@infuro/cms-core 1.0.67 → 1.0.69

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 (150) hide show
  1. package/dist/{OrderTrackPage-W3J6WIG2.js → OrderTrackPage-VBZUVZOU.js} +1 -1
  2. package/dist/{OrderTrackPage-Z6FCJQYY.cjs → OrderTrackPage-VFIXWJOW.cjs} +4 -4
  3. package/dist/admin.cjs +121 -12
  4. package/dist/admin.js +121 -12
  5. package/dist/api.cjs +57 -54
  6. package/dist/api.js +24 -21
  7. package/dist/auth.cjs +62 -62
  8. package/dist/auth.js +6 -6
  9. package/dist/{chunk-XJNNOSJR.js → chunk-2BNVRFUQ.js} +1 -1
  10. package/dist/chunk-2JHGIWH7.cjs +2700 -0
  11. package/dist/{chunk-3DZRIZOD.cjs → chunk-3ASNJS2H.cjs} +3 -3
  12. package/dist/{chunk-7NMT3GBR.cjs → chunk-3LQS4ATQ.cjs} +4 -4
  13. package/dist/{chunk-GWDI752Q.js → chunk-3XCTGADT.js} +1 -1
  14. package/dist/chunk-47G65M5Q.cjs +18 -0
  15. package/dist/{chunk-XFDIIVZB.cjs → chunk-4MNVIGVJ.cjs} +11 -11
  16. package/dist/{chunk-OY2YTBMP.cjs → chunk-4WZNRVEZ.cjs} +3 -3
  17. package/dist/{chunk-OVTOP42W.js → chunk-53AMBXMM.js} +1 -1
  18. package/dist/chunk-5BKT4CS5.js +28 -0
  19. package/dist/chunk-5DSY3GQI.js +16 -0
  20. package/dist/{chunk-AYERBA7I.js → chunk-5NVGWJSY.js} +1 -1
  21. package/dist/{chunk-HF3L2GIT.cjs → chunk-5YMKJ3TH.cjs} +16 -16
  22. package/dist/{chunk-WFMVD567.cjs → chunk-6MM5OMRL.cjs} +11 -11
  23. package/dist/{chunk-5MZFQRDW.cjs → chunk-747MJJCZ.cjs} +147 -147
  24. package/dist/{chunk-SYBOCAWB.js → chunk-7QJI56OL.js} +1 -1
  25. package/dist/{chunk-DBPSJYLZ.js → chunk-BK5XW5XH.js} +1 -1
  26. package/dist/chunk-BQQMTQ4C.cjs +455 -0
  27. package/dist/{chunk-6YOQ7G5O.js → chunk-CFUSYGSA.js} +1 -1
  28. package/dist/{chunk-OOTLNH63.cjs → chunk-CIZZX57T.cjs} +2 -2
  29. package/dist/{chunk-7L6KWI7S.cjs → chunk-CTTV375J.cjs} +13 -13
  30. package/dist/{chunk-ZY64VJMS.js → chunk-D4LR3S77.js} +2 -2
  31. package/dist/{chunk-GLLCLRCQ.js → chunk-DBBYLSQP.js} +179 -49
  32. package/dist/{chunk-5NOZSG6J.js → chunk-DWNQTFJ5.js} +2 -2
  33. package/dist/{chunk-2IAXTKQN.cjs → chunk-DZNWS2MM.cjs} +2 -2
  34. package/dist/chunk-E62LKM6Z.cjs +49 -0
  35. package/dist/{chunk-CRFV5WJK.js → chunk-ECNYZG6T.js} +1 -1
  36. package/dist/{chunk-TZEMLHSP.cjs → chunk-EYUBL7YH.cjs} +7 -7
  37. package/dist/{chunk-WMMZZRDJ.cjs → chunk-HGR4IA7I.cjs} +18 -18
  38. package/dist/{chunk-TJ2MIQUT.cjs → chunk-JRW3GQD4.cjs} +4 -4
  39. package/dist/{chunk-3K5AIEIZ.js → chunk-JYRFSFXH.js} +1 -1
  40. package/dist/chunk-K6RXCLD5.js +45 -0
  41. package/dist/{chunk-TU23GJPJ.js → chunk-LJ5C4RBF.js} +3 -3
  42. package/dist/{chunk-O4AFPDQ4.cjs → chunk-LXWF6T7F.cjs} +33 -33
  43. package/dist/{chunk-EIZKW2PF.js → chunk-LY7CDNC6.js} +1 -1
  44. package/dist/{chunk-PA6YDMFZ.cjs → chunk-M5QDJOUP.cjs} +12 -12
  45. package/dist/{chunk-MQBT33IV.js → chunk-MGT4DJ2D.js} +1 -1
  46. package/dist/{chunk-2ISSXYBZ.js → chunk-MJDNS324.js} +5 -5
  47. package/dist/{chunk-H3IVLIPR.cjs → chunk-OXFC3DAM.cjs} +4 -4
  48. package/dist/chunk-PQJIJ4ZX.js +445 -0
  49. package/dist/{chunk-HY3AXLOI.cjs → chunk-PRXVSSIF.cjs} +13 -13
  50. package/dist/{chunk-TDV6EJHV.js → chunk-PRZOLCFW.js} +2 -2
  51. package/dist/{chunk-BVLN75LP.cjs → chunk-QL44NCZC.cjs} +1221 -1091
  52. package/dist/{chunk-VM6OVUUM.cjs → chunk-QN6PZLAP.cjs} +40 -40
  53. package/dist/{chunk-OV5TRZET.cjs → chunk-QXAQ3V7R.cjs} +27 -27
  54. package/dist/{chunk-NV5IRHI3.js → chunk-RBKVMHBH.js} +9 -9
  55. package/dist/{chunk-UPLVMVRX.cjs → chunk-RQCXRCYM.cjs} +2 -2
  56. package/dist/{chunk-WUQAOTHA.js → chunk-SERRQ736.js} +1 -1
  57. package/dist/{chunk-SS3K7OIM.cjs → chunk-SWSTGV4F.cjs} +81 -81
  58. package/dist/{chunk-RCE5SJBA.js → chunk-T47VP2ZT.js} +3 -3
  59. package/dist/{chunk-FLUF2GZH.js → chunk-WHMIWJL7.js} +1 -1
  60. package/dist/{chunk-JC6DLWTE.js → chunk-WQZ4AH2P.js} +1 -1
  61. package/dist/{chunk-D5FBNKQM.cjs → chunk-WXH3GMCF.cjs} +8 -8
  62. package/dist/chunk-XHPRD45G.cjs +32 -0
  63. package/dist/{chunk-THL5JDWJ.cjs → chunk-Y54WDY2O.cjs} +2 -2
  64. package/dist/{chunk-YRCKEGL2.js → chunk-YDMHG6BA.js} +1 -1
  65. package/dist/chunk-YHVA5NHI.js +2698 -0
  66. package/dist/{chunk-JXF23MPG.js → chunk-ZMIMKNSQ.js} +1 -1
  67. package/dist/cli.cjs +10 -10
  68. package/dist/cli.js +1 -1
  69. package/dist/email-queue-BJDH2ID7.cjs +29 -0
  70. package/dist/email-queue-MWP4R67H.js +8 -0
  71. package/dist/email-service-6JODEMUA.js +3 -0
  72. package/dist/email-service-VA4Q4ZRB.cjs +28 -0
  73. package/dist/emit-order-notification-trigger-X36V4DOH.cjs +16 -0
  74. package/dist/emit-order-notification-trigger-XKN2TWVF.js +3 -0
  75. package/dist/erp-config-enabled-32XTHBBT.cjs +11 -0
  76. package/dist/erp-config-enabled-CASE5YVI.js +2 -0
  77. package/dist/erp-order-invoice-5O42ZKC5.cjs +28 -0
  78. package/dist/erp-order-invoice-JEQKFXG4.js +7 -0
  79. package/dist/{event-order-defaults-DU7V3YND.cjs → event-order-defaults-TR45WAQQ.cjs} +10 -10
  80. package/dist/{event-order-defaults-H4RT7NMR.js → event-order-defaults-VXYO6NHT.js} +2 -2
  81. package/dist/generate-local-invoice-pdf-2NCA2WBL.cjs +12 -0
  82. package/dist/generate-local-invoice-pdf-XUH6GYEJ.js +3 -0
  83. package/dist/hooks.cjs +24 -24
  84. package/dist/hooks.js +2 -2
  85. package/dist/index.cjs +497 -494
  86. package/dist/index.d.cts +7 -1
  87. package/dist/index.d.ts +7 -1
  88. package/dist/index.js +39 -36
  89. package/dist/interpolate-KD37IRF2.js +2 -0
  90. package/dist/interpolate-WP6OSJHN.cjs +11 -0
  91. package/dist/invoice-templates-2ESQ7K4N.cjs +19 -0
  92. package/dist/invoice-templates-3AXTXERZ.js +2 -0
  93. package/dist/middleware.cjs +4 -4
  94. package/dist/middleware.js +2 -2
  95. package/dist/{order-assignees-handlers-L3RVKUBS.js → order-assignees-handlers-F7WOZHOG.js} +1 -1
  96. package/dist/{order-assignees-handlers-KF7RMTV5.cjs → order-assignees-handlers-JEJ5IDID.cjs} +3 -3
  97. package/dist/{order-completion-otp-handlers-HFGCPC4O.js → order-completion-otp-handlers-FIW7PZ6W.js} +12 -9
  98. package/dist/{order-completion-otp-handlers-DZAXK4GQ.cjs → order-completion-otp-handlers-LNAZTMTS.cjs} +25 -22
  99. package/dist/{order-inventory-76V4XIGW.js → order-inventory-R3AU6N4V.js} +2 -2
  100. package/dist/{order-inventory-2MYRKEPC.cjs → order-inventory-UUFPWLBW.cjs} +10 -10
  101. package/dist/order-notification-dispatcher-FS54ANAV.js +13 -0
  102. package/dist/order-notification-dispatcher-GG5C4LKZ.cjs +38 -0
  103. package/dist/paid-order-erp-GRXR2OG6.js +3 -0
  104. package/dist/paid-order-erp-X5QHPI23.cjs +12 -0
  105. package/dist/pg-boss-service-CMW3KQJM.js +2 -0
  106. package/dist/pg-boss-service-GA6ZVD5G.cjs +15 -0
  107. package/dist/{razorpay-U23LGY72.cjs → razorpay-GP2DXVP2.cjs} +2 -2
  108. package/dist/{razorpay-KLO2KNCB.js → razorpay-I3G5LNYH.js} +1 -1
  109. package/dist/{rbac-debug-db-KWV7D5PQ.cjs → rbac-debug-db-2ZI3XKA4.cjs} +4 -4
  110. package/dist/{rbac-debug-db-DFZWZ6GV.js → rbac-debug-db-IRKT6G62.js} +2 -2
  111. package/dist/resolve-invoice-asset-url-64QQUVC3.js +2 -0
  112. package/dist/resolve-invoice-asset-url-J7WAMD26.cjs +11 -0
  113. package/dist/retire-soft-deleted-unique-DZALT537.cjs +15 -0
  114. package/dist/{retire-soft-deleted-unique-NXQIH4BC.js → retire-soft-deleted-unique-F25KZBZK.js} +2 -2
  115. package/dist/sms-defaults-DSO3M26Y.js +2 -0
  116. package/dist/{sms-defaults-KCOPKQBA.cjs → sms-defaults-GDFILHHR.cjs} +5 -5
  117. package/dist/{sms-notification-templates-handlers-SJLO7JGZ.js → sms-notification-templates-handlers-ZGDCVS5Z.js} +1 -1
  118. package/dist/{sms-notification-templates-handlers-YSB3L2PK.cjs → sms-notification-templates-handlers-ZKLKFRFZ.cjs} +3 -3
  119. package/dist/{stripe-VU6OEG2D.cjs → stripe-2APRZHKU.cjs} +2 -2
  120. package/dist/{stripe-4FD27QVJ.js → stripe-7CO2ETTN.js} +1 -1
  121. package/dist/theme.cjs +10 -10
  122. package/dist/theme.js +3 -3
  123. package/dist/vendor-invite-status-45ZCWKCX.js +2 -0
  124. package/dist/{vendor-invite-status-77O7ZQ3U.cjs → vendor-invite-status-AT2E4FUA.cjs} +5 -5
  125. package/package.json +2 -1
  126. package/dist/chunk-GLD263KW.cjs +0 -862
  127. package/dist/chunk-OPJEV44S.js +0 -847
  128. package/dist/chunk-SHUYVCID.js +0 -4
  129. package/dist/chunk-USNT2KNT.cjs +0 -6
  130. package/dist/email-queue-4OY45JIU.cjs +0 -26
  131. package/dist/email-queue-HGXB2FIS.js +0 -5
  132. package/dist/email-service-5O24BSFR.cjs +0 -28
  133. package/dist/email-service-ADDF52PJ.js +0 -3
  134. package/dist/emit-order-notification-trigger-EJJZ6XTS.js +0 -3
  135. package/dist/emit-order-notification-trigger-ZD5YN3JM.cjs +0 -16
  136. package/dist/erp-config-enabled-CUMQ6N2V.cjs +0 -11
  137. package/dist/erp-config-enabled-T37X7T34.js +0 -2
  138. package/dist/erp-order-invoice-H6HCJ7YS.js +0 -4
  139. package/dist/erp-order-invoice-YUSPZ7CE.cjs +0 -25
  140. package/dist/interpolate-WAKPN56R.cjs +0 -11
  141. package/dist/interpolate-WDUWDF3I.js +0 -2
  142. package/dist/order-notification-dispatcher-ECPFI7CD.js +0 -10
  143. package/dist/order-notification-dispatcher-LL7ETKLU.cjs +0 -35
  144. package/dist/paid-order-erp-3USEG6WL.js +0 -3
  145. package/dist/paid-order-erp-FSQ3GSXE.cjs +0 -12
  146. package/dist/pg-boss-service-BDGOKM2T.cjs +0 -15
  147. package/dist/pg-boss-service-WCBJD4JB.js +0 -2
  148. package/dist/retire-soft-deleted-unique-5VXBA5XX.cjs +0 -15
  149. package/dist/sms-defaults-2NL24H57.js +0 -2
  150. package/dist/vendor-invite-status-PWJ3DE76.js +0 -2
