@powerlines/deepkit 0.5.88 → 0.5.90

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.
@@ -8,163 +8,261 @@ var isNull$1 = require('@stryke/type-checks/is-null');
8
8
  var isString$1 = require('@stryke/type-checks/is-string');
9
9
  var isUndefined$1 = require('@stryke/type-checks/is-undefined');
10
10
 
11
- // ../../node_modules/.pnpm/@stryke+helpers@0.9.34/node_modules/@stryke/helpers/dist/get-unique.mjs
12
- function t(e7, t7 = (e8) => e8) {
13
- let n6 = /* @__PURE__ */ new Map();
14
- for (let r5 of e7) {
15
- let e8 = t7(r5);
16
- n6.has(e8) || n6.set(e8, r5);
17
- }
18
- return [...n6.values()];
11
+ // ../../node_modules/.pnpm/@stryke+helpers@0.9.36/node_modules/@stryke/helpers/dist/get-unique.mjs
12
+ function getUniqueBy(arr, mapper = (item) => item) {
13
+ const map = /* @__PURE__ */ new Map();
14
+ for (const item of arr) {
15
+ const key = mapper(item);
16
+ if (!map.has(key)) map.set(key, item);
17
+ }
18
+ return [...map.values()];
19
19
  }
20
- chunkUSNT2KNT_cjs.__name(t, "t");
20
+ chunkUSNT2KNT_cjs.__name(getUniqueBy, "getUniqueBy");
21
21
 
22
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/type-checks/src/get-object-tag.mjs
23
- var e = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => e7 == null ? e7 === void 0 ? `[object Undefined]` : `[object Null]` : Object.prototype.toString.call(e7), "e");
22
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/type-checks/src/get-object-tag.mjs
23
+ var getObjectTag = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
24
+ if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
25
+ return Object.prototype.toString.call(value);
26
+ }, "getObjectTag");
24
27
 
25
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/type-checks/src/is-plain-object.mjs
26
- var t2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => typeof e7 == `object` && !!e7, "t");
27
- var n = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((n6) => {
28
- if (!t2(n6) || e(n6) !== `[object Object]`) return false;
29
- if (Object.getPrototypeOf(n6) === null) return true;
30
- let r5 = n6;
31
- for (; Object.getPrototypeOf(r5) !== null; ) r5 = Object.getPrototypeOf(r5);
32
- return Object.getPrototypeOf(n6) === r5;
33
- }, "n");
28
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/type-checks/src/is-plain-object.mjs
29
+ var isObjectLike = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((obj) => {
30
+ return typeof obj === "object" && obj !== null;
31
+ }, "isObjectLike");
32
+ var isPlainObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((obj) => {
33
+ if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") return false;
34
+ if (Object.getPrototypeOf(obj) === null) return true;
35
+ let proto = obj;
36
+ while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
37
+ return Object.getPrototypeOf(obj) === proto;
38
+ }, "isPlainObject");
34
39
 
35
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/type-checks/src/is-object.mjs
36
- var t3 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((t7) => {
40
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/type-checks/src/is-object.mjs
41
+ var isObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
37
42
  try {
38
- return typeof t7 == `object` || !!t7 && t7?.constructor === Object || n(t7);
43
+ return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject(value);
39
44
  } catch {
40
45
  return false;
41
46
  }
42
- }, "t");
47
+ }, "isObject");
43
48
 
44
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/type-checks/src/is-string.mjs
45
- var e2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => {
49
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/type-checks/src/is-string.mjs
50
+ var isString = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
46
51
  try {
47
- return typeof e7 == `string`;
52
+ return typeof value === "string";
48
53
  } catch {
49
54
  return false;
50
55
  }
51
- }, "e");
56
+ }, "isString");
52
57
 
53
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/types/src/base.mjs
54
- var e3 = ``;
58
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/types/src/base.mjs
59
+ var EMPTY_STRING = "";
55
60
 
