protect-mcp 0.6.2 → 0.6.3

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.
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod2) => function __require() {
9
- return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
10
  };
11
11
  var __export = (target, all) => {
12
12
  for (var name in all)
@@ -20,15 +20,15 @@ var __copyProps = (to, from, except, desc) => {
20
20
  }
21
21
  return to;
22
22
  };
23
- var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
24
  // If the importer is in node compatibility mode or this is not an ESM
25
25
  // file that has been converted to a CommonJS file using a Babel-
26
26
  // compatible transform (i.e. "__esModule" has not been set), then set
27
27
  // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
29
- mod2
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
30
  ));
31
- var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
33
  // node_modules/zod/v3/helpers/util.cjs
34
34
  var require_util = __commonJS({
@@ -416,8 +416,8 @@ var require_en = __commonJS({
416
416
  var require_errors = __commonJS({
417
417
  "node_modules/zod/v3/errors.cjs"(exports2) {
418
418
  "use strict";
419
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
420
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
419
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
420
+ return mod && mod.__esModule ? mod : { "default": mod };
421
421
  };
422
422
  Object.defineProperty(exports2, "__esModule", { value: true });
423
423
  exports2.defaultErrorMap = void 0;
@@ -439,8 +439,8 @@ var require_errors = __commonJS({
439
439
  var require_parseUtil = __commonJS({
440
440
  "node_modules/zod/v3/helpers/parseUtil.cjs"(exports2) {
441
441
  "use strict";
442
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
443
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
442
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
443
+ return mod && mod.__esModule ? mod : { "default": mod };
444
444
  };
445
445
  Object.defineProperty(exports2, "__esModule", { value: true });
446
446
  exports2.isAsync = exports2.isValid = exports2.isDirty = exports2.isAborted = exports2.OK = exports2.DIRTY = exports2.INVALID = exports2.ParseStatus = exports2.EMPTY_PATH = exports2.makeIssue = void 0;
@@ -4182,13 +4182,13 @@ var require_v3 = __commonJS({
4182
4182
  }) : function(o, v) {
4183
4183
  o["default"] = v;
4184
4184
  });
4185
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
4186
- if (mod2 && mod2.__esModule) return mod2;
4185
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
4186
+ if (mod && mod.__esModule) return mod;
4187
4187
  var result = {};
4188
- if (mod2 != null) {
4189
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
4188
+ if (mod != null) {
4189
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4190
4190
  }
4191
- __setModuleDefault(result, mod2);
4191
+ __setModuleDefault(result, mod);
4192
4192
  return result;
4193
4193
  };
4194
4194
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
@@ -4987,13 +4987,13 @@ var require_errors2 = __commonJS({
4987
4987
  }) : function(o, v) {
4988
4988
  o["default"] = v;
4989
4989
  });
4990
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
4991
- if (mod2 && mod2.__esModule) return mod2;
4990
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
4991
+ if (mod && mod.__esModule) return mod;
4992
4992
  var result = {};
4993
- if (mod2 != null) {
4994
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
4993
+ if (mod != null) {
4994
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4995
4995
  }
4996
- __setModuleDefault(result, mod2);
4996
+ __setModuleDefault(result, mod);
4997
4997
  return result;
4998
4998
  };
4999
4999
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -5164,13 +5164,13 @@ var require_parse = __commonJS({
5164
5164
  }) : function(o, v) {
5165
5165
  o["default"] = v;
5166
5166
  });
5167
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
5168
- if (mod2 && mod2.__esModule) return mod2;
5167
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
5168
+ if (mod && mod.__esModule) return mod;
5169
5169
  var result = {};
5170
- if (mod2 != null) {
5171
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
5170
+ if (mod != null) {
5171
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5172
5172
  }
5173
- __setModuleDefault(result, mod2);
5173
+ __setModuleDefault(result, mod);
5174
5174
  return result;
5175
5175
  };
5176
5176
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -5301,13 +5301,13 @@ var require_regexes = __commonJS({
5301
5301
  }) : function(o, v) {
5302
5302
  o["default"] = v;
5303
5303
  });
5304
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
5305
- if (mod2 && mod2.__esModule) return mod2;
5304
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
5305
+ if (mod && mod.__esModule) return mod;
5306
5306
  var result = {};
5307
- if (mod2 != null) {
5308
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
5307
+ if (mod != null) {
5308
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5309
5309
  }
5310
- __setModuleDefault(result, mod2);
5310
+ __setModuleDefault(result, mod);
5311
5311
  return result;
5312
5312
  };
5313
5313
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -5441,13 +5441,13 @@ var require_checks = __commonJS({
5441
5441
  }) : function(o, v) {
5442
5442
  o["default"] = v;
5443
5443
  });
5444
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
5445
- if (mod2 && mod2.__esModule) return mod2;
5444
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
5445
+ if (mod && mod.__esModule) return mod;
5446
5446
  var result = {};
5447
- if (mod2 != null) {
5448
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
5447
+ if (mod != null) {
5448
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5449
5449
  }
5450
- __setModuleDefault(result, mod2);
5450
+ __setModuleDefault(result, mod);
5451
5451
  return result;
5452
5452
  };
5453
5453
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -6084,13 +6084,13 @@ var require_schemas = __commonJS({
6084
6084
  }) : function(o, v) {
6085
6085
  o["default"] = v;
6086
6086
  });
6087
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
6088
- if (mod2 && mod2.__esModule) return mod2;
6087
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
6088
+ if (mod && mod.__esModule) return mod;
6089
6089
  var result = {};
6090
- if (mod2 != null) {
6091
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
6090
+ if (mod != null) {
6091
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
6092
6092
  }
6093
- __setModuleDefault(result, mod2);
6093
+ __setModuleDefault(result, mod);
6094
6094
  return result;
6095
6095
  };
6096
6096
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -8104,13 +8104,13 @@ var require_ar = __commonJS({
8104
8104
  }) : function(o, v) {
8105
8105
  o["default"] = v;
8106
8106
  });
8107
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
8108
- if (mod2 && mod2.__esModule) return mod2;
8107
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
8108
+ if (mod && mod.__esModule) return mod;
8109
8109
  var result = {};
8110
- if (mod2 != null) {
8111
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
8110
+ if (mod != null) {
8111
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8112
8112
  }
8113
- __setModuleDefault(result, mod2);
8113
+ __setModuleDefault(result, mod);
8114
8114
  return result;
8115
8115
  };
8116
8116
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -8247,13 +8247,13 @@ var require_az = __commonJS({
8247
8247
  }) : function(o, v) {
8248
8248
  o["default"] = v;
8249
8249
  });
8250
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
8251
- if (mod2 && mod2.__esModule) return mod2;
8250
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
8251
+ if (mod && mod.__esModule) return mod;
8252
8252
  var result = {};
8253
- if (mod2 != null) {
8254
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
8253
+ if (mod != null) {
8254
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8255
8255
  }
8256
- __setModuleDefault(result, mod2);
8256
+ __setModuleDefault(result, mod);
8257
8257
  return result;
8258
8258
  };
8259
8259
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -8389,13 +8389,13 @@ var require_be = __commonJS({
8389
8389
  }) : function(o, v) {
8390
8390
  o["default"] = v;
8391
8391
  });
8392
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
8393
- if (mod2 && mod2.__esModule) return mod2;
8392
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
8393
+ if (mod && mod.__esModule) return mod;
8394
8394
  var result = {};
8395
- if (mod2 != null) {
8396
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
8395
+ if (mod != null) {
8396
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8397
8397
  }
8398
- __setModuleDefault(result, mod2);
8398
+ __setModuleDefault(result, mod);
8399
8399
  return result;
8400
8400
  };
8401
8401
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -8582,13 +8582,13 @@ var require_bg = __commonJS({
8582
8582
  }) : function(o, v) {
8583
8583
  o["default"] = v;
8584
8584
  });
8585
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
8586
- if (mod2 && mod2.__esModule) return mod2;
8585
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
8586
+ if (mod && mod.__esModule) return mod;
8587
8587
  var result = {};
8588
- if (mod2 != null) {
8589
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
8588
+ if (mod != null) {
8589
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8590
8590
  }
8591
- __setModuleDefault(result, mod2);
8591
+ __setModuleDefault(result, mod);
8592
8592
  return result;
8593
8593
  };
8594
8594
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -8739,13 +8739,13 @@ var require_ca = __commonJS({
8739
8739
  }) : function(o, v) {
8740
8740
  o["default"] = v;
8741
8741
  });
8742
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
8743
- if (mod2 && mod2.__esModule) return mod2;
8742
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
8743
+ if (mod && mod.__esModule) return mod;
8744
8744
  var result = {};
8745
- if (mod2 != null) {
8746
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
8745
+ if (mod != null) {
8746
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8747
8747
  }
8748
- __setModuleDefault(result, mod2);
8748
+ __setModuleDefault(result, mod);
8749
8749
  return result;
8750
8750
  };
8751
8751
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -8884,13 +8884,13 @@ var require_cs = __commonJS({
8884
8884
  }) : function(o, v) {
8885
8885
  o["default"] = v;
8886
8886
  });
8887
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
8888
- if (mod2 && mod2.__esModule) return mod2;
8887
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
8888
+ if (mod && mod.__esModule) return mod;
8889
8889
  var result = {};
8890
- if (mod2 != null) {
8891
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
8890
+ if (mod != null) {
8891
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8892
8892
  }
8893
- __setModuleDefault(result, mod2);
8893
+ __setModuleDefault(result, mod);
8894
8894
  return result;
8895
8895
  };
8896
8896
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9032,13 +9032,13 @@ var require_da = __commonJS({
9032
9032
  }) : function(o, v) {
9033
9033
  o["default"] = v;
9034
9034
  });
9035
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9036
- if (mod2 && mod2.__esModule) return mod2;
9035
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9036
+ if (mod && mod.__esModule) return mod;
9037
9037
  var result = {};
9038
- if (mod2 != null) {
9039
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9038
+ if (mod != null) {
9039
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9040
9040
  }
9041
- __setModuleDefault(result, mod2);
9041
+ __setModuleDefault(result, mod);
9042
9042
  return result;
9043
9043
  };
9044
9044
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9184,13 +9184,13 @@ var require_de = __commonJS({
9184
9184
  }) : function(o, v) {
9185
9185
  o["default"] = v;
9186
9186
  });
9187
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9188
- if (mod2 && mod2.__esModule) return mod2;
9187
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9188
+ if (mod && mod.__esModule) return mod;
9189
9189
  var result = {};
9190
- if (mod2 != null) {
9191
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9190
+ if (mod != null) {
9191
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9192
9192
  }
9193
- __setModuleDefault(result, mod2);
9193
+ __setModuleDefault(result, mod);
9194
9194
  return result;
9195
9195
  };
9196
9196
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9329,13 +9329,13 @@ var require_en2 = __commonJS({
9329
9329
  }) : function(o, v) {
9330
9330
  o["default"] = v;
9331
9331
  });
9332
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9333
- if (mod2 && mod2.__esModule) return mod2;
9332
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9333
+ if (mod && mod.__esModule) return mod;
9334
9334
  var result = {};
9335
- if (mod2 != null) {
9336
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9335
+ if (mod != null) {
9336
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9337
9337
  }
9338
- __setModuleDefault(result, mod2);
9338
+ __setModuleDefault(result, mod);
9339
9339
  return result;
9340
9340
  };
9341
9341
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9474,13 +9474,13 @@ var require_eo = __commonJS({
9474
9474
  }) : function(o, v) {
9475
9475
  o["default"] = v;
9476
9476
  });
9477
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9478
- if (mod2 && mod2.__esModule) return mod2;
9477
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9478
+ if (mod && mod.__esModule) return mod;
9479
9479
  var result = {};
9480
- if (mod2 != null) {
9481
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9480
+ if (mod != null) {
9481
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9482
9482
  }
9483
- __setModuleDefault(result, mod2);
9483
+ __setModuleDefault(result, mod);
9484
9484
  return result;
9485
9485
  };
9486
9486
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9620,13 +9620,13 @@ var require_es = __commonJS({
9620
9620
  }) : function(o, v) {
9621
9621
  o["default"] = v;
9622
9622
  });
9623
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9624
- if (mod2 && mod2.__esModule) return mod2;
9623
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9624
+ if (mod && mod.__esModule) return mod;
9625
9625
  var result = {};
9626
- if (mod2 != null) {
9627
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9626
+ if (mod != null) {
9627
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9628
9628
  }
9629
- __setModuleDefault(result, mod2);
9629
+ __setModuleDefault(result, mod);
9630
9630
  return result;
9631
9631
  };
9632
9632
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9789,13 +9789,13 @@ var require_fa = __commonJS({
9789
9789
  }) : function(o, v) {
9790
9790
  o["default"] = v;
9791
9791
  });
9792
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9793
- if (mod2 && mod2.__esModule) return mod2;
9792
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9793
+ if (mod && mod.__esModule) return mod;
9794
9794
  var result = {};
9795
- if (mod2 != null) {
9796
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9795
+ if (mod != null) {
9796
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9797
9797
  }
9798
- __setModuleDefault(result, mod2);
9798
+ __setModuleDefault(result, mod);
9799
9799
  return result;
9800
9800
  };
9801
9801
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9940,13 +9940,13 @@ var require_fi = __commonJS({
9940
9940
  }) : function(o, v) {
9941
9941
  o["default"] = v;
9942
9942
  });
9943
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
9944
- if (mod2 && mod2.__esModule) return mod2;
9943
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
9944
+ if (mod && mod.__esModule) return mod;
9945
9945
  var result = {};
9946
- if (mod2 != null) {
9947
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
9946
+ if (mod != null) {
9947
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
9948
9948
  }
9949
- __setModuleDefault(result, mod2);
9949
+ __setModuleDefault(result, mod);
9950
9950
  return result;
9951
9951
  };
9952
9952
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10089,13 +10089,13 @@ var require_fr = __commonJS({
10089
10089
  }) : function(o, v) {
10090
10090
  o["default"] = v;
10091
10091
  });
10092
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
10093
- if (mod2 && mod2.__esModule) return mod2;
10092
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
10093
+ if (mod && mod.__esModule) return mod;
10094
10094
  var result = {};
10095
- if (mod2 != null) {
10096
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
10095
+ if (mod != null) {
10096
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
10097
10097
  }
10098
- __setModuleDefault(result, mod2);
10098
+ __setModuleDefault(result, mod);
10099
10099
  return result;
10100
10100
  };
10101
10101
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10234,13 +10234,13 @@ var require_fr_CA = __commonJS({
10234
10234
  }) : function(o, v) {
10235
10235
  o["default"] = v;
10236
10236
  });
10237
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
10238
- if (mod2 && mod2.__esModule) return mod2;
10237
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
10238
+ if (mod && mod.__esModule) return mod;
10239
10239
  var result = {};
10240
- if (mod2 != null) {
10241
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
10240
+ if (mod != null) {
10241
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
10242
10242
  }
10243
- __setModuleDefault(result, mod2);
10243
+ __setModuleDefault(result, mod);
10244
10244
  return result;
10245
10245
  };
10246
10246
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10378,13 +10378,13 @@ var require_he = __commonJS({
10378
10378
  }) : function(o, v) {
10379
10379
  o["default"] = v;
10380
10380
  });
10381
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
10382
- if (mod2 && mod2.__esModule) return mod2;
10381
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
10382
+ if (mod && mod.__esModule) return mod;
10383
10383
  var result = {};
10384
- if (mod2 != null) {
10385
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
10384
+ if (mod != null) {
10385
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
10386
10386
  }
10387
- __setModuleDefault(result, mod2);
10387
+ __setModuleDefault(result, mod);
10388
10388
  return result;
10389
10389
  };
10390
10390
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10609,13 +10609,13 @@ var require_hu = __commonJS({
10609
10609
  }) : function(o, v) {
10610
10610
  o["default"] = v;
10611
10611
  });
10612
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
10613
- if (mod2 && mod2.__esModule) return mod2;
10612
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
10613
+ if (mod && mod.__esModule) return mod;
10614
10614
  var result = {};
10615
- if (mod2 != null) {
10616
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
10615
+ if (mod != null) {
10616
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
10617
10617
  }
10618
- __setModuleDefault(result, mod2);
10618
+ __setModuleDefault(result, mod);
10619
10619
  return result;
10620
10620
  };
10621
10621
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10754,13 +10754,13 @@ var require_hy = __commonJS({
10754
10754
  }) : function(o, v) {
10755
10755
  o["default"] = v;
10756
10756
  });
10757
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
10758
- if (mod2 && mod2.__esModule) return mod2;
10757
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
10758
+ if (mod && mod.__esModule) return mod;
10759
10759
  var result = {};
10760
- if (mod2 != null) {
10761
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
10760
+ if (mod != null) {
10761
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
10762
10762
  }
10763
- __setModuleDefault(result, mod2);
10763
+ __setModuleDefault(result, mod);
10764
10764
  return result;
10765
10765
  };
10766
10766
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10938,13 +10938,13 @@ var require_id = __commonJS({
10938
10938
  }) : function(o, v) {
10939
10939
  o["default"] = v;
10940
10940
  });
10941
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
10942
- if (mod2 && mod2.__esModule) return mod2;
10941
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
10942
+ if (mod && mod.__esModule) return mod;
10943
10943
  var result = {};
10944
- if (mod2 != null) {
10945
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
10944
+ if (mod != null) {
10945
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
10946
10946
  }
10947
- __setModuleDefault(result, mod2);
10947
+ __setModuleDefault(result, mod);
10948
10948
  return result;
10949
10949
  };
10950
10950
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11081,13 +11081,13 @@ var require_is = __commonJS({
11081
11081
  }) : function(o, v) {
11082
11082
  o["default"] = v;
11083
11083
  });
11084
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11085
- if (mod2 && mod2.__esModule) return mod2;
11084
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11085
+ if (mod && mod.__esModule) return mod;
11086
11086
  var result = {};
11087
- if (mod2 != null) {
11088
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11087
+ if (mod != null) {
11088
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11089
11089
  }
11090
- __setModuleDefault(result, mod2);
11090
+ __setModuleDefault(result, mod);
11091
11091
  return result;
11092
11092
  };
11093
11093
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11227,13 +11227,13 @@ var require_it = __commonJS({
11227
11227
  }) : function(o, v) {
11228
11228
  o["default"] = v;
11229
11229
  });
11230
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11231
- if (mod2 && mod2.__esModule) return mod2;
11230
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11231
+ if (mod && mod.__esModule) return mod;
11232
11232
  var result = {};
11233
- if (mod2 != null) {
11234
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11233
+ if (mod != null) {
11234
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11235
11235
  }
11236
- __setModuleDefault(result, mod2);
11236
+ __setModuleDefault(result, mod);
11237
11237
  return result;
11238
11238
  };
11239
11239
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11372,13 +11372,13 @@ var require_ja = __commonJS({
11372
11372
  }) : function(o, v) {
11373
11373
  o["default"] = v;
11374
11374
  });