@@ -0,0 +1,2698 @@
1
+ import { normalizeInvoiceTemplateId } from './chunk-K6RXCLD5.js';
2
+ import { __commonJS, __name, __toESM } from './chunk-5BKT4CS5.js';
3
+ import { rgb, PDFDocument, StandardFonts } from 'pdf-lib';
4
+
5
+ // node_modules/qr.js/lib/mode.js
6
+ var require_mode = __commonJS({
7
+ "node_modules/qr.js/lib/mode.js"(exports, module) {
8
+ module.exports = {
9
+ MODE_NUMBER: 1 << 0,
10
+ MODE_ALPHA_NUM: 1 << 1,
11
+ MODE_8BIT_BYTE: 1 << 2,
12
+ MODE_KANJI: 1 << 3
13
+ };
14
+ }
15
+ });
16
+
17
+ // node_modules/qr.js/lib/8BitByte.js
18
+ var require_BitByte = __commonJS({
19
+ "node_modules/qr.js/lib/8BitByte.js"(exports, module) {
20
+ var mode = require_mode();
21
+ function QR8bitByte(data) {
22
+ this.mode = mode.MODE_8BIT_BYTE;
23
+ this.data = data;
24
+ }
25
+ __name(QR8bitByte, "QR8bitByte");
26
+ QR8bitByte.prototype = {
27
+ getLength: /* @__PURE__ */ __name(function(buffer) {
28
+ return this.data.length;
29
+ }, "getLength"),
30
+ write: /* @__PURE__ */ __name(function(buffer) {
31
+ for (var i = 0; i < this.data.length; i++) {
32
+ buffer.put(this.data.charCodeAt(i), 8);
33
+ }
34
+ }, "write")
35
+ };
36
+ module.exports = QR8bitByte;
37
+ }
38
+ });
39
+
40
+ // node_modules/qr.js/lib/ErrorCorrectLevel.js
41
+ var require_ErrorCorrectLevel = __commonJS({
42
+ "node_modules/qr.js/lib/ErrorCorrectLevel.js"(exports, module) {
43
+ module.exports = {
44
+ L: 1,
45
+ M: 0,
46
+ Q: 3,
47
+ H: 2
48
+ };
49
+ }
50
+ });
51
+
52
+ // node_modules/qr.js/lib/RSBlock.js
53
+ var require_RSBlock = __commonJS({
54
+ "node_modules/qr.js/lib/RSBlock.js"(exports, module) {
55
+ var ECL = require_ErrorCorrectLevel();
56
+ function QRRSBlock(totalCount, dataCount) {
57
+ this.totalCount = totalCount;
58
+ this.dataCount = dataCount;
59
+ }
60
+ __name(QRRSBlock, "QRRSBlock");
61
+ QRRSBlock.RS_BLOCK_TABLE = [
62
+ // L
63
+ // M
64
+ // Q
65
+ // H
66
+ // 1
67
+ [
68
+ 1,
69
+ 26,
70
+ 19
71
+ ],
72
+ [
73
+ 1,
74
+ 26,
75
+ 16
76
+ ],
77
+ [
78
+ 1,
79
+ 26,
80
+ 13
81
+ ],
82
+ [
83
+ 1,
84
+ 26,
85
+ 9
86
+ ],
87
+ // 2
88
+ [
89
+ 1,
90
+ 44,
91
+ 34
92
+ ],
93
+ [
94
+ 1,
95
+ 44,
96
+ 28
97
+ ],
98
+ [
99
+ 1,
100
+ 44,
101
+ 22
102
+ ],
103
+ [
104
+ 1,
105
+ 44,
106
+ 16
107
+ ],
108
+ // 3
109
+ [
110
+ 1,
111
+ 70,
112
+ 55
113
+ ],
114
+ [
115
+ 1,
116
+ 70,
117
+ 44
118
+ ],
119
+ [
120
+ 2,
121
+ 35,
122
+ 17
123
+ ],
124
+ [
125
+ 2,
126
+ 35,
127
+ 13
128
+ ],
129
+ // 4
130
+ [
131
+ 1,
132
+ 100,
133
+ 80
134
+ ],
135
+ [
136
+ 2,
137
+ 50,
138
+ 32
139
+ ],
140
+ [
141
+ 2,
142
+ 50,
143
+ 24
144
+ ],
145
+ [
146
+ 4,
147
+ 25,
148
+ 9
149
+ ],
150
+ // 5
151
+ [
152
+ 1,
153
+ 134,
154
+ 108
155
+ ],
156
+ [
157
+ 2,
158
+ 67,
159
+ 43
160
+ ],
161
+ [
162
+ 2,
163
+ 33,
164
+ 15,
165
+ 2,
166
+ 34,
167
+ 16
168
+ ],
169
+ [
170
+ 2,
171
+ 33,
172
+ 11,
173
+ 2,
174
+ 34,
175
+ 12
176
+ ],
177
+ // 6
178
+ [
179
+ 2,
180
+ 86,
181
+ 68
182
+ ],
183
+ [
184
+ 4,
185
+ 43,
186
+ 27
187
+ ],
188
+ [
189
+ 4,
190
+ 43,
191
+ 19
192
+ ],
193
+ [
194
+ 4,
195
+ 43,
196
+ 15
197
+ ],
198
+ // 7
199
+ [
200
+ 2,
201
+ 98,
202
+ 78
203
+ ],
204
+ [
205
+ 4,
206
+ 49,
207
+ 31
208
+ ],
209
+ [
210
+ 2,
211
+ 32,
212
+ 14,
213
+ 4,
214
+ 33,
215
+ 15
216
+ ],
217
+ [
218
+ 4,
219
+ 39,
220
+ 13,
221
+ 1,
222
+ 40,
223
+ 14
224
+ ],
225
+ // 8
226
+ [
227
+ 2,
228
+ 121,
229
+ 97
230
+ ],
231
+ [
232
+ 2,
233
+ 60,
234
+ 38,
235
+ 2,
236
+ 61,
237
+ 39
238
+ ],
239
+ [
240
+ 4,
241
+ 40,
242
+ 18,
243
+ 2,
244
+ 41,
245
+ 19
246
+ ],
247
+ [
248
+ 4,
249
+ 40,
250
+ 14,
251
+ 2,
252
+ 41,
253
+ 15
254
+ ],
255
+ // 9
256
+ [
257
+ 2,
258
+ 146,
259
+ 116
260
+ ],
261
+ [
262
+ 3,
263
+ 58,
264
+ 36,
265
+ 2,
266
+ 59,
267
+ 37
268
+ ],
269
+ [
270
+ 4,
271
+ 36,
272
+ 16,
273
+ 4,
274
+ 37,
275
+ 17
276
+ ],
277
+ [
278
+ 4,
279
+ 36,
280
+ 12,
281
+ 4,
282
+ 37,
283
+ 13
284
+ ],
285
+ // 10
286
+ [
287
+ 2,
288
+ 86,
289
+ 68,
290
+ 2,
291
+ 87,
292
+ 69
293
+ ],
294
+ [
295
+ 4,
296
+ 69,
297
+ 43,
298
+ 1,
299
+ 70,
300
+ 44
301
+ ],
302
+ [
303
+ 6,
304
+ 43,
305
+ 19,
306
+ 2,
307
+ 44,
308
+ 20
309
+ ],
310
+ [
311
+ 6,
312
+ 43,
313
+ 15,
314
+ 2,
315
+ 44,
316
+ 16
317
+ ],
318
+ // 11
319
+ [
320
+ 4,
321
+ 101,
322
+ 81
323
+ ],
324
+ [
325
+ 1,
326
+ 80,
327
+ 50,
328
+ 4,
329
+ 81,
330
+ 51
331
+ ],
332
+ [
333
+ 4,
334
+ 50,
335
+ 22,
336
+ 4,
337
+ 51,
338
+ 23
339
+ ],
340
+ [
341
+ 3,
342
+ 36,
343
+ 12,
344
+ 8,
345
+ 37,
346
+ 13
347
+ ],
348
+ // 12
349
+ [
350
+ 2,
351
+ 116,
352
+ 92,
353
+ 2,
354
+ 117,
355
+ 93
356
+ ],
357
+ [
358
+ 6,
359
+ 58,
360
+ 36,
361
+ 2,
362
+ 59,
363
+ 37
364
+ ],
365
+ [
366
+ 4,
367
+ 46,
368
+ 20,
369
+ 6,
370
+ 47,
371
+ 21
372
+ ],
373
+ [
374
+ 7,
375
+ 42,
376
+ 14,
377
+ 4,
378
+ 43,
379
+ 15
380
+ ],
381
+ // 13
382
+ [
383
+ 4,
384
+ 133,
385
+ 107
386
+ ],
387
+ [
388
+ 8,
389
+ 59,
390
+ 37,
391
+ 1,
392
+ 60,
393
+ 38
394
+ ],
395
+ [
396
+ 8,
397
+ 44,
398
+ 20,
399
+ 4,
400
+ 45,
401
+ 21
402
+ ],
403
+ [
404
+ 12,
405
+ 33,
406
+ 11,
407
+ 4,
408
+ 34,
409
+ 12
410
+ ],
411
+ // 14
412
+ [
413
+ 3,
414
+ 145,
415
+ 115,
416
+ 1,
417
+ 146,
418
+ 116
419
+ ],
420
+ [
421
+ 4,
422
+ 64,
423
+ 40,
424
+ 5,
425
+ 65,
426
+ 41
427
+ ],
428
+ [
429
+ 11,
430
+ 36,
431
+ 16,
432
+ 5,
433
+ 37,
434
+ 17
435
+ ],
436
+ [
437
+ 11,
438
+ 36,
439
+ 12,
440
+ 5,
441
+ 37,
442
+ 13
443
+ ],
444
+ // 15
445
+ [
446
+ 5,
447
+ 109,
448
+ 87,
449
+ 1,
450
+ 110,
451
+ 88
452
+ ],
453
+ [
454
+ 5,
455
+ 65,
456
+ 41,
457
+ 5,
458
+ 66,
459
+ 42
460
+ ],
461
+ [
462
+ 5,
463
+ 54,
464
+ 24,
465
+ 7,
466
+ 55,
467
+ 25
468
+ ],
469
+ [
470
+ 11,
471
+ 36,
472
+ 12
473
+ ],
474
+ // 16
475
+ [
476
+ 5,
477
+ 122,
478
+ 98,
479
+ 1,
480
+ 123,
481
+ 99
482
+ ],
483
+ [
484
+ 7,
485
+ 73,
486
+ 45,
487
+ 3,
488
+ 74,
489
+ 46
490
+ ],
491
+ [
492
+ 15,
493
+ 43,
494
+ 19,
495
+ 2,
496
+ 44,
497
+ 20
498
+ ],
499
+ [
500
+ 3,
501
+ 45,
502
+ 15,
503
+ 13,
504
+ 46,
505
+ 16
506
+ ],
507
+ // 17
508
+ [
509
+ 1,
510
+ 135,
511
+ 107,
512
+ 5,
513
+ 136,
514
+ 108
515
+ ],
516
+ [
517
+ 10,
518
+ 74,
519
+ 46,
520
+ 1,
521
+ 75,
522
+ 47
523
+ ],
524
+ [
525
+ 1,
526
+ 50,
527
+ 22,
528
+ 15,
529
+ 51,
530
+ 23
531
+ ],
532
+ [
533
+ 2,
534
+ 42,
535
+ 14,
536
+ 17,
537
+ 43,
538
+ 15
539
+ ],
540
+ // 18
541
+ [
542
+ 5,
543
+ 150,
544
+ 120,
545
+ 1,
546
+ 151,
547
+ 121
548
+ ],
549
+ [
550
+ 9,
551
+ 69,
552
+ 43,
553
+ 4,
554
+ 70,
555
+ 44
556
+ ],
557
+ [
558
+ 17,
559
+ 50,
560
+ 22,
561
+ 1,
562
+ 51,
563
+ 23
564
+ ],
565
+ [
566
+ 2,
567
+ 42,
568
+ 14,
569
+ 19,
570
+ 43,
571
+ 15
572
+ ],
573
+ // 19
574
+ [
575
+ 3,
576
+ 141,
577
+ 113,
578
+ 4,
579
+ 142,
580
+ 114
581
+ ],
582
+ [
583
+ 3,
584
+ 70,
585
+ 44,
586
+ 11,
587
+ 71,
588
+ 45
589
+ ],
590
+ [
591
+ 17,
592
+ 47,
593
+ 21,
594
+ 4,
595
+ 48,
596
+ 22
597
+ ],
598
+ [
599
+ 9,
600
+ 39,
601
+ 13,
602
+ 16,
603
+ 40,
604
+ 14
605
+ ],
606
+ // 20
607
+ [
608
+ 3,
609
+ 135,
610
+ 107,
611
+ 5,
612
+ 136,
613
+ 108
614
+ ],
615
+ [
616
+ 3,
617
+ 67,
618
+ 41,
619
+ 13,
620
+ 68,
621
+ 42
622
+ ],
623
+ [
624
+ 15,
625
+ 54,
626
+ 24,
627
+ 5,
628
+ 55,
629
+ 25
630
+ ],
631
+ [
632
+ 15,
633
+ 43,
634
+ 15,
635
+ 10,
636
+ 44,
637
+ 16
638
+ ],
639
+ // 21
640
+ [
641
+ 4,
642
+ 144,
643
+ 116,
644
+ 4,
645
+ 145,
646
+ 117
647
+ ],
648
+ [
649
+ 17,
650
+ 68,
651
+ 42
652
+ ],
653
+ [
654
+ 17,
655
+ 50,
656
+ 22,
657
+ 6,
658
+ 51,
659
+ 23
660
+ ],
661
+ [
662
+ 19,
663
+ 46,
664
+ 16,
665
+ 6,
666
+ 47,
667
+ 17
668
+ ],
669
+ // 22
670
+ [
671
+ 2,
672
+ 139,
673
+ 111,
674
+ 7,
675
+ 140,
676
+ 112
677
+ ],
678
+ [
679
+ 17,
680
+ 74,
681
+ 46
682
+ ],
683
+ [
684
+ 7,
685
+ 54,
686
+ 24,
687
+ 16,
688
+ 55,
689
+ 25
690
+ ],
691
+ [
692
+ 34,
693
+ 37,
694
+ 13
695
+ ],
696
+ // 23
697
+ [
698
+ 4,
699
+ 151,
700
+ 121,
701
+ 5,
702
+ 152,
703
+ 122
704
+ ],
705
+ [
706
+ 4,
707
+ 75,
708
+ 47,
709
+ 14,
710
+ 76,
711
+ 48
712
+ ],
713
+ [
714
+ 11,
715
+ 54,
716
+ 24,
717
+ 14,
718
+ 55,
719
+ 25
720
+ ],
721
+ [
722
+ 16,
723
+ 45,
724
+ 15,
725
+ 14,
726
+ 46,
727
+ 16
728
+ ],
729
+ // 24
730
+ [
731
+ 6,
732
+ 147,
733
+ 117,
734
+ 4,
735
+ 148,
736
+ 118
737
+ ],
738
+ [
739
+ 6,
740
+ 73,
741
+ 45,
742
+ 14,
743
+ 74,
744
+ 46
745
+ ],
746
+ [
747
+ 11,
748
+ 54,
749
+ 24,
750
+ 16,
751
+ 55,
752
+ 25
753
+ ],
754
+ [
755
+ 30,
756
+ 46,
757
+ 16,
758
+ 2,
759
+ 47,
760
+ 17
761
+ ],
762
+ // 25
763
+ [
764
+ 8,
765
+ 132,
766
+ 106,
767
+ 4,
768
+ 133,
769
+ 107
770
+ ],
771
+ [
772
+ 8,
773
+ 75,
774
+ 47,
775
+ 13,
776
+ 76,
777
+ 48
778
+ ],
779
+ [
780
+ 7,
781
+ 54,
782
+ 24,
783
+ 22,
784
+ 55,
785
+ 25
786
+ ],
787
+ [
788
+ 22,
789
+ 45,
790
+ 15,
791
+ 13,
792
+ 46,
793
+ 16
794
+ ],
795
+ // 26
796
+ [
797
+ 10,
798
+ 142,
799
+ 114,
800
+ 2,
801
+ 143,
802
+ 115
803
+ ],
804
+ [
805
+ 19,
806
+ 74,
807
+ 46,
808
+ 4,
809
+ 75,
810
+ 47
811
+ ],
812
+ [
813
+ 28,
814
+ 50,
815
+ 22,
816
+ 6,
817
+ 51,
818
+ 23
819
+ ],
820
+ [
821
+ 33,
822
+ 46,
823
+ 16,
824
+ 4,
825
+ 47,
826
+ 17
827
+ ],
828
+ // 27
829
+ [
830
+ 8,
831
+ 152,
832
+ 122,
833
+ 4,
834
+ 153,
835
+ 123
836
+ ],
837
+ [
838
+ 22,
839
+ 73,
840
+ 45,
841
+ 3,
842
+ 74,
843
+ 46
844
+ ],
845
+ [
846
+ 8,
847
+ 53,
848
+ 23,
849
+ 26,
850
+ 54,
851
+ 24
852
+ ],
853
+ [
854
+ 12,
855
+ 45,
856
+ 15,
857
+ 28,
858
+ 46,
859
+ 16
860
+ ],
861
+ // 28
862
+ [
863
+ 3,
864
+ 147,
865
+ 117,
866
+ 10,
867
+ 148,
868
+ 118
869
+ ],
870
+ [
871
+ 3,
872
+ 73,
873
+ 45,
874
+ 23,
875
+ 74,
876
+ 46
877
+ ],
878
+ [
879
+ 4,
880
+ 54,
881
+ 24,
882
+ 31,
883
+ 55,
884
+ 25
885
+ ],
886
+ [
887
+ 11,
888
+ 45,
889
+ 15,
890
+ 31,
891
+ 46,
892
+ 16
893
+ ],
894
+ // 29
895
+ [
896
+ 7,
897
+ 146,
898
+ 116,
899
+ 7,
900
+ 147,
901
+ 117
902
+ ],
903
+ [
904
+ 21,
905
+ 73,
906
+ 45,
907
+ 7,
908
+ 74,
909
+ 46
910
+ ],
911
+ [
912
+ 1,
913
+ 53,
914
+ 23,
915
+ 37,
916
+ 54,
917
+ 24
918
+ ],
919
+ [
920
+ 19,
921
+ 45,
922
+ 15,
923
+ 26,
924
+ 46,
925
+ 16
926
+ ],
927
+ // 30
928
+ [
929
+ 5,
930
+ 145,
931
+ 115,
932
+ 10,
933
+ 146,
934
+ 116
935
+ ],
936
+ [
937
+ 19,
938
+ 75,
939
+ 47,
940
+ 10,
941
+ 76,
942
+ 48
943
+ ],
944
+ [
945
+ 15,
946
+ 54,
947
+ 24,
948
+ 25,
949
+ 55,
950
+ 25
951
+ ],
952
+ [
953
+ 23,
954
+ 45,
955
+ 15,
956
+ 25,
957
+ 46,
958
+ 16
959
+ ],
960
+ // 31
961
+ [
962
+ 13,
963
+ 145,
964
+ 115,
965
+ 3,
966
+ 146,
967
+ 116
968
+ ],
969
+ [
970
+ 2,
971
+ 74,
972
+ 46,
973
+ 29,
974
+ 75,
975
+ 47
976
+ ],
977
+ [
978
+ 42,
979
+ 54,
980
+ 24,
981
+ 1,
982
+ 55,
983
+ 25
984
+ ],
985
+ [
986
+ 23,
987
+ 45,
988
+ 15,
989
+ 28,
990
+ 46,
991
+ 16
992
+ ],
993
+ // 32
994
+ [
995
+ 17,
996
+ 145,
997
+ 115
998
+ ],
999
+ [
1000
+ 10,
1001
+ 74,
1002
+ 46,
1003
+ 23,
1004
+ 75,
1005
+ 47
1006
+ ],
1007
+ [
1008
+ 10,
1009
+ 54,
1010
+ 24,
1011
+ 35,
1012
+ 55,
1013
+ 25
1014
+ ],
1015
+ [
1016
+ 19,
1017
+ 45,
1018
+ 15,
1019
+ 35,
1020
+ 46,
1021
+ 16
1022
+ ],
1023
+ // 33
1024
+ [
1025
+ 17,
1026
+ 145,
1027
+ 115,
1028
+ 1,
1029
+ 146,
1030
+ 116
1031
+ ],
1032
+ [
1033
+ 14,
1034
+ 74,
1035
+ 46,
1036
+ 21,
1037
+ 75,
1038
+ 47
1039
+ ],
1040
+ [
1041
+ 29,
1042
+ 54,
1043
+ 24,
1044
+ 19,
1045
+ 55,
1046
+ 25
1047
+ ],
1048
+ [
1049
+ 11,
1050
+ 45,
1051
+ 15,
1052
+ 46,
1053
+ 46,
1054
+ 16
1055
+ ],
1056
+ // 34
1057
+ [
1058
+ 13,
1059
+ 145,
1060
+ 115,
1061
+ 6,
1062
+ 146,
1063
+ 116
1064
+ ],
1065
+ [
1066
+ 14,
1067
+ 74,
1068
+ 46,
1069
+ 23,
1070
+ 75,
1071
+ 47
1072
+ ],
1073
+ [
1074
+ 44,
1075
+ 54,
1076
+ 24,
1077
+ 7,
1078
+ 55,
1079
+ 25
1080
+ ],
1081
+ [
1082
+ 59,
1083
+ 46,
1084
+ 16,
1085
+ 1,
1086
+ 47,
1087
+ 17
1088
+ ],
1089
+ // 35
1090
+ [
1091
+ 12,
1092
+ 151,
1093
+ 121,
1094
+ 7,
1095
+ 152,
1096
+ 122
1097
+ ],
1098
+ [
1099
+ 12,
1100
+ 75,
1101
+ 47,
1102
+ 26,
1103
+ 76,
1104
+ 48
1105
+ ],
1106
+ [
1107
+ 39,
1108
+ 54,
1109
+ 24,
1110
+ 14,
1111
+ 55,
1112
+ 25
1113
+ ],
1114
+ [
1115
+ 22,
1116
+ 45,
1117
+ 15,
1118
+ 41,
1119
+ 46,
1120
+ 16
1121
+ ],
1122
+ // 36
1123
+ [
1124
+ 6,
1125
+ 151,
1126
+ 121,
1127
+ 14,
1128
+ 152,
1129
+ 122
1130
+ ],
1131
+ [
1132
+ 6,
1133
+ 75,
1134
+ 47,
1135
+ 34,
1136
+ 76,
1137
+ 48
1138
+ ],
1139
+ [
1140
+ 46,
1141
+ 54,
1142
+ 24,
1143
+ 10,
1144
+ 55,
1145
+ 25
1146
+ ],
1147
+ [
1148
+ 2,
1149
+ 45,
1150
+ 15,
1151
+ 64,
1152
+ 46,
1153
+ 16
1154
+ ],
1155
+ // 37
1156
+ [
1157
+ 17,
1158
+ 152,
1159
+ 122,
1160
+ 4,
1161
+ 153,
1162
+ 123
1163
+ ],
1164
+ [
1165
+ 29,
1166
+ 74,
1167
+ 46,
1168
+ 14,
1169
+ 75,
1170
+ 47
1171
+ ],
1172
+ [
1173
+ 49,
1174
+ 54,
1175
+ 24,
1176
+ 10,
1177
+ 55,
1178
+ 25
1179
+ ],
1180
+ [
1181
+ 24,
1182
+ 45,
1183
+ 15,
1184
+ 46,
1185
+ 46,
1186
+ 16
1187
+ ],
1188
+ // 38
1189
+ [
1190
+ 4,
1191
+ 152,
1192
+ 122,
1193
+ 18,
1194
+ 153,
1195
+ 123
1196
+ ],
1197
+ [
1198
+ 13,
1199
+ 74,
1200
+ 46,
1201
+ 32,
1202
+ 75,
1203
+ 47
1204
+ ],
1205
+ [
1206
+ 48,
1207
+ 54,
1208
+ 24,
1209
+ 14,
1210
+ 55,
1211
+ 25
1212
+ ],
1213
+ [
1214
+ 42,
1215
+ 45,
1216
+ 15,
1217
+ 32,
1218
+ 46,
1219
+ 16
1220
+ ],
1221
+ // 39
1222
+ [
1223
+ 20,
1224
+ 147,
1225
+ 117,
1226
+ 4,
1227
+ 148,
1228
+ 118
1229
+ ],
1230
+ [
1231
+ 40,
1232
+ 75,
1233
+ 47,
1234
+ 7,
1235
+ 76,
1236
+ 48
1237
+ ],
1238
+ [
1239
+ 43,
1240
+ 54,
1241
+ 24,
1242
+ 22,
1243
+ 55,
1244
+ 25
1245
+ ],
1246
+ [
1247
+ 10,
1248
+ 45,
1249
+ 15,
1250
+ 67,
1251
+ 46,
1252
+ 16
1253
+ ],
1254
+ // 40
1255
+ [
1256
+ 19,
1257
+ 148,
1258
+ 118,
1259
+ 6,
1260
+ 149,
1261
+ 119
1262
+ ],
1263
+ [
1264
+ 18,
1265
+ 75,
1266
+ 47,
1267
+ 31,
1268
+ 76,
1269
+ 48
1270
+ ],
1271
+ [
1272
+ 34,
1273
+ 54,
1274
+ 24,
1275
+ 34,
1276
+ 55,
1277
+ 25
1278
+ ],
1279
+ [
1280
+ 20,
1281
+ 45,
1282
+ 15,
1283
+ 61,
1284
+ 46,
1285
+ 16
1286
+ ]
1287
+ ];
1288
+ QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {
1289
+ var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
1290
+ if (rsBlock == void 0) {
1291
+ throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
1292
+ }
1293
+ var length = rsBlock.length / 3;
1294
+ var list = new Array();
1295
+ for (var i = 0; i < length; i++) {
1296
+ var count = rsBlock[i * 3 + 0];
1297
+ var totalCount = rsBlock[i * 3 + 1];
1298
+ var dataCount = rsBlock[i * 3 + 2];
1299
+ for (var j = 0; j < count; j++) {
1300
+ list.push(new QRRSBlock(totalCount, dataCount));
1301
+ }
1302
+ }
1303
+ return list;
1304
+ };
1305
+ QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {
1306
+ switch (errorCorrectLevel) {
1307
+ case ECL.L:
1308
+ return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
1309
+ case ECL.M:
1310
+ return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
1311
+ case ECL.Q:
1312
+ return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
1313
+ case ECL.H:
1314
+ return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
1315
+ default:
1316
+ return void 0;
1317
+ }
1318
+ };
1319
+ module.exports = QRRSBlock;
1320
+ }
1321
+ });
1322
+
1323
+ // node_modules/qr.js/lib/BitBuffer.js
1324
+ var require_BitBuffer = __commonJS({
1325
+ "node_modules/qr.js/lib/BitBuffer.js"(exports, module) {
1326
+ function QRBitBuffer() {
1327
+ this.buffer = new Array();
1328
+ this.length = 0;
1329
+ }
1330
+ __name(QRBitBuffer, "QRBitBuffer");
1331
+ QRBitBuffer.prototype = {
1332
+ get: /* @__PURE__ */ __name(function(index) {
1333
+ var bufIndex = Math.floor(index / 8);
1334
+ return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
1335
+ }, "get"),
1336
+ put: /* @__PURE__ */ __name(function(num, length) {
1337
+ for (var i = 0; i < length; i++) {
1338
+ this.putBit((num >>> length - i - 1 & 1) == 1);
1339
+ }
1340
+ }, "put"),
1341
+ getLengthInBits: /* @__PURE__ */ __name(function() {
1342
+ return this.length;
1343
+ }, "getLengthInBits"),
1344
+ putBit: /* @__PURE__ */ __name(function(bit) {
1345
+ var bufIndex = Math.floor(this.length / 8);
1346
+ if (this.buffer.length <= bufIndex) {
1347
+ this.buffer.push(0);
1348
+ }
1349
+ if (bit) {
1350
+ this.buffer[bufIndex] |= 128 >>> this.length % 8;
1351
+ }
1352
+ this.length++;
1353
+ }, "putBit")
1354
+ };
1355
+ module.exports = QRBitBuffer;
1356
+ }
1357
+ });
1358
+
1359
+ // node_modules/qr.js/lib/math.js
1360
+ var require_math = __commonJS({
1361
+ "node_modules/qr.js/lib/math.js"(exports, module) {
1362
+ var QRMath = {
1363
+ glog: /* @__PURE__ */ __name(function(n) {
1364
+ if (n < 1) {
1365
+ throw new Error("glog(" + n + ")");
1366
+ }
1367
+ return QRMath.LOG_TABLE[n];
1368
+ }, "glog"),
1369
+ gexp: /* @__PURE__ */ __name(function(n) {
1370
+ while (n < 0) {
1371
+ n += 255;
1372
+ }
1373
+ while (n >= 256) {
1374
+ n -= 255;
1375
+ }
1376
+ return QRMath.EXP_TABLE[n];
1377
+ }, "gexp"),
1378
+ EXP_TABLE: new Array(256),
1379
+ LOG_TABLE: new Array(256)
1380
+ };
1381
+ for (i = 0; i < 8; i++) {
1382
+ QRMath.EXP_TABLE[i] = 1 << i;
1383
+ }
1384
+ var i;
1385
+ for (i = 8; i < 256; i++) {
1386
+ QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
1387
+ }
1388
+ var i;
1389
+ for (i = 0; i < 255; i++) {
1390
+ QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
1391
+ }
1392
+ var i;
1393
+ module.exports = QRMath;
1394
+ }
1395
+ });
1396
+
1397
+ // node_modules/qr.js/lib/Polynomial.js
1398
+ var require_Polynomial = __commonJS({
1399
+ "node_modules/qr.js/lib/Polynomial.js"(exports, module) {
1400
+ var math = require_math();
1401
+ function QRPolynomial(num, shift) {
1402
+ if (num.length == void 0) {
1403
+ throw new Error(num.length + "/" + shift);
1404
+ }
1405
+ var offset = 0;
1406
+ while (offset < num.length && num[offset] == 0) {
1407
+ offset++;
1408
+ }
1409
+ this.num = new Array(num.length - offset + shift);
1410
+ for (var i = 0; i < num.length - offset; i++) {
1411
+ this.num[i] = num[i + offset];
1412
+ }
1413
+ }
1414
+ __name(QRPolynomial, "QRPolynomial");
1415
+ QRPolynomial.prototype = {
1416
+ get: /* @__PURE__ */ __name(function(index) {
1417
+ return this.num[index];
1418
+ }, "get"),
1419
+ getLength: /* @__PURE__ */ __name(function() {
1420
+ return this.num.length;
1421
+ }, "getLength"),
1422
+ multiply: /* @__PURE__ */ __name(function(e) {
1423
+ var num = new Array(this.getLength() + e.getLength() - 1);
1424
+ for (var i = 0; i < this.getLength(); i++) {
1425
+ for (var j = 0; j < e.getLength(); j++) {
1426
+ num[i + j] ^= math.gexp(math.glog(this.get(i)) + math.glog(e.get(j)));
1427
+ }
1428
+ }
1429
+ return new QRPolynomial(num, 0);
1430
+ }, "multiply"),
1431
+ mod: /* @__PURE__ */ __name(function(e) {
1432
+ if (this.getLength() - e.getLength() < 0) {
1433
+ return this;
1434
+ }
1435
+ var ratio = math.glog(this.get(0)) - math.glog(e.get(0));
1436
+ var num = new Array(this.getLength());
1437
+ for (var i = 0; i < this.getLength(); i++) {
1438
+ num[i] = this.get(i);
1439
+ }
1440
+ for (var i = 0; i < e.getLength(); i++) {
1441
+ num[i] ^= math.gexp(math.glog(e.get(i)) + ratio);
1442
+ }
1443
+ return new QRPolynomial(num, 0).mod(e);
1444
+ }, "mod")
1445
+ };
1446
+ module.exports = QRPolynomial;
1447
+ }
1448
+ });
1449
+
1450
+ // node_modules/qr.js/lib/util.js
1451
+ var require_util = __commonJS({
1452
+ "node_modules/qr.js/lib/util.js"(exports, module) {
1453
+ var Mode = require_mode();
1454
+ var Polynomial = require_Polynomial();
1455
+ var math = require_math();
1456
+ var QRMaskPattern = {
1457
+ PATTERN000: 0,
1458
+ PATTERN001: 1,
1459
+ PATTERN010: 2,
1460
+ PATTERN011: 3,
1461
+ PATTERN100: 4,
1462
+ PATTERN101: 5,
1463
+ PATTERN110: 6,
1464
+ PATTERN111: 7
1465
+ };
1466
+ var QRUtil = {
1467
+ PATTERN_POSITION_TABLE: [
1468
+ [],
1469
+ [
1470
+ 6,
1471
+ 18
1472
+ ],
1473
+ [
1474
+ 6,
1475
+ 22
1476
+ ],
1477
+ [
1478
+ 6,
1479
+ 26
1480
+ ],
1481
+ [
1482
+ 6,
1483
+ 30
1484
+ ],
1485
+ [
1486
+ 6,
1487
+ 34
1488
+ ],
1489
+ [
1490
+ 6,
1491
+ 22,
1492
+ 38
1493
+ ],
1494
+ [
1495
+ 6,
1496
+ 24,
1497
+ 42
1498
+ ],
1499
+ [
1500
+ 6,
1501
+ 26,
1502
+ 46
1503
+ ],
1504
+ [
1505
+ 6,
1506
+ 28,
1507
+ 50
1508
+ ],
1509
+ [
1510
+ 6,
1511
+ 30,
1512
+ 54
1513
+ ],
1514
+ [
1515
+ 6,
1516
+ 32,
1517
+ 58
1518
+ ],
1519
+ [
1520
+ 6,
1521
+ 34,
1522
+ 62
1523
+ ],
1524
+ [
1525
+ 6,
1526
+ 26,
1527
+ 46,
1528
+ 66
1529
+ ],
1530
+ [
1531
+ 6,
1532
+ 26,
1533
+ 48,
1534
+ 70
1535
+ ],
1536
+ [
1537
+ 6,
1538
+ 26,
1539
+ 50,
1540
+ 74
1541
+ ],
1542
+ [
1543
+ 6,
1544
+ 30,
1545
+ 54,
1546
+ 78
1547
+ ],
1548
+ [
1549
+ 6,
1550
+ 30,
1551
+ 56,
1552
+ 82
1553
+ ],
1554
+ [
1555
+ 6,
1556
+ 30,
1557
+ 58,
1558
+ 86
1559
+ ],
1560
+ [
1561
+ 6,
1562
+ 34,
1563
+ 62,
1564
+ 90
1565
+ ],
1566
+ [
1567
+ 6,
1568
+ 28,
1569
+ 50,
1570
+ 72,
1571
+ 94
1572
+ ],
1573
+ [
1574
+ 6,
1575
+ 26,
1576
+ 50,
1577
+ 74,
1578
+ 98
1579
+ ],
1580
+ [
1581
+ 6,
1582
+ 30,
1583
+ 54,
1584
+ 78,
1585
+ 102
1586
+ ],
1587
+ [
1588
+ 6,
1589
+ 28,
1590
+ 54,
1591
+ 80,
1592
+ 106
1593
+ ],
1594
+ [
1595
+ 6,
1596
+ 32,
1597
+ 58,
1598
+ 84,
1599
+ 110
1600
+ ],
1601
+ [
1602
+ 6,
1603
+ 30,
1604
+ 58,
1605
+ 86,
1606
+ 114
1607
+ ],
1608
+ [
1609
+ 6,
1610
+ 34,
1611
+ 62,
1612
+ 90,
1613
+ 118
1614
+ ],
1615
+ [
1616
+ 6,
1617
+ 26,
1618
+ 50,
1619
+ 74,
1620
+ 98,
1621
+ 122
1622
+ ],
1623
+ [
1624
+ 6,
1625
+ 30,
1626
+ 54,
1627
+ 78,
1628
+ 102,
1629
+ 126
1630
+ ],
1631
+ [
1632
+ 6,
1633
+ 26,
1634
+ 52,
1635
+ 78,
1636
+ 104,
1637
+ 130
1638
+ ],
1639
+ [
1640
+ 6,
1641
+ 30,
1642
+ 56,
1643
+ 82,
1644
+ 108,
1645
+ 134
1646
+ ],
1647
+ [
1648
+ 6,
1649
+ 34,
1650
+ 60,
1651
+ 86,
1652
+ 112,
1653
+ 138
1654
+ ],
1655
+ [
1656
+ 6,
1657
+ 30,
1658
+ 58,
1659
+ 86,
1660
+ 114,
1661
+ 142
1662
+ ],
1663
+ [
1664
+ 6,
1665
+ 34,
1666
+ 62,
1667
+ 90,
1668
+ 118,
1669
+ 146
1670
+ ],
1671
+ [
1672
+ 6,
1673
+ 30,
1674
+ 54,
1675
+ 78,
1676
+ 102,
1677
+ 126,
1678
+ 150
1679
+ ],
1680
+ [
1681
+ 6,
1682
+ 24,
1683
+ 50,
1684
+ 76,
1685
+ 102,
1686
+ 128,
1687
+ 154
1688
+ ],
1689
+ [
1690
+ 6,
1691
+ 28,
1692
+ 54,
1693
+ 80,
1694
+ 106,
1695
+ 132,
1696
+ 158
1697
+ ],
1698
+ [
1699
+ 6,
1700
+ 32,
1701
+ 58,
1702
+ 84,
1703
+ 110,
1704
+ 136,
1705
+ 162
1706
+ ],
1707
+ [
1708
+ 6,
1709
+ 26,
1710
+ 54,
1711
+ 82,
1712
+ 110,
1713
+ 138,
1714
+ 166
1715
+ ],
1716
+ [
1717
+ 6,
1718
+ 30,
1719
+ 58,
1720
+ 86,
1721
+ 114,
1722
+ 142,
1723
+ 170
1724
+ ]
1725
+ ],
1726
+ G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
1727
+ G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
1728
+ G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
1729
+ getBCHTypeInfo: /* @__PURE__ */ __name(function(data) {
1730
+ var d = data << 10;
1731
+ while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
1732
+ d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
1733
+ }
1734
+ return (data << 10 | d) ^ QRUtil.G15_MASK;
1735
+ }, "getBCHTypeInfo"),
1736
+ getBCHTypeNumber: /* @__PURE__ */ __name(function(data) {
1737
+ var d = data << 12;
1738
+ while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
1739
+ d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
1740
+ }
1741
+ return data << 12 | d;
1742
+ }, "getBCHTypeNumber"),
1743
+ getBCHDigit: /* @__PURE__ */ __name(function(data) {
1744
+ var digit = 0;
1745
+ while (data != 0) {
1746
+ digit++;
1747
+ data >>>= 1;
1748
+ }
1749
+ return digit;
1750
+ }, "getBCHDigit"),
1751
+ getPatternPosition: /* @__PURE__ */ __name(function(typeNumber) {
1752
+ return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
1753
+ }, "getPatternPosition"),
1754
+ getMask: /* @__PURE__ */ __name(function(maskPattern, i, j) {
1755
+ switch (maskPattern) {
1756
+ case QRMaskPattern.PATTERN000:
1757
+ return (i + j) % 2 == 0;
1758
+ case QRMaskPattern.PATTERN001:
1759
+ return i % 2 == 0;
1760
+ case QRMaskPattern.PATTERN010:
1761
+ return j % 3 == 0;
1762
+ case QRMaskPattern.PATTERN011:
1763
+ return (i + j) % 3 == 0;
1764
+ case QRMaskPattern.PATTERN100:
1765
+ return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
1766
+ case QRMaskPattern.PATTERN101:
1767
+ return i * j % 2 + i * j % 3 == 0;
1768
+ case QRMaskPattern.PATTERN110:
1769
+ return (i * j % 2 + i * j % 3) % 2 == 0;
1770
+ case QRMaskPattern.PATTERN111:
1771
+ return (i * j % 3 + (i + j) % 2) % 2 == 0;
1772
+ default:
1773
+ throw new Error("bad maskPattern:" + maskPattern);
1774
+ }
1775
+ }, "getMask"),
1776
+ getErrorCorrectPolynomial: /* @__PURE__ */ __name(function(errorCorrectLength) {
1777
+ var a = new Polynomial([
1778
+ 1
1779
+ ], 0);
1780
+ for (var i = 0; i < errorCorrectLength; i++) {
1781
+ a = a.multiply(new Polynomial([
1782
+ 1,
1783
+ math.gexp(i)
1784
+ ], 0));
1785
+ }
1786
+ return a;
1787
+ }, "getErrorCorrectPolynomial"),
1788
+ getLengthInBits: /* @__PURE__ */ __name(function(mode, type) {
1789
+ if (1 <= type && type < 10) {
1790
+ switch (mode) {
1791
+ case Mode.MODE_NUMBER:
1792
+ return 10;
1793
+ case Mode.MODE_ALPHA_NUM:
1794
+ return 9;
1795
+ case Mode.MODE_8BIT_BYTE:
1796
+ return 8;
1797
+ case Mode.MODE_KANJI:
1798
+ return 8;
1799
+ default:
1800
+ throw new Error("mode:" + mode);
1801
+ }
1802
+ } else if (type < 27) {
1803
+ switch (mode) {
1804
+ case Mode.MODE_NUMBER:
1805
+ return 12;
1806
+ case Mode.MODE_ALPHA_NUM:
1807
+ return 11;
1808
+ case Mode.MODE_8BIT_BYTE:
1809
+ return 16;
1810
+ case Mode.MODE_KANJI:
1811
+ return 10;
1812
+ default:
1813
+ throw new Error("mode:" + mode);
1814
+ }
1815
+ } else if (type < 41) {
1816
+ switch (mode) {
1817
+ case Mode.MODE_NUMBER:
1818
+ return 14;
1819
+ case Mode.MODE_ALPHA_NUM:
1820
+ return 13;
1821
+ case Mode.MODE_8BIT_BYTE:
1822
+ return 16;
1823
+ case Mode.MODE_KANJI:
1824
+ return 12;
1825
+ default:
1826
+ throw new Error("mode:" + mode);
1827
+ }
1828
+ } else {
1829
+ throw new Error("type:" + type);
1830
+ }
1831
+ }, "getLengthInBits"),
1832
+ getLostPoint: /* @__PURE__ */ __name(function(qrCode) {
1833
+ var moduleCount = qrCode.getModuleCount();
1834
+ var lostPoint = 0;
1835
+ for (var row = 0; row < moduleCount; row++) {
1836
+ for (var col = 0; col < moduleCount; col++) {
1837
+ var sameCount = 0;
1838
+ var dark = qrCode.isDark(row, col);
1839
+ for (var r = -1; r <= 1; r++) {
1840
+ if (row + r < 0 || moduleCount <= row + r) {
1841
+ continue;
1842
+ }
1843
+ for (var c = -1; c <= 1; c++) {
1844
+ if (col + c < 0 || moduleCount <= col + c) {
1845
+ continue;
1846
+ }
1847
+ if (r == 0 && c == 0) {
1848
+ continue;
1849
+ }
1850
+ if (dark == qrCode.isDark(row + r, col + c)) {
1851
+ sameCount++;
1852
+ }
1853
+ }
1854
+ }
1855
+ if (sameCount > 5) {
1856
+ lostPoint += 3 + sameCount - 5;
1857
+ }
1858
+ }
1859
+ }
1860
+ for (var row = 0; row < moduleCount - 1; row++) {
1861
+ for (var col = 0; col < moduleCount - 1; col++) {
1862
+ var count = 0;
1863
+ if (qrCode.isDark(row, col)) count++;
1864
+ if (qrCode.isDark(row + 1, col)) count++;
1865
+ if (qrCode.isDark(row, col + 1)) count++;
1866
+ if (qrCode.isDark(row + 1, col + 1)) count++;
1867
+ if (count == 0 || count == 4) {
1868
+ lostPoint += 3;
1869
+ }
1870
+ }
1871
+ }
1872
+ for (var row = 0; row < moduleCount; row++) {
1873
+ for (var col = 0; col < moduleCount - 6; col++) {
1874
+ if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
1875
+ lostPoint += 40;
1876
+ }
1877
+ }
1878
+ }
1879
+ for (var col = 0; col < moduleCount; col++) {
1880
+ for (var row = 0; row < moduleCount - 6; row++) {
1881
+ if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
1882
+ lostPoint += 40;
1883
+ }
1884
+ }
1885
+ }
1886
+ var darkCount = 0;
1887
+ for (var col = 0; col < moduleCount; col++) {
1888
+ for (var row = 0; row < moduleCount; row++) {
1889
+ if (qrCode.isDark(row, col)) {
1890
+ darkCount++;
1891
+ }
1892
+ }
1893
+ }
1894
+ var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
1895
+ lostPoint += ratio * 10;
1896
+ return lostPoint;
1897
+ }, "getLostPoint")
1898
+ };
1899
+ module.exports = QRUtil;
1900
+ }
1901
+ });
1902
+
1903
+ // node_modules/qr.js/lib/QRCode.js
1904
+ var require_QRCode = __commonJS({
1905
+ "node_modules/qr.js/lib/QRCode.js"(exports, module) {
1906
+ var BitByte = require_BitByte();
1907
+ var RSBlock = require_RSBlock();
1908
+ var BitBuffer = require_BitBuffer();
1909
+ var util = require_util();
1910
+ var Polynomial = require_Polynomial();
1911
+ function QRCode(typeNumber, errorCorrectLevel) {
1912
+ this.typeNumber = typeNumber;
1913
+ this.errorCorrectLevel = errorCorrectLevel;
1914
+ this.modules = null;
1915
+ this.moduleCount = 0;
1916
+ this.dataCache = null;
1917
+ this.dataList = [];
1918
+ }
1919
+ __name(QRCode, "QRCode");
1920
+ var proto = QRCode.prototype;
1921
+ proto.addData = function(data) {
1922
+ var newData = new BitByte(data);
1923
+ this.dataList.push(newData);
1924
+ this.dataCache = null;
1925
+ };
1926
+ proto.isDark = function(row, col) {
1927
+ if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
1928
+ throw new Error(row + "," + col);
1929
+ }
1930
+ return this.modules[row][col];
1931
+ };
1932
+ proto.getModuleCount = function() {
1933
+ return this.moduleCount;
1934
+ };
1935
+ proto.make = function() {
1936
+ if (this.typeNumber < 1) {
1937
+ var typeNumber = 1;
1938
+ for (typeNumber = 1; typeNumber < 40; typeNumber++) {
1939
+ var rsBlocks = RSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
1940
+ var buffer = new BitBuffer();
1941
+ var totalDataCount = 0;
1942
+ for (var i = 0; i < rsBlocks.length; i++) {
1943
+ totalDataCount += rsBlocks[i].dataCount;
1944
+ }
1945
+ for (var i = 0; i < this.dataList.length; i++) {
1946
+ var data = this.dataList[i];
1947
+ buffer.put(data.mode, 4);
1948
+ buffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber));
1949
+ data.write(buffer);
1950
+ }
1951
+ if (buffer.getLengthInBits() <= totalDataCount * 8) break;
1952
+ }
1953
+ this.typeNumber = typeNumber;
1954
+ }
1955
+ this.makeImpl(false, this.getBestMaskPattern());
1956
+ };
1957
+ proto.makeImpl = function(test, maskPattern) {
1958
+ this.moduleCount = this.typeNumber * 4 + 17;
1959
+ this.modules = new Array(this.moduleCount);
1960
+ for (var row = 0; row < this.moduleCount; row++) {
1961
+ this.modules[row] = new Array(this.moduleCount);
1962
+ for (var col = 0; col < this.moduleCount; col++) {
1963
+ this.modules[row][col] = null;
1964
+ }
1965
+ }
1966
+ this.setupPositionProbePattern(0, 0);
1967
+ this.setupPositionProbePattern(this.moduleCount - 7, 0);
1968
+ this.setupPositionProbePattern(0, this.moduleCount - 7);
1969
+ this.setupPositionAdjustPattern();
1970
+ this.setupTimingPattern();
1971
+ this.setupTypeInfo(test, maskPattern);
1972
+ if (this.typeNumber >= 7) {
1973
+ this.setupTypeNumber(test);
1974
+ }
1975
+ if (this.dataCache == null) {
1976
+ this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
1977
+ }
1978
+ this.mapData(this.dataCache, maskPattern);
1979
+ };
1980
+ proto.setupPositionProbePattern = function(row, col) {
1981
+ for (var r = -1; r <= 7; r++) {
1982
+ if (row + r <= -1 || this.moduleCount <= row + r) continue;
1983
+ for (var c = -1; c <= 7; c++) {
1984
+ if (col + c <= -1 || this.moduleCount <= col + c) continue;
1985
+ if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
1986
+ this.modules[row + r][col + c] = true;
1987
+ } else {
1988
+ this.modules[row + r][col + c] = false;
1989
+ }
1990
+ }
1991
+ }
1992
+ };
1993
+ proto.getBestMaskPattern = function() {
1994
+ var minLostPoint = 0;
1995
+ var pattern = 0;
1996
+ for (var i = 0; i < 8; i++) {
1997
+ this.makeImpl(true, i);
1998
+ var lostPoint = util.getLostPoint(this);
1999
+ if (i == 0 || minLostPoint > lostPoint) {
2000
+ minLostPoint = lostPoint;
2001
+ pattern = i;
2002
+ }
2003
+ }
2004
+ return pattern;
2005
+ };
2006
+ proto.createMovieClip = function(target_mc, instance_name, depth) {
2007
+ var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
2008
+ var cs = 1;
2009
+ this.make();
2010
+ for (var row = 0; row < this.modules.length; row++) {
2011
+ var y = row * cs;
2012
+ for (var col = 0; col < this.modules[row].length; col++) {
2013
+ var x = col * cs;
2014
+ var dark = this.modules[row][col];
2015
+ if (dark) {
2016
+ qr_mc.beginFill(0, 100);
2017
+ qr_mc.moveTo(x, y);
2018
+ qr_mc.lineTo(x + cs, y);
2019
+ qr_mc.lineTo(x + cs, y + cs);
2020
+ qr_mc.lineTo(x, y + cs);
2021
+ qr_mc.endFill();
2022
+ }
2023
+ }
2024
+ }
2025
+ return qr_mc;
2026
+ };
2027
+ proto.setupTimingPattern = function() {
2028
+ for (var r = 8; r < this.moduleCount - 8; r++) {
2029
+ if (this.modules[r][6] != null) {
2030
+ continue;
2031
+ }
2032
+ this.modules[r][6] = r % 2 == 0;
2033
+ }
2034
+ for (var c = 8; c < this.moduleCount - 8; c++) {
2035
+ if (this.modules[6][c] != null) {
2036
+ continue;
2037
+ }
2038
+ this.modules[6][c] = c % 2 == 0;
2039
+ }
2040
+ };
2041
+ proto.setupPositionAdjustPattern = function() {
2042
+ var pos = util.getPatternPosition(this.typeNumber);
2043
+ for (var i = 0; i < pos.length; i++) {
2044
+ for (var j = 0; j < pos.length; j++) {
2045
+ var row = pos[i];
2046
+ var col = pos[j];
2047
+ if (this.modules[row][col] != null) {
2048
+ continue;
2049
+ }
2050
+ for (var r = -2; r <= 2; r++) {
2051
+ for (var c = -2; c <= 2; c++) {
2052
+ if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
2053
+ this.modules[row + r][col + c] = true;
2054
+ } else {
2055
+ this.modules[row + r][col + c] = false;
2056
+ }
2057
+ }
2058
+ }
2059
+ }
2060
+ }
2061
+ };
2062
+ proto.setupTypeNumber = function(test) {
2063
+ var bits = util.getBCHTypeNumber(this.typeNumber);
2064
+ for (var i = 0; i < 18; i++) {
2065
+ var mod = !test && (bits >> i & 1) == 1;
2066
+ this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
2067
+ }
2068
+ for (var i = 0; i < 18; i++) {
2069
+ var mod = !test && (bits >> i & 1) == 1;
2070
+ this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
2071
+ }
2072
+ };
2073
+ proto.setupTypeInfo = function(test, maskPattern) {
2074
+ var data = this.errorCorrectLevel << 3 | maskPattern;
2075
+ var bits = util.getBCHTypeInfo(data);
2076
+ for (var i = 0; i < 15; i++) {
2077
+ var mod = !test && (bits >> i & 1) == 1;
2078
+ if (i < 6) {
2079
+ this.modules[i][8] = mod;
2080
+ } else if (i < 8) {
2081
+ this.modules[i + 1][8] = mod;
2082
+ } else {
2083
+ this.modules[this.moduleCount - 15 + i][8] = mod;
2084
+ }
2085
+ }
2086
+ for (var i = 0; i < 15; i++) {
2087
+ var mod = !test && (bits >> i & 1) == 1;
2088
+ if (i < 8) {
2089
+ this.modules[8][this.moduleCount - i - 1] = mod;
2090
+ } else if (i < 9) {
2091
+ this.modules[8][15 - i - 1 + 1] = mod;
2092
+ } else {
2093
+ this.modules[8][15 - i - 1] = mod;
2094
+ }
2095
+ }
2096
+ this.modules[this.moduleCount - 8][8] = !test;
2097
+ };
2098
+ proto.mapData = function(data, maskPattern) {
2099
+ var inc = -1;
2100
+ var row = this.moduleCount - 1;
2101
+ var bitIndex = 7;
2102
+ var byteIndex = 0;
2103
+ for (var col = this.moduleCount - 1; col > 0; col -= 2) {
2104
+ if (col == 6) col--;
2105
+ while (true) {
2106
+ for (var c = 0; c < 2; c++) {
2107
+ if (this.modules[row][col - c] == null) {
2108
+ var dark = false;
2109
+ if (byteIndex < data.length) {
2110
+ dark = (data[byteIndex] >>> bitIndex & 1) == 1;
2111
+ }
2112
+ var mask = util.getMask(maskPattern, row, col - c);
2113
+ if (mask) {
2114
+ dark = !dark;
2115
+ }
2116
+ this.modules[row][col - c] = dark;
2117
+ bitIndex--;
2118
+ if (bitIndex == -1) {
2119
+ byteIndex++;
2120
+ bitIndex = 7;
2121
+ }
2122
+ }
2123
+ }
2124
+ row += inc;
2125
+ if (row < 0 || this.moduleCount <= row) {
2126
+ row -= inc;
2127
+ inc = -inc;
2128
+ break;
2129
+ }
2130
+ }
2131
+ }
2132
+ };
2133
+ QRCode.PAD0 = 236;
2134
+ QRCode.PAD1 = 17;
2135
+ QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
2136
+ var rsBlocks = RSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
2137
+ var buffer = new BitBuffer();
2138
+ for (var i = 0; i < dataList.length; i++) {
2139
+ var data = dataList[i];
2140
+ buffer.put(data.mode, 4);
2141
+ buffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber));
2142
+ data.write(buffer);
2143
+ }
2144
+ var totalDataCount = 0;
2145
+ for (var i = 0; i < rsBlocks.length; i++) {
2146
+ totalDataCount += rsBlocks[i].dataCount;
2147
+ }
2148
+ if (buffer.getLengthInBits() > totalDataCount * 8) {
2149
+ throw new Error("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
2150
+ }
2151
+ if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
2152
+ buffer.put(0, 4);
2153
+ }
2154
+ while (buffer.getLengthInBits() % 8 != 0) {
2155
+ buffer.putBit(false);
2156
+ }
2157
+ while (true) {
2158
+ if (buffer.getLengthInBits() >= totalDataCount * 8) {
2159
+ break;
2160
+ }
2161
+ buffer.put(QRCode.PAD0, 8);
2162
+ if (buffer.getLengthInBits() >= totalDataCount * 8) {
2163
+ break;
2164
+ }
2165
+ buffer.put(QRCode.PAD1, 8);
2166
+ }
2167
+ return QRCode.createBytes(buffer, rsBlocks);
2168
+ };
2169
+ QRCode.createBytes = function(buffer, rsBlocks) {
2170
+ var offset = 0;
2171
+ var maxDcCount = 0;
2172
+ var maxEcCount = 0;
2173
+ var dcdata = new Array(rsBlocks.length);
2174
+ var ecdata = new Array(rsBlocks.length);
2175
+ for (var r = 0; r < rsBlocks.length; r++) {
2176
+ var dcCount = rsBlocks[r].dataCount;
2177
+ var ecCount = rsBlocks[r].totalCount - dcCount;
2178
+ maxDcCount = Math.max(maxDcCount, dcCount);
2179
+ maxEcCount = Math.max(maxEcCount, ecCount);
2180
+ dcdata[r] = new Array(dcCount);
2181
+ for (var i = 0; i < dcdata[r].length; i++) {
2182
+ dcdata[r][i] = 255 & buffer.buffer[i + offset];
2183
+ }
2184
+ offset += dcCount;
2185
+ var rsPoly = util.getErrorCorrectPolynomial(ecCount);
2186
+ var rawPoly = new Polynomial(dcdata[r], rsPoly.getLength() - 1);
2187
+ var modPoly = rawPoly.mod(rsPoly);
2188
+ ecdata[r] = new Array(rsPoly.getLength() - 1);
2189
+ for (var i = 0; i < ecdata[r].length; i++) {
2190
+ var modIndex = i + modPoly.getLength() - ecdata[r].length;
2191
+ ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
2192
+ }
2193
+ }
2194
+ var totalCodeCount = 0;
2195
+ for (var i = 0; i < rsBlocks.length; i++) {
2196
+ totalCodeCount += rsBlocks[i].totalCount;
2197
+ }
2198
+ var data = new Array(totalCodeCount);
2199
+ var index = 0;
2200
+ for (var i = 0; i < maxDcCount; i++) {
2201
+ for (var r = 0; r < rsBlocks.length; r++) {
2202
+ if (i < dcdata[r].length) {
2203
+ data[index++] = dcdata[r][i];
2204
+ }
2205
+ }
2206
+ }
2207
+ for (var i = 0; i < maxEcCount; i++) {
2208
+ for (var r = 0; r < rsBlocks.length; r++) {
2209
+ if (i < ecdata[r].length) {
2210
+ data[index++] = ecdata[r][i];
2211
+ }
2212
+ }
2213
+ }
2214
+ return data;
2215
+ };
2216
+ module.exports = QRCode;
2217
+ }
2218
+ });
2219
+
2220
+ // node_modules/qr.js/index.js
2221
+ var require_qr = __commonJS({
2222
+ "node_modules/qr.js/index.js"(exports, module) {
2223
+ var QRCode = require_QRCode();
2224
+ var ErrorCorrectLevel = require_ErrorCorrectLevel();
2225
+ var qrcode2 = /* @__PURE__ */ __name(function(data, opt) {
2226
+ opt = opt || {};
2227
+ var qr = new QRCode(opt.typeNumber || -1, opt.errorCorrectLevel || ErrorCorrectLevel.H);
2228
+ qr.addData(data);
2229
+ qr.make();
2230
+ return qr;
2231
+ }, "qrcode");
2232
+ qrcode2.ErrorCorrectLevel = ErrorCorrectLevel;
2233
+ module.exports = qrcode2;
2234
+ }
2235
+ });
2236
+
2237
+ // src/lib/invoice/generate-local-invoice-pdf.ts
2238
+ var import_qr = __toESM(require_qr(), 1);
2239
+ var THEMES = {
2240
+ classic: {
2241
+ accent: rgb(0.15, 0.25, 0.45),
2242
+ headerBg: rgb(0.96, 0.96, 0.97),
2243
+ headerText: rgb(0.12, 0.12, 0.14),
2244
+ text: rgb(0.12, 0.12, 0.14),
2245
+ muted: rgb(0.4, 0.42, 0.45),
2246
+ line: rgb(0.82, 0.84, 0.86),
2247
+ bandText: rgb(1, 1, 1)
2248
+ },
2249
+ modern: {
2250
+ accent: rgb(0.1, 0.45, 0.55),
2251
+ headerBg: rgb(0.93, 0.97, 0.98),
2252
+ headerText: rgb(0.1, 0.12, 0.14),
2253
+ text: rgb(0.1, 0.12, 0.14),
2254
+ muted: rgb(0.38, 0.42, 0.45),
2255
+ line: rgb(0.78, 0.86, 0.88),
2256
+ bandText: rgb(1, 1, 1)
2257
+ },
2258
+ compact: {
2259
+ accent: rgb(0.2, 0.2, 0.22),
2260
+ headerBg: rgb(0.95, 0.95, 0.95),
2261
+ headerText: rgb(0.1, 0.1, 0.1),
2262
+ text: rgb(0.1, 0.1, 0.1),
2263
+ muted: rgb(0.45, 0.45, 0.45),
2264
+ line: rgb(0.85, 0.85, 0.85),
2265
+ bandText: rgb(1, 1, 1)
2266
+ },
2267
+ bold: {
2268
+ accent: rgb(0.55, 0.12, 0.12),
2269
+ headerBg: rgb(0.55, 0.12, 0.12),
2270
+ headerText: rgb(1, 1, 1),
2271
+ text: rgb(0.1, 0.1, 0.1),
2272
+ muted: rgb(0.4, 0.4, 0.4),
2273
+ line: rgb(0.8, 0.75, 0.75),
2274
+ bandText: rgb(1, 1, 1)
2275
+ },
2276
+ service_detailed: {
2277
+ accent: rgb(0.15, 0.25, 0.45),
2278
+ headerBg: rgb(0.96, 0.96, 0.97),
2279
+ headerText: rgb(0.12, 0.12, 0.14),
2280
+ text: rgb(0.12, 0.12, 0.14),
2281
+ muted: rgb(0.4, 0.42, 0.45),
2282
+ line: rgb(0.82, 0.84, 0.86),
2283
+ bandText: rgb(1, 1, 1)
2284
+ }
2285
+ };
2286
+ function money(amount, currency) {
2287
+ const n = Number.isFinite(amount) ? amount : 0;
2288
+ const code = (currency || "INR").trim().toUpperCase() || "INR";
2289
+ return `${code} ${n.toFixed(2)}`;
2290
+ }
2291
+ __name(money, "money");
2292
+ function fmtDate(d) {
2293
+ const date = d instanceof Date ? d : new Date(d);
2294
+ if (Number.isNaN(date.getTime())) return String(d);
2295
+ const y = date.getFullYear();
2296
+ const m = String(date.getMonth() + 1).padStart(2, "0");
2297
+ const day = String(date.getDate()).padStart(2, "0");
2298
+ return `${day}-${m}-${y}`;
2299
+ }
2300
+ __name(fmtDate, "fmtDate");
2301
+ function winAnsiSafe(input) {
2302
+ return String(input ?? "").replace(/\u20B9/g, "INR ").replace(/\u20AC/g, "EUR ").replace(/\u00A3/g, "GBP ").replace(/[^\x09\x0A\x0D\x20-\x7E]/g, "?");
2303
+ }
2304
+ __name(winAnsiSafe, "winAnsiSafe");
2305
+ function addrLines(a) {
2306
+ if (!a) return [];
2307
+ const out = [];
2308
+ if (a.line1?.trim()) out.push(a.line1.trim());
2309
+ if (a.line2?.trim()) out.push(a.line2.trim());
2310
+ const cityLine = [
2311
+ a.city,
2312
+ a.state,
2313
+ a.postalCode
2314
+ ].filter((x) => x && String(x).trim()).join(", ");
2315
+ if (cityLine) out.push(cityLine);
2316
+ if (a.country?.trim()) out.push(a.country.trim());
2317
+ return out.map(winAnsiSafe);
2318
+ }
2319
+ __name(addrLines, "addrLines");
2320
+ function companyHeaderDetailLines(company) {
2321
+ const lines = [];
2322
+ if (company.supportEmail?.trim()) {
2323
+ lines.push(`Email: ${company.supportEmail.trim()}`);
2324
+ }
2325
+ if (company.supportPhone?.trim()) {
2326
+ lines.push(`Phone: ${company.supportPhone.trim()}`);
2327
+ }
2328
+ if (company.address?.trim()) {
2329
+ const parts = company.address.split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
2330
+ if (parts.length === 1) {
2331
+ lines.push(`Address: ${parts[0]}`);
2332
+ } else if (parts.length > 1) {
2333
+ lines.push(`Address: ${parts[0]}`);
2334
+ lines.push(...parts.slice(1));
2335
+ }
2336
+ }
2337
+ return lines.map(winAnsiSafe);
2338
+ }
2339
+ __name(companyHeaderDetailLines, "companyHeaderDetailLines");
2340
+ function drawText(page, text, x, y, font, size, color) {
2341
+ const safe = winAnsiSafe(text).slice(0, 120);
2342
+ if (!safe) return;
2343
+ page.drawText(safe, {
2344
+ x,
2345
+ y,
2346
+ size,
2347
+ font,
2348
+ color
2349
+ });
2350
+ }
2351
+ __name(drawText, "drawText");
2352
+ function wrapText(text, font, size, maxWidth) {
2353
+ const words = winAnsiSafe(text).split(/\s+/).filter(Boolean);
2354
+ if (!words.length) return [
2355
+ ""
2356
+ ];
2357
+ const lines = [];
2358
+ let cur = "";
2359
+ for (const w of words) {
2360
+ const next = cur ? `${cur} ${w}` : w;
2361
+ if (font.widthOfTextAtSize(next, size) <= maxWidth) {
2362
+ cur = next;
2363
+ } else {
2364
+ if (cur) lines.push(cur);
2365
+ cur = w;
2366
+ }
2367
+ }
2368
+ if (cur) lines.push(cur);
2369
+ return lines.slice(0, 4);
2370
+ }
2371
+ __name(wrapText, "wrapText");
2372
+ async function tryEmbedLogo(doc, logoUrl, maxW, maxH) {
2373
+ const url = String(logoUrl ?? "").trim();
2374
+ if (!url || !/^https?:\/\//i.test(url)) return null;
2375
+ try {
2376
+ const res = await fetch(url, {
2377
+ signal: AbortSignal.timeout(8e3)
2378
+ });
2379
+ if (!res.ok) return null;
2380
+ const buf = new Uint8Array(await res.arrayBuffer());
2381
+ if (buf.byteLength < 24 || buf.byteLength > 25e5) return null;
2382
+ const ct = (res.headers.get("content-type") || "").toLowerCase();
2383
+ const isPng = ct.includes("png") || buf[0] === 137 && buf[1] === 80 && buf[2] === 78 && buf[3] === 71;
2384
+ const isJpg = ct.includes("jpeg") || ct.includes("jpg") || buf[0] === 255 && buf[1] === 216;
2385
+ let image;
2386
+ if (isPng) image = await doc.embedPng(buf);
2387
+ else if (isJpg) image = await doc.embedJpg(buf);
2388
+ else {
2389
+ try {
2390
+ image = await doc.embedPng(buf);
2391
+ } catch {
2392
+ image = await doc.embedJpg(buf);
2393
+ }
2394
+ }
2395
+ const scale = Math.min(maxW / image.width, maxH / image.height, 1);
2396
+ return {
2397
+ image,
2398
+ width: image.width * scale,
2399
+ height: image.height * scale
2400
+ };
2401
+ } catch {
2402
+ return null;
2403
+ }
2404
+ }
2405
+ __name(tryEmbedLogo, "tryEmbedLogo");
2406
+ function drawQrCode(page, text, x, y, size) {
2407
+ try {
2408
+ const fn = typeof import_qr.default === "function" ? import_qr.default : import_qr.default?.default;
2409
+ if (!fn) return;
2410
+ const qr = fn(text, {
2411
+ errorCorrectLevel: 2
2412
+ });
2413
+ const modules = qr.modules;
2414
+ if (!modules || !modules.length) return;
2415
+ const count = modules.length;
2416
+ const cellSize = size / count;
2417
+ page.drawRectangle({
2418
+ x: x - 3,
2419
+ y: y - 3,
2420
+ width: size + 6,
2421
+ height: size + 6,
2422
+ color: rgb(1, 1, 1)
2423
+ });
2424
+ for (let r = 0; r < count; r++) {
2425
+ for (let c = 0; c < count; c++) {
2426
+ if (modules[r][c]) {
2427
+ page.drawRectangle({
2428
+ x: x + c * cellSize,
2429
+ y: y + (count - 1 - r) * cellSize,
2430
+ width: cellSize + 0.05,
2431
+ height: cellSize + 0.05,
2432
+ color: rgb(0.1, 0.1, 0.1)
2433
+ });
2434
+ }
2435
+ }
2436
+ }
2437
+ } catch (err) {
2438
+ console.error("[invoice-pdf] Failed to draw QR code:", err);
2439
+ }
2440
+ }
2441
+ __name(drawQrCode, "drawQrCode");
2442
+ async function generateLocalInvoicePdf(input) {
2443
+ const templateId = normalizeInvoiceTemplateId(input.templateId);
2444
+ const theme = THEMES[templateId];
2445
+ const doc = await PDFDocument.create();
2446
+ const font = await doc.embedFont(StandardFonts.Helvetica);
2447
+ const fontBold = await doc.embedFont(StandardFonts.HelveticaBold);
2448
+ const pageWidth = 595.28;
2449
+ const pageHeight = 841.89;
2450
+ const margin = templateId === "compact" ? 36 : 48;
2451
+ let page = doc.addPage([
2452
+ pageWidth,
2453
+ pageHeight
2454
+ ]);
2455
+ let y = pageHeight - margin;
2456
+ const companyName = input.company.name || "Store";
2457
+ const logo = await tryEmbedLogo(doc, input.company.logoUrl, 120, 40);
2458
+ const ensureSpace = /* @__PURE__ */ __name((need) => {
2459
+ if (y - need < margin + 40) {
2460
+ page = doc.addPage([
2461
+ pageWidth,
2462
+ pageHeight
2463
+ ]);
2464
+ y = pageHeight - margin;
2465
+ }
2466
+ }, "ensureSpace");
2467
+ const companyDetails = companyHeaderDetailLines(input.company);
2468
+ const detailLineH = 11;
2469
+ const detailsBlockH = companyDetails.length * detailLineH;
2470
+ if (templateId === "bold" || templateId === "modern") {
2471
+ const contentH = 22 + 16 + detailsBlockH;
2472
+ const bandH = Math.max(templateId === "bold" ? 72 : 56, logo ? logo.height + 24 : 56, contentH + 20);
2473
+ page.drawRectangle({
2474
+ x: 0,
2475
+ y: pageHeight - bandH,
2476
+ width: pageWidth,
2477
+ height: bandH,
2478
+ color: theme.accent
2479
+ });
2480
+ if (logo) {
2481
+ page.drawImage(logo.image, {
2482
+ x: pageWidth - margin - logo.width,
2483
+ y: pageHeight - bandH + (bandH - logo.height) / 2,
2484
+ width: logo.width,
2485
+ height: logo.height
2486
+ });
2487
+ }
2488
+ let hy = pageHeight - 26;
2489
+ drawText(page, "TAX INVOICE", margin, hy, fontBold, 18, theme.bandText);
2490
+ hy -= 18;
2491
+ drawText(page, companyName, margin, hy, font, 11, theme.bandText);
2492
+ hy -= 14;
2493
+ for (const line of companyDetails) {
2494
+ drawText(page, line, margin, hy, font, 8, theme.bandText);
2495
+ hy -= detailLineH;
2496
+ }
2497
+ y = pageHeight - bandH - 24;
2498
+ } else {
2499
+ const contentH = 18 + 14 + detailsBlockH;
2500
+ const headerH = Math.max(44, logo ? logo.height + 16 : 44, contentH + 20);
2501
+ page.drawRectangle({
2502
+ x: margin,
2503
+ y: y - headerH + 16,
2504
+ width: pageWidth - margin * 2,
2505
+ height: headerH,
2506
+ color: theme.headerBg
2507
+ });
2508
+ if (logo) {
2509
+ page.drawImage(logo.image, {
2510
+ x: pageWidth - margin - 12 - logo.width,
2511
+ y: y - headerH + 16 + (headerH - logo.height) / 2,
2512
+ width: logo.width,
2513
+ height: logo.height
2514
+ });
2515
+ }
2516
+ let hy = y + 2;
2517
+ drawText(page, "TAX INVOICE", margin + 12, hy, fontBold, 16, theme.accent);
2518
+ hy -= 16;
2519
+ drawText(page, companyName, margin + 12, hy, font, 10, theme.muted);
2520
+ hy -= 13;
2521
+ for (const line of companyDetails) {
2522
+ drawText(page, line, margin + 12, hy, font, 8, theme.muted);
2523
+ hy -= detailLineH;
2524
+ }
2525
+ y -= headerH + 16;
2526
+ }
2527
+ drawText(page, `Invoice #: ${input.orderNumber}`, margin, y, fontBold, 11, theme.text);
2528
+ drawText(page, `Date: ${fmtDate(input.orderDate)}`, pageWidth / 2, y, font, 10, theme.muted);
2529
+ y -= 22;
2530
+ ensureSpace(100);
2531
+ const colW = (pageWidth - margin * 2 - 16) / 2;
2532
+ drawText(page, "Bill to", margin, y, fontBold, 10, theme.accent);
2533
+ drawText(page, "Ship to", margin + colW + 16, y, fontBold, 10, theme.accent);
2534
+ y -= 14;
2535
+ const bill = [
2536
+ input.customerName,
2537
+ input.customerEmail || "",
2538
+ input.customerPhone || "",
2539
+ ...addrLines(input.billingAddress)
2540
+ ].filter(Boolean);
2541
+ const ship = addrLines(input.shippingAddress).length ? [
2542
+ input.customerName,
2543
+ ...addrLines(input.shippingAddress)
2544
+ ] : bill;
2545
+ const rows = Math.max(bill.length, ship.length, 1);
2546
+ for (let i = 0; i < rows; i++) {
2547
+ ensureSpace(14);
2548
+ if (bill[i]) drawText(page, bill[i], margin, y, font, 9, theme.text);
2549
+ if (ship[i]) drawText(page, ship[i], margin + colW + 16, y, font, 9, theme.text);
2550
+ y -= 12;
2551
+ }
2552
+ y -= 12;
2553
+ const isServiceTemplate = templateId === "service_detailed";
2554
+ if (isServiceTemplate) {
2555
+ y -= 6;
2556
+ ensureSpace(50);
2557
+ const sCol1 = margin;
2558
+ const sCol2 = margin + colW + 16;
2559
+ drawText(page, "Order Date:", sCol1, y, fontBold, 9.5, theme.accent);
2560
+ drawText(page, fmtDate(input.orderDate), sCol1 + 75, y, font, 9.5, theme.text);
2561
+ drawText(page, "Service Date:", sCol2, y, fontBold, 9.5, theme.accent);
2562
+ drawText(page, input.serviceDate ? fmtDate(input.serviceDate) : "Not scheduled", sCol2 + 85, y, font, 9.5, theme.text);
2563
+ y -= 16;
2564
+ drawText(page, "Slot:", sCol1, y, fontBold, 9.5, theme.accent);
2565
+ drawText(page, input.timeSlot ? String(input.timeSlot) : "Standard", sCol1 + 75, y, font, 9.5, theme.text);
2566
+ drawText(page, "Assigned to:", sCol2, y, fontBold, 9.5, theme.accent);
2567
+ drawText(page, input.assignedTo ? String(input.assignedTo) : "Pending Assignment", sCol2 + 85, y, font, 9.5, theme.text);
2568
+ y -= 24;
2569
+ }
2570
+ const right = pageWidth - margin;
2571
+ const contentRight = right - 4;
2572
+ const colTotalW = 100;
2573
+ const colTaxW = 100;
2574
+ const colPriceW = 100;
2575
+ const colQtyW = 40;
2576
+ const totalRight = contentRight;
2577
+ const taxRight = totalRight - colTotalW;
2578
+ const priceRight = taxRight - colTaxW;
2579
+ const qtyRight = priceRight - colPriceW;
2580
+ const itemMaxW = Math.max(80, qtyRight - colQtyW - margin - 8);
2581
+ const drawRight = /* @__PURE__ */ __name((text, rightEdge, atY, f, size, color) => {
2582
+ const safe = winAnsiSafe(text).slice(0, 40);
2583
+ if (!safe) return;
2584
+ const w = f.widthOfTextAtSize(safe, size);
2585
+ page.drawText(safe, {
2586
+ x: rightEdge - w,
2587
+ y: atY,
2588
+ size,
2589
+ font: f,
2590
+ color
2591
+ });
2592
+ }, "drawRight");
2593
+ ensureSpace(30);
2594
+ const headerBarH = 20;
2595
+ const headerBarBottom = y - 5;
2596
+ page.drawRectangle({
2597
+ x: margin,
2598
+ y: headerBarBottom,
2599
+ width: pageWidth - margin * 2,
2600
+ height: headerBarH,
2601
+ color: theme.headerBg
2602
+ });
2603
+ const headerTextY = headerBarBottom + 6;
2604
+ drawText(page, "Item", margin + 4, headerTextY, fontBold, 9, theme.headerText);
2605
+ drawRight("Qty", qtyRight, headerTextY, fontBold, 9, theme.headerText);
2606
+ drawRight("Price", priceRight, headerTextY, fontBold, 9, theme.headerText);
2607
+ drawRight("Tax", taxRight, headerTextY, fontBold, 9, theme.headerText);
2608
+ drawRight("Total", totalRight, headerTextY, fontBold, 9, theme.headerText);
2609
+ y = headerBarBottom - 10;
2610
+ for (const line of input.lineItems) {
2611
+ const nameLines = wrapText(line.name || "Item", font, 9, itemMaxW);
2612
+ const skuText = line.sku ? winAnsiSafe(`SKU: ${line.sku}`).slice(0, 80) : "";
2613
+ const nameH = Math.max(11, nameLines.length * 11);
2614
+ const skuH = skuText ? 10 : 0;
2615
+ const blockH = nameH + skuH + 6;
2616
+ ensureSpace(blockH + 10);
2617
+ let ty = y;
2618
+ for (const nl of nameLines) {
2619
+ drawText(page, nl, margin + 4, ty, font, 9, theme.text);
2620
+ ty -= 11;
2621
+ }
2622
+ if (skuText) {
2623
+ drawText(page, skuText, margin + 4, ty, font, 7, theme.muted);
2624
+ ty -= 10;
2625
+ }
2626
+ drawRight(String(line.quantity), qtyRight, y, font, 9, theme.text);
2627
+ drawRight(money(line.unitPrice, input.currency), priceRight, y, font, 9, theme.text);
2628
+ drawRight(money(line.tax ?? 0, input.currency), taxRight, y, font, 9, theme.text);
2629
+ drawRight(money(line.total, input.currency), totalRight, y, font, 9, theme.text);
2630
+ const contentBottom = Math.min(ty, y - 12);
2631
+ y = contentBottom - 2;
2632
+ page.drawLine({
2633
+ start: {
2634
+ x: margin,
2635
+ y
2636
+ },
2637
+ end: {
2638
+ x: pageWidth - margin,
2639
+ y
2640
+ },
2641
+ thickness: 0.5,
2642
+ color: theme.line
2643
+ });
2644
+ y -= 8;
2645
+ }
2646
+ y -= 16;
2647
+ ensureSpace(95);
2648
+ const summaryTopY = y;
2649
+ const summaryLabelX = totalRight - colTotalW - colTaxW - 8;
2650
+ const rowsSummary = [
2651
+ [
2652
+ "Subtotal",
2653
+ money(input.subtotal, input.currency),
2654
+ false
2655
+ ],
2656
+ [
2657
+ "Discount",
2658
+ money(input.discount, input.currency),
2659
+ false
2660
+ ],
2661
+ [
2662
+ "Tax",
2663
+ money(input.tax, input.currency),
2664
+ false
2665
+ ],
2666
+ [
2667
+ "Total",
2668
+ money(input.total, input.currency),
2669
+ true
2670
+ ]
2671
+ ];
2672
+ let sy = summaryTopY;
2673
+ for (const [label, value, strong] of rowsSummary) {
2674
+ const f = strong ? fontBold : font;
2675
+ const size = strong ? 11 : 9;
2676
+ drawText(page, label, summaryLabelX, sy, f, size, strong ? theme.accent : theme.muted);
2677
+ drawRight(value, totalRight, sy, f, size, theme.text);
2678
+ sy -= strong ? 18 : 14;
2679
+ }
2680
+ let qrBottomY = summaryTopY;
2681
+ const shouldDrawQr = input.includeQrCode === true && Boolean(input.qrData || input.qrToken);
2682
+ if (shouldDrawQr) {
2683
+ const qrSize = 64;
2684
+ const qrX = margin + 4;
2685
+ const qrY = summaryTopY - qrSize + 8;
2686
+ const qrContent = input.qrData || String(input.orderNumber);
2687
+ drawQrCode(page, qrContent, qrX, qrY, qrSize);
2688
+ qrBottomY = qrY - 10;
2689
+ }
2690
+ y = Math.min(sy, qrBottomY) - 16;
2691
+ ensureSpace(30);
2692
+ drawText(page, "Thank you for your purchase.", margin, y, font, 9, theme.muted);
2693
+ y -= 12;
2694
+ return doc.save();
2695
+ }
2696
+ __name(generateLocalInvoicePdf, "generateLocalInvoicePdf");
2697
+
2698
+ export { generateLocalInvoicePdf };