56
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/utils/strip-comments.mjs
57
- var t4 = Symbol(`singleComment`);
58
- var n2 = Symbol(`multiComment`);
59
- function r() {
60
- return ``;
61
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/utils/strip-comments.mjs
62
+ var singleComment = Symbol("singleComment");
63
+ var multiComment = Symbol("multiComment");
64
+ function stripWithoutWhitespace() {
65
+ return "";
61
66
  }
62
- chunkUSNT2KNT_cjs.__name(r, "r");
63
- function i(e7, t7, n6) {
64
- return e7.slice(t7, n6).replace(/\S/g, ` `);
67
+ chunkUSNT2KNT_cjs.__name(stripWithoutWhitespace, "stripWithoutWhitespace");
68
+ function stripWithWhitespace(value, start, end) {
69
+ return value.slice(start, end).replace(/\S/g, " ");
65
70
  }
66
- chunkUSNT2KNT_cjs.__name(i, "i");
67
- function a(e7, t7) {
68
- let n6 = t7 - 1, r5 = 0;
69
- for (; e7[n6] === `\\`; ) --n6, r5 += 1;
70
- return !!(r5 % 2);
71
+ chunkUSNT2KNT_cjs.__name(stripWithWhitespace, "stripWithWhitespace");
72
+ function isEscaped(value, quotePosition) {
73
+ let index = quotePosition - 1;
74
+ let backslashCount = 0;
75
+ while (value[index] === "\\") {
76
+ index -= 1;
77
+ backslashCount += 1;
78
+ }
79
+ return Boolean(backslashCount % 2);
71
80
  }
72
- chunkUSNT2KNT_cjs.__name(a, "a");
73
- function o(o4, { whitespace: s = true, trailingCommas: c2 = false } = {}) {
74
- if (typeof o4 != `string`) throw TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof o4}\``);
75
- let l = s ? i : r, u = false, d = false, f = 0, p = ``, m = ``, h = -1;
76
- for (let r5 = 0; r5 < o4.length; r5++) {
77
- let i3 = o4[r5], s2 = o4[r5 + 1];
78
- !d && i3 === `"` && (a(o4, r5) || (u = !u)), !u && (!d && i3 + (s2 ?? e3) === `//` ? (p += o4.slice(f, r5), f = r5, d = t4, r5++) : d === t4 && i3 + (s2 ?? e3) === `\r
79
- ` ? (r5++, d = false, p += l(o4, f, r5), f = r5) : d === t4 && i3 === `
80
- ` ? (d = false, p += l(o4, f, r5), f = r5) : !d && i3 + (s2 ?? e3) === `/*` ? (p += o4.slice(f, r5), f = r5, d = n2, r5++) : d === n2 && i3 + (s2 ?? e3) === `*/` ? (r5++, d = false, p += l(o4, f, r5 + 1), f = r5 + 1) : c2 && !d && (h === -1 ? i3 === `,` && (m += p + o4.slice(f, r5), p = ``, f = r5, h = r5) : i3 === `}` || i3 === `]` ? (p += o4.slice(f, r5), m += l(p, 0, 1) + p.slice(1), p = ``, f = r5, h = -1) : i3 !== ` ` && i3 !== ` ` && i3 !== `\r` && i3 !== `
81
- ` && (p += o4.slice(f, r5), f = r5, h = -1)));
82
- }
83
- return m + p + (d ? l(o4.slice(f)) : o4.slice(f));
81
+ chunkUSNT2KNT_cjs.__name(isEscaped, "isEscaped");
82
+ function stripComments(value, { whitespace = true, trailingCommas = false } = {}) {
83
+ if (typeof value !== "string") throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof value}\``);
84
+ const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
85
+ let isInsideString = false;
86
+ let isInsideComment = false;
87
+ let offset = 0;
88
+ let buffer = "";
89
+ let result = "";
90
+ let commaIndex = -1;
91
+ for (let index = 0; index < value.length; index++) {
92
+ const currentCharacter = value[index];
93
+ const nextCharacter = value[index + 1];
94
+ if (!isInsideComment && currentCharacter === '"') {
95
+ if (!isEscaped(value, index)) isInsideString = !isInsideString;
96
+ }
97
+ if (isInsideString) continue;
98
+ if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "//") {
99
+ buffer += value.slice(offset, index);
100
+ offset = index;
101
+ isInsideComment = singleComment;
102
+ index++;
103
+ } else if (isInsideComment === singleComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "\r\n") {
104
+ index++;
105
+ isInsideComment = false;
106
+ buffer += strip(value, offset, index);
107
+ offset = index;
108
+ } else if (isInsideComment === singleComment && currentCharacter === "\n") {
109
+ isInsideComment = false;
110
+ buffer += strip(value, offset, index);
111
+ offset = index;
112
+ } else if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "/*") {
113
+ buffer += value.slice(offset, index);
114
+ offset = index;
115
+ isInsideComment = multiComment;
116
+ index++;
117
+ } else if (isInsideComment === multiComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "*/") {
118
+ index++;
119
+ isInsideComment = false;
120
+ buffer += strip(value, offset, index + 1);
121
+ offset = index + 1;
122
+ } else if (trailingCommas && !isInsideComment) {
123
+ if (commaIndex !== -1) {
124
+ if (currentCharacter === "}" || currentCharacter === "]") {
125
+ buffer += value.slice(offset, index);
126
+ result += strip(buffer, 0, 1) + buffer.slice(1);
127
+ buffer = "";
128
+ offset = index;
129
+ commaIndex = -1;
130
+ } else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
131
+ buffer += value.slice(offset, index);
132
+ offset = index;
133
+ commaIndex = -1;
134
+ }
135
+ } else if (currentCharacter === ",") {
136
+ result += buffer + value.slice(offset, index);
137
+ buffer = "";
138
+ offset = index;
139
+ commaIndex = index;
140
+ }
141
+ }
142
+ }
143
+ return result + buffer + (isInsideComment ? strip(value.slice(offset)) : value.slice(offset));
84
144
  }
85
- chunkUSNT2KNT_cjs.__name(o, "o");
145
+ chunkUSNT2KNT_cjs.__name(stripComments, "stripComments");
86
146
 