11375
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11376
- if (mod2 && mod2.__esModule) return mod2;
11375
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11376
+ if (mod && mod.__esModule) return mod;
11377
11377
  var result = {};
11378
- if (mod2 != null) {
11379
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11378
+ if (mod != null) {
11379
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11380
11380
  }
11381
- __setModuleDefault(result, mod2);
11381
+ __setModuleDefault(result, mod);
11382
11382
  return result;
11383
11383
  };
11384
11384
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11516,13 +11516,13 @@ var require_ka = __commonJS({
11516
11516
  }) : function(o, v) {
11517
11517
  o["default"] = v;
11518
11518
  });
11519
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11520
- if (mod2 && mod2.__esModule) return mod2;
11519
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11520
+ if (mod && mod.__esModule) return mod;
11521
11521
  var result = {};
11522
- if (mod2 != null) {
11523
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11522
+ if (mod != null) {
11523
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11524
11524
  }
11525
- __setModuleDefault(result, mod2);
11525
+ __setModuleDefault(result, mod);
11526
11526
  return result;
11527
11527
  };
11528
11528
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11665,13 +11665,13 @@ var require_km = __commonJS({
11665
11665
  }) : function(o, v) {
11666
11666
  o["default"] = v;
11667
11667
  });
11668
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11669
- if (mod2 && mod2.__esModule) return mod2;
11668
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11669
+ if (mod && mod.__esModule) return mod;
11670
11670
  var result = {};
11671
- if (mod2 != null) {
11672
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11671
+ if (mod != null) {
11672
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11673
11673
  }
11674
- __setModuleDefault(result, mod2);
11674
+ __setModuleDefault(result, mod);
11675
11675
  return result;
11676
11676
  };
11677
11677
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11794,8 +11794,8 @@ var require_km = __commonJS({
11794
11794
  var require_kh = __commonJS({
11795
11795
  "node_modules/zod/v4/locales/kh.cjs"(exports2, module2) {
11796
11796
  "use strict";
11797
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
11798
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
11797
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
11798
+ return mod && mod.__esModule ? mod : { "default": mod };
11799
11799
  };
11800
11800
  Object.defineProperty(exports2, "__esModule", { value: true });
11801
11801
  exports2.default = default_1;
@@ -11829,13 +11829,13 @@ var require_ko = __commonJS({
11829
11829
  }) : function(o, v) {
11830
11830
  o["default"] = v;
11831
11831
  });
11832
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11833
- if (mod2 && mod2.__esModule) return mod2;
11832
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11833
+ if (mod && mod.__esModule) return mod;
11834
11834
  var result = {};
11835
- if (mod2 != null) {
11836
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11835
+ if (mod != null) {
11836
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11837
11837
  }
11838
- __setModuleDefault(result, mod2);
11838
+ __setModuleDefault(result, mod);
11839
11839
  return result;
11840
11840
  };
11841
11841
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -11977,13 +11977,13 @@ var require_lt = __commonJS({
11977
11977
  }) : function(o, v) {
11978
11978
  o["default"] = v;
11979
11979
  });
11980
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
11981
- if (mod2 && mod2.__esModule) return mod2;
11980
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
11981
+ if (mod && mod.__esModule) return mod;
11982
11982
  var result = {};
11983
- if (mod2 != null) {
11984
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
11983
+ if (mod != null) {
11984
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
11985
11985
  }
11986
- __setModuleDefault(result, mod2);
11986
+ __setModuleDefault(result, mod);
11987
11987
  return result;
11988
11988
  };
11989
11989
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12217,13 +12217,13 @@ var require_mk = __commonJS({
12217
12217
  }) : function(o, v) {
12218
12218
  o["default"] = v;
12219
12219
  });
12220
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
12221
- if (mod2 && mod2.__esModule) return mod2;
12220
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
12221
+ if (mod && mod.__esModule) return mod;
12222
12222
  var result = {};
12223
- if (mod2 != null) {
12224
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
12223
+ if (mod != null) {
12224
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12225
12225
  }
12226
- __setModuleDefault(result, mod2);
12226
+ __setModuleDefault(result, mod);
12227
12227
  return result;
12228
12228
  };
12229
12229
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12363,13 +12363,13 @@ var require_ms = __commonJS({
12363
12363
  }) : function(o, v) {
12364
12364
  o["default"] = v;
12365
12365
  });
12366
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
12367
- if (mod2 && mod2.__esModule) return mod2;
12366
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
12367
+ if (mod && mod.__esModule) return mod;
12368
12368
  var result = {};
12369
- if (mod2 != null) {
12370
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
12369
+ if (mod != null) {
12370
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12371
12371
  }
12372
- __setModuleDefault(result, mod2);
12372
+ __setModuleDefault(result, mod);
12373
12373
  return result;
12374
12374
  };
12375
12375
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12507,13 +12507,13 @@ var require_nl = __commonJS({
12507
12507
  }) : function(o, v) {
12508
12508
  o["default"] = v;
12509
12509
  });
12510
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
12511
- if (mod2 && mod2.__esModule) return mod2;
12510
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
12511
+ if (mod && mod.__esModule) return mod;
12512
12512
  var result = {};
12513
- if (mod2 != null) {
12514
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
12513
+ if (mod != null) {
12514
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12515
12515
  }
12516
- __setModuleDefault(result, mod2);
12516
+ __setModuleDefault(result, mod);
12517
12517
  return result;
12518
12518
  };
12519
12519
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12654,13 +12654,13 @@ var require_no = __commonJS({
12654
12654
  }) : function(o, v) {
12655
12655
  o["default"] = v;
12656
12656
  });
12657
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
12658
- if (mod2 && mod2.__esModule) return mod2;
12657
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
12658
+ if (mod && mod.__esModule) return mod;
12659
12659
  var result = {};
12660
- if (mod2 != null) {
12661
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
12660
+ if (mod != null) {
12661
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12662
12662
  }
12663
- __setModuleDefault(result, mod2);
12663
+ __setModuleDefault(result, mod);
12664
12664
  return result;
12665
12665
  };
12666
12666
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12799,13 +12799,13 @@ var require_ota = __commonJS({
12799
12799
  }) : function(o, v) {
12800
12800
  o["default"] = v;
12801
12801
  });
12802
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
12803
- if (mod2 && mod2.__esModule) return mod2;
12802
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
12803
+ if (mod && mod.__esModule) return mod;
12804
12804
  var result = {};
12805
- if (mod2 != null) {
12806
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
12805
+ if (mod != null) {
12806
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12807
12807
  }
12808
- __setModuleDefault(result, mod2);
12808
+ __setModuleDefault(result, mod);
12809
12809
  return result;
12810
12810
  };
12811
12811
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12945,13 +12945,13 @@ var require_ps = __commonJS({
12945
12945
  }) : function(o, v) {
12946
12946
  o["default"] = v;
12947
12947
  });
12948
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
12949
- if (mod2 && mod2.__esModule) return mod2;
12948
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
12949
+ if (mod && mod.__esModule) return mod;
12950
12950
  var result = {};
12951
- if (mod2 != null) {
12952
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
12951
+ if (mod != null) {
12952
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12953
12953
  }
12954
- __setModuleDefault(result, mod2);
12954
+ __setModuleDefault(result, mod);
12955
12955
  return result;
12956
12956
  };
12957
12957
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -13096,13 +13096,13 @@ var require_pl = __commonJS({
13096
13096
  }) : function(o, v) {
13097
13097
  o["default"] = v;
13098
13098
  });
13099
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
13100
- if (mod2 && mod2.__esModule) return mod2;
13099
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
13100
+ if (mod && mod.__esModule) return mod;
13101
13101
  var result = {};
13102
- if (mod2 != null) {
13103
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
13102
+ if (mod != null) {
13103
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13104
13104
  }
13105
- __setModuleDefault(result, mod2);
13105
+ __setModuleDefault(result, mod);
13106
13106
  return result;
13107
13107
  };
13108
13108
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -13242,13 +13242,13 @@ var require_pt = __commonJS({
13242
13242
  }) : function(o, v) {
13243
13243
  o["default"] = v;
13244
13244
  });
13245
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
13246
- if (mod2 && mod2.__esModule) return mod2;
13245
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
13246
+ if (mod && mod.__esModule) return mod;
13247
13247
  var result = {};
13248
- if (mod2 != null) {
13249
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
13248
+ if (mod != null) {
13249
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13250
13250
  }
13251
- __setModuleDefault(result, mod2);
13251
+ __setModuleDefault(result, mod);
13252
13252
  return result;
13253
13253
  };
13254
13254
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -13387,13 +13387,13 @@ var require_ru = __commonJS({
13387
13387
  }) : function(o, v) {
13388
13388
  o["default"] = v;
13389
13389
  });
13390
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
13391
- if (mod2 && mod2.__esModule) return mod2;
13390
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
13391
+ if (mod && mod.__esModule) return mod;
13392
13392
  var result = {};
13393
- if (mod2 != null) {
13394
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
13393
+ if (mod != null) {
13394
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13395
13395
  }
13396
- __setModuleDefault(result, mod2);
13396
+ __setModuleDefault(result, mod);
13397
13397
  return result;
13398
13398
  };
13399
13399
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -13580,13 +13580,13 @@ var require_sl = __commonJS({
13580
13580
  }) : function(o, v) {
13581
13581
  o["default"] = v;
13582
13582
  });
13583
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
13584
- if (mod2 && mod2.__esModule) return mod2;
13583
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
13584
+ if (mod && mod.__esModule) return mod;
13585
13585
  var result = {};
13586
- if (mod2 != null) {
13587
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
13586
+ if (mod != null) {
13587
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13588
13588
  }
13589
- __setModuleDefault(result, mod2);
13589
+ __setModuleDefault(result, mod);
13590
13590
  return result;
13591
13591
  };
13592
13592
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -13726,13 +13726,13 @@ var require_sv = __commonJS({
13726
13726
  }) : function(o, v) {
13727
13727
  o["default"] = v;
13728
13728
  });
13729
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
13730
- if (mod2 && mod2.__esModule) return mod2;
13729
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
13730
+ if (mod && mod.__esModule) return mod;
13731
13731
  var result = {};
13732
- if (mod2 != null) {
13733
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
13732
+ if (mod != null) {
13733
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13734
13734
  }
13735
- __setModuleDefault(result, mod2);
13735
+ __setModuleDefault(result, mod);
13736
13736
  return result;
13737
13737
  };
13738
13738
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -13873,13 +13873,13 @@ var require_ta = __commonJS({
13873
13873
  }) : function(o, v) {
13874
13874
  o["default"] = v;
13875
13875
  });
13876
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
13877
- if (mod2 && mod2.__esModule) return mod2;
13876
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
13877
+ if (mod && mod.__esModule) return mod;
13878
13878
  var result = {};
13879
- if (mod2 != null) {
13880
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
13879
+ if (mod != null) {
13880
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
13881
13881
  }
13882
- __setModuleDefault(result, mod2);
13882
+ __setModuleDefault(result, mod);
13883
13883
  return result;
13884
13884
  };
13885
13885
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14020,13 +14020,13 @@ var require_th = __commonJS({
14020
14020
  }) : function(o, v) {
14021
14021
  o["default"] = v;
14022
14022
  });
14023
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14024
- if (mod2 && mod2.__esModule) return mod2;
14023
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14024
+ if (mod && mod.__esModule) return mod;
14025
14025
  var result = {};
14026
- if (mod2 != null) {
14027
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14026
+ if (mod != null) {
14027
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14028
14028
  }
14029
- __setModuleDefault(result, mod2);
14029
+ __setModuleDefault(result, mod);
14030
14030
  return result;
14031
14031
  };
14032
14032
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14167,13 +14167,13 @@ var require_tr = __commonJS({
14167
14167
  }) : function(o, v) {
14168
14168
  o["default"] = v;
14169
14169
  });
14170
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14171
- if (mod2 && mod2.__esModule) return mod2;
14170
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14171
+ if (mod && mod.__esModule) return mod;
14172
14172
  var result = {};
14173
- if (mod2 != null) {
14174
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14173
+ if (mod != null) {
14174
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14175
14175
  }
14176
- __setModuleDefault(result, mod2);
14176
+ __setModuleDefault(result, mod);
14177
14177
  return result;
14178
14178
  };
14179
14179
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14309,13 +14309,13 @@ var require_uk = __commonJS({
14309
14309
  }) : function(o, v) {
14310
14310
  o["default"] = v;
14311
14311
  });
14312
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14313
- if (mod2 && mod2.__esModule) return mod2;
14312
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14313
+ if (mod && mod.__esModule) return mod;
14314
14314
  var result = {};
14315
- if (mod2 != null) {
14316
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14315
+ if (mod != null) {
14316
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14317
14317
  }
14318
- __setModuleDefault(result, mod2);
14318
+ __setModuleDefault(result, mod);
14319
14319
  return result;
14320
14320
  };
14321
14321
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14436,8 +14436,8 @@ var require_uk = __commonJS({
14436
14436
  var require_ua = __commonJS({
14437
14437
  "node_modules/zod/v4/locales/ua.cjs"(exports2, module2) {
14438
14438
  "use strict";
14439
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
14440
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
14439
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
14440
+ return mod && mod.__esModule ? mod : { "default": mod };
14441
14441
  };
14442
14442
  Object.defineProperty(exports2, "__esModule", { value: true });
14443
14443
  exports2.default = default_1;
@@ -14471,13 +14471,13 @@ var require_ur = __commonJS({
14471
14471
  }) : function(o, v) {
14472
14472
  o["default"] = v;
14473
14473
  });
14474
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14475
- if (mod2 && mod2.__esModule) return mod2;
14474
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14475
+ if (mod && mod.__esModule) return mod;
14476
14476
  var result = {};
14477
- if (mod2 != null) {
14478
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14477
+ if (mod != null) {
14478
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14479
14479
  }
14480
- __setModuleDefault(result, mod2);
14480
+ __setModuleDefault(result, mod);
14481
14481
  return result;
14482
14482
  };
14483
14483
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14618,13 +14618,13 @@ var require_uz = __commonJS({
14618
14618
  }) : function(o, v) {
14619
14619
  o["default"] = v;
14620
14620
  });
14621
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14622
- if (mod2 && mod2.__esModule) return mod2;
14621
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14622
+ if (mod && mod.__esModule) return mod;
14623
14623
  var result = {};
14624
- if (mod2 != null) {
14625
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14624
+ if (mod != null) {
14625
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14626
14626
  }
14627
- __setModuleDefault(result, mod2);
14627
+ __setModuleDefault(result, mod);
14628
14628
  return result;
14629
14629
  };
14630
14630
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14764,13 +14764,13 @@ var require_vi = __commonJS({
14764
14764
  }) : function(o, v) {
14765
14765
  o["default"] = v;
14766
14766
  });
14767
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14768
- if (mod2 && mod2.__esModule) return mod2;
14767
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14768
+ if (mod && mod.__esModule) return mod;
14769
14769
  var result = {};
14770
- if (mod2 != null) {
14771
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14770
+ if (mod != null) {
14771
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14772
14772
  }
14773
- __setModuleDefault(result, mod2);
14773
+ __setModuleDefault(result, mod);
14774
14774
  return result;
14775
14775
  };
14776
14776
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -14909,13 +14909,13 @@ var require_zh_CN = __commonJS({
14909
14909
  }) : function(o, v) {
14910
14910
  o["default"] = v;
14911
14911
  });
14912
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
14913
- if (mod2 && mod2.__esModule) return mod2;
14912
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
14913
+ if (mod && mod.__esModule) return mod;
14914
14914
  var result = {};
14915
- if (mod2 != null) {
14916
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
14915
+ if (mod != null) {
14916
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
14917
14917
  }
14918
- __setModuleDefault(result, mod2);
14918
+ __setModuleDefault(result, mod);
14919
14919
  return result;
14920
14920
  };
14921
14921
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -15055,13 +15055,13 @@ var require_zh_TW = __commonJS({
15055
15055
  }) : function(o, v) {
15056
15056
  o["default"] = v;
15057
15057
  });
15058
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
15059
- if (mod2 && mod2.__esModule) return mod2;
15058
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
15059
+ if (mod && mod.__esModule) return mod;
15060
15060
  var result = {};
15061
- if (mod2 != null) {
15062
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
15061
+ if (mod != null) {
15062
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15063
15063
  }
15064
- __setModuleDefault(result, mod2);
15064
+ __setModuleDefault(result, mod);
15065
15065
  return result;
15066
15066
  };
15067
15067
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -15199,13 +15199,13 @@ var require_yo = __commonJS({
15199
15199
  }) : function(o, v) {
15200
15200
  o["default"] = v;
15201
15201
  });
15202
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
15203
- if (mod2 && mod2.__esModule) return mod2;
15202
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
15203
+ if (mod && mod.__esModule) return mod;
15204
15204
  var result = {};
15205
- if (mod2 != null) {
15206
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
15205
+ if (mod != null) {
15206
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15207
15207
  }
15208
- __setModuleDefault(result, mod2);
15208
+ __setModuleDefault(result, mod);
15209
15209
  return result;
15210
15210
  };
