@useinsider/guido 3.3.0-beta.6d597b3 → 3.3.0-beta.878c1c2

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.
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
- import { object as o, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as a, array as c, record as k, literal as i, looseObject as y, variant as g, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as o, number as n, optional as e, string as t, pipe as p, picklist as l, minLength as b, custom as h, boolean as a, array as c, record as k, looseObject as y, literal as i, variant as g, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -1,5 +1,5 @@
1
1
  import { useDebounce as p } from "./useDebounce.js";
2
- import { ResponsivePreviewRegex as c, ResponsivePreviewConfig as a, ResponsivePreviewSelectors as v } from "../enums/preview.js";
2
+ import { ResponsivePreviewRegex as c, ResponsivePreviewSelectors as v, ResponsivePreviewConfig as a } from "../enums/preview.js";
3
3
  let i = null, l = null;
4
4
  const { debounce: y } = p(), h = (t) => {
5
5
  if (!t)
@@ -2,7 +2,7 @@ import { RecommendationBlockId as s } from "../../constants/blockIds.js";
2
2
  import { ATTR_PRODUCT_ATTR as b, ATTR_PRODUCT_BUTTON as u, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_OMNIBUS_PRICE as h, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as f, ATTR_PRODUCT_IMAGE as x } from "../../constants/selectors.js";
3
3
  import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
4
4
  import { formatPrice as $ } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as C, sanitizeImageUrl as R } from "../utils.js";
5
+ import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as R } from "../utils.js";
6
6
  const a = "0 5px", l = "attribute-cell";
