@askdialog/dialog-vue 3.7.0 → 3.8.0

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,33 +1,33 @@
1
- var Se = Object.defineProperty;
2
- var Ce = (t, e, o) => e in t ? Se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var j = (t, e, o) => Ce(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { defineComponent as w, createElementBlock as h, openBlock as c, createElementVNode as l, toDisplayString as E, Fragment as N, renderList as W, createVNode as I, createBlock as O, ref as k, withDirectives as re, withKeys as ye, vModelText as ae, onMounted as B, watch as q, renderSlot as Ee, computed as C, withCtx as ie, createCommentVNode as L, withModifiers as we, unref as K, resolveDynamicComponent as $e, mergeProps as Re, toHandlers as Te, createTextVNode as le, onUnmounted as ce, Teleport as Ie, normalizeStyle as ke, normalizeClass as Y, shallowRef as Le } from "vue";
5
- const Ae = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), xe = (t) => t !== void 0 && Ae.has(t.trim().toLowerCase().slice(0, 2)), De = (t) => xe(t) ? "rtl" : "ltr";
6
- var M;
1
+ var Ce = Object.defineProperty;
2
+ var ye = (t, e, s) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var z = (t, e, s) => ye(t, typeof e != "symbol" ? e + "" : e, s);
4
+ import { defineComponent as w, createElementBlock as _, openBlock as u, createElementVNode as l, toDisplayString as E, Fragment as N, renderList as Q, createVNode as T, createBlock as O, ref as k, computed as b, withDirectives as ae, withKeys as Ee, vModelText as ie, onMounted as B, watch as M, renderSlot as we, withCtx as le, createCommentVNode as A, withModifiers as Ie, unref as K, resolveDynamicComponent as $e, mergeProps as Re, toHandlers as Te, createTextVNode as ce, onUnmounted as ue, Teleport as ke, normalizeStyle as Ae, normalizeClass as Z, shallowRef as Le } from "vue";
5
+ const xe = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), De = (t) => t !== void 0 && xe.has(t.trim().toLowerCase().slice(0, 2)), Pe = (t) => De(t) ? "rtl" : "ltr";
6
+ var q;
7
7
  (function(t) {
8
- t.OPEN_ASSISTANT = "open_assistant", t.CLOSE_ASSISTANT = "close_assistant", t.SEND_MESSAGE = "PRODUCT_QUESTION", t.SEND_GENERIC_QUESTION = "GENERIC_QUESTION", t.TRACK_ADD_TO_CART = "TRACK_ADD_TO_CART", t.TRACK_SUBMIT_CHECKOUT = "TRACK_SUBMIT_CHECKOUT", t.TRACK_VIEW_SEARCH_RESULTS = "TRACK_VIEW_SEARCH_RESULTS", t.TRACK_SELECT_SEARCH_RESULT = "TRACK_SELECT_SEARCH_RESULT";
9
- })(M || (M = {}));
8
+ t.OPEN_ASSISTANT = "open_assistant", t.OPEN_WITH_SUGGESTIONS = "OPEN_WITH_SUGGESTIONS", t.CLOSE_ASSISTANT = "close_assistant", t.SEND_MESSAGE = "PRODUCT_QUESTION", t.SEND_GENERIC_QUESTION = "GENERIC_QUESTION", t.TRACK_ADD_TO_CART = "TRACK_ADD_TO_CART", t.TRACK_SUBMIT_CHECKOUT = "TRACK_SUBMIT_CHECKOUT", t.TRACK_VIEW_SEARCH_RESULTS = "TRACK_VIEW_SEARCH_RESULTS", t.TRACK_SELECT_SEARCH_RESULT = "TRACK_SELECT_SEARCH_RESULT";
9
+ })(q || (q = {}));
10
10
  var J;
11
11
  (function(t) {
12
12
  t.USER_OPENED_ASSISTANT = "userOpenedAssistant", t.USER_CLOSED_ASSISTANT = "userClosedAssistant", t.USER_SENT_MESSAGE = "userSentMessage", t.USER_CLICKED_ON_PRODUCT_CARD = "userClickedOnProductCard", t.USER_OPENED_RECOMMENDATION = "userOpenedRecommendation", t.USER_ADDED_TO_CART = "userAddedToCart", t.USER_SEND_POSITIVE_FEEDBACK = "userSendPositiveFeedback", t.USER_SEND_NEGATIVE_FEEDBACK = "userSendNegativeFeedback";
13
13
  })(J || (J = {}));
