@learncard/simple-signing-plugin 1.1.8 → 1.1.9

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.
@@ -548,10 +548,10 @@ function $constructor(name, initializer3, params) {
548
548
  let Definition = _Definition;
549
549
  Object.defineProperty(Definition, "name", { value: name });
550
550
  function _(def) {
551
- var _a7;
551
+ var _a2;
552
552
  const inst = params?.Parent ? new Definition() : this;
553
553
  init(inst, def);
554
- (_a7 = inst._zod).deferred ?? (_a7.deferred = []);
554
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
555
555
  for (const fn of inst._zod.deferred) {
556
556
  fn();
557
557
  }
@@ -1177,8 +1177,8 @@ function aborted(x, startIndex = 0) {
1177
1177
  __name(aborted, "aborted");
1178
1178
  function prefixIssues(path, issues) {
1179
1179
  return issues.map((iss) => {
1180
- var _a7;
1181
- (_a7 = iss).path ?? (_a7.path = []);
1180
+ var _a2;
1181
+ (_a2 = iss).path ?? (_a2.path = []);
1182
1182
  iss.path.unshift(path);
1183
1183
  return iss;
1184
1184
  });
@@ -1359,7 +1359,7 @@ __name(formatError, "formatError");
1359
1359
  function treeifyError(error46, mapper = (issue2) => issue2.message) {
1360
1360
  const result = { errors: [] };
1361
1361
  const processError = /* @__PURE__ */ __name((error47, path = []) => {
1362
- var _a7, _b;
1362
+ var _a2, _b;
1363
1363
  for (const issue2 of error47.issues) {
1364
1364
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1365
1365
  issue2.errors.map((issues) => processError({ issues }, issue2.path));
@@ -1380,7 +1380,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
1380
1380
  const terminal = i === fullpath.length - 1;
1381
1381
  if (typeof el === "string") {
1382
1382
  curr.properties ?? (curr.properties = {});
1383
- (_a7 = curr.properties)[el] ?? (_a7[el] = { errors: [] });
1383
+ (_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] });
1384
1384
  curr = curr.properties[el];
1385
1385
  } else {
1386
1386
  curr.items ?? (curr.items = []);
@@ -1683,10 +1683,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
1683
1683
 
1684
1684
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/checks.js
1685
1685
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
1686
- var _a7;
1686
+ var _a2;
1687
1687
  inst._zod ?? (inst._zod = {});
1688
1688
  inst._zod.def = def;
1689
- (_a7 = inst._zod).onattach ?? (_a7.onattach = []);
1689
+ (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
1690
1690
  });
1691
1691
  var numericOriginMap = {
1692
1692
  number: "number",
@@ -1752,8 +1752,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
1752
1752
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
1753
1753
  $ZodCheck.init(inst, def);
1754
1754
  inst._zod.onattach.push((inst2) => {
1755
- var _a7;
1756
- (_a7 = inst2._zod.bag).multipleOf ?? (_a7.multipleOf = def.value);
1755
+ var _a2;
1756
+ (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
1757
1757
  });
1758
1758
  inst._zod.check = (payload) => {
1759
1759
  if (typeof payload.value !== typeof def.value)
@@ -1880,9 +1880,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
1880
1880
  };
1881
1881
  });
1882
1882
  var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1883
- var _a7;
1883
+ var _a2;
1884
1884
  $ZodCheck.init(inst, def);
1885
- (_a7 = inst._zod.def).when ?? (_a7.when = (payload) => {
1885
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1886
1886
  const val = payload.value;
1887
1887
  return !nullish(val) && val.size !== void 0;
1888
1888
  });
@@ -1908,9 +1908,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
1908
1908
  };
1909
1909
  });
1910
1910
  var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1911
- var _a7;
1911
+ var _a2;
1912
1912
  $ZodCheck.init(inst, def);
1913
- (_a7 = inst._zod.def).when ?? (_a7.when = (payload) => {
1913
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1914
1914
  const val = payload.value;
1915
1915
  return !nullish(val) && val.size !== void 0;
1916
1916
  });
@@ -1936,9 +1936,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
1936
1936
  };
1937
1937
  });
1938
1938
  var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1939
- var _a7;
1939
+ var _a2;
1940
1940
  $ZodCheck.init(inst, def);
1941
- (_a7 = inst._zod.def).when ?? (_a7.when = (payload) => {
1941
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1942
1942
  const val = payload.value;
1943
1943
  return !nullish(val) && val.size !== void 0;
1944
1944
  });
@@ -1966,9 +1966,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
1966
1966
  };
1967
1967
  });
1968
1968
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1969
- var _a7;
1969
+ var _a2;
1970
1970
  $ZodCheck.init(inst, def);
1971
- (_a7 = inst._zod.def).when ?? (_a7.when = (payload) => {
1971
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
1972
1972
  const val = payload.value;
1973
1973
  return !nullish(val) && val.length !== void 0;
1974
1974
  });
@@ -1995,9 +1995,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
1995
1995
  };
1996
1996
  });
1997
1997
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1998
- var _a7;
1998
+ var _a2;
1999
1999
  $ZodCheck.init(inst, def);
2000
- (_a7 = inst._zod.def).when ?? (_a7.when = (payload) => {
2000
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
2001
2001
  const val = payload.value;
2002
2002
  return !nullish(val) && val.length !== void 0;
2003
2003
  });
@@ -2024,9 +2024,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
2024
2024
  };
2025
2025
  });
2026
2026
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
2027
- var _a7;
2027
+ var _a2;
2028
2028
  $ZodCheck.init(inst, def);
2029
- (_a7 = inst._zod.def).when ?? (_a7.when = (payload) => {
2029
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
2030
2030
  const val = payload.value;
2031
2031
  return !nullish(val) && val.length !== void 0;
2032
2032
  });
@@ -2055,7 +2055,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2055
2055
  };
2056
2056
  });
2057
2057
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
2058
- var _a7, _b;
2058
+ var _a2, _b;
2059
2059
  $ZodCheck.init(inst, def);
2060
2060
  inst._zod.onattach.push((inst2) => {
2061
2061
  const bag = inst2._zod.bag;
@@ -2066,7 +2066,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
2066
2066
  }
2067
2067
  });
2068
2068
  if (def.pattern)
2069
- (_a7 = inst._zod).check ?? (_a7.check = (payload) => {
2069
+ (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
2070
2070
  def.pattern.lastIndex = 0;
2071
2071
  if (def.pattern.test(payload.value))
2072
2072
  return;
@@ -2271,7 +2271,7 @@ var version = {
2271
2271
 
2272
2272
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/schemas.js
2273
2273
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2274
- var _a7;
2274
+ var _a2;
2275
2275
  inst ?? (inst = {});
2276
2276
  inst._zod.def = def;
2277
2277
  inst._zod.bag = inst._zod.bag || {};
@@ -2286,7 +2286,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2286
2286
  }
2287
2287
  }
2288
2288
  if (checks.length === 0) {
2289
- (_a7 = inst._zod).deferred ?? (_a7.deferred = []);
2289
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
2290
2290
  inst._zod.deferred?.push(() => {
2291
2291
  inst._zod.run = inst._zod.parse;
2292
2292
  });
@@ -3008,13 +3008,13 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3008
3008
  }
3009
3009
  return propValues;
3010
3010
  });
3011
- const isObject3 = isObject;
3011
+ const isObject2 = isObject;
3012
3012
  const catchall = def.catchall;
3013
3013
  let value;
