@useinsider/guido 3.2.0-beta.caa22bf → 3.2.0-beta.ccaf9f5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +0 -92
  2. package/dist/@types/config/schemas.js +94 -150
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +75 -75
  5. package/dist/composables/useCortexBlueprintBridge.js +38 -0
  6. package/dist/composables/useEmailTemplateApplier.js +41 -0
  7. package/dist/composables/useRecommendation.js +26 -46
  8. package/dist/composables/useSave.js +18 -21
  9. package/dist/composables/useStripo.js +16 -14
  10. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  11. package/dist/config/migrator/index.js +9 -9
  12. package/dist/config/migrator/radioButtonMigrator.js +44 -64
  13. package/dist/config/migrator/recommendationMigrator.js +290 -74
  14. package/dist/enums/displayConditions.js +80 -0
  15. package/dist/enums/extensions/recommendationBlock.js +1 -2
  16. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  17. package/dist/extensions/Blocks/Recommendation/block.js +32 -35
  18. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  19. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +24 -25
  20. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +181 -228
  21. package/dist/extensions/Blocks/Recommendation/services/configService.js +29 -65
  22. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -130
  23. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  24. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  25. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  26. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +22 -13
  27. package/dist/guido.css +1 -1
  28. package/dist/node_modules/valibot/dist/index.js +235 -450
  29. package/dist/src/@types/config/defaults.d.ts +1 -5
  30. package/dist/src/@types/config/index.d.ts +3 -3
  31. package/dist/src/@types/config/schemas.d.ts +0 -213
  32. package/dist/src/@types/config/types.d.ts +1 -9
  33. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  34. package/dist/src/composables/useConfig.d.ts +0 -56
  35. package/dist/src/composables/useCortexBlueprintBridge.d.ts +17 -0
  36. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  37. package/dist/src/composables/useRecommendation.d.ts +1 -10
  38. package/dist/src/config/migrator/index.d.ts +1 -2
  39. package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -13
  40. package/dist/src/enums/displayConditions.d.ts +2 -0
  41. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -10
  43. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -34
  44. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  45. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +3 -0
  46. package/dist/src/library.d.ts +1 -1
  47. package/dist/src/stores/config.d.ts +0 -504
  48. package/dist/utils/templatePreparation.js +32 -72
  49. package/package.json +1 -5
  50. package/dist/composables/validators/useCouponBlockValidator.js +0 -24
  51. package/dist/config/migrator/recommendation/compositionMapper.js +0 -98
  52. package/dist/config/migrator/recommendation/extractors.js +0 -27
  53. package/dist/config/migrator/recommendation/htmlBuilder.js +0 -496
  54. package/dist/config/migrator/recommendation/parseLegacyConfig.js +0 -33
  55. package/dist/config/migrator/recommendation/settingsMapper.js +0 -70
  56. package/dist/config/migrator/recommendation/themeMapper.js +0 -93
  57. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +0 -21
  58. package/dist/src/composables/useRecommendation.test.d.ts +0 -1
  59. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  60. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +0 -2
  61. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +0 -1
  62. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -7
  63. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +0 -1
  64. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -11
  65. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +0 -15
  66. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
  67. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +0 -7
  68. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
  69. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +0 -5
  70. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
  71. package/dist/src/config/migrator/recommendation/types.d.ts +0 -205
  72. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
  73. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
  74. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
  75. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +0 -21
  76. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
  77. package/dist/src/utils/htmlEscape.d.ts +0 -5
  78. package/dist/src/utils/htmlEscape.test.d.ts +0 -1
  79. package/dist/utils/htmlEscape.js +0 -13
@@ -1,145 +1,141 @@
1
- var m;
1
+ var v;
2
2
  // @__NO_SIDE_EFFECTS__