14
- M.TRACK_ADD_TO_CART, M.TRACK_SUBMIT_CHECKOUT, M.TRACK_VIEW_SEARCH_RESULTS, M.TRACK_SELECT_SEARCH_RESULT;
15
- class Pe extends Error {
16
- constructor({ status: o, code: s, message: r }) {
14
+ q.TRACK_ADD_TO_CART, q.TRACK_SUBMIT_CHECKOUT, q.TRACK_VIEW_SEARCH_RESULTS, q.TRACK_SELECT_SEARCH_RESULT;
15
+ class Oe extends Error {
16
+ constructor({ status: s, code: o, message: r }) {
17
17
  super(r);
18
- j(this, "status");
19
- j(this, "code");
20
- this.name = "DialogSearchError", this.status = o, this.code = s;
18
+ z(this, "status");
19
+ z(this, "code");
20
+ this.name = "DialogSearchError", this.status = s, this.code = o;
21
21
  }
22
22
  }
23
- const X = (t, e, o) => {
23
+ const X = (t, e, s) => {
24
24
  if (!/^[a-z]{2}$/.test(e))
25
25
  throw new Error("Search language must be a lowercase ISO 639-1 code.");
26
- if (!/^[A-Za-z]{3}$/.test(o))
26
+ if (!/^[A-Za-z]{3}$/.test(s))
27
27
  throw new Error("Search currency must be an ISO 4217 code.");
28
- return `${t}_${e}_${o.toLowerCase()}`;
29
- }, ee = "multiple installation methods detected:", Oe = () => typeof window > "u" ? void 0 : window, ue = () => {
30
- const t = Oe();
28
+ return `${t}_${e}_${s.toLowerCase()}`;
29
+ }, ee = "multiple installation methods detected:", Ne = () => typeof window > "u" ? void 0 : window, de = () => {
30
+ const t = Ne();
31
31
  if (t !== void 0)
32
32
  return t.dialog = t.dialog ?? {}, t.dialog.audit = t.dialog.audit ?? {
33
33
  methods: [],
@@ -35,40 +35,40 @@ const X = (t, e, o) => {
35
35
  capabilities: [],
36
36
  warnings: []
37
37
  }, t.dialog.audit;
38
- }, Ne = (t) => {
38
+ }, qe = (t) => {
39
39
  if (t.warnings = t.warnings.filter((e) => !e.startsWith(ee)), t.methods.length >= 2) {
40
- const e = t.methods.map((o) => o.method).join(", ");
40
+ const e = t.methods.map((s) => s.method).join(", ");
41
41
  t.warnings.push(`${ee} ${e}`);
42
42
  }
43
43
  }, Me = (t, e) => e === void 0 ? t : {
44
44
  version: (t == null ? void 0 : t.version) ?? e.version,
45
45
  commit: (t == null ? void 0 : t.commit) ?? e.commit
46
- }, de = (t) => {
47
- const e = ue();
46
+ }, pe = (t) => {
47
+ const e = de();
48
48
  if (e === void 0)
49
49
  return;
50
- const o = e.methods.find((s) => s.method === t.method);
51
- if (o === void 0) {
52
- e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), Ne(e);
50
+ const s = e.methods.find((o) => o.method === t.method);
51
+ if (s === void 0) {
52
+ e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), qe(e);
53
53
  return;
54
54
  }
55
- o.version = o.version ?? t.version, o.build = Me(o.build, t.build), o.source = o.source ?? t.source;
56
- }, qe = (t) => {
57
- const e = ue();
55
+ s.version = s.version ?? t.version, s.build = Me(s.build, t.build), s.source = s.source ?? t.source;
56
+ }, Ue = (t) => {
57
+ const e = de();
58
58
  e !== void 0 && (e.capabilities.includes(t) || e.capabilities.push(t));
59
- }, A = {
59
+ }, L = {
60
60
  IDLE: "idle",
61
61
  LOADING: "loading",
62
62
  SUCCESS: "success",
63
63
  /** Successful request with zero hits. */
64
64
  EMPTY: "empty",
65
65
  ERROR: "error"
66
- }, Ue = 0.5, He = 500, Ve = 1500, Be = 100;
67
- function Ke({ emit: t, visibilityThreshold: e = Ue, dwellMs: o = He, idleFlushMs: s = Ve, maxItemsPerEvent: r = Be }) {
66
+ }, He = 0.5, Ve = 500, Be = 1500, Ke = 100;
67
+ function Fe({ emit: t, visibilityThreshold: e = He, dwellMs: s = Ve, idleFlushMs: o = Be, maxItemsPerEvent: r = Ke }) {
68
68
  let n, i = [];
69
- const a = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
69
+ const a = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
70
70
  let d;
71
- const f = () => {
71
+ const g = () => {
72
72
  clearTimeout(d), !(n === void 0 || i.length === 0) && (t({ ...n, items: i }), i = []);
73
73
  }, y = (m) => {
74
74
  if (n === void 0)
@@ -76,48 +76,48 @@ function Ke({ emit: t, visibilityThreshold: e = Ue, dwellMs: o = He, idleFlushMs
76
76
  const v = `${n.query_id}:${m.product_id}`;
77
77
  if (!a.has(v)) {
78
78
  if (a.add(v), i.push(m), i.length >= r) {
79
- f();
79
+ g();
80
80
  return;
81
81
  }
82
- clearTimeout(d), d = setTimeout(f, s);
82
+ clearTimeout(d), d = setTimeout(g, o);
83
83
  }
84
- }, b = (m) => {
85
- const v = u.get(m);
86
- v !== void 0 && (clearTimeout(v), u.delete(m));
87
- }, g = new IntersectionObserver((m) => {
84
+ }, S = (m) => {
85
+ const v = c.get(m);
86
+ v !== void 0 && (clearTimeout(v), c.delete(m));
87
+ }, f = new IntersectionObserver((m) => {
88
88
  for (const v of m) {
89
- const p = _.get(v.target);
90
- p !== void 0 && (v.intersectionRatio >= e ? u.has(v.target) || u.set(v.target, setTimeout(() => {
91
- u.delete(v.target), y(p);
92
- }, o)) : b(v.target));
89
+ const p = h.get(v.target);
90
+ p !== void 0 && (v.intersectionRatio >= e ? c.has(v.target) || c.set(v.target, setTimeout(() => {
91
+ c.delete(v.target), y(p);
92
+ }, s)) : S(v.target));
93
93
  }
94
- }, { threshold: e }), $ = () => {
95
- g.disconnect();
96
- for (const m of u.values())
94
+ }, { threshold: e }), I = () => {
95
+ f.disconnect();
96
+ for (const m of c.values())
97
97
  clearTimeout(m);
98
- u.clear(), _.clear();
99
- }, R = () => {
100
- f();
101
- }, T = (m) => {
98
+ c.clear(), h.clear();
99
+ }, $ = () => {
100
+ g();
101
+ }, R = (m) => {
102
102
  if (m.persisted) {
103
103
  a.clear();
104
- for (const v of _.keys())
105
- b(v), g.unobserve(v), g.observe(v);
104
+ for (const v of h.keys())
105
+ S(v), f.unobserve(v), f.observe(v);
106
106
  }
107
107
  };
108
- return window.addEventListener("pagehide", R), window.addEventListener("pageshow", T), {
108
+ return window.addEventListener("pagehide", $), window.addEventListener("pageshow", R), {
109
109
  setContext(m) {
110
- f(), a.clear(), n = m, $();
110
+ g(), a.clear(), n = m, I();
111
111
  },
112
112
  observe(m, v) {
113
- _.set(m, v), g.observe(m);
113
+ h.set(m, v), f.observe(m);
114
114
  },
115
115
  forceImpression(m) {
116
- y(m), f();
116
+ y(m), g();
117
117
  },
118
- flush: f,
118
+ flush: g,
119
119
  disconnect() {
120
- f(), $(), window.removeEventListener("pagehide", R), window.removeEventListener("pageshow", T);
120
+ g(), I(), window.removeEventListener("pagehide", $), window.removeEventListener("pageshow", R);
121
121
  }
122
122
  };
123
123
  }
@@ -126,14 +126,14 @@ const te = (t, e) => ({
126
126
  // One-based position across all pages.
127
127
  position: t.page * t.hitsPerPage + e + 1
128
128
  });
129
- function Fe(t) {
130
- let e, o;
131
- const s = () => (e ?? (e = Ke({
129
+ function ze(t) {
130
+ let e, s;
131
+ const o = () => (e ?? (e = Fe({
132
132
  emit: t.trackViewSearchResults
133
133
  })), e);
134
134
  return {
135
135
  onResponse(r) {
136
- o = {
136
+ s = {
137
137
  query_id: r.queryID,
138
138
  index: r.index,
139
139
  surface: t.surface,
@@ -142,93 +142,93 @@ function Fe(t) {
142
142
  page: r.page + 1,
143
143
  total_hits: r.nbHits,
144
144
  query_length: [...r.query].length
145
- }, s().setContext(o), r.nbHits === 0 && t.trackViewSearchResults({ ...o, items: [] });
145
+ }, o().setContext(s), r.nbHits === 0 && t.trackViewSearchResults({ ...s, items: [] });
146
146
  },
147
147
  observeResult(r, n, i) {
148
- s().observe(r, te(n, i));
148
+ o().observe(r, te(n, i));
149
149
  },
150
150
  select(r, n) {
151
- if (o === void 0)
151
+ if (s === void 0)
152
152
  return;
153
153
  const i = te(r, n);
154
- s().forceImpression(i), t.trackSelectSearchResult({ ...o, items: [i] });
154
+ o().forceImpression(i), t.trackSelectSearchResult({ ...s, items: [i] });
155
155
  },
156
156
  dispose() {
157
157
  e == null || e.disconnect();
158
158
  }
159
159
  };
160
160
  }
161
- const je = 2, oe = (t) => {
161
+ const je = 2, se = (t) => {
162
162
  const e = t.trim();
163
163
  return [...e].length >= je ? e : void 0;
164
- }, ze = (t, e, o, { indexName: s, language: r, currency: n, hitsPerPage: i }) => ({
164
+ }, Ge = (t, e, s, { indexName: o, language: r, currency: n, hitsPerPage: i }) => ({
165
165
  requests: [
166
- { indexName: s, query: t, page: e, hitsPerPage: i },
167
- ...o.map((a) => ({
166
+ { indexName: o, query: t, page: e, hitsPerPage: i },
167
+ ...s.map((a) => ({
168
168
  indexName: X(a.index, r, n),
169
169
  query: t,
170
170
  page: 0,
171
171
  hitsPerPage: a.hitsPerPage ?? i
172
172
  }))
173
173
  ]
174
- }), Ge = (t, e, { indexName: o, language: s, currency: r }) => {
175
- const n = t.results.find((a) => a.index === o);
174
+ }), We = (t, e, { indexName: s, language: o, currency: r }) => {
175
+ const n = t.results.find((a) => a.index === s);
176
176
  if (n === void 0)
177
- throw new Error(`Dialog search returned no ${o} entry`);
177
+ throw new Error(`Dialog search returned no ${s} entry`);
178
178
  const i = {};
179
179
  for (const a of e) {
180
- const _ = X(a.index, s, r), u = t.results.find((d) => d.index === _);
181
- u !== void 0 && (i[a.index] = u);
180
+ const h = X(a.index, o, r), c = t.results.find((d) => d.index === h);
181
+ c !== void 0 && (i[a.index] = c);
182
182
  }
183
183
  return {
184
184
  response: n,
185
185
  sections: e.length === 0 ? void 0 : i
186
186
  };
187
- }, z = {
188
- status: A.IDLE,
187
+ }, j = {
188
+ status: L.IDLE,
189
189
  query: "",
190
190
  page: 0,
191
191
  response: void 0,
192
192
  sections: void 0,
193
193
  error: void 0
194
194
  };
195
- function Qe({ search: t, language: e, currency: o, analytics: s, navigate: r, debounceMs: n = 250, hitsPerPage: i = 12, sections: a = [] }) {
196
- const _ = {
197
- indexName: X("products", e, o),
195
+ function Qe({ search: t, language: e, currency: s, analytics: o, navigate: r, debounceMs: n = 250, hitsPerPage: i = 12, sections: a = [] }) {
196
+ const h = {
197
+ indexName: X("products", e, s),
198
198
  language: e,
199
- currency: o,
199
+ currency: s,
200
200
  hitsPerPage: i
201
201
  };
202
- let u = z;
203
- const d = /* @__PURE__ */ new Set(), f = Fe(s);
204
- let y, b, g, $ = 0, R = !1;
205
- const T = (p) => {
206
- u = { ...u, ...p };
207
- for (const S of d)
208
- S(u);
202
+ let c = j;
203
+ const d = /* @__PURE__ */ new Set(), g = ze(o);
204
+ let y, S, f, I = 0, $ = !1;
205
+ const R = (p) => {
206
+ c = { ...c, ...p };
207
+ for (const C of d)
208
+ C(c);
209
209
  }, m = () => {
210
- clearTimeout(y), b = void 0, $ += 1, g == null || g.abort(), g = void 0;
211
- }, v = async (p, S) => {
212
- m(), g = new AbortController();
213
- const P = $;
214
- T({ status: A.LOADING, query: p, page: S });
210
+ clearTimeout(y), S = void 0, I += 1, f == null || f.abort(), f = void 0;
211
+ }, v = async (p, C) => {
212
+ m(), f = new AbortController();
213
+ const P = I;
214
+ R({ status: L.LOADING, query: p, page: C });
215
215
  try {
216
- const x = typeof a == "function" ? a() : a, Z = ze(p, S, x, _), be = await t(Z, {
217
- signal: g.signal
216
+ const x = typeof a == "function" ? a() : a, Y = Ge(p, C, x, h), Se = await t(Y, {
217
+ signal: f.signal
218
218
  });
219
- if (P !== $)
219
+ if (P !== I)
220
220
  return;
221
- const F = Ge(be, x, _);
222
- f.onResponse(F.response), T({
221
+ const F = We(Se, x, h);
222
+ g.onResponse(F.response), R({
223
223
  ...F,
224
- status: F.response.nbHits === 0 ? A.EMPTY : A.SUCCESS,
224
+ status: F.response.nbHits === 0 ? L.EMPTY : L.SUCCESS,
225
225
  error: void 0
226
226
  });
227
227
  } catch (x) {
228
- if (x instanceof DOMException && x.name === "AbortError" || P !== $)
228
+ if (x instanceof DOMException && x.name === "AbortError" || P !== I)
229
229
  return;
230
- T({
231
- status: A.ERROR,
230
+ R({
231
+ status: L.ERROR,
232
232
  error: x,
233
233
  response: void 0,
234
234
  sections: void 0
@@ -237,62 +237,62 @@ function Qe({ search: t, language: e, currency: o, analytics: s, navigate: r, de
237
237
  };
238
238
  return {
239
239
  setQuery(p) {
240
- if (R)
240
+ if ($)
241
241
  return;
242
242
  m();
243
- const S = oe(p);
244
- if (S === void 0) {
245
- T(z);
243
+ const C = se(p);
244
+ if (C === void 0) {
245
+ R(j);
246
246
  return;
247
247
  }
248
- b = S, y = setTimeout(() => void v(S, 0), n);
248
+ S = C, y = setTimeout(() => void v(C, 0), n);
249
249
  },
250
250
  submit(p) {
251
- if (R)
251
+ if ($)
252
252
  return;
253
253
  m();
254
- const S = oe(p);
255
- if (S === void 0) {
256
- T(z);
254
+ const C = se(p);
255
+ if (C === void 0) {
256
+ R(j);
257
257
  return;
258
258
  }
259
- v(S, 0);
259
+ v(C, 0);
260
260
  },
261
261
  setPage(p) {
262
- if (!R) {
263
- if (b !== void 0) {
264
- v(b, 0);
262
+ if (!$) {
263
+ if (S !== void 0) {
264
+ v(S, 0);
265
265
  return;
266
266
  }
267
- u.query !== "" && v(u.query, p);
267
+ c.query !== "" && v(c.query, p);
268
268
  }
269
269
  },
270
270
  retry() {
271
- R || u.status !== A.ERROR || v(u.query, u.page);
271
+ $ || c.status !== L.ERROR || v(c.query, c.page);
272
272
  },
273
- observeResult(p, S) {
274
- u.response !== void 0 && f.observeResult(p, u.response, S);
273
+ observeResult(p, C) {
274
+ c.response !== void 0 && g.observeResult(p, c.response, C);
275
275
  },
276
- selectResult(p, S) {
277
- const P = u.response;
276
+ selectResult(p, C) {
277
+ const P = c.response;
278
278
  if (P === void 0)
279
279
  return !1;
280
- f.select(P, p);
280
+ g.select(P, p);
281
281
  const x = P.hits[p].url;
282
- return ((S == null ? void 0 : S.navigate) ?? !0) && r !== void 0 && x !== void 0 ? (r(x, P.hits[p]), !0) : !1;
282
+ return ((C == null ? void 0 : C.navigate) ?? !0) && r !== void 0 && x !== void 0 ? (r(x, P.hits[p]), !0) : !1;
283
283
  },
284
284
  subscribe(p) {
285
285
  return d.add(p), () => {
286
286
  d.delete(p);
287
287
  };
288
288
  },
289
- getState: () => u,
289
+ getState: () => c,
290
290
  dispose() {
291
- R = !0, m(), d.clear(), f.dispose();
291
+ $ = !0, m(), d.clear(), g.dispose();
292
292
  }
293
293
  };
294
294
  }
295
- const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-block-title" }, Ze = { class: "dialog-block-description" }, Ye = /* @__PURE__ */ w({
295
+ const Xe = { class: "dialog-block-header-container" }, Ye = { class: "dialog-block-title" }, Ze = { class: "dialog-block-description" }, Je = /* @__PURE__ */ w({
296
296
  __name: "DialogBlockHeader",
297
297
  props: {
298
298
  title: {},
@@ -300,31 +300,31 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
300
300
  },
301
301
  setup(t) {
302
302
  const e = t;
303
- return (o, s) => (c(), h("div", We, [
304
- l("div", Xe, E(e.title ?? "Your expert"), 1),
303
+ return (s, o) => (u(), _("div", Xe, [
304
+ l("div", Ye, E(e.title ?? "Your expert"), 1),
305
305
  l("div", Ze, E(e.description ?? "A question about this product?"), 1)
306
306
  ]));
307
307
  }
308
308
  }), D = (t, e) => {
309
- const o = t.__vccOpts || t;
310
- for (const [s, r] of e)
311
- o[s] = r;
312
- return o;
313
- }, Je = /* @__PURE__ */ D(Ye, [["__scopeId", "data-v-28e6dda7"]]), et = {
309
+ const s = t.__vccOpts || t;
310
+ for (const [o, r] of e)
311
+ s[o] = r;
312
+ return s;
313
+ }, et = /* @__PURE__ */ D(Je, [["__scopeId", "data-v-28e6dda7"]]), tt = {
314
314
  width: "20",
315
315
  height: "20",
316
316
  viewBox: "0 0 20 20",
317
317
  fill: "none",
318
318
  xmlns: "http://www.w3.org/2000/svg"
319
- }, tt = { "clip-path": "url(#clip0_466_934)" }, ot = ["stroke"], st = ["stroke"], nt = /* @__PURE__ */ w({
319
+ }, st = { "clip-path": "url(#clip0_466_934)" }, ot = ["stroke"], nt = ["stroke"], rt = /* @__PURE__ */ w({
320
320
  __name: "AiStarsIcon",
321
321
  props: {
322
322
  color: {}
323
323
  },
324
324
  setup(t) {
325
325
  const e = t;
326
- return (o, s) => (c(), h("svg", et, [
327
- l("g", tt, [
326
+ return (s, o) => (u(), _("svg", tt, [
327
+ l("g", st, [
328
328
  l("path", {
329
329
  d: `M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
330
330
  12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
@@ -356,9 +356,9 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
356
356
  "stroke-width": "1.5",
357
357
  "stroke-linecap": "round",
358
358
  "stroke-linejoin": "round"
359
- }, null, 8, st)
359
+ }, null, 8, nt)
360
360
  ]),
361
- s[0] || (s[0] = l("defs", null, [
361
+ o[0] || (o[0] = l("defs", null, [
362
362
  l("clipPath", { id: "clip0_466_934" }, [
363
363
  l("rect", {
364
364
  width: "20",
@@ -369,7 +369,7 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
369
369
  ], -1))
370
370
  ]));
371
371
  }
372
- }), rt = ["onClick"], at = { class: "dialog-block-suggestions-item-label" }, it = /* @__PURE__ */ w({
372
+ }), at = ["onClick"], it = { class: "dialog-block-suggestions-item-label" }, lt = /* @__PURE__ */ w({
373
373
  __name: "DialogBlockSuggestions",
374
374
  props: {
375
375
  client: {},
@@ -379,36 +379,36 @@ const We = { class: "dialog-block-header-container" }, Xe = { class: "dialog-blo
379
379
  selectedVariantId: {}
380
380
  },
381
381
  setup(t) {
382
- const e = t, o = (s) => {
382
+ const e = t, s = (o) => {
383
383
  e.client.sendProductMessage({
384
384
  productId: e.productId,
385
385
  productTitle: e.productTitle,
386
386
  selectedVariantId: e.selectedVariantId,
387
- question: s,
387
+ question: o,
388
388
  fromQuestionSuggestion: !0
389
389
  });
390
390
  };
391
- return (s, r) => (c(!0), h(N, null, W(e.questions, (n) => (c(), h("button", {
391
+ return (o, r) => (u(!0), _(N, null, Q(e.questions, (n) => (u(), _("button", {
392
392
  key: n.question,
393
393
  class: "dialog-block-suggestions-item",
394
- onClick: (i) => o(n.question)
394
+ onClick: (i) => s(n.question)
395
395
  }, [
396
- I(nt, {
396
+ T(rt, {
397
397
  class: "dialog-block-suggestions-item-icon",
398
398
  color: e.client.theme.primaryColor
399
399
  }, null, 8, ["color"]),
400
- l("span", at, E(n.question), 1)
401
- ], 8, rt))), 128));
400
+ l("span", it, E(n.question), 1)
401
+ ], 8, at))), 128));
402
402
  }
403
- }), lt = /* @__PURE__ */ D(it, [["__scopeId", "data-v-db34d4b4"]]), ct = {};
404
- function ut(t, e) {
405
- return c(), h(N, null, [
403
+ }), ct = /* @__PURE__ */ D(lt, [["__scopeId", "data-v-db34d4b4"]]), ut = {};
404
+ function dt(t, e) {
405
+ return u(), _(N, null, [
406
406
  e[0] || (e[0] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
407
407
  e[1] || (e[1] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
408
408
  e[2] || (e[2] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
409
409
  ], 64);
410
410
  }
411
- const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58"]]), pt = { class: "dialog-block-suggestions-container" }, ht = /* @__PURE__ */ w({
411
+ const pt = /* @__PURE__ */ D(ut, [["render", dt], ["__scopeId", "data-v-26a64b58"]]), ht = { class: "dialog-block-suggestions-container" }, _t = /* @__PURE__ */ w({
412
412
  __name: "DialogBlockSuggestionsContainer",
413
413
  props: {
414
414
  client: {},
@@ -420,8 +420,8 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
420
420
  },
421
421
  setup(t) {
422
422
  const e = t;
423
- return (o, s) => (c(), h("div", pt, [
424
- e.isLoading || !e.questions ? (c(), O(dt, { key: 0 })) : (c(), O(lt, {
423
+ return (s, o) => (u(), _("div", ht, [
424
+ e.isLoading || !e.questions ? (u(), O(pt, { key: 0 })) : (u(), O(ct, {
425
425
  key: 1,
426
426
  client: e.client,
427
427
  questions: e.questions,
@@ -431,30 +431,50 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
431
431
  }, null, 8, ["client", "questions", "product-id", "product-title", "selected-variant-id"]))
432
432
  ]));
433
433
  }
434
- }), _t = /* @__PURE__ */ D(ht, [["__scopeId", "data-v-18c9e78b"]]), ft = {
434
+ }), gt = /* @__PURE__ */ D(_t, [["__scopeId", "data-v-18c9e78b"]]), ft = {
435
435
  width: "20",
436
436
  height: "20",
437
437
  viewBox: "0 0 20 20",
438
438
  fill: "none",
439
439
  xmlns: "http://www.w3.org/2000/svg"
440
- }, gt = ["stroke"], vt = /* @__PURE__ */ w({
440
+ }, vt = ["stroke"], mt = /* @__PURE__ */ w({
441
441
  __name: "ArrowIcon",
442
442
  props: {
443
443
  color: {}
444
444
  },
445
445
  setup(t) {
446
446
  const e = t;
447
- return (o, s) => (c(), h("svg", ft, [
447
+ return (s, o) => (u(), _("svg", ft, [
448
448
  l("path", {
449
449
  d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
450
450
  stroke: e.color || "#ffffff",
451
451
  "stroke-width": "1.5",
452
452
  "stroke-linecap": "round",
453
453
  "stroke-linejoin": "round"
454
- }, null, 8, gt)
454
+ }, null, 8, vt)
455
455
  ]));
456
456
  }
457
- }), mt = ["placeholder"], bt = ["disabled"], St = /* @__PURE__ */ w({
457
+ }), oe = {
458
+ en: {
459
+ placeholder: "Ask the AI a question",
460
+ aiDisclosure: "You're chatting with an AI assistant. It can make mistakes, so please double-check important information"
461
+ },
462
+ fr: {
463
+ placeholder: "Posez une question à l'IA",
464
+ aiDisclosure: "Vous discutez avec un assistant IA. Il peut se tromper, pensez à vérifier les informations importantes"
465
+ },
466
+ es: {
467
+ placeholder: "Haz una pregunta a la IA",
468
+ aiDisclosure: "Estás chateando con un asistente de IA. Puede cometer errores, así que verifica la información importante"
469
+ }
470
+ }, bt = (t) => {
471
+ var s;
472
+ const e = ((s = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : s.toLowerCase()) ?? "en";
473
+ return oe[e] ?? oe.en;
474
+ }, St = { class: "dialog-input-container" }, Ct = ["placeholder"], yt = ["disabled"], Et = {
475
+ id: "dialog-input-ai-disclosure",
476
+ class: "dialog-input-ai-disclosure"
477
+ }, wt = /* @__PURE__ */ w({
458
478
  __name: "DialogInput",
459
479
  props: {
460
480
  client: {},
@@ -464,77 +484,81 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
464
484
  selectedVariantId: {}
465
485
  },
466
486
  setup(t) {
467
- const e = t, o = k(), s = k(""), r = () => {
468
- var i;
469
- (i = o.value) == null || i.focus();
470
- }, n = () => {
471
- const i = s.value;
472
- i.trim() && (e.client.sendProductMessage({
487
+ const e = t, s = k(), o = k(""), r = b(() => bt(e.client.locale)), n = () => {
488
+ var a;
489
+ (a = s.value) == null || a.focus();
490
+ }, i = () => {
491
+ const a = o.value;
492
+ a.trim() && (e.client.sendProductMessage({
473
493
  productId: e.productId,
474
494
  productTitle: e.productTitle,
475
495
  selectedVariantId: e.selectedVariantId,
476
- question: i,
496
+ question: a,
477
497
  fromQuestionSuggestion: !0
478
- }), s.value = "");
498
+ }), o.value = "");
479
499
  };
480
- return (i, a) => (c(), h("div", {
481
- class: "dialog-input-wrapper",
482
- onClick: r
483
- }, [
484
- re(l("input", {
485
- id: "dialog-ask-anything-input-ai-input",
486
- ref_key: "inputRef",
487
- ref: o,
488
- "onUpdate:modelValue": a[0] || (a[0] = (_) => s.value = _),
489
- class: "dialog-ask-anything-input-ai-input",
490
- placeholder: e.placeholder ?? "Ask anything...",
491
- onKeydown: ye(n, ["enter"])
492
- }, null, 40, mt), [
493
- [ae, s.value]
494
- ]),
495
- l("button", {
496
- id: "send-message-button-ai-input",
497
- class: "dialog-input-submit",
498
- disabled: !s.value.trim(),
500
+ return (a, h) => (u(), _("div", St, [
501
+ l("div", {
502
+ class: "dialog-input-wrapper",
499
503
  onClick: n
500
504
  }, [
501
- I(vt, {
502
- color: e.client.theme.ctaTextColor
503
- }, null, 8, ["color"])
504
- ], 8, bt)
505
+ ae(l("input", {
506
+ id: "dialog-ask-anything-input-ai-input",
507
+ ref_key: "inputRef",
508
+ ref: s,
509
+ "onUpdate:modelValue": h[0] || (h[0] = (c) => o.value = c),
510
+ class: "dialog-ask-anything-input-ai-input",
511
+ placeholder: r.value.placeholder,
512
+ "aria-describedby": "dialog-input-ai-disclosure",
513
+ onKeydown: Ee(i, ["enter"])
514
+ }, null, 40, Ct), [
515
+ [ie, o.value]
516
+ ]),
517
+ l("button", {
518
+ id: "send-message-button-ai-input",
519
+ class: "dialog-input-submit",
520
+ disabled: !o.value.trim(),
521
+ onClick: i
522
+ }, [
523
+ T(mt, {
524
+ color: e.client.theme.ctaTextColor
525
+ }, null, 8, ["color"])
526
+ ], 8, yt)
527
+ ]),
528
+ l("p", Et, E(r.value.aiDisclosure), 1)
505
529
  ]));
506
530
  }
507
- }), Ct = /* @__PURE__ */ D(St, [["__scopeId", "data-v-4f5901c9"]]), yt = /* @__PURE__ */ w({
531
+ }), It = /* @__PURE__ */ D(wt, [["__scopeId", "data-v-87013888"]]), $t = /* @__PURE__ */ w({
508
532
  __name: "ThemeProvider",
509
533
  props: {
510
534
  theme: {}
511
535
  },
512
536
  setup(t) {
513
- const e = t, o = document.body, s = (n) => n.replace(/([A-Z])/g, "-$1").toLowerCase(), r = (n) => {
537
+ const e = t, s = document.body, o = (n) => n.replace(/([A-Z])/g, "-$1").toLowerCase(), r = (n) => {
514
538
  n && Object.keys(n).forEach((i) => {
515
- const a = i, _ = s(i);
539
+ const a = i, h = o(i);
516
540
  if (n[a] !== void 0) {
517
541
  if (typeof n[a] == "object") {
518
- Object.keys(n[a]).forEach((u) => {
519
- var f;
520
- const d = u;
542
+ Object.keys(n[a]).forEach((c) => {
543
+ var g;
544
+ const d = c;
521
545
  if (d !== void 0) {
522
- const y = s(u), b = n[a];
523
- o.style.setProperty(
524
- `--dialog-theme-${_}-${y}`,
525
- (f = b[d]) == null ? void 0 : f.toString()
546
+ const y = o(c), S = n[a];
547
+ s.style.setProperty(
548
+ `--dialog-theme-${h}-${y}`,
549
+ (g = S[d]) == null ? void 0 : g.toString()
526
550
  );
527
551
  }
528
552
  });
529
553
  return;
530
554
  }
531
555
  if (a === "ctaBorderType") {
532
- const u = n[a] === "rounded" ? "24px" : "0";
533
- o.style.setProperty(`--dialog-theme-${_}`, u);
556
+ const c = n[a] === "rounded" ? "24px" : "0";
557
+ s.style.setProperty(`--dialog-theme-${h}`, c);
534
558
  return;
535
559
  }
536
- o.style.setProperty(
537
- `--dialog-theme-${_}`,
560
+ s.style.setProperty(
561
+ `--dialog-theme-${h}`,
538
562
  n[a].toString()
539
563
  );
540
564
  }
@@ -542,15 +566,15 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
542
566
  };
543
567
  return B(() => {
544
568
  e.theme && r(e.theme);
545
- }), q(
569
+ }), M(
546
570
  () => e.theme,
547
571
  (n) => {
548
572
  n && r(n);
549
573
  },
550
574
  { deep: !0 }
551
- ), (n, i) => Ee(n.$slots, "default");
575
+ ), (n, i) => we(n.$slots, "default");
552
576
  }
553
- }), Et = ["dir"], wt = /* @__PURE__ */ w({
577
+ }), Rt = ["dir"], Tt = /* @__PURE__ */ w({
554
578
  __name: "DialogProductBlock",
555
579
  props: {
556
580
  client: {},
@@ -562,83 +586,83 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
562
586
  setup(t) {
563
587
  const e = t;
564
588
  B(() => {
565
- de({
589
+ pe({
566
590
  method: "vue",
567
- version: "3.7.0"
568
- }), qe("pdp-block");
591
+ version: "3.8.0"
592
+ }), Ue("pdp-block");
569
593
  });
570
- const o = k(!0), s = k(void 0), r = k(0), n = C(() => {
594
+ const s = k(!0), o = k(void 0), r = k(0), n = b(() => {
571
595
  var d;
572
- return o.value ? "" : (d = s.value) == null ? void 0 : d.assistantName;
573
- }), i = C(() => {
596
+ return s.value ? "" : (d = o.value) == null ? void 0 : d.assistantName;
597
+ }), i = b(() => {
574
598
  var d;
575
- return o.value ? "" : (d = s.value) == null ? void 0 : d.description;
576
- }), a = C(() => {
599
+ return s.value ? "" : (d = o.value) == null ? void 0 : d.description;
600
+ }), a = b(() => {
577
601
  var d;
578
- return o.value ? "" : (d = s.value) == null ? void 0 : d.inputPlaceholder;
579
- }), _ = C(
602
+ return s.value ? "" : (d = o.value) == null ? void 0 : d.inputPlaceholder;
603
+ }), h = b(
580
604
  () => {
581
605
  var d;
582
- return De(
606
+ return Pe(
583
607
  (d = e.client.getLocalizationInformations()) == null ? void 0 : d.languageCode
584
608
  );
585
609
  }
586
- ), u = async () => {
610
+ ), c = async () => {
587
611
  const d = ++r.value;
588
- o.value = !0, s.value = void 0;
612
+ s.value = !0, o.value = void 0;
589
613
  try {
590
- const f = await e.client.getSuggestions(e.productId);
591
- d === r.value && (s.value = f);
592
- } catch (f) {
593
- console.error("error", f);
614
+ const g = await e.client.getSuggestions(e.productId);
615
+ d === r.value && (o.value = g);
616
+ } catch (g) {
617
+ console.error("error", g);
594
618
  } finally {
595
- d === r.value && (o.value = !1);
619
+ d === r.value && (s.value = !1);
596
620
  }
597
621
  };
598
- return q(
622
+ return M(
599
623
  () => [e.client, e.productId],
600
624
  () => {
601
- u();
625
+ c();
602
626
  },
603
627
  { immediate: !0 }
604
- ), (d, f) => (c(), O(yt, {
628
+ ), (d, g) => (u(), O($t, {
605
629
  theme: e.client.theme
606
630
  }, {
607
- default: ie(() => {
631
+ default: le(() => {
608
632
  var y;
609
633
  return [
610
634
  l("div", {
611
635
  id: "dialog-instant",
612
636
  class: "dialog-block-container",
613
- dir: _.value
637
+ dir: h.value
614
638
  }, [
615
- I(Je, {
639
+ T(et, {
616
640
  title: n.value,
617
641
  description: i.value
618
642
  }, null, 8, ["title", "description"]),
619
- I(_t, {
643
+ T(gt, {
620
644
  client: e.client,
621
- questions: (y = s.value) == null ? void 0 : y.questions,
622
- "is-loading": o.value,
645
+ questions: (y = o.value) == null ? void 0 : y.questions,
646
+ "is-loading": s.value,
623
647
  "product-id": e.productId,
624
648
  "product-title": e.productTitle,
625
649
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
626
650
  }, null, 8, ["client", "questions", "is-loading", "product-id", "product-title", "selected-variant-id"]),
627
- e.enableInput ? (c(), O(Ct, {
651
+ e.enableInput ? (u(), O(It, {
628
652
  key: 0,
629
653
  client: e.client,
630
654
  placeholder: a.value,
631
655
  "product-id": e.productId,
632
656
  "product-title": e.productTitle,
633
657
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
634
- }, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) : L("", !0)
635
- ], 8, Et)
658
+ }, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) : A("", !0)
659
+ ], 8, Rt)
636
660
  ];
637
661
  }),
638
662
  _: 1
639
663
  }, 8, ["theme"]));
640
664
  }
641
- }), Jo = /* @__PURE__ */ D(wt, [["__scopeId", "data-v-c57aa677"]]), $t = {}, Rt = {
665
+ }), so = /* @__PURE__ */ D(Tt, [["__scopeId", "data-v-c57aa677"]]), kt = {}, At = {
642
666
  width: "16",
643
667
  height: "16",
644
668
  viewBox: "0 0 16 16",
@@ -646,8 +670,8 @@ const dt = /* @__PURE__ */ D(ct, [["render", ut], ["__scopeId", "data-v-26a64b58
646
670
  xmlns: "http://www.w3.org/2000/svg",
647
671
  "aria-hidden": "true"
648
672
  };
649
- function Tt(t, e) {
650
- return c(), h("svg", Rt, e[0] || (e[0] = [
673
+ function Lt(t, e) {
674
+ return u(), _("svg", At, e[0] || (e[0] = [
651
675
  l("path", {
652
676
  d: "M8 13V3M8 3L3 8M8 3L13 8",
653
677
  stroke: "currentColor",
@@ -657,28 +681,28 @@ function Tt(t, e) {
657
681
  }, null, -1)
658
682
  ]));
659
683
  }
660
- const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
684
+ const xt = /* @__PURE__ */ D(kt, [["render", Lt]]), Dt = {
661
685
  width: "16",
662
686
  height: "16",
663
687
  viewBox: "0 0 12 12",
664
688
  fill: "none",
665
689
  xmlns: "http://www.w3.org/2000/svg",
666
690
  "aria-hidden": "true"
667
- }, Lt = ["fill"], At = "M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z", xt = /* @__PURE__ */ w({
691
+ }, Pt = ["fill"], Ot = "M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z", Nt = /* @__PURE__ */ w({
668
692
  __name: "ShurikenIcon",
669
693
  props: {
670
694
  color: {}
671
695
  },
672
696
  setup(t) {
673
697
  const e = t;
674
- return (o, s) => (c(), h("svg", kt, [
698
+ return (s, o) => (u(), _("svg", Dt, [
675
699
  l("path", {
676
- d: At,
700
+ d: Ot,
677
701
  fill: e.color || "currentColor"
678
- }, null, 8, Lt)
702
+ }, null, 8, Pt)
679
703
  ]));
680
704
  }
681
- }), Dt = { class: "dialog-search-bar-field" }, Pt = { class: "dialog-search-bar-icon" }, Ot = ["aria-label", "placeholder", "autofocus"], Nt = ["aria-label"], es = /* @__PURE__ */ w({
705
+ }), qt = { class: "dialog-search-bar-field" }, Mt = { class: "dialog-search-bar-icon" }, Ut = ["aria-label", "placeholder", "autofocus"], Ht = ["aria-label"], oo = /* @__PURE__ */ w({
682
706
  __name: "DialogSearchBar",
683
707
  props: {
684
708
  controller: {},
@@ -687,31 +711,31 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
687
711
  submitAriaLabel: { default: "Search" }
688
712
  },
689
713
  setup(t) {
690
- const e = t, o = k(""), s = () => {
691
- e.controller.setQuery(o.value);
714
+ const e = t, s = k(""), o = () => {
715
+ e.controller.setQuery(s.value);
692
716
  }, r = () => {
693
- e.controller.submit(o.value);
717
+ e.controller.submit(s.value);
694
718
  };
695
- return (n, i) => (c(), h("form", {
719
+ return (n, i) => (u(), _("form", {
696
720
  class: "dialog-search-bar",
697
721
  role: "search",
698
- onSubmit: we(r, ["prevent"])
722
+ onSubmit: Ie(r, ["prevent"])
699
723
  }, [
700
- l("div", Dt, [
701
- l("span", Pt, [
702
- I(xt)
724
+ l("div", qt, [
725
+ l("span", Mt, [
726
+ T(Nt)
703
727
  ]),
704
- re(l("input", {
705
- "onUpdate:modelValue": i[0] || (i[0] = (a) => o.value = a),
728
+ ae(l("input", {
729
+ "onUpdate:modelValue": i[0] || (i[0] = (a) => s.value = a),
706
730
  type: "text",
707
731
  name: "dialog-search-query",
708
732
  class: "dialog-search-bar-input",
709
733
  "aria-label": e.placeholder,
710
734
  placeholder: e.placeholder,
711
735
  autofocus: e.autoFocus,
712
- onInput: s
713
- }, null, 40, Ot), [
714
- [ae, o.value]
736
+ onInput: o
737
+ }, null, 40, Ut), [
738
+ [ie, s.value]
715
739
  ])
716
740
  ]),
717
741
  l("button", {
@@ -719,17 +743,17 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
719
743
  class: "dialog-search-bar-submit",
720
744
  "aria-label": e.submitAriaLabel
721
745
  }, [
722
- I(It)
723
- ], 8, Nt)
746
+ T(xt)
747
+ ], 8, Ht)
724
748
  ], 32));
725
749
  }
726
- }), Mt = (t, e) => {
750
+ }), Vt = (t, e) => {
727
751
  try {
728
752
  return new Intl.NumberFormat(e).format(t);
729
753
  } catch {
730
754
  return String(t);
731
755
  }
732
- }, se = {
756
+ }, ne = {
733
757
  en: (t) => ({
734
758
  searching: (e) => `Searching “${e}”…`,
735
759
  noResults: "No matching products",
@@ -741,7 +765,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
741
765
  seeAllLabel: (e) => e === 1 ? "See the result" : `See all ${t(e)} results`,
742
766
  previous: "Previous",
743
767
  next: "Next",
744
- pageOf: (e, o) => `Page ${t(e)} / ${t(o)}`
768
+ pageOf: (e, s) => `Page ${t(e)} / ${t(s)}`
745
769
  }),
746
770
  fr: (t) => ({
747
771
  searching: (e) => `Recherche de « ${e} »…`,
@@ -754,7 +778,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
754
778
  seeAllLabel: (e) => e === 1 ? "Voir le résultat" : `Voir les ${t(e)} résultats`,
755
779
  previous: "Précédent",
756
780
  next: "Suivant",
757
- pageOf: (e, o) => `Page ${t(e)} / ${t(o)}`
781
+ pageOf: (e, s) => `Page ${t(e)} / ${t(s)}`
758
782
  }),
759
783
  de: (t) => ({
760
784
  searching: (e) => `Suche nach „${e}“…`,
@@ -767,7 +791,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
767
791
  seeAllLabel: (e) => e === 1 ? "Das Ergebnis anzeigen" : `Alle ${t(e)} Ergebnisse anzeigen`,
768
792
  previous: "Zurück",
769
793
  next: "Weiter",
770
- pageOf: (e, o) => `Seite ${t(e)} / ${t(o)}`
794
+ pageOf: (e, s) => `Seite ${t(e)} / ${t(s)}`
771
795
  }),
772
796
  es: (t) => ({
773
797
  searching: (e) => `Buscando «${e}»…`,
@@ -780,7 +804,7 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
780
804
  seeAllLabel: (e) => e === 1 ? "Ver el resultado" : `Ver los ${t(e)} resultados`,
781
805
  previous: "Anterior",
782
806
  next: "Siguiente",
783
- pageOf: (e, o) => `Página ${t(e)} / ${t(o)}`
807
+ pageOf: (e, s) => `Página ${t(e)} / ${t(s)}`
784
808
  }),
785
809
  it: (t) => ({
786
810
  searching: (e) => `Ricerca di “${e}”…`,
@@ -793,17 +817,17 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
793
817
  seeAllLabel: (e) => e === 1 ? "Vedi il risultato" : `Vedi tutti i ${t(e)} risultati`,
794
818
  previous: "Precedente",
795
819
  next: "Successivo",
796
- pageOf: (e, o) => `Pagina ${t(e)} / ${t(o)}`
820
+ pageOf: (e, s) => `Pagina ${t(e)} / ${t(s)}`
797
821
  })
798
- }, pe = (t) => {
799
- var s;
800
- const e = ((s = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : s.toLowerCase()) ?? "en";
801
- return (se[e] ?? se.en)((r) => Mt(r, t));
802
- }, he = (t) => t.status !== A.LOADING && t.response !== void 0 && t.response.nbPages > 1, qt = {
822
+ }, he = (t) => {
823
+ var o;
824
+ const e = ((o = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : o.toLowerCase()) ?? "en";
825
+ return (ne[e] ?? ne.en)((r) => Vt(r, t));
826
+ }, _e = (t) => t.status !== L.LOADING && t.response !== void 0 && t.response.nbPages > 1, Bt = {
803
827
  key: 0,
804
828
  "aria-label": "Search results pages",
805
829
  class: "dialog-search-pagination"
806
- }, Ut = ["disabled"], Ht = ["disabled"], Vt = /* @__PURE__ */ w({
830
+ }, Kt = ["disabled"], Ft = ["disabled"], zt = /* @__PURE__ */ w({
807
831
  __name: "DialogSearchPagination",
808
832
  props: {
809
833
  controller: {},
@@ -811,87 +835,87 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
811
835
  locale: {}
812
836
  },
813
837
  setup(t) {
814
- const e = t, o = C(() => e.state.response), s = C(() => pe(e.locale));
815
- return (r, n) => o.value !== void 0 && K(he)(e.state) ? (c(), h("nav", qt, [
838
+ const e = t, s = b(() => e.state.response), o = b(() => he(e.locale));
839
+ return (r, n) => s.value !== void 0 && K(_e)(e.state) ? (u(), _("nav", Bt, [
816
840
  l("button", {
817
841
  type: "button",
818
- disabled: o.value.page === 0,
819
- onClick: n[0] || (n[0] = (i) => e.controller.setPage(o.value.page - 1))
820
- }, E(s.value.previous), 9, Ut),
821
- l("span", null, E(s.value.pageOf(o.value.page + 1, o.value.nbPages)), 1),
842
+ disabled: s.value.page === 0,
843
+ onClick: n[0] || (n[0] = (i) => e.controller.setPage(s.value.page - 1))
844
+ }, E(o.value.previous), 9, Kt),
845
+ l("span", null, E(o.value.pageOf(s.value.page + 1, s.value.nbPages)), 1),
822
846
  l("button", {
823
847
  type: "button",
824
- disabled: o.value.page >= o.value.nbPages - 1,
825
- onClick: n[1] || (n[1] = (i) => e.controller.setPage(o.value.page + 1))
826
- }, E(s.value.next), 9, Ht)
827
- ])) : L("", !0);
848
+ disabled: s.value.page >= s.value.nbPages - 1,
849
+ onClick: n[1] || (n[1] = (i) => e.controller.setPage(s.value.page + 1))
850
+ }, E(o.value.next), 9, Ft)
851
+ ])) : A("", !0);
828
852
  }
829
- }), ne = (t) => t.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), Bt = (t, e) => {
830
- const o = { before: "", match: t, after: "" }, s = ne(e.trim());
831
- if (s === "")
832
- return o;
853
+ }), re = (t) => t.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), jt = (t, e) => {
854
+ const s = { before: "", match: t, after: "" }, o = re(e.trim());
855
+ if (o === "")
856
+ return s;
833
857
  const r = [...t], n = [];
834
858
  let i = "";
835
- r.forEach((d, f) => {
836
- const y = ne(d);
837
- for (let b = 0; b < y.length; b += 1)
838
- n.push(f);
859
+ r.forEach((d, g) => {
860
+ const y = re(d);
861
+ for (let S = 0; S < y.length; S += 1)
862
+ n.push(g);
839
863
  i += y;
840
864
  });
841
- const a = i.indexOf(s);
865
+ const a = i.indexOf(o);
842
866
  if (a === -1)
843
- return o;
844
- const _ = n[a], u = n[a + s.length - 1] + 1;
867
+ return s;
868
+ const h = n[a], c = n[a + o.length - 1] + 1;
845
869
  return {
846
- before: r.slice(0, _).join(""),
847
- match: r.slice(_, u).join(""),
848
- after: r.slice(u).join("")
870
+ before: r.slice(0, h).join(""),
871
+ match: r.slice(h, c).join(""),
872
+ after: r.slice(c).join("")
849
873
  };
850
- }, Kt = {
874
+ }, Gt = {
851
875
  key: 0,
852
876
  class: "dialog-search-muted"
853
- }, Ft = { class: "dialog-search-match" }, jt = {
877
+ }, Wt = { class: "dialog-search-match" }, Qt = {
854
878
  key: 1,
855
879
  class: "dialog-search-muted"
856
- }, _e = /* @__PURE__ */ w({
880
+ }, ge = /* @__PURE__ */ w({
857
881
  __name: "HighlightedTitle",
858
882
  props: {
859
883
  title: {},
860
884
  query: {}
861
885
  },
862
886
  setup(t) {
863
- const e = t, o = C(() => Bt(e.title, e.query));
864
- return (s, r) => (c(), h(N, null, [
865
- o.value.before !== "" ? (c(), h("span", Kt, E(o.value.before), 1)) : L("", !0),
866
- l("span", Ft, E(o.value.match), 1),
867
- o.value.after !== "" ? (c(), h("span", jt, E(o.value.after), 1)) : L("", !0)
887
+ const e = t, s = b(() => jt(e.title, e.query));
888
+ return (o, r) => (u(), _(N, null, [
889
+ s.value.before !== "" ? (u(), _("span", Gt, E(s.value.before), 1)) : A("", !0),
890
+ l("span", Wt, E(s.value.match), 1),
891
+ s.value.after !== "" ? (u(), _("span", Qt, E(s.value.after), 1)) : A("", !0)
868
892
  ], 64));
869
893
  }
870
- }), zt = ({ amount: t, currencyCode: e }, o) => e === void 0 ? new Intl.NumberFormat(o).format(Number(t)) : new Intl.NumberFormat(o, {
894
+ }), Xt = ({ amount: t, currencyCode: e }, s) => e === void 0 ? new Intl.NumberFormat(s).format(Number(t)) : new Intl.NumberFormat(s, {
871
895
  style: "currency",
872
896
  currency: e
873
- }).format(Number(t)), Gt = (t, e) => {
897
+ }).format(Number(t)), Yt = (t, e) => {
874
898
  if (t === void 0)
875
899
  return "";
876
900
  try {
877
- return zt(t.min, e);
901
+ return Xt(t.min, e);
878
902
  } catch {
879
903
  return "";
880
904
  }
881
- }, Qt = (t) => {
905
+ }, Zt = (t) => {
882
906
  try {
883
907
  const { protocol: e } = new URL(t, window.location.href);
884
908
  return e === "http:" || e === "https:" ? t : void 0;
885
909
  } catch {
886
910
  return;
887
911
  }
888
- }, fe = (t) => t.url === void 0 || t.url === "" ? void 0 : Qt(t.url), ge = (t) => t.title ?? t.handle ?? t.objectID, Wt = {
912
+ }, fe = (t) => t.url === void 0 || t.url === "" ? void 0 : Zt(t.url), ve = (t) => t.title ?? t.handle ?? t.objectID, Jt = {
889
913
  class: "dialog-search-product-thumb",
890
914
  "aria-hidden": "true"
891
- }, Xt = ["src"], Zt = { class: "dialog-search-product-title" }, Yt = {
915
+ }, es = ["src"], ts = { class: "dialog-search-product-title" }, ss = {
892
916
  key: 0,
893
917
  class: "dialog-search-product-price"
894
- }, Jt = /* @__PURE__ */ w({
918
+ }, os = /* @__PURE__ */ w({
895
919
  __name: "DialogSearchProductCard",
896
920
  props: {
897
921
  controller: {},
@@ -901,55 +925,55 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
901
925
  query: { default: "" }
902
926
  },
903
927
  setup(t) {
904
- const e = t, o = k();
905
- q(
928
+ const e = t, s = k();
929
+ M(
906
930
  () => e.hit,
907
931
  () => {
908
- o.value !== void 0 && e.controller.observeResult(o.value, e.index);
932
+ s.value !== void 0 && e.controller.observeResult(s.value, e.index);
909
933
  },
910
934
  { immediate: !0, flush: "post" }
911
935
  );
912
- const s = C(() => fe(e.hit)), r = C(
913
- () => Gt(e.hit.priceRange, e.locale)
936
+ const o = b(() => fe(e.hit)), r = b(
937
+ () => Yt(e.hit.priceRange, e.locale)
914
938
  ), n = (a) => {
915
- const _ = a.metaKey || a.ctrlKey || a.shiftKey || a.altKey;
916
- e.controller.selectResult(e.index, { navigate: !_ }) && a.preventDefault();
939
+ const h = a.metaKey || a.ctrlKey || a.shiftKey || a.altKey;
940
+ e.controller.selectResult(e.index, { navigate: !h }) && a.preventDefault();
917
941
  }, i = (a) => {
918
942
  a.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
919
943
  };
920
- return (a, _) => (c(), h("li", {
944
+ return (a, h) => (u(), _("li", {
921
945
  ref_key: "cardRef",
922
- ref: o,
946
+ ref: s,
923
947
  class: "dialog-search-card"
924
948
  }, [
925
- (c(), O($e(s.value === void 0 ? "div" : "a"), Re({
949
+ (u(), O($e(o.value === void 0 ? "div" : "a"), Re({
926
950
  class: "dialog-search-product",
927
- href: s.value
951
+ href: o.value
928
952
  }, Te(
929
- s.value === void 0 ? {} : { click: n, auxclick: i }
953
+ o.value === void 0 ? {} : { click: n, auxclick: i }
930
954
  )), {
931
- default: ie(() => [
932
- l("span", Wt, [
933
- e.hit.imageUrl !== void 0 && e.hit.imageUrl !== "" ? (c(), h("img", {
955
+ default: le(() => [
956
+ l("span", Jt, [
957
+ e.hit.imageUrl !== void 0 && e.hit.imageUrl !== "" ? (u(), _("img", {
934
958
  key: 0,
935
959
  src: e.hit.imageUrl,
936
960
  alt: "",
937
961
  loading: "lazy"
938
- }, null, 8, Xt)) : L("", !0)
962
+ }, null, 8, es)) : A("", !0)
939
963
  ]),
940
- l("span", Zt, [
941
- I(_e, {
942
- title: K(ge)(e.hit),
964
+ l("span", ts, [
965
+ T(ge, {
966
+ title: K(ve)(e.hit),
943
967
  query: e.query
944
968
  }, null, 8, ["title", "query"])
945
969
  ]),
946
- r.value !== "" ? (c(), h("span", Yt, E(r.value), 1)) : L("", !0)
970
+ r.value !== "" ? (u(), _("span", ss, E(r.value), 1)) : A("", !0)
947
971
  ]),
948
972
  _: 1
949
973
  }, 16, ["href"]))
950
974
  ], 512));
951
975
  }
952
- }), eo = {}, to = {
976
+ }), ns = {}, rs = {
953
977
  width: "16",
954
978
  height: "16",
955
979
  viewBox: "0 0 256 256",
@@ -957,12 +981,12 @@ const It = /* @__PURE__ */ D($t, [["render", Tt]]), kt = {
957
981
  xmlns: "http://www.w3.org/2000/svg",
958
982
  "aria-hidden": "true"
959
983
  };
960
- function oo(t, e) {
961
- return c(), h("svg", to, e[0] || (e[0] = [
984
+ function as(t, e) {
985
+ return u(), _("svg", rs, e[0] || (e[0] = [
962
986
  l("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }, null, -1)
963
987
  ]));
964
988
  }
965
- const so = /* @__PURE__ */ D(eo, [["render", oo]]), no = {}, ro = {
989
+ const is = /* @__PURE__ */ D(ns, [["render", as]]), ls = {}, cs = {
966
990
  width: "12",
967
991
  height: "12",
968
992
  viewBox: "0 0 256 256",
@@ -970,21 +994,21 @@ const so = /* @__PURE__ */ D(eo, [["render", oo]]), no = {}, ro = {
970
994
  xmlns: "http://www.w3.org/2000/svg",
971
995
  "aria-hidden": "true"
972
996
  };
973
- function ao(t, e) {
974
- return c(), h("svg", ro, e[0] || (e[0] = [
997
+ function us(t, e) {
998
+ return u(), _("svg", cs, e[0] || (e[0] = [
975
999
  l("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" }, null, -1)
976
1000
  ]));
977
1001
  }
978
- const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMap((e) => {
979
- const o = fe(e);
980
- return o === void 0 ? [] : [{ collection: e, href: o }];
981
- }), lo = {
1002
+ const ds = /* @__PURE__ */ D(ls, [["render", us]]), me = (t) => (t ?? []).flatMap((e) => {
1003
+ const s = fe(e);
1004
+ return s === void 0 ? [] : [{ collection: e, href: s }];
1005
+ }), ps = {
982
1006
  key: 0,
983
1007
  class: "dialog-search-collections"
984
- }, co = { class: "dialog-search-section-head" }, uo = { class: "dialog-search-label" }, po = { class: "dialog-search-count" }, ho = { class: "dialog-search-collection-list" }, _o = ["href"], fo = {
1008
+ }, hs = { class: "dialog-search-section-head" }, _s = { class: "dialog-search-label" }, gs = { class: "dialog-search-count" }, fs = { class: "dialog-search-collection-list" }, vs = ["href"], ms = {
985
1009
  class: "dialog-search-collection-thumb",
986
1010
  "aria-hidden": "true"
987
- }, go = ["src"], vo = { class: "dialog-search-collection-title" }, mo = { class: "dialog-search-caret" }, bo = /* @__PURE__ */ w({
1011
+ }, bs = ["src"], Ss = { class: "dialog-search-collection-title" }, Cs = { class: "dialog-search-caret" }, ys = /* @__PURE__ */ w({
988
1012
  __name: "DialogSearchCollections",
989
1013
  props: {
990
1014
  collections: {},
@@ -992,50 +1016,50 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
992
1016
  messages: {}
993
1017
  },
994
1018
  setup(t) {
995
- const e = t, o = C(() => ve(e.collections));
996
- return (s, r) => o.value.length > 0 ? (c(), h("aside", lo, [
997
- l("div", co, [
998
- l("p", uo, E(e.messages.collectionsLabel), 1),
999
- l("span", po, E(e.messages.collectionsCount(o.value.length)), 1)
1019
+ const e = t, s = b(() => me(e.collections));
1020
+ return (o, r) => s.value.length > 0 ? (u(), _("aside", ps, [
1021
+ l("div", hs, [
1022
+ l("p", _s, E(e.messages.collectionsLabel), 1),
1023
+ l("span", gs, E(e.messages.collectionsCount(s.value.length)), 1)
1000
1024
  ]),
1001
- l("ul", ho, [
1002
- (c(!0), h(N, null, W(o.value, ({ collection: n, href: i }) => (c(), h("li", {
1025
+ l("ul", fs, [
1026
+ (u(!0), _(N, null, Q(s.value, ({ collection: n, href: i }) => (u(), _("li", {
1003
1027
  key: n.objectID
1004
1028
  }, [
1005
1029
  l("a", {
1006
1030
  class: "dialog-search-collection",
1007
1031
  href: i
1008
1032
  }, [
1009
- l("span", fo, [
1010
- n.imageUrl !== void 0 && n.imageUrl !== "" ? (c(), h("img", {
1033
+ l("span", ms, [
1034
+ n.imageUrl !== void 0 && n.imageUrl !== "" ? (u(), _("img", {
1011
1035
  key: 0,
1012
1036
  src: n.imageUrl,
1013
1037
  alt: "",
1014
1038
  loading: "lazy"
1015
- }, null, 8, go)) : L("", !0)
1039
+ }, null, 8, bs)) : A("", !0)
1016
1040
  ]),
1017
- l("span", vo, [
1018
- I(_e, {
1019
- title: K(ge)(n),
1041
+ l("span", Ss, [
1042
+ T(ge, {
1043
+ title: K(ve)(n),
1020
1044
  query: e.query
1021
1045
  }, null, 8, ["title", "query"])
1022
1046
  ]),
1023
- l("span", mo, [
1024
- I(io)
1047
+ l("span", Cs, [
1048
+ T(ds)
1025
1049
  ])
1026
- ], 8, _o)
1050
+ ], 8, vs)
1027
1051
  ]))), 128))
1028
1052
  ])
1029
- ])) : L("", !0);
1053
+ ])) : A("", !0);
1030
1054
  }
1031
- }), So = { class: "dialog-search-products" }, Co = { class: "dialog-search-section-head" }, yo = { class: "dialog-search-label" }, Eo = {
1055
+ }), Es = { class: "dialog-search-products" }, ws = { class: "dialog-search-section-head" }, Is = { class: "dialog-search-label" }, $s = {
1032
1056
  key: 0,
1033
1057
  class: "dialog-search-label-count"
1034
- }, wo = { class: "dialog-search-results" }, $o = {
1058
+ }, Rs = { class: "dialog-search-results" }, Ts = {
1035
1059
  key: 0,
1036
1060
  class: "dialog-search-empty",
1037
1061
  role: "status"
1038
- }, Ro = /* @__PURE__ */ w({
1062
+ }, ks = /* @__PURE__ */ w({
1039
1063
  __name: "DialogSearchProducts",
1040
1064
  props: {
1041
1065
  controller: {},
@@ -1045,15 +1069,15 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
1045
1069
  },
1046
1070
  setup(t) {
1047
1071
  const e = t;
1048
- return (o, s) => (c(), h("section", So, [
1049
- l("div", Co, [
1050
- l("p", yo, [
1051
- le(E(e.messages.productsLabel), 1),
1052
- e.response.nbHits > 0 ? (c(), h("span", Eo, " · " + E(e.messages.resultsCount(e.response.nbHits)), 1)) : L("", !0)
1072
+ return (s, o) => (u(), _("section", Es, [
1073
+ l("div", ws, [
1074
+ l("p", Is, [
1075
+ ce(E(e.messages.productsLabel), 1),
1076
+ e.response.nbHits > 0 ? (u(), _("span", $s, " · " + E(e.messages.resultsCount(e.response.nbHits)), 1)) : A("", !0)
1053
1077
  ])
1054
1078
  ]),
1055
- l("ul", wo, [
1056
- e.response.hits.length === 0 ? (c(), h("li", $o, E(e.messages.noResults), 1)) : (c(!0), h(N, { key: 1 }, W(e.response.hits, (r, n) => (c(), O(Jt, {
1079
+ l("ul", Rs, [
1080
+ e.response.hits.length === 0 ? (u(), _("li", Ts, E(e.messages.noResults), 1)) : (u(!0), _(N, { key: 1 }, Q(e.response.hits, (r, n) => (u(), O(os, {
1057
1081
  key: r.objectID,
1058
1082
  controller: e.controller,
1059
1083
  hit: r,
@@ -1064,57 +1088,57 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
1064
1088
  ])
1065
1089
  ]));
1066
1090
  }
1067
- }), H = 8, U = 16, To = 200, Io = 1440, ko = (t, e) => t.bottom > 0 && t.top < e, Lo = (t, e) => {
1068
- const o = Math.min(
1069
- Io,
1091
+ }), H = 8, U = 16, As = 200, Ls = 1440, xs = (t, e) => t.bottom > 0 && t.top < e, Ds = (t, e) => {
1092
+ const s = Math.min(
1093
+ Ls,
1070
1094
  e - 2 * U
1071
- ), s = t.left + t.width / 2 - o / 2;
1095
+ ), o = t.left + t.width / 2 - s / 2;
1072
1096
  return { left: `${Math.min(
1073
- Math.max(s, U),
1074
- e - U - o
1075
- )}px`, width: `${o}px` };
1076
- }, Ao = (t, e, o) => {
1077
- const s = o - t.bottom - H - U, r = t.top - H - U, n = Lo(t, e);
1078
- return s < To && r > s ? {
1097
+ Math.max(o, U),
1098
+ e - U - s
1099
+ )}px`, width: `${s}px` };
1100
+ }, Ps = (t, e, s) => {
1101
+ const o = s - t.bottom - H - U, r = t.top - H - U, n = Ds(t, e);
1102
+ return o < As && r > o ? {
1079
1103
  ...n,
1080
- bottom: `${o - t.top + H}px`,
1104
+ bottom: `${s - t.top + H}px`,
1081
1105
  maxHeight: `${Math.max(r, 0)}px`
1082
1106
  } : {
1083
1107
  ...n,
1084
1108
  top: `${t.bottom + H}px`,
1085
- maxHeight: `${Math.max(s, 0)}px`
1109
+ maxHeight: `${Math.max(o, 0)}px`
1086
1110
  };
1087
- }, xo = (t) => {
1111
+ }, Os = (t) => {
1088
1112
  const e = t.trim().replace(/^#/, "");
1089
1113
  if (!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e))
1090
1114
  return;
1091
- const o = e.length <= 4 ? [...e].map((s) => s + s).join("") : e;
1115
+ const s = e.length <= 4 ? [...e].map((o) => o + o).join("") : e;
1092
1116
  return [0, 2, 4].map(
1093
- (s) => Number.parseInt(o.slice(s, s + 2), 16)
1117
+ (o) => Number.parseInt(s.slice(o, o + 2), 16)
1094
1118
  );
1095
- }, Do = (t) => {
1119
+ }, Ns = (t) => {
1096
1120
  const e = /^rgba?\((\d+), (\d+), (\d+)(?:, [\d.]+)?\)$/.exec(t);
1097
1121
  if (e !== null)
1098
1122
  return [e[1], e[2], e[3]].map(Number);
1099
- }, Po = (t) => {
1123
+ }, qs = (t) => {
1100
1124
  if (typeof document > "u")
1101
1125
  return;
1102
1126
  const e = document.createElement("span");
1103
1127
  if (e.style.color = t, e.style.color === "")
1104
1128
  return;
1105
1129
  document.body.appendChild(e);
1106
- const o = Do(getComputedStyle(e).color);
1107
- return e.remove(), o;
1108
- }, Oo = (t) => xo(t) ?? Po(t), No = (t) => {
1130
+ const s = Ns(getComputedStyle(e).color);
1131
+ return e.remove(), s;
1132
+ }, Ms = (t) => Os(t) ?? qs(t), Us = (t) => {
1109
1133
  const e = t / 255;
1110
1134
  return e <= 0.03928 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1111
- }, me = (t) => {
1112
- const e = Oo(t);
1135
+ }, be = (t) => {
1136
+ const e = Ms(t);
1113
1137
  if (e === void 0)
1114
1138
  return;
1115
- const [o, s, r] = e.map(No);
1116
- return 0.2126 * o + 0.7152 * s + 0.0722 * r;
1117
- }, Mo = "#181825", qo = "#ffffff", Uo = "straight", G = 0.5, Q = {
1139
+ const [s, o, r] = e.map(Us);
1140
+ return 0.2126 * s + 0.7152 * o + 0.0722 * r;
1141
+ }, Hs = "#181825", Vs = "#ffffff", Bs = "straight", G = 0.5, W = {
1118
1142
  light: {
1119
1143
  panel: "#ffffff",
1120
1144
  side: "#fafbfc",
@@ -1133,7 +1157,7 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
1133
1157
  hover: "#242830",
1134
1158
  thumb: "#2b2f38"
1135
1159
  }
1136
- }, Ho = {
1160
+ }, Ks = {
1137
1161
  rectangle: {
1138
1162
  "r-panel": "4px",
1139
1163
  "r-item": "4px",
@@ -1146,79 +1170,79 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
1146
1170
  "r-thumb": "8px",
1147
1171
  "r-btn": "10px"
1148
1172
  }
1149
- }, V = (t) => t === void 0 || t.trim() === "" ? void 0 : t.trim(), Vo = (t) => {
1150
- const e = t === void 0 ? void 0 : me(t);
1173
+ }, V = (t) => t === void 0 || t.trim() === "" ? void 0 : t.trim(), Fs = (t) => {
1174
+ const e = t === void 0 ? void 0 : be(t);
1151
1175
  return e === void 0 ? "light" : e < G ? "dark" : "light";
1152
- }, Bo = (t, e) => {
1153
- const o = me(t);
1154
- return o === void 0 ? Q[e].text : (e === "light" ? o < G : o >= G) ? t : Q[e].text;
1155
- }, Ko = (t) => {
1156
- const e = Vo(V(t == null ? void 0 : t.backgroundColor)), o = (t == null ? void 0 : t.ctaBorderType) === Uo ? "rectangle" : "rectangle-rounded", s = V(t == null ? void 0 : t.primaryColor) ?? Mo, r = V(t == null ? void 0 : t.fontFamily), n = {
1157
- ...Q[e],
1158
- ...Ho[o],
1159
- primary: s,
1160
- accent: Bo(s, e),
1161
- "cta-text": V(t == null ? void 0 : t.ctaTextColor) ?? qo,
1176
+ }, zs = (t, e) => {
1177
+ const s = be(t);
1178
+ return s === void 0 ? W[e].text : (e === "light" ? s < G : s >= G) ? t : W[e].text;
1179
+ }, js = (t) => {
1180
+ const e = Fs(V(t == null ? void 0 : t.backgroundColor)), s = (t == null ? void 0 : t.ctaBorderType) === Bs ? "rectangle" : "rectangle-rounded", o = V(t == null ? void 0 : t.primaryColor) ?? Hs, r = V(t == null ? void 0 : t.fontFamily), n = {
1181
+ ...W[e],
1182
+ ...Ks[s],
1183
+ primary: o,
1184
+ accent: zs(o, e),
1185
+ "cta-text": V(t == null ? void 0 : t.ctaTextColor) ?? Vs,
1162
1186
  ...r === void 0 ? {} : { font: r }
1163
1187
  };
1164
1188
  return Object.fromEntries(
1165
1189
  Object.entries(n).map(([i, a]) => [`--dso-${i}`, a])
1166
1190
  );
1167
- }, Fo = (t) => {
1168
- const e = k(), o = k(void 0), s = k({ width: 0, height: 0 });
1169
- return q(
1191
+ }, Gs = (t) => {
1192
+ const e = k(), s = k(void 0), o = k({ width: 0, height: 0 });
1193
+ return M(
1170
1194
  t,
1171
1195
  (r, n, i) => {
1172
1196
  if (!r)
1173
1197
  return;
1174
1198
  const a = () => {
1175
- const _ = e.value;
1176
- if (_ === void 0)
1199
+ const h = e.value;
1200
+ if (h === void 0)
1177
1201
  return;
1178
- const u = _.previousElementSibling ?? _, { top: d, bottom: f, left: y, width: b } = u.getBoundingClientRect();
1179
- (s.value.width !== window.innerWidth || s.value.height !== window.innerHeight) && (s.value = {
1202
+ const c = h.previousElementSibling ?? h, { top: d, bottom: g, left: y, width: S } = c.getBoundingClientRect();
1203
+ (o.value.width !== window.innerWidth || o.value.height !== window.innerHeight) && (o.value = {
1180
1204
  width: window.innerWidth,
1181
1205
  height: window.innerHeight
1182
1206
  });
1183
- const g = o.value;
1184
- (g === void 0 || g.top !== d || g.bottom !== f || g.left !== y || g.width !== b) && (o.value = { top: d, bottom: f, left: y, width: b });
1207
+ const f = s.value;
1208
+ (f === void 0 || f.top !== d || f.bottom !== g || f.left !== y || f.width !== S) && (s.value = { top: d, bottom: g, left: y, width: S });
1185
1209
  };
1186
1210
  a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), i(() => {
1187
1211
  window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
1188
1212
  });
1189
1213
  },
1190
1214
  { immediate: !0, flush: "post" }
1191
- ), { anchorRef: e, rect: o, viewport: s };
1192
- }, jo = (t, e) => {
1193
- const o = k(!1), s = k(), r = C(
1194
- () => t.value.status !== A.IDLE && !o.value
1215
+ ), { anchorRef: e, rect: s, viewport: o };
1216
+ }, Ws = (t, e) => {
1217
+ const s = k(!1), o = k(), r = b(
1218
+ () => t.value.status !== L.IDLE && !s.value
1195
1219
  );
1196
- q(
1220
+ M(
1197
1221
  () => t.value.query,
1198
1222
  () => {
1199
- o.value = !1;
1223
+ s.value = !1;
1200
1224
  }
1201
- ), q(
1225
+ ), M(
1202
1226
  r,
1203
- (i, a, _) => {
1227
+ (i, a, h) => {
1204
1228
  if (!i)
1205
1229
  return;
1206
- const u = (d) => {
1207
- var $, R;
1208
- const f = d.target;
1209
- if (!(f instanceof Node))
1230
+ const c = (d) => {
1231
+ var I, $;
1232
+ const g = d.target;
1233
+ if (!(g instanceof Node))
1210
1234
  return;
1211
- const y = ($ = e.value) == null ? void 0 : $.previousElementSibling, b = ((R = s.value) == null ? void 0 : R.contains(f)) ?? !1, g = (y == null ? void 0 : y.contains(f)) ?? !1;
1212
- !b && !g && (o.value = !0);
1235
+ const y = (I = e.value) == null ? void 0 : I.previousElementSibling, S = (($ = o.value) == null ? void 0 : $.contains(g)) ?? !1, f = (y == null ? void 0 : y.contains(g)) ?? !1;
1236
+ !S && !f && (s.value = !0);
1213
1237
  };
1214
- document.addEventListener("pointerdown", u), _(
1215
- () => document.removeEventListener("pointerdown", u)
1238
+ document.addEventListener("pointerdown", c), h(
1239
+ () => document.removeEventListener("pointerdown", c)
1216
1240
  );
1217
1241
  },
1218
1242
  { immediate: !0 }
1219
1243
  );
1220
1244
  const n = () => {
1221
- o.value = !1;
1245
+ s.value = !1;
1222
1246
  };
1223
1247
  return B(() => {
1224
1248
  var i, a;
@@ -1226,27 +1250,27 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
1226
1250
  "focusin",
1227
1251
  n
1228
1252
  );
1229
- }), ce(() => {
1253
+ }), ue(() => {
1230
1254
  var i, a;
1231
1255
  (a = (i = e.value) == null ? void 0 : i.previousElementSibling) == null || a.removeEventListener(
1232
1256
  "focusin",
1233
1257
  n
1234
1258
  );
1235
- }), { isOpen: r, panelRef: s };
1236
- }, zo = {
1259
+ }), { isOpen: r, panelRef: o };
1260
+ }, Qs = {
1237
1261
  key: 0,
1238
1262
  class: "dialog-search-error"
1239
- }, Go = {
1263
+ }, Xs = {
1240
1264
  role: "alert",
1241
1265
  class: "dialog-search-status dialog-search-status-error"
1242
- }, Qo = {
1266
+ }, Ys = {
1243
1267
  key: 1,
1244
1268
  role: "status",
1245
1269
  class: "dialog-search-status"
1246
- }, Wo = {
1270
+ }, Zs = {
1247
1271
  key: 0,
1248
1272
  class: "dialog-search-footer"
1249
- }, Xo = ["href"], ts = /* @__PURE__ */ w({
1273
+ }, Js = ["href"], no = /* @__PURE__ */ w({
1250
1274
  __name: "DialogSearchResults",
1251
1275
  props: {
1252
1276
  controller: {},
@@ -1257,114 +1281,114 @@ const io = /* @__PURE__ */ D(no, [["render", ao]]), ve = (t) => (t ?? []).flatMa
1257
1281
  seeAllHref: { type: Function, default: void 0 }
1258
1282
  },
1259
1283
  setup(t) {
1260
- const e = t, o = (p) => p instanceof Pe ? `Search failed (${p.status}${p.code ? ` ${p.code}` : ""}): ${p.message}` : "Search failed: network error. Check your connection and try again.", s = C(() => e.state), r = C(() => e.state.status !== A.IDLE), { anchorRef: n, rect: i, viewport: a } = Fo(r), { isOpen: _, panelRef: u } = jo(s, n), d = C(
1261
- () => _.value && i.value !== void 0 && ko(i.value, a.value.height)
1262
- ), f = C(() => Ko(e.theme)), y = C(() => ({
1263
- ...i.value === void 0 ? {} : Ao(i.value, a.value.width, a.value.height),
1264
- ...f.value
1265
- })), b = C(() => pe(e.locale)), g = C(() => e.state.response), $ = C(
1284
+ const e = t, s = (p) => p instanceof Oe ? `Search failed (${p.status}${p.code ? ` ${p.code}` : ""}): ${p.message}` : "Search failed: network error. Check your connection and try again.", o = b(() => e.state), r = b(() => e.state.status !== L.IDLE), { anchorRef: n, rect: i, viewport: a } = Gs(r), { isOpen: h, panelRef: c } = Ws(o, n), d = b(
1285
+ () => h.value && i.value !== void 0 && xs(i.value, a.value.height)
1286
+ ), g = b(() => js(e.theme)), y = b(() => ({
1287
+ ...i.value === void 0 ? {} : Ps(i.value, a.value.width, a.value.height),
1288
+ ...g.value
1289
+ })), S = b(() => he(e.locale)), f = b(() => e.state.response), I = b(
1266
1290
  () => {
1267
- var p, S;
1268
- return ((S = (p = e.state.sections) == null ? void 0 : p.collections) == null ? void 0 : S.hits) ?? [];
1291
+ var p, C;
1292
+ return ((C = (p = e.state.sections) == null ? void 0 : p.collections) == null ? void 0 : C.hits) ?? [];
1269
1293
  }
1270
- ), R = C(
1271
- () => ve($.value).length > 0
1272
- ), T = C(
1273
- () => e.seeAllHref !== void 0 && g.value !== void 0 && g.value.nbHits > 0
1274
- ), m = C(() => !T.value && he(e.state)), v = C(
1294
+ ), $ = b(
1295
+ () => me(I.value).length > 0
1296
+ ), R = b(
1297
+ () => e.seeAllHref !== void 0 && f.value !== void 0 && f.value.nbHits > 0
1298
+ ), m = b(() => !R.value && _e(e.state)), v = b(
1275
1299
  () => {
1276
1300
  var p;
1277
- return g.value === void 0 || (p = e.seeAllHref) == null ? void 0 : p.call(e, g.value.query);
1301
+ return f.value === void 0 || (p = e.seeAllHref) == null ? void 0 : p.call(e, f.value.query);
1278
1302
  }
1279
1303
  );
1280
- return (p, S) => (c(), h(N, null, [
1304
+ return (p, C) => (u(), _(N, null, [
1281
1305
  l("div", {
1282
1306
  ref_key: "anchorRef",
1283
1307
  ref: n
1284
1308
  }, null, 512),
1285
- d.value ? (c(), O(Ie, {
1309
+ d.value ? (u(), O(ke, {
1286
1310
  key: 0,
1287
1311
  to: "body"
1288
1312
  }, [
1289
1313
  l("div", {
1290
1314
  ref_key: "panelRef",
1291
- ref: u,
1292
- class: Y(["dialog-search-panel", `dialog-search-panel--${e.layout}`]),
1293
- style: ke(y.value)
1315
+ ref: c,
1316
+ class: Z(["dialog-search-panel", `dialog-search-panel--${e.layout}`]),
1317
+ style: Ae(y.value)
1294
1318
  }, [
1295
- e.state.status === K(A).ERROR ? (c(), h("div", zo, [
1296
- l("p", Go, E(o(e.state.error)), 1),
1319
+ e.state.status === K(L).ERROR ? (u(), _("div", Qs, [
1320
+ l("p", Xs, E(s(e.state.error)), 1),
1297
1321
  l("button", {
1298
1322
  type: "button",
1299
1323
  class: "dialog-search-retry",
1300
- onClick: S[0] || (S[0] = (P) => e.controller.retry())
1301
- }, E(b.value.retry), 1)
1302
- ])) : g.value === void 0 ? (c(), h("p", Qo, E(b.value.searching(e.state.query)), 1)) : (c(), h(N, { key: 2 }, [
1324
+ onClick: C[0] || (C[0] = (P) => e.controller.retry())
1325
+ }, E(S.value.retry), 1)
1326
+ ])) : f.value === void 0 ? (u(), _("p", Ys, E(S.value.searching(e.state.query)), 1)) : (u(), _(N, { key: 2 }, [
1303
1327
  l("div", {
1304
- class: Y([
1328
+ class: Z([
1305
1329
  "dialog-search-body",
1306
- { "dialog-search-body--no-collections": !R.value }
1330
+ { "dialog-search-body--no-collections": !$.value }
1307
1331
  ])
1308
1332
  }, [
1309
- I(bo, {
1310
- collections: $.value,
1311
- query: g.value.query,
1312
- messages: b.value
1333
+ T(ys, {
1334
+ collections: I.value,
1335
+ query: f.value.query,
1336
+ messages: S.value
1313
1337
  }, null, 8, ["collections", "query", "messages"]),
1314
- I(Ro, {
1338
+ T(ks, {
1315
1339
  controller: e.controller,
1316
- response: g.value,
1340
+ response: f.value,
1317
1341
  locale: e.locale,
1318
- messages: b.value
1342
+ messages: S.value
1319
1343
  }, null, 8, ["controller", "response", "locale", "messages"])
1320
1344
  ], 2),
1321
- T.value || m.value ? (c(), h("div", Wo, [
1322
- T.value ? (c(), h("a", {
1345
+ R.value || m.value ? (u(), _("div", Zs, [
1346
+ R.value ? (u(), _("a", {
1323
1347
  key: 0,
1324
1348
  class: "dialog-search-cta",
1325
1349
  href: v.value
1326
1350
  }, [
1327
- le(E(b.value.seeAllLabel(g.value.nbHits)) + " ", 1),
1328
- I(so)
1329
- ], 8, Xo)) : (c(), O(Vt, {
1351
+ ce(E(S.value.seeAllLabel(f.value.nbHits)) + " ", 1),
1352
+ T(is)
1353
+ ], 8, Js)) : (u(), O(zt, {
1330
1354
  key: 1,
1331
1355
  controller: e.controller,
1332
1356
  state: e.state,
1333
1357
  locale: e.locale
1334
1358
  }, null, 8, ["controller", "state", "locale"]))
1335
- ])) : L("", !0)
1359
+ ])) : A("", !0)
1336
1360
  ], 64))
1337
1361
  ], 6)
1338
- ])) : L("", !0)
1362
+ ])) : A("", !0)
1339
1363
  ], 64));
1340
1364
  }
1341
- }), os = (t) => {
1342
- const { client: e, surface: o = "search_page", ...s } = t, r = Qe({
1343
- search: (a, _) => e.search(a, _),
1365
+ }), ro = (t) => {
1366
+ const { client: e, surface: s = "search_page", ...o } = t, r = Qe({
1367
+ search: (a, h) => e.search(a, h),
1344
1368
  analytics: {
1345
- surface: o,
1369
+ surface: s,
1346
1370
  trackViewSearchResults: (a) => e.trackViewSearchResults(a),
1347
1371
  trackSelectSearchResult: (a) => e.trackSelectSearchResult(a)
1348
1372
  },
1349
- ...s
1373
+ ...o
1350
1374
  }), n = Le(r.getState()), i = r.subscribe(() => {
1351
1375
  n.value = r.getState();
1352
1376
  });
1353
1377
  return B(() => {
1354
- de({
1378
+ pe({
1355
1379
  method: "vue",
1356
- version: "3.7.0"
1380
+ version: "3.8.0"
1357
1381
  });
1358
- }), ce(() => {
1382
+ }), ue(() => {
1359
1383
  i(), r.dispose();
1360
1384
  }), { controller: r, state: n, theme: e.theme };
1361
1385
  };
1362
1386
  export {
1363
- Ct as DialogInput,
1364
- Jo as DialogProductBlock,
1365
- es as DialogSearchBar,
1366
- Vt as DialogSearchPagination,
1367
- Jt as DialogSearchProductCard,
1368
- ts as DialogSearchResults,
1369
- os as useDialogSearch
1387
+ It as DialogInput,
1388
+ so as DialogProductBlock,
1389
+ oo as DialogSearchBar,
1390
+ zt as DialogSearchPagination,
1391
+ os as DialogSearchProductCard,
1392
+ no as DialogSearchResults,
1393
+ ro as useDialogSearch
1370
1394
  };