@starfish-codes/hellgate 3.9.0 → 3.10.0

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 (31) hide show
  1. package/dist/3ds/typings.d.ts +1 -0
  2. package/dist/__tests__/card-handler.spec.d.ts +1 -0
  3. package/dist/__tests__/test-utils.d.ts +11 -0
  4. package/dist/card/card-handler.d.ts +24 -8
  5. package/dist/card/coordinator/__tests__/card-handler-coordinator.spec.d.ts +1 -0
  6. package/dist/card/coordinator/card-handler-coordinator.d.ts +34 -0
  7. package/dist/card/coordinator/index.d.ts +2 -0
  8. package/dist/card/coordinator/typings.d.ts +45 -0
  9. package/dist/card/typings.d.ts +30 -0
  10. package/dist/card/ui/elements/base-element.d.ts +3 -3
  11. package/dist/card/ui/elements/utils.d.ts +1 -2
  12. package/dist/card/ui/iframe/elements/base-element.d.ts +4 -2
  13. package/dist/card/ui/iframe/elements/card-expiration-month.d.ts +1 -0
  14. package/dist/card/ui/iframe/elements/text-element.d.ts +1 -0
  15. package/dist/card/ui/iframe/index.d.ts +1 -0
  16. package/dist/card/ui/iframe/utils.d.ts +1 -0
  17. package/dist/card/ui/typings.d.ts +8 -5
  18. package/dist/card/ui/utils.d.ts +3 -1
  19. package/dist/coordinator/coordinator.d.ts +38 -0
  20. package/dist/coordinator/iframe/constants.d.ts +1 -0
  21. package/dist/coordinator/iframe/iframe-coordinator.d.ts +33 -0
  22. package/dist/coordinator/iframe/iframe.d.ts +1 -0
  23. package/dist/coordinator/iframe/index.d.ts +2 -0
  24. package/dist/coordinator/index.d.ts +3 -0
  25. package/dist/coordinator/typings.d.ts +39 -0
  26. package/dist/hellgate-sdk.mjs +464 -1145
  27. package/dist/hellgate-sdk.umd.js +1 -1
  28. package/dist/hellgate.d.ts +5 -2
  29. package/dist/session/session.d.ts +1 -1
  30. package/dist/utils.d.ts +1 -0
  31. package/package.json +7 -6
