@danidoble/webserial 4.2.3 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arduino.cjs +1 -1
- package/dist/arduino.js +1 -1
- package/dist/boardroid.cjs +1 -1
- package/dist/boardroid.js +1 -1
- package/dist/jofemar.cjs +1 -1
- package/dist/jofemar.js +1 -1
- package/dist/{kernel-B15wfB2x.js → kernel-BFXQSiNz.js} +381 -408
- package/dist/kernel-C0epz_jB.cjs +4 -0
- package/dist/kernel.cjs +2 -2
- package/dist/kernel.js +3 -3
- package/dist/locker.cjs +1 -1
- package/dist/locker.js +1 -1
- package/dist/pinpad.cjs +13 -13
- package/dist/pinpad.js +569 -560
- package/dist/pinpax.cjs +2 -2
- package/dist/pinpax.js +1 -1
- package/dist/relay.cjs +1 -1
- package/dist/relay.js +1 -1
- package/dist/webserial.cjs +2 -2
- package/dist/webserial.js +3 -3
- package/package.json +6 -6
- package/dist/kernel-CtyQRsMI.cjs +0 -4
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ce = Object.defineProperty;
|
|
2
|
+
var W = (l) => {
|
|
3
3
|
throw TypeError(l);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var w = (l, e, t) => (
|
|
8
|
-
function
|
|
5
|
+
var ue = (l, e, t) => e in l ? ce(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
6
|
+
var N = (l, e, t) => ue(l, typeof e != "symbol" ? e + "" : e, t), F = (l, e, t) => e.has(l) || W("Cannot " + t);
|
|
7
|
+
var w = (l, e, t) => (F(l, e, "read from private field"), t ? t.call(l) : e.get(l)), U = (l, e, t) => e.has(l) ? W("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), j = (l, e, t, n) => (F(l, e, "write to private field"), n ? n.call(l, t) : e.set(l, t), t), a = (l, e, t) => (F(l, e, "access private method"), t);
|
|
8
|
+
function _e(l = 100) {
|
|
9
9
|
return new Promise((e) => setTimeout(() => e(), l));
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function ve() {
|
|
12
12
|
return "serial" in navigator;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ke() {
|
|
15
15
|
return "geolocation" in navigator;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Ce() {
|
|
18
18
|
return "crypto" in window;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function De(l = 1) {
|
|
21
21
|
return l * 1e3;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Se(l) {
|
|
24
24
|
return l == null || l === "";
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var v, S, s, Y, Z, c, q, p, d, I, o, $, T;
|
|
27
27
|
const r = class r {
|
|
28
28
|
static status(e = null) {
|
|
29
|
-
var n,
|
|
30
|
-
if (!a(n = r,
|
|
29
|
+
var n, i;
|
|
30
|
+
if (!a(n = r, s, c).call(n, e)) return !1;
|
|
31
31
|
let t = [];
|
|
32
|
-
switch (w(r,
|
|
32
|
+
switch (w(r, v)) {
|
|
33
33
|
case "locker":
|
|
34
34
|
t = ["0", "8"];
|
|
35
35
|
break;
|
|
36
36
|
case "boardroid":
|
|
37
|
-
t = ["2", (5 + w(r,
|
|
37
|
+
t = ["2", (5 + w(r, S)).toString(16).toUpperCase()];
|
|
38
38
|
break;
|
|
39
39
|
case "jofemar":
|
|
40
40
|
t = ["6"];
|
|
@@ -42,13 +42,13 @@ const r = class r {
|
|
|
42
42
|
default:
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
|
-
a(
|
|
45
|
+
a(i = r, s, o).call(i, t);
|
|
46
46
|
}
|
|
47
47
|
static dispensed(e = null) {
|
|
48
|
-
var n,
|
|
49
|
-
if (!a(n = r,
|
|
48
|
+
var n, i;
|
|
49
|
+
if (!a(n = r, s, c).call(n, e)) return !1;
|
|
50
50
|
let t = [];
|
|
51
|
-
switch (w(r,
|
|
51
|
+
switch (w(r, v)) {
|
|
52
52
|
case "locker":
|
|
53
53
|
t = ["0", "7", "4", "4", "4"];
|
|
54
54
|
break;
|
|
@@ -61,13 +61,13 @@ const r = class r {
|
|
|
61
61
|
default:
|
|
62
62
|
return !1;
|
|
63
63
|
}
|
|
64
|
-
a(
|
|
64
|
+
a(i = r, s, o).call(i, t);
|
|
65
65
|
}
|
|
66
66
|
static notDispensed(e = null) {
|
|
67
|
-
var n,
|
|
68
|
-
if (!a(n = r,
|
|
67
|
+
var n, i;
|
|
68
|
+
if (!a(n = r, s, c).call(n, e)) return !1;
|
|
69
69
|
let t = [];
|
|
70
|
-
switch (w(r,
|
|
70
|
+
switch (w(r, v)) {
|
|
71
71
|
case "locker":
|
|
72
72
|
t = ["0", "7", "5", "5", "5"];
|
|
73
73
|
break;
|
|
@@ -80,30 +80,30 @@ const r = class r {
|
|
|
80
80
|
default:
|
|
81
81
|
return !1;
|
|
82
82
|
}
|
|
83
|
-
a(
|
|
83
|
+
a(i = r, s, o).call(i, t);
|
|
84
84
|
}
|
|
85
85
|
static gateInactive(e = null) {
|
|
86
86
|
var t;
|
|
87
|
-
if (!a(t = r,
|
|
88
|
-
a(this,
|
|
87
|
+
if (!a(t = r, s, c).call(t, e) || !a(this, s, q).call(this)) return !1;
|
|
88
|
+
a(this, s, o).call(this, ["0", "7", "5", "5", "5"]);
|
|
89
89
|
}
|
|
90
90
|
static gateConfigured(e = null) {
|
|
91
91
|
var t;
|
|
92
|
-
if (!a(t = r,
|
|
93
|
-
a(this,
|
|
92
|
+
if (!a(t = r, s, c).call(t, e) || !a(this, s, q).call(this)) return !1;
|
|
93
|
+
a(this, s, o).call(this, ["0", "6"]);
|
|
94
94
|
}
|
|
95
95
|
static keyPressed(e = null) {
|
|
96
96
|
var u, g, f;
|
|
97
|
-
if (!a(u = r,
|
|
98
|
-
const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], n = (128 + w(r,
|
|
99
|
-
a(f = r,
|
|
97
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, d).call(g)) return !1;
|
|
98
|
+
const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], n = (128 + w(r, S)).toString(16), i = Math.floor(Math.random() * 15);
|
|
99
|
+
a(f = r, s, o).call(f, ["2", n, "54", t[i]]);
|
|
100
100
|
}
|
|
101
101
|
static doorOpened(e = null) {
|
|
102
|
-
var
|
|
103
|
-
if (!a(
|
|
102
|
+
var i, u;
|
|
103
|
+
if (!a(i = r, s, c).call(i, e) || !a(this, s, I).call(this)) return !1;
|
|
104
104
|
let t = [];
|
|
105
|
-
const n = (128 + w(r,
|
|
106
|
-
switch (w(r,
|
|
105
|
+
const n = (128 + w(r, S)).toString(16);
|
|
106
|
+
switch (w(r, v)) {
|
|
107
107
|
case "boardroid":
|
|
108
108
|
t = ["2", "D8", "dc"];
|
|
109
109
|
break;
|
|
@@ -111,14 +111,14 @@ const r = class r {
|
|
|
111
111
|
t = ["2", n, "50", "4F"];
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
|
-
a(u = r,
|
|
114
|
+
a(u = r, s, o).call(u, t);
|
|
115
115
|
}
|
|
116
116
|
static doorClosed(e = null) {
|
|
117
|
-
var
|
|
118
|
-
if (!a(
|
|
117
|
+
var i, u;
|
|
118
|
+
if (!a(i = r, s, c).call(i, e) || !a(this, s, I).call(this)) return !1;
|
|
119
119
|
let t = [];
|
|
120
|
-
const n = (128 + w(r,
|
|
121
|
-
switch (w(r,
|
|
120
|
+
const n = (128 + w(r, S)).toString(16);
|
|
121
|
+
switch (w(r, v)) {
|
|
122
122
|
case "boardroid":
|
|
123
123
|
t = ["2", "D8", "db"];
|
|
124
124
|
break;
|
|
@@ -126,38 +126,38 @@ const r = class r {
|
|
|
126
126
|
t = ["2", n, "50", "43"];
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
|
-
a(u = r,
|
|
129
|
+
a(u = r, s, o).call(u, t);
|
|
130
130
|
}
|
|
131
131
|
static channelDisconnected(e = null) {
|
|
132
|
-
var n,
|
|
133
|
-
if (!a(n = r,
|
|
134
|
-
const t = (128 + w(r,
|
|
135
|
-
a(u = r,
|
|
132
|
+
var n, i, u;
|
|
133
|
+
if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
|
|
134
|
+
const t = (128 + w(r, S)).toString(16);
|
|
135
|
+
a(u = r, s, o).call(u, ["2", t, "43", "43", "43", "FD"]);
|
|
136
136
|
}
|
|
137
137
|
static channelConnected(e = null) {
|
|
138
|
-
var n,
|
|
139
|
-
if (!a(n = r,
|
|
140
|
-
const t = (128 + w(r,
|
|
141
|
-
a(u = r,
|
|
138
|
+
var n, i, u;
|
|
139
|
+
if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
|
|
140
|
+
const t = (128 + w(r, S)).toString(16);
|
|
141
|
+
a(u = r, s, o).call(u, ["2", t, "43", "43", "43", "FC"]);
|
|
142
142
|
}
|
|
143
143
|
static channelEmpty(e = null) {
|
|
144
|
-
var n,
|
|
145
|
-
if (!a(n = r,
|
|
146
|
-
const t = (128 + w(r,
|
|
147
|
-
a(u = r,
|
|
144
|
+
var n, i, u;
|
|
145
|
+
if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
|
|
146
|
+
const t = (128 + w(r, S)).toString(16);
|
|
147
|
+
a(u = r, s, o).call(u, ["2", t, "43", "43", "43", "FF"]);
|
|
148
148
|
}
|
|
149
149
|
static workingTemperature(e = null) {
|
|
150
|
-
var n,
|
|
151
|
-
if (!a(n = r,
|
|
152
|
-
const t = (128 + w(r,
|
|
153
|
-
a(u = r,
|
|
150
|
+
var n, i, u;
|
|
151
|
+
if (!a(n = r, s, c).call(n, e) || !a(i = r, s, d).call(i)) return !1;
|
|
152
|
+
const t = (128 + w(r, S)).toString(16);
|
|
153
|
+
a(u = r, s, o).call(u, ["2", t, "43", "54", "16"]);
|
|
154
154
|
}
|
|
155
155
|
static currentTemperature(e = null) {
|
|
156
|
-
var
|
|
157
|
-
if (!a(
|
|
156
|
+
var i, u, g;
|
|
157
|
+
if (!a(i = r, s, c).call(i, e) || !a(u = r, s, I).call(u)) return !1;
|
|
158
158
|
let t = [];
|
|
159
|
-
const n = (128 + w(r,
|
|
160
|
-
switch (w(r,
|
|
159
|
+
const n = (128 + w(r, S)).toString(16);
|
|
160
|
+
switch (w(r, v)) {
|
|
161
161
|
case "boardroid":
|
|
162
162
|
t = ["2", "D9", "44", "30"];
|
|
163
163
|
break;
|
|
@@ -165,217 +165,217 @@ const r = class r {
|
|
|
165
165
|
t = ["2", n, "43", "74", "2B", "30", "39", "2E", "31", "7F", "43"];
|
|
166
166
|
break;
|
|
167
167
|
}
|
|
168
|
-
a(g = r,
|
|
168
|
+
a(g = r, s, o).call(g, t);
|
|
169
169
|
}
|
|
170
170
|
static ready(e = null) {
|
|
171
|
-
var t, n,
|
|
172
|
-
if (!a(t = r,
|
|
173
|
-
a(
|
|
171
|
+
var t, n, i;
|
|
172
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
173
|
+
a(i = r, s, o).call(i, ["6", "30"]);
|
|
174
174
|
}
|
|
175
175
|
static busy(e = null) {
|
|
176
|
-
var t, n,
|
|
177
|
-
if (!a(t = r,
|
|
178
|
-
a(
|
|
176
|
+
var t, n, i;
|
|
177
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
178
|
+
a(i = r, s, o).call(i, ["6", "31"]);
|
|
179
179
|
}
|
|
180
180
|
static invalidTray(e = null) {
|
|
181
|
-
var t, n,
|
|
182
|
-
if (!a(t = r,
|
|
183
|
-
a(
|
|
181
|
+
var t, n, i;
|
|
182
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
183
|
+
a(i = r, s, o).call(i, ["6", "32"]);
|
|
184
184
|
}
|
|
185
185
|
static invalidChannel(e = null) {
|
|
186
|
-
var t, n,
|
|
187
|
-
if (!a(t = r,
|
|
188
|
-
a(
|
|
186
|
+
var t, n, i;
|
|
187
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
188
|
+
a(i = r, s, o).call(i, ["6", "33"]);
|
|
189
189
|
}
|
|
190
190
|
static emptyChannel(e = null) {
|
|
191
|
-
var t, n,
|
|
192
|
-
if (!a(t = r,
|
|
193
|
-
a(
|
|
191
|
+
var t, n, i;
|
|
192
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
193
|
+
a(i = r, s, o).call(i, ["6", "34"]);
|
|
194
194
|
}
|
|
195
195
|
static elevatorJam(e = null) {
|
|
196
|
-
var t, n,
|
|
197
|
-
if (!a(t = r,
|
|
198
|
-
a(
|
|
196
|
+
var t, n, i;
|
|
197
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
198
|
+
a(i = r, s, o).call(i, ["6", "35"]);
|
|
199
199
|
}
|
|
200
200
|
static elevatorMalfunction(e = null) {
|
|
201
|
-
var t, n,
|
|
202
|
-
if (!a(t = r,
|
|
203
|
-
a(
|
|
201
|
+
var t, n, i;
|
|
202
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
203
|
+
a(i = r, s, o).call(i, ["6", "36"]);
|
|
204
204
|
}
|
|
205
205
|
static phototransistorFailure(e = null) {
|
|
206
|
-
var t, n,
|
|
207
|
-
if (!a(t = r,
|
|
208
|
-
a(
|
|
206
|
+
var t, n, i;
|
|
207
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
208
|
+
a(i = r, s, o).call(i, ["6", "37"]);
|
|
209
209
|
}
|
|
210
210
|
static allChannelsEmpty(e = null) {
|
|
211
|
-
var t, n,
|
|
212
|
-
if (!a(t = r,
|
|
213
|
-
a(
|
|
211
|
+
var t, n, i;
|
|
212
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
213
|
+
a(i = r, s, o).call(i, ["6", "38"]);
|
|
214
214
|
}
|
|
215
215
|
static productDetectorFailure(e = null) {
|
|
216
|
-
var t, n,
|
|
217
|
-
if (!a(t = r,
|
|
218
|
-
a(
|
|
216
|
+
var t, n, i;
|
|
217
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
218
|
+
a(i = r, s, o).call(i, ["6", "39"]);
|
|
219
219
|
}
|
|
220
220
|
static displayDisconnected(e = null) {
|
|
221
|
-
var t, n,
|
|
222
|
-
if (!a(t = r,
|
|
223
|
-
a(
|
|
221
|
+
var t, n, i;
|
|
222
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
223
|
+
a(i = r, s, o).call(i, ["6", "41"]);
|
|
224
224
|
}
|
|
225
225
|
static productUnderElevator(e = null) {
|
|
226
|
-
var t, n,
|
|
227
|
-
if (!a(t = r,
|
|
228
|
-
a(
|
|
226
|
+
var t, n, i;
|
|
227
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
228
|
+
a(i = r, s, o).call(i, ["6", "42"]);
|
|
229
229
|
}
|
|
230
230
|
static elevatorSettingAlarm(e = null) {
|
|
231
|
-
var t, n,
|
|
232
|
-
if (!a(t = r,
|
|
233
|
-
a(
|
|
231
|
+
var t, n, i;
|
|
232
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
233
|
+
a(i = r, s, o).call(i, ["6", "43"]);
|
|
234
234
|
}
|
|
235
235
|
static buttonPanelFailure(e = null) {
|
|
236
|
-
var t, n,
|
|
237
|
-
if (!a(t = r,
|
|
238
|
-
a(
|
|
236
|
+
var t, n, i;
|
|
237
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
238
|
+
a(i = r, s, o).call(i, ["6", "44"]);
|
|
239
239
|
}
|
|
240
240
|
static errorWritingEeprom(e = null) {
|
|
241
|
-
var t, n,
|
|
242
|
-
if (!a(t = r,
|
|
243
|
-
a(
|
|
241
|
+
var t, n, i;
|
|
242
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
243
|
+
a(i = r, s, o).call(i, ["6", "45"]);
|
|
244
244
|
}
|
|
245
245
|
static errorControlTemperature(e = null) {
|
|
246
|
-
var t, n,
|
|
247
|
-
if (!a(t = r,
|
|
248
|
-
a(
|
|
246
|
+
var t, n, i;
|
|
247
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
248
|
+
a(i = r, s, o).call(i, ["6", "46"]);
|
|
249
249
|
}
|
|
250
250
|
static thermometerDisconnected(e = null) {
|
|
251
|
-
var t, n,
|
|
252
|
-
if (!a(t = r,
|
|
253
|
-
a(
|
|
251
|
+
var t, n, i;
|
|
252
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
253
|
+
a(i = r, s, o).call(i, ["6", "47"]);
|
|
254
254
|
}
|
|
255
255
|
static thermometerMisconfigured(e = null) {
|
|
256
|
-
var t, n,
|
|
257
|
-
if (!a(t = r,
|
|
258
|
-
a(
|
|
256
|
+
var t, n, i;
|
|
257
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
258
|
+
a(i = r, s, o).call(i, ["6", "48"]);
|
|
259
259
|
}
|
|
260
260
|
static thermometerFailure(e = null) {
|
|
261
|
-
var t, n,
|
|
262
|
-
if (!a(t = r,
|
|
263
|
-
a(
|
|
261
|
+
var t, n, i;
|
|
262
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
263
|
+
a(i = r, s, o).call(i, ["6", "49"]);
|
|
264
264
|
}
|
|
265
265
|
static errorExtractorConsumption(e = null) {
|
|
266
|
-
var t, n,
|
|
267
|
-
if (!a(t = r,
|
|
268
|
-
a(
|
|
266
|
+
var t, n, i;
|
|
267
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
268
|
+
a(i = r, s, o).call(i, ["6", "4A"]);
|
|
269
269
|
}
|
|
270
270
|
static channelSearchError(e = null) {
|
|
271
|
-
var t, n,
|
|
272
|
-
if (!a(t = r,
|
|
273
|
-
a(
|
|
271
|
+
var t, n, i;
|
|
272
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
273
|
+
a(i = r, s, o).call(i, ["6", "4B"]);
|
|
274
274
|
}
|
|
275
275
|
static productExitMouthSearchError(e = null) {
|
|
276
|
-
var t, n,
|
|
277
|
-
if (!a(t = r,
|
|
278
|
-
a(
|
|
276
|
+
var t, n, i;
|
|
277
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
278
|
+
a(i = r, s, o).call(i, ["6", "4C"]);
|
|
279
279
|
}
|
|
280
280
|
static elevatorInteriorLocked(e = null) {
|
|
281
|
-
var t, n,
|
|
282
|
-
if (!a(t = r,
|
|
283
|
-
a(
|
|
281
|
+
var t, n, i;
|
|
282
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
283
|
+
a(i = r, s, o).call(i, ["6", "4D"]);
|
|
284
284
|
}
|
|
285
285
|
static productDetectorVerifierError(e = null) {
|
|
286
|
-
var t, n,
|
|
287
|
-
if (!a(t = r,
|
|
288
|
-
a(
|
|
286
|
+
var t, n, i;
|
|
287
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
288
|
+
a(i = r, s, o).call(i, ["6", "4E"]);
|
|
289
289
|
}
|
|
290
290
|
static waitingForProductRecall(e = null) {
|
|
291
|
-
var t, n,
|
|
292
|
-
if (!a(t = r,
|
|
293
|
-
a(
|
|
291
|
+
var t, n, i;
|
|
292
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
293
|
+
a(i = r, s, o).call(i, ["6", "4F"]);
|
|
294
294
|
}
|
|
295
295
|
static productExpiredByTemperature(e = null) {
|
|
296
|
-
var t, n,
|
|
297
|
-
if (!a(t = r,
|
|
298
|
-
a(
|
|
296
|
+
var t, n, i;
|
|
297
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
298
|
+
a(i = r, s, o).call(i, ["6", "50"]);
|
|
299
299
|
}
|
|
300
300
|
static faultyAutomaticDoor(e = null) {
|
|
301
|
-
var t, n,
|
|
302
|
-
if (!a(t = r,
|
|
303
|
-
a(
|
|
301
|
+
var t, n, i;
|
|
302
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
303
|
+
a(i = r, s, o).call(i, ["6", "51"]);
|
|
304
304
|
}
|
|
305
305
|
static rejectLever(e = null) {
|
|
306
|
-
var t, n,
|
|
307
|
-
if (!a(t = r,
|
|
308
|
-
a(
|
|
306
|
+
var t, n, i;
|
|
307
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
308
|
+
a(i = r, s, o).call(i, ["2", "A0", "1"]);
|
|
309
309
|
}
|
|
310
310
|
static resetCoinPurse(e = null) {
|
|
311
|
-
var t, n,
|
|
312
|
-
if (!a(t = r,
|
|
313
|
-
a(
|
|
311
|
+
var t, n, i;
|
|
312
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
313
|
+
a(i = r, s, o).call(i, ["2", "A0", "2"]);
|
|
314
314
|
}
|
|
315
315
|
static coinInsertedBox(e = null, t = null) {
|
|
316
316
|
var u, g, f, h;
|
|
317
|
-
if (!a(u = r,
|
|
318
|
-
const n = ["40", "41", "42", "43", "44", "45"],
|
|
319
|
-
a(h = r,
|
|
317
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
|
|
318
|
+
const n = ["40", "41", "42", "43", "44", "45"], i = a(f = r, s, $).call(f, n, t);
|
|
319
|
+
a(h = r, s, o).call(h, ["2", "A0", i]);
|
|
320
320
|
}
|
|
321
321
|
static coinInsertedTube(e = null, t = null) {
|
|
322
322
|
var u, g, f, h;
|
|
323
|
-
if (!a(u = r,
|
|
324
|
-
const n = ["50", "51", "52", "53", "54", "55"],
|
|
325
|
-
a(h = r,
|
|
323
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
|
|
324
|
+
const n = ["50", "51", "52", "53", "54", "55"], i = a(f = r, s, $).call(f, n, t);
|
|
325
|
+
a(h = r, s, o).call(h, ["2", "A0", i]);
|
|
326
326
|
}
|
|
327
327
|
static banknoteInsertedStacker(e = null, t = null) {
|
|
328
328
|
var u, g, f, h;
|
|
329
|
-
if (!a(u = r,
|
|
330
|
-
const n = ["80", "81", "82", "83", "84"],
|
|
331
|
-
a(h = r,
|
|
329
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
|
|
330
|
+
const n = ["80", "81", "82", "83", "84"], i = a(f = r, s, T).call(f, n, t);
|
|
331
|
+
a(h = r, s, o).call(h, ["2", "B0", i]);
|
|
332
332
|
}
|
|
333
333
|
static banknoteInsertedEscrow(e = null, t = null) {
|
|
334
334
|
var u, g, f, h;
|
|
335
|
-
if (!a(u = r,
|
|
336
|
-
const n = ["90", "91", "92", "93", "94"],
|
|
337
|
-
a(h = r,
|
|
335
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
|
|
336
|
+
const n = ["90", "91", "92", "93", "94"], i = a(f = r, s, T).call(f, n, t);
|
|
337
|
+
a(h = r, s, o).call(h, ["2", "B0", i]);
|
|
338
338
|
}
|
|
339
339
|
static banknoteEjected(e = null, t = null) {
|
|
340
340
|
var u, g, f, h;
|
|
341
|
-
if (!a(u = r,
|
|
342
|
-
const n = ["A0", "A1", "A2", "A3", "A4"],
|
|
343
|
-
a(h = r,
|
|
341
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
|
|
342
|
+
const n = ["A0", "A1", "A2", "A3", "A4"], i = a(f = r, s, T).call(f, n, t);
|
|
343
|
+
a(h = r, s, o).call(h, ["2", "B0", i]);
|
|
344
344
|
}
|
|
345
345
|
static banknoteInsertedRecycler(e = null, t = null) {
|
|
346
346
|
var u, g, f, h;
|
|
347
|
-
if (!a(u = r,
|
|
348
|
-
const n = ["B0", "B1", "B2", "B3", "B4"],
|
|
349
|
-
a(h = r,
|
|
347
|
+
if (!a(u = r, s, c).call(u, e) || !a(g = r, s, p).call(g)) return !1;
|
|
348
|
+
const n = ["B0", "B1", "B2", "B3", "B4"], i = a(f = r, s, T).call(f, n, t);
|
|
349
|
+
a(h = r, s, o).call(h, ["2", "B0", i]);
|
|
350
350
|
}
|
|
351
351
|
static banknoteTaken(e = null) {
|
|
352
|
-
var t, n,
|
|
353
|
-
if (!a(t = r,
|
|
354
|
-
a(
|
|
352
|
+
var t, n, i;
|
|
353
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
354
|
+
a(i = r, s, o).call(i, ["2", "B0", "2a"]);
|
|
355
355
|
}
|
|
356
356
|
static coinPurseEnabled(e = null) {
|
|
357
|
-
var t, n,
|
|
358
|
-
if (!a(t = r,
|
|
359
|
-
a(
|
|
357
|
+
var t, n, i;
|
|
358
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
359
|
+
a(i = r, s, o).call(i, ["2", "D0", "1"]);
|
|
360
360
|
}
|
|
361
361
|
static coinPurseDisabled(e = null) {
|
|
362
|
-
var t, n,
|
|
363
|
-
if (!a(t = r,
|
|
364
|
-
a(
|
|
362
|
+
var t, n, i;
|
|
363
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
364
|
+
a(i = r, s, o).call(i, ["2", "D0", "0"]);
|
|
365
365
|
}
|
|
366
366
|
static billPurseDisabled(e = null) {
|
|
367
|
-
var t, n,
|
|
368
|
-
if (!a(t = r,
|
|
369
|
-
a(
|
|
367
|
+
var t, n, i;
|
|
368
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
369
|
+
a(i = r, s, o).call(i, ["2", "D1", "0", "0"]);
|
|
370
370
|
}
|
|
371
371
|
static billPurseEnabled(e = null) {
|
|
372
|
-
var t, n,
|
|
373
|
-
if (!a(t = r,
|
|
374
|
-
a(
|
|
372
|
+
var t, n, i;
|
|
373
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
374
|
+
a(i = r, s, o).call(i, ["2", "D1", "1", "1"]);
|
|
375
375
|
}
|
|
376
376
|
static readTubes(e = null) {
|
|
377
|
-
var C, D
|
|
378
|
-
if (!a(
|
|
377
|
+
var k, C, D;
|
|
378
|
+
if (!a(k = r, s, c).call(k, e) || !a(C = r, s, p).call(C)) return !1;
|
|
379
379
|
const t = [
|
|
380
380
|
"0",
|
|
381
381
|
"1",
|
|
@@ -409,7 +409,7 @@ const r = class r {
|
|
|
409
409
|
"1d",
|
|
410
410
|
"1e",
|
|
411
411
|
"1f"
|
|
412
|
-
], [n,
|
|
412
|
+
], [n, i, u, g, f, h] = [
|
|
413
413
|
t[Math.floor(Math.random() * 30)],
|
|
414
414
|
t[Math.floor(Math.random() * 30)],
|
|
415
415
|
t[Math.floor(Math.random() * 30)],
|
|
@@ -417,11 +417,11 @@ const r = class r {
|
|
|
417
417
|
t[Math.floor(Math.random() * 30)],
|
|
418
418
|
t[Math.floor(Math.random() * 30)]
|
|
419
419
|
];
|
|
420
|
-
a(
|
|
420
|
+
a(D = r, s, o).call(D, ["2", "D2", n, i, u, g, f, h]);
|
|
421
421
|
}
|
|
422
422
|
static readBillPurse(e = null, t = null) {
|
|
423
|
-
var
|
|
424
|
-
if (!a(
|
|
423
|
+
var i, u, g, f;
|
|
424
|
+
if (!a(i = r, s, c).call(i, e) || !a(u = r, s, p).call(u)) return !1;
|
|
425
425
|
let n = [
|
|
426
426
|
"0",
|
|
427
427
|
"1",
|
|
@@ -455,46 +455,46 @@ const r = class r {
|
|
|
455
455
|
];
|
|
456
456
|
if (e._recycler.ict) {
|
|
457
457
|
const h = n[Math.floor(Math.random() * 31)];
|
|
458
|
-
let
|
|
458
|
+
let k = "0", C = "0", D = "0", A = "0", M = "0";
|
|
459
459
|
if (t !== null && !isNaN(parseInt(t)))
|
|
460
460
|
switch (t.toString()) {
|
|
461
461
|
case "20":
|
|
462
|
-
|
|
462
|
+
k = h;
|
|
463
463
|
break;
|
|
464
464
|
case "50":
|
|
465
|
-
|
|
465
|
+
C = h;
|
|
466
466
|
break;
|
|
467
467
|
case "100":
|
|
468
|
-
|
|
468
|
+
D = h;
|
|
469
469
|
break;
|
|
470
470
|
case "200":
|
|
471
|
-
|
|
471
|
+
A = h;
|
|
472
472
|
break;
|
|
473
473
|
case "500":
|
|
474
|
-
|
|
474
|
+
M = h;
|
|
475
475
|
break;
|
|
476
476
|
}
|
|
477
477
|
else
|
|
478
478
|
switch (e._recycler.bill) {
|
|
479
479
|
case 0:
|
|
480
|
-
|
|
480
|
+
k = h;
|
|
481
481
|
break;
|
|
482
482
|
case 1:
|
|
483
|
-
|
|
483
|
+
C = h;
|
|
484
484
|
break;
|
|
485
485
|
case 2:
|
|
486
|
-
|
|
486
|
+
D = h;
|
|
487
487
|
break;
|
|
488
488
|
case 3:
|
|
489
|
-
|
|
489
|
+
A = h;
|
|
490
490
|
break;
|
|
491
491
|
case 4:
|
|
492
|
-
|
|
492
|
+
M = h;
|
|
493
493
|
break;
|
|
494
494
|
}
|
|
495
|
-
a(g = r,
|
|
495
|
+
a(g = r, s, o).call(g, ["2", "D3", k, C, D, A, M, "0"]);
|
|
496
496
|
} else {
|
|
497
|
-
const [h, C, D,
|
|
497
|
+
const [h, k, C, D, A, M] = [
|
|
498
498
|
n[Math.floor(Math.random() * 30)],
|
|
499
499
|
n[Math.floor(Math.random() * 30)],
|
|
500
500
|
n[Math.floor(Math.random() * 30)],
|
|
@@ -502,22 +502,22 @@ const r = class r {
|
|
|
502
502
|
n[Math.floor(Math.random())],
|
|
503
503
|
n[Math.floor(Math.random())]
|
|
504
504
|
];
|
|
505
|
-
a(f = r,
|
|
505
|
+
a(f = r, s, o).call(f, ["2", "D3", h, k, C, D, A, M]);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
static banknoteAccepted(e = null) {
|
|
509
|
-
var t, n,
|
|
510
|
-
if (!a(t = r,
|
|
511
|
-
a(
|
|
509
|
+
var t, n, i;
|
|
510
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
511
|
+
a(i = r, s, o).call(i, ["2", "D4", "1"]);
|
|
512
512
|
}
|
|
513
513
|
static banknoteRejected(e = null) {
|
|
514
|
-
var t, n,
|
|
515
|
-
if (!a(t = r,
|
|
516
|
-
a(
|
|
514
|
+
var t, n, i;
|
|
515
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
516
|
+
a(i = r, s, o).call(i, ["2", "D4", "0"]);
|
|
517
517
|
}
|
|
518
518
|
static banknotesDispensed(e = null) {
|
|
519
|
-
var n,
|
|
520
|
-
if (!a(n = r,
|
|
519
|
+
var n, i, u, g;
|
|
520
|
+
if (!a(n = r, s, c).call(n, e) || !a(i = r, s, p).call(i)) return !1;
|
|
521
521
|
let t = [
|
|
522
522
|
"1",
|
|
523
523
|
"2",
|
|
@@ -550,27 +550,27 @@ const r = class r {
|
|
|
550
550
|
];
|
|
551
551
|
if (e._recycler.ict) {
|
|
552
552
|
const f = t[Math.floor(Math.random() * 30)];
|
|
553
|
-
let h = "0",
|
|
553
|
+
let h = "0", k = "0", C = "0", D = "0", A = "0";
|
|
554
554
|
switch (e._recycler.bill) {
|
|
555
555
|
case 0:
|
|
556
556
|
h = f;
|
|
557
557
|
break;
|
|
558
558
|
case 1:
|
|
559
|
-
|
|
559
|
+
k = f;
|
|
560
560
|
break;
|
|
561
561
|
case 2:
|
|
562
|
-
|
|
562
|
+
C = f;
|
|
563
563
|
break;
|
|
564
564
|
case 3:
|
|
565
|
-
|
|
565
|
+
D = f;
|
|
566
566
|
break;
|
|
567
567
|
case 4:
|
|
568
|
-
|
|
568
|
+
A = f;
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
|
-
a(u = r,
|
|
571
|
+
a(u = r, s, o).call(u, ["2", "D5", h, k, C, D, A, "0"]);
|
|
572
572
|
} else {
|
|
573
|
-
const [f, h, C, D,
|
|
573
|
+
const [f, h, k, C, D, A] = [
|
|
574
574
|
t[Math.floor(Math.random() * 30)],
|
|
575
575
|
t[Math.floor(Math.random() * 30)],
|
|
576
576
|
t[Math.floor(Math.random() * 30)],
|
|
@@ -578,111 +578,111 @@ const r = class r {
|
|
|
578
578
|
t[Math.floor(Math.random())],
|
|
579
579
|
t[Math.floor(Math.random())]
|
|
580
580
|
];
|
|
581
|
-
a(g = r,
|
|
581
|
+
a(g = r, s, o).call(g, ["2", "D5", f, h, k, C, D, A]);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
static coinsDispensed(e = null) {
|
|
585
|
-
var t, n,
|
|
586
|
-
if (!a(t = r,
|
|
587
|
-
a(
|
|
585
|
+
var t, n, i;
|
|
586
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
587
|
+
a(i = r, s, o).call(i, ["2", "D6"]);
|
|
588
588
|
}
|
|
589
589
|
static relayOn(e = null) {
|
|
590
|
-
var t, n,
|
|
591
|
-
if (!a(t = r,
|
|
592
|
-
a(
|
|
590
|
+
var t, n, i;
|
|
591
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
592
|
+
a(i = r, s, o).call(i, ["2", "DA", "1"]);
|
|
593
593
|
}
|
|
594
594
|
static relayOff(e = null) {
|
|
595
|
-
var t, n,
|
|
596
|
-
if (!a(t = r,
|
|
597
|
-
a(
|
|
595
|
+
var t, n, i;
|
|
596
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
597
|
+
a(i = r, s, o).call(i, ["2", "DA", "0"]);
|
|
598
598
|
}
|
|
599
599
|
static nayaxEnabled(e = null) {
|
|
600
|
-
var t, n,
|
|
601
|
-
if (!a(t = r,
|
|
602
|
-
a(
|
|
600
|
+
var t, n, i;
|
|
601
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
602
|
+
a(i = r, s, o).call(i, ["2", "DD", "1"]);
|
|
603
603
|
}
|
|
604
604
|
static nayaxDisabled(e = null) {
|
|
605
|
-
var t, n,
|
|
606
|
-
if (!a(t = r,
|
|
607
|
-
a(
|
|
605
|
+
var t, n, i;
|
|
606
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
607
|
+
a(i = r, s, o).call(i, ["2", "DD", "0"]);
|
|
608
608
|
}
|
|
609
609
|
static nayaxPreCreditAuthorized(e = null) {
|
|
610
|
-
var t, n,
|
|
611
|
-
if (!a(t = r,
|
|
612
|
-
a(
|
|
610
|
+
var t, n, i;
|
|
611
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
612
|
+
a(i = r, s, o).call(i, ["2", "DD", "3"]);
|
|
613
613
|
}
|
|
614
614
|
static nayaxCancelRequest(e = null) {
|
|
615
|
-
var t, n,
|
|
616
|
-
if (!a(t = r,
|
|
617
|
-
a(
|
|
615
|
+
var t, n, i;
|
|
616
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
617
|
+
a(i = r, s, o).call(i, ["2", "DD", "4"]);
|
|
618
618
|
}
|
|
619
619
|
static nayaxSellApproved(e = null) {
|
|
620
|
-
var t, n,
|
|
621
|
-
if (!a(t = r,
|
|
622
|
-
a(
|
|
620
|
+
var t, n, i;
|
|
621
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
622
|
+
a(i = r, s, o).call(i, ["2", "DD", "5"]);
|
|
623
623
|
}
|
|
624
624
|
static nayaxSellDenied(e = null) {
|
|
625
|
-
var t, n,
|
|
626
|
-
if (!a(t = r,
|
|
627
|
-
a(
|
|
625
|
+
var t, n, i;
|
|
626
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
627
|
+
a(i = r, s, o).call(i, ["2", "DD", "6"]);
|
|
628
628
|
}
|
|
629
629
|
static nayaxEndSession(e = null) {
|
|
630
|
-
var t, n,
|
|
631
|
-
if (!a(t = r,
|
|
632
|
-
a(
|
|
630
|
+
var t, n, i;
|
|
631
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
632
|
+
a(i = r, s, o).call(i, ["2", "DD", "7"]);
|
|
633
633
|
}
|
|
634
634
|
static nayaxCancelled(e = null) {
|
|
635
|
-
var t, n,
|
|
636
|
-
if (!a(t = r,
|
|
637
|
-
a(
|
|
635
|
+
var t, n, i;
|
|
636
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
637
|
+
a(i = r, s, o).call(i, ["2", "DD", "8"]);
|
|
638
638
|
}
|
|
639
639
|
static nayaxDispensed(e = null) {
|
|
640
|
-
var t, n,
|
|
641
|
-
if (!a(t = r,
|
|
642
|
-
a(
|
|
640
|
+
var t, n, i;
|
|
641
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
642
|
+
a(i = r, s, o).call(i, ["2", "DD", "A", "0"]);
|
|
643
643
|
}
|
|
644
644
|
static nayaxNotDispensed(e = null) {
|
|
645
|
-
var t, n,
|
|
646
|
-
if (!a(t = r,
|
|
647
|
-
a(
|
|
645
|
+
var t, n, i;
|
|
646
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, p).call(n)) return !1;
|
|
647
|
+
a(i = r, s, o).call(i, ["2", "DD", "A", "1"]);
|
|
648
648
|
}
|
|
649
649
|
static fullTray(e = null) {
|
|
650
|
-
var t, n,
|
|
651
|
-
if (!a(t = r,
|
|
652
|
-
a(
|
|
650
|
+
var t, n, i;
|
|
651
|
+
if (!a(t = r, s, c).call(t, e) || !a(n = r, s, d).call(n)) return !1;
|
|
652
|
+
a(i = r, s, o).call(i, ["6", "4F"]);
|
|
653
653
|
}
|
|
654
654
|
static setConnection(e = null) {
|
|
655
655
|
var t;
|
|
656
|
-
if (!a(t = r,
|
|
656
|
+
if (!a(t = r, s, c).call(t, e)) return !1;
|
|
657
657
|
e.__internal__.serial.connected = !0;
|
|
658
658
|
}
|
|
659
659
|
};
|
|
660
|
-
|
|
660
|
+
v = new WeakMap(), S = new WeakMap(), s = new WeakSet(), Y = function() {
|
|
661
661
|
if (r.enable === !1) throw new Error("Emulator is disabled");
|
|
662
662
|
return r.enable;
|
|
663
|
-
},
|
|
664
|
-
if (typeof e != "object" || !(e instanceof
|
|
663
|
+
}, Z = function(e) {
|
|
664
|
+
if (typeof e != "object" || !(e instanceof ye))
|
|
665
665
|
throw new Error(`Type ${e.typeDevice} is not supported`);
|
|
666
|
-
return r.instance = e,
|
|
666
|
+
return r.instance = e, j(r, v, e.typeDevice), j(r, S, e.deviceNumber), !0;
|
|
667
667
|
}, c = function(e = null) {
|
|
668
668
|
var t, n;
|
|
669
|
-
return !a(t = r,
|
|
670
|
-
},
|
|
671
|
-
if (w(r,
|
|
669
|
+
return !a(t = r, s, Y).call(t) || e === null && r.instance === null ? !1 : (r.instance === null && a(n = r, s, Z).call(n, e), !0);
|
|
670
|
+
}, q = function() {
|
|
671
|
+
if (w(r, v) !== "locker") throw new Error("This function is only available for Locker devices");
|
|
672
672
|
return !0;
|
|
673
673
|
}, p = function() {
|
|
674
|
-
if (w(r,
|
|
674
|
+
if (w(r, v) !== "boardroid")
|
|
675
675
|
throw new Error("This function is only available for Boardroid devices");
|
|
676
676
|
return !0;
|
|
677
677
|
}, d = function() {
|
|
678
|
-
if (w(r,
|
|
678
|
+
if (w(r, v) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
|
|
679
679
|
return !0;
|
|
680
|
-
},
|
|
681
|
-
if (w(r,
|
|
680
|
+
}, I = function() {
|
|
681
|
+
if (w(r, v) === "locker") throw new Error("This function is not available for Locker devices");
|
|
682
682
|
return !0;
|
|
683
683
|
}, o = function(e) {
|
|
684
684
|
r.instance.__emulate({ code: e });
|
|
685
|
-
},
|
|
685
|
+
}, $ = function(e, t = null) {
|
|
686
686
|
let n = e[Math.floor(Math.random() * 5)];
|
|
687
687
|
if (t !== null && !isNaN(parseFloat(t)))
|
|
688
688
|
switch (t.toString()) {
|
|
@@ -703,7 +703,7 @@ k = new WeakMap(), A = new WeakMap(), i = new WeakSet(), te = function() {
|
|
|
703
703
|
break;
|
|
704
704
|
}
|
|
705
705
|
return n;
|
|
706
|
-
},
|
|
706
|
+
}, T = function(e, t = null) {
|
|
707
707
|
let n = e[Math.floor(Math.random() * 4)];
|
|
708
708
|
if (t !== null && !isNaN(parseFloat(t)))
|
|
709
709
|
switch (t.toString()) {
|
|
@@ -724,57 +724,30 @@ k = new WeakMap(), A = new WeakMap(), i = new WeakSet(), te = function() {
|
|
|
724
724
|
break;
|
|
725
725
|
}
|
|
726
726
|
return n;
|
|
727
|
-
},
|
|
728
|
-
let
|
|
729
|
-
var
|
|
727
|
+
}, U(r, s), N(r, "enable", !1), N(r, "instance", null), U(r, v, null), U(r, S, 1);
|
|
728
|
+
let O = r;
|
|
729
|
+
var he = Object.defineProperty, ee = (l) => {
|
|
730
730
|
throw TypeError(l);
|
|
731
|
-
},
|
|
732
|
-
|
|
733
|
-
for (let l = 0; l < 256; ++l)
|
|
734
|
-
v.push((l + 256).toString(16).slice(1));
|
|
735
|
-
function ye(l, e = 0) {
|
|
736
|
-
return (v[l[e + 0]] + v[l[e + 1]] + v[l[e + 2]] + v[l[e + 3]] + "-" + v[l[e + 4]] + v[l[e + 5]] + "-" + v[l[e + 6]] + v[l[e + 7]] + "-" + v[l[e + 8]] + v[l[e + 9]] + "-" + v[l[e + 10]] + v[l[e + 11]] + v[l[e + 12]] + v[l[e + 13]] + v[l[e + 14]] + v[l[e + 15]]).toLowerCase();
|
|
737
|
-
}
|
|
738
|
-
let O;
|
|
739
|
-
const we = new Uint8Array(16);
|
|
740
|
-
function ve() {
|
|
741
|
-
if (!O) {
|
|
742
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
743
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
744
|
-
O = crypto.getRandomValues.bind(crypto);
|
|
745
|
-
}
|
|
746
|
-
return O(we);
|
|
747
|
-
}
|
|
748
|
-
const ke = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), J = { randomUUID: ke };
|
|
749
|
-
function Ce(l, e, t) {
|
|
750
|
-
var n;
|
|
751
|
-
if (J.randomUUID && !l)
|
|
752
|
-
return J.randomUUID();
|
|
753
|
-
l = l || {};
|
|
754
|
-
const s = l.random ?? ((n = l.rng) == null ? void 0 : n.call(l)) ?? ve();
|
|
755
|
-
if (s.length < 16)
|
|
756
|
-
throw new Error("Random bytes length must be >= 16");
|
|
757
|
-
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, ye(s);
|
|
758
|
-
}
|
|
759
|
-
class z extends CustomEvent {
|
|
731
|
+
}, de = (l, e, t) => e in l ? he(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, B = (l, e, t) => de(l, typeof e != "symbol" ? e + "" : e, t), fe = (l, e, t) => e.has(l) || ee("Cannot " + t), pe = (l, e, t) => e.has(l) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), y = (l, e, t) => (fe(l, e, "access private method"), t);
|
|
732
|
+
class Q extends CustomEvent {
|
|
760
733
|
constructor(e, t) {
|
|
761
734
|
super(e, t);
|
|
762
735
|
}
|
|
763
736
|
}
|
|
764
|
-
class
|
|
737
|
+
class te extends EventTarget {
|
|
765
738
|
constructor() {
|
|
766
739
|
super(...arguments), B(this, "__listeners__", {
|
|
767
740
|
debug: !1
|
|
768
741
|
}), B(this, "__debug__", !1);
|
|
769
742
|
}
|
|
770
743
|
dispatch(e, t = null) {
|
|
771
|
-
const n = new
|
|
772
|
-
this.dispatchEvent(n), this.__debug__ && this.dispatchEvent(new
|
|
744
|
+
const n = new Q(e, { detail: t });
|
|
745
|
+
this.dispatchEvent(n), this.__debug__ && this.dispatchEvent(new Q("debug", { detail: { type: e, data: t } }));
|
|
773
746
|
}
|
|
774
747
|
dispatchAsync(e, t = null, n = 100) {
|
|
775
|
-
const
|
|
748
|
+
const i = this;
|
|
776
749
|
setTimeout(() => {
|
|
777
|
-
|
|
750
|
+
i.dispatch(e, t);
|
|
778
751
|
}, n);
|
|
779
752
|
}
|
|
780
753
|
on(e, t) {
|
|
@@ -793,7 +766,7 @@ class se extends EventTarget {
|
|
|
793
766
|
}));
|
|
794
767
|
}
|
|
795
768
|
}
|
|
796
|
-
const
|
|
769
|
+
const R = class m extends te {
|
|
797
770
|
constructor() {
|
|
798
771
|
super(), ["change"].forEach((e) => {
|
|
799
772
|
this.serialRegisterAvailableListener(e);
|
|
@@ -833,18 +806,18 @@ const W = class m extends se {
|
|
|
833
806
|
return typeof m.devices[e] > "u" && m.typeError(e), Object.values(m.devices[e]).find((n) => n.deviceNumber === t) ?? null;
|
|
834
807
|
}
|
|
835
808
|
};
|
|
836
|
-
B(
|
|
837
|
-
let _ =
|
|
809
|
+
B(R, "instance"), B(R, "devices", {});
|
|
810
|
+
let _ = R;
|
|
838
811
|
_.instance || (_.instance = new _());
|
|
839
|
-
function
|
|
812
|
+
function J(l = 100) {
|
|
840
813
|
return new Promise(
|
|
841
814
|
(e) => setTimeout(() => e(), l)
|
|
842
815
|
);
|
|
843
816
|
}
|
|
844
|
-
function
|
|
817
|
+
function ge() {
|
|
845
818
|
return "serial" in navigator;
|
|
846
819
|
}
|
|
847
|
-
const
|
|
820
|
+
const L = {
|
|
848
821
|
baudRate: 9600,
|
|
849
822
|
dataBits: 8,
|
|
850
823
|
stopBits: 1,
|
|
@@ -852,20 +825,20 @@ const q = {
|
|
|
852
825
|
bufferSize: 32768,
|
|
853
826
|
flowControl: "none"
|
|
854
827
|
};
|
|
855
|
-
var b,
|
|
856
|
-
class
|
|
828
|
+
var b, E, P, H, x, ne, V, z, K, re, ie, se, ae, G, X, le, oe;
|
|
829
|
+
class be extends te {
|
|
857
830
|
constructor({
|
|
858
831
|
filters: e = null,
|
|
859
|
-
config_port: t =
|
|
832
|
+
config_port: t = L,
|
|
860
833
|
no_device: n = 1,
|
|
861
|
-
device_listen_on_channel:
|
|
834
|
+
device_listen_on_channel: i = 1
|
|
862
835
|
} = {
|
|
863
836
|
filters: null,
|
|
864
|
-
config_port:
|
|
837
|
+
config_port: L,
|
|
865
838
|
no_device: 1,
|
|
866
839
|
device_listen_on_channel: 1
|
|
867
840
|
}) {
|
|
868
|
-
if (super(),
|
|
841
|
+
if (super(), pe(this, b), B(this, "__internal__", {
|
|
869
842
|
auto_response: !1,
|
|
870
843
|
device_number: 1,
|
|
871
844
|
aux_port_connector: 0,
|
|
@@ -896,13 +869,13 @@ class Se extends se {
|
|
|
896
869
|
delay_first_connection: 200,
|
|
897
870
|
bytes_connection: null,
|
|
898
871
|
filters: [],
|
|
899
|
-
config_port:
|
|
872
|
+
config_port: L,
|
|
900
873
|
queue: [],
|
|
901
874
|
auto_response: ["DD", "DD"]
|
|
902
875
|
},
|
|
903
876
|
device: {
|
|
904
877
|
type: "unknown",
|
|
905
|
-
id:
|
|
878
|
+
id: window.crypto.randomUUID(),
|
|
906
879
|
listen_on_port: null
|
|
907
880
|
},
|
|
908
881
|
time: {
|
|
@@ -917,7 +890,7 @@ class Se extends se {
|
|
|
917
890
|
}
|
|
918
891
|
}), !("serial" in navigator))
|
|
919
892
|
throw new Error("Web Serial not supported");
|
|
920
|
-
e && (this.serialFilters = e), t && (this.serialConfigPort = t), n && y(this, b,
|
|
893
|
+
e && (this.serialFilters = e), t && (this.serialConfigPort = t), n && y(this, b, le).call(this, n), i && ["number", "string"].includes(typeof i) && (this.listenOnChannel = i), y(this, b, se).call(this), y(this, b, ae).call(this);
|
|
921
894
|
}
|
|
922
895
|
set listenOnChannel(e) {
|
|
923
896
|
if (typeof e == "string" && (e = parseInt(e)), isNaN(e) || e < 1 || e > 255)
|
|
@@ -943,11 +916,11 @@ class Se extends se {
|
|
|
943
916
|
return this.__internal__.serial.config_port;
|
|
944
917
|
}
|
|
945
918
|
get isConnected() {
|
|
946
|
-
const e = this.__internal__.serial.connected, t = y(this, b,
|
|
947
|
-
return e && !t && y(this, b,
|
|
919
|
+
const e = this.__internal__.serial.connected, t = y(this, b, E).call(this, this.__internal__.serial.port);
|
|
920
|
+
return e && !t && y(this, b, P).call(this, { error: "Port is closed, not readable or writable." }), this.__internal__.serial.connected = t, this.__internal__.serial.connected;
|
|
948
921
|
}
|
|
949
922
|
get isDisconnected() {
|
|
950
|
-
const e = this.__internal__.serial.connected, t = y(this, b,
|
|
923
|
+
const e = this.__internal__.serial.connected, t = y(this, b, E).call(this, this.__internal__.serial.port);
|
|
951
924
|
return !e && t && (this.dispatch("serial:connected"), _.$dispatchChange(this)), this.__internal__.serial.connected = t, !this.__internal__.serial.connected;
|
|
952
925
|
}
|
|
953
926
|
get deviceNumber() {
|
|
@@ -970,12 +943,12 @@ class Se extends se {
|
|
|
970
943
|
});
|
|
971
944
|
}
|
|
972
945
|
async disconnect(e = null) {
|
|
973
|
-
await this.serialDisconnect(), y(this, b,
|
|
946
|
+
await this.serialDisconnect(), y(this, b, P).call(this, e);
|
|
974
947
|
}
|
|
975
948
|
async connect() {
|
|
976
949
|
return new Promise((e, t) => {
|
|
977
|
-
|
|
978
|
-
await
|
|
950
|
+
ge() || t("Web Serial not supported"), setTimeout(async () => {
|
|
951
|
+
await J(499), await this.serialConnect(), this.isConnected ? e(`${this.typeDevice} device ${this.deviceNumber} connected`) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`);
|
|
979
952
|
}, 1);
|
|
980
953
|
});
|
|
981
954
|
}
|
|
@@ -1063,13 +1036,13 @@ class Se extends se {
|
|
|
1063
1036
|
async serialConnect() {
|
|
1064
1037
|
try {
|
|
1065
1038
|
this.dispatch("serial:connecting", {});
|
|
1066
|
-
const e = await y(this, b,
|
|
1039
|
+
const e = await y(this, b, ne).call(this);
|
|
1067
1040
|
if (e.length > 0)
|
|
1068
1041
|
await this.serialPortsSaved(e);
|
|
1069
1042
|
else {
|
|
1070
|
-
const
|
|
1043
|
+
const i = this.serialFilters;
|
|
1071
1044
|
this.__internal__.serial.port = await navigator.serial.requestPort({
|
|
1072
|
-
filters:
|
|
1045
|
+
filters: i
|
|
1073
1046
|
});
|
|
1074
1047
|
}
|
|
1075
1048
|
const t = this.__internal__.serial.port;
|
|
@@ -1077,22 +1050,22 @@ class Se extends se {
|
|
|
1077
1050
|
throw new Error("No port selected by the user");
|
|
1078
1051
|
await t.open(this.serialConfigPort);
|
|
1079
1052
|
const n = this;
|
|
1080
|
-
t.onconnect = (
|
|
1081
|
-
console.log(
|
|
1053
|
+
t.onconnect = (i) => {
|
|
1054
|
+
console.log(i), n.dispatch("serial:connected", i), _.$dispatchChange(this), n.__internal__.serial.queue.length > 0 && n.dispatch("internal:queue", {});
|
|
1082
1055
|
}, t.ondisconnect = async () => {
|
|
1083
1056
|
await n.disconnect();
|
|
1084
|
-
}, await
|
|
1057
|
+
}, await J(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
|
|
1085
1058
|
await n.timeout(n.__internal__.serial.bytes_connection ?? [], "connection:start");
|
|
1086
|
-
}, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await y(this, b,
|
|
1059
|
+
}, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await y(this, b, H).call(this, this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
|
|
1087
1060
|
action: "connect",
|
|
1088
1061
|
bytes: this.__internal__.serial.bytes_connection
|
|
1089
|
-
}), this.__internal__.auto_response && y(this, b,
|
|
1062
|
+
}), this.__internal__.auto_response && y(this, b, x).call(this, this.__internal__.serial.auto_response, null), await y(this, b, re).call(this);
|
|
1090
1063
|
} catch (e) {
|
|
1091
1064
|
this.serialErrors(e);
|
|
1092
1065
|
}
|
|
1093
1066
|
}
|
|
1094
1067
|
async serialForget() {
|
|
1095
|
-
return await y(this, b,
|
|
1068
|
+
return await y(this, b, ie).call(this);
|
|
1096
1069
|
}
|
|
1097
1070
|
decToHex(e) {
|
|
1098
1071
|
return typeof e == "string" && (e = parseInt(e, 10)), e.toString(16);
|
|
@@ -1105,8 +1078,8 @@ class Se extends se {
|
|
|
1105
1078
|
}
|
|
1106
1079
|
add0x(e) {
|
|
1107
1080
|
const t = [];
|
|
1108
|
-
return e.forEach((n,
|
|
1109
|
-
t[
|
|
1081
|
+
return e.forEach((n, i) => {
|
|
1082
|
+
t[i] = "0x" + n;
|
|
1110
1083
|
}), t;
|
|
1111
1084
|
}
|
|
1112
1085
|
bytesToHex(e) {
|
|
@@ -1149,7 +1122,7 @@ class Se extends se {
|
|
|
1149
1122
|
});
|
|
1150
1123
|
}
|
|
1151
1124
|
softReload() {
|
|
1152
|
-
y(this, b,
|
|
1125
|
+
y(this, b, oe).call(this), this.dispatch("serial:soft-reload", {});
|
|
1153
1126
|
}
|
|
1154
1127
|
async sendConnect() {
|
|
1155
1128
|
if (!this.__internal__.serial.bytes_connection)
|
|
@@ -1177,7 +1150,7 @@ class Se extends se {
|
|
|
1177
1150
|
parseStringToBytes(e = "", t = `
|
|
1178
1151
|
`) {
|
|
1179
1152
|
const n = this.parseStringToTextEncoder(e, t);
|
|
1180
|
-
return Array.from(n).map((
|
|
1153
|
+
return Array.from(n).map((i) => i.toString(16));
|
|
1181
1154
|
}
|
|
1182
1155
|
parseUint8ToHex(e) {
|
|
1183
1156
|
return Array.from(e).map((t) => t.toString(16));
|
|
@@ -1188,26 +1161,26 @@ class Se extends se {
|
|
|
1188
1161
|
stringArrayToUint8Array(e) {
|
|
1189
1162
|
const t = [];
|
|
1190
1163
|
return e.forEach((n) => {
|
|
1191
|
-
const
|
|
1192
|
-
t.push(parseInt(
|
|
1164
|
+
const i = n.replace("0x", "");
|
|
1165
|
+
t.push(parseInt(i, 16));
|
|
1193
1166
|
}), new Uint8Array(t);
|
|
1194
1167
|
}
|
|
1195
1168
|
parseUint8ArrayToString(e) {
|
|
1196
1169
|
const t = this.stringArrayToUint8Array(e);
|
|
1197
1170
|
e = this.parseUint8ToHex(t);
|
|
1198
|
-
const n = e.map((
|
|
1171
|
+
const n = e.map((i) => parseInt(i, 16));
|
|
1199
1172
|
return this.__internal__.serial.response.replacer ? String.fromCharCode(...n).replace(this.__internal__.serial.response.replacer, "") : String.fromCharCode(...n);
|
|
1200
1173
|
}
|
|
1201
1174
|
hexToAscii(e) {
|
|
1202
1175
|
const t = e.toString();
|
|
1203
1176
|
let n = "";
|
|
1204
|
-
for (let
|
|
1205
|
-
n += String.fromCharCode(parseInt(t.substring(
|
|
1177
|
+
for (let i = 0; i < t.length; i += 2)
|
|
1178
|
+
n += String.fromCharCode(parseInt(t.substring(i, 2), 16));
|
|
1206
1179
|
return n;
|
|
1207
1180
|
}
|
|
1208
1181
|
asciiToHex(e) {
|
|
1209
1182
|
const t = [];
|
|
1210
|
-
for (let n = 0,
|
|
1183
|
+
for (let n = 0, i = e.length; n < i; n++) {
|
|
1211
1184
|
const u = Number(e.charCodeAt(n)).toString(16);
|
|
1212
1185
|
t.push(u);
|
|
1213
1186
|
}
|
|
@@ -1217,70 +1190,70 @@ class Se extends se {
|
|
|
1217
1190
|
return this.isConnected;
|
|
1218
1191
|
}
|
|
1219
1192
|
}
|
|
1220
|
-
b = /* @__PURE__ */ new WeakSet(),
|
|
1193
|
+
b = /* @__PURE__ */ new WeakSet(), E = function(l) {
|
|
1221
1194
|
return !!(l && l.readable && l.writable);
|
|
1222
|
-
},
|
|
1195
|
+
}, P = function(l = null) {
|
|
1223
1196
|
this.__internal__.serial.connected = !1, this.__internal__.aux_port_connector = 0, this.dispatch("serial:disconnected", l), _.$dispatchChange(this);
|
|
1224
|
-
},
|
|
1197
|
+
}, H = async function(l) {
|
|
1225
1198
|
const e = this.__internal__.serial.port;
|
|
1226
1199
|
if (!e || e && (!e.readable || !e.writable))
|
|
1227
|
-
throw y(this, b,
|
|
1200
|
+
throw y(this, b, P).call(this, { error: "Port is closed, not readable or writable." }), new Error("The port is closed or is not readable/writable");
|
|
1228
1201
|
const t = this.stringArrayToUint8Array(l);
|
|
1229
1202
|
if (e.writable === null) return;
|
|
1230
1203
|
const n = e.writable.getWriter();
|
|
1231
1204
|
await n.write(t), n.releaseLock();
|
|
1232
|
-
},
|
|
1205
|
+
}, x = function(l = [], e = null) {
|
|
1233
1206
|
if (l && l.length > 0) {
|
|
1234
1207
|
const t = this.__internal__.serial.connected;
|
|
1235
|
-
this.__internal__.serial.connected = y(this, b,
|
|
1208
|
+
this.__internal__.serial.connected = y(this, b, E).call(this, this.__internal__.serial.port), _.$dispatchChange(this), !t && this.__internal__.serial.connected && this.dispatch("serial:connected"), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0);
|
|
1236
1209
|
const n = [];
|
|
1237
|
-
for (const
|
|
1238
|
-
n.push(l[
|
|
1210
|
+
for (const i in l)
|
|
1211
|
+
n.push(l[i].toString().padStart(2, "0").toLowerCase());
|
|
1239
1212
|
if (this.__internal__.serial.response.as === "hex")
|
|
1240
1213
|
this.serialMessage(n);
|
|
1241
1214
|
else if (this.__internal__.serial.response.as === "uint8")
|
|
1242
1215
|
this.serialMessage(this.parseHexToUint8(this.add0x(n)));
|
|
1243
1216
|
else if (this.__internal__.serial.response.as === "string")
|
|
1244
1217
|
if (this.__internal__.serial.response.limiter !== null) {
|
|
1245
|
-
const
|
|
1246
|
-
for (const u in
|
|
1247
|
-
|
|
1218
|
+
const i = this.parseUint8ArrayToString(this.add0x(n)).split(this.__internal__.serial.response.limiter);
|
|
1219
|
+
for (const u in i)
|
|
1220
|
+
i[u] && this.serialMessage(i[u]);
|
|
1248
1221
|
} else
|
|
1249
1222
|
this.serialMessage(this.parseUint8ArrayToString(this.add0x(n)));
|
|
1250
1223
|
else {
|
|
1251
|
-
const
|
|
1224
|
+
const i = this.stringToArrayBuffer(
|
|
1252
1225
|
this.parseUint8ArrayToString(this.add0x(n))
|
|
1253
1226
|
);
|
|
1254
|
-
this.serialMessage(
|
|
1227
|
+
this.serialMessage(i);
|
|
1255
1228
|
}
|
|
1256
1229
|
} else
|
|
1257
1230
|
this.serialCorruptMessage(l, e);
|
|
1258
1231
|
this.__internal__.serial.queue.length !== 0 && this.dispatch("internal:queue", {});
|
|
1259
|
-
},
|
|
1232
|
+
}, ne = async function() {
|
|
1260
1233
|
const l = this.serialFilters, e = await navigator.serial.getPorts({ filters: l });
|
|
1261
1234
|
return l.length === 0 ? e : e.filter((t) => {
|
|
1262
1235
|
const n = t.getInfo();
|
|
1263
|
-
return l.some((
|
|
1264
|
-
}).filter((t) => !y(this, b,
|
|
1265
|
-
},
|
|
1236
|
+
return l.some((i) => n.usbProductId === i.usbProductId && n.usbVendorId === i.usbVendorId);
|
|
1237
|
+
}).filter((t) => !y(this, b, E).call(this, t));
|
|
1238
|
+
}, V = function(l) {
|
|
1266
1239
|
if (l) {
|
|
1267
1240
|
const e = this.__internal__.serial.response.buffer, t = new Uint8Array(e.length + l.byteLength);
|
|
1268
1241
|
t.set(e, 0), t.set(new Uint8Array(l), e.length), this.__internal__.serial.response.buffer = t;
|
|
1269
1242
|
}
|
|
1270
|
-
},
|
|
1243
|
+
}, z = async function() {
|
|
1271
1244
|
this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
|
|
1272
1245
|
const l = [];
|
|
1273
1246
|
for (const e in this.__internal__.serial.response.buffer)
|
|
1274
1247
|
l.push(this.__internal__.serial.response.buffer[e].toString(16));
|
|
1275
|
-
this.__internal__.serial.response.buffer && y(this, b,
|
|
1248
|
+
this.__internal__.serial.response.buffer && y(this, b, x).call(this, l), this.__internal__.serial.response.buffer = new Uint8Array(0);
|
|
1276
1249
|
}, 400);
|
|
1277
|
-
},
|
|
1250
|
+
}, K = async function() {
|
|
1278
1251
|
if (this.__internal__.serial.response.length !== null) {
|
|
1279
1252
|
if (this.__internal__.serial.response.length === this.__internal__.serial.response.buffer.length) {
|
|
1280
1253
|
const l = [];
|
|
1281
1254
|
for (const e in this.__internal__.serial.response.buffer)
|
|
1282
1255
|
l.push(this.__internal__.serial.response.buffer[e].toString(16));
|
|
1283
|
-
y(this, b,
|
|
1256
|
+
y(this, b, x).call(this, l), this.__internal__.serial.response.buffer = new Uint8Array(0);
|
|
1284
1257
|
} else if (this.__internal__.serial.response.length < this.__internal__.serial.response.buffer.length) {
|
|
1285
1258
|
let l = new Uint8Array(0);
|
|
1286
1259
|
for (let t = 0; t < this.__internal__.serial.response.length; t++)
|
|
@@ -1289,7 +1262,7 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1289
1262
|
const t = [];
|
|
1290
1263
|
for (const n in l)
|
|
1291
1264
|
t.push(l[n].toString(16));
|
|
1292
|
-
y(this, b,
|
|
1265
|
+
y(this, b, x).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
|
|
1293
1266
|
return;
|
|
1294
1267
|
}
|
|
1295
1268
|
l = new Uint8Array(0);
|
|
@@ -1301,12 +1274,12 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1301
1274
|
const t = [];
|
|
1302
1275
|
for (const n in l)
|
|
1303
1276
|
t.push(l[n].toString(16));
|
|
1304
|
-
y(this, b,
|
|
1277
|
+
y(this, b, x).call(this, t), this.__internal__.serial.response.buffer = new Uint8Array(0);
|
|
1305
1278
|
}
|
|
1306
1279
|
}
|
|
1307
1280
|
}
|
|
1308
1281
|
}
|
|
1309
|
-
},
|
|
1282
|
+
}, re = async function() {
|
|
1310
1283
|
const l = this.__internal__.serial.port;
|
|
1311
1284
|
if (!l || !l.readable) throw new Error("Port is not readable");
|
|
1312
1285
|
for (; l.readable && this.__internal__.serial.keep_reading; ) {
|
|
@@ -1315,12 +1288,12 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1315
1288
|
try {
|
|
1316
1289
|
let t = !0;
|
|
1317
1290
|
for (; t; ) {
|
|
1318
|
-
const { value: n, done:
|
|
1319
|
-
if (
|
|
1291
|
+
const { value: n, done: i } = await e.read();
|
|
1292
|
+
if (i) {
|
|
1320
1293
|
e.releaseLock(), this.__internal__.serial.keep_reading = !1, t = !1;
|
|
1321
1294
|
break;
|
|
1322
1295
|
}
|
|
1323
|
-
y(this, b,
|
|
1296
|
+
y(this, b, V).call(this, n), this.__internal__.serial.response.length === null ? await y(this, b, z).call(this) : await y(this, b, K).call(this);
|
|
1324
1297
|
}
|
|
1325
1298
|
} catch (t) {
|
|
1326
1299
|
this.serialErrors(t);
|
|
@@ -1329,9 +1302,9 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1329
1302
|
}
|
|
1330
1303
|
}
|
|
1331
1304
|
this.__internal__.serial.keep_reading = !0, this.__internal__.serial.port && await this.__internal__.serial.port.close();
|
|
1332
|
-
},
|
|
1305
|
+
}, ie = async function() {
|
|
1333
1306
|
return typeof window > "u" ? !1 : "serial" in navigator && "forget" in SerialPort.prototype && this.__internal__.serial.port ? (await this.__internal__.serial.port.forget(), !0) : !1;
|
|
1334
|
-
},
|
|
1307
|
+
}, se = function() {
|
|
1335
1308
|
[
|
|
1336
1309
|
"serial:connected",
|
|
1337
1310
|
"serial:connecting",
|
|
@@ -1350,21 +1323,21 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1350
1323
|
].forEach((l) => {
|
|
1351
1324
|
this.serialRegisterAvailableListener(l);
|
|
1352
1325
|
});
|
|
1353
|
-
},
|
|
1326
|
+
}, ae = function() {
|
|
1354
1327
|
const l = this;
|
|
1355
1328
|
this.on("internal:queue", async () => {
|
|
1356
1329
|
var e;
|
|
1357
|
-
await y(e = l, b,
|
|
1358
|
-
}), y(this, b,
|
|
1359
|
-
},
|
|
1330
|
+
await y(e = l, b, X).call(e);
|
|
1331
|
+
}), y(this, b, G).call(this);
|
|
1332
|
+
}, G = function() {
|
|
1360
1333
|
const l = this;
|
|
1361
1334
|
navigator.serial.addEventListener("connect", async () => {
|
|
1362
1335
|
l.isDisconnected && await l.serialConnect().catch(() => {
|
|
1363
1336
|
});
|
|
1364
1337
|
});
|
|
1365
|
-
},
|
|
1366
|
-
if (!y(this, b,
|
|
1367
|
-
y(this, b,
|
|
1338
|
+
}, X = async function() {
|
|
1339
|
+
if (!y(this, b, E).call(this, this.__internal__.serial.port)) {
|
|
1340
|
+
y(this, b, P).call(this, { error: "Port is closed, not readable or writable." }), await this.serialConnect();
|
|
1368
1341
|
return;
|
|
1369
1342
|
}
|
|
1370
1343
|
if (this.__internal__.timeout.until_response || this.__internal__.serial.queue.length === 0) return;
|
|
@@ -1372,15 +1345,15 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1372
1345
|
let e = this.__internal__.time.response_general;
|
|
1373
1346
|
l.action === "connect" && (e = this.__internal__.time.response_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
|
|
1374
1347
|
await this.timeout(l.bytes, l.action);
|
|
1375
|
-
}, e), this.__internal__.serial.last_action = l.action ?? "unknown", await y(this, b,
|
|
1348
|
+
}, e), this.__internal__.serial.last_action = l.action ?? "unknown", await y(this, b, H).call(this, l.bytes), this.dispatch("serial:sent", {
|
|
1376
1349
|
action: l.action,
|
|
1377
1350
|
bytes: l.bytes
|
|
1378
|
-
}), this.__internal__.auto_response && y(this, b,
|
|
1351
|
+
}), this.__internal__.auto_response && y(this, b, x).call(this, this.__internal__.serial.auto_response, null);
|
|
1379
1352
|
const t = [...this.__internal__.serial.queue];
|
|
1380
1353
|
this.__internal__.serial.queue = t.splice(1);
|
|
1381
|
-
},
|
|
1354
|
+
}, le = function(l = 1) {
|
|
1382
1355
|
this.__internal__.device_number = l, this.__internal__.serial.bytes_connection = this.serialSetConnectionConstant(l);
|
|
1383
|
-
},
|
|
1356
|
+
}, oe = function() {
|
|
1384
1357
|
this.__internal__.last_error = {
|
|
1385
1358
|
message: null,
|
|
1386
1359
|
action: null,
|
|
@@ -1389,7 +1362,7 @@ b = /* @__PURE__ */ new WeakSet(), M = function(l) {
|
|
|
1389
1362
|
};
|
|
1390
1363
|
};
|
|
1391
1364
|
_.instance || (_.instance = new _());
|
|
1392
|
-
const
|
|
1365
|
+
const me = {
|
|
1393
1366
|
relay: [],
|
|
1394
1367
|
locker: [],
|
|
1395
1368
|
jofemar: [],
|
|
@@ -1398,7 +1371,7 @@ const Ae = {
|
|
|
1398
1371
|
pinpad: [],
|
|
1399
1372
|
pinpax: []
|
|
1400
1373
|
};
|
|
1401
|
-
_.devices = { ..._.devices, ...
|
|
1374
|
+
_.devices = { ..._.devices, ...me };
|
|
1402
1375
|
_.addCustom = (l, e) => {
|
|
1403
1376
|
_.registerType(l), _.add(e);
|
|
1404
1377
|
};
|
|
@@ -1417,7 +1390,7 @@ _.getRelay = (l = 1) => _.getByNumber("relay", l);
|
|
|
1417
1390
|
_.getArduino = (l = 1) => _.getByNumber("arduino", l);
|
|
1418
1391
|
_.getPinPad = (l = 1) => _.getByNumber("pinpad", l);
|
|
1419
1392
|
_.getPinPax = (l = 1) => _.getByNumber("pinpax", l);
|
|
1420
|
-
class
|
|
1393
|
+
class ye extends be {
|
|
1421
1394
|
constructor(e) {
|
|
1422
1395
|
super(e), this.__internal__ = structuredClone(this.__internal__), this.getResponseAsArrayHex(), this.__internal__.device.door_open = !1, this.__internal__.time.response_engines = 2e3, this.__internal__.time.sense = 100, this.__internal__.interval.waiting_sense = 0, this.__internal__.dispense = {
|
|
1423
1396
|
must_response: !1,
|
|
@@ -1460,7 +1433,7 @@ class xe extends Se {
|
|
|
1460
1433
|
}), null);
|
|
1461
1434
|
}
|
|
1462
1435
|
async internalDispenseStatus() {
|
|
1463
|
-
if (this.__internal__.dispense.must_response && (await
|
|
1436
|
+
if (this.__internal__.dispense.must_response && (await _e(this.__internal__.time.response_engines + 10), this.__internal__.dispense.status === "no-response"))
|
|
1464
1437
|
return this.internalClearSensing(), this.__internal__.dispense.status = !1, this.dispatch("not-dispensed", { reason: "no-response" }), { status: !1, error: "no-response" };
|
|
1465
1438
|
this.__internal__.dispense.status = null, this.__internal__.dispense.dispensing = !0, this.dispatch("internal:dispense:running", {});
|
|
1466
1439
|
const e = this;
|
|
@@ -1488,14 +1461,14 @@ class xe extends Se {
|
|
|
1488
1461
|
}
|
|
1489
1462
|
async internalDispense(e) {
|
|
1490
1463
|
if (this.isDispensing) throw new Error("Another dispensing process is running");
|
|
1491
|
-
if (!
|
|
1464
|
+
if (!O.enable && !this.__internal__.serial.connected && (await this.serialConnect(), !this.__internal__.serial.connected))
|
|
1492
1465
|
throw new Error("Serial device not connected");
|
|
1493
1466
|
return this.__internal__.serial.queue.length === 0 ? (await this.appendToQueue(e, "dispense"), await this.internalDispenseStatus()) : new Promise((t) => {
|
|
1494
1467
|
const n = setInterval(async () => {
|
|
1495
1468
|
if (this.__internal__.serial.queue.length > 0) return;
|
|
1496
1469
|
clearInterval(n), await this.appendToQueue(e, "dispense");
|
|
1497
|
-
const
|
|
1498
|
-
t(
|
|
1470
|
+
const i = await this.internalDispenseStatus();
|
|
1471
|
+
t(i);
|
|
1499
1472
|
}, 100);
|
|
1500
1473
|
});
|
|
1501
1474
|
}
|
|
@@ -1525,13 +1498,13 @@ class xe extends Se {
|
|
|
1525
1498
|
}
|
|
1526
1499
|
}
|
|
1527
1500
|
export {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1501
|
+
O as E,
|
|
1502
|
+
ye as K,
|
|
1503
|
+
_,
|
|
1504
|
+
Ce as a,
|
|
1505
|
+
ke as b,
|
|
1506
|
+
De as g,
|
|
1507
|
+
Se as i,
|
|
1508
|
+
ve as s,
|
|
1509
|
+
_e as w
|
|
1537
1510
|
};
|