7
7
  function p() {
8
8
  const t = _(), { currencySettings: e } = t.recommendationConfigs;
@@ -40,7 +40,7 @@ const I = {
40
40
  esd-extension-block-id="${s.IMAGE}">
41
41
  <a target="_blank" href="${t.url}">
42
42
  <img
43
- src="${R(t.image_url)}"
43
+ src="${C(t.image_url)}"
44
44
  alt="${t.name}"
45
45
  style="display: block; max-width: 100%; height: auto;"
46
46
  class="adapt-img">
@@ -236,7 +236,7 @@ const I = {
236
236
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
237
237
  * @param content - Display content for the cell
238
238
  */
239
- [C]: (t, e) => `
239
+ [R]: (t, e) => `
240
240
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
241
241
  <table
242
242
  class="product-card-segment"
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
2
- import { getDefaultProducts as E, DEFAULTS as I, createBlockTemplate as _, DEFAULT_CARD_COMPOSITION as S, spacer as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
2
+ import { getDefaultProducts as E, createBlockTemplate as I, DEFAULTS as _, DEFAULT_CARD_COMPOSITION as S, spacer as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
3
  import { ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D, gridElementRenderer as C } from "./elementRenderer.js";
4
4
  const O = `
5
5
  <tr class="recommendation-product-row">
@@ -53,8 +53,8 @@ function h(t, e, o, r = {}) {
53
53
  return U(t, e, C, o, r);
54
54
  }
55
55
  function F(t) {
56
- const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = _("grid", e), r = E(), n = h(r, L);
57
- return o.replace("{-{-TITLE-}-}", I.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
56
+ const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = I("grid", e), r = E(), n = h(r, L);
57
+ return o.replace("{-{-TITLE-}-}", _.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
58
58
  }
59
59
  export {
60
60
  F as getDefaultTemplate,
@@ -2,7 +2,7 @@ import { RecommendationBlockId as o } from "../../constants/blockIds.js";
2
2
  import { ATTR_PRODUCT_ATTR as m, ATTR_PRODUCT_BUTTON as c, ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_OMNIBUS_DISCOUNT as u, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x } from "../../constants/selectors.js";
3
3
  import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
4
4
  import { formatPrice as R } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as y, sanitizeImageUrl as C } from "../utils.js";
5
+ import { sanitizeImageUrl as y, CUSTOM_CELL_HTML as C } from "../utils.js";
6
6
  function p() {
7
7
  const t = _(), { currencySettings: e } = t.recommendationConfigs;
8
8
  return {
@@ -37,7 +37,7 @@ const U = {
37
37
  valign="middle">
38
38
  <a target="_blank" href="${t.url}">
39
39
  <img
40
- src="${C(t.image_url)}"
40
+ src="${y(t.image_url)}"
41
41
  alt="${t.name}"
42
42
  style="display: block; max-width: 100%; height: auto;"
43
43
  class="adapt-img product-image">
@@ -179,7 +179,7 @@ const U = {
179
179
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
180
180
  * @param content - Display content for the cell
181
181
  */
182
- [y]: (t, e) => `
182
+ [C]: (t, e) => `
183
183
  <tr>
184
184
  <td
185
185
  ${m}="${t}"
@@ -1,4 +1,4 @@
1
- let m;
1
+ var m;
2
2
  // @__NO_SIDE_EFFECTS__
3
3
  function j(n) {
4
4
  return {
@@ -8,30 +8,30 @@ function j(n) {
8
8
  abortPipeEarly: (n == null ? void 0 : n.abortPipeEarly) ?? (m == null ? void 0 : m.abortPipeEarly)
9
9
  };
10
10
  }
11
- let d;
11
+ var d;
12
12
  // @__NO_SIDE_EFFECTS__
13
- function A(n) {
13
+ function I(n) {
14
14
  return d == null ? void 0 : d.get(n);
15
15
  }
16
- let x;
16
+ var x;
17
17
  // @__NO_SIDE_EFFECTS__
18
- function q(n) {
18
+ function A(n) {
19
19
  return x == null ? void 0 : x.get(n);
20
20
  }
21
- let E;
21
+ var E;
22
22
  // @__NO_SIDE_EFFECTS__
23
- function K(n, s) {
23
+ function q(n, s) {
24
24
  var e;
25
25
  return (e = E == null ? void 0 : E.get(n)) == null ? void 0 : e.get(s);
26
26
  }
27
27
  // @__NO_SIDE_EFFECTS__
28
28
  function _(n) {
29
- var e, t;
29
+ var e, r;
30
30
  const s = typeof n;
31
- return s === "string" ? `"${n}"` : s === "number" || s === "bigint" || s === "boolean" ? `${n}` : s === "object" || s === "function" ? (n && ((t = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : t.name)) ?? "null" : s;
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;
32
32
  }
33
- function y(n, s, e, t, r) {
34
- const l = r && "input" in r ? r.input : e.value, i = (r == null ? void 0 : r.expected) ?? n.expects ?? null, p = (r == null ? void 0 : r.received) ?? /* @__PURE__ */ _(l), u = {
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 = {
35
35
  kind: n.kind,
36
36
  type: n.type,
37
37
  input: l,
@@ -39,13 +39,16 @@ function y(n, s, e, t, r) {
39
39
  received: p,
40
40
  message: `Invalid ${s}: ${i ? `Expected ${i} but r` : "R"}eceived ${p}`,
41
41
  requirement: n.requirement,
42
- path: r == null ? void 0 : r.path,
43
- issues: r == null ? void 0 : r.issues,
44
- lang: t.lang,
45
- abortEarly: t.abortEarly,
46
- abortPipeEarly: t.abortPipeEarly
47
- }, a = n.kind === "schema", c = (r == null ? void 0 : r.message) ?? n.message ?? /* @__PURE__ */ K(n.reference, u.lang) ?? (a ? /* @__PURE__ */ q(u.lang) : null) ?? t.message ?? /* @__PURE__ */ A(u.lang);
48
- c !== void 0 && (u.message = typeof c == "function" ? c(u) : c), a && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
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);
48
+ c !== void 0 && (u.message = typeof c == "function" ? (
49
+ // @ts-expect-error
50
+ c(u)
51
+ ) : c), a && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
49
52
  }
50
53
  // @__NO_SIDE_EFFECTS__
51
54
  function o(n) {
@@ -58,79 +61,85 @@ function o(n) {
58
61
  };
59
62
  }
60
63
  // @__NO_SIDE_EFFECTS__
61
- function S(n, s) {
64
+ function O(n, s) {
62
65
  return Object.hasOwn(n, s) && s !== "__proto__" && s !== "prototype" && s !== "constructor";
63
66
  }
64
67
  // @__NO_SIDE_EFFECTS__
65
- function D(n, s) {
68
+ function $(n, s) {
66
69
  const e = [...new Set(n)];
67
70
  return e.length > 1 ? `(${e.join(` ${s} `)})` : e[0] ?? "never";
68
71
  }
69
72
  // @__NO_SIDE_EFFECTS__
70
- function M(n, s) {
73
+ function K(n, s) {
71
74
  return {
72
75
  kind: "validation",
73
76
  type: "check",
74
- reference: M,
77
+ reference: K,
75
78
  async: !0,
76
79
  expects: null,
77
80
  requirement: n,
78
81
  message: s,
79
- async "~run"(e, t) {
80
- return e.typed && !await this.requirement(e.value) && y(this, "input", e, t), e;
82
+ async "~run"(e, r) {
83
+ return e.typed && !await this.requirement(e.value) && y(this, "input", e, r), e;
81
84
  }
82
85
  };
83
86
  }
84
87
  // @__NO_SIDE_EFFECTS__
85
- function V(n, s) {
88
+ function M(n, s) {
86
89
  return {
87
90
  kind: "validation",
88
91
  type: "max_length",
89
- reference: V,
92
+ reference: M,
90
93
  async: !1,
91
94
  expects: `<=${n}`,
92
95
  requirement: n,
93
96
  message: s,
94
- "~run"(e, t) {
95
- return e.typed && e.value.length > this.requirement && y(this, "length", e, t, { received: `${e.value.length}` }), e;
97
+ "~run"(e, r) {
98
+ return e.typed && e.value.length > this.requirement && y(this, "length", e, r, {
99
+ received: `${e.value.length}`
100
+ }), e;
96
101
  }
97
102
  };
98
103
  }
99
104
  // @__NO_SIDE_EFFECTS__
100
- function G(n, s) {
105
+ function V(n, s) {
101
106
  return {
102
107
  kind: "validation",
103
108
  type: "min_length",
104
- reference: G,
109
+ reference: V,
105
110
  async: !1,
106
111
  expects: `>=${n}`,
107
112
  requirement: n,
108
113
  message: s,
109
- "~run"(e, t) {
110
- return e.typed && e.value.length < this.requirement && y(this, "length", e, t, { received: `${e.value.length}` }), e;
114
+ "~run"(e, r) {
115
+ return e.typed && e.value.length < this.requirement && y(this, "length", e, r, {
116
+ received: `${e.value.length}`
117
+ }), e;
111
118
  }
112
119
  };
113
120
  }
114
121
  // @__NO_SIDE_EFFECTS__
115
- function L(n) {
122
+ function G(n) {
116
123
  return {
117
124
  kind: "validation",
118
125
  type: "non_empty",
119
- reference: L,
126
+ reference: G,
120
127
  async: !1,
121
128
  expects: "!0",
122
129
  message: n,
123
130
  "~run"(s, e) {
124
- return s.typed && s.value.length === 0 && y(this, "length", s, e, { received: "0" }), s;
131
+ return s.typed && s.value.length === 0 && y(this, "length", s, e, {
132
+ received: "0"
133
+ }), s;
125
134
  }
126
135
  };
127
136
  }
128
137
  // @__NO_SIDE_EFFECTS__
129
- function N() {
138
+ function L() {
130
139
  return {
131
140
  kind: "transformation",
132
141
  type: "trim",
133
- reference: N,
142
+ reference: L,
134
143
  async: !1,
135
144
  "~run"(n) {
136
145
  return n.value = n.value.trim(), n;
@@ -138,19 +147,31 @@ function N() {
138
147
  };
139
148
  }
140
149
  // @__NO_SIDE_EFFECTS__
141
- function I(n, s, e) {
142
- return typeof n.fallback == "function" ? n.fallback(s, e) : n.fallback;
150
+ function S(n, s, e) {
151
+ return typeof n.fallback == "function" ? (
152
+ // @ts-expect-error
153
+ n.fallback(s, e)
154
+ ) : (
155
+ // @ts-expect-error
156
+ n.fallback
157
+ );
143
158
  }
144
159
  // @__NO_SIDE_EFFECTS__
145
- function P(n, s, e) {
146
- return typeof n.default == "function" ? n.default(s, e) : n.default;
160
+ function D(n, s, e) {
161
+ return typeof n.default == "function" ? (
162
+ // @ts-expect-error
163
+ n.default(s, e)
164
+ ) : (
165
+ // @ts-expect-error
166
+ n.default
167
+ );
147
168
  }
148
169
  // @__NO_SIDE_EFFECTS__
149
- function C(n, s) {
170
+ function N(n, s) {
150
171
  return {
151
172
  kind: "schema",
152
173
  type: "array",
153
- reference: C,
174
+ reference: N,
154
175
  expects: "Array",
155
176
  async: !1,
156
177
  item: n,
@@ -158,41 +179,42 @@ function C(n, s) {
158
179
  get "~standard"() {
159
180
  return /* @__PURE__ */ o(this);
160
181
  },
161
- "~run"(e, t) {
182
+ "~run"(e, r) {
162
183
  var l;
163
- const r = e.value;
164
- if (Array.isArray(r)) {
184
+ const t = e.value;
185
+ if (Array.isArray(t)) {
165
186
  e.typed = !0, e.value = [];
166
- for (let i = 0; i < r.length; i++) {
167
- const p = r[i], u = this.item["~run"]({ value: p }, t);
187
+ for (let i = 0; i < t.length; i++) {
188
+ const p = t[i], u = this.item["~run"]({ value: p }, r);
168
189
  if (u.issues) {
169
190
  const a = {
170
191
  type: "array",
171
192
  origin: "value",
172
- input: r,
193
+ input: t,
173
194
  key: i,
174
195
  value: p
175
196
  };
176
197
  for (const c of u.issues)
177
198
  c.path ? c.path.unshift(a) : c.path = [a], (l = e.issues) == null || l.push(c);
178
- if (e.issues || (e.issues = u.issues), t.abortEarly) {
199
+ if (e.issues || (e.issues = u.issues), r.abortEarly) {
179
200
  e.typed = !1;
180
201
  break;
181
202
  }
182
203
  }
183
204
  u.typed || (e.typed = !1), e.value.push(u.value);
184
205
  }
185
- } else y(this, "type", e, t);
206
+ } else
207
+ y(this, "type", e, r);
186
208
  return e;
187
209
  }
188
210
  };
189
211
  }
190
212
  // @__NO_SIDE_EFFECTS__
191
- function F(n) {
213
+ function C(n) {
192
214
  return {
193
215
  kind: "schema",
194
216
  type: "boolean",
195
- reference: F,
217
+ reference: C,
196
218
  expects: "boolean",
197
219
  async: !1,
198
220
  message: n,
@@ -205,11 +227,11 @@ function F(n) {
205
227
  };
206
228
  }
207
229
  // @__NO_SIDE_EFFECTS__
208
- function R(n, s) {
230
+ function F(n, s) {
209
231
  return {
210
232
  kind: "schema",
211
233
  type: "custom",
212
- reference: R,
234
+ reference: F,
213
235
  expects: "unknown",
214
236
  async: !1,
215
237
  check: n,
@@ -217,17 +239,17 @@ function R(n, s) {
217
239
  get "~standard"() {
218
240
  return /* @__PURE__ */ o(this);
219
241
  },
220
- "~run"(e, t) {
221
- return this.check(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
242
+ "~run"(e, r) {
243
+ return this.check(e.value) ? e.typed = !0 : y(this, "type", e, r), e;
222
244
  }
223
245
  };
224
246
  }
225
247
  // @__NO_SIDE_EFFECTS__
226
- function z(n, s) {
248
+ function R(n, s) {
227
249
  return {
228
250
  kind: "schema",
229
251
  type: "literal",
230
- reference: z,
252
+ reference: R,
231
253
  expects: /* @__PURE__ */ _(n),
232
254
  async: !1,
233
255
  literal: n,
@@ -235,17 +257,17 @@ function z(n, s) {
235
257
  get "~standard"() {
236
258
  return /* @__PURE__ */ o(this);
237
259
  },
238
- "~run"(e, t) {
239
- return e.value === this.literal ? e.typed = !0 : y(this, "type", e, t), e;
260
+ "~run"(e, r) {
261
+ return e.value === this.literal ? e.typed = !0 : y(this, "type", e, r), e;
240
262
  }
241
263
  };
242
264
  }
243
265
  // @__NO_SIDE_EFFECTS__
244
- function B(n, s) {
266
+ function z(n, s) {
245
267
  return {
246
268
  kind: "schema",
247
269
  type: "loose_object",
248
- reference: B,
270
+ reference: z,
249
271
  expects: "Object",
250
272
  async: !1,
251
273
  entries: n,
@@ -253,58 +275,68 @@ function B(n, s) {
253
275
  get "~standard"() {
254
276
  return /* @__PURE__ */ o(this);
255
277
  },
256
- "~run"(e, t) {
278
+ "~run"(e, r) {
257
279
  var l;
258
- const r = e.value;
259
- if (r && typeof r == "object") {
280
+ const t = e.value;
281
+ if (t && typeof t == "object") {
260
282
  e.typed = !0, e.value = {};
261
283
  for (const i in this.entries) {
262
284
  const p = this.entries[i];
263
- if (i in r || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
264
- const u = i in r ? r[i] : /* @__PURE__ */ P(p), a = p["~run"]({ value: u }, t);
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);
265
291
  if (a.issues) {
266
292
  const c = {
267
293
  type: "object",
268
294
  origin: "value",
269
- input: r,
295
+ input: t,
270
296
  key: i,
271
297
  value: u
272
298
  };
273
299
  for (const f of a.issues)
274
300
  f.path ? f.path.unshift(c) : f.path = [c], (l = e.issues) == null || l.push(f);
275
- if (e.issues || (e.issues = a.issues), t.abortEarly) {
301
+ if (e.issues || (e.issues = a.issues), r.abortEarly) {
276
302
  e.typed = !1;
277
303
  break;
278
304
  }
279
305
  }
280
306
  a.typed || (e.typed = !1), e.value[i] = a.value;
281
- } else if (p.fallback !== void 0) e.value[i] = /* @__PURE__ */ I(p);
282
- else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (y(this, "key", e, t, {
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, {
283
310
  input: void 0,
284
311
  expected: `"${i}"`,
285
- path: [{
286
- type: "object",
287
- origin: "key",
288
- input: r,
289
- key: i,
290
- value: r[i]
291
- }]
292
- }), t.abortEarly))
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))
293
323
  break;
294
324
  }
295
- if (!e.issues || !t.abortEarly)
296
- for (const i in r) /* @__PURE__ */ S(r, i) && !(i in this.entries) && (e.value[i] = r[i]);
297
- } else y(this, "type", e, t);
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);
298
330
  return e;
299
331
  }
300
332
  };
301
333
  }
302
334
  // @__NO_SIDE_EFFECTS__
303
- function H(n) {
335
+ function B(n) {
304
336
  return {
305
337
  kind: "schema",
306
338
  type: "number",
307
- reference: H,
339
+ reference: B,
308
340
  expects: "number",
309
341
  async: !1,
310
342
  message: n,
@@ -317,11 +349,11 @@ function H(n) {
317
349
  };
318
350
  }
319
351
  // @__NO_SIDE_EFFECTS__
320
- function J(n, s) {
352
+ function H(n, s) {
321
353
  return {
322
354
  kind: "schema",
323
355
  type: "object",
324
- reference: J,
356
+ reference: H,
325
357
  expects: "Object",
326
358
  async: !1,
327
359
  entries: n,
@@ -329,56 +361,65 @@ function J(n, s) {
329
361
  get "~standard"() {
330
362
  return /* @__PURE__ */ o(this);
331
363
  },
332
- "~run"(e, t) {
364
+ "~run"(e, r) {
333
365
  var l;
334
- const r = e.value;
335
- if (r && typeof r == "object") {
366
+ const t = e.value;
367
+ if (t && typeof t == "object") {
336
368
  e.typed = !0, e.value = {};
337
369
  for (const i in this.entries) {
338
370
  const p = this.entries[i];
339
- if (i in r || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
340
- const u = i in r ? r[i] : /* @__PURE__ */ P(p), a = p["~run"]({ value: u }, t);
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 ? (
374
+ // @ts-expect-error
375
+ t[i]
376
+ ) : /* @__PURE__ */ D(p), a = p["~run"]({ value: u }, r);
341
377
  if (a.issues) {
342
378
  const c = {
343
379
  type: "object",
344
380
  origin: "value",
345
- input: r,
381
+ input: t,
346
382
  key: i,
347
383
  value: u
348
384
  };
349
385
  for (const f of a.issues)
350
386
  f.path ? f.path.unshift(c) : f.path = [c], (l = e.issues) == null || l.push(f);
351
- if (e.issues || (e.issues = a.issues), t.abortEarly) {
387
+ if (e.issues || (e.issues = a.issues), r.abortEarly) {
352
388
  e.typed = !1;
353
389
  break;
354
390
  }
355
391
  }
356
392
  a.typed || (e.typed = !1), e.value[i] = a.value;
357
- } else if (p.fallback !== void 0) e.value[i] = /* @__PURE__ */ I(p);
358
- else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (y(this, "key", e, t, {
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, {
359
396
  input: void 0,
360
397
  expected: `"${i}"`,
361
- path: [{
362
- type: "object",
363
- origin: "key",
364
- input: r,
365
- key: i,
366
- value: r[i]
367
- }]
368
- }), t.abortEarly))
398
+ path: [
399
+ {
400
+ type: "object",
401
+ origin: "key",
402
+ input: t,
403
+ key: i,
404
+ // @ts-expect-error
405
+ value: t[i]
406
+ }
407
+ ]
408
+ }), r.abortEarly))
369
409
  break;
370
410
  }
371
- } else y(this, "type", e, t);
411
+ } else
412
+ y(this, "type", e, r);
372
413
  return e;
373
414
  }
374
415
  };
375
416
  }
376
417
  // @__NO_SIDE_EFFECTS__
377
- function Q(n, s) {
418
+ function J(n, s) {
378
419
  return {
379
420
  kind: "schema",
380
421
  type: "optional",
381
- reference: Q,
422
+ reference: J,
382
423
  expects: `(${n.expects} | undefined)`,
383
424
  async: !1,
384
425
  wrapped: n,
@@ -386,35 +427,35 @@ function Q(n, s) {
386
427
  get "~standard"() {
387
428
  return /* @__PURE__ */ o(this);
388
429
  },
389
- "~run"(e, t) {
390
- return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ P(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
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);
391
432
  }
392
433
  };
393
434
  }
394
435
  // @__NO_SIDE_EFFECTS__
395
- function T(n, s) {
436
+ function Q(n, s) {
396
437
  return {
397
438
  kind: "schema",
398
439
  type: "picklist",
399
- reference: T,
400
- expects: /* @__PURE__ */ D(n.map(_), "|"),
440
+ reference: Q,
441
+ expects: /* @__PURE__ */ $(n.map(_), "|"),
401
442
  async: !1,
402
443
  options: n,
403
444
  message: s,
404
445
  get "~standard"() {
405
446
  return /* @__PURE__ */ o(this);
406
447
  },
407
- "~run"(e, t) {
408
- return this.options.includes(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
448
+ "~run"(e, r) {
449
+ return this.options.includes(e.value) ? e.typed = !0 : y(this, "type", e, r), e;
409
450
  }
410
451
  };
411
452
  }
412
453
  // @__NO_SIDE_EFFECTS__
413
- function U(n, s, e) {
454
+ function T(n, s, e) {
414
455
  return {
415
456
  kind: "schema",
416
457
  type: "record",
417
- reference: U,
458
+ reference: T,
418
459
  expects: "Object",
419
460
  async: !1,
420
461
  key: n,
@@ -423,57 +464,62 @@ function U(n, s, e) {
423
464
  get "~standard"() {
424
465
  return /* @__PURE__ */ o(this);
425
466
  },
426
- "~run"(t, r) {
467
+ "~run"(r, t) {
427
468
  var i, p;
428
- const l = t.value;
469
+ const l = r.value;
429
470
  if (l && typeof l == "object") {
430
- t.typed = !0, t.value = {};
431
- for (const u in l) if (/* @__PURE__ */ S(l, u)) {
432
- const a = l[u], c = this.key["~run"]({ value: u }, r);
433
- if (c.issues) {
434
- const b = {
435
- type: "object",
436
- origin: "key",
437
- input: l,
438
- key: u,
439
- value: a
440
- };
441
- for (const h of c.issues)
442
- h.path = [b], (i = t.issues) == null || i.push(h);
443
- if (t.issues || (t.issues = c.issues), r.abortEarly) {
444
- t.typed = !1;
445
- break;
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
+ }
446
489
  }
447
- }
448
- const f = this.value["~run"]({ value: a }, r);
449
- if (f.issues) {
450
- const b = {
451
- type: "object",
452
- origin: "value",
453
- input: l,
454
- key: u,
455
- value: a
456
- };
457
- for (const h of f.issues)
458
- h.path ? h.path.unshift(b) : h.path = [b], (p = t.issues) == null || p.push(h);
459
- if (t.issues || (t.issues = f.issues), r.abortEarly) {
460
- t.typed = !1;
461
- break;
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
+ }
462
508
  }
509
+ (!c.typed || !f.typed) && (r.typed = !1), c.typed && (r.value[c.value] = f.value);
463
510
  }
464
- (!c.typed || !f.typed) && (t.typed = !1), c.typed && (t.value[c.value] = f.value);
465
- }
466
- } else y(this, "type", t, r);
467
- return t;
511
+ } else
512
+ y(this, "type", r, t);
513
+ return r;
468
514
  }
469
515
  };
470
516
  }
471
517
  // @__NO_SIDE_EFFECTS__
472
- function W(n) {
518
+ function U(n) {
473
519
  return {
474
520
  kind: "schema",
475
521
  type: "string",
476
- reference: W,
522
+ reference: U,
477
523
  expects: "string",
478
524
  async: !1,
479
525
  message: n,
@@ -486,53 +532,68 @@ function W(n) {
486
532
  };
487
533
  }
488
534
  // @__NO_SIDE_EFFECTS__
489
- function O(n) {
535
+ function w(n) {
490
536
  let s;
491
- if (n) for (const e of n) s ? s.push(...e.issues) : s = e.issues;
537
+ if (n)
538
+ for (const e of n)
539
+ s ? s.push(...e.issues) : s = e.issues;
492
540
  return s;
493
541
  }
494
542
  // @__NO_SIDE_EFFECTS__
495
- function X(n, s) {
543
+ function W(n, s) {
496
544
  return {
497
545
  kind: "schema",
498
546
  type: "union",
499
- reference: X,
500
- expects: /* @__PURE__ */ D(n.map((e) => e.expects), "|"),
547
+ reference: W,
548
+ expects: /* @__PURE__ */ $(
549
+ n.map((e) => e.expects),
550
+ "|"
551
+ ),
501
552
  async: !1,
502
553
  options: n,
503
554
  message: s,
504
555
  get "~standard"() {
505
556
  return /* @__PURE__ */ o(this);
506
557
  },
507
- "~run"(e, t) {
508
- let r, l, i;
558
+ "~run"(e, r) {
559
+ let t, l, i;
509
560
  for (const p of this.options) {
510
- const u = p["~run"]({ value: e.value }, t);
511
- if (u.typed) if (u.issues) l ? l.push(u) : l = [u];
512
- else {
513
- r = u;
514
- break;
515
- }
516
- else i ? i.push(u) : i = [u];
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];
517
571
  }
518
- if (r) return r;
572
+ if (t)
573
+ return t;
519
574
  if (l) {
520
- if (l.length === 1) return l[0];
521
- y(this, "type", e, t, { issues: /* @__PURE__ */ O(l) }), e.typed = !0;
575
+ if (l.length === 1)
576
+ return l[0];
577
+ y(this, "type", e, r, {
578
+ issues: /* @__PURE__ */ w(l)
579
+ }), e.typed = !0;
522
580
  } else {
523
- if ((i == null ? void 0 : i.length) === 1) return i[0];
524
- y(this, "type", e, t, { issues: /* @__PURE__ */ O(i) });
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
+ });
525
586
  }
526
587
  return e;
527
588
  }
528
589
  };
529
590
  }
530
591
  // @__NO_SIDE_EFFECTS__
531
- function Y() {
592
+ function X() {
532
593
  return {
533
594
  kind: "schema",
534
595
  type: "unknown",
535
- reference: Y,
596
+ reference: X,
536
597
  expects: "unknown",
537
598
  async: !1,
538
599
  get "~standard"() {
@@ -544,11 +605,11 @@ function Y() {
544
605
  };
545
606
  }
546
607
  // @__NO_SIDE_EFFECTS__
547
- function Z(n, s, e) {
608
+ function Y(n, s, e) {
548
609
  return {
549
610
  kind: "schema",
550
611
  type: "variant",
551
- reference: Z,
612
+ reference: Y,
552
613
  expects: "Object",
553
614
  async: !1,
554
615
  key: n,
@@ -557,53 +618,64 @@ function Z(n, s, e) {
557
618
  get "~standard"() {
558
619
  return /* @__PURE__ */ o(this);
559
620
  },
560
- "~run"(t, r) {
561
- const l = t.value;
621
+ "~run"(r, t) {
622
+ const l = r.value;
562
623
  if (l && typeof l == "object") {
563
624
  let i, p = 0, u = this.key, a = [];
564
625
  const c = (f, b) => {
565
626
  for (const h of f.options) {
566
- if (h.type === "variant") c(h, new Set(b).add(h.key));
627
+ if (h.type === "variant")
628
+ c(h, new Set(b).add(h.key));
567
629
  else {
568
- let w = !0, k = 0;
630
+ let P = !0, k = 0;
569
631
  for (const v of b) {
570
632
  const g = h.entries[v];
571
- if (v in l ? g["~run"]({
572
- typed: !1,
573
- value: l[v]
574
- }, { abortEarly: !0 }).issues : g.type !== "exact_optional" && g.type !== "optional" && g.type !== "nullish") {
575
- w = !1, u !== v && (p < k || p === k && v in l && !(u in l)) && (p = k, u = v, a = []), u === v && a.push(h.entries[v].expects);
633
+ if (v in l ? g["~run"](
634
+ // @ts-expect-error
635
+ { typed: !1, value: l[v] },
636
+ { 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
640
+ );
576
641
  break;
577
642
  }
578
643
  k++;
579
644
  }
580
- if (w) {
581
- const v = h["~run"]({ value: l }, r);
645
+ if (P) {
646
+ const v = h["~run"]({ value: l }, t);
582
647
  (!i || !i.typed && v.typed) && (i = v);
583
648
  }
584
649
  }
585
- if (i && !i.issues) break;
650
+ if (i && !i.issues)
651
+ break;
586
652
  }
587
653
  };
588
- if (c(this, /* @__PURE__ */ new Set([this.key])), i) return i;
589
- y(this, "type", t, r, {
654
+ if (c(this, /* @__PURE__ */ new Set([this.key])), i)
655
+ return i;
656
+ y(this, "type", r, t, {
657
+ // @ts-expect-error
590
658
  input: l[u],
591
- expected: /* @__PURE__ */ D(a, "|"),
592
- path: [{
593
- type: "object",
594
- origin: "value",
595
- input: l,
596
- key: u,
597
- value: l[u]
598
- }]
659
+ expected: /* @__PURE__ */ $(a, "|"),
660
+ path: [
661
+ {
662
+ type: "object",
663
+ origin: "value",
664
+ input: l,
665
+ key: u,
666
+ // @ts-expect-error
667
+ value: l[u]
668
+ }
669
+ ]
599
670
  });
600
- } else y(this, "type", t, r);
601
- return t;
671
+ } else
672
+ y(this, "type", r, t);
673
+ return r;
602
674
  }
603
675
  };
604
676
  }
605
677
  // @__NO_SIDE_EFFECTS__
606
- function $(...n) {
678
+ function Z(...n) {
607
679
  return {
608
680
  ...n[0],
609
681
  pipe: n,
@@ -611,13 +683,14 @@ function $(...n) {
611
683
  return /* @__PURE__ */ o(this);
612
684
  },
613
685
  "~run"(s, e) {
614
- for (const t of n) if (t.kind !== "metadata") {
615
- if (s.issues && (t.kind === "schema" || t.kind === "transformation")) {
616
- s.typed = !1;
617
- break;
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;
690
+ break;
691
+ }
692
+ (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = r["~run"](s, e));
618
693
  }
619
- (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = t["~run"](s, e));
620
- }
621
694
  return s;
622
695
  }
623
696
  };
@@ -632,70 +705,74 @@ function ee(...n) {
632
705
  return /* @__PURE__ */ o(this);
633
706
  },
634
707
  async "~run"(s, e) {
635
- for (const t of n) if (t.kind !== "metadata") {
636
- if (s.issues && (t.kind === "schema" || t.kind === "transformation")) {
637
- s.typed = !1;
638
- break;
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;
712
+ break;
713
+ }
714
+ (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = await r["~run"](s, e));
639
715
  }
640
- (!s.issues || !e.abortEarly && !e.abortPipeEarly) && (s = await t["~run"](s, e));
641
- }
642
716
  return s;
643
717
  }
644
718
  };
645
719
  }
646
720
  // @__NO_SIDE_EFFECTS__
647
721
  function ne(n, s, e) {
648
- const t = n["~run"]({ value: s }, /* @__PURE__ */ j(e));
722
+ const r = n["~run"]({ value: s }, /* @__PURE__ */ j(e));
649
723
  return {
650
- typed: t.typed,
651
- success: !t.issues,
652
- output: t.value,
653
- issues: t.issues
724
+ typed: r.typed,
725
+ success: !r.issues,
726
+ output: r.value,
727
+ issues: r.issues
654
728
  };
655
729
  }
656
730
  // @__NO_SIDE_EFFECTS__
657
731
  async function se(n, s, e) {
658
- const t = await n["~run"]({ value: s }, /* @__PURE__ */ j(e));
732
+ const r = await n["~run"](
733
+ { value: s },
734
+ /* @__PURE__ */ j(e)
735
+ );
659
736
  return {
660
- typed: t.typed,
661
- success: !t.issues,
662
- output: t.value,
663
- issues: t.issues
737
+ typed: r.typed,
738
+ success: !r.issues,
739
+ output: r.value,
740
+ issues: r.issues
664
741
  };
665
742
  }
666
743
  export {
667
744
  y as _addIssue,
668
745
  o as _getStandardProps,
669
- S as _isValidObjectKey,
670
- D as _joinExpects,
746
+ O as _isValidObjectKey,
747
+ $ as _joinExpects,
671
748
  _ as _stringify,
672
- C as array,
673
- F as boolean,
674
- M as checkAsync,
675
- R as custom,
676
- P as getDefault,
677
- I as getFallback,
749
+ N as array,
750
+ C as boolean,
751
+ K as checkAsync,
752
+ F as custom,
753
+ D as getDefault,
754
+ S as getFallback,
678
755
  j as getGlobalConfig,
679
- A as getGlobalMessage,
680
- q as getSchemaMessage,
681
- K as getSpecificMessage,
682
- z as literal,
683
- B as looseObject,
684
- V as maxLength,
685
- G as minLength,
686
- L as nonEmpty,
687
- H as number,
688
- J as object,
689
- Q as optional,
690
- T as picklist,
691
- $ as pipe,
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,
692
769
  ee as pipeAsync,
693
- U as record,
770
+ T as record,
694
771
  ne as safeParse,
695
772
  se as safeParseAsync,
696
- W as string,
697
- N as trim,
698
- X as union,
699
- Y as unknown,
700
- Z as variant
773
+ U as string,
774
+ L as trim,
775
+ W as union,
776
+ X as unknown,
777
+ Y as variant
701
778
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.3.0-beta.6d597b3",
3
+ "version": "3.3.0-beta.878c1c2",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -39,7 +39,7 @@
39
39
  "@vueuse/core": "11.3.0",
40
40
  "lodash-es": "4.17.21",
41
41
  "pinia": "2.3.1",
42
- "valibot": "1.2.0",
42
+ "valibot": "1.1.0",
43
43
  "vite": "6.3.5",
44
44
  "vue": "2.7.14"
45
45
  },
@@ -82,35 +82,8 @@
82
82
  "vue-tsc": "2.2.10"
83
83
  },
84
84
  "overrides": {
85
- "@isaacs/brace-expansion": "^5.0.1",
86
- "axios": "^1.8.2",
87
- "follow-redirects": "^1.14.7",
88
- "flatted": "^3.4.0",
89
- "immutable": "^4.3.8",
90
85
  "micromatch": "4.0.8",
91
- "minimatch": "^3.1.3",
92
- "@microsoft/api-extractor": {
93
- "minimatch": "^10.2.1"
94
- },
95
- "@typescript-eslint/typescript-estree": {
96
- "minimatch": "^9.0.6"
97
- },
98
- "@vue/language-core": {
99
- "minimatch": "^9.0.6"
100
- },
101
- "path-to-regexp": "6.3.0",
102
- "picomatch": "^2.3.2",
103
- "@rollup/pluginutils": {
104
- "picomatch": "^4.0.4"
105
- },
106
- "@stylistic/eslint-plugin": {
107
- "picomatch": "^4.0.4"
108
- },
109
- "fdir": {
110
- "picomatch": "^4.0.4"
111
- },
112
- "ag-grid-community": "^31.3.4",
113
- "ag-grid-enterprise": "^31.3.4"
86
+ "path-to-regexp": "6.3.0"
114
87
  },
115
88
  "msw": {
116
89
  "workerDirectory": "public"