cppay-sdk 0.0.2-beta.19 → 0.0.2-beta.20

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.
@@ -0,0 +1,1239 @@
1
+ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (t, c) => () => (c || t((c = { exports: {} }).exports, c), c.exports), __copyProps = (t, d, p, m) => {
2
+ if (d && typeof d == "object" || typeof d == "function") for (var h = __getOwnPropNames(d), g = 0, _ = h.length, v; g < _; g++) v = h[g], !__hasOwnProp.call(t, v) && v !== p && __defProp(t, v, {
3
+ get: ((t) => d[t]).bind(null, v),
4
+ enumerable: !(m = __getOwnPropDesc(d, v)) || m.enumerable
5
+ });
6
+ return t;
7
+ }, __toESM = (l, u, f) => (f = l == null ? {} : __create(__getProtoOf(l)), __copyProps(u || !l || !l.__esModule ? __defProp(f, "default", {
8
+ value: l,
9
+ enumerable: !0
10
+ }) : f, l)), payment_dialog_default = "._cppay-overlay{z-index:9999;background-color:#00000080;justify-content:center;align-items:center;padding:1rem;display:flex;position:fixed;inset:0}._cppay-dialog{background-color:#fff;border-radius:1.5rem;width:100%;max-width:28rem;overflow:hidden;box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a}._cppay-header{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:1.5rem;display:flex}._cppay-title{color:#111827;margin:0;font-size:1.25rem;font-weight:600}._cppay-close-btn{color:#9ca3af;cursor:pointer;background:0 0;border:none;padding:.25rem;transition:color .2s}._cppay-close-btn:hover:not(:disabled){color:#4b5563}._cppay-close-btn:disabled{opacity:.5;cursor:not-allowed}._cppay-close-btn svg{width:1.5rem;height:1.5rem}._cppay-content{padding:1.5rem}._cppay-section{margin-bottom:1.5rem}._cppay-section:last-child{margin-bottom:0}._cppay-label{color:#374151;margin-bottom:.5rem;font-size:.875rem;font-weight:500;display:block}._cppay-grid{grid-template-columns:repeat(2,1fr);gap:.75rem;display:grid}._cppay-select-btn{cursor:pointer;background:#fff;border:2px solid #e5e7eb;border-radius:.75rem;align-items:center;gap:.5rem;padding:.75rem;font-family:inherit;font-size:.875rem;transition:all .2s;display:flex}._cppay-select-btn:hover{border-color:#d1d5db}._cppay-select-btn._cppay-selected{background-color:#eff6ff;border-color:#2563eb}._cppay-select-btn img{border-radius:9999px;width:1.5rem;height:1.5rem}._cppay-select-btn span{font-weight:500}._cppay-price-box{background-color:#f9fafb;border-radius:1rem;padding:1rem}._cppay-price-row{justify-content:space-between;align-items:center;display:flex}._cppay-price-label{color:#4b5563;font-size:.875rem}._cppay-price-amount{text-align:right}._cppay-price-main{color:#111827;margin:0;font-size:1.25rem;font-weight:700}._cppay-price-sub{color:#6b7280;margin-top:.25rem;font-size:.875rem}._cppay-btn{cursor:pointer;border:none;border-radius:.75rem;width:100%;padding:.75rem;font-family:inherit;font-size:1rem;font-weight:500;transition:all .2s}._cppay-btn-primary{color:#fff;background-color:#2563eb}._cppay-btn-primary:hover:not(:disabled){background-color:#1d4ed8}._cppay-btn-primary:disabled{opacity:.5;cursor:not-allowed}._cppay-btn-secondary{color:#374151;background-color:#fff;border:1px solid #d1d5db}._cppay-btn-secondary:hover:not(:disabled){background-color:#f9fafb}._cppay-btn-secondary:disabled{opacity:.5;cursor:not-allowed}._cppay-qr-container{justify-content:center;margin-bottom:1.5rem;display:flex}._cppay-qr-placeholder{background-color:#f3f4f6;border-radius:1rem;justify-content:center;align-items:center;width:12rem;height:12rem;display:flex}._cppay-qr-placeholder span{color:#9ca3af;font-size:.875rem}._cppay-info-box{background-color:#f9fafb;border-radius:.75rem;margin-bottom:.75rem;padding:1rem}._cppay-info-box:last-child{margin-bottom:0}._cppay-info-label{color:#4b5563;margin-bottom:.25rem;font-size:.875rem}._cppay-info-value{color:#111827;font-size:1.25rem;font-weight:700}._cppay-address-row{align-items:center;gap:.5rem;display:flex}._cppay-address-row code{text-overflow:ellipsis;white-space:nowrap;color:#111827;background:0 0;flex:1;font-family:monospace;font-size:.75rem;overflow:hidden}._cppay-copy-btn{color:#2563eb;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:.25rem;transition:color .2s;display:flex}._cppay-copy-btn:hover{color:#1d4ed8}._cppay-copy-btn svg{width:1.25rem;height:1.25rem}@keyframes _cppay-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _cppay-slideUp{0%{opacity:0;transform:translateY(1.25rem)}to{opacity:1;transform:translateY(0)}}._cppay-overlay{animation:.3s _cppay-fadeIn}._cppay-dialog{animation:.3s _cppay-slideUp}@media (max-width:640px){._cppay-dialog{margin:.5rem}._cppay-header,._cppay-content{padding:1rem}}";
11
+ function injectStyle(t) {
12
+ if (typeof document > "u" || document.getElementById("_cppay-payment-dialog-style")) return;
13
+ let c = document.createElement("style");
14
+ c.id = "_cppay-payment-dialog-style", c.textContent = t, document.head.appendChild(c);
15
+ }
16
+ var require_can_promise = /* @__PURE__ */ __commonJSMin(((t, c) => {
17
+ c.exports = function() {
18
+ return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
19
+ };
20
+ })), require_utils$1 = /* @__PURE__ */ __commonJSMin(((t) => {
21
+ var c, l = [
22
+ 0,
23
+ 26,
24
+ 44,
25
+ 70,
26
+ 100,
27
+ 134,
28
+ 172,
29
+ 196,
30
+ 242,
31
+ 292,
32
+ 346,
33
+ 404,
34
+ 466,
35
+ 532,
36
+ 581,
37
+ 655,
38
+ 733,
39
+ 815,
40
+ 901,
41
+ 991,
42
+ 1085,
43
+ 1156,
44
+ 1258,
45
+ 1364,
46
+ 1474,
47
+ 1588,
48
+ 1706,
49
+ 1828,
50
+ 1921,
51
+ 2051,
52
+ 2185,
53
+ 2323,
54
+ 2465,
55
+ 2611,
56
+ 2761,
57
+ 2876,
58
+ 3034,
59
+ 3196,
60
+ 3362,
61
+ 3532,
62
+ 3706
63
+ ];
64
+ t.getSymbolSize = function(t) {
65
+ if (!t) throw Error("\"version\" cannot be null or undefined");
66
+ if (t < 1 || t > 40) throw Error("\"version\" should be in range from 1 to 40");
67
+ return t * 4 + 17;
68
+ }, t.getSymbolTotalCodewords = function(t) {
69
+ return l[t];
70
+ }, t.getBCHDigit = function(t) {
71
+ let c = 0;
72
+ for (; t !== 0;) c++, t >>>= 1;
73
+ return c;
74
+ }, t.setToSJISFunction = function(t) {
75
+ if (typeof t != "function") throw Error("\"toSJISFunc\" is not a valid function.");
76
+ c = t;
77
+ }, t.isKanjiModeEnabled = function() {
78
+ return c !== void 0;
79
+ }, t.toSJIS = function(t) {
80
+ return c(t);
81
+ };
82
+ })), require_error_correction_level = /* @__PURE__ */ __commonJSMin(((t) => {
83
+ t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
84
+ function c(c) {
85
+ if (typeof c != "string") throw Error("Param is not a string");
86
+ switch (c.toLowerCase()) {
87
+ case "l":
88
+ case "low": return t.L;
89
+ case "m":
90
+ case "medium": return t.M;
91
+ case "q":
92
+ case "quartile": return t.Q;
93
+ case "h":
94
+ case "high": return t.H;
95
+ default: throw Error("Unknown EC Level: " + c);
96
+ }
97
+ }
98
+ t.isValid = function(t) {
99
+ return t && t.bit !== void 0 && t.bit >= 0 && t.bit < 4;
100
+ }, t.from = function(l, u) {
101
+ if (t.isValid(l)) return l;
102
+ try {
103
+ return c(l);
104
+ } catch {
105
+ return u;
106
+ }
107
+ };
108
+ })), require_bit_buffer = /* @__PURE__ */ __commonJSMin(((t, c) => {
109
+ function l() {
110
+ this.buffer = [], this.length = 0;
111
+ }
112
+ l.prototype = {
113
+ get: function(t) {
114
+ let c = Math.floor(t / 8);
115
+ return (this.buffer[c] >>> 7 - t % 8 & 1) == 1;
116
+ },
117
+ put: function(t, c) {
118
+ for (let l = 0; l < c; l++) this.putBit((t >>> c - l - 1 & 1) == 1);
119
+ },
120
+ getLengthInBits: function() {
121
+ return this.length;
122
+ },
123
+ putBit: function(t) {
124
+ let c = Math.floor(this.length / 8);
125
+ this.buffer.length <= c && this.buffer.push(0), t && (this.buffer[c] |= 128 >>> this.length % 8), this.length++;
126
+ }
127
+ }, c.exports = l;
128
+ })), require_bit_matrix = /* @__PURE__ */ __commonJSMin(((t, c) => {
129
+ function l(t) {
130
+ if (!t || t < 1) throw Error("BitMatrix size must be defined and greater than 0");
131
+ this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
132
+ }
133
+ l.prototype.set = function(t, c, l, u) {
134
+ let d = t * this.size + c;
135
+ this.data[d] = l, u && (this.reservedBit[d] = !0);
136
+ }, l.prototype.get = function(t, c) {
137
+ return this.data[t * this.size + c];
138
+ }, l.prototype.xor = function(t, c, l) {
139
+ this.data[t * this.size + c] ^= l;
140
+ }, l.prototype.isReserved = function(t, c) {
141
+ return this.reservedBit[t * this.size + c];
142
+ }, c.exports = l;
143
+ })), require_alignment_pattern = /* @__PURE__ */ __commonJSMin(((t) => {
144
+ var c = require_utils$1().getSymbolSize;
145
+ t.getRowColCoords = function(t) {
146
+ if (t === 1) return [];
147
+ let l = Math.floor(t / 7) + 2, u = c(t), d = u === 145 ? 26 : Math.ceil((u - 13) / (2 * l - 2)) * 2, f = [u - 7];
148
+ for (let t = 1; t < l - 1; t++) f[t] = f[t - 1] - d;
149
+ return f.push(6), f.reverse();
150
+ }, t.getPositions = function(c) {
151
+ let l = [], u = t.getRowColCoords(c), d = u.length;
152
+ for (let t = 0; t < d; t++) for (let c = 0; c < d; c++) t === 0 && c === 0 || t === 0 && c === d - 1 || t === d - 1 && c === 0 || l.push([u[t], u[c]]);
153
+ return l;
154
+ };
155
+ })), require_finder_pattern = /* @__PURE__ */ __commonJSMin(((t) => {
156
+ var c = require_utils$1().getSymbolSize, l = 7;
157
+ t.getPositions = function(t) {
158
+ let u = c(t);
159
+ return [
160
+ [0, 0],
161
+ [u - l, 0],
162
+ [0, u - l]
163
+ ];
164
+ };
165
+ })), require_mask_pattern = /* @__PURE__ */ __commonJSMin(((t) => {
166
+ t.Patterns = {
167
+ PATTERN000: 0,
168
+ PATTERN001: 1,
169
+ PATTERN010: 2,
170
+ PATTERN011: 3,
171
+ PATTERN100: 4,
172
+ PATTERN101: 5,
173
+ PATTERN110: 6,
174
+ PATTERN111: 7
175
+ };
176
+ var c = {
177
+ N1: 3,
178
+ N2: 3,
179
+ N3: 40,
180
+ N4: 10
181
+ };
182
+ t.isValid = function(t) {
183
+ return t != null && t !== "" && !isNaN(t) && t >= 0 && t <= 7;
184
+ }, t.from = function(c) {
185
+ return t.isValid(c) ? parseInt(c, 10) : void 0;
186
+ }, t.getPenaltyN1 = function(t) {
187
+ let l = t.size, u = 0, d = 0, f = 0, p = null, m = null;
188
+ for (let h = 0; h < l; h++) {
189
+ d = f = 0, p = m = null;
190
+ for (let g = 0; g < l; g++) {
191
+ let l = t.get(h, g);
192
+ l === p ? d++ : (d >= 5 && (u += c.N1 + (d - 5)), p = l, d = 1), l = t.get(g, h), l === m ? f++ : (f >= 5 && (u += c.N1 + (f - 5)), m = l, f = 1);
193
+ }
194
+ d >= 5 && (u += c.N1 + (d - 5)), f >= 5 && (u += c.N1 + (f - 5));
195
+ }
196
+ return u;
197
+ }, t.getPenaltyN2 = function(t) {
198
+ let l = t.size, u = 0;
199
+ for (let c = 0; c < l - 1; c++) for (let d = 0; d < l - 1; d++) {
200
+ let l = t.get(c, d) + t.get(c, d + 1) + t.get(c + 1, d) + t.get(c + 1, d + 1);
201
+ (l === 4 || l === 0) && u++;
202
+ }
203
+ return u * c.N2;
204
+ }, t.getPenaltyN3 = function(t) {
205
+ let l = t.size, u = 0, d = 0, f = 0;
206
+ for (let c = 0; c < l; c++) {
207
+ d = f = 0;
208
+ for (let p = 0; p < l; p++) d = d << 1 & 2047 | t.get(c, p), p >= 10 && (d === 1488 || d === 93) && u++, f = f << 1 & 2047 | t.get(p, c), p >= 10 && (f === 1488 || f === 93) && u++;
209
+ }
210
+ return u * c.N3;
211
+ }, t.getPenaltyN4 = function(t) {
212
+ let l = 0, u = t.data.length;
213
+ for (let c = 0; c < u; c++) l += t.data[c];
214
+ return Math.abs(Math.ceil(l * 100 / u / 5) - 10) * c.N4;
215
+ };
216
+ function l(c, l, u) {
217
+ switch (c) {
218
+ case t.Patterns.PATTERN000: return (l + u) % 2 == 0;
219
+ case t.Patterns.PATTERN001: return l % 2 == 0;
220
+ case t.Patterns.PATTERN010: return u % 3 == 0;
221
+ case t.Patterns.PATTERN011: return (l + u) % 3 == 0;
222
+ case t.Patterns.PATTERN100: return (Math.floor(l / 2) + Math.floor(u / 3)) % 2 == 0;
223
+ case t.Patterns.PATTERN101: return l * u % 2 + l * u % 3 == 0;
224
+ case t.Patterns.PATTERN110: return (l * u % 2 + l * u % 3) % 2 == 0;
225
+ case t.Patterns.PATTERN111: return (l * u % 3 + (l + u) % 2) % 2 == 0;
226
+ default: throw Error("bad maskPattern:" + c);
227
+ }
228
+ }
229
+ t.applyMask = function(t, c) {
230
+ let u = c.size;
231
+ for (let d = 0; d < u; d++) for (let f = 0; f < u; f++) c.isReserved(f, d) || c.xor(f, d, l(t, f, d));
232
+ }, t.getBestMask = function(c, l) {
233
+ let u = Object.keys(t.Patterns).length, d = 0, f = Infinity;
234
+ for (let p = 0; p < u; p++) {
235
+ l(p), t.applyMask(p, c);
236
+ let u = t.getPenaltyN1(c) + t.getPenaltyN2(c) + t.getPenaltyN3(c) + t.getPenaltyN4(c);
237
+ t.applyMask(p, c), u < f && (f = u, d = p);
238
+ }
239
+ return d;
240
+ };
241
+ })), require_error_correction_code = /* @__PURE__ */ __commonJSMin(((t) => {
242
+ var c = require_error_correction_level(), l = [
243
+ 1,
244
+ 1,
245
+ 1,
246
+ 1,
247
+ 1,
248
+ 1,
249
+ 1,
250
+ 1,
251
+ 1,
252
+ 1,
253
+ 2,
254
+ 2,
255
+ 1,
256
+ 2,
257
+ 2,
258
+ 4,
259
+ 1,
260
+ 2,
261
+ 4,
262
+ 4,
263
+ 2,
264
+ 4,
265
+ 4,
266
+ 4,
267
+ 2,
268
+ 4,
269
+ 6,
270
+ 5,
271
+ 2,
272
+ 4,
273
+ 6,
274
+ 6,
275
+ 2,
276
+ 5,
277
+ 8,
278
+ 8,
279
+ 4,
280
+ 5,
281
+ 8,
282
+ 8,
283
+ 4,
284
+ 5,
285
+ 8,
286
+ 11,
287
+ 4,
288
+ 8,
289
+ 10,
290
+ 11,
291
+ 4,
292
+ 9,
293
+ 12,
294
+ 16,
295
+ 4,
296
+ 9,
297
+ 16,
298
+ 16,
299
+ 6,
300
+ 10,
301
+ 12,
302
+ 18,
303
+ 6,
304
+ 10,
305
+ 17,
306
+ 16,
307
+ 6,
308
+ 11,
309
+ 16,
310
+ 19,
311
+ 6,
312
+ 13,
313
+ 18,
314
+ 21,
315
+ 7,
316
+ 14,
317
+ 21,
318
+ 25,
319
+ 8,
320
+ 16,
321
+ 20,
322
+ 25,
323
+ 8,
324
+ 17,
325
+ 23,
326
+ 25,
327
+ 9,
328
+ 17,
329
+ 23,
330
+ 34,
331
+ 9,
332
+ 18,
333
+ 25,
334
+ 30,
335
+ 10,
336
+ 20,
337
+ 27,
338
+ 32,
339
+ 12,
340
+ 21,
341
+ 29,
342
+ 35,
343
+ 12,
344
+ 23,
345
+ 34,
346
+ 37,
347
+ 12,
348
+ 25,
349
+ 34,
350
+ 40,
351
+ 13,
352
+ 26,
353
+ 35,
354
+ 42,
355
+ 14,
356
+ 28,
357
+ 38,
358
+ 45,
359
+ 15,
360
+ 29,
361
+ 40,
362
+ 48,
363
+ 16,
364
+ 31,
365
+ 43,
366
+ 51,
367
+ 17,
368
+ 33,
369
+ 45,
370
+ 54,
371
+ 18,
372
+ 35,
373
+ 48,
374
+ 57,
375
+ 19,
376
+ 37,
377
+ 51,
378
+ 60,
379
+ 19,
380
+ 38,
381
+ 53,
382
+ 63,
383
+ 20,
384
+ 40,
385
+ 56,
386
+ 66,
387
+ 21,
388
+ 43,
389
+ 59,
390
+ 70,
391
+ 22,
392
+ 45,
393
+ 62,
394
+ 74,
395
+ 24,
396
+ 47,
397
+ 65,
398
+ 77,
399
+ 25,
400
+ 49,
401
+ 68,
402
+ 81
403
+ ], u = [
404
+ 7,
405
+ 10,
406
+ 13,
407
+ 17,
408
+ 10,
409
+ 16,
410
+ 22,
411
+ 28,
412
+ 15,
413
+ 26,
414
+ 36,
415
+ 44,
416
+ 20,
417
+ 36,
418
+ 52,
419
+ 64,
420
+ 26,
421
+ 48,
422
+ 72,
423
+ 88,
424
+ 36,
425
+ 64,
426
+ 96,
427
+ 112,
428
+ 40,
429
+ 72,
430
+ 108,
431
+ 130,
432
+ 48,
433
+ 88,
434
+ 132,
435
+ 156,
436
+ 60,
437
+ 110,
438
+ 160,
439
+ 192,
440
+ 72,
441
+ 130,
442
+ 192,
443
+ 224,
444
+ 80,
445
+ 150,
446
+ 224,
447
+ 264,
448
+ 96,
449
+ 176,
450
+ 260,
451
+ 308,
452
+ 104,
453
+ 198,
454
+ 288,
455
+ 352,
456
+ 120,
457
+ 216,
458
+ 320,
459
+ 384,
460
+ 132,
461
+ 240,
462
+ 360,
463
+ 432,
464
+ 144,
465
+ 280,
466
+ 408,
467
+ 480,
468
+ 168,
469
+ 308,
470
+ 448,
471
+ 532,
472
+ 180,
473
+ 338,
474
+ 504,
475
+ 588,
476
+ 196,
477
+ 364,
478
+ 546,
479
+ 650,
480
+ 224,
481
+ 416,
482
+ 600,
483
+ 700,
484
+ 224,
485
+ 442,
486
+ 644,
487
+ 750,
488
+ 252,
489
+ 476,
490
+ 690,
491
+ 816,
492
+ 270,
493
+ 504,
494
+ 750,
495
+ 900,
496
+ 300,
497
+ 560,
498
+ 810,
499
+ 960,
500
+ 312,
501
+ 588,
502
+ 870,
503
+ 1050,
504
+ 336,
505
+ 644,
506
+ 952,
507
+ 1110,
508
+ 360,
509
+ 700,
510
+ 1020,
511
+ 1200,
512
+ 390,
513
+ 728,
514
+ 1050,
515
+ 1260,
516
+ 420,
517
+ 784,
518
+ 1140,
519
+ 1350,
520
+ 450,
521
+ 812,
522
+ 1200,
523
+ 1440,
524
+ 480,
525
+ 868,
526
+ 1290,
527
+ 1530,
528
+ 510,
529
+ 924,
530
+ 1350,
531
+ 1620,
532
+ 540,
533
+ 980,
534
+ 1440,
535
+ 1710,
536
+ 570,
537
+ 1036,
538
+ 1530,
539
+ 1800,
540
+ 570,
541
+ 1064,
542
+ 1590,
543
+ 1890,
544
+ 600,
545
+ 1120,
546
+ 1680,
547
+ 1980,
548
+ 630,
549
+ 1204,
550
+ 1770,
551
+ 2100,
552
+ 660,
553
+ 1260,
554
+ 1860,
555
+ 2220,
556
+ 720,
557
+ 1316,
558
+ 1950,
559
+ 2310,
560
+ 750,
561
+ 1372,
562
+ 2040,
563
+ 2430
564
+ ];
565
+ t.getBlocksCount = function(t, u) {
566
+ switch (u) {
567
+ case c.L: return l[(t - 1) * 4 + 0];
568
+ case c.M: return l[(t - 1) * 4 + 1];
569
+ case c.Q: return l[(t - 1) * 4 + 2];
570
+ case c.H: return l[(t - 1) * 4 + 3];
571
+ default: return;
572
+ }
573
+ }, t.getTotalCodewordsCount = function(t, l) {
574
+ switch (l) {
575
+ case c.L: return u[(t - 1) * 4 + 0];
576
+ case c.M: return u[(t - 1) * 4 + 1];
577
+ case c.Q: return u[(t - 1) * 4 + 2];
578
+ case c.H: return u[(t - 1) * 4 + 3];
579
+ default: return;
580
+ }
581
+ };
582
+ })), require_galois_field = /* @__PURE__ */ __commonJSMin(((t) => {
583
+ var c = new Uint8Array(512), l = new Uint8Array(256);
584
+ (function() {
585
+ let t = 1;
586
+ for (let u = 0; u < 255; u++) c[u] = t, l[t] = u, t <<= 1, t & 256 && (t ^= 285);
587
+ for (let t = 255; t < 512; t++) c[t] = c[t - 255];
588
+ })(), t.log = function(t) {
589
+ if (t < 1) throw Error("log(" + t + ")");
590
+ return l[t];
591
+ }, t.exp = function(t) {
592
+ return c[t];
593
+ }, t.mul = function(t, u) {
594
+ return t === 0 || u === 0 ? 0 : c[l[t] + l[u]];
595
+ };
596
+ })), require_polynomial = /* @__PURE__ */ __commonJSMin(((t) => {
597
+ var c = require_galois_field();
598
+ t.mul = function(t, l) {
599
+ let u = new Uint8Array(t.length + l.length - 1);
600
+ for (let d = 0; d < t.length; d++) for (let f = 0; f < l.length; f++) u[d + f] ^= c.mul(t[d], l[f]);
601
+ return u;
602
+ }, t.mod = function(t, l) {
603
+ let u = new Uint8Array(t);
604
+ for (; u.length - l.length >= 0;) {
605
+ let t = u[0];
606
+ for (let d = 0; d < l.length; d++) u[d] ^= c.mul(l[d], t);
607
+ let d = 0;
608
+ for (; d < u.length && u[d] === 0;) d++;
609
+ u = u.slice(d);
610
+ }
611
+ return u;
612
+ }, t.generateECPolynomial = function(l) {
613
+ let u = new Uint8Array([1]);
614
+ for (let d = 0; d < l; d++) u = t.mul(u, new Uint8Array([1, c.exp(d)]));
615
+ return u;
616
+ };
617
+ })), require_reed_solomon_encoder = /* @__PURE__ */ __commonJSMin(((t, c) => {
618
+ var l = require_polynomial();
619
+ function u(t) {
620
+ this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree);
621
+ }
622
+ u.prototype.initialize = function(t) {
623
+ this.degree = t, this.genPoly = l.generateECPolynomial(this.degree);
624
+ }, u.prototype.encode = function(t) {
625
+ if (!this.genPoly) throw Error("Encoder not initialized");
626
+ let c = new Uint8Array(t.length + this.degree);
627
+ c.set(t);
628
+ let u = l.mod(c, this.genPoly), d = this.degree - u.length;
629
+ if (d > 0) {
630
+ let t = new Uint8Array(this.degree);
631
+ return t.set(u, d), t;
632
+ }
633
+ return u;
634
+ }, c.exports = u;
635
+ })), require_version_check = /* @__PURE__ */ __commonJSMin(((t) => {
636
+ t.isValid = function(t) {
637
+ return !isNaN(t) && t >= 1 && t <= 40;
638
+ };
639
+ })), require_regex = /* @__PURE__ */ __commonJSMin(((t) => {
640
+ var c = "[0-9]+", l = "[A-Z $%*+\\-./:]+", u = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
641
+ u = u.replace(/u/g, "\\u");
642
+ var d = "(?:(?![A-Z0-9 $%*+\\-./:]|" + u + ")(?:.|[\r\n]))+";
643
+ t.KANJI = new RegExp(u, "g"), t.BYTE_KANJI = RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), t.BYTE = new RegExp(d, "g"), t.NUMERIC = new RegExp(c, "g"), t.ALPHANUMERIC = new RegExp(l, "g");
644
+ var f = /* @__PURE__ */ RegExp("^" + u + "$"), p = /* @__PURE__ */ RegExp("^" + c + "$"), m = /* @__PURE__ */ RegExp("^[A-Z0-9 $%*+\\-./:]+$");
645
+ t.testKanji = function(t) {
646
+ return f.test(t);
647
+ }, t.testNumeric = function(t) {
648
+ return p.test(t);
649
+ }, t.testAlphanumeric = function(t) {
650
+ return m.test(t);
651
+ };
652
+ })), require_mode = /* @__PURE__ */ __commonJSMin(((t) => {
653
+ var c = require_version_check(), l = require_regex();
654
+ t.NUMERIC = {
655
+ id: "Numeric",
656
+ bit: 1,
657
+ ccBits: [
658
+ 10,
659
+ 12,
660
+ 14
661
+ ]
662
+ }, t.ALPHANUMERIC = {
663
+ id: "Alphanumeric",
664
+ bit: 2,
665
+ ccBits: [
666
+ 9,
667
+ 11,
668
+ 13
669
+ ]
670
+ }, t.BYTE = {
671
+ id: "Byte",
672
+ bit: 4,
673
+ ccBits: [
674
+ 8,
675
+ 16,
676
+ 16
677
+ ]
678
+ }, t.KANJI = {
679
+ id: "Kanji",
680
+ bit: 8,
681
+ ccBits: [
682
+ 8,
683
+ 10,
684
+ 12
685
+ ]
686
+ }, t.MIXED = { bit: -1 }, t.getCharCountIndicator = function(t, l) {
687
+ if (!t.ccBits) throw Error("Invalid mode: " + t);
688
+ if (!c.isValid(l)) throw Error("Invalid version: " + l);
689
+ return l >= 1 && l < 10 ? t.ccBits[0] : l < 27 ? t.ccBits[1] : t.ccBits[2];
690
+ }, t.getBestModeForData = function(c) {
691
+ return l.testNumeric(c) ? t.NUMERIC : l.testAlphanumeric(c) ? t.ALPHANUMERIC : l.testKanji(c) ? t.KANJI : t.BYTE;
692
+ }, t.toString = function(t) {
693
+ if (t && t.id) return t.id;
694
+ throw Error("Invalid mode");
695
+ }, t.isValid = function(t) {
696
+ return t && t.bit && t.ccBits;
697
+ };
698
+ function u(c) {
699
+ if (typeof c != "string") throw Error("Param is not a string");
700
+ switch (c.toLowerCase()) {
701
+ case "numeric": return t.NUMERIC;
702
+ case "alphanumeric": return t.ALPHANUMERIC;
703
+ case "kanji": return t.KANJI;
704
+ case "byte": return t.BYTE;
705
+ default: throw Error("Unknown mode: " + c);
706
+ }
707
+ }
708
+ t.from = function(c, l) {
709
+ if (t.isValid(c)) return c;
710
+ try {
711
+ return u(c);
712
+ } catch {
713
+ return l;
714
+ }
715
+ };
716
+ })), require_version = /* @__PURE__ */ __commonJSMin(((t) => {
717
+ var c = require_utils$1(), l = require_error_correction_code(), u = require_error_correction_level(), d = require_mode(), f = require_version_check(), p = 7973, m = c.getBCHDigit(p);
718
+ function h(c, l, u) {
719
+ for (let d = 1; d <= 40; d++) if (l <= t.getCapacity(d, u, c)) return d;
720
+ }
721
+ function g(t, c) {
722
+ return d.getCharCountIndicator(t, c) + 4;
723
+ }
724
+ function _(t, c) {
725
+ let l = 0;
726
+ return t.forEach(function(t) {
727
+ let u = g(t.mode, c);
728
+ l += u + t.getBitsLength();
729
+ }), l;
730
+ }
731
+ function v(c, l) {
732
+ for (let u = 1; u <= 40; u++) if (_(c, u) <= t.getCapacity(u, l, d.MIXED)) return u;
733
+ }
734
+ t.from = function(t, c) {
735
+ return f.isValid(t) ? parseInt(t, 10) : c;
736
+ }, t.getCapacity = function(t, u, p) {
737
+ if (!f.isValid(t)) throw Error("Invalid QR Code version");
738
+ p === void 0 && (p = d.BYTE);
739
+ let m = (c.getSymbolTotalCodewords(t) - l.getTotalCodewordsCount(t, u)) * 8;
740
+ if (p === d.MIXED) return m;
741
+ let h = m - g(p, t);
742
+ switch (p) {
743
+ case d.NUMERIC: return Math.floor(h / 10 * 3);
744
+ case d.ALPHANUMERIC: return Math.floor(h / 11 * 2);
745
+ case d.KANJI: return Math.floor(h / 13);
746
+ case d.BYTE:
747
+ default: return Math.floor(h / 8);
748
+ }
749
+ }, t.getBestVersionForData = function(t, c) {
750
+ let l, d = u.from(c, u.M);
751
+ if (Array.isArray(t)) {
752
+ if (t.length > 1) return v(t, d);
753
+ if (t.length === 0) return 1;
754
+ l = t[0];
755
+ } else l = t;
756
+ return h(l.mode, l.getLength(), d);
757
+ }, t.getEncodedBits = function(t) {
758
+ if (!f.isValid(t) || t < 7) throw Error("Invalid QR Code version");
759
+ let l = t << 12;
760
+ for (; c.getBCHDigit(l) - m >= 0;) l ^= p << c.getBCHDigit(l) - m;
761
+ return t << 12 | l;
762
+ };
763
+ })), require_format_info = /* @__PURE__ */ __commonJSMin(((t) => {
764
+ var c = require_utils$1(), l = 1335, u = 21522, d = c.getBCHDigit(l);
765
+ t.getEncodedBits = function(t, f) {
766
+ let p = t.bit << 3 | f, m = p << 10;
767
+ for (; c.getBCHDigit(m) - d >= 0;) m ^= l << c.getBCHDigit(m) - d;
768
+ return (p << 10 | m) ^ u;
769
+ };
770
+ })), require_numeric_data = /* @__PURE__ */ __commonJSMin(((t, c) => {
771
+ var l = require_mode();
772
+ function u(t) {
773
+ this.mode = l.NUMERIC, this.data = t.toString();
774
+ }
775
+ u.getBitsLength = function(t) {
776
+ return 10 * Math.floor(t / 3) + (t % 3 ? t % 3 * 3 + 1 : 0);
777
+ }, u.prototype.getLength = function() {
778
+ return this.data.length;
779
+ }, u.prototype.getBitsLength = function() {
780
+ return u.getBitsLength(this.data.length);
781
+ }, u.prototype.write = function(t) {
782
+ let c, l, u;
783
+ for (c = 0; c + 3 <= this.data.length; c += 3) l = this.data.substr(c, 3), u = parseInt(l, 10), t.put(u, 10);
784
+ let d = this.data.length - c;
785
+ d > 0 && (l = this.data.substr(c), u = parseInt(l, 10), t.put(u, d * 3 + 1));
786
+ }, c.exports = u;
787
+ })), require_alphanumeric_data = /* @__PURE__ */ __commonJSMin(((t, c) => {
788
+ var l = require_mode(), u = /* @__PURE__ */ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
789
+ function d(t) {
790
+ this.mode = l.ALPHANUMERIC, this.data = t;
791
+ }
792
+ d.getBitsLength = function(t) {
793
+ return 11 * Math.floor(t / 2) + 6 * (t % 2);
794
+ }, d.prototype.getLength = function() {
795
+ return this.data.length;
796
+ }, d.prototype.getBitsLength = function() {
797
+ return d.getBitsLength(this.data.length);
798
+ }, d.prototype.write = function(t) {
799
+ let c;
800
+ for (c = 0; c + 2 <= this.data.length; c += 2) {
801
+ let l = u.indexOf(this.data[c]) * 45;
802
+ l += u.indexOf(this.data[c + 1]), t.put(l, 11);
803
+ }
804
+ this.data.length % 2 && t.put(u.indexOf(this.data[c]), 6);
805
+ }, c.exports = d;
806
+ })), require_byte_data = /* @__PURE__ */ __commonJSMin(((t, c) => {
807
+ var l = require_mode();
808
+ function u(t) {
809
+ this.mode = l.BYTE, typeof t == "string" ? this.data = new TextEncoder().encode(t) : this.data = new Uint8Array(t);
810
+ }
811
+ u.getBitsLength = function(t) {
812
+ return t * 8;
813
+ }, u.prototype.getLength = function() {
814
+ return this.data.length;
815
+ }, u.prototype.getBitsLength = function() {
816
+ return u.getBitsLength(this.data.length);
817
+ }, u.prototype.write = function(t) {
818
+ for (let c = 0, l = this.data.length; c < l; c++) t.put(this.data[c], 8);
819
+ }, c.exports = u;
820
+ })), require_kanji_data = /* @__PURE__ */ __commonJSMin(((t, c) => {
821
+ var l = require_mode(), u = require_utils$1();
822
+ function d(t) {
823
+ this.mode = l.KANJI, this.data = t;
824
+ }
825
+ d.getBitsLength = function(t) {
826
+ return t * 13;
827
+ }, d.prototype.getLength = function() {
828
+ return this.data.length;
829
+ }, d.prototype.getBitsLength = function() {
830
+ return d.getBitsLength(this.data.length);
831
+ }, d.prototype.write = function(t) {
832
+ let c;
833
+ for (c = 0; c < this.data.length; c++) {
834
+ let l = u.toSJIS(this.data[c]);
835
+ if (l >= 33088 && l <= 40956) l -= 33088;
836
+ else if (l >= 57408 && l <= 60351) l -= 49472;
837
+ else throw Error("Invalid SJIS character: " + this.data[c] + "\nMake sure your charset is UTF-8");
838
+ l = (l >>> 8 & 255) * 192 + (l & 255), t.put(l, 13);
839
+ }
840
+ }, c.exports = d;
841
+ })), require_dijkstra = /* @__PURE__ */ __commonJSMin(((t, c) => {
842
+ var l = {
843
+ single_source_shortest_paths: function(t, c, u) {
844
+ var d = {}, f = {};
845
+ f[c] = 0;
846
+ var p = l.PriorityQueue.make();
847
+ p.push(c, 0);
848
+ for (var m, h, g, _, v, y, b, x, S; !p.empty();) for (g in m = p.pop(), h = m.value, _ = m.cost, v = t[h] || {}, v) v.hasOwnProperty(g) && (y = v[g], b = _ + y, x = f[g], S = f[g] === void 0, (S || x > b) && (f[g] = b, p.push(g, b), d[g] = h));
849
+ if (u !== void 0 && f[u] === void 0) {
850
+ var C = [
851
+ "Could not find a path from ",
852
+ c,
853
+ " to ",
854
+ u,
855
+ "."
856
+ ].join("");
857
+ throw Error(C);
858
+ }
859
+ return d;
860
+ },
861
+ extract_shortest_path_from_predecessor_list: function(t, c) {
862
+ for (var l = [], u = c; u;) l.push(u), t[u], u = t[u];
863
+ return l.reverse(), l;
864
+ },
865
+ find_path: function(t, c, u) {
866
+ var d = l.single_source_shortest_paths(t, c, u);
867
+ return l.extract_shortest_path_from_predecessor_list(d, u);
868
+ },
869
+ PriorityQueue: {
870
+ make: function(t) {
871
+ var c = l.PriorityQueue, u = {}, d;
872
+ for (d in t ||= {}, c) c.hasOwnProperty(d) && (u[d] = c[d]);
873
+ return u.queue = [], u.sorter = t.sorter || c.default_sorter, u;
874
+ },
875
+ default_sorter: function(t, c) {
876
+ return t.cost - c.cost;
877
+ },
878
+ push: function(t, c) {
879
+ var l = {
880
+ value: t,
881
+ cost: c
882
+ };
883
+ this.queue.push(l), this.queue.sort(this.sorter);
884
+ },
885
+ pop: function() {
886
+ return this.queue.shift();
887
+ },
888
+ empty: function() {
889
+ return this.queue.length === 0;
890
+ }
891
+ }
892
+ };
893
+ c !== void 0 && (c.exports = l);
894
+ })), require_segments = /* @__PURE__ */ __commonJSMin(((t) => {
895
+ var c = require_mode(), l = require_numeric_data(), u = require_alphanumeric_data(), d = require_byte_data(), f = require_kanji_data(), p = require_regex(), m = require_utils$1(), h = require_dijkstra();
896
+ function g(t) {
897
+ return unescape(encodeURIComponent(t)).length;
898
+ }
899
+ function _(t, c, l) {
900
+ let u = [], d;
901
+ for (; (d = t.exec(l)) !== null;) u.push({
902
+ data: d[0],
903
+ index: d.index,
904
+ mode: c,
905
+ length: d[0].length
906
+ });
907
+ return u;
908
+ }
909
+ function v(t) {
910
+ let l = _(p.NUMERIC, c.NUMERIC, t), u = _(p.ALPHANUMERIC, c.ALPHANUMERIC, t), d, f;
911
+ return m.isKanjiModeEnabled() ? (d = _(p.BYTE, c.BYTE, t), f = _(p.KANJI, c.KANJI, t)) : (d = _(p.BYTE_KANJI, c.BYTE, t), f = []), l.concat(u, d, f).sort(function(t, c) {
912
+ return t.index - c.index;
913
+ }).map(function(t) {
914
+ return {
915
+ data: t.data,
916
+ mode: t.mode,
917
+ length: t.length
918
+ };
919
+ });
920
+ }
921
+ function b(t, p) {
922
+ switch (p) {
923
+ case c.NUMERIC: return l.getBitsLength(t);
924
+ case c.ALPHANUMERIC: return u.getBitsLength(t);
925
+ case c.KANJI: return f.getBitsLength(t);
926
+ case c.BYTE: return d.getBitsLength(t);
927
+ }
928
+ }
929
+ function x(t) {
930
+ return t.reduce(function(t, c) {
931
+ let l = t.length - 1 >= 0 ? t[t.length - 1] : null;
932
+ return l && l.mode === c.mode ? (t[t.length - 1].data += c.data, t) : (t.push(c), t);
933
+ }, []);
934
+ }
935
+ function S(t) {
936
+ let l = [];
937
+ for (let u = 0; u < t.length; u++) {
938
+ let d = t[u];
939
+ switch (d.mode) {
940
+ case c.NUMERIC:
941
+ l.push([
942
+ d,
943
+ {
944
+ data: d.data,
945
+ mode: c.ALPHANUMERIC,
946
+ length: d.length
947
+ },
948
+ {
949
+ data: d.data,
950
+ mode: c.BYTE,
951
+ length: d.length
952
+ }
953
+ ]);
954
+ break;
955
+ case c.ALPHANUMERIC:
956
+ l.push([d, {
957
+ data: d.data,
958
+ mode: c.BYTE,
959
+ length: d.length
960
+ }]);
961
+ break;
962
+ case c.KANJI:
963
+ l.push([d, {
964
+ data: d.data,
965
+ mode: c.BYTE,
966
+ length: g(d.data)
967
+ }]);
968
+ break;
969
+ case c.BYTE: l.push([{
970
+ data: d.data,
971
+ mode: c.BYTE,
972
+ length: g(d.data)
973
+ }]);
974
+ }
975
+ }
976
+ return l;
977
+ }
978
+ function C(t, l) {
979
+ let u = {}, d = { start: {} }, f = ["start"];
980
+ for (let p = 0; p < t.length; p++) {
981
+ let m = t[p], h = [];
982
+ for (let t = 0; t < m.length; t++) {
983
+ let g = m[t], _ = "" + p + t;
984
+ h.push(_), u[_] = {
985
+ node: g,
986
+ lastCount: 0
987
+ }, d[_] = {};
988
+ for (let t = 0; t < f.length; t++) {
989
+ let p = f[t];
990
+ u[p] && u[p].node.mode === g.mode ? (d[p][_] = b(u[p].lastCount + g.length, g.mode) - b(u[p].lastCount, g.mode), u[p].lastCount += g.length) : (u[p] && (u[p].lastCount = g.length), d[p][_] = b(g.length, g.mode) + 4 + c.getCharCountIndicator(g.mode, l));
991
+ }
992
+ }
993
+ f = h;
994
+ }
995
+ for (let t = 0; t < f.length; t++) d[f[t]].end = 0;
996
+ return {
997
+ map: d,
998
+ table: u
999
+ };
1000
+ }
1001
+ function w(t, p) {
1002
+ let h, g = c.getBestModeForData(t);
1003
+ if (h = c.from(p, g), h !== c.BYTE && h.bit < g.bit) throw Error("\"" + t + "\" cannot be encoded with mode " + c.toString(h) + ".\n Suggested mode is: " + c.toString(g));
1004
+ switch (h === c.KANJI && !m.isKanjiModeEnabled() && (h = c.BYTE), h) {
1005
+ case c.NUMERIC: return new l(t);
1006
+ case c.ALPHANUMERIC: return new u(t);
1007
+ case c.KANJI: return new f(t);
1008
+ case c.BYTE: return new d(t);
1009
+ }
1010
+ }
1011
+ t.fromArray = function(t) {
1012
+ return t.reduce(function(t, c) {
1013
+ return typeof c == "string" ? t.push(w(c, null)) : c.data && t.push(w(c.data, c.mode)), t;
1014
+ }, []);
1015
+ }, t.fromString = function(c, l) {
1016
+ let u = C(S(v(c, m.isKanjiModeEnabled())), l), d = h.find_path(u.map, "start", "end"), f = [];
1017
+ for (let t = 1; t < d.length - 1; t++) f.push(u.table[d[t]].node);
1018
+ return t.fromArray(x(f));
1019
+ }, t.rawSplit = function(c) {
1020
+ return t.fromArray(v(c, m.isKanjiModeEnabled()));
1021
+ };
1022
+ })), require_qrcode = /* @__PURE__ */ __commonJSMin(((t) => {
1023
+ var c = require_utils$1(), l = require_error_correction_level(), u = require_bit_buffer(), d = require_bit_matrix(), f = require_alignment_pattern(), p = require_finder_pattern(), m = require_mask_pattern(), h = require_error_correction_code(), g = require_reed_solomon_encoder(), _ = require_version(), v = require_format_info(), D = require_mode(), O = require_segments();
1024
+ function A(t, c) {
1025
+ let l = t.size, u = p.getPositions(c);
1026
+ for (let c = 0; c < u.length; c++) {
1027
+ let d = u[c][0], f = u[c][1];
1028
+ for (let c = -1; c <= 7; c++) if (!(d + c <= -1 || l <= d + c)) for (let u = -1; u <= 7; u++) f + u <= -1 || l <= f + u || (c >= 0 && c <= 6 && (u === 0 || u === 6) || u >= 0 && u <= 6 && (c === 0 || c === 6) || c >= 2 && c <= 4 && u >= 2 && u <= 4 ? t.set(d + c, f + u, !0, !0) : t.set(d + c, f + u, !1, !0));
1029
+ }
1030
+ }
1031
+ function j(t) {
1032
+ let c = t.size;
1033
+ for (let l = 8; l < c - 8; l++) {
1034
+ let c = l % 2 == 0;
1035
+ t.set(l, 6, c, !0), t.set(6, l, c, !0);
1036
+ }
1037
+ }
1038
+ function M(t, c) {
1039
+ let l = f.getPositions(c);
1040
+ for (let c = 0; c < l.length; c++) {
1041
+ let u = l[c][0], d = l[c][1];
1042
+ for (let c = -2; c <= 2; c++) for (let l = -2; l <= 2; l++) c === -2 || c === 2 || l === -2 || l === 2 || c === 0 && l === 0 ? t.set(u + c, d + l, !0, !0) : t.set(u + c, d + l, !1, !0);
1043
+ }
1044
+ }
1045
+ function N(t, c) {
1046
+ let l = t.size, u = _.getEncodedBits(c), d, f, p;
1047
+ for (let c = 0; c < 18; c++) d = Math.floor(c / 3), f = c % 3 + l - 8 - 3, p = (u >> c & 1) == 1, t.set(d, f, p, !0), t.set(f, d, p, !0);
1048
+ }
1049
+ function P(t, c, l) {
1050
+ let u = t.size, d = v.getEncodedBits(c, l), f, p;
1051
+ for (f = 0; f < 15; f++) p = (d >> f & 1) == 1, f < 6 ? t.set(f, 8, p, !0) : f < 8 ? t.set(f + 1, 8, p, !0) : t.set(u - 15 + f, 8, p, !0), f < 8 ? t.set(8, u - f - 1, p, !0) : f < 9 ? t.set(8, 15 - f - 1 + 1, p, !0) : t.set(8, 15 - f - 1, p, !0);
1052
+ t.set(u - 8, 8, 1, !0);
1053
+ }
1054
+ function F(t, c) {
1055
+ let l = t.size, u = -1, d = l - 1, f = 7, p = 0;
1056
+ for (let m = l - 1; m > 0; m -= 2) for (m === 6 && m--;;) {
1057
+ for (let l = 0; l < 2; l++) if (!t.isReserved(d, m - l)) {
1058
+ let u = !1;
1059
+ p < c.length && (u = (c[p] >>> f & 1) == 1), t.set(d, m - l, u), f--, f === -1 && (p++, f = 7);
1060
+ }
1061
+ if (d += u, d < 0 || l <= d) {
1062
+ d -= u, u = -u;
1063
+ break;
1064
+ }
1065
+ }
1066
+ }
1067
+ function I(t, l, d) {
1068
+ let f = new u();
1069
+ d.forEach(function(c) {
1070
+ f.put(c.mode.bit, 4), f.put(c.getLength(), D.getCharCountIndicator(c.mode, t)), c.write(f);
1071
+ });
1072
+ let p = (c.getSymbolTotalCodewords(t) - h.getTotalCodewordsCount(t, l)) * 8;
1073
+ for (f.getLengthInBits() + 4 <= p && f.put(0, 4); f.getLengthInBits() % 8 != 0;) f.putBit(0);
1074
+ let m = (p - f.getLengthInBits()) / 8;
1075
+ for (let t = 0; t < m; t++) f.put(t % 2 ? 17 : 236, 8);
1076
+ return L(f, t, l);
1077
+ }
1078
+ function L(t, l, u) {
1079
+ let d = c.getSymbolTotalCodewords(l), f = d - h.getTotalCodewordsCount(l, u), p = h.getBlocksCount(l, u), m = p - d % p, _ = Math.floor(d / p), v = Math.floor(f / p), y = v + 1, b = _ - v, x = new g(b), S = 0, C = Array(p), w = Array(p), T = 0, E = new Uint8Array(t.buffer);
1080
+ for (let t = 0; t < p; t++) {
1081
+ let c = t < m ? v : y;
1082
+ C[t] = E.slice(S, S + c), w[t] = x.encode(C[t]), S += c, T = Math.max(T, c);
1083
+ }
1084
+ let D = new Uint8Array(d), O = 0, k, A;
1085
+ for (k = 0; k < T; k++) for (A = 0; A < p; A++) k < C[A].length && (D[O++] = C[A][k]);
1086
+ for (k = 0; k < b; k++) for (A = 0; A < p; A++) D[O++] = w[A][k];
1087
+ return D;
1088
+ }
1089
+ function R(t, l, u, f) {
1090
+ let p;
1091
+ if (Array.isArray(t)) p = O.fromArray(t);
1092
+ else if (typeof t == "string") {
1093
+ let c = l;
1094
+ if (!c) {
1095
+ let l = O.rawSplit(t);
1096
+ c = _.getBestVersionForData(l, u);
1097
+ }
1098
+ p = O.fromString(t, c || 40);
1099
+ } else throw Error("Invalid data");
1100
+ let h = _.getBestVersionForData(p, u);
1101
+ if (!h) throw Error("The amount of data is too big to be stored in a QR Code");
1102
+ if (!l) l = h;
1103
+ else if (l < h) throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + h + ".\n");
1104
+ let g = I(l, u, p), v = new d(c.getSymbolSize(l));
1105
+ return A(v, l), j(v), M(v, l), P(v, u, 0), l >= 7 && N(v, l), F(v, g), isNaN(f) && (f = m.getBestMask(v, P.bind(null, v, u))), m.applyMask(f, v), P(v, u, f), {
1106
+ modules: v,
1107
+ version: l,
1108
+ errorCorrectionLevel: u,
1109
+ maskPattern: f,
1110
+ segments: p
1111
+ };
1112
+ }
1113
+ t.create = function(t, u) {
1114
+ if (t === void 0 || t === "") throw Error("No input text");
1115
+ let d = l.M, f, p;
1116
+ return u !== void 0 && (d = l.from(u.errorCorrectionLevel, l.M), f = _.from(u.version), p = m.from(u.maskPattern), u.toSJISFunc && c.setToSJISFunction(u.toSJISFunc)), R(t, f, d, p);
1117
+ };
1118
+ })), require_utils = /* @__PURE__ */ __commonJSMin(((t) => {
1119
+ function c(t) {
1120
+ if (typeof t == "number" && (t = t.toString()), typeof t != "string") throw Error("Color should be defined as hex string");
1121
+ let c = t.slice().replace("#", "").split("");
1122
+ if (c.length < 3 || c.length === 5 || c.length > 8) throw Error("Invalid hex color: " + t);
1123
+ (c.length === 3 || c.length === 4) && (c = Array.prototype.concat.apply([], c.map(function(t) {
1124
+ return [t, t];
1125
+ }))), c.length === 6 && c.push("F", "F");
1126
+ let l = parseInt(c.join(""), 16);
1127
+ return {
1128
+ r: l >> 24 & 255,
1129
+ g: l >> 16 & 255,
1130
+ b: l >> 8 & 255,
1131
+ a: l & 255,
1132
+ hex: "#" + c.slice(0, 6).join("")
1133
+ };
1134
+ }
1135
+ t.getOptions = function(t) {
1136
+ t ||= {}, t.color ||= {};
1137
+ let l = t.margin === void 0 || t.margin === null || t.margin < 0 ? 4 : t.margin, u = t.width && t.width >= 21 ? t.width : void 0, d = t.scale || 4;
1138
+ return {
1139
+ width: u,
1140
+ scale: u ? 4 : d,
1141
+ margin: l,
1142
+ color: {
1143
+ dark: c(t.color.dark || "#000000ff"),
1144
+ light: c(t.color.light || "#ffffffff")
1145
+ },
1146
+ type: t.type,
1147
+ rendererOpts: t.rendererOpts || {}
1148
+ };
1149
+ }, t.getScale = function(t, c) {
1150
+ return c.width && c.width >= t + c.margin * 2 ? c.width / (t + c.margin * 2) : c.scale;
1151
+ }, t.getImageWidth = function(c, l) {
1152
+ let u = t.getScale(c, l);
1153
+ return Math.floor((c + l.margin * 2) * u);
1154
+ }, t.qrToImageData = function(c, l, u) {
1155
+ let d = l.modules.size, f = l.modules.data, p = t.getScale(d, u), m = Math.floor((d + u.margin * 2) * p), h = u.margin * p, g = [u.color.light, u.color.dark];
1156
+ for (let t = 0; t < m; t++) for (let l = 0; l < m; l++) {
1157
+ let _ = (t * m + l) * 4, v = u.color.light;
1158
+ if (t >= h && l >= h && t < m - h && l < m - h) {
1159
+ let c = Math.floor((t - h) / p), u = Math.floor((l - h) / p);
1160
+ v = g[f[c * d + u] ? 1 : 0];
1161
+ }
1162
+ c[_++] = v.r, c[_++] = v.g, c[_++] = v.b, c[_] = v.a;
1163
+ }
1164
+ };
1165
+ })), require_canvas = /* @__PURE__ */ __commonJSMin(((t) => {
1166
+ var c = require_utils();
1167
+ function l(t, c, l) {
1168
+ t.clearRect(0, 0, c.width, c.height), c.style ||= {}, c.height = l, c.width = l, c.style.height = l + "px", c.style.width = l + "px";
1169
+ }
1170
+ function u() {
1171
+ try {
1172
+ return document.createElement("canvas");
1173
+ } catch {
1174
+ throw Error("You need to specify a canvas element");
1175
+ }
1176
+ }
1177
+ t.render = function(t, d, f) {
1178
+ let p = f, m = d;
1179
+ p === void 0 && (!d || !d.getContext) && (p = d, d = void 0), d || (m = u()), p = c.getOptions(p);
1180
+ let h = c.getImageWidth(t.modules.size, p), g = m.getContext("2d"), _ = g.createImageData(h, h);
1181
+ return c.qrToImageData(_.data, t, p), l(g, m, h), g.putImageData(_, 0, 0), m;
1182
+ }, t.renderToDataURL = function(c, l, u) {
1183
+ let d = u;
1184
+ d === void 0 && (!l || !l.getContext) && (d = l, l = void 0), d ||= {};
1185
+ let f = t.render(c, l, d), p = d.type || "image/png", m = d.rendererOpts || {};
1186
+ return f.toDataURL(p, m.quality);
1187
+ };
1188
+ })), require_svg_tag = /* @__PURE__ */ __commonJSMin(((t) => {
1189
+ var c = require_utils();
1190
+ function l(t, c) {
1191
+ let l = t.a / 255, u = c + "=\"" + t.hex + "\"";
1192
+ return l < 1 ? u + " " + c + "-opacity=\"" + l.toFixed(2).slice(1) + "\"" : u;
1193
+ }
1194
+ function u(t, c, l) {
1195
+ let u = t + c;
1196
+ return l !== void 0 && (u += " " + l), u;
1197
+ }
1198
+ function d(t, c, l) {
1199
+ let d = "", f = 0, p = !1, m = 0;
1200
+ for (let h = 0; h < t.length; h++) {
1201
+ let g = Math.floor(h % c), _ = Math.floor(h / c);
1202
+ !g && !p && (p = !0), t[h] ? (m++, h > 0 && g > 0 && t[h - 1] || (d += p ? u("M", g + l, .5 + _ + l) : u("m", f, 0), f = 0, p = !1), g + 1 < c && t[h + 1] || (d += u("h", m), m = 0)) : f++;
1203
+ }
1204
+ return d;
1205
+ }
1206
+ t.render = function(t, u, f) {
1207
+ let p = c.getOptions(u), m = t.modules.size, h = t.modules.data, g = m + p.margin * 2, _ = p.color.light.a ? "<path " + l(p.color.light, "fill") + " d=\"M0 0h" + g + "v" + g + "H0z\"/>" : "", v = "<path " + l(p.color.dark, "stroke") + " d=\"" + d(h, m, p.margin) + "\"/>", y = "viewBox=\"0 0 " + g + " " + g + "\"", b = "<svg xmlns=\"http://www.w3.org/2000/svg\" " + (p.width ? "width=\"" + p.width + "\" height=\"" + p.width + "\" " : "") + y + " shape-rendering=\"crispEdges\">" + _ + v + "</svg>\n";
1208
+ return typeof f == "function" && f(null, b), b;
1209
+ };
1210
+ })), require_browser = /* @__PURE__ */ __commonJSMin(((t) => {
1211
+ var c = require_can_promise(), l = require_qrcode(), u = require_canvas(), d = require_svg_tag();
1212
+ function f(t, u, d, f, p) {
1213
+ let m = [].slice.call(arguments, 1), h = m.length, g = typeof m[h - 1] == "function";
1214
+ if (!g && !c()) throw Error("Callback required as last argument");
1215
+ if (g) {
1216
+ if (h < 2) throw Error("Too few arguments provided");
1217
+ h === 2 ? (p = d, d = u, u = f = void 0) : h === 3 && (u.getContext && p === void 0 ? (p = f, f = void 0) : (p = f, f = d, d = u, u = void 0));
1218
+ } else {
1219
+ if (h < 1) throw Error("Too few arguments provided");
1220
+ return h === 1 ? (d = u, u = f = void 0) : h === 2 && !u.getContext && (f = d, d = u, u = void 0), new Promise(function(c, p) {
1221
+ try {
1222
+ c(t(l.create(d, f), u, f));
1223
+ } catch (t) {
1224
+ p(t);
1225
+ }
1226
+ });
1227
+ }
1228
+ try {
1229
+ let c = l.create(d, f);
1230
+ p(null, t(c, u, f));
1231
+ } catch (t) {
1232
+ p(t);
1233
+ }
1234
+ }
1235
+ t.create = l.create, t.toCanvas = f.bind(null, u.render), t.toDataURL = f.bind(null, u.renderToDataURL), t.toString = f.bind(null, function(t, c, l) {
1236
+ return d.render(t, l);
1237
+ });
1238
+ }));
1239
+ export { __toESM as i, injectStyle as n, payment_dialog_default as r, require_browser as t };