every-plugin 0.4.13 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/build/rspack/index.cjs +82 -80
  2. package/dist/build/rspack/index.cjs.map +1 -0
  3. package/dist/build/rspack/index.d.cts +1 -1
  4. package/dist/build/rspack/index.d.cts.map +1 -0
  5. package/dist/build/rspack/index.d.mts +1 -1
  6. package/dist/build/rspack/index.d.mts.map +1 -0
  7. package/dist/build/rspack/index.mjs +82 -80
  8. package/dist/build/rspack/index.mjs.map +1 -0
  9. package/dist/errors-9sNpYLv5.d.mts +1 -1
  10. package/dist/errors-9sNpYLv5.d.mts.map +1 -0
  11. package/dist/errors-CVnoPl9v.cjs +1 -1
  12. package/dist/errors-CVnoPl9v.cjs.map +1 -0
  13. package/dist/errors-D7keKf7a.mjs +1 -1
  14. package/dist/errors-D7keKf7a.mjs.map +1 -0
  15. package/dist/errors-DKPPPYYT.d.cts +1 -1
  16. package/dist/errors-DKPPPYYT.d.cts.map +1 -0
  17. package/dist/fetch-8DauUFDh.mjs +335 -0
  18. package/dist/fetch-8DauUFDh.mjs.map +1 -0
  19. package/dist/fetch-CrBvwsZ4.cjs +336 -0
  20. package/dist/fetch-CrBvwsZ4.cjs.map +1 -0
  21. package/dist/index-Coz54d1B.d.mts +387 -0
  22. package/dist/index-Coz54d1B.d.mts.map +1 -0
  23. package/dist/index-G63gBZIY.d.cts +386 -0
  24. package/dist/index-G63gBZIY.d.cts.map +1 -0
  25. package/dist/index.cjs +3 -3
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.mts +1 -1
  29. package/dist/index.mjs +3 -3
  30. package/dist/index.mjs.map +1 -0
  31. package/dist/normalize-BW7kk8Lk.d.cts +1 -1
  32. package/dist/normalize-BW7kk8Lk.d.cts.map +1 -0
  33. package/dist/normalize-D4Qh0wVk.cjs +1 -1
  34. package/dist/normalize-D4Qh0wVk.cjs.map +1 -0
  35. package/dist/normalize-D7nae0Hn.mjs +1 -1
  36. package/dist/normalize-D7nae0Hn.mjs.map +1 -0
  37. package/dist/normalize-eB_j86fm.d.mts +1 -1
  38. package/dist/normalize-eB_j86fm.d.mts.map +1 -0
  39. package/dist/package-BoyftHDo.mjs +150 -0
  40. package/dist/package-BoyftHDo.mjs.map +1 -0
  41. package/dist/package-CgNIVjVe.cjs +155 -0
  42. package/dist/package-CgNIVjVe.cjs.map +1 -0
  43. package/dist/plugins-C6MGKdD-.mjs +790 -0
  44. package/dist/plugins-C6MGKdD-.mjs.map +1 -0
  45. package/dist/plugins-DNaNtkG7.cjs +791 -0
  46. package/dist/plugins-DNaNtkG7.cjs.map +1 -0
  47. package/dist/runtime/index.cjs +2 -2
  48. package/dist/runtime/index.d.cts +1 -1
  49. package/dist/runtime/index.d.mts +1 -1
  50. package/dist/runtime/index.mjs +2 -2
  51. package/dist/runtime-60AkNpI0.mjs +476 -0
  52. package/dist/runtime-60AkNpI0.mjs.map +1 -0
  53. package/dist/runtime-BcksCIA1.cjs +541 -0
  54. package/dist/runtime-BcksCIA1.cjs.map +1 -0
  55. package/dist/standard-CkH8zNkx.mjs +584 -0
  56. package/dist/standard-CkH8zNkx.mjs.map +1 -0
  57. package/dist/standard-v75BC6Z5.cjs +685 -0
  58. package/dist/standard-v75BC6Z5.cjs.map +1 -0
  59. package/dist/testing/index.cjs +3 -3
  60. package/dist/testing/index.cjs.map +1 -0
  61. package/dist/testing/index.d.cts +2 -2
  62. package/dist/testing/index.d.cts.map +1 -0
  63. package/dist/testing/index.d.mts +2 -2
  64. package/dist/testing/index.d.mts.map +1 -0
  65. package/dist/testing/index.mjs +3 -3
  66. package/dist/testing/index.mjs.map +1 -0
  67. package/dist/zod-A7Pti5IV.d.cts +1 -1
  68. package/dist/zod-A7Pti5IV.d.cts.map +1 -0
  69. package/dist/zod-BVo51kgJ.mjs +1 -1
  70. package/dist/zod-BVo51kgJ.mjs.map +1 -0
  71. package/dist/zod-DYghWCz1.cjs +1 -1
  72. package/dist/zod-DYghWCz1.cjs.map +1 -0
  73. package/dist/zod-Zw8dlP3j.d.mts +1 -1
  74. package/dist/zod-Zw8dlP3j.d.mts.map +1 -0
  75. package/package.json +1 -1
  76. package/dist/fetch-CGzn1Uf7.cjs +0 -336
  77. package/dist/fetch-ycs0raYN.mjs +0 -335
  78. package/dist/index-matrPV4m.d.cts +0 -382
  79. package/dist/index-qxKsRmCb.d.mts +0 -383
  80. package/dist/package-CMoV9xVN.cjs +0 -155
  81. package/dist/package-WZ0vKAyb.mjs +0 -150
  82. package/dist/plugins-Cmsm3gW1.cjs +0 -791
  83. package/dist/plugins-hpi2GlaX.mjs +0 -790
  84. package/dist/runtime-B4AItsDQ.mjs +0 -458
  85. package/dist/runtime-D5bSEcHa.cjs +0 -523
  86. package/dist/standard-0wBehDUp.cjs +0 -685
  87. package/dist/standard-CYaRay89.mjs +0 -584