87
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/utils/parse.mjs
88
- var t5 = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
89
- var n3 = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
90
- var r2 = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
91
- function i2(e7, t7) {
92
- if (e7 === `__proto__` || e7 === `constructor` && t7 && typeof t7 == `object` && `prototype` in t7) {
93
- console.warn(`Dropping "${e7}" key to prevent prototype pollution.`);
147
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/utils/parse.mjs
148
+ var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
149
+ var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
150
+ var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
151
+ function jsonParseTransform(key, value) {
152
+ if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
153
+ console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
94
154
  return;
95
155
  }
96
- return t7;
156
+ return value;
97
157
  }
98
- chunkUSNT2KNT_cjs.__name(i2, "i");
99
- function a2(a3, o4 = {}) {
100
- if (typeof a3 != `string`) return a3;
101
- let s = o(a3);
102
- if (s[0] === `"` && s[s.length - 1] === `"` && !s.includes(`\\`)) return s.slice(1, -1);
103
- if (s = s.trim(), s.length <= 9) switch (s.toLowerCase()) {
104
- case `true`:
158
+ chunkUSNT2KNT_cjs.__name(jsonParseTransform, "jsonParseTransform");
159
+ function parse(value, options = {}) {
160
+ if (typeof value !== "string") return value;
161
+ let stripped = stripComments(value);
162
+ if (stripped[0] === '"' && stripped[stripped.length - 1] === '"' && !stripped.includes("\\")) return stripped.slice(1, -1);
163
+ stripped = stripped.trim();
164
+ if (stripped.length <= 9) switch (stripped.toLowerCase()) {
165
+ case "true":
105
166
  return true;
106
- case `false`:
167
+ case "false":
107
168
  return false;
108
- case `undefined`:
169
+ case "undefined":
109
170
  return;
110
- case `null`:
171
+ case "null":
111
172
  return null;
112
- case `nan`:
173
+ case "nan":
113
174
  return NaN;
114
- case `infinity`:
115
- return 1 / 0;
116
- case `-infinity`:
117
- return -1 / 0;
175
+ case "infinity":
176
+ return Number.POSITIVE_INFINITY;
177
+ case "-infinity":
178
+ return Number.NEGATIVE_INFINITY;
118
179
  }
119
- if (!r2.test(s)) {
120
- if (o4.strict) throw Error(`Invalid JSON`);
121
- return s;
180
+ if (!JsonSigRx.test(stripped)) {
181
+ if (options.strict) throw new Error("Invalid JSON");
182
+ return stripped;
122
183
  }
123
184
  try {
124
- if (t5.test(s) || n3.test(s)) {
125
- if (o4.strict) throw Error(`Possible prototype pollution`);
126
- return JSON.parse(s, i2);
185
+ if (suspectProtoRx.test(stripped) || suspectConstructorRx.test(stripped)) {
186
+ if (options.strict) throw new Error("Possible prototype pollution");
187
+ return JSON.parse(stripped, jsonParseTransform);
127
188
  }
128
- return JSON.parse(s);
129
- } catch (e7) {
130
- if (o4.strict) throw e7;
131
- return a3;
189
+ return JSON.parse(stripped);
190
+ } catch (error) {
191
+ if (options.strict) throw error;
192
+ return value;
132
193
  }
133
194
  }
134
- chunkUSNT2KNT_cjs.__name(a2, "a");
195
+ chunkUSNT2KNT_cjs.__name(parse, "parse");
135
196
 
136
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/utils/code-frames.mjs
137
- var e4 = /\r\n|[\n\r\u2028\u2029]/;
138
- function t6(e7, t7, n6 = {}) {
139
- let r5 = { column: 0, line: -1, ...e7.start }, i3 = { ...r5, ...e7.end }, { linesAbove: a3 = 2, linesBelow: o4 = 3 } = n6 || {}, s = r5.line, c2 = r5.column, l = i3.line, u = i3.column, d = Math.max(s - (a3 + 1), 0), f = Math.min(t7.length, l + o4);
140
- s === -1 && (d = 0), l === -1 && (f = t7.length);
141
- let p = l - s, m = {};
142
- if (p) for (let e8 = 0; e8 <= p; e8++) {
143
- let n7 = e8 + s;
144
- c2 ? e8 === 0 ? m[n7] = [c2, (t7[n7 - 1]?.length ?? 0) - c2 + 1] : e8 === p ? m[n7] = [0, u] : m[n7] = [0, t7[n7 - e8]?.length ?? 0] : m[n7] = true;
145
- }
146
- else c2 === u ? m[s] = c2 ? [c2, 0] : true : m[s] = [c2, u - c2];
147
- return { start: d, end: f, markerLines: m };
197
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/utils/code-frames.mjs
198
+ var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
199
+ function getMarkerLines(loc, source, opts = {}) {
200
+ const startLoc = {
201
+ column: 0,
202
+ line: -1,
203
+ ...loc.start
204
+ };
205
+ const endLoc = {
206
+ ...startLoc,
207
+ ...loc.end
208
+ };
209
+ const { linesAbove = 2, linesBelow = 3 } = opts || {};
210
+ const startLine = startLoc.line;
211
+ const startColumn = startLoc.column;
212
+ const endLine = endLoc.line;
213
+ const endColumn = endLoc.column;
214
+ let start = Math.max(startLine - (linesAbove + 1), 0);
215
+ let end = Math.min(source.length, endLine + linesBelow);
216
+ if (startLine === -1) start = 0;
217
+ if (endLine === -1) end = source.length;
218
+ const lineDiff = endLine - startLine;
219
+ const markerLines = {};
220
+ if (lineDiff) for (let i = 0; i <= lineDiff; i++) {
221
+ const lineNumber = i + startLine;
222
+ if (!startColumn) markerLines[lineNumber] = true;
223
+ else if (i === 0) markerLines[lineNumber] = [startColumn, (source[lineNumber - 1]?.length ?? 0) - startColumn + 1];
224
+ else if (i === lineDiff) markerLines[lineNumber] = [0, endColumn];
225
+ else markerLines[lineNumber] = [0, source[lineNumber - i]?.length ?? 0];
226
+ }
227
+ else if (startColumn === endColumn) markerLines[startLine] = startColumn ? [startColumn, 0] : true;
228
+ else markerLines[startLine] = [startColumn, endColumn - startColumn];
229
+ return {
230
+ start,
231
+ end,
232
+ markerLines
233
+ };
148
234
  }
149
- chunkUSNT2KNT_cjs.__name(t6, "t");
150
- function n4(n6, r5, i3 = {}) {
151
- let { start: a3, end: o4, markerLines: s } = t6(r5, n6.split(e4), i3), c2 = String(o4).length;
152
- return (i3.highlight ? i3.highlight(n6) : n6).split(e4).slice(a3, o4).map((e7, t7) => {
153
- let n7 = a3 + 1 + t7, r6 = ` ${` ${n7}`.slice(-c2)} | `, i4 = !!(s[n7] ?? false);
154
- if (i4) {
155
- let t8 = ``;
156
- if (Array.isArray(i4)) {
157
- let n8 = e7.slice(0, Math.max(i4[0] - 1, 0)).replace(/[^\t]/g, ` `), a4 = i4[1] || 1;
158
- t8 = [`
159
- `, r6.replace(/\d/g, ` `), n8, `^`.repeat(a4)].join(``);
235
+ chunkUSNT2KNT_cjs.__name(getMarkerLines, "getMarkerLines");
236
+ function codeFrameColumns(rawLines, loc, opts = {}) {
237
+ const { start, end, markerLines } = getMarkerLines(loc, rawLines.split(NEWLINE), opts);
238
+ const numberMaxWidth = String(end).length;
239
+ return (opts.highlight ? opts.highlight(rawLines) : rawLines).split(NEWLINE).slice(start, end).map((line, index) => {
240
+ const number = start + 1 + index;
241
+ const gutter = ` ${` ${number}`.slice(-numberMaxWidth)} | `;
242
+ const hasMarker = Boolean(markerLines[number] ?? false);
243
+ if (hasMarker) {
244
+ let markerLine = "";
245
+ if (Array.isArray(hasMarker)) {
246
+ const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
247
+ const numberOfMarkers = hasMarker[1] || 1;
248
+ markerLine = [
249
+ "\n ",
250
+ gutter.replace(/\d/g, " "),
251
+ markerSpacing,
252
+ "^".repeat(numberOfMarkers)
253
+ ].join("");
160
254
  }
161
- return [`>`, r6, e7, t8].join(``);
255
+ return [
256
+ ">",
257
+ gutter,
258
+ line,
259
+ markerLine
260
+ ].join("");
162
261
  }
163
- return ` ${r6}${e7}`;
164
- }).join(`
165
- `);
262
+ return ` ${gutter}${line}`;
263
+ }).join("\n");
166
264
  }
167
- chunkUSNT2KNT_cjs.__name(n4, "n");
265
+ chunkUSNT2KNT_cjs.__name(codeFrameColumns, "codeFrameColumns");
168
266
 
169
267
  // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
170
268
  function createScanner(text, ignoreTrivia = false) {
@@ -605,7 +703,7 @@ var ParseOptions;
605
703
  allowTrailingComma: false
606
704
  };
607
705
  })(ParseOptions || (ParseOptions = {}));
608
- function parse(text, errors = [], options = ParseOptions.DEFAULT) {
706
+ function parse2(text, errors = [], options = ParseOptions.DEFAULT) {
609
707
  let currentProperty = null;
610
708
  let currentParent = [];
611
709
  const previousParents = [];
@@ -653,7 +751,7 @@ function parse(text, errors = [], options = ParseOptions.DEFAULT) {
653
751
  visit(text, visitor, options);
654
752
  return currentParent[0];
655
753
  }
656
- chunkUSNT2KNT_cjs.__name(parse, "parse");
754
+ chunkUSNT2KNT_cjs.__name(parse2, "parse");
657
755
  function visit(text, visitor, options = ParseOptions.DEFAULT) {
658
756
  const _scanner = createScanner(text, false);
659
757
  const _jsonPath = [];
@@ -984,7 +1082,7 @@ var SyntaxKind;
984
1082
  SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
985
1083
  SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
986
1084
  })(SyntaxKind || (SyntaxKind = {}));
987
- var parse2 = parse;
1085
+ var parse3 = parse2;
988
1086
  var ParseErrorCode;
989
1087
  (function(ParseErrorCode2) {
990
1088
  ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
@@ -1104,58 +1202,107 @@ var LinesAndColumns = (
1104
1202
  })()
1105
1203
  );
1106
1204
 
1107
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/utils/parse-error.mjs
1108
- function r3(r5, i3) {
1109
- let { error: a3, offset: o4, length: s } = i3, c2 = new LinesAndColumns(r5).locationForIndex(o4), l = c2?.line ?? 0, u = c2?.column ?? 0;
1110
- return l++, u++, `${printParseErrorCode(a3)} in JSON at ${l}:${u}
1111
- ${n4(r5, { start: { line: l, column: u }, end: { line: l, column: u + s } })}
1205
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/utils/parse-error.mjs
1206
+ function formatParseError(input, parseError) {
1207
+ const { error, offset, length } = parseError;
1208
+ const result = new LinesAndColumns(input).locationForIndex(offset);
1209
+ let line = result?.line ?? 0;
1210
+ let column = result?.column ?? 0;
1211
+ line++;
1212
+ column++;
1213
+ return `${printParseErrorCode(error)} in JSON at ${line}:${column}
1214
+ ${codeFrameColumns(input, {
1215
+ start: {
1216
+ line,
1217
+ column
1218
+ },
1219
+ end: {
1220
+ line,
1221
+ column: column + length
1222
+ }
1223
+ })}
1112
1224
  `;
1113
1225
  }
1114
- chunkUSNT2KNT_cjs.__name(r3, "r");
1226
+ chunkUSNT2KNT_cjs.__name(formatParseError, "formatParseError");
1115
1227
 
1116
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/type-checks/src/is-number.mjs
1117
- var e5 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => {
1228
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/type-checks/src/is-number.mjs
1229
+ var isNumber = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
1118
1230
  try {
1119
- return e7 instanceof Number || typeof e7 == `number` || Number(e7) === e7;
1231
+ return value instanceof Number || typeof value === "number" || Number(value) === value;
1120
1232
  } catch {
1121
1233
  return false;
1122
1234
  }
1123
- }, "e");
1235
+ }, "isNumber");
1124
1236
 
1125
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/type-checks/src/is-undefined.mjs
1126
- var e6 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => e7 === void 0, "e");
1237
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/type-checks/src/is-undefined.mjs
1238
+ var isUndefined = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value) => {
1239
+ return value === void 0;
1240
+ }, "isUndefined");
1127
1241
 
1128
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/utils/stringify.mjs
1129
- var n5 = `@/#$ :;,.!?&=+-*%^~|\\"'\`{}[]()<>`.split(``);
1130
- var r4 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((i3, a3 = 2) => {
1131
- let o4 = e5(a3) ? ` `.repeat(a3) : a3;
1132
- switch (i3) {
1242
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/utils/stringify.mjs
1243
+ var invalidKeyChars = [
1244
+ "@",
1245
+ "/",
1246
+ "#",
1247
+ "$",
1248
+ " ",
1249
+ ":",
1250
+ ";",
1251
+ ",",
1252
+ ".",
1253
+ "!",
1254
+ "?",
1255
+ "&",
1256
+ "=",
1257
+ "+",
1258
+ "-",
1259
+ "*",
1260
+ "%",
1261
+ "^",
1262
+ "~",
1263
+ "|",
1264
+ "\\",
1265
+ '"',
1266
+ "'",
1267
+ "`",
1268
+ "{",
1269
+ "}",
1270
+ "[",
1271
+ "]",
1272
+ "(",
1273
+ ")",
1274
+ "<",
1275
+ ">"
1276
+ ];
1277
+ var stringify = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value, spacing = 2) => {
1278
+ const space = isNumber(spacing) ? " ".repeat(spacing) : spacing;
1279
+ switch (value) {
1133
1280
  case null:
1134
- return `null`;
1281
+ return "null";
1135
1282
  case void 0:
1136
- return `"undefined"`;
1283
+ return '"undefined"';
1137
1284
  case true:
1138
- return `true`;
1285
+ return "true";
1139
1286
  case false:
1140
- return `false`;
1141
- case 1 / 0:
1142
- return `infinity`;
1143
- case -1 / 0:
1144
- return `-infinity`;
1145
- }
1146
- if (Array.isArray(i3)) return `[${o4}${i3.map((e7) => r4(e7, o4)).join(`,${o4}`)}${o4}]`;
1147
- if (i3 instanceof Uint8Array) return i3.toString();
1148
- switch (typeof i3) {
1149
- case `number`:
1150
- return `${i3}`;
1151
- case `string`:
1152
- return JSON.stringify(i3);
1153
- case `object`:
1154
- return `{${o4}${Object.keys(i3).filter((e7) => !e6(i3[e7])).map((e7) => `${n5.some((t7) => e7.includes(t7)) ? `"${e7}"` : e7}: ${o4}${r4(i3[e7], o4)}`).join(`,${o4}`)}${o4}}`;
1287
+ return "false";
1288
+ case Number.POSITIVE_INFINITY:
1289
+ return "infinity";
1290
+ case Number.NEGATIVE_INFINITY:
1291
+ return "-infinity";
1292
+ }
1293
+ if (Array.isArray(value)) return `[${space}${value.map((v) => stringify(v, space)).join(`,${space}`)}${space}]`;
1294
+ if (value instanceof Uint8Array) return value.toString();
1295
+ switch (typeof value) {
1296
+ case "number":
1297
+ return `${value}`;
1298
+ case "string":
1299
+ return JSON.stringify(value);
1300
+ case "object":
1301
+ return `{${space}${Object.keys(value).filter((key) => !isUndefined(value[key])).map((key) => `${invalidKeyChars.some((invalidKeyChar) => key.includes(invalidKeyChar)) ? `"${key}"` : key}: ${space}${stringify(value[key], space)}`).join(`,${space}`)}${space}}`;
1155
1302
  default:
1156
- return `null`;
1303
+ return "null";
1157
1304
  }
1158
- }, "r");
1305
+ }, "stringify");
1159
1306
 
1160
1307
  // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js
1161
1308
  var DoubleIndexedKV = class {
@@ -1217,7 +1364,7 @@ var ClassRegistry = class extends Registry {
1217
1364
  chunkUSNT2KNT_cjs.__name(this, "ClassRegistry");
1218
1365
  }
1219
1366
  constructor() {
1220
- super((c2) => c2.name);
1367
+ super((c) => c.name);
1221
1368
  this.classToAllowedProps = /* @__PURE__ */ new Map();
1222
1369
  }
1223
1370
  register(value, options) {
@@ -1255,8 +1402,8 @@ function find(record, predicate) {
1255
1402
  return values.find(predicate);
1256
1403
  }
1257
1404
  const valuesNotNever = values;
1258
- for (let i3 = 0; i3 < valuesNotNever.length; i3++) {
1259
- const value = valuesNotNever[i3];
1405
+ for (let i = 0; i < valuesNotNever.length; i++) {
1406
+ const value = valuesNotNever[i];
1260
1407
  if (predicate(value)) {
1261
1408
  return value;
1262
1409
  }
@@ -1273,8 +1420,8 @@ function includes(arr, value) {
1273
1420
  }
1274
1421
  chunkUSNT2KNT_cjs.__name(includes, "includes");
1275
1422
  function findArr(record, predicate) {
1276
- for (let i3 = 0; i3 < record.length; i3++) {
1277
- const value = record[i3];
1423
+ for (let i = 0; i < record.length; i++) {
1424
+ const value = record[i];
1278
1425
  if (predicate(value)) {
1279
1426
  return value;
1280
1427
  }
@@ -1304,18 +1451,18 @@ var CustomTransformerRegistry = class {
1304
1451
 
1305
1452
  // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.js
1306
1453
  var getType = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => Object.prototype.toString.call(payload).slice(8, -1), "getType");
1307
- var isUndefined = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "undefined", "isUndefined");
1454
+ var isUndefined2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "undefined", "isUndefined");
1308
1455
  var isNull = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload === null, "isNull");
1309
- var isPlainObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => {
1456
+ var isPlainObject2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => {
1310
1457
  if (typeof payload !== "object" || payload === null) return false;
1311
1458
  if (payload === Object.prototype) return false;
1312
1459
  if (Object.getPrototypeOf(payload) === null) return true;
1313
1460
  return Object.getPrototypeOf(payload) === Object.prototype;
1314
1461
  }, "isPlainObject");
1315
- var isEmptyObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => isPlainObject(payload) && Object.keys(payload).length === 0, "isEmptyObject");
1462
+ var isEmptyObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => isPlainObject2(payload) && Object.keys(payload).length === 0, "isEmptyObject");
1316
1463
  var isArray = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => Array.isArray(payload), "isArray");
1317
- var isString = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "string", "isString");
1318
- var isNumber = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "number" && !isNaN(payload), "isNumber");
1464
+ var isString2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "string", "isString");
1465
+ var isNumber2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "number" && !isNaN(payload), "isNumber");
1319
1466
  var isBoolean = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "boolean", "isBoolean");
1320
1467
  var isRegExp = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof RegExp, "isRegExp");
1321
1468
  var isMap = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Map, "isMap");
@@ -1324,7 +1471,7 @@ var isSymbol = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => getType(pay
1324
1471
  var isDate = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Date && !isNaN(payload.valueOf()), "isDate");
1325
1472
  var isError = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Error, "isError");
1326
1473
  var isNaNValue = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "number" && isNaN(payload), "isNaNValue");