15211
15211
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -15325,8 +15325,8 @@ var require_yo = __commonJS({
15325
15325
  var require_locales = __commonJS({
15326
15326
  "node_modules/zod/v4/locales/index.cjs"(exports2) {
15327
15327
  "use strict";
15328
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
15329
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
15328
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
15329
+ return mod && mod.__esModule ? mod : { "default": mod };
15330
15330
  };
15331
15331
  Object.defineProperty(exports2, "__esModule", { value: true });
15332
15332
  exports2.yo = exports2.zhTW = exports2.zhCN = exports2.vi = exports2.uz = exports2.ur = exports2.uk = exports2.ua = exports2.tr = exports2.th = exports2.ta = exports2.sv = exports2.sl = exports2.ru = exports2.pt = exports2.pl = exports2.ps = exports2.ota = exports2.no = exports2.nl = exports2.ms = exports2.mk = exports2.lt = exports2.ko = exports2.km = exports2.kh = exports2.ka = exports2.ja = exports2.it = exports2.is = exports2.id = exports2.hy = exports2.hu = exports2.he = exports2.frCA = exports2.fr = exports2.fi = exports2.fa = exports2.es = exports2.eo = exports2.en = exports2.de = exports2.da = exports2.cs = exports2.ca = exports2.bg = exports2.be = exports2.az = exports2.ar = void 0;
@@ -15610,13 +15610,13 @@ var require_api = __commonJS({
15610
15610
  }) : function(o, v) {
15611
15611
  o["default"] = v;
15612
15612
  });
15613
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
15614
- if (mod2 && mod2.__esModule) return mod2;
15613
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
15614
+ if (mod && mod.__esModule) return mod;
15615
15615
  var result = {};
15616
- if (mod2 != null) {
15617
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
15616
+ if (mod != null) {
15617
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
15618
15618
  }
15619
- __setModuleDefault(result, mod2);
15619
+ __setModuleDefault(result, mod);
15620
15620
  return result;
15621
15621
  };
15622
15622
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -17869,13 +17869,13 @@ var require_core2 = __commonJS({
17869
17869
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
17870
17870
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
17871
17871
  };
17872
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
17873
- if (mod2 && mod2.__esModule) return mod2;
17872
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
17873
+ if (mod && mod.__esModule) return mod;
17874
17874
  var result = {};
17875
- if (mod2 != null) {
17876
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
17875
+ if (mod != null) {
17876
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17877
17877
  }
17878
- __setModuleDefault(result, mod2);
17878
+ __setModuleDefault(result, mod);
17879
17879
  return result;
17880
17880
  };
17881
17881
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -17973,13 +17973,13 @@ var require_schemas2 = __commonJS({
17973
17973
  }) : function(o, v) {
17974
17974
  o["default"] = v;
17975
17975
  });
17976
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
17977
- if (mod2 && mod2.__esModule) return mod2;
17976
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
17977
+ if (mod && mod.__esModule) return mod;
17978
17978
  var result = {};
17979
- if (mod2 != null) {
17980
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
17979
+ if (mod != null) {
17980
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17981
17981
  }
17982
- __setModuleDefault(result, mod2);
17982
+ __setModuleDefault(result, mod);
17983
17983
  return result;
17984
17984
  };
17985
17985
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19088,13 +19088,13 @@ var require_iso = __commonJS({
19088
19088
  }) : function(o, v) {
19089
19089
  o["default"] = v;
19090
19090
  });
19091
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19092
- if (mod2 && mod2.__esModule) return mod2;
19091
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19092
+ if (mod && mod.__esModule) return mod;
19093
19093
  var result = {};
19094
- if (mod2 != null) {
19095
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19094
+ if (mod != null) {
19095
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19096
19096
  }
19097
- __setModuleDefault(result, mod2);
19097
+ __setModuleDefault(result, mod);
19098
19098
  return result;
19099
19099
  };
19100
19100
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19162,13 +19162,13 @@ var require_coerce = __commonJS({
19162
19162
  }) : function(o, v) {
19163
19163
  o["default"] = v;
19164
19164
  });
19165
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19166
- if (mod2 && mod2.__esModule) return mod2;
19165
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19166
+ if (mod && mod.__esModule) return mod;
19167
19167
  var result = {};
19168
- if (mod2 != null) {
19169
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19168
+ if (mod != null) {
19169
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19170
19170
  }
19171
- __setModuleDefault(result, mod2);
19171
+ __setModuleDefault(result, mod);
19172
19172
  return result;
19173
19173
  };
19174
19174
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19224,13 +19224,13 @@ var require_external2 = __commonJS({
19224
19224
  }) : function(o, v) {
19225
19225
  o["default"] = v;
19226
19226
  });
19227
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19228
- if (mod2 && mod2.__esModule) return mod2;
19227
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19228
+ if (mod && mod.__esModule) return mod;
19229
19229
  var result = {};
19230
- if (mod2 != null) {
19231
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19230
+ if (mod != null) {
19231
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19232
19232
  }
19233
- __setModuleDefault(result, mod2);
19233
+ __setModuleDefault(result, mod);
19234
19234
  return result;
19235
19235
  };
19236
19236
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
@@ -19333,13 +19333,13 @@ var require_v4_mini = __commonJS({
19333
19333
  }) : function(o, v) {
19334
19334
  o["default"] = v;
19335
19335
  });
19336
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19337
- if (mod2 && mod2.__esModule) return mod2;
19336
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19337
+ if (mod && mod.__esModule) return mod;
19338
19338
  var result = {};
19339
- if (mod2 != null) {
19340
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19339
+ if (mod != null) {
19340
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19341
19341
  }
19342
- __setModuleDefault(result, mod2);
19342
+ __setModuleDefault(result, mod);
19343
19343
  return result;
19344
19344
  };
19345
19345
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
@@ -19375,13 +19375,13 @@ var require_zod_compat = __commonJS({
19375
19375
  }) : function(o, v) {
19376
19376
  o["default"] = v;
19377
19377
  });
19378
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19379
- if (mod2 && mod2.__esModule) return mod2;
19378
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19379
+ if (mod && mod.__esModule) return mod;
19380
19380
  var result = {};
19381
- if (mod2 != null) {
19382
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19381
+ if (mod != null) {
19382
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19383
19383
  }
19384
- __setModuleDefault(result, mod2);
19384
+ __setModuleDefault(result, mod);
19385
19385
  return result;
19386
19386
  };
19387
19387
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19661,13 +19661,13 @@ var require_iso2 = __commonJS({
19661
19661
  }) : function(o, v) {
19662
19662
  o["default"] = v;
19663
19663
  });
19664
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19665
- if (mod2 && mod2.__esModule) return mod2;
19664
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19665
+ if (mod && mod.__esModule) return mod;
19666
19666
  var result = {};
19667
- if (mod2 != null) {
19668
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19667
+ if (mod != null) {
19668
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19669
19669
  }
19670
- __setModuleDefault(result, mod2);
19670
+ __setModuleDefault(result, mod);
19671
19671
  return result;
19672
19672
  };
19673
19673
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19731,13 +19731,13 @@ var require_errors3 = __commonJS({
19731
19731
  }) : function(o, v) {
19732
19732
  o["default"] = v;
19733
19733
  });
19734
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19735
- if (mod2 && mod2.__esModule) return mod2;
19734
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19735
+ if (mod && mod.__esModule) return mod;
19736
19736
  var result = {};
19737
- if (mod2 != null) {
19738
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19737
+ if (mod != null) {
19738
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19739
19739
  }
19740
- __setModuleDefault(result, mod2);
19740
+ __setModuleDefault(result, mod);
19741
19741
  return result;
19742
19742
  };
19743
19743
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19808,13 +19808,13 @@ var require_parse3 = __commonJS({
19808
19808
  }) : function(o, v) {
19809
19809
  o["default"] = v;
19810
19810
  });
19811
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19812
- if (mod2 && mod2.__esModule) return mod2;
19811
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19812
+ if (mod && mod.__esModule) return mod;
19813
19813
  var result = {};
19814
- if (mod2 != null) {
19815
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19814
+ if (mod != null) {
19815
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19816
19816
  }
19817
- __setModuleDefault(result, mod2);
19817
+ __setModuleDefault(result, mod);
19818
19818
  return result;
19819
19819
  };
19820
19820
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -19858,13 +19858,13 @@ var require_schemas3 = __commonJS({
19858
19858
  }) : function(o, v) {
19859
19859
  o["default"] = v;
19860
19860
  });
19861
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
19862
- if (mod2 && mod2.__esModule) return mod2;
19861
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
19862
+ if (mod && mod.__esModule) return mod;
19863
19863
  var result = {};
19864
- if (mod2 != null) {
19865
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
19864
+ if (mod != null) {
19865
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
19866
19866
  }
19867
- __setModuleDefault(result, mod2);
19867
+ __setModuleDefault(result, mod);
19868
19868
  return result;
19869
19869
  };
19870
19870
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -21074,13 +21074,13 @@ var require_compat = __commonJS({
21074
21074
  }) : function(o, v) {
21075
21075
  o["default"] = v;
21076
21076
  });
21077
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
21078
- if (mod2 && mod2.__esModule) return mod2;
21077
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
21078
+ if (mod && mod.__esModule) return mod;
21079
21079
  var result = {};
21080
- if (mod2 != null) {
21081
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
21080
+ if (mod != null) {
21081
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21082
21082
  }
21083
- __setModuleDefault(result, mod2);
21083
+ __setModuleDefault(result, mod);
21084
21084
  return result;
21085
21085
  };
21086
21086
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -21144,13 +21144,13 @@ var require_from_json_schema = __commonJS({
21144
21144
  }) : function(o, v) {
21145
21145
  o["default"] = v;
21146
21146
  });
21147
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
21148
- if (mod2 && mod2.__esModule) return mod2;
21147
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
21148
+ if (mod && mod.__esModule) return mod;
21149
21149
  var result = {};
21150
- if (mod2 != null) {
21151
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
21150
+ if (mod != null) {
21151
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21152
21152
  }
21153
- __setModuleDefault(result, mod2);
21153
+ __setModuleDefault(result, mod);
21154
21154
  return result;
21155
21155
  };
21156
21156
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -21656,13 +21656,13 @@ var require_coerce2 = __commonJS({
21656
21656
  }) : function(o, v) {
21657
21657
  o["default"] = v;
21658
21658
  });
21659
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
21660
- if (mod2 && mod2.__esModule) return mod2;
21659
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
21660
+ if (mod && mod.__esModule) return mod;
21661
21661
  var result = {};
21662
- if (mod2 != null) {
21663
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
21662
+ if (mod != null) {
21663
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21664
21664
  }
21665
- __setModuleDefault(result, mod2);
21665
+ __setModuleDefault(result, mod);
21666
21666
  return result;
21667
21667
  };
21668
21668
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -21713,20 +21713,20 @@ var require_external3 = __commonJS({
21713
21713
  }) : function(o, v) {
21714
21714
  o["default"] = v;
21715
21715
  });
21716
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
21717
- if (mod2 && mod2.__esModule) return mod2;
21716
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
21717
+ if (mod && mod.__esModule) return mod;
21718
21718
  var result = {};
21719
- if (mod2 != null) {
21720
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
21719
+ if (mod != null) {
21720
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21721
21721
  }
21722
- __setModuleDefault(result, mod2);
21722
+ __setModuleDefault(result, mod);
21723
21723
  return result;
21724
21724
  };
21725
21725
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
21726
21726
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
21727
21727
  };
21728
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
21729
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
21728
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
21729
+ return mod && mod.__esModule ? mod : { "default": mod };
21730
21730
  };
21731
21731
  Object.defineProperty(exports2, "__esModule", { value: true });
21732
21732
  exports2.coerce = exports2.iso = exports2.ZodISODuration = exports2.ZodISOTime = exports2.ZodISODate = exports2.ZodISODateTime = exports2.locales = exports2.fromJSONSchema = exports2.toJSONSchema = exports2.NEVER = exports2.util = exports2.TimePrecision = exports2.flattenError = exports2.formatError = exports2.prettifyError = exports2.treeifyError = exports2.regexes = exports2.clone = exports2.$brand = exports2.$input = exports2.$output = exports2.config = exports2.registry = exports2.globalRegistry = exports2.core = void 0;
@@ -21834,13 +21834,13 @@ var require_classic = __commonJS({
21834
21834
  }) : function(o, v) {
21835
21835
  o["default"] = v;
21836
21836
  });
21837
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
21838
- if (mod2 && mod2.__esModule) return mod2;
21837
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
21838
+ if (mod && mod.__esModule) return mod;
21839
21839
  var result = {};
21840
- if (mod2 != null) {
21841
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
21840
+ if (mod != null) {
21841
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21842
21842
  }
21843
- __setModuleDefault(result, mod2);
21843
+ __setModuleDefault(result, mod);
21844
21844
  return result;
21845
21845
  };
21846
21846
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
@@ -21875,8 +21875,8 @@ var require_v4 = __commonJS({
21875
21875
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
21876
21876
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
21877
21877
  };
21878
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
21879
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
21878
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
21879
+ return mod && mod.__esModule ? mod : { "default": mod };
21880
21880
  };
21881
21881
  Object.defineProperty(exports2, "__esModule", { value: true });
21882
21882
  var index_js_1 = __importDefault(require_classic());
@@ -21907,13 +21907,13 @@ var require_types2 = __commonJS({
21907
21907
  }) : function(o, v) {
21908
21908
  o["default"] = v;
21909
21909
  });
21910
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
21911
- if (mod2 && mod2.__esModule) return mod2;
21910
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
21911
+ if (mod && mod.__esModule) return mod;
21912
21912
  var result = {};
21913
- if (mod2 != null) {
21914
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
21913
+ if (mod != null) {
21914
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21915
21915
  }
21916
- __setModuleDefault(result, mod2);
21916
+ __setModuleDefault(result, mod);
21917
21917
  return result;
21918
21918
  };
21919
21919
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -25248,13 +25248,13 @@ var require_zod_json_schema_compat = __commonJS({
25248
25248
  }) : function(o, v) {
25249
25249
  o["default"] = v;
25250
25250
  });
25251
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
25252
- if (mod2 && mod2.__esModule) return mod2;
25251
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
25252
+ if (mod && mod.__esModule) return mod;
25253
25253
  var result = {};
25254
- if (mod2 != null) {
25255
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
25254
+ if (mod != null) {
25255
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25256
25256
  }
25257
- __setModuleDefault(result, mod2);
25257
+ __setModuleDefault(result, mod);
25258
25258
  return result;
25259
25259
  };
