@kosdev-code/kos-dispense-sdk 0.1.0-dev.5343 → 0.1.0-dev.5344

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.
Files changed (32) hide show
  1. package/{dispense-registration-manager-DM1TEmvY.cjs → dispense-registration-manager-BP5wXKEC.cjs} +2 -2
  2. package/{dispense-registration-manager-DM1TEmvY.cjs.map → dispense-registration-manager-BP5wXKEC.cjs.map} +1 -1
  3. package/{dispense-registration-manager-D9ey2UCg.js → dispense-registration-manager-Ba4UWXju.js} +12 -16
  4. package/{dispense-registration-manager-D9ey2UCg.js.map → dispense-registration-manager-Ba4UWXju.js.map} +1 -1
  5. package/{extension-utils-Ks3ffMqq.js → extension-utils-CNDUJVak.js} +2 -2
  6. package/{extension-utils-Ks3ffMqq.js.map → extension-utils-CNDUJVak.js.map} +1 -1
  7. package/{extension-utils-B_8_3ipu.cjs → extension-utils-CxlY9mef.cjs} +2 -2
  8. package/{extension-utils-B_8_3ipu.cjs.map → extension-utils-CxlY9mef.cjs.map} +1 -1
  9. package/index.cjs +1 -1
  10. package/index.js +3 -3
  11. package/models/models/nozzle/nozzle-model.d.ts +1 -1
  12. package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
  13. package/models.cjs +1 -1
  14. package/models.js +2 -2
  15. package/package.json +4 -4
  16. package/{pump-provider-B5htndvr.js → pump-provider-Dhh0rg1k.js} +226 -221
  17. package/pump-provider-Dhh0rg1k.js.map +1 -0
  18. package/pump-provider-m3YekBzj.cjs +2 -0
  19. package/pump-provider-m3YekBzj.cjs.map +1 -0
  20. package/ui/hooks/cui-kit/use-beverages.d.ts +1 -1
  21. package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
  22. package/ui/hooks/cui-kit/use-brands.d.ts +1 -1
  23. package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
  24. package/ui/hooks/cui-kit/use-cui-kit.d.ts +1 -1
  25. package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
  26. package/ui/hooks/cui-kit/use-flavors.d.ts +1 -1
  27. package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
  28. package/ui.cjs +1 -1
  29. package/ui.js +2 -2
  30. package/pump-provider-B5htndvr.js.map +0 -1
  31. package/pump-provider-Bx-yx6VP.cjs +0 -2
  32. package/pump-provider-Bx-yx6VP.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  var ot = Object.defineProperty;
2
2
  var it = (e, t, r) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var X = (e, t, r) => (it(e, typeof t != "symbol" ? t + "" : t, r), r);
3
+ var U = (e, t, r) => (it(e, typeof t != "symbol" ? t + "" : t, r), r);
4
4
  import { jsx as m } from "@emotion/react/jsx-runtime";
5
- import { useKosModel as C, getKosCompanionModel as we, kosAutoEffect as De, KosLog as P, usePressGesture as Pe, EventBus as $, TimerManager as Be } from "@kosdev-code/kos-ui-sdk";
6
- import { A as Ae, b as Ke, e as ct, d as Ee, N as dt, f as ye, H as ut, j as Ce, I as Se, k as ke, G as lt, P as Ne } from "./dispense-registration-manager-D9ey2UCg.js";
5
+ import { useKosModel as C, getKosCompanionModel as $e, kosAutoEffect as De, KosLog as P, usePressGesture as Pe, EventBus as w, TimerManager as Be } from "@kosdev-code/kos-ui-sdk";
6
+ import { A as Ae, b as Ke, e as ct, d as Ee, N as dt, f as ye, H as ut, j as Ce, I as Se, k as ke, G as lt, P as Ne } from "./dispense-registration-manager-Ba4UWXju.js";
7
7
  import mt, { createContext as N, useMemo as A, useContext as S, useState as x, useCallback as i, useEffect as V, useRef as le } from "react";
