@kosdev-code/kos-dispense-sdk 2.0.30 → 2.0.32
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/index.cjs +1 -1
- package/index.js +1 -1
- package/models/utils/service.d.ts +23 -15
- package/models/utils/service.d.ts.map +1 -1
- package/package.json +3 -3
- package/pump-provider-CP6xxU4h.cjs +2 -0
- package/pump-provider-CP6xxU4h.cjs.map +1 -0
- package/{pump-provider-CiU4D_1r.js → pump-provider-jdIoS5JD.js} +339 -323
- package/pump-provider-jdIoS5JD.js.map +1 -0
- package/ui/contexts/cui-kit/cui-kit.d.ts +8 -1
- package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +1 -1
- package/pump-provider-CiU4D_1r.js.map +0 -1
- package/pump-provider-DzxdPW8o.cjs +0 -2
- package/pump-provider-DzxdPW8o.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useKosModel as E, getKosCompanionModel as pe, kosAutoEffect as
|
|
6
|
-
import tt, { createContext as
|
|
1
|
+
var ze = Object.defineProperty;
|
|
2
|
+
var et = (e, t, r) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var _ = (e, t, r) => (et(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
5
|
+
import { useKosModel as E, getKosCompanionModel as pe, kosAutoEffect as ke, KosLog as w, usePressGesture as me, EventBus as T, TimerManager as He } from "@kosdev-code/kos-ui-sdk";
|
|
6
|
+
import tt, { createContext as H, useMemo as P, useContext as N, useState as I, useCallback as i, useEffect as Y, useRef as st } from "react";
|
|
7
7
|
import { A as $e, a as we, d as rt, c as Pe, N as nt, e as ge, H as ot, f as Te, I as Ie, g as Ae, G as at, P as xe } from "./dispense-registration-manager-CKFF29mO.js";
|
|
8
8
|
const Se = () => {
|
|
9
9
|
const e = $e.type;
|
|
@@ -13,13 +13,13 @@ const Se = () => {
|
|
|
13
13
|
options: {}
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function Bt(e) {
|
|
17
17
|
return (t) => {
|
|
18
18
|
const { model: r, status: n, KosModelLoader: s } = Se();
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, assembly: r }) });
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const Be = () => {
|
|
23
23
|
const e = we.type;
|
|
24
24
|
return E({
|
|
25
25
|
modelId: e,
|
|
@@ -27,10 +27,10 @@ const Ne = () => {
|
|
|
27
27
|
options: {}
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function Kt(e) {
|
|
31
31
|
return (t) => {
|
|
32
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
const { model: r, status: n, KosModelLoader: s } = Be();
|
|
33
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, beverage: r }) });
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
const Ke = (e) => E({
|
|
@@ -41,10 +41,10 @@ const Ke = (e) => E({
|
|
|
41
41
|
function Lt(e) {
|
|
42
42
|
return (t) => (r) => {
|
|
43
43
|
const { model: n, status: s, KosModelLoader: o } = Ke(t);
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ l(o, { ...s, children: /* @__PURE__ */ l(e, { ...r, board: n }) });
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const Le = () => {
|
|
48
48
|
const e = Pe.type;
|
|
49
49
|
return E({
|
|
50
50
|
modelId: e,
|
|
@@ -54,21 +54,21 @@ const Be = () => {
|
|
|
54
54
|
};
|
|
55
55
|
function Ct(e) {
|
|
56
56
|
return (t) => {
|
|
57
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
58
|
-
return /* @__PURE__ */
|
|
57
|
+
const { model: r, status: n, KosModelLoader: s } = Le();
|
|
58
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, boardContainer: r }) });
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const Ce = (e) => E({
|
|
62
62
|
modelId: e,
|
|
63
63
|
modelType: nt.type,
|
|
64
64
|
options: {
|
|
65
65
|
path: e
|
|
66
66
|
}
|
|
67
|
-
}),
|
|
68
|
-
const { model: r, ready: n } =
|
|
69
|
-
return /* @__PURE__ */
|
|
67
|
+
}), De = H(void 0), it = ({ children: e, path: t }) => {
|
|
68
|
+
const { model: r, ready: n } = Ce(t), s = P(() => n && r ? { model: r } : {}, [n, r]);
|
|
69
|
+
return /* @__PURE__ */ l(De.Provider, { value: s, children: e });
|
|
70
70
|
}, C = () => {
|
|
71
|
-
const e =
|
|
71
|
+
const e = N(De);
|
|
72
72
|
if (!e)
|
|
73
73
|
throw new Error("useNozzleContext must be used within a NozzleProvider");
|
|
74
74
|
return e;
|
|
@@ -77,18 +77,18 @@ const Le = (e) => E({
|
|
|
77
77
|
onClearBeverage: t,
|
|
78
78
|
companionType: r
|
|
79
79
|
}) => {
|
|
80
|
-
const { model: n } = C(), [s, o] =
|
|
81
|
-
(
|
|
80
|
+
const { model: n } = C(), [s, o] = I([]), [c, u] = I(null), h = P(() => r ? s.map(
|
|
81
|
+
(d) => pe(d, r)
|
|
82
82
|
) : [], [s, r]), f = i(
|
|
83
|
-
async (
|
|
84
|
-
|
|
83
|
+
async (d) => {
|
|
84
|
+
u(d), await (n == null ? void 0 : n.setSelectedPourable({ beverage: d })), e == null || e(d);
|
|
85
85
|
},
|
|
86
86
|
[n, e]
|
|
87
|
-
),
|
|
88
|
-
|
|
87
|
+
), p = i(async () => {
|
|
88
|
+
u(null), await (n == null ? void 0 : n.setSelectedPourable({ beverage: void 0 })), t == null || t();
|
|
89
89
|
}, [n, t]);
|
|
90
|
-
return
|
|
91
|
-
const
|
|
90
|
+
return Y(() => {
|
|
91
|
+
const d = ke(() => {
|
|
92
92
|
if (!n)
|
|
93
93
|
return;
|
|
94
94
|
const v = n.selectedBrand;
|
|
@@ -101,42 +101,46 @@ const Le = (e) => E({
|
|
|
101
101
|
o(b ?? []);
|
|
102
102
|
});
|
|
103
103
|
return () => {
|
|
104
|
-
|
|
104
|
+
d();
|
|
105
105
|
};
|
|
106
106
|
}, [n]), {
|
|
107
107
|
beverages: s,
|
|
108
108
|
beverageCompanions: h,
|
|
109
109
|
selectBeverage: f,
|
|
110
|
-
selectedBeverage:
|
|
111
|
-
clearBeverage:
|
|
110
|
+
selectedBeverage: c,
|
|
111
|
+
clearBeverage: p
|
|
112
112
|
};
|
|
113
113
|
}, dt = ({
|
|
114
114
|
onBrandSelected: e,
|
|
115
115
|
onBrandCleared: t,
|
|
116
116
|
companionType: r
|
|
117
117
|
}) => {
|
|
118
|
-
const { model: n } = C(), [s, o] =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
), p = P(() => r ? d.map((c) => pe(c, r)) : [], [d, r]), h = i(
|
|
122
|
-
async (c) => {
|
|
123
|
-
o(c), n == null || n.setSelectedBrand(c), e == null || e(c);
|
|
118
|
+
const { model: n } = C(), [s, o] = I(null), [c, u] = I([]), h = P(() => r ? c.map((d) => pe(d, r)) : [], [c, r]), f = i(
|
|
119
|
+
async (d) => {
|
|
120
|
+
o(d), n == null || n.setSelectedBrand(d), e == null || e(d);
|
|
124
121
|
},
|
|
125
122
|
[n, e]
|
|
126
|
-
),
|
|
123
|
+
), p = i(() => {
|
|
127
124
|
o(null), n == null || n.setSelectedBrand(void 0), t == null || t();
|
|
128
125
|
}, [n, t]);
|
|
129
|
-
return {
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
return Y(() => {
|
|
127
|
+
const d = ke(() => {
|
|
128
|
+
n && u(n.visibleBrands);
|
|
129
|
+
});
|
|
130
|
+
return () => {
|
|
131
|
+
d();
|
|
132
|
+
};
|
|
133
|
+
}, [n]), {
|
|
134
|
+
brands: c,
|
|
135
|
+
brandCompanions: h,
|
|
132
136
|
selectedBrand: s,
|
|
133
|
-
selectBrand:
|
|
134
|
-
clearBrand:
|
|
137
|
+
selectBrand: f,
|
|
138
|
+
clearBrand: p
|
|
135
139
|
};
|
|
136
140
|
}, ut = w.createLogger({
|
|
137
141
|
name: "HoldToPourStrategy",
|
|
138
142
|
group: "kos-hooks"
|
|
139
|
-
}),
|
|
143
|
+
}), Re = {
|
|
140
144
|
name: "HoldToPourStrategy",
|
|
141
145
|
async initiate(e) {
|
|
142
146
|
if (!(e != null && e.canPour)) {
|
|
@@ -156,26 +160,26 @@ const Le = (e) => E({
|
|
|
156
160
|
onPourCancel: t,
|
|
157
161
|
onBeforePour: r,
|
|
158
162
|
onBeforePourRejected: n,
|
|
159
|
-
strategy: s =
|
|
163
|
+
strategy: s = Re
|
|
160
164
|
}) => {
|
|
161
|
-
const { model: o } = C(),
|
|
165
|
+
const { model: o } = C(), c = i(async () => {
|
|
162
166
|
(r ? await (r == null ? void 0 : r()) : !0) ? (Q.debug(
|
|
163
167
|
`[${s == null ? void 0 : s.name}] - Pour initiated for nozzle ${o == null ? void 0 : o.id}.`
|
|
164
168
|
), s == null || s.initiate(o), e == null || e()) : (Q.debug(
|
|
165
169
|
`[${s == null ? void 0 : s.name}] - Did not pass onBeforePour gate for nozzle ${o == null ? void 0 : o.id}. Cancelling pour.`
|
|
166
170
|
), n == null || n());
|
|
167
|
-
}, [e, o, s, r, t]),
|
|
168
|
-
var
|
|
171
|
+
}, [e, o, s, r, t]), u = i(() => {
|
|
172
|
+
var p;
|
|
169
173
|
Q.debug(
|
|
170
174
|
`[${s == null ? void 0 : s.name}] - Pour initiate ended called for nozzle ${o == null ? void 0 : o.id}.`
|
|
171
|
-
), (
|
|
175
|
+
), (p = s == null ? void 0 : s.initiateEnded) == null || p.call(s, o), t == null || t();
|
|
172
176
|
}, [t, o, s]), h = i(() => {
|
|
173
177
|
Q.debug(`Force cancelling pour for nozzle ${o == null ? void 0 : o.id}.`), o == null || o.cancelPour(), t == null || t();
|
|
174
178
|
}, [t, o]);
|
|
175
179
|
return {
|
|
176
180
|
handlers: me({
|
|
177
|
-
onPressed:
|
|
178
|
-
onRelease:
|
|
181
|
+
onPressed: c,
|
|
182
|
+
onRelease: u
|
|
179
183
|
}).dom,
|
|
180
184
|
cancel: h,
|
|
181
185
|
status: o
|
|
@@ -186,92 +190,92 @@ const Le = (e) => E({
|
|
|
186
190
|
companionType: r
|
|
187
191
|
}) => {
|
|
188
192
|
const { model: n } = C(), s = P(
|
|
189
|
-
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((
|
|
193
|
+
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((p) => p.visible)) ?? [],
|
|
190
194
|
[n]
|
|
191
195
|
), o = P(() => r ? s.map(
|
|
192
|
-
(
|
|
193
|
-
) : [], [s, r]), [
|
|
194
|
-
async (
|
|
195
|
-
if (
|
|
196
|
-
(
|
|
196
|
+
(p) => pe(p, r)
|
|
197
|
+
) : [], [s, r]), [c, u] = I([]), h = i(
|
|
198
|
+
async (p) => {
|
|
199
|
+
if (u(
|
|
200
|
+
(d) => d != null && d.includes(p) ? [...d.filter((v) => v !== p)] : [...d ?? [], p]
|
|
197
201
|
), n != null && n.selectedPourable) {
|
|
198
|
-
const { beverage:
|
|
202
|
+
const { beverage: d } = n.selectedPourable;
|
|
199
203
|
await n.setSelectedPourable({
|
|
200
|
-
beverage:
|
|
201
|
-
additional:
|
|
204
|
+
beverage: d,
|
|
205
|
+
additional: c ?? []
|
|
202
206
|
});
|
|
203
207
|
}
|
|
204
|
-
e == null || e(
|
|
208
|
+
e == null || e(p, c ?? []);
|
|
205
209
|
},
|
|
206
|
-
[n, e,
|
|
210
|
+
[n, e, c]
|
|
207
211
|
), f = i(async () => {
|
|
208
|
-
if (
|
|
209
|
-
const { beverage:
|
|
210
|
-
n.setSelectedPourable({ beverage:
|
|
212
|
+
if (u([]), n != null && n.selectedPourable) {
|
|
213
|
+
const { beverage: p } = n.selectedPourable;
|
|
214
|
+
n.setSelectedPourable({ beverage: p }), t == null || t();
|
|
211
215
|
}
|
|
212
216
|
}, [n, t]);
|
|
213
217
|
return {
|
|
214
218
|
flavors: s,
|
|
215
219
|
flavorCompanions: o,
|
|
216
220
|
selectFlavor: h,
|
|
217
|
-
selectedFlavors:
|
|
221
|
+
selectedFlavors: c,
|
|
218
222
|
clearFlavors: f
|
|
219
223
|
};
|
|
220
|
-
}, G = "brands", X = "beverages",
|
|
224
|
+
}, G = "brands", X = "beverages", j = "flavors", R = w.createLogger({ name: "use-cui-kit" }), mt = ({
|
|
221
225
|
initialGroup: e = G,
|
|
222
226
|
options: t = {}
|
|
223
227
|
}) => {
|
|
224
228
|
var W, q, J;
|
|
225
|
-
const [r, n] =
|
|
226
|
-
(
|
|
227
|
-
n(
|
|
228
|
-
const
|
|
229
|
-
T.publish(
|
|
229
|
+
const [r, n] = I(e), { model: s } = C(), o = st([]), c = i(
|
|
230
|
+
(m) => {
|
|
231
|
+
n(j);
|
|
232
|
+
const S = `/kos/dispense/${s == null ? void 0 : s.path}/brand/selected/`;
|
|
233
|
+
T.publish(S, m);
|
|
230
234
|
},
|
|
231
235
|
[s == null ? void 0 : s.path]
|
|
232
|
-
),
|
|
233
|
-
const
|
|
234
|
-
T.publish(
|
|
236
|
+
), u = i(() => {
|
|
237
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/brand/cleared/`;
|
|
238
|
+
T.publish(m, {});
|
|
235
239
|
}, [s == null ? void 0 : s.path]), h = i(
|
|
236
|
-
(
|
|
237
|
-
n(
|
|
238
|
-
const
|
|
239
|
-
T.publish(
|
|
240
|
+
(m) => {
|
|
241
|
+
n(j);
|
|
242
|
+
const S = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/selected/`;
|
|
243
|
+
T.publish(S, m);
|
|
240
244
|
},
|
|
241
245
|
[s == null ? void 0 : s.path]
|
|
242
246
|
), f = i(() => {
|
|
243
|
-
const
|
|
244
|
-
T.publish(
|
|
245
|
-
}, [s == null ? void 0 : s.path]),
|
|
246
|
-
(
|
|
247
|
-
const
|
|
248
|
-
T.publish(
|
|
247
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/cleared/`;
|
|
248
|
+
T.publish(m, {});
|
|
249
|
+
}, [s == null ? void 0 : s.path]), p = i(
|
|
250
|
+
(m) => {
|
|
251
|
+
const S = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/selected/`;
|
|
252
|
+
T.publish(S, m);
|
|
249
253
|
},
|
|
250
254
|
[s == null ? void 0 : s.path]
|
|
251
|
-
),
|
|
252
|
-
const
|
|
253
|
-
T.publish(
|
|
255
|
+
), d = i(() => {
|
|
256
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/cleared/`;
|
|
257
|
+
T.publish(m, {});
|
|
254
258
|
}, [s == null ? void 0 : s.path]), v = i(() => {
|
|
255
|
-
const
|
|
256
|
-
T.publish(
|
|
259
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/pour/`;
|
|
260
|
+
T.publish(m, {});
|
|
257
261
|
}, [s == null ? void 0 : s.path]), b = i(async () => {
|
|
258
|
-
const
|
|
259
|
-
return T.publish(
|
|
262
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/`;
|
|
263
|
+
return T.publish(m, {}), await (g == null ? void 0 : g()) || !0;
|
|
260
264
|
}, [s == null ? void 0 : s.path]), a = i(async () => {
|
|
261
|
-
const
|
|
262
|
-
T.publish(
|
|
265
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/rejected/`;
|
|
266
|
+
T.publish(m, {});
|
|
263
267
|
}, [s == null ? void 0 : s.path]), $ = i(() => {
|
|
264
|
-
const
|
|
265
|
-
T.publish(
|
|
266
|
-
}, [s == null ? void 0 : s.path]), { brands: y, selectBrand:
|
|
268
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/pour/cancel/`;
|
|
269
|
+
T.publish(m, {});
|
|
270
|
+
}, [s == null ? void 0 : s.path]), { brands: y, selectBrand: k, selectedBrand: B, clearBrand: K, brandCompanions: V } = dt({
|
|
267
271
|
companionType: (W = t.companionTypes) == null ? void 0 : W.brand,
|
|
268
|
-
onBrandSelected:
|
|
269
|
-
onBrandCleared:
|
|
272
|
+
onBrandSelected: c,
|
|
273
|
+
onBrandCleared: u
|
|
270
274
|
}), {
|
|
271
275
|
beverages: z,
|
|
272
276
|
selectBeverage: ee,
|
|
273
277
|
selectedBeverage: te,
|
|
274
|
-
clearBeverage:
|
|
278
|
+
clearBeverage: A,
|
|
275
279
|
beverageCompanions: D
|
|
276
280
|
} = ct({
|
|
277
281
|
companionType: (q = t.companionTypes) == null ? void 0 : q.beverage,
|
|
@@ -279,16 +283,16 @@ const Le = (e) => E({
|
|
|
279
283
|
onClearBeverage: f
|
|
280
284
|
}), {
|
|
281
285
|
clearFlavors: se,
|
|
282
|
-
flavors:
|
|
283
|
-
selectFlavor:
|
|
286
|
+
flavors: O,
|
|
287
|
+
selectFlavor: x,
|
|
284
288
|
selectedFlavors: L,
|
|
285
289
|
flavorCompanions: re
|
|
286
290
|
} = pt({
|
|
287
291
|
companionType: (J = t.companionTypes) == null ? void 0 : J.flavor,
|
|
288
|
-
onFlavorSelected:
|
|
289
|
-
onFlavorCleared:
|
|
290
|
-
}), [g, M] =
|
|
291
|
-
M(() =>
|
|
292
|
+
onFlavorSelected: p,
|
|
293
|
+
onFlavorCleared: d
|
|
294
|
+
}), [g, M] = I(), ne = i((m) => {
|
|
295
|
+
M(() => m);
|
|
292
296
|
}, []), oe = lt({
|
|
293
297
|
onPour: v,
|
|
294
298
|
onPourCancel: $,
|
|
@@ -297,42 +301,42 @@ const Le = (e) => E({
|
|
|
297
301
|
}), ae = i(() => {
|
|
298
302
|
switch (R.debug(`Navigating back from group: ${r}`), r) {
|
|
299
303
|
case G:
|
|
300
|
-
|
|
304
|
+
A(), K();
|
|
301
305
|
break;
|
|
302
306
|
case X:
|
|
303
|
-
case
|
|
304
|
-
n(e),
|
|
307
|
+
case j:
|
|
308
|
+
n(e), A(), K();
|
|
305
309
|
break;
|
|
306
310
|
}
|
|
307
|
-
}, [
|
|
308
|
-
const
|
|
309
|
-
T.publish(
|
|
310
|
-
}, [
|
|
311
|
+
}, [A, K, r, e]), ie = i(() => {
|
|
312
|
+
const m = `/kos/dispense/${s == null ? void 0 : s.path}/home/`;
|
|
313
|
+
T.publish(m, {}), n(e), e === G && (A(), K()), e === X && A();
|
|
314
|
+
}, [A, K, e]), ce = i(() => {
|
|
311
315
|
if (o.current.length === 0) {
|
|
312
316
|
R.debug("No timers to pause.");
|
|
313
317
|
return;
|
|
314
318
|
}
|
|
315
|
-
R.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((
|
|
316
|
-
R.debug(`Pausing timer with id ${
|
|
319
|
+
R.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((m) => {
|
|
320
|
+
R.debug(`Pausing timer with id ${m.id}.`), m.pause();
|
|
317
321
|
});
|
|
318
322
|
}, []), de = i(() => {
|
|
319
323
|
if (o.current.length === 0) {
|
|
320
324
|
R.debug("No timers to restart.");
|
|
321
325
|
return;
|
|
322
326
|
}
|
|
323
|
-
R.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((
|
|
324
|
-
R.debug(`Restarting timer with id ${
|
|
327
|
+
R.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((m) => {
|
|
328
|
+
R.debug(`Restarting timer with id ${m.id}.`), m.restart();
|
|
325
329
|
});
|
|
326
330
|
}, []);
|
|
327
331
|
return {
|
|
328
332
|
timers: {
|
|
329
|
-
add: i((
|
|
330
|
-
if (
|
|
331
|
-
if (o.current.some((
|
|
332
|
-
R.debug(`Timer with id ${
|
|
333
|
+
add: i((m) => {
|
|
334
|
+
if (m) {
|
|
335
|
+
if (o.current.some((S) => S.id === m.id)) {
|
|
336
|
+
R.debug(`Timer with id ${m.id} already exists.`);
|
|
333
337
|
return;
|
|
334
338
|
}
|
|
335
|
-
o.current.push(
|
|
339
|
+
o.current.push(m);
|
|
336
340
|
}
|
|
337
341
|
}, []),
|
|
338
342
|
pause: ce,
|
|
@@ -346,55 +350,55 @@ const Le = (e) => E({
|
|
|
346
350
|
pour: oe,
|
|
347
351
|
updateOnBeforePour: ne,
|
|
348
352
|
selections: {
|
|
349
|
-
[G]:
|
|
353
|
+
[G]: B,
|
|
350
354
|
[X]: te,
|
|
351
|
-
[
|
|
355
|
+
[j]: L
|
|
352
356
|
},
|
|
353
357
|
[G]: {
|
|
354
358
|
models: y,
|
|
355
359
|
companions: V,
|
|
356
|
-
clear:
|
|
360
|
+
clear: K,
|
|
357
361
|
handlers: {
|
|
358
|
-
onSelected:
|
|
362
|
+
onSelected: k
|
|
359
363
|
}
|
|
360
364
|
},
|
|
361
365
|
[X]: {
|
|
362
366
|
models: z,
|
|
363
367
|
companions: D,
|
|
364
|
-
clear:
|
|
368
|
+
clear: A,
|
|
365
369
|
handlers: {
|
|
366
370
|
onSelected: ee
|
|
367
371
|
}
|
|
368
372
|
},
|
|
369
|
-
[
|
|
370
|
-
models:
|
|
373
|
+
[j]: {
|
|
374
|
+
models: O,
|
|
371
375
|
companions: re,
|
|
372
376
|
clear: se,
|
|
373
377
|
handlers: {
|
|
374
|
-
onSelected:
|
|
378
|
+
onSelected: x
|
|
375
379
|
}
|
|
376
380
|
}
|
|
377
381
|
};
|
|
378
382
|
}, ht = (e) => {
|
|
379
|
-
const { model: t } = C(), [r, n] =
|
|
383
|
+
const { model: t } = C(), [r, n] = I(null), {
|
|
380
384
|
onAmbientTimer: s,
|
|
381
385
|
onAttractTimer: o,
|
|
382
|
-
onResetAttractTimer:
|
|
383
|
-
onResumeAttractTimer:
|
|
386
|
+
onResetAttractTimer: c,
|
|
387
|
+
onResumeAttractTimer: u,
|
|
384
388
|
defaultAttractTime: h,
|
|
385
389
|
defaultAmbientTime: f
|
|
386
|
-
} = e,
|
|
390
|
+
} = e, p = i(() => {
|
|
387
391
|
s && (w.info("Ambient timer expired. Calling callback"), s == null || s());
|
|
388
|
-
}, [s]),
|
|
392
|
+
}, [s]), d = i(() => {
|
|
389
393
|
o && (w.info("Attract timer expired. Calling callback"), o == null || o());
|
|
390
394
|
}, [o]), v = i(() => {
|
|
391
|
-
r && (r.restart(),
|
|
392
|
-
}, [r,
|
|
393
|
-
r && (r.reset(),
|
|
394
|
-
}, [r,
|
|
395
|
-
r && (r.pause(),
|
|
396
|
-
}, [r,
|
|
397
|
-
return
|
|
395
|
+
r && (r.restart(), c == null || c());
|
|
396
|
+
}, [r, c]), b = i(() => {
|
|
397
|
+
r && (r.reset(), c == null || c());
|
|
398
|
+
}, [r, c]), a = i(() => {
|
|
399
|
+
r && (r.pause(), u == null || u());
|
|
400
|
+
}, [r, u]);
|
|
401
|
+
return Y(() => {
|
|
398
402
|
if (t && h) {
|
|
399
403
|
w.info("Nozzle is available. Creating timers");
|
|
400
404
|
const $ = He.createTimer(
|
|
@@ -404,11 +408,11 @@ const Le = (e) => E({
|
|
|
404
408
|
return h && ($ == null || $.addTimeoutAction({
|
|
405
409
|
name: "attract-timer",
|
|
406
410
|
remainingTime: 0,
|
|
407
|
-
action:
|
|
411
|
+
action: d
|
|
408
412
|
})), f && ($ == null || $.addTimeoutAction({
|
|
409
413
|
name: "ambient-timer",
|
|
410
414
|
remainingTime: f,
|
|
411
|
-
action:
|
|
415
|
+
action: p
|
|
412
416
|
})), h && ($ == null || $.start()), n($ ?? null), () => {
|
|
413
417
|
$ == null || $.reset(), n(null);
|
|
414
418
|
};
|
|
@@ -419,8 +423,8 @@ const Le = (e) => E({
|
|
|
419
423
|
}, [
|
|
420
424
|
f,
|
|
421
425
|
h,
|
|
422
|
-
|
|
423
|
-
|
|
426
|
+
p,
|
|
427
|
+
d,
|
|
424
428
|
t
|
|
425
429
|
]), {
|
|
426
430
|
attractTimer: r,
|
|
@@ -438,17 +442,17 @@ const Le = (e) => E({
|
|
|
438
442
|
onBeverageCleared: n,
|
|
439
443
|
onBeverageSelected: s,
|
|
440
444
|
onFlavorCleared: o,
|
|
441
|
-
onFlavorSelected:
|
|
442
|
-
onReturnToHome:
|
|
445
|
+
onFlavorSelected: c,
|
|
446
|
+
onReturnToHome: u,
|
|
443
447
|
onPour: h,
|
|
444
448
|
onPourCancel: f,
|
|
445
|
-
onBeforePourRejected:
|
|
446
|
-
onAmbientTimer:
|
|
449
|
+
onBeforePourRejected: p,
|
|
450
|
+
onAmbientTimer: d,
|
|
447
451
|
onAttractTimer: v,
|
|
448
452
|
onResumeAttractTimer: b
|
|
449
453
|
}) => {
|
|
450
454
|
const { model: a } = C();
|
|
451
|
-
|
|
455
|
+
Y(() => {
|
|
452
456
|
const y = [
|
|
453
457
|
{
|
|
454
458
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/brand/selected/`,
|
|
@@ -468,7 +472,7 @@ const Le = (e) => E({
|
|
|
468
472
|
},
|
|
469
473
|
{
|
|
470
474
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/flavor/selected/`,
|
|
471
|
-
callback:
|
|
475
|
+
callback: c
|
|
472
476
|
},
|
|
473
477
|
{
|
|
474
478
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/flavor/cleared/`,
|
|
@@ -481,11 +485,11 @@ const Le = (e) => E({
|
|
|
481
485
|
},
|
|
482
486
|
{
|
|
483
487
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/pre/pour/rejected/`,
|
|
484
|
-
callback:
|
|
488
|
+
callback: p
|
|
485
489
|
},
|
|
486
490
|
{
|
|
487
491
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/ambient/start/`,
|
|
488
|
-
callback:
|
|
492
|
+
callback: d
|
|
489
493
|
},
|
|
490
494
|
{
|
|
491
495
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/attract/start/`,
|
|
@@ -501,47 +505,47 @@ const Le = (e) => E({
|
|
|
501
505
|
},
|
|
502
506
|
{
|
|
503
507
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/home/`,
|
|
504
|
-
callback:
|
|
508
|
+
callback: u
|
|
505
509
|
}
|
|
506
510
|
].map(
|
|
507
|
-
({ topic:
|
|
511
|
+
({ topic: k, callback: B }) => ft(k, B)
|
|
508
512
|
);
|
|
509
513
|
return () => {
|
|
510
|
-
y.forEach((
|
|
514
|
+
y.forEach((k) => k == null ? void 0 : k());
|
|
511
515
|
};
|
|
512
516
|
}, [
|
|
513
517
|
a == null ? void 0 : a.path,
|
|
514
|
-
|
|
518
|
+
d,
|
|
515
519
|
v,
|
|
516
520
|
n,
|
|
517
521
|
s,
|
|
518
522
|
r,
|
|
519
523
|
t,
|
|
520
524
|
o,
|
|
521
|
-
|
|
525
|
+
c,
|
|
522
526
|
h,
|
|
523
527
|
f,
|
|
524
528
|
b,
|
|
525
529
|
e,
|
|
526
|
-
|
|
530
|
+
u
|
|
527
531
|
]);
|
|
528
532
|
}, Ee = (e) => {
|
|
529
|
-
const { model: t } = C(), [r, n] =
|
|
533
|
+
const { model: t } = C(), [r, n] = I(null), {
|
|
530
534
|
onAreYouThereTimer: s,
|
|
531
535
|
onIdleTimer: o,
|
|
532
|
-
onResetIdleTimer:
|
|
533
|
-
defaultAreYouThereTime:
|
|
536
|
+
onResetIdleTimer: c,
|
|
537
|
+
defaultAreYouThereTime: u = 10,
|
|
534
538
|
defaultIdleTime: h = 20
|
|
535
539
|
} = e, f = i(() => {
|
|
536
540
|
s && (w.info("Are you there timer expired. Calling callback"), s == null || s());
|
|
537
|
-
}, [s]),
|
|
541
|
+
}, [s]), p = i(() => {
|
|
538
542
|
o && (w.info("Idle timer expired. Calling callback"), o == null || o());
|
|
539
|
-
}, [o]),
|
|
540
|
-
r && (r.restart(),
|
|
541
|
-
}, [r,
|
|
542
|
-
r && (r.reset(),
|
|
543
|
-
}, [r,
|
|
544
|
-
return
|
|
543
|
+
}, [o]), d = i(() => {
|
|
544
|
+
r && (r.restart(), c == null || c());
|
|
545
|
+
}, [r, c]), v = i(() => {
|
|
546
|
+
r && (r.reset(), c == null || c());
|
|
547
|
+
}, [r, c]);
|
|
548
|
+
return Y(() => {
|
|
545
549
|
if (t) {
|
|
546
550
|
w.info("Nozzle is available. Creating timers");
|
|
547
551
|
const b = He.createTimer(
|
|
@@ -551,10 +555,10 @@ const Le = (e) => E({
|
|
|
551
555
|
return b == null || b.addTimeoutAction({
|
|
552
556
|
name: "idle-timer",
|
|
553
557
|
remainingTime: 0,
|
|
554
|
-
action:
|
|
558
|
+
action: p
|
|
555
559
|
}), b == null || b.addTimeoutAction({
|
|
556
560
|
name: "are-you-there-timer",
|
|
557
|
-
remainingTime:
|
|
561
|
+
remainingTime: u,
|
|
558
562
|
action: f
|
|
559
563
|
}), n(b ?? null), () => {
|
|
560
564
|
b == null || b.reset(), n(null);
|
|
@@ -564,15 +568,15 @@ const Le = (e) => E({
|
|
|
564
568
|
w.info("Nozzle is not available. No timers to clear");
|
|
565
569
|
};
|
|
566
570
|
}, [
|
|
567
|
-
|
|
571
|
+
u,
|
|
568
572
|
h,
|
|
569
573
|
f,
|
|
570
|
-
|
|
574
|
+
p,
|
|
571
575
|
t,
|
|
572
576
|
e.prefix
|
|
573
577
|
]), {
|
|
574
578
|
idleTimer: r,
|
|
575
|
-
restart:
|
|
579
|
+
restart: d,
|
|
576
580
|
pause: v
|
|
577
581
|
};
|
|
578
582
|
}, Dt = ({
|
|
@@ -581,34 +585,34 @@ const Le = (e) => E({
|
|
|
581
585
|
pour: r,
|
|
582
586
|
screens: n
|
|
583
587
|
}) => {
|
|
584
|
-
var
|
|
585
|
-
const [s, o] =
|
|
588
|
+
var S, fe, be, ve;
|
|
589
|
+
const [s, o] = I(!1), [c, u] = I(!1), [h, f] = I(!1), { model: p } = C(), [d, v] = I(!1), b = (t == null ? void 0 : t.idleTimeout) ?? 15, a = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, $ = (r == null ? void 0 : r.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, y = (r == null ? void 0 : r.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, k = n == null ? void 0 : n.ambientTimeoutOffset, B = n == null ? void 0 : n.attractTimeout, K = i(() => {
|
|
586
590
|
o(!0);
|
|
587
591
|
}, []), V = i(() => {
|
|
588
592
|
o(!1), e == null || e.nav.home();
|
|
589
|
-
}, [(
|
|
590
|
-
|
|
591
|
-
}, [
|
|
592
|
-
|
|
593
|
-
}, [
|
|
594
|
-
|
|
595
|
-
}, [e == null ? void 0 : e.nav,
|
|
596
|
-
pause:
|
|
593
|
+
}, [(S = e == null ? void 0 : e.nav) == null ? void 0 : S.home]), z = i(() => {
|
|
594
|
+
k && (u(!0), f(!1));
|
|
595
|
+
}, [k]), ee = i(() => {
|
|
596
|
+
B && (f(!0), u(!1));
|
|
597
|
+
}, [B]), te = i(() => {
|
|
598
|
+
B && (f(!1), u(!1), e == null || e.nav.home());
|
|
599
|
+
}, [e == null ? void 0 : e.nav, B]), {
|
|
600
|
+
pause: A,
|
|
597
601
|
restart: D,
|
|
598
602
|
resume: se,
|
|
599
|
-
attractTimer:
|
|
603
|
+
attractTimer: O
|
|
600
604
|
} = ht({
|
|
601
|
-
defaultAmbientTime:
|
|
602
|
-
defaultAttractTime:
|
|
605
|
+
defaultAmbientTime: k,
|
|
606
|
+
defaultAttractTime: B,
|
|
603
607
|
onAmbientTimer: z,
|
|
604
608
|
onAttractTimer: ee,
|
|
605
609
|
onResumeAttractTimer: te
|
|
606
610
|
});
|
|
607
|
-
(fe = e == null ? void 0 : e.timers) == null || fe.add(
|
|
608
|
-
const { pause:
|
|
611
|
+
(fe = e == null ? void 0 : e.timers) == null || fe.add(O);
|
|
612
|
+
const { pause: x, restart: L, idleTimer: re } = Ee({
|
|
609
613
|
defaultAreYouThereTime: a,
|
|
610
614
|
defaultIdleTime: b,
|
|
611
|
-
onAreYouThereTimer:
|
|
615
|
+
onAreYouThereTimer: K,
|
|
612
616
|
onIdleTimer: V
|
|
613
617
|
});
|
|
614
618
|
(be = e == null ? void 0 : e.timers) == null || be.add(re);
|
|
@@ -619,30 +623,30 @@ const Le = (e) => E({
|
|
|
619
623
|
} = Ee({
|
|
620
624
|
defaultAreYouThereTime: y,
|
|
621
625
|
defaultIdleTime: $,
|
|
622
|
-
onAreYouThereTimer:
|
|
626
|
+
onAreYouThereTimer: K,
|
|
623
627
|
onIdleTimer: V,
|
|
624
628
|
prefix: "pour-"
|
|
625
629
|
});
|
|
626
630
|
(ve = e == null ? void 0 : e.timers) == null || ve.add(ne);
|
|
627
631
|
const oe = i(() => {
|
|
628
|
-
v(!1), g(),
|
|
629
|
-
}, [
|
|
630
|
-
v(!0), console.log("restarting pour timer"), M(),
|
|
631
|
-
}, [
|
|
632
|
+
v(!1), g(), x();
|
|
633
|
+
}, [x, g]), ae = i(() => {
|
|
634
|
+
v(!0), console.log("restarting pour timer"), M(), x();
|
|
635
|
+
}, [x, M]), ie = i(() => {
|
|
632
636
|
v(!1), console.log("restarting pour timer on before pour rejected"), g(), L();
|
|
633
637
|
}, []), ce = i(() => {
|
|
634
|
-
o(!1),
|
|
635
|
-
}, [
|
|
636
|
-
|
|
637
|
-
}, [
|
|
638
|
-
f(!1),
|
|
638
|
+
o(!1), d ? (M(), x()) : (L(), g());
|
|
639
|
+
}, [d, x, g, L, M]), de = i(() => {
|
|
640
|
+
A(), f(!1), u(!1), L();
|
|
641
|
+
}, [A, L]), he = i(() => {
|
|
642
|
+
f(!1), u(!1), v(!1), g(), D();
|
|
639
643
|
}, [D, g]), W = i(() => {
|
|
640
|
-
f(!1),
|
|
641
|
-
}, [
|
|
642
|
-
f(!1),
|
|
643
|
-
}, [D,
|
|
644
|
-
f(!1),
|
|
645
|
-
}, [D,
|
|
644
|
+
f(!1), u(!1), v(!1), A(), L();
|
|
645
|
+
}, [A, L]), q = i(() => {
|
|
646
|
+
f(!1), u(!1), v(!1), D(), x(), g();
|
|
647
|
+
}, [D, x, g]), J = i(() => {
|
|
648
|
+
f(!1), u(!1), D(), x();
|
|
649
|
+
}, [D, x]);
|
|
646
650
|
bt({
|
|
647
651
|
onBrandSelected: de,
|
|
648
652
|
onBrandCleared: he,
|
|
@@ -653,21 +657,21 @@ const Le = (e) => E({
|
|
|
653
657
|
onBeforePourRejected: ie,
|
|
654
658
|
onInit: J
|
|
655
659
|
});
|
|
656
|
-
const
|
|
657
|
-
return
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
T.publish(
|
|
660
|
+
const m = d ? y : a;
|
|
661
|
+
return Y(() => {
|
|
662
|
+
if (p && O) {
|
|
663
|
+
const Ze = `/kos/dispense/${p == null ? void 0 : p.path}/init/`;
|
|
664
|
+
T.publish(Ze, {});
|
|
661
665
|
}
|
|
662
|
-
}, [
|
|
666
|
+
}, [p, O]), {
|
|
663
667
|
showAreYouThere: s,
|
|
664
668
|
clearAreYouThere: ce,
|
|
665
|
-
areYouThereCountdown:
|
|
666
|
-
showAmbientScreen:
|
|
669
|
+
areYouThereCountdown: m,
|
|
670
|
+
showAmbientScreen: c,
|
|
667
671
|
showAttractScreen: h,
|
|
668
672
|
pauseScreenTimer: se
|
|
669
673
|
};
|
|
670
|
-
},
|
|
674
|
+
}, ye = () => {
|
|
671
675
|
const e = ge.type;
|
|
672
676
|
return E({
|
|
673
677
|
modelId: e,
|
|
@@ -677,22 +681,22 @@ const Le = (e) => E({
|
|
|
677
681
|
};
|
|
678
682
|
function Rt(e) {
|
|
679
683
|
return (t) => {
|
|
680
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
681
|
-
return /* @__PURE__ */
|
|
684
|
+
const { model: r, status: n, KosModelLoader: s } = ye();
|
|
685
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, deviceAssembly: r }) });
|
|
682
686
|
};
|
|
683
687
|
}
|
|
684
|
-
const
|
|
688
|
+
const Me = (e) => E({
|
|
685
689
|
modelId: e,
|
|
686
690
|
modelType: ot.type,
|
|
687
691
|
options: {}
|
|
688
692
|
});
|
|
689
693
|
function yt(e, t) {
|
|
690
694
|
return (r) => {
|
|
691
|
-
const { model: n, status: s, KosModelLoader: o } =
|
|
692
|
-
return /* @__PURE__ */
|
|
695
|
+
const { model: n, status: s, KosModelLoader: o } = Me(e);
|
|
696
|
+
return /* @__PURE__ */ l(o, { ...s, children: /* @__PURE__ */ l(t, { ...r, holder: n }) });
|
|
693
697
|
};
|
|
694
698
|
}
|
|
695
|
-
const
|
|
699
|
+
const Ye = () => {
|
|
696
700
|
const e = Te.type;
|
|
697
701
|
return E({
|
|
698
702
|
modelId: e,
|
|
@@ -702,11 +706,11 @@ const Me = () => {
|
|
|
702
706
|
};
|
|
703
707
|
function Mt(e) {
|
|
704
708
|
return (t) => {
|
|
705
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
706
|
-
return /* @__PURE__ */
|
|
709
|
+
const { model: r, status: n, KosModelLoader: s } = Ye();
|
|
710
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, holderContainer: r }) });
|
|
707
711
|
};
|
|
708
712
|
}
|
|
709
|
-
const
|
|
713
|
+
const Oe = () => {
|
|
710
714
|
const e = Ie.type;
|
|
711
715
|
return E({
|
|
712
716
|
modelId: e,
|
|
@@ -746,7 +750,7 @@ const Ye = () => {
|
|
|
746
750
|
le.debug(
|
|
747
751
|
`[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${r == null ? void 0 : r.id}.`
|
|
748
752
|
), (h = n == null ? void 0 : n.initiateEnded) == null || h.call(n, r), t == null || t();
|
|
749
|
-
}, [t, r, n]),
|
|
753
|
+
}, [t, r, n]), c = i(() => {
|
|
750
754
|
le.debug(`Force cancelling pour for nozzle ${r == null ? void 0 : r.id}.`), r == null || r.cancelPour(), t == null || t();
|
|
751
755
|
}, [t, r]);
|
|
752
756
|
return {
|
|
@@ -754,17 +758,17 @@ const Ye = () => {
|
|
|
754
758
|
onPressed: s,
|
|
755
759
|
onRelease: o
|
|
756
760
|
}).dom,
|
|
757
|
-
cancel:
|
|
761
|
+
cancel: c,
|
|
758
762
|
status: r
|
|
759
763
|
};
|
|
760
764
|
};
|
|
761
765
|
function Ot(e) {
|
|
762
766
|
return (t) => {
|
|
763
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
764
|
-
return /* @__PURE__ */
|
|
767
|
+
const { model: r, status: n, KosModelLoader: s } = Oe();
|
|
768
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, ingredient: r }) });
|
|
765
769
|
};
|
|
766
770
|
}
|
|
767
|
-
const
|
|
771
|
+
const _e = () => {
|
|
768
772
|
const e = Ae.type;
|
|
769
773
|
return E({
|
|
770
774
|
modelId: e,
|
|
@@ -772,19 +776,19 @@ const Oe = () => {
|
|
|
772
776
|
options: {}
|
|
773
777
|
});
|
|
774
778
|
};
|
|
775
|
-
function
|
|
779
|
+
function _t(e) {
|
|
776
780
|
return (t) => {
|
|
777
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
778
|
-
return /* @__PURE__ */
|
|
781
|
+
const { model: r, status: n, KosModelLoader: s } = _e();
|
|
782
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, ingredientContainer: r }) });
|
|
779
783
|
};
|
|
780
784
|
}
|
|
781
|
-
function
|
|
785
|
+
function Gt(e, t) {
|
|
782
786
|
return (r) => {
|
|
783
|
-
const { model: n, status: s, KosModelLoader: o } =
|
|
784
|
-
return /* @__PURE__ */
|
|
787
|
+
const { model: n, status: s, KosModelLoader: o } = Ce(e);
|
|
788
|
+
return /* @__PURE__ */ l(o, { ...s, children: /* @__PURE__ */ l(t, { ...r, nozzle: n }) });
|
|
785
789
|
};
|
|
786
790
|
}
|
|
787
|
-
const
|
|
791
|
+
const F = w.createLogger({
|
|
788
792
|
name: "usePour",
|
|
789
793
|
group: "kos-hooks"
|
|
790
794
|
}), jt = ({
|
|
@@ -793,59 +797,59 @@ const j = w.createLogger({
|
|
|
793
797
|
onPourCancel: r,
|
|
794
798
|
onPourAbort: n,
|
|
795
799
|
pourTarget: s,
|
|
796
|
-
strategy: o =
|
|
800
|
+
strategy: o = Re
|
|
797
801
|
}) => {
|
|
798
|
-
const
|
|
799
|
-
|
|
802
|
+
const c = i(async () => {
|
|
803
|
+
F.debug(
|
|
800
804
|
`[${o == null ? void 0 : o.name}] - calling before pour for pour target ${s == null ? void 0 : s.id}.`
|
|
801
|
-
), (e ? await (e == null ? void 0 : e()) : !0) ? (
|
|
805
|
+
), (e ? await (e == null ? void 0 : e()) : !0) ? (F.debug(
|
|
802
806
|
`[${o == null ? void 0 : o.name}] - Pour initiated for pour target ${s == null ? void 0 : s.id}.`
|
|
803
|
-
), await (o == null ? void 0 : o.initiate(s)), t == null || t(), s != null && s.isPouring || n == null || n()) : (
|
|
807
|
+
), await (o == null ? void 0 : o.initiate(s)), t == null || t(), s != null && s.isPouring || n == null || n()) : (F.debug(
|
|
804
808
|
`[${o == null ? void 0 : o.name}] - Pour cancelled for pour target ${s == null ? void 0 : s.id}.`
|
|
805
809
|
), r == null || r());
|
|
806
|
-
}, [t, s, o]),
|
|
807
|
-
var
|
|
808
|
-
|
|
810
|
+
}, [t, s, o]), u = i(async () => {
|
|
811
|
+
var d;
|
|
812
|
+
F.debug(
|
|
809
813
|
`[${o == null ? void 0 : o.name}] - Pour initiate ended called for pour target ${s == null ? void 0 : s.id}.`
|
|
810
|
-
), await ((
|
|
814
|
+
), await ((d = o == null ? void 0 : o.initiateEnded) == null ? void 0 : d.call(o, s)) || r == null || r();
|
|
811
815
|
}, [r, s, o]), h = i(async () => {
|
|
812
|
-
|
|
816
|
+
F.debug(`Force cancelling pour for pour target ${s == null ? void 0 : s.id}.`), await (s == null ? void 0 : s.cancelPour()), r == null || r();
|
|
813
817
|
}, [r, s]);
|
|
814
818
|
return {
|
|
815
819
|
handlers: me({
|
|
816
|
-
onPressed:
|
|
817
|
-
onRelease:
|
|
820
|
+
onPressed: c,
|
|
821
|
+
onRelease: u
|
|
818
822
|
}).dom,
|
|
819
823
|
cancel: h,
|
|
820
824
|
status: s
|
|
821
825
|
};
|
|
822
|
-
},
|
|
826
|
+
}, U = w.createLogger({
|
|
823
827
|
name: "TapOrHoldIntentStrategy",
|
|
824
828
|
group: "kos-hooks"
|
|
825
829
|
});
|
|
826
830
|
class Ft {
|
|
827
831
|
constructor(t) {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
+
_(this, "intent");
|
|
833
|
+
_(this, "name", "TapOrHoldIntentStrategy");
|
|
834
|
+
_(this, "isHold", !1);
|
|
835
|
+
_(this, "disposer", null);
|
|
832
836
|
this.intent = t;
|
|
833
837
|
}
|
|
834
838
|
async initiate(t, r) {
|
|
835
839
|
if (this.disposer = setTimeout(() => {
|
|
836
840
|
this.isHold = !0;
|
|
837
841
|
}, 250), t != null && t.isPouring && !this.isHold) {
|
|
838
|
-
|
|
842
|
+
U.debug("additional tap detected. cancelling pour"), await t.cancelPour();
|
|
839
843
|
return;
|
|
840
844
|
}
|
|
841
845
|
if (!(t != null && t.canPour)) {
|
|
842
|
-
|
|
846
|
+
U.debug(`${t == null ? void 0 : t.id} cannot pour. Returning early.`);
|
|
843
847
|
return;
|
|
844
848
|
}
|
|
845
|
-
r ? (
|
|
849
|
+
r ? (U.debug(`performing intent: ${r}`), await (t == null ? void 0 : t.performIntent(r))) : U.debug("no intent provided. Returning early.");
|
|
846
850
|
}
|
|
847
851
|
async initiateEnded(t) {
|
|
848
|
-
return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (
|
|
852
|
+
return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (U.debug("Tap detected. don't cancel and return."), !0);
|
|
849
853
|
}
|
|
850
854
|
}
|
|
851
855
|
const Z = w.createLogger({
|
|
@@ -867,18 +871,18 @@ const Z = w.createLogger({
|
|
|
867
871
|
async initiateEnded(e) {
|
|
868
872
|
return !0;
|
|
869
873
|
}
|
|
870
|
-
},
|
|
874
|
+
}, Ne = w.createLogger({
|
|
871
875
|
name: "HoldToPourStrategy",
|
|
872
876
|
group: "kos-hooks"
|
|
873
877
|
}), Vt = {
|
|
874
878
|
name: "TapToPourStrategy",
|
|
875
879
|
async initiate(e) {
|
|
876
880
|
if (e != null && e.isPouring) {
|
|
877
|
-
|
|
881
|
+
Ne.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
|
|
878
882
|
return;
|
|
879
883
|
}
|
|
880
884
|
if (!(e != null && e.canPour)) {
|
|
881
|
-
|
|
885
|
+
Ne.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
882
886
|
return;
|
|
883
887
|
}
|
|
884
888
|
await (e == null ? void 0 : e.pour());
|
|
@@ -901,14 +905,14 @@ function Wt(e) {
|
|
|
901
905
|
t.servicePathFactory,
|
|
902
906
|
t.itemId
|
|
903
907
|
);
|
|
904
|
-
return /* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ l(s, { ...n, children: /* @__PURE__ */ l(e, { ...t, genericPour: r }) });
|
|
905
909
|
};
|
|
906
910
|
}
|
|
907
|
-
const Ge =
|
|
911
|
+
const Ge = H(void 0), qt = ({ children: e }) => {
|
|
908
912
|
const { model: t, ready: r } = Se(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
909
|
-
return /* @__PURE__ */
|
|
913
|
+
return /* @__PURE__ */ l(Ge.Provider, { value: n, children: e });
|
|
910
914
|
}, Jt = () => {
|
|
911
|
-
const e =
|
|
915
|
+
const e = N(
|
|
912
916
|
Ge
|
|
913
917
|
);
|
|
914
918
|
if (!e)
|
|
@@ -916,47 +920,47 @@ const Ge = S(void 0), qt = ({ children: e }) => {
|
|
|
916
920
|
"useAssemblyContext must be used within a AssemblyProvider"
|
|
917
921
|
);
|
|
918
922
|
return e;
|
|
919
|
-
},
|
|
920
|
-
const { model: t, ready: r } =
|
|
921
|
-
return /* @__PURE__ */
|
|
923
|
+
}, je = H(void 0), Qt = ({ children: e }) => {
|
|
924
|
+
const { model: t, ready: r } = Be(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
925
|
+
return /* @__PURE__ */ l(je.Provider, { value: n, children: e });
|
|
922
926
|
}, Xt = () => {
|
|
923
|
-
const e =
|
|
927
|
+
const e = N(je);
|
|
924
928
|
if (!e)
|
|
925
929
|
throw new Error(
|
|
926
930
|
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
927
931
|
);
|
|
928
932
|
return e;
|
|
929
|
-
},
|
|
933
|
+
}, Fe = H(void 0), Zt = ({ children: e, id: t }) => {
|
|
930
934
|
const { model: r, ready: n } = Ke(t), s = P(() => n && r ? { model: r } : {}, [n, r]);
|
|
931
|
-
return /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ l(Fe.Provider, { value: s, children: e });
|
|
932
936
|
}, zt = () => {
|
|
933
|
-
const e =
|
|
937
|
+
const e = N(Fe);
|
|
934
938
|
if (!e)
|
|
935
939
|
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
936
940
|
return e;
|
|
937
|
-
},
|
|
938
|
-
const { model: t, ready: r } =
|
|
939
|
-
return /* @__PURE__ */
|
|
941
|
+
}, Ue = H(void 0), es = ({ children: e }) => {
|
|
942
|
+
const { model: t, ready: r } = Le(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
943
|
+
return /* @__PURE__ */ l(Ue.Provider, { value: n, children: e });
|
|
940
944
|
}, ts = () => {
|
|
941
|
-
const e =
|
|
945
|
+
const e = N(Ue);
|
|
942
946
|
if (!e)
|
|
943
947
|
throw new Error(
|
|
944
948
|
"useBoardContainerContext must be used within a BoardContainerProvider"
|
|
945
949
|
);
|
|
946
950
|
return e;
|
|
947
|
-
},
|
|
951
|
+
}, Ve = H(
|
|
948
952
|
void 0
|
|
949
953
|
), wt = ({ children: e }) => {
|
|
950
|
-
const { model: t, ready: r } =
|
|
954
|
+
const { model: t, ready: r } = ye(), n = P(() => {
|
|
951
955
|
if (r && t) {
|
|
952
956
|
const o = t.nozzlePaths;
|
|
953
957
|
return { model: t, nozzlePaths: o };
|
|
954
958
|
}
|
|
955
959
|
return {};
|
|
956
960
|
}, [r, t]), s = r && t ? e : null;
|
|
957
|
-
return /* @__PURE__ */
|
|
961
|
+
return /* @__PURE__ */ l(Ve.Provider, { value: n, children: s });
|
|
958
962
|
}, Pt = () => {
|
|
959
|
-
const e =
|
|
963
|
+
const e = N(Ve);
|
|
960
964
|
if (!e)
|
|
961
965
|
throw new Error(
|
|
962
966
|
"useDeviceAssemblyContext must be used within a DeviceAssemblyProvider"
|
|
@@ -966,36 +970,48 @@ const Ge = S(void 0), qt = ({ children: e }) => {
|
|
|
966
970
|
function gt() {
|
|
967
971
|
const e = tt.createContext(null);
|
|
968
972
|
return [() => {
|
|
969
|
-
const r =
|
|
973
|
+
const r = N(e);
|
|
970
974
|
if (r === void 0)
|
|
971
975
|
throw new Error("useDispenseKitContext must be used within a Provider");
|
|
972
976
|
return r;
|
|
973
977
|
}, e.Provider];
|
|
974
978
|
}
|
|
975
|
-
function Tt({
|
|
976
|
-
|
|
977
|
-
|
|
979
|
+
function Tt({
|
|
980
|
+
children: e,
|
|
981
|
+
provider: t,
|
|
982
|
+
props: r,
|
|
983
|
+
nozzleProps: n
|
|
984
|
+
}) {
|
|
985
|
+
const s = mt(r);
|
|
986
|
+
return /* @__PURE__ */ l(t, { value: s, children: e(n || {}) });
|
|
978
987
|
}
|
|
979
988
|
function It({
|
|
980
989
|
children: e,
|
|
981
990
|
provider: t,
|
|
982
991
|
props: r
|
|
983
992
|
}) {
|
|
984
|
-
const { nozzlePaths: n } = Pt();
|
|
985
|
-
return (n == null ? void 0 : n.map((
|
|
993
|
+
const { nozzlePaths: n } = Pt(), s = (n == null ? void 0 : n.length) || 0;
|
|
994
|
+
return (n == null ? void 0 : n.map((c, u) => /* @__PURE__ */ l(it, { path: c, children: /* @__PURE__ */ l(
|
|
986
995
|
Tt,
|
|
987
996
|
{
|
|
988
997
|
provider: t,
|
|
989
998
|
props: r,
|
|
999
|
+
nozzleProps: {
|
|
1000
|
+
nozzleIndex: u,
|
|
1001
|
+
nozzlePath: c,
|
|
1002
|
+
totalNozzles: s,
|
|
1003
|
+
isFirstNozzle: u === 0,
|
|
1004
|
+
isLastNozzle: u === s - 1
|
|
1005
|
+
},
|
|
990
1006
|
children: e
|
|
991
1007
|
}
|
|
992
|
-
) },
|
|
1008
|
+
) }, c))) || [];
|
|
993
1009
|
}
|
|
994
1010
|
function At({
|
|
995
1011
|
provider: e,
|
|
996
1012
|
props: t
|
|
997
1013
|
}) {
|
|
998
|
-
return ({ children: r }) => e ? /* @__PURE__ */
|
|
1014
|
+
return ({ children: r }) => e ? /* @__PURE__ */ l(wt, { children: /* @__PURE__ */ l(
|
|
999
1015
|
It,
|
|
1000
1016
|
{
|
|
1001
1017
|
provider: e,
|
|
@@ -1011,43 +1027,43 @@ function ss(e) {
|
|
|
1011
1027
|
At({ provider: r, props: e })
|
|
1012
1028
|
];
|
|
1013
1029
|
}
|
|
1014
|
-
const
|
|
1015
|
-
const { model: r, ready: n } =
|
|
1016
|
-
return /* @__PURE__ */
|
|
1030
|
+
const We = H(void 0), rs = ({ children: e, id: t }) => {
|
|
1031
|
+
const { model: r, ready: n } = Me(t || ""), s = P(() => n && r ? { model: r } : {}, [n, r]);
|
|
1032
|
+
return /* @__PURE__ */ l(We.Provider, { value: s, children: e });
|
|
1017
1033
|
}, ns = () => {
|
|
1018
|
-
const e =
|
|
1034
|
+
const e = N(We);
|
|
1019
1035
|
if (!e)
|
|
1020
1036
|
throw new Error("useHolderContext must be used within a HolderProvider");
|
|
1021
1037
|
return e;
|
|
1022
|
-
},
|
|
1038
|
+
}, qe = H(
|
|
1023
1039
|
void 0
|
|
1024
1040
|
), os = ({ children: e }) => {
|
|
1025
|
-
const { model: t, ready: r } =
|
|
1026
|
-
return /* @__PURE__ */
|
|
1041
|
+
const { model: t, ready: r } = Ye(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1042
|
+
return /* @__PURE__ */ l(qe.Provider, { value: n, children: e });
|
|
1027
1043
|
}, as = () => {
|
|
1028
|
-
const e =
|
|
1044
|
+
const e = N(qe);
|
|
1029
1045
|
if (!e)
|
|
1030
1046
|
throw new Error(
|
|
1031
1047
|
"useHolderContainerContext must be used within a HolderContainerProvider"
|
|
1032
1048
|
);
|
|
1033
1049
|
return e;
|
|
1034
|
-
},
|
|
1035
|
-
const { model: t, ready: r } =
|
|
1036
|
-
return /* @__PURE__ */
|
|
1050
|
+
}, Je = H(void 0), is = ({ children: e }) => {
|
|
1051
|
+
const { model: t, ready: r } = Oe(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1052
|
+
return /* @__PURE__ */ l(Je.Provider, { value: n, children: e });
|
|
1037
1053
|
}, cs = () => {
|
|
1038
|
-
const e =
|
|
1054
|
+
const e = N(Je);
|
|
1039
1055
|
if (!e)
|
|
1040
1056
|
throw new Error(
|
|
1041
1057
|
"useIngredientContext must be used within a IngredientProvider"
|
|
1042
1058
|
);
|
|
1043
1059
|
return e;
|
|
1044
|
-
},
|
|
1060
|
+
}, Qe = H(
|
|
1045
1061
|
void 0
|
|
1046
1062
|
), ds = ({ children: e }) => {
|
|
1047
|
-
const { model: t, ready: r } =
|
|
1048
|
-
return /* @__PURE__ */
|
|
1063
|
+
const { model: t, ready: r } = _e(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1064
|
+
return /* @__PURE__ */ l(Qe.Provider, { value: n, children: e });
|
|
1049
1065
|
}, us = () => {
|
|
1050
|
-
const e =
|
|
1066
|
+
const e = N(Qe);
|
|
1051
1067
|
if (!e)
|
|
1052
1068
|
throw new Error(
|
|
1053
1069
|
"useIngredientContainerContext must be used within a IngredientContainerProvider"
|
|
@@ -1060,17 +1076,17 @@ const Ve = S(void 0), rs = ({ children: e, id: t }) => {
|
|
|
1060
1076
|
modelType: xe.type,
|
|
1061
1077
|
options: {}
|
|
1062
1078
|
});
|
|
1063
|
-
},
|
|
1079
|
+
}, Xe = H(void 0), ls = ({ children: e }) => {
|
|
1064
1080
|
const { model: t, ready: r } = xt(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1065
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ l(Xe.Provider, { value: n, children: e });
|
|
1066
1082
|
}, ps = () => {
|
|
1067
|
-
const e =
|
|
1083
|
+
const e = N(Xe);
|
|
1068
1084
|
if (!e)
|
|
1069
1085
|
throw new Error("usePumpContext must be used within a PumpProvider");
|
|
1070
1086
|
return e;
|
|
1071
1087
|
};
|
|
1072
1088
|
export {
|
|
1073
|
-
|
|
1089
|
+
_t as $,
|
|
1074
1090
|
qt as A,
|
|
1075
1091
|
Zt as B,
|
|
1076
1092
|
Tt as C,
|
|
@@ -1080,7 +1096,7 @@ export {
|
|
|
1080
1096
|
X as G,
|
|
1081
1097
|
rs as H,
|
|
1082
1098
|
is as I,
|
|
1083
|
-
|
|
1099
|
+
j as J,
|
|
1084
1100
|
mt as K,
|
|
1085
1101
|
Dt as L,
|
|
1086
1102
|
bt as M,
|
|
@@ -1088,23 +1104,23 @@ export {
|
|
|
1088
1104
|
Ee as O,
|
|
1089
1105
|
ls as P,
|
|
1090
1106
|
pt as Q,
|
|
1091
|
-
|
|
1107
|
+
ye as R,
|
|
1092
1108
|
Rt as S,
|
|
1093
|
-
|
|
1109
|
+
Me as T,
|
|
1094
1110
|
yt as U,
|
|
1095
|
-
|
|
1111
|
+
Ye as V,
|
|
1096
1112
|
Mt as W,
|
|
1097
|
-
|
|
1113
|
+
Oe as X,
|
|
1098
1114
|
Yt as Y,
|
|
1099
1115
|
Ot as Z,
|
|
1100
|
-
|
|
1116
|
+
_e as _,
|
|
1101
1117
|
Qt as a,
|
|
1102
|
-
|
|
1103
|
-
|
|
1118
|
+
Ce as a0,
|
|
1119
|
+
Gt as a1,
|
|
1104
1120
|
lt as a2,
|
|
1105
1121
|
jt as a3,
|
|
1106
1122
|
vt as a4,
|
|
1107
|
-
|
|
1123
|
+
Re as a5,
|
|
1108
1124
|
Ft as a6,
|
|
1109
1125
|
Ut as a7,
|
|
1110
1126
|
Vt as a8,
|
|
@@ -1126,14 +1142,14 @@ export {
|
|
|
1126
1142
|
C as o,
|
|
1127
1143
|
ps as p,
|
|
1128
1144
|
Se as q,
|
|
1129
|
-
|
|
1130
|
-
|
|
1145
|
+
Be as r,
|
|
1146
|
+
Kt as s,
|
|
1131
1147
|
Ke as t,
|
|
1132
1148
|
Jt as u,
|
|
1133
1149
|
Lt as v,
|
|
1134
|
-
|
|
1135
|
-
|
|
1150
|
+
Bt as w,
|
|
1151
|
+
Le as x,
|
|
1136
1152
|
Ct as y,
|
|
1137
1153
|
ct as z
|
|
1138
1154
|
};
|
|
1139
|
-
//# sourceMappingURL=pump-provider-
|
|
1155
|
+
//# sourceMappingURL=pump-provider-jdIoS5JD.js.map
|