@blue-labs/language 3.4.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import M from "big.js";
2
- import { isNullable as I, isNonNullable as p, jsonPrimitiveSchema as cr, isReadonlyArray as Ee, isJsonPrimitive as qe, isPreciseNumberString as Et } from "@blue-labs/shared-utils";
3
- import { z as f, ZodOptional as Nt, ZodNullable as Pt, ZodReadonly as St, ZodBranded as At, ZodEffects as Ne, ZodLazy as Pe, ZodString as ee, ZodNumber as te, ZodBoolean as Be, ZodBigInt as be, ZodEnum as ar, ZodNativeEnum as ur, ZodIntersection as dr, ZodUnion as pr, ZodObject as fr, ZodRecord as hr } from "zod";
4
- import ae from "bs58";
5
- import { isObject as Vt, isArray as Qe, isString as et, omit as Ct, pascal as yr, map as gr } from "radash";
6
- import { OBJECT_CONTRACTS as C, OBJECT_MERGE_POLICY as mr, OBJECT_SCHEMA as Ir, BLUE_REPOSITORY_STATUS_STABLE as le, BLUE_REPOSITORY_STATUS_DEV as tt, validateAttributesAddedPointer as Tr, parsePointer as Rt } from "@blue-labs/repository-contract";
7
- import { sha256 as vr } from "js-sha256";
8
- import Le from "crypto";
9
- import Br from "base32.js";
10
- import W from "js-yaml";
2
+ import { isNullable as I, isNonNullable as p, jsonPrimitiveSchema as cr, isReadonlyArray as Ee, isJsonPrimitive as Qe, isPreciseNumberString as Nt } from "@blue-labs/shared-utils";
3
+ import { z as h, ZodOptional as Pt, ZodNullable as St, ZodReadonly as Ct, ZodBranded as At, ZodEffects as Ne, ZodLazy as Pe, ZodString as ee, ZodNumber as te, ZodBoolean as be, ZodBigInt as we, ZodEnum as ur, ZodNativeEnum as dr, ZodIntersection as pr, ZodUnion as hr, ZodObject as fr, ZodRecord as yr } from "zod";
4
+ import ue from "bs58";
5
+ import { isObject as Vt, isArray as et, isString as tt, omit as Rt, pascal as gr, map as mr } from "radash";
6
+ import { OBJECT_CONTRACTS as V, OBJECT_MERGE_POLICY as Ir, OBJECT_SCHEMA as Tr, BLUE_REPOSITORY_STATUS_STABLE as ae, BLUE_REPOSITORY_STATUS_DEV as rt, validateAttributesAddedPointer as vr, parsePointer as Ot } from "@blue-labs/repository-contract";
7
+ import { sha256 as br } from "js-sha256";
8
+ import je from "crypto";
9
+ import wr from "base32.js";
10
+ import H from "js-yaml";
11
11
  class S extends M {
12
12
  constructor(e) {
13
13
  super(e);
@@ -18,71 +18,71 @@ class E extends M {
18
18
  super(e);
19
19
  }
20
20
  }
21
- const G = "name", J = "description", Z = "type", he = "itemType", ye = "keyType", ge = "valueType", me = "value", Oe = "items", x = "blueId", De = "blue", rt = [
21
+ const G = "name", J = "description", W = "type", fe = "itemType", ye = "keyType", ge = "valueType", me = "value", Oe = "items", x = "blueId", De = "blue", st = [
22
22
  G,
23
23
  J,
24
- Z,
25
- he,
24
+ W,
25
+ fe,
26
26
  ye,
27
27
  ge,
28
28
  me,
29
29
  Oe,
30
30
  x,
31
31
  De
32
- ], Ot = "Text", Dt = "Double", Mt = "Integer", xt = "Boolean", Ft = "List", $t = "Dictionary", Me = [
33
- Ot,
32
+ ], Dt = "Text", Mt = "Double", xt = "Integer", Ft = "Boolean", $t = "List", _t = "Dictionary", Me = [
34
33
  Dt,
35
34
  Mt,
36
- xt
37
- ], st = [...Me, Ft, $t], _ = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", L = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", j = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", U = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", nt = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", it = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", ot = [
35
+ xt,
36
+ Ft
37
+ ], nt = [...Me, $t, _t], _ = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", j = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", L = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", U = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", it = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", ot = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", lt = [
38
38
  _,
39
- L,
40
39
  j,
40
+ L,
41
41
  U
42
42
  ], X = [
43
- ...ot,
44
- nt,
45
- it
46
- ], br = Object.fromEntries(
47
- st.map((s, e) => [s, X[e]])
43
+ ...lt,
44
+ it,
45
+ ot
46
+ ], Br = Object.fromEntries(
47
+ nt.map((s, e) => [s, X[e]])
48
48
  ), xe = Object.fromEntries(
49
- X.map((s, e) => [s, st[e]])
49
+ X.map((s, e) => [s, nt[e]])
50
50
  ), On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
51
  __proto__: null,
52
52
  BASIC_TYPES: Me,
53
- BASIC_TYPE_BLUE_IDS: ot,
54
- BOOLEAN_TYPE: xt,
53
+ BASIC_TYPE_BLUE_IDS: lt,
54
+ BOOLEAN_TYPE: Ft,
55
55
  BOOLEAN_TYPE_BLUE_ID: U,
56
- CORE_TYPES: st,
56
+ CORE_TYPES: nt,
57
57
  CORE_TYPE_BLUE_IDS: X,
58
58
  CORE_TYPE_BLUE_ID_TO_NAME_MAP: xe,
59
- CORE_TYPE_NAME_TO_BLUE_ID_MAP: br,
60
- DICTIONARY_TYPE: $t,
61
- DICTIONARY_TYPE_BLUE_ID: it,
62
- DOUBLE_TYPE: Dt,
63
- DOUBLE_TYPE_BLUE_ID: L,
64
- INTEGER_TYPE: Mt,
65
- INTEGER_TYPE_BLUE_ID: j,
66
- LIST_TYPE: Ft,
67
- LIST_TYPE_BLUE_ID: nt,
59
+ CORE_TYPE_NAME_TO_BLUE_ID_MAP: Br,
60
+ DICTIONARY_TYPE: _t,
61
+ DICTIONARY_TYPE_BLUE_ID: ot,
62
+ DOUBLE_TYPE: Mt,
63
+ DOUBLE_TYPE_BLUE_ID: j,
64
+ INTEGER_TYPE: xt,
65
+ INTEGER_TYPE_BLUE_ID: L,
66
+ LIST_TYPE: $t,
67
+ LIST_TYPE_BLUE_ID: it,
68
68
  OBJECT_BLUE: De,
69
69
  OBJECT_BLUE_ID: x,
70
- OBJECT_CONTRACTS: C,
70
+ OBJECT_CONTRACTS: V,
71
71
  OBJECT_DESCRIPTION: J,
72
72
  OBJECT_ITEMS: Oe,
73
- OBJECT_ITEM_TYPE: he,
73
+ OBJECT_ITEM_TYPE: fe,
74
74
  OBJECT_KEY_TYPE: ye,
75
- OBJECT_MERGE_POLICY: mr,
75
+ OBJECT_MERGE_POLICY: Ir,
76
76
  OBJECT_NAME: G,
77
- OBJECT_SCHEMA: Ir,
78
- OBJECT_SPECIFIC_KEYS: rt,
79
- OBJECT_TYPE: Z,
77
+ OBJECT_SCHEMA: Tr,
78
+ OBJECT_SPECIFIC_KEYS: st,
79
+ OBJECT_TYPE: W,
80
80
  OBJECT_VALUE: me,
81
81
  OBJECT_VALUE_TYPE: ge,
82
- TEXT_TYPE: Ot,
82
+ TEXT_TYPE: Dt,
83
83
  TEXT_TYPE_BLUE_ID: _
84
84
  }, Symbol.toStringTag, { value: "Module" }));
