@feedmepos/mf-connect 0.1.20-prod → 0.1.22-prod
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/{Analytic-DaYL4IwZ.js → Analytic-CWvtQiXv.js} +10 -10
- package/dist/{App-CnRrmva6.js → App-BqAI4Hkg.js} +7 -7
- package/dist/{Bin-Bf8yL56G.js → Bin-BJRETFYp.js} +7 -7
- package/dist/{Broadcast-CyqZZRc1.js → Broadcast-BVNKXpst.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBAGO9mc.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BeauGnZ8.js} +6 -6
- package/dist/{Card-BHOw7yjA.js → Card-BH5HR_Xt.js} +14 -14
- package/dist/{Collections-DQYk52tc.js → Collections-DUzS8_tu.js} +5 -5
- package/dist/{Credit-BVD4wCLN.js → Credit-DVyhB8Fx.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-EdpoxZlh.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BzSJIIBN.js} +28 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-1tSUOxmX.js → EffectSheet.vue_vue_type_style_index_0_lang-CtgRejaJ.js} +45 -45
- package/dist/{Experience-BKTJKeqW.js → Experience-Uz-PdyS0.js} +8 -8
- package/dist/{Game-DDnwUySW.js → Game-yRSag2UH.js} +8 -8
- package/dist/{Index-Cf6d9PW1.js → Index-D54c-_3K.js} +9 -9
- package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/{Marketing-Dm2ECeZM.js → Marketing-wYfRoaP3.js} +12 -12
- package/dist/{Member-Bjx7KU3k.js → Member-BeX0-b7n.js} +4 -4
- package/dist/{MemberList-BEiuLggu.js → MemberList-B2dwBE3o.js} +23 -23
- package/dist/{MemberTransactions-C3YdUquh.js → MemberTransactions-jhOw4vzq.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-B8b8FbZX.js +447 -0
- package/dist/{Mission-CZ-jJd14.js → Mission-DzBDmz68.js} +8 -8
- package/dist/{Overview-CgbAmJNJ.js → Overview-DZ1-IMkf.js} +16 -16
- package/dist/{Point-Bt3nTcqr.js → Point-aP-KiJV2.js} +8 -8
- package/dist/{Promotion-DnMvO6sH.js → Promotion-NYlrI4Ur.js} +9 -9
- package/dist/{Record-DGSd8OoA.js → Record-C3FG6v0j.js} +6 -6
- package/dist/{Reward-DjSvoVKB.js → Reward-BkgfktZX.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CD5NQYu7.js → RewardGroup.vue_vue_type_script_setup_true_lang-CBkgYcan.js} +10 -10
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DL9sCsHT.js → RuleGroup.vue_vue_type_script_setup_true_lang-DgTRcfYy.js} +181 -178
- package/dist/{Segment-CwyALcvm.js → Segment-BdCYCRF-.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BpM7WgFp.js → SelectItems.vue_vue_type_script_setup_true_lang-DIWVzxxW.js} +2 -2
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bwa2RvTx.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BBXjK-Kc.js} +3 -3
- package/dist/Setting-CklTyVlf.js +1930 -0
- package/dist/{Store-BTejxCBe.js → Store-Ciud1AgX.js} +145 -143
- package/dist/StoreRewards-DUrZvdAy.js +422 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B-z5tu9A.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DabfW0cB.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CpIVuHaf.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C4g0D2WQ.js} +1 -1
- package/dist/{Tier-njMn6MiO.js → Tier-BcJfsKXP.js} +19 -19
- package/dist/{Title-Db8js_gS.js → Title-rtBtv9oZ.js} +100 -100
- package/dist/{Transaction-D9TjDeKD.js → Transaction-6fAgm3SK.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Bod8YjzJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bjvkwpb4.js} +6 -6
- package/dist/{Voucher--yr4TQ-G.js → Voucher-DsSs5cTE.js} +34 -34
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CeL94a07.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CrSH0qWc.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCc_w9J8.js → ZodTextField.vue_vue_type_script_setup_true_lang-DxDO6zJg.js} +1 -1
- package/dist/{app-BqAFUCz8.js → app-Cz0McG8i.js} +40 -40
- package/dist/{app-Ugrk96Pp.js → app-fPygt_FG.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CTwB-cPM.js → business-wZVszwRW.js} +1 -1
- package/dist/{campaign-DwL2D9J5.js → campaign-B-WMI4r4.js} +9 -9
- package/dist/{campaign-CKZMkxH5.js → campaign-CXOSMRjR.js} +2 -2
- package/dist/{campaign.enum-uKI06HHx.js → campaign.enum-xd3odOwZ.js} +1 -1
- package/dist/{campaign.fn-Dp8mlrpN.js → campaign.fn-CeIsYBHA.js} +41 -41
- package/dist/{collectible.enum-Bw421zWp.js → collectible.enum-B7uqKLHE.js} +1 -1
- package/dist/{collection.fn-D2zmqc53.js → collection.fn-Cj3PpbiS.js} +2 -2
- package/dist/{dto-FP61IJwc.js → dto-CVyFNO4G.js} +7 -7
- package/dist/{effect-BE4EnD4B.js → effect-D8WiNma1.js} +35 -18
- package/dist/{email-addresses-D8_sMdak.js → email-addresses-CZGh6TJT.js} +1 -1
- package/dist/{export-kgzxrVkq.js → export-B-yEeKMb.js} +3 -3
- package/dist/{helper-BI6pWRqN.js → helper-rlgqVAdj.js} +1 -1
- package/dist/{index-DTbigOhK.js → index-BC2la2BP.js} +1 -1
- package/dist/{index-COe4sMRZ.js → index-BSWItpEw.js} +1 -1
- package/dist/{index-sLN88aCQ.js → index-BYP79OMe.js} +225 -218
- package/dist/{index-DcBjYW9W.js → index-C73nKr6T.js} +1 -1
- package/dist/{index-BUXc2Nw5.js → index-C9Eegvas.js} +1 -1
- package/dist/{index-BpBt6Y8F.js → index-CH0xVjYG.js} +1 -1
- package/dist/{index-DoHEyLZn.js → index-CgA8VVym.js} +3 -3
- package/dist/{index-aOnN-LXC.js → index-Cr8x5i6a.js} +12 -5
- package/dist/{index-DLIjZTu7.js → index-DENLOr_f.js} +21 -16
- package/dist/index-DVko1T2G.js +29556 -0
- package/dist/{index-Cga6gx-T.js → index-szngpT22.js} +1 -1
- package/dist/{index-fCUvdTQu.js → index-yzjCyahZ.js} +91 -73
- package/dist/{index.esm2017-CWKGaTMR.js → index.esm2017-B852lCgd.js} +38 -38
- package/dist/{loading-GiUoU2Fa.js → loading-YQhP-YKE.js} +4 -4
- package/dist/{membership-Bt_7SvV0.js → membership-C6EfMXD7.js} +3 -3
- package/dist/{money-BZq33xlW.js → money-CSas0WMX.js} +1 -1
- package/dist/{number-DFHYy76W.js → number-DBcS6xgD.js} +1 -1
- package/dist/objectid-VFD2vEs_.js +145 -0
- package/dist/{reward-Dy_FLF01.js → reward-BIMasAXq.js} +1 -1
- package/dist/{rule-zl6tGcQA.js → rule-BRALPXUn.js} +8 -4
- package/dist/{rule-builder-BpZ5uHIv.js → rule-builder-CBcoUD6U.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-BKEUsA_B.js → template-GsgcvRB8.js} +4 -4
- package/dist/{trigger-ChT3kWh_.js → trigger-B8pRScE6.js} +4 -4
- package/dist/{usePagination-DWyHwAZT.js → usePagination-BtU3EXqo.js} +1 -1
- package/dist/{user-CX5C_btL.js → user-CBmfFwbE.js} +1 -1
- package/dist/{vue-i18n--AFmNvm8.js → vue-i18n-C5G5eOJh.js} +327 -327
- package/package.json +2 -2
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-ChUeeW90.js +0 -215
- package/dist/Setting-CCxSOD98.js +0 -1877
- package/dist/StoreRewards-DrUIjbjC.js +0 -401
- package/dist/index-CaJmkfzc.js +0 -29000
- package/dist/objectid-C6apWPpH.js +0 -145
|
@@ -0,0 +1,1930 @@
|
|
|
1
|
+
import { defineComponent as Xe, ref as H, computed as me, onMounted as Ze, resolveComponent as R, openBlock as x, createBlock as fe, withCtx as te, createElementVNode as w, createVNode as I, unref as c, isRef as We, createElementBlock as q, Fragment as le, toDisplayString as k, createTextVNode as ne, renderList as Ke, createCommentVNode as ce } from "vue";
|
|
2
|
+
import { h as _t } from "./moment-BWErdI6_.js";
|
|
3
|
+
import { Z as Oe } from "./zod-Bg2FbC-D.js";
|
|
4
|
+
import { useDialog as et } from "@feedmepos/ui-library";
|
|
5
|
+
import { a as tt, u as Et, p as At, f as G } from "./loading-YQhP-YKE.js";
|
|
6
|
+
import { u as Bt } from "./app-wDQR6dpb.js";
|
|
7
|
+
import { u as Me, l as nt } from "./business-wZVszwRW.js";
|
|
8
|
+
import { u as ot } from "./membership-C6EfMXD7.js";
|
|
9
|
+
import { q as Mt, h as St } from "./index-BYP79OMe.js";
|
|
10
|
+
import { _ as Ye } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
11
|
+
import { _ as It } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-C4g0D2WQ.js";
|
|
12
|
+
import { M as Pt, _ as Tt } from "./MessageInput.vue_vue_type_script_setup_true_lang-B8b8FbZX.js";
|
|
13
|
+
import { u as Nt } from "./vue-i18n-C5G5eOJh.js";
|
|
14
|
+
import { useCoreStore as Ut } from "@feedmepos/mf-common";
|
|
15
|
+
import { m as je } from "./index-Cr8x5i6a.js";
|
|
16
|
+
import { S as Lt } from "./index-DVko1T2G.js";
|
|
17
|
+
import { o as Ft } from "./objectId-dwaoBfJX.js";
|
|
18
|
+
import { a as Rt } from "./object-qECH92oz.js";
|
|
19
|
+
var ie = {}, Dt = function() {
|
|
20
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
21
|
+
}, rt = {}, L = {};
|
|
22
|
+
let Ne;
|
|
23
|
+
const kt = [
|
|
24
|
+
0,
|
|
25
|
+
// Not used
|
|
26
|
+
26,
|
|
27
|
+
44,
|
|
28
|
+
70,
|
|
29
|
+
100,
|
|
30
|
+
134,
|
|
31
|
+
172,
|
|
32
|
+
196,
|
|
33
|
+
242,
|
|
34
|
+
292,
|
|
35
|
+
346,
|
|
36
|
+
404,
|
|
37
|
+
466,
|
|
38
|
+
532,
|
|
39
|
+
581,
|
|
40
|
+
655,
|
|
41
|
+
733,
|
|
42
|
+
815,
|
|
43
|
+
901,
|
|
44
|
+
991,
|
|
45
|
+
1085,
|
|
46
|
+
1156,
|
|
47
|
+
1258,
|
|
48
|
+
1364,
|
|
49
|
+
1474,
|
|
50
|
+
1588,
|
|
51
|
+
1706,
|
|
52
|
+
1828,
|
|
53
|
+
1921,
|
|
54
|
+
2051,
|
|
55
|
+
2185,
|
|
56
|
+
2323,
|
|
57
|
+
2465,
|
|
58
|
+
2611,
|
|
59
|
+
2761,
|
|
60
|
+
2876,
|
|
61
|
+
3034,
|
|
62
|
+
3196,
|
|
63
|
+
3362,
|
|
64
|
+
3532,
|
|
65
|
+
3706
|
|
66
|
+
];
|
|
67
|
+
L.getSymbolSize = function(e) {
|
|
68
|
+
if (!e) throw new Error('"version" cannot be null or undefined');
|
|
69
|
+
if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
70
|
+
return e * 4 + 17;
|
|
71
|
+
};
|
|
72
|
+
L.getSymbolTotalCodewords = function(e) {
|
|
73
|
+
return kt[e];
|
|
74
|
+
};
|
|
75
|
+
L.getBCHDigit = function(t) {
|
|
76
|
+
let e = 0;
|
|
77
|
+
for (; t !== 0; )
|
|
78
|
+
e++, t >>>= 1;
|
|
79
|
+
return e;
|
|
80
|
+
};
|
|
81
|
+
L.setToSJISFunction = function(e) {
|
|
82
|
+
if (typeof e != "function")
|
|
83
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
84
|
+
Ne = e;
|
|
85
|
+
};
|
|
86
|
+
L.isKanjiModeEnabled = function() {
|
|
87
|
+
return typeof Ne < "u";
|
|
88
|
+
};
|
|
89
|
+
L.toSJIS = function(e) {
|
|
90
|
+
return Ne(e);
|
|
91
|
+
};
|
|
92
|
+
var pe = {};
|
|
93
|
+
(function(t) {
|
|
94
|
+
t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
|
|
95
|
+
function e(i) {
|
|
96
|
+
if (typeof i != "string")
|
|
97
|
+
throw new Error("Param is not a string");
|
|
98
|
+
switch (i.toLowerCase()) {
|
|
99
|
+
case "l":
|
|
100
|
+
case "low":
|
|
101
|
+
return t.L;
|
|
102
|
+
case "m":
|
|
103
|
+
case "medium":
|
|
104
|
+
return t.M;
|
|
105
|
+
case "q":
|
|
106
|
+
case "quartile":
|
|
107
|
+
return t.Q;
|
|
108
|
+
case "h":
|
|
109
|
+
case "high":
|
|
110
|
+
return t.H;
|
|
111
|
+
default:
|
|
112
|
+
throw new Error("Unknown EC Level: " + i);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
t.isValid = function(r) {
|
|
116
|
+
return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
|
|
117
|
+
}, t.from = function(r, o) {
|
|
118
|
+
if (t.isValid(r))
|
|
119
|
+
return r;
|
|
120
|
+
try {
|
|
121
|
+
return e(r);
|
|
122
|
+
} catch {
|
|
123
|
+
return o;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
})(pe);
|
|
127
|
+
function it() {
|
|
128
|
+
this.buffer = [], this.length = 0;
|
|
129
|
+
}
|
|
130
|
+
it.prototype = {
|
|
131
|
+
get: function(t) {
|
|
132
|
+
const e = Math.floor(t / 8);
|
|
133
|
+
return (this.buffer[e] >>> 7 - t % 8 & 1) === 1;
|
|
134
|
+
},
|
|
135
|
+
put: function(t, e) {
|
|
136
|
+
for (let i = 0; i < e; i++)
|
|
137
|
+
this.putBit((t >>> e - i - 1 & 1) === 1);
|
|
138
|
+
},
|
|
139
|
+
getLengthInBits: function() {
|
|
140
|
+
return this.length;
|
|
141
|
+
},
|
|
142
|
+
putBit: function(t) {
|
|
143
|
+
const e = Math.floor(this.length / 8);
|
|
144
|
+
this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
var Vt = it;
|
|
148
|
+
function se(t) {
|
|
149
|
+
if (!t || t < 1)
|
|
150
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
151
|
+
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
152
|
+
}
|
|
153
|
+
se.prototype.set = function(t, e, i, r) {
|
|
154
|
+
const o = t * this.size + e;
|
|
155
|
+
this.data[o] = i, r && (this.reservedBit[o] = !0);
|
|
156
|
+
};
|
|
157
|
+
se.prototype.get = function(t, e) {
|
|
158
|
+
return this.data[t * this.size + e];
|
|
159
|
+
};
|
|
160
|
+
se.prototype.xor = function(t, e, i) {
|
|
161
|
+
this.data[t * this.size + e] ^= i;
|
|
162
|
+
};
|
|
163
|
+
se.prototype.isReserved = function(t, e) {
|
|
164
|
+
return this.reservedBit[t * this.size + e];
|
|
165
|
+
};
|
|
166
|
+
var xt = se, st = {};
|
|
167
|
+
(function(t) {
|
|
168
|
+
const e = L.getSymbolSize;
|
|
169
|
+
t.getRowColCoords = function(r) {
|
|
170
|
+
if (r === 1) return [];
|
|
171
|
+
const o = Math.floor(r / 7) + 2, n = e(r), a = n === 145 ? 26 : Math.ceil((n - 13) / (2 * o - 2)) * 2, l = [n - 7];
|
|
172
|
+
for (let s = 1; s < o - 1; s++)
|
|
173
|
+
l[s] = l[s - 1] - a;
|
|
174
|
+
return l.push(6), l.reverse();
|
|
175
|
+
}, t.getPositions = function(r) {
|
|
176
|
+
const o = [], n = t.getRowColCoords(r), a = n.length;
|
|
177
|
+
for (let l = 0; l < a; l++)
|
|
178
|
+
for (let s = 0; s < a; s++)
|
|
179
|
+
l === 0 && s === 0 || // top-left
|
|
180
|
+
l === 0 && s === a - 1 || // bottom-left
|
|
181
|
+
l === a - 1 && s === 0 || o.push([n[l], n[s]]);
|
|
182
|
+
return o;
|
|
183
|
+
};
|
|
184
|
+
})(st);
|
|
185
|
+
var at = {};
|
|
186
|
+
const $t = L.getSymbolSize, Je = 7;
|
|
187
|
+
at.getPositions = function(e) {
|
|
188
|
+
const i = $t(e);
|
|
189
|
+
return [
|
|
190
|
+
// top-left
|
|
191
|
+
[0, 0],
|
|
192
|
+
// top-right
|
|
193
|
+
[i - Je, 0],
|
|
194
|
+
// bottom-left
|
|
195
|
+
[0, i - Je]
|
|
196
|
+
];
|
|
197
|
+
};
|
|
198
|
+
var lt = {};
|
|
199
|
+
(function(t) {
|
|
200
|
+
t.Patterns = {
|
|
201
|
+
PATTERN000: 0,
|
|
202
|
+
PATTERN001: 1,
|
|
203
|
+
PATTERN010: 2,
|
|
204
|
+
PATTERN011: 3,
|
|
205
|
+
PATTERN100: 4,
|
|
206
|
+
PATTERN101: 5,
|
|
207
|
+
PATTERN110: 6,
|
|
208
|
+
PATTERN111: 7
|
|
209
|
+
};
|
|
210
|
+
const e = {
|
|
211
|
+
N1: 3,
|
|
212
|
+
N2: 3,
|
|
213
|
+
N3: 40,
|
|
214
|
+
N4: 10
|
|
215
|
+
};
|
|
216
|
+
t.isValid = function(o) {
|
|
217
|
+
return o != null && o !== "" && !isNaN(o) && o >= 0 && o <= 7;
|
|
218
|
+
}, t.from = function(o) {
|
|
219
|
+
return t.isValid(o) ? parseInt(o, 10) : void 0;
|
|
220
|
+
}, t.getPenaltyN1 = function(o) {
|
|
221
|
+
const n = o.size;
|
|
222
|
+
let a = 0, l = 0, s = 0, u = null, f = null;
|
|
223
|
+
for (let A = 0; A < n; A++) {
|
|
224
|
+
l = s = 0, u = f = null;
|
|
225
|
+
for (let m = 0; m < n; m++) {
|
|
226
|
+
let d = o.get(A, m);
|
|
227
|
+
d === u ? l++ : (l >= 5 && (a += e.N1 + (l - 5)), u = d, l = 1), d = o.get(m, A), d === f ? s++ : (s >= 5 && (a += e.N1 + (s - 5)), f = d, s = 1);
|
|
228
|
+
}
|
|
229
|
+
l >= 5 && (a += e.N1 + (l - 5)), s >= 5 && (a += e.N1 + (s - 5));
|
|
230
|
+
}
|
|
231
|
+
return a;
|
|
232
|
+
}, t.getPenaltyN2 = function(o) {
|
|
233
|
+
const n = o.size;
|
|
234
|
+
let a = 0;
|
|
235
|
+
for (let l = 0; l < n - 1; l++)
|
|
236
|
+
for (let s = 0; s < n - 1; s++) {
|
|
237
|
+
const u = o.get(l, s) + o.get(l, s + 1) + o.get(l + 1, s) + o.get(l + 1, s + 1);
|
|
238
|
+
(u === 4 || u === 0) && a++;
|
|
239
|
+
}
|
|
240
|
+
return a * e.N2;
|
|
241
|
+
}, t.getPenaltyN3 = function(o) {
|
|
242
|
+
const n = o.size;
|
|
243
|
+
let a = 0, l = 0, s = 0;
|
|
244
|
+
for (let u = 0; u < n; u++) {
|
|
245
|
+
l = s = 0;
|
|
246
|
+
for (let f = 0; f < n; f++)
|
|
247
|
+
l = l << 1 & 2047 | o.get(u, f), f >= 10 && (l === 1488 || l === 93) && a++, s = s << 1 & 2047 | o.get(f, u), f >= 10 && (s === 1488 || s === 93) && a++;
|
|
248
|
+
}
|
|
249
|
+
return a * e.N3;
|
|
250
|
+
}, t.getPenaltyN4 = function(o) {
|
|
251
|
+
let n = 0;
|
|
252
|
+
const a = o.data.length;
|
|
253
|
+
for (let s = 0; s < a; s++) n += o.data[s];
|
|
254
|
+
return Math.abs(Math.ceil(n * 100 / a / 5) - 10) * e.N4;
|
|
255
|
+
};
|
|
256
|
+
function i(r, o, n) {
|
|
257
|
+
switch (r) {
|
|
258
|
+
case t.Patterns.PATTERN000:
|
|
259
|
+
return (o + n) % 2 === 0;
|
|
260
|
+
case t.Patterns.PATTERN001:
|
|
261
|
+
return o % 2 === 0;
|
|
262
|
+
case t.Patterns.PATTERN010:
|
|
263
|
+
return n % 3 === 0;
|
|
264
|
+
case t.Patterns.PATTERN011:
|
|
265
|
+
return (o + n) % 3 === 0;
|
|
266
|
+
case t.Patterns.PATTERN100:
|
|
267
|
+
return (Math.floor(o / 2) + Math.floor(n / 3)) % 2 === 0;
|
|
268
|
+
case t.Patterns.PATTERN101:
|
|
269
|
+
return o * n % 2 + o * n % 3 === 0;
|
|
270
|
+
case t.Patterns.PATTERN110:
|
|
271
|
+
return (o * n % 2 + o * n % 3) % 2 === 0;
|
|
272
|
+
case t.Patterns.PATTERN111:
|
|
273
|
+
return (o * n % 3 + (o + n) % 2) % 2 === 0;
|
|
274
|
+
default:
|
|
275
|
+
throw new Error("bad maskPattern:" + r);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
t.applyMask = function(o, n) {
|
|
279
|
+
const a = n.size;
|
|
280
|
+
for (let l = 0; l < a; l++)
|
|
281
|
+
for (let s = 0; s < a; s++)
|
|
282
|
+
n.isReserved(s, l) || n.xor(s, l, i(o, s, l));
|
|
283
|
+
}, t.getBestMask = function(o, n) {
|
|
284
|
+
const a = Object.keys(t.Patterns).length;
|
|
285
|
+
let l = 0, s = 1 / 0;
|
|
286
|
+
for (let u = 0; u < a; u++) {
|
|
287
|
+
n(u), t.applyMask(u, o);
|
|
288
|
+
const f = t.getPenaltyN1(o) + t.getPenaltyN2(o) + t.getPenaltyN3(o) + t.getPenaltyN4(o);
|
|
289
|
+
t.applyMask(u, o), f < s && (s = f, l = u);
|
|
290
|
+
}
|
|
291
|
+
return l;
|
|
292
|
+
};
|
|
293
|
+
})(lt);
|
|
294
|
+
var ye = {};
|
|
295
|
+
const O = pe, ue = [
|
|
296
|
+
// L M Q H
|
|
297
|
+
1,
|
|
298
|
+
1,
|
|
299
|
+
1,
|
|
300
|
+
1,
|
|
301
|
+
1,
|
|
302
|
+
1,
|
|
303
|
+
1,
|
|
304
|
+
1,
|
|
305
|
+
1,
|
|
306
|
+
1,
|
|
307
|
+
2,
|
|
308
|
+
2,
|
|
309
|
+
1,
|
|
310
|
+
2,
|
|
311
|
+
2,
|
|
312
|
+
4,
|
|
313
|
+
1,
|
|
314
|
+
2,
|
|
315
|
+
4,
|
|
316
|
+
4,
|
|
317
|
+
2,
|
|
318
|
+
4,
|
|
319
|
+
4,
|
|
320
|
+
4,
|
|
321
|
+
2,
|
|
322
|
+
4,
|
|
323
|
+
6,
|
|
324
|
+
5,
|
|
325
|
+
2,
|
|
326
|
+
4,
|
|
327
|
+
6,
|
|
328
|
+
6,
|
|
329
|
+
2,
|
|
330
|
+
5,
|
|
331
|
+
8,
|
|
332
|
+
8,
|
|
333
|
+
4,
|
|
334
|
+
5,
|
|
335
|
+
8,
|
|
336
|
+
8,
|
|
337
|
+
4,
|
|
338
|
+
5,
|
|
339
|
+
8,
|
|
340
|
+
11,
|
|
341
|
+
4,
|
|
342
|
+
8,
|
|
343
|
+
10,
|
|
344
|
+
11,
|
|
345
|
+
4,
|
|
346
|
+
9,
|
|
347
|
+
12,
|
|
348
|
+
16,
|
|
349
|
+
4,
|
|
350
|
+
9,
|
|
351
|
+
16,
|
|
352
|
+
16,
|
|
353
|
+
6,
|
|
354
|
+
10,
|
|
355
|
+
12,
|
|
356
|
+
18,
|
|
357
|
+
6,
|
|
358
|
+
10,
|
|
359
|
+
17,
|
|
360
|
+
16,
|
|
361
|
+
6,
|
|
362
|
+
11,
|
|
363
|
+
16,
|
|
364
|
+
19,
|
|
365
|
+
6,
|
|
366
|
+
13,
|
|
367
|
+
18,
|
|
368
|
+
21,
|
|
369
|
+
7,
|
|
370
|
+
14,
|
|
371
|
+
21,
|
|
372
|
+
25,
|
|
373
|
+
8,
|
|
374
|
+
16,
|
|
375
|
+
20,
|
|
376
|
+
25,
|
|
377
|
+
8,
|
|
378
|
+
17,
|
|
379
|
+
23,
|
|
380
|
+
25,
|
|
381
|
+
9,
|
|
382
|
+
17,
|
|
383
|
+
23,
|
|
384
|
+
34,
|
|
385
|
+
9,
|
|
386
|
+
18,
|
|
387
|
+
25,
|
|
388
|
+
30,
|
|
389
|
+
10,
|
|
390
|
+
20,
|
|
391
|
+
27,
|
|
392
|
+
32,
|
|
393
|
+
12,
|
|
394
|
+
21,
|
|
395
|
+
29,
|
|
396
|
+
35,
|
|
397
|
+
12,
|
|
398
|
+
23,
|
|
399
|
+
34,
|
|
400
|
+
37,
|
|
401
|
+
12,
|
|
402
|
+
25,
|
|
403
|
+
34,
|
|
404
|
+
40,
|
|
405
|
+
13,
|
|
406
|
+
26,
|
|
407
|
+
35,
|
|
408
|
+
42,
|
|
409
|
+
14,
|
|
410
|
+
28,
|
|
411
|
+
38,
|
|
412
|
+
45,
|
|
413
|
+
15,
|
|
414
|
+
29,
|
|
415
|
+
40,
|
|
416
|
+
48,
|
|
417
|
+
16,
|
|
418
|
+
31,
|
|
419
|
+
43,
|
|
420
|
+
51,
|
|
421
|
+
17,
|
|
422
|
+
33,
|
|
423
|
+
45,
|
|
424
|
+
54,
|
|
425
|
+
18,
|
|
426
|
+
35,
|
|
427
|
+
48,
|
|
428
|
+
57,
|
|
429
|
+
19,
|
|
430
|
+
37,
|
|
431
|
+
51,
|
|
432
|
+
60,
|
|
433
|
+
19,
|
|
434
|
+
38,
|
|
435
|
+
53,
|
|
436
|
+
63,
|
|
437
|
+
20,
|
|
438
|
+
40,
|
|
439
|
+
56,
|
|
440
|
+
66,
|
|
441
|
+
21,
|
|
442
|
+
43,
|
|
443
|
+
59,
|
|
444
|
+
70,
|
|
445
|
+
22,
|
|
446
|
+
45,
|
|
447
|
+
62,
|
|
448
|
+
74,
|
|
449
|
+
24,
|
|
450
|
+
47,
|
|
451
|
+
65,
|
|
452
|
+
77,
|
|
453
|
+
25,
|
|
454
|
+
49,
|
|
455
|
+
68,
|
|
456
|
+
81
|
|
457
|
+
], de = [
|
|
458
|
+
// L M Q H
|
|
459
|
+
7,
|
|
460
|
+
10,
|
|
461
|
+
13,
|
|
462
|
+
17,
|
|
463
|
+
10,
|
|
464
|
+
16,
|
|
465
|
+
22,
|
|
466
|
+
28,
|
|
467
|
+
15,
|
|
468
|
+
26,
|
|
469
|
+
36,
|
|
470
|
+
44,
|
|
471
|
+
20,
|
|
472
|
+
36,
|
|
473
|
+
52,
|
|
474
|
+
64,
|
|
475
|
+
26,
|
|
476
|
+
48,
|
|
477
|
+
72,
|
|
478
|
+
88,
|
|
479
|
+
36,
|
|
480
|
+
64,
|
|
481
|
+
96,
|
|
482
|
+
112,
|
|
483
|
+
40,
|
|
484
|
+
72,
|
|
485
|
+
108,
|
|
486
|
+
130,
|
|
487
|
+
48,
|
|
488
|
+
88,
|
|
489
|
+
132,
|
|
490
|
+
156,
|
|
491
|
+
60,
|
|
492
|
+
110,
|
|
493
|
+
160,
|
|
494
|
+
192,
|
|
495
|
+
72,
|
|
496
|
+
130,
|
|
497
|
+
192,
|
|
498
|
+
224,
|
|
499
|
+
80,
|
|
500
|
+
150,
|
|
501
|
+
224,
|
|
502
|
+
264,
|
|
503
|
+
96,
|
|
504
|
+
176,
|
|
505
|
+
260,
|
|
506
|
+
308,
|
|
507
|
+
104,
|
|
508
|
+
198,
|
|
509
|
+
288,
|
|
510
|
+
352,
|
|
511
|
+
120,
|
|
512
|
+
216,
|
|
513
|
+
320,
|
|
514
|
+
384,
|
|
515
|
+
132,
|
|
516
|
+
240,
|
|
517
|
+
360,
|
|
518
|
+
432,
|
|
519
|
+
144,
|
|
520
|
+
280,
|
|
521
|
+
408,
|
|
522
|
+
480,
|
|
523
|
+
168,
|
|
524
|
+
308,
|
|
525
|
+
448,
|
|
526
|
+
532,
|
|
527
|
+
180,
|
|
528
|
+
338,
|
|
529
|
+
504,
|
|
530
|
+
588,
|
|
531
|
+
196,
|
|
532
|
+
364,
|
|
533
|
+
546,
|
|
534
|
+
650,
|
|
535
|
+
224,
|
|
536
|
+
416,
|
|
537
|
+
600,
|
|
538
|
+
700,
|
|
539
|
+
224,
|
|
540
|
+
442,
|
|
541
|
+
644,
|
|
542
|
+
750,
|
|
543
|
+
252,
|
|
544
|
+
476,
|
|
545
|
+
690,
|
|
546
|
+
816,
|
|
547
|
+
270,
|
|
548
|
+
504,
|
|
549
|
+
750,
|
|
550
|
+
900,
|
|
551
|
+
300,
|
|
552
|
+
560,
|
|
553
|
+
810,
|
|
554
|
+
960,
|
|
555
|
+
312,
|
|
556
|
+
588,
|
|
557
|
+
870,
|
|
558
|
+
1050,
|
|
559
|
+
336,
|
|
560
|
+
644,
|
|
561
|
+
952,
|
|
562
|
+
1110,
|
|
563
|
+
360,
|
|
564
|
+
700,
|
|
565
|
+
1020,
|
|
566
|
+
1200,
|
|
567
|
+
390,
|
|
568
|
+
728,
|
|
569
|
+
1050,
|
|
570
|
+
1260,
|
|
571
|
+
420,
|
|
572
|
+
784,
|
|
573
|
+
1140,
|
|
574
|
+
1350,
|
|
575
|
+
450,
|
|
576
|
+
812,
|
|
577
|
+
1200,
|
|
578
|
+
1440,
|
|
579
|
+
480,
|
|
580
|
+
868,
|
|
581
|
+
1290,
|
|
582
|
+
1530,
|
|
583
|
+
510,
|
|
584
|
+
924,
|
|
585
|
+
1350,
|
|
586
|
+
1620,
|
|
587
|
+
540,
|
|
588
|
+
980,
|
|
589
|
+
1440,
|
|
590
|
+
1710,
|
|
591
|
+
570,
|
|
592
|
+
1036,
|
|
593
|
+
1530,
|
|
594
|
+
1800,
|
|
595
|
+
570,
|
|
596
|
+
1064,
|
|
597
|
+
1590,
|
|
598
|
+
1890,
|
|
599
|
+
600,
|
|
600
|
+
1120,
|
|
601
|
+
1680,
|
|
602
|
+
1980,
|
|
603
|
+
630,
|
|
604
|
+
1204,
|
|
605
|
+
1770,
|
|
606
|
+
2100,
|
|
607
|
+
660,
|
|
608
|
+
1260,
|
|
609
|
+
1860,
|
|
610
|
+
2220,
|
|
611
|
+
720,
|
|
612
|
+
1316,
|
|
613
|
+
1950,
|
|
614
|
+
2310,
|
|
615
|
+
750,
|
|
616
|
+
1372,
|
|
617
|
+
2040,
|
|
618
|
+
2430
|
|
619
|
+
];
|
|
620
|
+
ye.getBlocksCount = function(e, i) {
|
|
621
|
+
switch (i) {
|
|
622
|
+
case O.L:
|
|
623
|
+
return ue[(e - 1) * 4 + 0];
|
|
624
|
+
case O.M:
|
|
625
|
+
return ue[(e - 1) * 4 + 1];
|
|
626
|
+
case O.Q:
|
|
627
|
+
return ue[(e - 1) * 4 + 2];
|
|
628
|
+
case O.H:
|
|
629
|
+
return ue[(e - 1) * 4 + 3];
|
|
630
|
+
default:
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
ye.getTotalCodewordsCount = function(e, i) {
|
|
635
|
+
switch (i) {
|
|
636
|
+
case O.L:
|
|
637
|
+
return de[(e - 1) * 4 + 0];
|
|
638
|
+
case O.M:
|
|
639
|
+
return de[(e - 1) * 4 + 1];
|
|
640
|
+
case O.Q:
|
|
641
|
+
return de[(e - 1) * 4 + 2];
|
|
642
|
+
case O.H:
|
|
643
|
+
return de[(e - 1) * 4 + 3];
|
|
644
|
+
default:
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
var ct = {}, we = {};
|
|
649
|
+
const oe = new Uint8Array(512), ge = new Uint8Array(256);
|
|
650
|
+
(function() {
|
|
651
|
+
let e = 1;
|
|
652
|
+
for (let i = 0; i < 255; i++)
|
|
653
|
+
oe[i] = e, ge[e] = i, e <<= 1, e & 256 && (e ^= 285);
|
|
654
|
+
for (let i = 255; i < 512; i++)
|
|
655
|
+
oe[i] = oe[i - 255];
|
|
656
|
+
})();
|
|
657
|
+
we.log = function(e) {
|
|
658
|
+
if (e < 1) throw new Error("log(" + e + ")");
|
|
659
|
+
return ge[e];
|
|
660
|
+
};
|
|
661
|
+
we.exp = function(e) {
|
|
662
|
+
return oe[e];
|
|
663
|
+
};
|
|
664
|
+
we.mul = function(e, i) {
|
|
665
|
+
return e === 0 || i === 0 ? 0 : oe[ge[e] + ge[i]];
|
|
666
|
+
};
|
|
667
|
+
(function(t) {
|
|
668
|
+
const e = we;
|
|
669
|
+
t.mul = function(r, o) {
|
|
670
|
+
const n = new Uint8Array(r.length + o.length - 1);
|
|
671
|
+
for (let a = 0; a < r.length; a++)
|
|
672
|
+
for (let l = 0; l < o.length; l++)
|
|
673
|
+
n[a + l] ^= e.mul(r[a], o[l]);
|
|
674
|
+
return n;
|
|
675
|
+
}, t.mod = function(r, o) {
|
|
676
|
+
let n = new Uint8Array(r);
|
|
677
|
+
for (; n.length - o.length >= 0; ) {
|
|
678
|
+
const a = n[0];
|
|
679
|
+
for (let s = 0; s < o.length; s++)
|
|
680
|
+
n[s] ^= e.mul(o[s], a);
|
|
681
|
+
let l = 0;
|
|
682
|
+
for (; l < n.length && n[l] === 0; ) l++;
|
|
683
|
+
n = n.slice(l);
|
|
684
|
+
}
|
|
685
|
+
return n;
|
|
686
|
+
}, t.generateECPolynomial = function(r) {
|
|
687
|
+
let o = new Uint8Array([1]);
|
|
688
|
+
for (let n = 0; n < r; n++)
|
|
689
|
+
o = t.mul(o, new Uint8Array([1, e.exp(n)]));
|
|
690
|
+
return o;
|
|
691
|
+
};
|
|
692
|
+
})(ct);
|
|
693
|
+
const ut = ct;
|
|
694
|
+
function Ue(t) {
|
|
695
|
+
this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree);
|
|
696
|
+
}
|
|
697
|
+
Ue.prototype.initialize = function(e) {
|
|
698
|
+
this.degree = e, this.genPoly = ut.generateECPolynomial(this.degree);
|
|
699
|
+
};
|
|
700
|
+
Ue.prototype.encode = function(e) {
|
|
701
|
+
if (!this.genPoly)
|
|
702
|
+
throw new Error("Encoder not initialized");
|
|
703
|
+
const i = new Uint8Array(e.length + this.degree);
|
|
704
|
+
i.set(e);
|
|
705
|
+
const r = ut.mod(i, this.genPoly), o = this.degree - r.length;
|
|
706
|
+
if (o > 0) {
|
|
707
|
+
const n = new Uint8Array(this.degree);
|
|
708
|
+
return n.set(r, o), n;
|
|
709
|
+
}
|
|
710
|
+
return r;
|
|
711
|
+
};
|
|
712
|
+
var zt = Ue, dt = {}, Y = {}, Le = {};
|
|
713
|
+
Le.isValid = function(e) {
|
|
714
|
+
return !isNaN(e) && e >= 1 && e <= 40;
|
|
715
|
+
};
|
|
716
|
+
var $ = {};
|
|
717
|
+
const ft = "[0-9]+", Ht = "[A-Z $%*+\\-./:]+";
|
|
718
|
+
let re = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
719
|
+
re = re.replace(/u/g, "\\u");
|
|
720
|
+
const Kt = "(?:(?![A-Z0-9 $%*+\\-./:]|" + re + `)(?:.|[\r
|
|
721
|
+
]))+`;
|
|
722
|
+
$.KANJI = new RegExp(re, "g");
|
|
723
|
+
$.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
724
|
+
$.BYTE = new RegExp(Kt, "g");
|
|
725
|
+
$.NUMERIC = new RegExp(ft, "g");
|
|
726
|
+
$.ALPHANUMERIC = new RegExp(Ht, "g");
|
|
727
|
+
const Ot = new RegExp("^" + re + "$"), Yt = new RegExp("^" + ft + "$"), jt = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
728
|
+
$.testKanji = function(e) {
|
|
729
|
+
return Ot.test(e);
|
|
730
|
+
};
|
|
731
|
+
$.testNumeric = function(e) {
|
|
732
|
+
return Yt.test(e);
|
|
733
|
+
};
|
|
734
|
+
$.testAlphanumeric = function(e) {
|
|
735
|
+
return jt.test(e);
|
|
736
|
+
};
|
|
737
|
+
(function(t) {
|
|
738
|
+
const e = Le, i = $;
|
|
739
|
+
t.NUMERIC = {
|
|
740
|
+
id: "Numeric",
|
|
741
|
+
bit: 1,
|
|
742
|
+
ccBits: [10, 12, 14]
|
|
743
|
+
}, t.ALPHANUMERIC = {
|
|
744
|
+
id: "Alphanumeric",
|
|
745
|
+
bit: 2,
|
|
746
|
+
ccBits: [9, 11, 13]
|
|
747
|
+
}, t.BYTE = {
|
|
748
|
+
id: "Byte",
|
|
749
|
+
bit: 4,
|
|
750
|
+
ccBits: [8, 16, 16]
|
|
751
|
+
}, t.KANJI = {
|
|
752
|
+
id: "Kanji",
|
|
753
|
+
bit: 8,
|
|
754
|
+
ccBits: [8, 10, 12]
|
|
755
|
+
}, t.MIXED = {
|
|
756
|
+
bit: -1
|
|
757
|
+
}, t.getCharCountIndicator = function(n, a) {
|
|
758
|
+
if (!n.ccBits) throw new Error("Invalid mode: " + n);
|
|
759
|
+
if (!e.isValid(a))
|
|
760
|
+
throw new Error("Invalid version: " + a);
|
|
761
|
+
return a >= 1 && a < 10 ? n.ccBits[0] : a < 27 ? n.ccBits[1] : n.ccBits[2];
|
|
762
|
+
}, t.getBestModeForData = function(n) {
|
|
763
|
+
return i.testNumeric(n) ? t.NUMERIC : i.testAlphanumeric(n) ? t.ALPHANUMERIC : i.testKanji(n) ? t.KANJI : t.BYTE;
|
|
764
|
+
}, t.toString = function(n) {
|
|
765
|
+
if (n && n.id) return n.id;
|
|
766
|
+
throw new Error("Invalid mode");
|
|
767
|
+
}, t.isValid = function(n) {
|
|
768
|
+
return n && n.bit && n.ccBits;
|
|
769
|
+
};
|
|
770
|
+
function r(o) {
|
|
771
|
+
if (typeof o != "string")
|
|
772
|
+
throw new Error("Param is not a string");
|
|
773
|
+
switch (o.toLowerCase()) {
|
|
774
|
+
case "numeric":
|
|
775
|
+
return t.NUMERIC;
|
|
776
|
+
case "alphanumeric":
|
|
777
|
+
return t.ALPHANUMERIC;
|
|
778
|
+
case "kanji":
|
|
779
|
+
return t.KANJI;
|
|
780
|
+
case "byte":
|
|
781
|
+
return t.BYTE;
|
|
782
|
+
default:
|
|
783
|
+
throw new Error("Unknown mode: " + o);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
t.from = function(n, a) {
|
|
787
|
+
if (t.isValid(n))
|
|
788
|
+
return n;
|
|
789
|
+
try {
|
|
790
|
+
return r(n);
|
|
791
|
+
} catch {
|
|
792
|
+
return a;
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
})(Y);
|
|
796
|
+
(function(t) {
|
|
797
|
+
const e = L, i = ye, r = pe, o = Y, n = Le, a = 7973, l = e.getBCHDigit(a);
|
|
798
|
+
function s(m, d, v) {
|
|
799
|
+
for (let C = 1; C <= 40; C++)
|
|
800
|
+
if (d <= t.getCapacity(C, v, m))
|
|
801
|
+
return C;
|
|
802
|
+
}
|
|
803
|
+
function u(m, d) {
|
|
804
|
+
return o.getCharCountIndicator(m, d) + 4;
|
|
805
|
+
}
|
|
806
|
+
function f(m, d) {
|
|
807
|
+
let v = 0;
|
|
808
|
+
return m.forEach(function(C) {
|
|
809
|
+
const M = u(C.mode, d);
|
|
810
|
+
v += M + C.getBitsLength();
|
|
811
|
+
}), v;
|
|
812
|
+
}
|
|
813
|
+
function A(m, d) {
|
|
814
|
+
for (let v = 1; v <= 40; v++)
|
|
815
|
+
if (f(m, v) <= t.getCapacity(v, d, o.MIXED))
|
|
816
|
+
return v;
|
|
817
|
+
}
|
|
818
|
+
t.from = function(d, v) {
|
|
819
|
+
return n.isValid(d) ? parseInt(d, 10) : v;
|
|
820
|
+
}, t.getCapacity = function(d, v, C) {
|
|
821
|
+
if (!n.isValid(d))
|
|
822
|
+
throw new Error("Invalid QR Code version");
|
|
823
|
+
typeof C > "u" && (C = o.BYTE);
|
|
824
|
+
const M = e.getSymbolTotalCodewords(d), h = i.getTotalCodewordsCount(d, v), b = (M - h) * 8;
|
|
825
|
+
if (C === o.MIXED) return b;
|
|
826
|
+
const g = b - u(C, d);
|
|
827
|
+
switch (C) {
|
|
828
|
+
case o.NUMERIC:
|
|
829
|
+
return Math.floor(g / 10 * 3);
|
|
830
|
+
case o.ALPHANUMERIC:
|
|
831
|
+
return Math.floor(g / 11 * 2);
|
|
832
|
+
case o.KANJI:
|
|
833
|
+
return Math.floor(g / 13);
|
|
834
|
+
case o.BYTE:
|
|
835
|
+
default:
|
|
836
|
+
return Math.floor(g / 8);
|
|
837
|
+
}
|
|
838
|
+
}, t.getBestVersionForData = function(d, v) {
|
|
839
|
+
let C;
|
|
840
|
+
const M = r.from(v, r.M);
|
|
841
|
+
if (Array.isArray(d)) {
|
|
842
|
+
if (d.length > 1)
|
|
843
|
+
return A(d, M);
|
|
844
|
+
if (d.length === 0)
|
|
845
|
+
return 1;
|
|
846
|
+
C = d[0];
|
|
847
|
+
} else
|
|
848
|
+
C = d;
|
|
849
|
+
return s(C.mode, C.getLength(), M);
|
|
850
|
+
}, t.getEncodedBits = function(d) {
|
|
851
|
+
if (!n.isValid(d) || d < 7)
|
|
852
|
+
throw new Error("Invalid QR Code version");
|
|
853
|
+
let v = d << 12;
|
|
854
|
+
for (; e.getBCHDigit(v) - l >= 0; )
|
|
855
|
+
v ^= a << e.getBCHDigit(v) - l;
|
|
856
|
+
return d << 12 | v;
|
|
857
|
+
};
|
|
858
|
+
})(dt);
|
|
859
|
+
var mt = {};
|
|
860
|
+
const Se = L, gt = 1335, Jt = 21522, qe = Se.getBCHDigit(gt);
|
|
861
|
+
mt.getEncodedBits = function(e, i) {
|
|
862
|
+
const r = e.bit << 3 | i;
|
|
863
|
+
let o = r << 10;
|
|
864
|
+
for (; Se.getBCHDigit(o) - qe >= 0; )
|
|
865
|
+
o ^= gt << Se.getBCHDigit(o) - qe;
|
|
866
|
+
return (r << 10 | o) ^ Jt;
|
|
867
|
+
};
|
|
868
|
+
var ht = {};
|
|
869
|
+
const qt = Y;
|
|
870
|
+
function Q(t) {
|
|
871
|
+
this.mode = qt.NUMERIC, this.data = t.toString();
|
|
872
|
+
}
|
|
873
|
+
Q.getBitsLength = function(e) {
|
|
874
|
+
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
875
|
+
};
|
|
876
|
+
Q.prototype.getLength = function() {
|
|
877
|
+
return this.data.length;
|
|
878
|
+
};
|
|
879
|
+
Q.prototype.getBitsLength = function() {
|
|
880
|
+
return Q.getBitsLength(this.data.length);
|
|
881
|
+
};
|
|
882
|
+
Q.prototype.write = function(e) {
|
|
883
|
+
let i, r, o;
|
|
884
|
+
for (i = 0; i + 3 <= this.data.length; i += 3)
|
|
885
|
+
r = this.data.substr(i, 3), o = parseInt(r, 10), e.put(o, 10);
|
|
886
|
+
const n = this.data.length - i;
|
|
887
|
+
n > 0 && (r = this.data.substr(i), o = parseInt(r, 10), e.put(o, n * 3 + 1));
|
|
888
|
+
};
|
|
889
|
+
var Gt = Q;
|
|
890
|
+
const Qt = Y, Ce = [
|
|
891
|
+
"0",
|
|
892
|
+
"1",
|
|
893
|
+
"2",
|
|
894
|
+
"3",
|
|
895
|
+
"4",
|
|
896
|
+
"5",
|
|
897
|
+
"6",
|
|
898
|
+
"7",
|
|
899
|
+
"8",
|
|
900
|
+
"9",
|
|
901
|
+
"A",
|
|
902
|
+
"B",
|
|
903
|
+
"C",
|
|
904
|
+
"D",
|
|
905
|
+
"E",
|
|
906
|
+
"F",
|
|
907
|
+
"G",
|
|
908
|
+
"H",
|
|
909
|
+
"I",
|
|
910
|
+
"J",
|
|
911
|
+
"K",
|
|
912
|
+
"L",
|
|
913
|
+
"M",
|
|
914
|
+
"N",
|
|
915
|
+
"O",
|
|
916
|
+
"P",
|
|
917
|
+
"Q",
|
|
918
|
+
"R",
|
|
919
|
+
"S",
|
|
920
|
+
"T",
|
|
921
|
+
"U",
|
|
922
|
+
"V",
|
|
923
|
+
"W",
|
|
924
|
+
"X",
|
|
925
|
+
"Y",
|
|
926
|
+
"Z",
|
|
927
|
+
" ",
|
|
928
|
+
"$",
|
|
929
|
+
"%",
|
|
930
|
+
"*",
|
|
931
|
+
"+",
|
|
932
|
+
"-",
|
|
933
|
+
".",
|
|
934
|
+
"/",
|
|
935
|
+
":"
|
|
936
|
+
];
|
|
937
|
+
function X(t) {
|
|
938
|
+
this.mode = Qt.ALPHANUMERIC, this.data = t;
|
|
939
|
+
}
|
|
940
|
+
X.getBitsLength = function(e) {
|
|
941
|
+
return 11 * Math.floor(e / 2) + 6 * (e % 2);
|
|
942
|
+
};
|
|
943
|
+
X.prototype.getLength = function() {
|
|
944
|
+
return this.data.length;
|
|
945
|
+
};
|
|
946
|
+
X.prototype.getBitsLength = function() {
|
|
947
|
+
return X.getBitsLength(this.data.length);
|
|
948
|
+
};
|
|
949
|
+
X.prototype.write = function(e) {
|
|
950
|
+
let i;
|
|
951
|
+
for (i = 0; i + 2 <= this.data.length; i += 2) {
|
|
952
|
+
let r = Ce.indexOf(this.data[i]) * 45;
|
|
953
|
+
r += Ce.indexOf(this.data[i + 1]), e.put(r, 11);
|
|
954
|
+
}
|
|
955
|
+
this.data.length % 2 && e.put(Ce.indexOf(this.data[i]), 6);
|
|
956
|
+
};
|
|
957
|
+
var Xt = X, Zt = function(e) {
|
|
958
|
+
for (var i = [], r = e.length, o = 0; o < r; o++) {
|
|
959
|
+
var n = e.charCodeAt(o);
|
|
960
|
+
if (n >= 55296 && n <= 56319 && r > o + 1) {
|
|
961
|
+
var a = e.charCodeAt(o + 1);
|
|
962
|
+
a >= 56320 && a <= 57343 && (n = (n - 55296) * 1024 + a - 56320 + 65536, o += 1);
|
|
963
|
+
}
|
|
964
|
+
if (n < 128) {
|
|
965
|
+
i.push(n);
|
|
966
|
+
continue;
|
|
967
|
+
}
|
|
968
|
+
if (n < 2048) {
|
|
969
|
+
i.push(n >> 6 | 192), i.push(n & 63 | 128);
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
if (n < 55296 || n >= 57344 && n < 65536) {
|
|
973
|
+
i.push(n >> 12 | 224), i.push(n >> 6 & 63 | 128), i.push(n & 63 | 128);
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
if (n >= 65536 && n <= 1114111) {
|
|
977
|
+
i.push(n >> 18 | 240), i.push(n >> 12 & 63 | 128), i.push(n >> 6 & 63 | 128), i.push(n & 63 | 128);
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
i.push(239, 191, 189);
|
|
981
|
+
}
|
|
982
|
+
return new Uint8Array(i).buffer;
|
|
983
|
+
};
|
|
984
|
+
const Wt = Zt, en = Y;
|
|
985
|
+
function Z(t) {
|
|
986
|
+
this.mode = en.BYTE, typeof t == "string" && (t = Wt(t)), this.data = new Uint8Array(t);
|
|
987
|
+
}
|
|
988
|
+
Z.getBitsLength = function(e) {
|
|
989
|
+
return e * 8;
|
|
990
|
+
};
|
|
991
|
+
Z.prototype.getLength = function() {
|
|
992
|
+
return this.data.length;
|
|
993
|
+
};
|
|
994
|
+
Z.prototype.getBitsLength = function() {
|
|
995
|
+
return Z.getBitsLength(this.data.length);
|
|
996
|
+
};
|
|
997
|
+
Z.prototype.write = function(t) {
|
|
998
|
+
for (let e = 0, i = this.data.length; e < i; e++)
|
|
999
|
+
t.put(this.data[e], 8);
|
|
1000
|
+
};
|
|
1001
|
+
var tn = Z;
|
|
1002
|
+
const nn = Y, on = L;
|
|
1003
|
+
function W(t) {
|
|
1004
|
+
this.mode = nn.KANJI, this.data = t;
|
|
1005
|
+
}
|
|
1006
|
+
W.getBitsLength = function(e) {
|
|
1007
|
+
return e * 13;
|
|
1008
|
+
};
|
|
1009
|
+
W.prototype.getLength = function() {
|
|
1010
|
+
return this.data.length;
|
|
1011
|
+
};
|
|
1012
|
+
W.prototype.getBitsLength = function() {
|
|
1013
|
+
return W.getBitsLength(this.data.length);
|
|
1014
|
+
};
|
|
1015
|
+
W.prototype.write = function(t) {
|
|
1016
|
+
let e;
|
|
1017
|
+
for (e = 0; e < this.data.length; e++) {
|
|
1018
|
+
let i = on.toSJIS(this.data[e]);
|
|
1019
|
+
if (i >= 33088 && i <= 40956)
|
|
1020
|
+
i -= 33088;
|
|
1021
|
+
else if (i >= 57408 && i <= 60351)
|
|
1022
|
+
i -= 49472;
|
|
1023
|
+
else
|
|
1024
|
+
throw new Error(
|
|
1025
|
+
"Invalid SJIS character: " + this.data[e] + `
|
|
1026
|
+
Make sure your charset is UTF-8`
|
|
1027
|
+
);
|
|
1028
|
+
i = (i >>> 8 & 255) * 192 + (i & 255), t.put(i, 13);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
var rn = W, pt = { exports: {} };
|
|
1032
|
+
(function(t) {
|
|
1033
|
+
var e = {
|
|
1034
|
+
single_source_shortest_paths: function(i, r, o) {
|
|
1035
|
+
var n = {}, a = {};
|
|
1036
|
+
a[r] = 0;
|
|
1037
|
+
var l = e.PriorityQueue.make();
|
|
1038
|
+
l.push(r, 0);
|
|
1039
|
+
for (var s, u, f, A, m, d, v, C, M; !l.empty(); ) {
|
|
1040
|
+
s = l.pop(), u = s.value, A = s.cost, m = i[u] || {};
|
|
1041
|
+
for (f in m)
|
|
1042
|
+
m.hasOwnProperty(f) && (d = m[f], v = A + d, C = a[f], M = typeof a[f] > "u", (M || C > v) && (a[f] = v, l.push(f, v), n[f] = u));
|
|
1043
|
+
}
|
|
1044
|
+
if (typeof o < "u" && typeof a[o] > "u") {
|
|
1045
|
+
var h = ["Could not find a path from ", r, " to ", o, "."].join("");
|
|
1046
|
+
throw new Error(h);
|
|
1047
|
+
}
|
|
1048
|
+
return n;
|
|
1049
|
+
},
|
|
1050
|
+
extract_shortest_path_from_predecessor_list: function(i, r) {
|
|
1051
|
+
for (var o = [], n = r; n; )
|
|
1052
|
+
o.push(n), i[n], n = i[n];
|
|
1053
|
+
return o.reverse(), o;
|
|
1054
|
+
},
|
|
1055
|
+
find_path: function(i, r, o) {
|
|
1056
|
+
var n = e.single_source_shortest_paths(i, r, o);
|
|
1057
|
+
return e.extract_shortest_path_from_predecessor_list(
|
|
1058
|
+
n,
|
|
1059
|
+
o
|
|
1060
|
+
);
|
|
1061
|
+
},
|
|
1062
|
+
/**
|
|
1063
|
+
* A very naive priority queue implementation.
|
|
1064
|
+
*/
|
|
1065
|
+
PriorityQueue: {
|
|
1066
|
+
make: function(i) {
|
|
1067
|
+
var r = e.PriorityQueue, o = {}, n;
|
|
1068
|
+
i = i || {};
|
|
1069
|
+
for (n in r)
|
|
1070
|
+
r.hasOwnProperty(n) && (o[n] = r[n]);
|
|
1071
|
+
return o.queue = [], o.sorter = i.sorter || r.default_sorter, o;
|
|
1072
|
+
},
|
|
1073
|
+
default_sorter: function(i, r) {
|
|
1074
|
+
return i.cost - r.cost;
|
|
1075
|
+
},
|
|
1076
|
+
/**
|
|
1077
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
1078
|
+
* is at the front of the queue.
|
|
1079
|
+
*/
|
|
1080
|
+
push: function(i, r) {
|
|
1081
|
+
var o = { value: i, cost: r };
|
|
1082
|
+
this.queue.push(o), this.queue.sort(this.sorter);
|
|
1083
|
+
},
|
|
1084
|
+
/**
|
|
1085
|
+
* Return the highest priority element in the queue.
|
|
1086
|
+
*/
|
|
1087
|
+
pop: function() {
|
|
1088
|
+
return this.queue.shift();
|
|
1089
|
+
},
|
|
1090
|
+
empty: function() {
|
|
1091
|
+
return this.queue.length === 0;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
t.exports = e;
|
|
1096
|
+
})(pt);
|
|
1097
|
+
var sn = pt.exports;
|
|
1098
|
+
(function(t) {
|
|
1099
|
+
const e = Y, i = Gt, r = Xt, o = tn, n = rn, a = $, l = L, s = sn;
|
|
1100
|
+
function u(h) {
|
|
1101
|
+
return unescape(encodeURIComponent(h)).length;
|
|
1102
|
+
}
|
|
1103
|
+
function f(h, b, g) {
|
|
1104
|
+
const p = [];
|
|
1105
|
+
let B;
|
|
1106
|
+
for (; (B = h.exec(g)) !== null; )
|
|
1107
|
+
p.push({
|
|
1108
|
+
data: B[0],
|
|
1109
|
+
index: B.index,
|
|
1110
|
+
mode: b,
|
|
1111
|
+
length: B[0].length
|
|
1112
|
+
});
|
|
1113
|
+
return p;
|
|
1114
|
+
}
|
|
1115
|
+
function A(h) {
|
|
1116
|
+
const b = f(a.NUMERIC, e.NUMERIC, h), g = f(a.ALPHANUMERIC, e.ALPHANUMERIC, h);
|
|
1117
|
+
let p, B;
|
|
1118
|
+
return l.isKanjiModeEnabled() ? (p = f(a.BYTE, e.BYTE, h), B = f(a.KANJI, e.KANJI, h)) : (p = f(a.BYTE_KANJI, e.BYTE, h), B = []), b.concat(g, p, B).sort(function(P, U) {
|
|
1119
|
+
return P.index - U.index;
|
|
1120
|
+
}).map(function(P) {
|
|
1121
|
+
return {
|
|
1122
|
+
data: P.data,
|
|
1123
|
+
mode: P.mode,
|
|
1124
|
+
length: P.length
|
|
1125
|
+
};
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
function m(h, b) {
|
|
1129
|
+
switch (b) {
|
|
1130
|
+
case e.NUMERIC:
|
|
1131
|
+
return i.getBitsLength(h);
|
|
1132
|
+
case e.ALPHANUMERIC:
|
|
1133
|
+
return r.getBitsLength(h);
|
|
1134
|
+
case e.KANJI:
|
|
1135
|
+
return n.getBitsLength(h);
|
|
1136
|
+
case e.BYTE:
|
|
1137
|
+
return o.getBitsLength(h);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
function d(h) {
|
|
1141
|
+
return h.reduce(function(b, g) {
|
|
1142
|
+
const p = b.length - 1 >= 0 ? b[b.length - 1] : null;
|
|
1143
|
+
return p && p.mode === g.mode ? (b[b.length - 1].data += g.data, b) : (b.push(g), b);
|
|
1144
|
+
}, []);
|
|
1145
|
+
}
|
|
1146
|
+
function v(h) {
|
|
1147
|
+
const b = [];
|
|
1148
|
+
for (let g = 0; g < h.length; g++) {
|
|
1149
|
+
const p = h[g];
|
|
1150
|
+
switch (p.mode) {
|
|
1151
|
+
case e.NUMERIC:
|
|
1152
|
+
b.push([
|
|
1153
|
+
p,
|
|
1154
|
+
{ data: p.data, mode: e.ALPHANUMERIC, length: p.length },
|
|
1155
|
+
{ data: p.data, mode: e.BYTE, length: p.length }
|
|
1156
|
+
]);
|
|
1157
|
+
break;
|
|
1158
|
+
case e.ALPHANUMERIC:
|
|
1159
|
+
b.push([
|
|
1160
|
+
p,
|
|
1161
|
+
{ data: p.data, mode: e.BYTE, length: p.length }
|
|
1162
|
+
]);
|
|
1163
|
+
break;
|
|
1164
|
+
case e.KANJI:
|
|
1165
|
+
b.push([
|
|
1166
|
+
p,
|
|
1167
|
+
{ data: p.data, mode: e.BYTE, length: u(p.data) }
|
|
1168
|
+
]);
|
|
1169
|
+
break;
|
|
1170
|
+
case e.BYTE:
|
|
1171
|
+
b.push([
|
|
1172
|
+
{ data: p.data, mode: e.BYTE, length: u(p.data) }
|
|
1173
|
+
]);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return b;
|
|
1177
|
+
}
|
|
1178
|
+
function C(h, b) {
|
|
1179
|
+
const g = {}, p = { start: {} };
|
|
1180
|
+
let B = ["start"];
|
|
1181
|
+
for (let S = 0; S < h.length; S++) {
|
|
1182
|
+
const P = h[S], U = [];
|
|
1183
|
+
for (let V = 0; V < P.length; V++) {
|
|
1184
|
+
const F = P[V], E = "" + S + V;
|
|
1185
|
+
U.push(E), g[E] = { node: F, lastCount: 0 }, p[E] = {};
|
|
1186
|
+
for (let y = 0; y < B.length; y++) {
|
|
1187
|
+
const N = B[y];
|
|
1188
|
+
g[N] && g[N].node.mode === F.mode ? (p[N][E] = m(g[N].lastCount + F.length, F.mode) - m(g[N].lastCount, F.mode), g[N].lastCount += F.length) : (g[N] && (g[N].lastCount = F.length), p[N][E] = m(F.length, F.mode) + 4 + e.getCharCountIndicator(F.mode, b));
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
B = U;
|
|
1192
|
+
}
|
|
1193
|
+
for (let S = 0; S < B.length; S++)
|
|
1194
|
+
p[B[S]].end = 0;
|
|
1195
|
+
return { map: p, table: g };
|
|
1196
|
+
}
|
|
1197
|
+
function M(h, b) {
|
|
1198
|
+
let g;
|
|
1199
|
+
const p = e.getBestModeForData(h);
|
|
1200
|
+
if (g = e.from(b, p), g !== e.BYTE && g.bit < p.bit)
|
|
1201
|
+
throw new Error('"' + h + '" cannot be encoded with mode ' + e.toString(g) + `.
|
|
1202
|
+
Suggested mode is: ` + e.toString(p));
|
|
1203
|
+
switch (g === e.KANJI && !l.isKanjiModeEnabled() && (g = e.BYTE), g) {
|
|
1204
|
+
case e.NUMERIC:
|
|
1205
|
+
return new i(h);
|
|
1206
|
+
case e.ALPHANUMERIC:
|
|
1207
|
+
return new r(h);
|
|
1208
|
+
case e.KANJI:
|
|
1209
|
+
return new n(h);
|
|
1210
|
+
case e.BYTE:
|
|
1211
|
+
return new o(h);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
t.fromArray = function(b) {
|
|
1215
|
+
return b.reduce(function(g, p) {
|
|
1216
|
+
return typeof p == "string" ? g.push(M(p, null)) : p.data && g.push(M(p.data, p.mode)), g;
|
|
1217
|
+
}, []);
|
|
1218
|
+
}, t.fromString = function(b, g) {
|
|
1219
|
+
const p = A(b, l.isKanjiModeEnabled()), B = v(p), S = C(B, g), P = s.find_path(S.map, "start", "end"), U = [];
|
|
1220
|
+
for (let V = 1; V < P.length - 1; V++)
|
|
1221
|
+
U.push(S.table[P[V]].node);
|
|
1222
|
+
return t.fromArray(d(U));
|
|
1223
|
+
}, t.rawSplit = function(b) {
|
|
1224
|
+
return t.fromArray(
|
|
1225
|
+
A(b, l.isKanjiModeEnabled())
|
|
1226
|
+
);
|
|
1227
|
+
};
|
|
1228
|
+
})(ht);
|
|
1229
|
+
const be = L, _e = pe, an = Vt, ln = xt, cn = st, un = at, Ie = lt, Pe = ye, dn = zt, he = dt, fn = mt, mn = Y, Ee = ht;
|
|
1230
|
+
function gn(t, e) {
|
|
1231
|
+
const i = t.size, r = un.getPositions(e);
|
|
1232
|
+
for (let o = 0; o < r.length; o++) {
|
|
1233
|
+
const n = r[o][0], a = r[o][1];
|
|
1234
|
+
for (let l = -1; l <= 7; l++)
|
|
1235
|
+
if (!(n + l <= -1 || i <= n + l))
|
|
1236
|
+
for (let s = -1; s <= 7; s++)
|
|
1237
|
+
a + s <= -1 || i <= a + s || (l >= 0 && l <= 6 && (s === 0 || s === 6) || s >= 0 && s <= 6 && (l === 0 || l === 6) || l >= 2 && l <= 4 && s >= 2 && s <= 4 ? t.set(n + l, a + s, !0, !0) : t.set(n + l, a + s, !1, !0));
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
function hn(t) {
|
|
1241
|
+
const e = t.size;
|
|
1242
|
+
for (let i = 8; i < e - 8; i++) {
|
|
1243
|
+
const r = i % 2 === 0;
|
|
1244
|
+
t.set(i, 6, r, !0), t.set(6, i, r, !0);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
function pn(t, e) {
|
|
1248
|
+
const i = cn.getPositions(e);
|
|
1249
|
+
for (let r = 0; r < i.length; r++) {
|
|
1250
|
+
const o = i[r][0], n = i[r][1];
|
|
1251
|
+
for (let a = -2; a <= 2; a++)
|
|
1252
|
+
for (let l = -2; l <= 2; l++)
|
|
1253
|
+
a === -2 || a === 2 || l === -2 || l === 2 || a === 0 && l === 0 ? t.set(o + a, n + l, !0, !0) : t.set(o + a, n + l, !1, !0);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
function yn(t, e) {
|
|
1257
|
+
const i = t.size, r = he.getEncodedBits(e);
|
|
1258
|
+
let o, n, a;
|
|
1259
|
+
for (let l = 0; l < 18; l++)
|
|
1260
|
+
o = Math.floor(l / 3), n = l % 3 + i - 8 - 3, a = (r >> l & 1) === 1, t.set(o, n, a, !0), t.set(n, o, a, !0);
|
|
1261
|
+
}
|
|
1262
|
+
function Ae(t, e, i) {
|
|
1263
|
+
const r = t.size, o = fn.getEncodedBits(e, i);
|
|
1264
|
+
let n, a;
|
|
1265
|
+
for (n = 0; n < 15; n++)
|
|
1266
|
+
a = (o >> n & 1) === 1, n < 6 ? t.set(n, 8, a, !0) : n < 8 ? t.set(n + 1, 8, a, !0) : t.set(r - 15 + n, 8, a, !0), n < 8 ? t.set(8, r - n - 1, a, !0) : n < 9 ? t.set(8, 15 - n - 1 + 1, a, !0) : t.set(8, 15 - n - 1, a, !0);
|
|
1267
|
+
t.set(r - 8, 8, 1, !0);
|
|
1268
|
+
}
|
|
1269
|
+
function wn(t, e) {
|
|
1270
|
+
const i = t.size;
|
|
1271
|
+
let r = -1, o = i - 1, n = 7, a = 0;
|
|
1272
|
+
for (let l = i - 1; l > 0; l -= 2)
|
|
1273
|
+
for (l === 6 && l--; ; ) {
|
|
1274
|
+
for (let s = 0; s < 2; s++)
|
|
1275
|
+
if (!t.isReserved(o, l - s)) {
|
|
1276
|
+
let u = !1;
|
|
1277
|
+
a < e.length && (u = (e[a] >>> n & 1) === 1), t.set(o, l - s, u), n--, n === -1 && (a++, n = 7);
|
|
1278
|
+
}
|
|
1279
|
+
if (o += r, o < 0 || i <= o) {
|
|
1280
|
+
o -= r, r = -r;
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
function bn(t, e, i) {
|
|
1286
|
+
const r = new an();
|
|
1287
|
+
i.forEach(function(s) {
|
|
1288
|
+
r.put(s.mode.bit, 4), r.put(s.getLength(), mn.getCharCountIndicator(s.mode, t)), s.write(r);
|
|
1289
|
+
});
|
|
1290
|
+
const o = be.getSymbolTotalCodewords(t), n = Pe.getTotalCodewordsCount(t, e), a = (o - n) * 8;
|
|
1291
|
+
for (r.getLengthInBits() + 4 <= a && r.put(0, 4); r.getLengthInBits() % 8 !== 0; )
|
|
1292
|
+
r.putBit(0);
|
|
1293
|
+
const l = (a - r.getLengthInBits()) / 8;
|
|
1294
|
+
for (let s = 0; s < l; s++)
|
|
1295
|
+
r.put(s % 2 ? 17 : 236, 8);
|
|
1296
|
+
return vn(r, t, e);
|
|
1297
|
+
}
|
|
1298
|
+
function vn(t, e, i) {
|
|
1299
|
+
const r = be.getSymbolTotalCodewords(e), o = Pe.getTotalCodewordsCount(e, i), n = r - o, a = Pe.getBlocksCount(e, i), l = r % a, s = a - l, u = Math.floor(r / a), f = Math.floor(n / a), A = f + 1, m = u - f, d = new dn(m);
|
|
1300
|
+
let v = 0;
|
|
1301
|
+
const C = new Array(a), M = new Array(a);
|
|
1302
|
+
let h = 0;
|
|
1303
|
+
const b = new Uint8Array(t.buffer);
|
|
1304
|
+
for (let P = 0; P < a; P++) {
|
|
1305
|
+
const U = P < s ? f : A;
|
|
1306
|
+
C[P] = b.slice(v, v + U), M[P] = d.encode(C[P]), v += U, h = Math.max(h, U);
|
|
1307
|
+
}
|
|
1308
|
+
const g = new Uint8Array(r);
|
|
1309
|
+
let p = 0, B, S;
|
|
1310
|
+
for (B = 0; B < h; B++)
|
|
1311
|
+
for (S = 0; S < a; S++)
|
|
1312
|
+
B < C[S].length && (g[p++] = C[S][B]);
|
|
1313
|
+
for (B = 0; B < m; B++)
|
|
1314
|
+
for (S = 0; S < a; S++)
|
|
1315
|
+
g[p++] = M[S][B];
|
|
1316
|
+
return g;
|
|
1317
|
+
}
|
|
1318
|
+
function Cn(t, e, i, r) {
|
|
1319
|
+
let o;
|
|
1320
|
+
if (Array.isArray(t))
|
|
1321
|
+
o = Ee.fromArray(t);
|
|
1322
|
+
else if (typeof t == "string") {
|
|
1323
|
+
let u = e;
|
|
1324
|
+
if (!u) {
|
|
1325
|
+
const f = Ee.rawSplit(t);
|
|
1326
|
+
u = he.getBestVersionForData(f, i);
|
|
1327
|
+
}
|
|
1328
|
+
o = Ee.fromString(t, u || 40);
|
|
1329
|
+
} else
|
|
1330
|
+
throw new Error("Invalid data");
|
|
1331
|
+
const n = he.getBestVersionForData(o, i);
|
|
1332
|
+
if (!n)
|
|
1333
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
1334
|
+
if (!e)
|
|
1335
|
+
e = n;
|
|
1336
|
+
else if (e < n)
|
|
1337
|
+
throw new Error(
|
|
1338
|
+
`
|
|
1339
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
1340
|
+
Minimum version required to store current data is: ` + n + `.
|
|
1341
|
+
`
|
|
1342
|
+
);
|
|
1343
|
+
const a = bn(e, i, o), l = be.getSymbolSize(e), s = new ln(l);
|
|
1344
|
+
return gn(s, e), hn(s), pn(s, e), Ae(s, i, 0), e >= 7 && yn(s, e), wn(s, a), isNaN(r) && (r = Ie.getBestMask(
|
|
1345
|
+
s,
|
|
1346
|
+
Ae.bind(null, s, i)
|
|
1347
|
+
)), Ie.applyMask(r, s), Ae(s, i, r), {
|
|
1348
|
+
modules: s,
|
|
1349
|
+
version: e,
|
|
1350
|
+
errorCorrectionLevel: i,
|
|
1351
|
+
maskPattern: r,
|
|
1352
|
+
segments: o
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
rt.create = function(e, i) {
|
|
1356
|
+
if (typeof e > "u" || e === "")
|
|
1357
|
+
throw new Error("No input text");
|
|
1358
|
+
let r = _e.M, o, n;
|
|
1359
|
+
return typeof i < "u" && (r = _e.from(i.errorCorrectionLevel, _e.M), o = he.from(i.version), n = Ie.from(i.maskPattern), i.toSJISFunc && be.setToSJISFunction(i.toSJISFunc)), Cn(e, o, r, n);
|
|
1360
|
+
};
|
|
1361
|
+
var yt = {}, Fe = {};
|
|
1362
|
+
(function(t) {
|
|
1363
|
+
function e(i) {
|
|
1364
|
+
if (typeof i == "number" && (i = i.toString()), typeof i != "string")
|
|
1365
|
+
throw new Error("Color should be defined as hex string");
|
|
1366
|
+
let r = i.slice().replace("#", "").split("");
|
|
1367
|
+
if (r.length < 3 || r.length === 5 || r.length > 8)
|
|
1368
|
+
throw new Error("Invalid hex color: " + i);
|
|
1369
|
+
(r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(n) {
|
|
1370
|
+
return [n, n];
|
|
1371
|
+
}))), r.length === 6 && r.push("F", "F");
|
|
1372
|
+
const o = parseInt(r.join(""), 16);
|
|
1373
|
+
return {
|
|
1374
|
+
r: o >> 24 & 255,
|
|
1375
|
+
g: o >> 16 & 255,
|
|
1376
|
+
b: o >> 8 & 255,
|
|
1377
|
+
a: o & 255,
|
|
1378
|
+
hex: "#" + r.slice(0, 6).join("")
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
t.getOptions = function(r) {
|
|
1382
|
+
r || (r = {}), r.color || (r.color = {});
|
|
1383
|
+
const o = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, n = r.width && r.width >= 21 ? r.width : void 0, a = r.scale || 4;
|
|
1384
|
+
return {
|
|
1385
|
+
width: n,
|
|
1386
|
+
scale: n ? 4 : a,
|
|
1387
|
+
margin: o,
|
|
1388
|
+
color: {
|
|
1389
|
+
dark: e(r.color.dark || "#000000ff"),
|
|
1390
|
+
light: e(r.color.light || "#ffffffff")
|
|
1391
|
+
},
|
|
1392
|
+
type: r.type,
|
|
1393
|
+
rendererOpts: r.rendererOpts || {}
|
|
1394
|
+
};
|
|
1395
|
+
}, t.getScale = function(r, o) {
|
|
1396
|
+
return o.width && o.width >= r + o.margin * 2 ? o.width / (r + o.margin * 2) : o.scale;
|
|
1397
|
+
}, t.getImageWidth = function(r, o) {
|
|
1398
|
+
const n = t.getScale(r, o);
|
|
1399
|
+
return Math.floor((r + o.margin * 2) * n);
|
|
1400
|
+
}, t.qrToImageData = function(r, o, n) {
|
|
1401
|
+
const a = o.modules.size, l = o.modules.data, s = t.getScale(a, n), u = Math.floor((a + n.margin * 2) * s), f = n.margin * s, A = [n.color.light, n.color.dark];
|
|
1402
|
+
for (let m = 0; m < u; m++)
|
|
1403
|
+
for (let d = 0; d < u; d++) {
|
|
1404
|
+
let v = (m * u + d) * 4, C = n.color.light;
|
|
1405
|
+
if (m >= f && d >= f && m < u - f && d < u - f) {
|
|
1406
|
+
const M = Math.floor((m - f) / s), h = Math.floor((d - f) / s);
|
|
1407
|
+
C = A[l[M * a + h] ? 1 : 0];
|
|
1408
|
+
}
|
|
1409
|
+
r[v++] = C.r, r[v++] = C.g, r[v++] = C.b, r[v] = C.a;
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
})(Fe);
|
|
1413
|
+
(function(t) {
|
|
1414
|
+
const e = Fe;
|
|
1415
|
+
function i(o, n, a) {
|
|
1416
|
+
o.clearRect(0, 0, n.width, n.height), n.style || (n.style = {}), n.height = a, n.width = a, n.style.height = a + "px", n.style.width = a + "px";
|
|
1417
|
+
}
|
|
1418
|
+
function r() {
|
|
1419
|
+
try {
|
|
1420
|
+
return document.createElement("canvas");
|
|
1421
|
+
} catch {
|
|
1422
|
+
throw new Error("You need to specify a canvas element");
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
t.render = function(n, a, l) {
|
|
1426
|
+
let s = l, u = a;
|
|
1427
|
+
typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), a || (u = r()), s = e.getOptions(s);
|
|
1428
|
+
const f = e.getImageWidth(n.modules.size, s), A = u.getContext("2d"), m = A.createImageData(f, f);
|
|
1429
|
+
return e.qrToImageData(m.data, n, s), i(A, u, f), A.putImageData(m, 0, 0), u;
|
|
1430
|
+
}, t.renderToDataURL = function(n, a, l) {
|
|
1431
|
+
let s = l;
|
|
1432
|
+
typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), s || (s = {});
|
|
1433
|
+
const u = t.render(n, a, s), f = s.type || "image/png", A = s.rendererOpts || {};
|
|
1434
|
+
return u.toDataURL(f, A.quality);
|
|
1435
|
+
};
|
|
1436
|
+
})(yt);
|
|
1437
|
+
var wt = {};
|
|
1438
|
+
const _n = Fe;
|
|
1439
|
+
function Ge(t, e) {
|
|
1440
|
+
const i = t.a / 255, r = e + '="' + t.hex + '"';
|
|
1441
|
+
return i < 1 ? r + " " + e + '-opacity="' + i.toFixed(2).slice(1) + '"' : r;
|
|
1442
|
+
}
|
|
1443
|
+
function Be(t, e, i) {
|
|
1444
|
+
let r = t + e;
|
|
1445
|
+
return typeof i < "u" && (r += " " + i), r;
|
|
1446
|
+
}
|
|
1447
|
+
function En(t, e, i) {
|
|
1448
|
+
let r = "", o = 0, n = !1, a = 0;
|
|
1449
|
+
for (let l = 0; l < t.length; l++) {
|
|
1450
|
+
const s = Math.floor(l % e), u = Math.floor(l / e);
|
|
1451
|
+
!s && !n && (n = !0), t[l] ? (a++, l > 0 && s > 0 && t[l - 1] || (r += n ? Be("M", s + i, 0.5 + u + i) : Be("m", o, 0), o = 0, n = !1), s + 1 < e && t[l + 1] || (r += Be("h", a), a = 0)) : o++;
|
|
1452
|
+
}
|
|
1453
|
+
return r;
|
|
1454
|
+
}
|
|
1455
|
+
wt.render = function(e, i, r) {
|
|
1456
|
+
const o = _n.getOptions(i), n = e.modules.size, a = e.modules.data, l = n + o.margin * 2, s = o.color.light.a ? "<path " + Ge(o.color.light, "fill") + ' d="M0 0h' + l + "v" + l + 'H0z"/>' : "", u = "<path " + Ge(o.color.dark, "stroke") + ' d="' + En(a, n, o.margin) + '"/>', f = 'viewBox="0 0 ' + l + " " + l + '"', m = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + f + ' shape-rendering="crispEdges">' + s + u + `</svg>
|
|
1457
|
+
`;
|
|
1458
|
+
return typeof r == "function" && r(null, m), m;
|
|
1459
|
+
};
|
|
1460
|
+
const An = Dt, Te = rt, bt = yt, Bn = wt;
|
|
1461
|
+
function Re(t, e, i, r, o) {
|
|
1462
|
+
const n = [].slice.call(arguments, 1), a = n.length, l = typeof n[a - 1] == "function";
|
|
1463
|
+
if (!l && !An())
|
|
1464
|
+
throw new Error("Callback required as last argument");
|
|
1465
|
+
if (l) {
|
|
1466
|
+
if (a < 2)
|
|
1467
|
+
throw new Error("Too few arguments provided");
|
|
1468
|
+
a === 2 ? (o = i, i = e, e = r = void 0) : a === 3 && (e.getContext && typeof o > "u" ? (o = r, r = void 0) : (o = r, r = i, i = e, e = void 0));
|
|
1469
|
+
} else {
|
|
1470
|
+
if (a < 1)
|
|
1471
|
+
throw new Error("Too few arguments provided");
|
|
1472
|
+
return a === 1 ? (i = e, e = r = void 0) : a === 2 && !e.getContext && (r = i, i = e, e = void 0), new Promise(function(s, u) {
|
|
1473
|
+
try {
|
|
1474
|
+
const f = Te.create(i, r);
|
|
1475
|
+
s(t(f, e, r));
|
|
1476
|
+
} catch (f) {
|
|
1477
|
+
u(f);
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
try {
|
|
1482
|
+
const s = Te.create(i, r);
|
|
1483
|
+
o(null, t(s, e, r));
|
|
1484
|
+
} catch (s) {
|
|
1485
|
+
o(s);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
ie.create = Te.create;
|
|
1489
|
+
ie.toCanvas = Re.bind(null, bt.render);
|
|
1490
|
+
ie.toDataURL = Re.bind(null, bt.renderToDataURL);
|
|
1491
|
+
ie.toString = Re.bind(null, function(t, e, i) {
|
|
1492
|
+
return Bn.render(t, i);
|
|
1493
|
+
});
|
|
1494
|
+
async function Mn(t, e = 350) {
|
|
1495
|
+
try {
|
|
1496
|
+
return await ie.toDataURL(t, {
|
|
1497
|
+
width: e,
|
|
1498
|
+
margin: 0
|
|
1499
|
+
});
|
|
1500
|
+
} catch (i) {
|
|
1501
|
+
console.error(i);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
var Sn = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1505
|
+
const In = { class: "flex items-start" }, Pn = /* @__PURE__ */ w("div", null, [
|
|
1506
|
+
/* @__PURE__ */ w("div", { class: "fm-typo-en-title-sm-800" }, "Link device"),
|
|
1507
|
+
/* @__PURE__ */ w("div", { class: "fm-typo-en-body-sm-400" }, " Open your camera on your device to link counter app. ")
|
|
1508
|
+
], -1), Tn = { class: "flex flex-col gap-16 mt-16" }, Nn = ["src"], Un = /* @__PURE__ */ Xe({
|
|
1509
|
+
__name: "LinkDeviceDialog",
|
|
1510
|
+
setup(t) {
|
|
1511
|
+
const e = Me(), i = ot(), r = et(), o = H(), n = H(), a = Sn.crmUrl, l = H(), s = me(() => i.membership), u = me(() => {
|
|
1512
|
+
var m, d;
|
|
1513
|
+
return `https://${(m = s.value) != null && m.url ? s.value.url : (d = s.value) == null ? void 0 : d.business}.${a}`;
|
|
1514
|
+
});
|
|
1515
|
+
async function f(m) {
|
|
1516
|
+
const d = await nt.getOtp(m);
|
|
1517
|
+
return `${u.value}?link-device=${d.otp}`;
|
|
1518
|
+
}
|
|
1519
|
+
async function A(m) {
|
|
1520
|
+
const d = await f(m);
|
|
1521
|
+
l.value = d, o.value = await Mn(d);
|
|
1522
|
+
}
|
|
1523
|
+
return Ze(async () => {
|
|
1524
|
+
if (await e.readLocations(), !e.locations.length) {
|
|
1525
|
+
r.close();
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
|
+
const m = e.locations[0]._id;
|
|
1529
|
+
n.value = m, await A(m);
|
|
1530
|
+
}), (m, d) => {
|
|
1531
|
+
const v = R("FmIcon"), C = R("FmSelect"), M = R("FmButton"), h = R("FmCard");
|
|
1532
|
+
return x(), fe(h, { class: "p-24 max-w-[350px]" }, {
|
|
1533
|
+
default: te(() => [
|
|
1534
|
+
w("div", In, [
|
|
1535
|
+
Pn,
|
|
1536
|
+
I(v, {
|
|
1537
|
+
name: "close",
|
|
1538
|
+
onClick: d[0] || (d[0] = (b) => c(r).close()),
|
|
1539
|
+
class: "cursor-pointer"
|
|
1540
|
+
})
|
|
1541
|
+
]),
|
|
1542
|
+
w("div", Tn, [
|
|
1543
|
+
I(C, {
|
|
1544
|
+
modelValue: c(n),
|
|
1545
|
+
"onUpdate:modelValue": [
|
|
1546
|
+
d[1] || (d[1] = (b) => We(n) ? n.value = b : null),
|
|
1547
|
+
A
|
|
1548
|
+
],
|
|
1549
|
+
label: "Select Location",
|
|
1550
|
+
items: c(e).locationItems.filter((b) => !!b.value)
|
|
1551
|
+
}, null, 8, ["modelValue", "items"]),
|
|
1552
|
+
w("img", {
|
|
1553
|
+
src: c(o),
|
|
1554
|
+
class: "aspect-square w-full"
|
|
1555
|
+
}, null, 8, Nn),
|
|
1556
|
+
I(M, {
|
|
1557
|
+
class: "mx-auto",
|
|
1558
|
+
variant: "plain",
|
|
1559
|
+
icon: "content_copy",
|
|
1560
|
+
onClick: d[2] || (d[2] = (b) => c(tt)(c(l)))
|
|
1561
|
+
})
|
|
1562
|
+
])
|
|
1563
|
+
]),
|
|
1564
|
+
_: 1
|
|
1565
|
+
});
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
});
|
|
1569
|
+
var Qe = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1570
|
+
const Ln = { class: "hidden xs:flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, Fn = { class: "fm-typo-en-title-md-800" }, Rn = {
|
|
1571
|
+
key: 0,
|
|
1572
|
+
class: "px-24 gap-32 grid grid-cols-3 xs:pt-16"
|
|
1573
|
+
}, Dn = { class: "col-span-2 flex flex-col xs:col-span-3" }, kn = { class: "fm-typo-en-title-sm-800" }, Vn = { class: "space-y-24" }, xn = { class: "space-y-8" }, $n = { class: "fm-typo-en-title-sm-800" }, zn = { class: "fm-typo-body-lg-400" }, Hn = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, Kn = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, On = { class: "space-y-8" }, Yn = { class: "fm-typo-en-title-sm-800 flex items-center gap-8" }, jn = { class: "space-y-8" }, Jn = /* @__PURE__ */ w("div", { class: "fm-typo-en-title-sm-800" }, "SMS", -1), qn = { class: "space-y-8" }, Gn = /* @__PURE__ */ w("div", { class: "fm-typo-en-title-sm-800" }, "Email", -1), Qn = /* @__PURE__ */ w("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Email address that will be used to send email broadcast ", -1), Xn = { class: "space-y-8" }, Zn = /* @__PURE__ */ w("div", { class: "fm-typo-en-title-sm-800" }, [
|
|
1574
|
+
/* @__PURE__ */ ne(" Free Credit as Discount "),
|
|
1575
|
+
/* @__PURE__ */ w("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-error" }, "*POS v6.56 or above")
|
|
1576
|
+
], -1), Wn = { class: "space-y-8" }, eo = { class: "fm-typo-en-title-sm-800 flex items-center gap-8" }, to = { class: "space-y-8" }, no = /* @__PURE__ */ w("div", { class: "fm-typo-en-title-sm-800" }, "Activation Location", -1), oo = { class: "flex justify-end pb-24" }, ro = { class: "col-span-1 space-y-8 xs:hidden" }, io = /* @__PURE__ */ w("div", { class: "fm-typo-en-body-lg-600" }, "Loyalty setting summary", -1), so = /* @__PURE__ */ w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Name ", -1), ao = { class: "fm-typo-en-body-lg-600" }, lo = /* @__PURE__ */ w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Advertisement ", -1), co = { class: "fm-typo-en-body-lg-600" }, uo = /* @__PURE__ */ w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Free Credit as Discount ", -1), fo = { class: "fm-typo-en-body-lg-600" }, mo = /* @__PURE__ */ w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Activated locations ", -1), go = { class: "fm-typo-en-body-lg-600" }, Lo = /* @__PURE__ */ Xe({
|
|
1577
|
+
__name: "Setting",
|
|
1578
|
+
setup(t) {
|
|
1579
|
+
const e = Bt(), i = Ut(), r = Me(), o = ot(), { global: n, minor: a } = Et, l = et(), s = H(), u = H(!1), f = H([]), A = H(null), m = Mt, d = [
|
|
1580
|
+
(E) => !E || E.length >= 6 || "Invalid URL format, please enter at least 6 characters",
|
|
1581
|
+
(E) => !E || new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/).test(E) || "Invalid URL format, url should start with a letter or number and can only include lowercase letters, numbers, or hyphens"
|
|
1582
|
+
], v = Qe.appUrl, C = me(() => {
|
|
1583
|
+
var E;
|
|
1584
|
+
return `https://${(E = s.value) == null ? void 0 : E.business}.${v}`;
|
|
1585
|
+
}), M = H(), h = H([]), b = me(() => {
|
|
1586
|
+
var E, y;
|
|
1587
|
+
return Math.min((((y = (E = s.value) == null ? void 0 : E.advertisements) == null ? void 0 : y.length) ?? 0) + 1, 5);
|
|
1588
|
+
}), { t: g } = Nt(), p = i.currentCountry.value || "MY", B = [
|
|
1589
|
+
"user.name",
|
|
1590
|
+
"user.gender",
|
|
1591
|
+
"user.birthday",
|
|
1592
|
+
"user.phoneNumber",
|
|
1593
|
+
"membership.url"
|
|
1594
|
+
].filter(
|
|
1595
|
+
(E) => {
|
|
1596
|
+
var y;
|
|
1597
|
+
return !((y = Pt[p]) != null && y.includes(E));
|
|
1598
|
+
}
|
|
1599
|
+
);
|
|
1600
|
+
async function S() {
|
|
1601
|
+
l.open({
|
|
1602
|
+
title: "",
|
|
1603
|
+
dialogComponent: Un,
|
|
1604
|
+
closeButton: !1
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
async function P(E) {
|
|
1608
|
+
await At.remove(
|
|
1609
|
+
"Are you sure you want to unlink this device?",
|
|
1610
|
+
"Unlink device",
|
|
1611
|
+
"Unlink"
|
|
1612
|
+
) && await a(
|
|
1613
|
+
async () => {
|
|
1614
|
+
await nt.unregisterDevice(E), await r.readLocationDevices();
|
|
1615
|
+
},
|
|
1616
|
+
{
|
|
1617
|
+
message: "Unlinking device",
|
|
1618
|
+
successMessage: "Unlinked device successfully"
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
async function U() {
|
|
1623
|
+
await a(
|
|
1624
|
+
async () => {
|
|
1625
|
+
var N;
|
|
1626
|
+
const E = Rt(s.value);
|
|
1627
|
+
E.welcomeMessage && !((N = E.welcomeMessage) != null && N.content) && (E.welcomeMessage.content = "Hi there, you have been invited to join our membership");
|
|
1628
|
+
const y = St.parse(E);
|
|
1629
|
+
M.value === null && y.image ? await G.delete(G.coverImagePath()) : M.value && (y.image = await G.update(
|
|
1630
|
+
G.coverImagePath(),
|
|
1631
|
+
M.value
|
|
1632
|
+
)), u.value ? y.advertisements = (await Promise.all(
|
|
1633
|
+
new Array(b.value - 1).fill(null).map(async (z, K) => {
|
|
1634
|
+
var ee;
|
|
1635
|
+
const j = h.value[K];
|
|
1636
|
+
return j ? await G.update(
|
|
1637
|
+
G.advertisementPath(K, j),
|
|
1638
|
+
j
|
|
1639
|
+
) : (ee = y.advertisements) == null ? void 0 : ee[K];
|
|
1640
|
+
})
|
|
1641
|
+
)).filter((z) => z) : y.advertisements = [], await je.update(y), await o.readMembership(), s.value = o.membership;
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
message: "Updating membership",
|
|
1645
|
+
successMessage: "Membership updated successfully"
|
|
1646
|
+
}
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
async function V() {
|
|
1650
|
+
const E = await je.getEmailAddresses();
|
|
1651
|
+
console.log(E), f.value = E, A.value = E.find((y) => y.default.includes("Marketing"));
|
|
1652
|
+
}
|
|
1653
|
+
async function F() {
|
|
1654
|
+
window.open(
|
|
1655
|
+
`${Qe.licensePortalUrl}business/${Lt.businessId}/settings`,
|
|
1656
|
+
"_blank"
|
|
1657
|
+
);
|
|
1658
|
+
}
|
|
1659
|
+
return Ze(async () => {
|
|
1660
|
+
await n(async () => {
|
|
1661
|
+
var E, y;
|
|
1662
|
+
await r.readPremium(), await r.readLocations(), await r.readLocationDevices(), await o.readMembership(), await V(), s.value = o.membership, u.value = (((E = s.value.advertisements) == null ? void 0 : E.length) ?? 0) > 0, h.value = ((y = s.value.advertisements) == null ? void 0 : y.map(() => null)) ?? [];
|
|
1663
|
+
});
|
|
1664
|
+
}), (E, y) => {
|
|
1665
|
+
var De, ke, Ve, xe, $e, ze, He;
|
|
1666
|
+
const N = R("FmPageHead"), z = R("FmButton"), K = R("FmTextField"), j = R("FmCard"), ee = R("FmPill"), ve = R("FmSwitch"), vt = R("FmSelect"), Ct = R("FmMenuDivider");
|
|
1667
|
+
return x(), q(le, null, [
|
|
1668
|
+
I(N, {
|
|
1669
|
+
title: c(g)("connect.setting.title"),
|
|
1670
|
+
class: "xs:hidden"
|
|
1671
|
+
}, null, 8, ["title"]),
|
|
1672
|
+
w("div", Ln, [
|
|
1673
|
+
w("div", Fn, k(c(g)("connect.setting.basicInfo.title")), 1),
|
|
1674
|
+
I(z, {
|
|
1675
|
+
icon: "info",
|
|
1676
|
+
variant: "tertiary"
|
|
1677
|
+
})
|
|
1678
|
+
]),
|
|
1679
|
+
c(s) ? (x(), q("div", Rn, [
|
|
1680
|
+
w("div", Dn, [
|
|
1681
|
+
w("div", kn, k(c(g)("connect.setting.basicInfo.title")), 1),
|
|
1682
|
+
w("div", Vn, [
|
|
1683
|
+
I(K, {
|
|
1684
|
+
label: c(g)("connect.setting.basicInfo.membershipTitle"),
|
|
1685
|
+
modelValue: c(s).name,
|
|
1686
|
+
"onUpdate:modelValue": y[0] || (y[0] = (_) => c(s).name = _)
|
|
1687
|
+
}, null, 8, ["label", "modelValue"]),
|
|
1688
|
+
I(K, {
|
|
1689
|
+
disabled: !0,
|
|
1690
|
+
"model-value": c(s).business,
|
|
1691
|
+
rules: d,
|
|
1692
|
+
required: !0,
|
|
1693
|
+
label: c(g)("connect.setting.basicInfo.memberAppUrl"),
|
|
1694
|
+
"helper-text": c(C),
|
|
1695
|
+
placeholder: c(s).business.toString(),
|
|
1696
|
+
"onUpdate:modelValue": y[2] || (y[2] = (_) => c(s).url = _)
|
|
1697
|
+
}, {
|
|
1698
|
+
prepend: te(() => [
|
|
1699
|
+
ne(" https:// ")
|
|
1700
|
+
]),
|
|
1701
|
+
append: te(() => [
|
|
1702
|
+
ne(" ." + k(c(v)) + " ", 1),
|
|
1703
|
+
I(z, {
|
|
1704
|
+
icon: "content_copy",
|
|
1705
|
+
variant: "tertiary",
|
|
1706
|
+
onClick: y[1] || (y[1] = (_) => c(tt)(c(C)))
|
|
1707
|
+
})
|
|
1708
|
+
]),
|
|
1709
|
+
_: 1
|
|
1710
|
+
}, 8, ["model-value", "label", "helper-text", "placeholder"]),
|
|
1711
|
+
I(Ye, {
|
|
1712
|
+
label: "Cover image",
|
|
1713
|
+
class: "w-2/3 xs:w-full",
|
|
1714
|
+
"image-fit": "cover",
|
|
1715
|
+
"aspect-ratio": "3/1",
|
|
1716
|
+
thumbnail: c(s).image || void 0,
|
|
1717
|
+
"onUpdate:file": y[3] || (y[3] = async (_) => {
|
|
1718
|
+
M.value = _, _ || (c(s).image = null);
|
|
1719
|
+
})
|
|
1720
|
+
}, null, 8, ["thumbnail"]),
|
|
1721
|
+
w("div", xn, [
|
|
1722
|
+
w("div", $n, k(c(g)("connect.setting.counterApp.title")), 1),
|
|
1723
|
+
I(z, {
|
|
1724
|
+
variant: "plain",
|
|
1725
|
+
icon: "link",
|
|
1726
|
+
label: c(g)("connect.setting.counterApp.linkDevice"),
|
|
1727
|
+
onClick: S
|
|
1728
|
+
}, null, 8, ["label"]),
|
|
1729
|
+
(x(!0), q(le, null, Ke(c(r).locationDevices, (_, T) => (x(), fe(j, {
|
|
1730
|
+
key: T,
|
|
1731
|
+
variant: "outlined",
|
|
1732
|
+
class: "flex items-center justify-between px-16 py-12"
|
|
1733
|
+
}, {
|
|
1734
|
+
default: te(() => [
|
|
1735
|
+
w("div", null, [
|
|
1736
|
+
w("p", zn, k(_.name || `Device ${_._id}`), 1),
|
|
1737
|
+
w("p", Hn, " Activation date: " + k(c(_t)(c(Ft)(_._id.toString())).format(
|
|
1738
|
+
"D MMM YYYY"
|
|
1739
|
+
)), 1),
|
|
1740
|
+
w("p", Kn, " Linked location: " + k(c(r).locations.find((D) => D._id == _.location).name), 1)
|
|
1741
|
+
]),
|
|
1742
|
+
I(z, {
|
|
1743
|
+
icon: "link_off",
|
|
1744
|
+
variant: "tertiary",
|
|
1745
|
+
onClick: (D) => P(_._id)
|
|
1746
|
+
}, null, 8, ["onClick"])
|
|
1747
|
+
]),
|
|
1748
|
+
_: 2
|
|
1749
|
+
}, 1024))), 128))
|
|
1750
|
+
]),
|
|
1751
|
+
w("div", On, [
|
|
1752
|
+
w("div", Yn, [
|
|
1753
|
+
ne(" Advertisement "),
|
|
1754
|
+
I(ee, { variant: "premium" })
|
|
1755
|
+
]),
|
|
1756
|
+
I(ve, {
|
|
1757
|
+
modelValue: c(u),
|
|
1758
|
+
"onUpdate:modelValue": y[4] || (y[4] = (_) => We(u) ? u.value = _ : null),
|
|
1759
|
+
label: "Advertisement",
|
|
1760
|
+
sublabel: "This will be show on FeedMe ordering app",
|
|
1761
|
+
"label-placement": "right",
|
|
1762
|
+
disabled: !c(r).isPremium,
|
|
1763
|
+
value: ""
|
|
1764
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
1765
|
+
c(u) ? (x(), q("div", {
|
|
1766
|
+
class: "flex items-center gap-8 flex-wrap xs:grid xs:grid-cols-2 xs:overflow-x-scroll xs:w-full",
|
|
1767
|
+
key: c(b)
|
|
1768
|
+
}, [
|
|
1769
|
+
(x(!0), q(le, null, Ke(c(b), (_, T) => {
|
|
1770
|
+
var D, J;
|
|
1771
|
+
return x(), fe(Ye, {
|
|
1772
|
+
class: "w-[200px]",
|
|
1773
|
+
"image-fit": "cover",
|
|
1774
|
+
label: "",
|
|
1775
|
+
"aspect-ratio": "2/3",
|
|
1776
|
+
thumbnail: (J = (D = c(s)) == null ? void 0 : D.advertisements) == null ? void 0 : J[T],
|
|
1777
|
+
accept: ".png, .jpg, .jpeg, .mp4, .gif",
|
|
1778
|
+
"recommended-size": "Recommended 4:5 ratio / 1080px x 1350px",
|
|
1779
|
+
file: c(h)[T] ?? void 0,
|
|
1780
|
+
"onUpdate:file": (ae) => {
|
|
1781
|
+
c(s).advertisements || (c(s).advertisements = []), ae ? (c(s).advertisements[T] = "", c(h)[T] = ae) : (c(s).advertisements.splice(T, 1), c(h).splice(T, 1));
|
|
1782
|
+
}
|
|
1783
|
+
}, null, 8, ["thumbnail", "file", "onUpdate:file"]);
|
|
1784
|
+
}), 256))
|
|
1785
|
+
])) : ce("", !0)
|
|
1786
|
+
]),
|
|
1787
|
+
w("div", jn, [
|
|
1788
|
+
Jn,
|
|
1789
|
+
I(K, {
|
|
1790
|
+
"model-value": ((De = c(s)) == null ? void 0 : De.brand) || "",
|
|
1791
|
+
"max-length": 15,
|
|
1792
|
+
label: "Brand Name",
|
|
1793
|
+
"show-word-count": "",
|
|
1794
|
+
"helper-text": `RM 0 ${((ke = c(s)) == null ? void 0 : ke.brand) || ""}: YOUR CUSTOMER MESSAGE`,
|
|
1795
|
+
"onUpdate:modelValue": y[5] || (y[5] = (_) => c(s).brand = _)
|
|
1796
|
+
}, null, 8, ["model-value", "helper-text"]),
|
|
1797
|
+
I(Tt, {
|
|
1798
|
+
modelValue: c(s).welcomeMessage,
|
|
1799
|
+
"onUpdate:modelValue": y[6] || (y[6] = (_) => c(s).welcomeMessage = _),
|
|
1800
|
+
variables: c(B),
|
|
1801
|
+
placeholder: "Hi there, you have been invited to join membership"
|
|
1802
|
+
}, null, 8, ["modelValue", "variables"])
|
|
1803
|
+
]),
|
|
1804
|
+
w("div", qn, [
|
|
1805
|
+
Gn,
|
|
1806
|
+
Qn,
|
|
1807
|
+
c(f).length ? ce("", !0) : (x(), fe(z, {
|
|
1808
|
+
key: 0,
|
|
1809
|
+
onClick: F,
|
|
1810
|
+
label: "Add new email address"
|
|
1811
|
+
})),
|
|
1812
|
+
c(f).length ? (x(), q(le, { key: 1 }, [
|
|
1813
|
+
I(vt, {
|
|
1814
|
+
"model-value": ((xe = (Ve = c(s)) == null ? void 0 : Ve.email) == null ? void 0 : xe.from) || null,
|
|
1815
|
+
label: "From Address",
|
|
1816
|
+
items: c(f).map((_) => ({
|
|
1817
|
+
label: _.emailAddress,
|
|
1818
|
+
value: _.emailAddress
|
|
1819
|
+
})),
|
|
1820
|
+
placeholder: c(A) ? c(A).emailAddress : "No email address available",
|
|
1821
|
+
"onUpdate:modelValue": y[7] || (y[7] = (_) => {
|
|
1822
|
+
var T, D;
|
|
1823
|
+
(T = c(s)) != null && T.email || (c(s).email = {
|
|
1824
|
+
from: _,
|
|
1825
|
+
name: (D = c(f).find((J) => J.emailAddress == _)) == null ? void 0 : D.name
|
|
1826
|
+
}), c(s).email.from = _ || null;
|
|
1827
|
+
}),
|
|
1828
|
+
rules: [c(Oe).ruleAtPath(c(m), "email.from")]
|
|
1829
|
+
}, null, 8, ["model-value", "items", "placeholder", "rules"]),
|
|
1830
|
+
I(K, {
|
|
1831
|
+
"model-value": ((ze = ($e = c(s)) == null ? void 0 : $e.email) == null ? void 0 : ze.name) || null,
|
|
1832
|
+
label: "Sender name",
|
|
1833
|
+
disabled: "",
|
|
1834
|
+
placeholder: ((He = c(A)) == null ? void 0 : He.name) || null,
|
|
1835
|
+
"onUpdate:modelValue": y[8] || (y[8] = (_) => {
|
|
1836
|
+
var T;
|
|
1837
|
+
(T = c(s)) != null && T.email || (c(s).email = {
|
|
1838
|
+
name: _
|
|
1839
|
+
}), c(s).email.name = _ || null;
|
|
1840
|
+
}),
|
|
1841
|
+
rules: [c(Oe).ruleAtPath(c(m), "email.name")]
|
|
1842
|
+
}, null, 8, ["model-value", "placeholder", "rules"])
|
|
1843
|
+
], 64)) : ce("", !0)
|
|
1844
|
+
]),
|
|
1845
|
+
w("div", Xn, [
|
|
1846
|
+
Zn,
|
|
1847
|
+
I(ve, {
|
|
1848
|
+
"model-value": c(s).freeCreditAsDiscount ?? !1,
|
|
1849
|
+
"onUpdate:modelValue": y[9] || (y[9] = (_) => c(s).freeCreditAsDiscount = _),
|
|
1850
|
+
label: "Free Credit as Discount",
|
|
1851
|
+
sublabel: "When enabled, this will allow free credit to be used as discount in the bill (POS >=v6.56)",
|
|
1852
|
+
"label-placement": "right",
|
|
1853
|
+
value: ""
|
|
1854
|
+
}, null, 8, ["model-value"])
|
|
1855
|
+
]),
|
|
1856
|
+
w("div", Wn, [
|
|
1857
|
+
w("div", eo, [
|
|
1858
|
+
ne(" Member Card "),
|
|
1859
|
+
I(ee, { variant: "premium" })
|
|
1860
|
+
]),
|
|
1861
|
+
I(ve, {
|
|
1862
|
+
"model-value": c(s).cardEnable ?? !1,
|
|
1863
|
+
"onUpdate:modelValue": y[10] || (y[10] = (_) => c(s).cardEnable = _),
|
|
1864
|
+
label: "",
|
|
1865
|
+
sublabel: "Allow member to bind card via member app",
|
|
1866
|
+
"label-placement": "right",
|
|
1867
|
+
value: "",
|
|
1868
|
+
disabled: !c(r).isPremium
|
|
1869
|
+
}, null, 8, ["model-value", "disabled"])
|
|
1870
|
+
]),
|
|
1871
|
+
w("div", to, [
|
|
1872
|
+
no,
|
|
1873
|
+
I(It, {
|
|
1874
|
+
label: "Select restaurant",
|
|
1875
|
+
"model-value": c(s).targetLocation ?? null,
|
|
1876
|
+
"onUpdate:modelValue": y[11] || (y[11] = (_) => c(s).targetLocation = _)
|
|
1877
|
+
}, null, 8, ["model-value"])
|
|
1878
|
+
]),
|
|
1879
|
+
w("div", oo, [
|
|
1880
|
+
I(z, {
|
|
1881
|
+
label: "Update",
|
|
1882
|
+
type: "button",
|
|
1883
|
+
onClick: U,
|
|
1884
|
+
disabled: !!c(e).loadingQueue.length,
|
|
1885
|
+
loading: !!c(e).loadingQueue.length
|
|
1886
|
+
}, null, 8, ["disabled", "loading"])
|
|
1887
|
+
])
|
|
1888
|
+
])
|
|
1889
|
+
]),
|
|
1890
|
+
w("div", ro, [
|
|
1891
|
+
I(j, {
|
|
1892
|
+
variant: "outlined",
|
|
1893
|
+
class: "flex flex-col p-24 gap-8"
|
|
1894
|
+
}, {
|
|
1895
|
+
default: te(() => {
|
|
1896
|
+
var _, T, D;
|
|
1897
|
+
return [
|
|
1898
|
+
io,
|
|
1899
|
+
I(Ct, { class: "my-4" }),
|
|
1900
|
+
w("div", null, [
|
|
1901
|
+
so,
|
|
1902
|
+
w("div", ao, k(c(s).name), 1)
|
|
1903
|
+
]),
|
|
1904
|
+
w("div", null, [
|
|
1905
|
+
lo,
|
|
1906
|
+
w("div", co, k((((_ = c(s).advertisements) == null ? void 0 : _.length) ?? 0) || "No advertisments"), 1)
|
|
1907
|
+
]),
|
|
1908
|
+
w("div", null, [
|
|
1909
|
+
uo,
|
|
1910
|
+
w("div", fo, k(c(s).freeCreditAsDiscount ? "Enabled" : "Disabled"), 1)
|
|
1911
|
+
]),
|
|
1912
|
+
w("div", null, [
|
|
1913
|
+
mo,
|
|
1914
|
+
w("div", go, k(!c(s).targetLocation || c(s).targetLocation.length == c(Me)().locations.length ? "All locations" : (D = (T = c(s)) == null ? void 0 : T.targetLocation) == null ? void 0 : D.map(
|
|
1915
|
+
(J) => c(r).locations.find((ae) => ae._id == J).name
|
|
1916
|
+
).join(", ")), 1)
|
|
1917
|
+
])
|
|
1918
|
+
];
|
|
1919
|
+
}),
|
|
1920
|
+
_: 1
|
|
1921
|
+
})
|
|
1922
|
+
])
|
|
1923
|
+
])) : ce("", !0)
|
|
1924
|
+
], 64);
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
});
|
|
1928
|
+
export {
|
|
1929
|
+
Lo as default
|
|
1930
|
+
};
|