@askdialog/dialog-vue 3.9.0 → 3.10.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,7 +1,7 @@
1
1
  var Ee = Object.defineProperty;
2
2
  var ye = (t, e, s) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
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";
4
+ import { defineComponent as I, createElementBlock as _, 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 b, 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 de, Teleport as Ae, normalizeStyle as Le, normalizeClass as Z, shallowRef as xe } from "vue";
5
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
6
  var q;
7
7
  (function(t) {
@@ -13,8 +13,8 @@ var J;
13
13
  })(J || (J = {}));
14
14
  q.TRACK_ADD_TO_CART, q.TRACK_SUBMIT_CHECKOUT, q.TRACK_VIEW_SEARCH_RESULTS, q.TRACK_SELECT_SEARCH_RESULT;
15
15
  class Ne extends Error {
16
- constructor({ status: s, code: o, message: n }) {
17
- super(n);
16
+ constructor({ status: s, code: o, message: r }) {
17
+ super(r);
18
18
  z(this, "status");
19
19
  z(this, "code");
20
20
  this.name = "DialogSearchError", this.status = s, this.code = o;
@@ -23,10 +23,10 @@ class Ne extends Error {
23
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(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 = () => {
29
+ }, ee = "multiple installation methods detected:", qe = () => typeof window > "u" ? void 0 : window, ue = () => {
30
30
  const t = qe();
31
31
  if (t !== void 0)
32
32
  return t.dialog = t.dialog ?? {}, t.dialog.audit = t.dialog.audit ?? {
@@ -44,7 +44,7 @@ const X = (t, e, s) => {
44
44
  version: (t == null ? void 0 : t.version) ?? e.version,
45
45
  commit: (t == null ? void 0 : t.commit) ?? e.commit
46
46
  }, pe = (t) => {
47
- const e = de();
47
+ const e = ue();
48
48
  if (e === void 0)
49
49
  return;
50
50
  const s = e.methods.find((o) => o.method === t.method);
@@ -54,7 +54,7 @@ const X = (t, e, s) => {
54
54
  }
55
55
  s.version = s.version ?? t.version, s.build = Ue(s.build, t.build), s.source = s.source ?? t.source;
56
56
  }, He = (t) => {
57
- const e = de();
57
+ const e = ue();
58
58
  e !== void 0 && (e.capabilities.includes(t) || e.capabilities.push(t));
59
59
  }, A = {
60
60
  IDLE: "idle",
@@ -64,93 +64,94 @@ const X = (t, e, s) => {
64
64
  EMPTY: "empty",
65
65
  ERROR: "error"
66
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 = [];
69
- const i = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
67
+ function ze({ emit: t, visibilityThreshold: e = Ve, dwellMs: s = Be, idleFlushMs: o = Ke, maxItemsPerEvent: r = Fe }) {
68
+ let n, a = [];
69
+ const i = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
70
70
  let C;
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)
71
+ const d = () => {
72
+ clearTimeout(C), !(n === void 0 || a.length === 0) && (t({ ...n, items: a }), a = []);
73
+ }, f = (S) => {
74
+ if (n === void 0)
75
75
  return;
76
- const m = `${r.query_id}:${b.product_id}`;
76
+ const m = `${n.query_id}:${S.product_id}`;
77
77
  if (!i.has(m)) {
78
- if (i.add(m), a.push(b), a.length >= n) {
79
- c();
78
+ if (i.add(m), a.push(S), a.length >= r) {
79
+ d();
80
80
  return;
81
81
  }
82
- clearTimeout(C), C = setTimeout(c, o);
82
+ clearTimeout(C), C = setTimeout(d, 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);
84
+ }, v = (S) => {
85
+ const m = c.get(S);
86
+ m !== void 0 && (clearTimeout(m), c.delete(S));
87
+ }, g = new IntersectionObserver((S) => {
88
+ for (const m of S) {
89
+ const h = p.get(m.target);
90
+ h !== void 0 && (m.intersectionRatio >= e ? c.has(m.target) || c.set(m.target, setTimeout(() => {
91
+ c.delete(m.target), f(h);
92
92
  }, s)) : v(m.target));
93
93
  }
94
94
  }, { threshold: e }), w = () => {
95
95
  g.disconnect();
96
- for (const b of d.values())
97
- clearTimeout(b);
98
- d.clear(), _.clear();
96
+ for (const S of c.values())
97
+ clearTimeout(S);
98
+ c.clear(), p.clear();
99
99
  }, $ = () => {
100
- c();
101
- }, k = (b) => {
102
- if (b.persisted) {
100
+ d();
101
+ }, k = (S) => {
102
+ if (S.persisted) {
103
103
  i.clear();
104
- for (const m of _.keys())
104
+ for (const m of p.keys())
105
105
  v(m), g.unobserve(m), g.observe(m);
106
106
  }
107
107
  };
108
108
  return window.addEventListener("pagehide", $), window.addEventListener("pageshow", k), {
109
- setContext(b) {
110
- c(), i.clear(), r = b, w();
109
+ setContext(S) {
110
+ d(), i.clear(), n = S, w();
111
111
  },
112
- observe(b, m) {
113
- _.set(b, m), g.observe(b);
112
+ observe(S, m) {
113
+ p.set(S, m), g.observe(S);
114
114
  },
115
- forceImpression(b) {
116
- f(b), c();
115
+ forceImpression(S) {
116
+ f(S), d();
117
117
  },
118
- flush: c,
118
+ flush: d,
119
119
  disconnect() {
120
- c(), w(), window.removeEventListener("pagehide", $), window.removeEventListener("pageshow", k);
120
+ d(), w(), window.removeEventListener("pagehide", $), window.removeEventListener("pageshow", k);
121
121
  }
122
122
  };
123
123
  }
124
124
  const te = (t, e) => ({
125
- product_id: t.hits[e].objectID,
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 Ge(t) {
130
131
  let e, s;
131
132
  const o = () => (e ?? (e = ze({
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, te(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 = te(r, n);
154
155
  o().forceImpression(a), t.trackSelectSearchResult({ ...s, items: [a] });
155
156
  },
156
157
  dispose() {
@@ -158,33 +159,34 @@ function je(t) {
158
159
  }
159
160
  };
160
161
  }
161
- const Ge = 2, se = (t) => {
162
+ const je = 2, se = (t) => {
162
163
  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 }) => ({
164
+ return [...e].length >= je ? e : void 0;
165
+ }, Qe = (t, e, s, { indexName: o, language: r, country: n, hitsPerPage: a }) => ({
165
166
  requests: [
166
167
  { indexName: o, query: t, page: e, hitsPerPage: a },
167
168
  ...s.map((i) => ({
168
- indexName: X(i.index, n, r),
169
+ indexName: X(i.index, r, n),
169
170
  query: t,
170
171
  page: 0,
171
172
  hitsPerPage: i.hitsPerPage ?? a
172
173
  }))
173
174
  ]
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)
175
+ }), We = (t, e, { indexName: s, language: o, country: r }) => {
176
+ const n = t.results.find((i) => i.index === s);
177
+ if (n === void 0)
177
178
  throw new Error(`Dialog search returned no ${s} entry`);
178
179
  const a = {};
179
180
  for (const i of e) {
180
- const _ = X(i.index, o, n), d = t.results.find((C) => C.index === _);
181
- d !== void 0 && (a[i.index] = d);
181
+ const p = X(i.index, o, r), c = t.results.find((C) => C.index === p);
182
+ c !== void 0 && (a[i.index] = c);
182
183
  }
183
184
  return {
184
- response: r,
185
+ // The products index answers product records only.
186
+ response: n,
185
187
  sections: e.length === 0 ? void 0 : a
186
188
  };
187
- }, j = {
189
+ }, G = {
188
190
  status: A.IDLE,
189
191
  query: "",
190
192
  page: 0,
@@ -192,34 +194,34 @@ const Ge = 2, se = (t) => {
192
194
  sections: void 0,
193
195
  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
+ function Xe({ search: t, language: e, country: s, analytics: o, navigate: r, debounceMs: n = 250, hitsPerPage: a = 12, sections: i = [] }) {
198
+ const p = {
197
199
  indexName: X("products", e, s),
198
200
  language: e,
199
- currency: s,
201
+ country: s,
200
202
  hitsPerPage: a
201
203
  };
202
- let d = j;
203
- const C = /* @__PURE__ */ new Set(), c = je(o);
204
+ let c = G;
205
+ const C = /* @__PURE__ */ new Set(), d = Ge(o);
204
206
  let f, v, g, w = 0, $ = !1;
205
- const k = (p) => {
206
- d = { ...d, ...p };
207
+ const k = (h) => {
208
+ c = { ...c, ...h };
207
209
  for (const E of C)
208
- E(d);
209
- }, b = () => {
210
+ E(c);
211
+ }, S = () => {
210
212
  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
+ }, m = async (h, E) => {
214
+ S(), g = new AbortController();
213
215
  const O = w;
214
- k({ status: A.LOADING, query: p, page: E });
216
+ k({ status: A.LOADING, query: h, page: E });
215
217
  try {
216
- const D = typeof i == "function" ? i() : i, Y = Qe(p, E, D, _), Ce = await t(Y, {
218
+ const D = typeof i == "function" ? i() : i, Y = Qe(h, E, D, p), Ce = await t(Y, {
217
219
  signal: g.signal
218
220
  });
219
221
  if (O !== w)
220
222
  return;
221
- const F = We(Ce, D, _);
222
- c.onResponse(F.response), k({
223
+ const F = We(Ce, D, p);
224
+ d.onResponse(F.response), k({
223
225
  ...F,
224
226
  status: F.response.nbHits === 0 ? A.EMPTY : A.SUCCESS,
225
227
  error: void 0
@@ -236,59 +238,59 @@ function Xe({ search: t, language: e, currency: s, analytics: o, navigate: n, de
236
238
  }
237
239
  };
238
240
  return {
239
- setQuery(p) {
241
+ setQuery(h) {
240
242
  if ($)
241
243
  return;
242
- b();
243
- const E = se(p);
244
+ S();
245
+ const E = se(h);
244
246
  if (E === void 0) {
245
- k(j);
247
+ k(G);
246
248
  return;
247
249
  }
248
- v = E, f = setTimeout(() => void m(E, 0), r);
250
+ v = E, f = setTimeout(() => void m(E, 0), n);
249
251
  },
250
- submit(p) {
252
+ submit(h) {
251
253
  if ($)
252
254
  return;
253
- b();
254
- const E = se(p);
255
+ S();
256
+ const E = se(h);
255
257
  if (E === void 0) {
256
- k(j);
258
+ k(G);
257
259
  return;
258
260
  }
259
261
  m(E, 0);
260
262
  },
261
- setPage(p) {
263
+ setPage(h) {
262
264
  if (!$) {
263
265
  if (v !== void 0) {
264
266
  m(v, 0);
265
267
  return;
266
268
  }
267
- d.query !== "" && m(d.query, p);
269
+ c.query !== "" && m(c.query, h);
268
270
  }
269
271
  },
270
272
  retry() {
271
- $ || d.status !== A.ERROR || m(d.query, d.page);
273
+ $ || c.status !== A.ERROR || m(c.query, c.page);
272
274
  },
273
- observeResult(p, E) {
274
- d.response !== void 0 && c.observeResult(p, d.response, E);
275
+ observeResult(h, E) {
276
+ c.response !== void 0 && d.observeResult(h, c.response, E);
275
277
  },
276
- selectResult(p, E) {
277
- const O = d.response;
278
+ selectResult(h, E) {
279
+ const O = c.response;
278
280
  if (O === 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
+ d.select(O, h);
283
+ const D = O.hits[h].url;
284
+ return ((E == null ? void 0 : E.navigate) ?? !0) && r !== void 0 && D !== void 0 ? (r(D, O.hits[h]), !0) : !1;
283
285
  },
284
- subscribe(p) {
285
- return C.add(p), () => {
286
- C.delete(p);
286
+ subscribe(h) {
287
+ return C.add(h), () => {
288
+ C.delete(h);
287
289
  };
288
290
  },
289
- getState: () => d,
291
+ getState: () => c,
290
292
  dispose() {
291
- $ = !0, b(), C.clear(), c.dispose();
293
+ $ = !0, S(), C.clear(), d.dispose();
292
294
  }
293
295
  };
294
296
  }
@@ -333,7 +335,7 @@ const oe = {
333
335
  }
334
336
  });
335
337
  };
336
- return (o, n) => (u(), h("button", {
338
+ return (o, r) => (u(), _("button", {
337
339
  type: "button",
338
340
  class: "dialog-ask-something-else",
339
341
  disabled: e.disabled,
@@ -342,8 +344,8 @@ const oe = {
342
344
  }
343
345
  }), x = (t, e) => {
344
346
  const s = t.__vccOpts || t;
345
- for (const [o, n] of e)
346
- s[o] = n;
347
+ for (const [o, r] of e)
348
+ s[o] = r;
347
349
  return s;
348
350
  }, 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({
349
351
  __name: "DialogBlockHeader",
@@ -353,7 +355,7 @@ const oe = {
353
355
  },
354
356
  setup(t) {
355
357
  const e = t;
356
- return (s, o) => (u(), h("div", et, [
358
+ return (s, o) => (u(), _("div", et, [
357
359
  l("div", tt, y(e.title ?? "Your expert"), 1),
358
360
  l("div", st, y(e.description ?? "A question about this product?"), 1)
359
361
  ]));
@@ -371,7 +373,7 @@ const oe = {
371
373
  },
372
374
  setup(t) {
373
375
  const e = t;
374
- return (s, o) => (u(), h("svg", rt, [
376
+ return (s, o) => (u(), _("svg", rt, [
375
377
  l("g", it, [
376
378
  l("path", {
377
379
  d: `M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
@@ -417,7 +419,7 @@ const oe = {
417
419
  ], -1))
418
420
  ]));
419
421
  }
420
- }), ut = ["onClick"], dt = { class: "dialog-block-suggestions-item-label" }, pt = /* @__PURE__ */ I({
422
+ }), dt = ["onClick"], ut = { class: "dialog-block-suggestions-item-label" }, pt = /* @__PURE__ */ I({
421
423
  __name: "DialogBlockSuggestions",
422
424
  props: {
423
425
  client: {},
@@ -436,21 +438,21 @@ const oe = {
436
438
  fromQuestionSuggestion: !0
437
439
  });
438
440
  };
439
- return (o, n) => (u(!0), h(N, null, W(e.questions, (r) => (u(), h("button", {
440
- key: r.question,
441
+ return (o, r) => (u(!0), _(N, null, W(e.questions, (n) => (u(), _("button", {
442
+ key: n.question,
441
443
  class: "dialog-block-suggestions-item",
442
- onClick: (a) => s(r.question)
444
+ onClick: (a) => s(n.question)
443
445
  }, [
444
446
  T(ct, {
445
447
  class: "dialog-block-suggestions-item-icon",
446
448
  color: e.client.theme.primaryColor
447
449
  }, null, 8, ["color"]),
448
- l("span", dt, y(r.question), 1)
449
- ], 8, ut))), 128));
450
+ l("span", ut, y(n.question), 1)
451
+ ], 8, dt))), 128));
450
452
  }
451
453
  }), ht = /* @__PURE__ */ x(pt, [["__scopeId", "data-v-db34d4b4"]]), _t = {};
452
454
  function gt(t, e) {
453
- return u(), h(N, null, [
455
+ return u(), _(N, null, [
454
456
  e[0] || (e[0] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
455
457
  e[1] || (e[1] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
456
458
  e[2] || (e[2] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
@@ -468,7 +470,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
468
470
  },
469
471
  setup(t) {
470
472
  const e = t;
471
- return (s, o) => (u(), h("div", vt, [
473
+ return (s, o) => (u(), _("div", vt, [
472
474
  e.isLoading || !e.questions ? (u(), P(ft, { key: 0 })) : (u(), P(ht, {
473
475
  key: 1,
474
476
  client: e.client,
@@ -492,7 +494,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
492
494
  },
493
495
  setup(t) {
494
496
  const e = t;
495
- return (s, o) => (u(), h("svg", St, [
497
+ return (s, o) => (u(), _("svg", St, [
496
498
  l("path", {
497
499
  d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
498
500
  stroke: e.color || "#ffffff",
@@ -515,7 +517,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
515
517
  selectedVariantId: {}
516
518
  },
517
519
  setup(t) {
518
- const e = t, s = R(), o = R(""), n = S(() => he(e.client.locale)), r = () => {
520
+ const e = t, s = R(), o = R(""), r = b(() => he(e.client.locale)), n = () => {
519
521
  var i;
520
522
  (i = s.value) == null || i.focus();
521
523
  }, a = () => {
@@ -528,18 +530,18 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
528
530
  fromQuestionSuggestion: !0
529
531
  }), o.value = "");
530
532
  };
531
- return (i, _) => (u(), h("div", yt, [
533
+ return (i, p) => (u(), _("div", yt, [
532
534
  l("div", {
533
535
  class: "dialog-input-wrapper",
534
- onClick: r
536
+ onClick: n
535
537
  }, [
536
538
  ie(l("input", {
537
539
  id: "dialog-ask-anything-input-ai-input",
538
540
  ref_key: "inputRef",
539
541
  ref: s,
540
- "onUpdate:modelValue": _[0] || (_[0] = (d) => o.value = d),
542
+ "onUpdate:modelValue": p[0] || (p[0] = (c) => o.value = c),
541
543
  class: "dialog-ask-anything-input-ai-input",
542
- placeholder: n.value.placeholder,
544
+ placeholder: r.value.placeholder,
543
545
  "aria-describedby": "dialog-input-ai-disclosure",
544
546
  onKeydown: Ie(a, ["enter"])
545
547
  }, null, 40, It), [
@@ -556,7 +558,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
556
558
  }, null, 8, ["color"])
557
559
  ], 8, wt)
558
560
  ]),
559
- l("p", $t, y(n.value.aiDisclosure), 1)
561
+ l("p", $t, y(r.value.aiDisclosure), 1)
560
562
  ]));
561
563
  }
562
564
  }), Tt = /* @__PURE__ */ x(kt, [["__scopeId", "data-v-87013888"]]), Rt = /* @__PURE__ */ I({
@@ -565,45 +567,45 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
565
567
  theme: {}
566
568
  },
567
569
  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) => {
570
- const i = a, _ = o(a);
571
- if (r[i] !== void 0) {
572
- if (typeof r[i] == "object") {
573
- Object.keys(r[i]).forEach((d) => {
574
- var c;
575
- const C = d;
570
+ const e = t, s = document.body, o = (n) => n.replace(/([A-Z])/g, "-$1").toLowerCase(), r = (n) => {
571
+ n && Object.keys(n).forEach((a) => {
572
+ const i = a, p = o(a);
573
+ if (n[i] !== void 0) {
574
+ if (typeof n[i] == "object") {
575
+ Object.keys(n[i]).forEach((c) => {
576
+ var d;
577
+ const C = c;
576
578
  if (C !== void 0) {
577
- const f = o(d), v = r[i];
579
+ const f = o(c), v = n[i];
578
580
  s.style.setProperty(
579
- `--dialog-theme-${_}-${f}`,
580
- (c = v[C]) == null ? void 0 : c.toString()
581
+ `--dialog-theme-${p}-${f}`,
582
+ (d = v[C]) == null ? void 0 : d.toString()
581
583
  );
582
584
  }
583
585
  });
584
586
  return;
585
587
  }
586
588
  if (i === "ctaBorderType") {
587
- const d = r[i] === "rounded" ? "24px" : "0";
588
- s.style.setProperty(`--dialog-theme-${_}`, d);
589
+ const c = n[i] === "rounded" ? "24px" : "0";
590
+ s.style.setProperty(`--dialog-theme-${p}`, c);
589
591
  return;
590
592
  }
591
593
  s.style.setProperty(
592
- `--dialog-theme-${_}`,
593
- r[i].toString()
594
+ `--dialog-theme-${p}`,
595
+ n[i].toString()
594
596
  );
595
597
  }
596
598
  });
597
599
  };
598
600
  return K(() => {
599
- e.theme && n(e.theme);
601
+ e.theme && r(e.theme);
600
602
  }), M(
601
603
  () => e.theme,
602
- (r) => {
603
- r && n(r);
604
+ (n) => {
605
+ n && r(n);
604
606
  },
605
607
  { deep: !0 }
606
- ), (r, a) => we(r.$slots, "default");
608
+ ), (n, a) => we(n.$slots, "default");
607
609
  }
608
610
  }), At = ["dir"], Lt = 2, xt = 5, Dt = /* @__PURE__ */ I({
609
611
  __name: "DialogProductBlock",
@@ -619,42 +621,42 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
619
621
  K(() => {
620
622
  pe({
621
623
  method: "vue",
622
- version: "3.9.0"
624
+ version: "3.10.0"
623
625
  }), He("pdp-block");
624
626
  });
625
- const s = R(!0), o = R(void 0), n = R(0), r = S(() => {
626
- var c;
627
- return s.value ? "" : (c = o.value) == null ? void 0 : c.assistantName;
628
- }), a = S(() => {
629
- var c;
630
- return s.value ? "" : (c = o.value) == null ? void 0 : c.description;
631
- }), i = S(
627
+ const s = R(!0), o = R(void 0), r = R(0), n = b(() => {
628
+ var d;
629
+ return s.value ? "" : (d = o.value) == null ? void 0 : d.assistantName;
630
+ }), a = b(() => {
631
+ var d;
632
+ return s.value ? "" : (d = o.value) == null ? void 0 : d.description;
633
+ }), i = b(
632
634
  () => {
633
- var c, f;
634
- return (f = (c = o.value) == null ? void 0 : c.questions) == null ? void 0 : f.slice(0, Lt);
635
+ var d, f;
636
+ return (f = (d = o.value) == null ? void 0 : d.questions) == null ? void 0 : f.slice(0, Lt);
635
637
  }
636
- ), _ = S(() => {
637
- var c;
638
- return s.value ? "" : (c = o.value) == null ? void 0 : c.inputPlaceholder;
639
- }), d = S(
638
+ ), p = b(() => {
639
+ var d;
640
+ return s.value ? "" : (d = o.value) == null ? void 0 : d.inputPlaceholder;
641
+ }), c = b(
640
642
  () => {
641
- var c;
643
+ var d;
642
644
  return Oe(
643
- (c = e.client.getLocalizationInformations()) == null ? void 0 : c.languageCode
645
+ (d = e.client.getLocalizationInformations()) == null ? void 0 : d.languageCode
644
646
  );
645
647
  }
646
648
  ), C = async () => {
647
- const c = ++n.value;
649
+ const d = ++r.value;
648
650
  s.value = !0, o.value = void 0;
649
651
  try {
650
652
  const f = await e.client.getSuggestions(e.productId, {
651
653
  limit: xt
652
654
  });
653
- c === n.value && (o.value = f);
655
+ d === r.value && (o.value = f);
654
656
  } catch (f) {
655
657
  console.error("error", f);
656
658
  } finally {
657
- c === n.value && (s.value = !1);
659
+ d === r.value && (s.value = !1);
658
660
  }
659
661
  };
660
662
  return M(
@@ -663,7 +665,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
663
665
  C();
664
666
  },
665
667
  { immediate: !0 }
666
- ), (c, f) => (u(), P(Rt, {
668
+ ), (d, f) => (u(), P(Rt, {
667
669
  theme: e.client.theme
668
670
  }, {
669
671
  default: le(() => {
@@ -672,10 +674,10 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
672
674
  l("div", {
673
675
  id: "dialog-instant",
674
676
  class: "dialog-block-container",
675
- dir: d.value
677
+ dir: c.value
676
678
  }, [
677
679
  T(nt, {
678
- title: r.value,
680
+ title: n.value,
679
681
  description: a.value
680
682
  }, null, 8, ["title", "description"]),
681
683
  T(bt, {
@@ -689,7 +691,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
689
691
  e.enableInput ? (u(), P(Tt, {
690
692
  key: 0,
691
693
  client: e.client,
692
- placeholder: _.value,
694
+ placeholder: p.value,
693
695
  "product-id": e.productId,
694
696
  "product-title": e.productTitle,
695
697
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
@@ -717,7 +719,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
717
719
  "aria-hidden": "true"
718
720
  };
719
721
  function Nt(t, e) {
720
- return u(), h("svg", Ot, e[0] || (e[0] = [
722
+ return u(), _("svg", Ot, e[0] || (e[0] = [
721
723
  l("path", {
722
724
  d: "M8 13V3M8 3L3 8M8 3L13 8",
723
725
  stroke: "currentColor",
@@ -741,7 +743,7 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
741
743
  },
742
744
  setup(t) {
743
745
  const e = t;
744
- return (s, o) => (u(), h("svg", Mt, [
746
+ return (s, o) => (u(), _("svg", Mt, [
745
747
  l("path", {
746
748
  d: Ht,
747
749
  fill: e.color || "currentColor"
@@ -759,13 +761,13 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
759
761
  setup(t) {
760
762
  const e = t, s = R(""), o = () => {
761
763
  e.controller.setQuery(s.value);
762
- }, n = () => {
764
+ }, r = () => {
763
765
  e.controller.submit(s.value);
764
766
  };
765
- return (r, a) => (u(), h("form", {
767
+ return (n, a) => (u(), _("form", {
766
768
  class: "dialog-search-bar",
767
769
  role: "search",
768
- onSubmit: $e(n, ["prevent"])
770
+ onSubmit: $e(r, ["prevent"])
769
771
  }, [
770
772
  l("div", Bt, [
771
773
  l("span", Kt, [
@@ -793,7 +795,7 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
793
795
  ], 8, zt)
794
796
  ], 32));
795
797
  }
796
- }), jt = (t, e) => {
798
+ }), Gt = (t, e) => {
797
799
  try {
798
800
  return new Intl.NumberFormat(e).format(t);
799
801
  } catch {
@@ -868,8 +870,8 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
868
870
  }, _e = (t) => {
869
871
  var o;
870
872
  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 = {
873
+ return (ne[e] ?? ne.en)((r) => Gt(r, t));
874
+ }, ge = (t) => t.status !== A.LOADING && t.response !== void 0 && t.response.nbPages > 1, jt = {
873
875
  key: 0,
874
876
  "aria-label": "Search results pages",
875
877
  class: "dialog-search-pagination"
@@ -881,18 +883,18 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
881
883
  locale: {}
882
884
  },
883
885
  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, [
886
+ const e = t, s = b(() => e.state.response), o = b(() => _e(e.locale));
887
+ return (r, n) => s.value !== void 0 && H(ge)(e.state) ? (u(), _("nav", jt, [
886
888
  l("button", {
887
889
  type: "button",
888
890
  disabled: s.value.page === 0,
889
- onClick: r[0] || (r[0] = (a) => e.controller.setPage(s.value.page - 1))
891
+ onClick: n[0] || (n[0] = (a) => e.controller.setPage(s.value.page - 1))
890
892
  }, y(o.value.previous), 9, Qt),
891
893
  l("span", null, y(o.value.pageOf(s.value.page + 1, s.value.nbPages)), 1),
892
894
  l("button", {
893
895
  type: "button",
894
896
  disabled: s.value.page >= s.value.nbPages - 1,
895
- onClick: r[1] || (r[1] = (a) => e.controller.setPage(s.value.page + 1))
897
+ onClick: n[1] || (n[1] = (a) => e.controller.setPage(s.value.page + 1))
896
898
  }, y(o.value.next), 9, Wt)
897
899
  ])) : L("", !0);
898
900
  }
@@ -900,22 +902,22 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
900
902
  const s = { before: "", match: t, after: "" }, o = re(e.trim());
901
903
  if (o === "")
902
904
  return s;
903
- const n = [...t], r = [];
905
+ const r = [...t], n = [];
904
906
  let a = "";
905
- n.forEach((C, c) => {
907
+ r.forEach((C, d) => {
906
908
  const f = re(C);
907
909
  for (let v = 0; v < f.length; v += 1)
908
- r.push(c);
910
+ n.push(d);
909
911
  a += f;
910
912
  });
911
913
  const i = a.indexOf(o);
912
914
  if (i === -1)
913
915
  return s;
914
- const _ = r[i], d = r[i + o.length - 1] + 1;
916
+ const p = n[i], c = n[i + o.length - 1] + 1;
915
917
  return {
916
- before: n.slice(0, _).join(""),
917
- match: n.slice(_, d).join(""),
918
- after: n.slice(d).join("")
918
+ before: r.slice(0, p).join(""),
919
+ match: r.slice(p, c).join(""),
920
+ after: r.slice(c).join("")
919
921
  };
920
922
  }, Zt = {
921
923
  key: 0,
@@ -930,25 +932,24 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
930
932
  query: {}
931
933
  },
932
934
  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),
935
+ const e = t, s = b(() => Yt(e.title, e.query));
936
+ return (o, r) => (u(), _(N, null, [
937
+ s.value.before !== "" ? (u(), _("span", Zt, y(s.value.before), 1)) : L("", !0),
936
938
  l("span", Jt, y(s.value.match), 1),
937
- s.value.after !== "" ? (u(), h("span", es, y(s.value.after), 1)) : L("", !0)
939
+ s.value.after !== "" ? (u(), _("span", es, y(s.value.after), 1)) : L("", !0)
938
940
  ], 64));
939
941
  }
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) => {
942
+ }), ts = ({ variants_min_price: t, currency: e }, s) => {
944
943
  if (t === void 0)
945
944
  return "";
946
945
  try {
947
- return ts(t.min, e);
946
+ return e === void 0 ? new Intl.NumberFormat(s).format(t) : new Intl.NumberFormat(s, { style: "currency", currency: e }).format(
947
+ t
948
+ );
948
949
  } catch {
949
950
  return "";
950
951
  }
951
- }, os = (t) => {
952
+ }, ss = (t) => t.product_image || t.image || void 0, os = (t) => {
952
953
  try {
953
954
  const { protocol: e } = new URL(t, window.location.href);
954
955
  return e === "http:" || e === "https:" ? t : void 0;
@@ -979,15 +980,13 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
979
980
  },
980
981
  { immediate: !0, flush: "post" }
981
982
  );
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 });
983
+ const o = b(() => ve(e.hit)), r = b(() => ss(e.hit)), n = b(() => ts(e.hit, e.locale)), a = (p) => {
984
+ const c = p.metaKey || p.ctrlKey || p.shiftKey || p.altKey;
985
+ e.controller.selectResult(e.index, { navigate: !c }) && p.preventDefault();
986
+ }, i = (p) => {
987
+ p.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
989
988
  };
990
- return (i, _) => (u(), h("li", {
989
+ return (p, c) => (u(), _("li", {
991
990
  ref_key: "cardRef",
992
991
  ref: s,
993
992
  class: "dialog-search-card"
@@ -996,13 +995,13 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
996
995
  class: "dialog-search-product",
997
996
  href: o.value
998
997
  }, Re(
999
- o.value === void 0 ? {} : { click: r, auxclick: a }
998
+ o.value === void 0 ? {} : { click: a, auxclick: i }
1000
999
  )), {
1001
1000
  default: le(() => [
1002
1001
  l("span", ns, [
1003
- e.hit.imageUrl !== void 0 && e.hit.imageUrl !== "" ? (u(), h("img", {
1002
+ r.value !== void 0 ? (u(), _("img", {
1004
1003
  key: 0,
1005
- src: e.hit.imageUrl,
1004
+ src: r.value,
1006
1005
  alt: "",
1007
1006
  loading: "lazy"
1008
1007
  }, null, 8, rs)) : L("", !0)
@@ -1013,13 +1012,13 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
1013
1012
  query: e.query
1014
1013
  }, null, 8, ["title", "query"])
1015
1014
  ]),
1016
- n.value !== "" ? (u(), h("span", as, y(n.value), 1)) : L("", !0)
1015
+ n.value !== "" ? (u(), _("span", as, y(n.value), 1)) : L("", !0)
1017
1016
  ]),
1018
1017
  _: 1
1019
1018
  }, 16, ["href"]))
1020
1019
  ], 512));
1021
1020
  }
1022
- }), cs = {}, us = {
1021
+ }), cs = {}, ds = {
1023
1022
  width: "16",
1024
1023
  height: "16",
1025
1024
  viewBox: "0 0 256 256",
@@ -1027,12 +1026,12 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
1027
1026
  xmlns: "http://www.w3.org/2000/svg",
1028
1027
  "aria-hidden": "true"
1029
1028
  };
1030
- function ds(t, e) {
1031
- return u(), h("svg", us, e[0] || (e[0] = [
1029
+ function us(t, e) {
1030
+ return u(), _("svg", ds, e[0] || (e[0] = [
1032
1031
  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
1032
  ]));
1034
1033
  }
1035
- const ps = /* @__PURE__ */ x(cs, [["render", ds]]), hs = {}, _s = {
1034
+ const ps = /* @__PURE__ */ x(cs, [["render", us]]), hs = {}, _s = {
1036
1035
  width: "12",
1037
1036
  height: "12",
1038
1037
  viewBox: "0 0 256 256",
@@ -1041,7 +1040,7 @@ const ps = /* @__PURE__ */ x(cs, [["render", ds]]), hs = {}, _s = {
1041
1040
  "aria-hidden": "true"
1042
1041
  };
1043
1042
  function gs(t, e) {
1044
- return u(), h("svg", _s, e[0] || (e[0] = [
1043
+ return u(), _("svg", _s, e[0] || (e[0] = [
1045
1044
  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
1045
  ]));
1047
1046
  }
@@ -1062,31 +1061,31 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1062
1061
  messages: {}
1063
1062
  },
1064
1063
  setup(t) {
1065
- const e = t, s = S(() => be(e.collections));
1066
- return (o, n) => s.value.length > 0 ? (u(), h("aside", vs, [
1064
+ const e = t, s = b(() => be(e.collections));
1065
+ return (o, r) => s.value.length > 0 ? (u(), _("aside", vs, [
1067
1066
  l("div", ms, [
1068
1067
  l("p", bs, y(e.messages.collectionsLabel), 1),
1069
1068
  l("span", Ss, y(e.messages.collectionsCount(s.value.length)), 1)
1070
1069
  ]),
1071
1070
  l("ul", Cs, [
1072
- (u(!0), h(N, null, W(s.value, ({ collection: r, href: a }) => (u(), h("li", {
1073
- key: r.objectID
1071
+ (u(!0), _(N, null, W(s.value, ({ collection: n, href: a }) => (u(), _("li", {
1072
+ key: n.objectID
1074
1073
  }, [
1075
1074
  l("a", {
1076
1075
  class: "dialog-search-collection",
1077
1076
  href: a
1078
1077
  }, [
1079
1078
  l("span", ys, [
1080
- r.imageUrl !== void 0 && r.imageUrl !== "" ? (u(), h("img", {
1079
+ n.imageUrl !== void 0 && n.imageUrl !== "" ? (u(), _("img", {
1081
1080
  key: 0,
1082
- src: r.imageUrl,
1081
+ src: n.imageUrl,
1083
1082
  alt: "",
1084
1083
  loading: "lazy"
1085
1084
  }, null, 8, Is)) : L("", !0)
1086
1085
  ]),
1087
1086
  l("span", ws, [
1088
1087
  T(fe, {
1089
- title: H(me)(r),
1088
+ title: H(me)(n),
1090
1089
  query: e.query
1091
1090
  }, null, 8, ["title", "query"])
1092
1091
  ]),
@@ -1115,19 +1114,19 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1115
1114
  },
1116
1115
  setup(t) {
1117
1116
  const e = t;
1118
- return (s, o) => (u(), h("section", Ts, [
1117
+ return (s, o) => (u(), _("section", Ts, [
1119
1118
  l("div", Rs, [
1120
1119
  l("p", As, [
1121
1120
  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)
1121
+ e.response.nbHits > 0 ? (u(), _("span", Ls, " · " + y(e.messages.resultsCount(e.response.nbHits)), 1)) : L("", !0)
1123
1122
  ])
1124
1123
  ]),
1125
1124
  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,
1125
+ e.response.hits.length === 0 ? (u(), _("li", Ds, y(e.messages.noResults), 1)) : (u(!0), _(N, { key: 1 }, W(e.response.hits, (r, n) => (u(), P(ls, {
1126
+ key: r.objectID,
1128
1127
  controller: e.controller,
1129
- hit: n,
1130
- index: r,
1128
+ hit: r,
1129
+ index: n,
1131
1130
  locale: e.locale,
1132
1131
  query: e.response.query
1133
1132
  }, null, 8, ["controller", "hit", "index", "locale", "query"]))), 128))
@@ -1144,13 +1143,13 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1144
1143
  e - U - s
1145
1144
  )}px`, width: `${s}px` };
1146
1145
  }, 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,
1146
+ const o = s - t.bottom - V - U, r = t.top - V - U, n = Ms(t, e);
1147
+ return o < Os && r > o ? {
1148
+ ...n,
1150
1149
  bottom: `${s - t.top + V}px`,
1151
- maxHeight: `${Math.max(n, 0)}px`
1150
+ maxHeight: `${Math.max(r, 0)}px`
1152
1151
  } : {
1153
- ...r,
1152
+ ...n,
1154
1153
  top: `${t.bottom + V}px`,
1155
1154
  maxHeight: `${Math.max(o, 0)}px`
1156
1155
  };
@@ -1182,9 +1181,9 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1182
1181
  const e = Ks(t);
1183
1182
  if (e === void 0)
1184
1183
  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 = {
1184
+ const [s, o, r] = e.map(Fs);
1185
+ return 0.2126 * s + 0.7152 * o + 0.0722 * r;
1186
+ }, zs = "#181825", Gs = "#ffffff", js = "straight", j = 0.5, Q = {
1188
1187
  light: {
1189
1188
  panel: "#ffffff",
1190
1189
  side: "#fafbfc",
@@ -1218,40 +1217,40 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1218
1217
  }
1219
1218
  }, B = (t) => t === void 0 || t.trim() === "" ? void 0 : t.trim(), Ws = (t) => {
1220
1219
  const e = t === void 0 ? void 0 : Se(t);
1221
- return e === void 0 ? "light" : e < G ? "dark" : "light";
1220
+ return e === void 0 ? "light" : e < j ? "dark" : "light";
1222
1221
  }, Xs = (t, e) => {
1223
1222
  const s = Se(t);
1224
- return s === void 0 ? Q[e].text : (e === "light" ? s < G : s >= G) ? t : Q[e].text;
1223
+ return s === void 0 ? Q[e].text : (e === "light" ? s < j : s >= j) ? t : Q[e].text;
1225
1224
  }, 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 = {
1225
+ const e = Ws(B(t == null ? void 0 : t.backgroundColor)), s = (t == null ? void 0 : t.ctaBorderType) === js ? "rectangle" : "rectangle-rounded", o = B(t == null ? void 0 : t.primaryColor) ?? zs, r = B(t == null ? void 0 : t.fontFamily), n = {
1227
1226
  ...Q[e],
1228
1227
  ...Qs[s],
1229
1228
  primary: o,
1230
1229
  accent: Xs(o, e),
1231
- "cta-text": B(t == null ? void 0 : t.ctaTextColor) ?? js,
1232
- ...n === void 0 ? {} : { font: n }
1230
+ "cta-text": B(t == null ? void 0 : t.ctaTextColor) ?? Gs,
1231
+ ...r === void 0 ? {} : { font: r }
1233
1232
  };
1234
1233
  return Object.fromEntries(
1235
- Object.entries(r).map(([a, i]) => [`--dso-${a}`, i])
1234
+ Object.entries(n).map(([a, i]) => [`--dso-${a}`, i])
1236
1235
  );
1237
1236
  }, Zs = (t) => {
1238
1237
  const e = R(), s = R(void 0), o = R({ width: 0, height: 0 });
1239
1238
  return M(
1240
1239
  t,
1241
- (n, r, a) => {
1242
- if (!n)
1240
+ (r, n, a) => {
1241
+ if (!r)
1243
1242
  return;
1244
1243
  const i = () => {
1245
- const _ = e.value;
1246
- if (_ === void 0)
1244
+ const p = e.value;
1245
+ if (p === void 0)
1247
1246
  return;
1248
- const d = _.previousElementSibling ?? _, { top: C, bottom: c, left: f, width: v } = d.getBoundingClientRect();
1247
+ const c = p.previousElementSibling ?? p, { top: C, bottom: d, left: f, width: v } = c.getBoundingClientRect();
1249
1248
  (o.value.width !== window.innerWidth || o.value.height !== window.innerHeight) && (o.value = {
1250
1249
  width: window.innerWidth,
1251
1250
  height: window.innerHeight
1252
1251
  });
1253
1252
  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 });
1253
+ (g === void 0 || g.top !== C || g.bottom !== d || g.left !== f || g.width !== v) && (s.value = { top: C, bottom: d, left: f, width: v });
1255
1254
  };
1256
1255
  i(), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), a(() => {
1257
1256
  window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
@@ -1260,7 +1259,7 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1260
1259
  { immediate: !0, flush: "post" }
1261
1260
  ), { anchorRef: e, rect: s, viewport: o };
1262
1261
  }, Js = (t, e) => {
1263
- const s = R(!1), o = R(), n = S(
1262
+ const s = R(!1), o = R(), r = b(
1264
1263
  () => t.value.status !== A.IDLE && !s.value
1265
1264
  );
1266
1265
  M(
@@ -1269,40 +1268,40 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1269
1268
  s.value = !1;
1270
1269
  }
1271
1270
  ), M(
1272
- n,
1273
- (a, i, _) => {
1271
+ r,
1272
+ (a, i, p) => {
1274
1273
  if (!a)
1275
1274
  return;
1276
- const d = (C) => {
1275
+ const c = (C) => {
1277
1276
  var w, $;
1278
- const c = C.target;
1279
- if (!(c instanceof Node))
1277
+ const d = C.target;
1278
+ if (!(d instanceof Node))
1280
1279
  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;
1280
+ const f = (w = e.value) == null ? void 0 : w.previousElementSibling, v = (($ = o.value) == null ? void 0 : $.contains(d)) ?? !1, g = (f == null ? void 0 : f.contains(d)) ?? !1;
1282
1281
  !v && !g && (s.value = !0);
1283
1282
  };
1284
- document.addEventListener("pointerdown", d), _(
1285
- () => document.removeEventListener("pointerdown", d)
1283
+ document.addEventListener("pointerdown", c), p(
1284
+ () => document.removeEventListener("pointerdown", c)
1286
1285
  );
1287
1286
  },
1288
1287
  { immediate: !0 }
1289
1288
  );
1290
- const r = () => {
1289
+ const n = () => {
1291
1290
  s.value = !1;
1292
1291
  };
1293
1292
  return K(() => {
1294
1293
  var a, i;
1295
1294
  (i = (a = e.value) == null ? void 0 : a.previousElementSibling) == null || i.addEventListener(
1296
1295
  "focusin",
1297
- r
1296
+ n
1298
1297
  );
1299
- }), ue(() => {
1298
+ }), de(() => {
1300
1299
  var a, i;
1301
1300
  (i = (a = e.value) == null ? void 0 : a.previousElementSibling) == null || i.removeEventListener(
1302
1301
  "focusin",
1303
- r
1302
+ n
1304
1303
  );
1305
- }), { isOpen: n, panelRef: o };
1304
+ }), { isOpen: r, panelRef: o };
1306
1305
  }, eo = {
1307
1306
  key: 0,
1308
1307
  class: "dialog-search-error"
@@ -1327,30 +1326,30 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1327
1326
  seeAllHref: { type: Function, default: void 0 }
1328
1327
  },
1329
1328
  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(() => ({
1329
+ const e = t, s = (h) => h instanceof Ne ? `Search failed (${h.status}${h.code ? ` ${h.code}` : ""}): ${h.message}` : "Search failed: network error. Check your connection and try again.", o = b(() => e.state), r = b(() => e.state.status !== A.IDLE), { anchorRef: n, rect: a, viewport: i } = Zs(r), { isOpen: p, panelRef: c } = Js(o, n), C = b(
1330
+ () => p.value && a.value !== void 0 && qs(a.value, i.value.height)
1331
+ ), d = b(() => Ys(e.theme)), f = b(() => ({
1333
1332
  ...a.value === void 0 ? {} : Us(a.value, i.value.width, i.value.height),
1334
- ...c.value
1335
- })), v = S(() => _e(e.locale)), g = S(() => e.state.response), w = S(
1333
+ ...d.value
1334
+ })), v = b(() => _e(e.locale)), g = b(() => e.state.response), w = b(
1336
1335
  () => {
1337
- var p, E;
1338
- return ((E = (p = e.state.sections) == null ? void 0 : p.collections) == null ? void 0 : E.hits) ?? [];
1336
+ var h, E;
1337
+ return ((E = (h = e.state.sections) == null ? void 0 : h.collections) == null ? void 0 : E.hits) ?? [];
1339
1338
  }
1340
- ), $ = S(
1339
+ ), $ = b(
1341
1340
  () => be(w.value).length > 0
1342
- ), k = S(
1341
+ ), k = b(
1343
1342
  () => e.seeAllHref !== void 0 && g.value !== void 0 && g.value.nbHits > 0
1344
- ), b = S(() => !k.value && ge(e.state)), m = S(
1343
+ ), S = b(() => !k.value && ge(e.state)), m = b(
1345
1344
  () => {
1346
- var p;
1347
- return g.value === void 0 || (p = e.seeAllHref) == null ? void 0 : p.call(e, g.value.query);
1345
+ var h;
1346
+ return g.value === void 0 || (h = e.seeAllHref) == null ? void 0 : h.call(e, g.value.query);
1348
1347
  }
1349
1348
  );
1350
- return (p, E) => (u(), h(N, null, [
1349
+ return (h, E) => (u(), _(N, null, [
1351
1350
  l("div", {
1352
1351
  ref_key: "anchorRef",
1353
- ref: r
1352
+ ref: n
1354
1353
  }, null, 512),
1355
1354
  C.value ? (u(), P(Ae, {
1356
1355
  key: 0,
@@ -1358,18 +1357,18 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1358
1357
  }, [
1359
1358
  l("div", {
1360
1359
  ref_key: "panelRef",
1361
- ref: d,
1360
+ ref: c,
1362
1361
  class: Z(["dialog-search-panel", `dialog-search-panel--${e.layout}`]),
1363
1362
  style: Le(f.value)
1364
1363
  }, [
1365
- e.state.status === H(A).ERROR ? (u(), h("div", eo, [
1364
+ e.state.status === H(A).ERROR ? (u(), _("div", eo, [
1366
1365
  l("p", to, y(s(e.state.error)), 1),
1367
1366
  l("button", {
1368
1367
  type: "button",
1369
1368
  class: "dialog-search-retry",
1370
1369
  onClick: E[0] || (E[0] = (O) => e.controller.retry())
1371
1370
  }, 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 }, [
1371
+ ])) : g.value === void 0 ? (u(), _("p", so, y(v.value.searching(e.state.query)), 1)) : (u(), _(N, { key: 2 }, [
1373
1372
  l("div", {
1374
1373
  class: Z([
1375
1374
  "dialog-search-body",
@@ -1388,8 +1387,8 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1388
1387
  messages: v.value
1389
1388
  }, null, 8, ["controller", "response", "locale", "messages"])
1390
1389
  ], 2),
1391
- k.value || b.value ? (u(), h("div", oo, [
1392
- k.value ? (u(), h("a", {
1390
+ k.value || S.value ? (u(), _("div", oo, [
1391
+ k.value ? (u(), _("a", {
1393
1392
  key: 0,
1394
1393
  class: "dialog-search-cta",
1395
1394
  href: m.value
@@ -1409,25 +1408,25 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1409
1408
  ], 64));
1410
1409
  }
1411
1410
  }), uo = (t) => {
1412
- const { client: e, surface: s = "search_page", ...o } = t, n = Xe({
1413
- search: (i, _) => e.search(i, _),
1411
+ const { client: e, surface: s = "search_page", ...o } = t, r = Xe({
1412
+ search: (i, p) => e.search(i, p),
1414
1413
  analytics: {
1415
1414
  surface: s,
1416
1415
  trackViewSearchResults: (i) => e.trackViewSearchResults(i),
1417
1416
  trackSelectSearchResult: (i) => e.trackSelectSearchResult(i)
1418
1417
  },
1419
1418
  ...o
1420
- }), r = xe(n.getState()), a = n.subscribe(() => {
1421
- r.value = n.getState();
1419
+ }), n = xe(r.getState()), a = r.subscribe(() => {
1420
+ n.value = r.getState();
1422
1421
  });
1423
1422
  return K(() => {
1424
1423
  pe({
1425
1424
  method: "vue",
1426
- version: "3.9.0"
1425
+ version: "3.10.0"
1427
1426
  });
1428
- }), ue(() => {
1429
- a(), n.dispose();
1430
- }), { controller: n, state: r, theme: e.theme };
1427
+ }), de(() => {
1428
+ a(), r.dispose();
1429
+ }), { controller: r, state: n, theme: e.theme };
1431
1430
  };
1432
1431
  export {
1433
1432
  Tt as DialogInput,