3
- function j(n) {
3
+ function E(n) {
4
4
  return {
5
- lang: (n == null ? void 0 : n.lang) ?? (m == null ? void 0 : m.lang),
5
+ lang: (n == null ? void 0 : n.lang) ?? (v == null ? void 0 : v.lang),
6
6
  message: n == null ? void 0 : n.message,
7
- abortEarly: (n == null ? void 0 : n.abortEarly) ?? (m == null ? void 0 : m.abortEarly),
8
- abortPipeEarly: (n == null ? void 0 : n.abortPipeEarly) ?? (m == null ? void 0 : m.abortPipeEarly)
7
+ abortEarly: (n == null ? void 0 : n.abortEarly) ?? (v == null ? void 0 : v.abortEarly),
8
+ abortPipeEarly: (n == null ? void 0 : n.abortPipeEarly) ?? (v == null ? void 0 : v.abortPipeEarly)
9
9
  };
10
10
  }
11
+ var g;
12
+ // @__NO_SIDE_EFFECTS__
13
+ function D(n) {
14
+ return g == null ? void 0 : g.get(n);
15
+ }
11
16
  var d;
12
17
  // @__NO_SIDE_EFFECTS__
13
- function I(n) {
18
+ function w(n) {
14
19
  return d == null ? void 0 : d.get(n);
15
20
  }
16
21
  var x;
17
22
  // @__NO_SIDE_EFFECTS__
18
- function A(n) {
19
- return x == null ? void 0 : x.get(n);
20
- }
21
- var E;
22
- // @__NO_SIDE_EFFECTS__
23
- function q(n, s) {
23
+ function A(n, r) {
24
24
  var e;
25
- return (e = E == null ? void 0 : E.get(n)) == null ? void 0 : e.get(s);
25
+ return (e = x == null ? void 0 : x.get(n)) == null ? void 0 : e.get(r);
26
26
  }
27
27
  // @__NO_SIDE_EFFECTS__
28
- function _(n) {
29
- var e, r;
30
- const s = typeof n;
31
- return s === "string" ? `"${n}"` : s === "number" || s === "bigint" || s === "boolean" ? `${n}` : s === "object" || s === "function" ? (n && ((r = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : r.name)) ?? "null" : s;
28
+ function $(n) {
29
+ var e, t;
30
+ const r = typeof n;
31
+ return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && ((t = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : t.name)) ?? "null" : r;
32
32
  }
33
- function y(n, s, e, r, t) {
34
- const l = t && "input" in t ? t.input : e.value, i = (t == null ? void 0 : t.expected) ?? n.expects ?? null, p = (t == null ? void 0 : t.received) ?? /* @__PURE__ */ _(l), u = {
33
+ function y(n, r, e, t, i) {
34
+ const a = i && "input" in i ? i.input : e.value, s = (i == null ? void 0 : i.expected) ?? n.expects ?? null, l = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ $(a), u = {
35
35
  kind: n.kind,
36
36
  type: n.type,
37
- input: l,
38
- expected: i,
39
- received: p,
40
- message: `Invalid ${s}: ${i ? `Expected ${i} but r` : "R"}eceived ${p}`,
37
+ input: a,
38
+ expected: s,
39
+ received: l,
40
+ message: `Invalid ${r}: ${s ? `Expected ${s} but r` : "R"}eceived ${l}`,
41
41
  requirement: n.requirement,
42
- path: t == null ? void 0 : t.path,
43
- issues: t == null ? void 0 : t.issues,
44
- lang: r.lang,
45
- abortEarly: r.abortEarly,
46
- abortPipeEarly: r.abortPipeEarly
47
- }, a = n.kind === "schema", c = (t == null ? void 0 : t.message) ?? n.message ?? /* @__PURE__ */ q(n.reference, u.lang) ?? (a ? /* @__PURE__ */ A(u.lang) : null) ?? r.message ?? /* @__PURE__ */ I(u.lang);
42
+ path: i == null ? void 0 : i.path,
43
+ issues: i == null ? void 0 : i.issues,
44
+ lang: t.lang,
45
+ abortEarly: t.abortEarly,
46
+ abortPipeEarly: t.abortPipeEarly
47
+ }, p = n.kind === "schema", c = (i == null ? void 0 : i.message) ?? n.message ?? /* @__PURE__ */ A(n.reference, u.lang) ?? (p ? /* @__PURE__ */ w(u.lang) : null) ?? t.message ?? /* @__PURE__ */ D(u.lang);
48
48
  c !== void 0 && (u.message = typeof c == "function" ? (
49
49
  // @ts-expect-error
50
50
  c(u)
51
- ) : c), a && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
51
+ ) : c), p && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
52
52
  }
53
53
  // @__NO_SIDE_EFFECTS__
54
- function o(n) {
54
+ function f(n) {
55
55
  return {
56
56
  version: 1,
57
57
  vendor: "valibot",
58
- validate(s) {
59
- return n["~run"]({ value: s }, /* @__PURE__ */ j());
58
+ validate(r) {
59
+ return n["~run"]({ value: r }, /* @__PURE__ */ E());
60
60
  }
61
61
  };
62
62
  }
63
63
  // @__NO_SIDE_EFFECTS__
64
- function O(n, s) {
65
- return Object.hasOwn(n, s) && s !== "__proto__" && s !== "prototype" && s !== "constructor";
66
- }
67
- // @__NO_SIDE_EFFECTS__
68
- function $(n, s) {
64
+ function S(n, r) {
69
65
  const e = [...new Set(n)];
70
- return e.length > 1 ? `(${e.join(` ${s} `)})` : e[0] ?? "never";
66
+ return e.length > 1 ? `(${e.join(` ${r} `)})` : e[0] ?? "never";
71
67
  }
72
68
  // @__NO_SIDE_EFFECTS__
73
- function K(n, s) {
69
+ function O(n, r) {
74
70
  return {
75
71
  kind: "validation",
76
72
  type: "check",
77
- reference: K,
73
+ reference: O,
78
74
  async: !0,
79
75
  expects: null,
80
76
  requirement: n,
81
- message: s,
82
- async "~run"(e, r) {
83
- return e.typed && !await this.requirement(e.value) && y(this, "input", e, r), e;
77
+ message: r,
78
+ async "~run"(e, t) {
79
+ return e.typed && !await this.requirement(e.value) && y(this, "input", e, t), e;
84
80
  }
85
81
  };
86
82
  }
87
83
  // @__NO_SIDE_EFFECTS__
88
- function M(n, s) {
84
+ function I(n, r) {
89
85
  return {
90
86
  kind: "validation",
91
87
  type: "max_length",
92
- reference: M,
88
+ reference: I,
93
89
  async: !1,
94
90
  expects: `<=${n}`,
95
91
  requirement: n,
96
- message: s,
97
- "~run"(e, r) {
98
- return e.typed && e.value.length > this.requirement && y(this, "length", e, r, {
92
+ message: r,
93
+ "~run"(e, t) {
94
+ return e.typed && e.value.length > this.requirement && y(this, "length", e, t, {
99
95
  received: `${e.value.length}`
100
96
  }), e;
101
97
  }
102
98
  };
103
99
  }
104
100
  // @__NO_SIDE_EFFECTS__
105
- function V(n, s) {
101
+ function q(n, r) {
106
102
  return {
107
103
  kind: "validation",
108
104
  type: "min_length",
109
- reference: V,
105
+ reference: q,
110
106
  async: !1,
111
107
  expects: `>=${n}`,
112
108
  requirement: n,
113
- message: s,
114
- "~run"(e, r) {
115
- return e.typed && e.value.length < this.requirement && y(this, "length", e, r, {
109
+ message: r,
110
+ "~run"(e, t) {
111
+ return e.typed && e.value.length < this.requirement && y(this, "length", e, t, {
116
112
  received: `${e.value.length}`
117
113
  }), e;
118
114
  }
119
115
  };
120
116
  }
121
117
  // @__NO_SIDE_EFFECTS__
122
- function G(n) {
118
+ function M(n) {
123
119
  return {
124
120
  kind: "validation",
125
121
  type: "non_empty",
126
- reference: G,
122
+ reference: M,
127
123
  async: !1,
128
124
  expects: "!0",
129
125
  message: n,
130
- "~run"(s, e) {
131
- return s.typed && s.value.length === 0 && y(this, "length", s, e, {
126
+ "~run"(r, e) {
127
+ return r.typed && r.value.length === 0 && y(this, "length", r, e, {
132
128
  received: "0"
133
- }), s;
129
+ }), r;
134
130
  }
135
131
  };
136
132
  }
137
133
  // @__NO_SIDE_EFFECTS__
138
- function L() {
134
+ function G() {
139
135
  return {
140
136
  kind: "transformation",
141
137
  type: "trim",
142
- reference: L,
138
+ reference: G,
143
139
  async: !1,
144
140
  "~run"(n) {
145
141
  return n.value = n.value.trim(), n;
@@ -147,27 +143,27 @@ function L() {
147
143
  };
148
144
  }
149
145
  // @__NO_SIDE_EFFECTS__
150
- function S(n, s, e) {
146
+ function L(n, r, e) {
151
147
  return typeof n.fallback == "function" ? (
152
148
  // @ts-expect-error
153
- n.fallback(s, e)
149
+ n.fallback(r, e)
154
150
  ) : (
155
151
  // @ts-expect-error
156
152
  n.fallback
157
153
  );
158
154
  }
159
155
  // @__NO_SIDE_EFFECTS__
160
- function D(n, s, e) {
156
+ function _(n, r, e) {
161
157
  return typeof n.default == "function" ? (
162
158
  // @ts-expect-error
163
- n.default(s, e)
159
+ n.default(r, e)
164
160
  ) : (
165
161
  // @ts-expect-error
166
162
  n.default
167
163
  );
168
164
  }
169
165
  // @__NO_SIDE_EFFECTS__
170
- function N(n, s) {
166
+ function N(n, r) {
171
167
  return {
172
168
  kind: "schema",
173
169
  type: "array",
@@ -175,28 +171,28 @@ function N(n, s) {
175
171
  expects: "Array",
176
172
  async: !1,
177
173
  item: n,
178
- message: s,
174
+ message: r,
179
175
  get "~standard"() {
180
- return /* @__PURE__ */ o(this);
176
+ return /* @__PURE__ */ f(this);
181
177
  },
182
- "~run"(e, r) {
183
- var l;
184
- const t = e.value;
185
- if (Array.isArray(t)) {
178
+ "~run"(e, t) {
179
+ var a;
180
+ const i = e.value;
181
+ if (Array.isArray(i)) {
186
182
  e.typed = !0, e.value = [];
187
- for (let i = 0; i < t.length; i++) {
188
- const p = t[i], u = this.item["~run"]({ value: p }, r);
183
+ for (let s = 0; s < i.length; s++) {
184
+ const l = i[s], u = this.item["~run"]({ value: l }, t);
189
185
  if (u.issues) {
190
- const a = {
186
+ const p = {
191
187
  type: "array",
192
188
  origin: "value",
193
- input: t,
194
- key: i,
195
- value: p
189
+ input: i,
190
+ key: s,
191
+ value: l
196
192
  };
197
193
  for (const c of u.issues)
198
- c.path ? c.path.unshift(a) : c.path = [a], (l = e.issues) == null || l.push(c);
199
- if (e.issues || (e.issues = u.issues), r.abortEarly) {
194
+ c.path ? c.path.unshift(p) : c.path = [p], (a = e.issues) == null || a.push(c);
195
+ if (e.issues || (e.issues = u.issues), t.abortEarly) {
200
196
  e.typed = !1;
201
197
  break;
202
198
  }
@@ -204,7 +200,7 @@ function N(n, s) {
204
200
  u.typed || (e.typed = !1), e.value.push(u.value);
205
201
  }
206
202
  } else
207
- y(this, "type", e, r);
203
+ y(this, "type", e, t);
208
204
  return e;
209
205
  }
210
206
  };
@@ -219,15 +215,15 @@ function C(n) {
219
215
  async: !1,
220
216
  message: n,
221
217
  get "~standard"() {
222
- return /* @__PURE__ */ o(this);
218
+ return /* @__PURE__ */ f(this);
223
219
  },
224
- "~run"(s, e) {
225
- return typeof s.value == "boolean" ? s.typed = !0 : y(this, "type", s, e), s;
220
+ "~run"(r, e) {
221
+ return typeof r.value == "boolean" ? r.typed = !0 : y(this, "type", r, e), r;
226
222
  }
227
223
  };
228
224
  }
229
225
  // @__NO_SIDE_EFFECTS__
230
- function F(n, s) {
226
+ function F(n, r) {
231
227
  return {
232
228
  kind: "schema",
233
229
  type: "custom",
@@ -235,544 +231,333 @@ function F(n, s) {
235
231
  expects: "unknown",
236
232
  async: !1,
237
233
  check: n,
238
- message: s,
234
+ message: r,
239
235
  get "~standard"() {
240
- return /* @__PURE__ */ o(this);
236
+ return /* @__PURE__ */ f(this);
241
237
  },
242
- "~run"(e, r) {
243
- return this.check(e.value) ? e.typed = !0 : y(this, "type", e, r), e;
238
+ "~run"(e, t) {
239
+ return this.check(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
244
240
  }
245
241
  };
246
242
  }
247
243
  // @__NO_SIDE_EFFECTS__
248
- function R(n, s) {
244
+ function K(n, r) {
249
245
  return {
250
246
  kind: "schema",
251
247
  type: "literal",
252
- reference: R,
253
- expects: /* @__PURE__ */ _(n),
248
+ reference: K,
249
+ expects: /* @__PURE__ */ $(n),
254
250
  async: !1,
255
251
  literal: n,
256
- message: s,
252
+ message: r,
257
253
  get "~standard"() {
258
- return /* @__PURE__ */ o(this);
254
+ return /* @__PURE__ */ f(this);
259
255
  },
260
- "~run"(e, r) {
261
- return e.value === this.literal ? e.typed = !0 : y(this, "type", e, r), e;
256
+ "~run"(e, t) {
257
+ return e.value === this.literal ? e.typed = !0 : y(this, "type", e, t), e;
262
258
  }
263
259
  };
264
260
  }
265
261
  // @__NO_SIDE_EFFECTS__
266
- function z(n, s) {
267
- return {
268
- kind: "schema",
269
- type: "loose_object",
270
- reference: z,
271
- expects: "Object",
272
- async: !1,
273
- entries: n,
274
- message: s,
275
- get "~standard"() {
276
- return /* @__PURE__ */ o(this);
277
- },
278
- "~run"(e, r) {
279
- var l;
280
- const t = e.value;
281
- if (t && typeof t == "object") {
282
- e.typed = !0, e.value = {};
283
- for (const i in this.entries) {
284
- const p = this.entries[i];
285
- if (i in t || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && // @ts-expect-error
286
- p.default !== void 0) {
287
- const u = i in t ? (
288
- // @ts-expect-error
289
- t[i]
290
- ) : /* @__PURE__ */ D(p), a = p["~run"]({ value: u }, r);
291
- if (a.issues) {
292
- const c = {
293
- type: "object",
294
- origin: "value",
295
- input: t,
296
- key: i,
297
- value: u
298
- };
299
- for (const f of a.issues)
300
- f.path ? f.path.unshift(c) : f.path = [c], (l = e.issues) == null || l.push(f);
301
- if (e.issues || (e.issues = a.issues), r.abortEarly) {
302
- e.typed = !1;
303
- break;
304
- }
305
- }
306
- a.typed || (e.typed = !1), e.value[i] = a.value;
307
- } else if (p.fallback !== void 0)
308
- e.value[i] = /* @__PURE__ */ S(p);
309
- else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (y(this, "key", e, r, {
310
- input: void 0,
311
- expected: `"${i}"`,
312
- path: [
313
- {
314
- type: "object",
315
- origin: "key",
316
- input: t,
317
- key: i,
318
- // @ts-expect-error
319
- value: t[i]
320
- }
321
- ]
322
- }), r.abortEarly))
323
- break;
324
- }
325
- if (!e.issues || !r.abortEarly)
326
- for (const i in t)
327
- /* @__PURE__ */ O(t, i) && !(i in this.entries) && (e.value[i] = t[i]);
328
- } else
329
- y(this, "type", e, r);
330
- return e;
331
- }
332
- };
333
- }
334
- // @__NO_SIDE_EFFECTS__
335
- function B(n) {
262
+ function R(n) {
336
263
  return {
337
264
  kind: "schema",
338
265
  type: "number",
339
- reference: B,
266
+ reference: R,
340
267
  expects: "number",
341
268
  async: !1,
342
269
  message: n,
343
270
  get "~standard"() {
344
- return /* @__PURE__ */ o(this);
271
+ return /* @__PURE__ */ f(this);
345
272
  },
346
- "~run"(s, e) {
347
- return typeof s.value == "number" && !isNaN(s.value) ? s.typed = !0 : y(this, "type", s, e), s;
273
+ "~run"(r, e) {
274
+ return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : y(this, "type", r, e), r;
348
275
  }
349
276
  };
350
277
  }
351
278
  // @__NO_SIDE_EFFECTS__
352
- function H(n, s) {
279
+ function V(n, r) {
353
280
  return {
354
281
  kind: "schema",
355
282
  type: "object",
356
- reference: H,
283
+ reference: V,
357
284
  expects: "Object",
358
285
  async: !1,
359
286
  entries: n,
360
- message: s,
287
+ message: r,
361
288
  get "~standard"() {
362
- return /* @__PURE__ */ o(this);
289
+ return /* @__PURE__ */ f(this);
363
290
  },
364
- "~run"(e, r) {
365
- var l;
366
- const t = e.value;
367
- if (t && typeof t == "object") {
291
+ "~run"(e, t) {
292
+ var a;
293
+ const i = e.value;
294
+ if (i && typeof i == "object") {
368
295
  e.typed = !0, e.value = {};
369
- for (const i in this.entries) {
370
- const p = this.entries[i];
371
- if (i in t || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && // @ts-expect-error
372
- p.default !== void 0) {
373
- const u = i in t ? (
296
+ for (const s in this.entries) {
297
+ const l = this.entries[s];
298
+ if (s in i || (l.type === "exact_optional" || l.type === "optional" || l.type === "nullish") && // @ts-expect-error
299
+ l.default !== void 0) {
300
+ const u = s in i ? (
374
301
  // @ts-expect-error
375
- t[i]
376
- ) : /* @__PURE__ */ D(p), a = p["~run"]({ value: u }, r);
377
- if (a.issues) {
302
+ i[s]
303
+ ) : /* @__PURE__ */ _(l), p = l["~run"]({ value: u }, t);
304
+ if (p.issues) {
378
305
  const c = {
379
306
  type: "object",
380
307
  origin: "value",
381
- input: t,
382
- key: i,
308
+ input: i,
309
+ key: s,
383
310
  value: u
384
311
  };
385
- for (const f of a.issues)
386
- f.path ? f.path.unshift(c) : f.path = [c], (l = e.issues) == null || l.push(f);
387
- if (e.issues || (e.issues = a.issues), r.abortEarly) {
312
+ for (const m of p.issues)
313
+ m.path ? m.path.unshift(c) : m.path = [c], (a = e.issues) == null || a.push(m);
314
+ if (e.issues || (e.issues = p.issues), t.abortEarly) {
388
315
  e.typed = !1;
389
316
  break;
390
317
  }
391
318
  }
392
- a.typed || (e.typed = !1), e.value[i] = a.value;
393
- } else if (p.fallback !== void 0)
394
- e.value[i] = /* @__PURE__ */ S(p);
395
- else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (y(this, "key", e, r, {
319
+ p.typed || (e.typed = !1), e.value[s] = p.value;
320
+ } else if (l.fallback !== void 0)
321
+ e.value[s] = /* @__PURE__ */ L(l);
322
+ else if (l.type !== "exact_optional" && l.type !== "optional" && l.type !== "nullish" && (y(this, "key", e, t, {
396
323
  input: void 0,
397
- expected: `"${i}"`,
324
+ expected: `"${s}"`,
398
325
  path: [
399
326
  {
400
327
  type: "object",
401
328
  origin: "key",
402
- input: t,
403
- key: i,
329
+ input: i,
330
+ key: s,
404
331
  // @ts-expect-error
405
- value: t[i]
332
+ value: i[s]
406
333
  }
407
334
  ]
408
- }), r.abortEarly))
335
+ }), t.abortEarly))
409
336
  break;
410
337
  }
411
338
  } else
412
- y(this, "type", e, r);
339
+ y(this, "type", e, t);
413
340
  return e;
414
341
  }
415
342
  };
416
343
  }
417
344
  // @__NO_SIDE_EFFECTS__
418
- function J(n, s) {
345
+ function z(n, r) {
419
346
  return {
420
347
  kind: "schema",
421
348
  type: "optional",
422
- reference: J,
349
+ reference: z,
423
350
  expects: `(${n.expects} | undefined)`,
424
351
  async: !1,
425
352
  wrapped: n,
426
- default: s,
353
+ default: r,
427
354
  get "~standard"() {
428
- return /* @__PURE__ */ o(this);
355
+ return /* @__PURE__ */ f(this);
429
356
  },
430
- "~run"(e, r) {
431
- return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ D(this, e, r)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
357
+ "~run"(e, t) {
358
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ _(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
432
359
  }
433
360
  };
434
361
  }
435
362
  // @__NO_SIDE_EFFECTS__
436
- function Q(n, s) {
363
+ function B(n, r) {
437
364
  return {
438
365
  kind: "schema",
439
366
  type: "picklist",
440
- reference: Q,
441
- expects: /* @__PURE__ */ $(n.map(_), "|"),
367
+ reference: B,
368
+ expects: /* @__PURE__ */ S(n.map($), "|"),
442
369
  async: !1,
443
370
  options: n,
444
- message: s,
371
+ message: r,
445
372
  get "~standard"() {
446
- return /* @__PURE__ */ o(this);
373
+ return /* @__PURE__ */ f(this);
447
374
  },
448
- "~run"(e, r) {
449
- return this.options.includes(e.value) ? e.typed = !0 : y(this, "type", e, r), e;
375
+ "~run"(e, t) {
376
+ return this.options.includes(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
450
377
  }
451
378
  };
452
379
  }
453
380
  // @__NO_SIDE_EFFECTS__
454
- function T(n, s, e) {
455
- return {
456
- kind: "schema",
457
- type: "record",
458
- reference: T,
459
- expects: "Object",
460
- async: !1,
461
- key: n,
462
- value: s,
463
- message: e,
464
- get "~standard"() {
465
- return /* @__PURE__ */ o(this);
466
- },
467
- "~run"(r, t) {
468
- var i, p;
469
- const l = r.value;
470
- if (l && typeof l == "object") {
471
- r.typed = !0, r.value = {};
472
- for (const u in l)
473
- if (/* @__PURE__ */ O(l, u)) {
474
- const a = l[u], c = this.key["~run"]({ value: u }, t);
475
- if (c.issues) {
476
- const b = {
477
- type: "object",
478
- origin: "key",
479
- input: l,
480
- key: u,
481
- value: a
482
- };
483
- for (const h of c.issues)
484
- h.path = [b], (i = r.issues) == null || i.push(h);
485
- if (r.issues || (r.issues = c.issues), t.abortEarly) {
486
- r.typed = !1;
487
- break;
488
- }
489
- }
490
- const f = this.value["~run"](
491
- { value: a },
492
- t
493
- );
494
- if (f.issues) {
495
- const b = {
496
- type: "object",
497
- origin: "value",
498
- input: l,
499
- key: u,
500
- value: a
501
- };
502
- for (const h of f.issues)
503
- h.path ? h.path.unshift(b) : h.path = [b], (p = r.issues) == null || p.push(h);
504
- if (r.issues || (r.issues = f.issues), t.abortEarly) {
505
- r.typed = !1;
506
- break;
507
- }
508
- }
509
- (!c.typed || !f.typed) && (r.typed = !1), c.typed && (r.value[c.value] = f.value);
510
- }
511
- } else
512
- y(this, "type", r, t);
513
- return r;
514
- }
515
- };
516
- }
517
- // @__NO_SIDE_EFFECTS__
518
- function U(n) {
381
+ function H(n) {
519
382
  return {
520
383
  kind: "schema",
521
384
  type: "string",
522
- reference: U,
385
+ reference: H,
523
386
  expects: "string",
524
387
  async: !1,
525
388
  message: n,
526
389
  get "~standard"() {
527
- return /* @__PURE__ */ o(this);
528
- },
529
- "~run"(s, e) {
530
- return typeof s.value == "string" ? s.typed = !0 : y(this, "type", s, e), s;
531
- }
532
- };
533
- }
534
- // @__NO_SIDE_EFFECTS__
535
- function w(n) {
536
- let s;
537
- if (n)
538
- for (const e of n)
539
- s ? s.push(...e.issues) : s = e.issues;
540
- return s;
541
- }
542
- // @__NO_SIDE_EFFECTS__
543
- function W(n, s) {
544
- return {
545
- kind: "schema",
546
- type: "union",
547
- reference: W,
548
- expects: /* @__PURE__ */ $(
549
- n.map((e) => e.expects),
550
- "|"
551
- ),
552
- async: !1,
553
- options: n,
554
- message: s,
555
- get "~standard"() {
556
- return /* @__PURE__ */ o(this);
390
+ return /* @__PURE__ */ f(this);
557
391
  },
558
- "~run"(e, r) {
559
- let t, l, i;
560
- for (const p of this.options) {
561
- const u = p["~run"]({ value: e.value }, r);
562
- if (u.typed)
563
- if (u.issues)
564
- l ? l.push(u) : l = [u];
565
- else {
566
- t = u;
567
- break;
568
- }
569
- else
570
- i ? i.push(u) : i = [u];
571
- }
572
- if (t)
573
- return t;
574
- if (l) {
575
- if (l.length === 1)
576
- return l[0];
577
- y(this, "type", e, r, {
578
- issues: /* @__PURE__ */ w(l)
579
- }), e.typed = !0;
580
- } else {
581
- if ((i == null ? void 0 : i.length) === 1)
582
- return i[0];
583
- y(this, "type", e, r, {
584
- issues: /* @__PURE__ */ w(i)
585
- });
586
- }
587
- return e;
392
+ "~run"(r, e) {
393
+ return typeof r.value == "string" ? r.typed = !0 : y(this, "type", r, e), r;
588
394
  }
589
395
  };
590
396
  }
591
397
  // @__NO_SIDE_EFFECTS__
592
- function X() {
593
- return {
594
- kind: "schema",
595
- type: "unknown",
596
- reference: X,
597
- expects: "unknown",
598
- async: !1,
599
- get "~standard"() {
600
- return /* @__PURE__ */ o(this);
601
- },
602
- "~run"(n) {
603
- return n.typed = !0, n;
604
- }
605
- };
606
- }
607
- // @__NO_SIDE_EFFECTS__
608
- function Y(n, s, e) {
398
+ function J(n, r, e) {
609
399
  return {
610
400
  kind: "schema",
611
401
  type: "variant",
612
- reference: Y,
402
+ reference: J,
613
403
  expects: "Object",
614
404
  async: !1,
615
405
  key: n,
616
- options: s,
406
+ options: r,
617
407
  message: e,
618
408
  get "~standard"() {
619
- return /* @__PURE__ */ o(this);
409
+ return /* @__PURE__ */ f(this);
620
410
  },
621
- "~run"(r, t) {
622
- const l = r.value;
623
- if (l && typeof l == "object") {
624
- let i, p = 0, u = this.key, a = [];
625
- const c = (f, b) => {
626
- for (const h of f.options) {
411
+ "~run"(t, i) {
412
+ const a = t.value;
413
+ if (a && typeof a == "object") {
414
+ let s, l = 0, u = this.key, p = [];
415
+ const c = (m, j) => {
416
+ for (const h of m.options) {
627
417
  if (h.type === "variant")
628
- c(h, new Set(b).add(h.key));
418
+ c(h, new Set(j).add(h.key));
629
419
  else {
630
- let P = !0, k = 0;
631
- for (const v of b) {
632
- const g = h.entries[v];
633
- if (v in l ? g["~run"](
420
+ let P = !0, b = 0;
421
+ for (const o of j) {
422
+ const k = h.entries[o];
423
+ if (o in a ? k["~run"](
634
424
  // @ts-expect-error
635
- { typed: !1, value: l[v] },
425
+ { typed: !1, value: a[o] },
636
426
  { abortEarly: !0 }
637
- ).issues : g.type !== "exact_optional" && g.type !== "optional" && g.type !== "nullish") {
638
- P = !1, u !== v && (p < k || p === k && v in l && !(u in l)) && (p = k, u = v, a = []), u === v && a.push(
639
- h.entries[v].expects
427
+ ).issues : k.type !== "exact_optional" && k.type !== "optional" && k.type !== "nullish") {
428
+ P = !1, u !== o && (l < b || l === b && o in a && !(u in a)) && (l = b, u = o, p = []), u === o && p.push(
429
+ h.entries[o].expects
640
430
  );
641
431
  break;
642
432
  }
643
- k++;
433
+ b++;
644
434
  }
645
435
  if (P) {
646
- const v = h["~run"]({ value: l }, t);
647
- (!i || !i.typed && v.typed) && (i = v);
436
+ const o = h["~run"]({ value: a }, i);
437
+ (!s || !s.typed && o.typed) && (s = o);
648
438
  }
649
439
  }
650
- if (i && !i.issues)
440
+ if (s && !s.issues)
651
441
  break;
652
442
  }
653
443
  };
654
- if (c(this, /* @__PURE__ */ new Set([this.key])), i)
655
- return i;
656
- y(this, "type", r, t, {
444
+ if (c(this, /* @__PURE__ */ new Set([this.key])), s)
445
+ return s;
446
+ y(this, "type", t, i, {
657
447
  // @ts-expect-error
658
- input: l[u],
659
- expected: /* @__PURE__ */ $(a, "|"),
448
+ input: a[u],
449
+ expected: /* @__PURE__ */ S(p, "|"),
660
450
  path: [
661
451
  {
662
452
  type: "object",
663
453
  origin: "value",
664
- input: l,
454
+ input: a,
665
455
  key: u,
666
456
  // @ts-expect-error
667
- value: l[u]
457
+ value: a[u]
668
458
  }
669
459
  ]
670
460
  });
671
461
  } else
672
- y(this, "type", r, t);
673
- return r;
462
+ y(this, "type", t, i);
463
+ return t;
674
464
  }
675
465
  };
676
466
  }
677
467
  // @__NO_SIDE_EFFECTS__
678
- function Z(...n) {
468
+ function Q(...n) {
679
469
  return {
680
470
  ...n[0],
681
471
  pipe: n,
682
472
  get "~standard"() {
683
- return /* @__PURE__ */ o(this);
473
+ return /* @__PURE__ */ f(this);
684
474
  },
685
- "~run"(s, e) {
686
- for (const r of n)
687
- if (r.kind !== "metadata") {
688
- if (s.issues && (r.kind === "schema" || r.kind === "transformation")) {
689
- s.typed = !1;
475
+ "~run"(r, e) {
476
+ for (const t of n)
477
+ if (t.kind !== "metadata") {
478
+ if (r.issues && (t.kind === "schema" || t.kind === "transformation")) {
479
+ r.typed = !1;
690
480
  break;
691
481
  }
692
- (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = r["~run"](s, e));
482
+ (!r.issues || !e.abortEarly && !e.abortPipeEarly) && (r = t["~run"](r, e));
693
483
  }
694
- return s;
484
+ return r;
695
485
  }
696
486
  };
697
487
  }
698
488
  // @__NO_SIDE_EFFECTS__
699
- function ee(...n) {
489
+ function T(...n) {
700
490
  return {
701
491
  ...n[0],
702
492
  pipe: n,
703
493
  async: !0,
704
494
  get "~standard"() {
705
- return /* @__PURE__ */ o(this);
495
+ return /* @__PURE__ */ f(this);
706
496
  },
707
- async "~run"(s, e) {
708
- for (const r of n)
709
- if (r.kind !== "metadata") {
710
- if (s.issues && (r.kind === "schema" || r.kind === "transformation")) {
711
- s.typed = !1;
497
+ async "~run"(r, e) {
498
+ for (const t of n)
499
+ if (t.kind !== "metadata") {
500
+ if (r.issues && (t.kind === "schema" || t.kind === "transformation")) {
501
+ r.typed = !1;
712
502
  break;
713
503
  }
714
- (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = await r["~run"](s, e));
504
+ (!r.issues || !e.abortEarly && !e.abortPipeEarly) && (r = await t["~run"](r, e));
715
505
  }
716
- return s;
506
+ return r;
717
507
  }
718
508
  };
719
509
  }
720
510
  // @__NO_SIDE_EFFECTS__
721
- function ne(n, s, e) {
722
- const r = n["~run"]({ value: s }, /* @__PURE__ */ j(e));
511
+ function U(n, r, e) {
512
+ const t = n["~run"]({ value: r }, /* @__PURE__ */ E(e));
723
513
  return {
724
- typed: r.typed,
725
- success: !r.issues,
726
- output: r.value,
727
- issues: r.issues
514
+ typed: t.typed,
515
+ success: !t.issues,
516
+ output: t.value,
517
+ issues: t.issues
728
518
  };
729
519
  }
730
520
  // @__NO_SIDE_EFFECTS__
731
- async function se(n, s, e) {
732
- const r = await n["~run"](
733
- { value: s },
734
- /* @__PURE__ */ j(e)
521
+ async function W(n, r, e) {
522
+ const t = await n["~run"](
523
+ { value: r },
524
+ /* @__PURE__ */ E(e)
735
525
  );
736
526
  return {
737
- typed: r.typed,
738
- success: !r.issues,
739
- output: r.value,
740
- issues: r.issues
527
+ typed: t.typed,
528
+ success: !t.issues,
529
+ output: t.value,
530
+ issues: t.issues
741
531
  };
742
532
  }
743
533
  export {
744
534
  y as _addIssue,
745
- o as _getStandardProps,
746
- O as _isValidObjectKey,
747
- $ as _joinExpects,
748
- _ as _stringify,
535
+ f as _getStandardProps,
536
+ S as _joinExpects,
537
+ $ as _stringify,
749
538
  N as array,
750
539
  C as boolean,
751
- K as checkAsync,
540
+ O as checkAsync,
752
541
  F as custom,
753
- D as getDefault,
754
- S as getFallback,
755
- j as getGlobalConfig,
756
- I as getGlobalMessage,
757
- A as getSchemaMessage,
758
- q as getSpecificMessage,
759
- R as literal,
760
- z as looseObject,
761
- M as maxLength,
762
- V as minLength,
763
- G as nonEmpty,
764
- B as number,
765
- H as object,
766
- J as optional,
767
- Q as picklist,
768
- Z as pipe,
769
- ee as pipeAsync,
770
- T as record,
771
- ne as safeParse,
772
- se as safeParseAsync,
773
- U as string,
774
- L as trim,
775
- W as union,
776
- X as unknown,
777
- Y as variant
542
+ _ as getDefault,
543
+ L as getFallback,
544
+ E as getGlobalConfig,
545
+ D as getGlobalMessage,
546
+ w as getSchemaMessage,
547
+ A as getSpecificMessage,
548
+ K as literal,
549
+ I as maxLength,
550
+ q as minLength,
551
+ M as nonEmpty,
552
+ R as number,
553
+ V as object,
554
+ z as optional,
555
+ B as picklist,
556
+ Q as pipe,
557
+ T as pipeAsync,
558
+ U as safeParse,
559
+ W as safeParseAsync,
560
+ H as string,
561
+ G as trim,
562
+ J as variant
778
563
  };