@feedmepos/mf-payment 1.4.46 → 1.5.0-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-sYaYPQ_s.js → Actions.vue_vue_type_script_setup_true_lang-DGbH2LsQ.js} +43 -43
  2. package/dist/{AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js → AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js} +13 -13
  3. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-I9eO197f.js +47 -0
  4. package/dist/{Chargeback-BftBez0p.js → Chargeback-19afdT_4.js} +83 -83
  5. package/dist/{DateRangePicker.vue_vue_type_script_setup_true_lang-XZ7OzGau.js → DateRangePicker.vue_vue_type_script_setup_true_lang-kymnzYpd.js} +1 -1
  6. package/dist/DocumentViewer.vue_vue_type_script_setup_true_lang-CzwG5dCO.js +77 -0
  7. package/dist/Forbidden-CSTZjebc.js +38 -0
  8. package/dist/Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js +45 -0
  9. package/dist/{OnboardForm-CnKOFMMH.js → OnboardForm-Cc6JOr09.js} +596 -528
  10. package/dist/{OnboardForm-DqhRFi-H.js → OnboardForm-Do6ar3sx.js} +363 -347
  11. package/dist/{OnboardSubmission-DKxUJxCW.js → OnboardSubmission-B-leoVPo.js} +4 -4
  12. package/dist/{OnboardSubmission-munHiPKU.js → OnboardSubmission-Dj8AGb69.js} +8 -8
  13. package/dist/PDFViewer-DgyyGDHl.js +23209 -0
  14. package/dist/{PayoutAccount-DbLQjLVr.js → PayoutAccount--1J5ubvX.js} +341 -312
  15. package/dist/{PayoutAccount-C1ADGszh.js → PayoutAccount-ChGlsZ-O.js} +75 -75
  16. package/dist/{PayoutAccountSetting-YYswVooL.js → PayoutAccountSetting-BC0ANAqY.js} +281 -266
  17. package/dist/{Restaurant-26r7Q01z.js → Restaurant-ZiTHtFZJ.js} +79 -79
  18. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-Bzj_sdSY.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-DG3iyjkK.js} +3 -3
  19. package/dist/{RestaurantSetting-D1APrvzM.js → RestaurantSetting-M1jYaGwx.js} +5 -5
  20. package/dist/{SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js → SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js} +5 -5
  21. package/dist/{Settlement-CWX5RKwL.js → Settlement-Cj2W8VfH.js} +7 -7
  22. package/dist/{Settlement-Ix55QLVB.js → Settlement-D_nmqYEC.js} +12 -15
  23. package/dist/{SettlementTransactions-DYAlKO__.js → SettlementTransactions-Ch9jeQU6.js} +99 -99
  24. package/dist/{SettlementTransactions-BIodJ6DN.js → SettlementTransactions-DK1ONvn6.js} +55 -55
  25. package/dist/{Status.vue_vue_type_script_setup_true_lang-B5iI3OiL.js → Status.vue_vue_type_script_setup_true_lang-BP5m6Vic.js} +9 -9
  26. package/dist/Terminal-CoPPPePw.js +1135 -0
  27. package/dist/{TerminalSetting-BiaGvysm.js → TerminalSetting-PWs1fyFe.js} +549 -425
  28. package/dist/{Transaction-D51QiCaP.js → Transaction-BirTp8t6.js} +82 -82
  29. package/dist/{Transaction-ouagKBic.js → Transaction-CegzBK7m.js} +65 -65
  30. package/dist/{TransactionOld-CCzonxUD.js → TransactionOld-DqGMuWvL.js} +9 -9
  31. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  32. package/dist/api/document/index.d.ts +4 -0
  33. package/dist/{app-DE4U_54A.js → app-D6U0uODp.js} +894 -944
  34. package/dist/app.d.ts +1 -358
  35. package/dist/app.js +4 -3
  36. package/dist/{assets--JQWdCl5.js → assets-DtwUojcS.js} +1 -1
  37. package/dist/components/AdminLayout.vue.d.ts +3 -3
  38. package/dist/components/AutoCopyCell.vue.d.ts +1 -1
  39. package/dist/components/DocumentViewer.vue.d.ts +16 -0
  40. package/dist/components/ImagePreview.vue.d.ts +3 -3
  41. package/dist/components/Layout.vue.d.ts +3 -3
  42. package/dist/components/PDFViewer.vue.d.ts +4 -4
  43. package/dist/components/RestaurantSelector.vue.d.ts +1 -1
  44. package/dist/components/RouteCell.vue.d.ts +1 -1
  45. package/dist/{grafana-22PXAn1O.js → grafana-fZyobMgN.js} +1 -1
  46. package/dist/{index-B0uA-O38.js → index--K2ipr4H.js} +7 -7
  47. package/dist/{index-cCTvH31Z.js → index-BJNCcdvT.js} +22132 -24859
  48. package/dist/{index-Blb5YaYR.js → index-C-YBwRQp.js} +3 -3
  49. package/dist/{index-Ctn4LFui.js → index-CMN40t8e.js} +1 -1
  50. package/dist/{index-sc6pzeZl.js → index-CbONxZz2.js} +17 -13
  51. package/dist/{index-BLyx8ZQr.js → index-CtkwL_6R.js} +1 -1
  52. package/dist/{index-B9kHmV6p.js → index-D69RnDa7.js} +19 -19
  53. package/dist/index-_u7l8cO3.js +27 -0
  54. package/dist/{index-B0-Kn6Mw.js → index-eLZ3BErV.js} +12 -12
  55. package/dist/{index.vue_vue_type_script_setup_true_lang-NUicoOT2.js → index.vue_vue_type_script_setup_true_lang-zxkA_YTt.js} +50 -50
  56. package/dist/model/payout-account.d.ts +2 -2
  57. package/dist/{Forbidden-Dqw0MqyC.js → no-data-BRmo6XOO.js} +2 -35
  58. package/dist/package.json +13 -7
  59. package/dist/{payout-account-KcIc3kyX.js → payout-account-CVYMFqu9.js} +78 -77
  60. package/dist/plugins.d.ts +1 -5
  61. package/dist/router/index.d.ts +1 -0
  62. package/dist/stores/payoutAccount.d.ts +16 -16
  63. package/dist/tsconfig.app.tsbuildinfo +1 -1
  64. package/dist/{validator-D5jtpt9A.js → validator-DzjyJnvv.js} +842 -763
  65. package/dist/views/Forbidden.vue.d.ts +1 -1
  66. package/dist/views/admin/chargeback/cell/Actions.vue.d.ts +1 -1
  67. package/dist/views/admin/onboard-submission/cell/SignatureBoard.vue.d.ts +2 -1
  68. package/dist/views/admin/onboard-submission/cell/UploadButton.vue.d.ts +3 -2
  69. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +17 -17
  70. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +17 -17
  71. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +22 -22
  72. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +22 -22
  73. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
  74. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +17 -17
  75. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +22 -22
  76. package/dist/views/admin/payout-account/tabs/cell/Actions.vue.d.ts +1 -1
  77. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +2 -2
  78. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +2 -2
  79. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  80. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  81. package/dist/views/admin/restaurant/cell/LogButton.vue.d.ts +1 -1
  82. package/dist/views/admin/restaurant/tabs/PaymentGateway.vue.d.ts +118 -244
  83. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  84. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +4 -4
  85. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +6 -6
  86. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +4 -4
  87. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +4 -4
  88. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
  89. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  90. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
  91. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +4 -4
  92. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +28 -8
  93. package/dist/views/admin/terminal/cell/Actions.vue.d.ts +1 -1
  94. package/dist/views/admin/terminal/cell/ID.vue.d.ts +1 -1
  95. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +29 -9
  96. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +28 -8
  97. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +29 -9
  98. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +28 -8
  99. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +28 -8
  100. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +28 -8
  101. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +28 -8
  102. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +28 -8
  103. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +250 -0
  104. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +28 -8
  105. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +28 -8
  106. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +28 -8
  107. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +28 -8
  108. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +28 -8
  109. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +28 -8
  110. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +28 -8
  111. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +28 -8
  112. package/dist/views/admin/transaction/cell/Actions.vue.d.ts +1 -1
  113. package/dist/views/admin/transaction/cell/BillSeqNumber.vue.d.ts +1 -1
  114. package/dist/views/onboard-submission/cell/SignatureBoard.vue.d.ts +2 -1
  115. package/dist/views/onboard-submission/cell/UploadButton.vue.d.ts +6 -5
  116. package/dist/views/payout-account/PayoutAccountDialog.vue.d.ts +2 -2
  117. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
  118. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +68 -68
  119. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +34 -34
  120. package/dist/views/transaction/cell/Actions.vue.d.ts +1 -1
  121. package/dist/views/transaction/cell/BillSeqNumber.vue.d.ts +1 -1
  122. package/package.json +26 -20
  123. package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-DP8STuAT.js +0 -47
  124. package/dist/Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js +0 -45
  125. package/dist/PDFViewer-DHKBD99J.js +0 -22433
  126. package/dist/Terminal-CrM7EzkM.js +0 -1095
  127. package/dist/plugins-DOA8YO_V.js +0 -1366