8
8
  const Le = () => {
9
9
  const e = Ae.type;
@@ -78,70 +78,72 @@ const Ye = (e) => C({
78
78
  onClearBeverage: r,
79
79
  companionType: n
80
80
  }) => {
81
- const { model: s } = M(), [o, a] = x([]), [d, b] = x(null), p = A(() => n ? o.map(
82
- (h) => we(h, n)
81
+ const { model: s } = M(), [o, a] = x([]), [d, T] = x(null), f = A(() => n ? o.map(
82
+ (p) => $e(p, n)
83
83
  ) : [], [o, n]), c = i(
84
- async (h, T) => {
85
- b(h), await (s == null ? void 0 : s.setSelectedPourable({ beverage: h, context: T })), e == null || e(h);
84
+ async (p, v, b) => {
85
+ T(p), await (s == null ? void 0 : s.setSelectedPourable({ beverage: p, context: v }, b)), e == null || e(p);
86
86
  },
87
87
  [s, e]
88
- ), f = i(async () => {
89
- b(null), await (s == null ? void 0 : s.setSelectedPourable({ beverage: void 0 })), r == null || r();
88
+ ), h = i(async () => {
89
+ T(null), await (s == null ? void 0 : s.setSelectedPourable({ beverage: void 0 })), r == null || r();
90
90
  }, [s, r]);
91
91
  return V(() => {
92
- const h = De(() => {
92
+ const p = De(() => {
93
93
  if (!s)
94
94
  return;
95
- const T = s.selectedBrand;
96
- if (!T) {
95
+ const v = s.selectedBrand;
96
+ if (!v) {
97
97
  const u = s.getGroupAvailabilityItems("beverages").filter((g) => g.visible);
98
98
  a(u ?? []), t == null || t(u);
99
99
  return;
100
100
  }
101
- const v = s.getAvailabilityByParent(T.id).filter((u) => u.visible);
102
- a(v ?? []), t == null || t(v);
101
+ const b = s.getAvailabilityByParent(v.id).filter((u) => u.visible);
102
+ a(b ?? []), t == null || t(b);
103
103
  });
104
104
  return () => {
105
- h();
105
+ p();
106
106
  };
107
107
  }, [s]), {
108
108
  beverages: o,
109
- beverageCompanions: p,
109
+ beverageCompanions: f,
110
110
  selectBeverage: c,
111
111
  selectedBeverage: d,
112
- clearBeverage: f
112
+ clearBeverage: h
113
113
  };
114
114
  }, pt = ({
115
115
  onBrandSelected: e,
116
116
  onBrandCleared: t,
117
117
  companionType: r
118
118
  }) => {
119
- const { model: n } = M(), [s, o] = x(null), [a, d] = x([]), b = A(() => r ? a.map((f) => we(f, r)) : [], [a, r]), p = i(
120
- async (f, h) => {
121
- o(f), n == null || n.setSelectedBrand(f, h), e == null || e(f);
119
+ const { model: n } = M(), [s, o] = x(null), [a, d] = x([]), T = A(() => r ? a.map((h) => $e(h, r)) : [], [a, r]), f = i(
120
+ async (h, p, v) => {
121
+ o(h), v && P.warn(
122
+ "forceUpdate is not currently supported when setting brand"
123
+ ), n == null || n.setSelectedBrand(h, p), e == null || e(h);
122
124
  },
123
125
  [n, e]
124
126
  ), c = i(() => {
125
127
  o(null), n == null || n.setSelectedBrand(void 0), t == null || t();
126
128
  }, [n, t]);
127
129
  return V(() => {
128
- const f = De(() => {
130
+ const h = De(() => {
129
131
  n && d(n.visibleBrands);
130
132
  });
131
133
  return () => {
132
- f();
134
+ h();
133
135
  };
134
136
  }, [n]), {
135
137
  brands: a,
136
- brandCompanions: b,
138
+ brandCompanions: T,
137
139
  selectedBrand: s,
138
- selectBrand: p,
140
+ selectBrand: f,
139
141
  clearBrand: c
140
142
  };
141
143
  };
142
144
  class Ge {
143
145
  constructor() {
144
- X(this, "_data", /* @__PURE__ */ new Map());
146
+ U(this, "_data", /* @__PURE__ */ new Map());
145
147
  }
146
148
  get(t) {
147
149
  return this._data.get(t);
@@ -182,9 +184,9 @@ const bt = P.createLogger({
182
184
  pourContext: s,
183
185
  strategy: o = Ve
184
186
  }) => {
185
- const { model: a } = M(), [d, b] = x(
187
+ const { model: a } = M(), [d, T] = x(
186
188
  s || new Ge()
187
- ), p = i(async () => {
189
+ ), f = i(async () => {
188
190
  (r ? await (r == null ? void 0 : r(d)) : !0) ? (ce.debug(
189
191
  `[${o == null ? void 0 : o.name}] - Pour initiated for nozzle ${a == null ? void 0 : a.id}.`
190
192
  ), o == null || o.initiate(a), e == null || e()) : (ce.debug(
@@ -203,14 +205,14 @@ const bt = P.createLogger({
203
205
  ce.debug(
204
206
  `[${o == null ? void 0 : o.name}] - Pour initiate ended called for nozzle ${a == null ? void 0 : a.id}.`
205
207
  ), (u = o == null ? void 0 : o.initiateEnded) == null || u.call(o, a), t == null || t();
206
- }, [t, a, o]), f = i(() => {
208
+ }, [t, a, o]), h = i(() => {
207
209
  ce.debug(`Force cancelling pour for nozzle ${a == null ? void 0 : a.id}.`), a == null || a.cancelPour(), t == null || t();
208
- }, [t, a]), h = i(
210
+ }, [t, a]), p = i(
209
211
  (u, g) => {
210
212
  d.set(u, g);
211
213
  },
212
214
  [d]
213
- ), T = i(
215
+ ), v = i(
214
216
  (u) => {
215
217
  d.remove(u);
216
218
  },
@@ -218,12 +220,12 @@ const bt = P.createLogger({
218
220
  );
219
221
  return {
220
222
  handlers: Pe({
221
- onPressed: p,
223
+ onPressed: f,
222
224
  onRelease: c
223
225
  }).dom,
224
- cancel: f,
225
- updatePourContext: h,
226
- removeFromPourContext: T,
226
+ cancel: h,
227
+ updatePourContext: p,
228
+ removeFromPourContext: v,
227
229
  status: a
228
230
  };
229
231
  }, Tt = ({
@@ -235,23 +237,26 @@ const bt = P.createLogger({
235
237
  () => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((c) => c.visible)) ?? [],
236
238
  [n]
237
239
  ), o = A(() => r ? s.map(
238
- (c) => we(c, r)
239
- ) : [], [s, r]), [a, d] = x([]), b = i(
240
- async (c, f) => {
240
+ (c) => $e(c, r)
241
+ ) : [], [s, r]), [a, d] = x([]), T = i(
242
+ async (c, h, p) => {
241
243
  if (d(
242
- (h) => h != null && h.includes(c) ? [...h.filter((T) => T !== c)] : [...h ?? [], c]
244
+ (v) => v != null && v.includes(c) ? [...v.filter((b) => b !== c)] : [...v ?? [], c]
243
245
  ), n != null && n.selectedPourable) {
244
- const { beverage: h } = n.selectedPourable;
245
- await n.setSelectedPourable({
246
- beverage: h,
247
- additional: a ?? [],
248
- context: f
249
- });
246
+ const { beverage: v } = n.selectedPourable;
247
+ await n.setSelectedPourable(
248
+ {
249
+ beverage: v,
250
+ additional: a ?? [],
251
+ context: h
252
+ },
253
+ p
254
+ );
250
255
  }
251
256
  e == null || e(c, a ?? []);
252
257
  },
253
258
  [n, e, a]
254
- ), p = i(async () => {
259
+ ), f = i(async () => {
255
260
  if (d([]), n != null && n.selectedPourable) {
256
261
  const { beverage: c } = n.selectedPourable;
257
262
  n.setSelectedPourable({ beverage: c }), t == null || t();
@@ -260,81 +265,81 @@ const bt = P.createLogger({
260
265
  return {
261
266
  flavors: s,
262
267
  flavorCompanions: o,
263
- selectFlavor: b,
268
+ selectFlavor: T,
264
269
  selectedFlavors: a,
265
- clearFlavors: p
270
+ clearFlavors: f
266
271
  };
267
- }, te = "brands", de = "beverages", se = "flavors", G = P.createLogger({ name: "use-cui-kit" }), $t = ({
272
+ }, te = "brands", de = "beverages", se = "flavors", G = P.createLogger({ name: "use-cui-kit" }), wt = ({
268
273
  initialGroup: e = te,
269
274
  options: t = {}
270
275
  }) => {
271
276
  var ae, oe, ie;
272
- const [r, n] = x(e), { model: s } = M(), o = le([]), a = le(), d = le(), b = i(
277
+ const [r, n] = x(e), { model: s } = M(), o = le([]), a = le(), d = le(), T = i(
273
278
  (l) => {
274
279
  n(se);
275
- const w = `/kos/dispense/${s == null ? void 0 : s.path}/brand/selected/`;
276
- $.publish(w, l);
280
+ const $ = `/kos/dispense/${s == null ? void 0 : s.path}/brand/selected/`;
281
+ w.publish($, l);
277
282
  },
278
283
  [s == null ? void 0 : s.path]
279
- ), p = i(() => {
284
+ ), f = i(() => {
280
285
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/brand/cleared/`;
281
- $.publish(l, {});
286
+ w.publish(l, {});
282
287
  }, [s == null ? void 0 : s.path]), c = i(
283
288
  (l) => {
284
- const w = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/list/updated/`;
285
- $.publish(w, l);
289
+ const $ = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/list/updated/`;
290
+ w.publish($, l);
286
291
  },
287
292
  [s == null ? void 0 : s.path]
288
- ), f = i(
293
+ ), h = i(
289
294
  (l) => {
290
295
  var ee;
291
296
  n(se), (ee = a.current) == null || ee.call(a, "selectedBeverage", l);
292
- const w = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/selected/`;
293
- $.publish(w, l);
297
+ const $ = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/selected/`;
298
+ w.publish($, l);
294
299
  },
295
300
  [s == null ? void 0 : s.path]
296
- ), h = i(() => {
297
- var w;
301
+ ), p = i(() => {
302
+ var $;
298
303
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/cleared/`;
299
- (w = d.current) == null || w.call(d, "selectedBeverage"), $.publish(l, {});
300
- }, [s == null ? void 0 : s.path]), T = i(
304
+ ($ = d.current) == null || $.call(d, "selectedBeverage"), w.publish(l, {});
305
+ }, [s == null ? void 0 : s.path]), v = i(
301
306
  (l) => {
302
- const w = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/selected/`;
303
- $.publish(w, l);
307
+ const $ = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/selected/`;
308
+ w.publish($, l);
304
309
  },
305
310
  [s == null ? void 0 : s.path]
306
- ), v = i(() => {
311
+ ), b = i(() => {
307
312
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/cleared/`;
308
- $.publish(l, {});
313
+ w.publish(l, {});
309
314
  }, [s == null ? void 0 : s.path]), u = i(() => {
310
315
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/pour/`;
311
- $.publish(l, {});
316
+ w.publish(l, {});
312
317
  }, [s == null ? void 0 : s.path]), g = i(
313
318
  async (l) => {
314
- const w = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/`;
315
- return $.publish(w, {}), await (F == null ? void 0 : F(l)) || !0;
319
+ const $ = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/`;
320
+ return w.publish($, {}), await (F == null ? void 0 : F(l)) || !0;
316
321
  },
317
322
  [s == null ? void 0 : s.path]
318
323
  ), y = i(async () => {
319
324
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/rejected/`;
320
- $.publish(l, {});
325
+ w.publish(l, {});
321
326
  }, [s == null ? void 0 : s.path]), _ = i(() => {
322
327
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/pour/cancel/`;
323
- $.publish(l, {});
324
- }, [s == null ? void 0 : s.path]), { brands: O, selectBrand: R, selectedBrand: Z, clearBrand: Y, brandCompanions: me } = pt({
328
+ w.publish(l, {});
329
+ }, [s == null ? void 0 : s.path]), { brands: O, selectBrand: R, selectedBrand: X, clearBrand: Y, brandCompanions: me } = pt({
325
330
  companionType: (ae = t.companionTypes) == null ? void 0 : ae.brand,
326
- onBrandSelected: b,
327
- onBrandCleared: p
331
+ onBrandSelected: T,
332
+ onBrandCleared: f
328
333
  }), {
329
334
  beverages: H,
330
335
  selectBeverage: D,
331
- selectedBeverage: U,
336
+ selectedBeverage: Z,
332
337
  clearBeverage: B,
333
338
  beverageCompanions: q
334
339
  } = ft({
335
340
  companionType: (oe = t.companionTypes) == null ? void 0 : oe.beverage,
336
- onBeverageSelected: f,
337
- onClearBeverage: h,
341
+ onBeverageSelected: h,
342
+ onClearBeverage: p,
338
343
  onBeverageListUpdated: c
339
344
  }), {
340
345
  clearFlavors: I,
@@ -344,8 +349,8 @@ const bt = P.createLogger({
344
349
  flavorCompanions: j
345
350
  } = Tt({
346
351
  companionType: (ie = t.companionTypes) == null ? void 0 : ie.flavor,
347
- onFlavorSelected: T,
348
- onFlavorCleared: v
352
+ onFlavorSelected: v,
353
+ onFlavorCleared: b
349
354
  }), [F, Q] = x(), he = i((l) => {
350
355
  Q(() => l);
351
356
  }, []), z = vt({
@@ -367,7 +372,7 @@ const bt = P.createLogger({
367
372
  }
368
373
  }, [B, Y, r, e]), pe = i(() => {
369
374
  const l = `/kos/dispense/${s == null ? void 0 : s.path}/home/`;
370
- $.publish(l, {}), n(e), e === te && (B(), Y()), e === de && B();
375
+ w.publish(l, {}), n(e), e === te && (B(), Y()), e === de && B();
371
376
  }, [B, Y, e]), be = i(() => {
372
377
  if (o.current.length === 0) {
373
378
  G.debug("No timers to pause.");
@@ -389,7 +394,7 @@ const bt = P.createLogger({
389
394
  timers: {
390
395
  add: i((l) => {
391
396
  if (l) {
392
- if (o.current.some((w) => w.id === l.id)) {
397
+ if (o.current.some(($) => $.id === l.id)) {
393
398
  G.debug(`Timer with id ${l.id} already exists.`);
394
399
  return;
395
400
  }
@@ -407,8 +412,8 @@ const bt = P.createLogger({
407
412
  pour: z,
408
413
  updateOnBeforePour: he,
409
414
  selections: {
410
- [te]: Z,
411
- [de]: U,
415
+ [te]: X,
416
+ [de]: Z,
412
417
  [se]: K
413
418
  },
414
419
  [te]: {
@@ -442,35 +447,35 @@ const bt = P.createLogger({
442
447
  onAttractTimer: o,
443
448
  onResetAttractTimer: a,
444
449
  onResumeAttractTimer: d,
445
- defaultAttractTime: b,
446
- defaultAmbientTime: p
450
+ defaultAttractTime: T,
451
+ defaultAmbientTime: f
447
452
  } = e, c = i(() => {
448
453
  s && (P.info("Ambient timer expired. Calling callback"), s == null || s());
449
- }, [s]), f = i(() => {
454
+ }, [s]), h = i(() => {
450
455
  o && (P.info("Attract timer expired. Calling callback"), o == null || o());
451
- }, [o]), h = i(() => {
456
+ }, [o]), p = i(() => {
452
457
  r && (r.restart(), a == null || a());
453
- }, [r, a]), T = i(() => {
454
- r && (r.reset(), a == null || a());
455
458
  }, [r, a]), v = i(() => {
459
+ r && (r.reset(), a == null || a());
460
+ }, [r, a]), b = i(() => {
456
461
  r && (r.pause(), d == null || d());
457
462
  }, [r, d]);
458
463
  return V(() => {
459
- if (t && b) {
464
+ if (t && T) {
460
465
  P.info("Nozzle is available. Creating timers");
461
466
  const u = Be.createTimer(
462
467
  "attract-timer-" + t.path,
463
- b
468
+ T
464
469
  );
465
- return b && (u == null || u.addTimeoutAction({
470
+ return T && (u == null || u.addTimeoutAction({
466
471
  name: "attract-timer",
467
472
  remainingTime: 0,
468
- action: f
469
- })), p && (u == null || u.addTimeoutAction({
473
+ action: h
474
+ })), f && (u == null || u.addTimeoutAction({
470
475
  name: "ambient-timer",
471
- remainingTime: p,
476
+ remainingTime: f,
472
477
  action: c
473
- })), b && (u == null || u.start()), n(u ?? null), () => {
478
+ })), T && (u == null || u.start()), n(u ?? null), () => {
474
479
  u == null || u.reset(), n(null);
475
480
  };
476
481
  }
@@ -478,18 +483,18 @@ const bt = P.createLogger({
478
483
  P.info("Nozzle is not available. No timers to clear");
479
484
  };
480
485
  }, [
481
- p,
482
- b,
483
- c,
484
486
  f,
487
+ T,
488
+ c,
489
+ h,
485
490
  t
486
491
  ]), {
487
492
  attractTimer: r,
488
- restart: h,
489
- pause: T,
490
- resume: v
493
+ restart: p,
494
+ pause: v,
495
+ resume: b
491
496
  };
492
- }, wt = [
497
+ }, $t = [
493
498
  { path: "brand/selected", callbackKey: "onBrandSelected" },
494
499
  { path: "brand/cleared", callbackKey: "onBrandCleared" },
495
500
  { path: "beverage/list/updated", callbackKey: "onBeverageListUpdated" },
@@ -509,7 +514,7 @@ const bt = P.createLogger({
509
514
  { path: "home", callbackKey: "onReturnToHome" }
510
515
  ];
511
516
  function Pt(e, t) {
512
- return e ? wt.filter(
517
+ return e ? $t.filter(
513
518
  (r) => t[r.callbackKey] !== void 0
514
519
  ).map((r) => ({
515
520
  topic: `/kos/dispense/${e}/${r.path}/`,
@@ -521,7 +526,7 @@ const It = (e, t) => {
521
526
  const r = (s) => {
522
527
  s && s.body && t(s.body);
523
528
  };
524
- return $.subscribe(e, r).unsubscribe;
529
+ return w.subscribe(e, r).unsubscribe;
525
530
  }
526
531
  }, xt = ({
527
532
  onInit: e,
@@ -532,13 +537,13 @@ const It = (e, t) => {
532
537
  onBeverageListUpdated: o,
533
538
  onFlavorCleared: a,
534
539
  onFlavorSelected: d,
535
- onReturnToHome: b,
536
- onPour: p,
540
+ onReturnToHome: T,
541
+ onPour: f,
537
542
  onPourCancel: c,
538
- onBeforePourRejected: f,
539
- onAmbientTimer: h,
540
- onAttractTimer: T,
541
- onResumeAttractTimer: v,
543
+ onBeforePourRejected: h,
544
+ onAmbientTimer: p,
545
+ onAttractTimer: v,
546
+ onResumeAttractTimer: b,
542
547
  onIdleTimeout: u,
543
548
  onAreYouThereTimeout: g
544
549
  }) => {
@@ -552,26 +557,26 @@ const It = (e, t) => {
552
557
  onBeverageCleared: n,
553
558
  onFlavorSelected: d,
554
559
  onFlavorCleared: a,
555
- onPour: p,
560
+ onPour: f,
556
561
  onPourCancel: c,
557
- onBeforePourRejected: f,
558
- onAmbientTimer: h,
559
- onAttractTimer: T,
560
- onResumeAttractTimer: v,
562
+ onBeforePourRejected: h,
563
+ onAmbientTimer: p,
564
+ onAttractTimer: v,
565
+ onResumeAttractTimer: b,
561
566
  onIdleTimeout: u,
562
567
  onAreYouThereTimeout: g,
563
568
  onInit: e,
564
- onReturnToHome: b
569
+ onReturnToHome: T
565
570
  }).map(
566
- ({ topic: R, callback: Z }) => It(R, Z)
571
+ ({ topic: R, callback: X }) => It(R, X)
567
572
  );
568
573
  return () => {
569
574
  O.forEach((R) => R == null ? void 0 : R());
570
575
  };
571
576
  }, [
572
577
  y == null ? void 0 : y.path,
573
- h,
574
- T,
578
+ p,
579
+ v,
575
580
  n,
576
581
  s,
577
582
  o,
@@ -579,14 +584,14 @@ const It = (e, t) => {
579
584
  t,
580
585
  a,
581
586
  d,
582
- p,
583
- c,
584
587
  f,
585
- v,
588
+ c,
589
+ h,
590
+ b,
586
591
  u,
587
592
  g,
588
593
  e,
589
- b
594
+ T
590
595
  ]);
591
596
  }, L = P.createLogger({ name: "useCuiKitTimers" }), He = (e) => {
592
597
  const { model: t } = M(), [r, n] = x(null), {
@@ -594,41 +599,41 @@ const It = (e, t) => {
594
599
  onIdleTimer: o,
595
600
  onResetIdleTimer: a,
596
601
  defaultAreYouThereTime: d = 10,
597
- defaultIdleTime: b = 20
598
- } = e, p = le(!1), c = i(() => {
599
- !p.current && s && (P.info("Are you there timer expired. Calling callback"), p.current = !0, s == null || s());
600
- }, [s]), f = i(() => {
602
+ defaultIdleTime: T = 20
603
+ } = e, f = le(!1), c = i(() => {
604
+ !f.current && s && (P.info("Are you there timer expired. Calling callback"), f.current = !0, s == null || s());
605
+ }, [s]), h = i(() => {
601
606
  L.debug(
602
607
  "handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:",
603
608
  !!o
604
609
  ), o ? (L.debug("Idle timer expired. Calling callback"), o == null || o()) : L.debug("No onIdleTimer callback provided!");
605
- }, [o]), h = i(() => {
606
- L.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), r && (r.restart(), p.current = !1, a == null || a());
607
- }, [r, a, e.prefix]), T = i(() => {
608
- L.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), r && (r.reset(), p.current = !1, a == null || a());
610
+ }, [o]), p = i(() => {
611
+ L.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), r && (r.restart(), f.current = !1, a == null || a());
612
+ }, [r, a, e.prefix]), v = i(() => {
613
+ L.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), r && (r.reset(), f.current = !1, a == null || a());
609
614
  }, [r, a, e.prefix]);
610
615
  return V(() => {
611
616
  if (L.debug(
612
- `useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!f}, handleAreYouThere=${!!c}`
617
+ `useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!h}, handleAreYouThere=${!!c}`
613
618
  ), t) {
614
619
  L.info("Nozzle is available. Creating timers");
615
- const v = Be.createTimer(
620
+ const b = Be.createTimer(
616
621
  `${e.prefix ?? ""}idle-timer-${t.path}`,
617
- b
622
+ T
618
623
  );
619
624
  return L.debug(
620
625
  `Adding idle timer action for ${e.prefix ?? ""}idle-timer-${t.path} with callback:`,
621
- !!f
622
- ), v == null || v.addTimeoutAction({
626
+ !!h
627
+ ), b == null || b.addTimeoutAction({
623
628
  name: "idle-timer",
624
629
  remainingTime: 0,
625
- action: f
626
- }), v == null || v.addTimeoutAction({
630
+ action: h
631
+ }), b == null || b.addTimeoutAction({
627
632
  name: "are-you-there-timer",
628
633
  remainingTime: d,
629
634
  action: c
630
- }), n(v ?? null), () => {
631
- v == null || v.reset(), n(null);
635
+ }), n(b ?? null), () => {
636
+ b == null || b.reset(), n(null);
632
637
  };
633
638
  }
634
639
  return () => {
@@ -636,15 +641,15 @@ const It = (e, t) => {
636
641
  };
637
642
  }, [
638
643
  d,
639
- b,
644
+ T,
640
645
  c,
641
- f,
646
+ h,
642
647
  t,
643
648
  e.prefix
644
649
  ]), {
645
650
  idleTimer: r,
646
- restart: h,
647
- pause: T
651
+ restart: p,
652
+ pause: v
648
653
  };
649
654
  }, W = P.createLogger({ name: "useDefaultCuiKitLifecycle" }), Gt = ({
650
655
  kit: e,
@@ -654,51 +659,51 @@ const It = (e, t) => {
654
659
  onBeforeAreYouThereTimer: s,
655
660
  areYouThereRejectionPolicy: o = "pause"
656
661
  }) => {
657
- var l, w, ee, xe;
658
- const [a, d] = x(!1), [b, p] = x(!1), { model: c } = M(), [f, h] = x(!1), T = (t == null ? void 0 : t.idleTimeout) ?? 15, v = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, u = (r == null ? void 0 : r.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, g = (r == null ? void 0 : r.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, y = n == null ? void 0 : n.ambientTimeoutOffset, _ = n == null ? void 0 : n.attractTimeout, O = i(() => {
662
+ var l, $, ee, xe;
663
+ const [a, d] = x(!1), [T, f] = x(!1), { model: c } = M(), [h, p] = x(!1), v = (t == null ? void 0 : t.idleTimeout) ?? 15, b = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, u = (r == null ? void 0 : r.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, g = (r == null ? void 0 : r.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, y = n == null ? void 0 : n.ambientTimeoutOffset, _ = n == null ? void 0 : n.attractTimeout, O = i(() => {
659
664
  if (W.info("handleIdleTimeout called - navigating home and publishing event"), q(!1), e == null || e.nav.home(), c) {
660
665
  const E = `/kos/dispense/${c.path}/idle/timeout/`;
661
- $.publish(E, {});
666
+ w.publish(E, {});
662
667
  }
663
668
  }, [(l = e == null ? void 0 : e.nav) == null ? void 0 : l.home, c]), R = i(() => {
664
669
  W.info("handleResetIdleTimer called - resetting idle timer"), q(!1);
665
- }, []), Z = i(() => {
666
- if (y && (d(!0), p(!1), c)) {
670
+ }, []), X = i(() => {
671
+ if (y && (d(!0), f(!1), c)) {
667
672
  const E = `/kos/dispense/${c.path}/ambient/start/`;
668
- $.publish(E, {});
673
+ w.publish(E, {});
669
674
  }
670
675
  }, [y, c]), Y = i(() => {
671
- if (_ && (p(!0), d(!1), c)) {
676
+ if (_ && (f(!0), d(!1), c)) {
672
677
  const E = `/kos/dispense/${c.path}/attract/start/`;
673
- $.publish(E, {});
678
+ w.publish(E, {});
674
679
  }
675
680
  }, [_, c]), me = i(() => {
676
- if (_ && (p(!1), d(!1), e == null || e.nav.home(), c)) {
681
+ if (_ && (f(!1), d(!1), e == null || e.nav.home(), c)) {
677
682
  const E = `/kos/dispense/${c.path}/attract/resume/`;
678
- $.publish(E, {});
683
+ w.publish(E, {});
679
684
  }
680
685
  }, [e == null ? void 0 : e.nav, _, c]), {
681
686
  pause: H,
682
687
  restart: D,
683
- attractTimer: U
688
+ attractTimer: Z
684
689
  } = gt({
685
690
  defaultAmbientTime: y,
686
691
  defaultAttractTime: _,
687
- onAmbientTimer: Z,
692
+ onAmbientTimer: X,
688
693
  onAttractTimer: Y,
689
694
  onResumeAttractTimer: me
690
695
  });
691
- (w = e == null ? void 0 : e.timers) == null || w.add(U);
696
+ ($ = e == null ? void 0 : e.timers) == null || $.add(Z);
692
697
  const [B, q] = x(!1);
693
698
  W.info(
694
699
  "Creating idle timer with timeout:",
695
- T,
700
+ v,
696
701
  "seconds and callback:",
697
702
  !!O
698
703
  );
699
704
  const { pause: I, restart: k, idleTimer: J } = He({
700
- defaultAreYouThereTime: v,
701
- defaultIdleTime: T,
705
+ defaultAreYouThereTime: b,
706
+ defaultIdleTime: v,
702
707
  onIdleTimer: O,
703
708
  onResetIdleTimer: R
704
709
  });
@@ -725,28 +730,28 @@ const It = (e, t) => {
725
730
  if (E) {
726
731
  if (c) {
727
732
  const Te = `/kos/dispense/${c.path}/are-you-there/timeout/`;
728
- $.publish(Te, {});
733
+ w.publish(Te, {});
729
734
  }
730
- q(!0), f ? K() : I();
735
+ q(!0), h ? K() : I();
731
736
  } else
732
737
  switch (o) {
733
738
  case "pause":
734
- f ? K() : I();
739
+ h ? K() : I();
735
740
  break;
736
741
  case "restart":
737
- f ? j() : k();
742
+ h ? j() : k();
738
743
  break;
739
744
  }
740
- }, [s, c, o, f]), he = i(() => {
741
- q(!1), H(), f ? (j(), I()) : (k(), K());
742
- }, [f, I, K, k, j]);
745
+ }, [s, c, o, h]), he = i(() => {
746
+ q(!1), H(), h ? (j(), I()) : (k(), K());
747
+ }, [h, I, K, k, j]);
743
748
  V(() => {
744
749
  J && J.addTimeoutAction({
745
750
  name: "are-you-there-timer",
746
- remainingTime: v,
751
+ remainingTime: b,
747
752
  action: Q
748
753
  });
749
- }, [J, v, Q]), V(() => {
754
+ }, [J, b, Q]), V(() => {
750
755
  F && F.addTimeoutAction({
751
756
  name: "pour-are-you-there-timer",
752
757
  remainingTime: g,
@@ -754,21 +759,21 @@ const It = (e, t) => {
754
759
  });
755
760
  }, [F, g, Q]), (ee = e == null ? void 0 : e.timers) == null || ee.add(J), (xe = e == null ? void 0 : e.timers) == null || xe.add(F);
756
761
  const z = i(() => {
757
- h(!1), K(), I(), H();
762
+ p(!1), K(), I(), H();
758
763
  }, [I, K]), fe = i(() => {
759
- h(!0), W.info("restarting pour timer"), j(), H(), I();
764
+ p(!0), W.info("restarting pour timer"), j(), H(), I();
760
765
  }, [I, j]), pe = i(() => {
761
- h(!1), W.info("restarting pour timer on before pour rejected"), K(), k();
766
+ p(!1), W.info("restarting pour timer on before pour rejected"), K(), k();
762
767
  }, []), be = i(() => {
763
- H(), p(!1), d(!1), k();
768
+ H(), f(!1), d(!1), k();
764
769
  }, [H, k]), ve = i(() => {
765
- p(!1), d(!1), h(!1), K(), D();
770
+ f(!1), d(!1), p(!1), K(), D();
766
771
  }, [D, K]), Ie = i(() => {
767
- p(!1), d(!1), h(!1), H(), k();
772
+ f(!1), d(!1), p(!1), H(), k();
768
773
  }, [H, k]), ae = i(() => {
769
- p(!1), d(!1), h(!1), D(), I(), K();
774
+ f(!1), d(!1), p(!1), D(), I(), K();
770
775
  }, [D, I, K]), oe = i(() => {
771
- p(!1), d(!1), D(), I();
776
+ f(!1), d(!1), D(), I();
772
777
  }, [D, I]);
773
778
  xt({
774
779
  onBrandSelected: be,
@@ -784,20 +789,20 @@ const It = (e, t) => {
784
789
  // component's own timer hooks call those handlers directly. Including them would
785
790
  // create circular event loops.
786
791
  });
787
- const ie = f ? g : v;
792
+ const ie = h ? g : b;
788
793
  return V(() => {
789
- if (c && U) {
794
+ if (c && Z) {
790
795
  const E = `/kos/dispense/${c == null ? void 0 : c.path}/init/`;
791
- $.publish(E, {});
796
+ w.publish(E, {});
792
797
  }
793
- }, [c, U]), {
798
+ }, [c, Z]), {
794
799
  showAreYouThere: B,
795
800
  clearAreYouThere: he,
796
801
  pauseIdleTimer: I,
797
802
  restartIdleTimer: k,
798
803
  areYouThereCountdown: ie,
799
804
  showAmbientScreen: a,
800
- showAttractScreen: b,
805
+ showAttractScreen: T,
801
806
  pauseScreenTimer: H,
802
807
  restartScreenTimer: D
803
808
  };
@@ -847,17 +852,17 @@ const Je = () => {
847
852
  modelType: Se.type,
848
853
  options: {}
849
854
  });
850
- }, $e = P.createLogger({
855
+ }, we = P.createLogger({
851
856
  name: "HoldToPourIntentStrategy",
852
857
  group: "kos-hooks"
853
858
  }), At = {
854
859
  name: "HoldToPourIntentStrategy",
855
860
  async initiate(e, t) {
856
861
  if (!(e != null && e.canPour)) {
857
- $e.debug(`${e == null ? void 0 : e.id} cannot pour. Returning early.`);
862
+ we.debug(`${e == null ? void 0 : e.id} cannot pour. Returning early.`);
858
863
  return;
859
864
  }
860
- t ? ($e.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : $e.debug("no intent provided. Returning early.");
865
+ t ? (we.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : we.debug("no intent provided. Returning early.");
861
866
  },
862
867
  async initiateEnded(e) {
863
868
  await (e == null ? void 0 : e.cancelPour());
@@ -876,10 +881,10 @@ const Je = () => {
876
881
  `[${n == null ? void 0 : n.name}] - Pour initiated for model ${r == null ? void 0 : r.id}.`
877
882
  ), n == null || n.initiate(r), e == null || e();
878
883
  }, [e, r, n]), o = i(() => {
879
- var b;
884
+ var T;
880
885
  ge.debug(
881
886
  `[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${r == null ? void 0 : r.id}.`
882
- ), (b = n == null ? void 0 : n.initiateEnded) == null || b.call(n, r), t == null || t();
887
+ ), (T = n == null ? void 0 : n.initiateEnded) == null || T.call(n, r), t == null || t();
883
888
  }, [t, r, n]), a = i(() => {
884
889
  ge.debug(`Force cancelling pour for nozzle ${r == null ? void 0 : r.id}.`), r == null || r.cancelPour(), t == null || t();
885
890
  }, [t, r]);
@@ -912,7 +917,7 @@ function Qt(e) {
912
917
  return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredientContainer: r }) });
913
918
  };
914
919
  }
915
- function Xt(e, t) {
920
+ function Ut(e, t) {
916
921
  return (r) => {
917
922
  const { model: n, status: s, KosModelLoader: o } = Ye(e);
918
923
  return /* @__PURE__ */ m(o, { ...s, children: /* @__PURE__ */ m(t, { ...r, nozzle: n }) });
@@ -921,7 +926,7 @@ function Xt(e, t) {
921
926
  const re = P.createLogger({
922
927
  name: "usePour",
923
928
  group: "kos-hooks"
924
- }), Zt = ({
929
+ }), Xt = ({
925
930
  onBeforePour: e,
926
931
  onPour: t,
927
932
  onPourCancel: r,
@@ -930,9 +935,9 @@ const re = P.createLogger({
930
935
  pourContext: o,
931
936
  strategy: a = Ve
932
937
  }) => {
933
- const [d, b] = x(
938
+ const [d, T] = x(
934
939
  o || new Ge()
935
- ), p = i(async () => {
940
+ ), f = i(async () => {
936
941
  re.debug(
937
942
  `[${a == null ? void 0 : a.name}] - calling before pour for pour target ${s == null ? void 0 : s.id}.`
938
943
  ), (e ? await (e == null ? void 0 : e(d)) : !0) ? (re.debug(
@@ -945,14 +950,14 @@ const re = P.createLogger({
945
950
  re.debug(
946
951
  `[${a == null ? void 0 : a.name}] - Pour initiate ended called for pour target ${s == null ? void 0 : s.id}.`
947
952
  ), await ((g = a == null ? void 0 : a.initiateEnded) == null ? void 0 : g.call(a, s)) || r == null || r();
948
- }, [r, s, a]), f = i(async () => {
953
+ }, [r, s, a]), h = i(async () => {
949
954
  re.debug(`Force cancelling pour for pour target ${s == null ? void 0 : s.id}.`), await (s == null ? void 0 : s.cancelPour()), r == null || r();
950
- }, [r, s]), h = i(
955
+ }, [r, s]), p = i(
951
956
  (u, g) => {
952
957
  d.set(u, g);
953
958
  },
954
959
  [d]
955
- ), T = i(
960
+ ), v = i(
956
961
  (u) => {
957
962
  d.remove(u);
958
963
  },
@@ -960,24 +965,24 @@ const re = P.createLogger({
960
965
  );
961
966
  return {
962
967
  handlers: Pe({
963
- onPressed: p,
968
+ onPressed: f,
964
969
  onRelease: c
965
970
  }).dom,
966
- cancel: f,
967
- updatePourContext: h,
968
- removeFromPourContext: T,
971
+ cancel: h,
972
+ updatePourContext: p,
973
+ removeFromPourContext: v,
969
974
  status: s
970
975
  };
971
976
  }, ne = P.createLogger({
972
977
  name: "TapOrHoldIntentStrategy",
973
978
  group: "kos-hooks"
974
979
  });
975
- class Ut {
980
+ class Zt {
976
981
  constructor(t) {
977
- X(this, "intent");
978
- X(this, "name", "TapOrHoldIntentStrategy");
979
- X(this, "isHold", !1);
980
- X(this, "disposer", null);
982
+ U(this, "intent");
983
+ U(this, "name", "TapOrHoldIntentStrategy");
984
+ U(this, "isHold", !1);
985
+ U(this, "disposer", null);
981
986
  this.intent = t;
982
987
  }
983
988
  async initiate(t, r) {
@@ -1055,33 +1060,33 @@ function ts(e) {
1055
1060
  return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, genericPour: r }) });
1056
1061
  };
1057
1062
  }
1058
- const Xe = N(void 0), ss = ({ children: e }) => {
1063
+ const Ue = N(void 0), ss = ({ children: e }) => {
1059
1064
  const { model: t, ready: r } = Le(), n = A(() => r && t ? { model: t } : {}, [r, t]);
1060
- return /* @__PURE__ */ m(Xe.Provider, { value: n, children: e });
1065
+ return /* @__PURE__ */ m(Ue.Provider, { value: n, children: e });
1061
1066
  }, rs = () => {
1062
1067
  const e = S(
1063
- Xe
1068
+ Ue
1064
1069
  );
1065
1070
  if (!e)
1066
1071
  throw new Error(
1067
1072
  "useAssemblyContext must be used within a AssemblyProvider"
1068
1073
  );
1069
1074
  return e;
1070
- }, Ze = N(void 0), ns = ({ children: e }) => {
1075
+ }, Xe = N(void 0), ns = ({ children: e }) => {
1071
1076
  const { model: t, ready: r } = Me(), n = A(() => r && t ? { model: t } : {}, [r, t]);
1072
- return /* @__PURE__ */ m(Ze.Provider, { value: n, children: e });
1077
+ return /* @__PURE__ */ m(Xe.Provider, { value: n, children: e });
1073
1078
  }, as = () => {
1074
- const e = S(Ze);
1079
+ const e = S(Xe);
1075
1080
  if (!e)
1076
1081
  throw new Error(
1077
1082
  "useAvailabilityContext must be used within a AvailabilityProvider"
1078
1083
  );
1079
1084
  return e;
1080
- }, Ue = N(void 0), os = ({ children: e, id: t }) => {
1085
+ }, Ze = N(void 0), os = ({ children: e, id: t }) => {
1081
1086
  const { model: r, ready: n } = _e(t), s = A(() => n && r ? { model: r } : {}, [n, r]);
1082
- return /* @__PURE__ */ m(Ue.Provider, { value: s, children: e });
1087
+ return /* @__PURE__ */ m(Ze.Provider, { value: s, children: e });
1083
1088
  }, is = () => {
1084
- const e = S(Ue);
1089
+ const e = S(Ze);
1085
1090
  if (!e)
1086
1091
  throw new Error("useBoardContext must be used within a BoardProvider");
1087
1092
  return e;
@@ -1129,7 +1134,7 @@ function St({
1129
1134
  props: r,
1130
1135
  nozzleProps: n
1131
1136
  }) {
1132
- const s = $t(r);
1137
+ const s = wt(r);
1133
1138
  return /* @__PURE__ */ m(t, { value: s, children: e(n || {}) });
1134
1139
  }
1135
1140
  function kt({
@@ -1223,7 +1228,7 @@ const tt = N(void 0), ls = ({ children: e, id: t }) => {
1223
1228
  modelType: Ne.type,
1224
1229
  options: {}
1225
1230
  });
1226
- }, at = N(void 0), $s = ({ children: e }) => {
1231
+ }, at = N(void 0), ws = ({ children: e }) => {
1227
1232
  const { model: t, ready: r } = Ht(), n = A(() => r && t ? { model: t } : {}, [r, t]);
1228
1233
  return /* @__PURE__ */ m(at.Provider, { value: n, children: e });
1229
1234
  }, gs = () => {
@@ -1244,12 +1249,12 @@ export {
1244
1249
  ls as H,
1245
1250
  ps as I,
1246
1251
  se as J,
1247
- $t as K,
1252
+ wt as K,
1248
1253
  Gt as L,
1249
1254
  xt as M,
1250
1255
  ht as N,
1251
1256
  He as O,
1252
- $s as P,
1257
+ ws as P,
1253
1258
  Tt as Q,
1254
1259
  je as R,
1255
1260
  Vt as S,
@@ -1263,12 +1268,12 @@ export {
1263
1268
  Qe as _,
1264
1269
  ns as a,
1265
1270
  Ye as a0,
1266
- Xt as a1,
1271
+ Ut as a1,
1267
1272
  vt as a2,
1268
- Zt as a3,
1273
+ Xt as a3,
1269
1274
  At as a4,
1270
1275
  Ve as a5,
1271
- Ut as a6,
1276
+ Zt as a6,
1272
1277
  zt as a7,
1273
1278
  es as a8,
1274
1279
  Kt as a9,
@@ -1300,4 +1305,4 @@ export {
1300
1305
  Ft as y,
1301
1306
  ft as z
1302
1307
  };
1303
- //# sourceMappingURL=pump-provider-B5htndvr.js.map
1308
+ //# sourceMappingURL=pump-provider-Dhh0rg1k.js.map