85
- class wr {
85
+ class Er {
86
86
  static get(e, t, r, n = !0) {
87
87
  if (I(t) || !t.startsWith("/"))
88
88
  throw new Error(`Invalid path: ${t}`);
@@ -108,8 +108,8 @@ class wr {
108
108
  !1
109
109
  );
110
110
  if (r === t.length) {
111
- const c = e.getValue();
112
- return i && c !== void 0 ? c : e;
111
+ const a = e.getValue();
112
+ return i && a !== void 0 ? a : e;
113
113
  }
114
114
  const o = t[r], l = this.getNodeForSegment(
115
115
  e,
@@ -135,12 +135,12 @@ class wr {
135
135
  switch (t) {
136
136
  case "name": {
137
137
  const l = e.getName();
138
- i = new a().setValue(l ?? null);
138
+ i = new c().setValue(l ?? null);
139
139
  break;
140
140
  }
141
141
  case "description": {
142
142
  const l = e.getDescription();
143
- i = new a().setValue(l ?? null);
143
+ i = new c().setValue(l ?? null);
144
144
  break;
145
145
  }
146
146
  case "type":
@@ -157,12 +157,12 @@ class wr {
157
157
  break;
158
158
  case "value": {
159
159
  const l = e.getValue();
160
- i = new a().setValue(l ?? null);
160
+ i = new c().setValue(l ?? null);
161
161
  break;
162
162
  }
163
163
  case "blueId": {
164
164
  const l = e.getBlueId();
165
- i = new a().setValue(l ?? null);
165
+ i = new c().setValue(l ?? null);
166
166
  break;
167
167
  }
168
168
  case "blue":
@@ -170,23 +170,23 @@ class wr {
170
170
  break;
171
171
  case "items": {
172
172
  const l = e.getItems();
173
- i = new a().setItems(l);
173
+ i = new c().setItems(l);
174
174
  break;
175
175
  }
176
176
  case "properties": {
177
177
  const l = e.getProperties();
178
- i = new a().setProperties(l);
178
+ i = new c().setProperties(l);
179
179
  break;
180
180
  }
181
- case C: {
181
+ case V: {
182
182
  const l = e.getContracts();
183
- i = new a().setContracts(l);
183
+ i = new c().setContracts(l);
184
184
  break;
185
185
  }
186
186
  default: {
187
187
  if (/^\d+$/.test(t)) {
188
- const l = parseInt(t, 10), c = e.getItems();
189
- c && l >= 0 && l < c.length ? i = c[l] : i = void 0;
188
+ const l = parseInt(t, 10), a = e.getItems();
189
+ a && l >= 0 && l < a.length ? i = a[l] : i = void 0;
190
190
  } else
191
191
  i = void 0;
192
192
  break;
@@ -200,8 +200,8 @@ class wr {
200
200
  return p(r) ? r : e;
201
201
  }
202
202
  }
203
- class a {
204
- static INTEGER = new a("Integer");
203
+ class c {
204
+ static INTEGER = new c("Integer");
205
205
  name;
206
206
  description;
207
207
  type;
@@ -233,32 +233,32 @@ class a {
233
233
  return this.type;
234
234
  }
235
235
  setType(e) {
236
- return typeof e == "string" ? this.type = new a().setValue(e).setInlineValue(!0) : this.type = e, this;
236
+ return typeof e == "string" ? this.type = new c().setValue(e).setInlineValue(!0) : this.type = e, this;
237
237
  }
238
238
  getItemType() {
239
239
  return this.itemType;
240
240
  }
241
241
  setItemType(e) {
242
- return typeof e == "string" ? this.itemType = new a().setValue(e).setInlineValue(!0) : this.itemType = e, this;
242
+ return typeof e == "string" ? this.itemType = new c().setValue(e).setInlineValue(!0) : this.itemType = e, this;
243
243
  }
244
244
  getKeyType() {
245
245
  return this.keyType;
246
246
  }
247
247
  setKeyType(e) {
248
- return typeof e == "string" ? this.keyType = new a().setValue(e).setInlineValue(!0) : this.keyType = e, this;
248
+ return typeof e == "string" ? this.keyType = new c().setValue(e).setInlineValue(!0) : this.keyType = e, this;
249
249
  }
250
250
  getValueType() {
251
251
  return this.valueType;
252
252
  }
253
253
  setValueType(e) {
254
- return typeof e == "string" ? this.valueType = new a().setValue(e).setInlineValue(!0) : this.valueType = e, this;
254
+ return typeof e == "string" ? this.valueType = new c().setValue(e).setInlineValue(!0) : this.valueType = e, this;
255
255
  }
256
256
  getValue() {
257
257
  const e = this.type?.getBlueId();
258
258
  if (p(e) && p(this.value)) {
259
- if (e === j && typeof this.value == "string")
259
+ if (e === L && typeof this.value == "string")
260
260
  return new E(this.value);
261
- if (e === L && typeof this.value == "string") {
261
+ if (e === j && typeof this.value == "string") {
262
262
  const t = new S(this.value), r = parseFloat(t.toString());
263
263
  return new S(r.toString());
264
264
  } else if (e === U && typeof this.value == "string")
@@ -291,22 +291,22 @@ class a {
291
291
  return this.properties && delete this.properties[e], this;
292
292
  }
293
293
  getContractsProperty() {
294
- return this.properties?.[C];
294
+ return this.properties?.[V];
295
295
  }
296
296
  getContracts() {
297
297
  return this.getContractsProperty()?.getProperties();
298
298
  }
299
299
  setContracts(e) {
300
- return I(e) ? this.removeProperty(C) : this.addProperty(
301
- C,
302
- new a().setProperties(e)
300
+ return I(e) ? this.removeProperty(V) : this.addProperty(
301
+ V,
302
+ new c().setProperties(e)
303
303
  ), this;
304
304
  }
305
305
  addContract(e, t) {
306
306
  const r = this.getContractsProperty();
307
307
  return I(r) ? this.addProperty(
308
- C,
309
- new a().addProperty(e, t)
308
+ V,
309
+ new c().addProperty(e, t)
310
310
  ) : r.addProperty(e, t), this;
311
311
  }
312
312
  removeContract(e) {
@@ -314,7 +314,7 @@ class a {
314
314
  if (t) {
315
315
  t.removeProperty(e);
316
316
  const r = t.getProperties();
317
- r && Object.keys(r).length === 0 && this.removeProperty(C);
317
+ r && Object.keys(r).length === 0 && this.removeProperty(V);
318
318
  }
319
319
  return this;
320
320
  }
@@ -344,11 +344,11 @@ class a {
344
344
  return !1;
345
345
  }
346
346
  get(e, t) {
347
- return wr.get(this, e, t);
347
+ return Er.get(this, e, t);
348
348
  }
349
349
  getAsNode(e) {
350
350
  const t = this.get(e);
351
- if (t instanceof a)
351
+ if (t instanceof c)
352
352
  return t;
353
353
  throw new Error(`Value at path ${e} is not a BlueNode: ${t}`);
354
354
  }
@@ -361,11 +361,15 @@ class a {
361
361
  );
362
362
  }
363
363
  clone() {
364
- const e = new a(this.name);
364
+ const e = new c(this.name);
365
365
  return e.description = this.description, e.type = this.type?.clone(), e.itemType = this.itemType?.clone(), e.keyType = this.keyType?.clone(), e.valueType = this.valueType?.clone(), e.value = this.value, e.items = this.items?.map((t) => t.clone()), this.properties && (e.properties = Object.fromEntries(
366
366
  Object.entries(this.properties).map(([t, r]) => [t, r.clone()])
367
367
  )), e.blueId = this.blueId, e.blue = this.blue?.clone(), e.inlineValue = this.inlineValue, e;
368
368
  }
369
+ cloneShallow() {
370
+ const e = new c(this.name);
371
+ return e.description = this.description, e.type = this.type, e.itemType = this.itemType, e.keyType = this.keyType, e.valueType = this.valueType, e.value = this.value, e.items = this.items ? [...this.items] : void 0, e.properties = this.properties ? { ...this.properties } : void 0, e.blueId = this.blueId, e.blue = this.blue, e.inlineValue = this.inlineValue, e;
372
+ }
369
373
  toString() {
370
374
  return `BlueNode{name='${this.name}', description='${this.description}', type=${this.type}, itemType=${this.itemType}, keyType=${this.keyType}, valueType=${this.valueType}, value=${this.value}, items=${this.items}, properties=${this.properties}, blueId='${this.blueId}', blue=${this.blue}, inlineValue=${this.inlineValue}}`;
371
375
  }
@@ -381,7 +385,7 @@ class Se {
381
385
  if (n < this.MIN_BLUE_ID_LENGTH || n > this.MAX_BLUE_ID_LENGTH)
382
386
  return !1;
383
387
  try {
384
- if (ae.decode(r).length !== 32)
388
+ if (ue.decode(r).length !== 32)
385
389
  return !1;
386
390
  } catch {
387
391
  return !1;
@@ -396,14 +400,14 @@ class Se {
396
400
  return !0;
397
401
  }
398
402
  }
399
- const Dn = f.string().max(Se.MAX_BLUE_ID_LENGTH, {
403
+ const Dn = h.string().max(Se.MAX_BLUE_ID_LENGTH, {
400
404
  message: "Blue Id has a maximum length of 45 characters"
401
405
  }).min(Se.MIN_BLUE_ID_LENGTH, {
402
406
  message: "Blue Id has a minimum length of 41 characters"
403
407
  }).refine(
404
408
  (s) => {
405
409
  try {
406
- return ae.decode(s), !0;
410
+ return ue.decode(s), !0;
407
411
  } catch {
408
412
  return !1;
409
413
  }
@@ -411,45 +415,45 @@ const Dn = f.string().max(Se.MAX_BLUE_ID_LENGTH, {
411
415
  {
412
416
  message: "Blue Id must be a valid Base58 string"
413
417
  }
414
- ), ue = f.lazy(
415
- () => f.record(f.unknown()).and(
416
- f.object({
417
- blueId: f.string().optional(),
418
- name: f.string().optional(),
419
- description: f.string().optional(),
420
- type: ue.optional(),
421
- value: f.union([f.string(), f.number(), f.boolean()]).optional().nullable(),
422
- items: f.array(ue).optional()
418
+ ), de = h.lazy(
419
+ () => h.record(h.unknown()).and(
420
+ h.object({
421
+ blueId: h.string().optional(),
422
+ name: h.string().optional(),
423
+ description: h.string().optional(),
424
+ type: de.optional(),
425
+ value: h.union([h.string(), h.number(), h.boolean()]).optional().nullable(),
426
+ items: h.array(de).optional()
423
427
  })
424
428
  )
425
- ), Fe = f.object({
426
- blueId: f.string().optional(),
427
- name: f.string().optional(),
428
- description: f.string().optional(),
429
- type: ue.optional()
429
+ ), Fe = h.object({
430
+ blueId: h.string().optional(),
431
+ name: h.string().optional(),
432
+ description: h.string().optional(),
433
+ type: de.optional()
430
434
  }), Mn = Fe.extend({
431
- value: f.string().optional()
435
+ value: h.string().optional()
432
436
  }), xn = Fe.extend({
433
- value: f.number().optional()
437
+ value: h.number().optional()
434
438
  }), Fn = Fe.extend({
435
- value: f.boolean().optional()
439
+ value: h.boolean().optional()
436
440
  }), $n = Fe.extend({
437
- items: f.array(f.string()).optional()
438
- }), _n = (s) => ue.safeParse(s).success, Er = (s) => p(s) && "blueId" in s && p(s.blueId), Ln = (s) => p(s) && "name" in s && p(s.name), Nr = (s) => p(s) && "items" in s && p(s.items), Pr = (s) => p(s) && "type" in s && p(s.type), Sr = (s) => p(s) && "value" in s && p(s.value), jn = (s, e) => s.required({ type: !0 }).safeParse(e).success, A = (s) => s instanceof M, H = (s) => A(s) && s instanceof E, Ge = (s) => A(s) && s instanceof S, Ar = f.lazy(
439
- () => f.record(Ae)
440
- ), Vr = f.lazy(
441
- () => f.union([
442
- f.array(Ae),
443
- f.array(Ae).readonly()
441
+ items: h.array(h.string()).optional()
442
+ }), _n = (s) => de.safeParse(s).success, Nr = (s) => p(s) && "blueId" in s && p(s.blueId), jn = (s) => p(s) && "name" in s && p(s.name), Pr = (s) => p(s) && "items" in s && p(s.items), Sr = (s) => p(s) && "type" in s && p(s.type), Cr = (s) => p(s) && "value" in s && p(s.value), Ln = (s, e) => s.required({ type: !0 }).safeParse(e).success, C = (s) => s instanceof M, Z = (s) => C(s) && s instanceof E, Ge = (s) => C(s) && s instanceof S, Ar = h.lazy(
443
+ () => h.record(Ce)
444
+ ), Vr = h.lazy(
445
+ () => h.union([
446
+ h.array(Ce),
447
+ h.array(Ce).readonly()
444
448
  ])
445
- ), Ae = f.lazy(
446
- () => f.union([
449
+ ), Ce = h.lazy(
450
+ () => h.union([
447
451
  cr,
448
452
  Ar,
449
453
  Vr,
450
- f.instanceof(M)
454
+ h.instanceof(M)
451
455
  ])
452
- ), _t = (s) => Vt(s) && !Qe(s) && !Ee(s) && !A(s), Lt = (s) => Qe(s) || Ee(s), Un = (s) => Lt(s) || _t(s) || A(s) || qe(s);
456
+ ), jt = (s) => Vt(s) && !et(s) && !Ee(s) && !C(s), Lt = (s) => et(s) || Ee(s), Un = (s) => Lt(s) || jt(s) || C(s) || Qe(s);
453
457
  class g {
454
458
  static deserialize(e) {
455
459
  return g.handleNode(e);
@@ -459,8 +463,8 @@ class g {
459
463
  throw new Error(
460
464
  "This is not a valid JSON-like value. Found 'undefined' as a value."
461
465
  );
462
- if (_t(e)) {
463
- const t = new a(), r = {};
466
+ if (jt(e)) {
467
+ const t = new c(), r = {};
464
468
  return Object.entries(e).forEach(([n, i]) => {
465
469
  switch (n) {
466
470
  case G:
@@ -483,10 +487,10 @@ class g {
483
487
  t.setDescription(i);
484
488
  }
485
489
  break;
486
- case Z:
490
+ case W:
487
491
  t.setType(g.handleNode(i));
488
492
  break;
489
- case he:
493
+ case fe:
490
494
  t.setItemType(g.handleNode(i));
491
495
  break;
492
496
  case ye:
@@ -516,10 +520,10 @@ class g {
516
520
  }), Object.keys(r).length > 0 && t.setProperties(r), t;
517
521
  } else {
518
522
  if (Lt(e))
519
- return new a().setItems(g.handleArray(e));
523
+ return new c().setItems(g.handleArray(e));
520
524
  {
521
525
  const t = e;
522
- return new a().setValue(g.handleValue(t)).setInlineValue(!0);
526
+ return new c().setValue(g.handleValue(t)).setInlineValue(!0);
523
527
  }
524
528
  }
525
529
  }
@@ -528,8 +532,8 @@ class g {
528
532
  return null;
529
533
  if (typeof e == "string")
530
534
  return e;
531
- if (typeof e == "number" || A(e))
532
- if (H(e) || Number.isSafeInteger(e)) {
535
+ if (typeof e == "number" || C(e))
536
+ if (Z(e) || Number.isSafeInteger(e)) {
533
537
  const t = new E(e.toString()), r = Number.MIN_SAFE_INTEGER, n = Number.MAX_SAFE_INTEGER;
534
538
  return t.lt(r) ? new E(r.toString()) : t.gt(n) ? new E(n.toString()) : t;
535
539
  } else {
@@ -550,12 +554,12 @@ class g {
550
554
  }
551
555
  }
552
556
  }
553
- function Cr(s) {
557
+ function Rr(s) {
554
558
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
555
559
  }
556
- var je, gt;
557
- function Rr() {
558
- return gt || (gt = 1, je = function s(e) {
560
+ var Le, mt;
561
+ function Or() {
562
+ return mt || (mt = 1, Le = function s(e) {
559
563
  if (typeof e == "number" && isNaN(e))
560
564
  throw new Error("NaN is not allowed");
561
565
  if (typeof e == "number" && !isFinite(e))
@@ -566,47 +570,47 @@ function Rr() {
566
570
  const i = r.length === 0 ? "" : ",";
567
571
  return `${r}${i}${s(n)}:${s(e[n])}`;
568
572
  }, "")}}`;
569
- }), je;
573
+ }), Le;
570
574
  }
571
- var Or = Rr();
572
- const Dr = /* @__PURE__ */ Cr(Or);
575
+ var Dr = Or();
576
+ const Mr = /* @__PURE__ */ Rr(Dr);
573
577
  class Je {
574
578
  static canonicalize(e) {
575
- return Dr(e);
579
+ return Mr(e);
576
580
  }
577
581
  }
578
582
  const Ue = typeof process < "u" && process.versions != null && process.versions.node != null;
579
- class lt {
583
+ class at {
580
584
  static instance;
581
585
  browserCrypto;
582
586
  constructor() {
583
587
  this.browserCrypto = this.initBrowserCrypto();
584
588
  }
585
589
  static getInstance() {
586
- return this.instance || (this.instance = new lt()), this.instance;
590
+ return this.instance || (this.instance = new at()), this.instance;
587
591
  }
588
592
  initBrowserCrypto() {
589
593
  return Ue ? null : "crypto" in globalThis ? globalThis.crypto : null;
590
594
  }
591
595
  hasNodeCrypto() {
592
- return Ue && !!Le && typeof Le.createHash == "function";
596
+ return Ue && !!je && typeof je.createHash == "function";
593
597
  }
594
598
  getBrowserCrypto() {
595
599
  return this.browserCrypto;
596
600
  }
597
601
  getNodeCrypto() {
598
- return Ue ? Le : null;
602
+ return Ue ? je : null;
599
603
  }
600
604
  }
601
- class Mr {
602
- cryptoEnv = lt.getInstance();
605
+ class xr {
606
+ cryptoEnv = at.getInstance();
603
607
  applySync(e) {
604
608
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
605
- return ae.encode(r);
609
+ return ue.encode(r);
606
610
  }
607
611
  async apply(e) {
608
612
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
609
- return ae.encode(r);
613
+ return ue.encode(r);
610
614
  }
611
615
  canonicalizeInput(e) {
612
616
  const t = Je.canonicalize(e);
@@ -624,7 +628,7 @@ class Mr {
624
628
  return new Uint8Array(r);
625
629
  }
626
630
  sha256SyncBrowser(e) {
627
- return new Uint8Array(vr.arrayBuffer(e));
631
+ return new Uint8Array(br.arrayBuffer(e));
628
632
  }
629
633
  async sha256Async(e) {
630
634
  if (this.cryptoEnv.hasNodeCrypto())
@@ -661,31 +665,31 @@ class m {
661
665
  if (i !== void 0)
662
666
  return i;
663
667
  }
664
- const c = {};
665
- o !== void 0 && (c[G] = o), l !== void 0 && (c[J] = l);
668
+ const a = {};
669
+ o !== void 0 && (a[G] = o), l !== void 0 && (a[J] = l);
666
670
  const u = e.getType();
667
671
  if (t === "official" && r !== void 0 && u === void 0) {
668
672
  const Q = this.inferTypeBlueId(r);
669
- Q !== null && (c[Z] = { [x]: Q });
670
- } else u !== void 0 && (c[Z] = m.get(u, t));
673
+ Q !== null && (a[W] = { [x]: Q });
674
+ } else u !== void 0 && (a[W] = m.get(u, t));
671
675
  const y = e.getItemType();
672
- y !== void 0 && (c[he] = m.get(y, t));
676
+ y !== void 0 && (a[fe] = m.get(y, t));
673
677
  const d = e.getKeyType();
674
- d !== void 0 && (c[ye] = m.get(d, t));
675
- const h = e.getValueType();
676
- h !== void 0 && (c[ge] = m.get(h, t)), n !== void 0 && (c[me] = n), i !== void 0 && (c[Oe] = i);
678
+ d !== void 0 && (a[ye] = m.get(d, t));
679
+ const f = e.getValueType();
680
+ f !== void 0 && (a[ge] = m.get(f, t)), n !== void 0 && (a[me] = n), i !== void 0 && (a[Oe] = i);
677
681
  const v = e.getBlueId();
678
- v !== void 0 && (c[x] = v);
682
+ v !== void 0 && (a[x] = v);
679
683
  const k = e.getBlue();
680
- k !== void 0 && (c[De] = k);
684
+ k !== void 0 && (a[De] = k);
681
685
  const q = e.getProperties();
682
- return q !== void 0 && Object.entries(q).forEach(([Q, lr]) => {
683
- c[Q] = m.get(lr, t);
684
- }), c;
686
+ return q !== void 0 && Object.entries(q).forEach(([Q, ar]) => {
687
+ a[Q] = m.get(ar, t);
688
+ }), a;
685
689
  }
686
690
  static handleValue(e) {
687
- if (A(e)) {
688
- if (H(e)) {
691
+ if (C(e)) {
692
+ if (Z(e)) {
689
693
  const t = new M(Number.MIN_SAFE_INTEGER.toString()), r = new M(Number.MAX_SAFE_INTEGER.toString());
690
694
  if (e.lt(t) || e.gt(r))
691
695
  return e.toString();
@@ -695,12 +699,12 @@ class m {
695
699
  return e;
696
700
  }
697
701
  static inferTypeBlueId(e) {
698
- return typeof e == "string" ? _ : A(e) ? H(e) ? j : L : typeof e == "boolean" ? U : null;
702
+ return typeof e == "string" ? _ : C(e) ? Z(e) ? L : j : typeof e == "boolean" ? U : null;
699
703
  }
700
704
  }
701
- const xr = (s) => qe(s) && p(s);
705
+ const Fr = (s) => Qe(s) && p(s);
702
706
  class T {
703
- static INSTANCE = new T(new Mr());
707
+ static INSTANCE = new T(new xr());
704
708
  hashProvider;
705
709
  constructor(e) {
706
710
  this.hashProvider = e;
@@ -735,7 +739,7 @@ class T {
735
739
  }
736
740
  // Internal method to calculate BlueId recursively
737
741
  internalCalculate(e, t) {
738
- return xr(e) || A(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || Ee(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
742
+ return Fr(e) || C(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || Ee(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
739
743
  }
740
744
  calculateMap(e, t) {
741
745
  if (e[x] !== void 0)
@@ -745,16 +749,16 @@ class T {
745
749
  if ([G, me, J].includes(o))
746
750
  return t ? [o, l] : Promise.resolve([o, l]);
747
751
  {
748
- const c = this.internalCalculate(l, t);
749
- return t ? [o, { blueId: c }] : Promise.resolve(c).then((u) => [
752
+ const a = this.internalCalculate(l, t);
753
+ return t ? [o, { blueId: a }] : Promise.resolve(a).then((u) => [
750
754
  o,
751
755
  { blueId: u }
752
756
  ]);
753
757
  }
754
758
  }), i = (o) => {
755
759
  const l = {};
756
- for (const [c, u] of o)
757
- l[c] = u;
760
+ for (const [a, u] of o)
761
+ l[a] = u;
758
762
  return this.applyHash(l, t);
759
763
  };
760
764
  return t ? i(n) : Promise.all(n).then(i);
@@ -770,7 +774,7 @@ class T {
770
774
  [{ blueId: i }, { blueId: o }],
771
775
  !0
772
776
  ) : Promise.all([i, o]).then(
773
- ([l, c]) => this.applyHash([{ blueId: l }, { blueId: c }], !1)
777
+ ([l, a]) => this.applyHash([{ blueId: l }, { blueId: a }], !1)
774
778
  );
775
779
  for (let i = 1; i < e.length; i++) {
776
780
  const o = this.internalCalculate(e[i], t);
@@ -785,7 +789,7 @@ class T {
785
789
  // Method to clean the input structure by removing null or undefined values
786
790
  cleanStructure(e) {
787
791
  if (e != null) {
788
- if (qe(e) || A(e))
792
+ if (Qe(e) || C(e))
789
793
  return e;
790
794
  if (Array.isArray(e) || Ee(e)) {
791
795
  const t = e.map((r) => this.cleanStructure(r)).filter(p);
@@ -804,13 +808,13 @@ class T {
804
808
  }
805
809
  class kn {
806
810
  static convert(e) {
807
- const t = ae.decode(e), r = new Uint8Array(2 + t.length);
811
+ const t = ue.decode(e), r = new Uint8Array(2 + t.length);
808
812
  r[0] = 18, r[1] = 32, r.set(t, 2);
809
813
  const n = new Uint8Array(2 + r.length);
810
- return n[0] = 1, n[1] = 85, n.set(r, 2), "b" + new Br.Encoder({ type: "rfc4648", lc: !0 }).write(n).finalize().replace(/=/g, "");
814
+ return n[0] = 1, n[1] = 85, n.set(r, 2), "b" + new wr.Encoder({ type: "rfc4648", lc: !0 }).write(n).finalize().replace(/=/g, "");
811
815
  }
812
816
  }
813
- class w {
817
+ class B {
814
818
  /**
815
819
  * Transforms a node and all its child nodes using the provided transformer function
816
820
  * @param node - The node to transform
@@ -819,30 +823,30 @@ class w {
819
823
  */
820
824
  static transform(e, t) {
821
825
  const r = t(e.clone()), n = r.getType();
822
- n !== void 0 && r.setType(w.transform(n, t));
826
+ n !== void 0 && r.setType(B.transform(n, t));
823
827
  const i = r.getItemType();
824
828
  i !== void 0 && r.setItemType(
825
- w.transform(i, t)
829
+ B.transform(i, t)
826
830
  );
827
831
  const o = r.getKeyType();
828
832
  o !== void 0 && r.setKeyType(
829
- w.transform(o, t)
833
+ B.transform(o, t)
830
834
  );
831
835
  const l = r.getValueType();
832
836
  l !== void 0 && r.setValueType(
833
- w.transform(l, t)
837
+ B.transform(l, t)
834
838
  );
835
- const c = r.getItems();
836
- if (c !== void 0) {
837
- const y = c.map(
838
- (d) => w.transform(d, t)
839
+ const a = r.getItems();
840
+ if (a !== void 0) {
841
+ const y = a.map(
842
+ (d) => B.transform(d, t)
839
843
  );
840
844
  r.setItems(y);
841
845
  }
842
846
  const u = r.getProperties();
843
847
  if (u !== void 0) {
844
848
  const y = Object.keys(u).reduce(
845
- (d, h) => (d[h] = w.transform(u[h], t), d),
849
+ (d, f) => (d[f] = B.transform(u[f], t), d),
846
850
  {}
847
851
  );
848
852
  r.setProperties(y);
@@ -850,12 +854,12 @@ class w {
850
854
  return r;
851
855
  }
852
856
  }
853
- const F = (s) => !!s && typeof s == "object" && !Array.isArray(s) && !(s instanceof a), O = (s) => s instanceof E || s instanceof S, Fr = (s) => s.replace(/~1/g, "/").replace(/~0/g, "~");
854
- function ie(s) {
857
+ const F = (s) => !!s && typeof s == "object" && !Array.isArray(s) && !(s instanceof c), O = (s) => s instanceof E || s instanceof S, $r = (s) => s.replace(/~1/g, "/").replace(/~0/g, "~");
858
+ function oe(s) {
855
859
  if (s === "/") return [];
856
860
  if (!s.startsWith("/"))
857
861
  throw new Error(`Path must start with '/': ${s}`);
858
- return s.split("/").slice(1).map(Fr);
862
+ return s.split("/").slice(1).map($r);
859
863
  }
860
864
  function se(s) {
861
865
  if (s === "-") return -1;
@@ -868,7 +872,7 @@ function se(s) {
868
872
  );
869
873
  return e;
870
874
  }
871
- function jt(s, e, t, r = !0) {
875
+ function Ut(s, e, t, r = !0) {
872
876
  switch (e) {
873
877
  case "name":
874
878
  return t ? r ? s.getName() ?? null : s : s.getName();
@@ -892,15 +896,15 @@ function jt(s, e, t, r = !0) {
892
896
  return s.getItems();
893
897
  case "properties":
894
898
  return s.getProperties();
895
- case C:
899
+ case V:
896
900
  return s.getContracts();
897
901
  default:
898
902
  return;
899
903
  }
900
904
  }
901
- function mt(s, e, t = !0) {
902
- if (s instanceof a) {
903
- const r = jt(
905
+ function It(s, e, t = !0) {
906
+ if (s instanceof c) {
907
+ const r = Ut(
904
908
  s,
905
909
  e,
906
910
  !0,
@@ -918,7 +922,7 @@ function mt(s, e, t = !0) {
918
922
  "blue",
919
923
  "items",
920
924
  "properties",
921
- C
925
+ V
922
926
  ].includes(e))
923
927
  return r;
924
928
  if (/^-?\d+$/.test(e) && e !== "-") {
@@ -935,7 +939,7 @@ function mt(s, e, t = !0) {
935
939
  }
936
940
  if (F(s)) return s[e];
937
941
  }
938
- function oe(s, e) {
942
+ function le(s, e) {
939
943
  if (e.length === 0)
940
944
  return {
941
945
  parent: s,
@@ -944,29 +948,29 @@ function oe(s, e) {
944
948
  };
945
949
  let t = s;
946
950
  for (let n = 0; n < e.length - 1; ++n) {
947
- const i = e[n], o = mt(t, i);
951
+ const i = e[n], o = It(t, i);
948
952
  if (o === void 0)
949
953
  throw new Error(`Cannot resolve '/${e.slice(0, n + 1).join("/")}'`);
950
954
  t = o;
951
955
  }
952
956
  const r = e[e.length - 1];
953
- if (t instanceof a) {
954
- const n = mt(t, r, !1);
955
- if ((typeof n != "object" || n === null || O(n)) && !(n instanceof a) && !Array.isArray(n) && ["name", "description", "value", "blueId"].includes(r))
957
+ if (t instanceof c) {
958
+ const n = It(t, r, !1);
959
+ if ((typeof n != "object" || n === null || O(n)) && !(n instanceof c) && !Array.isArray(n) && ["name", "description", "value", "blueId"].includes(r))
956
960
  return {
957
961
  parent: t,
958
962
  key: r,
959
963
  actualTarget: n
960
964
  };
961
965
  }
962
- return Array.isArray(t) && r === "-" ? { parent: t, key: "-" } : t instanceof a && t.getItems() && r === "-" ? { parent: t, key: "-" } : {
966
+ return Array.isArray(t) && r === "-" ? { parent: t, key: "-" } : t instanceof c && t.getItems() && r === "-" ? { parent: t, key: "-" } : {
963
967
  parent: t,
964
968
  key: Array.isArray(t) ? se(r) : r
965
969
  };
966
970
  }
967
971
  function ct(s, e) {
968
- if (s instanceof a) {
969
- const t = e, r = jt(s, t, !1);
972
+ if (s instanceof c) {
973
+ const t = e, r = Ut(s, t, !1);
970
974
  if (r !== void 0 || [
971
975
  "name",
972
976
  "description",
@@ -979,7 +983,7 @@ function ct(s, e) {
979
983
  "blue",
980
984
  "items",
981
985
  "properties",
982
- C
986
+ V
983
987
  ].includes(t))
984
988
  return r;
985
989
  if (typeof e == "number" || typeof e == "string" && /^\d+$/.test(e)) {
@@ -991,23 +995,23 @@ function ct(s, e) {
991
995
  return Array.isArray(s) || F(s) ? s[e] : s;
992
996
  }
993
997
  function P(s) {
994
- if (s instanceof a) return s;
998
+ if (s instanceof c) return s;
995
999
  if (s === null || typeof s == "string" || typeof s == "number" || typeof s == "boolean" || O(s))
996
1000
  return g.deserialize(s);
997
- const e = Ze(s);
1001
+ const e = We(s);
998
1002
  return g.deserialize(e);
999
1003
  }
1000
- function Ze(s) {
1004
+ function We(s) {
1001
1005
  if (s === void 0) return null;
1002
1006
  if (s === null || typeof s != "object") return s;
1003
- if (Array.isArray(s)) return s.map(Ze);
1007
+ if (Array.isArray(s)) return s.map(We);
1004
1008
  const e = {};
1005
1009
  for (const [t, r] of Object.entries(s))
1006
- e[t] = Ze(r);
1010
+ e[t] = We(r);
1007
1011
  return e;
1008
1012
  }
1009
- function at(s, e, t) {
1010
- if (s instanceof a) {
1013
+ function ut(s, e, t) {
1014
+ if (s instanceof c) {
1011
1015
  const r = e;
1012
1016
  switch (r) {
1013
1017
  case "name":
@@ -1018,22 +1022,22 @@ function at(s, e, t) {
1018
1022
  return;
1019
1023
  case "type":
1020
1024
  s.setType(
1021
- t instanceof a || typeof t == "string" || t === void 0 ? t : P(t)
1025
+ t instanceof c || typeof t == "string" || t === void 0 ? t : P(t)
1022
1026
  );
1023
1027
  return;
1024
1028
  case "itemType":
1025
1029
  s.setItemType(
1026
- t instanceof a || typeof t == "string" || t === void 0 ? t : P(t)
1030
+ t instanceof c || typeof t == "string" || t === void 0 ? t : P(t)
1027
1031
  );
1028
1032
  return;
1029
1033
  case "keyType":
1030
1034
  s.setKeyType(
1031
- t instanceof a || typeof t == "string" || t === void 0 ? t : P(t)
1035
+ t instanceof c || typeof t == "string" || t === void 0 ? t : P(t)
1032
1036
  );
1033
1037
  return;
1034
1038
  case "valueType":
1035
1039
  s.setValueType(
1036
- t instanceof a || typeof t == "string" || t === void 0 ? t : P(t)
1040
+ t instanceof c || typeof t == "string" || t === void 0 ? t : P(t)
1037
1041
  );
1038
1042
  return;
1039
1043
  case "value": {
@@ -1046,7 +1050,7 @@ function at(s, e, t) {
1046
1050
  return;
1047
1051
  case "blue":
1048
1052
  s.setBlue(
1049
- t instanceof a || t === void 0 ? t : P(t)
1053
+ t instanceof c || t === void 0 ? t : P(t)
1050
1054
  );
1051
1055
  return;
1052
1056
  case "items":
@@ -1055,7 +1059,7 @@ function at(s, e, t) {
1055
1059
  case "properties":
1056
1060
  s.setProperties(t);
1057
1061
  return;
1058
- case C:
1062
+ case V:
1059
1063
  s.setContracts(t);
1060
1064
  return;
1061
1065
  default: {
@@ -1063,14 +1067,14 @@ function at(s, e, t) {
1063
1067
  const n = s.getProperties();
1064
1068
  n && r in n && delete n[r];
1065
1069
  } else
1066
- s.getProperties() || s.setProperties({}), s.addProperty(r, t instanceof a ? t : P(t));
1070
+ s.getProperties() || s.setProperties({}), s.addProperty(r, t instanceof c ? t : P(t));
1067
1071
  return;
1068
1072
  }
1069
1073
  }
1070
1074
  }
1071
1075
  Array.isArray(s) ? s.splice(se(e), 1) : F(s) && (t === void 0 ? delete s[e] : s[e] = t);
1072
1076
  }
1073
- function $r(s, e, t, r) {
1077
+ function _r(s, e, t, r) {
1074
1078
  let n = -1;
1075
1079
  if (e !== "-" && (n = typeof e == "number" ? e : parseInt(e, 10), isNaN(n)))
1076
1080
  throw new Error(
@@ -1096,7 +1100,7 @@ function $r(s, e, t, r) {
1096
1100
  } else
1097
1101
  i.splice(n, 0, t);
1098
1102
  }
1099
- function Ve(s, e, t, r) {
1103
+ function Ae(s, e, t, r) {
1100
1104
  if (Array.isArray(s)) {
1101
1105
  const n = e === "-" ? s.length : se(e);
1102
1106
  if (!r && n > s.length)
@@ -1117,8 +1121,8 @@ function Ve(s, e, t, r) {
1117
1121
  s.splice(n, 0, i);
1118
1122
  return;
1119
1123
  }
1120
- if (s instanceof a) {
1121
- e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? $r(s, e, P(t), r) : at(s, e, t);
1124
+ if (s instanceof c) {
1125
+ e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? _r(s, e, P(t), r) : ut(s, e, t);
1122
1126
  return;
1123
1127
  }
1124
1128
  if (F(s)) {
@@ -1127,13 +1131,13 @@ function Ve(s, e, t, r) {
1127
1131
  }
1128
1132
  throw new Error(`Cannot insert into parent of type ${typeof s}`);
1129
1133
  }
1130
- function _r(s, e) {
1134
+ function jr(s, e) {
1131
1135
  if (Array.isArray(s)) {
1132
1136
  const t = se(e);
1133
1137
  t === -1 && e === "-" ? s.length > 0 && s.pop() : t >= 0 && t < s.length && s.splice(t, 1);
1134
1138
  return;
1135
1139
  }
1136
- if (s instanceof a) {
1140
+ if (s instanceof c) {
1137
1141
  if (typeof e == "number" || typeof e == "string" && /^-?\d+$/.test(e)) {
1138
1142
  const t = s.getItems();
1139
1143
  if (t) {
@@ -1142,25 +1146,25 @@ function _r(s, e) {
1142
1146
  return;
1143
1147
  }
1144
1148
  }
1145
- at(s, e, void 0);
1149
+ ut(s, e, void 0);
1146
1150
  } else F(s) && delete s[e];
1147
1151
  }
1148
- function He(s) {
1149
- if (s instanceof a) return s.clone();
1152
+ function Ze(s) {
1153
+ if (s instanceof c) return s.clone();
1150
1154
  if (Array.isArray(s))
1151
- return s.map((t) => He(t));
1155
+ return s.map((t) => Ze(t));
1152
1156
  if (F(s)) {
1153
1157
  const e = {};
1154
1158
  return Object.keys(s).forEach((t) => {
1155
- e[t] = He(s[t]);
1159
+ e[t] = Ze(s[t]);
1156
1160
  }), e;
1157
1161
  }
1158
1162
  return s;
1159
1163
  }
1160
1164
  function Y(s, e) {
1161
- if (s === e || s instanceof a && (s.isInlineValue() || s.getValue() !== void 0) && Y(s.getValue() ?? null, e) || e instanceof a && (e.isInlineValue() || e.getValue() !== void 0) && Y(s, e.getValue() ?? null))
1165
+ if (s === e || s instanceof c && (s.isInlineValue() || s.getValue() !== void 0) && Y(s.getValue() ?? null, e) || e instanceof c && (e.isInlineValue() || e.getValue() !== void 0) && Y(s, e.getValue() ?? null))
1162
1166
  return !0;
1163
- if (s instanceof a && e instanceof a || O(s) && O(e) || O(s) && typeof e == "number" || typeof s == "number" && O(e))
1167
+ if (s instanceof c && e instanceof c || O(s) && O(e) || O(s) && typeof e == "number" || typeof s == "number" && O(e))
1164
1168
  return s.toString() === e.toString();
1165
1169
  if (Array.isArray(s) && Array.isArray(e))
1166
1170
  return s.length === e.length && s.every((t, r) => Y(t, e[r]));
@@ -1170,22 +1174,22 @@ function Y(s, e) {
1170
1174
  }
1171
1175
  return !1;
1172
1176
  }
1173
- function Ut(s, e) {
1174
- const { parent: t, key: r } = oe(s, ie(e));
1177
+ function kt(s, e) {
1178
+ const { parent: t, key: r } = le(s, oe(e));
1175
1179
  return ct(t, r);
1176
1180
  }
1177
- function kt(s, e, t) {
1178
- const r = ie(e);
1181
+ function Kt(s, e, t) {
1182
+ const r = oe(e);
1179
1183
  if (r.length === 0 && e === "/") {
1180
1184
  const o = P(t);
1181
1185
  s.setValue(o.getValue() ?? null), o.getItems() ? s.setItems(o.getItems()) : s.setItems(void 0);
1182
1186
  return;
1183
1187
  }
1184
- const { parent: n, key: i } = oe(s, r);
1185
- Ve(n, i, t, !0);
1188
+ const { parent: n, key: i } = le(s, r);
1189
+ Ae(n, i, t, !0);
1186
1190
  }
1187
1191
  function Lr(s, e, t) {
1188
- const r = ie(e);
1192
+ const r = oe(e);
1189
1193
  if (r.length === 0 && e === "/") {
1190
1194
  if (s.getItems() && Array.isArray(t)) {
1191
1195
  const o = P(t);
@@ -1196,52 +1200,52 @@ function Lr(s, e, t) {
1196
1200
  }
1197
1201
  return !0;
1198
1202
  }
1199
- const { parent: n, key: i } = oe(s, r);
1200
- return Ve(n, i, t, !1), !0;
1203
+ const { parent: n, key: i } = le(s, r);
1204
+ return Ae(n, i, t, !1), !0;
1201
1205
  }
1202
- function jr(s, e, t) {
1203
- const r = ie(e);
1206
+ function Ur(s, e, t) {
1207
+ const r = oe(e);
1204
1208
  if (r.length === 0 && e === "/") {
1205
1209
  const l = P(t);
1206
1210
  return s.setValue(l.getValue() ?? null), l.getItems() ? s.setItems(l.getItems()) : s.setItems(void 0), !0;
1207
1211
  }
1208
- const { parent: n, key: i, actualTarget: o } = oe(s, r);
1209
- if (o !== void 0 && n instanceof a)
1210
- at(n, i, t);
1212
+ const { parent: n, key: i, actualTarget: o } = le(s, r);
1213
+ if (o !== void 0 && n instanceof c)
1214
+ ut(n, i, t);
1211
1215
  else {
1212
- const l = ct(n, i), c = Array.isArray(n) || n instanceof a && n.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1216
+ const l = ct(n, i), a = Array.isArray(n) || n instanceof c && n.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1213
1217
  if (l === void 0) {
1214
- if (c)
1218
+ if (a)
1215
1219
  throw new Error(
1216
1220
  `REPLACE failed: Target array index '${i.toString()}' is out of bounds or does not exist at path '${e}'.`
1217
1221
  );
1218
- Ve(n, i, t, !0);
1222
+ Ae(n, i, t, !0);
1219
1223
  } else
1220
- Ve(n, i, t, !0);
1224
+ Ae(n, i, t, !0);
1221
1225
  }
1222
1226
  return !0;
1223
1227
  }
1224
- function Kt(s, e) {
1225
- const t = ie(e);
1228
+ function Yt(s, e) {
1229
+ const t = oe(e);
1226
1230
  if (t.length === 0 && e === "/")
1227
1231
  return s.setValue(null), s.setItems(void 0), s.setProperties(void 0), !0;
1228
- const { parent: r, key: n } = oe(s, t);
1229
- return _r(r, n), !0;
1230
- }
1231
- function Ur(s, e, t) {
1232
- const r = He(Ut(s, e));
1233
- return kt(s, t, r), !0;
1232
+ const { parent: r, key: n } = le(s, t);
1233
+ return jr(r, n), !0;
1234
1234
  }
1235
1235
  function kr(s, e, t) {
1236
- const r = ie(e), { parent: n, key: i } = oe(s, r), o = ct(n, i);
1236
+ const r = Ze(kt(s, e));
1237
+ return Kt(s, t, r), !0;
1238
+ }
1239
+ function Kr(s, e, t) {
1240
+ const r = oe(e), { parent: n, key: i } = le(s, r), o = ct(n, i);
1237
1241
  if (o === void 0)
1238
1242
  throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
1239
- return Kt(s, e) ? (kt(s, t, o), !0) : !1;
1243
+ return Yt(s, e) ? (Kt(s, t, o), !0) : !1;
1240
1244
  }
1241
- function Kr(s, e, t) {
1242
- const r = Ut(s, e);
1245
+ function Yr(s, e, t) {
1246
+ const r = kt(s, e);
1243
1247
  let n = t;
1244
- if (r instanceof a)
1248
+ if (r instanceof c)
1245
1249
  if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || O(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
1246
1250
  if (!Y(r.getValue() ?? null, t))
1247
1251
  throw new Error(
@@ -1250,7 +1254,7 @@ function Kr(s, e, t) {
1250
1254
  )}, got ${JSON.stringify(r.getValue() ?? null)}`
1251
1255
  );
1252
1256
  return !0;
1253
- } else typeof t == "object" && !(t instanceof a) && (n = P(t));
1257
+ } else typeof t == "object" && !(t instanceof c) && (n = P(t));
1254
1258
  else if (O(r) && typeof t == "number")
1255
1259
  r instanceof E ? n = new E(t.toString()) : r instanceof S && (n = new S(t.toString()));
1256
1260
  else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && O(t)) {
@@ -1258,98 +1262,98 @@ function Kr(s, e, t) {
1258
1262
  !Y(r, i.toString()) && (typeof r == "number" && parseFloat(i.toString()));
1259
1263
  }
1260
1264
  if (!Y(r, n)) {
1261
- const i = r instanceof a ? r.toString() : JSON.stringify(r), o = n instanceof a ? n.toString() : JSON.stringify(n);
1265
+ const i = r instanceof c ? r.toString() : JSON.stringify(r), o = n instanceof c ? n.toString() : JSON.stringify(n);
1262
1266
  throw new Error(
1263
1267
  `TEST failed at '${e}': Expected ${o}, got ${i}`
1264
1268
  );
1265
1269
  }
1266
1270
  return !0;
1267
1271
  }
1268
- function Yr(s, e) {
1272
+ function zr(s, e) {
1269
1273
  switch (e.op) {
1270
1274
  case "add":
1271
1275
  return Lr(s, e.path, e.val);
1272
1276
  case "replace":
1273
- return jr(s, e.path, e.val);
1277
+ return Ur(s, e.path, e.val);
1274
1278
  case "remove":
1275
- return Kt(s, e.path);
1279
+ return Yt(s, e.path);
1276
1280
  case "copy":
1277
- return Ur(s, e.from, e.path);
1278
- case "move":
1279
1281
  return kr(s, e.from, e.path);
1282
+ case "move":
1283
+ return Kr(s, e.from, e.path);
1280
1284
  case "test":
1281
- return Kr(s, e.path, e.val);
1285
+ return Yr(s, e.path, e.val);
1282
1286
  }
1283
1287
  }
1284
1288
  function Kn(s, e, t = !1) {
1285
1289
  const r = t ? s : s.clone();
1286
- return Yr(r, e), r;
1290
+ return zr(r, e), r;
1287
1291
  }
1288
1292
  const ke = Symbol.for("zod-schema-annotations");
1289
- function zr() {
1293
+ function Gr() {
1290
1294
  if (typeof globalThis < "u") return globalThis;
1291
1295
  if (typeof global < "u") return global;
1292
1296
  if (typeof window < "u") return window;
1293
1297
  if (typeof self < "u") return self;
1294
1298
  throw new Error("Unable to locate global object");
1295
1299
  }
1296
- function Yt() {
1297
- const s = zr();
1300
+ function zt() {
1301
+ const s = Gr();
1298
1302
  return ke in s || (s[ke] = /* @__PURE__ */ new WeakMap()), s[ke];
1299
1303
  }
1300
1304
  function Ie(s, e) {
1301
- const t = Yt(), r = t.get(s) || {};
1305
+ const t = zt(), r = t.get(s) || {};
1302
1306
  return t.set(s, { ...r, ...e }), s;
1303
1307
  }
1304
- const R = (s) => Yt().get(s), Gr = (s) => (e) => {
1308
+ const R = (s) => zt().get(s), Jr = (s) => (e) => {
1305
1309
  const t = R(e);
1306
1310
  return Ie(e, {
1307
1311
  ...t,
1308
1312
  blueDescription: s
1309
1313
  });
1310
- }, Jr = (s) => {
1314
+ }, Wr = (s) => {
1311
1315
  const e = R(s);
1312
- return p(e) && et(e.blueDescription) ? e.blueDescription : null;
1313
- }, Yn = (s) => Gr(s)(f.string().optional()), Zr = f.union([f.string(), f.boolean()]), Hr = (s) => (e) => {
1316
+ return p(e) && tt(e.blueDescription) ? e.blueDescription : null;
1317
+ }, Yn = (s) => Jr(s)(h.string().optional()), Zr = h.union([h.string(), h.boolean()]), Hr = (s) => (e) => {
1314
1318
  const t = R(e);
1315
1319
  return Ie(e, {
1316
1320
  ...t,
1317
1321
  blueId: s
1318
1322
  });
1319
- }, Wr = (s) => {
1323
+ }, Xr = (s) => {
1320
1324
  const e = R(s), t = Zr.safeParse(e?.blueId);
1321
1325
  return t.success ? t.data : null;
1322
- }, zn = (s) => Hr(s ?? !0)(f.string()), Xr = (s) => (e) => {
1326
+ }, zn = (s) => Hr(s ?? !0)(h.string()), qr = (s) => (e) => {
1323
1327
  const t = R(e);
1324
1328
  return Ie(e, {
1325
1329
  ...t,
1326
1330
  blueName: s
1327
1331
  });
1328
- }, qr = (s) => {
1332
+ }, Qr = (s) => {
1329
1333
  const e = R(s);
1330
- return p(e) && et(e.blueName) ? e.blueName : null;
1334
+ return p(e) && tt(e.blueName) ? e.blueName : null;
1331
1335
  }, Gn = (s) => {
1332
- const e = f.string().optional();
1333
- return Xr(s)(e);
1334
- }, Qr = () => (s) => {
1336
+ const e = h.string().optional();
1337
+ return qr(s)(e);
1338
+ }, es = () => (s) => {
1335
1339
  const e = R(s);
1336
1340
  return Ie(s, {
1337
1341
  ...e,
1338
1342
  blueNode: !0
1339
1343
  });
1340
- }, es = (s) => {
1344
+ }, ts = (s) => {
1341
1345
  const e = R(s);
1342
1346
  return p(e) && p(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
1343
- }, zt = (s) => !!es(s), Jn = () => {
1344
- const s = f.instanceof(a);
1345
- return Qr()(s);
1346
- }, ts = f.object({
1347
- value: f.array(f.string()).optional(),
1348
- defaultValue: f.string().optional()
1349
- }), rs = (s) => {
1350
- const e = R(s), t = ts.passthrough().safeParse(e?.typeBlueId);
1347
+ }, Gt = (s) => !!ts(s), Jn = () => {
1348
+ const s = h.instanceof(c);
1349
+ return es()(s);
1350
+ }, rs = h.object({
1351
+ value: h.array(h.string()).optional(),
1352
+ defaultValue: h.string().optional()
1353
+ }), ss = (s) => {
1354
+ const e = R(s), t = rs.passthrough().safeParse(e?.typeBlueId);
1351
1355
  return t.success ? t.data : null;
1352
- }, Zn = (s) => (e) => {
1356
+ }, Wn = (s) => (e) => {
1353
1357
  const t = R(e), r = typeof s == "string" ? { value: [s] } : s;
1354
1358
  return Ie(e, {
1355
1359
  ...t,
@@ -1359,32 +1363,32 @@ const R = (s) => Yt().get(s), Gr = (s) => (e) => {
1359
1363
  }
1360
1364
  });
1361
1365
  };
1362
- class de {
1366
+ class pe {
1363
1367
  static resolveBlueId(e) {
1364
- const t = rs(e);
1368
+ const t = ss(e);
1365
1369
  if (I(t))
1366
1370
  return null;
1367
1371
  const r = t.defaultValue;
1368
1372
  if (p(r))
1369
1373
  return r;
1370
1374
  const n = t.value?.[0];
1371
- return p(n) ? n : de.getRepositoryBlueId(t, e);
1375
+ return p(n) ? n : pe.getRepositoryBlueId(t, e);
1372
1376
  }
1373
1377
  static getRepositoryBlueId(e, t) {
1374
1378
  throw new Error("Not implemented");
1375
1379
  }
1376
1380
  }
1377
- class V {
1381
+ class A {
1378
1382
  // TODO: Enhance to support schemas associated with multiple blueIds
1379
1383
  static isTypeOf(e, t, r) {
1380
- const n = de.resolveBlueId(t), i = e.getType()?.getBlueId();
1384
+ const n = pe.resolveBlueId(t), i = e.getType()?.getBlueId();
1381
1385
  if (I(n) || I(i))
1382
1386
  return !1;
1383
1387
  if (n === i)
1384
1388
  return !0;
1385
1389
  if (r?.checkSchemaExtensions && p(r.typeSchemaResolver)) {
1386
1390
  const o = r.typeSchemaResolver.resolveSchema(e);
1387
- return V.checkSchemaExtension(o, t, {
1391
+ return A.checkSchemaExtension(o, t, {
1388
1392
  typeSchemaResolver: r.typeSchemaResolver
1389
1393
  });
1390
1394
  }
@@ -1396,20 +1400,20 @@ class V {
1396
1400
  static checkSchemaExtension(e, t, r) {
1397
1401
  if (!p(e))
1398
1402
  return !1;
1399
- const n = V.unwrapSchema(e), i = V.unwrapSchema(t);
1403
+ const n = A.unwrapSchema(e), i = A.unwrapSchema(t);
1400
1404
  return p(r?.typeSchemaResolver) ? r.typeSchemaResolver.isSchemaExtendedFrom(
1401
1405
  n,
1402
1406
  i
1403
1407
  ) : !1;
1404
1408
  }
1405
1409
  static isWrapperType(e) {
1406
- return e instanceof Nt || e instanceof Pt || e instanceof St || e instanceof At || e instanceof Ne || e instanceof Pe;
1410
+ return e instanceof Pt || e instanceof St || e instanceof Ct || e instanceof At || e instanceof Ne || e instanceof Pe;
1407
1411
  }
1408
1412
  static unwrapSchema(e) {
1409
- return zt(e) ? e : V.isWrapperType(e) ? e instanceof Ne ? V.unwrapSchema(e.innerType()) : e instanceof Pe ? V.unwrapSchema(e.schema) : V.unwrapSchema(e.unwrap()) : e;
1413
+ return Gt(e) ? e : A.isWrapperType(e) ? e instanceof Ne ? A.unwrapSchema(e.innerType()) : e instanceof Pe ? A.unwrapSchema(e.schema) : A.unwrapSchema(e.unwrap()) : e;
1410
1414
  }
1411
1415
  }
1412
- function It(s, e) {
1416
+ function Tt(s, e) {
1413
1417
  const t = s.getType();
1414
1418
  if (t === void 0)
1415
1419
  return;
@@ -1419,7 +1423,7 @@ function It(s, e) {
1419
1423
  r
1420
1424
  )) {
1421
1425
  const i = xe[r];
1422
- return new a().setBlueId(r).setName(i);
1426
+ return new c().setBlueId(r).setName(i);
1423
1427
  }
1424
1428
  const n = e.fetchByBlueId(r);
1425
1429
  if (!n || n.length === 0)
@@ -1432,82 +1436,82 @@ function It(s, e) {
1432
1436
  }
1433
1437
  return t;
1434
1438
  }
1435
- function b(s, e, t) {
1439
+ function w(s, e, t) {
1436
1440
  const r = T.calculateBlueIdSync(s), n = T.calculateBlueIdSync(e);
1437
1441
  if (r === n)
1438
1442
  return !0;
1439
1443
  if (r && X.includes(
1440
1444
  r
1441
1445
  )) {
1442
- let c = e;
1443
- for (; c !== void 0; ) {
1444
- if (T.calculateBlueIdSync(c) === r)
1446
+ let a = e;
1447
+ for (; a !== void 0; ) {
1448
+ if (T.calculateBlueIdSync(a) === r)
1445
1449
  return !0;
1446
- c = It(c, t);
1450
+ a = Tt(a, t);
1447
1451
  }
1448
1452
  return !1;
1449
1453
  }
1450
1454
  let i = s;
1451
1455
  const o = s.getBlueId();
1452
1456
  if (o) {
1453
- const c = t.fetchByBlueId(o);
1454
- c && c.length === 1 && (i = c[0]);
1457
+ const a = t.fetchByBlueId(o);
1458
+ a && a.length === 1 && (i = a[0]);
1455
1459
  }
1456
1460
  let l = i;
1457
1461
  for (; l !== void 0; ) {
1458
1462
  if (T.calculateBlueIdSync(l) === n)
1459
1463
  return !0;
1460
- l = It(l, t);
1464
+ l = Tt(l, t);
1461
1465
  }
1462
1466
  return !1;
1463
1467
  }
1464
- function ss(s, e) {
1465
- return ot.some((t) => {
1466
- const r = new a().setBlueId(t);
1467
- return b(s, r, e);
1468
- });
1469
- }
1470
1468
  function ns(s, e) {
1471
- const t = new a().setBlueId(_);
1472
- return b(s, t, e);
1469
+ return lt.some((t) => {
1470
+ const r = new c().setBlueId(t);
1471
+ return w(s, r, e);
1472
+ });
1473
1473
  }
1474
1474
  function is(s, e) {
1475
- const t = new a().setBlueId(j);
1476
- return b(s, t, e);
1475
+ const t = new c().setBlueId(_);
1476
+ return w(s, t, e);
1477
1477
  }
1478
1478
  function os(s, e) {
1479
- const t = new a().setBlueId(L);
1480
- return b(s, t, e);
1479
+ const t = new c().setBlueId(L);
1480
+ return w(s, t, e);
1481
1481
  }
1482
1482
  function ls(s, e) {
1483
- const t = new a().setBlueId(U);
1484
- return b(s, t, e);
1483
+ const t = new c().setBlueId(j);
1484
+ return w(s, t, e);
1485
1485
  }
1486
- function Gt(s, e) {
1487
- const t = new a().setBlueId(nt);
1488
- return b(s, t, e);
1486
+ function as(s, e) {
1487
+ const t = new c().setBlueId(U);
1488
+ return w(s, t, e);
1489
1489
  }
1490
1490
  function Jt(s, e) {
1491
- const t = new a().setBlueId(it);
1492
- return b(s, t, e);
1491
+ const t = new c().setBlueId(it);
1492
+ return w(s, t, e);
1493
+ }
1494
+ function Wt(s, e) {
1495
+ const t = new c().setBlueId(ot);
1496
+ return w(s, t, e);
1493
1497
  }
1494
1498
  function cs(s, e) {
1495
1499
  return Me.some((t) => {
1496
- const r = new a().setName(t);
1497
- return b(s, r, e);
1500
+ const r = new c().setName(t);
1501
+ return w(s, r, e);
1498
1502
  });
1499
1503
  }
1500
- function as(s, e) {
1504
+ function us(s, e) {
1501
1505
  for (const t of Me) {
1502
- const r = new a().setName(t);
1503
- if (b(s, r, e))
1506
+ const r = new c().setName(t);
1507
+ if (w(s, r, e))
1504
1508
  return t;
1505
1509
  }
1506
1510
  throw new Error(
1507
1511
  `Cannot determine the basic type for node of type "${s.getName() || "unknown"}".`
1508
1512
  );
1509
1513
  }
1510
- class us {
1514
+ class ds {
1511
1515
  blueIdMap = /* @__PURE__ */ new Map();
1512
1516
  nodeProvider;
1513
1517
  constructor(e = [], t) {
@@ -1518,7 +1522,7 @@ class us {
1518
1522
  this.registerSchema(t);
1519
1523
  }
1520
1524
  registerSchema(e) {
1521
- const t = de.resolveBlueId(e);
1525
+ const t = pe.resolveBlueId(e);
1522
1526
  if (p(t)) {
1523
1527
  if (this.blueIdMap.has(t))
1524
1528
  throw new Error(`Duplicate BlueId value: ${t}`);
@@ -1542,8 +1546,8 @@ class us {
1542
1546
  return !0;
1543
1547
  if (p(this.nodeProvider))
1544
1548
  try {
1545
- const i = new a().setBlueId(r), o = new a().setBlueId(n);
1546
- if (b(i, o, this.nodeProvider))
1549
+ const i = new c().setBlueId(r), o = new c().setBlueId(n);
1550
+ if (w(i, o, this.nodeProvider))
1547
1551
  return !0;
1548
1552
  } catch {
1549
1553
  }
@@ -1552,7 +1556,7 @@ class us {
1552
1556
  getBlueIdForSchema(e) {
1553
1557
  if (I(e))
1554
1558
  return null;
1555
- const t = de.resolveBlueId(e);
1559
+ const t = pe.resolveBlueId(e);
1556
1560
  if (p(t))
1557
1561
  return t;
1558
1562
  for (const [r, n] of this.blueIdMap)
@@ -1581,7 +1585,7 @@ const N = {
1581
1585
  BLUE: "blue",
1582
1586
  ITEMS: "items"
1583
1587
  };
1584
- class ut {
1588
+ class dt {
1585
1589
  /**
1586
1590
  * Check if a node is empty (has no fields set)
1587
1591
  */
@@ -1613,27 +1617,27 @@ class ut {
1613
1617
  * Create a text node
1614
1618
  */
1615
1619
  static textNode(e) {
1616
- return new a().setType(new a().setBlueId(_)).setValue(e);
1620
+ return new c().setType(new c().setBlueId(_)).setValue(e);
1617
1621
  }
1618
1622
  /**
1619
1623
  * Create an integer node
1620
1624
  */
1621
1625
  static integerNode(e) {
1622
1626
  const t = e instanceof E ? e : new E(e.toString());
1623
- return new a().setType(new a().setBlueId(j)).setValue(t);
1627
+ return new c().setType(new c().setBlueId(L)).setValue(t);
1624
1628
  }
1625
1629
  /**
1626
1630
  * Create a double node
1627
1631
  */
1628
1632
  static doubleNode(e) {
1629
1633
  const t = e instanceof S ? e : new S(e.toString());
1630
- return new a().setType(new a().setBlueId(L)).setValue(t);
1634
+ return new c().setType(new c().setBlueId(j)).setValue(t);
1631
1635
  }
1632
1636
  /**
1633
1637
  * Create a boolean node
1634
1638
  */
1635
1639
  static booleanNode(e) {
1636
- return new a().setType(new a().setBlueId(U)).setValue(e);
1640
+ return new c().setType(new c().setBlueId(U)).setValue(e);
1637
1641
  }
1638
1642
  /**
1639
1643
  * Check if a node has exactly the specified fields
@@ -1685,11 +1689,11 @@ class ut {
1685
1689
  }
1686
1690
  }
1687
1691
  }
1688
- class dt {
1692
+ class pt {
1689
1693
  }
1690
1694
  class ce {
1691
1695
  static convert(e) {
1692
- const t = new We();
1696
+ const t = new He();
1693
1697
  return ce.traverseNode(e, "", t), t.build();
1694
1698
  }
1695
1699
  static traverseNode(e, t, r) {
@@ -1701,22 +1705,22 @@ class ce {
1701
1705
  return;
1702
1706
  }
1703
1707
  if (n)
1704
- for (const [c, u] of Object.entries(n)) {
1705
- const y = `${t}/${c}`;
1708
+ for (const [a, u] of Object.entries(n)) {
1709
+ const y = `${t}/${a}`;
1706
1710
  ce.traverseNode(u, y, r);
1707
1711
  }
1708
1712
  if (i)
1709
- for (let c = 0; c < i.length; c++) {
1710
- const u = `${t}/${c}`;
1711
- ce.traverseNode(i[c], u, r);
1713
+ for (let a = 0; a < i.length; a++) {
1714
+ const u = `${t}/${a}`;
1715
+ ce.traverseNode(i[a], u, r);
1712
1716
  }
1713
1717
  }
1714
1718
  }
1715
- function Tt(s, e) {
1719
+ function vt(s, e) {
1716
1720
  const t = s.split(e), r = [...t].reverse().findIndex((i) => i !== ""), n = r === -1 ? 0 : t.length - r;
1717
1721
  return t.slice(0, n);
1718
1722
  }
1719
- class $e extends dt {
1723
+ class $e extends pt {
1720
1724
  allowedPaths;
1721
1725
  maxDepth;
1722
1726
  currentPath = [];
@@ -1767,7 +1771,7 @@ class $e extends dt {
1767
1771
  * @returns True if the path matches the allowed path pattern, false otherwise
1768
1772
  */
1769
1773
  matchesAllowedPath(e, t) {
1770
- const r = Tt(e, "/"), n = Tt(t, "/");
1774
+ const r = vt(e, "/"), n = vt(t, "/");
1771
1775
  if (n.length > r.length)
1772
1776
  return !1;
1773
1777
  for (let i = 1; i < n.length; i++)
@@ -1809,7 +1813,7 @@ class $e extends dt {
1809
1813
  * @returns The path limits
1810
1814
  */
1811
1815
  static withMaxDepth(e) {
1812
- const t = new We().setMaxDepth(e);
1816
+ const t = new He().setMaxDepth(e);
1813
1817
  for (let r = 1; r <= e; r++) {
1814
1818
  const n = "/" + Array(r).fill("*").join("/");
1815
1819
  t.addPath(n);
@@ -1822,7 +1826,7 @@ class $e extends dt {
1822
1826
  * @returns The path limits
1823
1827
  */
1824
1828
  static withSinglePath(e) {
1825
- return new We().addPath(e).build();
1829
+ return new He().addPath(e).build();
1826
1830
  }
1827
1831
  /**
1828
1832
  * Creates path limits by analyzing the structure of a node.
@@ -1832,7 +1836,7 @@ class $e extends dt {
1832
1836
  return ce.convert(e);
1833
1837
  }
1834
1838
  }
1835
- class We {
1839
+ class He {
1836
1840
  allowedPaths = /* @__PURE__ */ new Set();
1837
1841
  maxDepth = Number.MAX_SAFE_INTEGER;
1838
1842
  /**
@@ -1859,7 +1863,7 @@ class We {
1859
1863
  return new $e(this.allowedPaths, this.maxDepth);
1860
1864
  }
1861
1865
  }
1862
- class ds extends dt {
1866
+ class Xe extends pt {
1863
1867
  /**
1864
1868
  * Determines if a path segment should be extended - always returns true
1865
1869
  * @returns Always true
@@ -1885,7 +1889,7 @@ class ds extends dt {
1885
1889
  exitPathSegment() {
1886
1890
  }
1887
1891
  }
1888
- class _e extends dt {
1892
+ class _e extends pt {
1889
1893
  limits;
1890
1894
  /**
1891
1895
  * Creates a composite limits with the specified limit strategies
@@ -1945,7 +1949,7 @@ class _e extends dt {
1945
1949
  return new _e(e);
1946
1950
  }
1947
1951
  }
1948
- const K = new ds();
1952
+ const K = new Xe();
1949
1953
  class ps {
1950
1954
  blue;
1951
1955
  constructor(e) {
@@ -1955,8 +1959,8 @@ class ps {
1955
1959
  const n = t.getType();
1956
1960
  if (this.matchesImplicitStructure(e, n))
1957
1961
  return !0;
1958
- const i = $e.fromNode(t), o = _e.of(r, i), l = this.extendAndResolve(e, o), c = this.blue.resolve(t, o);
1959
- return this.verifyMatch(l, t, o) && this.recursiveValueComparison(l, c);
1962
+ const i = $e.fromNode(t), o = _e.of(r, i), l = this.extendAndResolve(e, o), a = this.blue.resolve(t, o);
1963
+ return this.verifyMatch(l, t, o) && this.recursiveValueComparison(l, a);
1960
1964
  }
1961
1965
  /**
1962
1966
  * Resolves a node with the runtime while preserving any structure that could
@@ -1976,17 +1980,17 @@ class ps {
1976
1980
  const r = t.getItems(), n = e.getItems();
1977
1981
  if (r && r.length > 0)
1978
1982
  if (!n || n.length === 0)
1979
- e.setItems(r.map((c) => c.clone()));
1983
+ e.setItems(r.map((a) => a.clone()));
1980
1984
  else
1981
- for (let c = 0; c < Math.min(n.length, r.length); c++)
1982
- this.restoreMissingStructure(n[c], r[c]);
1985
+ for (let a = 0; a < Math.min(n.length, r.length); a++)
1986
+ this.restoreMissingStructure(n[a], r[a]);
1983
1987
  const i = t.getProperties();
1984
1988
  if (i) {
1985
- let c = e.getProperties();
1986
- c || (c = {}, e.setProperties(c));
1989
+ let a = e.getProperties();
1990
+ a || (a = {}, e.setProperties(a));
1987
1991
  for (const [u, y] of Object.entries(i)) {
1988
- const d = c[u];
1989
- d === void 0 ? c[u] = y.clone() : this.restoreMissingStructure(d, y);
1992
+ const d = a[u];
1993
+ d === void 0 ? a[u] = y.clone() : this.restoreMissingStructure(d, y);
1990
1994
  }
1991
1995
  }
1992
1996
  const o = t.getBlueId();
@@ -2013,7 +2017,7 @@ class ps {
2013
2017
  );
2014
2018
  if (r && !n) {
2015
2019
  const d = e.getType();
2016
- if (!d || !b(
2020
+ if (!d || !w(
2017
2021
  d,
2018
2022
  r,
2019
2023
  this.blue.getNodeProvider()
@@ -2022,11 +2026,11 @@ class ps {
2022
2026
  }
2023
2027
  const i = t.getBlueId();
2024
2028
  if (!n && i !== void 0) {
2025
- const d = e.getBlueId(), h = e.getType()?.getBlueId();
2029
+ const d = e.getBlueId(), f = e.getType()?.getBlueId();
2026
2030
  if (d !== void 0) {
2027
2031
  if (i !== d)
2028
2032
  return !1;
2029
- } else if (h === void 0 || i !== h)
2033
+ } else if (f === void 0 || i !== f)
2030
2034
  return !1;
2031
2035
  }
2032
2036
  const o = t.getValue();
@@ -2034,7 +2038,7 @@ class ps {
2034
2038
  const d = e.getValue();
2035
2039
  if (d === void 0)
2036
2040
  return !1;
2037
- if (A(d) && A(o)) {
2041
+ if (C(d) && C(o)) {
2038
2042
  if (!d.eq(o))
2039
2043
  return !1;
2040
2044
  } else if (d !== o)
@@ -2043,26 +2047,26 @@ class ps {
2043
2047
  const l = t.getItems();
2044
2048
  if (l !== void 0) {
2045
2049
  const d = e.getItems() ?? [];
2046
- for (let h = 0; h < l.length; h++)
2047
- if (h < d.length) {
2048
- if (!this.recursiveValueComparison(d[h], l[h]))
2050
+ for (let f = 0; f < l.length; f++)
2051
+ if (f < d.length) {
2052
+ if (!this.recursiveValueComparison(d[f], l[f]))
2049
2053
  return !1;
2050
- } else if (this.hasValueInNestedStructure(l[h]))
2054
+ } else if (this.hasValueInNestedStructure(l[f]))
2051
2055
  return !1;
2052
2056
  }
2053
- const c = t.getItemType();
2054
- if (c !== void 0) {
2057
+ const a = t.getItemType();
2058
+ if (a !== void 0) {
2055
2059
  const d = e.getItems() ?? [];
2056
- for (const h of d)
2057
- if (!this.recursiveValueComparison(h, c))
2060
+ for (const f of d)
2061
+ if (!this.recursiveValueComparison(f, a))
2058
2062
  return !1;
2059
2063
  }
2060
2064
  const u = t.getProperties();
2061
2065
  if (u !== void 0) {
2062
2066
  const d = e.getProperties() ?? {};
2063
- for (const [h, v] of Object.entries(u))
2064
- if (h in d) {
2065
- if (!this.recursiveValueComparison(d[h], v))
2067
+ for (const [f, v] of Object.entries(u))
2068
+ if (f in d) {
2069
+ if (!this.recursiveValueComparison(d[f], v))
2066
2070
  return !1;
2067
2071
  } else if (this.hasValueInNestedStructure(v))
2068
2072
  return !1;
@@ -2070,8 +2074,8 @@ class ps {
2070
2074
  const y = t.getValueType();
2071
2075
  if (y !== void 0) {
2072
2076
  const d = Object.values(e.getProperties() ?? {});
2073
- for (const h of d)
2074
- if (!this.recursiveValueComparison(h, y))
2077
+ for (const f of d)
2078
+ if (!this.recursiveValueComparison(f, y))
2075
2079
  return !1;
2076
2080
  }
2077
2081
  return !0;
@@ -2098,7 +2102,7 @@ class ps {
2098
2102
  * shape of the requested core list or dictionary type.
2099
2103
  */
2100
2104
  matchesImplicitStructure(e, t) {
2101
- return t === void 0 || e.getType() !== void 0 ? !1 : Gt(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Jt(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2105
+ return t === void 0 || e.getType() !== void 0 ? !1 : Jt(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Wt(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2102
2106
  }
2103
2107
  isImplicitListStructure(e) {
2104
2108
  return e.getItems() !== void 0 && e.getValue() === void 0;
@@ -2107,26 +2111,26 @@ class ps {
2107
2111
  return e.getProperties() !== void 0 && e.getValue() === void 0;
2108
2112
  }
2109
2113
  }
2110
- const fs = (s) => s instanceof Nt || s instanceof Pt || s instanceof St || s instanceof At || s instanceof Ne || s instanceof Pe, hs = (s) => s instanceof ee || s instanceof te || s instanceof Be || s instanceof be;
2114
+ const hs = (s) => s instanceof Pt || s instanceof St || s instanceof Ct || s instanceof At || s instanceof Ne || s instanceof Pe, fs = (s) => s instanceof ee || s instanceof te || s instanceof be || s instanceof we;
2111
2115
  class Zt {
2112
2116
  static convertValue(e, t) {
2113
2117
  const r = e.getType()?.getBlueId(), n = e.getValue();
2114
- return I(n) ? hs(t) && ut.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : n : _ === r ? this.convertFromString(String(n), t) : L === r || n instanceof S ? this.convertFromBigDecimal(
2118
+ return I(n) ? fs(t) && dt.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : n : _ === r ? this.convertFromString(String(n), t) : j === r || n instanceof S ? this.convertFromBigDecimal(
2115
2119
  new S(n?.toString()),
2116
2120
  t
2117
- ) : j === r || n instanceof E ? this.convertFromBigInteger(
2121
+ ) : L === r || n instanceof E ? this.convertFromBigInteger(
2118
2122
  new E(n?.toString()),
2119
2123
  t
2120
2124
  ) : U === r || typeof n == "boolean" ? this.convertFromBoolean(!!n, t) : this.convertFromString(String(n), t);
2121
2125
  }
2122
2126
  static convertFromString(e, t) {
2123
- if (!t || t instanceof ee || t instanceof ar || t instanceof ur)
2127
+ if (!t || t instanceof ee || t instanceof ur || t instanceof dr)
2124
2128
  return e;
2125
2129
  if (t instanceof te)
2126
2130
  return Number(e);
2127
- if (t instanceof Be)
2128
- return e.toLowerCase() === "true";
2129
2131
  if (t instanceof be)
2132
+ return e.toLowerCase() === "true";
2133
+ if (t instanceof we)
2130
2134
  return BigInt(e);
2131
2135
  throw new Error(`Cannot convert String to ${t._def.typeName}`);
2132
2136
  }
@@ -2140,20 +2144,20 @@ class Zt {
2140
2144
  static convertFromBigInteger(e, t) {
2141
2145
  if (t instanceof te)
2142
2146
  return e.toNumber();
2143
- if (t instanceof be)
2147
+ if (t instanceof we)
2144
2148
  return BigInt(e.toString());
2145
2149
  if (t instanceof ee)
2146
2150
  return e.toString();
2147
2151
  throw new Error(`Cannot convert Number to ${t._def.typeName}`);
2148
2152
  }
2149
2153
  static convertFromBoolean(e, t) {
2150
- if (!t || t instanceof Be)
2154
+ if (!t || t instanceof be)
2151
2155
  return e;
2152
2156
  if (t instanceof ee)
2153
2157
  return e.toString();
2154
2158
  if (t instanceof te)
2155
2159
  return Number(e);
2156
- if (t instanceof be)
2160
+ if (t instanceof we)
2157
2161
  return BigInt(e);
2158
2162
  throw new Error(`Cannot convert Boolean to ${t._def.typeName}`);
2159
2163
  }
@@ -2161,7 +2165,7 @@ class Zt {
2161
2165
  if (!e) return null;
2162
2166
  if (e instanceof te)
2163
2167
  return 0;
2164
- if (e instanceof Be)
2168
+ if (e instanceof be)
2165
2169
  return !1;
2166
2170
  if (e instanceof ee)
2167
2171
  return "";
@@ -2183,26 +2187,26 @@ class gs {
2183
2187
  return this.convertFields(e, t);
2184
2188
  }
2185
2189
  convertFields(e, t) {
2186
- if (t instanceof dr) {
2190
+ if (t instanceof pr) {
2187
2191
  const r = t._def.left, n = t._def.right, i = this.convert(e, r), o = this.convert(e, n);
2188
2192
  return { ...i, ...o };
2189
2193
  }
2190
- if (t instanceof pr)
2194
+ if (t instanceof hr)
2191
2195
  throw new Error("Union not supported");
2192
2196
  if (t instanceof fr)
2193
2197
  return Object.keys(t.shape).reduce(
2194
2198
  (n, i) => {
2195
- const o = e.getProperties(), l = t.shape[i], c = Wr(l);
2196
- if (p(c)) {
2197
- const v = et(c) ? c : i, k = o?.[v], q = k ? T.calculateBlueIdSync(k) : void 0;
2199
+ const o = e.getProperties(), l = t.shape[i], a = Xr(l);
2200
+ if (p(a)) {
2201
+ const v = tt(a) ? a : i, k = o?.[v], q = k ? T.calculateBlueIdSync(k) : void 0;
2198
2202
  return n[i] = q, n;
2199
2203
  }
2200
- const u = qr(l);
2204
+ const u = Qr(l);
2201
2205
  if (p(u)) {
2202
2206
  const v = o?.[u];
2203
2207
  return n[i] = v?.getName(), n;
2204
2208
  }
2205
- const y = Jr(l);
2209
+ const y = Wr(l);
2206
2210
  if (p(y)) {
2207
2211
  const v = o?.[y];
2208
2212
  return n[i] = v?.getDescription(), n;
@@ -2218,11 +2222,11 @@ class gs {
2218
2222
  const d = o?.[i];
2219
2223
  if (I(d))
2220
2224
  return n;
2221
- const h = this.nodeToObjectConverter.convert(
2225
+ const f = this.nodeToObjectConverter.convert(
2222
2226
  d,
2223
2227
  l
2224
2228
  );
2225
- return n[i] = h, n;
2229
+ return n[i] = f, n;
2226
2230
  },
2227
2231
  {}
2228
2232
  );
@@ -2266,13 +2270,13 @@ class Ts {
2266
2270
  p(o) && i.set(G, o);
2267
2271
  const l = e.getDescription();
2268
2272
  p(l) && i.set(J, l);
2269
- const c = e.getProperties();
2270
- return p(c) && Object.entries(c).forEach(([u, y]) => {
2271
- const d = new a().setValue(u);
2272
- d.setType(new a().setBlueId(_));
2273
- const h = Zt.convertValue(d, r), v = this.nodeToObjectConverter.convert(y, n);
2274
- i.set(h, v);
2275
- }), t instanceof hr ? Object.fromEntries(i) : i;
2273
+ const a = e.getProperties();
2274
+ return p(a) && Object.entries(a).forEach(([u, y]) => {
2275
+ const d = new c().setValue(u);
2276
+ d.setType(new c().setBlueId(_));
2277
+ const f = Zt.convertValue(d, r), v = this.nodeToObjectConverter.convert(y, n);
2278
+ i.set(f, v);
2279
+ }), t instanceof yr ? Object.fromEntries(i) : i;
2276
2280
  }
2277
2281
  }
2278
2282
  class vs {
@@ -2280,12 +2284,12 @@ class vs {
2280
2284
  return m.get(e);
2281
2285
  }
2282
2286
  }
2283
- class Bs {
2287
+ class bs {
2284
2288
  convert(e) {
2285
2289
  return m.get(e);
2286
2290
  }
2287
2291
  }
2288
- class bs {
2292
+ class ws {
2289
2293
  constructor(e) {
2290
2294
  this.nodeToObjectConverter = e;
2291
2295
  }
@@ -2299,21 +2303,21 @@ class bs {
2299
2303
  );
2300
2304
  }
2301
2305
  }
2302
- const ws = f.union([
2303
- f.literal("ZodString"),
2304
- f.literal("ZodNumber"),
2305
- f.literal("ZodBoolean"),
2306
- f.literal("ZodBigInt"),
2307
- f.literal("ZodArray"),
2308
- f.literal("ZodSet"),
2309
- f.literal("ZodMap"),
2310
- f.literal("ZodRecord"),
2311
- f.literal("ZodObject"),
2312
- f.literal("ZodEnum"),
2313
- f.literal("ZodNativeEnum"),
2314
- f.literal("ZodUnknown"),
2315
- f.literal("ZodAny"),
2316
- f.literal("ZodTuple")
2306
+ const Bs = h.union([
2307
+ h.literal("ZodString"),
2308
+ h.literal("ZodNumber"),
2309
+ h.literal("ZodBoolean"),
2310
+ h.literal("ZodBigInt"),
2311
+ h.literal("ZodArray"),
2312
+ h.literal("ZodSet"),
2313
+ h.literal("ZodMap"),
2314
+ h.literal("ZodRecord"),
2315
+ h.literal("ZodObject"),
2316
+ h.literal("ZodEnum"),
2317
+ h.literal("ZodNativeEnum"),
2318
+ h.literal("ZodUnknown"),
2319
+ h.literal("ZodAny"),
2320
+ h.literal("ZodTuple")
2317
2321
  ]);
2318
2322
  class Es {
2319
2323
  constructor(e) {
@@ -2324,19 +2328,19 @@ class Es {
2324
2328
  converters = /* @__PURE__ */ new Map();
2325
2329
  complexObjectConverter;
2326
2330
  registerConverters() {
2327
- const e = new ys(), t = new ms(this.nodeToObjectConverter), r = new bs(this.nodeToObjectConverter), n = new Is(this.nodeToObjectConverter), i = new Ts(this.nodeToObjectConverter);
2328
- this.converters.set("ZodString", e), this.converters.set("ZodNumber", e), this.converters.set("ZodBoolean", e), this.converters.set("ZodBigInt", e), this.converters.set("ZodEnum", e), this.converters.set("ZodNativeEnum", e), this.converters.set("ZodUnknown", new vs()), this.converters.set("ZodAny", new Bs()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", n), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
2331
+ const e = new ys(), t = new ms(this.nodeToObjectConverter), r = new ws(this.nodeToObjectConverter), n = new Is(this.nodeToObjectConverter), i = new Ts(this.nodeToObjectConverter);
2332
+ this.converters.set("ZodString", e), this.converters.set("ZodNumber", e), this.converters.set("ZodBoolean", e), this.converters.set("ZodBigInt", e), this.converters.set("ZodEnum", e), this.converters.set("ZodNativeEnum", e), this.converters.set("ZodUnknown", new vs()), this.converters.set("ZodAny", new bs()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", n), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
2329
2333
  }
2330
2334
  getConverter(e) {
2331
2335
  const t = this.getSchemaTypeName(e);
2332
2336
  return this.converters.get(t) ?? this.complexObjectConverter;
2333
2337
  }
2334
2338
  getSchemaTypeName(e) {
2335
- if (fs(e))
2339
+ if (hs(e))
2336
2340
  return e instanceof Ne ? this.getSchemaTypeName(e.innerType()) : e instanceof Pe ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
2337
2341
  const t = e._def.typeName;
2338
2342
  try {
2339
- return ws.parse(t);
2343
+ return Bs.parse(t);
2340
2344
  } catch {
2341
2345
  throw new Error(`Schema type name ${t} is not supported`);
2342
2346
  }
@@ -2348,11 +2352,11 @@ class Ns {
2348
2352
  }
2349
2353
  converterFactory;
2350
2354
  convert(e, t) {
2351
- const r = this.typeSchemaResolver?.resolveSchema(e), n = V.unwrapSchema(t);
2352
- if (zt(n))
2355
+ const r = this.typeSchemaResolver?.resolveSchema(e), n = A.unwrapSchema(t);
2356
+ if (Gt(n))
2353
2357
  return e;
2354
2358
  let i = n;
2355
- return V.checkSchemaExtension(
2359
+ return A.checkSchemaExtension(
2356
2360
  r,
2357
2361
  n,
2358
2362
  { typeSchemaResolver: this.typeSchemaResolver }
@@ -2364,7 +2368,7 @@ class Ns {
2364
2368
  }
2365
2369
  class Ht {
2366
2370
  reverse(e) {
2367
- const t = new a();
2371
+ const t = new c();
2368
2372
  return this.reverseNode(t, e, e.getType()), t;
2369
2373
  }
2370
2374
  reverseNode(e, t, r) {
@@ -2379,8 +2383,8 @@ class Ht {
2379
2383
  }
2380
2384
  reverseTypeReferences(e, t, r) {
2381
2385
  const n = (i, o) => {
2382
- const l = i(t), c = r ? i(r) : void 0, u = l?.getBlueId();
2383
- p(u) && (I(c?.getBlueId()) || u !== c.getBlueId()) && o(e, new a().setBlueId(u));
2386
+ const l = i(t), a = r ? i(r) : void 0, u = l?.getBlueId();
2387
+ p(u) && (I(a?.getBlueId()) || u !== a.getBlueId()) && o(e, new c().setBlueId(u));
2384
2388
  };
2385
2389
  n(
2386
2390
  (i) => i.getType(),
@@ -2402,13 +2406,13 @@ class Ht {
2402
2406
  return;
2403
2407
  const i = r?.getItems(), o = [];
2404
2408
  if (p(i) && i.length > 0) {
2405
- const c = T.calculateBlueIdSync(i);
2406
- o.push(new a().setBlueId(c));
2409
+ const a = T.calculateBlueIdSync(i);
2410
+ o.push(new c().setBlueId(a));
2407
2411
  }
2408
2412
  const l = i?.length || 0;
2409
- for (let c = l; c < n.length; c++) {
2410
- const u = new a();
2411
- this.reverseNode(u, n[c], void 0), o.push(u);
2413
+ for (let a = l; a < n.length; a++) {
2414
+ const u = new c();
2415
+ this.reverseNode(u, n[a], void 0), o.push(u);
2412
2416
  }
2413
2417
  o.length > 0 && e.setItems(o);
2414
2418
  }
@@ -2418,12 +2422,12 @@ class Ht {
2418
2422
  return;
2419
2423
  const i = {};
2420
2424
  for (const [o, l] of Object.entries(n)) {
2421
- const c = this.getInheritedProperty(
2425
+ const a = this.getInheritedProperty(
2422
2426
  o,
2423
2427
  t,
2424
2428
  r
2425
- ), u = new a();
2426
- this.reverseNode(u, l, c), ut.isEmptyNode(u) || (i[o] = u);
2429
+ ), u = new c();
2430
+ this.reverseNode(u, l, a), dt.isEmptyNode(u) || (i[o] = u);
2427
2431
  }
2428
2432
  Object.keys(i).length > 0 && e.setProperties(i);
2429
2433
  }
@@ -2450,20 +2454,20 @@ class Ht {
2450
2454
  p(o) && r.setItemType(o.clone());
2451
2455
  const l = t.getKeyType();
2452
2456
  p(l) && r.setKeyType(l.clone());
2453
- const c = t.getValueType();
2454
- p(c) && r.setValueType(c.clone());
2457
+ const a = t.getValueType();
2458
+ p(a) && r.setValueType(a.clone());
2455
2459
  const u = t.getProperties();
2456
2460
  if (p(u)) {
2457
2461
  const d = r.getProperties() || {};
2458
- for (const [h, v] of Object.entries(u))
2459
- d[h] = v.clone();
2462
+ for (const [f, v] of Object.entries(u))
2463
+ d[f] = v.clone();
2460
2464
  r.setProperties(d);
2461
2465
  }
2462
2466
  const y = t.getItems();
2463
2467
  return p(y) && r.setItems(y.map((d) => d.clone())), r;
2464
2468
  }
2465
2469
  }
2466
- class pe extends a {
2470
+ class ne extends c {
2467
2471
  /**
2468
2472
  * Creates a new ResolvedBlueNode from a resolved BlueNode
2469
2473
  * @param resolvedNode - The fully resolved node after merge operations
@@ -2497,7 +2501,16 @@ class pe extends a {
2497
2501
  */
2498
2502
  clone() {
2499
2503
  const e = super.clone();
2500
- return new pe(e);
2504
+ return new ne(e);
2505
+ }
2506
+ /**
2507
+ * Creates a shallow clone of this ResolvedBlueNode while preserving
2508
+ * the resolved marker type.
2509
+ * @returns A new ResolvedBlueNode with shallow-copied containers
2510
+ */
2511
+ cloneShallow() {
2512
+ const e = super.cloneShallow();
2513
+ return new ne(e);
2501
2514
  }
2502
2515
  /**
2503
2516
  * Copies all properties from another BlueNode
@@ -2529,34 +2542,34 @@ function Ps(s) {
2529
2542
  }
2530
2543
  }();
2531
2544
  }
2532
- const Ke = W.types.float.options, Ss = {
2545
+ const Ke = H.types.float.options, Ss = {
2533
2546
  ...Ke,
2534
2547
  construct: (s) => {
2535
2548
  const e = s.replace(/_/g, "").toLowerCase();
2536
- if (!Et(e))
2549
+ if (!Nt(e))
2537
2550
  return new S(e);
2538
2551
  if (Ke.construct)
2539
2552
  return Ke.construct(s);
2540
2553
  }
2541
- }, As = new W.Type("tag:yaml.org,2002:float", Ss), Ye = W.types.int.options, Vs = {
2554
+ }, Cs = new H.Type("tag:yaml.org,2002:float", Ss), Ye = H.types.int.options, As = {
2542
2555
  ...Ye,
2543
2556
  construct: (s) => {
2544
2557
  let e = s;
2545
- if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !Et(e))
2558
+ if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !Nt(e))
2546
2559
  return new E(e);
2547
2560
  if (Ye.construct)
2548
2561
  return Ye.construct(s);
2549
2562
  }
2550
- }, Cs = new W.Type("tag:yaml.org,2002:int", Vs), Wt = W.CORE_SCHEMA.extend({
2551
- implicit: [As, Cs]
2563
+ }, Vs = new H.Type("tag:yaml.org,2002:int", As), Xt = H.CORE_SCHEMA.extend({
2564
+ implicit: [Cs, Vs]
2552
2565
  }), $ = (s) => {
2553
- const e = W.load(s, { schema: Wt });
2566
+ const e = H.load(s, { schema: Xt });
2554
2567
  return e === void 0 ? void 0 : e;
2555
- }, Rs = (s) => W.dump(s, {
2556
- schema: Wt,
2568
+ }, Rs = (s) => H.dump(s, {
2569
+ schema: Xt,
2557
2570
  replacer: (e, t) => {
2558
- if (A(t)) {
2559
- if (H(t)) {
2571
+ if (C(t)) {
2572
+ if (Z(t)) {
2560
2573
  const r = new M(Number.MIN_SAFE_INTEGER.toString()), n = new M(Number.MAX_SAFE_INTEGER.toString());
2561
2574
  if (t.lt(r) || t.gt(n))
2562
2575
  return t.toString();
@@ -2599,7 +2612,7 @@ class Ds extends Te {
2599
2612
  return this.nodeProviders;
2600
2613
  }
2601
2614
  }
2602
- const Xt = `- type:
2615
+ const qt = `- type:
2603
2616
  blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
2604
2617
  mappings:
2605
2618
  Text: DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K
@@ -2618,7 +2631,7 @@ description: This transformation infers type details for Text, Integer, Number a
2618
2631
  type:
2619
2632
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
2620
2633
  description: This transformation replaces`, $s = [
2621
- Xt,
2634
+ qt,
2622
2635
  Ms,
2623
2636
  xs,
2624
2637
  Fs
@@ -2650,8 +2663,8 @@ class _s extends Te {
2650
2663
  }
2651
2664
  }
2652
2665
  }
2653
- class pt extends Te {
2654
- static INSTANCE = new pt();
2666
+ class ht extends Te {
2667
+ static INSTANCE = new ht();
2655
2668
  nodeProvider;
2656
2669
  constructor() {
2657
2670
  super(), this.nodeProvider = new _s();
@@ -2680,14 +2693,14 @@ class z {
2680
2693
  let n, i;
2681
2694
  const o = Array.isArray(r) && r.length > 1;
2682
2695
  if (o) {
2683
- const l = r.map((c) => {
2684
- const u = g.deserialize(c);
2696
+ const l = r.map((a) => {
2697
+ const u = g.deserialize(a);
2685
2698
  return t(u);
2686
2699
  });
2687
- n = T.calculateBlueIdSync(l), i = l.map((c) => m.get(c));
2700
+ n = T.calculateBlueIdSync(l), i = l.map((a) => m.get(a));
2688
2701
  } else {
2689
- const l = g.deserialize(r), c = t(l);
2690
- n = T.calculateBlueIdSync(c), i = m.get(c);
2702
+ const l = g.deserialize(r), a = t(l);
2703
+ n = T.calculateBlueIdSync(a), i = m.get(a);
2691
2704
  }
2692
2705
  return new ze(n, i, o);
2693
2706
  }
@@ -2752,7 +2765,7 @@ class z {
2752
2765
  }
2753
2766
  }
2754
2767
  }
2755
- class Ls extends Te {
2768
+ class js extends Te {
2756
2769
  fetchByBlueId(e) {
2757
2770
  const t = e.split("#")[0], r = this.fetchContentByBlueId(t);
2758
2771
  if (r == null)
@@ -2767,11 +2780,11 @@ class Ls extends Te {
2767
2780
  if (o.length > 1) {
2768
2781
  const l = parseInt(o[1]);
2769
2782
  if (Array.isArray(i) && l < i.length) {
2770
- const c = i[l], u = g.deserialize(c);
2783
+ const a = i[l], u = g.deserialize(a);
2771
2784
  return u.setBlueId(e), [u];
2772
2785
  } else if (l === 0) {
2773
- const c = g.deserialize(i);
2774
- return c.setBlueId(e), [c];
2786
+ const a = g.deserialize(i);
2787
+ return a.setBlueId(e), [a];
2775
2788
  } else
2776
2789
  return null;
2777
2790
  }
@@ -2784,7 +2797,7 @@ class Ls extends Te {
2784
2797
  }
2785
2798
  }
2786
2799
  }
2787
- class qt extends Ls {
2800
+ class Qt extends js {
2788
2801
  nameToBlueIdsMap = /* @__PURE__ */ new Map();
2789
2802
  /**
2790
2803
  * Find a node by name. Throws an error if multiple nodes are found with the same name.
@@ -2828,17 +2841,17 @@ class qt extends Ls {
2828
2841
  ]);
2829
2842
  }
2830
2843
  }
2831
- const Qt = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanceof a) ? s : Qe(s) ? s.map((e) => g.deserialize(e)) : g.deserialize(s), js = async (s) => {
2832
- const e = Qt(s);
2844
+ const er = (s) => s instanceof c || Array.isArray(s) && s.every((e) => e instanceof c) ? s : et(s) ? s.map((e) => g.deserialize(e)) : g.deserialize(s), Ls = async (s) => {
2845
+ const e = er(s);
2833
2846
  return T.calculateBlueId(e);
2834
- }, Hn = (s) => {
2835
- const e = Qt(s);
2847
+ }, Zn = (s) => {
2848
+ const e = er(s);
2836
2849
  return T.calculateBlueIdSync(e);
2837
- }, vt = async (s) => {
2838
- if (Er(s))
2850
+ }, bt = async (s) => {
2851
+ if (Nr(s))
2839
2852
  return s;
2840
2853
  try {
2841
- const e = Ae.parse(s), t = await js(e);
2854
+ const e = Ce.parse(s), t = await Ls(e);
2842
2855
  return {
2843
2856
  ...s,
2844
2857
  blueId: t
@@ -2846,41 +2859,41 @@ const Qt = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanc
2846
2859
  } catch (e) {
2847
2860
  throw new Error(`Failed enriching object with Blue ID: ${e}`);
2848
2861
  }
2849
- }, Wn = (s) => s?.items, Xn = (s) => s?.value, qn = (s) => I(s) ? {} : Ct(
2862
+ }, Hn = (s) => s?.items, Xn = (s) => s?.value, qn = (s) => I(s) ? {} : Rt(
2850
2863
  s,
2851
- rt
2852
- ), Qn = (s) => Pr(s) ? s.type.name ?? null : Sr(s) ? yr(typeof s.value) : Nr(s) ? "List" : null, Us = (s) => p(s) && Object.keys(Ct(s, ["blueId"])).length > 0, ei = (s) => {
2864
+ st
2865
+ ), Qn = (s) => Sr(s) ? s.type.name ?? null : Cr(s) ? gr(typeof s.value) : Pr(s) ? "List" : null, Us = (s) => p(s) && Object.keys(Rt(s, ["blueId"])).length > 0, ei = (s) => {
2853
2866
  try {
2854
2867
  const e = g.deserialize(s), t = m.get(e);
2855
- return ue.parse(t);
2868
+ return de.parse(t);
2856
2869
  } catch (e) {
2857
2870
  throw new Error(
2858
2871
  `Failed transforming JSON-like value to BlueObject: ${e}`
2859
2872
  );
2860
2873
  }
2861
- }, Bt = async (s) => {
2874
+ }, wt = async (s) => {
2862
2875
  const {
2863
2876
  resolveFunction: e,
2864
2877
  signal: t = new AbortController().signal,
2865
2878
  omitItems: r
2866
2879
  } = s, n = s.count ?? s.items.length;
2867
- let i = await gr(s.items, async (l) => await vt(l));
2880
+ let i = await mr(s.items, async (l) => await bt(l));
2868
2881
  const o = Math.max(i?.length - n, 0);
2869
2882
  for (let l = i.length - 1; l >= o; l--)
2870
2883
  if (!Us(i[l])) {
2871
- const c = await e(i[l], { signal: t });
2872
- if (Array.isArray(c))
2873
- return Bt({
2884
+ const a = await e(i[l], { signal: t });
2885
+ if (Array.isArray(a))
2886
+ return wt({
2874
2887
  ...s,
2875
2888
  items: [
2876
2889
  ...i.slice(0, l),
2877
- ...c,
2890
+ ...a,
2878
2891
  ...i.slice(l + 1)
2879
2892
  ]
2880
2893
  });
2881
- const u = await vt(c);
2894
+ const u = await bt(a);
2882
2895
  if (r?.includes(u.blueId))
2883
- return Bt({
2896
+ return wt({
2884
2897
  ...s,
2885
2898
  items: [...i.slice(0, l), ...i.slice(l + 1)]
2886
2899
  });
@@ -2892,7 +2905,7 @@ const Qt = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanc
2892
2905
  }
2893
2906
  return i;
2894
2907
  };
2895
- function we(s) {
2908
+ function Be(s) {
2896
2909
  try {
2897
2910
  const e = new URL(s);
2898
2911
  return e.protocol === "http:" || e.protocol === "https:";
@@ -2907,7 +2920,7 @@ class ks {
2907
2920
  * @returns The processed document
2908
2921
  */
2909
2922
  process(e) {
2910
- return w.transform(e, this.inferType.bind(this));
2923
+ return B.transform(e, this.inferType.bind(this));
2911
2924
  }
2912
2925
  /**
2913
2926
  * Infer a basic type for a node
@@ -2916,10 +2929,10 @@ class ks {
2916
2929
  */
2917
2930
  inferType(e) {
2918
2931
  const t = e.getType(), r = e.getValue();
2919
- return I(t) && p(r) && (typeof r == "string" ? e.setType(new a().setBlueId(_)) : typeof r == "bigint" || H(r) ? e.setType(new a().setBlueId(j)) : Ge(r) ? e.setType(new a().setBlueId(L)) : typeof r == "boolean" && e.setType(new a().setBlueId(U))), e;
2932
+ return I(t) && p(r) && (typeof r == "string" ? e.setType(new c().setBlueId(_)) : typeof r == "bigint" || Z(r) ? e.setType(new c().setBlueId(L)) : Ge(r) ? e.setType(new c().setBlueId(j)) : typeof r == "boolean" && e.setType(new c().setBlueId(U))), e;
2920
2933
  }
2921
2934
  }
2922
- class Ce {
2935
+ class Ve {
2923
2936
  static MAPPINGS = "mappings";
2924
2937
  mappings = /* @__PURE__ */ new Map();
2925
2938
  /**
@@ -2927,13 +2940,13 @@ class Ce {
2927
2940
  * @param transformationOrMappings - The transformation node or mappings to use
2928
2941
  */
2929
2942
  constructor(e) {
2930
- if (e instanceof a) {
2943
+ if (e instanceof c) {
2931
2944
  const r = e.getProperties();
2932
- if (r && r[Ce.MAPPINGS]) {
2933
- const i = r[Ce.MAPPINGS].getProperties();
2945
+ if (r && r[Ve.MAPPINGS]) {
2946
+ const i = r[Ve.MAPPINGS].getProperties();
2934
2947
  i && Object.entries(i).forEach(([o, l]) => {
2935
- const c = l.getValue();
2936
- typeof c == "string" && this.mappings.set(o, c);
2948
+ const a = l.getValue();
2949
+ typeof a == "string" && this.mappings.set(o, a);
2937
2950
  });
2938
2951
  }
2939
2952
  } else
@@ -2945,7 +2958,7 @@ class Ce {
2945
2958
  * @returns The processed document
2946
2959
  */
2947
2960
  process(e) {
2948
- return w.transform(e, this.transformNode.bind(this));
2961
+ return B.transform(e, this.transformNode.bind(this));
2949
2962
  }
2950
2963
  transformNode(e) {
2951
2964
  const t = e.clone();
@@ -2957,7 +2970,7 @@ class Ce {
2957
2970
  if (this.mappings.has(r)) {
2958
2971
  const n = this.mappings.get(r);
2959
2972
  if (n) {
2960
- const i = new a().setBlueId(n);
2973
+ const i = new c().setBlueId(n);
2961
2974
  t === e.getType() ? e.setType(i) : t === e.getItemType() ? e.setItemType(i) : t === e.getKeyType() ? e.setKeyType(i) : t === e.getValueType() && e.setValueType(i);
2962
2975
  }
2963
2976
  }
@@ -2972,7 +2985,7 @@ class Ks {
2972
2985
  * @throws Error if any inline type values remain without BlueId mappings
2973
2986
  */
2974
2987
  process(e) {
2975
- return w.transform(e, this.validateNode.bind(this)), e;
2988
+ return B.transform(e, this.validateNode.bind(this)), e;
2976
2989
  }
2977
2990
  validateNode(e) {
2978
2991
  return this.validateTypeField(e, e.getType(), "type"), this.validateTypeField(e, e.getItemType(), "itemType"), this.validateTypeField(e, e.getKeyType(), "keyType"), this.validateTypeField(e, e.getValueType(), "valueType"), e;
@@ -2995,7 +3008,7 @@ class ft {
2995
3008
  * @param strategy - The strategy to use for missing elements (defaults to THROW_EXCEPTION)
2996
3009
  */
2997
3010
  constructor(e, t) {
2998
- this.nodeProvider = fe.wrap(e), this.strategy = t || "THROW_EXCEPTION";
3011
+ this.nodeProvider = he.wrap(e), this.strategy = t || "THROW_EXCEPTION";
2999
3012
  }
3000
3013
  /**
3001
3014
  * Extends a node with its resolved references
@@ -3016,13 +3029,13 @@ class ft {
3016
3029
  if (i && !X.includes(
3017
3030
  i
3018
3031
  )) {
3019
- const h = this.fetchNode(e);
3020
- if (h && h.length > 0)
3021
- if (h.length === 1) {
3022
- const v = h[0];
3032
+ const f = this.fetchNode(e);
3033
+ if (f && f.length > 0)
3034
+ if (f.length === 1) {
3035
+ const v = f[0];
3023
3036
  this.mergeNodes(e, v);
3024
3037
  } else {
3025
- const v = h.map((q) => q.clone()), k = new a().setItems(v);
3038
+ const v = f.map((q) => q.clone()), k = new c().setItems(v);
3026
3039
  this.mergeNodes(e, k);
3027
3040
  }
3028
3041
  }
@@ -3030,19 +3043,19 @@ class ft {
3030
3043
  o && this.extendNode(o, t, "type", !0);
3031
3044
  const l = e.getItemType();
3032
3045
  l && this.extendNode(l, t, "itemType", !0);
3033
- const c = e.getKeyType();
3034
- c && this.extendNode(c, t, "keyType", !0);
3046
+ const a = e.getKeyType();
3047
+ a && this.extendNode(a, t, "keyType", !0);
3035
3048
  const u = e.getValueType();
3036
3049
  u && this.extendNode(u, t, "valueType", !0);
3037
3050
  const y = e.getProperties();
3038
- y && Object.entries(y).forEach(([h, v]) => {
3039
- this.extendNode(v, t, h, !1);
3051
+ y && Object.entries(y).forEach(([f, v]) => {
3052
+ this.extendNode(v, t, f, !1);
3040
3053
  });
3041
3054
  const d = e.getItems();
3042
3055
  if (d && d.length > 0) {
3043
3056
  this.reconstructList(d);
3044
- for (let h = 0; h < d.length; h++)
3045
- this.extendNode(d[h], t, String(h), !1);
3057
+ for (let f = 0; f < d.length; f++)
3058
+ this.extendNode(d[f], t, String(f), !1);
3046
3059
  }
3047
3060
  } finally {
3048
3061
  n || t.exitPathSegment();
@@ -3080,7 +3093,7 @@ class ft {
3080
3093
  p(r) && e.setValue(r), e.setItems(t.getItems()), e.setProperties(t.getProperties());
3081
3094
  }
3082
3095
  }
3083
- class ht {
3096
+ class yt {
3084
3097
  blueIdsCollections = [];
3085
3098
  /**
3086
3099
  * Initializes the generator with default BlueIds collections
@@ -3150,7 +3163,7 @@ ${r}`;
3150
3163
  return Object.keys(this.getAllBlueIds()).length;
3151
3164
  }
3152
3165
  }
3153
- class ne {
3166
+ class ie {
3154
3167
  static DEFAULT_BLUE_BLUE_ID = "6sqUywMoBRyj9hgQxSu2nDPnqcyiSM7xu9AB9sN98YJK";
3155
3168
  processorProvider;
3156
3169
  nodeProvider;
@@ -3164,7 +3177,7 @@ class ne {
3164
3177
  const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: n } = e;
3165
3178
  if (!t)
3166
3179
  throw new Error("NodeProvider is required");
3167
- this.nodeProvider = fe.wrap(t), this.processorProvider = r || ne.getStandardProvider(), this.blueIdsMappingGenerator = n || new ht(), this.loadDefaultSimpleBlue();
3180
+ this.nodeProvider = he.wrap(t), this.processorProvider = r || ie.getStandardProvider(), this.blueIdsMappingGenerator = n || new yt(), this.loadDefaultSimpleBlue();
3168
3181
  }
3169
3182
  /**
3170
3183
  * Preprocesses a document node
@@ -3223,7 +3236,7 @@ class ne {
3223
3236
  getProcessor(e) {
3224
3237
  const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", n = e.getType()?.getBlueId();
3225
3238
  if (t === n)
3226
- return new Ce(
3239
+ return new Ve(
3227
3240
  e
3228
3241
  );
3229
3242
  if (r === n)
@@ -3248,7 +3261,7 @@ ${t}
3248
3261
  */
3249
3262
  loadDefaultSimpleBlue() {
3250
3263
  try {
3251
- const e = this.enrichDefaultBlue(Xt), t = $(e);
3264
+ const e = this.enrichDefaultBlue(qt), t = $(e);
3252
3265
  if (t)
3253
3266
  this.defaultSimpleBlue = g.deserialize(t);
3254
3267
  else
@@ -3258,15 +3271,15 @@ ${t}
3258
3271
  }
3259
3272
  }
3260
3273
  }
3261
- class yt extends qt {
3274
+ class gt extends Qt {
3262
3275
  blueIdToContentMap = /* @__PURE__ */ new Map();
3263
3276
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
3264
3277
  preprocessor;
3265
3278
  constructor(e) {
3266
3279
  super();
3267
- const t = new ht(), r = yt.collectAliasMappings(e);
3280
+ const t = new yt(), r = gt.collectAliasMappings(e);
3268
3281
  Object.keys(r).length > 0 && t.registerBlueIds(r);
3269
- const n = new ne({
3282
+ const n = new ie({
3270
3283
  nodeProvider: this,
3271
3284
  blueIdsMappingGenerator: t
3272
3285
  });
@@ -3312,10 +3325,10 @@ class yt extends qt {
3312
3325
  (o) => o
3313
3326
  ), i = t || n.blueId;
3314
3327
  this.blueIdToContentMap.set(i, n.content), this.blueIdToMultipleDocumentsMap.set(i, !0), r.forEach((o, l) => {
3315
- const c = `${i}#${l}`, u = m.get(o), y = T.calculateBlueIdSync(o);
3328
+ const a = `${i}#${l}`, u = m.get(o), y = T.calculateBlueIdSync(o);
3316
3329
  this.blueIdToContentMap.set(y, u), this.blueIdToMultipleDocumentsMap.set(y, !1);
3317
3330
  const d = o.getName();
3318
- d && this.addToNameMap(d, c);
3331
+ d && this.addToNameMap(d, a);
3319
3332
  });
3320
3333
  }
3321
3334
  fetchContentByBlueId(e) {
@@ -3340,7 +3353,7 @@ class yt extends qt {
3340
3353
  return this.blueIdToContentMap.has(t);
3341
3354
  }
3342
3355
  }
3343
- class fe {
3356
+ class he {
3344
3357
  /**
3345
3358
  * Wraps a NodeProvider with a SequentialNodeProvider that includes bootstrap providers and repository definitions
3346
3359
  * @param originalProvider - The original NodeProvider to wrap
@@ -3348,9 +3361,9 @@ class fe {
3348
3361
  * @returns A wrapped NodeProvider that includes bootstrap providers and repository definitions
3349
3362
  */
3350
3363
  static wrap(e, t) {
3351
- const r = [pt.INSTANCE];
3364
+ const r = [ht.INSTANCE];
3352
3365
  if (t && t.length > 0) {
3353
- const n = new yt(t);
3366
+ const n = new gt(t);
3354
3367
  r.push(n);
3355
3368
  }
3356
3369
  return r.push(e), new Ds(r);
@@ -3382,7 +3395,7 @@ class Ys {
3382
3395
  return this.handleAliasValue(r, t);
3383
3396
  if (Se.isPotentialBlueId(t))
3384
3397
  return this.handleBlueId(r, t);
3385
- throw we(t) ? new Error(
3398
+ throw Be(t) ? new Error(
3386
3399
  `URL '${t}' detected. Use the async version of this method to fetch the content.`
3387
3400
  ) : new Error(`Invalid blue value: ${t}`);
3388
3401
  }
@@ -3402,17 +3415,17 @@ class Ys {
3402
3415
  return this.handleAliasValue(r, t);
3403
3416
  if (Se.isPotentialBlueId(t))
3404
3417
  return this.handleBlueId(r, t);
3405
- if (we(t) && this.urlContentFetcher)
3418
+ if (Be(t) && this.urlContentFetcher)
3406
3419
  try {
3407
3420
  const n = await this.fetchFromUrl(t);
3408
- return n && r.setBlue(new a().setItems(n)), r;
3421
+ return n && r.setBlue(new c().setItems(n)), r;
3409
3422
  } catch (n) {
3410
3423
  throw n instanceof Error ? new Error(
3411
3424
  `Failed to fetch from URL '${t}'.
3412
3425
  ${n.message}`
3413
3426
  ) : n;
3414
3427
  }
3415
- else throw we(t) ? new Error(
3428
+ else throw Be(t) ? new Error(
3416
3429
  `UrlContentFetcher not provided for URL: ${t}`
3417
3430
  ) : new Error(`Invalid blue value: ${t}`);
3418
3431
  }
@@ -3435,7 +3448,7 @@ ${n.message}`
3435
3448
  */
3436
3449
  handleAliasValue(e, t) {
3437
3450
  return e.setBlue(
3438
- new a().setBlueId(this.preprocessingAliases.get(t))
3451
+ new c().setBlueId(this.preprocessingAliases.get(t))
3439
3452
  ), e;
3440
3453
  }
3441
3454
  /**
@@ -3445,7 +3458,7 @@ ${n.message}`
3445
3458
  * @returns The modified node
3446
3459
  */
3447
3460
  handleBlueId(e, t) {
3448
- return e.setBlue(new a().setBlueId(t)), e;
3461
+ return e.setBlue(new c().setBlueId(t)), e;
3449
3462
  }
3450
3463
  /**
3451
3464
  * Fetches content from a URL
@@ -3515,7 +3528,7 @@ class Gs {
3515
3528
  this.fetchStrategy = e || zs;
3516
3529
  }
3517
3530
  validateUrl(e) {
3518
- if (!we(e))
3531
+ if (!Be(e))
3519
3532
  throw new Error(`Invalid URL: ${e}`);
3520
3533
  return !0;
3521
3534
  }
@@ -3646,7 +3659,7 @@ class Js {
3646
3659
  return this.resolve(e, K);
3647
3660
  }
3648
3661
  }
3649
- class Zs extends Js {
3662
+ class Ws extends Js {
3650
3663
  mergingProcessor;
3651
3664
  nodeProvider;
3652
3665
  /**
@@ -3655,7 +3668,7 @@ class Zs extends Js {
3655
3668
  * @param nodeProvider - The provider to use for resolving nodes
3656
3669
  */
3657
3670
  constructor(e, t) {
3658
- super(), this.mergingProcessor = e, this.nodeProvider = fe.wrap(t);
3671
+ super(), this.mergingProcessor = e, this.nodeProvider = he.wrap(t);
3659
3672
  }
3660
3673
  /**
3661
3674
  * Merges a source node into a target node with the given limits
@@ -3665,6 +3678,13 @@ class Zs extends Js {
3665
3678
  * @returns A new BlueNode with the merged content
3666
3679
  */
3667
3680
  merge(e, t, r) {
3681
+ return this.mergeWithContext(
3682
+ e,
3683
+ t,
3684
+ this.createResolutionContext(r)
3685
+ );
3686
+ }
3687
+ mergeWithContext(e, t, r) {
3668
3688
  if (p(t.getBlue()))
3669
3689
  throw new Error(
3670
3690
  'Document contains "blue" attribute. Preprocess document before merging.'
@@ -3672,13 +3692,10 @@ class Zs extends Js {
3672
3692
  let n = e;
3673
3693
  const i = t.getType();
3674
3694
  if (p(i)) {
3675
- const o = i.clone();
3676
- p(o.getBlueId()) && new ft(this.nodeProvider).extend(
3677
- o,
3678
- $e.withSinglePath("/")
3679
- );
3680
- const l = this.resolve(o, r), c = t.clone().setType(l);
3681
- return n = this.merge(n, o, r), this.mergeObject(n, c, r);
3695
+ const o = this.resolveTypeNode(i, r), l = o.cloneShallow().setType(void 0);
3696
+ n = this.mergeObject(n, l, r);
3697
+ const a = t.cloneShallow().setType(o);
3698
+ return this.mergeObject(n, a, r);
3682
3699
  }
3683
3700
  return this.mergeObject(n, t, r);
3684
3701
  }
@@ -3690,21 +3707,20 @@ class Zs extends Js {
3690
3707
  * @returns A new BlueNode with the merged content
3691
3708
  */
3692
3709
  mergeObject(e, t, r) {
3693
- let n = this.mergingProcessor.process(
3694
- e,
3710
+ const n = e.cloneShallow();
3711
+ let i = this.mergingProcessor.process(
3712
+ n,
3695
3713
  t,
3696
- this.nodeProvider
3714
+ r.nodeProvider
3697
3715
  );
3698
- const i = t.getItems();
3699
- p(i) && (n = this.mergeChildren(n, i, r));
3700
- const o = t.getProperties();
3701
- return p(o) && Object.entries(o).forEach(([l, c]) => {
3702
- r.shouldMergePathSegment(l, c) && (r.enterPathSegment(l, c), n = this.mergeProperty(n, l, c, r), r.exitPathSegment());
3703
- }), p(t.getBlueId()) && (n = n.clone().setBlueId(t.getBlueId())), this.mergingProcessor.postProcess && (n = this.mergingProcessor.postProcess(
3704
- n,
3716
+ const o = t.getItems();
3717
+ p(o) && (i = this.mergeChildren(i, o, r));
3718
+ const l = t.getProperties();
3719
+ return p(l) && (i = this.mergeProperties(i, l, r)), p(t.getBlueId()) && (i = i.cloneShallow().setBlueId(t.getBlueId())), this.mergingProcessor.postProcess && (i = this.mergingProcessor.postProcess(
3720
+ i,
3705
3721
  t,
3706
- this.nodeProvider
3707
- )), n;
3722
+ r.nodeProvider
3723
+ )), i;
3708
3724
  }
3709
3725
  /**
3710
3726
  * Merges child items from source into target
@@ -3716,56 +3732,69 @@ class Zs extends Js {
3716
3732
  mergeChildren(e, t, r) {
3717
3733
  const n = e.getItems();
3718
3734
  if (I(n)) {
3719
- const o = t.filter(
3720
- (l, c) => r.shouldMergePathSegment(String(c), l)
3721
- ).map((l) => {
3722
- r.enterPathSegment(String(t.indexOf(l)), l);
3723
- const c = this.resolve(l, r);
3724
- return r.exitPathSegment(), c;
3725
- });
3726
- return e.clone().setItems(o);
3735
+ const o = [];
3736
+ for (let l = 0; l < t.length; l++) {
3737
+ const a = t[l];
3738
+ if (r.limits.shouldMergePathSegment(String(l), a)) {
3739
+ this.enterPathSegment(r, String(l), a);
3740
+ try {
3741
+ const u = a.isResolved() && this.canReuseResolvedSubtree(r) ? a : this.resolveWithContext(a, r);
3742
+ o.push(u);
3743
+ } finally {
3744
+ this.exitPathSegment(r);
3745
+ }
3746
+ }
3747
+ }
3748
+ return e.cloneShallow().setItems(o);
3727
3749
  } else if (t.length < n.length)
3728
3750
  throw new Error(
3729
3751
  `Subtype of element must not have more items (${n.length}) than the element itself (${t.length}).`
3730
3752
  );
3731
3753
  const i = [...n];
3732
- for (let o = 0; o < t.length; o++) {
3733
- if (!r.shouldMergePathSegment(String(o), t[o]))
3734
- continue;
3735
- if (r.enterPathSegment(String(o), t[o]), o >= i.length) {
3736
- i.push(t[o]), r.exitPathSegment();
3737
- continue;
3754
+ for (let o = 0; o < t.length; o++)
3755
+ if (r.limits.shouldMergePathSegment(String(o), t[o])) {
3756
+ this.enterPathSegment(r, String(o), t[o]);
3757
+ try {
3758
+ if (o >= i.length) {
3759
+ i.push(t[o]);
3760
+ continue;
3761
+ }
3762
+ const l = T.calculateBlueIdSync(
3763
+ t[o]
3764
+ ), a = T.calculateBlueIdSync(
3765
+ i[o]
3766
+ );
3767
+ if (l !== a)
3768
+ throw new Error(
3769
+ `Mismatched items at index ${o}: source item has blueId '${l}', but target item has blueId '${a}'.`
3770
+ );
3771
+ } finally {
3772
+ this.exitPathSegment(r);
3773
+ }
3738
3774
  }
3739
- const l = T.calculateBlueIdSync(
3740
- t[o]
3741
- ), c = T.calculateBlueIdSync(
3742
- i[o]
3743
- );
3744
- if (l !== c)
3745
- throw new Error(
3746
- `Mismatched items at index ${o}: source item has blueId '${l}', but target item has blueId '${c}'.`
3747
- );
3748
- r.exitPathSegment();
3749
- }
3750
- return e.clone().setItems(i);
3775
+ return e.cloneShallow().setItems(i);
3751
3776
  }
3752
3777
  /**
3753
- * Merges a property from source into target
3778
+ * Merges source properties into target using copy-on-write for properties map
3754
3779
  * @param target - The target node
3755
- * @param sourceKey - The property key
3756
- * @param sourceValue - The property value to merge
3780
+ * @param sourceProperties - The properties to merge from source
3757
3781
  * @param limits - The limits to apply
3758
- * @returns A new BlueNode with the merged property
3759
- */
3760
- mergeProperty(e, t, r, n) {
3761
- const i = this.resolve(r, n), o = e.clone();
3762
- I(o.getProperties()) && o.setProperties({});
3763
- const l = o.getProperties()[t];
3764
- return l === void 0 ? o.getProperties()[t] = i : o.getProperties()[t] = this.mergeObject(
3765
- l,
3766
- i,
3767
- n
3768
- ), o;
3782
+ * @returns A new BlueNode with merged properties
3783
+ */
3784
+ mergeProperties(e, t, r) {
3785
+ const n = e.getProperties() ?? {};
3786
+ let i = n, o = !1;
3787
+ for (const [l, a] of Object.entries(t))
3788
+ if (r.limits.shouldMergePathSegment(l, a)) {
3789
+ this.enterPathSegment(r, l, a);
3790
+ try {
3791
+ const u = a.isResolved() && this.canReuseResolvedSubtree(r) ? a : this.resolveWithContext(a, r), y = i[l], d = y === void 0 ? u : this.mergeObject(y, u, r);
3792
+ d !== y && (o || (i = { ...n }, o = !0), i[l] = d);
3793
+ } finally {
3794
+ this.exitPathSegment(r);
3795
+ }
3796
+ }
3797
+ return o ? e.cloneShallow().setProperties(i) : e;
3769
3798
  }
3770
3799
  /**
3771
3800
  * Resolves a node by creating a new node and merging the source into it
@@ -3774,11 +3803,55 @@ class Zs extends Js {
3774
3803
  * @returns A ResolvedBlueNode containing the resolved content
3775
3804
  */
3776
3805
  resolve(e, t) {
3777
- const r = new a(), i = this.merge(r, e, t).clone().setName(e.getName()).setDescription(e.getDescription()).setBlueId(e.getBlueId());
3778
- return new pe(i);
3806
+ return this.resolveWithContext(e, this.createResolutionContext(t));
3807
+ }
3808
+ resolveWithContext(e, t) {
3809
+ const r = new c(), i = this.mergeWithContext(r, e, t).clone().setName(e.getName()).setDescription(e.getDescription()).setBlueId(e.getBlueId());
3810
+ return new ne(i);
3811
+ }
3812
+ createResolutionContext(e) {
3813
+ return {
3814
+ limits: e,
3815
+ nodeProvider: this.nodeProvider,
3816
+ resolvedTypeCache: /* @__PURE__ */ new Map(),
3817
+ pathStack: []
3818
+ };
3819
+ }
3820
+ resolveTypeNode(e, t) {
3821
+ const r = e.getBlueId();
3822
+ if (p(r)) {
3823
+ const n = this.createResolvedTypeCacheKey(r, t), i = t.resolvedTypeCache.get(n);
3824
+ if (p(i))
3825
+ return i;
3826
+ const o = this.resolveAndExtendTypeNode(e, t);
3827
+ return t.resolvedTypeCache.set(n, o), o;
3828
+ }
3829
+ return this.resolveAndExtendTypeNode(e, t);
3830
+ }
3831
+ resolveAndExtendTypeNode(e, t) {
3832
+ const r = e.clone();
3833
+ return p(r.getBlueId()) && new ft(t.nodeProvider).extend(
3834
+ r,
3835
+ $e.withSinglePath("/")
3836
+ ), this.resolveWithContext(r, t);
3837
+ }
3838
+ createResolvedTypeCacheKey(e, t) {
3839
+ return t.limits instanceof Xe ? e : `${e}|${this.getCurrentPointer(t)}`;
3840
+ }
3841
+ canReuseResolvedSubtree(e) {
3842
+ return e.limits instanceof Xe;
3843
+ }
3844
+ getCurrentPointer(e) {
3845
+ return e.pathStack.length === 0 ? "/" : `/${e.pathStack.join("/")}`;
3846
+ }
3847
+ enterPathSegment(e, t, r) {
3848
+ e.pathStack.push(t), e.limits.enterPathSegment(t, r);
3849
+ }
3850
+ exitPathSegment(e) {
3851
+ e.pathStack.pop(), e.limits.exitPathSegment();
3779
3852
  }
3780
3853
  }
3781
- class er {
3854
+ class tr {
3782
3855
  mergingProcessors;
3783
3856
  /**
3784
3857
  * Creates a new SequentialMergingProcessor with the given processors
@@ -3803,14 +3876,14 @@ class er {
3803
3876
  return this.mergingProcessors.reduce((n, i) => i.postProcess ? i.postProcess(n, t, r) : n, e);
3804
3877
  }
3805
3878
  }
3806
- class tr {
3879
+ class rr {
3807
3880
  process(e, t) {
3808
3881
  const r = t.getValue();
3809
3882
  if (p(r)) {
3810
3883
  const n = e.getValue();
3811
3884
  if (I(n))
3812
- return e.clone().setValue(r);
3813
- if (!Hs(r, n))
3885
+ return e.cloneShallow().setValue(r);
3886
+ if (!Zs(r, n))
3814
3887
  throw new Error(
3815
3888
  `Node values conflict. Source node value: ${r}, target node value: ${n}`
3816
3889
  );
@@ -3818,74 +3891,74 @@ class tr {
3818
3891
  return e;
3819
3892
  }
3820
3893
  }
3821
- const Hs = (s, e) => H(s) && H(e) || Ge(s) && Ge(e) ? s.eq(e) : s === e;
3822
- class rr {
3894
+ const Zs = (s, e) => Z(s) && Z(e) || Ge(s) && Ge(e) ? s.eq(e) : s === e;
3895
+ class sr {
3823
3896
  process(e, t, r) {
3824
3897
  const n = e.getType(), i = t.getType();
3825
3898
  let o = e;
3826
3899
  if (n === void 0)
3827
- o = e.clone().setType(i);
3900
+ o = e.cloneShallow().setType(i);
3828
3901
  else if (i !== void 0) {
3829
- if (!b(
3902
+ if (!w(
3830
3903
  i,
3831
3904
  n,
3832
3905
  r
3833
3906
  )) {
3834
- const c = m.get(i), u = m.get(n);
3907
+ const a = m.get(i), u = m.get(n);
3835
3908
  throw new Error(
3836
3909
  `The source type '${JSON.stringify(
3837
- c
3910
+ a
3838
3911
  )}' is not a subtype of the target type '${JSON.stringify(
3839
3912
  u
3840
3913
  )}'.`
3841
3914
  );
3842
3915
  }
3843
- o = e.clone().setType(i);
3916
+ o = e.cloneShallow().setType(i);
3844
3917
  }
3845
3918
  return o;
3846
3919
  }
3847
3920
  }
3848
- class sr {
3921
+ class nr {
3849
3922
  process(e, t, r) {
3850
3923
  const n = t.getItemType(), i = t.getType();
3851
- if (n !== void 0 && i !== void 0 && !Gt(i, r))
3924
+ if (n !== void 0 && i !== void 0 && !Jt(i, r))
3852
3925
  throw new Error("Source node with itemType must have a List type");
3853
3926
  const o = e.getItemType();
3854
3927
  let l = e;
3855
3928
  if (o === void 0)
3856
- n !== void 0 && (l = e.clone().setItemType(n));
3929
+ n !== void 0 && (l = e.cloneShallow().setItemType(n));
3857
3930
  else if (n !== void 0) {
3858
- if (!b(
3931
+ if (!w(
3859
3932
  n,
3860
3933
  o,
3861
3934
  r
3862
3935
  )) {
3863
- const d = m.get(n), h = m.get(o);
3936
+ const d = m.get(n), f = m.get(o);
3864
3937
  throw new Error(
3865
3938
  `The source item type '${JSON.stringify(
3866
3939
  d
3867
3940
  )}' is not a subtype of the target item type '${JSON.stringify(
3868
- h
3941
+ f
3869
3942
  )}'.`
3870
3943
  );
3871
3944
  }
3872
- l = e.clone().setItemType(n);
3945
+ l = e.cloneShallow().setItemType(n);
3873
3946
  }
3874
- const c = l.getItemType(), u = t.getItems();
3875
- if (c !== void 0 && u !== void 0)
3947
+ const a = l.getItemType(), u = t.getItems();
3948
+ if (a !== void 0 && u !== void 0)
3876
3949
  for (const y of u) {
3877
3950
  const d = y.getType();
3878
- if (d !== void 0 && !b(
3951
+ if (d !== void 0 && !w(
3879
3952
  d,
3880
- c,
3953
+ a,
3881
3954
  r
3882
3955
  )) {
3883
- const h = m.get(d), v = m.get(
3884
- c
3956
+ const f = m.get(d), v = m.get(
3957
+ a
3885
3958
  );
3886
3959
  throw new Error(
3887
3960
  `Item of type '${JSON.stringify(
3888
- h
3961
+ f
3889
3962
  )}' is not a subtype of the list's item type '${JSON.stringify(
3890
3963
  v
3891
3964
  )}'.`
@@ -3895,41 +3968,41 @@ class sr {
3895
3968
  return l;
3896
3969
  }
3897
3970
  }
3898
- class nr {
3971
+ class ir {
3899
3972
  process(e, t, r) {
3900
3973
  const n = t.getKeyType(), i = t.getValueType(), o = t.getType();
3901
- if ((n !== void 0 || i !== void 0) && o !== void 0 && !Jt(o, r))
3974
+ if ((n !== void 0 || i !== void 0) && o !== void 0 && !Wt(o, r))
3902
3975
  throw new Error(
3903
3976
  "Source node with keyType or valueType must have a Dictionary type"
3904
3977
  );
3905
3978
  let l = this.processKeyType(e, t, r);
3906
3979
  l = this.processValueType(l, t, r);
3907
- const c = l.getKeyType(), u = l.getValueType(), y = t.getProperties();
3908
- return (c !== void 0 || u !== void 0) && y !== void 0 && Object.entries(y).forEach(([d, h]) => {
3909
- c !== void 0 && this.validateKeyType(d, c, r), u !== void 0 && this.validateValueType(h, u, r);
3980
+ const a = l.getKeyType(), u = l.getValueType(), y = t.getProperties();
3981
+ return (a !== void 0 || u !== void 0) && y !== void 0 && Object.entries(y).forEach(([d, f]) => {
3982
+ a !== void 0 && this.validateKeyType(d, a, r), u !== void 0 && this.validateValueType(f, u, r);
3910
3983
  }), l;
3911
3984
  }
3912
3985
  processKeyType(e, t, r) {
3913
3986
  const n = e.getKeyType(), i = t.getKeyType();
3914
3987
  if (n === void 0) {
3915
3988
  if (i !== void 0)
3916
- return this.validateBasicKeyType(i, r), e.clone().setKeyType(i);
3989
+ return this.validateBasicKeyType(i, r), e.cloneShallow().setKeyType(i);
3917
3990
  } else if (i !== void 0) {
3918
- if (this.validateBasicKeyType(i, r), !b(
3991
+ if (this.validateBasicKeyType(i, r), !w(
3919
3992
  i,
3920
3993
  n,
3921
3994
  r
3922
3995
  )) {
3923
- const l = m.get(i), c = m.get(n);
3996
+ const l = m.get(i), a = m.get(n);
3924
3997
  throw new Error(
3925
3998
  `The source key type '${JSON.stringify(
3926
3999
  l
3927
4000
  )}' is not a subtype of the target key type '${JSON.stringify(
3928
- c
4001
+ a
3929
4002
  )}'.`
3930
4003
  );
3931
4004
  }
3932
- return e.clone().setKeyType(i);
4005
+ return e.cloneShallow().setKeyType(i);
3933
4006
  }
3934
4007
  return e;
3935
4008
  }
@@ -3937,41 +4010,41 @@ class nr {
3937
4010
  const n = e.getValueType(), i = t.getValueType();
3938
4011
  if (n === void 0) {
3939
4012
  if (i !== void 0)
3940
- return e.clone().setValueType(i);
4013
+ return e.cloneShallow().setValueType(i);
3941
4014
  } else if (i !== void 0) {
3942
- if (!b(
4015
+ if (!w(
3943
4016
  i,
3944
4017
  n,
3945
4018
  r
3946
4019
  )) {
3947
- const l = m.get(i), c = m.get(n);
4020
+ const l = m.get(i), a = m.get(n);
3948
4021
  throw new Error(
3949
4022
  `The source value type '${JSON.stringify(
3950
4023
  l
3951
4024
  )}' is not a subtype of the target value type '${JSON.stringify(
3952
- c
4025
+ a
3953
4026
  )}'.`
3954
4027
  );
3955
4028
  }
3956
- return e.clone().setValueType(i);
4029
+ return e.cloneShallow().setValueType(i);
3957
4030
  }
3958
4031
  return e;
3959
4032
  }
3960
4033
  validateBasicKeyType(e, t) {
3961
- if (!ss(e, t))
4034
+ if (!ns(e, t))
3962
4035
  throw new Error("Dictionary key type must be a basic type");
3963
4036
  }
3964
4037
  validateKeyType(e, t, r) {
3965
- if (!ns(t, r))
3966
- if (is(t, r)) {
4038
+ if (!is(t, r))
4039
+ if (os(t, r)) {
3967
4040
  const n = Number.parseInt(e, 10);
3968
4041
  if (Number.isNaN(n) || n.toString() !== e)
3969
4042
  throw new Error(`Key '${e}' is not a valid Integer.`);
3970
- } else if (os(t, r)) {
4043
+ } else if (ls(t, r)) {
3971
4044
  const n = Number.parseFloat(e);
3972
4045
  if (Number.isNaN(n))
3973
4046
  throw new Error(`Key '${e}' is not a valid Number.`);
3974
- } else if (ls(t, r)) {
4047
+ } else if (as(t, r)) {
3975
4048
  if (e.toLowerCase() !== "true" && e.toLowerCase() !== "false")
3976
4049
  throw new Error(`Key '${e}' is not a valid Boolean.`);
3977
4050
  } else
@@ -3981,7 +4054,7 @@ class nr {
3981
4054
  }
3982
4055
  validateValueType(e, t, r) {
3983
4056
  const n = e.getType();
3984
- if (n !== void 0 && !b(n, t, r)) {
4057
+ if (n !== void 0 && !w(n, t, r)) {
3985
4058
  const i = m.get(n), o = m.get(t);
3986
4059
  throw new Error(
3987
4060
  `Value of type '${JSON.stringify(
@@ -3993,7 +4066,7 @@ class nr {
3993
4066
  }
3994
4067
  }
3995
4068
  }
3996
- class ir {
4069
+ class or {
3997
4070
  process(e) {
3998
4071
  return e;
3999
4072
  }
@@ -4002,45 +4075,45 @@ class ir {
4002
4075
  if (n !== void 0 && cs(n, r)) {
4003
4076
  const i = e.getItems(), o = e.getProperties();
4004
4077
  if (i !== void 0 && i.length > 0 || o !== void 0 && Object.keys(o).length > 0) {
4005
- const l = as(
4078
+ const l = us(
4006
4079
  n,
4007
4080
  r
4008
- ), c = n.getName() || "unknown";
4081
+ ), a = n.getName() || "unknown";
4009
4082
  throw new Error(
4010
- `Node of type "${c}" (which extends basic type "${l}") must not have items, properties or contracts.`
4083
+ `Node of type "${a}" (which extends basic type "${l}") must not have items, properties or contracts.`
4011
4084
  );
4012
4085
  }
4013
4086
  }
4014
4087
  return e;
4015
4088
  }
4016
4089
  }
4017
- class or {
4090
+ class lr {
4018
4091
  process(e, t) {
4019
4092
  let r = e;
4020
4093
  const n = t.getName(), i = e.getName();
4021
- n !== void 0 && i === void 0 && (r = r.clone().setName(n));
4094
+ n !== void 0 && i === void 0 && (r = r.cloneShallow().setName(n));
4022
4095
  const o = t.getDescription(), l = r.getDescription();
4023
- return o !== void 0 && l === void 0 && (r = r.clone().setDescription(o)), r;
4096
+ return o !== void 0 && l === void 0 && (r = r.cloneShallow().setDescription(o)), r;
4024
4097
  }
4025
4098
  }
4026
4099
  const ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4027
4100
  __proto__: null,
4028
- BasicTypesVerifier: ir,
4029
- DictionaryProcessor: nr,
4030
- ListProcessor: sr,
4031
- MetadataPropagator: or,
4032
- SequentialMergingProcessor: er,
4033
- TypeAssigner: rr,
4034
- ValuePropagator: tr
4101
+ BasicTypesVerifier: or,
4102
+ DictionaryProcessor: ir,
4103
+ ListProcessor: nr,
4104
+ MetadataPropagator: lr,
4105
+ SequentialMergingProcessor: tr,
4106
+ TypeAssigner: sr,
4107
+ ValuePropagator: rr
4035
4108
  }, Symbol.toStringTag, { value: "Module" }));
4036
- function Ws() {
4037
- return new er([
4038
- new tr(),
4109
+ function Hs() {
4110
+ return new tr([
4039
4111
  new rr(),
4040
4112
  new sr(),
4041
4113
  new nr(),
4042
- new or(),
4043
- new ir()
4114
+ new ir(),
4115
+ new lr(),
4116
+ new or()
4044
4117
  ]);
4045
4118
  }
4046
4119
  class Xs {
@@ -4060,7 +4133,7 @@ class Xs {
4060
4133
  * Returns a new BlueNode where all type references are restored to inline values when possible.
4061
4134
  */
4062
4135
  restore(e) {
4063
- return w.transform(
4136
+ return B.transform(
4064
4137
  e,
4065
4138
  (t) => this.restoreNode(t)
4066
4139
  );
@@ -4094,7 +4167,7 @@ class Xs {
4094
4167
  const o = this.resolveInlineValue(i, n);
4095
4168
  if (!o)
4096
4169
  return;
4097
- const l = new a().setValue(o).setInlineValue(!0);
4170
+ const l = new c().setValue(o).setInlineValue(!0);
4098
4171
  r(l);
4099
4172
  }
4100
4173
  resolveInlineValue(e, t) {
@@ -4222,7 +4295,7 @@ function sn(s, e, t) {
4222
4295
  r,
4223
4296
  t.name
4224
4297
  );
4225
- if (s.types[r] = i, s.typePackageByCurrentBlueId[r] = t.name, s.typeAliasByCurrentBlueId[r] = `${t.name}/${n.name}`, i.status === le && !s.toCurrentBlueIdIndex[r] && (s.toCurrentBlueIdIndex[r] = r), i.status === le)
4298
+ if (s.types[r] = i, s.typePackageByCurrentBlueId[r] = t.name, s.typeAliasByCurrentBlueId[r] = `${t.name}/${n.name}`, i.status === ae && !s.toCurrentBlueIdIndex[r] && (s.toCurrentBlueIdIndex[r] = r), i.status === ae)
4226
4299
  for (const o of i.versions) {
4227
4300
  const l = s.toCurrentBlueIdIndex[o.typeBlueId];
4228
4301
  if (l && l !== r)
@@ -4242,8 +4315,8 @@ function on(s, e) {
4242
4315
  s.schemas.push(...Object.values(e.schemas));
4243
4316
  }
4244
4317
  function ln(s, e, t, r) {
4245
- if (s.status === tt)
4246
- return cn(s, e, t, r), {
4318
+ if (s.status === rt)
4319
+ return an(s, e, t, r), {
4247
4320
  ...s,
4248
4321
  versions: s.versions ? [...s.versions] : s.versions
4249
4322
  };
@@ -4266,7 +4339,7 @@ function ln(s, e, t, r) {
4266
4339
  );
4267
4340
  i.add(o.repositoryVersionIndex);
4268
4341
  for (const l of o.attributesAdded ?? [])
4269
- an(
4342
+ cn(
4270
4343
  l,
4271
4344
  e.name,
4272
4345
  t,
@@ -4277,8 +4350,8 @@ function ln(s, e, t, r) {
4277
4350
  versions: n
4278
4351
  };
4279
4352
  }
4280
- function cn(s, e, t, r) {
4281
- if (s.status === tt) {
4353
+ function an(s, e, t, r) {
4354
+ if (s.status === rt) {
4282
4355
  if (s.versions && s.versions.length > 1)
4283
4356
  throw new Error(
4284
4357
  `Dev type ${r}/${s.name} (${t}) must not declare multiple versions`
@@ -4292,9 +4365,9 @@ function cn(s, e, t, r) {
4292
4365
  }
4293
4366
  }
4294
4367
  }
4295
- function an(s, e, t, r) {
4368
+ function cn(s, e, t, r) {
4296
4369
  try {
4297
- Tr(s);
4370
+ vr(s);
4298
4371
  } catch (n) {
4299
4372
  const i = n instanceof Error ? n.message : "Unknown error";
4300
4373
  throw new Error(
@@ -4343,22 +4416,22 @@ const D = {
4343
4416
  REPO_UNREPRESENTABLE_IN_TARGET_VERSION: "REPO_UNREPRESENTABLE_IN_TARGET_VERSION",
4344
4417
  INVALID_BLUE_CONTEXT_REPOSITORIES: "INVALID_BLUE_CONTEXT_REPOSITORIES",
4345
4418
  INVALID_REPOSITORY_POINTER: "INVALID_REPOSITORY_POINTER"
4346
- }, fn = /* @__PURE__ */ new Set([
4419
+ }, hn = /* @__PURE__ */ new Set([
4347
4420
  "__proto__",
4348
4421
  "constructor",
4349
4422
  "prototype"
4350
4423
  ]);
4351
- function bt(s) {
4424
+ function Bt(s) {
4352
4425
  const e = s.at(0), t = s.at(-1);
4353
4426
  return !e || !t ? s : e === "'" && t === "'" || e === '"' && t === '"' ? s.slice(1, -1) : s;
4354
4427
  }
4355
- function hn(s, e) {
4428
+ function fn(s, e) {
4356
4429
  const t = s.indexOf("=");
4357
4430
  if (t === -1)
4358
4431
  throw re(e, `Missing '=' in segment '${s.trim()}'`);
4359
4432
  if (s.indexOf("=", t + 1) !== -1)
4360
4433
  throw re(e, `Unexpected '=' in segment '${s.trim()}'`);
4361
- const r = bt(s.slice(0, t).trim()), n = bt(s.slice(t + 1).trim());
4434
+ const r = Bt(s.slice(0, t).trim()), n = Bt(s.slice(t + 1).trim());
4362
4435
  if (!r)
4363
4436
  throw re(e, "Repository name is empty");
4364
4437
  if (!n)
@@ -4373,7 +4446,7 @@ function yn(s) {
4373
4446
  const r = t.trim();
4374
4447
  if (!r)
4375
4448
  throw re(s, "Empty repository segment");
4376
- const { name: n, value: i } = hn(r, s);
4449
+ const { name: n, value: i } = fn(r, s);
4377
4450
  mn(n, s), e[n] = i;
4378
4451
  }
4379
4452
  return e;
@@ -4399,23 +4472,23 @@ function re(s, e) {
4399
4472
  );
4400
4473
  }
4401
4474
  function mn(s, e) {
4402
- if (fn.has(s))
4475
+ if (hn.has(s))
4403
4476
  throw re(e, `Forbidden repository name '${s}'`);
4404
4477
  }
4405
4478
  function In(s, e) {
4406
4479
  const t = s.filter((n) => n.repositoryVersionIndex > e).sort((n, i) => i.repositoryVersionIndex - n.repositoryVersionIndex), r = [];
4407
4480
  for (const n of t) {
4408
4481
  const i = [...n.attributesAdded].sort(
4409
- (o, l) => wt(l) - wt(o)
4482
+ (o, l) => Et(l) - Et(o)
4410
4483
  );
4411
4484
  r.push(...i);
4412
4485
  }
4413
4486
  return r;
4414
4487
  }
4415
- function wt(s) {
4416
- return Rt(s).length;
4488
+ function Et(s) {
4489
+ return Ot(s).length;
4417
4490
  }
4418
- const Tn = /* @__PURE__ */ new Set([...rt]), B = {
4491
+ const Tn = /* @__PURE__ */ new Set([...st]), b = {
4419
4492
  core: "core",
4420
4493
  noRuntime: "no-runtime",
4421
4494
  noTargetContext: "no-target-context",
@@ -4431,7 +4504,7 @@ class vn {
4431
4504
  this.registry = e.registry, this.targetRepoVersionIndexes = e.targetRepoVersionIndexes, this.fallbackToCurrentInlineDefinitions = e.fallbackToCurrentInlineDefinitions;
4432
4505
  }
4433
4506
  transform(e) {
4434
- return w.transform(
4507
+ return B.transform(
4435
4508
  e,
4436
4509
  (t) => this.transformNode(t)
4437
4510
  );
@@ -4461,11 +4534,11 @@ class vn {
4461
4534
  return;
4462
4535
  const i = this.resolveType(n);
4463
4536
  switch (i.kind) {
4464
- case B.core: {
4537
+ case b.core: {
4465
4538
  r.setBlueId(i.blueId);
4466
4539
  return;
4467
4540
  }
4468
- case B.representable: {
4541
+ case b.representable: {
4469
4542
  this.applyDropPointers([r], i.dropPointers, {
4470
4543
  rootIsSchema: !0
4471
4544
  }), this.applyDropPointers(
@@ -4474,34 +4547,34 @@ class vn {
4474
4547
  ), r.setBlueId(i.targetBlueId);
4475
4548
  return;
4476
4549
  }
4477
- case B.noRuntime:
4478
- case B.noTargetContext:
4479
- case B.unrepresentable: {
4550
+ case b.noRuntime:
4551
+ case b.noTargetContext:
4552
+ case b.unrepresentable: {
4480
4553
  if (this.fallbackToCurrentInlineDefinitions) {
4481
4554
  this.inlineDefinition(e, t.setter, n);
4482
4555
  return;
4483
4556
  }
4484
- throw i.kind === B.unrepresentable ? i.error : this.unrepresentableError(
4557
+ throw i.kind === b.unrepresentable ? i.error : this.unrepresentableError(
4485
4558
  n,
4486
- i.kind === B.noTargetContext ? `Repository '${i.runtimeName}' not provided in BlueContext.` : "Type does not belong to any declared repository.",
4487
- i.kind === B.noTargetContext ? i.runtime : void 0,
4488
- i.kind === B.noTargetContext ? i.meta : void 0,
4559
+ i.kind === b.noTargetContext ? `Repository '${i.runtimeName}' not provided in BlueContext.` : "Type does not belong to any declared repository.",
4560
+ i.kind === b.noTargetContext ? i.runtime : void 0,
4561
+ i.kind === b.noTargetContext ? i.meta : void 0,
4489
4562
  void 0,
4490
- i.kind === B.noTargetContext ? i.typeAlias : void 0
4563
+ i.kind === b.noTargetContext ? i.typeAlias : void 0
4491
4564
  );
4492
4565
  }
4493
4566
  }
4494
4567
  }
4495
4568
  resolveType(e) {
4496
4569
  if (X.includes(e))
4497
- return { kind: B.core, blueId: e };
4570
+ return { kind: b.core, blueId: e };
4498
4571
  const t = this.registry.toCurrentBlueId(e), r = this.registry.getTypeAlias(t), n = this.registry.findRuntimeByBlueId(t);
4499
4572
  if (!n || !n.typeMeta)
4500
- return { kind: B.noRuntime };
4573
+ return { kind: b.noRuntime };
4501
4574
  const i = this.targetRepoVersionIndexes[n.runtime.name];
4502
4575
  if (i === void 0)
4503
4576
  return {
4504
- kind: B.noTargetContext,
4577
+ kind: b.noTargetContext,
4505
4578
  currentBlueId: t,
4506
4579
  runtimeName: n.runtime.name,
4507
4580
  runtime: n.runtime,
@@ -4509,11 +4582,11 @@ class vn {
4509
4582
  typeAlias: r
4510
4583
  };
4511
4584
  const o = n.typeMeta;
4512
- if (o.status === tt) {
4585
+ if (o.status === rt) {
4513
4586
  const d = n.runtime.repositoryVersions.length - 1;
4514
4587
  if (i !== d)
4515
4588
  return {
4516
- kind: B.unrepresentable,
4589
+ kind: b.unrepresentable,
4517
4590
  currentBlueId: t,
4518
4591
  error: this.unrepresentableError(
4519
4592
  t,
@@ -4524,18 +4597,18 @@ class vn {
4524
4597
  r
4525
4598
  )
4526
4599
  };
4527
- const h = o.versions?.[0];
4600
+ const f = o.versions?.[0];
4528
4601
  return {
4529
- kind: B.representable,
4602
+ kind: b.representable,
4530
4603
  currentBlueId: t,
4531
- targetBlueId: h?.typeBlueId ?? t,
4604
+ targetBlueId: f?.typeBlueId ?? t,
4532
4605
  dropPointers: []
4533
4606
  };
4534
4607
  }
4535
4608
  const l = o.versions || [];
4536
4609
  if (l.length === 0)
4537
4610
  return {
4538
- kind: B.unrepresentable,
4611
+ kind: b.unrepresentable,
4539
4612
  currentBlueId: t,
4540
4613
  error: this.unrepresentableError(
4541
4614
  t,
@@ -4546,10 +4619,10 @@ class vn {
4546
4619
  r
4547
4620
  )
4548
4621
  };
4549
- const c = l[0].repositoryVersionIndex;
4550
- if (i < c)
4622
+ const a = l[0].repositoryVersionIndex;
4623
+ if (i < a)
4551
4624
  return {
4552
- kind: B.unrepresentable,
4625
+ kind: b.unrepresentable,
4553
4626
  currentBlueId: t,
4554
4627
  error: this.unrepresentableError(
4555
4628
  t,
@@ -4563,16 +4636,16 @@ class vn {
4563
4636
  let u = l[0].typeBlueId;
4564
4637
  for (const d of l)
4565
4638
  d.repositoryVersionIndex <= i && (u = d.typeBlueId);
4566
- const y = o.status === le ? this.getDropPointers(o, i) : [];
4639
+ const y = o.status === ae ? this.getDropPointers(o, i) : [];
4567
4640
  return {
4568
- kind: B.representable,
4641
+ kind: b.representable,
4569
4642
  currentBlueId: t,
4570
4643
  targetBlueId: u,
4571
4644
  dropPointers: y
4572
4645
  };
4573
4646
  }
4574
4647
  getDropPointers(e, t) {
4575
- return e.status !== le ? [] : In(e.versions, t);
4648
+ return e.status !== ae ? [] : In(e.versions, t);
4576
4649
  }
4577
4650
  applyDropPointers(e, t, r = {}) {
4578
4651
  if (e.length === 0 || t.length === 0)
@@ -4585,13 +4658,13 @@ class vn {
4585
4658
  getDictionaryValueTargets(e) {
4586
4659
  const t = e.getProperties();
4587
4660
  return t ? Object.entries(t).filter(
4588
- ([r, n]) => n instanceof a && !Tn.has(r)
4661
+ ([r, n]) => n instanceof c && !Tn.has(r)
4589
4662
  ).map(([, r]) => r) : [];
4590
4663
  }
4591
4664
  deletePropertyAtPointer(e, t, r) {
4592
4665
  let n;
4593
4666
  try {
4594
- n = Rt(t);
4667
+ n = Ot(t);
4595
4668
  } catch {
4596
4669
  throw this.invalidPointerError(t);
4597
4670
  }
@@ -4601,24 +4674,24 @@ class vn {
4601
4674
  if (t.length === 0)
4602
4675
  return;
4603
4676
  const [n, ...i] = t;
4604
- if (n === Z) {
4605
- const c = e.getType();
4606
- c && this.applyPointerSegments(c, i, !0);
4677
+ if (n === W) {
4678
+ const a = e.getType();
4679
+ a && this.applyPointerSegments(a, i, !0);
4607
4680
  return;
4608
4681
  }
4609
- if (n === he) {
4610
- const c = e.getItemType();
4611
- c && this.applyPointerSegments(c, i, !0);
4682
+ if (n === fe) {
4683
+ const a = e.getItemType();
4684
+ a && this.applyPointerSegments(a, i, !0);
4612
4685
  return;
4613
4686
  }
4614
4687
  if (n === ye) {
4615
- const c = e.getKeyType();
4616
- c && this.applyPointerSegments(c, i, !0);
4688
+ const a = e.getKeyType();
4689
+ a && this.applyPointerSegments(a, i, !0);
4617
4690
  return;
4618
4691
  }
4619
4692
  if (n === ge) {
4620
- const c = e.getValueType();
4621
- c && this.applyPointerSegments(c, i, !0);
4693
+ const a = e.getValueType();
4694
+ a && this.applyPointerSegments(a, i, !0);
4622
4695
  return;
4623
4696
  }
4624
4697
  const o = e.getProperties();
@@ -4627,12 +4700,12 @@ class vn {
4627
4700
  if (i.length === 0) {
4628
4701
  if (!r || !(n in o))
4629
4702
  return;
4630
- const c = { ...o };
4631
- delete c[n], e.setProperties(c);
4703
+ const a = { ...o };
4704
+ delete a[n], e.setProperties(a);
4632
4705
  return;
4633
4706
  }
4634
4707
  const l = o[n];
4635
- l instanceof a && this.applyPointerSegments(l, i, r);
4708
+ l instanceof c && this.applyPointerSegments(l, i, r);
4636
4709
  }
4637
4710
  inlineDefinition(e, t, r) {
4638
4711
  const n = this.registry.toCurrentBlueId(r);
@@ -4658,9 +4731,9 @@ class vn {
4658
4731
  try {
4659
4732
  const o = g.deserialize(i);
4660
4733
  o.setBlueId(void 0);
4661
- const l = w.transform(
4734
+ const l = B.transform(
4662
4735
  o,
4663
- (c) => this.transformNode(c)
4736
+ (a) => this.transformNode(a)
4664
4737
  );
4665
4738
  return t(l), e;
4666
4739
  } finally {
@@ -4679,21 +4752,21 @@ class vn {
4679
4752
  ]);
4680
4753
  }
4681
4754
  unrepresentableError(e, t, r, n, i, o, l) {
4682
- const c = {
4755
+ const a = {
4683
4756
  currentTypeBlueId: e,
4684
4757
  targetRepoVersionIndex: i,
4685
4758
  typeAlias: o,
4686
4759
  ...l
4687
4760
  };
4688
- if (r && (i !== void 0 && (c.requestedRepoBlueId = r.repositoryVersions[i]), c.serverRepoBlueId = r.currentRepoBlueId), n && n.status === le) {
4761
+ if (r && (i !== void 0 && (a.requestedRepoBlueId = r.repositoryVersions[i]), a.serverRepoBlueId = r.currentRepoBlueId), n && n.status === ae) {
4689
4762
  const y = n.versions?.[0]?.repositoryVersionIndex;
4690
- y !== void 0 && (c.typeIntroducedInRepoBlueId = r?.repositoryVersions[y]);
4763
+ y !== void 0 && (a.typeIntroducedInRepoBlueId = r?.repositoryVersions[y]);
4691
4764
  }
4692
4765
  const u = {
4693
4766
  code: D.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
4694
4767
  message: t,
4695
- locationPath: [Z],
4696
- context: c
4768
+ locationPath: [W],
4769
+ context: a
4697
4770
  };
4698
4771
  return new Re(
4699
4772
  D.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
@@ -4702,8 +4775,8 @@ class vn {
4702
4775
  );
4703
4776
  }
4704
4777
  }
4705
- function Xe(s, e) {
4706
- return e ? w.transform(s, (t) => (ve(
4778
+ function qe(s, e) {
4779
+ return e ? B.transform(s, (t) => (ve(
4707
4780
  () => t.getType(),
4708
4781
  (r) => t.setType(r),
4709
4782
  e
@@ -4731,7 +4804,7 @@ function ve(s, e, t) {
4731
4804
  const i = t.toCurrentBlueId(n);
4732
4805
  i !== n && e(r.clone().setBlueId(i));
4733
4806
  }
4734
- class Bn {
4807
+ class bn {
4735
4808
  registry;
4736
4809
  blueIdMapper;
4737
4810
  constructor(e) {
@@ -4741,7 +4814,7 @@ class Bn {
4741
4814
  const r = this.computeTargetRepoVersionIndexes(t);
4742
4815
  if (Object.keys(r).length === 0)
4743
4816
  return e;
4744
- const n = Xe(e, this.blueIdMapper);
4817
+ const n = qe(e, this.blueIdMapper);
4745
4818
  return new vn({
4746
4819
  registry: this.registry,
4747
4820
  targetRepoVersionIndexes: r,
@@ -4803,24 +4876,24 @@ class ri {
4803
4876
  repositories: i,
4804
4877
  mergingProcessor: o
4805
4878
  } = e;
4806
- this.repositories = i, this.repositoryRegistry = new qs(i ?? []), this.blueContextResolver = new Bn({
4879
+ this.repositories = i, this.repositoryRegistry = new qs(i ?? []), this.blueContextResolver = new bn({
4807
4880
  registry: this.repositoryRegistry,
4808
4881
  blueIdMapper: this.repositoryRegistry
4809
4882
  });
4810
4883
  const l = Ps(() => []);
4811
- this.nodeProvider = fe.wrap(
4884
+ this.nodeProvider = he.wrap(
4812
4885
  t || l,
4813
4886
  i
4814
- ), this.typeSchemaResolver = r ?? new us([], {
4887
+ ), this.typeSchemaResolver = r ?? new ds([], {
4815
4888
  nodeProvider: this.nodeProvider
4816
- }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.mergingProcessor = o ?? Ws(), this.urlContentFetcher = new Gs(n), this.blueDirectivePreprocessor = new Ys(
4889
+ }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.mergingProcessor = o ?? Hs(), this.urlContentFetcher = new Gs(n), this.blueDirectivePreprocessor = new Ys(
4817
4890
  void 0,
4818
4891
  this.urlContentFetcher
4819
- ), this.blueIdsMappingGenerator = new ht(), this.blueIdsMappingGenerator.registerBlueIds(
4892
+ ), this.blueIdsMappingGenerator = new yt(), this.blueIdsMappingGenerator.registerBlueIds(
4820
4893
  this.repositoryRegistry.getAliases()
4821
4894
  );
4822
- const c = this.repositoryRegistry.getRuntimes().flatMap((u) => u.schemas);
4823
- c.length > 0 && this.typeSchemaResolver?.registerSchemas(c);
4895
+ const a = this.repositoryRegistry.getRuntimes().flatMap((u) => u.schemas);
4896
+ a.length > 0 && this.typeSchemaResolver?.registerSchemas(a);
4824
4897
  }
4825
4898
  /**
4826
4899
  * Converts a BlueNode to a JSON representation based on the specified strategy.
@@ -4846,7 +4919,7 @@ class ri {
4846
4919
  }
4847
4920
  resolve(e, t = K) {
4848
4921
  const r = this.combineWithGlobalLimits(t);
4849
- return new Zs(this.mergingProcessor, this.nodeProvider).resolve(e, r);
4922
+ return new Ws(this.mergingProcessor, this.nodeProvider).resolve(e, r);
4850
4923
  }
4851
4924
  /**
4852
4925
  * Wraps an already resolved (merged) BlueNode in a ResolvedBlueNode.
@@ -4857,7 +4930,7 @@ class ri {
4857
4930
  * @returns A new ResolvedBlueNode instance.
4858
4931
  */
4859
4932
  createResolvedNode(e) {
4860
- return e instanceof pe ? e : new pe(e);
4933
+ return e instanceof ne ? e : new ne(e);
4861
4934
  }
4862
4935
  reverse(e) {
4863
4936
  return new Ht().reverse(e);
@@ -4881,13 +4954,13 @@ class ri {
4881
4954
  }
4882
4955
  jsonValueToNode(e) {
4883
4956
  const t = this.preprocess(g.deserialize(e));
4884
- return Xe(t, this.repositoryRegistry);
4957
+ return qe(t, this.repositoryRegistry);
4885
4958
  }
4886
4959
  async jsonValueToNodeAsync(e) {
4887
4960
  const t = await this.preprocessAsync(
4888
4961
  g.deserialize(e)
4889
4962
  );
4890
- return Xe(t, this.repositoryRegistry);
4963
+ return qe(t, this.repositoryRegistry);
4891
4964
  }
4892
4965
  yamlToNode(e) {
4893
4966
  const t = $(e);
@@ -4901,14 +4974,14 @@ class ri {
4901
4974
  throw new Error("Failed to parse YAML to JSON");
4902
4975
  return this.jsonValueToNodeAsync(t);
4903
4976
  }
4904
- prepareForBlueIdCalculation = async (e) => e instanceof a || Array.isArray(e) && e.every((t) => t instanceof a) ? e : Array.isArray(e) ? await Promise.all(
4977
+ prepareForBlueIdCalculation = async (e) => e instanceof c || Array.isArray(e) && e.every((t) => t instanceof c) ? e : Array.isArray(e) ? await Promise.all(
4905
4978
  e.map((r) => this.jsonValueToNodeAsync(r))
4906
4979
  ) : this.jsonValueToNodeAsync(e);
4907
4980
  calculateBlueId = async (e) => {
4908
4981
  const t = await this.prepareForBlueIdCalculation(e);
4909
4982
  return T.calculateBlueId(t);
4910
4983
  };
4911
- prepareForBlueIdCalculationSync = (e) => e instanceof a || Array.isArray(e) && e.every((t) => t instanceof a) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e);
4984
+ prepareForBlueIdCalculationSync = (e) => e instanceof c || Array.isArray(e) && e.every((t) => t instanceof c) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e);
4912
4985
  calculateBlueIdSync(e) {
4913
4986
  const t = this.prepareForBlueIdCalculationSync(e);
4914
4987
  return T.calculateBlueIdSync(t);
@@ -4918,26 +4991,26 @@ class ri {
4918
4991
  }
4919
4992
  preprocess(e) {
4920
4993
  const t = this.blueDirectivePreprocessor.process(e);
4921
- return new ne({
4994
+ return new ie({
4922
4995
  nodeProvider: this.nodeProvider,
4923
4996
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
4924
4997
  }).preprocessWithDefaultBlue(t);
4925
4998
  }
4926
4999
  async preprocessAsync(e) {
4927
5000
  const t = await this.blueDirectivePreprocessor.processAsync(e);
4928
- return new ne({
5001
+ return new ie({
4929
5002
  nodeProvider: this.nodeProvider,
4930
5003
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
4931
5004
  }).preprocessWithDefaultBlue(t);
4932
5005
  }
4933
5006
  transform(e, t) {
4934
- return w.transform(e, t);
5007
+ return B.transform(e, t);
4935
5008
  }
4936
5009
  getNodeProvider() {
4937
5010
  return this.nodeProvider;
4938
5011
  }
4939
5012
  setNodeProvider(e) {
4940
- return this.nodeProvider = fe.wrap(
5013
+ return this.nodeProvider = he.wrap(
4941
5014
  e,
4942
5015
  this.repositories
4943
5016
  ), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this;
@@ -5061,7 +5134,7 @@ class ri {
5061
5134
  * @returns true if the node matches the schema type, false otherwise
5062
5135
  */
5063
5136
  isTypeOf(e, t, r) {
5064
- return V.isTypeOf(e, t, {
5137
+ return A.isTypeOf(e, t, {
5065
5138
  checkSchemaExtensions: r?.checkSchemaExtensions,
5066
5139
  typeSchemaResolver: this.typeSchemaResolver
5067
5140
  });
@@ -5080,8 +5153,8 @@ class ri {
5080
5153
  const n = e.getType();
5081
5154
  if (!n)
5082
5155
  return !1;
5083
- const i = new a().setBlueId(r);
5084
- return b(n, i, this.nodeProvider);
5156
+ const i = new c().setBlueId(r);
5157
+ return w(n, i, this.nodeProvider);
5085
5158
  }
5086
5159
  /**
5087
5160
  * Checks if a BlueNode matches a BlueNode type.
@@ -5121,17 +5194,17 @@ class ri {
5121
5194
  return this.globalLimits == K ? e : e == K ? this.globalLimits : _e.of(this.globalLimits, e);
5122
5195
  }
5123
5196
  }
5124
- class si extends qt {
5197
+ class si extends Qt {
5125
5198
  blueIdToContentMap = /* @__PURE__ */ new Map();
5126
5199
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
5127
5200
  preprocessor;
5128
5201
  constructor(e = []) {
5129
5202
  super();
5130
- const t = new ne({ nodeProvider: this });
5203
+ const t = new ie({ nodeProvider: this });
5131
5204
  this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), e.forEach((r) => this.processNode(r));
5132
5205
  }
5133
5206
  processNode(e) {
5134
- ut.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
5207
+ dt.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
5135
5208
  }
5136
5209
  processSingleNode(e) {
5137
5210
  const t = z.parseAndCalculateBlueIdForNode(
@@ -5248,22 +5321,22 @@ class si extends qt {
5248
5321
  }
5249
5322
  }
5250
5323
  export {
5251
- Mr as Base58Sha256Provider,
5324
+ xr as Base58Sha256Provider,
5252
5325
  si as BasicNodeProvider,
5253
5326
  ri as Blue,
5254
5327
  T as BlueIdCalculator,
5255
5328
  kn as BlueIdToCid,
5256
- a as BlueNode,
5257
- V as BlueNodeTypeSchema,
5329
+ c as BlueNode,
5330
+ A as BlueNodeTypeSchema,
5258
5331
  Je as JsonCanonicalizer,
5259
- dt as Limits,
5260
- Zs as Merger,
5332
+ pt as Limits,
5333
+ Ws as Merger,
5261
5334
  ti as MergingProcessors,
5262
5335
  Js as NodeResolver,
5263
- ut as Nodes,
5336
+ dt as Nodes,
5264
5337
  On as Properties,
5265
- pe as ResolvedBlueNode,
5266
- us as TypeSchemaResolver,
5338
+ ne as ResolvedBlueNode,
5339
+ ds as TypeSchemaResolver,
5267
5340
  Kn as applyBlueNodePatch,
5268
5341
  Fe as baseBlueObjectSchema,
5269
5342
  Yn as blueDescriptionField,
@@ -5273,45 +5346,45 @@ export {
5273
5346
  Jn as blueNodeField,
5274
5347
  Fn as blueObjectBooleanValueSchema,
5275
5348
  xn as blueObjectNumberValueSchema,
5276
- ue as blueObjectSchema,
5349
+ de as blueObjectSchema,
5277
5350
  $n as blueObjectStringListItemsSchema,
5278
5351
  Mn as blueObjectStringValueSchema,
5279
- js as calculateBlueId,
5280
- Hn as calculateBlueIdSync,
5281
- vt as enrichWithBlueId,
5282
- Jr as getBlueDescriptionAnnotation,
5283
- Wr as getBlueIdAnnotation,
5284
- qr as getBlueNameAnnotation,
5285
- es as getBlueNodeAnnotation,
5286
- Wn as getBlueObjectItems,
5352
+ Ls as calculateBlueId,
5353
+ Zn as calculateBlueIdSync,
5354
+ bt as enrichWithBlueId,
5355
+ Wr as getBlueDescriptionAnnotation,
5356
+ Xr as getBlueIdAnnotation,
5357
+ Qr as getBlueNameAnnotation,
5358
+ ts as getBlueNodeAnnotation,
5359
+ Hn as getBlueObjectItems,
5287
5360
  qn as getBlueObjectProperties,
5288
5361
  Qn as getBlueObjectTypeLabel,
5289
5362
  Xn as getBlueObjectValue,
5290
- rs as getTypeBlueIdAnnotation,
5291
- Er as hasBlueObjectBlueIdDefined,
5292
- Nr as hasBlueObjectItemsDefined,
5293
- Ln as hasBlueObjectNameDefined,
5294
- Pr as hasBlueObjectTypeDefined,
5295
- Sr as hasBlueObjectValueDefined,
5363
+ ss as getTypeBlueIdAnnotation,
5364
+ Nr as hasBlueObjectBlueIdDefined,
5365
+ Pr as hasBlueObjectItemsDefined,
5366
+ jn as hasBlueObjectNameDefined,
5367
+ Sr as hasBlueObjectTypeDefined,
5368
+ Cr as hasBlueObjectValueDefined,
5296
5369
  Ge as isBigDecimalNumber,
5297
- H as isBigIntegerNumber,
5298
- A as isBigNumber,
5299
- zt as isBlueNodeSchema,
5370
+ Z as isBigIntegerNumber,
5371
+ C as isBigNumber,
5372
+ Gt as isBlueNodeSchema,
5300
5373
  _n as isBlueObject,
5301
5374
  Us as isBlueObjectResolved,
5302
- jn as isGivenBlueObjectTypeSchema,
5375
+ Ln as isGivenBlueObjectTypeSchema,
5303
5376
  Lt as isJsonBlueArray,
5304
- _t as isJsonBlueObject,
5377
+ jt as isJsonBlueObject,
5305
5378
  Un as isJsonBlueValue,
5306
- we as isUrl,
5307
- Ae as jsonBlueValueSchema,
5379
+ Be as isUrl,
5380
+ Ce as jsonBlueValueSchema,
5308
5381
  ei as normalizeToBlueObject,
5309
- Bt as resolveBlueObjectItems,
5310
- Gr as withBlueDescription,
5382
+ wt as resolveBlueObjectItems,
5383
+ Jr as withBlueDescription,
5311
5384
  Hr as withBlueId,
5312
- Xr as withBlueName,
5313
- Qr as withBlueNode,
5314
- Zn as withTypeBlueId,
5385
+ qr as withBlueName,
5386
+ es as withBlueNode,
5387
+ Wn as withTypeBlueId,
5315
5388
  Rs as yamlBlueDump,
5316
5389
  $ as yamlBlueParse
5317
5390
  };