@danidoble/webserial 4.5.0-beta.4 → 4.5.0-beta.5

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.
@@ -12,43 +12,43 @@ const g = (i) => {
12
12
  data: i,
13
13
  asString: e = !0
14
14
  }) => e ? Array.from(i).map((n) => n.toString(16).padStart(2, "0")).join(" ") : Array.from(i).map((n) => n.toString(16).padStart(2, "0"));
15
- var F = Object.defineProperty, L = (i, e, n) => e in i ? F(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, S = (i, e, n) => L(i, typeof e != "symbol" ? e + "" : e, n);
16
- const f = class d {
15
+ var F = Object.defineProperty, H = (i, e, n) => e in i ? F(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, S = (i, e, n) => H(i, typeof e != "symbol" ? e + "" : e, n);
16
+ const C = class m {
17
17
  build(e) {
18
- return g(e + d.append);
18
+ return g(e + m.append);
19
19
  }
20
20
  static connection() {
21
- return d.instance.build("CONNECT");
21
+ return m.instance.build("CONNECT");
22
22
  }
23
23
  static connect() {
24
- return d.connection();
24
+ return m.connection();
25
25
  }
26
26
  static credits() {
27
- return d.instance.build("CREDITS");
27
+ return m.instance.build("CREDITS");
28
28
  }
29
29
  static hi() {
30
- return d.instance.build("HI");
30
+ return m.instance.build("HI");
31
31
  }
32
32
  static ara() {
33
- return d.instance.build("ARA");
33
+ return m.instance.build("ARA");
34
34
  }
35
35
  static custom(e) {
36
- return d.instance.build(e);
36
+ return m.instance.build(e);
37
37
  }
38
38
  };
39
- S(f, "append", `
40
- `), S(f, "instance");
41
- let k = f;
39
+ S(C, "append", `
40
+ `), S(C, "instance");
41
+ let k = C;
42
42
  k.instance = new k();
43
- var H = Object.defineProperty, B = (i, e, n) => e in i ? H(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, I = (i, e, n) => B(i, typeof e != "symbol" ? e + "" : e, n);
43
+ var J = Object.defineProperty, L = (i, e, n) => e in i ? J(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, N = (i, e, n) => L(i, typeof e != "symbol" ? e + "" : e, n);
44
44
  const b = class c {
45
45
  build(e) {
46
46
  return c.asHex ? P({ data: e, asString: !1 }) : g(e);
47
47
  }
48
48
  serialBoardroidSumHex(e) {
49
49
  let n = 0;
50
- for (let a = 0; a < e.length; a++)
51
- a === 0 || a === 11 || (n += e[a]);
50
+ for (let t = 0; t < e.length; t++)
51
+ t === 0 || t === 11 || (n += e[t]);
52
52
  return n;
53
53
  }
54
54
  boardroidCheckSum(e) {
@@ -76,15 +76,15 @@ const b = class c {
76
76
  static coinPurseConfiguration({
77
77
  enable: e = !1,
78
78
  high: n = 255,
79
- low: a = 255
79
+ low: t = 255
80
80
  } = {}) {
81
- const t = c.instance.boardroidCheckSum(
81
+ const a = c.instance.boardroidCheckSum(
82
82
  new Uint8Array([
83
83
  241,
84
84
  193,
85
85
  e ? 1 : 0,
86
86
  n,
87
- a,
87
+ t,
88
88
  0,
89
89
  0,
90
90
  0,
@@ -94,14 +94,14 @@ const b = class c {
94
94
  0
95
95
  ])
96
96
  );
97
- return c.instance.build(t);
97
+ return c.instance.build(a);
98
98
  }
99
- static coinPurseDispense({ $50c: e = 0, $1: n = 0, $2: a = 0, $5: t = 0, $10: s = 0 } = {}) {
100
- if ([e, n, a, t, s].some(
99
+ static coinPurseDispense({ $50c: e = 0, $1: n = 0, $2: t = 0, $5: a = 0, $10: s = 0 } = {}) {
100
+ if ([e, n, t, a, s].some(
101
101
  (u) => isNaN(u) || typeof u == "string"
102
102
  ))
103
103
  throw new Error("One of the values is not a number");
104
- if (e < 1 && n < 1 && a < 1 && t < 1 && s < 1)
104
+ if (e < 1 && n < 1 && t < 1 && a < 1 && s < 1)
105
105
  throw new Error("No coins to dispense");
106
106
  const o = c.instance.boardroidCheckSum(
107
107
  new Uint8Array([
@@ -109,8 +109,8 @@ const b = class c {
109
109
  198,
110
110
  e,
111
111
  n,
112
- a,
113
112
  t,
113
+ a,
114
114
  s,
115
115
  0,
116
116
  0,
@@ -141,14 +141,14 @@ const b = class c {
141
141
  return c.instance.build(e);
142
142
  }
143
143
  static banknotePurseICTConfigure({ enable: e = !1, scrow: n = !1 } = {}) {
144
- const a = e ? 255 : 0, t = n ? 255 : 0, s = c.instance.boardroidCheckSum(
144
+ const t = e ? 255 : 0, a = n ? 255 : 0, s = c.instance.boardroidCheckSum(
145
145
  new Uint8Array([
146
146
  241,
147
147
  192,
148
- a,
149
- a,
150
148
  t,
151
149
  t,
150
+ a,
151
+ a,
152
152
  0,
153
153
  0,
154
154
  0,
@@ -160,12 +160,12 @@ const b = class c {
160
160
  return c.instance.build(s);
161
161
  }
162
162
  static banknotePurseOtherConfigure({ enable: e = !1, scrow: n = !1 } = {}) {
163
- const a = e ? 1 : 0, t = n ? 1 : 0, s = c.instance.boardroidCheckSum(
163
+ const t = e ? 1 : 0, a = n ? 1 : 0, s = c.instance.boardroidCheckSum(
164
164
  new Uint8Array([
165
165
  241,
166
166
  192,
167
- a,
168
167
  t,
168
+ a,
169
169
  0,
170
170
  0,
171
171
  0,
@@ -186,11 +186,11 @@ const b = class c {
186
186
  throw new Error("No banknotes to dispense");
187
187
  if ([20, 50, 100, 200, 500].indexOf(n) === -1)
188
188
  throw new Error("Invalid denomination");
189
- const a = [20, 50, 100, 200, 500].indexOf(n), t = c.instance.boardroidCheckSum(
189
+ const t = [20, 50, 100, 200, 500].indexOf(n), a = c.instance.boardroidCheckSum(
190
190
  new Uint8Array([
191
191
  241,
192
192
  197,
193
- a,
193
+ t,
194
194
  e,
195
195
  0,
196
196
  0,
@@ -202,21 +202,21 @@ const b = class c {
202
202
  0
203
203
  ])
204
204
  );
205
- return c.instance.build(t);
205
+ return c.instance.build(a);
206
206
  }
207
207
  static banknotePurseOtherDispense({
208
208
  $20: e = 0,
209
209
  $50: n = 0,
210
- $100: a = 0,
211
- $200: t = 0,
210
+ $100: t = 0,
211
+ $200: a = 0,
212
212
  $500: s = 0,
213
213
  $1000: o = 0
214
214
  } = {}) {
215
- if ([e, n, a, t, s, o].some(
216
- (m) => isNaN(m) || typeof m == "string"
215
+ if ([e, n, t, a, s, o].some(
216
+ (d) => isNaN(d) || typeof d == "string"
217
217
  ))
218
218
  throw new Error("One of the values is not a number");
219
- if (e < 1 && n < 1 && a < 1 && t < 1 && s < 1 && o < 1)
219
+ if (e < 1 && n < 1 && t < 1 && a < 1 && s < 1 && o < 1)
220
220
  throw new Error("No banknotes to dispense");
221
221
  const u = c.instance.boardroidCheckSum(
222
222
  new Uint8Array([
@@ -224,8 +224,8 @@ const b = class c {
224
224
  197,
225
225
  e,
226
226
  n,
227
- a,
228
227
  t,
228
+ a,
229
229
  s,
230
230
  o,
231
231
  0,
@@ -277,8 +277,8 @@ const b = class c {
277
277
  static banknotePurseSaveMemory({
278
278
  channel: e = null,
279
279
  $20: n = null,
280
- $50: a = null,
281
- $100: t = null,
280
+ $50: t = null,
281
+ $100: a = null,
282
282
  $200: s = null,
283
283
  $500: o = null,
284
284
  $1000: u = null
@@ -291,27 +291,27 @@ const b = class c {
291
291
  $500: null,
292
292
  $1000: null
293
293
  }) {
294
- if (e === null || n === null || a === null || t === null || s === null || o === null || u === null)
294
+ if (e === null || n === null || t === null || a === null || s === null || o === null || u === null)
295
295
  throw new Error(
296
296
  "One of the values is not defined: " + JSON.stringify({
297
297
  channel: e,
298
298
  $20: n,
299
- $50: a,
300
- $100: t,
299
+ $50: t,
300
+ $100: a,
301
301
  $200: s,
302
302
  $500: o,
303
303
  $1000: u
304
304
  })
305
305
  );
306
- const m = c.instance.boardroidCheckSum(
306
+ const d = c.instance.boardroidCheckSum(
307
307
  new Uint8Array([
308
308
  241,
309
309
  200,
310
310
  e,
311
311
  0,
312
312
  n,
313
- a,
314
313
  t,
314
+ a,
315
315
  s,
316
316
  o,
317
317
  u,
@@ -319,7 +319,7 @@ const b = class c {
319
319
  0
320
320
  ])
321
321
  );
322
- return c.instance.build(m);
322
+ return c.instance.build(d);
323
323
  }
324
324
  static banknotePurseReadRecycler() {
325
325
  const e = c.instance.boardroidCheckSum(
@@ -362,8 +362,8 @@ const b = class c {
362
362
  static cardReaderDispense({
363
363
  selection: e = 1,
364
364
  second_selection: n = null,
365
- sensor: a = !0,
366
- seconds: t = null,
365
+ sensor: t = !0,
366
+ seconds: a = null,
367
367
  price: s = 0
368
368
  } = {
369
369
  selection: 1,
@@ -372,17 +372,17 @@ const b = class c {
372
372
  seconds: null,
373
373
  price: 0
374
374
  }) {
375
- const o = s / 256, u = s % 256, m = e + 9;
375
+ const o = s / 256, u = s % 256, d = e + 9;
376
376
  let p = 0;
377
377
  n && (p = n + 9);
378
378
  let E = 0;
379
- a || (t || (t = 1.5), E = Math.round(t * 6.2));
379
+ t || (a || (a = 1.5), E = Math.round(a * 6.2));
380
380
  const M = c.instance.boardroidCheckSum(
381
381
  new Uint8Array([
382
382
  241,
383
383
  205,
384
384
  1,
385
- m,
385
+ d,
386
386
  p,
387
387
  E,
388
388
  o,
@@ -436,8 +436,8 @@ const b = class c {
436
436
  static dispense({
437
437
  selection: e = 1,
438
438
  second_selection: n = null,
439
- sensor: a = !0,
440
- seconds: t = null
439
+ sensor: t = !0,
440
+ seconds: a = null
441
441
  } = {
442
442
  selection: 1,
443
443
  second_selection: null,
@@ -449,8 +449,8 @@ const b = class c {
449
449
  let o = 0;
450
450
  n && (n += 9, o = n);
451
451
  let u = 0;
452
- a || (t || (t = 1.5), u = Math.round(t * 6.2));
453
- const m = c.instance.boardroidCheckSum(
452
+ t || (a || (a = 1.5), u = Math.round(a * 6.2));
453
+ const d = c.instance.boardroidCheckSum(
454
454
  new Uint8Array([
455
455
  241,
456
456
  199,
@@ -466,20 +466,20 @@ const b = class c {
466
466
  0
467
467
  ])
468
468
  );
469
- return c.instance.build(m);
469
+ return c.instance.build(d);
470
470
  }
471
471
  static customCode(e) {
472
- typeof e[0] == "string" && (e = e.map((a) => parseInt(a, 16)));
472
+ typeof e[0] == "string" && (e = e.map((t) => parseInt(t, 16)));
473
473
  const n = c.instance.boardroidCheckSum(
474
474
  new Uint8Array(e)
475
475
  );
476
476
  return c.instance.build(n);
477
477
  }
478
478
  };
479
- I(b, "asHex", !1), I(b, "instance");
480
- let N = b;
481
- N.instance = new N();
482
- var J = Object.defineProperty, G = (i, e, n) => e in i ? J(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, A = (i, e, n) => G(i, typeof e != "symbol" ? e + "" : e, n);
479
+ N(b, "asHex", !1), N(b, "instance");
480
+ let I = b;
481
+ I.instance = new I();
482
+ var B = Object.defineProperty, G = (i, e, n) => e in i ? B(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, A = (i, e, n) => G(i, typeof e != "symbol" ? e + "" : e, n);
483
483
  const w = class r {
484
484
  build(e) {
485
485
  const n = this.jofemarCheckSum(e);
@@ -494,31 +494,31 @@ const w = class r {
494
494
  }
495
495
  jofemarCheckSum(e) {
496
496
  let n = 0;
497
- for (let t = 0; t < e.length; t++)
498
- n += e[t];
499
- const a = this.calcCheckSums(n);
500
- return e.push(a[0]), e.push(a[1]), e.push(3), new Uint8Array(e);
497
+ for (let a = 0; a < e.length; a++)
498
+ n += e[a];
499
+ const t = this.calcCheckSums(n);
500
+ return e.push(t[0]), e.push(t[1]), e.push(3), new Uint8Array(e);
501
501
  }
502
502
  getTrayAndChannelBySelection(e) {
503
503
  if (e = parseInt(e) + 109, e = e.toString(), e.length !== 3)
504
504
  throw new Error("Invalid selection");
505
- const n = (parseInt(e.substring(0, 2)) + 128).toString(16).padStart(2, "0"), a = (parseInt(e.substring(2, 3)) + 128).toString(16).padStart(2, "0");
506
- return { channel: parseInt(a, 16), tray: parseInt(n, 16) };
505
+ const n = (parseInt(e.substring(0, 2)) + 128).toString(16).padStart(2, "0"), t = (parseInt(e.substring(2, 3)) + 128).toString(16).padStart(2, "0");
506
+ return { channel: parseInt(t, 16), tray: parseInt(n, 16) };
507
507
  }
508
508
  makeDisplayMessage(e = "") {
509
509
  e = e.padEnd(32, " ");
510
510
  const n = [];
511
- for (let a = 0; a < 32; a++)
512
- n.push(e.charCodeAt(a));
511
+ for (let t = 0; t < 32; t++)
512
+ n.push(e.charCodeAt(t));
513
513
  return n;
514
514
  }
515
515
  makeTimeFormat(e) {
516
516
  if (!(e instanceof Date))
517
517
  throw new Error("Invalid date, must be an instance of Date");
518
- const n = e.getHours().toString().padStart(2, "0"), a = e.getMinutes().toString().padStart(2, "0"), t = e.getDate().toString().padStart(2, "0"), s = (e.getMonth() + 1).toString().padStart(2, "0"), o = e.getFullYear().toString().substring(2, 4), u = `${n}:${a} ${t}-${s}-${o}`, m = [];
518
+ const n = e.getHours().toString().padStart(2, "0"), t = e.getMinutes().toString().padStart(2, "0"), a = e.getDate().toString().padStart(2, "0"), s = (e.getMonth() + 1).toString().padStart(2, "0"), o = e.getFullYear().toString().substring(2, 4), u = `${n}:${t} ${a}-${s}-${o}`, d = [];
519
519
  for (let p = 0; p < 14; p++)
520
- m.push(u.charCodeAt(p));
521
- return m;
520
+ d.push(u.charCodeAt(p));
521
+ return d;
522
522
  }
523
523
  static connection({ channel: e = 1 } = {}) {
524
524
  return r.instance.build([
@@ -531,22 +531,22 @@ const w = class r {
531
531
  255
532
532
  ]);
533
533
  }
534
- static dispense({ machineChannel: e = 1, selection: n = 1, cart: a = !1 } = {
534
+ static dispense({ machineChannel: e = 1, selection: n = 1, cart: t = !1 } = {
535
535
  machineChannel: 1,
536
536
  selection: 1,
537
537
  cart: !1
538
538
  }) {
539
539
  if (n = parseInt(n), isNaN(n) || n < 1 || n > 130)
540
540
  throw new Error("Invalid selection");
541
- const { channel: t, tray: s } = r.instance.getTrayAndChannelBySelection(n);
541
+ const { channel: a, tray: s } = r.instance.getTrayAndChannelBySelection(n);
542
542
  return r.instance.build([
543
543
  2,
544
544
  48,
545
545
  48,
546
546
  128 + e,
547
- a ? 77 : 86,
547
+ t ? 77 : 86,
548
548
  s,
549
- t
549
+ a
550
550
  ]);
551
551
  }
552
552
  static endCartDispense({ machineChannel: e = 1 } = {}) {
@@ -572,14 +572,14 @@ const w = class r {
572
572
  ]);
573
573
  }
574
574
  static reset({ machineChannel: e = 1, type: n = "soldOut" } = {}) {
575
- let a = 128;
576
- return n === "waiting" ? a = 129 : n === "machine" && (a = 255), r.instance.build([
575
+ let t = 128;
576
+ return n === "waiting" ? t = 129 : n === "machine" && (t = 255), r.instance.build([
577
577
  2,
578
578
  48,
579
579
  48,
580
580
  128 + e,
581
581
  82,
582
- a,
582
+ t,
583
583
  255
584
584
  ]);
585
585
  }
@@ -595,21 +595,21 @@ const w = class r {
595
595
  ]);
596
596
  }
597
597
  static lights({ machineChannel: e = 1, type: n = "on" } = {}) {
598
- const a = n === "on" ? 129 : 128;
598
+ const t = n === "on" ? 129 : 128;
599
599
  return r.instance.build([
600
600
  2,
601
601
  48,
602
602
  48,
603
603
  128 + e,
604
604
  76,
605
- a,
605
+ t,
606
606
  255
607
607
  ]);
608
608
  }
609
609
  static program({
610
610
  machineChannel: e = 1,
611
611
  param1: n = 255,
612
- param2: a = 255
612
+ param2: t = 255
613
613
  } = {}) {
614
614
  return r.instance.build([
615
615
  2,
@@ -618,19 +618,19 @@ const w = class r {
618
618
  128 + e,
619
619
  80,
620
620
  n,
621
- a
621
+ t
622
622
  ]);
623
623
  }
624
624
  static programDisplayLanguage({
625
625
  machineChannel: e = 1,
626
626
  language: n = "spanish"
627
627
  } = {}) {
628
- const a = { spanish: 48, english: 49, french: 50 };
629
- if (!a[n]) throw new Error("Invalid language");
628
+ const t = { spanish: 48, english: 49, french: 50 };
629
+ if (!t[n]) throw new Error("Invalid language");
630
630
  return r.program({
631
631
  machineChannel: e,
632
632
  param1: 73,
633
- param2: a[n]
633
+ param2: t[n]
634
634
  });
635
635
  }
636
636
  static programBeeper({
@@ -660,16 +660,16 @@ const w = class r {
660
660
  static programWorkingTemperature({
661
661
  machineChannel: e = 1,
662
662
  degrees: n = 0.5,
663
- machineType: a = "esplus"
663
+ machineType: t = "esplus"
664
664
  } = {}) {
665
665
  typeof n == "string" && (n = parseFloat(n));
666
- const t = a === "iceplus" ? 6.5 : 32, s = a === "iceplus" ? -25 : 0.5;
667
- if (isNaN(n) || n < s || n > t || n % 0.5 !== 0)
666
+ const a = t === "iceplus" ? 6.5 : 32, s = t === "iceplus" ? -25 : 0.5;
667
+ if (isNaN(n) || n < s || n > a || n % 0.5 !== 0)
668
668
  throw new Error(
669
669
  "Invalid degrees, must be a multiple of 0.5 and between 0.5 and 32"
670
670
  );
671
671
  let o = n * 2 + 128;
672
- return a === "iceplus" && (o += 51), o = Math.ceil(o), r.program({ param1: 84, param2: o, machineChannel: e });
672
+ return t === "iceplus" && (o += 51), o = Math.ceil(o), r.program({ param1: 84, param2: o, machineChannel: e });
673
673
  }
674
674
  static programIsolationTray({
675
675
  machineChannel: e = 1,
@@ -677,8 +677,8 @@ const w = class r {
677
677
  }) {
678
678
  if (typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 0 || n > 12)
679
679
  throw new Error("Invalid tray, valid range is 0 to 12");
680
- const a = n === 0 ? 128 : n + 139;
681
- return r.program({ param1: 66, param2: a, machineChannel: e });
680
+ const t = n === 0 ? 128 : n + 139;
681
+ return r.program({ param1: 66, param2: t, machineChannel: e });
682
682
  }
683
683
  static programTimeToStandbyAfterCollect({
684
684
  machineChannel: e = 1,
@@ -686,8 +686,8 @@ const w = class r {
686
686
  } = {}) {
687
687
  if (typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 15 || n > 120)
688
688
  throw new Error("Invalid seconds, valid range is 15 to 120");
689
- const a = 128 + n;
690
- return r.program({ param1: 70, param2: a, machineChannel: e });
689
+ const t = 128 + n;
690
+ return r.program({ param1: 70, param2: t, machineChannel: e });
691
691
  }
692
692
  static programTimeToStandbyWithoutCollect({
693
693
  machineChannel: e = 1,
@@ -695,19 +695,19 @@ const w = class r {
695
695
  } = {}) {
696
696
  if (typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 1 || n > 10)
697
697
  throw new Error("Invalid minutes, valid range is 1 to 10");
698
- const a = 128 + n;
699
- return r.program({ param1: 72, param2: a, machineChannel: e });
698
+ const t = 128 + n;
699
+ return r.program({ param1: 72, param2: t, machineChannel: e });
700
700
  }
701
701
  static programElevatorSpeed({
702
702
  machineChannel: e = 1,
703
703
  speed: n = "high"
704
704
  } = {}) {
705
- const a = { high: 49, low: 48 };
706
- if (!a[n])
705
+ const t = { high: 49, low: 48 };
706
+ if (!t[n])
707
707
  throw new Error("Invalid speed, valid speeds are 'high' and 'low'");
708
708
  return r.program({
709
709
  param1: 118,
710
- param2: a[n],
710
+ param2: t[n],
711
711
  machineChannel: e
712
712
  });
713
713
  }
@@ -741,8 +741,8 @@ const w = class r {
741
741
  throw new Error(
742
742
  "Invalid degrees, must be a multiple of 0.5 and valid range is 0.5 to 30"
743
743
  );
744
- const a = 128 + n * 2;
745
- return r.program({ param1: 101, param2: a, machineChannel: e });
744
+ const t = 128 + n * 2;
745
+ return r.program({ param1: 101, param2: t, machineChannel: e });
746
746
  }
747
747
  static programTimeBeforeExpirationByTemperature({
748
748
  machineChannel: e = 1,
@@ -750,90 +750,90 @@ const w = class r {
750
750
  }) {
751
751
  if (typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 1 || n > 120)
752
752
  throw new Error("Invalid minutes, valid range is 1 to 120");
753
- const a = 128 + n;
754
- return r.program({ param1: 102, param2: a, machineChannel: e });
753
+ const t = 128 + n;
754
+ return r.program({ param1: 102, param2: t, machineChannel: e });
755
755
  }
756
756
  static programTemperatureScale({
757
757
  machineChannel: e = 1,
758
758
  scale: n = "celsius"
759
759
  } = {}) {
760
- const a = { celsius: 67, fahrenheit: 70 };
761
- if (!a[n])
760
+ const t = { celsius: 67, fahrenheit: 70 };
761
+ if (!t[n])
762
762
  throw new Error(
763
763
  "Invalid scale, valid scales are 'celsius' and 'fahrenheit'"
764
764
  );
765
765
  return r.program({
766
766
  param1: 103,
767
- param2: a[n],
767
+ param2: t[n],
768
768
  machineChannel: e
769
769
  });
770
770
  }
771
771
  static programVoltageEngine({
772
772
  machineChannel: e = 1,
773
773
  selection: n = 1,
774
- voltage: a = 5
774
+ voltage: t = 5
775
775
  } = {}) {
776
- if (typeof a == "string" && (a = parseFloat(a)), typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 1 || n > 130)
776
+ if (typeof t == "string" && (t = parseFloat(t)), typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 1 || n > 130)
777
777
  throw new Error("Invalid selection, valid range is 1 to 130");
778
- if (isNaN(a) || a < 5 || a > 9.5 || a % 0.5 !== 0)
778
+ if (isNaN(t) || t < 5 || t > 9.5 || t % 0.5 !== 0)
779
779
  throw new Error("Invalid voltage, valid range is 5 to 9.5");
780
- const t = 109 + n, s = 128 + (a - 5) * 2;
780
+ const a = 109 + n, s = 128 + (t - 5) * 2;
781
781
  return r.instance.build([
782
782
  2,
783
783
  48,
784
784
  48,
785
785
  128 + e,
786
786
  71,
787
- t,
787
+ a,
788
788
  s
789
789
  ]);
790
790
  }
791
791
  static programPushOverProducts({
792
792
  machineChannel: e = 1,
793
793
  selection: n = 1,
794
- enable: a = !0
794
+ enable: t = !0
795
795
  } = {}) {
796
796
  if (typeof n == "string" && (n = parseInt(n)), isNaN(n) || n < 1 || n > 130)
797
797
  throw new Error("Invalid selection, valid range is 1 to 130");
798
- const t = 109 + n, s = a ? 49 : 48;
798
+ const a = 109 + n, s = t ? 49 : 48;
799
799
  return r.instance.build([
800
800
  2,
801
801
  48,
802
802
  48,
803
803
  128 + e,
804
804
  79,
805
- t,
805
+ a,
806
806
  s
807
807
  ]);
808
808
  }
809
809
  static programChannelRunningAfterDispense({
810
810
  machineChannel: e = 1,
811
811
  selection: n = 1,
812
- seconds: a = 0
812
+ seconds: t = 0
813
813
  } = {}) {
814
- if (typeof n == "string" && (n = parseInt(n)), typeof a == "string" && (a = parseFloat(a)), isNaN(n) || n < 1 || n > 130)
814
+ if (typeof n == "string" && (n = parseInt(n)), typeof t == "string" && (t = parseFloat(t)), isNaN(n) || n < 1 || n > 130)
815
815
  throw new Error("Invalid selection, valid range is 1 to 130");
816
- if (isNaN(a) || a < 0 || a > 10 || a % 0.1 !== 0)
816
+ if (isNaN(t) || t < 0 || t > 10 || t % 0.1 !== 0)
817
817
  throw new Error(
818
818
  "Invalid seconds, valid range is 0.0 to 10.0 with a step of 0.1"
819
819
  );
820
- const t = 109 + n;
821
- a = 10 * parseFloat(a.toFixed(1));
822
- const s = 128 + a;
820
+ const a = 109 + n;
821
+ t = 10 * parseFloat(t.toFixed(1));
822
+ const s = 128 + t;
823
823
  return r.instance.build([
824
824
  2,
825
825
  48,
826
826
  48,
827
827
  128 + e,
828
828
  69,
829
- t,
829
+ a,
830
830
  s
831
831
  ]);
832
832
  }
833
833
  static checkData({
834
834
  machineChannel: e = 1,
835
835
  type: n = 255,
836
- aux: a = 255
836
+ aux: t = 255
837
837
  }) {
838
838
  return r.instance.build([
839
839
  2,
@@ -842,7 +842,7 @@ const w = class r {
842
842
  128 + e,
843
843
  67,
844
844
  n,
845
- a
845
+ t
846
846
  ]);
847
847
  }
848
848
  static getDisplayLanguage({
@@ -975,7 +975,7 @@ const w = class r {
975
975
  static displayConfig({
976
976
  machineChannel: e = 1,
977
977
  type: n = 128,
978
- param2: a = []
978
+ param2: t = []
979
979
  } = {}) {
980
980
  return r.instance.build([
981
981
  2,
@@ -984,30 +984,30 @@ const w = class r {
984
984
  128 + e,
985
985
  68,
986
986
  n,
987
- ...a
987
+ ...t
988
988
  ]);
989
989
  }
990
990
  static setDisplayStandbyMessage({ machineChannel: e = 1, message: n = "" } = {}) {
991
991
  n = n.substring(0, 32);
992
- const a = r.instance.makeDisplayMessage(n);
992
+ const t = r.instance.makeDisplayMessage(n);
993
993
  return r.displayConfig({
994
994
  machineChannel: e,
995
995
  type: 128,
996
- param2: a
996
+ param2: t
997
997
  });
998
998
  }
999
999
  static setDisplayMessageTemporarily({
1000
1000
  machineChannel: e = 1,
1001
1001
  message: n = "",
1002
- seconds: a = 1
1002
+ seconds: t = 1
1003
1003
  }) {
1004
- if (n = n.substring(0, 32), typeof a == "string" && (a = parseInt(a)), isNaN(a) || a < 1 || a > 125)
1004
+ if (n = n.substring(0, 32), typeof t == "string" && (t = parseInt(t)), isNaN(t) || t < 1 || t > 125)
1005
1005
  throw new Error("Invalid seconds, valid range is 1 to 125");
1006
- const t = r.instance.makeDisplayMessage(n), s = 128 + a;
1006
+ const a = r.instance.makeDisplayMessage(n), s = 128 + t;
1007
1007
  return r.displayConfig({
1008
1008
  machineChannel: e,
1009
1009
  type: s,
1010
- param2: t
1010
+ param2: a
1011
1011
  });
1012
1012
  }
1013
1013
  static setDisplayMessageUnlimited({
@@ -1015,11 +1015,11 @@ const w = class r {
1015
1015
  message: n = ""
1016
1016
  }) {
1017
1017
  n = n.substring(0, 32);
1018
- const a = r.instance.makeDisplayMessage(n);
1018
+ const t = r.instance.makeDisplayMessage(n);
1019
1019
  return r.displayConfig({
1020
1020
  machineChannel: e,
1021
1021
  type: 255,
1022
- param2: a
1022
+ param2: t
1023
1023
  });
1024
1024
  }
1025
1025
  static programClock({ machineChannel: e = 1, date: n = /* @__PURE__ */ new Date() } = {}) {
@@ -1037,10 +1037,10 @@ const w = class r {
1037
1037
  static eventsConfig({
1038
1038
  machineChannel: e = 1,
1039
1039
  event: n = null,
1040
- enable: a = !0
1040
+ enable: t = !0
1041
1041
  } = {}) {
1042
1042
  if (n === null) throw new Error("Invalid event");
1043
- const t = a ? 49 : 48;
1043
+ const a = t ? 49 : 48;
1044
1044
  return r.instance.build([
1045
1045
  2,
1046
1046
  48,
@@ -1048,7 +1048,7 @@ const w = class r {
1048
1048
  128 + e,
1049
1049
  65,
1050
1050
  n,
1051
- t
1051
+ a
1052
1052
  ]);
1053
1053
  }
1054
1054
  static eventEnable({
@@ -1056,8 +1056,8 @@ const w = class r {
1056
1056
  event: n = null
1057
1057
  } = {}) {
1058
1058
  if (n === null) throw new Error("Invalid event");
1059
- const a = parseInt(n, 16);
1060
- if (isNaN(a) || a < 38 || a > 100)
1059
+ const t = parseInt(n, 16);
1060
+ if (isNaN(t) || t < 38 || t > 100)
1061
1061
  throw new Error("Invalid event");
1062
1062
  return r.eventsConfig({ machineChannel: e, event: n, enable: !0 });
1063
1063
  }
@@ -1066,8 +1066,8 @@ const w = class r {
1066
1066
  event: n = null
1067
1067
  } = {}) {
1068
1068
  if (n === null) throw new Error("Invalid event");
1069
- const a = parseInt(n, 16);
1070
- if (isNaN(a) || a < 38 || a > 100)
1069
+ const t = parseInt(n, 16);
1070
+ if (isNaN(t) || t < 38 || t > 100)
1071
1071
  throw new Error("Invalid event");
1072
1072
  return r.eventsConfig({ machineChannel: e, event: n, enable: !1 });
1073
1073
  }
@@ -1085,30 +1085,30 @@ const y = class h {
1085
1085
  let n;
1086
1086
  try {
1087
1087
  n = new Uint8Array(e.length + 8), n.set(e, 2), n[0] = 2, n[1] = e.length + 4, n[n.length - 2] = 3;
1088
- let a = 0;
1089
- for (let o = 1; o < e.length; o++)
1090
- a += e[o], a *= parseInt(Math.pow(2, o - 1).toString());
1091
- n[e.length + 2] = a % 256, n[e.length + 3] = 666 * 3 % 256, n[e.length + 4] = 666 * 8 % 256;
1092
1088
  let t = 0;
1089
+ for (let o = 1; o < e.length; o++)
1090
+ t += e[o], t *= parseInt(Math.pow(2, o - 1).toString());
1091
+ n[e.length + 2] = t % 256, n[e.length + 3] = 666 * 3 % 256, n[e.length + 4] = 666 * 8 % 256;
1092
+ let a = 0;
1093
1093
  for (let o = 3; o < e.length + 5; o++)
1094
- t += n[o];
1095
- n[e.length + 5] = t % 256;
1094
+ a += n[o];
1095
+ n[e.length + 5] = a % 256;
1096
1096
  let s = 0;
1097
1097
  for (let o = 0; o < n.length - 1; o++)
1098
1098
  s ^= n[o];
1099
1099
  n[n.length - 1] = s;
1100
- } catch (a) {
1101
- throw n = new Uint8Array(0), a instanceof Error ? new Error(`Error generating command: ${a.message}`) : new Error("Error generating command: Unknown error");
1100
+ } catch (t) {
1101
+ throw n = new Uint8Array(0), t instanceof Error ? new Error(`Error generating command: ${t.message}`) : new Error("Error generating command: Unknown error");
1102
1102
  }
1103
1103
  return n;
1104
1104
  }
1105
1105
  serialLockerHexCmd(e) {
1106
- const n = this.serialLockerCmdMaker(e), a = [];
1107
- for (let t = 0; t < n.length; t++) {
1108
- const s = n[t].toString(16).padStart(2, "0");
1109
- a.push(s);
1106
+ const n = this.serialLockerCmdMaker(e), t = [];
1107
+ for (let a = 0; a < n.length; a++) {
1108
+ const s = n[a].toString(16).padStart(2, "0");
1109
+ t.push(s);
1110
1110
  }
1111
- return a;
1111
+ return t;
1112
1112
  }
1113
1113
  validateCell(e = 1) {
1114
1114
  let n;
@@ -1121,29 +1121,29 @@ const y = class h {
1121
1121
  } = {}) {
1122
1122
  return e = this.validateCell(e), this.build(new Uint8Array([16, n, e]));
1123
1123
  }
1124
- serialLockerGetLightScanCmd({ since: e = 0, until: n = 10, channel: a = 1 } = {}) {
1125
- return this.build(new Uint8Array([32, a, e, n]));
1124
+ serialLockerGetLightScanCmd({ since: e = 0, until: n = 10, channel: t = 1 } = {}) {
1125
+ return this.build(new Uint8Array([32, t, e, n]));
1126
1126
  }
1127
1127
  parseCellToColumnRow(e) {
1128
1128
  const n = Math.floor((e - 1) / 10) + 1;
1129
- let a = e % 8;
1130
- return a === 0 && (a = 8), [n, a];
1129
+ let t = e % 8;
1130
+ return t === 0 && (t = 8), [n, t];
1131
1131
  }
1132
1132
  serialLockerGetConfigureCellCmd({
1133
1133
  enable: e = !0,
1134
1134
  column: n = 0,
1135
- row: a = 10,
1136
- channel: t = 1
1135
+ row: t = 10,
1136
+ channel: a = 1
1137
1137
  } = {}) {
1138
1138
  if (n < 0 || n > 8) throw new Error("Invalid column number");
1139
- if (a < 0 || a > 10) throw new Error("Invalid row number");
1139
+ if (t < 0 || t > 10) throw new Error("Invalid row number");
1140
1140
  let s = 1;
1141
- return e || (s = 0), this.build(new Uint8Array([48, t, n, a, s]));
1141
+ return e || (s = 0), this.build(new Uint8Array([48, a, n, t, s]));
1142
1142
  }
1143
1143
  serialLockerGetOpenCmd({ cell: e = 1, channel: n = 1 } = {}) {
1144
1144
  e = this.validateCell(e);
1145
- const a = 666, t = a % 256, s = Math.floor(a / 3) % 256;
1146
- return this.build(new Uint8Array([64, n, e, t, s]));
1145
+ const t = 666, a = t % 256, s = Math.floor(t / 3) % 256;
1146
+ return this.build(new Uint8Array([64, n, e, a, s]));
1147
1147
  }
1148
1148
  build(e) {
1149
1149
  return h.asHex ? this.serialLockerHexCmd(e) : g(this.serialLockerCmdMaker(e));
@@ -1157,32 +1157,32 @@ const y = class h {
1157
1157
  static statusCell({ cell: e = 1, channel: n = 1 } = {}) {
1158
1158
  return e = h.instance.validateCell(e), h.instance.serialLockerGetStatusCellCmd({ cell: e, channel: n });
1159
1159
  }
1160
- static lightScan({ since: e = 0, until: n = 10, channel: a = 1 } = {}) {
1160
+ static lightScan({ since: e = 0, until: n = 10, channel: t = 1 } = {}) {
1161
1161
  if (e < 0 || e > 10) throw new Error("Invalid since number");
1162
1162
  if (n < 0 || n > 10) throw new Error("Invalid until number");
1163
1163
  return h.instance.serialLockerGetLightScanCmd({
1164
1164
  since: e,
1165
1165
  until: n,
1166
- channel: a
1166
+ channel: t
1167
1167
  });
1168
1168
  }
1169
1169
  static enableCell({ cell: e = 1, channel: n = 1 } = {}) {
1170
1170
  e = h.instance.validateCell(e);
1171
- const [a, t] = h.instance.parseCellToColumnRow(e);
1171
+ const [t, a] = h.instance.parseCellToColumnRow(e);
1172
1172
  return h.instance.serialLockerGetConfigureCellCmd({
1173
1173
  enable: !0,
1174
- column: a,
1175
- row: t,
1174
+ column: t,
1175
+ row: a,
1176
1176
  channel: n
1177
1177
  });
1178
1178
  }
1179
1179
  static disableCell({ cell: e = 1, channel: n = 1 } = {}) {
1180
1180
  e = h.instance.validateCell(e);
1181
- const [a, t] = h.instance.parseCellToColumnRow(e);
1181
+ const [t, a] = h.instance.parseCellToColumnRow(e);
1182
1182
  return h.instance.serialLockerGetConfigureCellCmd({
1183
1183
  enable: !1,
1184
- column: a,
1185
- row: t,
1184
+ column: t,
1185
+ row: a,
1186
1186
  channel: n
1187
1187
  });
1188
1188
  }
@@ -1233,12 +1233,12 @@ const v = class l {
1233
1233
  throw new Error(
1234
1234
  "Reference must be alphanumeric and the only symbol allowed is midlescore or underscore (- _) or null"
1235
1235
  );
1236
- const a = e.toFixed(2), t = JSON.stringify({
1236
+ const t = e.toFixed(2), a = JSON.stringify({
1237
1237
  action: "PAYMENT",
1238
- amount: a,
1238
+ amount: t,
1239
1239
  reference: n
1240
1240
  });
1241
- return l.instance.build(t);
1241
+ return l.instance.build(a);
1242
1242
  }
1243
1243
  static getVoucher({ folio: e = null } = {}) {
1244
1244
  if (!e)
@@ -1277,17 +1277,17 @@ const v = class l {
1277
1277
  static refund({
1278
1278
  amount: e = 0,
1279
1279
  folio: n = null,
1280
- auth: a = null
1280
+ auth: t = null
1281
1281
  } = {}) {
1282
1282
  if (e <= 0) throw new Error("Invalid amount");
1283
1283
  if (typeof e != "number" && (e = parseFloat(e)), isNaN(e)) throw new Error("Invalid amount");
1284
1284
  if (!n) throw new Error("Folio must be a number");
1285
- if (!a) throw new Error("Auth must be a number");
1286
- const t = e.toFixed(2), s = JSON.stringify({
1285
+ if (!t) throw new Error("Auth must be a number");
1286
+ const a = e.toFixed(2), s = JSON.stringify({
1287
1287
  action: "REFUND",
1288
- amount: t,
1288
+ amount: a,
1289
1289
  folio: n,
1290
- auth: a
1290
+ auth: t
1291
1291
  });
1292
1292
  return l.instance.build(s);
1293
1293
  }
@@ -1299,41 +1299,49 @@ const v = class l {
1299
1299
  const e = JSON.stringify({ action: "INIT" });
1300
1300
  return l.instance.build(e);
1301
1301
  }
1302
+ static stop() {
1303
+ const e = JSON.stringify({ action: "STOP" });
1304
+ return l.instance.build(e);
1305
+ }
1306
+ static verifyNetwork() {
1307
+ const e = JSON.stringify({ action: "CHECKINTERNET" });
1308
+ return l.instance.build(e);
1309
+ }
1302
1310
  };
1303
1311
  O(v, "append", `\r
1304
1312
  `), O(v, "instance");
1305
1313
  let U = v;
1306
1314
  U.instance = new U();
1307
- var Y = Object.defineProperty, q = (i, e, n) => e in i ? Y(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, z = (i, e, n) => q(i, e + "", n);
1308
- const R = class C {
1315
+ var K = Object.defineProperty, Y = (i, e, n) => e in i ? K(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, q = (i, e, n) => Y(i, e + "", n);
1316
+ const R = class f {
1309
1317
  build(e) {
1310
1318
  return e[3] = this.withChecksum(e), g(e);
1311
1319
  }
1312
1320
  withChecksum(e) {
1313
1321
  let n = 0;
1314
- return e.forEach((a, t) => {
1315
- t !== 3 && (n += a);
1322
+ return e.forEach((t, a) => {
1323
+ a !== 3 && (n += t);
1316
1324
  }), n;
1317
1325
  }
1318
1326
  static connection(e = 1) {
1319
- return C.instance.build([160, e, 0, 161]);
1327
+ return f.instance.build([160, e, 0, 161]);
1320
1328
  }
1321
1329
  static deactivate(e = 1) {
1322
- return C.connection(e);
1330
+ return f.connection(e);
1323
1331
  }
1324
1332
  static activate(e = 1) {
1325
- return C.instance.build([160, e, 1, 162]);
1333
+ return f.instance.build([160, e, 1, 162]);
1326
1334
  }
1327
1335
  static custom(e) {
1328
- return C.instance.build(e);
1336
+ return f.instance.build(e);
1329
1337
  }
1330
1338
  };
1331
- z(R, "instance");
1339
+ q(R, "instance");
1332
1340
  let x = R;
1333
1341
  x.instance = new x();
1334
1342
  export {
1335
1343
  x as e,
1336
- N as l,
1344
+ I as l,
1337
1345
  D as o,
1338
1346
  U as s,
1339
1347
  $ as u