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