3014
3014
  inst._zod.parse = (payload, ctx) => {
3015
3015
  value ?? (value = _normalized.value);
3016
3016
  const input = payload.value;
3017
- if (!isObject3(input)) {
3017
+ if (!isObject2(input)) {
3018
3018
  payload.issues.push({
3019
3019
  expected: "object",
3020
3020
  code: "invalid_type",
@@ -3088,7 +3088,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3088
3088
  return (payload, ctx) => fn(shape, payload, ctx);
3089
3089
  }, "generateFastpass");
3090
3090
  let fastpass;
3091
- const isObject3 = isObject;
3091
+ const isObject2 = isObject;
3092
3092
  const jit = !globalConfig.jitless;
3093
3093
  const allowsEval2 = allowsEval;
3094
3094
  const fastEnabled = jit && allowsEval2.value;
@@ -3097,7 +3097,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3097
3097
  inst._zod.parse = (payload, ctx) => {
3098
3098
  value ?? (value = _normalized.value);
3099
3099
  const input = payload.value;
3100
- if (!isObject3(input)) {
3100
+ if (!isObject2(input)) {
3101
3101
  payload.issues.push({
3102
3102
  expected: "object",
3103
3103
  code: "invalid_type",
@@ -3205,19 +3205,19 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3205
3205
  });
3206
3206
  const disc = cached(() => {
3207
3207
  const opts = def.options;
3208
- const map3 = /* @__PURE__ */ new Map();
3208
+ const map2 = /* @__PURE__ */ new Map();
3209
3209
  for (const o of opts) {
3210
3210
  const values = o._zod.propValues?.[def.discriminator];
3211
3211
  if (!values || values.size === 0)
3212
3212
  throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
3213
3213
  for (const v of values) {
3214
- if (map3.has(v)) {
3214
+ if (map2.has(v)) {
3215
3215
  throw new Error(`Duplicate discriminator value "${String(v)}"`);
3216
3216
  }
3217
- map3.set(v, o);
3217
+ map2.set(v, o);
3218
3218
  }
3219
3219
  }
3220
- return map3;
3220
+ return map2;
3221
3221
  });
3222
3222
  inst._zod.parse = (payload, ctx) => {
3223
3223
  const input = payload.value;
@@ -11088,7 +11088,7 @@ var _JSONSchemaGenerator = class _JSONSchemaGenerator {
11088
11088
  this.seen = /* @__PURE__ */ new Map();
11089
11089
  }
11090
11090
  process(schema, _params = { path: [], schemaPath: [] }) {
11091
- var _a7;
11091
+ var _a2;
11092
11092
  const def = schema._zod.def;
11093
11093
  const formatMap = {
11094
11094
  guid: "uuid",
@@ -11602,7 +11602,7 @@ var _JSONSchemaGenerator = class _JSONSchemaGenerator {
11602
11602
  delete result.schema.default;
11603
11603
  }
11604
11604
  if (this.io === "input" && result.schema._prefault)
11605
- (_a7 = result.schema).default ?? (_a7.default = result.schema._prefault);
11605
+ (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
11606
11606
  delete result.schema._prefault;
11607
11607
  const _result = this.seen.get(schema);
11608
11608
  return _result.schema;
@@ -13037,9 +13037,9 @@ var ZodIssueCode = {
13037
13037
  invalid_value: "invalid_value",
13038
13038
  custom: "custom"
13039
13039
  };
13040
- function setErrorMap(map3) {
13040
+ function setErrorMap(map2) {
13041
13041
  config({
13042
- customError: map3
13042
+ customError: map2
13043
13043
  });
13044
13044
  }
13045
13045
  __name(setErrorMap, "setErrorMap");
@@ -13093,1446 +13093,8 @@ var SigningAuthorityValidator = external_exports.object({
13093
13093
  endpoint: external_exports.string().optional()
13094
13094
  });
13095
13095
 
13096
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/objectSpread2-BvkFp-_Y.mjs
13097
- var __create = Object.create;
13098
- var __defProp2 = Object.defineProperty;
13099
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13100
- var __getOwnPropNames = Object.getOwnPropertyNames;
13101
- var __getProtoOf = Object.getPrototypeOf;
13102
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13103
- var __commonJS = /* @__PURE__ */ __name((cb, mod) => function() {
13104
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13105
- }, "__commonJS");
13106
- var __copyProps = /* @__PURE__ */ __name((to, from, except, desc) => {
13107
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13108
- key = keys[i];
13109
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp2(to, key, {
13110
- get: ((k) => from[k]).bind(null, key),
13111
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13112
- });
13113
- }
13114
- return to;
13115
- }, "__copyProps");
13116
- var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
13117
- value: mod,
13118
- enumerable: true
13119
- }) : target, mod)), "__toESM");
13120
- var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
13121
- function _typeof$2(o) {
13122
- "@babel/helpers - typeof";
13123
- return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
13124
- return typeof o$1;
13125
- } : function(o$1) {
13126
- return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
13127
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
13128
- }
13129
- __name(_typeof$2, "_typeof$2");
13130
- module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
13131
- } });
13132
- var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
13133
- var _typeof$1 = require_typeof()["default"];
13134
- function toPrimitive$1(t, r) {
13135
- if ("object" != _typeof$1(t) || !t) return t;
13136
- var e = t[Symbol.toPrimitive];
13137
- if (void 0 !== e) {
13138
- var i = e.call(t, r || "default");
13139
- if ("object" != _typeof$1(i)) return i;
13140
- throw new TypeError("@@toPrimitive must return a primitive value.");
13141
- }
13142
- return ("string" === r ? String : Number)(t);
13143
- }
13144
- __name(toPrimitive$1, "toPrimitive$1");
13145
- module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
13146
- } });
13147
- var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
13148
- var _typeof = require_typeof()["default"];
13149
- var toPrimitive = require_toPrimitive();
13150
- function toPropertyKey$1(t) {
13151
- var i = toPrimitive(t, "string");
13152
- return "symbol" == _typeof(i) ? i : i + "";
13153
- }
13154
- __name(toPropertyKey$1, "toPropertyKey$1");
13155
- module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
13156
- } });
13157
- var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
13158
- var toPropertyKey = require_toPropertyKey();
13159
- function _defineProperty(e, r, t) {
13160
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
13161
- value: t,
13162
- enumerable: true,
13163
- configurable: true,
13164
- writable: true
13165
- }) : e[r] = t, e;
13166
- }
13167
- __name(_defineProperty, "_defineProperty");
13168
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
13169
- } });
13170
- var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
13171
- var defineProperty = require_defineProperty();
13172
- function ownKeys(e, r) {
13173
- var t = Object.keys(e);
13174
- if (Object.getOwnPropertySymbols) {
13175
- var o = Object.getOwnPropertySymbols(e);
13176
- r && (o = o.filter(function(r$1) {
13177
- return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
13178
- })), t.push.apply(t, o);
13179
- }
13180
- return t;
13181
- }
13182
- __name(ownKeys, "ownKeys");
13183
- function _objectSpread2(e) {
13184
- for (var r = 1; r < arguments.length; r++) {
13185
- var t = null != arguments[r] ? arguments[r] : {};
13186
- r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
13187
- defineProperty(e, r$1, t[r$1]);
13188
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
13189
- Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
13190
- });
13191
- }
13192
- return e;
13193
- }
13194
- __name(_objectSpread2, "_objectSpread2");
13195
- module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
13196
- } });
13197
-
13198
- // ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs
13199
- function observable(subscribe) {
13200
- const self = {
13201
- subscribe(observer) {
13202
- let teardownRef = null;
13203
- let isDone = false;
13204
- let unsubscribed = false;
13205
- let teardownImmediately = false;
13206
- function unsubscribe() {
13207
- if (teardownRef === null) {
13208
- teardownImmediately = true;
13209
- return;
13210
- }
13211
- if (unsubscribed) return;
13212
- unsubscribed = true;
13213
- if (typeof teardownRef === "function") teardownRef();
13214
- else if (teardownRef) teardownRef.unsubscribe();
13215
- }
13216
- __name(unsubscribe, "unsubscribe");
13217
- teardownRef = subscribe({
13218
- next(value) {
13219
- var _observer$next;
13220
- if (isDone) return;
13221
- (_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);
13222
- },
13223
- error(err) {
13224
- var _observer$error;
13225
- if (isDone) return;
13226
- isDone = true;
13227
- (_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, err);
13228
- unsubscribe();
13229
- },
13230
- complete() {
13231
- var _observer$complete;
13232
- if (isDone) return;
13233
- isDone = true;
13234
- (_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);
13235
- unsubscribe();
13236
- }
13237
- });
13238
- if (teardownImmediately) unsubscribe();
13239
- return { unsubscribe };
13240
- },
13241
- pipe(...operations) {
13242
- return operations.reduce(pipeReducer, self);
13243
- }
13244
- };
13245
- return self;
13246
- }
13247
- __name(observable, "observable");
13248
- function pipeReducer(prev, fn) {
13249
- return fn(prev);
13250
- }
13251
- __name(pipeReducer, "pipeReducer");
13252
- function observableToPromise(observable$1) {
13253
- const ac = new AbortController();
13254
- const promise2 = new Promise((resolve, reject) => {
13255
- let isDone = false;
13256
- function onDone() {
13257
- if (isDone) return;
13258
- isDone = true;
13259
- obs$.unsubscribe();
13260
- }
13261
- __name(onDone, "onDone");
13262
- ac.signal.addEventListener("abort", () => {
13263
- reject(ac.signal.reason);
13264
- });
13265
- const obs$ = observable$1.subscribe({
13266
- next(data) {
13267
- isDone = true;
13268
- resolve(data);
13269
- onDone();
13270
- },
13271
- error(data) {
13272
- reject(data);
13273
- },
13274
- complete() {
13275
- ac.abort();
13276
- onDone();
13277
- }
13278
- });
13279
- });
13280
- return promise2;
13281
- }
13282
- __name(observableToPromise, "observableToPromise");
13283
-
13284
- // ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/observable-CUiPknO-.mjs
13285
- function share(_opts) {
13286
- return (source) => {
13287
- let refCount = 0;
13288
- let subscription = null;
13289
- const observers = [];
13290
- function startIfNeeded() {
13291
- if (subscription) return;
13292
- subscription = source.subscribe({
13293
- next(value) {
13294
- for (const observer of observers) {
13295
- var _observer$next;
13296
- (_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);
13297
- }
13298
- },
13299
- error(error46) {
13300
- for (const observer of observers) {
13301
- var _observer$error;
13302
- (_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, error46);
13303
- }
13304
- },
13305
- complete() {
13306
- for (const observer of observers) {
13307
- var _observer$complete;
13308
- (_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);
13309
- }
13310
- }
13311
- });
13312
- }
13313
- __name(startIfNeeded, "startIfNeeded");
13314
- function resetIfNeeded() {
13315
- if (refCount === 0 && subscription) {
13316
- const _sub = subscription;
13317
- subscription = null;
13318
- _sub.unsubscribe();
13319
- }
13320
- }
13321
- __name(resetIfNeeded, "resetIfNeeded");
13322
- return observable((subscriber) => {
13323
- refCount++;
13324
- observers.push(subscriber);
13325
- startIfNeeded();
13326
- return { unsubscribe() {
13327
- refCount--;
13328
- resetIfNeeded();
13329
- const index = observers.findIndex((v) => v === subscriber);
13330
- if (index > -1) observers.splice(index, 1);
13331
- } };
13332
- });
13333
- };
13334
- }
13335
- __name(share, "share");
13336
- function behaviorSubject(initialValue) {
13337
- let value = initialValue;
13338
- const observerList = [];
13339
- const addObserver = /* @__PURE__ */ __name((observer) => {
13340
- if (value !== void 0) observer.next(value);
13341
- observerList.push(observer);
13342
- }, "addObserver");
13343
- const removeObserver = /* @__PURE__ */ __name((observer) => {
13344
- observerList.splice(observerList.indexOf(observer), 1);
13345
- }, "removeObserver");
13346
- const obs = observable((observer) => {
13347
- addObserver(observer);
13348
- return () => {
13349
- removeObserver(observer);
13350
- };
13351
- });
13352
- obs.next = (nextValue) => {
13353
- if (value === nextValue) return;
13354
- value = nextValue;
13355
- for (const observer of observerList) observer.next(nextValue);
13356
- };
13357
- obs.get = () => value;
13358
- return obs;
13359
- }
13360
- __name(behaviorSubject, "behaviorSubject");
13361
-
13362
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/splitLink-B7Cuf2c_.mjs
13363
- function createChain(opts) {
13364
- return observable((observer) => {
13365
- function execute(index = 0, op = opts.op) {
13366
- const next = opts.links[index];
13367
- if (!next) throw new Error("No more links to execute - did you forget to add an ending link?");
13368
- const subscription = next({
13369
- op,
13370
- next(nextOp) {
13371
- const nextObserver = execute(index + 1, nextOp);
13372
- return nextObserver;
13373
- }
13374
- });
13375
- return subscription;
13376
- }
13377
- __name(execute, "execute");
13378
- const obs$ = execute();
13379
- return obs$.subscribe(observer);
13380
- });
13381
- }
13382
- __name(createChain, "createChain");
13383
-
13384
- // ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/utils-CLZnJdb_.mjs
13385
- var TRPC_ERROR_CODES_BY_KEY = {
13386
- PARSE_ERROR: -32700,
13387
- BAD_REQUEST: -32600,
13388
- INTERNAL_SERVER_ERROR: -32603,
13389
- NOT_IMPLEMENTED: -32603,
13390
- BAD_GATEWAY: -32603,
13391
- SERVICE_UNAVAILABLE: -32603,
13392
- GATEWAY_TIMEOUT: -32603,
13393
- UNAUTHORIZED: -32001,
13394
- PAYMENT_REQUIRED: -32002,
13395
- FORBIDDEN: -32003,
13396
- NOT_FOUND: -32004,
13397
- METHOD_NOT_SUPPORTED: -32005,
13398
- TIMEOUT: -32008,
13399
- CONFLICT: -32009,
13400
- PRECONDITION_FAILED: -32012,
13401
- PAYLOAD_TOO_LARGE: -32013,
13402
- UNSUPPORTED_MEDIA_TYPE: -32015,
13403
- UNPROCESSABLE_CONTENT: -32022,
13404
- PRECONDITION_REQUIRED: -32028,
13405
- TOO_MANY_REQUESTS: -32029,
13406
- CLIENT_CLOSED_REQUEST: -32099
13407
- };
13408
- var retryableRpcCodes = [
13409
- TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,
13410
- TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,
13411
- TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,
13412
- TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
13413
- ];
13414
- function isObject2(value) {
13415
- return !!value && !Array.isArray(value) && typeof value === "object";
13416
- }
13417
- __name(isObject2, "isObject");
13418
-
13419
- // ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/getErrorShape-BH60iMC2.mjs
13420
- var __create2 = Object.create;
13421
- var __defProp3 = Object.defineProperty;
13422
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
13423
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
13424
- var __getProtoOf2 = Object.getPrototypeOf;
13425
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
13426
- var __commonJS2 = /* @__PURE__ */ __name((cb, mod) => function() {
13427
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13428
- }, "__commonJS");
13429
- var __copyProps2 = /* @__PURE__ */ __name((to, from, except, desc) => {
13430
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames2(from), i = 0, n = keys.length, key; i < n; i++) {
13431
- key = keys[i];
13432
- if (!__hasOwnProp2.call(to, key) && key !== except) __defProp3(to, key, {
13433
- get: ((k) => from[k]).bind(null, key),
13434
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
13435
- });
13436
- }
13437
- return to;
13438
- }, "__copyProps");
13439
- var __toESM2 = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", {
13440
- value: mod,
13441
- enumerable: true
13442
- }) : target, mod)), "__toESM");
13443
- var noop = /* @__PURE__ */ __name(() => {
13444
- }, "noop");
13445
- var freezeIfAvailable = /* @__PURE__ */ __name((obj) => {
13446
- if (Object.freeze) Object.freeze(obj);
13447
- }, "freezeIfAvailable");
13448
- function createInnerProxy(callback, path, memo) {
13449
- var _memo$cacheKey;
13450
- const cacheKey = path.join(".");
13451
- (_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo[cacheKey] = new Proxy(noop, {
13452
- get(_obj, key) {
13453
- if (typeof key !== "string" || key === "then") return void 0;
13454
- return createInnerProxy(callback, [...path, key], memo);
13455
- },
13456
- apply(_1, _2, args) {
13457
- const lastOfPath = path[path.length - 1];
13458
- let opts = {
13459
- args,
13460
- path
13461
- };
13462
- if (lastOfPath === "call") opts = {
13463
- args: args.length >= 2 ? [args[1]] : [],
13464
- path: path.slice(0, -1)
13465
- };
13466
- else if (lastOfPath === "apply") opts = {
13467
- args: args.length >= 2 ? args[1] : [],
13468
- path: path.slice(0, -1)
13469
- };
13470
- freezeIfAvailable(opts.args);
13471
- freezeIfAvailable(opts.path);
13472
- return callback(opts);
13473
- }
13474
- }));
13475
- return memo[cacheKey];
13476
- }
13477
- __name(createInnerProxy, "createInnerProxy");
13478
- var createRecursiveProxy = /* @__PURE__ */ __name((callback) => createInnerProxy(callback, [], /* @__PURE__ */ Object.create(null)), "createRecursiveProxy");
13479
- var createFlatProxy = /* @__PURE__ */ __name((callback) => {
13480
- return new Proxy(noop, { get(_obj, name) {
13481
- if (name === "then") return void 0;
13482
- return callback(name);
13483
- } });
13484
- }, "createFlatProxy");
13485
- var require_typeof2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
13486
- function _typeof$2(o) {
13487
- "@babel/helpers - typeof";
13488
- return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
13489
- return typeof o$1;
13490
- } : function(o$1) {
13491
- return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
13492
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
13493
- }
13494
- __name(_typeof$2, "_typeof$2");
13495
- module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
13496
- } });
13497
- var require_toPrimitive2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
13498
- var _typeof$1 = require_typeof2()["default"];
13499
- function toPrimitive$1(t, r) {
13500
- if ("object" != _typeof$1(t) || !t) return t;
13501
- var e = t[Symbol.toPrimitive];
13502
- if (void 0 !== e) {
13503
- var i = e.call(t, r || "default");
13504
- if ("object" != _typeof$1(i)) return i;
13505
- throw new TypeError("@@toPrimitive must return a primitive value.");
13506
- }
13507
- return ("string" === r ? String : Number)(t);
13508
- }
13509
- __name(toPrimitive$1, "toPrimitive$1");
13510
- module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
13511
- } });
13512
- var require_toPropertyKey2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
13513
- var _typeof = require_typeof2()["default"];
13514
- var toPrimitive = require_toPrimitive2();
13515
- function toPropertyKey$1(t) {
13516
- var i = toPrimitive(t, "string");
13517
- return "symbol" == _typeof(i) ? i : i + "";
13518
- }
13519
- __name(toPropertyKey$1, "toPropertyKey$1");
13520
- module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
13521
- } });
13522
- var require_defineProperty2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
13523
- var toPropertyKey = require_toPropertyKey2();
13524
- function _defineProperty(e, r, t) {
13525
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
13526
- value: t,
13527
- enumerable: true,
13528
- configurable: true,
13529
- writable: true
13530
- }) : e[r] = t, e;
13531
- }
13532
- __name(_defineProperty, "_defineProperty");
13533
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
13534
- } });
13535
- var require_objectSpread22 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
13536
- var defineProperty = require_defineProperty2();
13537
- function ownKeys(e, r) {
13538
- var t = Object.keys(e);
13539
- if (Object.getOwnPropertySymbols) {
13540
- var o = Object.getOwnPropertySymbols(e);
13541
- r && (o = o.filter(function(r$1) {
13542
- return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
13543
- })), t.push.apply(t, o);
13544
- }
13545
- return t;
13546
- }
13547
- __name(ownKeys, "ownKeys");
13548
- function _objectSpread2(e) {
13549
- for (var r = 1; r < arguments.length; r++) {
13550
- var t = null != arguments[r] ? arguments[r] : {};
13551
- r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
13552
- defineProperty(e, r$1, t[r$1]);
13553
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
13554
- Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
13555
- });
13556
- }
13557
- return e;
13558
- }
13559
- __name(_objectSpread2, "_objectSpread2");
13560
- module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
13561
- } });
13562
- var import_objectSpread2 = __toESM2(require_objectSpread22(), 1);
13563
-
13564
- // ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/tracked-Blz8XOf1.mjs
13565
- var import_defineProperty = __toESM2(require_defineProperty2(), 1);
13566
- var import_objectSpread2$1 = __toESM2(require_objectSpread22(), 1);
13567
- function transformResultInner(response, transformer) {
13568
- if ("error" in response) {
13569
- const error46 = transformer.deserialize(response.error);
13570
- return {
13571
- ok: false,
13572
- error: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response), {}, { error: error46 })
13573
- };
13574
- }
13575
- const result = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response.result), (!response.result.type || response.result.type === "data") && {
13576
- type: "data",
13577
- data: transformer.deserialize(response.result.data)
13578
- });
13579
- return {
13580
- ok: true,
13581
- result
13582
- };
13583
- }
13584
- __name(transformResultInner, "transformResultInner");
13585
- var _a2;
13586
- var TransformResultError = (_a2 = class extends Error {
13587
- constructor() {
13588
- super("Unable to transform response from server");
13589
- }
13590
- }, __name(_a2, "TransformResultError"), _a2);
13591
- function transformResult(response, transformer) {
13592
- let result;
13593
- try {
13594
- result = transformResultInner(response, transformer);
13595
- } catch (_unused) {
13596
- throw new TransformResultError();
13597
- }
13598
- if (!result.ok && (!isObject2(result.error.error) || typeof result.error.error["code"] !== "number")) throw new TransformResultError();
13599
- if (result.ok && !isObject2(result.result)) throw new TransformResultError();
13600
- return result;
13601
- }
13602
- __name(transformResult, "transformResult");
13603
- var import_objectSpread22 = __toESM2(require_objectSpread22(), 1);
13604
-
13605
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/TRPCClientError-CjKyS10w.mjs
13606
- var import_defineProperty2 = __toESM(require_defineProperty(), 1);
13607
- var import_objectSpread23 = __toESM(require_objectSpread2(), 1);
13608
- function isTRPCClientError(cause) {
13609
- return cause instanceof TRPCClientError;
13610
- }
13611
- __name(isTRPCClientError, "isTRPCClientError");
13612
- function isTRPCErrorResponse(obj) {
13613
- return isObject2(obj) && isObject2(obj["error"]) && typeof obj["error"]["code"] === "number" && typeof obj["error"]["message"] === "string";
13614
- }
13615
- __name(isTRPCErrorResponse, "isTRPCErrorResponse");
13616
- function getMessageFromUnknownError(err, fallback) {
13617
- if (typeof err === "string") return err;
13618
- if (isObject2(err) && typeof err["message"] === "string") return err["message"];
13619
- return fallback;
13620
- }
13621
- __name(getMessageFromUnknownError, "getMessageFromUnknownError");
13622
- var _a3;
13623
- var TRPCClientError = (_a3 = class extends Error {
13624
- constructor(message, opts) {
13625
- var _opts$result, _opts$result2;
13626
- const cause = opts === null || opts === void 0 ? void 0 : opts.cause;
13627
- super(message, { cause });
13628
- (0, import_defineProperty2.default)(this, "cause", void 0);
13629
- (0, import_defineProperty2.default)(this, "shape", void 0);
13630
- (0, import_defineProperty2.default)(this, "data", void 0);
13631
- (0, import_defineProperty2.default)(this, "meta", void 0);
13632
- this.meta = opts === null || opts === void 0 ? void 0 : opts.meta;
13633
- this.cause = cause;
13634
- this.shape = opts === null || opts === void 0 || (_opts$result = opts.result) === null || _opts$result === void 0 ? void 0 : _opts$result.error;
13635
- this.data = opts === null || opts === void 0 || (_opts$result2 = opts.result) === null || _opts$result2 === void 0 ? void 0 : _opts$result2.error.data;
13636
- this.name = "TRPCClientError";
13637
- Object.setPrototypeOf(this, _a3.prototype);
13638
- }
13639
- static from(_cause, opts = {}) {
13640
- const cause = _cause;
13641
- if (isTRPCClientError(cause)) {
13642
- if (opts.meta) cause.meta = (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, cause.meta), opts.meta);
13643
- return cause;
13644
- }
13645
- if (isTRPCErrorResponse(cause)) return new _a3(cause.error.message, (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, opts), {}, { result: cause }));
13646
- return new _a3(getMessageFromUnknownError(cause, "Unknown error"), (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, opts), {}, { cause }));
13647
- }
13648
- }, __name(_a3, "TRPCClientError"), _a3);
13649
-
13650
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/unstable-internals-Bg7n9BBj.mjs
13651
- function getTransformer(transformer) {
13652
- const _transformer = transformer;
13653
- if (!_transformer) return {
13654
- input: {
13655
- serialize: /* @__PURE__ */ __name((data) => data, "serialize"),
13656
- deserialize: /* @__PURE__ */ __name((data) => data, "deserialize")
13657
- },
13658
- output: {
13659
- serialize: /* @__PURE__ */ __name((data) => data, "serialize"),
13660
- deserialize: /* @__PURE__ */ __name((data) => data, "deserialize")
13661
- }
13662
- };
13663
- if ("input" in _transformer) return _transformer;
13664
- return {
13665
- input: _transformer,
13666
- output: _transformer
13667
- };
13668
- }
13669
- __name(getTransformer, "getTransformer");
13670
-
13671
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/httpUtils-Dv57hbOd.mjs
13672
- var isFunction2 = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
13673
- function getFetch(customFetchImpl) {
13674
- if (customFetchImpl) return customFetchImpl;
13675
- if (typeof window !== "undefined" && isFunction2(window.fetch)) return window.fetch;
13676
- if (typeof globalThis !== "undefined" && isFunction2(globalThis.fetch)) return globalThis.fetch;
13677
- throw new Error("No fetch implementation found");
13678
- }
13679
- __name(getFetch, "getFetch");
13680
- var import_objectSpread24 = __toESM(require_objectSpread2(), 1);
13681
- function resolveHTTPLinkOptions(opts) {
13682
- return {
13683
- url: opts.url.toString(),
13684
- fetch: opts.fetch,
13685
- transformer: getTransformer(opts.transformer),
13686
- methodOverride: opts.methodOverride
13687
- };
13688
- }
13689
- __name(resolveHTTPLinkOptions, "resolveHTTPLinkOptions");
13690
- function arrayToDict(array2) {
13691
- const dict = {};
13692
- for (let index = 0; index < array2.length; index++) {
13693
- const element = array2[index];
13694
- dict[index] = element;
13695
- }
13696
- return dict;
13697
- }
13698
- __name(arrayToDict, "arrayToDict");
13699
- var METHOD = {
13700
- query: "GET",
13701
- mutation: "POST",
13702
- subscription: "PATCH"
13703
- };
13704
- function getInput(opts) {
13705
- return "input" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input)));
13706
- }
13707
- __name(getInput, "getInput");
13708
- var getUrl = /* @__PURE__ */ __name((opts) => {
13709
- const parts = opts.url.split("?");
13710
- const base = parts[0].replace(/\/$/, "");
13711
- let url2 = base + "/" + opts.path;
13712
- const queryParts = [];
13713
- if (parts[1]) queryParts.push(parts[1]);
13714
- if ("inputs" in opts) queryParts.push("batch=1");
13715
- if (opts.type === "query" || opts.type === "subscription") {
13716
- const input = getInput(opts);
13717
- if (input !== void 0 && opts.methodOverride !== "POST") queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);
13718
- }
13719
- if (queryParts.length) url2 += "?" + queryParts.join("&");
13720
- return url2;
13721
- }, "getUrl");
13722
- var getBody = /* @__PURE__ */ __name((opts) => {
13723
- if (opts.type === "query" && opts.methodOverride !== "POST") return void 0;
13724
- const input = getInput(opts);
13725
- return input !== void 0 ? JSON.stringify(input) : void 0;
13726
- }, "getBody");
13727
- var jsonHttpRequester = /* @__PURE__ */ __name((opts) => {
13728
- return httpRequest((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts), {}, {
13729
- contentTypeHeader: "application/json",
13730
- getUrl,
13731
- getBody
13732
- }));
13733
- }, "jsonHttpRequester");
13734
- var _a4;
13735
- var AbortError = (_a4 = class extends Error {
13736
- constructor() {
13737
- const name = "AbortError";
13738
- super(name);
13739
- this.name = name;
13740
- this.message = name;
13741
- }
13742
- }, __name(_a4, "AbortError"), _a4);
13743
- var throwIfAborted = /* @__PURE__ */ __name((signal) => {
13744
- var _signal$throwIfAborte;
13745
- if (!(signal === null || signal === void 0 ? void 0 : signal.aborted)) return;
13746
- (_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === void 0 || _signal$throwIfAborte.call(signal);
13747
- if (typeof DOMException !== "undefined") throw new DOMException("AbortError", "AbortError");
13748
- throw new AbortError();
13749
- }, "throwIfAborted");
13750
- async function fetchHTTPResponse(opts) {
13751
- var _opts$methodOverride;
13752
- throwIfAborted(opts.signal);
13753
- const url2 = opts.getUrl(opts);
13754
- const body = opts.getBody(opts);
13755
- const method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== void 0 ? _opts$methodOverride : METHOD[opts.type];
13756
- const resolvedHeaders = await (async () => {
13757
- const heads = await opts.headers();
13758
- if (Symbol.iterator in heads) return Object.fromEntries(heads);
13759
- return heads;
13760
- })();
13761
- const headers = (0, import_objectSpread24.default)((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts.contentTypeHeader && method !== "GET" ? { "content-type": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { "trpc-accept": opts.trpcAcceptHeader } : void 0), resolvedHeaders);
13762
- return getFetch(opts.fetch)(url2, {
13763
- method,
13764
- signal: opts.signal,
13765
- body,
13766
- headers
13767
- });
13768
- }
13769
- __name(fetchHTTPResponse, "fetchHTTPResponse");
13770
- async function httpRequest(opts) {
13771
- const meta3 = {};
13772
- const res = await fetchHTTPResponse(opts);
13773
- meta3.response = res;
13774
- const json2 = await res.json();
13775
- meta3.responseJSON = json2;
13776
- return {
13777
- json: json2,
13778
- meta: meta3
13779
- };
13780
- }
13781
- __name(httpRequest, "httpRequest");
13782
-
13783
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/httpLink-DCFpUmZF.mjs
13784
- var import_objectSpread25 = __toESM(require_objectSpread2(), 1);
13785
-
13786
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/httpBatchLink-BOe5aCcR.mjs
13787
- var throwFatalError = /* @__PURE__ */ __name(() => {
13788
- throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
13789
- }, "throwFatalError");
13790
- function dataLoader(batchLoader) {
13791
- let pendingItems = null;
13792
- let dispatchTimer = null;
13793
- const destroyTimerAndPendingItems = /* @__PURE__ */ __name(() => {
13794
- clearTimeout(dispatchTimer);
13795
- dispatchTimer = null;
13796
- pendingItems = null;
13797
- }, "destroyTimerAndPendingItems");
13798
- function groupItems(items) {
13799
- const groupedItems = [[]];
13800
- let index = 0;
13801
- while (true) {
13802
- const item = items[index];
13803
- if (!item) break;
13804
- const lastGroup = groupedItems[groupedItems.length - 1];
13805
- if (item.aborted) {
13806
- var _item$reject;
13807
- (_item$reject = item.reject) === null || _item$reject === void 0 || _item$reject.call(item, new Error("Aborted"));
13808
- index++;
13809
- continue;
13810
- }
13811
- const isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key));
13812
- if (isValid) {
13813
- lastGroup.push(item);
13814
- index++;
13815
- continue;
13816
- }
13817
- if (lastGroup.length === 0) {
13818
- var _item$reject2;
13819
- (_item$reject2 = item.reject) === null || _item$reject2 === void 0 || _item$reject2.call(item, new Error("Input is too big for a single dispatch"));
13820
- index++;
13821
- continue;
13822
- }
13823
- groupedItems.push([]);
13824
- }
13825
- return groupedItems;
13826
- }
13827
- __name(groupItems, "groupItems");
13828
- function dispatch() {
13829
- const groupedItems = groupItems(pendingItems);
13830
- destroyTimerAndPendingItems();
13831
- for (const items of groupedItems) {
13832
- if (!items.length) continue;
13833
- const batch = { items };
13834
- for (const item of items) item.batch = batch;
13835
- const promise2 = batchLoader.fetch(batch.items.map((_item) => _item.key));
13836
- promise2.then(async (result) => {
13837
- await Promise.all(result.map(async (valueOrPromise, index) => {
13838
- const item = batch.items[index];
13839
- try {
13840
- var _item$resolve;
13841
- const value = await Promise.resolve(valueOrPromise);
13842
- (_item$resolve = item.resolve) === null || _item$resolve === void 0 || _item$resolve.call(item, value);
13843
- } catch (cause) {
13844
- var _item$reject3;
13845
- (_item$reject3 = item.reject) === null || _item$reject3 === void 0 || _item$reject3.call(item, cause);
13846
- }
13847
- item.batch = null;
13848
- item.reject = null;
13849
- item.resolve = null;
13850
- }));
13851
- for (const item of batch.items) {
13852
- var _item$reject4;
13853
- (_item$reject4 = item.reject) === null || _item$reject4 === void 0 || _item$reject4.call(item, new Error("Missing result"));
13854
- item.batch = null;
13855
- }
13856
- }).catch((cause) => {
13857
- for (const item of batch.items) {
13858
- var _item$reject5;
13859
- (_item$reject5 = item.reject) === null || _item$reject5 === void 0 || _item$reject5.call(item, cause);
13860
- item.batch = null;
13861
- }
13862
- });
13863
- }
13864
- }
13865
- __name(dispatch, "dispatch");
13866
- function load(key) {
13867
- var _dispatchTimer;
13868
- const item = {
13869
- aborted: false,
13870
- key,
13871
- batch: null,
13872
- resolve: throwFatalError,
13873
- reject: throwFatalError
13874
- };
13875
- const promise2 = new Promise((resolve, reject) => {
13876
- var _pendingItems;
13877
- item.reject = reject;
13878
- item.resolve = resolve;
13879
- (_pendingItems = pendingItems) !== null && _pendingItems !== void 0 || (pendingItems = []);
13880
- pendingItems.push(item);
13881
- });
13882
- (_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== void 0 || (dispatchTimer = setTimeout(dispatch));
13883
- return promise2;
13884
- }
13885
- __name(load, "load");
13886
- return { load };
13887
- }
13888
- __name(dataLoader, "dataLoader");
13889
- function allAbortSignals(...signals) {
13890
- const ac = new AbortController();
13891
- const count = signals.length;
13892
- let abortedCount = 0;
13893
- const onAbort = /* @__PURE__ */ __name(() => {
13894
- if (++abortedCount === count) ac.abort();
13895
- }, "onAbort");
13896
- for (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) onAbort();
13897
- else signal === null || signal === void 0 || signal.addEventListener("abort", onAbort, { once: true });
13898
- return ac.signal;
13899
- }
13900
- __name(allAbortSignals, "allAbortSignals");
13901
- var import_objectSpread26 = __toESM(require_objectSpread2(), 1);
13902
- function httpBatchLink(opts) {
13903
- var _opts$maxURLLength, _opts$maxItems;
13904
- const resolvedOpts = resolveHTTPLinkOptions(opts);
13905
- const maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity;
13906
- const maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity;
13907
- return () => {
13908
- const batchLoader = /* @__PURE__ */ __name((type) => {
13909
- return {
13910
- validate(batchOps) {
13911
- if (maxURLLength === Infinity && maxItems === Infinity) return true;
13912
- if (batchOps.length > maxItems) return false;
13913
- const path = batchOps.map((op) => op.path).join(",");
13914
- const inputs = batchOps.map((op) => op.input);
13915
- const url2 = getUrl((0, import_objectSpread26.default)((0, import_objectSpread26.default)({}, resolvedOpts), {}, {
13916
- type,
13917
- path,
13918
- inputs,
13919
- signal: null
13920
- }));
13921
- return url2.length <= maxURLLength;
13922
- },
13923
- async fetch(batchOps) {
13924
- const path = batchOps.map((op) => op.path).join(",");
13925
- const inputs = batchOps.map((op) => op.input);
13926
- const signal = allAbortSignals(...batchOps.map((op) => op.signal));
13927
- const res = await jsonHttpRequester((0, import_objectSpread26.default)((0, import_objectSpread26.default)({}, resolvedOpts), {}, {
13928
- path,
13929
- inputs,
13930
- type,
13931
- headers() {
13932
- if (!opts.headers) return {};
13933
- if (typeof opts.headers === "function") return opts.headers({ opList: batchOps });
13934
- return opts.headers;
13935
- },
13936
- signal
13937
- }));
13938
- const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
13939
- const result = resJSON.map((item) => ({
13940
- meta: res.meta,
13941
- json: item
13942
- }));
13943
- return result;
13944
- }
13945
- };
13946
- }, "batchLoader");
13947
- const query = dataLoader(batchLoader("query"));
13948
- const mutation = dataLoader(batchLoader("mutation"));
13949
- const loaders = {
13950
- query,
13951
- mutation
13952
- };
13953
- return ({ op }) => {
13954
- return observable((observer) => {
13955
- if (op.type === "subscription") throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
13956
- const loader = loaders[op.type];
13957
- const promise2 = loader.load(op);
13958
- let _res = void 0;
13959
- promise2.then((res) => {
13960
- _res = res;
13961
- const transformed = transformResult(res.json, resolvedOpts.transformer.output);
13962
- if (!transformed.ok) {
13963
- observer.error(TRPCClientError.from(transformed.error, { meta: res.meta }));
13964
- return;
13965
- }
13966
- observer.next({
13967
- context: res.meta,
13968
- result: transformed.result
13969
- });
13970
- observer.complete();
13971
- }).catch((err) => {
13972
- observer.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta }));
13973
- });
13974
- return () => {
13975
- };
13976
- });
13977
- };
13978
- };
13979
- }
13980
- __name(httpBatchLink, "httpBatchLink");
13981
-
13982
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/loggerLink-ineCN1PO.mjs
13983
- var import_objectSpread27 = __toESM(require_objectSpread2(), 1);
13984
-
13985
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/wsLink-CatceK3c.mjs
13986
- var resultOf = /* @__PURE__ */ __name((value, ...args) => {
13987
- return typeof value === "function" ? value(...args) : value;
13988
- }, "resultOf");
13989
- var import_defineProperty$3 = __toESM(require_defineProperty(), 1);
13990
- function withResolvers() {
13991
- let resolve;
13992
- let reject;
13993
- const promise2 = new Promise((res, rej) => {
13994
- resolve = res;
13995
- reject = rej;
13996
- });
13997
- return {
13998
- promise: promise2,
13999
- resolve,
14000
- reject
14001
- };
14002
- }
14003
- __name(withResolvers, "withResolvers");
14004
- async function prepareUrl(urlOptions) {
14005
- const url2 = await resultOf(urlOptions.url);
14006
- if (!urlOptions.connectionParams) return url2;
14007
- const prefix = url2.includes("?") ? "&" : "?";
14008
- const connectionParams = `${prefix}connectionParams=1`;
14009
- return url2 + connectionParams;
14010
- }
14011
- __name(prepareUrl, "prepareUrl");
14012
- async function buildConnectionMessage(connectionParams) {
14013
- const message = {
14014
- method: "connectionParams",
14015
- data: await resultOf(connectionParams)
14016
- };
14017
- return JSON.stringify(message);
14018
- }
14019
- __name(buildConnectionMessage, "buildConnectionMessage");
14020
- var import_defineProperty$2 = __toESM(require_defineProperty(), 1);
14021
- var import_defineProperty$1 = __toESM(require_defineProperty(), 1);
14022
- function asyncWsOpen(ws) {
14023
- const { promise: promise2, resolve, reject } = withResolvers();
14024
- ws.addEventListener("open", () => {
14025
- ws.removeEventListener("error", reject);
14026
- resolve();
14027
- });
14028
- ws.addEventListener("error", reject);
14029
- return promise2;
14030
- }
14031
- __name(asyncWsOpen, "asyncWsOpen");
14032
- function setupPingInterval(ws, { intervalMs, pongTimeoutMs }) {
14033
- let pingTimeout;
14034
- let pongTimeout;
14035
- function start() {
14036
- pingTimeout = setTimeout(() => {
14037
- ws.send("PING");
14038
- pongTimeout = setTimeout(() => {
14039
- ws.close();
14040
- }, pongTimeoutMs);
14041
- }, intervalMs);
14042
- }
14043
- __name(start, "start");
14044
- function reset() {
14045
- clearTimeout(pingTimeout);
14046
- start();
14047
- }
14048
- __name(reset, "reset");
14049
- function pong() {
14050
- clearTimeout(pongTimeout);
14051
- reset();
14052
- }
14053
- __name(pong, "pong");
14054
- ws.addEventListener("open", start);
14055
- ws.addEventListener("message", ({ data }) => {
14056
- clearTimeout(pingTimeout);
14057
- start();
14058
- if (data === "PONG") pong();
14059
- });
14060
- ws.addEventListener("close", () => {
14061
- clearTimeout(pingTimeout);
14062
- clearTimeout(pongTimeout);
14063
- });
14064
- }
14065
- __name(setupPingInterval, "setupPingInterval");
14066
- var _a5;
14067
- var WsConnection = (_a5 = class {
14068
- constructor(opts) {
14069
- var _opts$WebSocketPonyfi;
14070
- (0, import_defineProperty$1.default)(this, "id", ++_a5.connectCount);
14071
- (0, import_defineProperty$1.default)(this, "WebSocketPonyfill", void 0);
14072
- (0, import_defineProperty$1.default)(this, "urlOptions", void 0);
14073
- (0, import_defineProperty$1.default)(this, "keepAliveOpts", void 0);
14074
- (0, import_defineProperty$1.default)(this, "wsObservable", behaviorSubject(null));
14075
- (0, import_defineProperty$1.default)(this, "openPromise", null);
14076
- this.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== void 0 ? _opts$WebSocketPonyfi : WebSocket;
14077
- if (!this.WebSocketPonyfill) throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
14078
- this.urlOptions = opts.urlOptions;
14079
- this.keepAliveOpts = opts.keepAlive;
14080
- }
14081
- get ws() {
14082
- return this.wsObservable.get();
14083
- }
14084
- set ws(ws) {
14085
- this.wsObservable.next(ws);
14086
- }
14087
- /**
14088
- * Checks if the WebSocket connection is open and ready to communicate.
14089
- */
14090
- isOpen() {
14091
- return !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;
14092
- }
14093
- /**
14094
- * Checks if the WebSocket connection is closed or in the process of closing.
14095
- */
14096
- isClosed() {
14097
- return !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);
14098
- }
14099
- async open() {
14100
- var _this = this;
14101
- if (_this.openPromise) return _this.openPromise;
14102
- _this.id = ++_a5.connectCount;
14103
- const wsPromise = prepareUrl(_this.urlOptions).then((url2) => new _this.WebSocketPonyfill(url2));
14104
- _this.openPromise = wsPromise.then(async (ws) => {
14105
- _this.ws = ws;
14106
- ws.addEventListener("message", function({ data }) {
14107
- if (data === "PING") this.send("PONG");
14108
- });
14109
- if (_this.keepAliveOpts.enabled) setupPingInterval(ws, _this.keepAliveOpts);
14110
- ws.addEventListener("close", () => {
14111
- if (_this.ws === ws) _this.ws = null;
14112
- });
14113
- await asyncWsOpen(ws);
14114
- if (_this.urlOptions.connectionParams) ws.send(await buildConnectionMessage(_this.urlOptions.connectionParams));
14115
- });
14116
- try {
14117
- await _this.openPromise;
14118
- } finally {
14119
- _this.openPromise = null;
14120
- }
14121
- }
14122
- /**
14123
- * Closes the WebSocket connection gracefully.
14124
- * Waits for any ongoing open operation to complete before closing.
14125
- */
14126
- async close() {
14127
- var _this2 = this;
14128
- try {
14129
- await _this2.openPromise;
14130
- } finally {
14131
- var _this$ws;
14132
- (_this$ws = _this2.ws) === null || _this$ws === void 0 || _this$ws.close();
14133
- }
14134
- }
14135
- }, __name(_a5, "WsConnection"), _a5);
14136
- (0, import_defineProperty$1.default)(WsConnection, "connectCount", 0);
14137
- var import_defineProperty3 = __toESM(require_defineProperty(), 1);
14138
- var import_objectSpread28 = __toESM(require_objectSpread2(), 1);
14139
-
14140
- // ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/index.mjs
14141
- var import_defineProperty4 = __toESM(require_defineProperty(), 1);
14142
- var import_objectSpread2$4 = __toESM(require_objectSpread2(), 1);
14143
- var _a6;
14144
- var TRPCUntypedClient = (_a6 = class {
14145
- constructor(opts) {
14146
- (0, import_defineProperty4.default)(this, "links", void 0);
14147
- (0, import_defineProperty4.default)(this, "runtime", void 0);
14148
- (0, import_defineProperty4.default)(this, "requestId", void 0);
14149
- this.requestId = 0;
14150
- this.runtime = {};
14151
- this.links = opts.links.map((link) => link(this.runtime));
14152
- }
14153
- $request(opts) {
14154
- var _opts$context;
14155
- const chain$ = createChain({
14156
- links: this.links,
14157
- op: (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, opts), {}, {
14158
- context: (_opts$context = opts.context) !== null && _opts$context !== void 0 ? _opts$context : {},
14159
- id: ++this.requestId
14160
- })
14161
- });
14162
- return chain$.pipe(share());
14163
- }
14164
- async requestAsPromise(opts) {
14165
- var _this = this;
14166
- try {
14167
- const req$ = _this.$request(opts);
14168
- const envelope = await observableToPromise(req$);
14169
- const data = envelope.result.data;
14170
- return data;
14171
- } catch (err) {
14172
- throw TRPCClientError.from(err);
14173
- }
14174
- }
14175
- query(path, input, opts) {
14176
- return this.requestAsPromise({
14177
- type: "query",
14178
- path,
14179
- input,
14180
- context: opts === null || opts === void 0 ? void 0 : opts.context,
14181
- signal: opts === null || opts === void 0 ? void 0 : opts.signal
14182
- });
14183
- }
14184
- mutation(path, input, opts) {
14185
- return this.requestAsPromise({
14186
- type: "mutation",
14187
- path,
14188
- input,
14189
- context: opts === null || opts === void 0 ? void 0 : opts.context,
14190
- signal: opts === null || opts === void 0 ? void 0 : opts.signal
14191
- });
14192
- }
14193
- subscription(path, input, opts) {
14194
- const observable$ = this.$request({
14195
- type: "subscription",
14196
- path,
14197
- input,
14198
- context: opts.context,
14199
- signal: opts.signal
14200
- });
14201
- return observable$.subscribe({
14202
- next(envelope) {
14203
- switch (envelope.result.type) {
14204
- case "state": {
14205
- var _opts$onConnectionSta;
14206
- (_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === void 0 || _opts$onConnectionSta.call(opts, envelope.result);
14207
- break;
14208
- }
14209
- case "started": {
14210
- var _opts$onStarted;
14211
- (_opts$onStarted = opts.onStarted) === null || _opts$onStarted === void 0 || _opts$onStarted.call(opts, { context: envelope.context });
14212
- break;
14213
- }
14214
- case "stopped": {
14215
- var _opts$onStopped;
14216
- (_opts$onStopped = opts.onStopped) === null || _opts$onStopped === void 0 || _opts$onStopped.call(opts);
14217
- break;
14218
- }
14219
- case "data":
14220
- case void 0: {
14221
- var _opts$onData;
14222
- (_opts$onData = opts.onData) === null || _opts$onData === void 0 || _opts$onData.call(opts, envelope.result.data);
14223
- break;
14224
- }
14225
- }
14226
- },
14227
- error(err) {
14228
- var _opts$onError;
14229
- (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, err);
14230
- },
14231
- complete() {
14232
- var _opts$onComplete;
14233
- (_opts$onComplete = opts.onComplete) === null || _opts$onComplete === void 0 || _opts$onComplete.call(opts);
14234
- }
14235
- });
14236
- }
14237
- }, __name(_a6, "TRPCUntypedClient"), _a6);
14238
- var untypedClientSymbol = /* @__PURE__ */ Symbol.for("trpc_untypedClient");
14239
- var clientCallTypeMap = {
14240
- query: "query",
14241
- mutate: "mutation",
14242
- subscribe: "subscription"
14243
- };
14244
- var clientCallTypeToProcedureType = /* @__PURE__ */ __name((clientCallType) => {
14245
- return clientCallTypeMap[clientCallType];
14246
- }, "clientCallTypeToProcedureType");
14247
- function createTRPCClientProxy(client) {
14248
- const proxy = createRecursiveProxy(({ path, args }) => {
14249
- const pathCopy = [...path];
14250
- const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
14251
- const fullPath = pathCopy.join(".");
14252
- return client[procedureType](fullPath, ...args);
14253
- });
14254
- return createFlatProxy((key) => {
14255
- if (key === untypedClientSymbol) return client;
14256
- return proxy[key];
14257
- });
14258
- }
14259
- __name(createTRPCClientProxy, "createTRPCClientProxy");
14260
- function createTRPCClient(opts) {
14261
- const client = new TRPCUntypedClient(opts);
14262
- const proxy = createTRPCClientProxy(client);
14263
- return proxy;
14264
- }
14265
- __name(createTRPCClient, "createTRPCClient");
14266
- var import_objectSpread2$3 = __toESM(require_objectSpread2(), 1);
14267
- var import_objectSpread2$2 = __toESM(require_objectSpread2(), 1);
14268
- var require_asyncIterator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) {
14269
- function _asyncIterator$1(r) {
14270
- var n, t, o, e = 2;
14271
- for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--; ) {
14272
- if (t && null != (n = r[t])) return n.call(r);
14273
- if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
14274
- t = "@@asyncIterator", o = "@@iterator";
14275
- }
14276
- throw new TypeError("Object is not async iterable");
14277
- }
14278
- __name(_asyncIterator$1, "_asyncIterator$1");
14279
- function AsyncFromSyncIterator(r) {
14280
- function AsyncFromSyncIteratorContinuation(r$1) {
14281
- if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object."));
14282
- var n = r$1.done;
14283
- return Promise.resolve(r$1.value).then(function(r$2) {
14284
- return {
14285
- value: r$2,
14286
- done: n
14287
- };
14288
- });
14289
- }
14290
- __name(AsyncFromSyncIteratorContinuation, "AsyncFromSyncIteratorContinuation");
14291
- return AsyncFromSyncIterator = /* @__PURE__ */ __name(function AsyncFromSyncIterator$1(r$1) {
14292
- this.s = r$1, this.n = r$1.next;
14293
- }, "AsyncFromSyncIterator$1"), AsyncFromSyncIterator.prototype = {
14294
- s: null,
14295
- n: null,
14296
- next: /* @__PURE__ */ __name(function next() {
14297
- return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
14298
- }, "next"),
14299
- "return": /* @__PURE__ */ __name(function _return(r$1) {
14300
- var n = this.s["return"];
14301
- return void 0 === n ? Promise.resolve({
14302
- value: r$1,
14303
- done: true
14304
- }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
14305
- }, "_return"),
14306
- "throw": /* @__PURE__ */ __name(function _throw(r$1) {
14307
- var n = this.s["return"];
14308
- return void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
14309
- }, "_throw")
14310
- }, new AsyncFromSyncIterator(r);
14311
- }
14312
- __name(AsyncFromSyncIterator, "AsyncFromSyncIterator");
14313
- module.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
14314
- } });
14315
- var import_asyncIterator = __toESM(require_asyncIterator(), 1);
14316
- var import_objectSpread2$12 = __toESM(require_objectSpread2(), 1);
14317
- var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
14318
- function _usingCtx() {
14319
- var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
14320
- var n$1 = Error();
14321
- return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1;
14322
- }, e = {}, n = [];
14323
- function using(r$1, e$1) {
14324
- if (null != e$1) {
14325
- if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
14326
- if (r$1) var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
14327
- if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t = o;
14328
- if ("function" != typeof o) throw new TypeError("Object is not disposable.");
14329
- t && (o = /* @__PURE__ */ __name(function o$1() {
14330
- try {
14331
- t.call(e$1);
14332
- } catch (r$2) {
14333
- return Promise.reject(r$2);
14334
- }
14335
- }, "o$1")), n.push({
14336
- v: e$1,
14337
- d: o,
14338
- a: r$1
14339
- });
14340
- } else r$1 && n.push({
14341
- d: e$1,
14342
- a: r$1
14343
- });
14344
- return e$1;
14345
- }
14346
- __name(using, "using");
14347
- return {
14348
- e,
14349
- u: using.bind(null, false),
14350
- a: using.bind(null, true),
14351
- d: /* @__PURE__ */ __name(function d() {
14352
- var o, t = this.e, s = 0;
14353
- function next() {
14354
- for (; o = n.pop(); ) try {
14355
- if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
14356
- if (o.d) {
14357
- var r$1 = o.d.call(o.v);
14358
- if (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);
14359
- } else s |= 1;
14360
- } catch (r$2) {
14361
- return err(r$2);
14362
- }
14363
- if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
14364
- if (t !== e) throw t;
14365
- }
14366
- __name(next, "next");
14367
- function err(n$1) {
14368
- return t = t !== e ? new r(n$1, t) : n$1, next();
14369
- }
14370
- __name(err, "err");
14371
- return next();
14372
- }, "d")
14373
- };
14374
- }
14375
- __name(_usingCtx, "_usingCtx");
14376
- module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
14377
- } });
14378
- var require_OverloadYield = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(exports, module) {
14379
- function _OverloadYield(e, d) {
14380
- this.v = e, this.k = d;
14381
- }
14382
- __name(_OverloadYield, "_OverloadYield");
14383
- module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
14384
- } });
14385
- var require_awaitAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(exports, module) {
14386
- var OverloadYield$1 = require_OverloadYield();
14387
- function _awaitAsyncGenerator$1(e) {
14388
- return new OverloadYield$1(e, 0);
14389
- }
14390
- __name(_awaitAsyncGenerator$1, "_awaitAsyncGenerator$1");
14391
- module.exports = _awaitAsyncGenerator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
14392
- } });
14393
- var require_wrapAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(exports, module) {
14394
- var OverloadYield = require_OverloadYield();
14395
- function _wrapAsyncGenerator$1(e) {
14396
- return function() {
14397
- return new AsyncGenerator(e.apply(this, arguments));
14398
- };
14399
- }
14400
- __name(_wrapAsyncGenerator$1, "_wrapAsyncGenerator$1");
14401
- function AsyncGenerator(e) {
14402
- var r, t;
14403
- function resume(r$1, t$1) {
14404
- try {
14405
- var n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield;
14406
- Promise.resolve(u ? o.v : o).then(function(t$2) {
14407
- if (u) {
14408
- var i = "return" === r$1 ? "return" : "next";
14409
- if (!o.k || t$2.done) return resume(i, t$2);
14410
- t$2 = e[i](t$2).value;
14411
- }
14412
- settle(n.done ? "return" : "normal", t$2);
14413
- }, function(e$1) {
14414
- resume("throw", e$1);
14415
- });
14416
- } catch (e$1) {
14417
- settle("throw", e$1);
14418
- }
14419
- }
14420
- __name(resume, "resume");
14421
- function settle(e$1, n) {
14422
- switch (e$1) {
14423
- case "return":
14424
- r.resolve({
14425
- value: n,
14426
- done: true
14427
- });
14428
- break;
14429
- case "throw":
14430
- r.reject(n);
14431
- break;
14432
- default:
14433
- r.resolve({
14434
- value: n,
14435
- done: false
14436
- });
14437
- }
14438
- (r = r.next) ? resume(r.key, r.arg) : t = null;
14439
- }
14440
- __name(settle, "settle");
14441
- this._invoke = function(e$1, n) {
14442
- return new Promise(function(o, u) {
14443
- var i = {
14444
- key: e$1,
14445
- arg: n,
14446
- resolve: o,
14447
- reject: u,
14448
- next: null
14449
- };
14450
- t ? t = t.next = i : (r = t = i, resume(e$1, n));
14451
- });
14452
- }, "function" != typeof e["return"] && (this["return"] = void 0);
14453
- }
14454
- __name(AsyncGenerator, "AsyncGenerator");
14455
- AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() {
14456
- return this;
14457
- }, AsyncGenerator.prototype.next = function(e) {
14458
- return this._invoke("next", e);
14459
- }, AsyncGenerator.prototype["throw"] = function(e) {
14460
- return this._invoke("throw", e);
14461
- }, AsyncGenerator.prototype["return"] = function(e) {
14462
- return this._invoke("return", e);
14463
- };
14464
- module.exports = _wrapAsyncGenerator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
14465
- } });
14466
- var import_usingCtx = __toESM(require_usingCtx(), 1);
14467
- var import_awaitAsyncGenerator = __toESM(require_awaitAsyncGenerator(), 1);
14468
- var import_wrapAsyncGenerator = __toESM(require_wrapAsyncGenerator(), 1);
14469
- var import_objectSpread29 = __toESM(require_objectSpread2(), 1);
14470
-
14471
- // ../../learn-card-network/simple-signing-client/dist/simple-signing-client.esm.js
14472
- var __defProp4 = Object.defineProperty;
14473
- var __name2 = /* @__PURE__ */ __name((target, value) => __defProp4(target, "name", { value, configurable: true }), "__name");
14474
- var callbackLink = /* @__PURE__ */ __name2((callback) => {
14475
- return () => {
14476
- return ({ next, op }) => {
14477
- return observable((observer) => {
14478
- let request = null;
14479
- let attempts = 0;
14480
- let isDone = false;
14481
- const attempt = /* @__PURE__ */ __name2(() => {
14482
- attempts += 1;
14483
- request?.unsubscribe();
14484
- request = next(op).subscribe({
14485
- error: /* @__PURE__ */ __name2(async (error46) => {
14486
- if (attempts > 5 || error46.data?.httpStatus !== 401) {
14487
- return observer.error(error46);
14488
- }
14489
- await callback();
14490
- attempt();
14491
- }, "error"),
14492
- next: /* @__PURE__ */ __name2((result) => observer.next(result), "next"),
14493
- complete: /* @__PURE__ */ __name2(() => {
14494
- if (isDone) observer.complete();
14495
- }, "complete")
14496
- });
14497
- }, "attempt");
14498
- attempt();
14499
- return () => {
14500
- isDone = true;
14501
- request?.unsubscribe();
14502
- };
14503
- });
14504
- };
14505
- };
14506
- }, "callbackLink");
14507
- var getClient = /* @__PURE__ */ __name2(async (url2, didAuthFunction) => {
14508
- let challenges = [];
14509
- const challengeRequester = createTRPCClient({
14510
- links: [
14511
- httpBatchLink({ url: url2, headers: { Authorization: `Bearer ${await didAuthFunction()}` } })
14512
- ]
14513
- });
14514
- const getChallenges = /* @__PURE__ */ __name2(async (amount = 95 + Math.round((Math.random() - 0.5) * 5)) => {
14515
- return challengeRequester.utilities.getChallenges.query({ amount });
14516
- }, "getChallenges");
14517
- getChallenges().then((result) => challenges = result);
14518
- const trpc = createTRPCClient({
14519
- links: [
14520
- callbackLink(async () => {
14521
- challenges = await getChallenges();
14522
- }),
14523
- httpBatchLink({
14524
- url: url2,
14525
- headers: /* @__PURE__ */ __name2(async () => {
14526
- if (challenges.length === 0) challenges.push(...await getChallenges());
14527
- return { Authorization: `Bearer ${await didAuthFunction(challenges.pop())}` };
14528
- }, "headers")
14529
- })
14530
- ]
14531
- });
14532
- return trpc;
14533
- }, "getClient");
14534
-
14535
13096
  // src/plugin.ts
13097
+ import { getClient } from "@learncard/simple-signing-client";
14536
13098
  var getNewClient = /* @__PURE__ */ __name(async (url2, learnCard) => {
14537
13099
  return getClient(url2, async (challenge) => {
14538
13100
  const jwt2 = await learnCard.invoke.getDidAuthVp({ proofFormat: "jwt", challenge });
@@ -14588,9 +13150,4 @@ export {
14588
13150
  SigningAuthorityValidator,
14589
13151
  getSimpleSigningPlugin
14590
13152
  };
14591
- /*! Bundled license information:
14592
-
14593
- @trpc/client/dist/httpBatchLink-BOe5aCcR.mjs:
14594
- (* istanbul ignore if -- @preserve *)
14595
- */
14596
13153
  //# sourceMappingURL=simple-signing-plugin.esm.js.map