25260
25260
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -33047,8 +33047,8 @@ var require_dist = __commonJS({
33047
33047
  var require_ajv_provider = __commonJS({
33048
33048
  "node_modules/@modelcontextprotocol/sdk/dist/cjs/validation/ajv-provider.js"(exports2) {
33049
33049
  "use strict";
33050
- var __importDefault = exports2 && exports2.__importDefault || function(mod2) {
33051
- return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
33050
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
33051
+ return mod && mod.__esModule ? mod : { "default": mod };
33052
33052
  };
33053
33053
  Object.defineProperty(exports2, "__esModule", { value: true });
33054
33054
  exports2.AjvJsonSchemaValidator = void 0;
@@ -34160,13 +34160,13 @@ var require_zod = __commonJS({
34160
34160
  }) : function(o, v) {
34161
34161
  o["default"] = v;
34162
34162
  });
34163
- var __importStar = exports2 && exports2.__importStar || function(mod2) {
34164
- if (mod2 && mod2.__esModule) return mod2;
34163
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
34164
+ if (mod && mod.__esModule) return mod;
34165
34165
  var result = {};
34166
- if (mod2 != null) {
34167
- for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding(result, mod2, k);
34166
+ if (mod != null) {
34167
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
34168
34168
  }
34169
- __setModuleDefault(result, mod2);
34169
+ __setModuleDefault(result, mod);
34170
34170
  return result;
34171
34171
  };
34172
34172
  var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
@@ -36844,2145 +36844,28 @@ var ProtectGateway = class {
36844
36844
  }
36845
36845
  };
36846
36846
 
36847
- // node_modules/@noble/hashes/esm/cryptoNode.js
36848
- var nc = __toESM(require("crypto"), 1);
36849
- var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
36850
-
36851
- // node_modules/@noble/hashes/esm/utils.js
36852
- function isBytes(a) {
36853
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
36854
- }
36855
- function anumber(n) {
36856
- if (!Number.isSafeInteger(n) || n < 0)
36857
- throw new Error("positive integer expected, got " + n);
36858
- }
36859
- function abytes(b, ...lengths) {
36860
- if (!isBytes(b))
36861
- throw new Error("Uint8Array expected");
36862
- if (lengths.length > 0 && !lengths.includes(b.length))
36863
- throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
36864
- }
36865
- function aexists(instance, checkFinished = true) {
36866
- if (instance.destroyed)
36867
- throw new Error("Hash instance has been destroyed");
36868
- if (checkFinished && instance.finished)
36869
- throw new Error("Hash#digest() has already been called");
36870
- }
36871
- function aoutput(out, instance) {
36872
- abytes(out);
36873
- const min = instance.outputLen;
36874
- if (out.length < min) {
36875
- throw new Error("digestInto() expects output buffer of length at least " + min);
36876
- }
36877
- }
36878
- function clean(...arrays) {
36879
- for (let i = 0; i < arrays.length; i++) {
36880
- arrays[i].fill(0);
36881
- }
36882
- }
36883
- function createView(arr) {
36884
- return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
36885
- }
36886
- function rotr(word, shift) {
36887
- return word << 32 - shift | word >>> shift;
36888
- }
36889
- var hasHexBuiltin = /* @__PURE__ */ (() => (
36890
- // @ts-ignore
36891
- typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
36892
- ))();
36893
- var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
36894
- function bytesToHex(bytes) {
36895
- abytes(bytes);
36896
- if (hasHexBuiltin)
36897
- return bytes.toHex();
36898
- let hex = "";
36899
- for (let i = 0; i < bytes.length; i++) {
36900
- hex += hexes[bytes[i]];
36901
- }
36902
- return hex;
36903
- }
36904
- var asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
36905
- function asciiToBase16(ch) {
36906
- if (ch >= asciis._0 && ch <= asciis._9)
36907
- return ch - asciis._0;
36908
- if (ch >= asciis.A && ch <= asciis.F)
36909
- return ch - (asciis.A - 10);
36910
- if (ch >= asciis.a && ch <= asciis.f)
36911
- return ch - (asciis.a - 10);
36912
- return;
36913
- }
36914
- function hexToBytes(hex) {
36915
- if (typeof hex !== "string")
36916
- throw new Error("hex string expected, got " + typeof hex);
36917
- if (hasHexBuiltin)
36918
- return Uint8Array.fromHex(hex);
36919
- const hl = hex.length;
36920
- const al = hl / 2;
36921
- if (hl % 2)
36922
- throw new Error("hex string expected, got unpadded hex of length " + hl);
36923
- const array = new Uint8Array(al);
36924
- for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
36925
- const n1 = asciiToBase16(hex.charCodeAt(hi));
36926
- const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
36927
- if (n1 === void 0 || n2 === void 0) {
36928
- const char = hex[hi] + hex[hi + 1];
36929
- throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
36930
- }
36931
- array[ai] = n1 * 16 + n2;
36932
- }
36933
- return array;
36934
- }
36935
- function utf8ToBytes(str) {
36936
- if (typeof str !== "string")
36937
- throw new Error("string expected");
36938
- return new Uint8Array(new TextEncoder().encode(str));
36939
- }
36940
- function toBytes(data) {
36941
- if (typeof data === "string")
36942
- data = utf8ToBytes(data);
36943
- abytes(data);
36944
- return data;
36945
- }
36946
- function concatBytes(...arrays) {
36947
- let sum = 0;
36948
- for (let i = 0; i < arrays.length; i++) {
36949
- const a = arrays[i];
36950
- abytes(a);
36951
- sum += a.length;
36952
- }
36953
- const res = new Uint8Array(sum);
36954
- for (let i = 0, pad = 0; i < arrays.length; i++) {
36955
- const a = arrays[i];
36956
- res.set(a, pad);
36957
- pad += a.length;
36958
- }
36959
- return res;
36960
- }
36961
- var Hash = class {
36962
- };
36963
- function createHasher(hashCons) {
36964
- const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
36965
- const tmp = hashCons();
36966
- hashC.outputLen = tmp.outputLen;
36967
- hashC.blockLen = tmp.blockLen;
36968
- hashC.create = () => hashCons();
36969
- return hashC;
36970
- }
36971
- function randomBytes2(bytesLength = 32) {
36972
- if (crypto && typeof crypto.getRandomValues === "function") {
36973
- return crypto.getRandomValues(new Uint8Array(bytesLength));
36974
- }
36975
- if (crypto && typeof crypto.randomBytes === "function") {
36976
- return Uint8Array.from(crypto.randomBytes(bytesLength));
36977
- }
36978
- throw new Error("crypto.getRandomValues must be defined");
36979
- }
36980
-
36981
- // node_modules/@noble/hashes/esm/_md.js
36982
- function setBigUint64(view, byteOffset, value, isLE) {
36983
- if (typeof view.setBigUint64 === "function")
36984
- return view.setBigUint64(byteOffset, value, isLE);
36985
- const _32n2 = BigInt(32);
36986
- const _u32_max = BigInt(4294967295);
36987
- const wh = Number(value >> _32n2 & _u32_max);
36988
- const wl = Number(value & _u32_max);
36989
- const h = isLE ? 4 : 0;
36990
- const l = isLE ? 0 : 4;
36991
- view.setUint32(byteOffset + h, wh, isLE);
36992
- view.setUint32(byteOffset + l, wl, isLE);
36993
- }
36994
- function Chi(a, b, c) {
36995
- return a & b ^ ~a & c;
36996
- }
36997
- function Maj(a, b, c) {
36998
- return a & b ^ a & c ^ b & c;
36999
- }
37000
- var HashMD = class extends Hash {
37001
- constructor(blockLen, outputLen, padOffset, isLE) {
37002
- super();
37003
- this.finished = false;
37004
- this.length = 0;
37005
- this.pos = 0;
37006
- this.destroyed = false;
37007
- this.blockLen = blockLen;
37008
- this.outputLen = outputLen;
37009
- this.padOffset = padOffset;
37010
- this.isLE = isLE;
37011
- this.buffer = new Uint8Array(blockLen);
37012
- this.view = createView(this.buffer);
37013
- }
37014
- update(data) {
37015
- aexists(this);
37016
- data = toBytes(data);
37017
- abytes(data);
37018
- const { view, buffer, blockLen } = this;
37019
- const len = data.length;
37020
- for (let pos = 0; pos < len; ) {
37021
- const take = Math.min(blockLen - this.pos, len - pos);
37022
- if (take === blockLen) {
37023
- const dataView = createView(data);
37024
- for (; blockLen <= len - pos; pos += blockLen)
37025
- this.process(dataView, pos);
37026
- continue;
37027
- }
37028
- buffer.set(data.subarray(pos, pos + take), this.pos);
37029
- this.pos += take;
37030
- pos += take;
37031
- if (this.pos === blockLen) {
37032
- this.process(view, 0);
37033
- this.pos = 0;
37034
- }
37035
- }
37036
- this.length += data.length;
37037
- this.roundClean();
37038
- return this;
37039
- }
37040
- digestInto(out) {
37041
- aexists(this);
37042
- aoutput(out, this);
37043
- this.finished = true;
37044
- const { buffer, view, blockLen, isLE } = this;
37045
- let { pos } = this;
37046
- buffer[pos++] = 128;
37047
- clean(this.buffer.subarray(pos));
37048
- if (this.padOffset > blockLen - pos) {
37049
- this.process(view, 0);
37050
- pos = 0;
37051
- }
37052
- for (let i = pos; i < blockLen; i++)
37053
- buffer[i] = 0;
37054
- setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
37055
- this.process(view, 0);
37056
- const oview = createView(out);
37057
- const len = this.outputLen;
37058
- if (len % 4)
37059
- throw new Error("_sha2: outputLen should be aligned to 32bit");
37060
- const outLen = len / 4;
37061
- const state = this.get();
37062
- if (outLen > state.length)
37063
- throw new Error("_sha2: outputLen bigger than state");
37064
- for (let i = 0; i < outLen; i++)
37065
- oview.setUint32(4 * i, state[i], isLE);
37066
- }
37067
- digest() {
37068
- const { buffer, outputLen } = this;
37069
- this.digestInto(buffer);
37070
- const res = buffer.slice(0, outputLen);
37071
- this.destroy();
37072
- return res;
37073
- }
37074
- _cloneInto(to) {
37075
- to || (to = new this.constructor());
37076
- to.set(...this.get());
37077
- const { blockLen, buffer, length, finished, destroyed, pos } = this;
37078
- to.destroyed = destroyed;
37079
- to.finished = finished;
37080
- to.length = length;
37081
- to.pos = pos;
37082
- if (length % blockLen)
37083
- to.buffer.set(buffer);
37084
- return to;
37085
- }
37086
- clone() {
37087
- return this._cloneInto();
37088
- }
37089
- };
37090
- var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
37091
- 1779033703,
37092
- 3144134277,
37093
- 1013904242,
37094
- 2773480762,
37095
- 1359893119,
37096
- 2600822924,
37097
- 528734635,
37098
- 1541459225
37099
- ]);
37100
- var SHA512_IV = /* @__PURE__ */ Uint32Array.from([
37101
- 1779033703,
37102
- 4089235720,
37103
- 3144134277,
37104
- 2227873595,
37105
- 1013904242,
37106
- 4271175723,
37107
- 2773480762,
37108
- 1595750129,
37109
- 1359893119,
37110
- 2917565137,
37111
- 2600822924,
37112
- 725511199,
37113
- 528734635,
37114
- 4215389547,
37115
- 1541459225,
37116
- 327033209
37117
- ]);
37118
-
37119
- // node_modules/@noble/hashes/esm/_u64.js
37120
- var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
37121
- var _32n = /* @__PURE__ */ BigInt(32);
37122
- function fromBig(n, le = false) {
37123
- if (le)
37124
- return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
37125
- return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
37126
- }
37127
- function split(lst, le = false) {
37128
- const len = lst.length;
37129
- let Ah = new Uint32Array(len);
37130
- let Al = new Uint32Array(len);
37131
- for (let i = 0; i < len; i++) {
37132
- const { h, l } = fromBig(lst[i], le);
37133
- [Ah[i], Al[i]] = [h, l];
37134
- }
37135
- return [Ah, Al];
37136
- }
37137
- var shrSH = (h, _l, s) => h >>> s;
37138
- var shrSL = (h, l, s) => h << 32 - s | l >>> s;
37139
- var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
37140
- var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
37141
- var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
37142
- var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
37143
- function add(Ah, Al, Bh, Bl) {
37144
- const l = (Al >>> 0) + (Bl >>> 0);
37145
- return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
37146
- }
37147
- var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
37148
- var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
37149
- var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
37150
- var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
37151
- var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
37152
- var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
37153
-
37154
- // node_modules/@noble/hashes/esm/sha2.js
37155
- var SHA256_K = /* @__PURE__ */ Uint32Array.from([
37156
- 1116352408,
37157
- 1899447441,
37158
- 3049323471,
37159
- 3921009573,
37160
- 961987163,
37161
- 1508970993,
37162
- 2453635748,
37163
- 2870763221,
37164
- 3624381080,
37165
- 310598401,
37166
- 607225278,
37167
- 1426881987,
37168
- 1925078388,
37169
- 2162078206,
37170
- 2614888103,
37171
- 3248222580,
37172
- 3835390401,
37173
- 4022224774,
37174
- 264347078,
37175
- 604807628,
37176
- 770255983,
37177
- 1249150122,
37178
- 1555081692,
37179
- 1996064986,
37180
- 2554220882,
37181
- 2821834349,
37182
- 2952996808,
37183
- 3210313671,
37184
- 3336571891,
37185
- 3584528711,
37186
- 113926993,
37187
- 338241895,
37188
- 666307205,
37189
- 773529912,
37190
- 1294757372,
37191
- 1396182291,
37192
- 1695183700,
37193
- 1986661051,
37194
- 2177026350,
37195
- 2456956037,
37196
- 2730485921,
37197
- 2820302411,
37198
- 3259730800,
37199
- 3345764771,
37200
- 3516065817,
37201
- 3600352804,
37202
- 4094571909,
37203
- 275423344,
37204
- 430227734,
37205
- 506948616,
37206
- 659060556,
37207
- 883997877,
37208
- 958139571,
37209
- 1322822218,
37210
- 1537002063,
37211
- 1747873779,
37212
- 1955562222,
37213
- 2024104815,
37214
- 2227730452,
37215
- 2361852424,
37216
- 2428436474,
37217
- 2756734187,
37218
- 3204031479,
37219
- 3329325298
37220
- ]);
37221
- var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
37222
- var SHA256 = class extends HashMD {
37223
- constructor(outputLen = 32) {
37224
- super(64, outputLen, 8, false);
37225
- this.A = SHA256_IV[0] | 0;
37226
- this.B = SHA256_IV[1] | 0;
37227
- this.C = SHA256_IV[2] | 0;
37228
- this.D = SHA256_IV[3] | 0;
37229
- this.E = SHA256_IV[4] | 0;
37230
- this.F = SHA256_IV[5] | 0;
37231
- this.G = SHA256_IV[6] | 0;
37232
- this.H = SHA256_IV[7] | 0;
37233
- }
37234
- get() {
37235
- const { A, B, C, D, E, F, G, H } = this;
37236
- return [A, B, C, D, E, F, G, H];
37237
- }
37238
- // prettier-ignore
37239
- set(A, B, C, D, E, F, G, H) {
37240
- this.A = A | 0;
37241
- this.B = B | 0;
37242
- this.C = C | 0;
37243
- this.D = D | 0;
37244
- this.E = E | 0;
37245
- this.F = F | 0;
37246
- this.G = G | 0;
37247
- this.H = H | 0;
37248
- }
37249
- process(view, offset) {
37250
- for (let i = 0; i < 16; i++, offset += 4)
37251
- SHA256_W[i] = view.getUint32(offset, false);
37252
- for (let i = 16; i < 64; i++) {
37253
- const W15 = SHA256_W[i - 15];
37254
- const W2 = SHA256_W[i - 2];
37255
- const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
37256
- const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
37257
- SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
37258
- }
37259
- let { A, B, C, D, E, F, G, H } = this;
37260
- for (let i = 0; i < 64; i++) {
37261
- const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
37262
- const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
37263
- const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
37264
- const T2 = sigma0 + Maj(A, B, C) | 0;
37265
- H = G;
37266
- G = F;
37267
- F = E;
37268
- E = D + T1 | 0;
37269
- D = C;
37270
- C = B;
37271
- B = A;
37272
- A = T1 + T2 | 0;
37273
- }
37274
- A = A + this.A | 0;
37275
- B = B + this.B | 0;
37276
- C = C + this.C | 0;
37277
- D = D + this.D | 0;
37278
- E = E + this.E | 0;
37279
- F = F + this.F | 0;
37280
- G = G + this.G | 0;
37281
- H = H + this.H | 0;
37282
- this.set(A, B, C, D, E, F, G, H);
37283
- }
37284
- roundClean() {
37285
- clean(SHA256_W);
37286
- }
37287
- destroy() {
37288
- this.set(0, 0, 0, 0, 0, 0, 0, 0);
37289
- clean(this.buffer);
37290
- }
37291
- };
37292
- var K512 = /* @__PURE__ */ (() => split([
37293
- "0x428a2f98d728ae22",
37294
- "0x7137449123ef65cd",
37295
- "0xb5c0fbcfec4d3b2f",
37296
- "0xe9b5dba58189dbbc",
37297
- "0x3956c25bf348b538",
37298
- "0x59f111f1b605d019",
37299
- "0x923f82a4af194f9b",
37300
- "0xab1c5ed5da6d8118",
37301
- "0xd807aa98a3030242",
37302
- "0x12835b0145706fbe",
37303
- "0x243185be4ee4b28c",
37304
- "0x550c7dc3d5ffb4e2",
37305
- "0x72be5d74f27b896f",
37306
- "0x80deb1fe3b1696b1",
37307
- "0x9bdc06a725c71235",
37308
- "0xc19bf174cf692694",
37309
- "0xe49b69c19ef14ad2",
37310
- "0xefbe4786384f25e3",
37311
- "0x0fc19dc68b8cd5b5",
37312
- "0x240ca1cc77ac9c65",
37313
- "0x2de92c6f592b0275",
37314
- "0x4a7484aa6ea6e483",
37315
- "0x5cb0a9dcbd41fbd4",
37316
- "0x76f988da831153b5",
37317
- "0x983e5152ee66dfab",
37318
- "0xa831c66d2db43210",
37319
- "0xb00327c898fb213f",
37320
- "0xbf597fc7beef0ee4",
37321
- "0xc6e00bf33da88fc2",
37322
- "0xd5a79147930aa725",
37323
- "0x06ca6351e003826f",
37324
- "0x142929670a0e6e70",
37325
- "0x27b70a8546d22ffc",
37326
- "0x2e1b21385c26c926",
37327
- "0x4d2c6dfc5ac42aed",
37328
- "0x53380d139d95b3df",
37329
- "0x650a73548baf63de",
37330
- "0x766a0abb3c77b2a8",
37331
- "0x81c2c92e47edaee6",
37332
- "0x92722c851482353b",
37333
- "0xa2bfe8a14cf10364",
37334
- "0xa81a664bbc423001",
37335
- "0xc24b8b70d0f89791",
37336
- "0xc76c51a30654be30",
37337
- "0xd192e819d6ef5218",
37338
- "0xd69906245565a910",
37339
- "0xf40e35855771202a",
37340
- "0x106aa07032bbd1b8",
37341
- "0x19a4c116b8d2d0c8",
37342
- "0x1e376c085141ab53",
37343
- "0x2748774cdf8eeb99",
37344
- "0x34b0bcb5e19b48a8",
37345
- "0x391c0cb3c5c95a63",
37346
- "0x4ed8aa4ae3418acb",
37347
- "0x5b9cca4f7763e373",
37348
- "0x682e6ff3d6b2b8a3",
37349
- "0x748f82ee5defb2fc",
37350
- "0x78a5636f43172f60",
37351
- "0x84c87814a1f0ab72",
37352
- "0x8cc702081a6439ec",
37353
- "0x90befffa23631e28",
37354
- "0xa4506cebde82bde9",
37355
- "0xbef9a3f7b2c67915",
37356
- "0xc67178f2e372532b",
37357
- "0xca273eceea26619c",
37358
- "0xd186b8c721c0c207",
37359
- "0xeada7dd6cde0eb1e",
37360
- "0xf57d4f7fee6ed178",
37361
- "0x06f067aa72176fba",
37362
- "0x0a637dc5a2c898a6",
37363
- "0x113f9804bef90dae",
37364
- "0x1b710b35131c471b",
37365
- "0x28db77f523047d84",
37366
- "0x32caab7b40c72493",
37367
- "0x3c9ebe0a15c9bebc",
37368
- "0x431d67c49c100d4c",
37369
- "0x4cc5d4becb3e42b6",
37370
- "0x597f299cfc657e2a",
37371
- "0x5fcb6fab3ad6faec",
37372
- "0x6c44198c4a475817"
37373
- ].map((n) => BigInt(n))))();
37374
- var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
37375
- var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
37376
- var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
37377
- var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
37378
- var SHA512 = class extends HashMD {
37379
- constructor(outputLen = 64) {
37380
- super(128, outputLen, 16, false);
37381
- this.Ah = SHA512_IV[0] | 0;
37382
- this.Al = SHA512_IV[1] | 0;
37383
- this.Bh = SHA512_IV[2] | 0;
37384
- this.Bl = SHA512_IV[3] | 0;
37385
- this.Ch = SHA512_IV[4] | 0;
37386
- this.Cl = SHA512_IV[5] | 0;
37387
- this.Dh = SHA512_IV[6] | 0;
37388
- this.Dl = SHA512_IV[7] | 0;
37389
- this.Eh = SHA512_IV[8] | 0;
37390
- this.El = SHA512_IV[9] | 0;
37391
- this.Fh = SHA512_IV[10] | 0;
37392
- this.Fl = SHA512_IV[11] | 0;
37393
- this.Gh = SHA512_IV[12] | 0;
37394
- this.Gl = SHA512_IV[13] | 0;
37395
- this.Hh = SHA512_IV[14] | 0;
37396
- this.Hl = SHA512_IV[15] | 0;
37397
- }
37398
- // prettier-ignore
37399
- get() {
37400
- const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
37401
- return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
37402
- }
37403
- // prettier-ignore
37404
- set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
37405
- this.Ah = Ah | 0;
37406
- this.Al = Al | 0;
37407
- this.Bh = Bh | 0;
37408
- this.Bl = Bl | 0;
37409
- this.Ch = Ch | 0;
37410
- this.Cl = Cl | 0;
37411
- this.Dh = Dh | 0;
37412
- this.Dl = Dl | 0;
37413
- this.Eh = Eh | 0;
37414
- this.El = El | 0;
37415
- this.Fh = Fh | 0;
37416
- this.Fl = Fl | 0;
37417
- this.Gh = Gh | 0;
37418
- this.Gl = Gl | 0;
37419
- this.Hh = Hh | 0;
37420
- this.Hl = Hl | 0;
37421
- }
37422
- process(view, offset) {
37423
- for (let i = 0; i < 16; i++, offset += 4) {
37424
- SHA512_W_H[i] = view.getUint32(offset);
37425
- SHA512_W_L[i] = view.getUint32(offset += 4);
37426
- }
37427
- for (let i = 16; i < 80; i++) {
37428
- const W15h = SHA512_W_H[i - 15] | 0;
37429
- const W15l = SHA512_W_L[i - 15] | 0;
37430
- const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7);
37431
- const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7);
37432
- const W2h = SHA512_W_H[i - 2] | 0;
37433
- const W2l = SHA512_W_L[i - 2] | 0;
37434
- const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6);
37435
- const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6);
37436
- const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
37437
- const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
37438
- SHA512_W_H[i] = SUMh | 0;
37439
- SHA512_W_L[i] = SUMl | 0;
37440
- }
37441
- let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
37442
- for (let i = 0; i < 80; i++) {
37443
- const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41);
37444
- const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41);
37445
- const CHIh = Eh & Fh ^ ~Eh & Gh;
37446
- const CHIl = El & Fl ^ ~El & Gl;
37447
- const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
37448
- const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
37449
- const T1l = T1ll | 0;
37450
- const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39);
37451
- const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39);
37452
- const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
37453
- const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
37454
- Hh = Gh | 0;
37455
- Hl = Gl | 0;
37456
- Gh = Fh | 0;
37457
- Gl = Fl | 0;
37458
- Fh = Eh | 0;
37459
- Fl = El | 0;
37460
- ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
37461
- Dh = Ch | 0;
37462
- Dl = Cl | 0;
37463
- Ch = Bh | 0;
37464
- Cl = Bl | 0;
37465
- Bh = Ah | 0;
37466
- Bl = Al | 0;
37467
- const All = add3L(T1l, sigma0l, MAJl);
37468
- Ah = add3H(All, T1h, sigma0h, MAJh);
37469
- Al = All | 0;
37470
- }
37471
- ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
37472
- ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
37473
- ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
37474
- ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
37475
- ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
37476
- ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
37477
- ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
37478
- ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
37479
- this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
37480
- }
37481
- roundClean() {
37482
- clean(SHA512_W_H, SHA512_W_L);
37483
- }
37484
- destroy() {
37485
- clean(this.buffer);
37486
- this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
37487
- }
37488
- };
37489
- var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
37490
- var sha512 = /* @__PURE__ */ createHasher(() => new SHA512());
37491
-
37492
- // node_modules/@noble/curves/esm/utils.js
37493
- var _0n = /* @__PURE__ */ BigInt(0);
37494
- var _1n = /* @__PURE__ */ BigInt(1);
37495
- function _abool2(value, title = "") {
37496
- if (typeof value !== "boolean") {
37497
- const prefix = title && `"${title}"`;
37498
- throw new Error(prefix + "expected boolean, got type=" + typeof value);
37499
- }
37500
- return value;
37501
- }
37502
- function _abytes2(value, length, title = "") {
37503
- const bytes = isBytes(value);
37504
- const len = value?.length;
37505
- const needsLen = length !== void 0;
37506
- if (!bytes || needsLen && len !== length) {
37507
- const prefix = title && `"${title}" `;
37508
- const ofLen = needsLen ? ` of length ${length}` : "";
37509
- const got = bytes ? `length=${len}` : `type=${typeof value}`;
37510
- throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
37511
- }
37512
- return value;
37513
- }
37514
- function hexToNumber(hex) {
37515
- if (typeof hex !== "string")
37516
- throw new Error("hex string expected, got " + typeof hex);
37517
- return hex === "" ? _0n : BigInt("0x" + hex);
37518
- }
37519
- function bytesToNumberBE(bytes) {
37520
- return hexToNumber(bytesToHex(bytes));
37521
- }
37522
- function bytesToNumberLE(bytes) {
37523
- abytes(bytes);
37524
- return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
37525
- }
37526
- function numberToBytesBE(n, len) {
37527
- return hexToBytes(n.toString(16).padStart(len * 2, "0"));
37528
- }
37529
- function numberToBytesLE(n, len) {
37530
- return numberToBytesBE(n, len).reverse();
37531
- }
37532
- function ensureBytes(title, hex, expectedLength) {
37533
- let res;
37534
- if (typeof hex === "string") {
37535
- try {
37536
- res = hexToBytes(hex);
37537
- } catch (e) {
37538
- throw new Error(title + " must be hex string or Uint8Array, cause: " + e);
37539
- }
37540
- } else if (isBytes(hex)) {
37541
- res = Uint8Array.from(hex);
37542
- } else {
37543
- throw new Error(title + " must be hex string or Uint8Array");
37544
- }
37545
- const len = res.length;
37546
- if (typeof expectedLength === "number" && len !== expectedLength)
37547
- throw new Error(title + " of length " + expectedLength + " expected, got " + len);
37548
- return res;
37549
- }
37550
- function equalBytes(a, b) {
37551
- if (a.length !== b.length)
37552
- return false;
37553
- let diff = 0;
37554
- for (let i = 0; i < a.length; i++)
37555
- diff |= a[i] ^ b[i];
37556
- return diff === 0;
37557
- }
37558
- function copyBytes(bytes) {
37559
- return Uint8Array.from(bytes);
37560
- }
37561
- var isPosBig = (n) => typeof n === "bigint" && _0n <= n;
37562
- function inRange(n, min, max) {
37563
- return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;
37564
- }
37565
- function aInRange(title, n, min, max) {
37566
- if (!inRange(n, min, max))
37567
- throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n);
37568
- }
37569
- function bitLen(n) {
37570
- let len;
37571
- for (len = 0; n > _0n; n >>= _1n, len += 1)
37572
- ;
37573
- return len;
37574
- }
37575
- var bitMask = (n) => (_1n << BigInt(n)) - _1n;
37576
- function _validateObject(object, fields, optFields = {}) {
37577
- if (!object || typeof object !== "object")
37578
- throw new Error("expected valid options object");
37579
- function checkField(fieldName, expectedType, isOpt) {
37580
- const val = object[fieldName];
37581
- if (isOpt && val === void 0)
37582
- return;
37583
- const current = typeof val;
37584
- if (current !== expectedType || val === null)
37585
- throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`);
37586
- }
37587
- Object.entries(fields).forEach(([k, v]) => checkField(k, v, false));
37588
- Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true));
37589
- }
37590
- var notImplemented = () => {
37591
- throw new Error("not implemented");
37592
- };
37593
- function memoized(fn) {
37594
- const map = /* @__PURE__ */ new WeakMap();
37595
- return (arg, ...args) => {
37596
- const val = map.get(arg);
37597
- if (val !== void 0)
37598
- return val;
37599
- const computed = fn(arg, ...args);
37600
- map.set(arg, computed);
37601
- return computed;
37602
- };
37603
- }
37604
-
37605
- // node_modules/@noble/curves/esm/abstract/modular.js
37606
- var _0n2 = BigInt(0);
37607
- var _1n2 = BigInt(1);
37608
- var _2n = /* @__PURE__ */ BigInt(2);
37609
- var _3n = /* @__PURE__ */ BigInt(3);
37610
- var _4n = /* @__PURE__ */ BigInt(4);
37611
- var _5n = /* @__PURE__ */ BigInt(5);
37612
- var _7n = /* @__PURE__ */ BigInt(7);
37613
- var _8n = /* @__PURE__ */ BigInt(8);
37614
- var _9n = /* @__PURE__ */ BigInt(9);
37615
- var _16n = /* @__PURE__ */ BigInt(16);
37616
- function mod(a, b) {
37617
- const result = a % b;
37618
- return result >= _0n2 ? result : b + result;
37619
- }
37620
- function pow2(x, power, modulo) {
37621
- let res = x;
37622
- while (power-- > _0n2) {
37623
- res *= res;
37624
- res %= modulo;
37625
- }
37626
- return res;
37627
- }
37628
- function invert(number, modulo) {
37629
- if (number === _0n2)
37630
- throw new Error("invert: expected non-zero number");
37631
- if (modulo <= _0n2)
37632
- throw new Error("invert: expected positive modulus, got " + modulo);
37633
- let a = mod(number, modulo);
37634
- let b = modulo;
37635
- let x = _0n2, y = _1n2, u = _1n2, v = _0n2;
37636
- while (a !== _0n2) {
37637
- const q = b / a;
37638
- const r = b % a;
37639
- const m = x - u * q;
37640
- const n = y - v * q;
37641
- b = a, a = r, x = u, y = v, u = m, v = n;
37642
- }
37643
- const gcd = b;
37644
- if (gcd !== _1n2)
37645
- throw new Error("invert: does not exist");
37646
- return mod(x, modulo);
37647
- }
37648
- function assertIsSquare(Fp2, root, n) {
37649
- if (!Fp2.eql(Fp2.sqr(root), n))
37650
- throw new Error("Cannot find square root");
37651
- }
37652
- function sqrt3mod4(Fp2, n) {
37653
- const p1div4 = (Fp2.ORDER + _1n2) / _4n;
37654
- const root = Fp2.pow(n, p1div4);
37655
- assertIsSquare(Fp2, root, n);
37656
- return root;
37657
- }
37658
- function sqrt5mod8(Fp2, n) {
37659
- const p5div8 = (Fp2.ORDER - _5n) / _8n;
37660
- const n2 = Fp2.mul(n, _2n);
37661
- const v = Fp2.pow(n2, p5div8);
37662
- const nv = Fp2.mul(n, v);
37663
- const i = Fp2.mul(Fp2.mul(nv, _2n), v);
37664
- const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE));
37665
- assertIsSquare(Fp2, root, n);
37666
- return root;
37667
- }
37668
- function sqrt9mod16(P) {
37669
- const Fp_ = Field(P);
37670
- const tn = tonelliShanks(P);
37671
- const c1 = tn(Fp_, Fp_.neg(Fp_.ONE));
37672
- const c2 = tn(Fp_, c1);
37673
- const c3 = tn(Fp_, Fp_.neg(c1));
37674
- const c4 = (P + _7n) / _16n;
37675
- return (Fp2, n) => {
37676
- let tv1 = Fp2.pow(n, c4);
37677
- let tv2 = Fp2.mul(tv1, c1);
37678
- const tv3 = Fp2.mul(tv1, c2);
37679
- const tv4 = Fp2.mul(tv1, c3);
37680
- const e1 = Fp2.eql(Fp2.sqr(tv2), n);
37681
- const e2 = Fp2.eql(Fp2.sqr(tv3), n);
37682
- tv1 = Fp2.cmov(tv1, tv2, e1);
37683
- tv2 = Fp2.cmov(tv4, tv3, e2);
37684
- const e3 = Fp2.eql(Fp2.sqr(tv2), n);
37685
- const root = Fp2.cmov(tv1, tv2, e3);
37686
- assertIsSquare(Fp2, root, n);
37687
- return root;
37688
- };
37689
- }
37690
- function tonelliShanks(P) {
37691
- if (P < _3n)
37692
- throw new Error("sqrt is not defined for small field");
37693
- let Q = P - _1n2;
37694
- let S = 0;
37695
- while (Q % _2n === _0n2) {
37696
- Q /= _2n;
37697
- S++;
37698
- }
37699
- let Z = _2n;
37700
- const _Fp = Field(P);
37701
- while (FpLegendre(_Fp, Z) === 1) {
37702
- if (Z++ > 1e3)
37703
- throw new Error("Cannot find square root: probably non-prime P");
37704
- }
37705
- if (S === 1)
37706
- return sqrt3mod4;
37707
- let cc = _Fp.pow(Z, Q);
37708
- const Q1div2 = (Q + _1n2) / _2n;
37709
- return function tonelliSlow(Fp2, n) {
37710
- if (Fp2.is0(n))
37711
- return n;
37712
- if (FpLegendre(Fp2, n) !== 1)
37713
- throw new Error("Cannot find square root");
37714
- let M = S;
37715
- let c = Fp2.mul(Fp2.ONE, cc);
37716
- let t = Fp2.pow(n, Q);
37717
- let R = Fp2.pow(n, Q1div2);
37718
- while (!Fp2.eql(t, Fp2.ONE)) {
37719
- if (Fp2.is0(t))
37720
- return Fp2.ZERO;
37721
- let i = 1;
37722
- let t_tmp = Fp2.sqr(t);
37723
- while (!Fp2.eql(t_tmp, Fp2.ONE)) {
37724
- i++;
37725
- t_tmp = Fp2.sqr(t_tmp);
37726
- if (i === M)
37727
- throw new Error("Cannot find square root");
37728
- }
37729
- const exponent = _1n2 << BigInt(M - i - 1);
37730
- const b = Fp2.pow(c, exponent);
37731
- M = i;
37732
- c = Fp2.sqr(b);
37733
- t = Fp2.mul(t, c);
37734
- R = Fp2.mul(R, b);
37735
- }
37736
- return R;
37737
- };
37738
- }
37739
- function FpSqrt(P) {
37740
- if (P % _4n === _3n)
37741
- return sqrt3mod4;
37742
- if (P % _8n === _5n)
37743
- return sqrt5mod8;
37744
- if (P % _16n === _9n)
37745
- return sqrt9mod16(P);
37746
- return tonelliShanks(P);
37747
- }
37748
- var isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n2) === _1n2;
37749
- var FIELD_FIELDS = [
37750
- "create",
37751
- "isValid",
37752
- "is0",
37753
- "neg",
37754
- "inv",
37755
- "sqrt",
37756
- "sqr",
37757
- "eql",
37758
- "add",
37759
- "sub",
37760
- "mul",
37761
- "pow",
37762
- "div",
37763
- "addN",
37764
- "subN",
37765
- "mulN",
37766
- "sqrN"
37767
- ];
37768
- function validateField(field) {
37769
- const initial = {
37770
- ORDER: "bigint",
37771
- MASK: "bigint",
37772
- BYTES: "number",
37773
- BITS: "number"
37774
- };
37775
- const opts = FIELD_FIELDS.reduce((map, val) => {
37776
- map[val] = "function";
37777
- return map;
37778
- }, initial);
37779
- _validateObject(field, opts);
37780
- return field;
37781
- }
37782
- function FpPow(Fp2, num, power) {
37783
- if (power < _0n2)
37784
- throw new Error("invalid exponent, negatives unsupported");
37785
- if (power === _0n2)
37786
- return Fp2.ONE;
37787
- if (power === _1n2)
37788
- return num;
37789
- let p = Fp2.ONE;
37790
- let d = num;
37791
- while (power > _0n2) {
37792
- if (power & _1n2)
37793
- p = Fp2.mul(p, d);
37794
- d = Fp2.sqr(d);
37795
- power >>= _1n2;
37796
- }
37797
- return p;
37798
- }
37799
- function FpInvertBatch(Fp2, nums, passZero = false) {
37800
- const inverted = new Array(nums.length).fill(passZero ? Fp2.ZERO : void 0);
37801
- const multipliedAcc = nums.reduce((acc, num, i) => {
37802
- if (Fp2.is0(num))
37803
- return acc;
37804
- inverted[i] = acc;
37805
- return Fp2.mul(acc, num);
37806
- }, Fp2.ONE);
37807
- const invertedAcc = Fp2.inv(multipliedAcc);
37808
- nums.reduceRight((acc, num, i) => {
37809
- if (Fp2.is0(num))
37810
- return acc;
37811
- inverted[i] = Fp2.mul(acc, inverted[i]);
37812
- return Fp2.mul(acc, num);
37813
- }, invertedAcc);
37814
- return inverted;
37815
- }
37816
- function FpLegendre(Fp2, n) {
37817
- const p1mod2 = (Fp2.ORDER - _1n2) / _2n;
37818
- const powered = Fp2.pow(n, p1mod2);
37819
- const yes = Fp2.eql(powered, Fp2.ONE);
37820
- const zero = Fp2.eql(powered, Fp2.ZERO);
37821
- const no = Fp2.eql(powered, Fp2.neg(Fp2.ONE));
37822
- if (!yes && !zero && !no)
37823
- throw new Error("invalid Legendre symbol result");
37824
- return yes ? 1 : zero ? 0 : -1;
37825
- }
37826
- function nLength(n, nBitLength) {
37827
- if (nBitLength !== void 0)
37828
- anumber(nBitLength);
37829
- const _nBitLength = nBitLength !== void 0 ? nBitLength : n.toString(2).length;
37830
- const nByteLength = Math.ceil(_nBitLength / 8);
37831
- return { nBitLength: _nBitLength, nByteLength };
37832
- }
37833
- function Field(ORDER, bitLenOrOpts, isLE = false, opts = {}) {
37834
- if (ORDER <= _0n2)
37835
- throw new Error("invalid field: expected ORDER > 0, got " + ORDER);
37836
- let _nbitLength = void 0;
37837
- let _sqrt = void 0;
37838
- let modFromBytes = false;
37839
- let allowedLengths = void 0;
37840
- if (typeof bitLenOrOpts === "object" && bitLenOrOpts != null) {
37841
- if (opts.sqrt || isLE)
37842
- throw new Error("cannot specify opts in two arguments");
37843
- const _opts = bitLenOrOpts;
37844
- if (_opts.BITS)
37845
- _nbitLength = _opts.BITS;
37846
- if (_opts.sqrt)
37847
- _sqrt = _opts.sqrt;
37848
- if (typeof _opts.isLE === "boolean")
37849
- isLE = _opts.isLE;
37850
- if (typeof _opts.modFromBytes === "boolean")
37851
- modFromBytes = _opts.modFromBytes;
37852
- allowedLengths = _opts.allowedLengths;
37853
- } else {
37854
- if (typeof bitLenOrOpts === "number")
37855
- _nbitLength = bitLenOrOpts;
37856
- if (opts.sqrt)
37857
- _sqrt = opts.sqrt;
37858
- }
37859
- const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, _nbitLength);
37860
- if (BYTES > 2048)
37861
- throw new Error("invalid field: expected ORDER of <= 2048 bytes");
37862
- let sqrtP;
37863
- const f = Object.freeze({
37864
- ORDER,
37865
- isLE,
37866
- BITS,
37867
- BYTES,
37868
- MASK: bitMask(BITS),
37869
- ZERO: _0n2,
37870
- ONE: _1n2,
37871
- allowedLengths,
37872
- create: (num) => mod(num, ORDER),
37873
- isValid: (num) => {
37874
- if (typeof num !== "bigint")
37875
- throw new Error("invalid field element: expected bigint, got " + typeof num);
37876
- return _0n2 <= num && num < ORDER;
37877
- },
37878
- is0: (num) => num === _0n2,
37879
- // is valid and invertible
37880
- isValidNot0: (num) => !f.is0(num) && f.isValid(num),
37881
- isOdd: (num) => (num & _1n2) === _1n2,
37882
- neg: (num) => mod(-num, ORDER),
37883
- eql: (lhs, rhs) => lhs === rhs,
37884
- sqr: (num) => mod(num * num, ORDER),
37885
- add: (lhs, rhs) => mod(lhs + rhs, ORDER),
37886
- sub: (lhs, rhs) => mod(lhs - rhs, ORDER),
37887
- mul: (lhs, rhs) => mod(lhs * rhs, ORDER),
37888
- pow: (num, power) => FpPow(f, num, power),
37889
- div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),
37890
- // Same as above, but doesn't normalize
37891
- sqrN: (num) => num * num,
37892
- addN: (lhs, rhs) => lhs + rhs,
37893
- subN: (lhs, rhs) => lhs - rhs,
37894
- mulN: (lhs, rhs) => lhs * rhs,
37895
- inv: (num) => invert(num, ORDER),
37896
- sqrt: _sqrt || ((n) => {
37897
- if (!sqrtP)
37898
- sqrtP = FpSqrt(ORDER);
37899
- return sqrtP(f, n);
37900
- }),
37901
- toBytes: (num) => isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
37902
- fromBytes: (bytes, skipValidation = true) => {
37903
- if (allowedLengths) {
37904
- if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) {
37905
- throw new Error("Field.fromBytes: expected " + allowedLengths + " bytes, got " + bytes.length);
37906
- }
37907
- const padded = new Uint8Array(BYTES);
37908
- padded.set(bytes, isLE ? 0 : padded.length - bytes.length);
37909
- bytes = padded;
37910
- }
37911
- if (bytes.length !== BYTES)
37912
- throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
37913
- let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);
37914
- if (modFromBytes)
37915
- scalar = mod(scalar, ORDER);
37916
- if (!skipValidation) {
37917
- if (!f.isValid(scalar))
37918
- throw new Error("invalid field element: outside of range 0..ORDER");
37919
- }
37920
- return scalar;
37921
- },
37922
- // TODO: we don't need it here, move out to separate fn
37923
- invertBatch: (lst) => FpInvertBatch(f, lst),
37924
- // We can't move this out because Fp6, Fp12 implement it
37925
- // and it's unclear what to return in there.
37926
- cmov: (a, b, c) => c ? b : a
37927
- });
37928
- return Object.freeze(f);
37929
- }
37930
-
37931
- // node_modules/@noble/curves/esm/abstract/curve.js
37932
- var _0n3 = BigInt(0);
37933
- var _1n3 = BigInt(1);
37934
- function negateCt(condition, item) {
37935
- const neg = item.negate();
37936
- return condition ? neg : item;
37937
- }
37938
- function normalizeZ(c, points) {
37939
- const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z));
37940
- return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i])));
37941
- }
37942
- function validateW(W, bits) {
37943
- if (!Number.isSafeInteger(W) || W <= 0 || W > bits)
37944
- throw new Error("invalid window size, expected [1.." + bits + "], got W=" + W);
37945
- }
37946
- function calcWOpts(W, scalarBits) {
37947
- validateW(W, scalarBits);
37948
- const windows = Math.ceil(scalarBits / W) + 1;
37949
- const windowSize = 2 ** (W - 1);
37950
- const maxNumber = 2 ** W;
37951
- const mask = bitMask(W);
37952
- const shiftBy = BigInt(W);
37953
- return { windows, windowSize, mask, maxNumber, shiftBy };
37954
- }
37955
- function calcOffsets(n, window, wOpts) {
37956
- const { windowSize, mask, maxNumber, shiftBy } = wOpts;
37957
- let wbits = Number(n & mask);
37958
- let nextN = n >> shiftBy;
37959
- if (wbits > windowSize) {
37960
- wbits -= maxNumber;
37961
- nextN += _1n3;
37962
- }
37963
- const offsetStart = window * windowSize;
37964
- const offset = offsetStart + Math.abs(wbits) - 1;
37965
- const isZero = wbits === 0;
37966
- const isNeg = wbits < 0;
37967
- const isNegF = window % 2 !== 0;
37968
- const offsetF = offsetStart;
37969
- return { nextN, offset, isZero, isNeg, isNegF, offsetF };
37970
- }
37971
- function validateMSMPoints(points, c) {
37972
- if (!Array.isArray(points))
37973
- throw new Error("array expected");
37974
- points.forEach((p, i) => {
37975
- if (!(p instanceof c))
37976
- throw new Error("invalid point at index " + i);
37977
- });
37978
- }
37979
- function validateMSMScalars(scalars, field) {
37980
- if (!Array.isArray(scalars))
37981
- throw new Error("array of scalars expected");
37982
- scalars.forEach((s, i) => {
37983
- if (!field.isValid(s))
37984
- throw new Error("invalid scalar at index " + i);
37985
- });
37986
- }
37987
- var pointPrecomputes = /* @__PURE__ */ new WeakMap();
37988
- var pointWindowSizes = /* @__PURE__ */ new WeakMap();
37989
- function getW(P) {
37990
- return pointWindowSizes.get(P) || 1;
37991
- }
37992
- function assert0(n) {
37993
- if (n !== _0n3)
37994
- throw new Error("invalid wNAF");
37995
- }
37996
- var wNAF = class {
37997
- // Parametrized with a given Point class (not individual point)
37998
- constructor(Point, bits) {
37999
- this.BASE = Point.BASE;
38000
- this.ZERO = Point.ZERO;
38001
- this.Fn = Point.Fn;
38002
- this.bits = bits;
38003
- }
38004
- // non-const time multiplication ladder
38005
- _unsafeLadder(elm, n, p = this.ZERO) {
38006
- let d = elm;
38007
- while (n > _0n3) {
38008
- if (n & _1n3)
38009
- p = p.add(d);
38010
- d = d.double();
38011
- n >>= _1n3;
38012
- }
38013
- return p;
38014
- }
38015
- /**
38016
- * Creates a wNAF precomputation window. Used for caching.
38017
- * Default window size is set by `utils.precompute()` and is equal to 8.
38018
- * Number of precomputed points depends on the curve size:
38019
- * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
38020
- * - 𝑊 is the window size
38021
- * - 𝑛 is the bitlength of the curve order.
38022
- * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
38023
- * @param point Point instance
38024
- * @param W window size
38025
- * @returns precomputed point tables flattened to a single array
38026
- */
38027
- precomputeWindow(point, W) {
38028
- const { windows, windowSize } = calcWOpts(W, this.bits);
38029
- const points = [];
38030
- let p = point;
38031
- let base = p;
38032
- for (let window = 0; window < windows; window++) {
38033
- base = p;
38034
- points.push(base);
38035
- for (let i = 1; i < windowSize; i++) {
38036
- base = base.add(p);
38037
- points.push(base);
38038
- }
38039
- p = base.double();
38040
- }
38041
- return points;
38042
- }
38043
- /**
38044
- * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
38045
- * More compact implementation:
38046
- * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541
38047
- * @returns real and fake (for const-time) points
38048
- */
38049
- wNAF(W, precomputes, n) {
38050
- if (!this.Fn.isValid(n))
38051
- throw new Error("invalid scalar");
38052
- let p = this.ZERO;
38053
- let f = this.BASE;
38054
- const wo = calcWOpts(W, this.bits);
38055
- for (let window = 0; window < wo.windows; window++) {
38056
- const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);
38057
- n = nextN;
38058
- if (isZero) {
38059
- f = f.add(negateCt(isNegF, precomputes[offsetF]));
38060
- } else {
38061
- p = p.add(negateCt(isNeg, precomputes[offset]));
38062
- }
38063
- }
38064
- assert0(n);
38065
- return { p, f };
38066
- }
38067
- /**
38068
- * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.
38069
- * @param acc accumulator point to add result of multiplication
38070
- * @returns point
38071
- */
38072
- wNAFUnsafe(W, precomputes, n, acc = this.ZERO) {
38073
- const wo = calcWOpts(W, this.bits);
38074
- for (let window = 0; window < wo.windows; window++) {
38075
- if (n === _0n3)
38076
- break;
38077
- const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);
38078
- n = nextN;
38079
- if (isZero) {
38080
- continue;
38081
- } else {
38082
- const item = precomputes[offset];
38083
- acc = acc.add(isNeg ? item.negate() : item);
38084
- }
38085
- }
38086
- assert0(n);
38087
- return acc;
38088
- }
38089
- getPrecomputes(W, point, transform) {
38090
- let comp = pointPrecomputes.get(point);
38091
- if (!comp) {
38092
- comp = this.precomputeWindow(point, W);
38093
- if (W !== 1) {
38094
- if (typeof transform === "function")
38095
- comp = transform(comp);
38096
- pointPrecomputes.set(point, comp);
38097
- }
38098
- }
38099
- return comp;
38100
- }
38101
- cached(point, scalar, transform) {
38102
- const W = getW(point);
38103
- return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar);
38104
- }
38105
- unsafe(point, scalar, transform, prev) {
38106
- const W = getW(point);
38107
- if (W === 1)
38108
- return this._unsafeLadder(point, scalar, prev);
38109
- return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev);
38110
- }
38111
- // We calculate precomputes for elliptic curve point multiplication
38112
- // using windowed method. This specifies window size and
38113
- // stores precomputed values. Usually only base point would be precomputed.
38114
- createCache(P, W) {
38115
- validateW(W, this.bits);
38116
- pointWindowSizes.set(P, W);
38117
- pointPrecomputes.delete(P);
38118
- }
38119
- hasCache(elm) {
38120
- return getW(elm) !== 1;
38121
- }
38122
- };
38123
- function pippenger(c, fieldN, points, scalars) {
38124
- validateMSMPoints(points, c);
38125
- validateMSMScalars(scalars, fieldN);
38126
- const plength = points.length;
38127
- const slength = scalars.length;
38128
- if (plength !== slength)
38129
- throw new Error("arrays of points and scalars must have equal length");
38130
- const zero = c.ZERO;
38131
- const wbits = bitLen(BigInt(plength));
38132
- let windowSize = 1;
38133
- if (wbits > 12)
38134
- windowSize = wbits - 3;
38135
- else if (wbits > 4)
38136
- windowSize = wbits - 2;
38137
- else if (wbits > 0)
38138
- windowSize = 2;
38139
- const MASK = bitMask(windowSize);
38140
- const buckets = new Array(Number(MASK) + 1).fill(zero);
38141
- const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;
38142
- let sum = zero;
38143
- for (let i = lastBits; i >= 0; i -= windowSize) {
38144
- buckets.fill(zero);
38145
- for (let j = 0; j < slength; j++) {
38146
- const scalar = scalars[j];
38147
- const wbits2 = Number(scalar >> BigInt(i) & MASK);
38148
- buckets[wbits2] = buckets[wbits2].add(points[j]);
38149
- }
38150
- let resI = zero;
38151
- for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {
38152
- sumI = sumI.add(buckets[j]);
38153
- resI = resI.add(sumI);
38154
- }
38155
- sum = sum.add(resI);
38156
- if (i !== 0)
38157
- for (let j = 0; j < windowSize; j++)
38158
- sum = sum.double();
38159
- }
38160
- return sum;
38161
- }
38162
- function createField(order, field, isLE) {
38163
- if (field) {
38164
- if (field.ORDER !== order)
38165
- throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
38166
- validateField(field);
38167
- return field;
38168
- } else {
38169
- return Field(order, { isLE });
38170
- }
38171
- }
38172
- function _createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {
38173
- if (FpFnLE === void 0)
38174
- FpFnLE = type === "edwards";
38175
- if (!CURVE || typeof CURVE !== "object")
38176
- throw new Error(`expected valid ${type} CURVE object`);
38177
- for (const p of ["p", "n", "h"]) {
38178
- const val = CURVE[p];
38179
- if (!(typeof val === "bigint" && val > _0n3))
38180
- throw new Error(`CURVE.${p} must be positive bigint`);
38181
- }
38182
- const Fp2 = createField(CURVE.p, curveOpts.Fp, FpFnLE);
38183
- const Fn2 = createField(CURVE.n, curveOpts.Fn, FpFnLE);
38184
- const _b = type === "weierstrass" ? "b" : "d";
38185
- const params = ["Gx", "Gy", "a", _b];
38186
- for (const p of params) {
38187
- if (!Fp2.isValid(CURVE[p]))
38188
- throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);
38189
- }
38190
- CURVE = Object.freeze(Object.assign({}, CURVE));
38191
- return { CURVE, Fp: Fp2, Fn: Fn2 };
38192
- }
38193
-
38194
- // node_modules/@noble/curves/esm/abstract/edwards.js
38195
- var _0n4 = BigInt(0);
38196
- var _1n4 = BigInt(1);
38197
- var _2n2 = BigInt(2);
38198
- var _8n2 = BigInt(8);
38199
- function isEdValidXY(Fp2, CURVE, x, y) {
38200
- const x2 = Fp2.sqr(x);
38201
- const y2 = Fp2.sqr(y);
38202
- const left = Fp2.add(Fp2.mul(CURVE.a, x2), y2);
38203
- const right = Fp2.add(Fp2.ONE, Fp2.mul(CURVE.d, Fp2.mul(x2, y2)));
38204
- return Fp2.eql(left, right);
38205
- }
38206
- function edwards(params, extraOpts = {}) {
38207
- const validated = _createCurveFields("edwards", params, extraOpts, extraOpts.FpFnLE);
38208
- const { Fp: Fp2, Fn: Fn2 } = validated;
38209
- let CURVE = validated.CURVE;
38210
- const { h: cofactor } = CURVE;
38211
- _validateObject(extraOpts, {}, { uvRatio: "function" });
38212
- const MASK = _2n2 << BigInt(Fn2.BYTES * 8) - _1n4;
38213
- const modP = (n) => Fp2.create(n);
38214
- const uvRatio2 = extraOpts.uvRatio || ((u, v) => {
38215
- try {
38216
- return { isValid: true, value: Fp2.sqrt(Fp2.div(u, v)) };
38217
- } catch (e) {
38218
- return { isValid: false, value: _0n4 };
38219
- }
38220
- });
38221
- if (!isEdValidXY(Fp2, CURVE, CURVE.Gx, CURVE.Gy))
38222
- throw new Error("bad curve params: generator point");
38223
- function acoord(title, n, banZero = false) {
38224
- const min = banZero ? _1n4 : _0n4;
38225
- aInRange("coordinate " + title, n, min, MASK);
38226
- return n;
38227
- }
38228
- function aextpoint(other) {
38229
- if (!(other instanceof Point))
38230
- throw new Error("ExtendedPoint expected");
38231
- }
38232
- const toAffineMemo = memoized((p, iz) => {
38233
- const { X, Y, Z } = p;
38234
- const is0 = p.is0();
38235
- if (iz == null)
38236
- iz = is0 ? _8n2 : Fp2.inv(Z);
38237
- const x = modP(X * iz);
38238
- const y = modP(Y * iz);
38239
- const zz = Fp2.mul(Z, iz);
38240
- if (is0)
38241
- return { x: _0n4, y: _1n4 };
38242
- if (zz !== _1n4)
38243
- throw new Error("invZ was invalid");
38244
- return { x, y };
38245
- });
38246
- const assertValidMemo = memoized((p) => {
38247
- const { a, d } = CURVE;
38248
- if (p.is0())
38249
- throw new Error("bad point: ZERO");
38250
- const { X, Y, Z, T } = p;
38251
- const X2 = modP(X * X);
38252
- const Y2 = modP(Y * Y);
38253
- const Z2 = modP(Z * Z);
38254
- const Z4 = modP(Z2 * Z2);
38255
- const aX2 = modP(X2 * a);
38256
- const left = modP(Z2 * modP(aX2 + Y2));
38257
- const right = modP(Z4 + modP(d * modP(X2 * Y2)));
38258
- if (left !== right)
38259
- throw new Error("bad point: equation left != right (1)");
38260
- const XY = modP(X * Y);
38261
- const ZT = modP(Z * T);
38262
- if (XY !== ZT)
38263
- throw new Error("bad point: equation left != right (2)");
38264
- return true;
38265
- });
38266
- class Point {
38267
- constructor(X, Y, Z, T) {
38268
- this.X = acoord("x", X);
38269
- this.Y = acoord("y", Y);
38270
- this.Z = acoord("z", Z, true);
38271
- this.T = acoord("t", T);
38272
- Object.freeze(this);
38273
- }
38274
- static CURVE() {
38275
- return CURVE;
38276
- }
38277
- static fromAffine(p) {
38278
- if (p instanceof Point)
38279
- throw new Error("extended point not allowed");
38280
- const { x, y } = p || {};
38281
- acoord("x", x);
38282
- acoord("y", y);
38283
- return new Point(x, y, _1n4, modP(x * y));
38284
- }
38285
- // Uses algo from RFC8032 5.1.3.
38286
- static fromBytes(bytes, zip215 = false) {
38287
- const len = Fp2.BYTES;
38288
- const { a, d } = CURVE;
38289
- bytes = copyBytes(_abytes2(bytes, len, "point"));
38290
- _abool2(zip215, "zip215");
38291
- const normed = copyBytes(bytes);
38292
- const lastByte = bytes[len - 1];
38293
- normed[len - 1] = lastByte & ~128;
38294
- const y = bytesToNumberLE(normed);
38295
- const max = zip215 ? MASK : Fp2.ORDER;
38296
- aInRange("point.y", y, _0n4, max);
38297
- const y2 = modP(y * y);
38298
- const u = modP(y2 - _1n4);
38299
- const v = modP(d * y2 - a);
38300
- let { isValid, value: x } = uvRatio2(u, v);
38301
- if (!isValid)
38302
- throw new Error("bad point: invalid y coordinate");
38303
- const isXOdd = (x & _1n4) === _1n4;
38304
- const isLastByteOdd = (lastByte & 128) !== 0;
38305
- if (!zip215 && x === _0n4 && isLastByteOdd)
38306
- throw new Error("bad point: x=0 and x_0=1");
38307
- if (isLastByteOdd !== isXOdd)
38308
- x = modP(-x);
38309
- return Point.fromAffine({ x, y });
38310
- }
38311
- static fromHex(bytes, zip215 = false) {
38312
- return Point.fromBytes(ensureBytes("point", bytes), zip215);
38313
- }
38314
- get x() {
38315
- return this.toAffine().x;
38316
- }
38317
- get y() {
38318
- return this.toAffine().y;
38319
- }
38320
- precompute(windowSize = 8, isLazy = true) {
38321
- wnaf.createCache(this, windowSize);
38322
- if (!isLazy)
38323
- this.multiply(_2n2);
38324
- return this;
38325
- }
38326
- // Useful in fromAffine() - not for fromBytes(), which always created valid points.
38327
- assertValidity() {
38328
- assertValidMemo(this);
38329
- }
38330
- // Compare one point to another.
38331
- equals(other) {
38332
- aextpoint(other);
38333
- const { X: X1, Y: Y1, Z: Z1 } = this;
38334
- const { X: X2, Y: Y2, Z: Z2 } = other;
38335
- const X1Z2 = modP(X1 * Z2);
38336
- const X2Z1 = modP(X2 * Z1);
38337
- const Y1Z2 = modP(Y1 * Z2);
38338
- const Y2Z1 = modP(Y2 * Z1);
38339
- return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;
38340
- }
38341
- is0() {
38342
- return this.equals(Point.ZERO);
38343
- }
38344
- negate() {
38345
- return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T));
38346
- }
38347
- // Fast algo for doubling Extended Point.
38348
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd
38349
- // Cost: 4M + 4S + 1*a + 6add + 1*2.
38350
- double() {
38351
- const { a } = CURVE;
38352
- const { X: X1, Y: Y1, Z: Z1 } = this;
38353
- const A = modP(X1 * X1);
38354
- const B = modP(Y1 * Y1);
38355
- const C = modP(_2n2 * modP(Z1 * Z1));
38356
- const D = modP(a * A);
38357
- const x1y1 = X1 + Y1;
38358
- const E = modP(modP(x1y1 * x1y1) - A - B);
38359
- const G = D + B;
38360
- const F = G - C;
38361
- const H = D - B;
38362
- const X3 = modP(E * F);
38363
- const Y3 = modP(G * H);
38364
- const T3 = modP(E * H);
38365
- const Z3 = modP(F * G);
38366
- return new Point(X3, Y3, Z3, T3);
38367
- }
38368
- // Fast algo for adding 2 Extended Points.
38369
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd
38370
- // Cost: 9M + 1*a + 1*d + 7add.
38371
- add(other) {
38372
- aextpoint(other);
38373
- const { a, d } = CURVE;
38374
- const { X: X1, Y: Y1, Z: Z1, T: T1 } = this;
38375
- const { X: X2, Y: Y2, Z: Z2, T: T2 } = other;
38376
- const A = modP(X1 * X2);
38377
- const B = modP(Y1 * Y2);
38378
- const C = modP(T1 * d * T2);
38379
- const D = modP(Z1 * Z2);
38380
- const E = modP((X1 + Y1) * (X2 + Y2) - A - B);
38381
- const F = D - C;
38382
- const G = D + C;
38383
- const H = modP(B - a * A);
38384
- const X3 = modP(E * F);
38385
- const Y3 = modP(G * H);
38386
- const T3 = modP(E * H);
38387
- const Z3 = modP(F * G);
38388
- return new Point(X3, Y3, Z3, T3);
38389
- }
38390
- subtract(other) {
38391
- return this.add(other.negate());
38392
- }
38393
- // Constant-time multiplication.
38394
- multiply(scalar) {
38395
- if (!Fn2.isValidNot0(scalar))
38396
- throw new Error("invalid scalar: expected 1 <= sc < curve.n");
38397
- const { p, f } = wnaf.cached(this, scalar, (p2) => normalizeZ(Point, p2));
38398
- return normalizeZ(Point, [p, f])[0];
38399
- }
38400
- // Non-constant-time multiplication. Uses double-and-add algorithm.
38401
- // It's faster, but should only be used when you don't care about
38402
- // an exposed private key e.g. sig verification.
38403
- // Does NOT allow scalars higher than CURVE.n.
38404
- // Accepts optional accumulator to merge with multiply (important for sparse scalars)
38405
- multiplyUnsafe(scalar, acc = Point.ZERO) {
38406
- if (!Fn2.isValid(scalar))
38407
- throw new Error("invalid scalar: expected 0 <= sc < curve.n");
38408
- if (scalar === _0n4)
38409
- return Point.ZERO;
38410
- if (this.is0() || scalar === _1n4)
38411
- return this;
38412
- return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p), acc);
38413
- }
38414
- // Checks if point is of small order.
38415
- // If you add something to small order point, you will have "dirty"
38416
- // point with torsion component.
38417
- // Multiplies point by cofactor and checks if the result is 0.
38418
- isSmallOrder() {
38419
- return this.multiplyUnsafe(cofactor).is0();
38420
- }
38421
- // Multiplies point by curve order and checks if the result is 0.
38422
- // Returns `false` is the point is dirty.
38423
- isTorsionFree() {
38424
- return wnaf.unsafe(this, CURVE.n).is0();
38425
- }
38426
- // Converts Extended point to default (x, y) coordinates.
38427
- // Can accept precomputed Z^-1 - for example, from invertBatch.
38428
- toAffine(invertedZ) {
38429
- return toAffineMemo(this, invertedZ);
38430
- }
38431
- clearCofactor() {
38432
- if (cofactor === _1n4)
38433
- return this;
38434
- return this.multiplyUnsafe(cofactor);
38435
- }
38436
- toBytes() {
38437
- const { x, y } = this.toAffine();
38438
- const bytes = Fp2.toBytes(y);
38439
- bytes[bytes.length - 1] |= x & _1n4 ? 128 : 0;
38440
- return bytes;
38441
- }
38442
- toHex() {
38443
- return bytesToHex(this.toBytes());
38444
- }
38445
- toString() {
38446
- return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
38447
- }
38448
- // TODO: remove
38449
- get ex() {
38450
- return this.X;
38451
- }
38452
- get ey() {
38453
- return this.Y;
38454
- }
38455
- get ez() {
38456
- return this.Z;
38457
- }
38458
- get et() {
38459
- return this.T;
38460
- }
38461
- static normalizeZ(points) {
38462
- return normalizeZ(Point, points);
38463
- }
38464
- static msm(points, scalars) {
38465
- return pippenger(Point, Fn2, points, scalars);
38466
- }
38467
- _setWindowSize(windowSize) {
38468
- this.precompute(windowSize);
38469
- }
38470
- toRawBytes() {
38471
- return this.toBytes();
38472
- }
38473
- }
38474
- Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n4, modP(CURVE.Gx * CURVE.Gy));
38475
- Point.ZERO = new Point(_0n4, _1n4, _1n4, _0n4);
38476
- Point.Fp = Fp2;
38477
- Point.Fn = Fn2;
38478
- const wnaf = new wNAF(Point, Fn2.BITS);
38479
- Point.BASE.precompute(8);
38480
- return Point;
38481
- }
38482
- var PrimeEdwardsPoint = class {
38483
- constructor(ep) {
38484
- this.ep = ep;
38485
- }
38486
- // Static methods that must be implemented by subclasses
38487
- static fromBytes(_bytes) {
38488
- notImplemented();
38489
- }
38490
- static fromHex(_hex) {
38491
- notImplemented();
38492
- }
38493
- get x() {
38494
- return this.toAffine().x;
38495
- }
38496
- get y() {
38497
- return this.toAffine().y;
38498
- }
38499
- // Common implementations
38500
- clearCofactor() {
38501
- return this;
38502
- }
38503
- assertValidity() {
38504
- this.ep.assertValidity();
38505
- }
38506
- toAffine(invertedZ) {
38507
- return this.ep.toAffine(invertedZ);
38508
- }
38509
- toHex() {
38510
- return bytesToHex(this.toBytes());
38511
- }
38512
- toString() {
38513
- return this.toHex();
38514
- }
38515
- isTorsionFree() {
38516
- return true;
38517
- }
38518
- isSmallOrder() {
38519
- return false;
38520
- }
38521
- add(other) {
38522
- this.assertSame(other);
38523
- return this.init(this.ep.add(other.ep));
38524
- }
38525
- subtract(other) {
38526
- this.assertSame(other);
38527
- return this.init(this.ep.subtract(other.ep));
38528
- }
38529
- multiply(scalar) {
38530
- return this.init(this.ep.multiply(scalar));
38531
- }
38532
- multiplyUnsafe(scalar) {
38533
- return this.init(this.ep.multiplyUnsafe(scalar));
38534
- }
38535
- double() {
38536
- return this.init(this.ep.double());
38537
- }
38538
- negate() {
38539
- return this.init(this.ep.negate());
38540
- }
38541
- precompute(windowSize, isLazy) {
38542
- return this.init(this.ep.precompute(windowSize, isLazy));
38543
- }
38544
- /** @deprecated use `toBytes` */
38545
- toRawBytes() {
38546
- return this.toBytes();
38547
- }
38548
- };
38549
- function eddsa(Point, cHash, eddsaOpts = {}) {
38550
- if (typeof cHash !== "function")
38551
- throw new Error('"hash" function param is required');
38552
- _validateObject(eddsaOpts, {}, {
38553
- adjustScalarBytes: "function",
38554
- randomBytes: "function",
38555
- domain: "function",
38556
- prehash: "function",
38557
- mapToCurve: "function"
38558
- });
38559
- const { prehash } = eddsaOpts;
38560
- const { BASE, Fp: Fp2, Fn: Fn2 } = Point;
38561
- const randomBytes6 = eddsaOpts.randomBytes || randomBytes2;
38562
- const adjustScalarBytes2 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes);
38563
- const domain = eddsaOpts.domain || ((data, ctx, phflag) => {
38564
- _abool2(phflag, "phflag");
38565
- if (ctx.length || phflag)
38566
- throw new Error("Contexts/pre-hash are not supported");
38567
- return data;
38568
- });
38569
- function modN_LE(hash) {
38570
- return Fn2.create(bytesToNumberLE(hash));
38571
- }
38572
- function getPrivateScalar(key) {
38573
- const len = lengths.secretKey;
38574
- key = ensureBytes("private key", key, len);
38575
- const hashed = ensureBytes("hashed private key", cHash(key), 2 * len);
38576
- const head = adjustScalarBytes2(hashed.slice(0, len));
38577
- const prefix = hashed.slice(len, 2 * len);
38578
- const scalar = modN_LE(head);
38579
- return { head, prefix, scalar };
38580
- }
38581
- function getExtendedPublicKey(secretKey) {
38582
- const { head, prefix, scalar } = getPrivateScalar(secretKey);
38583
- const point = BASE.multiply(scalar);
38584
- const pointBytes = point.toBytes();
38585
- return { head, prefix, scalar, point, pointBytes };
38586
- }
38587
- function getPublicKey(secretKey) {
38588
- return getExtendedPublicKey(secretKey).pointBytes;
38589
- }
38590
- function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
38591
- const msg = concatBytes(...msgs);
38592
- return modN_LE(cHash(domain(msg, ensureBytes("context", context), !!prehash)));
38593
- }
38594
- function sign(msg, secretKey, options = {}) {
38595
- msg = ensureBytes("message", msg);
38596
- if (prehash)
38597
- msg = prehash(msg);
38598
- const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey);
38599
- const r = hashDomainToScalar(options.context, prefix, msg);
38600
- const R = BASE.multiply(r).toBytes();
38601
- const k = hashDomainToScalar(options.context, R, pointBytes, msg);
38602
- const s = Fn2.create(r + k * scalar);
38603
- if (!Fn2.isValid(s))
38604
- throw new Error("sign failed: invalid s");
38605
- const rs = concatBytes(R, Fn2.toBytes(s));
38606
- return _abytes2(rs, lengths.signature, "result");
38607
- }
38608
- const verifyOpts = { zip215: true };
38609
- function verify(sig, msg, publicKey, options = verifyOpts) {
38610
- const { context, zip215 } = options;
38611
- const len = lengths.signature;
38612
- sig = ensureBytes("signature", sig, len);
38613
- msg = ensureBytes("message", msg);
38614
- publicKey = ensureBytes("publicKey", publicKey, lengths.publicKey);
38615
- if (zip215 !== void 0)
38616
- _abool2(zip215, "zip215");
38617
- if (prehash)
38618
- msg = prehash(msg);
38619
- const mid = len / 2;
38620
- const r = sig.subarray(0, mid);
38621
- const s = bytesToNumberLE(sig.subarray(mid, len));
38622
- let A, R, SB;
38623
- try {
38624
- A = Point.fromBytes(publicKey, zip215);
38625
- R = Point.fromBytes(r, zip215);
38626
- SB = BASE.multiplyUnsafe(s);
38627
- } catch (error) {
38628
- return false;
38629
- }
38630
- if (!zip215 && A.isSmallOrder())
38631
- return false;
38632
- const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg);
38633
- const RkA = R.add(A.multiplyUnsafe(k));
38634
- return RkA.subtract(SB).clearCofactor().is0();
38635
- }
38636
- const _size = Fp2.BYTES;
38637
- const lengths = {
38638
- secretKey: _size,
38639
- publicKey: _size,
38640
- signature: 2 * _size,
38641
- seed: _size
38642
- };
38643
- function randomSecretKey(seed = randomBytes6(lengths.seed)) {
38644
- return _abytes2(seed, lengths.seed, "seed");
38645
- }
38646
- function keygen(seed) {
38647
- const secretKey = utils.randomSecretKey(seed);
38648
- return { secretKey, publicKey: getPublicKey(secretKey) };
38649
- }
38650
- function isValidSecretKey(key) {
38651
- return isBytes(key) && key.length === Fn2.BYTES;
38652
- }
38653
- function isValidPublicKey(key, zip215) {
38654
- try {
38655
- return !!Point.fromBytes(key, zip215);
38656
- } catch (error) {
38657
- return false;
38658
- }
38659
- }
38660
- const utils = {
38661
- getExtendedPublicKey,
38662
- randomSecretKey,
38663
- isValidSecretKey,
38664
- isValidPublicKey,
38665
- /**
38666
- * Converts ed public key to x public key. Uses formula:
38667
- * - ed25519:
38668
- * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)`
38669
- * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))`
38670
- * - ed448:
38671
- * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)`
38672
- * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))`
38673
- */
38674
- toMontgomery(publicKey) {
38675
- const { y } = Point.fromBytes(publicKey);
38676
- const size = lengths.publicKey;
38677
- const is25519 = size === 32;
38678
- if (!is25519 && size !== 57)
38679
- throw new Error("only defined for 25519 and 448");
38680
- const u = is25519 ? Fp2.div(_1n4 + y, _1n4 - y) : Fp2.div(y - _1n4, y + _1n4);
38681
- return Fp2.toBytes(u);
38682
- },
38683
- toMontgomerySecret(secretKey) {
38684
- const size = lengths.secretKey;
38685
- _abytes2(secretKey, size);
38686
- const hashed = cHash(secretKey.subarray(0, size));
38687
- return adjustScalarBytes2(hashed).subarray(0, size);
38688
- },
38689
- /** @deprecated */
38690
- randomPrivateKey: randomSecretKey,
38691
- /** @deprecated */
38692
- precompute(windowSize = 8, point = Point.BASE) {
38693
- return point.precompute(windowSize, false);
38694
- }
38695
- };
38696
- return Object.freeze({
38697
- keygen,
38698
- getPublicKey,
38699
- sign,
38700
- verify,
38701
- utils,
38702
- Point,
38703
- lengths
38704
- });
38705
- }
38706
- function _eddsa_legacy_opts_to_new(c) {
38707
- const CURVE = {
38708
- a: c.a,
38709
- d: c.d,
38710
- p: c.Fp.ORDER,
38711
- n: c.n,
38712
- h: c.h,
38713
- Gx: c.Gx,
38714
- Gy: c.Gy
38715
- };
38716
- const Fp2 = c.Fp;
38717
- const Fn2 = Field(CURVE.n, c.nBitLength, true);
38718
- const curveOpts = { Fp: Fp2, Fn: Fn2, uvRatio: c.uvRatio };
38719
- const eddsaOpts = {
38720
- randomBytes: c.randomBytes,
38721
- adjustScalarBytes: c.adjustScalarBytes,
38722
- domain: c.domain,
38723
- prehash: c.prehash,
38724
- mapToCurve: c.mapToCurve
38725
- };
38726
- return { CURVE, curveOpts, hash: c.hash, eddsaOpts };
38727
- }
38728
- function _eddsa_new_output_to_legacy(c, eddsa2) {
38729
- const Point = eddsa2.Point;
38730
- const legacy = Object.assign({}, eddsa2, {
38731
- ExtendedPoint: Point,
38732
- CURVE: c,
38733
- nBitLength: Point.Fn.BITS,
38734
- nByteLength: Point.Fn.BYTES
38735
- });
38736
- return legacy;
38737
- }
38738
- function twistedEdwards(c) {
38739
- const { CURVE, curveOpts, hash, eddsaOpts } = _eddsa_legacy_opts_to_new(c);
38740
- const Point = edwards(CURVE, curveOpts);
38741
- const EDDSA = eddsa(Point, hash, eddsaOpts);
38742
- return _eddsa_new_output_to_legacy(c, EDDSA);
38743
- }
38744
-
38745
- // node_modules/@noble/curves/esm/ed25519.js
38746
- var _0n5 = /* @__PURE__ */ BigInt(0);
38747
- var _1n5 = BigInt(1);
38748
- var _2n3 = BigInt(2);
38749
- var _3n2 = BigInt(3);
38750
- var _5n2 = BigInt(5);
38751
- var _8n3 = BigInt(8);
38752
- var ed25519_CURVE_p = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");
38753
- var ed25519_CURVE = /* @__PURE__ */ (() => ({
38754
- p: ed25519_CURVE_p,
38755
- n: BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),
38756
- h: _8n3,
38757
- a: BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),
38758
- d: BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),
38759
- Gx: BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),
38760
- Gy: BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")
38761
- }))();
38762
- function ed25519_pow_2_252_3(x) {
38763
- const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);
38764
- const P = ed25519_CURVE_p;
38765
- const x2 = x * x % P;
38766
- const b2 = x2 * x % P;
38767
- const b4 = pow2(b2, _2n3, P) * b2 % P;
38768
- const b5 = pow2(b4, _1n5, P) * x % P;
38769
- const b10 = pow2(b5, _5n2, P) * b5 % P;
38770
- const b20 = pow2(b10, _10n, P) * b10 % P;
38771
- const b40 = pow2(b20, _20n, P) * b20 % P;
38772
- const b80 = pow2(b40, _40n, P) * b40 % P;
38773
- const b160 = pow2(b80, _80n, P) * b80 % P;
38774
- const b240 = pow2(b160, _80n, P) * b80 % P;
38775
- const b250 = pow2(b240, _10n, P) * b10 % P;
38776
- const pow_p_5_8 = pow2(b250, _2n3, P) * x % P;
38777
- return { pow_p_5_8, b2 };
38778
- }
38779
- function adjustScalarBytes(bytes) {
38780
- bytes[0] &= 248;
38781
- bytes[31] &= 127;
38782
- bytes[31] |= 64;
38783
- return bytes;
38784
- }
38785
- var ED25519_SQRT_M1 = /* @__PURE__ */ BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");
38786
- function uvRatio(u, v) {
38787
- const P = ed25519_CURVE_p;
38788
- const v3 = mod(v * v * v, P);
38789
- const v7 = mod(v3 * v3 * v, P);
38790
- const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8;
38791
- let x = mod(u * v3 * pow, P);
38792
- const vx2 = mod(v * x * x, P);
38793
- const root1 = x;
38794
- const root2 = mod(x * ED25519_SQRT_M1, P);
38795
- const useRoot1 = vx2 === u;
38796
- const useRoot2 = vx2 === mod(-u, P);
38797
- const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P);
38798
- if (useRoot1)
38799
- x = root1;
38800
- if (useRoot2 || noRoot)
38801
- x = root2;
38802
- if (isNegativeLE(x, P))
38803
- x = mod(-x, P);
38804
- return { isValid: useRoot1 || useRoot2, value: x };
38805
- }
38806
- var Fp = /* @__PURE__ */ (() => Field(ed25519_CURVE.p, { isLE: true }))();
38807
- var Fn = /* @__PURE__ */ (() => Field(ed25519_CURVE.n, { isLE: true }))();
38808
- var ed25519Defaults = /* @__PURE__ */ (() => ({
38809
- ...ed25519_CURVE,
38810
- Fp,
38811
- hash: sha512,
38812
- adjustScalarBytes,
38813
- // dom2
38814
- // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3.
38815
- // Constant-time, u/√v
38816
- uvRatio
38817
- }))();
38818
- var ed25519 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))();
38819
- var SQRT_M1 = ED25519_SQRT_M1;
38820
- var SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235");
38821
- var INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578");
38822
- var ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838");
38823
- var D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");
38824
- var invertSqrt = (number) => uvRatio(_1n5, number);
38825
- var MAX_255B = /* @__PURE__ */ BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
38826
- var bytes255ToNumberLE = (bytes) => ed25519.Point.Fp.create(bytesToNumberLE(bytes) & MAX_255B);
38827
- function calcElligatorRistrettoMap(r0) {
38828
- const { d } = ed25519_CURVE;
38829
- const P = ed25519_CURVE_p;
38830
- const mod2 = (n) => Fp.create(n);
38831
- const r = mod2(SQRT_M1 * r0 * r0);
38832
- const Ns = mod2((r + _1n5) * ONE_MINUS_D_SQ);
38833
- let c = BigInt(-1);
38834
- const D = mod2((c - d * r) * mod2(r + d));
38835
- let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D);
38836
- let s_ = mod2(s * r0);
38837
- if (!isNegativeLE(s_, P))
38838
- s_ = mod2(-s_);
38839
- if (!Ns_D_is_sq)
38840
- s = s_;
38841
- if (!Ns_D_is_sq)
38842
- c = r;
38843
- const Nt = mod2(c * (r - _1n5) * D_MINUS_ONE_SQ - D);
38844
- const s2 = s * s;
38845
- const W0 = mod2((s + s) * D);
38846
- const W1 = mod2(Nt * SQRT_AD_MINUS_ONE);
38847
- const W2 = mod2(_1n5 - s2);
38848
- const W3 = mod2(_1n5 + s2);
38849
- return new ed25519.Point(mod2(W0 * W3), mod2(W2 * W1), mod2(W1 * W3), mod2(W0 * W2));
38850
- }
38851
- function ristretto255_map(bytes) {
38852
- abytes(bytes, 64);
38853
- const r1 = bytes255ToNumberLE(bytes.subarray(0, 32));
38854
- const R1 = calcElligatorRistrettoMap(r1);
38855
- const r2 = bytes255ToNumberLE(bytes.subarray(32, 64));
38856
- const R2 = calcElligatorRistrettoMap(r2);
38857
- return new _RistrettoPoint(R1.add(R2));
38858
- }
38859
- var _RistrettoPoint = class __RistrettoPoint extends PrimeEdwardsPoint {
38860
- constructor(ep) {
38861
- super(ep);
38862
- }
38863
- static fromAffine(ap) {
38864
- return new __RistrettoPoint(ed25519.Point.fromAffine(ap));
38865
- }
38866
- assertSame(other) {
38867
- if (!(other instanceof __RistrettoPoint))
38868
- throw new Error("RistrettoPoint expected");
38869
- }
38870
- init(ep) {
38871
- return new __RistrettoPoint(ep);
38872
- }
38873
- /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */
38874
- static hashToCurve(hex) {
38875
- return ristretto255_map(ensureBytes("ristrettoHash", hex, 64));
38876
- }
38877
- static fromBytes(bytes) {
38878
- abytes(bytes, 32);
38879
- const { a, d } = ed25519_CURVE;
38880
- const P = ed25519_CURVE_p;
38881
- const mod2 = (n) => Fp.create(n);
38882
- const s = bytes255ToNumberLE(bytes);
38883
- if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P))
38884
- throw new Error("invalid ristretto255 encoding 1");
38885
- const s2 = mod2(s * s);
38886
- const u1 = mod2(_1n5 + a * s2);
38887
- const u2 = mod2(_1n5 - a * s2);
38888
- const u1_2 = mod2(u1 * u1);
38889
- const u2_2 = mod2(u2 * u2);
38890
- const v = mod2(a * d * u1_2 - u2_2);
38891
- const { isValid, value: I } = invertSqrt(mod2(v * u2_2));
38892
- const Dx = mod2(I * u2);
38893
- const Dy = mod2(I * Dx * v);
38894
- let x = mod2((s + s) * Dx);
38895
- if (isNegativeLE(x, P))
38896
- x = mod2(-x);
38897
- const y = mod2(u1 * Dy);
38898
- const t = mod2(x * y);
38899
- if (!isValid || isNegativeLE(t, P) || y === _0n5)
38900
- throw new Error("invalid ristretto255 encoding 2");
38901
- return new __RistrettoPoint(new ed25519.Point(x, y, _1n5, t));
38902
- }
38903
- /**
38904
- * Converts ristretto-encoded string to ristretto point.
38905
- * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode).
38906
- * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding
38907
- */
38908
- static fromHex(hex) {
38909
- return __RistrettoPoint.fromBytes(ensureBytes("ristrettoHex", hex, 32));
38910
- }
38911
- static msm(points, scalars) {
38912
- return pippenger(__RistrettoPoint, ed25519.Point.Fn, points, scalars);
38913
- }
38914
- /**
38915
- * Encodes ristretto point to Uint8Array.
38916
- * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode).
38917
- */
38918
- toBytes() {
38919
- let { X, Y, Z, T } = this.ep;
38920
- const P = ed25519_CURVE_p;
38921
- const mod2 = (n) => Fp.create(n);
38922
- const u1 = mod2(mod2(Z + Y) * mod2(Z - Y));
38923
- const u2 = mod2(X * Y);
38924
- const u2sq = mod2(u2 * u2);
38925
- const { value: invsqrt } = invertSqrt(mod2(u1 * u2sq));
38926
- const D1 = mod2(invsqrt * u1);
38927
- const D2 = mod2(invsqrt * u2);
38928
- const zInv = mod2(D1 * D2 * T);
38929
- let D;
38930
- if (isNegativeLE(T * zInv, P)) {
38931
- let _x = mod2(Y * SQRT_M1);
38932
- let _y = mod2(X * SQRT_M1);
38933
- X = _x;
38934
- Y = _y;
38935
- D = mod2(D1 * INVSQRT_A_MINUS_D);
38936
- } else {
38937
- D = D2;
38938
- }
38939
- if (isNegativeLE(X * zInv, P))
38940
- Y = mod2(-Y);
38941
- let s = mod2((Z - Y) * D);
38942
- if (isNegativeLE(s, P))
38943
- s = mod2(-s);
38944
- return Fp.toBytes(s);
38945
- }
38946
- /**
38947
- * Compares two Ristretto points.
38948
- * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals).
38949
- */
38950
- equals(other) {
38951
- this.assertSame(other);
38952
- const { X: X1, Y: Y1 } = this.ep;
38953
- const { X: X2, Y: Y2 } = other.ep;
38954
- const mod2 = (n) => Fp.create(n);
38955
- const one = mod2(X1 * Y2) === mod2(Y1 * X2);
38956
- const two = mod2(Y1 * Y2) === mod2(X1 * X2);
38957
- return one || two;
38958
- }
38959
- is0() {
38960
- return this.equals(__RistrettoPoint.ZERO);
38961
- }
38962
- };
38963
- _RistrettoPoint.BASE = /* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.BASE))();
38964
- _RistrettoPoint.ZERO = /* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.ZERO))();
38965
- _RistrettoPoint.Fp = /* @__PURE__ */ (() => Fp)();
38966
- _RistrettoPoint.Fn = /* @__PURE__ */ (() => Fn)();
38967
-
38968
- // node_modules/@noble/hashes/esm/sha256.js
38969
- var sha2562 = sha256;
36847
+ // src/signing-committed.ts
36848
+ var import_ed25519 = require("@noble/curves/ed25519");
36849
+ var import_sha2563 = require("@noble/hashes/sha256");
36850
+ var import_utils3 = require("@noble/hashes/utils");
38970
36851
 
38971
36852
  // src/commitments/merkle.ts
36853
+ var import_sha256 = require("@noble/hashes/sha256");
36854
+ var import_utils = require("@noble/hashes/utils");
38972
36855
  var DOMAIN_LEAF = 0;
38973
36856
  var DOMAIN_INTERNAL = 1;
38974
36857
  function hashLeaf(leafBytes) {
38975
36858
  const buf = new Uint8Array(leafBytes.length + 1);
38976
36859
  buf[0] = DOMAIN_LEAF;
38977
36860
  buf.set(leafBytes, 1);
38978
- return sha2562(buf);
36861
+ return (0, import_sha256.sha256)(buf);
38979
36862
  }
38980
36863
  function hashInternal(left, right) {
38981
36864
  const buf = new Uint8Array(left.length + right.length + 1);
38982
36865
  buf[0] = DOMAIN_INTERNAL;
38983
36866
  buf.set(left, 1);
38984
36867
  buf.set(right, 1 + left.length);
38985
- return sha2562(buf);
36868
+ return (0, import_sha256.sha256)(buf);
38986
36869
  }
38987
36870
  function merkleRoot(leafHashes) {
38988
36871
  if (leafHashes.length === 0) {
@@ -39011,7 +36894,7 @@ function generateProof(leafHashes, index) {
39011
36894
  return {
39012
36895
  index,
39013
36896
  treeSize: leafHashes.length,
39014
- siblings: siblings.map((s) => bytesToHex(s))
36897
+ siblings: siblings.map((s) => (0, import_utils.bytesToHex)(s))
39015
36898
  };
39016
36899
  }
39017
36900
  function collectPath(leaves, index, out) {
@@ -39036,6 +36919,9 @@ function largestPowerOfTwoLessThan(n) {
39036
36919
  }
39037
36920
 
39038
36921
  // src/commitments/primitives.ts
36922
+ var import_sha2562 = require("@noble/hashes/sha256");
36923
+ var import_hmac = require("@noble/hashes/hmac");
36924
+ var import_utils2 = require("@noble/hashes/utils");
39039
36925
  function jcs(value) {
39040
36926
  if (value === null || value === void 0) return "null";
39041
36927
  if (typeof value === "boolean" || typeof value === "number")
@@ -39086,7 +36972,7 @@ function leavesFromFields(fields) {
39086
36972
 
39087
36973
  // src/signing-committed.ts
39088
36974
  function freshSalt() {
39089
- return randomBytes2(32);
36975
+ return (0, import_utils3.randomBytes)(32);
39090
36976
  }
39091
36977
  function signCommittedDecision(entry, committedFieldNames, signingKey, publicKey, kid, issuer) {
39092
36978
  const allFields = {
@@ -39126,7 +37012,7 @@ function signCommittedDecision(entry, committedFieldNames, signingKey, publicKey
39126
37012
  const { sorted, leafBytes } = leavesFromFields(committedFields);
39127
37013
  const leafHashes = leafBytes.map(hashLeaf);
39128
37014
  const root = merkleRoot(leafHashes);
39129
- committedFieldsRoot = bytesToHex(root);
37015
+ committedFieldsRoot = (0, import_utils3.bytesToHex)(root);
39130
37016
  sorted.forEach((f, i) => {
39131
37017
  openings[f.name] = { name: f.name, value: f.value, salt: f.salt, index: i };
39132
37018
  });
@@ -39143,8 +37029,8 @@ function signCommittedDecision(entry, committedFieldNames, signingKey, publicKey
39143
37029
  payload.committed_field_names = committedFields.map((f) => f.name);
39144
37030
  }
39145
37031
  const canonical = jcs(payload);
39146
- const messageHash = sha2562(new TextEncoder().encode(canonical));
39147
- const signatureBytes = ed25519.sign(messageHash, hexToBytes(signingKey));
37032
+ const messageHash = (0, import_sha2563.sha256)(new TextEncoder().encode(canonical));
37033
+ const signatureBytes = import_ed25519.ed25519.sign(messageHash, (0, import_utils3.hexToBytes)(signingKey));
39148
37034
  const signedReceipt = {
39149
37035
  ...payload,
39150
37036
  signature: {
@@ -39157,7 +37043,7 @@ function signCommittedDecision(entry, committedFieldNames, signingKey, publicKey
39157
37043
  }
39158
37044
  };
39159
37045
  const signedJson = JSON.stringify(signedReceipt);
39160
- const receiptHash = bytesToHex(sha2562(new TextEncoder().encode(jcs(signedReceipt))));
37046
+ const receiptHash = (0, import_utils3.bytesToHex)((0, import_sha2563.sha256)(new TextEncoder().encode(jcs(signedReceipt))));
39161
37047
  return {
39162
37048
  signed: signedJson,
39163
37049
  artifact_type: "decision_receipt_committed_v1",
@@ -41584,6 +39470,10 @@ MIT
41584
39470
 
41585
39471
  // src/webauthn-approval.ts
41586
39472
  var import_node_crypto7 = require("crypto");
39473
+ var import_p256 = require("@noble/curves/p256");
39474
+ var import_ed255192 = require("@noble/curves/ed25519");
39475
+ var import_sha2564 = require("@noble/hashes/sha256");
39476
+ var import_utils4 = require("@noble/hashes/utils");
41587
39477
  function createApprovalChallenge(requestId, toolName, agentId, rpId = "scopeblind.com", timeoutSeconds = 300) {
41588
39478
  const challengeBytes = (0, import_node_crypto7.randomBytes)(32);
41589
39479
  const contextHash = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify({ requestId, toolName, agentId, timestamp: Date.now() })).digest("hex");
@@ -41615,43 +39505,72 @@ function toCredentialRequestOptions(challenge, allowCredentials) {
41615
39505
  }
41616
39506
  };
41617
39507
  }
41618
- function verifyApprovalAssertion(challenge, assertion) {
39508
+ function verifyApprovalAssertion(challenge, assertion, credentialPublicKey, opts = {}) {
39509
+ const now = opts.now ?? Date.now();
39510
+ const fail = (reason, partial = {}) => ({
39511
+ valid: false,
39512
+ reason,
39513
+ credentialId: assertion.credentialId,
39514
+ authenticatorType: "unknown",
39515
+ userVerified: false,
39516
+ signCount: 0,
39517
+ contextHash: challenge.contextHash,
39518
+ approvedAt: new Date(now).toISOString(),
39519
+ ...partial
39520
+ });
41619
39521
  const createdAt = new Date(challenge.createdAt).getTime();
41620
- const now = Date.now();
41621
- if (now - createdAt > challenge.timeoutSeconds * 1e3) {
41622
- return {
41623
- valid: false,
41624
- credentialId: assertion.credentialId,
41625
- authenticatorType: "unknown",
41626
- userVerified: false,
41627
- signCount: 0,
41628
- contextHash: challenge.contextHash,
41629
- approvedAt: (/* @__PURE__ */ new Date()).toISOString()
41630
- };
39522
+ if (now - createdAt > challenge.timeoutSeconds * 1e3) return fail("challenge_expired");
39523
+ if (!credentialPublicKey?.publicKeyHex) return fail("missing_credential_public_key");
39524
+ const clientDataBytes = base64urlDecode(assertion.clientDataJSON);
39525
+ let clientData;
39526
+ try {
39527
+ clientData = JSON.parse(Buffer.from(clientDataBytes).toString("utf8"));
39528
+ } catch {
39529
+ return fail("client_data_parse_error");
41631
39530
  }
39531
+ if (clientData.type !== "webauthn.get") return fail("wrong_client_data_type");
39532
+ if (!constantTimeStrEqual(clientData.challenge ?? "", challenge.challenge)) return fail("challenge_mismatch");
39533
+ const allowedOrigins = opts.expectedOrigin ? Array.isArray(opts.expectedOrigin) ? opts.expectedOrigin : [opts.expectedOrigin] : [`https://${challenge.rpId}`];
39534
+ if (!clientData.origin || !allowedOrigins.includes(clientData.origin)) return fail("origin_mismatch");
41632
39535
  const authData = base64urlDecode(assertion.authenticatorData);
