@gymmymac/bob-widget 3.2.14 → 3.2.16

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.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ var Zn = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
4
  var sn = (t, e, r) => e.has(t) || Zn("Cannot " + r);
5
- var w = (t, e, r) => (sn(t, e, "read from private field"), r ? r.call(t) : e.get(t)), ne = (t, e, r) => e.has(t) ? Zn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), H = (t, e, r, s) => (sn(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r), ge = (t, e, r) => (sn(t, e, "access private method"), r);
5
+ var w = (t, e, r) => (sn(t, e, "read from private field"), r ? r.call(t) : e.get(t)), ne = (t, e, r) => e.has(t) ? Zn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), H = (t, e, r, s) => (sn(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r), me = (t, e, r) => (sn(t, e, "access private method"), r);
6
6
  var Fs = (t, e, r, s) => ({
7
7
  set _(n) {
8
8
  H(t, e, n, r);
@@ -13,7 +13,7 @@ var Fs = (t, e, r, s) => ({
13
13
  });
14
14
  import * as mt from "react";
15
15
  import nr, { useRef as X, useCallback as Y, useEffect as ce, createContext as Ua, useMemo as Et, useContext as zn, useState as V, useImperativeHandle as Ma } from "react";
16
- const ar = "3.2.14", nd = () => ar;
16
+ const ar = "3.2.16", nd = () => ar;
17
17
  var gn = { exports: {} }, is = {};
18
18
  /**
19
19
  * @license React
@@ -70,10 +70,10 @@ function qa() {
70
70
  {
71
71
  var oe = b.ReactDebugCurrentFrame, fe = oe.getStackAddendum();
72
72
  fe !== "" && (F += "%s", D = D.concat([fe]));
73
- var ye = D.map(function(de) {
73
+ var ve = D.map(function(de) {
74
74
  return String(de);
75
75
  });
76
- ye.unshift("Warning: " + F), Function.prototype.apply.call(console[y], console, ye);
76
+ ve.unshift("Warning: " + F), Function.prototype.apply.call(console[y], console, ve);
77
77
  }
78
78
  }
79
79
  var v = !1, S = !1, R = !1, P = !1, k = !1, N;
@@ -130,9 +130,9 @@ function qa() {
130
130
  var oe = y.displayName || null;
131
131
  return oe !== null ? oe : A(y.type) || "Memo";
132
132
  case f: {
133
- var fe = y, ye = fe._payload, de = fe._init;
133
+ var fe = y, ve = fe._payload, de = fe._init;
134
134
  try {
135
- return A(de(ye));
135
+ return A(de(ve));
136
136
  } catch {
137
137
  return null;
138
138
  }
@@ -144,7 +144,7 @@ function qa() {
144
144
  function re() {
145
145
  }
146
146
  re.__reactDisabledLog = !0;
147
- function _e() {
147
+ function ke() {
148
148
  {
149
149
  if (W === 0) {
150
150
  M = console.log, le = console.info, K = console.warn, U = console.error, G = console.group, he = console.groupCollapsed, ee = console.groupEnd;
@@ -216,25 +216,25 @@ function qa() {
216
216
  ` + O + y;
217
217
  }
218
218
  }
219
- var Ae = !1, Re;
219
+ var Oe = !1, Ae;
220
220
  {
221
- var ke = typeof WeakMap == "function" ? WeakMap : Map;
222
- Re = new ke();
221
+ var Se = typeof WeakMap == "function" ? WeakMap : Map;
222
+ Ae = new Se();
223
223
  }
224
224
  function Qe(y, F) {
225
- if (!y || Ae)
225
+ if (!y || Oe)
226
226
  return "";
227
227
  {
228
- var D = Re.get(y);
228
+ var D = Ae.get(y);
229
229
  if (D !== void 0)
230
230
  return D;
231
231
  }
232
232
  var oe;
233
- Ae = !0;
233
+ Oe = !0;
234
234
  var fe = Error.prepareStackTrace;
235
235
  Error.prepareStackTrace = void 0;
236
- var ye;
237
- ye = se.current, se.current = null, _e();
236
+ var ve;
237
+ ve = se.current, se.current = null, ke();
238
238
  try {
239
239
  if (F) {
240
240
  var de = function() {
@@ -271,26 +271,26 @@ function qa() {
271
271
  if (I && oe && typeof I.stack == "string") {
272
272
  for (var ue = I.stack.split(`
273
273
  `), Ie = oe.stack.split(`
274
- `), xe = ue.length - 1, Te = Ie.length - 1; xe >= 1 && Te >= 0 && ue[xe] !== Ie[Te]; )
275
- Te--;
276
- for (; xe >= 1 && Te >= 0; xe--, Te--)
277
- if (ue[xe] !== Ie[Te]) {
278
- if (xe !== 1 || Te !== 1)
274
+ `), _e = ue.length - 1, Re = Ie.length - 1; _e >= 1 && Re >= 0 && ue[_e] !== Ie[Re]; )
275
+ Re--;
276
+ for (; _e >= 1 && Re >= 0; _e--, Re--)
277
+ if (ue[_e] !== Ie[Re]) {
278
+ if (_e !== 1 || Re !== 1)
279
279
  do
280
- if (xe--, Te--, Te < 0 || ue[xe] !== Ie[Te]) {
280
+ if (_e--, Re--, Re < 0 || ue[_e] !== Ie[Re]) {
281
281
  var Ue = `
282
- ` + ue[xe].replace(" at new ", " at ");
283
- return y.displayName && Ue.includes("<anonymous>") && (Ue = Ue.replace("<anonymous>", y.displayName)), typeof y == "function" && Re.set(y, Ue), Ue;
282
+ ` + ue[_e].replace(" at new ", " at ");
283
+ return y.displayName && Ue.includes("<anonymous>") && (Ue = Ue.replace("<anonymous>", y.displayName)), typeof y == "function" && Ae.set(y, Ue), Ue;
284
284
  }
285
- while (xe >= 1 && Te >= 0);
285
+ while (_e >= 1 && Re >= 0);
286
286
  break;
287
287
  }
288
288
  }
289
289
  } finally {
290
- Ae = !1, se.current = ye, $(), Error.prepareStackTrace = fe;
290
+ Oe = !1, se.current = ve, $(), Error.prepareStackTrace = fe;
291
291
  }
292
292
  var ze = y ? y.displayName || y.name : "", ct = ze ? ae(ze) : "";
293
- return typeof y == "function" && Re.set(y, ct), ct;
293
+ return typeof y == "function" && Ae.set(y, ct), ct;
294
294
  }
295
295
  function et(y, F, D) {
296
296
  return Qe(y, !1);
@@ -319,9 +319,9 @@ function qa() {
319
319
  case h:
320
320
  return st(y.type, F, D);
321
321
  case f: {
322
- var oe = y, fe = oe._payload, ye = oe._init;
322
+ var oe = y, fe = oe._payload, ve = oe._init;
323
323
  try {
324
- return st(ye(fe), F, D);
324
+ return st(ve(fe), F, D);
325
325
  } catch {
326
326
  }
327
327
  }
@@ -338,9 +338,9 @@ function qa() {
338
338
  }
339
339
  function L(y, F, D, oe, fe) {
340
340
  {
341
- var ye = Function.call.bind(Ye);
341
+ var ve = Function.call.bind(Ye);
342
342
  for (var de in y)
343
- if (ye(y, de)) {
343
+ if (ve(y, de)) {
344
344
  var ue = void 0;
345
345
  try {
346
346
  if (typeof y[de] != "function") {
@@ -348,16 +348,16 @@ function qa() {
348
348
  throw Ie.name = "Invariant Violation", Ie;
349
349
  }
350
350
  ue = y[de](F, de, oe, D, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
351
- } catch (xe) {
352
- ue = xe;
351
+ } catch (_e) {
352
+ ue = _e;
353
353
  }
354
354
  ue && !(ue instanceof Error) && (q(fe), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", oe || "React class", D, de, typeof ue), q(null)), ue instanceof Error && !(ue.message in nt) && (nt[ue.message] = !0, q(fe), _("Failed %s type: %s", D, ue.message), q(null));
355
355
  }
356
356
  }
357
357
  }
358
- var Se = Array.isArray;
358
+ var je = Array.isArray;
359
359
  function Z(y) {
360
- return Se(y);
360
+ return je(y);
361
361
  }
362
362
  function pe(y) {
363
363
  {
@@ -365,7 +365,7 @@ function qa() {
365
365
  return D;
366
366
  }
367
367
  }
368
- function ve(y) {
368
+ function we(y) {
369
369
  try {
370
370
  return We(y), !1;
371
371
  } catch {
@@ -376,7 +376,7 @@ function qa() {
376
376
  return "" + y;
377
377
  }
378
378
  function Be(y) {
379
- if (ve(y))
379
+ if (we(y))
380
380
  return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pe(y)), We(y);
381
381
  }
382
382
  var Ne = b.ReactCurrentOwner, Ke = {
@@ -404,7 +404,7 @@ function qa() {
404
404
  function z(y, F) {
405
405
  typeof y.ref == "string" && Ne.current;
406
406
  }
407
- function be(y, F) {
407
+ function ye(y, F) {
408
408
  {
409
409
  var D = function() {
410
410
  lr || (lr = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", F));
@@ -415,7 +415,7 @@ function qa() {
415
415
  });
416
416
  }
417
417
  }
418
- function je(y, F) {
418
+ function Ee(y, F) {
419
419
  {
420
420
  var D = function() {
421
421
  ns || (ns = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", F));
@@ -426,7 +426,7 @@ function qa() {
426
426
  });
427
427
  }
428
428
  }
429
- var we = function(y, F, D, oe, fe, ye, de) {
429
+ var xe = function(y, F, D, oe, fe, ve, de) {
430
430
  var ue = {
431
431
  // This tag allows us to uniquely identify this as a React Element
432
432
  $$typeof: e,
@@ -436,7 +436,7 @@ function qa() {
436
436
  ref: D,
437
437
  props: de,
438
438
  // Record the component responsible for creating this element.
439
- _owner: ye
439
+ _owner: ve
440
440
  };
441
441
  return ue._store = {}, Object.defineProperty(ue._store, "validated", {
442
442
  configurable: !1,
@@ -457,20 +457,20 @@ function qa() {
457
457
  };
458
458
  function it(y, F, D, oe, fe) {
459
459
  {
460
- var ye, de = {}, ue = null, Ie = null;
460
+ var ve, de = {}, ue = null, Ie = null;
461
461
  D !== void 0 && (Be(D), ue = "" + D), Ns(F) && (Be(F.key), ue = "" + F.key), Is(F) && (Ie = F.ref, z(F, fe));
462
- for (ye in F)
463
- Ye.call(F, ye) && !Ke.hasOwnProperty(ye) && (de[ye] = F[ye]);
462
+ for (ve in F)
463
+ Ye.call(F, ve) && !Ke.hasOwnProperty(ve) && (de[ve] = F[ve]);
464
464
  if (y && y.defaultProps) {
465
- var xe = y.defaultProps;
466
- for (ye in xe)
467
- de[ye] === void 0 && (de[ye] = xe[ye]);
465
+ var _e = y.defaultProps;
466
+ for (ve in _e)
467
+ de[ve] === void 0 && (de[ve] = _e[ve]);
468
468
  }
469
469
  if (ue || Ie) {
470
- var Te = typeof y == "function" ? y.displayName || y.name || "Unknown" : y;
471
- ue && be(de, Te), Ie && je(de, Te);
470
+ var Re = typeof y == "function" ? y.displayName || y.name || "Unknown" : y;
471
+ ue && ye(de, Re), Ie && Ee(de, Re);
472
472
  }
473
- return we(y, ue, Ie, fe, oe, Ne.current, de);
473
+ return xe(y, ue, Ie, fe, oe, Ne.current, de);
474
474
  }
475
475
  }
476
476
  var Pt = b.ReactCurrentOwner, Ut = b.ReactDebugCurrentFrame;
@@ -541,7 +541,7 @@ Check the top-level render call using <` + D + ">.");
541
541
  else if (y) {
542
542
  var fe = x(y);
543
543
  if (typeof fe == "function" && fe !== y.entries)
544
- for (var ye = fe.call(y), de; !(de = ye.next()).done; )
544
+ for (var ve = fe.call(y), de; !(de = ve.next()).done; )
545
545
  It(de.value) && yt(de.value, F);
546
546
  }
547
547
  }
@@ -584,7 +584,7 @@ Check the top-level render call using <` + D + ">.");
584
584
  }
585
585
  }
586
586
  var lt = {};
587
- function zt(y, F, D, oe, fe, ye) {
587
+ function zt(y, F, D, oe, fe, ve) {
588
588
  {
589
589
  var de = E(y);
590
590
  if (!de) {
@@ -592,12 +592,12 @@ Check the top-level render call using <` + D + ">.");
592
592
  (y === void 0 || typeof y == "object" && y !== null && Object.keys(y).length === 0) && (ue += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
593
593
  var Ie = bt();
594
594
  Ie ? ue += Ie : ue += Wt();
595
- var xe;
596
- y === null ? xe = "null" : Z(y) ? xe = "array" : y !== void 0 && y.$$typeof === e ? (xe = "<" + (A(y.type) || "Unknown") + " />", ue = " Did you accidentally export a JSX literal instead of a component?") : xe = typeof y, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", xe, ue);
595
+ var _e;
596
+ y === null ? _e = "null" : Z(y) ? _e = "array" : y !== void 0 && y.$$typeof === e ? (_e = "<" + (A(y.type) || "Unknown") + " />", ue = " Did you accidentally export a JSX literal instead of a component?") : _e = typeof y, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _e, ue);
597
597
  }
598
- var Te = it(y, F, D, fe, ye);
599
- if (Te == null)
600
- return Te;
598
+ var Re = it(y, F, D, fe, ve);
599
+ if (Re == null)
600
+ return Re;
601
601
  if (de) {
602
602
  var Ue = F.children;
603
603
  if (Ue !== void 0)
@@ -612,20 +612,20 @@ Check the top-level render call using <` + D + ">.");
612
612
  ur(Ue, y);
613
613
  }
614
614
  if (Ye.call(F, "key")) {
615
- var ct = A(y), I = Object.keys(F).filter(function(Oe) {
616
- return Oe !== "key";
615
+ var ct = A(y), I = Object.keys(F).filter(function(Ce) {
616
+ return Ce !== "key";
617
617
  }), Ht = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
618
618
  if (!lt[ct + Ht]) {
619
- var Pe = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
619
+ var ge = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
620
620
  _(`A props object containing a "key" prop is being spread into JSX:
621
621
  let props = %s;
622
622
  <%s {...props} />
623
623
  React keys must be passed directly to JSX without using spread:
624
624
  let props = %s;
625
- <%s key={someKey} {...props} />`, Ht, ct, Pe, ct), lt[ct + Ht] = !0;
625
+ <%s key={someKey} {...props} />`, Ht, ct, ge, ct), lt[ct + Ht] = !0;
626
626
  }
627
627
  }
628
- return y === s ? qt(Te) : Pr(Te), Te;
628
+ return y === s ? qt(Re) : Pr(Re), Re;
629
629
  }
630
630
  }
631
631
  function Xe(y, F, D) {
@@ -2126,10 +2126,10 @@ class ra {
2126
2126
  }, this.timerCalc(this.tries + 1));
2127
2127
  }
2128
2128
  }
2129
- var Ce;
2129
+ var Pe;
2130
2130
  (function(t) {
2131
2131
  t.abstime = "abstime", t.bool = "bool", t.date = "date", t.daterange = "daterange", t.float4 = "float4", t.float8 = "float8", t.int2 = "int2", t.int4 = "int4", t.int4range = "int4range", t.int8 = "int8", t.int8range = "int8range", t.json = "json", t.jsonb = "jsonb", t.money = "money", t.numeric = "numeric", t.oid = "oid", t.reltime = "reltime", t.text = "text", t.time = "time", t.timestamp = "timestamp", t.timestamptz = "timestamptz", t.timetz = "timetz", t.tsrange = "tsrange", t.tstzrange = "tstzrange";
2132
- })(Ce || (Ce = {}));
2132
+ })(Pe || (Pe = {}));
2133
2133
  const oi = (t, e, r = {}) => {
2134
2134
  var s;
2135
2135
  const n = (s = r.skipTypes) !== null && s !== void 0 ? s : [];
@@ -2143,34 +2143,34 @@ const oi = (t, e, r = {}) => {
2143
2143
  return po(e, r);
2144
2144
  }
2145
2145
  switch (t) {
2146
- case Ce.bool:
2146
+ case Pe.bool:
2147
2147
  return uo(e);
2148
- case Ce.float4:
2149
- case Ce.float8:
2150
- case Ce.int2:
2151
- case Ce.int4:
2152
- case Ce.int8:
2153
- case Ce.numeric:
2154
- case Ce.oid:
2148
+ case Pe.float4:
2149
+ case Pe.float8:
2150
+ case Pe.int2:
2151
+ case Pe.int4:
2152
+ case Pe.int8:
2153
+ case Pe.numeric:
2154
+ case Pe.oid:
2155
2155
  return ho(e);
2156
- case Ce.json:
2157
- case Ce.jsonb:
2156
+ case Pe.json:
2157
+ case Pe.jsonb:
2158
2158
  return fo(e);
2159
- case Ce.timestamp:
2159
+ case Pe.timestamp:
2160
2160
  return go(e);
2161
- case Ce.abstime:
2162
- case Ce.date:
2163
- case Ce.daterange:
2164
- case Ce.int4range:
2165
- case Ce.int8range:
2166
- case Ce.money:
2167
- case Ce.reltime:
2168
- case Ce.text:
2169
- case Ce.time:
2170
- case Ce.timestamptz:
2171
- case Ce.timetz:
2172
- case Ce.tsrange:
2173
- case Ce.tstzrange:
2161
+ case Pe.abstime:
2162
+ case Pe.date:
2163
+ case Pe.daterange:
2164
+ case Pe.int4range:
2165
+ case Pe.int8range:
2166
+ case Pe.money:
2167
+ case Pe.reltime:
2168
+ case Pe.text:
2169
+ case Pe.time:
2170
+ case Pe.timestamptz:
2171
+ case Pe.timetz:
2172
+ case Pe.tsrange:
2173
+ case Pe.tstzrange:
2174
2174
  return vn(e);
2175
2175
  default:
2176
2176
  return vn(e);
@@ -10599,7 +10599,7 @@ var _r, Vi, xa = (Vi = class {
10599
10599
  }
10600
10600
  setData(e, r) {
10601
10601
  const s = Cn(this.state.data, e, this.options);
10602
- return ge(this, kt, Ft).call(this, {
10602
+ return me(this, kt, Ft).call(this, {
10603
10603
  data: s,
10604
10604
  type: "success",
10605
10605
  dataUpdatedAt: r == null ? void 0 : r.updatedAt,
@@ -10607,7 +10607,7 @@ var _r, Vi, xa = (Vi = class {
10607
10607
  }), s;
10608
10608
  }
10609
10609
  setState(e, r) {
10610
- ge(this, kt, Ft).call(this, { type: "setState", state: e, setStateOptions: r });
10610
+ me(this, kt, Ft).call(this, { type: "setState", state: e, setStateOptions: r });
10611
10611
  }
10612
10612
  cancel(e) {
10613
10613
  var s, n;
@@ -10661,7 +10661,7 @@ var _r, Vi, xa = (Vi = class {
10661
10661
  return this.observers.length;
10662
10662
  }
10663
10663
  invalidate() {
10664
- this.state.isInvalidated || ge(this, kt, Ft).call(this, { type: "invalidate" });
10664
+ this.state.isInvalidated || me(this, kt, Ft).call(this, { type: "invalidate" });
10665
10665
  }
10666
10666
  async fetch(e, r) {
10667
10667
  var c, u, d, h, f, p, g, m, x, b, _, j;
@@ -10711,7 +10711,7 @@ var _r, Vi, xa = (Vi = class {
10711
10711
  };
10712
10712
  return n(v), v;
10713
10713
  })();
10714
- (u = this.options.behavior) == null || u.onFetch(l, this), H(this, Vr, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = l.fetchOptions) == null ? void 0 : d.meta)) && ge(this, kt, Ft).call(this, { type: "fetch", meta: (h = l.fetchOptions) == null ? void 0 : h.meta }), H(this, He, wa({
10714
+ (u = this.options.behavior) == null || u.onFetch(l, this), H(this, Vr, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = l.fetchOptions) == null ? void 0 : d.meta)) && me(this, kt, Ft).call(this, { type: "fetch", meta: (h = l.fetchOptions) == null ? void 0 : h.meta }), H(this, He, wa({
10715
10715
  initialPromise: r == null ? void 0 : r.initialPromise,
10716
10716
  fn: l.fetchFn,
10717
10717
  onCancel: (v) => {
@@ -10721,13 +10721,13 @@ var _r, Vi, xa = (Vi = class {
10721
10721
  }), s.abort();
10722
10722
  },
10723
10723
  onFail: (v, S) => {
10724
- ge(this, kt, Ft).call(this, { type: "failed", failureCount: v, error: S });
10724
+ me(this, kt, Ft).call(this, { type: "failed", failureCount: v, error: S });
10725
10725
  },
10726
10726
  onPause: () => {
10727
- ge(this, kt, Ft).call(this, { type: "pause" });
10727
+ me(this, kt, Ft).call(this, { type: "pause" });
10728
10728
  },
10729
10729
  onContinue: () => {
10730
- ge(this, kt, Ft).call(this, { type: "continue" });
10730
+ me(this, kt, Ft).call(this, { type: "continue" });
10731
10731
  },
10732
10732
  retry: l.options.retry,
10733
10733
  retryDelay: l.options.retryDelay,
@@ -10756,7 +10756,7 @@ var _r, Vi, xa = (Vi = class {
10756
10756
  return this.state.data;
10757
10757
  }
10758
10758
  }
10759
- throw ge(this, kt, Ft).call(this, {
10759
+ throw me(this, kt, Ft).call(this, {
10760
10760
  type: "error",
10761
10761
  error: v
10762
10762
  }), (b = (x = w(this, pt).config).onError) == null || b.call(
@@ -10880,12 +10880,12 @@ function Ci(t) {
10880
10880
  fetchStatus: "idle"
10881
10881
  };
10882
10882
  }
10883
- var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn, Bn, $n, Ln, Dn, Un, ka, Ji, Fc = (Ji = class extends Cs {
10883
+ var at, be, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Te, hs, Nn, Fn, Bn, $n, Ln, Dn, Un, ka, Ji, Fc = (Ji = class extends Cs {
10884
10884
  constructor(e, r) {
10885
10885
  super();
10886
- ne(this, Ee);
10886
+ ne(this, Te);
10887
10887
  ne(this, at);
10888
- ne(this, me);
10888
+ ne(this, be);
10889
10889
  ne(this, Es);
10890
10890
  ne(this, rt);
10891
10891
  ne(this, Er);
@@ -10907,52 +10907,52 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
10907
10907
  this.refetch = this.refetch.bind(this);
10908
10908
  }
10909
10909
  onSubscribe() {
10910
- this.listeners.size === 1 && (w(this, me).addObserver(this), Pi(w(this, me), this.options) ? ge(this, Ee, hs).call(this) : this.updateResult(), ge(this, Ee, $n).call(this));
10910
+ this.listeners.size === 1 && (w(this, be).addObserver(this), Pi(w(this, be), this.options) ? me(this, Te, hs).call(this) : this.updateResult(), me(this, Te, $n).call(this));
10911
10911
  }
10912
10912
  onUnsubscribe() {
10913
10913
  this.hasListeners() || this.destroy();
10914
10914
  }
10915
10915
  shouldFetchOnReconnect() {
10916
10916
  return Mn(
10917
- w(this, me),
10917
+ w(this, be),
10918
10918
  this.options,
10919
10919
  this.options.refetchOnReconnect
10920
10920
  );
10921
10921
  }
10922
10922
  shouldFetchOnWindowFocus() {
10923
10923
  return Mn(
10924
- w(this, me),
10924
+ w(this, be),
10925
10925
  this.options,
10926
10926
  this.options.refetchOnWindowFocus
10927
10927
  );
10928
10928
  }
10929
10929
  destroy() {
10930
- this.listeners = /* @__PURE__ */ new Set(), ge(this, Ee, Ln).call(this), ge(this, Ee, Dn).call(this), w(this, me).removeObserver(this);
10930
+ this.listeners = /* @__PURE__ */ new Set(), me(this, Te, Ln).call(this), me(this, Te, Dn).call(this), w(this, be).removeObserver(this);
10931
10931
  }
10932
10932
  setOptions(e) {
10933
- const r = this.options, s = w(this, me);
10934
- if (this.options = w(this, at).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof gt(this.options.enabled, w(this, me)) != "boolean")
10933
+ const r = this.options, s = w(this, be);
10934
+ if (this.options = w(this, at).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof gt(this.options.enabled, w(this, be)) != "boolean")
10935
10935
  throw new Error(
10936
10936
  "Expected enabled to be a boolean or a callback that returns a boolean"
10937
10937
  );
10938
- ge(this, Ee, Un).call(this), w(this, me).setOptions(this.options), r._defaulted && !An(this.options, r) && w(this, at).getQueryCache().notify({
10938
+ me(this, Te, Un).call(this), w(this, be).setOptions(this.options), r._defaulted && !An(this.options, r) && w(this, at).getQueryCache().notify({
10939
10939
  type: "observerOptionsUpdated",
10940
- query: w(this, me),
10940
+ query: w(this, be),
10941
10941
  observer: this
10942
10942
  });
10943
10943
  const n = this.hasListeners();
10944
10944
  n && Ii(
10945
- w(this, me),
10945
+ w(this, be),
10946
10946
  s,
10947
10947
  this.options,
10948
10948
  r
10949
- ) && ge(this, Ee, hs).call(this), this.updateResult(), n && (w(this, me) !== s || gt(this.options.enabled, w(this, me)) !== gt(r.enabled, w(this, me)) || ir(this.options.staleTime, w(this, me)) !== ir(r.staleTime, w(this, me))) && ge(this, Ee, Nn).call(this);
10950
- const i = ge(this, Ee, Fn).call(this);
10951
- n && (w(this, me) !== s || gt(this.options.enabled, w(this, me)) !== gt(r.enabled, w(this, me)) || i !== w(this, er)) && ge(this, Ee, Bn).call(this, i);
10949
+ ) && me(this, Te, hs).call(this), this.updateResult(), n && (w(this, be) !== s || gt(this.options.enabled, w(this, be)) !== gt(r.enabled, w(this, be)) || ir(this.options.staleTime, w(this, be)) !== ir(r.staleTime, w(this, be))) && me(this, Te, Nn).call(this);
10950
+ const i = me(this, Te, Fn).call(this);
10951
+ n && (w(this, be) !== s || gt(this.options.enabled, w(this, be)) !== gt(r.enabled, w(this, be)) || i !== w(this, er)) && me(this, Te, Bn).call(this, i);
10952
10952
  }
10953
10953
  getOptimisticResult(e) {
10954
10954
  const r = w(this, at).getQueryCache().build(w(this, at), e), s = this.createResult(r, e);
10955
- return $c(this, s) && (H(this, rt, s), H(this, Gr, this.options), H(this, Er, w(this, me).state)), s;
10955
+ return $c(this, s) && (H(this, rt, s), H(this, Gr, this.options), H(this, Er, w(this, be).state)), s;
10956
10956
  }
10957
10957
  getCurrentResult() {
10958
10958
  return w(this, rt);
@@ -10970,7 +10970,7 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
10970
10970
  w(this, Yr).add(e);
10971
10971
  }
10972
10972
  getCurrentQuery() {
10973
- return w(this, me);
10973
+ return w(this, be);
10974
10974
  }
10975
10975
  refetch({ ...e } = {}) {
10976
10976
  return this.fetch({
@@ -10982,14 +10982,14 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
10982
10982
  return s.fetch().then(() => this.createResult(s, r));
10983
10983
  }
10984
10984
  fetch(e) {
10985
- return ge(this, Ee, hs).call(this, {
10985
+ return me(this, Te, hs).call(this, {
10986
10986
  ...e,
10987
10987
  cancelRefetch: e.cancelRefetch ?? !0
10988
10988
  }).then(() => (this.updateResult(), w(this, rt)));
10989
10989
  }
10990
10990
  createResult(e, r) {
10991
10991
  var N;
10992
- const s = w(this, me), n = this.options, i = w(this, rt), a = w(this, Er), l = w(this, Gr), u = e !== s ? e.state : w(this, Es), { state: d } = e;
10992
+ const s = w(this, be), n = this.options, i = w(this, rt), a = w(this, Er), l = w(this, Gr), u = e !== s ? e.state : w(this, Es), { state: d } = e;
10993
10993
  let h = { ...d }, f = !1, p;
10994
10994
  if (r._optimisticResults) {
10995
10995
  const E = this.hasListeners(), T = !E && Pi(e, r), C = E && Ii(e, s, r, n);
@@ -11072,8 +11072,8 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
11072
11072
  return k;
11073
11073
  }
11074
11074
  updateResult() {
11075
- const e = w(this, rt), r = this.createResult(w(this, me), this.options);
11076
- if (H(this, Er, w(this, me).state), H(this, Gr, this.options), w(this, Er).data !== void 0 && H(this, Qr, w(this, me)), An(r, e))
11075
+ const e = w(this, rt), r = this.createResult(w(this, be), this.options);
11076
+ if (H(this, Er, w(this, be).state), H(this, Gr, this.options), w(this, Er).data !== void 0 && H(this, Qr, w(this, be)), An(r, e))
11077
11077
  return;
11078
11078
  H(this, rt, r);
11079
11079
  const s = () => {
@@ -11090,23 +11090,23 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
11090
11090
  return w(this, rt)[c] !== e[c] && a.has(c);
11091
11091
  });
11092
11092
  };
11093
- ge(this, Ee, ka).call(this, { listeners: s() });
11093
+ me(this, Te, ka).call(this, { listeners: s() });
11094
11094
  }
11095
11095
  onQueryUpdate() {
11096
- this.updateResult(), this.hasListeners() && ge(this, Ee, $n).call(this);
11096
+ this.updateResult(), this.hasListeners() && me(this, Te, $n).call(this);
11097
11097
  }
11098
- }, at = new WeakMap(), me = new WeakMap(), Es = new WeakMap(), rt = new WeakMap(), Er = new WeakMap(), Gr = new WeakMap(), $t = new WeakMap(), Zt = new WeakMap(), Ts = new WeakMap(), Jr = new WeakMap(), Qr = new WeakMap(), Tr = new WeakMap(), Rr = new WeakMap(), er = new WeakMap(), Yr = new WeakMap(), Ee = new WeakSet(), hs = function(e) {
11099
- ge(this, Ee, Un).call(this);
11100
- let r = w(this, me).fetch(
11098
+ }, at = new WeakMap(), be = new WeakMap(), Es = new WeakMap(), rt = new WeakMap(), Er = new WeakMap(), Gr = new WeakMap(), $t = new WeakMap(), Zt = new WeakMap(), Ts = new WeakMap(), Jr = new WeakMap(), Qr = new WeakMap(), Tr = new WeakMap(), Rr = new WeakMap(), er = new WeakMap(), Yr = new WeakMap(), Te = new WeakSet(), hs = function(e) {
11099
+ me(this, Te, Un).call(this);
11100
+ let r = w(this, be).fetch(
11101
11101
  this.options,
11102
11102
  e
11103
11103
  );
11104
11104
  return e != null && e.throwOnError || (r = r.catch(ot)), r;
11105
11105
  }, Nn = function() {
11106
- ge(this, Ee, Ln).call(this);
11106
+ me(this, Te, Ln).call(this);
11107
11107
  const e = ir(
11108
11108
  this.options.staleTime,
11109
- w(this, me)
11109
+ w(this, be)
11110
11110
  );
11111
11111
  if (Or || w(this, rt).isStale || !Tn(e))
11112
11112
  return;
@@ -11115,29 +11115,29 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
11115
11115
  w(this, rt).isStale || this.updateResult();
11116
11116
  }, s));
11117
11117
  }, Fn = function() {
11118
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(w(this, me)) : this.options.refetchInterval) ?? !1;
11118
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(w(this, be)) : this.options.refetchInterval) ?? !1;
11119
11119
  }, Bn = function(e) {
11120
- ge(this, Ee, Dn).call(this), H(this, er, e), !(Or || gt(this.options.enabled, w(this, me)) === !1 || !Tn(w(this, er)) || w(this, er) === 0) && H(this, Rr, vr.setInterval(() => {
11121
- (this.options.refetchIntervalInBackground || Gn.isFocused()) && ge(this, Ee, hs).call(this);
11120
+ me(this, Te, Dn).call(this), H(this, er, e), !(Or || gt(this.options.enabled, w(this, be)) === !1 || !Tn(w(this, er)) || w(this, er) === 0) && H(this, Rr, vr.setInterval(() => {
11121
+ (this.options.refetchIntervalInBackground || Gn.isFocused()) && me(this, Te, hs).call(this);
11122
11122
  }, w(this, er)));
11123
11123
  }, $n = function() {
11124
- ge(this, Ee, Nn).call(this), ge(this, Ee, Bn).call(this, ge(this, Ee, Fn).call(this));
11124
+ me(this, Te, Nn).call(this), me(this, Te, Bn).call(this, me(this, Te, Fn).call(this));
11125
11125
  }, Ln = function() {
11126
11126
  w(this, Tr) && (vr.clearTimeout(w(this, Tr)), H(this, Tr, void 0));
11127
11127
  }, Dn = function() {
11128
11128
  w(this, Rr) && (vr.clearInterval(w(this, Rr)), H(this, Rr, void 0));
11129
11129
  }, Un = function() {
11130
11130
  const e = w(this, at).getQueryCache().build(w(this, at), this.options);
11131
- if (e === w(this, me))
11131
+ if (e === w(this, be))
11132
11132
  return;
11133
- const r = w(this, me);
11134
- H(this, me, e), H(this, Es, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this));
11133
+ const r = w(this, be);
11134
+ H(this, be, e), H(this, Es, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this));
11135
11135
  }, ka = function(e) {
11136
11136
  Je.batch(() => {
11137
11137
  e.listeners && this.listeners.forEach((r) => {
11138
11138
  r(w(this, rt));
11139
11139
  }), w(this, at).getQueryCache().notify({
11140
- query: w(this, me),
11140
+ query: w(this, be),
11141
11141
  type: "observerResultsUpdated"
11142
11142
  });
11143
11143
  });
@@ -11286,7 +11286,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
11286
11286
  async execute(e) {
11287
11287
  var a, l, c, u, d, h, f, p, g, m, x, b, _, j, v, S, R, P;
11288
11288
  const r = () => {
11289
- ge(this, Ot, Gt).call(this, { type: "continue" });
11289
+ me(this, Ot, Gt).call(this, { type: "continue" });
11290
11290
  }, s = {
11291
11291
  client: w(this, Rs),
11292
11292
  meta: this.options.meta,
@@ -11295,10 +11295,10 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
11295
11295
  H(this, Ar, wa({
11296
11296
  fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
11297
11297
  onFail: (k, N) => {
11298
- ge(this, Ot, Gt).call(this, { type: "failed", failureCount: k, error: N });
11298
+ me(this, Ot, Gt).call(this, { type: "failed", failureCount: k, error: N });
11299
11299
  },
11300
11300
  onPause: () => {
11301
- ge(this, Ot, Gt).call(this, { type: "pause" });
11301
+ me(this, Ot, Gt).call(this, { type: "pause" });
11302
11302
  },
11303
11303
  onContinue: r,
11304
11304
  retry: this.options.retry ?? 0,
@@ -11311,7 +11311,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
11311
11311
  if (n)
11312
11312
  r();
11313
11313
  else {
11314
- ge(this, Ot, Gt).call(this, { type: "pending", variables: e, isPaused: i }), w(this, Ze).config.onMutate && await w(this, Ze).config.onMutate(
11314
+ me(this, Ot, Gt).call(this, { type: "pending", variables: e, isPaused: i }), w(this, Ze).config.onMutate && await w(this, Ze).config.onMutate(
11315
11315
  e,
11316
11316
  this,
11317
11317
  s
@@ -11321,7 +11321,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
11321
11321
  e,
11322
11322
  s
11323
11323
  ));
11324
- N !== this.state.context && ge(this, Ot, Gt).call(this, {
11324
+ N !== this.state.context && me(this, Ot, Gt).call(this, {
11325
11325
  type: "pending",
11326
11326
  context: N,
11327
11327
  variables: e,
@@ -11357,7 +11357,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
11357
11357
  e,
11358
11358
  this.state.context,
11359
11359
  s
11360
- )), ge(this, Ot, Gt).call(this, { type: "success", data: k }), k;
11360
+ )), me(this, Ot, Gt).call(this, { type: "success", data: k }), k;
11361
11361
  } catch (k) {
11362
11362
  try {
11363
11363
  await ((b = (x = w(this, Ze).config).onError) == null ? void 0 : b.call(
@@ -11407,7 +11407,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
11407
11407
  } catch (N) {
11408
11408
  Promise.reject(N);
11409
11409
  }
11410
- throw ge(this, Ot, Gt).call(this, { type: "error", error: k }), k;
11410
+ throw me(this, Ot, Gt).call(this, { type: "error", error: k }), k;
11411
11411
  } finally {
11412
11412
  w(this, Ze).runNext(this);
11413
11413
  }
@@ -12507,7 +12507,7 @@ const Wn = (t) => {
12507
12507
  hostContext: v,
12508
12508
  callbacks: S,
12509
12509
  enabled: P
12510
- }), { isReturningUser: N } = uu(), [E, T] = V([]), [C, A] = V(""), [B, W] = V(!1), [M, le] = V(!1), [K, U] = V(null), G = X(null), he = X(!1), ee = X(!1), re = X(""), _e = X(!1), $ = X(null);
12510
+ }), { isReturningUser: N } = uu(), [E, T] = V([]), [C, A] = V(""), [B, W] = V(!1), [M, le] = V(!1), [K, U] = V(null), G = X(null), he = X(!1), ee = X(!1), re = X(""), ke = X(!1), $ = X(null);
12511
12511
  X(null);
12512
12512
  const se = X({
12513
12513
  source: "none",
@@ -12516,36 +12516,36 @@ const Wn = (t) => {
12516
12516
  cannedUrl: null,
12517
12517
  currentAudio: null,
12518
12518
  searchingQueue: []
12519
- }), O = X([]), ae = X("AWAITING_REGO"), [Ae, Re] = V(!1), ke = () => {
12519
+ }), O = X([]), ae = X("AWAITING_REGO"), [Oe, Ae] = V(!1), Se = () => {
12520
12520
  const z = se.current;
12521
12521
  if (z.currentAudio) {
12522
12522
  try {
12523
12523
  z.currentAudio.pause(), z.currentAudio.currentTime = 0;
12524
- } catch (be) {
12525
- console.warn("[BobWidget] Error stopping audio:", be);
12524
+ } catch (ye) {
12525
+ console.warn("[BobWidget] Error stopping audio:", ye);
12526
12526
  }
12527
12527
  z.currentAudio = null;
12528
12528
  }
12529
- z.isPlaying = !1, z.source = "none", z.searchingQueue = [], Re(!1), Ye();
12530
- }, Qe = (z, be, je) => {
12531
- const we = se.current;
12532
- if (we.isPlaying) {
12533
- if (be === "canned" || be === "searching" && we.source === "tts")
12534
- ke();
12535
- else if (we.source === "canned") {
12529
+ z.isPlaying = !1, z.source = "none", z.searchingQueue = [], Ae(!1), Ye();
12530
+ }, Qe = (z, ye, Ee) => {
12531
+ const xe = se.current;
12532
+ if (xe.isPlaying) {
12533
+ if (ye === "canned" || ye === "searching" && xe.source === "tts")
12534
+ Se();
12535
+ else if (xe.source === "canned") {
12536
12536
  console.log("[BobWidget Audio] Skipping lower priority audio while canned is playing");
12537
12537
  return;
12538
12538
  }
12539
12539
  }
12540
12540
  const it = new Audio(z);
12541
- we.currentAudio = it, we.source = be, we.isPlaying = !0, it.onplay = () => {
12542
- console.log(`[BobWidget Audio] ${be} STARTED:`, z.split("/").pop()), Re(!0), e || q(r);
12541
+ xe.currentAudio = it, xe.source = ye, xe.isPlaying = !0, it.onplay = () => {
12542
+ console.log(`[BobWidget Audio] ${ye} STARTED:`, z.split("/").pop()), Ae(!0), e || q(r);
12543
12543
  }, it.onended = () => {
12544
- console.log(`[BobWidget Audio] ${be} ENDED`), we.currentAudio = null, we.isPlaying = !1, we.source = "none", Re(!1), je == null || je();
12544
+ console.log(`[BobWidget Audio] ${ye} ENDED`), xe.currentAudio = null, xe.isPlaying = !1, xe.source = "none", Ae(!1), Ee == null || Ee();
12545
12545
  }, it.onerror = () => {
12546
- console.warn(`[BobWidget Audio] ${be} FAILED:`, z), we.currentAudio = null, we.isPlaying = !1, we.source = "none", Re(!1), je == null || je();
12546
+ console.warn(`[BobWidget Audio] ${ye} FAILED:`, z), xe.currentAudio = null, xe.isPlaying = !1, xe.source = "none", Ae(!1), Ee == null || Ee();
12547
12547
  }, it.play().catch((Pt) => {
12548
- console.warn(`[BobWidget Audio] ${be} autoplay blocked:`, Pt), we.currentAudio = null, we.isPlaying = !1, we.source = "none", je == null || je();
12548
+ console.warn(`[BobWidget Audio] ${ye} autoplay blocked:`, Pt), xe.currentAudio = null, xe.isPlaying = !1, xe.source = "none", Ee == null || Ee();
12549
12549
  });
12550
12550
  }, et = () => {
12551
12551
  const z = se.current;
@@ -12557,20 +12557,20 @@ const Wn = (t) => {
12557
12557
  !e && z.source === "searching" && q(s);
12558
12558
  return;
12559
12559
  }
12560
- const be = z.searchingQueue.shift();
12561
- Qe(be, "searching", () => {
12560
+ const ye = z.searchingQueue.shift();
12561
+ Qe(ye, "searching", () => {
12562
12562
  et();
12563
12563
  });
12564
12564
  }, De = () => {
12565
12565
  $.current && (clearTimeout($.current), $.current = null);
12566
12566
  }, { speak: st, stop: Ye, isSpeaking: nt, retryPendingGreeting: tt } = lu({
12567
12567
  onStart: () => {
12568
- De(), _e.current = !0, console.log("[BobWidget STATE] Speech STARTED - transitioning to TALK state"), k.trackSpeechPlayed(re.current.length), h == null || h(), e || (console.log("[BobWidget STATE] Setting state to:", r), q(r));
12568
+ De(), ke.current = !0, console.log("[BobWidget STATE] Speech STARTED - transitioning to TALK state"), k.trackSpeechPlayed(re.current.length), h == null || h(), e || (console.log("[BobWidget STATE] Setting state to:", r), q(r));
12569
12569
  },
12570
12570
  onEnd: () => {
12571
12571
  De(), console.log("[BobWidget STATE] Speech ENDED - transitioning out of TALK state");
12572
12572
  const z = Li.some(
12573
- (be) => re.current.toLowerCase().includes(be.toLowerCase())
12573
+ (ye) => re.current.toLowerCase().includes(ye.toLowerCase())
12574
12574
  );
12575
12575
  e || (z && u ? (console.log("[BobWidget STATE] Has products - calling onShowingProduct"), u()) : c ? (console.log("[BobWidget STATE] Calling onStreamComplete"), c()) : (console.log("[BobWidget STATE] Setting state to:", n), q(n), setTimeout(() => {
12576
12576
  console.log("[BobWidget STATE] Post-complete transition to:", a), q(a);
@@ -12582,14 +12582,14 @@ const Wn = (t) => {
12582
12582
  });
12583
12583
  ce(() => {
12584
12584
  var z;
12585
- (z = S.onStopSpeechReady) == null || z.call(S, ke);
12585
+ (z = S.onStopSpeechReady) == null || z.call(S, Se);
12586
12586
  }, []), ce(() => {
12587
12587
  var z;
12588
12588
  (z = G.current) == null || z.scrollIntoView({ behavior: "smooth" });
12589
12589
  }, [E]), ce(() => {
12590
- var be, je;
12591
- const z = (be = v.vehicle) == null ? void 0 : be.selectedVehicle;
12592
- z && !K && (console.log("[BobWidget] Setting vehicle from host context:", z), U(z), (je = S.onVehicleIdentified) == null || je.call(S, z), k.trackVehicleIdentified({
12590
+ var ye, Ee;
12591
+ const z = (ye = v.vehicle) == null ? void 0 : ye.selectedVehicle;
12592
+ z && !K && (console.log("[BobWidget] Setting vehicle from host context:", z), U(z), (Ee = S.onVehicleIdentified) == null || Ee.call(S, z), k.trackVehicleIdentified({
12593
12593
  make: z.make,
12594
12594
  model: z.model,
12595
12595
  year: z.year,
@@ -12599,10 +12599,10 @@ const Wn = (t) => {
12599
12599
  var z;
12600
12600
  if (E.length === 0 && !ee.current) {
12601
12601
  ee.current = !0;
12602
- const be = (z = v.vehicle) == null ? void 0 : z.selectedVehicle;
12603
- let je;
12604
- N ? (je = "Ah hey... you again! What you after this time?", console.log("[BobWidget] Using returning user greeting")) : be ? je = `G'day! Saw you've got the ${`${be.year} ${be.make} ${be.model}`} - choice wagon! What can I help you find for it today?` : je = "G'day! Bob from CARFIX here. How can I help ya today?", T([{ role: "assistant", content: je }]), M || setTimeout(() => {
12605
- console.log("[BobWidget] Speaking initial greeting (priority)"), st(je, !0);
12602
+ const ye = (z = v.vehicle) == null ? void 0 : z.selectedVehicle;
12603
+ let Ee;
12604
+ N ? (Ee = "Ah hey... you again! What you after this time?", console.log("[BobWidget] Using returning user greeting")) : ye ? Ee = `G'day! Saw you've got the ${`${ye.year} ${ye.make} ${ye.model}`} - choice wagon! What can I help you find for it today?` : Ee = "G'day! Bob from CARFIX here. How can I help ya today?", T([{ role: "assistant", content: Ee }]), M || setTimeout(() => {
12605
+ console.log("[BobWidget] Speaking initial greeting (priority)"), st(Ee, !0);
12606
12606
  }, 500);
12607
12607
  }
12608
12608
  }, [(ns = v.vehicle) == null ? void 0 : ns.selectedVehicle, E.length, M, st]), ce(() => {
@@ -12616,13 +12616,13 @@ const Wn = (t) => {
12616
12616
  var Ut, ft;
12617
12617
  const z = (Ut = v.vehicle) == null ? void 0 : Ut.selectedVehicle;
12618
12618
  if (!z || he.current) return;
12619
- const be = z.vehicle_id ?? z.id, je = Number.parseInt(String(be), 10);
12620
- if (!Number.isFinite(je)) {
12619
+ const ye = z.vehicle_id ?? z.id, Ee = Number.parseInt(String(ye), 10);
12620
+ if (!Number.isFinite(Ee)) {
12621
12621
  console.warn("[BobWidget] Vehicle has invalid vehicle_id, cannot auto-fetch:", z);
12622
12622
  return;
12623
12623
  }
12624
12624
  he.current = !0;
12625
- const we = { ...z, vehicle_id: String(je) }, it = (ft = v.user) == null ? void 0 : ft.email;
12625
+ const xe = { ...z, vehicle_id: String(Ee) }, it = (ft = v.user) == null ? void 0 : ft.email;
12626
12626
  (async () => {
12627
12627
  var It, Wt;
12628
12628
  const Mt = `${_.supabaseUrl}/functions/v1/bob-chat`;
@@ -12635,7 +12635,7 @@ const Wn = (t) => {
12635
12635
  },
12636
12636
  body: JSON.stringify({
12637
12637
  messages: [],
12638
- vehicleContext: we,
12638
+ vehicleContext: xe,
12639
12639
  customerEmail: it,
12640
12640
  autoFetchParts: !0,
12641
12641
  hostConfig: j,
@@ -12665,7 +12665,7 @@ const Wn = (t) => {
12665
12665
  dr.title && b.current.add(dr.title);
12666
12666
  })), Xe.type === "parts_found" && Xe.parts && (console.log("[useBobChat autoFetch] Received parts_found:", Xe.parts.length, "parts"), (Wt = S.onPartsFound) == null || Wt.call(S, Xe.parts), k.trackPartsViewed(
12667
12667
  Array.isArray(Xe.parts) ? Xe.parts.length : 0,
12668
- String(je)
12668
+ String(Ee)
12669
12669
  ));
12670
12670
  } catch {
12671
12671
  }
@@ -12685,19 +12685,19 @@ const Wn = (t) => {
12685
12685
  }
12686
12686
  }, L = async (z) => {
12687
12687
  var it, Pt, Ut, ft, Mt, It, Wt, bt, cr, Cr, yt, ur, Pr, qt, lt, zt, Xe, dr;
12688
- const be = `${_.supabaseUrl}/functions/v1/bob-chat`, je = (it = v.user) == null ? void 0 : it.email;
12689
- let we = !1;
12688
+ const ye = `${_.supabaseUrl}/functions/v1/bob-chat`, Ee = (it = v.user) == null ? void 0 : it.email;
12689
+ let xe = !1;
12690
12690
  try {
12691
12691
  const vt = {
12692
12692
  messages: [...E, z],
12693
12693
  hostConfig: j,
12694
12694
  hostContext: v
12695
12695
  };
12696
- b != null && b.current && b.current.size > 0 && (vt.shelfContext = Array.from(b.current).join(", ")), K && (vt.vehicleContext = K), je && (vt.customerEmail = je), console.log(
12696
+ b != null && b.current && b.current.size > 0 && (vt.shelfContext = Array.from(b.current).join(", ")), K && (vt.vehicleContext = K), Ee && (vt.customerEmail = Ee), console.log(
12697
12697
  "[useBobChat DEBUG] vehicleCandidatesRef.current:",
12698
12698
  JSON.stringify((Pt = O.current) == null ? void 0 : Pt.slice(0, 2))
12699
12699
  ), console.log("[useBobChat DEBUG] vehicleCandidatesRef.current.length:", (Ut = O.current) == null ? void 0 : Ut.length), console.log("[useBobChat DEBUG] conversationStateRef.current:", ae.current), O.current && O.current.length > 0 ? (vt.vehicleCandidates = O.current, console.log("[useBobChat] ✅ Including", O.current.length, "vehicle candidates in request")) : console.log("[useBobChat] ⚠️ No vehicle candidates to include - ref is empty");
12700
- const wt = await fetch(be, {
12700
+ const wt = await fetch(ye, {
12701
12701
  method: "POST",
12702
12702
  headers: {
12703
12703
  "Content-Type": "application/json",
@@ -12720,9 +12720,9 @@ const Wn = (t) => {
12720
12720
  const y = wt.body.getReader(), F = new TextDecoder();
12721
12721
  let D = "", oe = !1, fe = "";
12722
12722
  for (; !oe; ) {
12723
- const { done: xe, value: Te } = await y.read();
12724
- if (xe) break;
12725
- D += F.decode(Te, { stream: !0 });
12723
+ const { done: _e, value: Re } = await y.read();
12724
+ if (_e) break;
12725
+ D += F.decode(Re, { stream: !0 });
12726
12726
  let Ue;
12727
12727
  for (; (Ue = D.indexOf(`
12728
12728
  `)) !== -1; ) {
@@ -12740,8 +12740,8 @@ const Wn = (t) => {
12740
12740
  continue;
12741
12741
  }
12742
12742
  if (I.type === "variant_selection_required") {
12743
- const Pe = Array.isArray(I.candidates) ? I.candidates.length : 0;
12744
- console.log("[useBobChat] 🎴 variant_selection_required event received:", Pe, "cards"), Array.isArray(I.candidates) ? x == null || x(
12743
+ const ge = Array.isArray(I.candidates) ? I.candidates.length : 0;
12744
+ console.log("[useBobChat] 🎴 variant_selection_required event received:", ge, "cards"), Array.isArray(I.candidates) ? x == null || x(
12745
12745
  I.candidates,
12746
12746
  typeof I.make == "string" ? I.make : "",
12747
12747
  typeof I.model == "string" ? I.model : ""
@@ -12762,15 +12762,15 @@ const Wn = (t) => {
12762
12762
  continue;
12763
12763
  }
12764
12764
  if (I.type === "service_packages_found" && I.packages) {
12765
- (Wt = S.onServicePackagesFound) == null || Wt.call(S, I.packages), b != null && b.current && (I.packages.forEach((Pe) => {
12766
- Pe.title && b.current.add(Pe.title);
12765
+ (Wt = S.onServicePackagesFound) == null || Wt.call(S, I.packages), b != null && b.current && (I.packages.forEach((ge) => {
12766
+ ge.title && b.current.add(ge.title);
12767
12767
  }), console.log("[useBobChat] Eagerly added service package titles to shelfCategories:", Array.from(b.current)));
12768
12768
  continue;
12769
12769
  }
12770
12770
  if (I.type === "parts_found" && I.parts) {
12771
- console.log("[useBobChat] Received parts_found event:", I.parts.length, "parts"), (bt = S.onPartsFound) == null || bt.call(S, I.parts), b != null && b.current && Array.isArray(I.parts) && I.parts.forEach((Pe) => {
12772
- const Oe = Pe.partslot_description || "Other Parts";
12773
- Oe && b.current.add(Oe);
12771
+ console.log("[useBobChat] Received parts_found event:", I.parts.length, "parts"), (bt = S.onPartsFound) == null || bt.call(S, I.parts), b != null && b.current && Array.isArray(I.parts) && I.parts.forEach((ge) => {
12772
+ const Ce = ge.partslot_description || "Other Parts";
12773
+ Ce && b.current.add(Ce);
12774
12774
  }), k.trackPartsViewed(
12775
12775
  Array.isArray(I.parts) ? I.parts.length : 0,
12776
12776
  (cr = K == null ? void 0 : K.vehicle_id) == null ? void 0 : cr.toString()
@@ -12778,16 +12778,16 @@ const Wn = (t) => {
12778
12778
  continue;
12779
12779
  }
12780
12780
  if (I.type === "bob_suggestions" && I.products) {
12781
- console.log("[useBobChat] Received bob_suggestions:", I.products.length, "products", I.title), T((Pe) => {
12781
+ console.log("[useBobChat] Received bob_suggestions:", I.products.length, "products", I.title), T((ge) => {
12782
12782
  var Kt;
12783
- const Oe = [...Pe], Fe = Oe[Oe.length - 1];
12784
- return console.log("[useBobChat] Attaching to message:", Fe == null ? void 0 : Fe.role, (Kt = Fe == null ? void 0 : Fe.content) == null ? void 0 : Kt.slice(0, 40)), (Fe == null ? void 0 : Fe.role) === "assistant" ? Oe.map(
12785
- (hr, rn) => rn === Oe.length - 1 ? {
12783
+ const Ce = [...ge], Fe = Ce[Ce.length - 1];
12784
+ return console.log("[useBobChat] Attaching to message:", Fe == null ? void 0 : Fe.role, (Kt = Fe == null ? void 0 : Fe.content) == null ? void 0 : Kt.slice(0, 40)), (Fe == null ? void 0 : Fe.role) === "assistant" ? Ce.map(
12785
+ (hr, rn) => rn === Ce.length - 1 ? {
12786
12786
  ...hr,
12787
12787
  suggestedProducts: I.products,
12788
12788
  suggestionsTitle: I.title
12789
12789
  } : hr
12790
- ) : Oe;
12790
+ ) : Ce;
12791
12791
  }), console.log("[useBobChat] bob_suggestions processed for inline display only");
12792
12792
  continue;
12793
12793
  }
@@ -12796,7 +12796,7 @@ const Wn = (t) => {
12796
12796
  continue;
12797
12797
  }
12798
12798
  if (I.type === "highlight_category" && I.category) {
12799
- console.log("[useBobChat] highlight_category event:", I.category), we = !0, f == null || f(I.category);
12799
+ console.log("[useBobChat] highlight_category event:", I.category), xe = !0, f == null || f(I.category);
12800
12800
  continue;
12801
12801
  }
12802
12802
  if (I.type === "navigate_url" && I.url) {
@@ -12804,44 +12804,54 @@ const Wn = (t) => {
12804
12804
  continue;
12805
12805
  }
12806
12806
  if (I.type === "quick_replies" && Array.isArray(I.replies)) {
12807
- console.log("[useBobChat] quick_replies event:", I.replies.length, "buttons"), T((Pe) => {
12807
+ console.log("[useBobChat] quick_replies event:", I.replies.length, "buttons"), T((ge) => {
12808
12808
  var Kt;
12809
- const Oe = [...Pe], Fe = Oe.length - 1;
12810
- return ((Kt = Oe[Fe]) == null ? void 0 : Kt.role) === "assistant" ? Oe.map(
12809
+ const Ce = [...ge], Fe = Ce.length - 1;
12810
+ return ((Kt = Ce[Fe]) == null ? void 0 : Kt.role) === "assistant" ? Ce.map(
12811
12811
  (hr, rn) => rn === Fe ? { ...hr, quickReplies: I.replies } : hr
12812
- ) : Oe;
12812
+ ) : Ce;
12813
12813
  });
12814
12814
  continue;
12815
12815
  }
12816
12816
  if (I.type === "audio_hint" && I.audio_url) {
12817
12817
  console.log("[useBobChat] Audio hint received:", I.clip_key, I.audio_url);
12818
- const Pe = se.current;
12819
- Pe.hasCannedAudio = !0, Pe.cannedUrl = I.audio_url, ke();
12818
+ const ge = se.current;
12819
+ ge.hasCannedAudio = !0, ge.cannedUrl = I.audio_url, Se();
12820
12820
  continue;
12821
12821
  }
12822
12822
  if (I.type === "bob_searching" && I.audio_url) {
12823
- console.log("[useBobChat] Bob searching:", I.search_type, I.clip_key), I.transcript && T((Oe) => {
12824
- const Fe = Oe[Oe.length - 1];
12825
- return (Fe == null ? void 0 : Fe.role) !== "assistant" || (Fe == null ? void 0 : Fe.content) !== I.transcript ? [...Oe, { role: "assistant", content: I.transcript }] : Oe;
12823
+ console.log("[useBobChat] Bob searching:", I.search_type, I.clip_key), I.transcript && T((Ce) => {
12824
+ const Fe = Ce[Ce.length - 1];
12825
+ return (Fe == null ? void 0 : Fe.role) !== "assistant" || (Fe == null ? void 0 : Fe.content) !== I.transcript ? [...Ce, { role: "assistant", content: I.transcript }] : Ce;
12826
12826
  });
12827
- const Pe = se.current;
12828
- Pe.searchingQueue.push(I.audio_url), !Pe.isPlaying && !Pe.hasCannedAudio && !M && et();
12827
+ const ge = se.current;
12828
+ ge.searchingQueue.push(I.audio_url), !ge.isPlaying && !ge.hasCannedAudio && !M && et();
12829
12829
  continue;
12830
12830
  }
12831
12831
  if (I.type === "cart_updated" && I.items) {
12832
- (Pr = S.onCartUpdated) == null || Pr.call(S, I.items);
12832
+ if ((Pr = S.onCartUpdated) == null || Pr.call(S, I.items), S.onAddToCart)
12833
+ for (const ge of I.items)
12834
+ S.onAddToCart({
12835
+ product_id: ge.product_id || ge.productName || "",
12836
+ product_name: ge.product_name || ge.productName || "",
12837
+ quantity: ge.quantity || 1,
12838
+ unit_price: ge.unit_price || 0,
12839
+ vehicle_id: ge.vehicle_id,
12840
+ sku: ge.sku,
12841
+ brand: ge.brand
12842
+ });
12833
12843
  continue;
12834
12844
  }
12835
12845
  const Ht = (zt = (lt = (qt = I.choices) == null ? void 0 : qt[0]) == null ? void 0 : lt.delta) == null ? void 0 : zt.content;
12836
12846
  if (Ht) {
12837
12847
  fe += Ht;
12838
- let Pe = fe.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
12839
- Pe = Wn(Pe), T((Oe) => {
12840
- const Fe = Oe[Oe.length - 1];
12841
- return (Fe == null ? void 0 : Fe.role) === "assistant" ? Oe.map(
12842
- (Kt, hr) => hr === Oe.length - 1 ? { ...Kt, content: Pe } : Kt
12843
- ) : [...Oe, { role: "assistant", content: Pe }];
12844
- }), (Xe = S.onBobMessage) == null || Xe.call(S, Pe);
12848
+ let ge = fe.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
12849
+ ge = Wn(ge), T((Ce) => {
12850
+ const Fe = Ce[Ce.length - 1];
12851
+ return (Fe == null ? void 0 : Fe.role) === "assistant" ? Ce.map(
12852
+ (Kt, hr) => hr === Ce.length - 1 ? { ...Kt, content: ge } : Kt
12853
+ ) : [...Ce, { role: "assistant", content: ge }];
12854
+ }), (Xe = S.onBobMessage) == null || Xe.call(S, ge);
12845
12855
  }
12846
12856
  } catch {
12847
12857
  D = ze + `
@@ -12850,39 +12860,39 @@ const Wn = (t) => {
12850
12860
  }
12851
12861
  }
12852
12862
  }
12853
- let ye = fe.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
12854
- ye = Wn(ye), re.current = ye;
12863
+ let ve = fe.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
12864
+ ve = Wn(ve), re.current = ve;
12855
12865
  const de = Li.some(
12856
- (xe) => fe.toLowerCase().includes(xe.toLowerCase())
12866
+ (_e) => fe.toLowerCase().includes(_e.toLowerCase())
12857
12867
  );
12858
- if (console.log("[useBobChat] v3.2.10 scroll debug: highlightCategoryReceived=", we, "shelfCategories=", b != null && b.current ? Array.from(b.current) : "none"), !we && (b != null && b.current) && b.current.size > 0) {
12859
- const xe = ye.toLowerCase();
12860
- let Te = null, Ue = 0;
12868
+ if (console.log("[useBobChat] v3.2.10 scroll debug: highlightCategoryReceived=", xe, "shelfCategories=", b != null && b.current ? Array.from(b.current) : "none"), !xe && (b != null && b.current) && b.current.size > 0) {
12869
+ const _e = ve.toLowerCase();
12870
+ let Re = null, Ue = 0;
12861
12871
  for (const ze of b.current) {
12862
- const ct = ze.toLowerCase().split(/\s+/).filter(Boolean), I = ct.filter((Ht) => xe.includes(Ht)).length;
12863
- I === ct.length && I > Ue && (Ue = I, Te = ze);
12872
+ const ct = ze.toLowerCase().split(/\s+/).filter(Boolean), I = ct.filter((Ht) => _e.includes(Ht)).length;
12873
+ I === ct.length && I > Ue && (Ue = I, Re = ze);
12864
12874
  }
12865
- Te && (console.log("[useBobChat] v3.2.10 shelf category match:", Te, `(${Ue} words)`), f == null || f(Te));
12875
+ Re && (console.log("[useBobChat] v3.2.10 shelf category match:", Re, `(${Ue} words)`), f == null || f(Re));
12866
12876
  }
12867
12877
  const ue = fe.match(/(?:go with|recommend|suggest|grab|try)\s+(?:the\s+)?(\w+)\s+(?:at|for)\s+\$(\d+(?:\.\d{2})?)/i);
12868
12878
  if (ue) {
12869
- const [, xe, Te] = ue;
12870
- p == null || p({ brand: xe, price: parseFloat(Te) });
12879
+ const [, _e, Re] = ue;
12880
+ p == null || p({ brand: _e, price: parseFloat(Re) });
12871
12881
  }
12872
12882
  const Ie = se.current;
12873
12883
  if (!M && re.current.trim()) {
12874
- if (_e.current = !1, De(), Ie.hasCannedAudio && Ie.cannedUrl)
12875
- console.log("[BobWidget] Playing canned audio (priority):", Ie.cannedUrl), ke(), Qe(Ie.cannedUrl, "canned", () => {
12884
+ if (ke.current = !1, De(), Ie.hasCannedAudio && Ie.cannedUrl)
12885
+ console.log("[BobWidget] Playing canned audio (priority):", Ie.cannedUrl), Se(), Qe(Ie.cannedUrl, "canned", () => {
12876
12886
  Ie.hasCannedAudio = !1, Ie.cannedUrl = null, De(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3)));
12877
- }), _e.current = !0, h == null || h();
12887
+ }), ke.current = !0, h == null || h();
12878
12888
  else if (Ie.isPlaying)
12879
12889
  console.log("[BobWidget] Skipping TTS - audio already playing:", Ie.source);
12880
12890
  else {
12881
- const xe = du(re.current);
12882
- console.log("[BobWidget] Playing TTS (no canned audio)"), st(xe);
12891
+ const _e = du(re.current);
12892
+ console.log("[BobWidget] Playing TTS (no canned audio)"), st(_e);
12883
12893
  }
12884
12894
  $.current = setTimeout(() => {
12885
- _e.current || (console.warn("[BobWidget] Speech fallback after 5s"), h == null || h(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3))));
12895
+ ke.current || (console.warn("[BobWidget] Speech fallback after 5s"), h == null || h(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3))));
12886
12896
  }, 5e3);
12887
12897
  } else
12888
12898
  h == null || h(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3)));
@@ -12894,15 +12904,15 @@ const Wn = (t) => {
12894
12904
  wt.message || "Unknown chat error"
12895
12905
  ), e || q(i);
12896
12906
  }
12897
- }, Se = async () => {
12907
+ }, je = async () => {
12898
12908
  if (!C.trim() || B) return;
12899
12909
  tt(), Ye();
12900
12910
  const z = { role: "user", content: C };
12901
- T((we) => [...we, z]), A(""), k.trackMessageSent(C.length, !!K);
12902
- const be = C.toLowerCase();
12903
- if (hu.some((we) => be.includes(we))) {
12904
- const we = `G'day mate! I'm running Bob v${ar} - she's running sweet as! Anything else I can help ya with?`;
12905
- T((it) => [...it, { role: "assistant", content: we }]), M || st(we);
12911
+ T((xe) => [...xe, z]), A(""), k.trackMessageSent(C.length, !!K);
12912
+ const ye = C.toLowerCase();
12913
+ if (hu.some((xe) => ye.includes(xe))) {
12914
+ const xe = `G'day mate! I'm running Bob v${ar} - she's running sweet as! Anything else I can help ya with?`;
12915
+ T((it) => [...it, { role: "assistant", content: xe }]), M || st(xe);
12906
12916
  return;
12907
12917
  }
12908
12918
  W(!0), console.log("[BobWidget STATE] User sent message - switching to RESEARCH state:", s), d == null || d(), e || q(s), await L(z), W(!1);
@@ -12912,9 +12922,9 @@ const Wn = (t) => {
12912
12922
  input: C,
12913
12923
  setInput: A,
12914
12924
  isLoading: B,
12915
- handleSend: Se,
12925
+ handleSend: je,
12916
12926
  handleKeyPress: (z) => {
12917
- z.key === "Enter" && !z.shiftKey && (z.preventDefault(), Se());
12927
+ z.key === "Enter" && !z.shiftKey && (z.preventDefault(), je());
12918
12928
  },
12919
12929
  handleInputFocus: () => {
12920
12930
  tt();
@@ -12933,7 +12943,7 @@ const Wn = (t) => {
12933
12943
  le((z) => !z), M || Ye();
12934
12944
  },
12935
12945
  // Bug #3 fix: composite isSpeaking — true when EITHER TTS or canned/searching audio is playing
12936
- isSpeaking: nt || Ae,
12946
+ isSpeaking: nt || Oe,
12937
12947
  identifiedVehicle: K,
12938
12948
  clearVehicle: () => {
12939
12949
  U(null);
@@ -12941,10 +12951,10 @@ const Wn = (t) => {
12941
12951
  sendDirectMessage: (z) => {
12942
12952
  if (!z.trim()) return;
12943
12953
  console.log("[BobWidget] sendDirectMessage:", z), Ye(), W(!1), A("");
12944
- const be = { role: "user", content: z };
12945
- T((je) => [...je, be]), d == null || d(), e || q(s), W(!0), L(be).finally(() => W(!1));
12954
+ const ye = { role: "user", content: z };
12955
+ T((Ee) => [...Ee, ye]), d == null || d(), e || q(s), W(!0), L(ye).finally(() => W(!1));
12946
12956
  },
12947
- stopAllAudio: ke
12957
+ stopAllAudio: Se
12948
12958
  };
12949
12959
  }, pu = {
12950
12960
  states: [],
@@ -13037,7 +13047,7 @@ const Wn = (t) => {
13037
13047
  return le.forEach((K) => {
13038
13048
  const U = b.configs.filter((re) => re.animation_state === K), G = U.map((re) => re.image_url), he = U.map((re) => re.vertical_offset || 0), ee = U.map((re) => re.scale || 100);
13039
13049
  if (G.length > 0) {
13040
- const re = b.states.find((_e) => _e.state_key === K);
13050
+ const re = b.states.find((ke) => ke.state_key === K);
13041
13051
  A[K] = {
13042
13052
  url: G[0],
13043
13053
  animation_speed: (re == null ? void 0 : re.animation_speed) || 400,
@@ -14309,7 +14319,7 @@ const fn = (t, e) => {
14309
14319
  const ae = se.scrollTop / O;
14310
14320
  W(Math.max(0, Math.min(1, ae)));
14311
14321
  }
14312
- }, le = ((g == null ? void 0 : g.length) ?? 0) > 0, K = t.length > 0 || e.length > 0 || le, U = c && !K, G = K && !U, he = u || K, ee = j === "mobile" ? 92 : j === "tablet" ? 65 : 70, re = j === "desktop" ? "900px" : j === "tablet" ? "500px" : "100%", _e = j === "mobile" ? "calc(8px + env(safe-area-inset-top, 4px))" : "6px";
14322
+ }, le = ((g == null ? void 0 : g.length) ?? 0) > 0, K = t.length > 0 || e.length > 0 || le, U = c && !K, G = K && !U, he = u || K, ee = j === "mobile" ? 92 : j === "tablet" ? 65 : 70, re = j === "desktop" ? "900px" : j === "tablet" ? "500px" : "100%", ke = j === "mobile" ? "calc(8px + env(safe-area-inset-top, 4px))" : "6px";
14313
14323
  return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
14314
14324
  K && u && /* @__PURE__ */ o.jsx(
14315
14325
  "div",
@@ -14338,7 +14348,7 @@ const fn = (t, e) => {
14338
14348
  maxWidth: re,
14339
14349
  right: "0",
14340
14350
  left: "auto",
14341
- top: _e,
14351
+ top: ke,
14342
14352
  bottom: j === "mobile" ? "calc(100px + env(safe-area-inset-bottom, 0px))" : "52px",
14343
14353
  paddingTop: "4px",
14344
14354
  paddingRight: "16px",
@@ -14425,7 +14435,7 @@ const fn = (t, e) => {
14425
14435
  O.fuelType
14426
14436
  ].filter(Boolean).join(" · ") || O.displayTitle), se = $.reduce((O, ae) => (O[ae] = (O[ae] || 0) + 1, O), {});
14427
14437
  return (g || []).map((O, ae) => {
14428
- const Ae = $[ae], ke = se[Ae] > 1 && O.displaySubtitle ? O.displaySubtitle : Ae;
14438
+ const Oe = $[ae], Se = se[Oe] > 1 && O.displaySubtitle ? O.displaySubtitle : Oe;
14429
14439
  return /* @__PURE__ */ o.jsx(
14430
14440
  "button",
14431
14441
  {
@@ -14449,7 +14459,7 @@ const fn = (t, e) => {
14449
14459
  children: O.optionNumber
14450
14460
  }
14451
14461
  ),
14452
- /* @__PURE__ */ o.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ o.jsx("p", { className: "font-semibold text-gray-900 text-base leading-tight", children: ke }) }),
14462
+ /* @__PURE__ */ o.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ o.jsx("p", { className: "font-semibold text-gray-900 text-base leading-tight", children: Se }) }),
14453
14463
  /* @__PURE__ */ o.jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center shrink-0", style: { background: "rgba(0, 102, 204, 0.1)" }, children: /* @__PURE__ */ o.jsx("svg", { className: "w-4 h-4 text-blue-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M9 5l7 7-7 7" }) }) })
14454
14464
  ] })
14455
14465
  },
@@ -14472,13 +14482,13 @@ const fn = (t, e) => {
14472
14482
  ] }) }),
14473
14483
  G && e.length > 0 && /* @__PURE__ */ o.jsx("div", { className: "space-y-4", children: e.map(($) => {
14474
14484
  var tt, q;
14475
- const se = Na($), O = ($.preparedTiers || []).filter((L) => !L.isHidden), { hasDisc: ae, hasDrum: Ae } = se ? $a(O) : { hasDisc: !1, hasDrum: !1 }, Re = se && ae && !Ae ? "disc" : se && Ae && !ae ? "drum" : T[$.id] || "disc";
14476
- let ke = O;
14477
- se && (ke = O.map((L) => {
14478
- const Se = Fa(L.products, Re);
14479
- return { ...L, products: Se, totalPrice: Ba(Se), productCount: Se.length };
14485
+ const se = Na($), O = ($.preparedTiers || []).filter((L) => !L.isHidden), { hasDisc: ae, hasDrum: Oe } = se ? $a(O) : { hasDisc: !1, hasDrum: !1 }, Ae = se && ae && !Oe ? "disc" : se && Oe && !ae ? "drum" : T[$.id] || "disc";
14486
+ let Se = O;
14487
+ se && (Se = O.map((L) => {
14488
+ const je = Fa(L.products, Ae);
14489
+ return { ...L, products: je, totalPrice: Ba(je), productCount: je.length };
14480
14490
  }));
14481
- const Qe = ((tt = ke.find((L) => L.isRecommended)) == null ? void 0 : tt.tierName) || ((q = ke[0]) == null ? void 0 : q.tierName) || "", et = N[$.id] || Qe, De = ke.find((L) => L.tierName === et), Ye = Aa($.title).split(".")[0] + ".", nt = P === $.id;
14491
+ const Qe = ((tt = Se.find((L) => L.isRecommended)) == null ? void 0 : tt.tierName) || ((q = Se[0]) == null ? void 0 : q.tierName) || "", et = N[$.id] || Qe, De = Se.find((L) => L.tierName === et), Ye = Aa($.title).split(".")[0] + ".", nt = P === $.id;
14482
14492
  return /* @__PURE__ */ o.jsxs(
14483
14493
  "div",
14484
14494
  {
@@ -14514,7 +14524,7 @@ const fn = (t, e) => {
14514
14524
  ),
14515
14525
  /* @__PURE__ */ o.jsxs("div", { className: "px-4 py-3 border-b", style: { borderColor: J.border }, children: [
14516
14526
  /* @__PURE__ */ o.jsx("p", { className: "text-sm leading-relaxed", style: { color: J.mutedForeground }, children: Ye }),
14517
- se && ae && Ae && /* @__PURE__ */ o.jsxs("div", { className: "mt-2 mb-1", children: [
14527
+ se && ae && Oe && /* @__PURE__ */ o.jsxs("div", { className: "mt-2 mb-1", children: [
14518
14528
  /* @__PURE__ */ o.jsx("p", { className: "text-[11px] mb-1.5", style: { color: J.mutedForeground }, children: "Select your vehicle's rear brake type" }),
14519
14529
  /* @__PURE__ */ o.jsxs("div", { className: "flex rounded-xl overflow-hidden border", style: { borderColor: J.border }, children: [
14520
14530
  /* @__PURE__ */ o.jsx(
@@ -14523,8 +14533,8 @@ const fn = (t, e) => {
14523
14533
  onClick: () => C((L) => ({ ...L, [$.id]: "disc" })),
14524
14534
  className: "flex-1 py-2 px-3 text-xs font-semibold transition-all",
14525
14535
  style: {
14526
- background: Re === "disc" ? J.primary : "transparent",
14527
- color: Re === "disc" ? "#FFFFFF" : J.mutedForeground
14536
+ background: Ae === "disc" ? J.primary : "transparent",
14537
+ color: Ae === "disc" ? "#FFFFFF" : J.mutedForeground
14528
14538
  },
14529
14539
  children: "Disc Brakes (Pads + Rotors)"
14530
14540
  }
@@ -14535,8 +14545,8 @@ const fn = (t, e) => {
14535
14545
  onClick: () => C((L) => ({ ...L, [$.id]: "drum" })),
14536
14546
  className: "flex-1 py-2 px-3 text-xs font-semibold transition-all",
14537
14547
  style: {
14538
- background: Re === "drum" ? J.primary : "transparent",
14539
- color: Re === "drum" ? "#FFFFFF" : J.mutedForeground
14548
+ background: Ae === "drum" ? J.primary : "transparent",
14549
+ color: Ae === "drum" ? "#FFFFFF" : J.mutedForeground
14540
14550
  },
14541
14551
  children: "Drum Brakes (Shoes + Drums)"
14542
14552
  }
@@ -14544,17 +14554,17 @@ const fn = (t, e) => {
14544
14554
  ] })
14545
14555
  ] })
14546
14556
  ] }),
14547
- ke.length > 0 && /* @__PURE__ */ o.jsxs("div", { className: "p-3", children: [
14557
+ Se.length > 0 && /* @__PURE__ */ o.jsxs("div", { className: "p-3", children: [
14548
14558
  /* @__PURE__ */ o.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide mb-2 px-1", style: { color: J.mutedForeground }, children: "Choose Your Value Level" }),
14549
- /* @__PURE__ */ o.jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${Math.min(ke.length, 4)}, 1fr)` }, children: ke.map((L) => {
14550
- const Se = qn[L.tierName], Z = L.tierName === et;
14559
+ /* @__PURE__ */ o.jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${Math.min(Se.length, 4)}, 1fr)` }, children: Se.map((L) => {
14560
+ const je = qn[L.tierName], Z = L.tierName === et;
14551
14561
  return /* @__PURE__ */ o.jsxs(
14552
14562
  "div",
14553
14563
  {
14554
14564
  onClick: () => E((pe) => ({ ...pe, [$.id]: L.tierName })),
14555
14565
  className: "relative rounded-xl text-center transition-all cursor-pointer",
14556
14566
  style: {
14557
- padding: ke.length >= 4 ? "6px 4px" : "8px",
14567
+ padding: Se.length >= 4 ? "6px 4px" : "8px",
14558
14568
  background: L.isRecommended ? `${J.primary}10` : Z ? `${J.primary}05` : J.background,
14559
14569
  border: `2px solid ${L.isRecommended ? J.primary : Z ? J.primary + "80" : J.border}`
14560
14570
  },
@@ -14567,20 +14577,20 @@ const fn = (t, e) => {
14567
14577
  children: "Carfix Value"
14568
14578
  }
14569
14579
  ),
14570
- /* @__PURE__ */ o.jsxs("p", { className: "text-sm font-bold mt-1", style: { color: (Se == null ? void 0 : Se.textColor) || J.foreground }, children: [
14571
- Se == null ? void 0 : Se.emoji,
14580
+ /* @__PURE__ */ o.jsxs("p", { className: "text-sm font-bold mt-1", style: { color: (je == null ? void 0 : je.textColor) || J.foreground }, children: [
14581
+ je == null ? void 0 : je.emoji,
14572
14582
  " ",
14573
14583
  L.displayName
14574
14584
  ] }),
14575
- /* @__PURE__ */ o.jsx("div", { className: "flex flex-col items-center gap-1 mt-2", style: { minHeight: ke.length >= 4 ? "40px" : "48px" }, children: L.brands.slice(0, 1).map((pe, ve) => {
14585
+ /* @__PURE__ */ o.jsx("div", { className: "flex flex-col items-center gap-1 mt-2", style: { minHeight: Se.length >= 4 ? "40px" : "48px" }, children: L.brands.slice(0, 1).map((pe, we) => {
14576
14586
  const We = `https://flpzjbasdsfwoeruyxgp.supabase.co/storage/v1/object/public/brand_images/${pe.fullName.replace(/\s+/g, "")}.jpg`;
14577
14587
  return /* @__PURE__ */ o.jsx(
14578
14588
  "div",
14579
14589
  {
14580
14590
  className: "w-full bg-white rounded-lg flex items-center justify-center overflow-hidden",
14581
14591
  style: {
14582
- height: ke.length >= 4 ? "36px" : "44px",
14583
- maxWidth: ke.length >= 4 ? "64px" : "80px",
14592
+ height: Se.length >= 4 ? "36px" : "44px",
14593
+ maxWidth: Se.length >= 4 ? "64px" : "80px",
14584
14594
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
14585
14595
  border: "1px solid #F1F5F9"
14586
14596
  },
@@ -14590,7 +14600,7 @@ const fn = (t, e) => {
14590
14600
  src: pe.imageUrl,
14591
14601
  alt: pe.fullName,
14592
14602
  className: "w-auto object-contain",
14593
- style: { height: ke.length >= 4 ? "26px" : "32px" },
14603
+ style: { height: Se.length >= 4 ? "26px" : "32px" },
14594
14604
  onError: (Be) => {
14595
14605
  const Ne = Be.target;
14596
14606
  Ne.src !== We ? Ne.src = We : (Ne.style.display = "none", Ne.parentElement.innerHTML = `<span class="text-[10px] font-semibold text-gray-600 truncate px-1">${pe.fullName}</span>`);
@@ -14598,7 +14608,7 @@ const fn = (t, e) => {
14598
14608
  }
14599
14609
  )
14600
14610
  },
14601
- ve
14611
+ we
14602
14612
  );
14603
14613
  }) }),
14604
14614
  /* @__PURE__ */ o.jsxs("p", { className: "text-[10px] mt-2", style: { color: J.mutedForeground }, children: [
@@ -14623,11 +14633,11 @@ const fn = (t, e) => {
14623
14633
  {
14624
14634
  onClick: (pe) => {
14625
14635
  pe.stopPropagation();
14626
- const ve = L.bundleDiscountPercentage || 0, We = 1 - ve / 100, Be = L.products.map((Ne) => ({
14636
+ const we = L.bundleDiscountPercentage || 0, We = 1 - we / 100, Be = L.products.map((Ne) => ({
14627
14637
  id: Ne.sku,
14628
14638
  name: Ne.name,
14629
14639
  brand: Ne.brand,
14630
- price: ve > 0 ? Math.round(Ne.displayPrice * We * 100) / 100 : Ne.displayPrice,
14640
+ price: we > 0 ? Math.round(Ne.displayPrice * We * 100) / 100 : Ne.displayPrice,
14631
14641
  sku: Ne.sku,
14632
14642
  partNumber: Ne.partNumber || void 0,
14633
14643
  image_url: Ne.productImageUrl,
@@ -14635,7 +14645,7 @@ const fn = (t, e) => {
14635
14645
  quantity: 1,
14636
14646
  _bundleMeta: {
14637
14647
  is_bundle_item: !0,
14638
- bundle_discount_percentage: ve,
14648
+ bundle_discount_percentage: we,
14639
14649
  service_package_name: $.title,
14640
14650
  service_package_id: $.id,
14641
14651
  quality_tier: L.tierName
@@ -14799,19 +14809,19 @@ const fn = (t, e) => {
14799
14809
  ]
14800
14810
  }
14801
14811
  ),
14802
- /* @__PURE__ */ o.jsx("div", { className: "flex flex-col gap-3", children: se.map((ae, Ae) => {
14803
- const Re = !!(s && Iu(ae, s));
14812
+ /* @__PURE__ */ o.jsx("div", { className: "flex flex-col gap-3", children: se.map((ae, Oe) => {
14813
+ const Ae = !!(s && Iu(ae, s));
14804
14814
  return /* @__PURE__ */ o.jsx("div", { "data-testid": "partslot-product", children: /* @__PURE__ */ o.jsx(
14805
14815
  Nu,
14806
14816
  {
14807
14817
  product: ae,
14808
- isSpotlighted: Re,
14818
+ isSpotlighted: Ae,
14809
14819
  spotlightedRef: R,
14810
14820
  onProductClick: a,
14811
14821
  onAddToCart: f,
14812
14822
  viewportSize: j
14813
14823
  }
14814
- ) }, `${ae.id}-${Ae}`);
14824
+ ) }, `${ae.id}-${Oe}`);
14815
14825
  }) })
14816
14826
  ]
14817
14827
  },
@@ -14917,7 +14927,7 @@ const fn = (t, e) => {
14917
14927
  onInterrupt: m,
14918
14928
  counterHeightPercent: x = 22
14919
14929
  }) => {
14920
- var _e;
14930
+ var ke;
14921
14931
  const [b, _] = V(!1), j = X(null), v = X(!1), { bottomOffset: S, zIndexBase: R } = Ra(), {
14922
14932
  isListening: P,
14923
14933
  interimTranscript: k,
@@ -14943,7 +14953,7 @@ const fn = (t, e) => {
14943
14953
  v.current && (v.current = !1, navigator.vibrate && navigator.vibrate([20, 50, 20]), C(), setTimeout(() => {
14944
14954
  n();
14945
14955
  }, 150));
14946
- }, [C, n]), M = [...t].reverse().find(($) => $.role === "assistant"), le = ((_e = M == null ? void 0 : M.suggestedProducts) == null ? void 0 : _e.length) || 0, K = M != null && M.content ? M.content.length > 50 ? M.content.slice(0, 50) + "..." : M.content : "Ask Bob about car parts...", U = le > 0 ? ` (${le} products)` : "", G = {
14956
+ }, [C, n]), M = [...t].reverse().find(($) => $.role === "assistant"), le = ((ke = M == null ? void 0 : M.suggestedProducts) == null ? void 0 : ke.length) || 0, K = M != null && M.content ? M.content.length > 50 ? M.content.slice(0, 50) + "..." : M.content : "Ask Bob about car parts...", U = le > 0 ? ` (${le} products)` : "", G = {
14947
14957
  idle: {
14948
14958
  background: "linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.95) 100%)",
14949
14959
  backdropFilter: "blur(16px) saturate(180%)",
@@ -15077,11 +15087,11 @@ const fn = (t, e) => {
15077
15087
  onProductClick: p
15078
15088
  }
15079
15089
  ),
15080
- $.role === "assistant" && $.quickReplies && $.quickReplies.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", marginTop: "8px" }, children: $.quickReplies.map((ae, Ae) => /* @__PURE__ */ o.jsx(
15090
+ $.role === "assistant" && $.quickReplies && $.quickReplies.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", marginTop: "8px" }, children: $.quickReplies.map((ae, Oe) => /* @__PURE__ */ o.jsx(
15081
15091
  "button",
15082
15092
  {
15083
- onClick: (Re) => {
15084
- Re.stopPropagation(), m == null || m(), g == null || g(ae.url);
15093
+ onClick: (Ae) => {
15094
+ Ae.stopPropagation(), m == null || m(), g == null || g(ae.url);
15085
15095
  },
15086
15096
  style: {
15087
15097
  padding: "6px 14px",
@@ -15099,7 +15109,7 @@ const fn = (t, e) => {
15099
15109
  },
15100
15110
  children: ae.label
15101
15111
  },
15102
- Ae
15112
+ Oe
15103
15113
  )) })
15104
15114
  ] }) }, se);
15105
15115
  }),
@@ -15358,7 +15368,7 @@ const fn = (t, e) => {
15358
15368
  backdropUrl: (r == null ? void 0 : r.substring(0, 50)) || "NONE",
15359
15369
  counterOverlayUrl: (s == null ? void 0 : s.substring(0, 50)) || "NONE"
15360
15370
  });
15361
- const ee = tn(), [re, _e] = V("center"), [$, se] = V("hidden"), O = b.length > 0 || _.length > 0, ae = ((W == null ? void 0 : W.length) ?? 0) > 0, Ae = O || ae, Qe = (() => {
15371
+ const ee = tn(), [re, ke] = V("center"), [$, se] = V("hidden"), O = b.length > 0 || _.length > 0, ae = ((W == null ? void 0 : W.length) ?? 0) > 0, Oe = O || ae, Qe = (() => {
15362
15372
  switch (ee) {
15363
15373
  case "desktop":
15364
15374
  return 70;
@@ -15372,18 +15382,18 @@ const fn = (t, e) => {
15372
15382
  })() * G / 100;
15373
15383
  ce(() => {
15374
15384
  if (N && $ !== "loading" && $ !== "visible")
15375
- se("loading"), re === "center" && _e("partial-left");
15376
- else if (Ae && $ !== "visible")
15385
+ se("loading"), re === "center" && ke("partial-left");
15386
+ else if (Oe && $ !== "visible")
15377
15387
  if (re === "center") {
15378
- _e("partial-left"), se("transitioning");
15388
+ ke("partial-left"), se("transitioning");
15379
15389
  const De = setTimeout(() => {
15380
15390
  se("visible");
15381
15391
  }, 400);
15382
15392
  return () => clearTimeout(De);
15383
15393
  } else
15384
15394
  se("visible");
15385
- else !Ae && !N && $ !== "hidden" && (se("hidden"), _e("center"));
15386
- }, [Ae, N, $, re]);
15395
+ else !Oe && !N && $ !== "hidden" && (se("hidden"), ke("center"));
15396
+ }, [Oe, N, $, re]);
15387
15397
  const et = $ !== "hidden";
15388
15398
  return /* @__PURE__ */ o.jsxs(
15389
15399
  "div",
@@ -15659,8 +15669,8 @@ const fn = (t, e) => {
15659
15669
  G.role === "assistant" && G.quickReplies && G.quickReplies.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", marginTop: "8px" }, children: G.quickReplies.map((ee, re) => /* @__PURE__ */ o.jsx(
15660
15670
  "button",
15661
15671
  {
15662
- onClick: (_e) => {
15663
- _e.stopPropagation(), p == null || p(), f == null || f(ee.url);
15672
+ onClick: (ke) => {
15673
+ ke.stopPropagation(), p == null || p(), f == null || f(ee.url);
15664
15674
  },
15665
15675
  style: {
15666
15676
  padding: "6px 14px",
@@ -16401,11 +16411,11 @@ const fn = (t, e) => {
16401
16411
  bobOffset: G = 0,
16402
16412
  bobScale: he = 100
16403
16413
  }) => {
16404
- const [ee, re] = V("center"), [_e, $] = V("hidden"), [se, O] = V("products"), [ae, Ae] = V(null), [Re, ke] = V(null), Qe = b.length > 0 || _.length > 0, et = ((M == null ? void 0 : M.length) ?? 0) > 0, De = Qe || et, nt = (se === "productDetail" ? 70 : ee === "center" && !De ? 140 : 98) * he / 100;
16414
+ const [ee, re] = V("center"), [ke, $] = V("hidden"), [se, O] = V("products"), [ae, Oe] = V(null), [Ae, Se] = V(null), Qe = b.length > 0 || _.length > 0, et = ((M == null ? void 0 : M.length) ?? 0) > 0, De = Qe || et, nt = (se === "productDetail" ? 70 : ee === "center" && !De ? 140 : 98) * he / 100;
16405
16415
  ce(() => {
16406
- if (N && _e !== "loading" && _e !== "visible")
16416
+ if (N && ke !== "loading" && ke !== "visible")
16407
16417
  $("loading"), ee === "center" && re("partial-left");
16408
- else if (De && _e !== "visible")
16418
+ else if (De && ke !== "visible")
16409
16419
  if (ee === "center") {
16410
16420
  re("partial-left"), $("transitioning");
16411
16421
  const pe = setTimeout(() => {
@@ -16414,19 +16424,19 @@ const fn = (t, e) => {
16414
16424
  return () => clearTimeout(pe);
16415
16425
  } else
16416
16426
  $("visible");
16417
- else !De && !N && _e !== "hidden" && ($("hidden"), re("center"));
16418
- }, [De, N, _e, ee]);
16427
+ else !De && !N && ke !== "hidden" && ($("hidden"), re("center"));
16428
+ }, [De, N, ke, ee]);
16419
16429
  const tt = (pe) => {
16420
16430
  if (T) {
16421
16431
  T(pe), P == null || P(pe);
16422
16432
  return;
16423
16433
  }
16424
- Ae(pe), O("productDetail"), P == null || P(pe);
16434
+ Oe(pe), O("productDetail"), P == null || P(pe);
16425
16435
  }, q = () => {
16426
- Ae(null), ke(null), O("products");
16436
+ Oe(null), Se(null), O("products");
16427
16437
  }, L = (pe) => {
16428
- console.log("[ContainedMobileBobLayout] Package selected:", pe.title), ke(pe), O("packageDetail"), k == null || k(pe);
16429
- }, Se = _e !== "hidden" && se === "products", Z = _e !== "hidden";
16438
+ console.log("[ContainedMobileBobLayout] Package selected:", pe.title), Se(pe), O("packageDetail"), k == null || k(pe);
16439
+ }, je = ke !== "hidden" && se === "products", Z = ke !== "hidden";
16430
16440
  return /* @__PURE__ */ o.jsxs(
16431
16441
  "div",
16432
16442
  {
@@ -16477,7 +16487,7 @@ const fn = (t, e) => {
16477
16487
  onProductClick: tt,
16478
16488
  onPackageSelect: L,
16479
16489
  isResearching: N,
16480
- visible: Se,
16490
+ visible: je,
16481
16491
  counterHeightPercent: n,
16482
16492
  hasVehicle: !!B,
16483
16493
  onAddToCart: E,
@@ -16497,29 +16507,29 @@ const fn = (t, e) => {
16497
16507
  onNavigateToProductPage: T
16498
16508
  }
16499
16509
  ),
16500
- se === "packageDetail" && Re && /* @__PURE__ */ o.jsx(
16510
+ se === "packageDetail" && Ae && /* @__PURE__ */ o.jsx(
16501
16511
  Du,
16502
16512
  {
16503
- package: Re,
16513
+ package: Ae,
16504
16514
  onBack: q,
16505
16515
  onAddToCart: (pe) => {
16506
- pe.forEach((ve) => {
16516
+ pe.forEach((we) => {
16507
16517
  var We;
16508
16518
  E == null || E({
16509
- id: ve.sku || ((We = ve.partslotId) == null ? void 0 : We.toString()) || "unknown",
16510
- name: ve.name || ve.partslotName || "Unknown Part",
16511
- brand: ve.brand,
16512
- price: ve.displayPrice,
16513
- sku: ve.sku,
16514
- partNumber: ve.partNumber,
16515
- image_url: ve.productImageUrl,
16516
- partslotDescription: ve.partslotName
16519
+ id: we.sku || ((We = we.partslotId) == null ? void 0 : We.toString()) || "unknown",
16520
+ name: we.name || we.partslotName || "Unknown Part",
16521
+ brand: we.brand,
16522
+ price: we.displayPrice,
16523
+ sku: we.sku,
16524
+ partNumber: we.partNumber,
16525
+ image_url: we.productImageUrl,
16526
+ partslotDescription: we.partslotName
16517
16527
  });
16518
16528
  });
16519
16529
  },
16520
16530
  onNavigateToProductPage: (pe) => {
16521
- const ve = b.find((We) => We.sku === pe);
16522
- ve && T && T(ve);
16531
+ const we = b.find((We) => We.sku === pe);
16532
+ we && T && T(we);
16523
16533
  }
16524
16534
  }
16525
16535
  ),
@@ -16580,7 +16590,7 @@ const fn = (t, e) => {
16580
16590
  }), K.current = q;
16581
16591
  }
16582
16592
  }, [k]);
16583
- const [U, G] = V([]), [he, ee] = V(""), [re, _e] = V(""), $ = X(null), se = X(null);
16593
+ const [U, G] = V([]), [he, ee] = V(""), [re, ke] = V(""), $ = X(null), se = X(null);
16584
16594
  ce(() => {
16585
16595
  $.current = (q) => {
16586
16596
  if (W(!1), !q || q.length === 0) {
@@ -16589,12 +16599,12 @@ const fn = (t, e) => {
16589
16599
  }
16590
16600
  const L = q[0];
16591
16601
  console.log("[Bob] First part raw keys:", Object.keys(L));
16592
- const Se = q.map((Z, pe) => {
16593
- const ve = Z.Brand || Z.brand || "";
16602
+ const je = q.map((Z, pe) => {
16603
+ const we = Z.Brand || Z.brand || "";
16594
16604
  return {
16595
16605
  id: Z.SKU || Z.sku || `part-${pe}`,
16596
16606
  name: Z["Part Product Type"] || Z.partslot_description || Z.name || "Unknown Part",
16597
- brand: ve,
16607
+ brand: we,
16598
16608
  price: Z["Metro Retail Price"] || Z.price || 0,
16599
16609
  sku: Z.SKU || Z.sku,
16600
16610
  partNumber: Z["Part Number"] || Z.part_number || null,
@@ -16605,15 +16615,15 @@ const fn = (t, e) => {
16605
16615
  perCarQty: Z["Per Car Qty"] || Z.per_car_qty || 1,
16606
16616
  volume: Z.volume || null,
16607
16617
  viscosity: Z.viscosity || null,
16608
- brandImageUrl: ve ? `https://flpzjbasdsfwoeruyxgp.supabase.co/storage/v1/object/public/brand_images/${ve.replace(/\s+/g, "")}.jpg` : void 0
16618
+ brandImageUrl: we ? `https://flpzjbasdsfwoeruyxgp.supabase.co/storage/v1/object/public/brand_images/${we.replace(/\s+/g, "")}.jpg` : void 0
16609
16619
  };
16610
16620
  });
16611
16621
  P((Z) => {
16612
16622
  var Ne;
16613
- const pe = new Set(Z.map((Ke) => Ke.sku).filter(Boolean)), ve = new Set(Z.map((Ke) => Ke.partslotDescription || "Other Parts")), We = /* @__PURE__ */ new Set(), Be = Se.filter((Ke) => !Ke.sku || We.has(Ke.sku) || pe.has(Ke.sku) ? !1 : (We.add(Ke.sku), !0));
16614
- if (console.log("[Bob] Products mapped:", Se.length, "-> new unique:", Be.length, "-> existing:", Z.length), Be.length > 0 && Z.length > 0) {
16623
+ const pe = new Set(Z.map((Ke) => Ke.sku).filter(Boolean)), we = new Set(Z.map((Ke) => Ke.partslotDescription || "Other Parts")), We = /* @__PURE__ */ new Set(), Be = je.filter((Ke) => !Ke.sku || We.has(Ke.sku) || pe.has(Ke.sku) ? !1 : (We.add(Ke.sku), !0));
16624
+ if (console.log("[Bob] Products mapped:", je.length, "-> new unique:", Be.length, "-> existing:", Z.length), Be.length > 0 && Z.length > 0) {
16615
16625
  const Ke = (Ne = Be.find(
16616
- (lr) => !ve.has(lr.partslotDescription || "Other Parts")
16626
+ (lr) => !we.has(lr.partslotDescription || "Other Parts")
16617
16627
  )) == null ? void 0 : Ne.partslotDescription;
16618
16628
  Ke && setTimeout(() => le(Ke), 100);
16619
16629
  }
@@ -16639,8 +16649,8 @@ const fn = (t, e) => {
16639
16649
  onResearchStart: () => {
16640
16650
  W(!0);
16641
16651
  },
16642
- onVariantSelectionRequired: (q, L, Se) => {
16643
- W(!1), G(q), ee(L), _e(Se);
16652
+ onVariantSelectionRequired: (q, L, je) => {
16653
+ W(!1), G(q), ee(L), ke(je);
16644
16654
  },
16645
16655
  onHighlightPart: (q) => {
16646
16656
  T(q), setTimeout(() => T(null), 8e3);
@@ -16654,7 +16664,7 @@ const fn = (t, e) => {
16654
16664
  shelfCategoriesRef: K
16655
16665
  });
16656
16666
  ce(() => {
16657
- O.identifiedVehicle && (G([]), ee(""), _e(""));
16667
+ O.identifiedVehicle && (G([]), ee(""), ke(""));
16658
16668
  }, [(nt = O.identifiedVehicle) == null ? void 0 : nt.vehicle_id, (tt = O.identifiedVehicle) == null ? void 0 : tt.id]);
16659
16669
  const ae = (q) => {
16660
16670
  O.sendDirectMessage(`Option ${q.optionNumber}`);
@@ -16663,19 +16673,19 @@ const fn = (t, e) => {
16663
16673
  g(O.isSpeaking);
16664
16674
  }, [O.isSpeaking]), ce(() => {
16665
16675
  const q = f.onPartsFound, L = f.onServicePackagesFound;
16666
- return f.onPartsFound = (Se) => {
16676
+ return f.onPartsFound = (je) => {
16667
16677
  var Z;
16668
- (Z = $.current) == null || Z.call($, Se), q == null || q(Se);
16669
- }, f.onServicePackagesFound = (Se) => {
16678
+ (Z = $.current) == null || Z.call($, je), q == null || q(je);
16679
+ }, f.onServicePackagesFound = (je) => {
16670
16680
  var Z;
16671
- (Z = se.current) == null || Z.call(se, Se), L == null || L(Se);
16681
+ (Z = se.current) == null || Z.call(se, je), L == null || L(je);
16672
16682
  }, () => {
16673
16683
  f.onPartsFound = q, f.onServicePackagesFound = L;
16674
16684
  };
16675
16685
  }, [f]);
16676
- const Ae = n || (S == null ? void 0 : S.image_url), Re = i || (S == null ? void 0 : S.counter_overlay_url) || void 0, ke = a || (S == null ? void 0 : S.counter_height_percent) || 12, Qe = b() || l || "", et = _(), De = j(), st = Y((q) => {
16677
- var Z, pe, ve, We;
16678
- const L = Array.isArray(q) ? q : [q], Se = ((pe = (Z = O.identifiedVehicle) == null ? void 0 : Z.vehicle_id) == null ? void 0 : pe.toString()) || ((We = (ve = O.identifiedVehicle) == null ? void 0 : ve.id) == null ? void 0 : We.toString());
16686
+ const Oe = n || (S == null ? void 0 : S.image_url), Ae = i || (S == null ? void 0 : S.counter_overlay_url) || void 0, Se = a || (S == null ? void 0 : S.counter_height_percent) || 12, Qe = b() || l || "", et = _(), De = j(), st = Y((q) => {
16687
+ var Z, pe, we, We;
16688
+ const L = Array.isArray(q) ? q : [q], je = ((pe = (Z = O.identifiedVehicle) == null ? void 0 : Z.vehicle_id) == null ? void 0 : pe.toString()) || ((We = (we = O.identifiedVehicle) == null ? void 0 : we.id) == null ? void 0 : We.toString());
16679
16689
  L.forEach((Be) => {
16680
16690
  var Ke;
16681
16691
  const Ne = {
@@ -16686,7 +16696,7 @@ const fn = (t, e) => {
16686
16696
  sku: Be.sku,
16687
16697
  brand: Be.brand,
16688
16698
  image_url: Be.image_url,
16689
- vehicle_id: Se,
16699
+ vehicle_id: je,
16690
16700
  ...Be._bundleMeta || {}
16691
16701
  };
16692
16702
  (Ke = f.onAddToCart) == null || Ke.call(f, Ne);
@@ -16698,9 +16708,9 @@ const fn = (t, e) => {
16698
16708
  {
16699
16709
  currentImage: Qe,
16700
16710
  animationState: m,
16701
- backdropUrl: Ae,
16702
- counterOverlayUrl: Re,
16703
- counterHeightPercent: ke,
16711
+ backdropUrl: Oe,
16712
+ counterOverlayUrl: Ae,
16713
+ counterHeightPercent: Se,
16704
16714
  bobOffset: et,
16705
16715
  bobScale: De,
16706
16716
  embedded: h,
@@ -16747,9 +16757,9 @@ const fn = (t, e) => {
16747
16757
  {
16748
16758
  currentImage: Qe,
16749
16759
  animationState: m,
16750
- backdropUrl: Ae,
16751
- counterOverlayUrl: Re,
16752
- counterHeightPercent: ke,
16760
+ backdropUrl: Oe,
16761
+ counterOverlayUrl: Ae,
16762
+ counterHeightPercent: Se,
16753
16763
  bobOffset: et,
16754
16764
  bobScale: De,
16755
16765
  messages: O.messages,
@@ -16799,9 +16809,9 @@ const fn = (t, e) => {
16799
16809
  {
16800
16810
  currentImage: Qe,
16801
16811
  animationState: m,
16802
- backdropUrl: Ae,
16803
- counterOverlayUrl: Re,
16804
- counterHeightPercent: ke,
16812
+ backdropUrl: Oe,
16813
+ counterOverlayUrl: Ae,
16814
+ counterHeightPercent: Se,
16805
16815
  verticalOffset: et,
16806
16816
  scale: De
16807
16817
  }