@kosdev-code/kos-dispense-sdk 0.1.0-dev.5140 → 0.1.0-dev.5143
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/{dispense-registration-manager-DEyW37S3.cjs → dispense-registration-manager-BkJ1ggtS.cjs} +2 -2
- package/{dispense-registration-manager-DEyW37S3.cjs.map → dispense-registration-manager-BkJ1ggtS.cjs.map} +1 -1
- package/{dispense-registration-manager-C36ULeOU.js → dispense-registration-manager-CcFUS_KM.js} +72 -69
- package/{dispense-registration-manager-C36ULeOU.js.map → dispense-registration-manager-CcFUS_KM.js.map} +1 -1
- package/{extension-utils-C3CjcNm5.cjs → extension-utils-DUV7OQR1.cjs} +2 -2
- package/{extension-utils-C3CjcNm5.cjs.map → extension-utils-DUV7OQR1.cjs.map} +1 -1
- package/{extension-utils-dTIk56MQ.js → extension-utils-DeLiIgFH.js} +2 -2
- package/{extension-utils-dTIk56MQ.js.map → extension-utils-DeLiIgFH.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.js +112 -113
- package/index.js.map +1 -1
- package/models/models/generic-pour/generic-pour-model.d.ts +2 -1
- package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
- package/models/models/generic-pour/types/index.d.ts +1 -0
- package/models/models/nozzle/index.d.ts +1 -1
- package/models/models/nozzle/index.d.ts.map +1 -1
- package/models/models/nozzle/nozzle-model.d.ts +2 -2
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models/models/nozzle/types/index.d.ts +8 -0
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +4 -4
- package/pump-provider-BMh5OGDU.cjs +2 -0
- package/pump-provider-BMh5OGDU.cjs.map +1 -0
- package/{pump-provider-BXvrC3jL.js → pump-provider-DErNNCPW.js} +260 -260
- package/pump-provider-DErNNCPW.js.map +1 -0
- package/ui/hooks/generic-pour/use-generic-pour.d.ts +2 -2
- package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
- package/ui/hooks/pour/use-pour.d.ts +2 -1
- package/ui/hooks/pour/use-pour.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +2 -9
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +67 -68
- package/ui.js.map +1 -1
- package/pump-provider-BXvrC3jL.js.map +0 -1
- package/pump-provider-Bp45210p.cjs +0 -2
- package/pump-provider-Bp45210p.cjs.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ot = (e, t, s) => t in e ?
|
|
1
|
+
var it = Object.defineProperty;
|
|
2
|
+
var ot = (e, t, s) => t in e ? it(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var J = (e, t, s) => (ot(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
4
|
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
5
|
-
import { GenericPour as ct } from "@kosdev-code/kos-dispense-sdk";
|
|
6
5
|
import { useKosModel as S, getKosCompanionModel as we, kosAutoEffect as Be, KosLog as T, usePressGesture as Te, EventBus as g, TimerManager as ye } from "@kosdev-code/kos-ui-sdk";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
6
|
+
import { A as Ae, b as ke, e as ct, d as Ee, N as dt, f as Ce, H as ut, j as Se, I as Ne, k as He, G as lt, P as Ke } from "./dispense-registration-manager-CcFUS_KM.js";
|
|
7
|
+
import mt, { createContext as L, useMemo as A, useContext as N, useState as x, useCallback as c, useEffect as F, useRef as de } from "react";
|
|
9
8
|
const De = () => {
|
|
10
9
|
const e = Ae.type;
|
|
11
10
|
return S({
|
|
@@ -14,7 +13,7 @@ const De = () => {
|
|
|
14
13
|
options: {}
|
|
15
14
|
});
|
|
16
15
|
};
|
|
17
|
-
function
|
|
16
|
+
function Dt(e) {
|
|
18
17
|
return (t) => {
|
|
19
18
|
const { model: s, status: n, KosModelLoader: r } = De();
|
|
20
19
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, assembly: s }) });
|
|
@@ -28,7 +27,7 @@ const Me = () => {
|
|
|
28
27
|
options: {}
|
|
29
28
|
});
|
|
30
29
|
};
|
|
31
|
-
function
|
|
30
|
+
function Mt(e) {
|
|
32
31
|
return (t) => {
|
|
33
32
|
const { model: s, status: n, KosModelLoader: r } = Me();
|
|
34
33
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, beverage: s }) });
|
|
@@ -36,13 +35,13 @@ function _t(e) {
|
|
|
36
35
|
}
|
|
37
36
|
const _e = (e) => S({
|
|
38
37
|
modelId: e,
|
|
39
|
-
modelType:
|
|
38
|
+
modelType: ct.type,
|
|
40
39
|
options: {}
|
|
41
40
|
});
|
|
42
|
-
function
|
|
41
|
+
function _t(e) {
|
|
43
42
|
return (t) => (s) => {
|
|
44
|
-
const { model: n, status: r, KosModelLoader:
|
|
45
|
-
return /* @__PURE__ */ m(
|
|
43
|
+
const { model: n, status: r, KosModelLoader: i } = _e(t);
|
|
44
|
+
return /* @__PURE__ */ m(i, { ...r, children: /* @__PURE__ */ m(e, { ...s, board: n }) });
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
const Oe = () => {
|
|
@@ -53,7 +52,7 @@ const Oe = () => {
|
|
|
53
52
|
options: {}
|
|
54
53
|
});
|
|
55
54
|
};
|
|
56
|
-
function
|
|
55
|
+
function Ot(e) {
|
|
57
56
|
return (t) => {
|
|
58
57
|
const { model: s, status: n, KosModelLoader: r } = Oe();
|
|
59
58
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, boardContainer: s }) });
|
|
@@ -61,11 +60,11 @@ function Yt(e) {
|
|
|
61
60
|
}
|
|
62
61
|
const Ye = (e) => S({
|
|
63
62
|
modelId: e,
|
|
64
|
-
modelType:
|
|
63
|
+
modelType: dt.type,
|
|
65
64
|
options: {
|
|
66
65
|
path: e
|
|
67
66
|
}
|
|
68
|
-
}), Fe = L(void 0),
|
|
67
|
+
}), Fe = L(void 0), ht = ({ children: e, path: t }) => {
|
|
69
68
|
const { model: s, ready: n } = Ye(t), r = A(() => n && s ? { model: s } : {}, [n, s]);
|
|
70
69
|
return /* @__PURE__ */ m(Fe.Provider, { value: r, children: e });
|
|
71
70
|
}, _ = () => {
|
|
@@ -73,12 +72,12 @@ const Ye = (e) => S({
|
|
|
73
72
|
if (!e)
|
|
74
73
|
throw new Error("useNozzleContext must be used within a NozzleProvider");
|
|
75
74
|
return e;
|
|
76
|
-
},
|
|
75
|
+
}, pt = ({
|
|
77
76
|
onBeverageSelected: e,
|
|
78
77
|
onClearBeverage: t,
|
|
79
78
|
companionType: s
|
|
80
79
|
}) => {
|
|
81
|
-
const { model: n } = _(), [r,
|
|
80
|
+
const { model: n } = _(), [r, i] = x([]), [a, d] = x(null), v = A(() => s ? r.map(
|
|
82
81
|
(l) => we(l, s)
|
|
83
82
|
) : [], [r, s]), f = c(
|
|
84
83
|
async (l) => {
|
|
@@ -94,12 +93,12 @@ const Ye = (e) => S({
|
|
|
94
93
|
return;
|
|
95
94
|
const $ = n.selectedBrand;
|
|
96
95
|
if (!$) {
|
|
97
|
-
const b = n.getGroupAvailabilityItems("beverages").filter((
|
|
98
|
-
|
|
96
|
+
const b = n.getGroupAvailabilityItems("beverages").filter((h) => h.visible);
|
|
97
|
+
i(b ?? []);
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
100
|
const w = n.getAvailabilityByParent($.id).filter((b) => b.visible);
|
|
102
|
-
|
|
101
|
+
i(w ?? []);
|
|
103
102
|
});
|
|
104
103
|
return () => {
|
|
105
104
|
l();
|
|
@@ -108,7 +107,7 @@ const Ye = (e) => S({
|
|
|
108
107
|
beverages: r,
|
|
109
108
|
beverageCompanions: v,
|
|
110
109
|
selectBeverage: f,
|
|
111
|
-
selectedBeverage:
|
|
110
|
+
selectedBeverage: a,
|
|
112
111
|
clearBeverage: u
|
|
113
112
|
};
|
|
114
113
|
}, ft = ({
|
|
@@ -116,13 +115,13 @@ const Ye = (e) => S({
|
|
|
116
115
|
onBrandCleared: t,
|
|
117
116
|
companionType: s
|
|
118
117
|
}) => {
|
|
119
|
-
const { model: n } = _(), [r,
|
|
118
|
+
const { model: n } = _(), [r, i] = x(null), [a, d] = x([]), v = A(() => s ? a.map((l) => we(l, s)) : [], [a, s]), f = c(
|
|
120
119
|
async (l) => {
|
|
121
|
-
|
|
120
|
+
i(l), n == null || n.setSelectedBrand(l), e == null || e(l);
|
|
122
121
|
},
|
|
123
122
|
[n, e]
|
|
124
123
|
), u = c(() => {
|
|
125
|
-
|
|
124
|
+
i(null), n == null || n.setSelectedBrand(void 0), t == null || t();
|
|
126
125
|
}, [n, t]);
|
|
127
126
|
return F(() => {
|
|
128
127
|
const l = Be(() => {
|
|
@@ -132,14 +131,14 @@ const Ye = (e) => S({
|
|
|
132
131
|
l();
|
|
133
132
|
};
|
|
134
133
|
}, [n]), {
|
|
135
|
-
brands:
|
|
134
|
+
brands: a,
|
|
136
135
|
brandCompanions: v,
|
|
137
136
|
selectedBrand: r,
|
|
138
137
|
selectBrand: f,
|
|
139
138
|
clearBrand: u
|
|
140
139
|
};
|
|
141
140
|
};
|
|
142
|
-
class
|
|
141
|
+
class Ge {
|
|
143
142
|
constructor() {
|
|
144
143
|
J(this, "_data", /* @__PURE__ */ new Map());
|
|
145
144
|
}
|
|
@@ -159,7 +158,7 @@ class Ue {
|
|
|
159
158
|
const bt = T.createLogger({
|
|
160
159
|
name: "HoldToPourStrategy",
|
|
161
160
|
group: "kos-hooks"
|
|
162
|
-
}),
|
|
161
|
+
}), Ue = {
|
|
163
162
|
name: "HoldToPourStrategy",
|
|
164
163
|
async initiate(e) {
|
|
165
164
|
if (!(e != null && e.canPour)) {
|
|
@@ -171,7 +170,7 @@ const bt = T.createLogger({
|
|
|
171
170
|
async initiateEnded(e) {
|
|
172
171
|
await (e == null ? void 0 : e.cancelPour());
|
|
173
172
|
}
|
|
174
|
-
},
|
|
173
|
+
}, ie = T.createLogger({
|
|
175
174
|
name: "useNozzlePour",
|
|
176
175
|
group: "kos-hooks"
|
|
177
176
|
}), vt = ({
|
|
@@ -180,39 +179,39 @@ const bt = T.createLogger({
|
|
|
180
179
|
onBeforePour: s,
|
|
181
180
|
onBeforePourRejected: n,
|
|
182
181
|
pourContext: r,
|
|
183
|
-
strategy:
|
|
182
|
+
strategy: i = Ue
|
|
184
183
|
}) => {
|
|
185
|
-
const { model:
|
|
186
|
-
r || new
|
|
184
|
+
const { model: a } = _(), [d, v] = x(
|
|
185
|
+
r || new Ge()
|
|
187
186
|
), f = c(async () => {
|
|
188
|
-
(s ? await (s == null ? void 0 : s(d)) : !0) ? (
|
|
189
|
-
`[${
|
|
190
|
-
),
|
|
191
|
-
`[${
|
|
187
|
+
(s ? await (s == null ? void 0 : s(d)) : !0) ? (ie.debug(
|
|
188
|
+
`[${i == null ? void 0 : i.name}] - Pour initiated for nozzle ${a == null ? void 0 : a.id}.`
|
|
189
|
+
), i == null || i.initiate(a), e == null || e()) : (ie.debug(
|
|
190
|
+
`[${i == null ? void 0 : i.name}] - Did not pass onBeforePour gate for nozzle ${a == null ? void 0 : a.id}. Cancelling pour.`
|
|
192
191
|
), n == null || n());
|
|
193
192
|
}, [
|
|
194
193
|
e,
|
|
195
|
-
i,
|
|
196
194
|
a,
|
|
195
|
+
i,
|
|
197
196
|
s,
|
|
198
197
|
t,
|
|
199
198
|
d,
|
|
200
199
|
n
|
|
201
200
|
]), u = c(() => {
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
`[${
|
|
205
|
-
), (
|
|
206
|
-
}, [t,
|
|
207
|
-
|
|
208
|
-
}, [t,
|
|
209
|
-
(
|
|
210
|
-
d.set(
|
|
201
|
+
var h;
|
|
202
|
+
ie.debug(
|
|
203
|
+
`[${i == null ? void 0 : i.name}] - Pour initiate ended called for nozzle ${a == null ? void 0 : a.id}.`
|
|
204
|
+
), (h = i == null ? void 0 : i.initiateEnded) == null || h.call(i, a), t == null || t();
|
|
205
|
+
}, [t, a, i]), l = c(() => {
|
|
206
|
+
ie.debug(`Force cancelling pour for nozzle ${a == null ? void 0 : a.id}.`), a == null || a.cancelPour(), t == null || t();
|
|
207
|
+
}, [t, a]), $ = c(
|
|
208
|
+
(h, o) => {
|
|
209
|
+
d.set(h, o);
|
|
211
210
|
},
|
|
212
211
|
[d]
|
|
213
212
|
), w = c(
|
|
214
|
-
(
|
|
215
|
-
d.remove(
|
|
213
|
+
(h) => {
|
|
214
|
+
d.remove(h);
|
|
216
215
|
},
|
|
217
216
|
[d]
|
|
218
217
|
);
|
|
@@ -224,7 +223,7 @@ const bt = T.createLogger({
|
|
|
224
223
|
cancel: l,
|
|
225
224
|
updatePourContext: $,
|
|
226
225
|
removeFromPourContext: w,
|
|
227
|
-
status:
|
|
226
|
+
status: a
|
|
228
227
|
};
|
|
229
228
|
}, $t = ({
|
|
230
229
|
onFlavorSelected: e,
|
|
@@ -234,9 +233,9 @@ const bt = T.createLogger({
|
|
|
234
233
|
const { model: n } = _(), r = A(
|
|
235
234
|
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((u) => u.visible)) ?? [],
|
|
236
235
|
[n]
|
|
237
|
-
),
|
|
236
|
+
), i = A(() => s ? r.map(
|
|
238
237
|
(u) => we(u, s)
|
|
239
|
-
) : [], [r, s]), [
|
|
238
|
+
) : [], [r, s]), [a, d] = x([]), v = c(
|
|
240
239
|
async (u) => {
|
|
241
240
|
if (d(
|
|
242
241
|
(l) => l != null && l.includes(u) ? [...l.filter(($) => $ !== u)] : [...l ?? [], u]
|
|
@@ -244,12 +243,12 @@ const bt = T.createLogger({
|
|
|
244
243
|
const { beverage: l } = n.selectedPourable;
|
|
245
244
|
await n.setSelectedPourable({
|
|
246
245
|
beverage: l,
|
|
247
|
-
additional:
|
|
246
|
+
additional: a ?? []
|
|
248
247
|
});
|
|
249
248
|
}
|
|
250
|
-
e == null || e(u,
|
|
249
|
+
e == null || e(u, a ?? []);
|
|
251
250
|
},
|
|
252
|
-
[n, e,
|
|
251
|
+
[n, e, a]
|
|
253
252
|
), f = c(async () => {
|
|
254
253
|
if (d([]), n != null && n.selectedPourable) {
|
|
255
254
|
const { beverage: u } = n.selectedPourable;
|
|
@@ -258,62 +257,62 @@ const bt = T.createLogger({
|
|
|
258
257
|
}, [n, t]);
|
|
259
258
|
return {
|
|
260
259
|
flavors: r,
|
|
261
|
-
flavorCompanions:
|
|
260
|
+
flavorCompanions: i,
|
|
262
261
|
selectFlavor: v,
|
|
263
|
-
selectedFlavors:
|
|
262
|
+
selectedFlavors: a,
|
|
264
263
|
clearFlavors: f
|
|
265
264
|
};
|
|
266
265
|
}, z = "brands", oe = "beverages", ee = "flavors", Y = T.createLogger({ name: "use-cui-kit" }), gt = ({
|
|
267
266
|
initialGroup: e = z,
|
|
268
267
|
options: t = {}
|
|
269
268
|
}) => {
|
|
270
|
-
var re, ne,
|
|
271
|
-
const [s, n] = x(e), { model: r } = _(),
|
|
272
|
-
(
|
|
269
|
+
var re, ne, ae;
|
|
270
|
+
const [s, n] = x(e), { model: r } = _(), i = de([]), a = de(), d = de(), v = c(
|
|
271
|
+
(p) => {
|
|
273
272
|
n(ee);
|
|
274
273
|
const I = `/kos/dispense/${r == null ? void 0 : r.path}/brand/selected/`;
|
|
275
|
-
g.publish(I,
|
|
274
|
+
g.publish(I, p);
|
|
276
275
|
},
|
|
277
276
|
[r == null ? void 0 : r.path]
|
|
278
277
|
), f = c(() => {
|
|
279
|
-
const
|
|
280
|
-
g.publish(
|
|
278
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/brand/cleared/`;
|
|
279
|
+
g.publish(p, {});
|
|
281
280
|
}, [r == null ? void 0 : r.path]), u = c(
|
|
282
|
-
(
|
|
281
|
+
(p) => {
|
|
283
282
|
var Z;
|
|
284
|
-
n(ee), (Z =
|
|
283
|
+
n(ee), (Z = a.current) == null || Z.call(a, "selectedBeverage", p);
|
|
285
284
|
const I = `/kos/dispense/${r == null ? void 0 : r.path}/beverage/selected/`;
|
|
286
|
-
g.publish(I,
|
|
285
|
+
g.publish(I, p);
|
|
287
286
|
},
|
|
288
287
|
[r == null ? void 0 : r.path]
|
|
289
288
|
), l = c(() => {
|
|
290
289
|
var I;
|
|
291
|
-
const
|
|
292
|
-
(I = d.current) == null || I.call(d, "selectedBeverage"), g.publish(
|
|
290
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/beverage/cleared/`;
|
|
291
|
+
(I = d.current) == null || I.call(d, "selectedBeverage"), g.publish(p, {});
|
|
293
292
|
}, [r == null ? void 0 : r.path]), $ = c(
|
|
294
|
-
(
|
|
293
|
+
(p) => {
|
|
295
294
|
const I = `/kos/dispense/${r == null ? void 0 : r.path}/flavor/selected/`;
|
|
296
|
-
g.publish(I,
|
|
295
|
+
g.publish(I, p);
|
|
297
296
|
},
|
|
298
297
|
[r == null ? void 0 : r.path]
|
|
299
298
|
), w = c(() => {
|
|
300
|
-
const
|
|
301
|
-
g.publish(
|
|
299
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/flavor/cleared/`;
|
|
300
|
+
g.publish(p, {});
|
|
302
301
|
}, [r == null ? void 0 : r.path]), b = c(() => {
|
|
303
|
-
const
|
|
304
|
-
g.publish(
|
|
305
|
-
}, [r == null ? void 0 : r.path]),
|
|
306
|
-
async (
|
|
302
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/pour/`;
|
|
303
|
+
g.publish(p, {});
|
|
304
|
+
}, [r == null ? void 0 : r.path]), h = c(
|
|
305
|
+
async (p) => {
|
|
307
306
|
const I = `/kos/dispense/${r == null ? void 0 : r.path}/pre/pour/`;
|
|
308
|
-
return g.publish(I, {}), await (D == null ? void 0 : D(
|
|
307
|
+
return g.publish(I, {}), await (D == null ? void 0 : D(p)) || !0;
|
|
309
308
|
},
|
|
310
309
|
[r == null ? void 0 : r.path]
|
|
311
310
|
), o = c(async () => {
|
|
312
|
-
const
|
|
313
|
-
g.publish(
|
|
314
|
-
}, [r == null ? void 0 : r.path]),
|
|
315
|
-
const
|
|
316
|
-
g.publish(
|
|
311
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/pre/pour/rejected/`;
|
|
312
|
+
g.publish(p, {});
|
|
313
|
+
}, [r == null ? void 0 : r.path]), U = c(() => {
|
|
314
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/pour/cancel/`;
|
|
315
|
+
g.publish(p, {});
|
|
317
316
|
}, [r == null ? void 0 : r.path]), { brands: B, selectBrand: C, selectedBrand: Q, clearBrand: O, brandCompanions: ue } = ft({
|
|
318
317
|
companionType: (re = t.companionTypes) == null ? void 0 : re.brand,
|
|
319
318
|
onBrandSelected: v,
|
|
@@ -324,7 +323,7 @@ const bt = T.createLogger({
|
|
|
324
323
|
selectedBeverage: y,
|
|
325
324
|
clearBeverage: H,
|
|
326
325
|
beverageCompanions: me
|
|
327
|
-
} =
|
|
326
|
+
} = pt({
|
|
328
327
|
companionType: (ne = t.companionTypes) == null ? void 0 : ne.beverage,
|
|
329
328
|
onBeverageSelected: u,
|
|
330
329
|
onClearBeverage: l
|
|
@@ -335,19 +334,19 @@ const bt = T.createLogger({
|
|
|
335
334
|
selectedFlavors: V,
|
|
336
335
|
flavorCompanions: k
|
|
337
336
|
} = $t({
|
|
338
|
-
companionType: (
|
|
337
|
+
companionType: (ae = t.companionTypes) == null ? void 0 : ae.flavor,
|
|
339
338
|
onFlavorSelected: $,
|
|
340
339
|
onFlavorCleared: w
|
|
341
|
-
}), [D, W] = x(), q = c((
|
|
342
|
-
W(() =>
|
|
340
|
+
}), [D, W] = x(), q = c((p) => {
|
|
341
|
+
W(() => p);
|
|
343
342
|
}, []), X = vt({
|
|
344
343
|
onPour: b,
|
|
345
|
-
onPourCancel:
|
|
346
|
-
onBeforePour:
|
|
344
|
+
onPourCancel: U,
|
|
345
|
+
onBeforePour: h,
|
|
347
346
|
onBeforePourRejected: o
|
|
348
347
|
});
|
|
349
|
-
|
|
350
|
-
const
|
|
348
|
+
a.current = X.updatePourContext, d.current = X.removeFromPourContext;
|
|
349
|
+
const he = c(() => {
|
|
351
350
|
switch (Y.debug(`Navigating back from group: ${s}`), s) {
|
|
352
351
|
case z:
|
|
353
352
|
H(), O();
|
|
@@ -357,35 +356,35 @@ const bt = T.createLogger({
|
|
|
357
356
|
n(e), H(), O();
|
|
358
357
|
break;
|
|
359
358
|
}
|
|
360
|
-
}, [H, O, s, e]),
|
|
361
|
-
const
|
|
362
|
-
g.publish(
|
|
359
|
+
}, [H, O, s, e]), pe = c(() => {
|
|
360
|
+
const p = `/kos/dispense/${r == null ? void 0 : r.path}/home/`;
|
|
361
|
+
g.publish(p, {}), n(e), e === z && (H(), O()), e === oe && H();
|
|
363
362
|
}, [H, O, e]), fe = c(() => {
|
|
364
|
-
if (
|
|
363
|
+
if (i.current.length === 0) {
|
|
365
364
|
Y.debug("No timers to pause.");
|
|
366
365
|
return;
|
|
367
366
|
}
|
|
368
|
-
Y.debug(`Pausing ${
|
|
369
|
-
Y.debug(`Pausing timer with id ${
|
|
367
|
+
Y.debug(`Pausing ${i.current.length} timers.`), i.current.forEach((p) => {
|
|
368
|
+
Y.debug(`Pausing timer with id ${p.id}.`), p.pause();
|
|
370
369
|
});
|
|
371
370
|
}, []), be = c(() => {
|
|
372
|
-
if (
|
|
371
|
+
if (i.current.length === 0) {
|
|
373
372
|
Y.debug("No timers to restart.");
|
|
374
373
|
return;
|
|
375
374
|
}
|
|
376
|
-
Y.debug(`Restarting ${
|
|
377
|
-
Y.debug(`Restarting timer with id ${
|
|
375
|
+
Y.debug(`Restarting ${i.current.length} timers.`), i.current.forEach((p) => {
|
|
376
|
+
Y.debug(`Restarting timer with id ${p.id}.`), p.restart();
|
|
378
377
|
});
|
|
379
378
|
}, []);
|
|
380
379
|
return {
|
|
381
380
|
timers: {
|
|
382
|
-
add: c((
|
|
383
|
-
if (
|
|
384
|
-
if (
|
|
385
|
-
Y.debug(`Timer with id ${
|
|
381
|
+
add: c((p) => {
|
|
382
|
+
if (p) {
|
|
383
|
+
if (i.current.some((I) => I.id === p.id)) {
|
|
384
|
+
Y.debug(`Timer with id ${p.id} already exists.`);
|
|
386
385
|
return;
|
|
387
386
|
}
|
|
388
|
-
|
|
387
|
+
i.current.push(p);
|
|
389
388
|
}
|
|
390
389
|
}, []),
|
|
391
390
|
pause: fe,
|
|
@@ -393,8 +392,8 @@ const bt = T.createLogger({
|
|
|
393
392
|
},
|
|
394
393
|
nav: {
|
|
395
394
|
currentGroup: s,
|
|
396
|
-
back:
|
|
397
|
-
home:
|
|
395
|
+
back: he,
|
|
396
|
+
home: pe
|
|
398
397
|
},
|
|
399
398
|
pour: X,
|
|
400
399
|
updateOnBeforePour: q,
|
|
@@ -431,39 +430,39 @@ const bt = T.createLogger({
|
|
|
431
430
|
}, wt = (e) => {
|
|
432
431
|
const { model: t } = _(), [s, n] = x(null), {
|
|
433
432
|
onAmbientTimer: r,
|
|
434
|
-
onAttractTimer:
|
|
435
|
-
onResetAttractTimer:
|
|
433
|
+
onAttractTimer: i,
|
|
434
|
+
onResetAttractTimer: a,
|
|
436
435
|
onResumeAttractTimer: d,
|
|
437
436
|
defaultAttractTime: v,
|
|
438
437
|
defaultAmbientTime: f
|
|
439
438
|
} = e, u = c(() => {
|
|
440
439
|
r && (T.info("Ambient timer expired. Calling callback"), r == null || r());
|
|
441
440
|
}, [r]), l = c(() => {
|
|
442
|
-
|
|
443
|
-
}, [
|
|
444
|
-
s && (s.restart(),
|
|
445
|
-
}, [s,
|
|
446
|
-
s && (s.reset(),
|
|
447
|
-
}, [s,
|
|
441
|
+
i && (T.info("Attract timer expired. Calling callback"), i == null || i());
|
|
442
|
+
}, [i]), $ = c(() => {
|
|
443
|
+
s && (s.restart(), a == null || a());
|
|
444
|
+
}, [s, a]), w = c(() => {
|
|
445
|
+
s && (s.reset(), a == null || a());
|
|
446
|
+
}, [s, a]), b = c(() => {
|
|
448
447
|
s && (s.pause(), d == null || d());
|
|
449
448
|
}, [s, d]);
|
|
450
449
|
return F(() => {
|
|
451
450
|
if (t && v) {
|
|
452
451
|
T.info("Nozzle is available. Creating timers");
|
|
453
|
-
const
|
|
452
|
+
const h = ye.createTimer(
|
|
454
453
|
"attract-timer-" + t.path,
|
|
455
454
|
v
|
|
456
455
|
);
|
|
457
|
-
return v && (
|
|
456
|
+
return v && (h == null || h.addTimeoutAction({
|
|
458
457
|
name: "attract-timer",
|
|
459
458
|
remainingTime: 0,
|
|
460
459
|
action: l
|
|
461
|
-
})), f && (
|
|
460
|
+
})), f && (h == null || h.addTimeoutAction({
|
|
462
461
|
name: "ambient-timer",
|
|
463
462
|
remainingTime: f,
|
|
464
463
|
action: u
|
|
465
|
-
})), v && (
|
|
466
|
-
|
|
464
|
+
})), v && (h == null || h.start()), n(h ?? null), () => {
|
|
465
|
+
h == null || h.reset(), n(null);
|
|
467
466
|
};
|
|
468
467
|
}
|
|
469
468
|
return () => {
|
|
@@ -490,8 +489,8 @@ const bt = T.createLogger({
|
|
|
490
489
|
onBrandCleared: s,
|
|
491
490
|
onBeverageCleared: n,
|
|
492
491
|
onBeverageSelected: r,
|
|
493
|
-
onFlavorCleared:
|
|
494
|
-
onFlavorSelected:
|
|
492
|
+
onFlavorCleared: i,
|
|
493
|
+
onFlavorSelected: a,
|
|
495
494
|
onReturnToHome: d,
|
|
496
495
|
onPour: v,
|
|
497
496
|
onPourCancel: f,
|
|
@@ -500,7 +499,7 @@ const bt = T.createLogger({
|
|
|
500
499
|
onAttractTimer: $,
|
|
501
500
|
onResumeAttractTimer: w,
|
|
502
501
|
onIdleTimeout: b,
|
|
503
|
-
onAreYouThereTimeout:
|
|
502
|
+
onAreYouThereTimeout: h
|
|
504
503
|
}) => {
|
|
505
504
|
const { model: o } = _();
|
|
506
505
|
F(() => {
|
|
@@ -523,11 +522,11 @@ const bt = T.createLogger({
|
|
|
523
522
|
},
|
|
524
523
|
{
|
|
525
524
|
topic: `/kos/dispense/${o == null ? void 0 : o.path}/flavor/selected/`,
|
|
526
|
-
callback:
|
|
525
|
+
callback: a
|
|
527
526
|
},
|
|
528
527
|
{
|
|
529
528
|
topic: `/kos/dispense/${o == null ? void 0 : o.path}/flavor/cleared/`,
|
|
530
|
-
callback:
|
|
529
|
+
callback: i
|
|
531
530
|
},
|
|
532
531
|
{ topic: `/kos/dispense/${o == null ? void 0 : o.path}/pour/`, callback: v },
|
|
533
532
|
{
|
|
@@ -556,7 +555,7 @@ const bt = T.createLogger({
|
|
|
556
555
|
},
|
|
557
556
|
{
|
|
558
557
|
topic: `/kos/dispense/${o == null ? void 0 : o.path}/are-you-there/timeout/`,
|
|
559
|
-
callback:
|
|
558
|
+
callback: h
|
|
560
559
|
},
|
|
561
560
|
{
|
|
562
561
|
topic: `/kos/dispense/${o == null ? void 0 : o.path}/init/`,
|
|
@@ -580,21 +579,21 @@ const bt = T.createLogger({
|
|
|
580
579
|
r,
|
|
581
580
|
s,
|
|
582
581
|
t,
|
|
583
|
-
a,
|
|
584
582
|
i,
|
|
583
|
+
a,
|
|
585
584
|
v,
|
|
586
585
|
f,
|
|
587
586
|
w,
|
|
588
587
|
b,
|
|
589
|
-
|
|
588
|
+
h,
|
|
590
589
|
e,
|
|
591
590
|
d
|
|
592
591
|
]);
|
|
593
592
|
}, M = T.createLogger({ name: "useCuiKitTimers" }), Le = (e) => {
|
|
594
593
|
const { model: t } = _(), [s, n] = x(null), {
|
|
595
594
|
onAreYouThereTimer: r,
|
|
596
|
-
onIdleTimer:
|
|
597
|
-
onResetIdleTimer:
|
|
595
|
+
onIdleTimer: i,
|
|
596
|
+
onResetIdleTimer: a,
|
|
598
597
|
defaultAreYouThereTime: d = 10,
|
|
599
598
|
defaultIdleTime: v = 20
|
|
600
599
|
} = e, f = de(!1), u = c(() => {
|
|
@@ -602,13 +601,13 @@ const bt = T.createLogger({
|
|
|
602
601
|
}, [r]), l = c(() => {
|
|
603
602
|
M.debug(
|
|
604
603
|
"handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:",
|
|
605
|
-
!!
|
|
606
|
-
),
|
|
607
|
-
}, [
|
|
608
|
-
M.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), s && (s.restart(), f.current = !1,
|
|
609
|
-
}, [s,
|
|
610
|
-
M.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), s && (s.reset(), f.current = !1,
|
|
611
|
-
}, [s,
|
|
604
|
+
!!i
|
|
605
|
+
), i ? (M.debug("Idle timer expired. Calling callback"), i == null || i()) : M.debug("No onIdleTimer callback provided!");
|
|
606
|
+
}, [i]), $ = c(() => {
|
|
607
|
+
M.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), s && (s.restart(), f.current = !1, a == null || a());
|
|
608
|
+
}, [s, a, e.prefix]), w = c(() => {
|
|
609
|
+
M.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), s && (s.reset(), f.current = !1, a == null || a());
|
|
610
|
+
}, [s, a, e.prefix]);
|
|
612
611
|
return F(() => {
|
|
613
612
|
if (M.debug(
|
|
614
613
|
`useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!l}, handleAreYouThere=${!!u}`
|
|
@@ -648,28 +647,28 @@ const bt = T.createLogger({
|
|
|
648
647
|
restart: $,
|
|
649
648
|
pause: w
|
|
650
649
|
};
|
|
651
|
-
},
|
|
650
|
+
}, G = T.createLogger({ name: "useDefaultCuiKitLifecycle" }), Yt = ({
|
|
652
651
|
kit: e,
|
|
653
652
|
inactivity: t,
|
|
654
653
|
pour: s,
|
|
655
654
|
screens: n,
|
|
656
655
|
onBeforeAreYouThereTimer: r,
|
|
657
|
-
areYouThereRejectionPolicy:
|
|
656
|
+
areYouThereRejectionPolicy: i = "pause"
|
|
658
657
|
}) => {
|
|
659
658
|
var I, Z, Ie, xe;
|
|
660
|
-
const [
|
|
661
|
-
if (
|
|
659
|
+
const [a, d] = x(!1), [v, f] = x(!1), { model: u } = _(), [l, $] = x(!1), w = (t == null ? void 0 : t.idleTimeout) ?? 15, b = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, h = (s == null ? void 0 : s.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, o = (s == null ? void 0 : s.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, U = n == null ? void 0 : n.ambientTimeoutOffset, B = n == null ? void 0 : n.attractTimeout, C = c(() => {
|
|
660
|
+
if (G.info("handleIdleTimeout called - navigating home and publishing event"), j(!1), e == null || e.nav.home(), u) {
|
|
662
661
|
const E = `/kos/dispense/${u.path}/idle/timeout/`;
|
|
663
662
|
g.publish(E, {});
|
|
664
663
|
}
|
|
665
664
|
}, [(I = e == null ? void 0 : e.nav) == null ? void 0 : I.home, u]), Q = c(() => {
|
|
666
|
-
|
|
665
|
+
G.info("handleResetIdleTimer called - resetting idle timer"), j(!1);
|
|
667
666
|
}, []), O = c(() => {
|
|
668
|
-
if (
|
|
667
|
+
if (U && (d(!0), f(!1), u)) {
|
|
669
668
|
const E = `/kos/dispense/${u.path}/ambient/start/`;
|
|
670
669
|
g.publish(E, {});
|
|
671
670
|
}
|
|
672
|
-
}, [
|
|
671
|
+
}, [U, u]), ue = c(() => {
|
|
673
672
|
if (B && (f(!0), d(!1), u)) {
|
|
674
673
|
const E = `/kos/dispense/${u.path}/attract/start/`;
|
|
675
674
|
g.publish(E, {});
|
|
@@ -684,7 +683,7 @@ const bt = T.createLogger({
|
|
|
684
683
|
restart: y,
|
|
685
684
|
attractTimer: H
|
|
686
685
|
} = wt({
|
|
687
|
-
defaultAmbientTime:
|
|
686
|
+
defaultAmbientTime: U,
|
|
688
687
|
defaultAttractTime: B,
|
|
689
688
|
onAmbientTimer: O,
|
|
690
689
|
onAttractTimer: ue,
|
|
@@ -692,7 +691,7 @@ const bt = T.createLogger({
|
|
|
692
691
|
});
|
|
693
692
|
(Z = e == null ? void 0 : e.timers) == null || Z.add(H);
|
|
694
693
|
const [me, j] = x(!1);
|
|
695
|
-
|
|
694
|
+
G.info(
|
|
696
695
|
"Creating idle timer with timeout:",
|
|
697
696
|
w,
|
|
698
697
|
"seconds and callback:",
|
|
@@ -704,8 +703,8 @@ const bt = T.createLogger({
|
|
|
704
703
|
onIdleTimer: C,
|
|
705
704
|
onResetIdleTimer: Q
|
|
706
705
|
});
|
|
707
|
-
|
|
708
|
-
`Creating pour timer with timeout: ${
|
|
706
|
+
G.info(
|
|
707
|
+
`Creating pour timer with timeout: ${h} seconds and callback: ${!!C}`
|
|
709
708
|
);
|
|
710
709
|
const {
|
|
711
710
|
pause: k,
|
|
@@ -713,7 +712,7 @@ const bt = T.createLogger({
|
|
|
713
712
|
idleTimer: W
|
|
714
713
|
} = Le({
|
|
715
714
|
defaultAreYouThereTime: o,
|
|
716
|
-
defaultIdleTime:
|
|
715
|
+
defaultIdleTime: h,
|
|
717
716
|
onIdleTimer: C,
|
|
718
717
|
prefix: "pour-"
|
|
719
718
|
}), q = c(async () => {
|
|
@@ -722,7 +721,7 @@ const bt = T.createLogger({
|
|
|
722
721
|
try {
|
|
723
722
|
E = await r();
|
|
724
723
|
} catch (ve) {
|
|
725
|
-
|
|
724
|
+
G.error(`onBeforeAreYouThereTimer callback failed: ${ve}`), E = !1;
|
|
726
725
|
}
|
|
727
726
|
if (E) {
|
|
728
727
|
if (u) {
|
|
@@ -731,7 +730,7 @@ const bt = T.createLogger({
|
|
|
731
730
|
}
|
|
732
731
|
j(!0), l ? k() : P();
|
|
733
732
|
} else
|
|
734
|
-
switch (
|
|
733
|
+
switch (i) {
|
|
735
734
|
case "pause":
|
|
736
735
|
l ? k() : P();
|
|
737
736
|
break;
|
|
@@ -739,7 +738,7 @@ const bt = T.createLogger({
|
|
|
739
738
|
l ? D() : K();
|
|
740
739
|
break;
|
|
741
740
|
}
|
|
742
|
-
}, [r, u,
|
|
741
|
+
}, [r, u, i, l]), X = c(() => {
|
|
743
742
|
j(!1), R(), l ? (D(), P()) : (K(), k());
|
|
744
743
|
}, [l, P, k, K, D]);
|
|
745
744
|
F(() => {
|
|
@@ -755,12 +754,12 @@ const bt = T.createLogger({
|
|
|
755
754
|
action: q
|
|
756
755
|
});
|
|
757
756
|
}, [W, o, q]), (Ie = e == null ? void 0 : e.timers) == null || Ie.add(V), (xe = e == null ? void 0 : e.timers) == null || xe.add(W);
|
|
758
|
-
const
|
|
757
|
+
const he = c(() => {
|
|
759
758
|
$(!1), k(), P(), R();
|
|
760
|
-
}, [P, k]),
|
|
761
|
-
$(!0),
|
|
759
|
+
}, [P, k]), pe = c(() => {
|
|
760
|
+
$(!0), G.info("restarting pour timer"), D(), R(), P();
|
|
762
761
|
}, [P, D]), fe = c(() => {
|
|
763
|
-
$(!1),
|
|
762
|
+
$(!1), G.info("restarting pour timer on before pour rejected"), k(), K();
|
|
764
763
|
}, []), be = c(() => {
|
|
765
764
|
R(), f(!1), d(!1), K();
|
|
766
765
|
}, [R, K]), Pe = c(() => {
|
|
@@ -769,7 +768,7 @@ const bt = T.createLogger({
|
|
|
769
768
|
f(!1), d(!1), $(!1), R(), K();
|
|
770
769
|
}, [R, K]), ne = c(() => {
|
|
771
770
|
f(!1), d(!1), $(!1), y(), P(), k();
|
|
772
|
-
}, [y, P, k]),
|
|
771
|
+
}, [y, P, k]), ae = c(() => {
|
|
773
772
|
f(!1), d(!1), y(), P();
|
|
774
773
|
}, [y, P]);
|
|
775
774
|
Pt({
|
|
@@ -777,16 +776,16 @@ const bt = T.createLogger({
|
|
|
777
776
|
onBrandCleared: Pe,
|
|
778
777
|
onBeverageSelected: re,
|
|
779
778
|
onBeverageCleared: ne,
|
|
780
|
-
onPour:
|
|
781
|
-
onPourCancel:
|
|
779
|
+
onPour: he,
|
|
780
|
+
onPourCancel: pe,
|
|
782
781
|
onBeforePourRejected: fe,
|
|
783
|
-
onInit:
|
|
782
|
+
onInit: ae
|
|
784
783
|
// Note: Timer-related handlers (onIdleTimeout, onAmbientTimer, onAttractTimer,
|
|
785
784
|
// onResumeAttractTimer, onAreYouThereTimeout) are NOT included here since this
|
|
786
785
|
// component's own timer hooks call those handlers directly. Including them would
|
|
787
786
|
// create circular event loops.
|
|
788
787
|
});
|
|
789
|
-
const
|
|
788
|
+
const p = l ? o : b;
|
|
790
789
|
return F(() => {
|
|
791
790
|
if (u && H) {
|
|
792
791
|
const E = `/kos/dispense/${u == null ? void 0 : u.path}/init/`;
|
|
@@ -797,8 +796,8 @@ const bt = T.createLogger({
|
|
|
797
796
|
clearAreYouThere: X,
|
|
798
797
|
pauseIdleTimer: P,
|
|
799
798
|
restartIdleTimer: K,
|
|
800
|
-
areYouThereCountdown:
|
|
801
|
-
showAmbientScreen:
|
|
799
|
+
areYouThereCountdown: p,
|
|
800
|
+
showAmbientScreen: a,
|
|
802
801
|
showAttractScreen: v,
|
|
803
802
|
pauseScreenTimer: R,
|
|
804
803
|
restartScreenTimer: y
|
|
@@ -811,7 +810,7 @@ const bt = T.createLogger({
|
|
|
811
810
|
options: {}
|
|
812
811
|
});
|
|
813
812
|
};
|
|
814
|
-
function
|
|
813
|
+
function Ft(e) {
|
|
815
814
|
return (t) => {
|
|
816
815
|
const { model: s, status: n, KosModelLoader: r } = je();
|
|
817
816
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, deviceAssembly: s }) });
|
|
@@ -819,13 +818,13 @@ function Ut(e) {
|
|
|
819
818
|
}
|
|
820
819
|
const Ve = (e) => S({
|
|
821
820
|
modelId: e,
|
|
822
|
-
modelType:
|
|
821
|
+
modelType: ut.type,
|
|
823
822
|
options: {}
|
|
824
823
|
});
|
|
825
824
|
function Gt(e, t) {
|
|
826
825
|
return (s) => {
|
|
827
|
-
const { model: n, status: r, KosModelLoader:
|
|
828
|
-
return /* @__PURE__ */ m(
|
|
826
|
+
const { model: n, status: r, KosModelLoader: i } = Ve(e);
|
|
827
|
+
return /* @__PURE__ */ m(i, { ...r, children: /* @__PURE__ */ m(t, { ...s, holder: n }) });
|
|
829
828
|
};
|
|
830
829
|
}
|
|
831
830
|
const We = () => {
|
|
@@ -836,7 +835,7 @@ const We = () => {
|
|
|
836
835
|
options: {}
|
|
837
836
|
});
|
|
838
837
|
};
|
|
839
|
-
function
|
|
838
|
+
function Ut(e) {
|
|
840
839
|
return (t) => {
|
|
841
840
|
const { model: s, status: n, KosModelLoader: r } = We();
|
|
842
841
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, holderContainer: s }) });
|
|
@@ -867,7 +866,7 @@ const qe = () => {
|
|
|
867
866
|
}, ge = T.createLogger({
|
|
868
867
|
name: "useNozzlePour",
|
|
869
868
|
group: "kos-hooks"
|
|
870
|
-
}),
|
|
869
|
+
}), jt = ({
|
|
871
870
|
onPour: e,
|
|
872
871
|
onPourCancel: t,
|
|
873
872
|
intentContainer: s,
|
|
@@ -877,24 +876,24 @@ const qe = () => {
|
|
|
877
876
|
ge.debug(
|
|
878
877
|
`[${n == null ? void 0 : n.name}] - Pour initiated for model ${s == null ? void 0 : s.id}.`
|
|
879
878
|
), n == null || n.initiate(s), e == null || e();
|
|
880
|
-
}, [e, s, n]),
|
|
879
|
+
}, [e, s, n]), i = c(() => {
|
|
881
880
|
var v;
|
|
882
881
|
ge.debug(
|
|
883
882
|
`[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${s == null ? void 0 : s.id}.`
|
|
884
883
|
), (v = n == null ? void 0 : n.initiateEnded) == null || v.call(n, s), t == null || t();
|
|
885
|
-
}, [t, s, n]),
|
|
884
|
+
}, [t, s, n]), a = c(() => {
|
|
886
885
|
ge.debug(`Force cancelling pour for nozzle ${s == null ? void 0 : s.id}.`), s == null || s.cancelPour(), t == null || t();
|
|
887
886
|
}, [t, s]);
|
|
888
887
|
return {
|
|
889
888
|
handlers: Te({
|
|
890
889
|
onPressed: r,
|
|
891
|
-
onRelease:
|
|
890
|
+
onRelease: i
|
|
892
891
|
}).dom,
|
|
893
|
-
cancel:
|
|
892
|
+
cancel: a,
|
|
894
893
|
status: s
|
|
895
894
|
};
|
|
896
895
|
};
|
|
897
|
-
function
|
|
896
|
+
function Vt(e) {
|
|
898
897
|
return (t) => {
|
|
899
898
|
const { model: s, status: n, KosModelLoader: r } = qe();
|
|
900
899
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredient: s }) });
|
|
@@ -908,55 +907,55 @@ const Je = () => {
|
|
|
908
907
|
options: {}
|
|
909
908
|
});
|
|
910
909
|
};
|
|
911
|
-
function
|
|
910
|
+
function Wt(e) {
|
|
912
911
|
return (t) => {
|
|
913
912
|
const { model: s, status: n, KosModelLoader: r } = Je();
|
|
914
913
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredientContainer: s }) });
|
|
915
914
|
};
|
|
916
915
|
}
|
|
917
|
-
function
|
|
916
|
+
function qt(e, t) {
|
|
918
917
|
return (s) => {
|
|
919
|
-
const { model: n, status: r, KosModelLoader:
|
|
920
|
-
return /* @__PURE__ */ m(
|
|
918
|
+
const { model: n, status: r, KosModelLoader: i } = Ye(e);
|
|
919
|
+
return /* @__PURE__ */ m(i, { ...r, children: /* @__PURE__ */ m(t, { ...s, nozzle: n }) });
|
|
921
920
|
};
|
|
922
921
|
}
|
|
923
922
|
const te = T.createLogger({
|
|
924
923
|
name: "usePour",
|
|
925
924
|
group: "kos-hooks"
|
|
926
|
-
}),
|
|
925
|
+
}), Jt = ({
|
|
927
926
|
onBeforePour: e,
|
|
928
927
|
onPour: t,
|
|
929
928
|
onPourCancel: s,
|
|
930
929
|
onPourAbort: n,
|
|
931
930
|
pourTarget: r,
|
|
932
|
-
pourContext:
|
|
933
|
-
strategy:
|
|
931
|
+
pourContext: i,
|
|
932
|
+
strategy: a = Ue
|
|
934
933
|
}) => {
|
|
935
934
|
const [d, v] = x(
|
|
936
|
-
|
|
935
|
+
i || new Ge()
|
|
937
936
|
), f = c(async () => {
|
|
938
937
|
te.debug(
|
|
939
|
-
`[${
|
|
938
|
+
`[${a == null ? void 0 : a.name}] - calling before pour for pour target ${r == null ? void 0 : r.id}.`
|
|
940
939
|
), (e ? await (e == null ? void 0 : e(d)) : !0) ? (te.debug(
|
|
941
|
-
`[${
|
|
942
|
-
), await (
|
|
943
|
-
`[${
|
|
940
|
+
`[${a == null ? void 0 : a.name}] - Pour initiated for pour target ${r == null ? void 0 : r.id}.`
|
|
941
|
+
), await (a == null ? void 0 : a.initiate(r)), t == null || t(), r != null && r.isPouring || n == null || n()) : (te.debug(
|
|
942
|
+
`[${a == null ? void 0 : a.name}] - Pour cancelled for pour target ${r == null ? void 0 : r.id}.`
|
|
944
943
|
), s == null || s());
|
|
945
|
-
}, [t, e, n, r,
|
|
944
|
+
}, [t, e, n, r, a, d]), u = c(async () => {
|
|
946
945
|
var o;
|
|
947
946
|
te.debug(
|
|
948
|
-
`[${
|
|
949
|
-
), await ((o =
|
|
950
|
-
}, [s, r,
|
|
947
|
+
`[${a == null ? void 0 : a.name}] - Pour initiate ended called for pour target ${r == null ? void 0 : r.id}.`
|
|
948
|
+
), await ((o = a == null ? void 0 : a.initiateEnded) == null ? void 0 : o.call(a, r)) || s == null || s();
|
|
949
|
+
}, [s, r, a]), l = c(async () => {
|
|
951
950
|
te.debug(`Force cancelling pour for pour target ${r == null ? void 0 : r.id}.`), await (r == null ? void 0 : r.cancelPour()), s == null || s();
|
|
952
951
|
}, [s, r]), $ = c(
|
|
953
|
-
(
|
|
954
|
-
d.set(
|
|
952
|
+
(h, o) => {
|
|
953
|
+
d.set(h, o);
|
|
955
954
|
},
|
|
956
955
|
[d]
|
|
957
956
|
), w = c(
|
|
958
|
-
(
|
|
959
|
-
d.remove(
|
|
957
|
+
(h) => {
|
|
958
|
+
d.remove(h);
|
|
960
959
|
},
|
|
961
960
|
[d]
|
|
962
961
|
);
|
|
@@ -974,7 +973,7 @@ const te = T.createLogger({
|
|
|
974
973
|
name: "TapOrHoldIntentStrategy",
|
|
975
974
|
group: "kos-hooks"
|
|
976
975
|
});
|
|
977
|
-
class
|
|
976
|
+
class Qt {
|
|
978
977
|
constructor(t) {
|
|
979
978
|
J(this, "intent");
|
|
980
979
|
J(this, "name", "TapOrHoldIntentStrategy");
|
|
@@ -1002,7 +1001,7 @@ class Xt {
|
|
|
1002
1001
|
const ce = T.createLogger({
|
|
1003
1002
|
name: "TapToPourIntentStrategy",
|
|
1004
1003
|
group: "kos-hooks"
|
|
1005
|
-
}),
|
|
1004
|
+
}), Xt = {
|
|
1006
1005
|
name: "TapToPourIntentStrategy",
|
|
1007
1006
|
async initiate(e, t) {
|
|
1008
1007
|
if (e != null && e.isPouring) {
|
|
@@ -1021,7 +1020,7 @@ const ce = T.createLogger({
|
|
|
1021
1020
|
}, Re = T.createLogger({
|
|
1022
1021
|
name: "HoldToPourStrategy",
|
|
1023
1022
|
group: "kos-hooks"
|
|
1024
|
-
}),
|
|
1023
|
+
}), Zt = {
|
|
1025
1024
|
name: "TapToPourStrategy",
|
|
1026
1025
|
async initiate(e) {
|
|
1027
1026
|
if (e != null && e.isPouring) {
|
|
@@ -1037,16 +1036,17 @@ const ce = T.createLogger({
|
|
|
1037
1036
|
async initiateEnded(e) {
|
|
1038
1037
|
return !0;
|
|
1039
1038
|
}
|
|
1040
|
-
}, xt = (e, t, s) => S({
|
|
1039
|
+
}, xt = (e, t, s, n) => S({
|
|
1041
1040
|
modelId: e,
|
|
1042
|
-
modelType:
|
|
1041
|
+
modelType: lt.type,
|
|
1043
1042
|
forceUpdate: !0,
|
|
1044
1043
|
options: {
|
|
1045
1044
|
servicePathFactory: t,
|
|
1046
|
-
selectedId: s
|
|
1045
|
+
selectedId: s,
|
|
1046
|
+
initialData: n
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
|
-
function
|
|
1049
|
+
function zt(e) {
|
|
1050
1050
|
return (t) => {
|
|
1051
1051
|
const { model: s, status: n, KosModelLoader: r } = xt(
|
|
1052
1052
|
t.id,
|
|
@@ -1056,10 +1056,10 @@ function es(e) {
|
|
|
1056
1056
|
return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, genericPour: s }) });
|
|
1057
1057
|
};
|
|
1058
1058
|
}
|
|
1059
|
-
const Qe = L(void 0),
|
|
1059
|
+
const Qe = L(void 0), es = ({ children: e }) => {
|
|
1060
1060
|
const { model: t, ready: s } = De(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1061
1061
|
return /* @__PURE__ */ m(Qe.Provider, { value: n, children: e });
|
|
1062
|
-
},
|
|
1062
|
+
}, ts = () => {
|
|
1063
1063
|
const e = N(
|
|
1064
1064
|
Qe
|
|
1065
1065
|
);
|
|
@@ -1068,17 +1068,17 @@ const Qe = L(void 0), ts = ({ children: e }) => {
|
|
|
1068
1068
|
"useAssemblyContext must be used within a AssemblyProvider"
|
|
1069
1069
|
);
|
|
1070
1070
|
return e;
|
|
1071
|
-
}, Xe = L(void 0),
|
|
1071
|
+
}, Xe = L(void 0), ss = ({ children: e }) => {
|
|
1072
1072
|
const { model: t, ready: s } = Me(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1073
1073
|
return /* @__PURE__ */ m(Xe.Provider, { value: n, children: e });
|
|
1074
|
-
},
|
|
1074
|
+
}, rs = () => {
|
|
1075
1075
|
const e = N(Xe);
|
|
1076
1076
|
if (!e)
|
|
1077
1077
|
throw new Error(
|
|
1078
1078
|
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
1079
1079
|
);
|
|
1080
1080
|
return e;
|
|
1081
|
-
}, Ze = L(void 0),
|
|
1081
|
+
}, Ze = L(void 0), ns = ({ children: e, id: t }) => {
|
|
1082
1082
|
const { model: s, ready: n } = _e(t), r = A(() => n && s ? { model: s } : {}, [n, s]);
|
|
1083
1083
|
return /* @__PURE__ */ m(Ze.Provider, { value: r, children: e });
|
|
1084
1084
|
}, as = () => {
|
|
@@ -1086,10 +1086,10 @@ const Qe = L(void 0), ts = ({ children: e }) => {
|
|
|
1086
1086
|
if (!e)
|
|
1087
1087
|
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
1088
1088
|
return e;
|
|
1089
|
-
}, ze = L(void 0),
|
|
1089
|
+
}, ze = L(void 0), is = ({ children: e }) => {
|
|
1090
1090
|
const { model: t, ready: s } = Oe(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1091
1091
|
return /* @__PURE__ */ m(ze.Provider, { value: n, children: e });
|
|
1092
|
-
},
|
|
1092
|
+
}, os = () => {
|
|
1093
1093
|
const e = N(ze);
|
|
1094
1094
|
if (!e)
|
|
1095
1095
|
throw new Error(
|
|
@@ -1101,8 +1101,8 @@ const Qe = L(void 0), ts = ({ children: e }) => {
|
|
|
1101
1101
|
), At = ({ children: e }) => {
|
|
1102
1102
|
const { model: t, ready: s } = je(), n = A(() => {
|
|
1103
1103
|
if (s && t) {
|
|
1104
|
-
const
|
|
1105
|
-
return { model: t, nozzlePaths:
|
|
1104
|
+
const i = t.nozzlePaths;
|
|
1105
|
+
return { model: t, nozzlePaths: i };
|
|
1106
1106
|
}
|
|
1107
1107
|
return {};
|
|
1108
1108
|
}, [s, t]), r = s && t ? e : null;
|
|
@@ -1116,7 +1116,7 @@ const Qe = L(void 0), ts = ({ children: e }) => {
|
|
|
1116
1116
|
return e;
|
|
1117
1117
|
};
|
|
1118
1118
|
function Et() {
|
|
1119
|
-
const e =
|
|
1119
|
+
const e = mt.createContext(null);
|
|
1120
1120
|
return [() => {
|
|
1121
1121
|
const s = N(e);
|
|
1122
1122
|
if (s === void 0)
|
|
@@ -1139,21 +1139,21 @@ function St({
|
|
|
1139
1139
|
props: s
|
|
1140
1140
|
}) {
|
|
1141
1141
|
const { nozzlePaths: n } = kt(), r = (n == null ? void 0 : n.length) || 0;
|
|
1142
|
-
return (n == null ? void 0 : n.map((
|
|
1142
|
+
return (n == null ? void 0 : n.map((a, d) => /* @__PURE__ */ m(ht, { path: a, children: /* @__PURE__ */ m(
|
|
1143
1143
|
Ct,
|
|
1144
1144
|
{
|
|
1145
1145
|
provider: t,
|
|
1146
1146
|
props: s,
|
|
1147
1147
|
nozzleProps: {
|
|
1148
1148
|
nozzleIndex: d,
|
|
1149
|
-
nozzlePath:
|
|
1149
|
+
nozzlePath: a,
|
|
1150
1150
|
totalNozzles: r,
|
|
1151
1151
|
isFirstNozzle: d === 0,
|
|
1152
1152
|
isLastNozzle: d === r - 1
|
|
1153
1153
|
},
|
|
1154
1154
|
children: e
|
|
1155
1155
|
}
|
|
1156
|
-
) },
|
|
1156
|
+
) }, a))) || [];
|
|
1157
1157
|
}
|
|
1158
1158
|
function Nt({
|
|
1159
1159
|
provider: e,
|
|
@@ -1168,27 +1168,27 @@ function Nt({
|
|
|
1168
1168
|
}
|
|
1169
1169
|
) }) : null;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function cs(e) {
|
|
1172
1172
|
const [t, s] = Et();
|
|
1173
1173
|
return [
|
|
1174
1174
|
t,
|
|
1175
1175
|
Nt({ provider: s, props: e })
|
|
1176
1176
|
];
|
|
1177
1177
|
}
|
|
1178
|
-
const tt = L(void 0),
|
|
1178
|
+
const tt = L(void 0), ds = ({ children: e, id: t }) => {
|
|
1179
1179
|
const { model: s, ready: n } = Ve(t || ""), r = A(() => n && s ? { model: s } : {}, [n, s]);
|
|
1180
1180
|
return /* @__PURE__ */ m(tt.Provider, { value: r, children: e });
|
|
1181
|
-
},
|
|
1181
|
+
}, us = () => {
|
|
1182
1182
|
const e = N(tt);
|
|
1183
1183
|
if (!e)
|
|
1184
1184
|
throw new Error("useHolderContext must be used within a HolderProvider");
|
|
1185
1185
|
return e;
|
|
1186
1186
|
}, st = L(
|
|
1187
1187
|
void 0
|
|
1188
|
-
),
|
|
1188
|
+
), ls = ({ children: e }) => {
|
|
1189
1189
|
const { model: t, ready: s } = We(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1190
1190
|
return /* @__PURE__ */ m(st.Provider, { value: n, children: e });
|
|
1191
|
-
},
|
|
1191
|
+
}, ms = () => {
|
|
1192
1192
|
const e = N(st);
|
|
1193
1193
|
if (!e)
|
|
1194
1194
|
throw new Error(
|
|
@@ -1198,7 +1198,7 @@ const tt = L(void 0), us = ({ children: e, id: t }) => {
|
|
|
1198
1198
|
}, rt = L(void 0), hs = ({ children: e }) => {
|
|
1199
1199
|
const { model: t, ready: s } = qe(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1200
1200
|
return /* @__PURE__ */ m(rt.Provider, { value: n, children: e });
|
|
1201
|
-
},
|
|
1201
|
+
}, ps = () => {
|
|
1202
1202
|
const e = N(rt);
|
|
1203
1203
|
if (!e)
|
|
1204
1204
|
throw new Error(
|
|
@@ -1207,10 +1207,10 @@ const tt = L(void 0), us = ({ children: e, id: t }) => {
|
|
|
1207
1207
|
return e;
|
|
1208
1208
|
}, nt = L(
|
|
1209
1209
|
void 0
|
|
1210
|
-
),
|
|
1210
|
+
), fs = ({ children: e }) => {
|
|
1211
1211
|
const { model: t, ready: s } = Je(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1212
1212
|
return /* @__PURE__ */ m(nt.Provider, { value: n, children: e });
|
|
1213
|
-
},
|
|
1213
|
+
}, bs = () => {
|
|
1214
1214
|
const e = N(nt);
|
|
1215
1215
|
if (!e)
|
|
1216
1216
|
throw new Error(
|
|
@@ -1224,81 +1224,81 @@ const tt = L(void 0), us = ({ children: e, id: t }) => {
|
|
|
1224
1224
|
modelType: Ke.type,
|
|
1225
1225
|
options: {}
|
|
1226
1226
|
});
|
|
1227
|
-
},
|
|
1227
|
+
}, at = L(void 0), vs = ({ children: e }) => {
|
|
1228
1228
|
const { model: t, ready: s } = Ht(), n = A(() => s && t ? { model: t } : {}, [s, t]);
|
|
1229
|
-
return /* @__PURE__ */ m(
|
|
1230
|
-
},
|
|
1231
|
-
const e = N(
|
|
1229
|
+
return /* @__PURE__ */ m(at.Provider, { value: n, children: e });
|
|
1230
|
+
}, $s = () => {
|
|
1231
|
+
const e = N(at);
|
|
1232
1232
|
if (!e)
|
|
1233
1233
|
throw new Error("usePumpContext must be used within a PumpProvider");
|
|
1234
1234
|
return e;
|
|
1235
1235
|
};
|
|
1236
1236
|
export {
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1237
|
+
Wt as $,
|
|
1238
|
+
es as A,
|
|
1239
|
+
ns as B,
|
|
1240
1240
|
Ct as C,
|
|
1241
1241
|
At as D,
|
|
1242
1242
|
ft as E,
|
|
1243
1243
|
z as F,
|
|
1244
1244
|
oe as G,
|
|
1245
|
-
|
|
1245
|
+
ds as H,
|
|
1246
1246
|
hs as I,
|
|
1247
1247
|
ee as J,
|
|
1248
1248
|
gt as K,
|
|
1249
|
-
|
|
1249
|
+
Yt as L,
|
|
1250
1250
|
Pt as M,
|
|
1251
|
-
|
|
1251
|
+
ht as N,
|
|
1252
1252
|
Le as O,
|
|
1253
|
-
|
|
1253
|
+
vs as P,
|
|
1254
1254
|
$t as Q,
|
|
1255
1255
|
je as R,
|
|
1256
|
-
|
|
1256
|
+
Ft as S,
|
|
1257
1257
|
Ve as T,
|
|
1258
1258
|
Gt as U,
|
|
1259
1259
|
We as V,
|
|
1260
|
-
|
|
1260
|
+
Ut as W,
|
|
1261
1261
|
qe as X,
|
|
1262
|
-
|
|
1263
|
-
|
|
1262
|
+
jt as Y,
|
|
1263
|
+
Vt as Z,
|
|
1264
1264
|
Je as _,
|
|
1265
|
-
|
|
1265
|
+
ss as a,
|
|
1266
1266
|
Ye as a0,
|
|
1267
|
-
|
|
1267
|
+
qt as a1,
|
|
1268
1268
|
vt as a2,
|
|
1269
|
-
|
|
1269
|
+
Jt as a3,
|
|
1270
1270
|
It as a4,
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1271
|
+
Ue as a5,
|
|
1272
|
+
Qt as a6,
|
|
1273
|
+
Xt as a7,
|
|
1274
|
+
Zt as a8,
|
|
1275
1275
|
xt as a9,
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1276
|
+
zt as aa,
|
|
1277
|
+
Ge as ab,
|
|
1278
|
+
rs as b,
|
|
1279
1279
|
as as c,
|
|
1280
|
-
|
|
1281
|
-
|
|
1280
|
+
is as d,
|
|
1281
|
+
os as e,
|
|
1282
1282
|
Nt as f,
|
|
1283
1283
|
kt as g,
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1284
|
+
us as h,
|
|
1285
|
+
cs as i,
|
|
1286
|
+
ls as j,
|
|
1287
|
+
ms as k,
|
|
1288
|
+
ps as l,
|
|
1289
|
+
fs as m,
|
|
1290
|
+
bs as n,
|
|
1291
1291
|
_ as o,
|
|
1292
|
-
|
|
1292
|
+
$s as p,
|
|
1293
1293
|
De as q,
|
|
1294
1294
|
Me as r,
|
|
1295
|
-
|
|
1295
|
+
Mt as s,
|
|
1296
1296
|
_e as t,
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1297
|
+
ts as u,
|
|
1298
|
+
_t as v,
|
|
1299
|
+
Dt as w,
|
|
1300
1300
|
Oe as x,
|
|
1301
|
-
|
|
1302
|
-
|
|
1301
|
+
Ot as y,
|
|
1302
|
+
pt as z
|
|
1303
1303
|
};
|
|
1304
|
-
//# sourceMappingURL=pump-provider-
|
|
1304
|
+
//# sourceMappingURL=pump-provider-DErNNCPW.js.map
|