@@ -0,0 +1,685 @@
1
+ let __orpc_contract = require("@orpc/contract");
2
+
3
+ //#region ../../node_modules/.bun/@orpc+shared@1.10.4+460773ef8ff1e07c/node_modules/@orpc/shared/dist/index.mjs
4
+ function resolveMaybeOptionalOptions(rest) {
5
+ return rest[0] ?? {};
6
+ }
7
+ function toArray(value$1) {
8
+ return Array.isArray(value$1) ? value$1 : value$1 === void 0 || value$1 === null ? [] : [value$1];
9
+ }
10
+ const ORPC_SHARED_PACKAGE_NAME = "@orpc/shared";
11
+ const ORPC_SHARED_PACKAGE_VERSION = "1.10.4";
12
+ function once(fn) {
13
+ let cached;
14
+ return () => {
15
+ if (cached) return cached.result;
16
+ const result = fn();
17
+ cached = { result };
18
+ return result;
19
+ };
20
+ }
21
+ function sequential(fn) {
22
+ let lastOperationPromise = Promise.resolve();
23
+ return (...args) => {
24
+ return lastOperationPromise = lastOperationPromise.catch(() => {}).then(() => {
25
+ return fn(...args);
26
+ });
27
+ };
28
+ }
29
+ const GLOBAL_OTEL_CONFIG_KEY = `__${ORPC_SHARED_PACKAGE_NAME}@${ORPC_SHARED_PACKAGE_VERSION}/otel/config__`;
30
+ function isAsyncIteratorObject(maybe) {
31
+ if (!maybe || typeof maybe !== "object") return false;
32
+ return "next" in maybe && typeof maybe.next === "function" && Symbol.asyncIterator in maybe && typeof maybe[Symbol.asyncIterator] === "function";
33
+ }
34
+ const fallbackAsyncDisposeSymbol = Symbol.for("asyncDispose");
35
+ const asyncDisposeSymbol = Symbol.asyncDispose ?? fallbackAsyncDisposeSymbol;
36
+ var AsyncIteratorClass = class {
37
+ #isDone = false;
38
+ #isExecuteComplete = false;
39
+ #cleanup;
40
+ #next;
41
+ constructor(next, cleanup) {
42
+ this.#cleanup = cleanup;
43
+ this.#next = sequential(async () => {
44
+ if (this.#isDone) return {
45
+ done: true,
46
+ value: void 0
47
+ };
48
+ try {
49
+ const result = await next();
50
+ if (result.done) this.#isDone = true;
51
+ return result;
52
+ } catch (err) {
53
+ this.#isDone = true;
54
+ throw err;
55
+ } finally {
56
+ if (this.#isDone && !this.#isExecuteComplete) {
57
+ this.#isExecuteComplete = true;
58
+ await this.#cleanup("next");
59
+ }
60
+ }
61
+ });
62
+ }
63
+ next() {
64
+ return this.#next();
65
+ }
66
+ async return(value$1) {
67
+ this.#isDone = true;
68
+ if (!this.#isExecuteComplete) {
69
+ this.#isExecuteComplete = true;
70
+ await this.#cleanup("return");
71
+ }
72
+ return {
73
+ done: true,
74
+ value: value$1
75
+ };
76
+ }
77
+ async throw(err) {
78
+ this.#isDone = true;
79
+ if (!this.#isExecuteComplete) {
80
+ this.#isExecuteComplete = true;
81
+ await this.#cleanup("throw");
82
+ }
83
+ throw err;
84
+ }
85
+ /**
86
+ * asyncDispose symbol only available in esnext, we should fallback to Symbol.for('asyncDispose')
87
+ */
88
+ async [asyncDisposeSymbol]() {
89
+ this.#isDone = true;
90
+ if (!this.#isExecuteComplete) {
91
+ this.#isExecuteComplete = true;
92
+ await this.#cleanup("dispose");
93
+ }
94
+ }
95
+ [Symbol.asyncIterator]() {
96
+ return this;
97
+ }
98
+ };
99
+ function stringifyJSON(value$1) {
100
+ return JSON.stringify(value$1);
101
+ }
102
+ function findDeepMatches(check, payload, segments = [], maps = [], values = []) {
103
+ if (check(payload)) {
104
+ maps.push(segments);
105
+ values.push(payload);
106
+ } else if (Array.isArray(payload)) payload.forEach((v, i) => {
107
+ findDeepMatches(check, v, [...segments, i], maps, values);
108
+ });
109
+ else if (isObject(payload)) for (const key in payload) findDeepMatches(check, payload[key], [...segments, key], maps, values);
110
+ return {
111
+ maps,
112
+ values
113
+ };
114
+ }
115
+ function getConstructor(value$1) {
116
+ if (!isTypescriptObject(value$1)) return null;
117
+ return Object.getPrototypeOf(value$1)?.constructor;
118
+ }
119
+ function isObject(value$1) {
120
+ if (!value$1 || typeof value$1 !== "object") return false;
121
+ const proto = Object.getPrototypeOf(value$1);
122
+ return proto === Object.prototype || !proto || !proto.constructor;
123
+ }
124
+ function isTypescriptObject(value$1) {
125
+ return !!value$1 && (typeof value$1 === "object" || typeof value$1 === "function");
126
+ }
127
+ function clone(value$1) {
128
+ if (Array.isArray(value$1)) return value$1.map(clone);
129
+ if (isObject(value$1)) {
130
+ const result = {};
131
+ for (const key in value$1) result[key] = clone(value$1[key]);
132
+ return result;
133
+ }
134
+ return value$1;
135
+ }
136
+ const NullProtoObj = /* @__PURE__ */ (() => {
137
+ const e = function() {};
138
+ e.prototype = /* @__PURE__ */ Object.create(null);
139
+ Object.freeze(e.prototype);
140
+ return e;
141
+ })();
142
+ function value(value2, ...args) {
143
+ if (typeof value2 === "function") return value2(...args);
144
+ return value2;
145
+ }
146
+ function tryDecodeURIComponent(value$1) {
147
+ try {
148
+ return decodeURIComponent(value$1);
149
+ } catch {
150
+ return value$1;
151
+ }
152
+ }
153
+
154
+ //#endregion
155
+ //#region ../../node_modules/.bun/@orpc+standard-server@1.10.4+460773ef8ff1e07c/node_modules/@orpc/standard-server/dist/index.mjs
156
+ var EventEncoderError = class extends TypeError {};
157
+ var ErrorEvent = class extends Error {
158
+ data;
159
+ constructor(options) {
160
+ super(options?.message ?? "An error event was received", options);
161
+ this.data = options?.data;
162
+ }
163
+ };
164
+ function assertEventId(id) {
165
+ if (id.includes("\n")) throw new EventEncoderError("Event's id must not contain a newline character");
166
+ }
167
+ function assertEventRetry(retry) {
168
+ if (!Number.isInteger(retry) || retry < 0) throw new EventEncoderError("Event's retry must be a integer and >= 0");
169
+ }
170
+ function assertEventComment(comment) {
171
+ if (comment.includes("\n")) throw new EventEncoderError("Event's comment must not contain a newline character");
172
+ }
173
+ const EVENT_SOURCE_META_SYMBOL = Symbol("ORPC_EVENT_SOURCE_META");
174
+ function withEventMeta(container, meta) {
175
+ if (meta.id === void 0 && meta.retry === void 0 && !meta.comments?.length) return container;
176
+ if (meta.id !== void 0) assertEventId(meta.id);
177
+ if (meta.retry !== void 0) assertEventRetry(meta.retry);
178
+ if (meta.comments !== void 0) for (const comment of meta.comments) assertEventComment(comment);
179
+ return new Proxy(container, { get(target, prop, receiver) {
180
+ if (prop === EVENT_SOURCE_META_SYMBOL) return meta;
181
+ return Reflect.get(target, prop, receiver);
182
+ } });
183
+ }
184
+ function getEventMeta(container) {
185
+ return isTypescriptObject(container) ? Reflect.get(container, EVENT_SOURCE_META_SYMBOL) : void 0;
186
+ }
187
+
188
+ //#endregion
189
+ //#region ../../node_modules/.bun/@orpc+client@1.10.4+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.DmkMd_GB.mjs
190
+ const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
191
+ const ORPC_CLIENT_PACKAGE_VERSION = "1.10.4";
192
+ const COMMON_ORPC_ERROR_DEFS = {
193
+ BAD_REQUEST: {
194
+ status: 400,
195
+ message: "Bad Request"
196
+ },
197
+ UNAUTHORIZED: {
198
+ status: 401,
199
+ message: "Unauthorized"
200
+ },
201
+ FORBIDDEN: {
202
+ status: 403,
203
+ message: "Forbidden"
204
+ },
205
+ NOT_FOUND: {
206
+ status: 404,
207
+ message: "Not Found"
208
+ },
209
+ METHOD_NOT_SUPPORTED: {
210
+ status: 405,
211
+ message: "Method Not Supported"
212
+ },
213
+ NOT_ACCEPTABLE: {
214
+ status: 406,
215
+ message: "Not Acceptable"
216
+ },
217
+ TIMEOUT: {
218
+ status: 408,
219
+ message: "Request Timeout"
220
+ },
221
+ CONFLICT: {
222
+ status: 409,
223
+ message: "Conflict"
224
+ },
225
+ PRECONDITION_FAILED: {
226
+ status: 412,
227
+ message: "Precondition Failed"
228
+ },
229
+ PAYLOAD_TOO_LARGE: {
230
+ status: 413,
231
+ message: "Payload Too Large"
232
+ },
233
+ UNSUPPORTED_MEDIA_TYPE: {
234
+ status: 415,
235
+ message: "Unsupported Media Type"
236
+ },
237
+ UNPROCESSABLE_CONTENT: {
238
+ status: 422,
239
+ message: "Unprocessable Content"
240
+ },
241
+ TOO_MANY_REQUESTS: {
242
+ status: 429,
243
+ message: "Too Many Requests"
244
+ },
245
+ CLIENT_CLOSED_REQUEST: {
246
+ status: 499,
247
+ message: "Client Closed Request"
248
+ },
249
+ INTERNAL_SERVER_ERROR: {
250
+ status: 500,
251
+ message: "Internal Server Error"
252
+ },
253
+ NOT_IMPLEMENTED: {
254
+ status: 501,
255
+ message: "Not Implemented"
256
+ },
257
+ BAD_GATEWAY: {
258
+ status: 502,
259
+ message: "Bad Gateway"
260
+ },
261
+ SERVICE_UNAVAILABLE: {
262
+ status: 503,
263
+ message: "Service Unavailable"
264
+ },
265
+ GATEWAY_TIMEOUT: {
266
+ status: 504,
267
+ message: "Gateway Timeout"
268
+ }
269
+ };
270
+ function fallbackORPCErrorStatus(code, status) {
271
+ return status ?? COMMON_ORPC_ERROR_DEFS[code]?.status ?? 500;
272
+ }
273
+ function fallbackORPCErrorMessage(code, message) {
274
+ return message || COMMON_ORPC_ERROR_DEFS[code]?.message || code;
275
+ }
276
+ const GLOBAL_ORPC_ERROR_CONSTRUCTORS_SYMBOL = Symbol.for(`__${ORPC_CLIENT_PACKAGE_NAME}@${ORPC_CLIENT_PACKAGE_VERSION}/error/ORPC_ERROR_CONSTRUCTORS__`);
277
+ globalThis[GLOBAL_ORPC_ERROR_CONSTRUCTORS_SYMBOL] ??= /* @__PURE__ */ new WeakSet();
278
+ const globalORPCErrorConstructors = globalThis[GLOBAL_ORPC_ERROR_CONSTRUCTORS_SYMBOL];
279
+ var ORPCError$1 = class extends Error {
280
+ defined;
281
+ code;
282
+ status;
283
+ data;
284
+ constructor(code, ...rest) {
285
+ const options = resolveMaybeOptionalOptions(rest);
286
+ if (options.status !== void 0 && !isORPCErrorStatus(options.status)) throw new Error("[ORPCError] Invalid error status code.");
287
+ const message = fallbackORPCErrorMessage(code, options.message);
288
+ super(message, options);
289
+ this.code = code;
290
+ this.status = fallbackORPCErrorStatus(code, options.status);
291
+ this.defined = options.defined ?? false;
292
+ this.data = options.data;
293
+ }
294
+ toJSON() {
295
+ return {
296
+ defined: this.defined,
297
+ code: this.code,
298
+ status: this.status,
299
+ message: this.message,
300
+ data: this.data
301
+ };
302
+ }
303
+ /**
304
+ * Workaround for Next.js where different contexts use separate
305
+ * dependency graphs, causing multiple ORPCError constructors existing and breaking
306
+ * `instanceof` checks across contexts.
307
+ *
308
+ * This is particularly problematic with "Optimized SSR", where orpc-client
309
+ * executes in one context but is invoked from another. When an error is thrown
310
+ * in the execution context, `instanceof ORPCError` checks fail in the
311
+ * invocation context due to separate class constructors.
312
+ *
313
+ * @todo Remove this and related code if Next.js resolves the multiple dependency graph issue.
314
+ */
315
+ static [Symbol.hasInstance](instance) {
316
+ if (globalORPCErrorConstructors.has(this)) {
317
+ const constructor = getConstructor(instance);
318
+ if (constructor && globalORPCErrorConstructors.has(constructor)) return true;
319
+ }
320
+ return super[Symbol.hasInstance](instance);
321
+ }
322
+ };
323
+ globalORPCErrorConstructors.add(ORPCError$1);
324
+ function toORPCError(error) {
325
+ return error instanceof ORPCError$1 ? error : new ORPCError$1("INTERNAL_SERVER_ERROR", {
326
+ message: "Internal server error",
327
+ cause: error
328
+ });
329
+ }
330
+ function isORPCErrorStatus(status) {
331
+ return status < 200 || status >= 400;
332
+ }
333
+ function isORPCErrorJson(json) {
334
+ if (!isObject(json)) return false;
335
+ const validKeys = [
336
+ "defined",
337
+ "code",
338
+ "status",
339
+ "message",
340
+ "data"
341
+ ];
342
+ if (Object.keys(json).some((k) => !validKeys.includes(k))) return false;
343
+ return "defined" in json && typeof json.defined === "boolean" && "code" in json && typeof json.code === "string" && "status" in json && typeof json.status === "number" && isORPCErrorStatus(json.status) && "message" in json && typeof json.message === "string";
344
+ }
345
+ function createORPCErrorFromJson(json, options = {}) {
346
+ return new ORPCError$1(json.code, {
347
+ ...options,
348
+ ...json
349
+ });
350
+ }
351
+ function mapEventIterator(iterator, maps) {
352
+ const mapError = async (error) => {
353
+ let mappedError = await maps.error(error);
354
+ if (mappedError !== error) {
355
+ const meta = getEventMeta(error);
356
+ if (meta && isTypescriptObject(mappedError)) mappedError = withEventMeta(mappedError, meta);
357
+ }
358
+ return mappedError;
359
+ };
360
+ return new AsyncIteratorClass(async () => {
361
+ const { done, value: value$1 } = await (async () => {
362
+ try {
363
+ return await iterator.next();
364
+ } catch (error) {
365
+ throw await mapError(error);
366
+ }
367
+ })();
368
+ let mappedValue = await maps.value(value$1, done);
369
+ if (mappedValue !== value$1) {
370
+ const meta = getEventMeta(value$1);
371
+ if (meta && isTypescriptObject(mappedValue)) mappedValue = withEventMeta(mappedValue, meta);
372
+ }
373
+ return {
374
+ done,
375
+ value: mappedValue
376
+ };
377
+ }, async () => {
378
+ try {
379
+ await iterator.return?.();
380
+ } catch (error) {
381
+ throw await mapError(error);
382
+ }
383
+ });
384
+ }
385
+
386
+ //#endregion
387
+ //#region ../../node_modules/.bun/@orpc+openapi-client@1.10.4+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/shared/openapi-client.t9fCAe3x.mjs
388
+ var StandardBracketNotationSerializer = class {
389
+ maxArrayIndex;
390
+ constructor(options = {}) {
391
+ this.maxArrayIndex = options.maxBracketNotationArrayIndex ?? 9999;
392
+ }
393
+ serialize(data, segments = [], result = []) {
394
+ if (Array.isArray(data)) data.forEach((item, i) => {
395
+ this.serialize(item, [...segments, i], result);
396
+ });
397
+ else if (isObject(data)) for (const key in data) this.serialize(data[key], [...segments, key], result);
398
+ else result.push([this.stringifyPath(segments), data]);
399
+ return result;
400
+ }
401
+ deserialize(serialized) {
402
+ if (serialized.length === 0) return {};
403
+ const arrayPushStyles = /* @__PURE__ */ new WeakSet();
404
+ const ref = { value: [] };
405
+ for (const [path, value$1] of serialized) {
406
+ const segments = this.parsePath(path);
407
+ let currentRef = ref;
408
+ let nextSegment = "value";
409
+ segments.forEach((segment, i) => {
410
+ if (!Array.isArray(currentRef[nextSegment]) && !isObject(currentRef[nextSegment])) currentRef[nextSegment] = [];
411
+ if (i !== segments.length - 1) {
412
+ if (Array.isArray(currentRef[nextSegment]) && !isValidArrayIndex(segment, this.maxArrayIndex)) if (arrayPushStyles.has(currentRef[nextSegment])) {
413
+ arrayPushStyles.delete(currentRef[nextSegment]);
414
+ currentRef[nextSegment] = pushStyleArrayToObject(currentRef[nextSegment]);
415
+ } else currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
416
+ } else if (Array.isArray(currentRef[nextSegment])) {
417
+ if (segment === "") {
418
+ if (currentRef[nextSegment].length && !arrayPushStyles.has(currentRef[nextSegment])) currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
419
+ } else if (arrayPushStyles.has(currentRef[nextSegment])) {
420
+ arrayPushStyles.delete(currentRef[nextSegment]);
421
+ currentRef[nextSegment] = pushStyleArrayToObject(currentRef[nextSegment]);
422
+ } else if (!isValidArrayIndex(segment, this.maxArrayIndex)) currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
423
+ }
424
+ currentRef = currentRef[nextSegment];
425
+ nextSegment = segment;
426
+ });
427
+ if (Array.isArray(currentRef) && nextSegment === "") {
428
+ arrayPushStyles.add(currentRef);
429
+ currentRef.push(value$1);
430
+ } else if (nextSegment in currentRef) if (Array.isArray(currentRef[nextSegment])) currentRef[nextSegment].push(value$1);
431
+ else currentRef[nextSegment] = [currentRef[nextSegment], value$1];
432
+ else currentRef[nextSegment] = value$1;
433
+ }
434
+ return ref.value;
435
+ }
436
+ stringifyPath(segments) {
437
+ return segments.map((segment) => {
438
+ return segment.toString().replace(/[\\[\]]/g, (match) => {
439
+ switch (match) {
440
+ case "\\": return "\\\\";
441
+ case "[": return "\\[";
442
+ case "]": return "\\]";
443
+ default: return match;
444
+ }
445
+ });
446
+ }).reduce((result, segment, i) => {
447
+ if (i === 0) return segment;
448
+ return `${result}[${segment}]`;
449
+ }, "");
450
+ }
451
+ parsePath(path) {
452
+ const segments = [];
453
+ let inBrackets = false;
454
+ let currentSegment = "";
455
+ let backslashCount = 0;
456
+ for (let i = 0; i < path.length; i++) {
457
+ const char = path[i];
458
+ const nextChar = path[i + 1];
459
+ if (inBrackets && char === "]" && (nextChar === void 0 || nextChar === "[") && backslashCount % 2 === 0) {
460
+ if (nextChar === void 0) inBrackets = false;
461
+ segments.push(currentSegment);
462
+ currentSegment = "";
463
+ i++;
464
+ } else if (segments.length === 0 && char === "[" && backslashCount % 2 === 0) {
465
+ inBrackets = true;
466
+ segments.push(currentSegment);
467
+ currentSegment = "";
468
+ } else if (char === "\\") backslashCount++;
469
+ else {
470
+ currentSegment += "\\".repeat(backslashCount / 2) + char;
471
+ backslashCount = 0;
472
+ }
473
+ }
474
+ return inBrackets || segments.length === 0 ? [path] : segments;
475
+ }
476
+ };
477
+ function isValidArrayIndex(value$1, maxIndex) {
478
+ return /^0$|^[1-9]\d*$/.test(value$1) && Number(value$1) <= maxIndex;
479
+ }
480
+ function arrayToObject(array) {
481
+ const obj = new NullProtoObj();
482
+ array.forEach((item, i) => {
483
+ obj[i] = item;
484
+ });
485
+ return obj;
486
+ }
487
+ function pushStyleArrayToObject(array) {
488
+ const obj = new NullProtoObj();
489
+ obj[""] = array.length === 1 ? array[0] : array;
490
+ return obj;
491
+ }
492
+
493
+ //#endregion
494
+ //#region ../../node_modules/.bun/@orpc+client@1.10.4+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.Di65MWxv.mjs
495
+ function toHttpPath(path) {
496
+ return `/${path.map(encodeURIComponent).join("/")}`;
497
+ }
498
+
499
+ //#endregion
500
+ //#region ../../node_modules/.bun/@orpc+openapi-client@1.10.4+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/shared/openapi-client.B2Q9qU5m.mjs
501
+ var StandardOpenAPIJsonSerializer = class {
502
+ customSerializers;
503
+ constructor(options = {}) {
504
+ this.customSerializers = options.customJsonSerializers ?? [];
505
+ }
506
+ serialize(data, hasBlobRef = { value: false }) {
507
+ for (const custom of this.customSerializers) if (custom.condition(data)) return this.serialize(custom.serialize(data), hasBlobRef);
508
+ if (data instanceof Blob) {
509
+ hasBlobRef.value = true;
510
+ return [data, hasBlobRef.value];
511
+ }
512
+ if (data instanceof Set) return this.serialize(Array.from(data), hasBlobRef);
513
+ if (data instanceof Map) return this.serialize(Array.from(data.entries()), hasBlobRef);
514
+ if (Array.isArray(data)) return [data.map((v) => v === void 0 ? null : this.serialize(v, hasBlobRef)[0]), hasBlobRef.value];
515
+ if (isObject(data)) {
516
+ const json = {};
517
+ for (const k in data) {
518
+ if (k === "toJSON" && typeof data[k] === "function") continue;
519
+ json[k] = this.serialize(data[k], hasBlobRef)[0];
520
+ }
521
+ return [json, hasBlobRef.value];
522
+ }
523
+ if (typeof data === "bigint" || data instanceof RegExp || data instanceof URL) return [data.toString(), hasBlobRef.value];
524
+ if (data instanceof Date) return [Number.isNaN(data.getTime()) ? null : data.toISOString(), hasBlobRef.value];
525
+ if (Number.isNaN(data)) return [null, hasBlobRef.value];
526
+ return [data, hasBlobRef.value];
527
+ }
528
+ };
529
+ function standardizeHTTPPath(path) {
530
+ return `/${path.replace(/\/{2,}/g, "/").replace(/^\/|\/$/g, "")}`;
531
+ }
532
+ function getDynamicParams(path) {
533
+ return path ? standardizeHTTPPath(path).match(/\/\{[^}]+\}/g)?.map((v) => ({
534
+ raw: v,
535
+ name: v.match(/\{\+?([^}]+)\}/)[1]
536
+ })) : void 0;
537
+ }
538
+ var StandardOpenAPISerializer = class {
539
+ constructor(jsonSerializer, bracketNotation) {
540
+ this.jsonSerializer = jsonSerializer;
541
+ this.bracketNotation = bracketNotation;
542
+ }
543
+ serialize(data, options = {}) {
544
+ if (isAsyncIteratorObject(data) && !options.outputFormat) return mapEventIterator(data, {
545
+ value: async (value$1) => this.#serialize(value$1, { outputFormat: "plain" }),
546
+ error: async (e) => {
547
+ return new ErrorEvent({
548
+ data: this.#serialize(toORPCError(e).toJSON(), { outputFormat: "plain" }),
549
+ cause: e
550
+ });
551
+ }
552
+ });
553
+ return this.#serialize(data, options);
554
+ }
555
+ #serialize(data, options) {
556
+ const [json, hasBlob] = this.jsonSerializer.serialize(data);
557
+ if (options.outputFormat === "plain") return json;
558
+ if (options.outputFormat === "URLSearchParams") {
559
+ const params = new URLSearchParams();
560
+ for (const [path, value$1] of this.bracketNotation.serialize(json)) if (typeof value$1 === "string" || typeof value$1 === "number" || typeof value$1 === "boolean") params.append(path, value$1.toString());
561
+ return params;
562
+ }
563
+ if (json instanceof Blob || json === void 0 || !hasBlob) return json;
564
+ const form = new FormData();
565
+ for (const [path, value$1] of this.bracketNotation.serialize(json)) if (typeof value$1 === "string" || typeof value$1 === "number" || typeof value$1 === "boolean") form.append(path, value$1.toString());
566
+ else if (value$1 instanceof Blob) form.append(path, value$1);
567
+ return form;
568
+ }
569
+ deserialize(data) {
570
+ if (data instanceof URLSearchParams || data instanceof FormData) return this.bracketNotation.deserialize(Array.from(data.entries()));
571
+ if (isAsyncIteratorObject(data)) return mapEventIterator(data, {
572
+ value: async (value$1) => value$1,
573
+ error: async (e) => {
574
+ if (e instanceof ErrorEvent && isORPCErrorJson(e.data)) return createORPCErrorFromJson(e.data, { cause: e });
575
+ return e;
576
+ }
577
+ });
578
+ return data;
579
+ }
580
+ };
581
+
582
+ //#endregion
583
+ Object.defineProperty(exports, 'StandardBracketNotationSerializer', {
584
+ enumerable: true,
585
+ get: function () {
586
+ return StandardBracketNotationSerializer;
587
+ }
588
+ });
589
+ Object.defineProperty(exports, 'StandardOpenAPIJsonSerializer', {
590
+ enumerable: true,
591
+ get: function () {
592
+ return StandardOpenAPIJsonSerializer;
593
+ }
594
+ });
595
+ Object.defineProperty(exports, 'StandardOpenAPISerializer', {
596
+ enumerable: true,
597
+ get: function () {
598
+ return StandardOpenAPISerializer;
599
+ }
600
+ });
601
+ Object.defineProperty(exports, 'clone', {
602
+ enumerable: true,
603
+ get: function () {
604
+ return clone;
605
+ }
606
+ });
607
+ Object.defineProperty(exports, 'fallbackORPCErrorMessage', {
608
+ enumerable: true,
609
+ get: function () {
610
+ return fallbackORPCErrorMessage;
611
+ }
612
+ });
613
+ Object.defineProperty(exports, 'fallbackORPCErrorStatus', {
614
+ enumerable: true,
615
+ get: function () {
616
+ return fallbackORPCErrorStatus;
617
+ }
618
+ });
619
+ Object.defineProperty(exports, 'findDeepMatches', {
620
+ enumerable: true,
621
+ get: function () {
622
+ return findDeepMatches;
623
+ }
624
+ });
625
+ Object.defineProperty(exports, 'getDynamicParams', {
626
+ enumerable: true,
627
+ get: function () {
628
+ return getDynamicParams;
629
+ }
630
+ });
631
+ Object.defineProperty(exports, 'isORPCErrorStatus', {
632
+ enumerable: true,
633
+ get: function () {
634
+ return isORPCErrorStatus;
635
+ }
636
+ });
637
+ Object.defineProperty(exports, 'isObject', {
638
+ enumerable: true,
639
+ get: function () {
640
+ return isObject;
641
+ }
642
+ });
643
+ Object.defineProperty(exports, 'once', {
644
+ enumerable: true,
645
+ get: function () {
646
+ return once;
647
+ }
648
+ });
649
+ Object.defineProperty(exports, 'standardizeHTTPPath', {
650
+ enumerable: true,
651
+ get: function () {
652
+ return standardizeHTTPPath;
653
+ }
654
+ });
655
+ Object.defineProperty(exports, 'stringifyJSON', {
656
+ enumerable: true,
657
+ get: function () {
658
+ return stringifyJSON;
659
+ }
660
+ });
661
+ Object.defineProperty(exports, 'toArray', {
662
+ enumerable: true,
663
+ get: function () {
664
+ return toArray;
665
+ }
666
+ });
667
+ Object.defineProperty(exports, 'toHttpPath', {
668
+ enumerable: true,
669
+ get: function () {
670
+ return toHttpPath;
671
+ }
672
+ });
673
+ Object.defineProperty(exports, 'tryDecodeURIComponent', {
674
+ enumerable: true,
675
+ get: function () {
676
+ return tryDecodeURIComponent;
677
+ }
678
+ });
679
+ Object.defineProperty(exports, 'value', {
680
+ enumerable: true,
681
+ get: function () {
682
+ return value;
683
+ }
684
+ });
685
+ //# sourceMappingURL=standard-v75BC6Z5.cjs.map