@@ -1,25 +1,28 @@
1
- function re(t) {
2
- return Array.isArray(t) ? t.filter(Boolean) : Object.fromEntries(Object.entries(t).map(([e, r]) => [
1
+ function C(i) {
2
+ return Array.isArray(i) ? i.filter(Boolean) : Object.fromEntries(Object.entries(i).map(([e, t]) => [
3
3
  e,
4
- typeof r == "object" && r && !Array.isArray(r) ? re(r) : r
5
- ]).filter(([e, r]) => typeof r == "object" && r && !Array.isArray(r) ? !!Object.keys(r).length : r != null && r != null));
4
+ typeof t == "object" && t && !Array.isArray(t) ? C(t) : t
5
+ ]).filter(([e, t]) => typeof t == "object" && t && !Array.isArray(t) ? !!Object.keys(t).length : t != null && t != null));
6
6
  }
7
- function C(t, e) {
8
- const r = { ...t, ...e }, n = Object.keys(r);
9
- for (const i of n) {
10
- const a = t[i], s = e[i];
11
- typeof a == "object" && !Array.isArray(a) && a && typeof s == "object" && !Array.isArray(s) && s && (r[i] = C(a, s));
7
+ function h(i, e) {
8
+ const t = { ...i, ...e }, r = Object.keys(t);
9
+ for (const n of r) {
10
+ const a = i[n], s = e[n];
11
+ typeof a == "object" && !Array.isArray(a) && a && typeof s == "object" && !Array.isArray(s) && s && (t[n] = h(a, s));
12
12
  }
13
- return r;
13
+ return t;
14
+ }
15
+ function E(i) {
16
+ if (!i.ok)
17
+ throw i;
18
+ return i.json();
14
19
  }
15
- function V(t) {
16
- if (!t.ok)
17
- throw t;
18
- return t.json();
20
+ function S(i) {
21
+ return `https://${window.HG_IFRAME_HOST ?? "sdk.hellgate.io"}/web/${i}/iframe/`;
19
22
  }
20
- const xe = 2e3;
21
- class He {
22
- constructor(e, r) {
23
+ const F = 2e3;
24
+ class k {
25
+ constructor(e, t) {
23
26
  Object.defineProperty(this, "session", {
24
27
  enumerable: !0,
25
28
  configurable: !0,
@@ -79,40 +82,40 @@ class He {
79
82
  enumerable: !0,
80
83
  configurable: !0,
81
84
  writable: !0,
82
- value: (n) => {
83
- this.decoupledAuthHandlers.push(n);
85
+ value: (r) => {
86
+ this.decoupledAuthHandlers.push(r);
84
87
  }
85
88
  }), Object.defineProperty(this, "onStartChallenge", {
86
89
  enumerable: !0,
87
90
  configurable: !0,
88
91
  writable: !0,
89
- value: (n) => {
90
- this.onStartHandler = n;
92
+ value: (r) => {
93
+ this.onStartHandler = r;
91
94
  }
92
95
  }), Object.defineProperty(this, "onChallengeFinished", {
93
96
  enumerable: !0,
94
97
  configurable: !0,
95
98
  writable: !0,
96
- value: (n) => {
97
- this.onFinishHandler = n;
99
+ value: (r) => {
100
+ this.onFinishHandler = r;
98
101
  }
99
102
  }), Object.defineProperty(this, "sessionStateHandle", {
100
103
  enumerable: !0,
101
104
  configurable: !0,
102
105
  writable: !0,
103
- value: (n) => {
104
- var i, a;
105
- switch (n.next_action) {
106
+ value: (r) => {
107
+ var n, a;
108
+ switch (r.next_action) {
106
109
  case "3ds_check": {
107
- this.initCheck3DSIframes(n.data.threeds_server_callback_url, n.data.mon_url);
110
+ this.initCheck3DSIframes(r.data.threeds_server_callback_url, r.data.mon_url);
108
111
  break;
109
112
  }
110
113
  case "3ds_challenge": {
111
- (i = this.onStartHandler) == null || i.call(this), this.disposeCheck3DSIframe(), this.startChallenge(n.data.challenge_url, n.data.result_mon_url);
114
+ (n = this.onStartHandler) == null || n.call(this), this.disposeCheck3DSIframe(), this.startChallenge(r.data.challenge_url, r.data.result_mon_url);
112
115
  break;
113
116
  }
114
117
  case "3ds_challenge_decoupled": {
115
- this.startDecoupledAuth(n.data.cardholder_info, n.data.result_mon_url, n.data.transaction_id);
118
+ this.startDecoupledAuth(r.data.cardholder_info, r.data.result_mon_url, r.data.transaction_id);
116
119
  break;
117
120
  }
118
121
  case null: {
@@ -121,820 +124,98 @@ class He {
121
124
  }
122
125
  }
123
126
  }
124
- }), this.domContainer = r.domContainer ?? I(), this.disposers.push(this.session.onStateChange(this.sessionStateHandle)), this.labelText = r.labelText;
127
+ }), this.domContainer = t.domContainer ?? p(), this.disposers.push(this.session.onStateChange(this.sessionStateHandle)), this.labelText = t.labelText;
125
128
  }
126
129
  dispose() {
127
130
  this.disposers.forEach((e) => e()), this.check3dsIframeDisposers.forEach((e) => e());
128
131
  }
129
- initCheck3DSIframes(e, r) {
130
- const n = I();
131
- n.insertAdjacentHTML("beforeend", `<iframe id="check_3ds_${this.iframeId}" width="0" height="0" style="border:0;visibility: hidden;" src="${e}"></iframe>`);
132
- const i = n.querySelector(`#check_3ds_${this.iframeId}`);
133
- if (i) {
132
+ initCheck3DSIframes(e, t) {
133
+ const r = p();
134
+ r.insertAdjacentHTML("beforeend", `<iframe id="check_3ds_${this.iframeId}" width="0" height="0" style="border:0;visibility: hidden;" src="${e}"></iframe>`);
135
+ const n = r.querySelector(`#check_3ds_${this.iframeId}`);
136
+ if (n) {
134
137
  const a = (s) => {
135
- s.source === i.contentWindow && this.session.completeAction({ action: "3ds_check", result: s.data });
138
+ s.source === n.contentWindow && this.session.completeAction({ action: "3ds_check", result: s.data });
136
139
  };
137
- window.addEventListener("message", a), this.check3dsIframeDisposers.push(() => window.removeEventListener("message", a), () => i.remove());
140
+ window.addEventListener("message", a), this.check3dsIframeDisposers.push(() => window.removeEventListener("message", a), () => n.remove());
138
141
  }
139
- if (r) {
140
- n.insertAdjacentHTML("beforeend", `<iframe id="mon_${this.iframeId}" width="0" height="0" style="border:0;visibility: hidden;" src="${r}"></iframe>`);
141
- const a = n.querySelector(`#mon_${this.iframeId}`);
142
+ if (t) {
143
+ r.insertAdjacentHTML("beforeend", `<iframe id="mon_${this.iframeId}" width="0" height="0" style="border:0;visibility: hidden;" src="${t}"></iframe>`);
144
+ const a = r.querySelector(`#mon_${this.iframeId}`);
142
145
  a && this.disposers.push(() => a.remove());
143
146
  }
144
147
  }
145
148
  disposeCheck3DSIframe() {
146
149
  this.check3dsIframeDisposers.forEach((e) => e()), this.check3dsIframeDisposers = [];
147
150
  }
148
- startChallenge(e, r) {
149
- const n = I(), i = `<div style="display: flex; flex-direction: column; gap: 10px; align-items: center; ${this.domContainer === n ? 'border:0; max-width: 800px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width:100% " ' : 'border:0;" width="100%" height="100%"'}><iframe id="cha_${this.iframeId}" src="${e}" width="100%" height="500"></iframe>${this.labelText ? '<span id="tds_label_text" style="font-size: large;">' + this.labelText + "</span>" : ""}<div>`;
150
- this.domContainer.insertAdjacentHTML("beforeend", this.domContainer === n ? `<div id="cha_${this.iframeId}_wrap" style="background: #fff; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 10000;">${i}</div>` : i);
151
+ startChallenge(e, t) {
152
+ const r = p(), n = `<div style="display: flex; flex-direction: column; gap: 10px; align-items: center; ${this.domContainer === r ? 'border:0; max-width: 800px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width:100% " ' : 'border:0;" width="100%" height="100%"'}><iframe id="cha_${this.iframeId}" src="${e}" width="100%" height="500"></iframe>${this.labelText ? '<span id="tds_label_text" style="font-size: large;">' + this.labelText + "</span>" : ""}<div>`;
153
+ this.domContainer.insertAdjacentHTML("beforeend", this.domContainer === r ? `<div id="cha_${this.iframeId}_wrap" style="background: #fff; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 10000;">${n}</div>` : n);
151
154
  const a = this.domContainer.querySelector(`#cha_${this.iframeId}`), s = this.domContainer.querySelector(`#cha_${this.iframeId}_wrap`);
152
155
  if (!a)
153
156
  throw new Error("3DS Challenge Iframe initialization failed");
154
157
  this.disposers.push(() => {
155
158
  a.remove(), s == null || s.remove();
156
159
  });
157
- const o = new Promise((u) => {
158
- const d = (h) => {
159
- h.source !== a.contentWindow || h.data.event !== "AuthResultReady" || u(h.data);
160
+ const o = new Promise((c) => {
161
+ const d = (u) => {
162
+ u.source !== a.contentWindow || u.data.event !== "AuthResultReady" || c({
163
+ ...u.data,
164
+ requestor_trans_id: u.data.requestor_trans_id ?? u.data.requestorTransId,
165
+ // TODO: remove this field after the backend is updated
166
+ requestorTransId: void 0,
167
+ param: u.data.param || void 0
168
+ });
160
169
  };
161
170
  window.addEventListener("message", d), this.disposers.push(() => window.removeEventListener("message", d));
162
- }), c = new Promise((u) => {
163
- const d = this.startAuthResultPolling(r, (h) => {
164
- h.event === "AuthResultReady" && (d(), u({
165
- requestor_trans_id: h.threeDSRequestorTransID,
166
- event: h.event
171
+ }), l = new Promise((c) => {
172
+ const d = this.startAuthResultPolling(t, (u) => {
173
+ u.event === "AuthResultReady" && (d(), c({
174
+ requestor_trans_id: u.threeDSRequestorTransID,
175
+ event: u.event
167
176
  }));
168
177
  });
169
178
  });
170
- Promise.any([o, c]).then((u) => {
179
+ Promise.any([o, l]).then((c) => {
171
180
  this.session.completeAction({
172
181
  action: "3ds_challenge",
173
- result: u
182
+ result: c
174
183
  });
175
184
  });
176
185
  }
177
- startDecoupledAuth(e, r, n) {
178
- this.transactionId || (this.transactionId = n), this.decoupledAuthHandlers.forEach((a) => a(e));
179
- const i = this.startAuthResultPolling(r, (a) => {
186
+ startDecoupledAuth(e, t, r) {
187
+ this.transactionId || (this.transactionId = r), this.decoupledAuthHandlers.forEach((a) => a(e));
188
+ const n = this.startAuthResultPolling(t, (a) => {
180
189
  a.event === "AuthResultReady" && (this.session.completeAction({
181
190
  action: "3ds_challenge_decoupled",
182
191
  result: { ...a, event: a.event }
183
- }), i());
192
+ }), n());
184
193
  });
185
194
  }
186
- startAuthResultPolling(e, r) {
187
- return window.clearTimeout(this.resultPollingTimer), this.resultPollingTimer = window.setTimeout(() => fetch(e).then((n) => V(n)).then((n) => {
188
- this.startAuthResultPolling(e, r), r(n);
195
+ startAuthResultPolling(e, t) {
196
+ return window.clearTimeout(this.resultPollingTimer), this.resultPollingTimer = window.setTimeout(() => fetch(e).then((r) => E(r)).then((r) => {
197
+ this.startAuthResultPolling(e, t), t(r);
189
198
  }).catch(() => {
190
- }), xe), () => window.clearTimeout(this.resultPollingTimer);
199
+ }), F), () => window.clearTimeout(this.resultPollingTimer);
191
200
  }
192
201
  }
193
- function I() {
202
+ function p() {
194
203
  return document.body;
195
204
  }
196
- const f = crypto, A = (t) => t instanceof CryptoKey, Ke = async (t, e) => {
197
- const r = `SHA-${t.slice(-3)}`;
198
- return new Uint8Array(await f.subtle.digest(r, e));
199
- }, O = new TextEncoder(), ne = new TextDecoder(), R = 2 ** 32;
200
- function M(...t) {
201
- const e = t.reduce((i, { length: a }) => i + a, 0), r = new Uint8Array(e);
202
- let n = 0;
203
- for (const i of t)
204
- r.set(i, n), n += i.length;
205
- return r;
206
- }
207
- function Te(t, e) {
208
- return M(O.encode(t), new Uint8Array([0]), e);
209
- }
210
- function J(t, e, r) {
211
- if (e < 0 || e >= R)
212
- throw new RangeError(`value must be >= 0 and <= ${R - 1}. Received ${e}`);
213
- t.set([e >>> 24, e >>> 16, e >>> 8, e & 255], r);
214
- }
215
- function De(t) {
216
- const e = Math.floor(t / R), r = t % R, n = new Uint8Array(8);
217
- return J(n, e, 0), J(n, r, 4), n;
218
- }
219
- function Y(t) {
220
- const e = new Uint8Array(4);
221
- return J(e, t), e;
222
- }
223
- function U(t) {
224
- return M(Y(t.length), t);
225
- }
226
- async function Me(t, e, r) {
227
- const n = Math.ceil((e >> 3) / 32), i = new Uint8Array(n * 32);
228
- for (let a = 0; a < n; a++) {
229
- const s = new Uint8Array(4 + t.length + r.length);
230
- s.set(Y(a + 1)), s.set(t, 4), s.set(r, 4 + t.length), i.set(await Ke("sha256", s), a * 32);
231
- }
232
- return i.slice(0, e >> 3);
233
- }
234
- const je = (t) => {
235
- let e = t;
236
- typeof e == "string" && (e = O.encode(e));
237
- const r = 32768, n = [];
238
- for (let i = 0; i < e.length; i += r)
239
- n.push(String.fromCharCode.apply(null, e.subarray(i, i + r)));
240
- return btoa(n.join(""));
241
- }, w = (t) => je(t).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"), Re = (t) => {
242
- const e = atob(t), r = new Uint8Array(e.length);
243
- for (let n = 0; n < e.length; n++)
244
- r[n] = e.charCodeAt(n);
245
- return r;
246
- }, ie = (t) => {
247
- let e = t;
248
- e instanceof Uint8Array && (e = ne.decode(e)), e = e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
249
- try {
250
- return Re(e);
251
- } catch {
252
- throw new TypeError("The input to be decoded is not correctly encoded.");
253
- }
254
- };
255
- class ae extends Error {
256
- static get code() {
257
- return "ERR_JOSE_GENERIC";
258
- }
259
- constructor(e) {
260
- var r;
261
- super(e), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
262
- }
263
- }
264
- class b extends ae {
265
- constructor() {
266
- super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
267
- }
268
- static get code() {
269
- return "ERR_JOSE_NOT_SUPPORTED";
270
- }
271
- }
272
- class P extends ae {
273
- constructor() {
274
- super(...arguments), this.code = "ERR_JWE_INVALID";
275
- }
276
- static get code() {
277
- return "ERR_JWE_INVALID";
278
- }
279
- }
280
- const k = f.getRandomValues.bind(f);
281
- function se(t) {
282
- switch (t) {
283
- case "A128GCM":
284
- case "A128GCMKW":
285
- case "A192GCM":
286
- case "A192GCMKW":
287
- case "A256GCM":
288
- case "A256GCMKW":
289
- return 96;
290
- case "A128CBC-HS256":
291
- case "A192CBC-HS384":
292
- case "A256CBC-HS512":
293
- return 128;
294
- default:
295
- throw new b(`Unsupported JWE Algorithm: ${t}`);
296
- }
297
- }
298
- const Ie = (t) => k(new Uint8Array(se(t) >> 3)), Ue = (t, e) => {
299
- if (e.length << 3 !== se(t))
300
- throw new P("Invalid Initialization Vector length");
301
- }, Z = (t, e) => {
302
- const r = t.byteLength << 3;
303
- if (r !== e)
304
- throw new P(`Invalid Content Encryption Key length. Expected ${e} bits, got ${r} bits`);
305
- };
306
- function S(t, e = "algorithm.name") {
307
- return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`);
308
- }
309
- function j(t, e) {
310
- return t.name === e;
311
- }
312
- function $e(t) {
313
- return parseInt(t.name.slice(4), 10);
314
- }
315
- function We(t, e) {
316
- if (e.length && !e.some((r) => t.usages.includes(r))) {
317
- let r = "CryptoKey does not support this operation, its usages must include ";
318
- if (e.length > 2) {
319
- const n = e.pop();
320
- r += `one of ${e.join(", ")}, or ${n}.`;
321
- } else e.length === 2 ? r += `one of ${e[0]} or ${e[1]}.` : r += `${e[0]}.`;
322
- throw new TypeError(r);
323
- }
324
- }
325
- function T(t, e, ...r) {
326
- switch (e) {
327
- case "A128GCM":
328
- case "A192GCM":
329
- case "A256GCM": {
330
- if (!j(t.algorithm, "AES-GCM"))
331
- throw S("AES-GCM");
332
- const n = parseInt(e.slice(1, 4), 10);
333
- if (t.algorithm.length !== n)
334
- throw S(n, "algorithm.length");
335
- break;
336
- }
337
- case "A128KW":
338
- case "A192KW":
339
- case "A256KW": {
340
- if (!j(t.algorithm, "AES-KW"))
341
- throw S("AES-KW");
342
- const n = parseInt(e.slice(1, 4), 10);
343
- if (t.algorithm.length !== n)
344
- throw S(n, "algorithm.length");
345
- break;
346
- }
347
- case "ECDH": {
348
- switch (t.algorithm.name) {
349
- case "ECDH":
350
- case "X25519":
351
- case "X448":
352
- break;
353
- default:
354
- throw S("ECDH, X25519, or X448");
355
- }
356
- break;
357
- }
358
- case "PBES2-HS256+A128KW":
359
- case "PBES2-HS384+A192KW":
360
- case "PBES2-HS512+A256KW":
361
- if (!j(t.algorithm, "PBKDF2"))
362
- throw S("PBKDF2");
363
- break;
364
- case "RSA-OAEP":
365
- case "RSA-OAEP-256":
366
- case "RSA-OAEP-384":
367
- case "RSA-OAEP-512": {
368
- if (!j(t.algorithm, "RSA-OAEP"))
369
- throw S("RSA-OAEP");
370
- const n = parseInt(e.slice(9), 10) || 1;
371
- if ($e(t.algorithm.hash) !== n)
372
- throw S(`SHA-${n}`, "algorithm.hash");
373
- break;
374
- }
375
- default:
376
- throw new TypeError("CryptoKey does not support this operation");
377
- }
378
- We(t, r);
379
- }
380
- function oe(t, e, ...r) {
381
- var n;
382
- if (r.length > 2) {
383
- const i = r.pop();
384
- t += `one of type ${r.join(", ")}, or ${i}.`;
385
- } else r.length === 2 ? t += `one of type ${r[0]} or ${r[1]}.` : t += `of type ${r[0]}.`;
386
- return e == null ? t += ` Received ${e}` : typeof e == "function" && e.name ? t += ` Received function ${e.name}` : typeof e == "object" && e != null && (n = e.constructor) != null && n.name && (t += ` Received an instance of ${e.constructor.name}`), t;
387
- }
388
- const _ = (t, ...e) => oe("Key must be ", t, ...e);
389
- function ce(t, e, ...r) {
390
- return oe(`Key for the ${t} algorithm must be `, e, ...r);
391
- }
392
- const le = (t) => A(t) ? !0 : (t == null ? void 0 : t[Symbol.toStringTag]) === "KeyObject", g = ["CryptoKey"], Ne = (...t) => {
393
- const e = t.filter(Boolean);
394
- if (e.length === 0 || e.length === 1)
395
- return !0;
396
- let r;
397
- for (const n of e) {
398
- const i = Object.keys(n);
399
- if (!r || r.size === 0) {
400
- r = new Set(i);
401
- continue;
402
- }
403
- for (const a of i) {
404
- if (r.has(a))
405
- return !1;
406
- r.add(a);
407
- }
408
- }
409
- return !0;
410
- };
411
- function Le(t) {
412
- return typeof t == "object" && t !== null;
413
- }
414
- function Fe(t) {
415
- if (!Le(t) || Object.prototype.toString.call(t) !== "[object Object]")
416
- return !1;
417
- if (Object.getPrototypeOf(t) === null)
418
- return !0;
419
- let e = t;
420
- for (; Object.getPrototypeOf(e) !== null; )
421
- e = Object.getPrototypeOf(e);
422
- return Object.getPrototypeOf(t) === e;
423
- }
424
- const ue = [
425
- { hash: "SHA-256", name: "HMAC" },
426
- !0,
427
- ["sign"]
428
- ];
429
- function Be(t, e) {
430
- if (t.algorithm.length !== parseInt(e.slice(1, 4), 10))
431
- throw new TypeError(`Invalid key size for alg: ${e}`);
432
- }
433
- function Ve(t, e, r) {
434
- if (A(t))
435
- return T(t, e, r), t;
436
- if (t instanceof Uint8Array)
437
- return f.subtle.importKey("raw", t, "AES-KW", !0, [r]);
438
- throw new TypeError(_(t, ...g, "Uint8Array"));
439
- }
440
- const z = async (t, e, r) => {
441
- const n = await Ve(e, t, "wrapKey");
442
- Be(n, t);
443
- const i = await f.subtle.importKey("raw", r, ...ue);
444
- return new Uint8Array(await f.subtle.wrapKey("raw", i, n, "AES-KW"));
445
- };
446
- async function Je(t, e, r, n, i = new Uint8Array(0), a = new Uint8Array(0)) {
447
- if (!A(t))
448
- throw new TypeError(_(t, ...g));
449
- if (T(t, "ECDH"), !A(e))
450
- throw new TypeError(_(e, ...g));
451
- T(e, "ECDH", "deriveBits");
452
- const s = M(U(O.encode(r)), U(i), U(a), Y(n));
453
- let o;
454
- t.algorithm.name === "X25519" ? o = 256 : t.algorithm.name === "X448" ? o = 448 : o = Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3), 10) / 8) << 3;
455
- const c = new Uint8Array(await f.subtle.deriveBits({
456
- name: t.algorithm.name,
457
- public: t
458
- }, e, o));
459
- return Me(c, n, s);
460
- }
461
- async function ze(t) {
462
- if (!A(t))
463
- throw new TypeError(_(t, ...g));
464
- return f.subtle.generateKey(t.algorithm, !0, ["deriveBits"]);
465
- }
466
- function Ge(t) {
467
- if (!A(t))
468
- throw new TypeError(_(t, ...g));
469
- return ["P-256", "P-384", "P-521"].includes(t.algorithm.namedCurve) || t.algorithm.name === "X25519" || t.algorithm.name === "X448";
470
- }
471
- function Ye(t) {
472
- if (!(t instanceof Uint8Array) || t.length < 8)
473
- throw new P("PBES2 Salt Input must be 8 or more octets");
474
- }
475
- function ke(t, e) {
476
- if (t instanceof Uint8Array)
477
- return f.subtle.importKey("raw", t, "PBKDF2", !1, ["deriveBits"]);
478
- if (A(t))
479
- return T(t, e, "deriveBits", "deriveKey"), t;
480
- throw new TypeError(_(t, ...g, "Uint8Array"));
481
- }
482
- async function qe(t, e, r, n) {
483
- Ye(t);
484
- const i = Te(e, t), a = parseInt(e.slice(13, 16), 10), s = {
485
- hash: `SHA-${e.slice(8, 11)}`,
486
- iterations: r,
487
- name: "PBKDF2",
488
- salt: i
489
- }, o = {
490
- length: a,
491
- name: "AES-KW"
492
- }, c = await ke(n, e);
493
- if (c.usages.includes("deriveBits"))
494
- return new Uint8Array(await f.subtle.deriveBits(s, c, a));
495
- if (c.usages.includes("deriveKey"))
496
- return f.subtle.deriveKey(s, c, o, !1, ["wrapKey", "unwrapKey"]);
497
- throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');
498
- }
499
- const Xe = async (t, e, r, n = 2048, i = k(new Uint8Array(16))) => {
500
- const a = await qe(i, t, n, e);
501
- return { encryptedKey: await z(t.slice(-6), a, r), p2c: n, p2s: w(i) };
502
- };
503
- function Q(t) {
504
- switch (t) {
505
- case "RSA-OAEP":
506
- case "RSA-OAEP-256":
507
- case "RSA-OAEP-384":
508
- case "RSA-OAEP-512":
509
- return "RSA-OAEP";
510
- default:
511
- throw new b(`alg ${t} is not supported either by JOSE or your javascript runtime`);
512
- }
513
- }
514
- const Ze = (t, e) => {
515
- if (t.startsWith("RS") || t.startsWith("PS")) {
516
- const { modulusLength: r } = e.algorithm;
517
- if (typeof r != "number" || r < 2048)
518
- throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`);
519
- }
520
- }, Qe = async (t, e, r) => {
521
- if (!A(e))
522
- throw new TypeError(_(e, ...g));
523
- if (T(e, t, "encrypt", "wrapKey"), Ze(t, e), e.usages.includes("encrypt"))
524
- return new Uint8Array(await f.subtle.encrypt(Q(t), e, r));
525
- if (e.usages.includes("wrapKey")) {
526
- const n = await f.subtle.importKey("raw", r, ...ue);
527
- return new Uint8Array(await f.subtle.wrapKey("raw", n, e, Q(t)));
528
- }
529
- throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation');
530
- };
531
- function et(t) {
532
- let e, r;
533
- switch (t.kty) {
534
- case "RSA": {
535
- switch (t.alg) {
536
- case "PS256":
537
- case "PS384":
538
- case "PS512":
539
- e = { name: "RSA-PSS", hash: `SHA-${t.alg.slice(-3)}` }, r = t.d ? ["sign"] : ["verify"];
540
- break;
541
- case "RS256":
542
- case "RS384":
543
- case "RS512":
544
- e = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${t.alg.slice(-3)}` }, r = t.d ? ["sign"] : ["verify"];
545
- break;
546
- case "RSA-OAEP":
547
- case "RSA-OAEP-256":
548
- case "RSA-OAEP-384":
549
- case "RSA-OAEP-512":
550
- e = {
551
- name: "RSA-OAEP",
552
- hash: `SHA-${parseInt(t.alg.slice(-3), 10) || 1}`
553
- }, r = t.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
554
- break;
555
- default:
556
- throw new b('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
557
- }
558
- break;
559
- }
560
- case "EC": {
561
- switch (t.alg) {
562
- case "ES256":
563
- e = { name: "ECDSA", namedCurve: "P-256" }, r = t.d ? ["sign"] : ["verify"];
564
- break;
565
- case "ES384":
566
- e = { name: "ECDSA", namedCurve: "P-384" }, r = t.d ? ["sign"] : ["verify"];
567
- break;
568
- case "ES512":
569
- e = { name: "ECDSA", namedCurve: "P-521" }, r = t.d ? ["sign"] : ["verify"];
570
- break;
571
- case "ECDH-ES":
572
- case "ECDH-ES+A128KW":
573
- case "ECDH-ES+A192KW":
574
- case "ECDH-ES+A256KW":
575
- e = { name: "ECDH", namedCurve: t.crv }, r = t.d ? ["deriveBits"] : [];
576
- break;
577
- default:
578
- throw new b('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
579
- }
580
- break;
581
- }
582
- case "OKP": {
583
- switch (t.alg) {
584
- case "EdDSA":
585
- e = { name: t.crv }, r = t.d ? ["sign"] : ["verify"];
586
- break;
587
- case "ECDH-ES":
588
- case "ECDH-ES+A128KW":
589
- case "ECDH-ES+A192KW":
590
- case "ECDH-ES+A256KW":
591
- e = { name: t.crv }, r = t.d ? ["deriveBits"] : [];
592
- break;
593
- default:
594
- throw new b('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
595
- }
596
- break;
597
- }
598
- default:
599
- throw new b('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
600
- }
601
- return { algorithm: e, keyUsages: r };
602
- }
603
- const de = async (t) => {
604
- if (!t.alg)
605
- throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
606
- const { algorithm: e, keyUsages: r } = et(t), n = [
607
- e,
608
- t.ext ?? !1,
609
- t.key_ops ?? r
610
- ], i = { ...t };
611
- return delete i.alg, delete i.use, f.subtle.importKey("jwk", i, ...n);
612
- }, he = (t) => ie(t);
613
- let $, W;
614
- const fe = (t) => (t == null ? void 0 : t[Symbol.toStringTag]) === "KeyObject", pe = async (t, e, r, n) => {
615
- let i = t.get(e);
616
- if (i != null && i[n])
617
- return i[n];
618
- const a = await de({ ...r, alg: n });
619
- return i ? i[n] = a : t.set(e, { [n]: a }), a;
620
- }, tt = (t, e) => {
621
- if (fe(t)) {
622
- let r = t.export({ format: "jwk" });
623
- return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? he(r.k) : (W || (W = /* @__PURE__ */ new WeakMap()), pe(W, t, r, e));
624
- }
625
- return t;
626
- }, rt = (t, e) => {
627
- if (fe(t)) {
628
- let r = t.export({ format: "jwk" });
629
- return r.k ? he(r.k) : ($ || ($ = /* @__PURE__ */ new WeakMap()), pe($, t, r, e));
630
- }
631
- return t;
632
- }, N = { normalizePublicKey: tt, normalizePrivateKey: rt };
633
- function me(t) {
634
- switch (t) {
635
- case "A128GCM":
636
- return 128;
637
- case "A192GCM":
638
- return 192;
639
- case "A256GCM":
640
- case "A128CBC-HS256":
641
- return 256;
642
- case "A192CBC-HS384":
643
- return 384;
644
- case "A256CBC-HS512":
645
- return 512;
646
- default:
647
- throw new b(`Unsupported JWE Algorithm: ${t}`);
648
- }
649
- }
650
- const D = (t) => k(new Uint8Array(me(t) >> 3));
651
- async function nt(t, e) {
652
- if (!Fe(t))
653
- throw new TypeError("JWK must be an object");
654
- switch (t.kty) {
655
- case "oct":
656
- if (typeof t.k != "string" || !t.k)
657
- throw new TypeError('missing "k" (Key Value) Parameter value');
658
- return ie(t.k);
659
- case "RSA":
660
- if (t.oth !== void 0)
661
- throw new b('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
662
- case "EC":
663
- case "OKP":
664
- return de({ ...t, alg: e });
665
- default:
666
- throw new b('Unsupported "kty" (Key Type) Parameter value');
667
- }
668
- }
669
- const G = (t) => t == null ? void 0 : t[Symbol.toStringTag], it = (t, e) => {
670
- if (!(e instanceof Uint8Array)) {
671
- if (!le(e))
672
- throw new TypeError(ce(t, e, ...g, "Uint8Array"));
673
- if (e.type !== "secret")
674
- throw new TypeError(`${G(e)} instances for symmetric algorithms must be of type "secret"`);
675
- }
676
- }, at = (t, e, r) => {
677
- if (!le(e))
678
- throw new TypeError(ce(t, e, ...g));
679
- if (e.type === "secret")
680
- throw new TypeError(`${G(e)} instances for asymmetric algorithms must not be of type "secret"`);
681
- if (e.algorithm, e.algorithm && r === "encrypt" && e.type === "private")
682
- throw new TypeError(`${G(e)} instances for asymmetric algorithm encryption must be of type "public"`);
683
- }, st = (t, e, r) => {
684
- t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? it(t, e) : at(t, e, r);
685
- };
686
- async function ot(t, e, r, n, i) {
687
- if (!(r instanceof Uint8Array))
688
- throw new TypeError(_(r, "Uint8Array"));
689
- const a = parseInt(t.slice(1, 4), 10), s = await f.subtle.importKey("raw", r.subarray(a >> 3), "AES-CBC", !1, ["encrypt"]), o = await f.subtle.importKey("raw", r.subarray(0, a >> 3), {
690
- hash: `SHA-${a << 1}`,
691
- name: "HMAC"
692
- }, !1, ["sign"]), c = new Uint8Array(await f.subtle.encrypt({
693
- iv: n,
694
- name: "AES-CBC"
695
- }, s, e)), u = M(i, n, c, De(i.length << 3)), d = new Uint8Array((await f.subtle.sign("HMAC", o, u)).slice(0, a >> 3));
696
- return { ciphertext: c, tag: d, iv: n };
697
- }
698
- async function ct(t, e, r, n, i) {
699
- let a;
700
- r instanceof Uint8Array ? a = await f.subtle.importKey("raw", r, "AES-GCM", !1, ["encrypt"]) : (T(r, t, "encrypt"), a = r);
701
- const s = new Uint8Array(await f.subtle.encrypt({
702
- additionalData: i,
703
- iv: n,
704
- name: "AES-GCM",
705
- tagLength: 128
706
- }, a, e)), o = s.slice(-16);
707
- return { ciphertext: s.slice(0, -16), tag: o, iv: n };
708
- }
709
- const be = async (t, e, r, n, i) => {
710
- if (!A(r) && !(r instanceof Uint8Array))
711
- throw new TypeError(_(r, ...g, "Uint8Array"));
712
- switch (n ? Ue(t, n) : n = Ie(t), t) {
713
- case "A128CBC-HS256":
714
- case "A192CBC-HS384":
715
- case "A256CBC-HS512":
716
- return r instanceof Uint8Array && Z(r, parseInt(t.slice(-3), 10)), ot(t, e, r, n, i);
717
- case "A128GCM":
718
- case "A192GCM":
719
- case "A256GCM":
720
- return r instanceof Uint8Array && Z(r, parseInt(t.slice(1, 4), 10)), ct(t, e, r, n, i);
721
- default:
722
- throw new b("Unsupported JWE Content Encryption Algorithm");
723
- }
724
- };
725
- async function lt(t, e, r, n) {
726
- const i = t.slice(0, 7), a = await be(i, r, e, n, new Uint8Array(0));
727
- return {
728
- encryptedKey: a.ciphertext,
729
- iv: w(a.iv),
730
- tag: w(a.tag)
731
- };
732
- }
733
- function ut(t, e, r, n, i) {
734
- if (i.crit !== void 0 && (n == null ? void 0 : n.crit) === void 0)
735
- throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');
736
- if (!n || n.crit === void 0)
737
- return /* @__PURE__ */ new Set();
738
- if (!Array.isArray(n.crit) || n.crit.length === 0 || n.crit.some((s) => typeof s != "string" || s.length === 0))
739
- throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
740
- let a;
741
- r !== void 0 ? a = new Map([...Object.entries(r), ...e.entries()]) : a = e;
742
- for (const s of n.crit) {
743
- if (!a.has(s))
744
- throw new b(`Extension Header Parameter "${s}" is not recognized`);
745
- if (i[s] === void 0)
746
- throw new t(`Extension Header Parameter "${s}" is missing`);
747
- if (a.get(s) && n[s] === void 0)
748
- throw new t(`Extension Header Parameter "${s}" MUST be integrity protected`);
749
- }
750
- return new Set(n.crit);
751
- }
752
- const dt = async (t) => {
753
- if (t instanceof Uint8Array)
754
- return {
755
- kty: "oct",
756
- k: w(t)
757
- };
758
- if (!A(t))
759
- throw new TypeError(_(t, ...g, "Uint8Array"));
760
- if (!t.extractable)
761
- throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");
762
- const { ext: e, key_ops: r, alg: n, use: i, ...a } = await f.subtle.exportKey("jwk", t);
763
- return a;
764
- };
765
- async function ht(t) {
766
- return dt(t);
767
- }
768
- async function ft(t, e, r, n, i = {}) {
769
- var c;
770
- let a, s, o;
771
- switch (st(t, r, "encrypt"), r = await ((c = N.normalizePublicKey) == null ? void 0 : c.call(N, r, t)) || r, t) {
772
- case "dir": {
773
- o = r;
774
- break;
775
- }
776
- case "ECDH-ES":
777
- case "ECDH-ES+A128KW":
778
- case "ECDH-ES+A192KW":
779
- case "ECDH-ES+A256KW": {
780
- if (!Ge(r))
781
- throw new b("ECDH with the provided key is not allowed or not supported by your javascript runtime");
782
- const { apu: u, apv: d } = i;
783
- let { epk: h } = i;
784
- h || (h = (await ze(r)).privateKey);
785
- const { x: p, y: E, crv: l, kty: m } = await ht(h), X = await Je(r, h, t === "ECDH-ES" ? e : t, t === "ECDH-ES" ? me(e) : parseInt(t.slice(-5, -2), 10), u, d);
786
- if (s = { epk: { x: p, crv: l, kty: m } }, m === "EC" && (s.epk.y = E), u && (s.apu = w(u)), d && (s.apv = w(d)), t === "ECDH-ES") {
787
- o = X;
788
- break;
789
- }
790
- o = n || D(e);
791
- const Oe = t.slice(-6);
792
- a = await z(Oe, X, o);
793
- break;
794
- }
795
- case "RSA1_5":
796
- case "RSA-OAEP":
797
- case "RSA-OAEP-256":
798
- case "RSA-OAEP-384":
799
- case "RSA-OAEP-512": {
800
- o = n || D(e), a = await Qe(t, r, o);
801
- break;
802
- }
803
- case "PBES2-HS256+A128KW":
804
- case "PBES2-HS384+A192KW":
805
- case "PBES2-HS512+A256KW": {
806
- o = n || D(e);
807
- const { p2c: u, p2s: d } = i;
808
- ({ encryptedKey: a, ...s } = await Xe(t, r, o, u, d));
809
- break;
810
- }
811
- case "A128KW":
812
- case "A192KW":
813
- case "A256KW": {
814
- o = n || D(e), a = await z(t, r, o);
815
- break;
816
- }
817
- case "A128GCMKW":
818
- case "A192GCMKW":
819
- case "A256GCMKW": {
820
- o = n || D(e);
821
- const { iv: u } = i;
822
- ({ encryptedKey: a, ...s } = await lt(t, r, o, u));
823
- break;
824
- }
825
- default:
826
- throw new b('Invalid or unsupported "alg" (JWE Algorithm) header value');
827
- }
828
- return { cek: o, encryptedKey: a, parameters: s };
829
- }
830
- const pt = Symbol();
831
- class mt {
832
- constructor(e) {
833
- if (!(e instanceof Uint8Array))
834
- throw new TypeError("plaintext must be an instance of Uint8Array");
835
- this._plaintext = e;
836
- }
837
- setKeyManagementParameters(e) {
838
- if (this._keyManagementParameters)
839
- throw new TypeError("setKeyManagementParameters can only be called once");
840
- return this._keyManagementParameters = e, this;
841
- }
842
- setProtectedHeader(e) {
843
- if (this._protectedHeader)
844
- throw new TypeError("setProtectedHeader can only be called once");
845
- return this._protectedHeader = e, this;
846
- }
847
- setSharedUnprotectedHeader(e) {
848
- if (this._sharedUnprotectedHeader)
849
- throw new TypeError("setSharedUnprotectedHeader can only be called once");
850
- return this._sharedUnprotectedHeader = e, this;
851
- }
852
- setUnprotectedHeader(e) {
853
- if (this._unprotectedHeader)
854
- throw new TypeError("setUnprotectedHeader can only be called once");
855
- return this._unprotectedHeader = e, this;
856
- }
857
- setAdditionalAuthenticatedData(e) {
858
- return this._aad = e, this;
859
- }
860
- setContentEncryptionKey(e) {
861
- if (this._cek)
862
- throw new TypeError("setContentEncryptionKey can only be called once");
863
- return this._cek = e, this;
864
- }
865
- setInitializationVector(e) {
866
- if (this._iv)
867
- throw new TypeError("setInitializationVector can only be called once");
868
- return this._iv = e, this;
869
- }
870
- async encrypt(e, r) {
871
- if (!this._protectedHeader && !this._unprotectedHeader && !this._sharedUnprotectedHeader)
872
- throw new P("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");
873
- if (!Ne(this._protectedHeader, this._unprotectedHeader, this._sharedUnprotectedHeader))
874
- throw new P("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");
875
- const n = {
876
- ...this._protectedHeader,
877
- ...this._unprotectedHeader,
878
- ...this._sharedUnprotectedHeader
879
- };
880
- if (ut(P, /* @__PURE__ */ new Map(), r == null ? void 0 : r.crit, this._protectedHeader, n), n.zip !== void 0)
881
- throw new b('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');
882
- const { alg: i, enc: a } = n;
883
- if (typeof i != "string" || !i)
884
- throw new P('JWE "alg" (Algorithm) Header Parameter missing or invalid');
885
- if (typeof a != "string" || !a)
886
- throw new P('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');
887
- let s;
888
- if (this._cek && (i === "dir" || i === "ECDH-ES"))
889
- throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${i}`);
890
- let o;
891
- {
892
- let m;
893
- ({ cek: o, encryptedKey: s, parameters: m } = await ft(i, a, e, this._cek, this._keyManagementParameters)), m && (r && pt in r ? this._unprotectedHeader ? this._unprotectedHeader = { ...this._unprotectedHeader, ...m } : this.setUnprotectedHeader(m) : this._protectedHeader ? this._protectedHeader = { ...this._protectedHeader, ...m } : this.setProtectedHeader(m));
894
- }
895
- let c, u, d;
896
- this._protectedHeader ? u = O.encode(w(JSON.stringify(this._protectedHeader))) : u = O.encode(""), this._aad ? (d = w(this._aad), c = M(u, O.encode("."), O.encode(d))) : c = u;
897
- const { ciphertext: h, tag: p, iv: E } = await be(a, this._plaintext, o, this._iv, c), l = {
898
- ciphertext: w(h)
899
- };
900
- return E && (l.iv = w(E)), p && (l.tag = w(p)), s && (l.encrypted_key = w(s)), d && (l.aad = d), this._protectedHeader && (l.protected = ne.decode(u)), this._sharedUnprotectedHeader && (l.unprotected = this._sharedUnprotectedHeader), this._unprotectedHeader && (l.header = this._unprotectedHeader), l;
901
- }
902
- }
903
- class bt {
904
- constructor(e) {
905
- this._flattened = new mt(e);
906
- }
907
- setContentEncryptionKey(e) {
908
- return this._flattened.setContentEncryptionKey(e), this;
909
- }
910
- setInitializationVector(e) {
911
- return this._flattened.setInitializationVector(e), this;
912
- }
913
- setProtectedHeader(e) {
914
- return this._flattened.setProtectedHeader(e), this;
915
- }
916
- setKeyManagementParameters(e) {
917
- return this._flattened.setKeyManagementParameters(e), this;
918
- }
919
- async encrypt(e, r) {
920
- const n = await this._flattened.encrypt(e, r);
921
- return [n.protected, n.encrypted_key, n.iv, n.ciphertext, n.tag].join(".");
922
- }
923
- }
924
- const L = {
205
+ const g = {
925
206
  base: {
926
207
  ":disabled": {
927
208
  backgroundColor: "transparent"
928
209
  }
929
210
  }
930
- }, yt = "DOM Element was not found";
931
- var ee;
932
- (function(t) {
933
- t.NOT_COMPLETE = "NOT_COMPLETE", t.SCHEME_NOT_SUPPORTED = "SCHEME_NOT_SUPPORTED", t.LUHN_CHECK_FAILED = "LUHN_CHECK_FAILED", t.INVALID_EXPIRY_DATE = "INVALID_EXPIRY_DATE";
934
- })(ee || (ee = {}));
935
- const ye = (t) => t != null, wt = "v3.9.0";
936
- class x {
937
- constructor(e, r) {
211
+ }, R = "DOM Element was not found";
212
+ var O;
213
+ (function(i) {
214
+ i.NOT_COMPLETE = "NOT_COMPLETE", i.SCHEME_NOT_SUPPORTED = "SCHEME_NOT_SUPPORTED", i.LUHN_CHECK_FAILED = "LUHN_CHECK_FAILED", i.INVALID_EXPIRY_DATE = "INVALID_EXPIRY_DATE";
215
+ })(O || (O = {}));
216
+ const j = (i) => i != null, $ = "v3.10.0";
217
+ class f {
218
+ constructor(e) {
938
219
  if (Object.defineProperty(this, "options", {
939
220
  enumerable: !0,
940
221
  configurable: !0,
@@ -955,16 +236,21 @@ class x {
955
236
  configurable: !0,
956
237
  writable: !0,
957
238
  value: { ready: [], blur: [], focus: [], keydown: [], change: [] }
239
+ }), Object.defineProperty(this, "key", {
240
+ enumerable: !0,
241
+ configurable: !0,
242
+ writable: !0,
243
+ value: ""
958
244
  }), Object.defineProperty(this, "update", {
959
245
  enumerable: !0,
960
246
  configurable: !0,
961
247
  writable: !0,
962
- value: async ({ ...n }) => {
963
- this.iframe && ye(n.height) && (this.iframe.height = n.height), this.iframePostMessage({
248
+ value: async ({ ...t }) => {
249
+ this.iframe && j(t.height) && (this.iframe.height = t.height), this.iframePostMessage({
964
250
  type: "update",
965
251
  data: {
966
- ...n,
967
- value: n.value ? this.putValue(n.value) ?? void 0 : void 0
252
+ ...t,
253
+ value: t.value ? this.putValue(t.value) ?? void 0 : void 0
968
254
  }
969
255
  });
970
256
  }
@@ -994,61 +280,42 @@ class x {
994
280
  configurable: !0,
995
281
  writable: !0,
996
282
  value: () => {
997
- var n;
998
- (n = this.iframe) == null || n.remove(), this.iframe = null;
283
+ var t;
284
+ (t = this.iframe) == null || t.remove(), this.iframe = null;
999
285
  }
1000
- }), this.IFRAME_BASE_URL = Et(wt), !this.IFRAME_BASE_URL)
286
+ }), this.IFRAME_BASE_URL = S($), !this.IFRAME_BASE_URL)
1001
287
  throw new Error("IFRAME_BASE_URL not found");
1002
- r && F.set(this, { key: r });
1003
288
  }
1004
289
  mount(e) {
1005
- const r = typeof e == "string" ? document.querySelector(e) : e;
1006
- if (!r)
1007
- throw new Error(`${yt}: ${e}`);
1008
- r.innerHTML = `<iframe width="100%" height="29" src="${this.IFRAME_BASE_URL}?field=${this.type}&origin=${location.origin}"></iframe>`, this.iframe = r.querySelector("iframe");
1009
- const n = (i) => {
290
+ const t = typeof e == "string" ? document.querySelector(e) : e;
291
+ if (!t)
292
+ throw new Error(`${R}: ${e}`);
293
+ t.innerHTML = `<iframe width="100%" height="29" src="${this.IFRAME_BASE_URL}?field=${this.type}&origin=${location.origin}"></iframe>`, this.iframe = t.querySelector("iframe");
294
+ const r = (n) => {
1010
295
  var a;
1011
- if (!(i.source !== ((a = this.iframe) == null ? void 0 : a.contentWindow) || i.data.element !== this.type))
1012
- if (i.data.type === "change") {
1013
- const s = this.extractValue(i.data.data.value), o = { ...i.data.data };
1014
- delete o.value;
1015
- const c = F.get(this);
1016
- c && (c.value = s), this.emitEvent({
1017
- ...i.data,
1018
- data: o
1019
- });
1020
- } else
1021
- this.emitEvent(i.data);
296
+ n.source !== ((a = this.iframe) == null ? void 0 : a.contentWindow) || n.data.element !== this.type || this.emitEvent(n.data);
1022
297
  };
1023
- return window.addEventListener("message", n), new Promise((i) => {
1024
- this.on("ready", () => {
1025
- this.update(this.options), i();
298
+ return window.addEventListener("message", r), new Promise((n) => {
299
+ this.on("ready", (a) => {
300
+ this.key = a.key, this.update(this.options), n();
1026
301
  });
1027
302
  });
1028
303
  }
1029
- on(e, r) {
1030
- return this.subscriptions[e].push(r), {
1031
- unsubscribe: () => this.subscriptions[e].splice(this.subscriptions[e].indexOf(r), 1)
304
+ on(e, t) {
305
+ return this.subscriptions[e].push(t), {
306
+ unsubscribe: () => this.subscriptions[e].splice(this.subscriptions[e].indexOf(t), 1)
1032
307
  };
1033
308
  }
1034
- secureValue(e) {
1035
- const r = F.get(this);
1036
- return (r == null ? void 0 : r.key) !== e ? null : (r == null ? void 0 : r.value) ?? null;
1037
- }
1038
309
  emitEvent(e) {
1039
- var r;
1040
- (r = this.subscriptions[e.type]) == null || r.forEach((n) => n(e.data));
310
+ var t;
311
+ (t = this.subscriptions[e.type]) == null || t.forEach((r) => r(e.data));
1041
312
  }
1042
313
  iframePostMessage(e) {
1043
- var r, n;
1044
- (n = (r = this.iframe) == null ? void 0 : r.contentWindow) == null || n.postMessage(e, this.IFRAME_BASE_URL);
314
+ var t, r;
315
+ (r = (t = this.iframe) == null ? void 0 : t.contentWindow) == null || r.postMessage(e, this.IFRAME_BASE_URL);
1045
316
  }
1046
317
  }
1047
- function Et(t) {
1048
- return `https://${window.HG_IFRAME_HOST ?? "sdk.hellgate.io"}/web/${t}/iframe/`;
1049
- }
1050
- const F = /* @__PURE__ */ new Map();
1051
- class gt extends x {
318
+ class U extends f {
1052
319
  constructor() {
1053
320
  super(...arguments), Object.defineProperty(this, "type", {
1054
321
  enumerable: !0,
@@ -1059,22 +326,22 @@ class gt extends x {
1059
326
  enumerable: !0,
1060
327
  configurable: !0,
1061
328
  writable: !0,
1062
- value: we
329
+ value: A
1063
330
  }), Object.defineProperty(this, "putValue", {
1064
331
  enumerable: !0,
1065
332
  configurable: !0,
1066
333
  writable: !0,
1067
- value: Ee
334
+ value: H
1068
335
  });
1069
336
  }
1070
337
  }
1071
- function we(t) {
1072
- return t ? Number(t) : null;
338
+ function A(i) {
339
+ return i ? Number(i) : null;
1073
340
  }
1074
- function Ee(t) {
1075
- return t ? t < 10 ? `0${t}` : String(t) : null;
341
+ function H(i) {
342
+ return i ? i < 10 ? `0${i}` : String(i) : null;
1076
343
  }
1077
- class At extends x {
344
+ class V extends f {
1078
345
  constructor() {
1079
346
  super(...arguments), Object.defineProperty(this, "type", {
1080
347
  enumerable: !0,
@@ -1085,38 +352,38 @@ class At extends x {
1085
352
  enumerable: !0,
1086
353
  configurable: !0,
1087
354
  writable: !0,
1088
- value: ge
355
+ value: D
1089
356
  }), Object.defineProperty(this, "putValue", {
1090
357
  enumerable: !0,
1091
358
  configurable: !0,
1092
359
  writable: !0,
1093
- value: Ae
360
+ value: T
1094
361
  });
1095
362
  }
1096
363
  }
1097
- function ge(t) {
1098
- if (!t)
364
+ function D(i) {
365
+ if (!i)
1099
366
  return null;
1100
- const e = Number(t);
367
+ const e = Number(i);
1101
368
  return e > 10 ? +`20${e}` : null;
1102
369
  }
1103
- function Ae(t) {
1104
- return t ? t >= 100 ? String(t).slice(-2) : String(t) : null;
370
+ function T(i) {
371
+ return i ? i >= 100 ? String(i).slice(-2) : String(i) : null;
1105
372
  }
1106
- function _e(t) {
1107
- const [e = null, r = null] = (t ?? "").split("/").map((n) => n.trim());
373
+ function M(i) {
374
+ const [e = null, t = null] = (i ?? "").split("/").map((r) => r.trim());
1108
375
  return {
1109
- month: we(e),
1110
- year: ge(r)
376
+ month: A(e),
377
+ year: D(t)
1111
378
  };
1112
379
  }
1113
- function Se(t) {
1114
- if (!t)
380
+ function I(i) {
381
+ if (!i)
1115
382
  return null;
1116
- const { month: e, year: r } = t;
1117
- return [Ee(e), Ae(r)].filter(ye).join(" / ");
383
+ const { month: e, year: t } = i;
384
+ return [H(e), T(t)].filter(j).join(" / ");
1118
385
  }
1119
- class _t extends x {
386
+ class z extends f {
1120
387
  constructor() {
1121
388
  super(...arguments), Object.defineProperty(this, "type", {
1122
389
  enumerable: !0,
@@ -1127,22 +394,22 @@ class _t extends x {
1127
394
  enumerable: !0,
1128
395
  configurable: !0,
1129
396
  writable: !0,
1130
- value: _e
397
+ value: M
1131
398
  }), Object.defineProperty(this, "putValue", {
1132
399
  enumerable: !0,
1133
400
  configurable: !0,
1134
401
  writable: !0,
1135
- value: Se
402
+ value: I
1136
403
  });
1137
404
  }
1138
405
  }
1139
- function Ce(t) {
1140
- return (t == null ? void 0 : t.replaceAll(" ", "")) ?? null;
406
+ function L(i) {
407
+ return (i == null ? void 0 : i.replaceAll(" ", "")) ?? null;
1141
408
  }
1142
- function St(t) {
1143
- return t;
409
+ function B(i) {
410
+ return i;
1144
411
  }
1145
- class Ct extends x {
412
+ class Y extends f {
1146
413
  constructor() {
1147
414
  super(...arguments), Object.defineProperty(this, "type", {
1148
415
  enumerable: !0,
@@ -1153,16 +420,16 @@ class Ct extends x {
1153
420
  enumerable: !0,
1154
421
  configurable: !0,
1155
422
  writable: !0,
1156
- value: Ce
423
+ value: L
1157
424
  }), Object.defineProperty(this, "putValue", {
1158
425
  enumerable: !0,
1159
426
  configurable: !0,
1160
427
  writable: !0,
1161
- value: St
428
+ value: B
1162
429
  });
1163
430
  }
1164
431
  }
1165
- class Pt extends x {
432
+ class q extends f {
1166
433
  constructor() {
1167
434
  super(...arguments), Object.defineProperty(this, "type", {
1168
435
  enumerable: !0,
@@ -1174,8 +441,8 @@ class Pt extends x {
1174
441
  configurable: !0,
1175
442
  writable: !0,
1176
443
  value: (e) => e ? {
1177
- number: e.cardNumber ? Ce(e.cardNumber) : null,
1178
- expiry_date: e.cardExpirationDate ? _e(e.cardExpirationDate) : null,
444
+ number: e.cardNumber ? L(e.cardNumber) : null,
445
+ expiry_date: e.cardExpirationDate ? M(e.cardExpirationDate) : null,
1179
446
  cvc: e.cardVerificationCode ?? null
1180
447
  } : null
1181
448
  }), Object.defineProperty(this, "putValue", {
@@ -1184,13 +451,13 @@ class Pt extends x {
1184
451
  writable: !0,
1185
452
  value: (e) => e ? {
1186
453
  cardNumber: e.number ? e.number : null,
1187
- cardExpirationDate: e.expiry_date ? Se(e.expiry_date) : null,
454
+ cardExpirationDate: e.expiry_date ? I(e.expiry_date) : null,
1188
455
  cardVerificationCode: e.cvc ?? null
1189
456
  } : null
1190
457
  });
1191
458
  }
1192
459
  }
1193
- class vt extends x {
460
+ class G extends f {
1194
461
  constructor() {
1195
462
  super(...arguments), Object.defineProperty(this, "type", {
1196
463
  enumerable: !0,
@@ -1210,7 +477,7 @@ class vt extends x {
1210
477
  });
1211
478
  }
1212
479
  }
1213
- class Pe extends x {
480
+ class K extends f {
1214
481
  constructor() {
1215
482
  super(...arguments), Object.defineProperty(this, "type", {
1216
483
  enumerable: !0,
@@ -1230,46 +497,60 @@ class Pe extends x {
1230
497
  });
1231
498
  }
1232
499
  }
1233
- function v(t, e, r) {
1234
- switch (t) {
500
+ function b(i, e) {
501
+ switch (i) {
1235
502
  case "card":
1236
- return new Pt(e, r);
503
+ return new q(e);
1237
504
  case "cardNumber":
1238
- return new Ct(e, r);
505
+ return new Y(e);
1239
506
  case "cardExpirationDate":
1240
- return new _t(e, r);
507
+ return new z(e);
1241
508
  case "cardExpirationMonth":
1242
- return new gt(e, r);
509
+ return new U(e);
1243
510
  case "cardExpirationYear":
1244
- return new At(e, r);
511
+ return new V(e);
1245
512
  case "cardVerificationCode":
1246
- return new vt(e, r);
513
+ return new G(e);
1247
514
  case "text":
1248
- return new Pe(e, r);
515
+ return new K(e);
1249
516
  default:
1250
- ASSERT_EXHAUSTIVE(t);
517
+ ASSERT_EXHAUSTIVE(i);
1251
518
  }
1252
519
  }
1253
- function Ot() {
1254
- return Date.now().toString(36) + Math.random().toString(36).slice(2);
520
+ const W = {
521
+ visa: "visa",
522
+ mastercard: "mastercard",
523
+ americanexpress: "american-express",
524
+ discover: "discover",
525
+ dinersclub: "diners-club",
526
+ jcb: "jcb",
527
+ unionpay: "unionpay"
528
+ };
529
+ function X(i) {
530
+ return i.map((e) => W[e]).filter(Boolean);
1255
531
  }
1256
- function te(t) {
532
+ function P(i) {
1257
533
  return [
1258
- t.issuer_identification_number,
1259
- "".padEnd(t.account_number_length - t.issuer_identification_number.length - t.account_number_last_four.length, "*"),
1260
- t.account_number_last_four
534
+ i.issuer_identification_number,
535
+ "".padEnd(i.account_number_length - i.issuer_identification_number.length - i.account_number_last_four.length, "*"),
536
+ i.account_number_last_four
1261
537
  ].join(" ");
1262
538
  }
1263
- class q {
1264
- static async init(e) {
1265
- return new q(e);
539
+ class w {
540
+ static async init(e, t) {
541
+ return new w(e, t);
1266
542
  }
1267
- constructor(e) {
543
+ constructor(e, t) {
1268
544
  Object.defineProperty(this, "session", {
1269
545
  enumerable: !0,
1270
546
  configurable: !0,
1271
547
  writable: !0,
1272
548
  value: e
549
+ }), Object.defineProperty(this, "coordinator", {
550
+ enumerable: !0,
551
+ configurable: !0,
552
+ writable: !0,
553
+ value: t
1273
554
  }), Object.defineProperty(this, "state", {
1274
555
  enumerable: !0,
1275
556
  configurable: !0,
@@ -1303,18 +584,15 @@ class q {
1303
584
  var s;
1304
585
  if (this.hasFormElements())
1305
586
  throw new Error("Form elements can't be initialized twice. You can call `reset()` method or create new Hellgate client.");
1306
- const n = K.get(this);
1307
- if (!n)
1308
- throw new Error("Secure key not found");
1309
- const i = C({
587
+ const n = h({
1310
588
  disabled: !1,
1311
589
  autocomplete: "on",
1312
- style: { ...L }
590
+ style: { ...g }
1313
591
  }, r);
1314
592
  if (this.session.isNextAction("refresh_security_code") && ((s = this.session.state) != null && s.data)) {
1315
593
  const o = this.session.state.data;
1316
- i.cvcOnly = !0, i.value = {
1317
- number: te(o),
594
+ n.cvcOnly = !0, n.value = {
595
+ number: P(o),
1318
596
  expiry_date: {
1319
597
  month: (o == null ? void 0 : o.expiry_month) ?? null,
1320
598
  year: (o == null ? void 0 : o.expiry_year) ?? null
@@ -1322,7 +600,8 @@ class q {
1322
600
  cvc: null
1323
601
  };
1324
602
  }
1325
- const a = v("card", i, n);
603
+ n.schemes = x(this.getSessionSchemes(), n.schemes);
604
+ const a = b("card", n);
1326
605
  return this.cardElements.card = {
1327
606
  element: a,
1328
607
  state: this.createFieldDefaultState()
@@ -1333,16 +612,13 @@ class q {
1333
612
  configurable: !0,
1334
613
  writable: !0,
1335
614
  value: (r = {}) => {
1336
- const n = K.get(this);
1337
- if (!n)
1338
- throw new Error("Secure key not found");
1339
- const i = {
615
+ const n = {
1340
616
  disabled: !1,
1341
617
  autocomplete: "on",
1342
- style: { ...L }
1343
- }, a = v("text", {
1344
- ...C(i, { ...r })
1345
- }, n);
618
+ style: { ...g }
619
+ }, a = b("text", {
620
+ ...h(n, { ...r })
621
+ });
1346
622
  return this.textElements.push(a), a;
1347
623
  }
1348
624
  }), Object.defineProperty(this, "tokenize", {
@@ -1350,25 +626,20 @@ class q {
1350
626
  configurable: !0,
1351
627
  writable: !0,
1352
628
  value: async (r) => {
1353
- var o, c;
1354
- if (((o = this.session.state) == null ? void 0 : o.next_action) !== "tokenize_card")
1355
- throw new Error(`The session's next_action='${(c = this.session.state) == null ? void 0 : c.next_action}'. tokenize() is available only if next_action='tokenize_card'`);
1356
- const n = this.getFormValue(), i = this.extractAdditionalData(r);
1357
- if (!n)
1358
- throw new Error("Form elements must be initialized before tokenization");
1359
- const a = this.getCardDataValidationError();
1360
- if (a)
1361
- throw a;
1362
- if (!n.number || !n.expiration_month || !n.expiration_year || !n.cvc)
1363
- throw new Error("Card data is not complete");
1364
- const s = this.session.state.data;
1365
- return this.encryptCardData({
1366
- account_number: n.number,
1367
- expiry_month: n.expiration_month,
1368
- expiry_year: n.expiration_year,
1369
- security_code: n.cvc,
1370
- additional_data: i
1371
- }, s.jwk);
629
+ var a, s;
630
+ if (((a = this.session.state) == null ? void 0 : a.next_action) !== "tokenize_card")
631
+ throw new Error(`The session's next_action='${(s = this.session.state) == null ? void 0 : s.next_action}'. tokenize() is available only if next_action='tokenize_card'`);
632
+ const n = this.getCardDataValidationError();
633
+ if (n)
634
+ throw n;
635
+ return this.coordinator.postMessage({
636
+ type: "card:tokenize",
637
+ additionalData: this.serializeAdditionalData(r)
638
+ }), new Promise((o) => {
639
+ this.coordinator.onMessage("card:tokenize:response", (l) => {
640
+ o(l.success ? l.result : null);
641
+ });
642
+ });
1372
643
  }
1373
644
  }), Object.defineProperty(this, "onStateChange", {
1374
645
  enumerable: !0,
@@ -1389,7 +660,7 @@ class q {
1389
660
  configurable: !0,
1390
661
  writable: !0,
1391
662
  value: () => {
1392
- Object.values(this.cardElements).forEach((r) => r == null ? void 0 : r.element.unmount()), this.textElements.forEach((r) => r == null ? void 0 : r.unmount()), this.cardElements = {}, this.textElements = [];
663
+ Object.values(this.cardElements).forEach((r) => r == null ? void 0 : r.element.unmount()), this.textElements.forEach((r) => r == null ? void 0 : r.unmount()), this.cardElements = {}, this.textElements = [], this.state = this.createFieldDefaultState();
1393
664
  }
1394
665
  }), Object.defineProperty(this, "dispose", {
1395
666
  enumerable: !0,
@@ -1405,187 +676,131 @@ class q {
1405
676
  value: async (r = {}) => {
1406
677
  if (!this.hasFormElements())
1407
678
  throw new Error("Card form must be initialized and completed before processing");
679
+ const n = this.getCardDataValidationError();
680
+ if (n)
681
+ throw n;
1408
682
  if (this.session.isNextAction("refresh_security_code"))
1409
683
  return this.refreshSecurityCode();
1410
684
  this.disableFormElements(!0);
1411
685
  try {
1412
- const n = await this.tokenize(r);
1413
- if (!n)
1414
- throw new Error("Tokenization failed");
1415
- return await this.session.completeAction({
1416
- action: "tokenize_card",
1417
- result: n
686
+ return this.coordinator.postMessage({
687
+ type: "card:process",
688
+ additionalData: this.serializeAdditionalData(r)
689
+ }), new Promise((a, s) => {
690
+ this.coordinator.onMessage("card:process:response", (o) => {
691
+ o.result && o.success ? a(o.result) : s(new Error(o.error));
692
+ });
1418
693
  });
1419
- } catch (n) {
1420
- throw this.disableFormElements(!1), n;
694
+ } catch (a) {
695
+ throw this.disableFormElements(!1), a;
1421
696
  }
1422
697
  }
1423
- }), K.set(this, Ot()), this.cvcOnlyEnabled = this.session.isNextAction("refresh_security_code");
698
+ }), this.cvcOnlyEnabled = this.session.isNextAction("refresh_security_code");
1424
699
  }
1425
700
  createFormFields(e = {}) {
1426
- var u, d;
701
+ var l, c;
1427
702
  if (this.hasFormElements())
1428
703
  throw new Error("Form elements can't be initialized twice. You can call `reset()` method or create new Hellgate client.");
1429
- const r = K.get(this);
1430
- if (!r)
1431
- throw new Error("Secure key not found");
1432
- const n = {
704
+ const t = {
1433
705
  disabled: this.cvcOnlyEnabled,
1434
706
  autocomplete: "on",
1435
- style: { ...L }
1436
- }, { cardNumber: i = {}, securityCode: a = {}, ...s } = e, o = v("cardNumber", {
1437
- ...C(n, {
1438
- ...s,
1439
- ...i,
707
+ style: { ...g }
708
+ }, { cardNumber: r = {}, securityCode: n = {}, ...a } = e, s = b("cardNumber", {
709
+ ...h(t, {
710
+ ...a,
711
+ ...r,
1440
712
  cvcOnly: this.cvcOnlyEnabled,
1441
- value: this.session.isNextAction("refresh_security_code") && ((u = this.session.state) != null && u.data) ? te(this.session.state.data) : null
713
+ schemes: x(this.getSessionSchemes(), r.schemes ?? a.schemes),
714
+ value: this.session.isNextAction("refresh_security_code") && ((l = this.session.state) != null && l.data) ? P(this.session.state.data) : null
1442
715
  })
1443
- }, r), c = v("cardVerificationCode", {
1444
- ...C({
1445
- ...n,
716
+ }), o = b("cardVerificationCode", {
717
+ ...h({
718
+ ...t,
1446
719
  disabled: !1,
1447
720
  autofocus: this.cvcOnlyEnabled
1448
721
  }, {
1449
- ...s,
1450
- ...a
722
+ ...a,
723
+ ...n
1451
724
  })
1452
- }, r);
1453
- if (o.on("change", (h) => {
1454
- const p = h.cardBrand;
1455
- c.update({ cardType: p });
725
+ });
726
+ if (s.on("change", (d) => {
727
+ const u = d.cardBrand;
728
+ o.update({ cardType: u });
1456
729
  }), this.cardElements = {
1457
730
  cardNumber: {
1458
- element: o,
731
+ element: s,
1459
732
  state: this.createFieldDefaultState()
1460
733
  },
1461
734
  cardVerificationCode: {
1462
- element: c,
735
+ element: o,
1463
736
  state: this.createFieldDefaultState()
1464
737
  }
1465
738
  }, this.addElementStateListener("cardNumber"), this.addElementStateListener("cardVerificationCode"), e.expiryDateElement === "separate") {
1466
- const { expiryMonth: h = {}, expiryYear: p = {} } = e, E = v("cardExpirationMonth", {
1467
- ...C(n, {
1468
- ...s,
1469
- ...h
739
+ const { expiryMonth: d = {}, expiryYear: u = {} } = e, _ = b("cardExpirationMonth", {
740
+ ...h(t, {
741
+ ...a,
742
+ ...d
1470
743
  })
1471
- }, r), l = v("cardExpirationYear", {
1472
- ...C(n, {
1473
- ...s,
1474
- ...p
744
+ }), v = b("cardExpirationYear", {
745
+ ...h(t, {
746
+ ...a,
747
+ ...u
1475
748
  })
1476
- }, r);
1477
- return l.on("change", () => {
1478
- const m = y(this, l);
1479
- E.update({
1480
- expiryYear: m ? String(y(this, l)) : void 0
1481
- });
1482
- }), this.cardElements.cardExpirationMonth = {
1483
- element: E,
749
+ });
750
+ return this.cardElements.cardExpirationMonth = {
751
+ element: _,
1484
752
  state: this.createFieldDefaultState()
1485
753
  }, this.cardElements.cardExpirationYear = {
1486
- element: l,
754
+ element: v,
1487
755
  state: this.createFieldDefaultState()
1488
- }, this.addElementStateListener("cardExpirationMonth"), this.addElementStateListener("cardExpirationYear"), { cardNumber: o, expiryMonth: E, expiryYear: l, securityCode: c };
756
+ }, this.addElementStateListener("cardExpirationMonth"), this.addElementStateListener("cardExpirationYear"), { cardNumber: s, expiryMonth: _, expiryYear: v, securityCode: o };
1489
757
  } else {
1490
- const { expiryDate: h = {} } = e, p = v("cardExpirationDate", {
1491
- ...C(n, {
1492
- ...s,
1493
- ...h,
1494
- value: this.session.isNextAction("refresh_security_code") && ((d = this.session.state) != null && d.data) ? {
758
+ const { expiryDate: d = {} } = e, u = b("cardExpirationDate", {
759
+ ...h(t, {
760
+ ...a,
761
+ ...d,
762
+ value: this.session.isNextAction("refresh_security_code") && ((c = this.session.state) != null && c.data) ? {
1495
763
  month: this.session.state.data.expiry_month,
1496
764
  year: this.session.state.data.expiry_year
1497
765
  } : null
1498
766
  })
1499
- }, r);
767
+ });
1500
768
  return this.cardElements.cardExpirationDate = {
1501
- element: p,
769
+ element: u,
1502
770
  state: this.createFieldDefaultState()
1503
- }, this.addElementStateListener("cardExpirationDate"), { cardNumber: o, expiryDate: p, securityCode: c };
771
+ }, this.addElementStateListener("cardExpirationDate"), { cardNumber: s, expiryDate: u, securityCode: o };
1504
772
  }
1505
773
  }
1506
774
  async refreshSecurityCode() {
1507
- const e = this.getFormValue();
1508
- if (!(e != null && e.cvc))
1509
- throw new Error("cvc field was not filled");
1510
- if (!this.session.isNextAction("refresh_security_code") || !this.session.state)
1511
- throw new Error("refreshSecurityCode() is available only if next_action=refresh_security_code");
1512
- this.disableFormElements(!0);
1513
- const r = await this.encryptCardData({ security_code: e.cvc }, this.session.state.data.jwk);
1514
- return this.session.completeAction({
1515
- action: "refresh_security_code",
1516
- result: { ...r }
1517
- }).catch((n) => {
1518
- if (this.disableFormElements(!1), n instanceof Error)
1519
- throw n;
1520
- return { status: "failure", data: n };
775
+ return this.coordinator.postMessage({
776
+ type: "card:refresh_security_code"
777
+ }), new Promise((e, t) => {
778
+ this.coordinator.onMessage("card:refresh_security_code:response", (r) => {
779
+ r.result ? e(r.result) : t(new Error(r.error));
780
+ });
1521
781
  });
1522
782
  }
1523
- getFormValue() {
1524
- var c, u, d, h, p, E;
1525
- const { card: e, cardNumber: r, cardExpirationDate: n, cardExpirationMonth: i, cardExpirationYear: a, cardVerificationCode: s } = this.cardElements;
1526
- let o;
1527
- if (e) {
1528
- const l = y(this, e.element);
1529
- o = {
1530
- number: (l == null ? void 0 : l.number) ?? null,
1531
- expiration_month: ((c = l == null ? void 0 : l.expiry_date) == null ? void 0 : c.month) ?? null,
1532
- expiration_year: ((u = l == null ? void 0 : l.expiry_date) == null ? void 0 : u.year) ?? null,
1533
- cvc: (l == null ? void 0 : l.cvc) ?? null
1534
- };
1535
- }
1536
- if (r && s && (n && (o = {
1537
- number: ((d = y(this, r.element)) == null ? void 0 : d.replaceAll(" ", "")) ?? null,
1538
- expiration_month: ((h = y(this, n.element)) == null ? void 0 : h.month) ?? null,
1539
- expiration_year: ((p = y(this, n.element)) == null ? void 0 : p.year) ?? null,
1540
- cvc: y(this, s.element)
1541
- }), i && a)) {
1542
- const l = y(this, i.element), m = y(this, a.element);
1543
- o = {
1544
- number: ((E = y(this, r.element)) == null ? void 0 : E.replaceAll(" ", "")) ?? null,
1545
- expiration_month: l ? Number(l) : null,
1546
- expiration_year: m ? Number(m) : null,
1547
- cvc: y(this, s.element)
1548
- };
1549
- }
1550
- return o;
1551
- }
1552
783
  hasFormElements() {
1553
784
  return !!Object.keys(this.cardElements).length;
1554
785
  }
1555
786
  disableFormElements(e) {
1556
- Object.values(this.cardElements).forEach(({ element: r }) => {
1557
- r.update({ disabled: e });
1558
- });
1559
- }
1560
- extractAdditionalData({ cardholder_name: e, billing_address: r = {} }) {
1561
- return re({
1562
- cardholder_name: H(this, e),
1563
- billing_address: {
1564
- line1: H(this, r.line1),
1565
- line2: H(this, r.line2),
1566
- line3: H(this, r.line3),
1567
- city: H(this, r.city),
1568
- postal_code: H(this, r.postal_code)
1569
- }
787
+ Object.values(this.cardElements).forEach(({ element: t }) => {
788
+ t.update({ disabled: e });
1570
789
  });
1571
790
  }
1572
- async encryptCardData(e, r) {
1573
- const n = await nt(r, "RSA-OAEP"), i = JSON.stringify(e), a = new TextEncoder().encode(i);
1574
- return { enc_payload: await new bt(a).setProtectedHeader({ alg: "RSA-OAEP", enc: "A256GCM" }).encrypt(n) };
1575
- }
1576
791
  addElementStateListener(e) {
1577
- const r = this.cardElements[e];
1578
- r && r.element.on("change", (n) => {
1579
- r.state = n, this.updateFormState();
792
+ const t = this.cardElements[e];
793
+ t && t.element.on("change", (r) => {
794
+ t.state = r, this.updateFormState();
1580
795
  });
1581
796
  }
1582
797
  updateFormState() {
1583
798
  const e = this.cvcOnlyEnabled && this.cardElements.cardVerificationCode ? [this.cardElements.cardVerificationCode] : Object.values(this.cardElements);
1584
- e.length ? this.state = e.reduce((r, { state: n }) => (r.valid = !!r.valid && !!n.valid, r.complete = !!r.complete && !!n.complete, r.empty = !!r.empty && !!n.empty, r.error = r.error || n.error, r.errorCode = r.errorCode || n.errorCode, r), {
799
+ e.length ? this.state = e.reduce((t, { state: r }) => (t.valid = !!t.valid && !!r.valid, t.complete = !!t.complete && !!r.complete, t.empty = !!t.empty && !!r.empty, t.error = t.error || r.error, t.errorCode = t.errorCode || r.errorCode, t), {
1585
800
  valid: !0,
1586
801
  complete: !0,
1587
802
  empty: !0
1588
- }) : this.state = this.createFieldDefaultState(), this.stateChangeHandlers.forEach((r) => r(this.state));
803
+ }) : this.state = this.createFieldDefaultState(), this.stateChangeHandlers.forEach((t) => t(this.state));
1589
804
  }
1590
805
  createFieldDefaultState() {
1591
806
  return {
@@ -1594,6 +809,27 @@ class q {
1594
809
  valid: !1
1595
810
  };
1596
811
  }
812
+ serializeAdditionalData({ cardholder_name: e, billing_address: t = {}, ephemeral: r, expiration_date: n }) {
813
+ const a = C({
814
+ cardholder_name: m(e),
815
+ billing_address: {
816
+ line1: m(t.line1),
817
+ line2: m(t.line2),
818
+ line3: m(t.line3),
819
+ city: m(t.city),
820
+ postal_code: m(t.postal_code)
821
+ }
822
+ });
823
+ return typeof r == "boolean" && (a.ephemeral = r), typeof n == "string" && (a.expiration_date = n), a;
824
+ }
825
+ getSessionSchemes() {
826
+ var t, r;
827
+ if (!this.session.isNextAction("tokenize_card"))
828
+ return;
829
+ const e = (t = this.session.state) == null ? void 0 : t.data;
830
+ if ((r = e == null ? void 0 : e.allowed_schemes) != null && r.length)
831
+ return X(e.allowed_schemes);
832
+ }
1597
833
  getCardDataValidationError() {
1598
834
  if (!this.state.complete)
1599
835
  return new Error(this.state.error ?? "Card data is not complete");
@@ -1601,22 +837,99 @@ class q {
1601
837
  return new Error(`Card data is not valid. ${this.state.error}`);
1602
838
  }
1603
839
  }
1604
- const K = /* @__PURE__ */ new Map();
1605
- function y(t, e) {
1606
- const r = K.get(t);
1607
- return r ? e.secureValue(r) : null;
840
+ function m(i) {
841
+ if (typeof i == "string")
842
+ return i;
843
+ if (i != null && i.key)
844
+ return { key: i.key };
845
+ }
846
+ function x(i, e) {
847
+ return i === void 0 ? e : i.length === 0 ? [] : e != null && e.length ? e.filter((t) => i.includes(t)) : i;
1608
848
  }
1609
- function H(t, e) {
1610
- const r = K.get(t);
1611
- return e instanceof Pe && r ? y(t, e) ?? void 0 : e;
849
+ const J = "v3.10.0";
850
+ class Q {
851
+ constructor() {
852
+ if (Object.defineProperty(this, "iframe", {
853
+ enumerable: !0,
854
+ configurable: !0,
855
+ writable: !0,
856
+ value: null
857
+ }), Object.defineProperty(this, "iframeBaseUrl", {
858
+ enumerable: !0,
859
+ configurable: !0,
860
+ writable: !0,
861
+ value: void 0
862
+ }), Object.defineProperty(this, "messageHandler", {
863
+ enumerable: !0,
864
+ configurable: !0,
865
+ writable: !0,
866
+ value: null
867
+ }), Object.defineProperty(this, "init", {
868
+ enumerable: !0,
869
+ configurable: !0,
870
+ writable: !0,
871
+ value: async (e, t, r) => (window.fetchMocker = { a: 1 }, new Promise((n, a) => {
872
+ r == null || r.signal.addEventListener("abort", () => {
873
+ const l = new Error("Coordinator init aborted");
874
+ l.name = "AbortError", a(l), this.dispose();
875
+ });
876
+ const s = document.createElement("div");
877
+ s.setAttribute("style", "position:absolute;width:0;height:0;overflow:hidden;"), s.setAttribute("data-hg-coordinator", ""), document.body.appendChild(s);
878
+ const o = `${this.iframeBaseUrl}?type=coordinator&sessionId=${e}&apiBaseUrl=${t}&origin=${encodeURIComponent(location.origin)}`;
879
+ if (s.innerHTML = `<iframe src="${o}" width="0" height="0" style="border:none;" tabindex="-1" aria-hidden="true"></iframe>`, this.iframe = s.querySelector("iframe"), !this.iframe) {
880
+ a(new Error("Failed to create coordinator iframe"));
881
+ return;
882
+ }
883
+ this.messageHandler = (l) => {
884
+ var c, d, u;
885
+ if (l.source === ((c = this.iframe) == null ? void 0 : c.contentWindow)) {
886
+ if (((d = l.data) == null ? void 0 : d.type) === "coordinator:ready") {
887
+ n();
888
+ return;
889
+ }
890
+ if (((u = l.data) == null ? void 0 : u.type) === "coordinator:error") {
891
+ a(l.data.error);
892
+ return;
893
+ }
894
+ }
895
+ }, window.addEventListener("message", this.messageHandler), this.iframe.addEventListener("error", () => {
896
+ a(new Error("Coordinator iframe failed to load"));
897
+ });
898
+ }))
899
+ }), this.iframeBaseUrl = S(J), !this.iframeBaseUrl)
900
+ throw new Error("IFRAME_BASE_URL not found");
901
+ }
902
+ /**
903
+ * Send a command to the coordinator iframe.
904
+ * Only commands and configuration — never card data.
905
+ */
906
+ postMessage(e) {
907
+ var t, r;
908
+ (r = (t = this.iframe) == null ? void 0 : t.contentWindow) == null || r.postMessage(e, this.iframeBaseUrl);
909
+ }
910
+ onMessage(e, t) {
911
+ window.addEventListener("message", (r) => {
912
+ var n, a;
913
+ r.source === ((n = this.iframe) == null ? void 0 : n.contentWindow) && ((a = r.data) == null ? void 0 : a.type) === e && t(r.data);
914
+ });
915
+ }
916
+ /**
917
+ * Clean up the coordinator iframe and all associated resources.
918
+ */
919
+ dispose() {
920
+ var t;
921
+ this.postMessage({ type: "coordinator:dispose" }), this.messageHandler && (window.removeEventListener("message", this.messageHandler), this.messageHandler = null);
922
+ const e = (t = this.iframe) == null ? void 0 : t.parentElement;
923
+ this.iframe = null, e == null || e.remove();
924
+ }
1612
925
  }
1613
- class xt {
1614
- constructor(e = "https://api.hellgate.io", r = new AbortController()) {
926
+ class Z {
927
+ constructor(e = "https://api.hellgate.io", t = new AbortController()) {
1615
928
  Object.defineProperty(this, "abortCtrl", {
1616
929
  enumerable: !0,
1617
930
  configurable: !0,
1618
931
  writable: !0,
1619
- value: r
932
+ value: t
1620
933
  }), Object.defineProperty(this, "baseUrl", {
1621
934
  enumerable: !0,
1622
935
  configurable: !0,
@@ -1627,26 +940,26 @@ class xt {
1627
940
  getSession(e) {
1628
941
  return fetch(`${this.baseUrl}/sessions/${e}`, {
1629
942
  signal: this.abortCtrl.signal
1630
- }).then((r) => V(r));
943
+ }).then((t) => E(t));
1631
944
  }
1632
- completeAction(e, r) {
945
+ completeAction(e, t) {
1633
946
  return fetch(`${this.baseUrl}/sessions/${e}/complete-action`, {
1634
947
  method: "POST",
1635
948
  headers: {
1636
949
  "Content-Type": "application/json"
1637
950
  },
1638
951
  mode: "cors",
1639
- body: JSON.stringify(r),
952
+ body: JSON.stringify(t),
1640
953
  signal: this.abortCtrl.signal
1641
- }).then((n) => V(n));
954
+ }).then((r) => E(r));
1642
955
  }
1643
956
  cancelAll() {
1644
957
  this.abortCtrl.abort();
1645
958
  }
1646
959
  }
1647
- const Ht = 2e3;
1648
- class Kt {
1649
- constructor(e, r) {
960
+ const ee = 2e3;
961
+ class te {
962
+ constructor(e, t) {
1650
963
  Object.defineProperty(this, "id", {
1651
964
  enumerable: !0,
1652
965
  configurable: !0,
@@ -1656,7 +969,7 @@ class Kt {
1656
969
  enumerable: !0,
1657
970
  configurable: !0,
1658
971
  writable: !0,
1659
- value: r
972
+ value: t
1660
973
  }), Object.defineProperty(this, "state", {
1661
974
  enumerable: !0,
1662
975
  configurable: !0,
@@ -1681,47 +994,47 @@ class Kt {
1681
994
  enumerable: !0,
1682
995
  configurable: !0,
1683
996
  writable: !0,
1684
- value: async () => new Promise((n, i) => {
997
+ value: async () => new Promise((r, n) => {
1685
998
  const a = this.onStateChange((s) => {
1686
- s.next_action !== "wait" && (n(s), a());
999
+ s.next_action !== "wait" && (r(s), a());
1687
1000
  });
1688
1001
  this.updateSessionState().catch((s) => {
1689
- s instanceof Response && s.status === 404 && i(new Error(`Session ${this.id} doesn't exist or has expired`)), i(s);
1002
+ s instanceof Response && s.status === 404 && n(new Error(`Session ${this.id} doesn't exist or has expired`)), n(s);
1690
1003
  });
1691
1004
  })
1692
1005
  }), Object.defineProperty(this, "onStateChange", {
1693
1006
  enumerable: !0,
1694
1007
  configurable: !0,
1695
1008
  writable: !0,
1696
- value: (n) => (this.stateChangeHandlers.push(n), this.state && n(this.state), () => this.stateChangeHandlers = this.stateChangeHandlers.filter((i) => i !== n))
1009
+ value: (r) => (this.stateChangeHandlers.push(r), this.state && r(this.state), () => this.stateChangeHandlers = this.stateChangeHandlers.filter((n) => n !== r))
1697
1010
  }), Object.defineProperty(this, "onClose", {
1698
1011
  enumerable: !0,
1699
1012
  configurable: !0,
1700
1013
  writable: !0,
1701
- value: (n) => {
1702
- var i;
1703
- return ((i = this.state) == null ? void 0 : i.next_action) === null ? (n(B(this.state)), () => {
1704
- }) : (this.onCloseHandlers.push(n), () => this.onCloseHandlers = this.onCloseHandlers.filter((a) => a !== n));
1014
+ value: (r) => {
1015
+ var n;
1016
+ return ((n = this.state) == null ? void 0 : n.next_action) === null ? (r(y(this.state)), () => {
1017
+ }) : (this.onCloseHandlers.push(r), () => this.onCloseHandlers = this.onCloseHandlers.filter((a) => a !== r));
1705
1018
  }
1706
1019
  }), Object.defineProperty(this, "completeAction", {
1707
1020
  enumerable: !0,
1708
1021
  configurable: !0,
1709
1022
  writable: !0,
1710
- value: async (n) => {
1711
- const i = this.state;
1023
+ value: async (r) => {
1024
+ const n = this.state;
1712
1025
  return new Promise((a, s) => {
1713
- const o = this.onStateChange((c) => {
1714
- c.next_action !== (i == null ? void 0 : i.next_action) && c.next_action === null && (a(B(c)), o());
1026
+ const o = this.onStateChange((l) => {
1027
+ l.next_action !== (n == null ? void 0 : n.next_action) && l.next_action === null && (a(y(l)), o());
1715
1028
  });
1716
- this.api.completeAction(this.id, n).then((c) => this.newStateHandle(c, s)).catch(async (c) => s(await Tt(c)));
1029
+ this.api.completeAction(this.id, r).then((l) => this.newStateHandle(l, s)).catch(async (l) => s(await re(l)));
1717
1030
  });
1718
1031
  }
1719
1032
  }), Object.defineProperty(this, "completeSession", {
1720
1033
  enumerable: !0,
1721
1034
  configurable: !0,
1722
1035
  writable: !0,
1723
- value: (n) => {
1724
- this.onCloseHandlers.forEach((i) => i(n)), this.stop();
1036
+ value: (r) => {
1037
+ this.onCloseHandlers.forEach((n) => n(r)), this.stop();
1725
1038
  }
1726
1039
  }), Object.defineProperty(this, "dispose", {
1727
1040
  enumerable: !0,
@@ -1733,46 +1046,51 @@ class Kt {
1733
1046
  });
1734
1047
  }
1735
1048
  isNextAction(e) {
1736
- var r;
1737
- return ((r = this.state) == null ? void 0 : r.next_action) === e;
1049
+ var t;
1050
+ return ((t = this.state) == null ? void 0 : t.next_action) === e;
1738
1051
  }
1739
1052
  stop() {
1740
1053
  window.clearTimeout(this.pollingTimer), this.stateChangeHandlers = [], this.onCloseHandlers = [];
1741
1054
  }
1742
1055
  async updateSessionState(e) {
1743
- const r = await this.api.getSession(this.id);
1744
- this.newStateHandle(r, e);
1056
+ const t = await this.api.getSession(this.id);
1057
+ this.newStateHandle(t, e);
1745
1058
  }
1746
- newStateHandle(e, r) {
1747
- var n;
1059
+ newStateHandle(e, t) {
1060
+ var r;
1748
1061
  switch (!e.next_action && e.status && (e.next_action = null), e.next_action) {
1749
1062
  case "wait": {
1750
- window.clearTimeout(this.pollingTimer), this.pollingTimer = window.setTimeout(() => this.updateSessionState(r).catch((i) => {
1751
- i instanceof Response && i.status === 404 && (r == null || r(new Error(`Session ${this.id} has expired`)));
1752
- }), Ht);
1063
+ window.clearTimeout(this.pollingTimer), this.pollingTimer = window.setTimeout(() => this.updateSessionState(t).catch((n) => {
1064
+ n instanceof Response && n.status === 404 && (t == null || t(new Error(`Session ${this.id} has expired`)));
1065
+ }), ee);
1753
1066
  break;
1754
1067
  }
1755
1068
  }
1756
- e.next_action !== ((n = this.state) == null ? void 0 : n.next_action) && this.stateChangeHandlers.forEach((i) => i(e)), e.next_action === null && this.completeSession(B(e)), this.state = e;
1069
+ e.next_action !== ((r = this.state) == null ? void 0 : r.next_action) && this.stateChangeHandlers.forEach((n) => n(e)), e.next_action === null && this.completeSession(y(e)), this.state = e;
1757
1070
  }
1758
1071
  }
1759
- async function Tt(t) {
1760
- return !t.ok && t.status >= 400 && t.status <= 500 ? t.json() : t;
1072
+ async function re(i) {
1073
+ return !i.ok && i.status >= 400 && i.status <= 500 ? i.json() : i;
1761
1074
  }
1762
- function B(t) {
1763
- const e = { ...t };
1075
+ function y(i) {
1076
+ const e = { ...i };
1764
1077
  return delete e.next_action, e;
1765
1078
  }
1766
- const Dt = {
1079
+ const ie = {
1767
1080
  base_url: "https://api.hellgate.io"
1768
1081
  };
1769
- class ve {
1770
- constructor(e, r) {
1082
+ class N {
1083
+ constructor(e, t, r) {
1771
1084
  Object.defineProperty(this, "session", {
1772
1085
  enumerable: !0,
1773
1086
  configurable: !0,
1774
1087
  writable: !0,
1775
1088
  value: e
1089
+ }), Object.defineProperty(this, "coordinator", {
1090
+ enumerable: !0,
1091
+ configurable: !0,
1092
+ writable: !0,
1093
+ value: t
1776
1094
  }), Object.defineProperty(this, "paymentFlowHandlers", {
1777
1095
  enumerable: !0,
1778
1096
  configurable: !0,
@@ -1783,7 +1101,7 @@ class ve {
1783
1101
  configurable: !0,
1784
1102
  writable: !0,
1785
1103
  value: () => {
1786
- this.session.dispose(), Object.values(this.paymentFlowHandlers).forEach((n) => n == null ? void 0 : n.dispose());
1104
+ this.session.dispose(), this.coordinator.dispose(), Object.values(this.paymentFlowHandlers).forEach((n) => n == null ? void 0 : n.dispose());
1787
1105
  }
1788
1106
  }), Object.defineProperty(this, "onSessionComplete", {
1789
1107
  enumerable: !0,
@@ -1797,46 +1115,47 @@ class ve {
1797
1115
  use(e) {
1798
1116
  return this.paymentFlowHandlers[e];
1799
1117
  }
1800
- static async init(e, r = {}) {
1801
- const { session: n, cardHandler: i, handler3DS: a } = await this.initHandlers(e, r);
1802
- return new ve(n, {
1803
- CARD: i,
1804
- "3DS": a
1118
+ static async init(e, t = {}) {
1119
+ const { session: r, coordinator: n, cardHandler: a, handler3DS: s } = await this.initHandlers(e, t);
1120
+ return new N(r, n, {
1121
+ CARD: a,
1122
+ "3DS": s
1805
1123
  });
1806
1124
  }
1807
- static async initHandlers(e, r) {
1808
- const n = {
1809
- ...Dt,
1810
- ...r
1811
- }, i = new xt(n.base_url, n.abortCtrl), a = new Kt(e, i);
1812
- await a.init();
1813
- const s = a.isNextAction("tokenize_card") || a.isNextAction("refresh_security_code") ? await this.createCardHandler(a) : void 0, o = this.create3DSHandler(a, r);
1814
- return { session: a, cardHandler: s, handler3DS: o };
1815
- }
1816
- static createCardHandler(e) {
1817
- return q.init(e);
1818
- }
1819
- static create3DSHandler(e, r) {
1820
- return new He(e, {
1821
- domContainer: r.challenge_3ds_container,
1822
- labelText: r.challenge_3ds_label_text
1125
+ static async initHandlers(e, t) {
1126
+ const r = {
1127
+ ...ie,
1128
+ ...t
1129
+ }, n = new Z(r.base_url, r.abortCtrl), a = new te(e, n), s = new Q();
1130
+ s.onMessage("coordinator:session_state_change", (c) => {
1131
+ c.state.next_action !== "wait" && a.newStateHandle(c.state);
1132
+ }), await s.init(e, r.base_url, r.abortCtrl);
1133
+ const o = a.isNextAction("tokenize_card") || a.isNextAction("refresh_security_code") ? await this.createCardHandler(a, s) : void 0, l = this.create3DSHandler(a, t);
1134
+ return { session: a, coordinator: s, cardHandler: o, handler3DS: l };
1135
+ }
1136
+ static createCardHandler(e, t) {
1137
+ return w.init(e, t);
1138
+ }
1139
+ static create3DSHandler(e, t) {
1140
+ return new k(e, {
1141
+ domContainer: t.challenge_3ds_container,
1142
+ labelText: t.challenge_3ds_label_text
1823
1143
  });
1824
1144
  }
1825
1145
  }
1826
1146
  globalThis.HellgateSDK && (globalThis.Hellgate = globalThis.HellgateSDK.Hellgate, delete globalThis.HellgateSDK);
1827
1147
  export {
1828
- Pt as CardElement,
1829
- _t as CardExpirationDateElement,
1830
- Ct as CardNumberElement,
1831
- vt as CardVerificationCodeElement,
1832
- ve as Hellgate,
1833
- He as Hellgate3DSHandler,
1834
- q as HellgateCardHandler,
1835
- Pe as TextElement,
1836
- v as createElement,
1837
- Ce as extractCardNumberValue,
1838
- _e as extractExpiryDateValue,
1839
- St as putCardNumberValue,
1840
- Se as putExpiryDateValue,
1841
- Ot as uid
1148
+ q as CardElement,
1149
+ z as CardExpirationDateElement,
1150
+ Y as CardNumberElement,
1151
+ G as CardVerificationCodeElement,
1152
+ N as Hellgate,
1153
+ k as Hellgate3DSHandler,
1154
+ w as HellgateCardHandler,
1155
+ K as TextElement,
1156
+ b as createElement,
1157
+ L as extractCardNumberValue,
1158
+ M as extractExpiryDateValue,
1159
+ B as putCardNumberValue,
1160
+ I as putExpiryDateValue
1842
1161
  };