1327
- var isPrimitive = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload), "isPrimitive");
1474
+ var isPrimitive = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => isBoolean(payload) || isNull(payload) || isUndefined2(payload) || isNumber2(payload) || isString2(payload) || isSymbol(payload), "isPrimitive");
1328
1475
  var isBigint = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "bigint", "isBigint");
1329
1476
  var isInfinite = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload === Infinity || payload === -Infinity, "isInfinite");
1330
1477
  var isTypedArray = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView), "isTypedArray");
@@ -1336,12 +1483,12 @@ var stringifyPath = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((path) => path.map(
1336
1483
  var parsePath = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((string) => {
1337
1484
  const result = [];
1338
1485
  let segment = "";
1339
- for (let i3 = 0; i3 < string.length; i3++) {
1340
- let char = string.charAt(i3);
1341
- const isEscapedDot = char === "\\" && string.charAt(i3 + 1) === ".";
1486
+ for (let i = 0; i < string.length; i++) {
1487
+ let char = string.charAt(i);
1488
+ const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
1342
1489
  if (isEscapedDot) {
1343
1490
  segment += ".";
1344
- i3++;
1491
+ i++;
1345
1492
  continue;
1346
1493
  }
1347
1494
  const isEndOfSegment = char === ".";
@@ -1368,7 +1515,7 @@ function simpleTransformation(isApplicable, annotation, transform, untransform)
1368
1515
  }
1369
1516
  chunkUSNT2KNT_cjs.__name(simpleTransformation, "simpleTransformation");
1370
1517
  var simpleRules = [
1371
- simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
1518
+ simpleTransformation(isUndefined2, "undefined", () => null, () => void 0),
1372
1519
  simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
1373
1520
  if (typeof BigInt !== "undefined") {
1374
1521
  return BigInt(v);
@@ -1387,13 +1534,13 @@ var simpleRules = [
1387
1534
  });
1388
1535
  return baseError;
1389
1536
  }, (v, superJson) => {
1390
- const e7 = new Error(v.message);
1391
- e7.name = v.name;
1392
- e7.stack = v.stack;
1537
+ const e = new Error(v.message);
1538
+ e.name = v.name;
1539
+ e.stack = v.stack;
1393
1540
  superJson.allowedErrorProps.forEach((prop) => {
1394
- e7[prop] = v[prop];
1541
+ e[prop] = v[prop];
1395
1542
  });
1396
- return e7;
1543
+ return e;
1397
1544
  }),
1398
1545
  simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
1399
1546
  const body = regex.slice(1, regex.lastIndexOf("/"));
@@ -1449,8 +1596,8 @@ var symbolRule = compositeTransformation((s, superJson) => {
1449
1596
  "symbol",
1450
1597
  identifier
1451
1598
  ];
1452
- }, (v) => v.description, (_, a3, superJson) => {
1453
- const value = superJson.symbolRegistry.getValue(a3[1]);
1599
+ }, (v) => v.description, (_, a, superJson) => {
1600
+ const value = superJson.symbolRegistry.getValue(a[1]);
1454
1601
  if (!value) {
1455
1602
  throw new Error("Trying to deserialize unknown symbol");
1456
1603
  }
@@ -1475,8 +1622,8 @@ var typedArrayRule = compositeTransformation(isTypedArray, (v) => [
1475
1622
  v.constructor.name
1476
1623
  ], (v) => [
1477
1624
  ...v
1478
- ], (v, a3) => {
1479
- const ctor = constructorToName[a3[1]];
1625
+ ], (v, a) => {
1626
+ const ctor = constructorToName[a[1]];
1480
1627
  if (!ctor) {
1481
1628
  throw new Error("Trying to deserialize unknown typed array");
1482
1629
  }
@@ -1508,10 +1655,10 @@ var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, sup
1508
1655
  result[prop] = clazz[prop];
1509
1656
  });
1510
1657
  return result;
1511
- }, (v, a3, superJson) => {
1512
- const clazz = superJson.classRegistry.getValue(a3[1]);
1658
+ }, (v, a, superJson) => {
1659
+ const clazz = superJson.classRegistry.getValue(a[1]);
1513
1660
  if (!clazz) {
1514
- throw new Error(`Trying to deserialize unknown class '${a3[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
1661
+ throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
1515
1662
  }
1516
1663
  return Object.assign(Object.create(clazz.prototype), v);
1517
1664
  });
@@ -1526,8 +1673,8 @@ var customRule = compositeTransformation((value, superJson) => {
1526
1673
  }, (value, superJson) => {
1527
1674
  const transformer = superJson.customTransformerRegistry.findApplicable(value);
1528
1675
  return transformer.serialize(value);
1529
- }, (v, a3, superJson) => {
1530
- const transformer = superJson.customTransformerRegistry.findByName(a3[1]);
1676
+ }, (v, a, superJson) => {
1677
+ const transformer = superJson.customTransformerRegistry.findByName(a[1]);
1531
1678
  if (!transformer) {
1532
1679
  throw new Error("Trying to deserialize unknown custom value");
1533
1680
  }
@@ -1584,12 +1731,12 @@ var untransformValue = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((json, type, sup
1584
1731
  }, "untransformValue");
1585
1732
 
1586
1733
  // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.js
1587
- var getNthKey = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value, n6) => {
1588
- if (n6 > value.size) throw new Error("index out of bounds");
1734
+ var getNthKey = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value, n) => {
1735
+ if (n > value.size) throw new Error("index out of bounds");
1589
1736
  const keys = value.keys();
1590
- while (n6 > 0) {
1737
+ while (n > 0) {
1591
1738
  keys.next();
1592
- n6--;
1739
+ n--;
1593
1740
  }
1594
1741
  return keys.next().value;
1595
1742
  }, "getNthKey");
@@ -1607,13 +1754,13 @@ function validatePath(path) {
1607
1754
  chunkUSNT2KNT_cjs.__name(validatePath, "validatePath");
1608
1755
  var getDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, path) => {
1609
1756
  validatePath(path);
1610
- for (let i3 = 0; i3 < path.length; i3++) {
1611
- const key = path[i3];
1757
+ for (let i = 0; i < path.length; i++) {
1758
+ const key = path[i];
1612
1759
  if (isSet(object)) {
1613
1760
  object = getNthKey(object, +key);
1614
1761
  } else if (isMap(object)) {
1615
1762
  const row = +key;
1616
- const type = +path[++i3] === 0 ? "key" : "value";
1763
+ const type = +path[++i] === 0 ? "key" : "value";
1617
1764
  const keyOfRow = getNthKey(object, row);
1618
1765
  switch (type) {
1619
1766
  case "key":
@@ -1635,23 +1782,23 @@ var setDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, path, mapper) =>
1635
1782
  return mapper(object);
1636
1783
  }
1637
1784
  let parent = object;
1638
- for (let i3 = 0; i3 < path.length - 1; i3++) {
1639
- const key = path[i3];
1785
+ for (let i = 0; i < path.length - 1; i++) {
1786
+ const key = path[i];
1640
1787
  if (isArray(parent)) {
1641
1788
  const index = +key;
1642
1789
  parent = parent[index];
1643
- } else if (isPlainObject(parent)) {
1790
+ } else if (isPlainObject2(parent)) {
1644
1791
  parent = parent[key];
1645
1792
  } else if (isSet(parent)) {
1646
1793
  const row = +key;
1647
1794
  parent = getNthKey(parent, row);
1648
1795
  } else if (isMap(parent)) {
1649
- const isEnd = i3 === path.length - 2;
1796
+ const isEnd = i === path.length - 2;
1650
1797
  if (isEnd) {
1651
1798
  break;
1652
1799
  }
1653
1800
  const row = +key;
1654
- const type = +path[++i3] === 0 ? "key" : "value";
1801
+ const type = +path[++i] === 0 ? "key" : "value";
1655
1802
  const keyOfRow = getNthKey(parent, row);
1656
1803
  switch (type) {
1657
1804
  case "key":
@@ -1666,7 +1813,7 @@ var setDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, path, mapper) =>
1666
1813
  const lastKey = path[path.length - 1];
1667
1814
  if (isArray(parent)) {
1668
1815
  parent[+lastKey] = mapper(parent[+lastKey]);
1669
- } else if (isPlainObject(parent)) {
1816
+ } else if (isPlainObject2(parent)) {
1670
1817
  parent[lastKey] = mapper(parent[lastKey]);
1671
1818
  }
1672
1819
  if (isSet(parent)) {
@@ -1752,7 +1899,7 @@ function applyReferentialEqualityAnnotations(plain, annotations) {
1752
1899
  return plain;
1753
1900
  }
1754
1901
  chunkUSNT2KNT_cjs.__name(applyReferentialEqualityAnnotations, "applyReferentialEqualityAnnotations");
1755
- var isDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, superJson) => isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson), "isDeep");
1902
+ var isDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, superJson) => isPlainObject2(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson), "isDeep");
1756
1903
  function addIdentity(object, path, identities) {
1757
1904
  const existingSet = identities.get(object);
1758
1905
  if (existingSet) {
@@ -1772,7 +1919,7 @@ function generateReferentialEqualityAnnotations(identitites, dedupe) {
1772
1919
  return;
1773
1920
  }
1774
1921
  if (!dedupe) {
1775
- paths = paths.map((path) => path.map(String)).sort((a3, b) => a3.length - b.length);
1922
+ paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
1776
1923
  }
1777
1924
  const [representativePath, ...identicalPaths] = paths;
1778
1925
  if (representativePath.length === 0) {
@@ -1846,7 +1993,7 @@ var walker = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, identities, super
1846
1993
  transformedValue[index] = recursiveResult.transformedValue;
1847
1994
  if (isArray(recursiveResult.annotations)) {
1848
1995
  innerAnnotations[index] = recursiveResult.annotations;
1849
- } else if (isPlainObject(recursiveResult.annotations)) {
1996
+ } else if (isPlainObject2(recursiveResult.annotations)) {
1850
1997
  forEach(recursiveResult.annotations, (tree, key) => {
1851
1998
  innerAnnotations[escapeKey(index) + "." + key] = tree;
1852
1999
  });
@@ -1879,24 +2026,24 @@ function isArray2(payload) {
1879
2026
  return getType2(payload) === "Array";
1880
2027
  }
1881
2028
  chunkUSNT2KNT_cjs.__name(isArray2, "isArray");
1882
- function isPlainObject2(payload) {
2029
+ function isPlainObject3(payload) {
1883
2030
  if (getType2(payload) !== "Object") return false;
1884
2031
  const prototype = Object.getPrototypeOf(payload);
1885
2032
  return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
1886
2033
  }
1887
- chunkUSNT2KNT_cjs.__name(isPlainObject2, "isPlainObject");
2034
+ chunkUSNT2KNT_cjs.__name(isPlainObject3, "isPlainObject");
1888
2035
  function isNull2(payload) {
1889
2036
  return getType2(payload) === "Null";
1890
2037
  }
1891
2038
  chunkUSNT2KNT_cjs.__name(isNull2, "isNull");
1892
- function isOneOf(a3, b, c2, d, e7) {
1893
- return (value) => a3(value) || b(value) || !!c2 && c2(value) || !!d && d(value) || !!e7 && e7(value);
2039
+ function isOneOf(a, b, c, d, e) {
2040
+ return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
1894
2041
  }
1895
2042
  chunkUSNT2KNT_cjs.__name(isOneOf, "isOneOf");
1896
- function isUndefined2(payload) {
2043
+ function isUndefined3(payload) {
1897
2044
  return getType2(payload) === "Undefined";
1898
2045
  }
1899
- chunkUSNT2KNT_cjs.__name(isUndefined2, "isUndefined");
2046
+ chunkUSNT2KNT_cjs.__name(isUndefined3, "isUndefined");
1900
2047
 
1901
2048
  // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
1902
2049
  function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
@@ -1916,7 +2063,7 @@ function copy(target, options = {}) {
1916
2063
  if (isArray2(target)) {
1917
2064
  return target.map((item) => copy(item, options));
1918
2065
  }
1919
- if (!isPlainObject2(target)) {
2066
+ if (!isPlainObject3(target)) {
1920
2067
  return target;
1921
2068
  }
1922
2069
  const props = Object.getOwnPropertyNames(target);
@@ -2023,48 +2170,107 @@ SuperJSON.registerCustom;
2023
2170
  SuperJSON.registerSymbol;
2024
2171
  SuperJSON.allowErrorProps;
2025
2172
 
2026
- // ../../node_modules/.pnpm/@stryke+json@0.9.35/node_modules/@stryke/json/dist/storm-json.mjs
2027
- var c = class o3 extends SuperJSON {
2173
+ // ../../node_modules/.pnpm/@stryke+json@0.9.37/node_modules/@stryke/json/dist/storm-json.mjs
2174
+ var StormJSON = class StormJSON2 extends SuperJSON {
2028
2175
  static {
2029
- chunkUSNT2KNT_cjs.__name(this, "o");
2176
+ chunkUSNT2KNT_cjs.__name(this, "StormJSON");
2030
2177
  }
2031
- static #e;
2178
+ static #instance;
2032
2179
  static get instance() {
2033
- return o3.#e ||= new o3(), o3.#e;
2180
+ if (!StormJSON2.#instance) StormJSON2.#instance = new StormJSON2();
2181
+ return StormJSON2.#instance;
2034
2182
  }
2035
- static deserialize(e7) {
2036
- return o3.instance.deserialize(e7);
2183
+ /**
2184
+ * Deserialize the given value with superjson using the given metadata
2185
+ */
2186
+ static deserialize(payload) {
2187
+ return StormJSON2.instance.deserialize(payload);
2037
2188
  }
2038
- static serialize(e7) {
2039
- return o3.instance.serialize(e7);
2189
+ /**
2190
+ * Serialize the given value with superjson
2191
+ */
2192
+ static serialize(object) {
2193
+ return StormJSON2.instance.serialize(object);
2040
2194
  }
2041
- static parse(e7) {
2042
- return a2(e7);
2195
+ /**
2196
+ * Parse the given string value with superjson using the given metadata
2197
+ *
2198
+ * @param value - The string value to parse
2199
+ * @returns The parsed data
2200
+ */
2201
+ static parse(value) {
2202
+ return parse(value);
2043
2203
  }
2044
- static stringify(e7, t7) {
2045
- let n6 = o3.instance.customTransformerRegistry.findApplicable(e7), r5 = e7;
2046
- return n6 && n6.isApplicable(e7) && (r5 = n6.serialize(r5)), r4(r5);
2204
+ /**
2205
+ * Serializes the given data to a JSON string.
2206
+ * By default the JSON string is formatted with a 2 space indentation to be easy readable.
2207
+ *
2208
+ * @param value - Object which should be serialized to JSON
2209
+ * @param _options - JSON serialize options
2210
+ * @returns the formatted JSON representation of the object
2211
+ */
2212
+ static stringify(value, _options) {
2213
+ const customTransformer = StormJSON2.instance.customTransformerRegistry.findApplicable(value);
2214
+ let result = value;
2215
+ if (customTransformer && customTransformer.isApplicable(value)) result = customTransformer.serialize(result);
2216
+ return stringify(result);
2047
2217
  }
2048
- static parseJson(e7, t7) {
2218
+ /**
2219
+ * Parses the given JSON string and returns the object the JSON content represents.
2220
+ * By default javascript-style comments and trailing commas are allowed.
2221
+ *
2222
+ * @param strData - JSON content as string
2223
+ * @param options - JSON parse options
2224
+ * @returns Object the JSON content represents
2225
+ */
2226
+ static parseJson(strData, options) {
2049
2227
  try {
2050
- if (t7?.expectComments === false) return o3.instance.parse(e7);
2228
+ if (options?.expectComments === false) return StormJSON2.instance.parse(strData);
2051
2229
  } catch {
2052
2230
  }
2053
- let n6 = [], i3 = parse2(e7, n6, { allowTrailingComma: true, ...t7 });
2054
- if (n6.length > 0 && n6[0]) throw Error(r3(e7, n6[0]));
2055
- return i3;
2231
+ const errors = [];
2232
+ const result = parse3(strData, errors, {
2233
+ allowTrailingComma: true,
2234
+ ...options
2235
+ });
2236
+ if (errors.length > 0 && errors[0]) throw new Error(formatParseError(strData, errors[0]));
2237
+ return result;
2056
2238
  }
2057
- static register(e7, t7, n6, r5) {
2058
- o3.instance.registerCustom({ isApplicable: r5, serialize: t7, deserialize: n6 }, e7);
2239
+ /**
2240
+ * Register a custom schema with superjson
2241
+ *
2242
+ * @param name - The name of the schema
2243
+ * @param serialize - The function to serialize the schema
2244
+ * @param deserialize - The function to deserialize the schema
2245
+ * @param isApplicable - The function to check if the schema is applicable
2246
+ */
2247
+ static register(name, serialize2, deserialize2, isApplicable) {
2248
+ StormJSON2.instance.registerCustom({
2249
+ isApplicable,
2250
+ serialize: serialize2,
2251
+ deserialize: deserialize2
2252
+ }, name);
2059
2253
  }
2060
- static registerClass(n6, r5) {
2061
- o3.instance.registerClass(n6, { identifier: e2(r5) ? r5 : r5?.identifier || n6.name, allowProps: r5 && t3(r5) && r5?.allowProps && Array.isArray(r5.allowProps) ? r5.allowProps : [`__typename`] });
2254
+ /**
2255
+ * Register a class with superjson
2256
+ *
2257
+ * @param classConstructor - The class constructor to register
2258
+ */
2259
+ static registerClass(classConstructor, options) {
2260
+ StormJSON2.instance.registerClass(classConstructor, {
2261
+ identifier: isString(options) ? options : options?.identifier || classConstructor.name,
2262
+ allowProps: options && isObject(options) && options?.allowProps && Array.isArray(options.allowProps) ? options.allowProps : ["__typename"]
2263
+ });
2062
2264
  }
2063
2265
  constructor() {
2064
2266
  super({ dedupe: true });
2065
2267
  }
2066
2268
  };
2067
- c.instance.registerCustom({ isApplicable: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => buffer.Buffer.isBuffer(e7), "isApplicable"), serialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => e7.toString(`base64`), "serialize"), deserialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => buffer.Buffer.from(e7, `base64`), "deserialize") }, `Bytes`);
2269
+ StormJSON.instance.registerCustom({
2270
+ isApplicable: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => buffer.Buffer.isBuffer(v), "isApplicable"),
2271
+ serialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => v.toString("base64"), "serialize"),
2272
+ deserialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((v) => buffer.Buffer.from(v, "base64"), "deserialize")
2273
+ }, "Bytes");
2068
2274
  function stringifyDefaultValue(property, value) {
2069
2275
  return typeChecks.isSetObject(property) ? stringifyValue(property.type, value ?? property.getDefaultValue()) : stringifyValue({
2070
2276
  kind: property
@@ -2076,14 +2282,14 @@ function stringifyStringValue(value) {
2076
2282
  }
2077
2283
  chunkUSNT2KNT_cjs.__name(stringifyStringValue, "stringifyStringValue");
2078
2284
  function stringifyValue(type$1, value) {
2079
- return isUndefined$1.isUndefined(value) ? "undefined" : isNull$1.isNull(value) ? "null" : type$1.kind === type.ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type$1.kind === type.ReflectionKind.string || type$1.kind === type.ReflectionKind.literal && isString$1.isString(type$1.literal) ? stringifyStringValue(value) : type$1.kind === type.ReflectionKind.enum ? getEnumReflectionType(type$1).kind === type.ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type$1.kind === type.ReflectionKind.union ? isStringUnion(type$1) ? stringifyStringValue(value) : `${String(value)}` : type$1.kind === type.ReflectionKind.array ? stringifyStringValue(c.stringify(value)) : type$1.kind === type.ReflectionKind.object || type$1.kind === type.ReflectionKind.objectLiteral ? c.stringify(value) : type$1.kind === type.ReflectionKind.property || type$1.kind === type.ReflectionKind.parameter ? stringifyValue(type$1.type, value) : String(value)?.includes('"') || String(value)?.includes("'") ? stringifyStringValue(value) : String(value);
2285
+ return isUndefined$1.isUndefined(value) ? "undefined" : isNull$1.isNull(value) ? "null" : type$1.kind === type.ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type$1.kind === type.ReflectionKind.string || type$1.kind === type.ReflectionKind.literal && isString$1.isString(type$1.literal) ? stringifyStringValue(value) : type$1.kind === type.ReflectionKind.enum ? getEnumReflectionType(type$1).kind === type.ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type$1.kind === type.ReflectionKind.union ? isStringUnion(type$1) ? stringifyStringValue(value) : `${String(value)}` : type$1.kind === type.ReflectionKind.array ? stringifyStringValue(StormJSON.stringify(value)) : type$1.kind === type.ReflectionKind.object || type$1.kind === type.ReflectionKind.objectLiteral ? StormJSON.stringify(value) : type$1.kind === type.ReflectionKind.property || type$1.kind === type.ReflectionKind.parameter ? stringifyValue(type$1.type, value) : String(value)?.includes('"') || String(value)?.includes("'") ? stringifyStringValue(value) : String(value);
2080
2286
  }
2081
2287
  chunkUSNT2KNT_cjs.__name(stringifyValue, "stringifyValue");
2082
2288
  function getEnumReflectionType(type$1) {
2083
2289
  if (type$1.kind !== type.ReflectionKind.enum) {
2084
2290
  throw new Error(`Expected a TypeEnum, but received ${type$1.kind}.`);
2085
2291
  }
2086
- const unique = t(type$1.values.filter((value) => value !== void 0 && value !== null), (enumMember) => isString$1.isString(enumMember) ? {
2292
+ const unique = getUniqueBy(type$1.values.filter((value) => value !== void 0 && value !== null), (enumMember) => isString$1.isString(enumMember) ? {
2087
2293
  kind: type.ReflectionKind.string
2088
2294
  } : {
2089
2295
  kind: type.ReflectionKind.number
@@ -2100,7 +2306,7 @@ function getEnumReflectionType(type$1) {
2100
2306
  chunkUSNT2KNT_cjs.__name(getEnumReflectionType, "getEnumReflectionType");
2101
2307
  function getUnionTypes(type$1) {
2102
2308
  if (type$1.kind === type.ReflectionKind.union && type$1.types.length > 0) {
2103
- return t(type$1.types, (member) => member.kind);
2309
+ return getUniqueBy(type$1.types, (member) => member.kind);
2104
2310
  }
2105
2311
  throw new Error(`Expected a TypeUnion, but received ${type$1.kind}.`);
2106
2312
  }