39536
+ if (authData.length < 37) return fail("authenticator_data_too_short");
39537
+ const rpIdHash = authData.slice(0, 32);
39538
+ const expectedRpIdHash = (0, import_sha2564.sha256)(new TextEncoder().encode(challenge.rpId));
39539
+ if (!bytesEqual(rpIdHash, expectedRpIdHash)) return fail("rp_id_hash_mismatch");
41633
39540
  const flags = authData[32];
41634
39541
  const userPresent = !!(flags & 1);
41635
39542
  const userVerified = !!(flags & 4);
41636
- const attestedCredData = !!(flags & 64);
41637
- const signCount = authData.length >= 37 ? authData[33] << 24 | authData[34] << 16 | authData[35] << 8 | authData[36] : 0;
41638
- let authenticatorType = "unknown";
39543
+ if (!userPresent) return fail("user_not_present");
39544
+ if ((opts.requireUserVerification ?? true) && !userVerified) return fail("user_verification_required", { userVerified });
39545
+ const signCount = authData[33] << 24 | authData[34] << 16 | authData[35] << 8 | authData[36];
39546
+ if (typeof opts.prevSignCount === "number" && signCount !== 0 && signCount <= opts.prevSignCount) {
39547
+ return fail("sign_count_regression", { userVerified, signCount });
39548
+ }
39549
+ const signedData = concatBytes(authData, (0, import_sha2564.sha256)(clientDataBytes));
39550
+ const sigBytes = base64urlDecode(assertion.signature);
39551
+ let sigOk = false;
41639
39552
  try {
41640
- const clientData = JSON.parse(Buffer.from(base64urlDecode(assertion.clientDataJSON)).toString());
41641
- if (clientData.type === "webauthn.get") {
41642
- authenticatorType = "platform";
39553
+ if (credentialPublicKey.alg === -7) {
39554
+ sigOk = import_p256.p256.verify(sigBytes, (0, import_sha2564.sha256)(signedData), (0, import_utils4.hexToBytes)(credentialPublicKey.publicKeyHex), { format: "der" });
39555
+ } else if (credentialPublicKey.alg === -8) {
39556
+ sigOk = import_ed255192.ed25519.verify(sigBytes, signedData, (0, import_utils4.hexToBytes)(credentialPublicKey.publicKeyHex));
39557
+ } else {
39558
+ return fail("unsupported_algorithm", { userVerified, signCount });
41643
39559
  }
41644
39560
  } catch {
39561
+ sigOk = false;
41645
39562
  }
39563
+ if (!sigOk) return fail("invalid_signature", { userVerified, signCount });
41646
39564
  return {
41647
- valid: userPresent,
41648
- // At minimum, user must be present
39565
+ valid: true,
41649
39566
  credentialId: assertion.credentialId,
41650
- authenticatorType,
39567
+ // Heuristic: platform authenticators (TouchID/FaceID/Hello) report UV; roaming
39568
+ // keys without a PIN are UP-only. Attachment is authoritative only at registration.
39569
+ authenticatorType: userVerified ? "platform" : "cross-platform",
41651
39570
  userVerified,
41652
39571
  signCount,
41653
39572
  contextHash: challenge.contextHash,
41654
- approvedAt: (/* @__PURE__ */ new Date()).toISOString()
39573
+ approvedAt: new Date(now).toISOString()
41655
39574
  };
41656
39575
  }