@@ -1,1095 +0,0 @@
1
- import { defineComponent as z, ref as I, onUpdated as oe, h as M, onMounted as me, Fragment as ie, computed as se, openBlock as N, createElementBlock as G, createElementVNode as A, createTextVNode as ee, toDisplayString as le, createVNode as k, resolveComponent as _, normalizeClass as pe, withCtx as q, createBlock as D, createCommentVNode as V, unref as P, watch as te, isRef as ge } from "vue";
2
- import { e as Ce } from "./index-cCTvH31Z.js";
3
- import { h as ye } from "./moment-h96o7c8I.js";
4
- import { u as we } from "./index-BLyx8ZQr.js";
5
- import { _ as Ee } from "./index.vue_vue_type_script_setup_true_lang-NUicoOT2.js";
6
- import { _ as Me } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
7
- import { useSnackbar as W, useDialogChild as Re, useDialog as Ae } from "@feedmepos/ui-library";
8
- import { t as Q } from "./index-Blb5YaYR.js";
9
- import { c as ue } from "./clipboard-4jh1WteU.js";
10
- import { useCoreStore as ce } from "@feedmepos/mf-common";
11
- import { g as Se } from "./grafana-22PXAn1O.js";
12
- import { u as Y } from "./error-K1CakhA9.js";
13
- import { z as re, a as ne } from "./validator-D5jtpt9A.js";
14
- import { w as ae } from "./Modal-DB8M9o1T.js";
15
- import { useRouter as be } from "vue-router";
16
- /*!
17
- * qrcode.vue v3.6.0
18
- * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
19
- * © 2017-PRESENT @scopewu(https://github.com/scopewu)
20
- * MIT License.
21
- */
22
- var T = function() {
23
- return T = Object.assign || function(c) {
24
- for (var d, s = 1, m = arguments.length; s < m; s++) {
25
- d = arguments[s];
26
- for (var f in d) Object.prototype.hasOwnProperty.call(d, f) && (c[f] = d[f]);
27
- }
28
- return c;
29
- }, T.apply(this, arguments);
30
- };
31
- var O;
32
- (function(o) {
33
- var c = (
34
- /** @class */
35
- function() {
36
- function n(e, t, r, a) {
37
- if (this.version = e, this.errorCorrectionLevel = t, this.modules = [], this.isFunction = [], e < n.MIN_VERSION || e > n.MAX_VERSION)
38
- throw new RangeError("Version value out of range");
39
- if (a < -1 || a > 7)
40
- throw new RangeError("Mask value out of range");
41
- this.size = e * 4 + 17;
42
- for (var i = [], l = 0; l < this.size; l++)
43
- i.push(!1);
44
- for (var l = 0; l < this.size; l++)
45
- this.modules.push(i.slice()), this.isFunction.push(i.slice());
46
- this.drawFunctionPatterns();
47
- var h = this.addEccAndInterleave(r);
48
- if (this.drawCodewords(h), a == -1)
49
- for (var C = 1e9, l = 0; l < 8; l++) {
50
- this.applyMask(l), this.drawFormatBits(l);
51
- var u = this.getPenaltyScore();
52
- u < C && (a = l, C = u), this.applyMask(l);
53
- }
54
- m(0 <= a && a <= 7), this.mask = a, this.applyMask(a), this.drawFormatBits(a), this.isFunction = [];
55
- }
56
- return n.encodeText = function(e, t) {
57
- var r = o.QrSegment.makeSegments(e);
58
- return n.encodeSegments(r, t);
59
- }, n.encodeBinary = function(e, t) {
60
- var r = o.QrSegment.makeBytes(e);
61
- return n.encodeSegments([r], t);
62
- }, n.encodeSegments = function(e, t, r, a, i, l) {
63
- if (r === void 0 && (r = 1), a === void 0 && (a = 40), i === void 0 && (i = -1), l === void 0 && (l = !0), !(n.MIN_VERSION <= r && r <= a && a <= n.MAX_VERSION) || i < -1 || i > 7)
64
- throw new RangeError("Invalid value");
65
- var h, C;
66
- for (h = r; ; h++) {
67
- var u = n.getNumDataCodewords(h, t) * 8, v = f.getTotalBits(e, h);
68
- if (v <= u) {
69
- C = v;
70
- break;
71
- }
72
- if (h >= a)
73
- throw new RangeError("Data too long");
74
- }
75
- for (var p = 0, w = [n.Ecc.MEDIUM, n.Ecc.QUARTILE, n.Ecc.HIGH]; p < w.length; p++) {
76
- var g = w[p];
77
- l && C <= n.getNumDataCodewords(h, g) * 8 && (t = g);
78
- }
79
- for (var y = [], E = 0, S = e; E < S.length; E++) {
80
- var R = S[E];
81
- d(R.mode.modeBits, 4, y), d(R.numChars, R.mode.numCharCountBits(h), y);
82
- for (var B = 0, b = R.getData(); B < b.length; B++) {
83
- var K = b[B];
84
- y.push(K);
85
- }
86
- }
87
- m(y.length == C);
88
- var L = n.getNumDataCodewords(h, t) * 8;
89
- m(y.length <= L), d(0, Math.min(4, L - y.length), y), d(0, (8 - y.length % 8) % 8, y), m(y.length % 8 == 0);
90
- for (var F = 236; y.length < L; F ^= 253)
91
- d(F, 8, y);
92
- for (var U = []; U.length * 8 < y.length; )
93
- U.push(0);
94
- return y.forEach(function($, H) {
95
- return U[H >>> 3] |= $ << 7 - (H & 7);
96
- }), new n(h, t, U, i);
97
- }, n.prototype.getModule = function(e, t) {
98
- return 0 <= e && e < this.size && 0 <= t && t < this.size && this.modules[t][e];
99
- }, n.prototype.getModules = function() {
100
- return this.modules;
101
- }, n.prototype.drawFunctionPatterns = function() {
102
- for (var e = 0; e < this.size; e++)
103
- this.setFunctionModule(6, e, e % 2 == 0), this.setFunctionModule(e, 6, e % 2 == 0);
104
- this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
105
- for (var t = this.getAlignmentPatternPositions(), r = t.length, e = 0; e < r; e++)
106
- for (var a = 0; a < r; a++)
107
- e == 0 && a == 0 || e == 0 && a == r - 1 || e == r - 1 && a == 0 || this.drawAlignmentPattern(t[e], t[a]);
108
- this.drawFormatBits(0), this.drawVersion();
109
- }, n.prototype.drawFormatBits = function(e) {
110
- for (var t = this.errorCorrectionLevel.formatBits << 3 | e, r = t, a = 0; a < 10; a++)
111
- r = r << 1 ^ (r >>> 9) * 1335;
112
- var i = (t << 10 | r) ^ 21522;
113
- m(i >>> 15 == 0);
114
- for (var a = 0; a <= 5; a++)
115
- this.setFunctionModule(8, a, s(i, a));
116
- this.setFunctionModule(8, 7, s(i, 6)), this.setFunctionModule(8, 8, s(i, 7)), this.setFunctionModule(7, 8, s(i, 8));
117
- for (var a = 9; a < 15; a++)
118
- this.setFunctionModule(14 - a, 8, s(i, a));
119
- for (var a = 0; a < 8; a++)
120
- this.setFunctionModule(this.size - 1 - a, 8, s(i, a));
121
- for (var a = 8; a < 15; a++)
122
- this.setFunctionModule(8, this.size - 15 + a, s(i, a));
123
- this.setFunctionModule(8, this.size - 8, !0);
124
- }, n.prototype.drawVersion = function() {
125
- if (!(this.version < 7)) {
126
- for (var e = this.version, t = 0; t < 12; t++)
127
- e = e << 1 ^ (e >>> 11) * 7973;
128
- var r = this.version << 12 | e;
129
- m(r >>> 18 == 0);
130
- for (var t = 0; t < 18; t++) {
131
- var a = s(r, t), i = this.size - 11 + t % 3, l = Math.floor(t / 3);
132
- this.setFunctionModule(i, l, a), this.setFunctionModule(l, i, a);
133
- }
134
- }
135
- }, n.prototype.drawFinderPattern = function(e, t) {
136
- for (var r = -4; r <= 4; r++)
137
- for (var a = -4; a <= 4; a++) {
138
- var i = Math.max(Math.abs(a), Math.abs(r)), l = e + a, h = t + r;
139
- 0 <= l && l < this.size && 0 <= h && h < this.size && this.setFunctionModule(l, h, i != 2 && i != 4);
140
- }
141
- }, n.prototype.drawAlignmentPattern = function(e, t) {
142
- for (var r = -2; r <= 2; r++)
143
- for (var a = -2; a <= 2; a++)
144
- this.setFunctionModule(e + a, t + r, Math.max(Math.abs(a), Math.abs(r)) != 1);
145
- }, n.prototype.setFunctionModule = function(e, t, r) {
146
- this.modules[t][e] = r, this.isFunction[t][e] = !0;
147
- }, n.prototype.addEccAndInterleave = function(e) {
148
- var t = this.version, r = this.errorCorrectionLevel;
149
- if (e.length != n.getNumDataCodewords(t, r))
150
- throw new RangeError("Invalid argument");
151
- for (var a = n.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t], i = n.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t], l = Math.floor(n.getNumRawDataModules(t) / 8), h = a - l % a, C = Math.floor(l / a), u = [], v = n.reedSolomonComputeDivisor(i), p = 0, w = 0; p < a; p++) {
152
- var g = e.slice(w, w + C - i + (p < h ? 0 : 1));
153
- w += g.length;
154
- var y = n.reedSolomonComputeRemainder(g, v);
155
- p < h && g.push(0), u.push(g.concat(y));
156
- }
157
- for (var E = [], S = function(R) {
158
- u.forEach(function(B, b) {
159
- (R != C - i || b >= h) && E.push(B[R]);
160
- });
161
- }, p = 0; p < u[0].length; p++)
162
- S(p);
163
- return m(E.length == l), E;
164
- }, n.prototype.drawCodewords = function(e) {
165
- if (e.length != Math.floor(n.getNumRawDataModules(this.version) / 8))
166
- throw new RangeError("Invalid argument");
167
- for (var t = 0, r = this.size - 1; r >= 1; r -= 2) {
168
- r == 6 && (r = 5);
169
- for (var a = 0; a < this.size; a++)
170
- for (var i = 0; i < 2; i++) {
171
- var l = r - i, h = (r + 1 & 2) == 0, C = h ? this.size - 1 - a : a;
172
- !this.isFunction[C][l] && t < e.length * 8 && (this.modules[C][l] = s(e[t >>> 3], 7 - (t & 7)), t++);
173
- }
174
- }
175
- m(t == e.length * 8);
176
- }, n.prototype.applyMask = function(e) {
177
- if (e < 0 || e > 7)
178
- throw new RangeError("Mask value out of range");
179
- for (var t = 0; t < this.size; t++)
180
- for (var r = 0; r < this.size; r++) {
181
- var a = void 0;
182
- switch (e) {
183
- case 0:
184
- a = (r + t) % 2 == 0;
185
- break;
186
- case 1:
187
- a = t % 2 == 0;
188
- break;
189
- case 2:
190
- a = r % 3 == 0;
191
- break;
192
- case 3:
193
- a = (r + t) % 3 == 0;
194
- break;
195
- case 4:
196
- a = (Math.floor(r / 3) + Math.floor(t / 2)) % 2 == 0;
197
- break;
198
- case 5:
199
- a = r * t % 2 + r * t % 3 == 0;
200
- break;
201
- case 6:
202
- a = (r * t % 2 + r * t % 3) % 2 == 0;
203
- break;
204
- case 7:
205
- a = ((r + t) % 2 + r * t % 3) % 2 == 0;
206
- break;
207
- default:
208
- throw new Error("Unreachable");
209
- }
210
- !this.isFunction[t][r] && a && (this.modules[t][r] = !this.modules[t][r]);
211
- }
212
- }, n.prototype.getPenaltyScore = function() {
213
- for (var e = 0, t = 0; t < this.size; t++) {
214
- for (var r = !1, a = 0, i = [0, 0, 0, 0, 0, 0, 0], l = 0; l < this.size; l++)
215
- this.modules[t][l] == r ? (a++, a == 5 ? e += n.PENALTY_N1 : a > 5 && e++) : (this.finderPenaltyAddHistory(a, i), r || (e += this.finderPenaltyCountPatterns(i) * n.PENALTY_N3), r = this.modules[t][l], a = 1);
216
- e += this.finderPenaltyTerminateAndCount(r, a, i) * n.PENALTY_N3;
217
- }
218
- for (var l = 0; l < this.size; l++) {
219
- for (var r = !1, h = 0, i = [0, 0, 0, 0, 0, 0, 0], t = 0; t < this.size; t++)
220
- this.modules[t][l] == r ? (h++, h == 5 ? e += n.PENALTY_N1 : h > 5 && e++) : (this.finderPenaltyAddHistory(h, i), r || (e += this.finderPenaltyCountPatterns(i) * n.PENALTY_N3), r = this.modules[t][l], h = 1);
221
- e += this.finderPenaltyTerminateAndCount(r, h, i) * n.PENALTY_N3;
222
- }
223
- for (var t = 0; t < this.size - 1; t++)
224
- for (var l = 0; l < this.size - 1; l++) {
225
- var C = this.modules[t][l];
226
- C == this.modules[t][l + 1] && C == this.modules[t + 1][l] && C == this.modules[t + 1][l + 1] && (e += n.PENALTY_N2);
227
- }
228
- for (var u = 0, v = 0, p = this.modules; v < p.length; v++) {
229
- var w = p[v];
230
- u = w.reduce(function(E, S) {
231
- return E + (S ? 1 : 0);
232
- }, u);
233
- }
234
- var g = this.size * this.size, y = Math.ceil(Math.abs(u * 20 - g * 10) / g) - 1;
235
- return m(0 <= y && y <= 9), e += y * n.PENALTY_N4, m(0 <= e && e <= 2568888), e;
236
- }, n.prototype.getAlignmentPatternPositions = function() {
237
- if (this.version == 1)
238
- return [];
239
- for (var e = Math.floor(this.version / 7) + 2, t = Math.floor((this.version * 8 + e * 3 + 5) / (e * 4 - 4)) * 2, r = [6], a = this.size - 7; r.length < e; a -= t)
240
- r.splice(1, 0, a);
241
- return r;
242
- }, n.getNumRawDataModules = function(e) {
243
- if (e < n.MIN_VERSION || e > n.MAX_VERSION)
244
- throw new RangeError("Version number out of range");
245
- var t = (16 * e + 128) * e + 64;
246
- if (e >= 2) {
247
- var r = Math.floor(e / 7) + 2;
248
- t -= (25 * r - 10) * r - 55, e >= 7 && (t -= 36);
249
- }
250
- return m(208 <= t && t <= 29648), t;
251
- }, n.getNumDataCodewords = function(e, t) {
252
- return Math.floor(n.getNumRawDataModules(e) / 8) - n.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e] * n.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e];
253
- }, n.reedSolomonComputeDivisor = function(e) {
254
- if (e < 1 || e > 255)
255
- throw new RangeError("Degree out of range");
256
- for (var t = [], r = 0; r < e - 1; r++)
257
- t.push(0);
258
- t.push(1);
259
- for (var a = 1, r = 0; r < e; r++) {
260
- for (var i = 0; i < t.length; i++)
261
- t[i] = n.reedSolomonMultiply(t[i], a), i + 1 < t.length && (t[i] ^= t[i + 1]);
262
- a = n.reedSolomonMultiply(a, 2);
263
- }
264
- return t;
265
- }, n.reedSolomonComputeRemainder = function(e, t) {
266
- for (var r = t.map(function(C) {
267
- return 0;
268
- }), a = function(C) {
269
- var u = C ^ r.shift();
270
- r.push(0), t.forEach(function(v, p) {
271
- return r[p] ^= n.reedSolomonMultiply(v, u);
272
- });
273
- }, i = 0, l = e; i < l.length; i++) {
274
- var h = l[i];
275
- a(h);
276
- }
277
- return r;
278
- }, n.reedSolomonMultiply = function(e, t) {
279
- if (e >>> 8 || t >>> 8)
280
- throw new RangeError("Byte out of range");
281
- for (var r = 0, a = 7; a >= 0; a--)
282
- r = r << 1 ^ (r >>> 7) * 285, r ^= (t >>> a & 1) * e;
283
- return m(r >>> 8 == 0), r;
284
- }, n.prototype.finderPenaltyCountPatterns = function(e) {
285
- var t = e[1];
286
- m(t <= this.size * 3);
287
- var r = t > 0 && e[2] == t && e[3] == t * 3 && e[4] == t && e[5] == t;
288
- return (r && e[0] >= t * 4 && e[6] >= t ? 1 : 0) + (r && e[6] >= t * 4 && e[0] >= t ? 1 : 0);
289
- }, n.prototype.finderPenaltyTerminateAndCount = function(e, t, r) {
290
- return e && (this.finderPenaltyAddHistory(t, r), t = 0), t += this.size, this.finderPenaltyAddHistory(t, r), this.finderPenaltyCountPatterns(r);
291
- }, n.prototype.finderPenaltyAddHistory = function(e, t) {
292
- t[0] == 0 && (e += this.size), t.pop(), t.unshift(e);
293
- }, n.MIN_VERSION = 1, n.MAX_VERSION = 40, n.PENALTY_N1 = 3, n.PENALTY_N2 = 3, n.PENALTY_N3 = 40, n.PENALTY_N4 = 10, n.ECC_CODEWORDS_PER_BLOCK = [
294
- // Version: (note that index 0 is for padding, and is set to an illegal value)
295
- //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
296
- [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
297
- // Low
298
- [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
299
- // Medium
300
- [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
301
- // Quartile
302
- [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
303
- // High
304
- ], n.NUM_ERROR_CORRECTION_BLOCKS = [
305
- // Version: (note that index 0 is for padding, and is set to an illegal value)
306
- //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
307
- [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
308
- // Low
309
- [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
310
- // Medium
311
- [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
312
- // Quartile
313
- [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
314
- // High
315
- ], n;
316
- }()
317
- );
318
- o.QrCode = c;
319
- function d(n, e, t) {
320
- if (e < 0 || e > 31 || n >>> e)
321
- throw new RangeError("Value out of range");
322
- for (var r = e - 1; r >= 0; r--)
323
- t.push(n >>> r & 1);
324
- }
325
- function s(n, e) {
326
- return (n >>> e & 1) != 0;
327
- }
328
- function m(n) {
329
- if (!n)
330
- throw new Error("Assertion error");
331
- }
332
- var f = (
333
- /** @class */
334
- function() {
335
- function n(e, t, r) {
336
- if (this.mode = e, this.numChars = t, this.bitData = r, t < 0)
337
- throw new RangeError("Invalid argument");
338
- this.bitData = r.slice();
339
- }
340
- return n.makeBytes = function(e) {
341
- for (var t = [], r = 0, a = e; r < a.length; r++) {
342
- var i = a[r];
343
- d(i, 8, t);
344
- }
345
- return new n(n.Mode.BYTE, e.length, t);
346
- }, n.makeNumeric = function(e) {
347
- if (!n.isNumeric(e))
348
- throw new RangeError("String contains non-numeric characters");
349
- for (var t = [], r = 0; r < e.length; ) {
350
- var a = Math.min(e.length - r, 3);
351
- d(parseInt(e.substring(r, r + a), 10), a * 3 + 1, t), r += a;
352
- }
353
- return new n(n.Mode.NUMERIC, e.length, t);
354
- }, n.makeAlphanumeric = function(e) {
355
- if (!n.isAlphanumeric(e))
356
- throw new RangeError("String contains unencodable characters in alphanumeric mode");
357
- var t = [], r;
358
- for (r = 0; r + 2 <= e.length; r += 2) {
359
- var a = n.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)) * 45;
360
- a += n.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r + 1)), d(a, 11, t);
361
- }
362
- return r < e.length && d(n.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)), 6, t), new n(n.Mode.ALPHANUMERIC, e.length, t);
363
- }, n.makeSegments = function(e) {
364
- return e == "" ? [] : n.isNumeric(e) ? [n.makeNumeric(e)] : n.isAlphanumeric(e) ? [n.makeAlphanumeric(e)] : [n.makeBytes(n.toUtf8ByteArray(e))];
365
- }, n.makeEci = function(e) {
366
- var t = [];
367
- if (e < 0)
368
- throw new RangeError("ECI assignment value out of range");
369
- if (e < 128)
370
- d(e, 8, t);
371
- else if (e < 16384)
372
- d(2, 2, t), d(e, 14, t);
373
- else if (e < 1e6)
374
- d(6, 3, t), d(e, 21, t);
375
- else
376
- throw new RangeError("ECI assignment value out of range");
377
- return new n(n.Mode.ECI, 0, t);
378
- }, n.isNumeric = function(e) {
379
- return n.NUMERIC_REGEX.test(e);
380
- }, n.isAlphanumeric = function(e) {
381
- return n.ALPHANUMERIC_REGEX.test(e);
382
- }, n.prototype.getData = function() {
383
- return this.bitData.slice();
384
- }, n.getTotalBits = function(e, t) {
385
- for (var r = 0, a = 0, i = e; a < i.length; a++) {
386
- var l = i[a], h = l.mode.numCharCountBits(t);
387
- if (l.numChars >= 1 << h)
388
- return 1 / 0;
389
- r += 4 + h + l.bitData.length;
390
- }
391
- return r;
392
- }, n.toUtf8ByteArray = function(e) {
393
- e = encodeURI(e);
394
- for (var t = [], r = 0; r < e.length; r++)
395
- e.charAt(r) != "%" ? t.push(e.charCodeAt(r)) : (t.push(parseInt(e.substring(r + 1, r + 3), 16)), r += 2);
396
- return t;
397
- }, n.NUMERIC_REGEX = /^[0-9]*$/, n.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, n.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", n;
398
- }()
399
- );
400
- o.QrSegment = f;
401
- })(O || (O = {}));
402
- (function(o) {
403
- (function(c) {
404
- var d = (
405
- /** @class */
406
- function() {
407
- function s(m, f) {
408
- this.ordinal = m, this.formatBits = f;
409
- }
410
- return s.LOW = new s(0, 1), s.MEDIUM = new s(1, 0), s.QUARTILE = new s(2, 3), s.HIGH = new s(3, 2), s;
411
- }()
412
- );
413
- c.Ecc = d;
414
- })(o.QrCode || (o.QrCode = {}));
415
- })(O || (O = {}));
416
- (function(o) {
417
- (function(c) {
418
- var d = (
419
- /** @class */
420
- function() {
421
- function s(m, f) {
422
- this.modeBits = m, this.numBitsCharCount = f;
423
- }
424
- return s.prototype.numCharCountBits = function(m) {
425
- return this.numBitsCharCount[Math.floor((m + 7) / 17)];
426
- }, s.NUMERIC = new s(1, [10, 12, 14]), s.ALPHANUMERIC = new s(2, [9, 11, 13]), s.BYTE = new s(4, [8, 16, 16]), s.KANJI = new s(8, [8, 10, 12]), s.ECI = new s(7, [0, 0, 0]), s;
427
- }()
428
- );
429
- c.Mode = d;
430
- })(o.QrSegment || (o.QrSegment = {}));
431
- })(O || (O = {}));
432
- var x = O, X = "L", J = {
433
- L: x.QrCode.Ecc.LOW,
434
- M: x.QrCode.Ecc.MEDIUM,
435
- Q: x.QrCode.Ecc.QUARTILE,
436
- H: x.QrCode.Ecc.HIGH
437
- }, Pe = function() {
438
- try {
439
- new Path2D().addPath(new Path2D());
440
- } catch {
441
- return !1;
442
- }
443
- return !0;
444
- }();
445
- function Z(o) {
446
- return o in J;
447
- }
448
- function de(o, c) {
449
- c === void 0 && (c = 0);
450
- var d = [];
451
- return o.forEach(function(s, m) {
452
- var f = null;
453
- s.forEach(function(n, e) {
454
- if (!n && f !== null) {
455
- d.push("M".concat(f + c, " ").concat(m + c, "h").concat(e - f, "v1H").concat(f + c, "z")), f = null;
456
- return;
457
- }
458
- if (e === s.length - 1) {
459
- if (!n)
460
- return;
461
- f === null ? d.push("M".concat(e + c, ",").concat(m + c, " h1v1H").concat(e + c, "z")) : d.push("M".concat(f + c, ",").concat(m + c, " h").concat(e + 1 - f, "v1H").concat(f + c, "z"));
462
- return;
463
- }
464
- n && f === null && (f = e);
465
- });
466
- }), d.join("");
467
- }
468
- function fe(o, c, d, s) {
469
- var m = s.width, f = s.height, n = s.x, e = s.y, t = o.length + d * 2, r = Math.floor(c * 0.1), a = t / c, i = (m || r) * a, l = (f || r) * a, h = n == null ? o.length / 2 - i / 2 : n * a, C = e == null ? o.length / 2 - l / 2 : e * a, u = null;
470
- if (s.excavate) {
471
- var v = Math.floor(h), p = Math.floor(C), w = Math.ceil(i + h - v), g = Math.ceil(l + C - p);
472
- u = { x: v, y: p, w, h: g };
473
- }
474
- return { x: h, y: C, h: l, w: i, excavation: u };
475
- }
476
- function ve(o, c) {
477
- return o.slice().map(function(d, s) {
478
- return s < c.y || s >= c.y + c.h ? d : d.map(function(m, f) {
479
- return f < c.x || f >= c.x + c.w ? m : !1;
480
- });
481
- });
482
- }
483
- var j = {
484
- value: {
485
- type: String,
486
- required: !0,
487
- default: ""
488
- },
489
- size: {
490
- type: Number,
491
- default: 100
492
- },
493
- level: {
494
- type: String,
495
- default: X,
496
- validator: function(o) {
497
- return Z(o);
498
- }
499
- },
500
- background: {
501
- type: String,
502
- default: "#fff"
503
- },
504
- foreground: {
505
- type: String,
506
- default: "#000"
507
- },
508
- margin: {
509
- type: Number,
510
- required: !1,
511
- default: 0
512
- },
513
- imageSettings: {
514
- type: Object,
515
- required: !1,
516
- default: function() {
517
- return {};
518
- }
519
- },
520
- gradient: {
521
- type: Boolean,
522
- required: !1,
523
- default: !1
524
- },
525
- gradientType: {
526
- type: String,
527
- required: !1,
528
- default: "linear",
529
- validator: function(o) {
530
- return ["linear", "radial"].indexOf(o) > -1;
531
- }
532
- },
533
- gradientStartColor: {
534
- type: String,
535
- required: !1,
536
- default: "#000"
537
- },
538
- gradientEndColor: {
539
- type: String,
540
- required: !1,
541
- default: "#fff"
542
- }
543
- }, Te = T(T({}, j), { renderAs: {
544
- type: String,
545
- required: !1,
546
- default: "canvas",
547
- validator: function(o) {
548
- return ["canvas", "svg"].indexOf(o) > -1;
549
- }
550
- } }), Ne = z({
551
- name: "QRCodeSvg",
552
- props: j,
553
- setup: function(o) {
554
- var c = I(0), d = I(""), s, m = function() {
555
- var n = o.value, e = o.level, t = o.margin, r = t >>> 0, a = Z(e) ? e : X, i = x.QrCode.encodeText(n, J[a]).getModules();
556
- if (c.value = i.length + r * 2, o.imageSettings.src) {
557
- var l = fe(i, o.size, r, o.imageSettings);
558
- s = {
559
- x: l.x + r,
560
- y: l.y + r,
561
- width: l.w,
562
- height: l.h
563
- }, l.excavation && (i = ve(i, l.excavation));
564
- }
565
- d.value = de(i, r);
566
- }, f = function() {
567
- if (!o.gradient)
568
- return null;
569
- var n = o.gradientType === "linear" ? {
570
- x1: "0%",
571
- y1: "0%",
572
- x2: "100%",
573
- y2: "100%"
574
- } : {
575
- cx: "50%",
576
- cy: "50%",
577
- r: "50%",
578
- fx: "50%",
579
- fy: "50%"
580
- };
581
- return M(o.gradientType === "linear" ? "linearGradient" : "radialGradient", T({ id: "qr-gradient" }, n), [
582
- M("stop", {
583
- offset: "0%",
584
- style: { stopColor: o.gradientStartColor }
585
- }),
586
- M("stop", {
587
- offset: "100%",
588
- style: { stopColor: o.gradientEndColor }
589
- })
590
- ]);
591
- };
592
- return m(), oe(m), function() {
593
- return M("svg", {
594
- width: o.size,
595
- height: o.size,
596
- "shape-rendering": "crispEdges",
597
- xmlns: "http://www.w3.org/2000/svg",
598
- viewBox: "0 0 ".concat(c.value, " ").concat(c.value)
599
- }, [
600
- M("defs", {}, [f()]),
601
- M("rect", {
602
- width: "100%",
603
- height: "100%",
604
- fill: o.background
605
- }),
606
- M("path", {
607
- fill: o.gradient ? "url(#qr-gradient)" : o.foreground,
608
- d: d.value
609
- }),
610
- o.imageSettings.src && M("image", T({ href: o.imageSettings.src }, s))
611
- ]);
612
- };
613
- }
614
- }), _e = z({
615
- name: "QRCodeCanvas",
616
- props: j,
617
- setup: function(o, c) {
618
- var d = I(null), s = I(null), m = function() {
619
- var n = o.value, e = o.level, t = o.size, r = o.margin, a = o.background, i = o.foreground, l = o.gradient, h = o.gradientType, C = o.gradientStartColor, u = o.gradientEndColor, v = r >>> 0, p = Z(e) ? e : X, w = d.value;
620
- if (w) {
621
- var g = w.getContext("2d");
622
- if (g) {
623
- var y = x.QrCode.encodeText(n, J[p]).getModules(), E = y.length + v * 2, S = s.value, R = { x: 0, y: 0, width: 0, height: 0 }, B = o.imageSettings.src && S != null && S.naturalWidth !== 0 && S.naturalHeight !== 0;
624
- if (B) {
625
- var b = fe(y, o.size, v, o.imageSettings);
626
- R = {
627
- x: b.x + v,
628
- y: b.y + v,
629
- width: b.w,
630
- height: b.h
631
- }, b.excavation && (y = ve(y, b.excavation));
632
- }
633
- var K = window.devicePixelRatio || 1, L = t / E * K;
634
- if (w.height = w.width = t * K, g.scale(L, L), g.fillStyle = a, g.fillRect(0, 0, E, E), l) {
635
- var F = void 0;
636
- h === "linear" ? F = g.createLinearGradient(0, 0, E, E) : F = g.createRadialGradient(E / 2, E / 2, 0, E / 2, E / 2, E / 2), F.addColorStop(0, C), F.addColorStop(1, u), g.fillStyle = F;
637
- } else
638
- g.fillStyle = i;
639
- Pe ? g.fill(new Path2D(de(y, v))) : y.forEach(function(U, $) {
640
- U.forEach(function(H, he) {
641
- H && g.fillRect(he + v, $ + v, 1, 1);
642
- });
643
- }), B && g.drawImage(S, R.x, R.y, R.width, R.height);
644
- }
645
- }
646
- };
647
- me(m), oe(m);
648
- var f = c.attrs.style;
649
- return function() {
650
- return M(ie, [
651
- M("canvas", T(T({}, c.attrs), { ref: d, style: T(T({}, f), { width: "".concat(o.size, "px"), height: "".concat(o.size, "px") }) })),
652
- o.imageSettings.src && M("img", {
653
- ref: s,
654
- src: o.imageSettings.src,
655
- style: { display: "none" },
656
- onLoad: m
657
- })
658
- ]);
659
- };
660
- }
661
- }), Ie = z({
662
- name: "Qrcode",
663
- render: function() {
664
- var o = this.$props, c = o.renderAs, d = o.value, s = o.size, m = o.margin, f = o.level, n = o.background, e = o.foreground, t = o.imageSettings, r = o.gradient, a = o.gradientType, i = o.gradientStartColor, l = o.gradientEndColor;
665
- return M(c === "svg" ? Ne : _e, {
666
- value: d,
667
- size: s,
668
- margin: m,
669
- level: f,
670
- background: n,
671
- foreground: e,
672
- imageSettings: t,
673
- gradient: r,
674
- gradientType: a,
675
- gradientStartColor: i,
676
- gradientEndColor: l
677
- });
678
- },
679
- props: Te
680
- });
681
- const ke = { class: "t-caption" }, Be = { class: "t-caption" }, Fe = { class: "my-6 justify-items-center" }, ze = /* @__PURE__ */ z({
682
- __name: "TerminalBindCodeDialog",
683
- props: {
684
- code: {
685
- type: String,
686
- required: !0
687
- }
688
- },
689
- setup(o) {
690
- const c = o, d = W(), s = ce();
691
- function m() {
692
- try {
693
- ue(c.code), d.open({ title: "Text copied to clipboard." }, 1e3);
694
- } catch {
695
- d.open({ title: "Clipboard API incompatible." }, 1e3);
696
- }
697
- }
698
- const f = s.namespace.value === "dev" ? "development" : "production", n = se(() => `${f},${(s.currentCountry.value ?? Ce.F_COUNTRY.enum.MY).toLowerCase()},${c.code}`);
699
- return (e, t) => (N(), G(ie, null, [
700
- A("div", ke, [
701
- t[1] || (t[1] = ee(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ")),
702
- A("div", {
703
- class: "my-6 text-center fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
704
- onClick: t[0] || (t[0] = (r) => {
705
- r.stopPropagation(), m();
706
- })
707
- }, le(o.code), 1)
708
- ]),
709
- t[3] || (t[3] = A("div", { class: "flex items-center my-4" }, [
710
- A("div", { class: "flex-grow border-t border-gray-300" }),
711
- A("span", { class: "px-4 text-gray-500 text-sm font-medium" }, "OR"),
712
- A("div", { class: "flex-grow border-t border-gray-300" })
713
- ], -1)),
714
- A("div", Be, [
715
- t[2] || (t[2] = ee(" Scan the binding code below on your device to link it with this terminal and apply the configuration. ")),
716
- A("div", Fe, [
717
- k(Ie, { value: n.value }, null, 8, ["value"])
718
- ])
719
- ])
720
- ], 64));
721
- }
722
- }), De = /* @__PURE__ */ z({
723
- __name: "ID",
724
- props: {
725
- row: {},
726
- data: {}
727
- },
728
- setup(o) {
729
- const c = o, d = W();
730
- function s() {
731
- return c.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
732
- }
733
- function m() {
734
- try {
735
- ue(c.data), d.open({ title: "Text copied to clipboard." }, 1e3);
736
- } catch {
737
- d.open({ title: "Clipboard API incompatible." }, 1e3);
738
- }
739
- c.data;
740
- }
741
- return (f, n) => {
742
- const e = _("FmBadge");
743
- return N(), G("div", {
744
- onClick: n[0] || (n[0] = (t) => {
745
- t.stopPropagation(), m();
746
- })
747
- }, [
748
- k(e, {
749
- inline: "",
750
- class: pe(s())
751
- }, {
752
- default: q(() => [
753
- A("div", null, le(f.data), 1)
754
- ]),
755
- _: 1
756
- }, 8, ["class"])
757
- ]);
758
- };
759
- }
760
- }), Oe = { class: "flex" }, Le = /* @__PURE__ */ z({
761
- __name: "Actions",
762
- props: {
763
- data: {}
764
- },
765
- emits: ["link", "unlink", "edit", "delete"],
766
- setup(o, { emit: c }) {
767
- const d = o, s = c;
768
- function m() {
769
- const f = Se([
770
- {
771
- type: "span",
772
- queryKey: "terminal.id",
773
- queryValue: d.data._id
774
- }
775
- ]);
776
- window.open(f, "_blank");
777
- }
778
- return (f, n) => {
779
- const e = _("FmButton");
780
- return N(), G("div", Oe, [
781
- k(e, {
782
- variant: "plain",
783
- "prepend-icon": "history",
784
- onClick: n[0] || (n[0] = (t) => {
785
- t.stopPropagation(), m();
786
- })
787
- }),
788
- f.data.deviceType === "TERMINAL" && !f.data.deviceId ? (N(), D(e, {
789
- key: 0,
790
- variant: "plain",
791
- "prepend-icon": "link",
792
- onClick: n[1] || (n[1] = (t) => {
793
- t.stopPropagation(), s("link");
794
- })
795
- })) : V("", !0),
796
- f.data.deviceType === "TERMINAL" && f.data.deviceId ? (N(), D(e, {
797
- key: 1,
798
- variant: "plain",
799
- "prepend-icon": "link_off",
800
- onClick: n[2] || (n[2] = (t) => {
801
- t.stopPropagation(), s("unlink");
802
- })
803
- })) : V("", !0),
804
- k(e, {
805
- variant: "plain",
806
- "prepend-icon": "edit",
807
- onClick: n[3] || (n[3] = (t) => {
808
- t.stopPropagation(), s("edit");
809
- })
810
- }),
811
- k(e, {
812
- variant: "plain",
813
- "prepend-icon": "delete",
814
- onClick: n[4] || (n[4] = (t) => {
815
- t.stopPropagation(), s("delete");
816
- })
817
- })
818
- ]);
819
- };
820
- }
821
- }), Ue = /* @__PURE__ */ z({
822
- __name: "TerminalDialog",
823
- props: {
824
- terminal: {
825
- type: Object
826
- }
827
- },
828
- setup(o) {
829
- var r, a, i;
830
- const c = o, d = ce(), s = Re(), m = I(), f = I((r = c.terminal) == null ? void 0 : r.name), n = I((a = c.terminal) == null ? void 0 : a.referenceId), e = I(((i = c.terminal) == null ? void 0 : i.status) === "Active"), t = se(() => d.restaurants.value.map((l) => ({
831
- label: l.profile.name,
832
- value: l._id
833
- })));
834
- return (l, h) => {
835
- const C = _("FmSelect"), u = _("FmTextField"), v = _("FmSwitch"), p = _("FmButton"), w = _("FmForm");
836
- return N(), D(w, {
837
- ref: m.value,
838
- class: "flex flex-col gap-16 mb-6",
839
- onValidationSuccess: h[3] || (h[3] = () => {
840
- P(s).emitData({ name: f.value, referenceId: n.value, status: e.value ? "Active" : "Inactive" }), P(s).emitAction("primary");
841
- })
842
- }, {
843
- default: q(() => [
844
- c.terminal ? V("", !0) : (N(), D(C, {
845
- key: 0,
846
- modelValue: n.value,
847
- "onUpdate:modelValue": h[0] || (h[0] = (g) => n.value = g),
848
- label: "Restaurant",
849
- "helper-text": "If you can't find the restaurant please change the business to the restaurant's business.",
850
- items: t.value,
851
- rules: P(re)(P(ne).string())
852
- }, null, 8, ["modelValue", "items", "rules"])),
853
- k(u, {
854
- modelValue: f.value,
855
- "onUpdate:modelValue": h[1] || (h[1] = (g) => f.value = g),
856
- label: "Terminal Name",
857
- rules: P(re)(P(ne).string())
858
- }, null, 8, ["modelValue", "rules"]),
859
- c.terminal ? (N(), D(v, {
860
- key: 1,
861
- modelValue: e.value,
862
- "onUpdate:modelValue": h[2] || (h[2] = (g) => e.value = g),
863
- label: "Status"
864
- }, null, 8, ["modelValue"])) : V("", !0),
865
- k(p, {
866
- type: "submit",
867
- label: "Create"
868
- })
869
- ]),
870
- _: 1
871
- }, 512);
872
- };
873
- }
874
- }), Qe = { class: "flex justify-between mb-6 items-center" }, xe = { class: "flex space-x-4" }, Ve = { class: "flex space-x-4" }, at = /* @__PURE__ */ z({
875
- __name: "Terminal",
876
- props: {
877
- type: {}
878
- },
879
- setup(o) {
880
- const c = o, d = I(), { searchKey: s, deviceType: m } = we({
881
- searchKey: "",
882
- deviceType: void 0
883
- });
884
- te(m, () => {
885
- var u;
886
- return (u = d.value) == null ? void 0 : u.reset();
887
- });
888
- let f;
889
- te(s, async () => {
890
- f && clearTimeout(f), f = setTimeout(
891
- () => {
892
- var u;
893
- return (u = d.value) == null ? void 0 : u.reset();
894
- },
895
- 700
896
- );
897
- });
898
- const n = be(), e = Ae(), t = W();
899
- async function r(u) {
900
- ae(
901
- e,
902
- "Terminal Unbind",
903
- "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
904
- async () => {
905
- var v;
906
- try {
907
- await Q.unbind(u), (v = d.value) == null || v.reset(), t.open({
908
- type: "success",
909
- message: "Terminal unbind successfully"
910
- });
911
- } catch (p) {
912
- t.open({
913
- type: "error",
914
- title: "Error occurs when unbind terminal",
915
- message: Y(p)
916
- });
917
- }
918
- }
919
- );
920
- }
921
- async function a(u) {
922
- const v = await Q.getBindCode(u);
923
- e.open({
924
- title: "Terminal Binding",
925
- closeButton: !0,
926
- overlay: !0,
927
- contentComponent: ze,
928
- contentComponentProps: { code: v }
929
- });
930
- }
931
- async function i(u) {
932
- e.open({
933
- title: u ? "Update Terminal" : "Create New Terminal",
934
- closeButton: !0,
935
- overlay: !0,
936
- contentComponent: Ue,
937
- contentComponentProps: { terminal: u }
938
- }).onPrimary(async (v) => {
939
- var p;
940
- e.close();
941
- try {
942
- await (u ? Q.updateById(u._id, { ...v, ecrs: u.ecrs ?? [], gateways: u.gateways ?? [] }) : Q.create(v)), (p = d.value) == null || p.reset(), t.open({
943
- type: "success",
944
- message: u ? "Terminal udpated successfully" : "Terminal created successfully."
945
- });
946
- } catch (w) {
947
- t.open({
948
- type: "error",
949
- title: "Error occurs when create terminal",
950
- message: Y(w)
951
- });
952
- }
953
- });
954
- }
955
- async function l(u) {
956
- ae(
957
- e,
958
- "Delete Terminal",
959
- "Are you sure to delete terminal? This action cannot be revert and device will be logged out!",
960
- async () => {
961
- var v;
962
- try {
963
- await Q.delete(u), (v = d.value) == null || v.reset(), t.open({
964
- type: "success",
965
- message: "Terminal delete successfully"
966
- });
967
- } catch (p) {
968
- t.open({
969
- type: "error",
970
- title: "Error occurs when delete terminal",
971
- message: Y(p)
972
- });
973
- }
974
- }
975
- );
976
- }
977
- const h = function(u) {
978
- var p, w;
979
- let v = u.name;
980
- return u.deviceType === "POS" && ((p = u.name) != null && p.includes("@")) && (v = u.restaurant.profile.name), u.deviceType === "KIOSK" && ((w = u.name) != null && w.includes("-")) && (v = u.restaurant.profile.name), {
981
- id: u._id,
982
- status: u.status,
983
- referenceId: u.referenceId,
984
- name: v,
985
- deviceId: u.deviceId,
986
- deviceType: u.deviceType,
987
- updatedAt: ye(u.updatedAt).format("YYYY-MM-DD HH:mm:ss"),
988
- posVersion: u.restaurant.posVersion,
989
- gateways: u.gateways,
990
- ecrs: u.ecrs
991
- };
992
- }, C = [
993
- {
994
- accessorKey: "id",
995
- header: () => "Terminal ID",
996
- meta: {
997
- textAlign: "right"
998
- },
999
- cell: ({ cell: u, row: v }) => M(De, { row: v, data: u.getValue() })
1000
- },
1001
- {
1002
- accessorKey: "name",
1003
- header: () => "Name",
1004
- meta: {
1005
- textAlign: "left"
1006
- }
1007
- },
1008
- {
1009
- accessorKey: "posVersion",
1010
- header: () => "POS Version",
1011
- meta: {
1012
- textAlign: "left"
1013
- }
1014
- },
1015
- {
1016
- accessorKey: "deviceId",
1017
- header: () => "Device ID",
1018
- meta: {
1019
- textAlign: "left"
1020
- }
1021
- },
1022
- {
1023
- accessorKey: "updatedAt",
1024
- header: () => "Last Updated",
1025
- meta: {
1026
- textAlign: "left"
1027
- }
1028
- },
1029
- {
1030
- accessorKey: "id",
1031
- header: () => "Actions",
1032
- meta: {
1033
- textAlign: "center"
1034
- },
1035
- cell: ({ row: u }) => {
1036
- var p;
1037
- const v = (p = d.value) == null ? void 0 : p.pageData().at(u.index);
1038
- return M(Le, {
1039
- data: v,
1040
- onLink: () => a(v._id),
1041
- onUnlink: () => r(v._id),
1042
- onEdit: () => i(v),
1043
- onDelete: () => l(v._id)
1044
- });
1045
- }
1046
- }
1047
- ];
1048
- return (u, v) => {
1049
- const p = _("FmSearch"), w = _("FmButton");
1050
- return N(), D(Me, {
1051
- title: c.type,
1052
- loading: !1
1053
- }, {
1054
- default: q(() => [
1055
- A("div", Qe, [
1056
- A("div", xe, [
1057
- k(p, {
1058
- "model-value": P(s),
1059
- "onUpdate:modelValue": v[0] || (v[0] = (g) => ge(s) ? s.value = g : null),
1060
- class: "mr-8",
1061
- label: "Search",
1062
- placeholder: "Search ..."
1063
- }, null, 8, ["model-value"])
1064
- ]),
1065
- A("div", Ve, [
1066
- c.type === "TERMINAL" ? (N(), D(w, {
1067
- key: 0,
1068
- label: "Create",
1069
- icon: "add",
1070
- onClick: v[1] || (v[1] = () => i())
1071
- })) : V("", !0)
1072
- ])
1073
- ]),
1074
- k(Ee, {
1075
- ref_key: "controller",
1076
- ref: d,
1077
- "column-defs": C,
1078
- "rows-defs": h,
1079
- paginate: (g, y) => P(Q).read({ searchKey: P(s), deviceType: c.type, limit: g, cursor: y }),
1080
- onRowClick: v[2] || (v[2] = (g) => P(n).push({
1081
- name: `mf-payment-admin.${c.type.toLowerCase()}-setting`,
1082
- params: {
1083
- terminalId: g._id
1084
- }
1085
- }))
1086
- }, null, 8, ["paginate"])
1087
- ]),
1088
- _: 1
1089
- }, 8, ["title"]);
1090
- };
1091
- }
1092
- });
1093
- export {
1094
- at as default
1095
- };