@incodetech/web 0.0.0-dev-20260407-4677d7f → 0.0.0-dev-20260407-2c382da

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