41657
39576
  function createApprovalReceiptPayload(challenge, result) {
@@ -41677,6 +39596,22 @@ function base64urlDecode(str) {
41677
39596
  const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
41678
39597
  return new Uint8Array(Buffer.from(padded, "base64"));
41679
39598
  }
39599
+ function concatBytes(a, b) {
39600
+ const out = new Uint8Array(a.length + b.length);
39601
+ out.set(a, 0);
39602
+ out.set(b, a.length);
39603
+ return out;
39604
+ }
39605
+ function bytesEqual(a, b) {
39606
+ if (a.length !== b.length) return false;
39607
+ return (0, import_node_crypto7.timingSafeEqual)(Buffer.from(a), Buffer.from(b));
39608
+ }
39609
+ function constantTimeStrEqual(a, b) {
39610
+ const ab = Buffer.from(a, "utf8");
39611
+ const bb = Buffer.from(b, "utf8");
39612
+ if (ab.length !== bb.length) return false;
39613
+ return (0, import_node_crypto7.timingSafeEqual)(ab, bb);
39614
+ }
41680
39615
 
41681
39616
  // src/did-vc.ts
41682
39617
  function ed25519ToDIDKey(publicKeyHex) {
@@ -42787,15 +40722,3 @@ function createSandboxServer() {
42787
40722
  *
42788
40723
  * @license MIT
42789
40724
  */
42790
- /*! Bundled license information:
42791
-
42792
- @noble/hashes/esm/utils.js:
42793
- (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
42794
-
42795
- @noble/curves/esm/utils.js:
42796
- @noble/curves/esm/abstract/modular.js:
42797
- @noble/curves/esm/abstract/curve.js:
42798
- @noble/curves/esm/abstract/edwards.js:
42799
- @noble/curves/esm/ed25519.js:
42800
- (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
42801
- */