@incodetech/web 0.0.0-dev-20260409-a38d5e8 → 0.0.0-dev-20260409-09dfd52
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/{AsYouType-C-VEC826.js → AsYouType-RC03ULcj.js} +1 -1
- package/dist/{addressAutocomplete-BuldQv2L.js → addressAutocomplete-BELDwueU.js} +4 -4
- package/dist/antifraud/antifraud.es.js +3 -3
- package/dist/authentication/authentication.es.js +3 -3
- package/dist/button-Dt72Wn3U.js +24 -0
- package/dist/{checkbox-CCxy6DN4.js → checkbox-BcJjkRs3.js} +2 -2
- package/dist/consent/consent.es.js +13 -13
- package/dist/cross-document-data-match/cross-document-data-match.es.js +3 -3
- package/dist/curp-validation/curp-validation.es.js +37 -37
- package/dist/dateInputComposed-DU2hZfnf.js +2 -0
- package/dist/{dateInputComposed-DX7hO6l8.js → dateInputComposed-wl-LTsul.js} +4 -4
- package/dist/{documentCapture-CYW_KpEI.js → documentCapture-CrE9NA0-.js} +54 -54
- package/dist/{dropdownComposed-DbHLLS0N.js → dropdownComposed-C2cDpZSB.js} +3 -3
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/ekybModule-BQUyYqJO.js +2 -0
- package/dist/{ekybModule-BKCFm27J.js → ekybModule-tHnD9IyU.js} +19 -19
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekycModule-ByS2oj23.js +2 -0
- package/dist/{ekycModule-BVXMAI6j.js → ekycModule-Cc2l9FNN.js} +19 -19
- package/dist/email/email.es.js +11 -11
- package/dist/{extensibility-CGYf1tlJ.js → extensibility-Due2cIvN.js} +58 -58
- package/dist/extensibility.es.js +20 -20
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/{faceMatch-BMdxb9CE.js → faceMatch-8wF_NjAI.js} +11 -11
- package/dist/faceMatch-k9ZKksto.js +2 -0
- package/dist/flow/flow.es.js +269 -2134
- package/dist/{formField-BVEXt76v.js → formField-DRI6PubM.js} +13 -13
- package/dist/geolocation/geolocation.es.js +11 -11
- package/dist/governmentValidation/governmentValidation.es.js +9 -9
- package/dist/{i18n-CcMrDzmw.js → i18n-DGG1zc7t.js} +1 -1
- package/dist/{icons-CvPvuYCm.js → icons-CkLer5E1.js} +1 -1
- package/dist/id/id.es.js +6 -6
- package/dist/index.es.js +1 -1
- package/dist/inputComposed-C3Q-eQ1V.js +1 -0
- package/dist/{inputComposed-6ZSkf7Za.js → inputComposed-yULlZXg1.js} +3 -3
- package/dist/{loadingIcon-DEN5B0ju.js → loadingIcon-B3xEpDvA.js} +1 -1
- package/dist/{mandatoryConsent-DpejBjwV.js → mandatoryConsent-CWA8z4z-.js} +14 -14
- package/dist/{otpInput-DAwkcaQi.js → otpInput-2FjlqNe0.js} +4 -4
- package/dist/{page-B61t4D13.js → page-kB-LDkaO.js} +4 -4
- package/dist/phone/phone.es.js +11 -11
- package/dist/{phoneInput-BezqS95v.js → phoneInput-CYbUN3oz.js} +3 -3
- package/dist/{phoneInputComposed-DbSTCw_p.js → phoneInputComposed-CkL_nMPT.js} +6 -6
- package/dist/{processing-CD5TYh41.js → processing-BB9pxvN2.js} +2 -2
- package/dist/redirectToMobile-CYLzR4ck.js +2 -0
- package/dist/redirectToMobile-CxEfitZM.js +1545 -0
- package/dist/{richText-nIDjB47u.js → richText-C9m4iMuF.js} +1 -1
- package/dist/selfie/selfie.es.js +4 -4
- package/dist/{setup-CNelwOWO.js → setup-CATCmh3T.js} +1 -1
- package/dist/signature/signature.es.js +15 -15
- package/dist/{spinner-CBuVSVRP.js → spinner-4epdvlck.js} +3 -3
- package/dist/spinner-CbGt1yZr.js +1 -0
- package/dist/{tutorial-qFq58awW.js → tutorial-s3gx4OxF.js} +63 -63
- package/dist/types/workflow.d.ts +62 -0
- package/dist/{typography-PQSaYBgR.js → typography-R9HuMYSQ.js} +1 -1
- package/dist/typography-ePPfV-Xg.js +1 -0
- package/dist/useModuleLoader-Jq27P9t5.js +325 -0
- package/dist/{button-D85zGTiU.js → verifiedByIncode-CMPwRtA2.js} +32 -51
- package/dist/workflow/styles.css +6697 -0
- package/dist/workflow/workflow.es.js +219 -0
- package/package.json +9 -2
- package/dist/dateInputComposed-BaWm6bmT.js +0 -2
- package/dist/ekybModule-DviRZ6bj.js +0 -2
- package/dist/ekycModule-B8z7i5gA.js +0 -2
- package/dist/faceMatch-BRVU6adg.js +0 -2
- package/dist/inputComposed-C2QhOo1q.js +0 -1
- package/dist/spinner-BOBu0_7y.js +0 -1
- package/dist/typography-BveyW5lr.js +0 -1
- /package/dist/{aligndevicelottie-BESyjja3.js → aligndevicelottie-Dzk0EYVz.js} +0 -0
- /package/dist/{back-horizontal-hint-CalX75a7.js → back-horizontal-hint-BgG85hNR.js} +0 -0
- /package/dist/{back-tutorial-BQwJgaGG.js → back-tutorial-CJwYD2hu.js} +0 -0
- /package/dist/{back-vertical-hint-2SOVPN8l.js → back-vertical-hint-BhG7RS-O.js} +0 -0
- /package/dist/{backdevicelottie-D5kOlV31.js → backdevicelottie-TJ3pa5kD.js} +0 -0
- /package/dist/{blurdevicelottie-YEyIrlUI.js → blurdevicelottie-gPcFwLJO.js} +0 -0
- /package/dist/{browser-ponyfill-cMyrYa4p.js → browser-ponyfill-CYOHdF5Y.js} +0 -0
- /package/dist/{countries-BGpsb-UE.js → countries-DKKNtuUp.js} +0 -0
- /package/dist/{defineProperty-DSVcWjt2.js → defineProperty-eqPYf0qG.js} +0 -0
- /package/dist/{flip-animation-DbofaTty.js → flip-animation-ygeHr8Wk.js} +0 -0
- /package/dist/{front-horizontal-hint-DI3Uaq97.js → front-horizontal-hint-yIMvej7H.js} +0 -0
- /package/dist/{front-vertical-hint-Bc4LWUVG.js → front-vertical-hint-ZYgpMlDz.js} +0 -0
- /package/dist/{frontdevicelottie-BEk_Z_Up.js → frontdevicelottie-CJbKuefM.js} +0 -0
- /package/dist/{glaredevicelottie-COKmclSi.js → glaredevicelottie-DeGIxDRx.js} +0 -0
- /package/dist/{id-laser-h-CY76JXmk.js → id-laser-h-B7ddWmEe.js} +0 -0
- /package/dist/{id-laser-v-CyjBWjkL.js → id-laser-v-CI4GubjY.js} +0 -0
- /package/dist/{id-tutorial-Cqp9EUbW.js → id-tutorial-B1vsh6Wp.js} +0 -0
- /package/dist/{incodeModule-nXHV_p_Y.js → incodeModule-C3p8eAh_.js} +0 -0
- /package/dist/{numberedStep-a4kHo4t-.js → numberedStep-CoxrYWYg.js} +0 -0
- /package/dist/{passport-horizontal-hint-h_yTQfgD.js → passport-horizontal-hint-BLM_Rdz4.js} +0 -0
- /package/dist/{passport-tutorial-DNr-AgHL.js → passport-tutorial-DH7UEOHu.js} +0 -0
- /package/dist/{passport-vertical-hint-DzvJ1Cas.js → passport-vertical-hint-BVKS-R7d.js} +0 -0
- /package/dist/{selfieTutorial-6N-Fb6dA.js → selfieTutorial-BZFLHPco.js} +0 -0
- /package/dist/{successIcon-AHrfmJvv.js → successIcon-Dklx5JWI.js} +0 -0
- /package/dist/{warningIcon-Cvj-ayg1.js → warningIcon-Bv_pDQV-.js} +0 -0
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,1801 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import { resolveWasmConfig as te, warmupWasm as E } from "@incodetech/core/wasm";
|
|
16
|
-
import { createOrchestratedFlowManager as ne, getFlow as re, getRequiredWasmPipelines as D } from "@incodetech/core/flow";
|
|
17
|
-
import { createRedirectToMobileManager as ie } from "@incodetech/core/redirect-to-mobile";
|
|
18
|
-
import { api as O } from "@incodetech/core/http";
|
|
19
|
-
//#region src/shared/tabs/tabs.tsx
|
|
20
|
-
var k = f(null), A = () => {
|
|
21
|
-
let e = o(k);
|
|
22
|
-
if (!e) throw Error("Tabs compound components must be used within <Tabs>");
|
|
23
|
-
return e;
|
|
24
|
-
}, j = Object.assign(({ defaultValue: e, listClassName: t, triggerClassName: n, activeTriggerClassName: r, children: i }) => {
|
|
25
|
-
let [a, o] = u(e);
|
|
26
|
-
return /* @__PURE__ */ d(k.Provider, {
|
|
27
|
-
value: {
|
|
28
|
-
activeValue: a,
|
|
29
|
-
setActiveValue: o,
|
|
30
|
-
listClassName: t,
|
|
31
|
-
triggerClassName: n,
|
|
32
|
-
activeTriggerClassName: r
|
|
33
|
-
},
|
|
34
|
-
children: i
|
|
35
|
-
});
|
|
36
|
-
}, {
|
|
37
|
-
List: ({ children: e }) => {
|
|
38
|
-
let { listClassName: t } = A();
|
|
39
|
-
return /* @__PURE__ */ d("div", {
|
|
40
|
-
class: t,
|
|
41
|
-
children: e
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
Trigger: ({ value: e, children: t }) => {
|
|
45
|
-
let { activeValue: n, setActiveValue: r, triggerClassName: i, activeTriggerClassName: a } = A();
|
|
46
|
-
return /* @__PURE__ */ d("button", {
|
|
47
|
-
type: "button",
|
|
48
|
-
class: g(i, n === e && a),
|
|
49
|
-
onClick: () => r(e),
|
|
50
|
-
children: t
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
Content: ({ value: e, children: t }) => {
|
|
54
|
-
let { activeValue: n } = A();
|
|
55
|
-
return n === e ? /* @__PURE__ */ d(r, { children: t }) : null;
|
|
56
|
-
}
|
|
57
|
-
}), ae = ({ logoSrc: e }) => {
|
|
58
|
-
let { t: n } = t();
|
|
59
|
-
return /* @__PURE__ */ d("header", {
|
|
60
|
-
class: "IncodeRedirectHeader",
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ d("div", {
|
|
63
|
-
class: "IncodeRedirectLogoWrapper",
|
|
64
|
-
children: /* @__PURE__ */ d("img", {
|
|
65
|
-
src: e,
|
|
66
|
-
alt: "Logo",
|
|
67
|
-
class: "IncodeRedirectLogo"
|
|
68
|
-
})
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ d(v, { size: 24 }),
|
|
71
|
-
/* @__PURE__ */ d("h1", {
|
|
72
|
-
class: "IncodeRedirectTitle",
|
|
73
|
-
children: n("v2.redirectToMobile.title")
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ d(v, { size: 12 }),
|
|
76
|
-
/* @__PURE__ */ d("p", {
|
|
77
|
-
class: "IncodeRedirectSubtitle",
|
|
78
|
-
children: n("v2.redirectToMobile.subtitle")
|
|
79
|
-
})
|
|
80
|
-
]
|
|
81
|
-
});
|
|
82
|
-
}, oe = ({ addContinueToDesktop: e, onContinueOnDesktop: n }) => {
|
|
83
|
-
let { t: r } = t();
|
|
84
|
-
return /* @__PURE__ */ d("footer", {
|
|
85
|
-
class: "IncodeRedirectBottomNav",
|
|
86
|
-
children: [e ? /* @__PURE__ */ d(S, {
|
|
87
|
-
variant: "link",
|
|
88
|
-
onClick: n,
|
|
89
|
-
children: r("redirect.continueOnDesktop")
|
|
90
|
-
}) : null, /* @__PURE__ */ d(b, {})]
|
|
91
|
-
});
|
|
92
|
-
}, se = ({ visible: e }) => {
|
|
93
|
-
let { t: n } = t();
|
|
94
|
-
return e ? /* @__PURE__ */ d("div", {
|
|
95
|
-
class: "IncodeRedirectToast",
|
|
96
|
-
children: [/* @__PURE__ */ d(w, { size: 24 }), /* @__PURE__ */ d("span", {
|
|
97
|
-
class: "IncodeRedirectToastText",
|
|
98
|
-
children: n("redirect.linkResent")
|
|
99
|
-
})]
|
|
100
|
-
}) : null;
|
|
101
|
-
}, ce = /* @__PURE__ */ e(((e, t) => {
|
|
102
|
-
t.exports = function() {
|
|
103
|
-
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
104
|
-
};
|
|
105
|
-
})), M = /* @__PURE__ */ e(((e) => {
|
|
106
|
-
var t, n = [
|
|
107
|
-
0,
|
|
108
|
-
26,
|
|
109
|
-
44,
|
|
110
|
-
70,
|
|
111
|
-
100,
|
|
112
|
-
134,
|
|
113
|
-
172,
|
|
114
|
-
196,
|
|
115
|
-
242,
|
|
116
|
-
292,
|
|
117
|
-
346,
|
|
118
|
-
404,
|
|
119
|
-
466,
|
|
120
|
-
532,
|
|
121
|
-
581,
|
|
122
|
-
655,
|
|
123
|
-
733,
|
|
124
|
-
815,
|
|
125
|
-
901,
|
|
126
|
-
991,
|
|
127
|
-
1085,
|
|
128
|
-
1156,
|
|
129
|
-
1258,
|
|
130
|
-
1364,
|
|
131
|
-
1474,
|
|
132
|
-
1588,
|
|
133
|
-
1706,
|
|
134
|
-
1828,
|
|
135
|
-
1921,
|
|
136
|
-
2051,
|
|
137
|
-
2185,
|
|
138
|
-
2323,
|
|
139
|
-
2465,
|
|
140
|
-
2611,
|
|
141
|
-
2761,
|
|
142
|
-
2876,
|
|
143
|
-
3034,
|
|
144
|
-
3196,
|
|
145
|
-
3362,
|
|
146
|
-
3532,
|
|
147
|
-
3706
|
|
148
|
-
];
|
|
149
|
-
e.getSymbolSize = function(e) {
|
|
150
|
-
if (!e) throw Error("\"version\" cannot be null or undefined");
|
|
151
|
-
if (e < 1 || e > 40) throw Error("\"version\" should be in range from 1 to 40");
|
|
152
|
-
return e * 4 + 17;
|
|
153
|
-
}, e.getSymbolTotalCodewords = function(e) {
|
|
154
|
-
return n[e];
|
|
155
|
-
}, e.getBCHDigit = function(e) {
|
|
156
|
-
let t = 0;
|
|
157
|
-
for (; e !== 0;) t++, e >>>= 1;
|
|
158
|
-
return t;
|
|
159
|
-
}, e.setToSJISFunction = function(e) {
|
|
160
|
-
if (typeof e != "function") throw Error("\"toSJISFunc\" is not a valid function.");
|
|
161
|
-
t = e;
|
|
162
|
-
}, e.isKanjiModeEnabled = function() {
|
|
163
|
-
return t !== void 0;
|
|
164
|
-
}, e.toSJIS = function(e) {
|
|
165
|
-
return t(e);
|
|
166
|
-
};
|
|
167
|
-
})), N = /* @__PURE__ */ e(((e) => {
|
|
168
|
-
e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
|
|
169
|
-
function t(t) {
|
|
170
|
-
if (typeof t != "string") throw Error("Param is not a string");
|
|
171
|
-
switch (t.toLowerCase()) {
|
|
172
|
-
case "l":
|
|
173
|
-
case "low": return e.L;
|
|
174
|
-
case "m":
|
|
175
|
-
case "medium": return e.M;
|
|
176
|
-
case "q":
|
|
177
|
-
case "quartile": return e.Q;
|
|
178
|
-
case "h":
|
|
179
|
-
case "high": return e.H;
|
|
180
|
-
default: throw Error("Unknown EC Level: " + t);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
e.isValid = function(e) {
|
|
184
|
-
return e && e.bit !== void 0 && e.bit >= 0 && e.bit < 4;
|
|
185
|
-
}, e.from = function(n, r) {
|
|
186
|
-
if (e.isValid(n)) return n;
|
|
187
|
-
try {
|
|
188
|
-
return t(n);
|
|
189
|
-
} catch {
|
|
190
|
-
return r;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
})), le = /* @__PURE__ */ e(((e, t) => {
|
|
194
|
-
function n() {
|
|
195
|
-
this.buffer = [], this.length = 0;
|
|
196
|
-
}
|
|
197
|
-
n.prototype = {
|
|
198
|
-
get: function(e) {
|
|
199
|
-
let t = Math.floor(e / 8);
|
|
200
|
-
return (this.buffer[t] >>> 7 - e % 8 & 1) == 1;
|
|
201
|
-
},
|
|
202
|
-
put: function(e, t) {
|
|
203
|
-
for (let n = 0; n < t; n++) this.putBit((e >>> t - n - 1 & 1) == 1);
|
|
204
|
-
},
|
|
205
|
-
getLengthInBits: function() {
|
|
206
|
-
return this.length;
|
|
207
|
-
},
|
|
208
|
-
putBit: function(e) {
|
|
209
|
-
let t = Math.floor(this.length / 8);
|
|
210
|
-
this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
|
|
211
|
-
}
|
|
212
|
-
}, t.exports = n;
|
|
213
|
-
})), ue = /* @__PURE__ */ e(((e, t) => {
|
|
214
|
-
function n(e) {
|
|
215
|
-
if (!e || e < 1) throw Error("BitMatrix size must be defined and greater than 0");
|
|
216
|
-
this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e);
|
|
217
|
-
}
|
|
218
|
-
n.prototype.set = function(e, t, n, r) {
|
|
219
|
-
let i = e * this.size + t;
|
|
220
|
-
this.data[i] = n, r && (this.reservedBit[i] = !0);
|
|
221
|
-
}, n.prototype.get = function(e, t) {
|
|
222
|
-
return this.data[e * this.size + t];
|
|
223
|
-
}, n.prototype.xor = function(e, t, n) {
|
|
224
|
-
this.data[e * this.size + t] ^= n;
|
|
225
|
-
}, n.prototype.isReserved = function(e, t) {
|
|
226
|
-
return this.reservedBit[e * this.size + t];
|
|
227
|
-
}, t.exports = n;
|
|
228
|
-
})), de = /* @__PURE__ */ e(((e) => {
|
|
229
|
-
var t = M().getSymbolSize;
|
|
230
|
-
e.getRowColCoords = function(e) {
|
|
231
|
-
if (e === 1) return [];
|
|
232
|
-
let n = Math.floor(e / 7) + 2, r = t(e), i = r === 145 ? 26 : Math.ceil((r - 13) / (2 * n - 2)) * 2, a = [r - 7];
|
|
233
|
-
for (let e = 1; e < n - 1; e++) a[e] = a[e - 1] - i;
|
|
234
|
-
return a.push(6), a.reverse();
|
|
235
|
-
}, e.getPositions = function(t) {
|
|
236
|
-
let n = [], r = e.getRowColCoords(t), i = r.length;
|
|
237
|
-
for (let e = 0; e < i; e++) for (let t = 0; t < i; t++) e === 0 && t === 0 || e === 0 && t === i - 1 || e === i - 1 && t === 0 || n.push([r[e], r[t]]);
|
|
238
|
-
return n;
|
|
239
|
-
};
|
|
240
|
-
})), fe = /* @__PURE__ */ e(((e) => {
|
|
241
|
-
var t = M().getSymbolSize, n = 7;
|
|
242
|
-
e.getPositions = function(e) {
|
|
243
|
-
let r = t(e);
|
|
244
|
-
return [
|
|
245
|
-
[0, 0],
|
|
246
|
-
[r - n, 0],
|
|
247
|
-
[0, r - n]
|
|
248
|
-
];
|
|
249
|
-
};
|
|
250
|
-
})), pe = /* @__PURE__ */ e(((e) => {
|
|
251
|
-
e.Patterns = {
|
|
252
|
-
PATTERN000: 0,
|
|
253
|
-
PATTERN001: 1,
|
|
254
|
-
PATTERN010: 2,
|
|
255
|
-
PATTERN011: 3,
|
|
256
|
-
PATTERN100: 4,
|
|
257
|
-
PATTERN101: 5,
|
|
258
|
-
PATTERN110: 6,
|
|
259
|
-
PATTERN111: 7
|
|
260
|
-
};
|
|
261
|
-
var t = {
|
|
262
|
-
N1: 3,
|
|
263
|
-
N2: 3,
|
|
264
|
-
N3: 40,
|
|
265
|
-
N4: 10
|
|
266
|
-
};
|
|
267
|
-
e.isValid = function(e) {
|
|
268
|
-
return e != null && e !== "" && !isNaN(e) && e >= 0 && e <= 7;
|
|
269
|
-
}, e.from = function(t) {
|
|
270
|
-
return e.isValid(t) ? parseInt(t, 10) : void 0;
|
|
271
|
-
}, e.getPenaltyN1 = function(e) {
|
|
272
|
-
let n = e.size, r = 0, i = 0, a = 0, o = null, s = null;
|
|
273
|
-
for (let c = 0; c < n; c++) {
|
|
274
|
-
i = a = 0, o = s = null;
|
|
275
|
-
for (let l = 0; l < n; l++) {
|
|
276
|
-
let n = e.get(c, l);
|
|
277
|
-
n === o ? i++ : (i >= 5 && (r += t.N1 + (i - 5)), o = n, i = 1), n = e.get(l, c), n === s ? a++ : (a >= 5 && (r += t.N1 + (a - 5)), s = n, a = 1);
|
|
278
|
-
}
|
|
279
|
-
i >= 5 && (r += t.N1 + (i - 5)), a >= 5 && (r += t.N1 + (a - 5));
|
|
280
|
-
}
|
|
281
|
-
return r;
|
|
282
|
-
}, e.getPenaltyN2 = function(e) {
|
|
283
|
-
let n = e.size, r = 0;
|
|
284
|
-
for (let t = 0; t < n - 1; t++) for (let i = 0; i < n - 1; i++) {
|
|
285
|
-
let n = e.get(t, i) + e.get(t, i + 1) + e.get(t + 1, i) + e.get(t + 1, i + 1);
|
|
286
|
-
(n === 4 || n === 0) && r++;
|
|
287
|
-
}
|
|
288
|
-
return r * t.N2;
|
|
289
|
-
}, e.getPenaltyN3 = function(e) {
|
|
290
|
-
let n = e.size, r = 0, i = 0, a = 0;
|
|
291
|
-
for (let t = 0; t < n; t++) {
|
|
292
|
-
i = a = 0;
|
|
293
|
-
for (let o = 0; o < n; o++) i = i << 1 & 2047 | e.get(t, o), o >= 10 && (i === 1488 || i === 93) && r++, a = a << 1 & 2047 | e.get(o, t), o >= 10 && (a === 1488 || a === 93) && r++;
|
|
294
|
-
}
|
|
295
|
-
return r * t.N3;
|
|
296
|
-
}, e.getPenaltyN4 = function(e) {
|
|
297
|
-
let n = 0, r = e.data.length;
|
|
298
|
-
for (let t = 0; t < r; t++) n += e.data[t];
|
|
299
|
-
return Math.abs(Math.ceil(n * 100 / r / 5) - 10) * t.N4;
|
|
300
|
-
};
|
|
301
|
-
function n(t, n, r) {
|
|
302
|
-
switch (t) {
|
|
303
|
-
case e.Patterns.PATTERN000: return (n + r) % 2 == 0;
|
|
304
|
-
case e.Patterns.PATTERN001: return n % 2 == 0;
|
|
305
|
-
case e.Patterns.PATTERN010: return r % 3 == 0;
|
|
306
|
-
case e.Patterns.PATTERN011: return (n + r) % 3 == 0;
|
|
307
|
-
case e.Patterns.PATTERN100: return (Math.floor(n / 2) + Math.floor(r / 3)) % 2 == 0;
|
|
308
|
-
case e.Patterns.PATTERN101: return n * r % 2 + n * r % 3 == 0;
|
|
309
|
-
case e.Patterns.PATTERN110: return (n * r % 2 + n * r % 3) % 2 == 0;
|
|
310
|
-
case e.Patterns.PATTERN111: return (n * r % 3 + (n + r) % 2) % 2 == 0;
|
|
311
|
-
default: throw Error("bad maskPattern:" + t);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
e.applyMask = function(e, t) {
|
|
315
|
-
let r = t.size;
|
|
316
|
-
for (let i = 0; i < r; i++) for (let a = 0; a < r; a++) t.isReserved(a, i) || t.xor(a, i, n(e, a, i));
|
|
317
|
-
}, e.getBestMask = function(t, n) {
|
|
318
|
-
let r = Object.keys(e.Patterns).length, i = 0, a = Infinity;
|
|
319
|
-
for (let o = 0; o < r; o++) {
|
|
320
|
-
n(o), e.applyMask(o, t);
|
|
321
|
-
let r = e.getPenaltyN1(t) + e.getPenaltyN2(t) + e.getPenaltyN3(t) + e.getPenaltyN4(t);
|
|
322
|
-
e.applyMask(o, t), r < a && (a = r, i = o);
|
|
323
|
-
}
|
|
324
|
-
return i;
|
|
325
|
-
};
|
|
326
|
-
})), P = /* @__PURE__ */ e(((e) => {
|
|
327
|
-
var t = N(), n = [
|
|
328
|
-
1,
|
|
329
|
-
1,
|
|
330
|
-
1,
|
|
331
|
-
1,
|
|
332
|
-
1,
|
|
333
|
-
1,
|
|
334
|
-
1,
|
|
335
|
-
1,
|
|
336
|
-
1,
|
|
337
|
-
1,
|
|
338
|
-
2,
|
|
339
|
-
2,
|
|
340
|
-
1,
|
|
341
|
-
2,
|
|
342
|
-
2,
|
|
343
|
-
4,
|
|
344
|
-
1,
|
|
345
|
-
2,
|
|
346
|
-
4,
|
|
347
|
-
4,
|
|
348
|
-
2,
|
|
349
|
-
4,
|
|
350
|
-
4,
|
|
351
|
-
4,
|
|
352
|
-
2,
|
|
353
|
-
4,
|
|
354
|
-
6,
|
|
355
|
-
5,
|
|
356
|
-
2,
|
|
357
|
-
4,
|
|
358
|
-
6,
|
|
359
|
-
6,
|
|
360
|
-
2,
|
|
361
|
-
5,
|
|
362
|
-
8,
|
|
363
|
-
8,
|
|
364
|
-
4,
|
|
365
|
-
5,
|
|
366
|
-
8,
|
|
367
|
-
8,
|
|
368
|
-
4,
|
|
369
|
-
5,
|
|
370
|
-
8,
|
|
371
|
-
11,
|
|
372
|
-
4,
|
|
373
|
-
8,
|
|
374
|
-
10,
|
|
375
|
-
11,
|
|
376
|
-
4,
|
|
377
|
-
9,
|
|
378
|
-
12,
|
|
379
|
-
16,
|
|
380
|
-
4,
|
|
381
|
-
9,
|
|
382
|
-
16,
|
|
383
|
-
16,
|
|
384
|
-
6,
|
|
385
|
-
10,
|
|
386
|
-
12,
|
|
387
|
-
18,
|
|
388
|
-
6,
|
|
389
|
-
10,
|
|
390
|
-
17,
|
|
391
|
-
16,
|
|
392
|
-
6,
|
|
393
|
-
11,
|
|
394
|
-
16,
|
|
395
|
-
19,
|
|
396
|
-
6,
|
|
397
|
-
13,
|
|
398
|
-
18,
|
|
399
|
-
21,
|
|
400
|
-
7,
|
|
401
|
-
14,
|
|
402
|
-
21,
|
|
403
|
-
25,
|
|
404
|
-
8,
|
|
405
|
-
16,
|
|
406
|
-
20,
|
|
407
|
-
25,
|
|
408
|
-
8,
|
|
409
|
-
17,
|
|
410
|
-
23,
|
|
411
|
-
25,
|
|
412
|
-
9,
|
|
413
|
-
17,
|
|
414
|
-
23,
|
|
415
|
-
34,
|
|
416
|
-
9,
|
|
417
|
-
18,
|
|
418
|
-
25,
|
|
419
|
-
30,
|
|
420
|
-
10,
|
|
421
|
-
20,
|
|
422
|
-
27,
|
|
423
|
-
32,
|
|
424
|
-
12,
|
|
425
|
-
21,
|
|
426
|
-
29,
|
|
427
|
-
35,
|
|
428
|
-
12,
|
|
429
|
-
23,
|
|
430
|
-
34,
|
|
431
|
-
37,
|
|
432
|
-
12,
|
|
433
|
-
25,
|
|
434
|
-
34,
|
|
435
|
-
40,
|
|
436
|
-
13,
|
|
437
|
-
26,
|
|
438
|
-
35,
|
|
439
|
-
42,
|
|
440
|
-
14,
|
|
441
|
-
28,
|
|
442
|
-
38,
|
|
443
|
-
45,
|
|
444
|
-
15,
|
|
445
|
-
29,
|
|
446
|
-
40,
|
|
447
|
-
48,
|
|
448
|
-
16,
|
|
449
|
-
31,
|
|
450
|
-
43,
|
|
451
|
-
51,
|
|
452
|
-
17,
|
|
453
|
-
33,
|
|
454
|
-
45,
|
|
455
|
-
54,
|
|
456
|
-
18,
|
|
457
|
-
35,
|
|
458
|
-
48,
|
|
459
|
-
57,
|
|
460
|
-
19,
|
|
461
|
-
37,
|
|
462
|
-
51,
|
|
463
|
-
60,
|
|
464
|
-
19,
|
|
465
|
-
38,
|
|
466
|
-
53,
|
|
467
|
-
63,
|
|
468
|
-
20,
|
|
469
|
-
40,
|
|
470
|
-
56,
|
|
471
|
-
66,
|
|
472
|
-
21,
|
|
473
|
-
43,
|
|
474
|
-
59,
|
|
475
|
-
70,
|
|
476
|
-
22,
|
|
477
|
-
45,
|
|
478
|
-
62,
|
|
479
|
-
74,
|
|
480
|
-
24,
|
|
481
|
-
47,
|
|
482
|
-
65,
|
|
483
|
-
77,
|
|
484
|
-
25,
|
|
485
|
-
49,
|
|
486
|
-
68,
|
|
487
|
-
81
|
|
488
|
-
], r = [
|
|
489
|
-
7,
|
|
490
|
-
10,
|
|
491
|
-
13,
|
|
492
|
-
17,
|
|
493
|
-
10,
|
|
494
|
-
16,
|
|
495
|
-
22,
|
|
496
|
-
28,
|
|
497
|
-
15,
|
|
498
|
-
26,
|
|
499
|
-
36,
|
|
500
|
-
44,
|
|
501
|
-
20,
|
|
502
|
-
36,
|
|
503
|
-
52,
|
|
504
|
-
64,
|
|
505
|
-
26,
|
|
506
|
-
48,
|
|
507
|
-
72,
|
|
508
|
-
88,
|
|
509
|
-
36,
|
|
510
|
-
64,
|
|
511
|
-
96,
|
|
512
|
-
112,
|
|
513
|
-
40,
|
|
514
|
-
72,
|
|
515
|
-
108,
|
|
516
|
-
130,
|
|
517
|
-
48,
|
|
518
|
-
88,
|
|
519
|
-
132,
|
|
520
|
-
156,
|
|
521
|
-
60,
|
|
522
|
-
110,
|
|
523
|
-
160,
|
|
524
|
-
192,
|
|
525
|
-
72,
|
|
526
|
-
130,
|
|
527
|
-
192,
|
|
528
|
-
224,
|
|
529
|
-
80,
|
|
530
|
-
150,
|
|
531
|
-
224,
|
|
532
|
-
264,
|
|
533
|
-
96,
|
|
534
|
-
176,
|
|
535
|
-
260,
|
|
536
|
-
308,
|
|
537
|
-
104,
|
|
538
|
-
198,
|
|
539
|
-
288,
|
|
540
|
-
352,
|
|
541
|
-
120,
|
|
542
|
-
216,
|
|
543
|
-
320,
|
|
544
|
-
384,
|
|
545
|
-
132,
|
|
546
|
-
240,
|
|
547
|
-
360,
|
|
548
|
-
432,
|
|
549
|
-
144,
|
|
550
|
-
280,
|
|
551
|
-
408,
|
|
552
|
-
480,
|
|
553
|
-
168,
|
|
554
|
-
308,
|
|
555
|
-
448,
|
|
556
|
-
532,
|
|
557
|
-
180,
|
|
558
|
-
338,
|
|
559
|
-
504,
|
|
560
|
-
588,
|
|
561
|
-
196,
|
|
562
|
-
364,
|
|
563
|
-
546,
|
|
564
|
-
650,
|
|
565
|
-
224,
|
|
566
|
-
416,
|
|
567
|
-
600,
|
|
568
|
-
700,
|
|
569
|
-
224,
|
|
570
|
-
442,
|
|
571
|
-
644,
|
|
572
|
-
750,
|
|
573
|
-
252,
|
|
574
|
-
476,
|
|
575
|
-
690,
|
|
576
|
-
816,
|
|
577
|
-
270,
|
|
578
|
-
504,
|
|
579
|
-
750,
|
|
580
|
-
900,
|
|
581
|
-
300,
|
|
582
|
-
560,
|
|
583
|
-
810,
|
|
584
|
-
960,
|
|
585
|
-
312,
|
|
586
|
-
588,
|
|
587
|
-
870,
|
|
588
|
-
1050,
|
|
589
|
-
336,
|
|
590
|
-
644,
|
|
591
|
-
952,
|
|
592
|
-
1110,
|
|
593
|
-
360,
|
|
594
|
-
700,
|
|
595
|
-
1020,
|
|
596
|
-
1200,
|
|
597
|
-
390,
|
|
598
|
-
728,
|
|
599
|
-
1050,
|
|
600
|
-
1260,
|
|
601
|
-
420,
|
|
602
|
-
784,
|
|
603
|
-
1140,
|
|
604
|
-
1350,
|
|
605
|
-
450,
|
|
606
|
-
812,
|
|
607
|
-
1200,
|
|
608
|
-
1440,
|
|
609
|
-
480,
|
|
610
|
-
868,
|
|
611
|
-
1290,
|
|
612
|
-
1530,
|
|
613
|
-
510,
|
|
614
|
-
924,
|
|
615
|
-
1350,
|
|
616
|
-
1620,
|
|
617
|
-
540,
|
|
618
|
-
980,
|
|
619
|
-
1440,
|
|
620
|
-
1710,
|
|
621
|
-
570,
|
|
622
|
-
1036,
|
|
623
|
-
1530,
|
|
624
|
-
1800,
|
|
625
|
-
570,
|
|
626
|
-
1064,
|
|
627
|
-
1590,
|
|
628
|
-
1890,
|
|
629
|
-
600,
|
|
630
|
-
1120,
|
|
631
|
-
1680,
|
|
632
|
-
1980,
|
|
633
|
-
630,
|
|
634
|
-
1204,
|
|
635
|
-
1770,
|
|
636
|
-
2100,
|
|
637
|
-
660,
|
|
638
|
-
1260,
|
|
639
|
-
1860,
|
|
640
|
-
2220,
|
|
641
|
-
720,
|
|
642
|
-
1316,
|
|
643
|
-
1950,
|
|
644
|
-
2310,
|
|
645
|
-
750,
|
|
646
|
-
1372,
|
|
647
|
-
2040,
|
|
648
|
-
2430
|
|
649
|
-
];
|
|
650
|
-
e.getBlocksCount = function(e, r) {
|
|
651
|
-
switch (r) {
|
|
652
|
-
case t.L: return n[(e - 1) * 4 + 0];
|
|
653
|
-
case t.M: return n[(e - 1) * 4 + 1];
|
|
654
|
-
case t.Q: return n[(e - 1) * 4 + 2];
|
|
655
|
-
case t.H: return n[(e - 1) * 4 + 3];
|
|
656
|
-
default: return;
|
|
657
|
-
}
|
|
658
|
-
}, e.getTotalCodewordsCount = function(e, n) {
|
|
659
|
-
switch (n) {
|
|
660
|
-
case t.L: return r[(e - 1) * 4 + 0];
|
|
661
|
-
case t.M: return r[(e - 1) * 4 + 1];
|
|
662
|
-
case t.Q: return r[(e - 1) * 4 + 2];
|
|
663
|
-
case t.H: return r[(e - 1) * 4 + 3];
|
|
664
|
-
default: return;
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
})), me = /* @__PURE__ */ e(((e) => {
|
|
668
|
-
var t = new Uint8Array(512), n = new Uint8Array(256);
|
|
669
|
-
(function() {
|
|
670
|
-
let e = 1;
|
|
671
|
-
for (let r = 0; r < 255; r++) t[r] = e, n[e] = r, e <<= 1, e & 256 && (e ^= 285);
|
|
672
|
-
for (let e = 255; e < 512; e++) t[e] = t[e - 255];
|
|
673
|
-
})(), e.log = function(e) {
|
|
674
|
-
if (e < 1) throw Error("log(" + e + ")");
|
|
675
|
-
return n[e];
|
|
676
|
-
}, e.exp = function(e) {
|
|
677
|
-
return t[e];
|
|
678
|
-
}, e.mul = function(e, r) {
|
|
679
|
-
return e === 0 || r === 0 ? 0 : t[n[e] + n[r]];
|
|
680
|
-
};
|
|
681
|
-
})), he = /* @__PURE__ */ e(((e) => {
|
|
682
|
-
var t = me();
|
|
683
|
-
e.mul = function(e, n) {
|
|
684
|
-
let r = new Uint8Array(e.length + n.length - 1);
|
|
685
|
-
for (let i = 0; i < e.length; i++) for (let a = 0; a < n.length; a++) r[i + a] ^= t.mul(e[i], n[a]);
|
|
686
|
-
return r;
|
|
687
|
-
}, e.mod = function(e, n) {
|
|
688
|
-
let r = new Uint8Array(e);
|
|
689
|
-
for (; r.length - n.length >= 0;) {
|
|
690
|
-
let e = r[0];
|
|
691
|
-
for (let i = 0; i < n.length; i++) r[i] ^= t.mul(n[i], e);
|
|
692
|
-
let i = 0;
|
|
693
|
-
for (; i < r.length && r[i] === 0;) i++;
|
|
694
|
-
r = r.slice(i);
|
|
695
|
-
}
|
|
696
|
-
return r;
|
|
697
|
-
}, e.generateECPolynomial = function(n) {
|
|
698
|
-
let r = new Uint8Array([1]);
|
|
699
|
-
for (let i = 0; i < n; i++) r = e.mul(r, new Uint8Array([1, t.exp(i)]));
|
|
700
|
-
return r;
|
|
701
|
-
};
|
|
702
|
-
})), ge = /* @__PURE__ */ e(((e, t) => {
|
|
703
|
-
var n = he();
|
|
704
|
-
function r(e) {
|
|
705
|
-
this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
|
|
706
|
-
}
|
|
707
|
-
r.prototype.initialize = function(e) {
|
|
708
|
-
this.degree = e, this.genPoly = n.generateECPolynomial(this.degree);
|
|
709
|
-
}, r.prototype.encode = function(e) {
|
|
710
|
-
if (!this.genPoly) throw Error("Encoder not initialized");
|
|
711
|
-
let t = new Uint8Array(e.length + this.degree);
|
|
712
|
-
t.set(e);
|
|
713
|
-
let r = n.mod(t, this.genPoly), i = this.degree - r.length;
|
|
714
|
-
if (i > 0) {
|
|
715
|
-
let e = new Uint8Array(this.degree);
|
|
716
|
-
return e.set(r, i), e;
|
|
717
|
-
}
|
|
718
|
-
return r;
|
|
719
|
-
}, t.exports = r;
|
|
720
|
-
})), F = /* @__PURE__ */ e(((e) => {
|
|
721
|
-
e.isValid = function(e) {
|
|
722
|
-
return !isNaN(e) && e >= 1 && e <= 40;
|
|
723
|
-
};
|
|
724
|
-
})), I = /* @__PURE__ */ e(((e) => {
|
|
725
|
-
var t = "[0-9]+", n = "[A-Z $%*+\\-./:]+", r = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
726
|
-
r = r.replace(/u/g, "\\u");
|
|
727
|
-
var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + r + ")(?:.|[\r\n]))+";
|
|
728
|
-
e.KANJI = new RegExp(r, "g"), e.BYTE_KANJI = /* @__PURE__ */ RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), e.BYTE = new RegExp(i, "g"), e.NUMERIC = new RegExp(t, "g"), e.ALPHANUMERIC = new RegExp(n, "g");
|
|
729
|
-
var a = RegExp("^" + r + "$"), o = RegExp("^" + t + "$"), s = /* @__PURE__ */ RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
730
|
-
e.testKanji = function(e) {
|
|
731
|
-
return a.test(e);
|
|
732
|
-
}, e.testNumeric = function(e) {
|
|
733
|
-
return o.test(e);
|
|
734
|
-
}, e.testAlphanumeric = function(e) {
|
|
735
|
-
return s.test(e);
|
|
736
|
-
};
|
|
737
|
-
})), L = /* @__PURE__ */ e(((e) => {
|
|
738
|
-
var t = F(), n = I();
|
|
739
|
-
e.NUMERIC = {
|
|
740
|
-
id: "Numeric",
|
|
741
|
-
bit: 1,
|
|
742
|
-
ccBits: [
|
|
743
|
-
10,
|
|
744
|
-
12,
|
|
745
|
-
14
|
|
746
|
-
]
|
|
747
|
-
}, e.ALPHANUMERIC = {
|
|
748
|
-
id: "Alphanumeric",
|
|
749
|
-
bit: 2,
|
|
750
|
-
ccBits: [
|
|
751
|
-
9,
|
|
752
|
-
11,
|
|
753
|
-
13
|
|
754
|
-
]
|
|
755
|
-
}, e.BYTE = {
|
|
756
|
-
id: "Byte",
|
|
757
|
-
bit: 4,
|
|
758
|
-
ccBits: [
|
|
759
|
-
8,
|
|
760
|
-
16,
|
|
761
|
-
16
|
|
762
|
-
]
|
|
763
|
-
}, e.KANJI = {
|
|
764
|
-
id: "Kanji",
|
|
765
|
-
bit: 8,
|
|
766
|
-
ccBits: [
|
|
767
|
-
8,
|
|
768
|
-
10,
|
|
769
|
-
12
|
|
770
|
-
]
|
|
771
|
-
}, e.MIXED = { bit: -1 }, e.getCharCountIndicator = function(e, n) {
|
|
772
|
-
if (!e.ccBits) throw Error("Invalid mode: " + e);
|
|
773
|
-
if (!t.isValid(n)) throw Error("Invalid version: " + n);
|
|
774
|
-
return n >= 1 && n < 10 ? e.ccBits[0] : n < 27 ? e.ccBits[1] : e.ccBits[2];
|
|
775
|
-
}, e.getBestModeForData = function(t) {
|
|
776
|
-
return n.testNumeric(t) ? e.NUMERIC : n.testAlphanumeric(t) ? e.ALPHANUMERIC : n.testKanji(t) ? e.KANJI : e.BYTE;
|
|
777
|
-
}, e.toString = function(e) {
|
|
778
|
-
if (e && e.id) return e.id;
|
|
779
|
-
throw Error("Invalid mode");
|
|
780
|
-
}, e.isValid = function(e) {
|
|
781
|
-
return e && e.bit && e.ccBits;
|
|
782
|
-
};
|
|
783
|
-
function r(t) {
|
|
784
|
-
if (typeof t != "string") throw Error("Param is not a string");
|
|
785
|
-
switch (t.toLowerCase()) {
|
|
786
|
-
case "numeric": return e.NUMERIC;
|
|
787
|
-
case "alphanumeric": return e.ALPHANUMERIC;
|
|
788
|
-
case "kanji": return e.KANJI;
|
|
789
|
-
case "byte": return e.BYTE;
|
|
790
|
-
default: throw Error("Unknown mode: " + t);
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
e.from = function(t, n) {
|
|
794
|
-
if (e.isValid(t)) return t;
|
|
795
|
-
try {
|
|
796
|
-
return r(t);
|
|
797
|
-
} catch {
|
|
798
|
-
return n;
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
})), _e = /* @__PURE__ */ e(((e) => {
|
|
802
|
-
var t = M(), n = P(), r = N(), i = L(), a = F(), o = 7973, s = t.getBCHDigit(o);
|
|
803
|
-
function c(t, n, r) {
|
|
804
|
-
for (let i = 1; i <= 40; i++) if (n <= e.getCapacity(i, r, t)) return i;
|
|
805
|
-
}
|
|
806
|
-
function l(e, t) {
|
|
807
|
-
return i.getCharCountIndicator(e, t) + 4;
|
|
808
|
-
}
|
|
809
|
-
function u(e, t) {
|
|
810
|
-
let n = 0;
|
|
811
|
-
return e.forEach(function(e) {
|
|
812
|
-
let r = l(e.mode, t);
|
|
813
|
-
n += r + e.getBitsLength();
|
|
814
|
-
}), n;
|
|
815
|
-
}
|
|
816
|
-
function d(t, n) {
|
|
817
|
-
for (let r = 1; r <= 40; r++) if (u(t, r) <= e.getCapacity(r, n, i.MIXED)) return r;
|
|
818
|
-
}
|
|
819
|
-
e.from = function(e, t) {
|
|
820
|
-
return a.isValid(e) ? parseInt(e, 10) : t;
|
|
821
|
-
}, e.getCapacity = function(e, r, o) {
|
|
822
|
-
if (!a.isValid(e)) throw Error("Invalid QR Code version");
|
|
823
|
-
o === void 0 && (o = i.BYTE);
|
|
824
|
-
let s = (t.getSymbolTotalCodewords(e) - n.getTotalCodewordsCount(e, r)) * 8;
|
|
825
|
-
if (o === i.MIXED) return s;
|
|
826
|
-
let c = s - l(o, e);
|
|
827
|
-
switch (o) {
|
|
828
|
-
case i.NUMERIC: return Math.floor(c / 10 * 3);
|
|
829
|
-
case i.ALPHANUMERIC: return Math.floor(c / 11 * 2);
|
|
830
|
-
case i.KANJI: return Math.floor(c / 13);
|
|
831
|
-
case i.BYTE:
|
|
832
|
-
default: return Math.floor(c / 8);
|
|
833
|
-
}
|
|
834
|
-
}, e.getBestVersionForData = function(e, t) {
|
|
835
|
-
let n, i = r.from(t, r.M);
|
|
836
|
-
if (Array.isArray(e)) {
|
|
837
|
-
if (e.length > 1) return d(e, i);
|
|
838
|
-
if (e.length === 0) return 1;
|
|
839
|
-
n = e[0];
|
|
840
|
-
} else n = e;
|
|
841
|
-
return c(n.mode, n.getLength(), i);
|
|
842
|
-
}, e.getEncodedBits = function(e) {
|
|
843
|
-
if (!a.isValid(e) || e < 7) throw Error("Invalid QR Code version");
|
|
844
|
-
let n = e << 12;
|
|
845
|
-
for (; t.getBCHDigit(n) - s >= 0;) n ^= o << t.getBCHDigit(n) - s;
|
|
846
|
-
return e << 12 | n;
|
|
847
|
-
};
|
|
848
|
-
})), ve = /* @__PURE__ */ e(((e) => {
|
|
849
|
-
var t = M(), n = 1335, r = 21522, i = t.getBCHDigit(n);
|
|
850
|
-
e.getEncodedBits = function(e, a) {
|
|
851
|
-
let o = e.bit << 3 | a, s = o << 10;
|
|
852
|
-
for (; t.getBCHDigit(s) - i >= 0;) s ^= n << t.getBCHDigit(s) - i;
|
|
853
|
-
return (o << 10 | s) ^ r;
|
|
854
|
-
};
|
|
855
|
-
})), ye = /* @__PURE__ */ e(((e, t) => {
|
|
856
|
-
var n = L();
|
|
857
|
-
function r(e) {
|
|
858
|
-
this.mode = n.NUMERIC, this.data = e.toString();
|
|
859
|
-
}
|
|
860
|
-
r.getBitsLength = function(e) {
|
|
861
|
-
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
862
|
-
}, r.prototype.getLength = function() {
|
|
863
|
-
return this.data.length;
|
|
864
|
-
}, r.prototype.getBitsLength = function() {
|
|
865
|
-
return r.getBitsLength(this.data.length);
|
|
866
|
-
}, r.prototype.write = function(e) {
|
|
867
|
-
let t, n, r;
|
|
868
|
-
for (t = 0; t + 3 <= this.data.length; t += 3) n = this.data.substr(t, 3), r = parseInt(n, 10), e.put(r, 10);
|
|
869
|
-
let i = this.data.length - t;
|
|
870
|
-
i > 0 && (n = this.data.substr(t), r = parseInt(n, 10), e.put(r, i * 3 + 1));
|
|
871
|
-
}, t.exports = r;
|
|
872
|
-
})), be = /* @__PURE__ */ e(((e, t) => {
|
|
873
|
-
var n = L(), r = /* @__PURE__ */ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
|
|
874
|
-
function i(e) {
|
|
875
|
-
this.mode = n.ALPHANUMERIC, this.data = e;
|
|
876
|
-
}
|
|
877
|
-
i.getBitsLength = function(e) {
|
|
878
|
-
return 11 * Math.floor(e / 2) + e % 2 * 6;
|
|
879
|
-
}, i.prototype.getLength = function() {
|
|
880
|
-
return this.data.length;
|
|
881
|
-
}, i.prototype.getBitsLength = function() {
|
|
882
|
-
return i.getBitsLength(this.data.length);
|
|
883
|
-
}, i.prototype.write = function(e) {
|
|
884
|
-
let t;
|
|
885
|
-
for (t = 0; t + 2 <= this.data.length; t += 2) {
|
|
886
|
-
let n = r.indexOf(this.data[t]) * 45;
|
|
887
|
-
n += r.indexOf(this.data[t + 1]), e.put(n, 11);
|
|
888
|
-
}
|
|
889
|
-
this.data.length % 2 && e.put(r.indexOf(this.data[t]), 6);
|
|
890
|
-
}, t.exports = i;
|
|
891
|
-
})), xe = /* @__PURE__ */ e(((e, t) => {
|
|
892
|
-
var n = L();
|
|
893
|
-
function r(e) {
|
|
894
|
-
this.mode = n.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
|
|
895
|
-
}
|
|
896
|
-
r.getBitsLength = function(e) {
|
|
897
|
-
return e * 8;
|
|
898
|
-
}, r.prototype.getLength = function() {
|
|
899
|
-
return this.data.length;
|
|
900
|
-
}, r.prototype.getBitsLength = function() {
|
|
901
|
-
return r.getBitsLength(this.data.length);
|
|
902
|
-
}, r.prototype.write = function(e) {
|
|
903
|
-
for (let t = 0, n = this.data.length; t < n; t++) e.put(this.data[t], 8);
|
|
904
|
-
}, t.exports = r;
|
|
905
|
-
})), Se = /* @__PURE__ */ e(((e, t) => {
|
|
906
|
-
var n = L(), r = M();
|
|
907
|
-
function i(e) {
|
|
908
|
-
this.mode = n.KANJI, this.data = e;
|
|
909
|
-
}
|
|
910
|
-
i.getBitsLength = function(e) {
|
|
911
|
-
return e * 13;
|
|
912
|
-
}, i.prototype.getLength = function() {
|
|
913
|
-
return this.data.length;
|
|
914
|
-
}, i.prototype.getBitsLength = function() {
|
|
915
|
-
return i.getBitsLength(this.data.length);
|
|
916
|
-
}, i.prototype.write = function(e) {
|
|
917
|
-
let t;
|
|
918
|
-
for (t = 0; t < this.data.length; t++) {
|
|
919
|
-
let n = r.toSJIS(this.data[t]);
|
|
920
|
-
if (n >= 33088 && n <= 40956) n -= 33088;
|
|
921
|
-
else if (n >= 57408 && n <= 60351) n -= 49472;
|
|
922
|
-
else throw Error("Invalid SJIS character: " + this.data[t] + "\nMake sure your charset is UTF-8");
|
|
923
|
-
n = (n >>> 8 & 255) * 192 + (n & 255), e.put(n, 13);
|
|
924
|
-
}
|
|
925
|
-
}, t.exports = i;
|
|
926
|
-
})), Ce = /* @__PURE__ */ e(((e, t) => {
|
|
927
|
-
var n = {
|
|
928
|
-
single_source_shortest_paths: function(e, t, r) {
|
|
929
|
-
var i = {}, a = {};
|
|
930
|
-
a[t] = 0;
|
|
931
|
-
var o = n.PriorityQueue.make();
|
|
932
|
-
o.push(t, 0);
|
|
933
|
-
for (var s, c, l, u, d, f, p, m, h; !o.empty();) for (l in s = o.pop(), c = s.value, u = s.cost, d = e[c] || {}, d) d.hasOwnProperty(l) && (f = d[l], p = u + f, m = a[l], h = a[l] === void 0, (h || m > p) && (a[l] = p, o.push(l, p), i[l] = c));
|
|
934
|
-
if (r !== void 0 && a[r] === void 0) {
|
|
935
|
-
var g = [
|
|
936
|
-
"Could not find a path from ",
|
|
937
|
-
t,
|
|
938
|
-
" to ",
|
|
939
|
-
r,
|
|
940
|
-
"."
|
|
941
|
-
].join("");
|
|
942
|
-
throw Error(g);
|
|
943
|
-
}
|
|
944
|
-
return i;
|
|
945
|
-
},
|
|
946
|
-
extract_shortest_path_from_predecessor_list: function(e, t) {
|
|
947
|
-
for (var n = [], r = t; r;) n.push(r), e[r], r = e[r];
|
|
948
|
-
return n.reverse(), n;
|
|
949
|
-
},
|
|
950
|
-
find_path: function(e, t, r) {
|
|
951
|
-
var i = n.single_source_shortest_paths(e, t, r);
|
|
952
|
-
return n.extract_shortest_path_from_predecessor_list(i, r);
|
|
953
|
-
},
|
|
954
|
-
PriorityQueue: {
|
|
955
|
-
make: function(e) {
|
|
956
|
-
var t = n.PriorityQueue, r = {}, i;
|
|
957
|
-
for (i in e ||= {}, t) t.hasOwnProperty(i) && (r[i] = t[i]);
|
|
958
|
-
return r.queue = [], r.sorter = e.sorter || t.default_sorter, r;
|
|
959
|
-
},
|
|
960
|
-
default_sorter: function(e, t) {
|
|
961
|
-
return e.cost - t.cost;
|
|
962
|
-
},
|
|
963
|
-
push: function(e, t) {
|
|
964
|
-
var n = {
|
|
965
|
-
value: e,
|
|
966
|
-
cost: t
|
|
967
|
-
};
|
|
968
|
-
this.queue.push(n), this.queue.sort(this.sorter);
|
|
969
|
-
},
|
|
970
|
-
pop: function() {
|
|
971
|
-
return this.queue.shift();
|
|
972
|
-
},
|
|
973
|
-
empty: function() {
|
|
974
|
-
return this.queue.length === 0;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
};
|
|
978
|
-
t !== void 0 && (t.exports = n);
|
|
979
|
-
})), we = /* @__PURE__ */ e(((e) => {
|
|
980
|
-
var t = L(), n = ye(), r = be(), i = xe(), a = Se(), o = I(), s = M(), c = Ce();
|
|
981
|
-
function l(e) {
|
|
982
|
-
return unescape(encodeURIComponent(e)).length;
|
|
983
|
-
}
|
|
984
|
-
function u(e, t, n) {
|
|
985
|
-
let r = [], i;
|
|
986
|
-
for (; (i = e.exec(n)) !== null;) r.push({
|
|
987
|
-
data: i[0],
|
|
988
|
-
index: i.index,
|
|
989
|
-
mode: t,
|
|
990
|
-
length: i[0].length
|
|
991
|
-
});
|
|
992
|
-
return r;
|
|
993
|
-
}
|
|
994
|
-
function d(e) {
|
|
995
|
-
let n = u(o.NUMERIC, t.NUMERIC, e), r = u(o.ALPHANUMERIC, t.ALPHANUMERIC, e), i, a;
|
|
996
|
-
return s.isKanjiModeEnabled() ? (i = u(o.BYTE, t.BYTE, e), a = u(o.KANJI, t.KANJI, e)) : (i = u(o.BYTE_KANJI, t.BYTE, e), a = []), n.concat(r, i, a).sort(function(e, t) {
|
|
997
|
-
return e.index - t.index;
|
|
998
|
-
}).map(function(e) {
|
|
999
|
-
return {
|
|
1000
|
-
data: e.data,
|
|
1001
|
-
mode: e.mode,
|
|
1002
|
-
length: e.length
|
|
1003
|
-
};
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
function f(e, o) {
|
|
1007
|
-
switch (o) {
|
|
1008
|
-
case t.NUMERIC: return n.getBitsLength(e);
|
|
1009
|
-
case t.ALPHANUMERIC: return r.getBitsLength(e);
|
|
1010
|
-
case t.KANJI: return a.getBitsLength(e);
|
|
1011
|
-
case t.BYTE: return i.getBitsLength(e);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
function p(e) {
|
|
1015
|
-
return e.reduce(function(e, t) {
|
|
1016
|
-
let n = e.length - 1 >= 0 ? e[e.length - 1] : null;
|
|
1017
|
-
return n && n.mode === t.mode ? (e[e.length - 1].data += t.data, e) : (e.push(t), e);
|
|
1018
|
-
}, []);
|
|
1019
|
-
}
|
|
1020
|
-
function m(e) {
|
|
1021
|
-
let n = [];
|
|
1022
|
-
for (let r = 0; r < e.length; r++) {
|
|
1023
|
-
let i = e[r];
|
|
1024
|
-
switch (i.mode) {
|
|
1025
|
-
case t.NUMERIC:
|
|
1026
|
-
n.push([
|
|
1027
|
-
i,
|
|
1028
|
-
{
|
|
1029
|
-
data: i.data,
|
|
1030
|
-
mode: t.ALPHANUMERIC,
|
|
1031
|
-
length: i.length
|
|
1032
|
-
},
|
|
1033
|
-
{
|
|
1034
|
-
data: i.data,
|
|
1035
|
-
mode: t.BYTE,
|
|
1036
|
-
length: i.length
|
|
1037
|
-
}
|
|
1038
|
-
]);
|
|
1039
|
-
break;
|
|
1040
|
-
case t.ALPHANUMERIC:
|
|
1041
|
-
n.push([i, {
|
|
1042
|
-
data: i.data,
|
|
1043
|
-
mode: t.BYTE,
|
|
1044
|
-
length: i.length
|
|
1045
|
-
}]);
|
|
1046
|
-
break;
|
|
1047
|
-
case t.KANJI:
|
|
1048
|
-
n.push([i, {
|
|
1049
|
-
data: i.data,
|
|
1050
|
-
mode: t.BYTE,
|
|
1051
|
-
length: l(i.data)
|
|
1052
|
-
}]);
|
|
1053
|
-
break;
|
|
1054
|
-
case t.BYTE: n.push([{
|
|
1055
|
-
data: i.data,
|
|
1056
|
-
mode: t.BYTE,
|
|
1057
|
-
length: l(i.data)
|
|
1058
|
-
}]);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
return n;
|
|
1062
|
-
}
|
|
1063
|
-
function h(e, n) {
|
|
1064
|
-
let r = {}, i = { start: {} }, a = ["start"];
|
|
1065
|
-
for (let o = 0; o < e.length; o++) {
|
|
1066
|
-
let s = e[o], c = [];
|
|
1067
|
-
for (let e = 0; e < s.length; e++) {
|
|
1068
|
-
let l = s[e], u = "" + o + e;
|
|
1069
|
-
c.push(u), r[u] = {
|
|
1070
|
-
node: l,
|
|
1071
|
-
lastCount: 0
|
|
1072
|
-
}, i[u] = {};
|
|
1073
|
-
for (let e = 0; e < a.length; e++) {
|
|
1074
|
-
let o = a[e];
|
|
1075
|
-
r[o] && r[o].node.mode === l.mode ? (i[o][u] = f(r[o].lastCount + l.length, l.mode) - f(r[o].lastCount, l.mode), r[o].lastCount += l.length) : (r[o] && (r[o].lastCount = l.length), i[o][u] = f(l.length, l.mode) + 4 + t.getCharCountIndicator(l.mode, n));
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
a = c;
|
|
1079
|
-
}
|
|
1080
|
-
for (let e = 0; e < a.length; e++) i[a[e]].end = 0;
|
|
1081
|
-
return {
|
|
1082
|
-
map: i,
|
|
1083
|
-
table: r
|
|
1084
|
-
};
|
|
1085
|
-
}
|
|
1086
|
-
function g(e, o) {
|
|
1087
|
-
let c, l = t.getBestModeForData(e);
|
|
1088
|
-
if (c = t.from(o, l), c !== t.BYTE && c.bit < l.bit) throw Error("\"" + e + "\" cannot be encoded with mode " + t.toString(c) + ".\n Suggested mode is: " + t.toString(l));
|
|
1089
|
-
switch (c === t.KANJI && !s.isKanjiModeEnabled() && (c = t.BYTE), c) {
|
|
1090
|
-
case t.NUMERIC: return new n(e);
|
|
1091
|
-
case t.ALPHANUMERIC: return new r(e);
|
|
1092
|
-
case t.KANJI: return new a(e);
|
|
1093
|
-
case t.BYTE: return new i(e);
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
e.fromArray = function(e) {
|
|
1097
|
-
return e.reduce(function(e, t) {
|
|
1098
|
-
return typeof t == "string" ? e.push(g(t, null)) : t.data && e.push(g(t.data, t.mode)), e;
|
|
1099
|
-
}, []);
|
|
1100
|
-
}, e.fromString = function(t, n) {
|
|
1101
|
-
let r = h(m(d(t, s.isKanjiModeEnabled())), n), i = c.find_path(r.map, "start", "end"), a = [];
|
|
1102
|
-
for (let e = 1; e < i.length - 1; e++) a.push(r.table[i[e]].node);
|
|
1103
|
-
return e.fromArray(p(a));
|
|
1104
|
-
}, e.rawSplit = function(t) {
|
|
1105
|
-
return e.fromArray(d(t, s.isKanjiModeEnabled()));
|
|
1106
|
-
};
|
|
1107
|
-
})), Te = /* @__PURE__ */ e(((e) => {
|
|
1108
|
-
var t = M(), n = N(), r = le(), i = ue(), a = de(), o = fe(), s = pe(), c = P(), l = ge(), u = _e(), d = ve(), f = L(), p = we();
|
|
1109
|
-
function m(e, t) {
|
|
1110
|
-
let n = e.size, r = o.getPositions(t);
|
|
1111
|
-
for (let t = 0; t < r.length; t++) {
|
|
1112
|
-
let i = r[t][0], a = r[t][1];
|
|
1113
|
-
for (let t = -1; t <= 7; t++) if (!(i + t <= -1 || n <= i + t)) for (let r = -1; r <= 7; r++) a + r <= -1 || n <= a + r || (t >= 0 && t <= 6 && (r === 0 || r === 6) || r >= 0 && r <= 6 && (t === 0 || t === 6) || t >= 2 && t <= 4 && r >= 2 && r <= 4 ? e.set(i + t, a + r, !0, !0) : e.set(i + t, a + r, !1, !0));
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
function h(e) {
|
|
1117
|
-
let t = e.size;
|
|
1118
|
-
for (let n = 8; n < t - 8; n++) {
|
|
1119
|
-
let t = n % 2 == 0;
|
|
1120
|
-
e.set(n, 6, t, !0), e.set(6, n, t, !0);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
function g(e, t) {
|
|
1124
|
-
let n = a.getPositions(t);
|
|
1125
|
-
for (let t = 0; t < n.length; t++) {
|
|
1126
|
-
let r = n[t][0], i = n[t][1];
|
|
1127
|
-
for (let t = -2; t <= 2; t++) for (let n = -2; n <= 2; n++) t === -2 || t === 2 || n === -2 || n === 2 || t === 0 && n === 0 ? e.set(r + t, i + n, !0, !0) : e.set(r + t, i + n, !1, !0);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
function _(e, t) {
|
|
1131
|
-
let n = e.size, r = u.getEncodedBits(t), i, a, o;
|
|
1132
|
-
for (let t = 0; t < 18; t++) i = Math.floor(t / 3), a = t % 3 + n - 8 - 3, o = (r >> t & 1) == 1, e.set(i, a, o, !0), e.set(a, i, o, !0);
|
|
1133
|
-
}
|
|
1134
|
-
function v(e, t, n) {
|
|
1135
|
-
let r = e.size, i = d.getEncodedBits(t, n), a, o;
|
|
1136
|
-
for (a = 0; a < 15; a++) o = (i >> a & 1) == 1, a < 6 ? e.set(a, 8, o, !0) : a < 8 ? e.set(a + 1, 8, o, !0) : e.set(r - 15 + a, 8, o, !0), a < 8 ? e.set(8, r - a - 1, o, !0) : a < 9 ? e.set(8, 15 - a - 1 + 1, o, !0) : e.set(8, 15 - a - 1, o, !0);
|
|
1137
|
-
e.set(r - 8, 8, 1, !0);
|
|
1138
|
-
}
|
|
1139
|
-
function y(e, t) {
|
|
1140
|
-
let n = e.size, r = -1, i = n - 1, a = 7, o = 0;
|
|
1141
|
-
for (let s = n - 1; s > 0; s -= 2) for (s === 6 && s--;;) {
|
|
1142
|
-
for (let n = 0; n < 2; n++) if (!e.isReserved(i, s - n)) {
|
|
1143
|
-
let r = !1;
|
|
1144
|
-
o < t.length && (r = (t[o] >>> a & 1) == 1), e.set(i, s - n, r), a--, a === -1 && (o++, a = 7);
|
|
1145
|
-
}
|
|
1146
|
-
if (i += r, i < 0 || n <= i) {
|
|
1147
|
-
i -= r, r = -r;
|
|
1148
|
-
break;
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
function b(e, n, i) {
|
|
1153
|
-
let a = new r();
|
|
1154
|
-
i.forEach(function(t) {
|
|
1155
|
-
a.put(t.mode.bit, 4), a.put(t.getLength(), f.getCharCountIndicator(t.mode, e)), t.write(a);
|
|
1156
|
-
});
|
|
1157
|
-
let o = (t.getSymbolTotalCodewords(e) - c.getTotalCodewordsCount(e, n)) * 8;
|
|
1158
|
-
for (a.getLengthInBits() + 4 <= o && a.put(0, 4); a.getLengthInBits() % 8 != 0;) a.putBit(0);
|
|
1159
|
-
let s = (o - a.getLengthInBits()) / 8;
|
|
1160
|
-
for (let e = 0; e < s; e++) a.put(e % 2 ? 17 : 236, 8);
|
|
1161
|
-
return x(a, e, n);
|
|
1162
|
-
}
|
|
1163
|
-
function x(e, n, r) {
|
|
1164
|
-
let i = t.getSymbolTotalCodewords(n), a = i - c.getTotalCodewordsCount(n, r), o = c.getBlocksCount(n, r), s = o - i % o, u = Math.floor(i / o), d = Math.floor(a / o), f = d + 1, p = u - d, m = new l(p), h = 0, g = Array(o), _ = Array(o), v = 0, y = new Uint8Array(e.buffer);
|
|
1165
|
-
for (let e = 0; e < o; e++) {
|
|
1166
|
-
let t = e < s ? d : f;
|
|
1167
|
-
g[e] = y.slice(h, h + t), _[e] = m.encode(g[e]), h += t, v = Math.max(v, t);
|
|
1168
|
-
}
|
|
1169
|
-
let b = new Uint8Array(i), x = 0, S, C;
|
|
1170
|
-
for (S = 0; S < v; S++) for (C = 0; C < o; C++) S < g[C].length && (b[x++] = g[C][S]);
|
|
1171
|
-
for (S = 0; S < p; S++) for (C = 0; C < o; C++) b[x++] = _[C][S];
|
|
1172
|
-
return b;
|
|
1173
|
-
}
|
|
1174
|
-
function S(e, n, r, a) {
|
|
1175
|
-
let o;
|
|
1176
|
-
if (Array.isArray(e)) o = p.fromArray(e);
|
|
1177
|
-
else if (typeof e == "string") {
|
|
1178
|
-
let t = n;
|
|
1179
|
-
if (!t) {
|
|
1180
|
-
let n = p.rawSplit(e);
|
|
1181
|
-
t = u.getBestVersionForData(n, r);
|
|
1182
|
-
}
|
|
1183
|
-
o = p.fromString(e, t || 40);
|
|
1184
|
-
} else throw Error("Invalid data");
|
|
1185
|
-
let c = u.getBestVersionForData(o, r);
|
|
1186
|
-
if (!c) throw Error("The amount of data is too big to be stored in a QR Code");
|
|
1187
|
-
if (!n) n = c;
|
|
1188
|
-
else if (n < c) throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + c + ".\n");
|
|
1189
|
-
let l = b(n, r, o), d = new i(t.getSymbolSize(n));
|
|
1190
|
-
return m(d, n), h(d), g(d, n), v(d, r, 0), n >= 7 && _(d, n), y(d, l), isNaN(a) && (a = s.getBestMask(d, v.bind(null, d, r))), s.applyMask(a, d), v(d, r, a), {
|
|
1191
|
-
modules: d,
|
|
1192
|
-
version: n,
|
|
1193
|
-
errorCorrectionLevel: r,
|
|
1194
|
-
maskPattern: a,
|
|
1195
|
-
segments: o
|
|
1196
|
-
};
|
|
1197
|
-
}
|
|
1198
|
-
e.create = function(e, r) {
|
|
1199
|
-
if (e === void 0 || e === "") throw Error("No input text");
|
|
1200
|
-
let i = n.M, a, o;
|
|
1201
|
-
return r !== void 0 && (i = n.from(r.errorCorrectionLevel, n.M), a = u.from(r.version), o = s.from(r.maskPattern), r.toSJISFunc && t.setToSJISFunction(r.toSJISFunc)), S(e, a, i, o);
|
|
1202
|
-
};
|
|
1203
|
-
})), R = /* @__PURE__ */ e(((e) => {
|
|
1204
|
-
function t(e) {
|
|
1205
|
-
if (typeof e == "number" && (e = e.toString()), typeof e != "string") throw Error("Color should be defined as hex string");
|
|
1206
|
-
let t = e.slice().replace("#", "").split("");
|
|
1207
|
-
if (t.length < 3 || t.length === 5 || t.length > 8) throw Error("Invalid hex color: " + e);
|
|
1208
|
-
(t.length === 3 || t.length === 4) && (t = Array.prototype.concat.apply([], t.map(function(e) {
|
|
1209
|
-
return [e, e];
|
|
1210
|
-
}))), t.length === 6 && t.push("F", "F");
|
|
1211
|
-
let n = parseInt(t.join(""), 16);
|
|
1212
|
-
return {
|
|
1213
|
-
r: n >> 24 & 255,
|
|
1214
|
-
g: n >> 16 & 255,
|
|
1215
|
-
b: n >> 8 & 255,
|
|
1216
|
-
a: n & 255,
|
|
1217
|
-
hex: "#" + t.slice(0, 6).join("")
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
e.getOptions = function(e) {
|
|
1221
|
-
e ||= {}, e.color ||= {};
|
|
1222
|
-
let n = e.margin === void 0 || e.margin === null || e.margin < 0 ? 4 : e.margin, r = e.width && e.width >= 21 ? e.width : void 0, i = e.scale || 4;
|
|
1223
|
-
return {
|
|
1224
|
-
width: r,
|
|
1225
|
-
scale: r ? 4 : i,
|
|
1226
|
-
margin: n,
|
|
1227
|
-
color: {
|
|
1228
|
-
dark: t(e.color.dark || "#000000ff"),
|
|
1229
|
-
light: t(e.color.light || "#ffffffff")
|
|
1230
|
-
},
|
|
1231
|
-
type: e.type,
|
|
1232
|
-
rendererOpts: e.rendererOpts || {}
|
|
1233
|
-
};
|
|
1234
|
-
}, e.getScale = function(e, t) {
|
|
1235
|
-
return t.width && t.width >= e + t.margin * 2 ? t.width / (e + t.margin * 2) : t.scale;
|
|
1236
|
-
}, e.getImageWidth = function(t, n) {
|
|
1237
|
-
let r = e.getScale(t, n);
|
|
1238
|
-
return Math.floor((t + n.margin * 2) * r);
|
|
1239
|
-
}, e.qrToImageData = function(t, n, r) {
|
|
1240
|
-
let i = n.modules.size, a = n.modules.data, o = e.getScale(i, r), s = Math.floor((i + r.margin * 2) * o), c = r.margin * o, l = [r.color.light, r.color.dark];
|
|
1241
|
-
for (let e = 0; e < s; e++) for (let n = 0; n < s; n++) {
|
|
1242
|
-
let u = (e * s + n) * 4, d = r.color.light;
|
|
1243
|
-
if (e >= c && n >= c && e < s - c && n < s - c) {
|
|
1244
|
-
let t = Math.floor((e - c) / o), r = Math.floor((n - c) / o);
|
|
1245
|
-
d = l[a[t * i + r] ? 1 : 0];
|
|
1246
|
-
}
|
|
1247
|
-
t[u++] = d.r, t[u++] = d.g, t[u++] = d.b, t[u] = d.a;
|
|
1248
|
-
}
|
|
1249
|
-
};
|
|
1250
|
-
})), Ee = /* @__PURE__ */ e(((e) => {
|
|
1251
|
-
var t = R();
|
|
1252
|
-
function n(e, t, n) {
|
|
1253
|
-
e.clearRect(0, 0, t.width, t.height), t.style ||= {}, t.height = n, t.width = n, t.style.height = n + "px", t.style.width = n + "px";
|
|
1254
|
-
}
|
|
1255
|
-
function r() {
|
|
1256
|
-
try {
|
|
1257
|
-
return document.createElement("canvas");
|
|
1258
|
-
} catch {
|
|
1259
|
-
throw Error("You need to specify a canvas element");
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
e.render = function(e, i, a) {
|
|
1263
|
-
let o = a, s = i;
|
|
1264
|
-
o === void 0 && (!i || !i.getContext) && (o = i, i = void 0), i || (s = r()), o = t.getOptions(o);
|
|
1265
|
-
let c = t.getImageWidth(e.modules.size, o), l = s.getContext("2d"), u = l.createImageData(c, c);
|
|
1266
|
-
return t.qrToImageData(u.data, e, o), n(l, s, c), l.putImageData(u, 0, 0), s;
|
|
1267
|
-
}, e.renderToDataURL = function(t, n, r) {
|
|
1268
|
-
let i = r;
|
|
1269
|
-
i === void 0 && (!n || !n.getContext) && (i = n, n = void 0), i ||= {};
|
|
1270
|
-
let a = e.render(t, n, i), o = i.type || "image/png", s = i.rendererOpts || {};
|
|
1271
|
-
return a.toDataURL(o, s.quality);
|
|
1272
|
-
};
|
|
1273
|
-
})), De = /* @__PURE__ */ e(((e) => {
|
|
1274
|
-
var t = R();
|
|
1275
|
-
function n(e, t) {
|
|
1276
|
-
let n = e.a / 255, r = t + "=\"" + e.hex + "\"";
|
|
1277
|
-
return n < 1 ? r + " " + t + "-opacity=\"" + n.toFixed(2).slice(1) + "\"" : r;
|
|
1278
|
-
}
|
|
1279
|
-
function r(e, t, n) {
|
|
1280
|
-
let r = e + t;
|
|
1281
|
-
return n !== void 0 && (r += " " + n), r;
|
|
1282
|
-
}
|
|
1283
|
-
function i(e, t, n) {
|
|
1284
|
-
let i = "", a = 0, o = !1, s = 0;
|
|
1285
|
-
for (let c = 0; c < e.length; c++) {
|
|
1286
|
-
let l = Math.floor(c % t), u = Math.floor(c / t);
|
|
1287
|
-
!l && !o && (o = !0), e[c] ? (s++, c > 0 && l > 0 && e[c - 1] || (i += o ? r("M", l + n, .5 + u + n) : r("m", a, 0), a = 0, o = !1), l + 1 < t && e[c + 1] || (i += r("h", s), s = 0)) : a++;
|
|
1288
|
-
}
|
|
1289
|
-
return i;
|
|
1290
|
-
}
|
|
1291
|
-
e.render = function(e, r, a) {
|
|
1292
|
-
let o = t.getOptions(r), s = e.modules.size, c = e.modules.data, l = s + o.margin * 2, u = o.color.light.a ? "<path " + n(o.color.light, "fill") + " d=\"M0 0h" + l + "v" + l + "H0z\"/>" : "", d = "<path " + n(o.color.dark, "stroke") + " d=\"" + i(c, s, o.margin) + "\"/>", f = "viewBox=\"0 0 " + l + " " + l + "\"", p = "<svg xmlns=\"http://www.w3.org/2000/svg\" " + (o.width ? "width=\"" + o.width + "\" height=\"" + o.width + "\" " : "") + f + " shape-rendering=\"crispEdges\">" + u + d + "</svg>\n";
|
|
1293
|
-
return typeof a == "function" && a(null, p), p;
|
|
1294
|
-
};
|
|
1295
|
-
})), Oe = (/* @__PURE__ */ e(((e) => {
|
|
1296
|
-
var t = ce(), n = Te(), r = Ee(), i = De();
|
|
1297
|
-
function a(e, r, i, a, o) {
|
|
1298
|
-
let s = [].slice.call(arguments, 1), c = s.length, l = typeof s[c - 1] == "function";
|
|
1299
|
-
if (!l && !t()) throw Error("Callback required as last argument");
|
|
1300
|
-
if (l) {
|
|
1301
|
-
if (c < 2) throw Error("Too few arguments provided");
|
|
1302
|
-
c === 2 ? (o = i, i = r, r = a = void 0) : c === 3 && (r.getContext && o === void 0 ? (o = a, a = void 0) : (o = a, a = i, i = r, r = void 0));
|
|
1303
|
-
} else {
|
|
1304
|
-
if (c < 1) throw Error("Too few arguments provided");
|
|
1305
|
-
return c === 1 ? (i = r, r = a = void 0) : c === 2 && !r.getContext && (a = i, i = r, r = void 0), new Promise(function(t, o) {
|
|
1306
|
-
try {
|
|
1307
|
-
t(e(n.create(i, a), r, a));
|
|
1308
|
-
} catch (e) {
|
|
1309
|
-
o(e);
|
|
1310
|
-
}
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1313
|
-
try {
|
|
1314
|
-
let t = n.create(i, a);
|
|
1315
|
-
o(null, e(t, r, a));
|
|
1316
|
-
} catch (e) {
|
|
1317
|
-
o(e);
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
e.create = n.create, e.toCanvas = a.bind(null, r.render), e.toDataURL = a.bind(null, r.renderToDataURL), e.toString = a.bind(null, function(e, t, n) {
|
|
1321
|
-
return i.render(e, n);
|
|
1322
|
-
});
|
|
1323
|
-
})))(), ke = ({ value: e, size: t = 150, bgColor: n = "#ffffff", fgColor: r = "#000000" }) => {
|
|
1324
|
-
let [a, o] = u("");
|
|
1325
|
-
return i(() => {
|
|
1326
|
-
e && (0, Oe.toString)(e, {
|
|
1327
|
-
type: "svg",
|
|
1328
|
-
width: t,
|
|
1329
|
-
margin: 0,
|
|
1330
|
-
color: {
|
|
1331
|
-
dark: r,
|
|
1332
|
-
light: n
|
|
1333
|
-
}
|
|
1334
|
-
}).then(o).catch(() => o(""));
|
|
1335
|
-
}, [
|
|
1336
|
-
e,
|
|
1337
|
-
t,
|
|
1338
|
-
n,
|
|
1339
|
-
r
|
|
1340
|
-
]), a ? /* @__PURE__ */ d("div", {
|
|
1341
|
-
class: "IncodeRedirectQrCode",
|
|
1342
|
-
dangerouslySetInnerHTML: { __html: a }
|
|
1343
|
-
}) : null;
|
|
1344
|
-
}, Ae = ({ redirectUrl: e }) => {
|
|
1345
|
-
let { t: n } = t();
|
|
1346
|
-
return /* @__PURE__ */ d(r, { children: [/* @__PURE__ */ d("p", {
|
|
1347
|
-
class: "IncodeRedirectTabDescription",
|
|
1348
|
-
children: n("v2.redirectToMobile.qr.description")
|
|
1349
|
-
}), /* @__PURE__ */ d("div", {
|
|
1350
|
-
class: "IncodeRedirectQrWrapper",
|
|
1351
|
-
children: /* @__PURE__ */ d(ke, {
|
|
1352
|
-
value: e,
|
|
1353
|
-
size: 186
|
|
1354
|
-
})
|
|
1355
|
-
})] });
|
|
1356
|
-
}, je = ({ formattedPhone: e, onResend: r, onChangePhone: i }) => {
|
|
1357
|
-
let { t: a } = t();
|
|
1358
|
-
return /* @__PURE__ */ d("div", {
|
|
1359
|
-
class: "IncodeRedirectLinkSent",
|
|
1360
|
-
children: [
|
|
1361
|
-
/* @__PURE__ */ d(w, { size: 32 }),
|
|
1362
|
-
/* @__PURE__ */ d(v, { size: 16 }),
|
|
1363
|
-
/* @__PURE__ */ d("h2", {
|
|
1364
|
-
class: "IncodeRedirectLinkSentTitle",
|
|
1365
|
-
children: a("redirect.linkSent")
|
|
1366
|
-
}),
|
|
1367
|
-
/* @__PURE__ */ d(v, { size: 12 }),
|
|
1368
|
-
/* @__PURE__ */ d("p", {
|
|
1369
|
-
class: "IncodeRedirectLinkSentPhone",
|
|
1370
|
-
children: a("redirect.linkSentTo", { phone: e })
|
|
1371
|
-
}),
|
|
1372
|
-
/* @__PURE__ */ d(v, { size: 32 }),
|
|
1373
|
-
/* @__PURE__ */ d("div", {
|
|
1374
|
-
class: "IncodeRedirectLinkSentActions",
|
|
1375
|
-
children: /* @__PURE__ */ d(n, {
|
|
1376
|
-
i18nKey: "redirect.didntReceiveLinkActions",
|
|
1377
|
-
defaultValue: "Didn't receive the link? <resend>Resend</resend> or <changePhone>Change phone number</changePhone>",
|
|
1378
|
-
components: {
|
|
1379
|
-
resend: /* @__PURE__ */ d(S, {
|
|
1380
|
-
variant: "link",
|
|
1381
|
-
onClick: r
|
|
1382
|
-
}),
|
|
1383
|
-
changePhone: /* @__PURE__ */ d(S, {
|
|
1384
|
-
variant: "link",
|
|
1385
|
-
onClick: i
|
|
1386
|
-
})
|
|
1387
|
-
}
|
|
1388
|
-
})
|
|
1389
|
-
})
|
|
1390
|
-
]
|
|
1391
|
-
});
|
|
1392
|
-
}, Me = a(() => import("../phoneInput-BezqS95v.js").then((e) => ({ default: e.PhoneInput }))), Ne = ({ countryCode: e, phonePrefix: n, error: i, isSending: a, isPhoneValid: o, onPhoneChange: s, onSendSms: c }) => {
|
|
1393
|
-
let { t: u } = t();
|
|
1394
|
-
return /* @__PURE__ */ d(r, { children: [/* @__PURE__ */ d(l, {
|
|
1395
|
-
fallback: /* @__PURE__ */ d(C, {}),
|
|
1396
|
-
children: /* @__PURE__ */ d(Me, {
|
|
1397
|
-
countryCode: e,
|
|
1398
|
-
phonePrefix: n,
|
|
1399
|
-
phoneError: i,
|
|
1400
|
-
disabled: a,
|
|
1401
|
-
autoFocus: !0,
|
|
1402
|
-
onPhoneChange: s
|
|
1403
|
-
})
|
|
1404
|
-
}), /* @__PURE__ */ d(S, {
|
|
1405
|
-
onClick: c,
|
|
1406
|
-
disabled: !o || a,
|
|
1407
|
-
isLoading: a,
|
|
1408
|
-
class: "IncodeRedirectSmsSendButton",
|
|
1409
|
-
children: u("redirect.sendLinkViaSms")
|
|
1410
|
-
})] });
|
|
1411
|
-
}, Pe = (e, t) => e.startsWith(t) ? `${t} ${e.slice(t.length).replace(/(\d{3})(?=\d)/g, "$1 ")}` : e, Fe = ({ phonePrefix: e, smsSent: n, error: i, manager: a, onResend: o }) => {
|
|
1412
|
-
let { t: c } = t(), [l, f] = u(e), [p, m] = u(!1), [h, g] = u(!1), _ = ee(e)?.code ?? "", v = Pe(l, e), y = s((e, t) => {
|
|
1413
|
-
f(e), m(t);
|
|
1414
|
-
}, []), b = s(() => {
|
|
1415
|
-
g(!0), a.sendSms(l), g(!1);
|
|
1416
|
-
}, [a, l]), x = s(() => {
|
|
1417
|
-
b(), o();
|
|
1418
|
-
}, [b, o]), S = s(() => {
|
|
1419
|
-
f(e), m(!1), a.resetSms();
|
|
1420
|
-
}, [a, e]);
|
|
1421
|
-
return /* @__PURE__ */ d(r, { children: [/* @__PURE__ */ d("p", {
|
|
1422
|
-
class: "IncodeRedirectTabDescription",
|
|
1423
|
-
children: c("v2.redirectToMobile.sms.description")
|
|
1424
|
-
}), n ? /* @__PURE__ */ d(je, {
|
|
1425
|
-
formattedPhone: v,
|
|
1426
|
-
onResend: x,
|
|
1427
|
-
onChangePhone: S
|
|
1428
|
-
}) : /* @__PURE__ */ d(Ne, {
|
|
1429
|
-
countryCode: _,
|
|
1430
|
-
phonePrefix: e,
|
|
1431
|
-
error: i,
|
|
1432
|
-
isSending: h,
|
|
1433
|
-
isPhoneValid: p,
|
|
1434
|
-
onPhoneChange: y,
|
|
1435
|
-
onSendSms: b
|
|
1436
|
-
})] });
|
|
1437
|
-
}, z = ({ redirectUrl: e, phonePrefix: n, smsSent: r, disableSmsOption: i, addContinueToDesktop: a, error: o, manager: c, logoSrc: l }) => {
|
|
1438
|
-
let { t: f } = t(), [p, m] = u(!1), h = s(() => {
|
|
1439
|
-
m(!0), setTimeout(() => m(!1), 3e3);
|
|
1440
|
-
}, []), g = s(() => {
|
|
1441
|
-
c.continueOnDesktop();
|
|
1442
|
-
}, [c]);
|
|
1443
|
-
return /* @__PURE__ */ d("div", {
|
|
1444
|
-
class: "IncodeRedirectContainer",
|
|
1445
|
-
children: [/* @__PURE__ */ d(se, { visible: p }), /* @__PURE__ */ d("div", {
|
|
1446
|
-
class: "IncodeRedirectCard",
|
|
1447
|
-
children: [
|
|
1448
|
-
/* @__PURE__ */ d(ae, { logoSrc: l }),
|
|
1449
|
-
/* @__PURE__ */ d("div", {
|
|
1450
|
-
class: "IncodeRedirectOptions",
|
|
1451
|
-
children: /* @__PURE__ */ d(j, {
|
|
1452
|
-
defaultValue: "qr",
|
|
1453
|
-
listClassName: "IncodeRedirectTabs",
|
|
1454
|
-
triggerClassName: "IncodeRedirectTab",
|
|
1455
|
-
activeTriggerClassName: "IncodeRedirectTabActive",
|
|
1456
|
-
children: [
|
|
1457
|
-
/* @__PURE__ */ d(j.List, { children: [/* @__PURE__ */ d(j.Trigger, {
|
|
1458
|
-
value: "qr",
|
|
1459
|
-
children: f("v2.redirectToMobile.tabs.0")
|
|
1460
|
-
}), i ? null : /* @__PURE__ */ d(j.Trigger, {
|
|
1461
|
-
value: "sms",
|
|
1462
|
-
children: f("v2.redirectToMobile.tabs.1")
|
|
1463
|
-
})] }),
|
|
1464
|
-
/* @__PURE__ */ d(j.Content, {
|
|
1465
|
-
value: "qr",
|
|
1466
|
-
children: /* @__PURE__ */ d(Ae, { redirectUrl: e })
|
|
1467
|
-
}),
|
|
1468
|
-
i ? null : /* @__PURE__ */ d(j.Content, {
|
|
1469
|
-
value: "sms",
|
|
1470
|
-
children: /* @__PURE__ */ d(Fe, {
|
|
1471
|
-
phonePrefix: n,
|
|
1472
|
-
smsSent: r,
|
|
1473
|
-
error: o,
|
|
1474
|
-
manager: c,
|
|
1475
|
-
onResend: h
|
|
1476
|
-
})
|
|
1477
|
-
})
|
|
1478
|
-
]
|
|
1479
|
-
})
|
|
1480
|
-
}),
|
|
1481
|
-
/* @__PURE__ */ d(oe, {
|
|
1482
|
-
addContinueToDesktop: a,
|
|
1483
|
-
onContinueOnDesktop: g
|
|
1484
|
-
})
|
|
1485
|
-
]
|
|
1486
|
-
})]
|
|
1487
|
-
});
|
|
1488
|
-
}, Ie = ({ title: e, subtitle: n, logoSrc: r }) => {
|
|
1489
|
-
let { t: i } = t(), a = e ?? i("verificationComplete.title"), o = n ?? i("verificationComplete.message");
|
|
1490
|
-
return /* @__PURE__ */ d("div", {
|
|
1491
|
-
class: "IncodeRedirectFinishedContainer",
|
|
1492
|
-
children: [
|
|
1493
|
-
/* @__PURE__ */ d("img", {
|
|
1494
|
-
src: r,
|
|
1495
|
-
alt: "Logo",
|
|
1496
|
-
class: "IncodeRedirectLogo"
|
|
1497
|
-
}),
|
|
1498
|
-
a ? /* @__PURE__ */ d("h1", {
|
|
1499
|
-
class: "IncodeRedirectFinishedTitle",
|
|
1500
|
-
children: a
|
|
1501
|
-
}) : null,
|
|
1502
|
-
o ? /* @__PURE__ */ d("p", {
|
|
1503
|
-
class: "IncodeRedirectFinishedSubtitle",
|
|
1504
|
-
children: o
|
|
1505
|
-
}) : null
|
|
1506
|
-
]
|
|
1507
|
-
});
|
|
1508
|
-
}, Le = ({ config: e, onFinish: t, onContinue: n, onError: r }) => {
|
|
1509
|
-
let [a, o] = h(() => ie({ config: e })), { logoSrc: s, logoHeightPx: c } = x({
|
|
1510
|
-
hideHeader: void 0,
|
|
1511
|
-
hideFooterBranding: void 0,
|
|
1512
|
-
logo: void 0,
|
|
1513
|
-
defaultLogoSrc: y
|
|
1514
|
-
});
|
|
1515
|
-
i(() => {
|
|
1516
|
-
a.status === "finished" && t?.();
|
|
1517
|
-
}, [a.status, t]), i(() => {
|
|
1518
|
-
a.status === "closed" && n?.();
|
|
1519
|
-
}, [a.status, n]), i(() => {
|
|
1520
|
-
a.status === "error" && r?.(a.error);
|
|
1521
|
-
}, [
|
|
1522
|
-
a.status,
|
|
1523
|
-
r,
|
|
1524
|
-
a
|
|
1525
|
-
]);
|
|
1526
|
-
let l = a.status === "idle" || a.status === "loading" ? /* @__PURE__ */ d(C, { fullScreen: !0 }) : a.status === "redirecting" ? /* @__PURE__ */ d(z, {
|
|
1527
|
-
redirectUrl: a.redirectUrl,
|
|
1528
|
-
phonePrefix: a.phonePrefix,
|
|
1529
|
-
smsSent: a.smsSent,
|
|
1530
|
-
disableSmsOption: e.disableSmsOption ?? !1,
|
|
1531
|
-
addContinueToDesktop: e.addContinueToDesktop ?? !1,
|
|
1532
|
-
error: a.error,
|
|
1533
|
-
manager: o,
|
|
1534
|
-
logoSrc: s
|
|
1535
|
-
}) : a.status === "finished" ? /* @__PURE__ */ d(Ie, { logoSrc: s }) : null;
|
|
1536
|
-
return /* @__PURE__ */ d("div", {
|
|
1537
|
-
class: "IncodeRedirectRoot",
|
|
1538
|
-
style: { "--logo-height": `${c}px` },
|
|
1539
|
-
children: l
|
|
1540
|
-
});
|
|
1541
|
-
}, B = ({ config: e, onFinish: t, onContinue: n, onError: r }) => /* @__PURE__ */ d(_, { children: e ? /* @__PURE__ */ d(Le, {
|
|
1542
|
-
config: e,
|
|
1543
|
-
onFinish: t,
|
|
1544
|
-
onContinue: n,
|
|
1545
|
-
onError: r
|
|
1546
|
-
}) : null });
|
|
1547
|
-
T(B, "incode-redirect-to-mobile");
|
|
1548
|
-
//#endregion
|
|
1549
|
-
//#region src/styles/generatePalette.ts
|
|
1550
|
-
function Re(e) {
|
|
1551
|
-
let t = e.replace("#", "");
|
|
1552
|
-
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
1553
|
-
let n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
1554
|
-
if (!n) return null;
|
|
1555
|
-
let r = Number.parseInt(n[1], 16) / 255, i = Number.parseInt(n[2], 16) / 255, a = Number.parseInt(n[3], 16) / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = 0, l = 0, u = (o + s) / 2;
|
|
1556
|
-
if (o !== s) {
|
|
1557
|
-
let e = o - s;
|
|
1558
|
-
switch (l = u > .5 ? e / (2 - o - s) : e / (o + s), o) {
|
|
1559
|
-
case r:
|
|
1560
|
-
c = ((i - a) / e + (i < a ? 6 : 0)) / 6;
|
|
1561
|
-
break;
|
|
1562
|
-
case i:
|
|
1563
|
-
c = ((a - r) / e + 2) / 6;
|
|
1564
|
-
break;
|
|
1565
|
-
case a:
|
|
1566
|
-
c = ((r - i) / e + 4) / 6;
|
|
1567
|
-
break;
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
return {
|
|
1571
|
-
h: c * 360,
|
|
1572
|
-
s: l * 100,
|
|
1573
|
-
l: u * 100
|
|
1574
|
-
};
|
|
1575
|
-
}
|
|
1576
|
-
function V(e, t, n) {
|
|
1577
|
-
let r = e / 360, i = t / 100, a = n / 100, o, s, c;
|
|
1578
|
-
if (i === 0) o = s = c = a;
|
|
1579
|
-
else {
|
|
1580
|
-
let e = (e, t, n) => (n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), t = a < .5 ? a * (1 + i) : a + i - a * i, n = 2 * a - t;
|
|
1581
|
-
o = e(n, t, r + 1 / 3), s = e(n, t, r), c = e(n, t, r - 1 / 3);
|
|
1582
|
-
}
|
|
1583
|
-
let l = (e) => {
|
|
1584
|
-
let t = Math.round(e * 255).toString(16);
|
|
1585
|
-
return t.length === 1 ? `0${t}` : t;
|
|
1586
|
-
};
|
|
1587
|
-
return `#${l(o)}${l(s)}${l(c)}`;
|
|
1588
|
-
}
|
|
1589
|
-
function ze(e) {
|
|
1590
|
-
let t = Re(e);
|
|
1591
|
-
if (!t) throw Error(`Invalid color format: ${e}`);
|
|
1592
|
-
return {
|
|
1593
|
-
50: V(t.h, t.s, 95),
|
|
1594
|
-
200: V(t.h, t.s, 80),
|
|
1595
|
-
300: V(t.h, t.s, 65),
|
|
1596
|
-
400: V(t.h, t.s, Math.min(100, t.l + 10)),
|
|
1597
|
-
500: e,
|
|
1598
|
-
600: V(t.h, t.s, Math.max(0, t.l - 10)),
|
|
1599
|
-
900: V(t.h, t.s, 20)
|
|
1600
|
-
};
|
|
1601
|
-
}
|
|
1602
|
-
//#endregion
|
|
1603
|
-
//#region src/styles/applyTheme.ts
|
|
1604
|
-
function Be(e, t) {
|
|
1605
|
-
if (typeof document > "u") return;
|
|
1606
|
-
let n = ze(e), r = document.getElementById("incode-theme");
|
|
1607
|
-
r || (r = document.createElement("style"), r.id = "incode-theme", document.head.appendChild(r));
|
|
1608
|
-
let i = t || "#ffffff", a = `
|
|
1609
|
-
:root,
|
|
1610
|
-
:host {
|
|
1611
|
-
--primitive-color-brand-50: ${n[50]};
|
|
1612
|
-
--primitive-color-brand-200: ${n[200]};
|
|
1613
|
-
--primitive-color-brand-300: ${n[300]};
|
|
1614
|
-
--primitive-color-brand-400: ${n[400]};
|
|
1615
|
-
--primitive-color-brand-500: ${n[500]};
|
|
1616
|
-
--primitive-color-brand-600: ${n[600]};
|
|
1617
|
-
--primitive-color-brand-900: ${n[900]};
|
|
1618
|
-
--button-primary-text-default: ${i};
|
|
1619
|
-
}
|
|
1620
|
-
`;
|
|
1621
|
-
r.textContent = a;
|
|
1622
|
-
}
|
|
1623
|
-
//#endregion
|
|
1624
|
-
//#region src/styles/fetchTheme.ts
|
|
1625
|
-
async function Ve() {
|
|
1626
|
-
return (await O.get("/omni/asset/fetch-all")).data;
|
|
1627
|
-
}
|
|
1628
|
-
var H = /* @__PURE__ */ new Map();
|
|
1629
|
-
async function He(e) {
|
|
1630
|
-
if (e.startsWith("data:")) return e;
|
|
1631
|
-
let t = H.get(e);
|
|
1632
|
-
if (t) return t;
|
|
1633
|
-
let n = await (await fetch(e)).blob(), r = await new Promise((e, t) => {
|
|
1634
|
-
let r = new FileReader();
|
|
1635
|
-
r.onloadend = () => e(r.result), r.onerror = t, r.readAsDataURL(n);
|
|
1636
|
-
});
|
|
1637
|
-
return H.set(e, r), r;
|
|
1638
|
-
}
|
|
1639
|
-
async function Ue() {
|
|
1640
|
-
let e = await Ve();
|
|
1641
|
-
if (!e.theme) throw Error("Theme URL not found in assets response");
|
|
1642
|
-
let t = e.theme, n = t.startsWith("http://") || t.startsWith("https://"), r;
|
|
1643
|
-
if (n) {
|
|
1644
|
-
let e = await fetch(t);
|
|
1645
|
-
if (!e.ok) throw Error(`Failed to fetch theme: ${e.statusText}`);
|
|
1646
|
-
r = await e.json();
|
|
1647
|
-
} else r = (await O.get(t)).data;
|
|
1648
|
-
let i = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || r.logo, a = i;
|
|
1649
|
-
return i && (a = await He(i)), {
|
|
1650
|
-
...r,
|
|
1651
|
-
logo: a
|
|
1652
|
-
};
|
|
1653
|
-
}
|
|
1654
|
-
async function We() {
|
|
1655
|
-
let e = await Ue();
|
|
1656
|
-
return e.main && Be(e.main, e.buttonColor), e;
|
|
1657
|
-
}
|
|
1658
|
-
//#endregion
|
|
1659
|
-
//#region src/modules/flow/flowInit.ts
|
|
1660
|
-
var U = () => import("../id/id.es.js").then((e) => e.Id);
|
|
1661
|
-
function Ge(e) {
|
|
1662
|
-
if (e === "PHONE") return () => import("@incodetech/core/phone").then((e) => e.phoneMachine);
|
|
1663
|
-
if (e === "EMAIL") return () => import("@incodetech/core/email").then((e) => e.emailMachine);
|
|
1664
|
-
if (e === "SELFIE") return () => import("@incodetech/core/selfie").then((e) => e.selfieMachine);
|
|
1665
|
-
if (e === "AUTHENTICATION") return () => import("@incodetech/core/authentication").then((e) => e.authenticationMachine);
|
|
1666
|
-
if (e === "ID" || e === "TUTORIAL_ID" || e === "SECOND_ID") return () => import("@incodetech/core/id").then((e) => e.idCaptureMachine);
|
|
1667
|
-
if (e === "FACE_MATCH") return () => import("@incodetech/core/face-match").then((e) => e.faceMatchMachine);
|
|
1668
|
-
if (e === "CURP_VALIDATION") return () => import("@incodetech/core/curp-validation").then((e) => e.curpValidationMachine);
|
|
1669
|
-
if (e === "GOVT_VALIDATION_PROVISIONING") return () => import("@incodetech/core/government-validation").then((e) => e.governmentValidationMachine);
|
|
1670
|
-
if (e === "GEOLOCATION") return () => import("@incodetech/core/geolocation").then((e) => e.geolocationMachine);
|
|
1671
|
-
if (e === "EXTERNAL_VERIFICATION") return () => import("@incodetech/core/ekyc").then((e) => e.ekycMachine);
|
|
1672
|
-
if (e === "EKYB") return () => import("@incodetech/core/ekyb").then((e) => e.ekybMachine);
|
|
1673
|
-
if (e === "DOCUMENT_CAPTURE" || e === "ADDRESS") return () => import("@incodetech/core/document-capture").then((e) => e.documentCaptureMachine);
|
|
1674
|
-
if (e === "COMBINED_CONSENT") return () => import("@incodetech/core/consent").then((e) => e.consentMachine);
|
|
1675
|
-
if (e === "MANDATORY_CONSENT") return () => import("@incodetech/core/mandatory-consent").then((e) => e.mandatoryConsentMachine);
|
|
1676
|
-
if (e === "SIGNATURE") return () => import("@incodetech/core/signature").then((e) => e.signatureMachine);
|
|
1677
|
-
if (e === "ANTIFRAUD") return () => import("@incodetech/core/antifraud").then((e) => e.antifraudMachine);
|
|
1678
|
-
}
|
|
1679
|
-
function Ke(e) {
|
|
1680
|
-
let t = {};
|
|
1681
|
-
for (let n of e) {
|
|
1682
|
-
let e = n.key;
|
|
1683
|
-
if (t[e]) continue;
|
|
1684
|
-
let r = Ge(e);
|
|
1685
|
-
r && (t[e] = r);
|
|
1686
|
-
}
|
|
1687
|
-
return t;
|
|
1688
|
-
}
|
|
1689
|
-
var W = {
|
|
1690
|
-
PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
|
|
1691
|
-
EMAIL: () => import("../email/email.es.js").then((e) => e.Email),
|
|
1692
|
-
SELFIE: () => import("../selfie/selfie.es.js").then((e) => e.Selfie),
|
|
1693
|
-
AUTHENTICATION: () => import("../authentication/authentication.es.js").then((e) => e.Authentication),
|
|
1694
|
-
ID: U,
|
|
1695
|
-
TUTORIAL_ID: U,
|
|
1696
|
-
SECOND_ID: U,
|
|
1697
|
-
FACE_MATCH: () => import("../faceMatch-BRVU6adg.js").then((e) => e.FaceMatch),
|
|
1698
|
-
CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
|
|
1699
|
-
GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then((e) => e.GovernmentValidation),
|
|
1700
|
-
GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
|
|
1701
|
-
EXTERNAL_VERIFICATION: () => import("../ekycModule-B8z7i5gA.js").then((e) => e.EkycModule),
|
|
1702
|
-
EKYB: () => import("../ekybModule-DviRZ6bj.js").then((e) => e.EkybModule),
|
|
1703
|
-
DOCUMENT_CAPTURE: () => import("../documentCapture-CYW_KpEI.js").then((e) => e.DocumentCapture),
|
|
1704
|
-
ADDRESS: () => import("../documentCapture-CYW_KpEI.js").then((e) => e.DocumentCapture),
|
|
1705
|
-
COMBINED_CONSENT: () => import("../consent/consent.es.js").then((e) => e.Consent),
|
|
1706
|
-
MANDATORY_CONSENT: () => import("../mandatoryConsent-DpejBjwV.js").then((e) => e.MandatoryConsent),
|
|
1707
|
-
SIGNATURE: () => import("../signature/signature.es.js").then((e) => e.Signature),
|
|
1708
|
-
ANTIFRAUD: () => import("../antifraud/antifraud.es.js").then((e) => e.Antifraud),
|
|
1709
|
-
CROSS_DOCUMENT_DATA_MATCH: () => import("../cross-document-data-match/cross-document-data-match.es.js").then((e) => e.CrossDocumentDataMatch)
|
|
1710
|
-
};
|
|
1711
|
-
function G() {
|
|
1712
|
-
let e = {};
|
|
1713
|
-
return ne({
|
|
1714
|
-
getFlow: async (t) => {
|
|
1715
|
-
let n = await re(t), r = Ke(n.flowModules ?? []);
|
|
1716
|
-
for (let t of Object.keys(e)) delete e[t];
|
|
1717
|
-
return Object.assign(e, r), n;
|
|
1718
|
-
},
|
|
1719
|
-
lazyModules: e
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
|
-
async function qe(e) {
|
|
1723
|
-
await m({
|
|
1724
|
-
apiURL: e.apiURL,
|
|
1725
|
-
token: e.token,
|
|
1726
|
-
wasm: !1,
|
|
1727
|
-
i18n: { lang: e.lang ?? "en" }
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1730
|
-
async function K(e) {
|
|
1731
|
-
let { apiURL: t, token: n, lang: r, flowManager: i } = e;
|
|
1732
|
-
await qe({
|
|
1733
|
-
apiURL: t,
|
|
1734
|
-
token: n,
|
|
1735
|
-
lang: r
|
|
1736
|
-
}), i.load();
|
|
1737
|
-
}
|
|
1738
|
-
async function q() {
|
|
1739
|
-
try {
|
|
1740
|
-
let e = await We(), t = {
|
|
1741
|
-
logoSrc: e.logo,
|
|
1742
|
-
hideFooterBranding: e.hideFooterBranding
|
|
1743
|
-
};
|
|
1744
|
-
return p(t), {
|
|
1745
|
-
theme: e,
|
|
1746
|
-
uiConfig: t
|
|
1747
|
-
};
|
|
1748
|
-
} catch {
|
|
1749
|
-
return {};
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
function J(e, t) {
|
|
1753
|
-
let n = D(e.flow);
|
|
1754
|
-
n.length > 0 && E(te({
|
|
1755
|
-
...t,
|
|
1756
|
-
pipelines: n
|
|
1757
|
-
})).catch((e) => {
|
|
1758
|
-
console.error("WASM warmup failed:", e);
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1761
|
-
function Je(e) {
|
|
1762
|
-
let t = e.currentStep;
|
|
1763
|
-
if (t) {
|
|
1764
|
-
let e = W[t];
|
|
1765
|
-
e && e().catch(() => {});
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
//#endregion
|
|
1769
|
-
//#region src/modules/flow/unsupportedModule.tsx
|
|
1770
|
-
var Ye = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ d("section", {
|
|
1771
|
-
class: "IncodeUnsupportedModule",
|
|
1772
|
-
"aria-live": "polite",
|
|
1773
|
-
children: /* @__PURE__ */ d("div", {
|
|
1774
|
-
class: "IncodeUnsupportedModuleContent",
|
|
1775
|
-
children: [
|
|
1776
|
-
/* @__PURE__ */ d("h2", {
|
|
1777
|
-
class: "IncodeUnsupportedModuleTitle",
|
|
1778
|
-
children: "Module not available"
|
|
1779
|
-
}),
|
|
1780
|
-
/* @__PURE__ */ d("p", {
|
|
1781
|
-
class: "IncodeUnsupportedModuleMessage",
|
|
1782
|
-
children: [
|
|
1783
|
-
"The \"",
|
|
1784
|
-
e,
|
|
1785
|
-
"\" module is not yet supported in this version."
|
|
1786
|
-
]
|
|
1787
|
-
}),
|
|
1788
|
-
/* @__PURE__ */ d(S, {
|
|
1789
|
-
onClick: t,
|
|
1790
|
-
class: "IncodeUnsupportedModuleButton",
|
|
1791
|
-
"data-testid": "unsupported-module-next-button",
|
|
1792
|
-
children: "Next"
|
|
1793
|
-
})
|
|
1794
|
-
]
|
|
1795
|
-
})
|
|
1796
|
-
}), Y = /* @__PURE__ */ new Map();
|
|
1797
|
-
function X(e) {
|
|
1798
|
-
let t = Y.get(e);
|
|
1
|
+
import { n as e } from "../i18n-DGG1zc7t.js";
|
|
2
|
+
import { _ as t, l as n, p as r, v as i } from "../vendor-preact-D6SntenC.js";
|
|
3
|
+
import { t as a } from "../uiConfig-CwpQ-IM6.js";
|
|
4
|
+
import { c as o, r as s } from "../loadingIcon-B3xEpDvA.js";
|
|
5
|
+
import { t as c } from "../spinner-4epdvlck.js";
|
|
6
|
+
import "../spinner-CbGt1yZr.js";
|
|
7
|
+
import { t as l } from "../incodeModule-C3p8eAh_.js";
|
|
8
|
+
import { t as u } from "../redirectToMobile-CxEfitZM.js";
|
|
9
|
+
import { a as d, c as f, i as p, n as m, o as h, r as g, s as _, t as v, u as y } from "../useModuleLoader-Jq27P9t5.js";
|
|
10
|
+
import { getRequiredWasmPipelines as b } from "@incodetech/core/flow";
|
|
11
|
+
//#region src/modules/flow/preloadFlow.ts
|
|
12
|
+
var x = /* @__PURE__ */ new Map();
|
|
13
|
+
function S(e) {
|
|
14
|
+
let t = x.get(e);
|
|
1799
15
|
if (!t) throw Error("Preload state not found");
|
|
1800
16
|
return {
|
|
1801
17
|
get isReady() {
|
|
@@ -1811,16 +27,16 @@ function X(e) {
|
|
|
1811
27
|
}
|
|
1812
28
|
},
|
|
1813
29
|
cancel() {
|
|
1814
|
-
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")),
|
|
30
|
+
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")), x.delete(e));
|
|
1815
31
|
}
|
|
1816
32
|
};
|
|
1817
33
|
}
|
|
1818
|
-
function
|
|
34
|
+
function C(e) {
|
|
1819
35
|
let { token: t } = e;
|
|
1820
|
-
if (
|
|
36
|
+
if (x.has(t)) return S(t);
|
|
1821
37
|
let n, r, i = new Promise((e, t) => {
|
|
1822
38
|
n = e, r = t;
|
|
1823
|
-
}), a =
|
|
39
|
+
}), a = d(), o = {
|
|
1824
40
|
status: "loading",
|
|
1825
41
|
flowManager: a,
|
|
1826
42
|
config: e,
|
|
@@ -1828,49 +44,49 @@ function Xe(e) {
|
|
|
1828
44
|
readyResolve: n,
|
|
1829
45
|
readyReject: r
|
|
1830
46
|
};
|
|
1831
|
-
return
|
|
47
|
+
return x.set(t, o), (async () => {
|
|
1832
48
|
try {
|
|
1833
|
-
await
|
|
49
|
+
await _({
|
|
1834
50
|
apiURL: e.apiURL,
|
|
1835
51
|
token: e.token,
|
|
1836
52
|
lang: e.lang,
|
|
1837
53
|
flowManager: a
|
|
1838
54
|
});
|
|
1839
|
-
let t = e.disableDashboardTheme ? Promise.resolve({}) :
|
|
55
|
+
let t = e.disableDashboardTheme ? Promise.resolve({}) : h().then((e) => {
|
|
1840
56
|
o.theme = e.theme, o.uiConfig = e.uiConfig;
|
|
1841
57
|
});
|
|
1842
58
|
o.unsubscribe = a.subscribe((t) => {
|
|
1843
59
|
if (t.status === "ready") {
|
|
1844
60
|
let n = t;
|
|
1845
|
-
e.wasmConfig &&
|
|
61
|
+
e.wasmConfig && y(n, e.wasmConfig), f(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
1846
62
|
} else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
|
|
1847
63
|
}), await t;
|
|
1848
64
|
} catch (e) {
|
|
1849
|
-
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")),
|
|
65
|
+
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), x.delete(t);
|
|
1850
66
|
}
|
|
1851
|
-
})(),
|
|
67
|
+
})(), S(t);
|
|
1852
68
|
}
|
|
1853
|
-
function
|
|
1854
|
-
return
|
|
69
|
+
function w(e) {
|
|
70
|
+
return x.get(e) ?? null;
|
|
1855
71
|
}
|
|
1856
|
-
function
|
|
1857
|
-
let t =
|
|
1858
|
-
return t &&
|
|
72
|
+
function T(e) {
|
|
73
|
+
let t = w(e);
|
|
74
|
+
return t && x.delete(e), t;
|
|
1859
75
|
}
|
|
1860
76
|
//#endregion
|
|
1861
77
|
//#region src/modules/flow/useFlowInitialization.ts
|
|
1862
|
-
function
|
|
1863
|
-
let { apiURL:
|
|
1864
|
-
let e =
|
|
78
|
+
function E(e) {
|
|
79
|
+
let { apiURL: i, token: o, lang: s, disableDashboardTheme: c, onError: l } = e, u = n(null), [f, p] = r(() => {
|
|
80
|
+
let e = w(o);
|
|
1865
81
|
if (e?.status === "ready") {
|
|
1866
|
-
let e =
|
|
1867
|
-
if (e) return
|
|
82
|
+
let e = T(o);
|
|
83
|
+
if (e) return u.current = e.flowManager, e.uiConfig && a(e.uiConfig), {
|
|
1868
84
|
status: "ready",
|
|
1869
85
|
flowManager: e.flowManager
|
|
1870
86
|
};
|
|
1871
87
|
}
|
|
1872
|
-
let t =
|
|
1873
|
-
return
|
|
88
|
+
let t = d();
|
|
89
|
+
return u.current = t, e?.status === "error" ? {
|
|
1874
90
|
status: "error",
|
|
1875
91
|
error: e.error ?? "Preload failed",
|
|
1876
92
|
flowManager: t
|
|
@@ -1878,450 +94,369 @@ function Ze(e) {
|
|
|
1878
94
|
status: "initializing",
|
|
1879
95
|
flowManager: t
|
|
1880
96
|
};
|
|
1881
|
-
}),
|
|
1882
|
-
return
|
|
1883
|
-
if (
|
|
1884
|
-
let e =
|
|
97
|
+
}), m = n(!1);
|
|
98
|
+
return t(() => {
|
|
99
|
+
if (f.status !== "initializing") return;
|
|
100
|
+
let e = w(o);
|
|
1885
101
|
if (e?.status === "loading") {
|
|
1886
102
|
e.readyPromise.then(() => {
|
|
1887
|
-
let e =
|
|
1888
|
-
e && (
|
|
103
|
+
let e = T(o);
|
|
104
|
+
e && (u.current = e.flowManager, e.uiConfig && a(e.uiConfig), p({
|
|
1889
105
|
status: "ready",
|
|
1890
106
|
flowManager: e.flowManager
|
|
1891
107
|
}));
|
|
1892
108
|
}).catch((e) => {
|
|
1893
109
|
let t = e instanceof Error ? e.message : "Preload failed";
|
|
1894
|
-
|
|
110
|
+
p({
|
|
1895
111
|
status: "error",
|
|
1896
112
|
error: t,
|
|
1897
|
-
flowManager:
|
|
1898
|
-
}),
|
|
113
|
+
flowManager: f.flowManager
|
|
114
|
+
}), l?.(t);
|
|
1899
115
|
});
|
|
1900
116
|
return;
|
|
1901
117
|
}
|
|
1902
|
-
|
|
118
|
+
m.current || (m.current = !0, (async () => {
|
|
1903
119
|
try {
|
|
1904
|
-
await
|
|
1905
|
-
apiURL:
|
|
1906
|
-
token:
|
|
1907
|
-
lang:
|
|
1908
|
-
flowManager:
|
|
1909
|
-
}), await (
|
|
1910
|
-
e.uiConfig &&
|
|
1911
|
-
})),
|
|
120
|
+
await _({
|
|
121
|
+
apiURL: i,
|
|
122
|
+
token: o,
|
|
123
|
+
lang: s,
|
|
124
|
+
flowManager: f.flowManager
|
|
125
|
+
}), await (c ? Promise.resolve() : h().then((e) => {
|
|
126
|
+
e.uiConfig && a(e.uiConfig);
|
|
127
|
+
})), p({
|
|
1912
128
|
status: "ready",
|
|
1913
|
-
flowManager:
|
|
129
|
+
flowManager: f.flowManager
|
|
1914
130
|
});
|
|
1915
131
|
} catch (e) {
|
|
1916
132
|
let t = e instanceof Error ? e.message : "Failed to initialize SDK";
|
|
1917
|
-
|
|
133
|
+
p({
|
|
1918
134
|
status: "error",
|
|
1919
135
|
error: t,
|
|
1920
|
-
flowManager:
|
|
1921
|
-
}),
|
|
136
|
+
flowManager: f.flowManager
|
|
137
|
+
}), l?.(t);
|
|
1922
138
|
}
|
|
1923
139
|
})());
|
|
1924
140
|
}, [
|
|
1925
|
-
|
|
1926
|
-
n,
|
|
1927
|
-
r,
|
|
1928
|
-
a,
|
|
141
|
+
i,
|
|
1929
142
|
o,
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
function Qe(e) {
|
|
1936
|
-
let { moduleKey: t, onModuleLoading: n, onModuleLoaded: r, onError: a } = e, [o, s] = u({ status: "idle" });
|
|
1937
|
-
return i(() => {
|
|
1938
|
-
if (!t) {
|
|
1939
|
-
s({ status: "idle" });
|
|
1940
|
-
return;
|
|
1941
|
-
}
|
|
1942
|
-
let e = W[t];
|
|
1943
|
-
if (!e) {
|
|
1944
|
-
s({
|
|
1945
|
-
status: "unsupported",
|
|
1946
|
-
moduleKey: t
|
|
1947
|
-
});
|
|
1948
|
-
return;
|
|
1949
|
-
}
|
|
1950
|
-
s({
|
|
1951
|
-
status: "loading",
|
|
1952
|
-
moduleKey: t
|
|
1953
|
-
}), n?.(t);
|
|
1954
|
-
let i = !1;
|
|
1955
|
-
return e().then((e) => {
|
|
1956
|
-
i || (s({
|
|
1957
|
-
status: "loaded",
|
|
1958
|
-
moduleKey: t,
|
|
1959
|
-
Component: e
|
|
1960
|
-
}), r?.(t));
|
|
1961
|
-
}).catch((e) => {
|
|
1962
|
-
if (!i) {
|
|
1963
|
-
let n = e instanceof Error ? e.message : "Failed to load module";
|
|
1964
|
-
s({
|
|
1965
|
-
status: "error",
|
|
1966
|
-
moduleKey: t,
|
|
1967
|
-
error: n
|
|
1968
|
-
}), a?.(`Failed to load ${t}: ${n}`);
|
|
1969
|
-
}
|
|
1970
|
-
}), () => {
|
|
1971
|
-
i = !0;
|
|
1972
|
-
};
|
|
1973
|
-
}, [
|
|
1974
|
-
t,
|
|
1975
|
-
n,
|
|
1976
|
-
r,
|
|
1977
|
-
a
|
|
1978
|
-
]), o;
|
|
1979
|
-
}
|
|
1980
|
-
function $e(e, t) {
|
|
1981
|
-
let n = c(/* @__PURE__ */ new Set());
|
|
1982
|
-
i(() => {
|
|
1983
|
-
if (t < e.length - 1) {
|
|
1984
|
-
let r = e[t + 1];
|
|
1985
|
-
if (r && !n.current.has(r)) {
|
|
1986
|
-
n.current.add(r);
|
|
1987
|
-
let e = W[r];
|
|
1988
|
-
e && e().catch(() => {
|
|
1989
|
-
n.current.delete(r);
|
|
1990
|
-
});
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
}, [e, t]);
|
|
143
|
+
s,
|
|
144
|
+
c,
|
|
145
|
+
l,
|
|
146
|
+
f
|
|
147
|
+
]), f;
|
|
1994
148
|
}
|
|
1995
149
|
//#endregion
|
|
1996
150
|
//#region src/modules/flow/flow.tsx
|
|
1997
|
-
var
|
|
1998
|
-
let { t:
|
|
1999
|
-
apiURL:
|
|
2000
|
-
token:
|
|
2001
|
-
lang:
|
|
2002
|
-
disableDashboardTheme:
|
|
2003
|
-
onError:
|
|
2004
|
-
}), [
|
|
2005
|
-
moduleKey:
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
151
|
+
var D = ({ config: n, onFinish: a, onError: s }) => {
|
|
152
|
+
let { t: l, i18n: d } = e(), [f, h] = r(!1), _ = E({
|
|
153
|
+
apiURL: n.apiURL,
|
|
154
|
+
token: n.token,
|
|
155
|
+
lang: n.lang,
|
|
156
|
+
disableDashboardTheme: n.disableDashboardTheme,
|
|
157
|
+
onError: s
|
|
158
|
+
}), [x, S] = o(() => _.flowManager, { autoLoad: !1 }), C = x?.status === "ready" && x.flow.redirectDesktopToMobile && !f, w = v({
|
|
159
|
+
moduleKey: x?.status === "ready" && !C ? x.currentStep : void 0,
|
|
160
|
+
modules: p,
|
|
161
|
+
onModuleLoading: n.onModuleLoading,
|
|
162
|
+
onModuleLoaded: n.onModuleLoaded,
|
|
163
|
+
onError: s
|
|
2009
164
|
});
|
|
2010
|
-
if (
|
|
2011
|
-
|
|
2012
|
-
}, [
|
|
2013
|
-
if (
|
|
2014
|
-
let
|
|
2015
|
-
|
|
2016
|
-
}
|
|
2017
|
-
}, [
|
|
2018
|
-
|
|
165
|
+
if (m(x?.status === "ready" ? x.steps : [], x?.status === "ready" ? x.currentStepIndex : -1, p), t(() => {
|
|
166
|
+
n.lang && d.language !== n.lang && d.changeLanguage(n.lang);
|
|
167
|
+
}, [n.lang, d]), t(() => {
|
|
168
|
+
if (x?.status === "ready" && n.wasmConfig) {
|
|
169
|
+
let e = x, t = b(e.flow);
|
|
170
|
+
t.length > 0 && (n.onWasmWarmup?.(t), y(e, n.wasmConfig));
|
|
171
|
+
}
|
|
172
|
+
}, [x, n]), t(() => {
|
|
173
|
+
x?.status === "finished" && a(x.finishStatus);
|
|
2019
174
|
}, [
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
]),
|
|
2024
|
-
|
|
175
|
+
x?.status,
|
|
176
|
+
a,
|
|
177
|
+
x
|
|
178
|
+
]), t(() => {
|
|
179
|
+
x?.status === "error" && s && s(x.error);
|
|
2025
180
|
}, [
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
]),
|
|
2030
|
-
|
|
2031
|
-
}, [
|
|
181
|
+
x?.status,
|
|
182
|
+
s,
|
|
183
|
+
x
|
|
184
|
+
]), t(() => {
|
|
185
|
+
x?.status === "ready" && x.currentStep === "ID" && x.steps.includes("TUTORIAL_ID") && S.completeModule();
|
|
186
|
+
}, [x, S]), _.status === "error") return /* @__PURE__ */ i("div", {
|
|
2032
187
|
class: "IncodeFlow",
|
|
2033
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ i("div", { children: ["Error: ", _.error] })
|
|
2034
189
|
});
|
|
2035
|
-
if (
|
|
190
|
+
if (_.status === "initializing" || !x || x.status === "idle" || x.status === "loading") return /* @__PURE__ */ i("div", {
|
|
2036
191
|
class: "IncodeFlow",
|
|
2037
|
-
children: /* @__PURE__ */
|
|
2038
|
-
title:
|
|
2039
|
-
subtitle:
|
|
2040
|
-
size:
|
|
192
|
+
children: /* @__PURE__ */ i(c, {
|
|
193
|
+
title: n.spinnerConfig?.title,
|
|
194
|
+
subtitle: n.spinnerConfig?.subtitle,
|
|
195
|
+
size: n.spinnerConfig?.size,
|
|
2041
196
|
fullScreen: !0
|
|
2042
197
|
})
|
|
2043
198
|
});
|
|
2044
|
-
if (
|
|
199
|
+
if (x.status === "error") return /* @__PURE__ */ i("div", {
|
|
2045
200
|
class: "IncodeFlow",
|
|
2046
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ i("div", { children: ["Error: ", x.error] })
|
|
2047
202
|
});
|
|
2048
|
-
if (
|
|
2049
|
-
if (
|
|
2050
|
-
let { currentStep:
|
|
2051
|
-
if (
|
|
203
|
+
if (x.status === "finished") return null;
|
|
204
|
+
if (x.status === "ready") {
|
|
205
|
+
let { currentStep: e, config: t, flow: { flowId: r, disableSmsOption: a, addContinueToDesktop: o, qrPhishingResistance: d } } = x;
|
|
206
|
+
if (C) return /* @__PURE__ */ i("div", {
|
|
2052
207
|
class: "IncodeFlow",
|
|
2053
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ i(u, {
|
|
2054
209
|
config: {
|
|
2055
|
-
flowId:
|
|
2056
|
-
disableSmsOption:
|
|
2057
|
-
addContinueToDesktop:
|
|
2058
|
-
qrPhishingResistance:
|
|
2059
|
-
authHint:
|
|
2060
|
-
lang:
|
|
210
|
+
flowId: r,
|
|
211
|
+
disableSmsOption: a,
|
|
212
|
+
addContinueToDesktop: o,
|
|
213
|
+
qrPhishingResistance: d,
|
|
214
|
+
authHint: n.authHint,
|
|
215
|
+
lang: n.lang
|
|
2061
216
|
},
|
|
2062
|
-
onFinish: () =>
|
|
2063
|
-
onContinue: () =>
|
|
2064
|
-
onError:
|
|
217
|
+
onFinish: () => S.completeFlow(),
|
|
218
|
+
onContinue: () => h(!0),
|
|
219
|
+
onError: s
|
|
2065
220
|
})
|
|
2066
221
|
});
|
|
2067
|
-
if (!
|
|
222
|
+
if (!e || !t) return /* @__PURE__ */ i("div", {
|
|
2068
223
|
class: "IncodeFlow",
|
|
2069
|
-
children: /* @__PURE__ */
|
|
2070
|
-
title:
|
|
2071
|
-
subtitle:
|
|
2072
|
-
size:
|
|
224
|
+
children: /* @__PURE__ */ i(c, {
|
|
225
|
+
title: n.spinnerConfig?.title ?? l("loadingCircle.hangOn"),
|
|
226
|
+
subtitle: n.spinnerConfig?.subtitle ?? l("loadingCircle.validating"),
|
|
227
|
+
size: n.spinnerConfig?.size,
|
|
2073
228
|
fullScreen: !0
|
|
2074
229
|
})
|
|
2075
230
|
});
|
|
2076
|
-
if (
|
|
231
|
+
if (w.status === "unsupported") return /* @__PURE__ */ i("div", {
|
|
2077
232
|
class: "IncodeFlow",
|
|
2078
|
-
children: /* @__PURE__ */
|
|
2079
|
-
moduleKey:
|
|
2080
|
-
onNext: () =>
|
|
233
|
+
children: /* @__PURE__ */ i(g, {
|
|
234
|
+
moduleKey: e,
|
|
235
|
+
onNext: () => S.completeModule()
|
|
2081
236
|
})
|
|
2082
237
|
});
|
|
2083
|
-
if (
|
|
238
|
+
if (w.status === "idle" || w.status === "loading" || w.status === "error") return /* @__PURE__ */ i("div", {
|
|
2084
239
|
class: "IncodeFlow",
|
|
2085
|
-
children: /* @__PURE__ */
|
|
2086
|
-
title:
|
|
2087
|
-
subtitle:
|
|
2088
|
-
size:
|
|
240
|
+
children: /* @__PURE__ */ i(c, {
|
|
241
|
+
title: n.spinnerConfig?.title ?? l("loadingCircle.hangOn"),
|
|
242
|
+
subtitle: n.spinnerConfig?.subtitle ?? l("loadingCircle.validating"),
|
|
243
|
+
size: n.spinnerConfig?.size,
|
|
2089
244
|
fullScreen: !0
|
|
2090
245
|
})
|
|
2091
246
|
});
|
|
2092
|
-
let { Component:
|
|
2093
|
-
if (
|
|
247
|
+
let { Component: f } = w;
|
|
248
|
+
if (e === "SELFIE") return /* @__PURE__ */ i("div", {
|
|
2094
249
|
class: "IncodeFlow",
|
|
2095
|
-
children: /* @__PURE__ */
|
|
2096
|
-
config:
|
|
2097
|
-
onFinish: () =>
|
|
250
|
+
children: /* @__PURE__ */ i(f, {
|
|
251
|
+
config: t,
|
|
252
|
+
onFinish: () => S.completeModule(),
|
|
2098
253
|
onError: (e) => {
|
|
2099
|
-
|
|
254
|
+
s?.(e ?? "Selfie verification error");
|
|
2100
255
|
}
|
|
2101
|
-
}, `selfie-${
|
|
256
|
+
}, `selfie-${x.currentStepIndex}`)
|
|
2102
257
|
});
|
|
2103
|
-
if (
|
|
258
|
+
if (e === "AUTHENTICATION") return /* @__PURE__ */ i("div", {
|
|
2104
259
|
class: "IncodeFlow",
|
|
2105
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ i(f, {
|
|
2106
261
|
config: {
|
|
2107
|
-
...
|
|
2108
|
-
authHint:
|
|
262
|
+
...t,
|
|
263
|
+
authHint: n.authHint
|
|
2109
264
|
},
|
|
2110
|
-
onFinish: () =>
|
|
265
|
+
onFinish: () => S.completeModule(),
|
|
2111
266
|
onError: (e) => {
|
|
2112
|
-
|
|
267
|
+
s?.(e ?? "Authentication error");
|
|
2113
268
|
}
|
|
2114
|
-
}, `authentication-${
|
|
269
|
+
}, `authentication-${x.currentStepIndex}`)
|
|
2115
270
|
});
|
|
2116
|
-
if (
|
|
271
|
+
if (e === "PHONE") return /* @__PURE__ */ i("div", {
|
|
2117
272
|
class: "IncodeFlow",
|
|
2118
|
-
children: /* @__PURE__ */
|
|
2119
|
-
config:
|
|
2120
|
-
onFinish: () =>
|
|
273
|
+
children: /* @__PURE__ */ i(f, {
|
|
274
|
+
config: t,
|
|
275
|
+
onFinish: () => S.completeModule(),
|
|
2121
276
|
onError: (e) => {
|
|
2122
|
-
|
|
277
|
+
s?.(e ?? "Phone verification error");
|
|
2123
278
|
}
|
|
2124
|
-
}, `phone-${
|
|
279
|
+
}, `phone-${x.currentStepIndex}`)
|
|
2125
280
|
});
|
|
2126
|
-
if (
|
|
2127
|
-
let e =
|
|
2128
|
-
return !e || typeof e.otpVerification != "boolean" || typeof e.otpExpirationInMinutes != "number" ? /* @__PURE__ */
|
|
281
|
+
if (e === "EMAIL") {
|
|
282
|
+
let e = t;
|
|
283
|
+
return !e || typeof e.otpVerification != "boolean" || typeof e.otpExpirationInMinutes != "number" ? /* @__PURE__ */ i("div", {
|
|
2129
284
|
class: "IncodeFlow",
|
|
2130
|
-
children: /* @__PURE__ */
|
|
2131
|
-
}) : /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ i("div", { children: "Error: Invalid email configuration" })
|
|
286
|
+
}) : /* @__PURE__ */ i("div", {
|
|
2132
287
|
class: "IncodeFlow",
|
|
2133
|
-
children: /* @__PURE__ */
|
|
2134
|
-
config:
|
|
2135
|
-
|
|
2136
|
-
prefill: e.prefill ?? !1
|
|
2137
|
-
},
|
|
2138
|
-
onFinish: () => p.completeModule(),
|
|
288
|
+
children: /* @__PURE__ */ i(f, {
|
|
289
|
+
config: e,
|
|
290
|
+
onFinish: () => S.completeModule(),
|
|
2139
291
|
onError: (e) => {
|
|
2140
|
-
|
|
292
|
+
s?.(e ?? "Email verification error");
|
|
2141
293
|
}
|
|
2142
|
-
}, `email-${
|
|
294
|
+
}, `email-${x.currentStepIndex}`)
|
|
2143
295
|
});
|
|
2144
296
|
}
|
|
2145
|
-
if (
|
|
2146
|
-
let
|
|
2147
|
-
return /* @__PURE__ */
|
|
297
|
+
if (e === "TUTORIAL_ID" || e === "SECOND_ID" || e === "ID" && !x.steps.includes("TUTORIAL_ID")) {
|
|
298
|
+
let n = t;
|
|
299
|
+
return /* @__PURE__ */ i("div", {
|
|
2148
300
|
class: "IncodeFlow",
|
|
2149
|
-
children: /* @__PURE__ */
|
|
2150
|
-
config:
|
|
2151
|
-
...
|
|
301
|
+
children: /* @__PURE__ */ i(f, {
|
|
302
|
+
config: e === "SECOND_ID" ? {
|
|
303
|
+
...n,
|
|
2152
304
|
isSecondId: !0
|
|
2153
|
-
} :
|
|
2154
|
-
onFinish: () =>
|
|
2155
|
-
onError: (e) => {
|
|
2156
|
-
r?.(e ?? "ID capture error");
|
|
2157
|
-
}
|
|
2158
|
-
}, `id-${f.currentStepIndex}`)
|
|
2159
|
-
});
|
|
2160
|
-
}
|
|
2161
|
-
if (t === "FACE_MATCH") {
|
|
2162
|
-
let e = n;
|
|
2163
|
-
return /* @__PURE__ */ d("div", {
|
|
2164
|
-
class: "IncodeFlow",
|
|
2165
|
-
children: /* @__PURE__ */ d(u, {
|
|
2166
|
-
config: {
|
|
2167
|
-
variant: e.matchingType,
|
|
2168
|
-
disableFaceMatchAnimation: e.disableFaceMatchAnimation ?? !1
|
|
2169
|
-
},
|
|
2170
|
-
onFinish: () => p.completeModule(),
|
|
305
|
+
} : n,
|
|
306
|
+
onFinish: () => S.completeModule(),
|
|
2171
307
|
onError: (e) => {
|
|
2172
|
-
|
|
308
|
+
s?.(e ?? "ID capture error");
|
|
2173
309
|
}
|
|
2174
|
-
}, `
|
|
310
|
+
}, `id-${x.currentStepIndex}`)
|
|
2175
311
|
});
|
|
2176
312
|
}
|
|
2177
|
-
if (
|
|
313
|
+
if (e === "FACE_MATCH") return /* @__PURE__ */ i("div", {
|
|
2178
314
|
class: "IncodeFlow",
|
|
2179
|
-
children: /* @__PURE__ */
|
|
2180
|
-
config:
|
|
2181
|
-
onFinish: () =>
|
|
315
|
+
children: /* @__PURE__ */ i(f, {
|
|
316
|
+
config: t,
|
|
317
|
+
onFinish: () => S.completeModule(),
|
|
2182
318
|
onError: (e) => {
|
|
2183
|
-
|
|
319
|
+
s?.(e ?? "Face match error");
|
|
2184
320
|
}
|
|
2185
|
-
}, `
|
|
321
|
+
}, `face-match-${x.currentStepIndex}`)
|
|
2186
322
|
});
|
|
2187
|
-
if (
|
|
323
|
+
if (e === "CURP_VALIDATION") return /* @__PURE__ */ i("div", {
|
|
2188
324
|
class: "IncodeFlow",
|
|
2189
|
-
children: /* @__PURE__ */
|
|
2190
|
-
config:
|
|
2191
|
-
onFinish: () =>
|
|
325
|
+
children: /* @__PURE__ */ i(f, {
|
|
326
|
+
config: t,
|
|
327
|
+
onFinish: () => S.completeModule(),
|
|
2192
328
|
onError: (e) => {
|
|
2193
|
-
|
|
329
|
+
s?.(e ?? "CURP validation error");
|
|
2194
330
|
}
|
|
2195
|
-
}, `
|
|
331
|
+
}, `curp-validation-${x.currentStepIndex}`)
|
|
2196
332
|
});
|
|
2197
|
-
if (
|
|
333
|
+
if (e === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ i("div", {
|
|
2198
334
|
class: "IncodeFlow",
|
|
2199
|
-
children: /* @__PURE__ */
|
|
2200
|
-
config:
|
|
2201
|
-
onFinish: () =>
|
|
335
|
+
children: /* @__PURE__ */ i(f, {
|
|
336
|
+
config: t,
|
|
337
|
+
onFinish: () => S.completeModule(),
|
|
2202
338
|
onError: (e) => {
|
|
2203
|
-
|
|
339
|
+
s?.(e ?? "Government validation error");
|
|
2204
340
|
}
|
|
2205
|
-
}, `
|
|
341
|
+
}, `govt-validation-${x.currentStepIndex}`)
|
|
2206
342
|
});
|
|
2207
|
-
if (
|
|
343
|
+
if (e === "GEOLOCATION") return /* @__PURE__ */ i("div", {
|
|
2208
344
|
class: "IncodeFlow",
|
|
2209
|
-
children: /* @__PURE__ */
|
|
2210
|
-
config:
|
|
2211
|
-
onFinish: () =>
|
|
345
|
+
children: /* @__PURE__ */ i(f, {
|
|
346
|
+
config: t,
|
|
347
|
+
onFinish: () => S.completeModule(),
|
|
2212
348
|
onError: (e) => {
|
|
2213
|
-
|
|
349
|
+
s?.(e ?? "Geolocation error");
|
|
2214
350
|
}
|
|
2215
|
-
}, `
|
|
351
|
+
}, `geolocation-${x.currentStepIndex}`)
|
|
2216
352
|
});
|
|
2217
|
-
if (
|
|
353
|
+
if (e === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ i("div", {
|
|
2218
354
|
class: "IncodeFlow",
|
|
2219
|
-
children: /* @__PURE__ */
|
|
2220
|
-
config:
|
|
2221
|
-
onFinish: () =>
|
|
355
|
+
children: /* @__PURE__ */ i(f, {
|
|
356
|
+
config: { flowId: x.flow.flowId },
|
|
357
|
+
onFinish: () => S.completeModule(),
|
|
2222
358
|
onError: (e) => {
|
|
2223
|
-
|
|
359
|
+
s?.(e ?? "External verification error");
|
|
2224
360
|
}
|
|
2225
|
-
}, `
|
|
361
|
+
}, `ekyc-${x.currentStepIndex}`)
|
|
2226
362
|
});
|
|
2227
|
-
if (
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
return /* @__PURE__ */ d("div", {
|
|
363
|
+
if (e === "DOCUMENT_CAPTURE") return /* @__PURE__ */ i("div", {
|
|
364
|
+
class: "IncodeFlow",
|
|
365
|
+
children: /* @__PURE__ */ i(f, {
|
|
366
|
+
config: t,
|
|
367
|
+
onFinish: () => S.completeModule(),
|
|
368
|
+
onError: (e) => {
|
|
369
|
+
s?.(e ?? "Document capture error");
|
|
370
|
+
}
|
|
371
|
+
}, `document-capture-${x.currentStepIndex}`)
|
|
372
|
+
});
|
|
373
|
+
if (e === "ADDRESS") return /* @__PURE__ */ i("div", {
|
|
374
|
+
class: "IncodeFlow",
|
|
375
|
+
children: /* @__PURE__ */ i(f, {
|
|
376
|
+
config: {
|
|
377
|
+
...t,
|
|
378
|
+
processingType: "addressStatement"
|
|
379
|
+
},
|
|
380
|
+
onFinish: () => S.completeModule(),
|
|
381
|
+
onError: (e) => {
|
|
382
|
+
s?.(e ?? "Address capture error");
|
|
383
|
+
}
|
|
384
|
+
}, `address-${x.currentStepIndex}`)
|
|
385
|
+
});
|
|
386
|
+
if (e === "SIGNATURE") return /* @__PURE__ */ i("div", {
|
|
387
|
+
class: "IncodeFlow",
|
|
388
|
+
children: /* @__PURE__ */ i(f, {
|
|
389
|
+
config: t,
|
|
390
|
+
onFinish: () => S.completeModule(),
|
|
391
|
+
onError: (e) => {
|
|
392
|
+
s?.(e ?? "Signature capture error");
|
|
393
|
+
}
|
|
394
|
+
}, `signature-${x.currentStepIndex}`)
|
|
395
|
+
});
|
|
396
|
+
if (e === "EKYB") {
|
|
397
|
+
let e = t;
|
|
398
|
+
return /* @__PURE__ */ i("div", {
|
|
2264
399
|
class: "IncodeFlow",
|
|
2265
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ i(f, {
|
|
2266
401
|
config: {
|
|
2267
|
-
flowId:
|
|
402
|
+
flowId: r,
|
|
2268
403
|
checkBusinessName: e.checkBusinessName,
|
|
2269
404
|
checkAddress: e.checkAddress,
|
|
2270
405
|
checkTaxId: e.checkTaxId,
|
|
2271
406
|
checkUniqueBeneficialOwner: e.checkUniqueBeneficialOwner
|
|
2272
407
|
},
|
|
2273
|
-
onFinish: () =>
|
|
408
|
+
onFinish: () => S.completeModule(),
|
|
2274
409
|
onError: (e) => {
|
|
2275
|
-
|
|
410
|
+
s?.(e ?? "eKYB verification error");
|
|
2276
411
|
}
|
|
2277
|
-
}, `ekyb-${
|
|
412
|
+
}, `ekyb-${x.currentStepIndex}`)
|
|
2278
413
|
});
|
|
2279
414
|
}
|
|
2280
|
-
if (
|
|
415
|
+
if (e === "COMBINED_CONSENT") return /* @__PURE__ */ i("div", {
|
|
2281
416
|
class: "IncodeFlow",
|
|
2282
|
-
children: /* @__PURE__ */
|
|
2283
|
-
config:
|
|
2284
|
-
onFinish: () =>
|
|
417
|
+
children: /* @__PURE__ */ i(f, {
|
|
418
|
+
config: t,
|
|
419
|
+
onFinish: () => S.completeModule(),
|
|
2285
420
|
onError: (e) => {
|
|
2286
|
-
|
|
421
|
+
s?.(e ?? "Combined consent error");
|
|
2287
422
|
}
|
|
2288
|
-
}, `combined-consent-${
|
|
423
|
+
}, `combined-consent-${x.currentStepIndex}`)
|
|
2289
424
|
});
|
|
2290
|
-
if (
|
|
425
|
+
if (e === "MANDATORY_CONSENT") return /* @__PURE__ */ i("div", {
|
|
2291
426
|
class: "IncodeFlow",
|
|
2292
|
-
children: /* @__PURE__ */
|
|
2293
|
-
config:
|
|
2294
|
-
onFinish: () =>
|
|
427
|
+
children: /* @__PURE__ */ i(f, {
|
|
428
|
+
config: t,
|
|
429
|
+
onFinish: () => S.completeModule(),
|
|
2295
430
|
onError: (e) => {
|
|
2296
|
-
|
|
431
|
+
s?.(e ?? "Mandatory consent error");
|
|
2297
432
|
}
|
|
2298
|
-
}, `mandatory-consent-${
|
|
433
|
+
}, `mandatory-consent-${x.currentStepIndex}`)
|
|
2299
434
|
});
|
|
2300
|
-
if (
|
|
435
|
+
if (e === "ANTIFRAUD") return /* @__PURE__ */ i("div", {
|
|
2301
436
|
class: "IncodeFlow",
|
|
2302
|
-
children: /* @__PURE__ */
|
|
2303
|
-
onFinish: () =>
|
|
437
|
+
children: /* @__PURE__ */ i(f, {
|
|
438
|
+
onFinish: () => S.completeModule(),
|
|
2304
439
|
onError: (e) => {
|
|
2305
|
-
|
|
440
|
+
s?.(e ?? "Antifraud check error");
|
|
2306
441
|
}
|
|
2307
|
-
}, `antifraud-${
|
|
442
|
+
}, `antifraud-${x.currentStepIndex}`)
|
|
2308
443
|
});
|
|
2309
|
-
if (
|
|
444
|
+
if (e === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ i("div", {
|
|
2310
445
|
class: "IncodeFlow",
|
|
2311
|
-
children: /* @__PURE__ */
|
|
2312
|
-
onFinish: () =>
|
|
446
|
+
children: /* @__PURE__ */ i(f, {
|
|
447
|
+
onFinish: () => S.completeModule(),
|
|
2313
448
|
onError: (e) => {
|
|
2314
|
-
|
|
449
|
+
s?.(e ?? "Cross document data match error");
|
|
2315
450
|
}
|
|
2316
|
-
}, `cross-document-data-match-${
|
|
451
|
+
}, `cross-document-data-match-${x.currentStepIndex}`)
|
|
2317
452
|
});
|
|
2318
453
|
}
|
|
2319
454
|
return null;
|
|
2320
|
-
},
|
|
455
|
+
}, O = ({ config: e, onFinish: t = () => {}, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(D, {
|
|
2321
456
|
config: e,
|
|
2322
457
|
onFinish: t,
|
|
2323
458
|
onError: n
|
|
2324
459
|
}) : null });
|
|
2325
|
-
|
|
460
|
+
l(O, "incode-flow");
|
|
2326
461
|
//#endregion
|
|
2327
|
-
export {
|
|
462
|
+
export { O as IncodeFlow, C as preloadIncodeFlow };
|