@liquidmetal-ai/raindrop 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +327 -89
  2. package/bundle/build-CBEGQPJT.js +62 -0
  3. package/bundle/{chunk-IEF2XC25.js → chunk-2PH3PHH3.js} +5 -3
  4. package/bundle/{chunk-4HZ22KOV.js → chunk-3CMR7ES5.js} +4 -4
  5. package/bundle/{chunk-JSBM2JYW.js → chunk-3EYKCHIK.js} +1 -1
  6. package/bundle/chunk-5XHDP4VK.js +1697 -0
  7. package/bundle/{chunk-TSQK4HH6.js → chunk-674GMSXY.js} +1 -1
  8. package/bundle/{chunk-PS3WZBDF.js → chunk-6L4V66WZ.js} +1105 -2728
  9. package/bundle/{chunk-5245CEUM.js → chunk-AGG7JZVH.js} +2 -2
  10. package/bundle/{chunk-3GFKUF5D.js → chunk-B3IY2XS6.js} +4 -2
  11. package/bundle/{chunk-WIDI65NO.js → chunk-CBAXTRCS.js} +1 -1
  12. package/bundle/{chunk-JLVDTXO2.js → chunk-DPV5HIG7.js} +4 -4
  13. package/bundle/{chunk-36GNZK4A.js → chunk-EVXLXWP7.js} +1 -1
  14. package/bundle/{chunk-4YVU5KEQ.js → chunk-HN3AAKRY.js} +4 -2
  15. package/bundle/{chunk-NVNEQXHN.js → chunk-IGLE4Y3B.js} +7 -5
  16. package/bundle/{chunk-FGSYWVBA.js → chunk-IQ6HFRA6.js} +1 -1
  17. package/bundle/{chunk-O3QZDJ75.js → chunk-JQONDSHY.js} +2 -2
  18. package/bundle/{chunk-W4IPOFZC.js → chunk-KADMFJLN.js} +8 -6
  19. package/bundle/chunk-KG5BLUGU.js +246 -0
  20. package/bundle/{chunk-V5LHJTYS.js → chunk-KLOYSTZY.js} +13 -2
  21. package/bundle/{chunk-ETC5VU7H.js → chunk-KXHVSLAI.js} +1 -1
  22. package/bundle/{chunk-Y4WFGNPM.js → chunk-L6FRQULN.js} +1 -1
  23. package/bundle/{chunk-3QCVYSRU.js → chunk-LT3BFQ4O.js} +1 -1
  24. package/bundle/{chunk-KQZJHBNG.js → chunk-MBLKVNI5.js} +1 -1
  25. package/bundle/{chunk-6AIUQUUM.js → chunk-MFMVJZW6.js} +71 -15
  26. package/bundle/{chunk-25T7MEKO.js → chunk-MJBLNWG3.js} +1 -1
  27. package/bundle/{chunk-MSJ33O5Y.js → chunk-NRCQIE3Z.js} +95 -115
  28. package/bundle/{chunk-XKKPPSPC.js → chunk-OCYTN4IH.js} +2 -2
  29. package/bundle/{chunk-2GAMWFJE.js → chunk-QEF5D4VE.js} +1 -1
  30. package/bundle/{chunk-4B3QYXBA.js → chunk-T7MQCLXF.js} +5 -3
  31. package/bundle/{chunk-LDFYPOXJ.js → chunk-TFQY5TSY.js} +1 -1
  32. package/bundle/{chunk-BWK4MC7Y.js → chunk-USZXZZAR.js} +8 -6
  33. package/bundle/{chunk-ER2RCPCY.js → chunk-V54KHS5B.js} +2 -2
  34. package/bundle/{chunk-YSKASURB.js → chunk-V6J23FL2.js} +1 -1
  35. package/bundle/{chunk-UHSTDJ7X.js → chunk-VN2QYX4C.js} +1 -1
  36. package/bundle/{chunk-Z4OWKG7J.js → chunk-VOT5MMEY.js} +1 -1
  37. package/bundle/{chunk-W6GU26WO.js → chunk-WG6BDFPZ.js} +1 -1
  38. package/bundle/{chunk-AK77X5GL.js → chunk-XX74I5RK.js} +4 -2
  39. package/bundle/{chunk-6BT265R3.js → chunk-YQCRWPNI.js} +1 -1
  40. package/bundle/commands/annotation/get.js +3 -3
  41. package/bundle/commands/annotation/list.js +3 -3
  42. package/bundle/commands/annotation/put.js +3 -3
  43. package/bundle/commands/auth/apikey.js +2 -2
  44. package/bundle/commands/auth/list.js +2 -2
  45. package/bundle/commands/auth/login.js +2 -2
  46. package/bundle/commands/auth/logout.js +2 -2
  47. package/bundle/commands/auth/select.js +3 -3
  48. package/bundle/commands/bucket/create-credential.js +2 -2
  49. package/bundle/commands/bucket/delete-credential.js +2 -2
  50. package/bundle/commands/bucket/get-credential.js +2 -2
  51. package/bundle/commands/bucket/list-credentials.js +2 -2
  52. package/bundle/commands/build/actor/setup.js +124 -0
  53. package/bundle/commands/build/branch.js +10 -10
  54. package/bundle/commands/build/bucket-events/setup.js +146 -0
  55. package/bundle/commands/build/checkout.js +8 -8
  56. package/bundle/commands/build/clone.js +6 -6
  57. package/bundle/commands/build/delete.js +8 -8
  58. package/bundle/commands/build/deploy.js +10 -10
  59. package/bundle/commands/build/env/get.js +3 -3
  60. package/bundle/commands/build/env/list.js +2 -2
  61. package/bundle/commands/build/env/set.js +3 -3
  62. package/bundle/commands/build/env.js +2 -2
  63. package/bundle/commands/build/features.js +192 -0
  64. package/bundle/commands/build/find.js +4 -4
  65. package/bundle/commands/build/generate.js +52 -3
  66. package/bundle/commands/build/init-workspace.js +3 -3
  67. package/bundle/commands/build/init.js +15 -3
  68. package/bundle/commands/build/list.js +5 -5
  69. package/bundle/commands/build/queue/setup.js +133 -0
  70. package/bundle/commands/build/sandbox.js +6 -6
  71. package/bundle/commands/build/smartbucket/setup.js +165 -0
  72. package/bundle/commands/build/smartmemory/setup.js +171 -0
  73. package/bundle/commands/build/smartsql/setup.js +167 -0
  74. package/bundle/commands/build/start.js +2 -2
  75. package/bundle/commands/build/status.js +5 -5
  76. package/bundle/commands/build/stop.js +2 -2
  77. package/bundle/commands/build/stripe/dashboard.js +3 -3
  78. package/bundle/commands/build/stripe/onboard.js +3 -3
  79. package/bundle/commands/build/stripe/setup.js +3 -3
  80. package/bundle/commands/build/stripe/start.js +14 -14
  81. package/bundle/commands/build/stripe/status.js +3 -3
  82. package/bundle/commands/build/stripe/subscription/create.js +4 -4
  83. package/bundle/commands/build/stripe/subscription/get.js +4 -4
  84. package/bundle/commands/build/stripe/subscription/update.js +4 -4
  85. package/bundle/commands/build/tools/check.js +2 -2
  86. package/bundle/commands/build/tools/fmt.js +2 -2
  87. package/bundle/commands/build/unsandbox.js +6 -6
  88. package/bundle/commands/build/upload.js +5 -5
  89. package/bundle/commands/build/validate.js +85 -14
  90. package/bundle/commands/build/workos/delete.js +6 -6
  91. package/bundle/commands/build/workos/env/attach.js +3 -3
  92. package/bundle/commands/build/workos/env/attached.js +3 -3
  93. package/bundle/commands/build/workos/env/create.js +3 -3
  94. package/bundle/commands/build/workos/env/delete.js +3 -3
  95. package/bundle/commands/build/workos/env/detach.js +3 -3
  96. package/bundle/commands/build/workos/env/dev-login.js +3 -3
  97. package/bundle/commands/build/workos/env/get.js +3 -3
  98. package/bundle/commands/build/workos/env/list.js +3 -3
  99. package/bundle/commands/build/workos/env/set.js +3 -3
  100. package/bundle/commands/build/workos/invite.js +3 -3
  101. package/bundle/commands/build/workos/jwt.js +172 -0
  102. package/bundle/commands/build/workos/setup.js +3 -3
  103. package/bundle/commands/build/workos/status.js +3 -3
  104. package/bundle/commands/dns/create.js +2 -2
  105. package/bundle/commands/dns/delete.js +6 -6
  106. package/bundle/commands/dns/get.js +6 -6
  107. package/bundle/commands/dns/list.js +3 -3
  108. package/bundle/commands/dns/records/create.js +2 -2
  109. package/bundle/commands/dns/records/delete.js +3 -3
  110. package/bundle/commands/dns/records/get.js +2 -2
  111. package/bundle/commands/dns/records/list.js +2 -2
  112. package/bundle/commands/dns/records/update.js +2 -2
  113. package/bundle/commands/doctor.js +309 -0
  114. package/bundle/commands/logs/query.js +3 -3
  115. package/bundle/commands/logs/tail.js +3 -3
  116. package/bundle/commands/mcp/install-claude.js +2 -2
  117. package/bundle/commands/mcp/install-gemini.js +2 -2
  118. package/bundle/commands/mcp/install-goose.js +2 -2
  119. package/bundle/commands/mcp/status.js +2 -2
  120. package/bundle/commands/object/delete.js +5 -37
  121. package/bundle/commands/object/get.js +5 -37
  122. package/bundle/commands/object/list.js +7 -39
  123. package/bundle/commands/object/put.js +5 -37
  124. package/bundle/commands/query/chunk-search.js +14 -46
  125. package/bundle/commands/query/document.js +17 -55
  126. package/bundle/commands/query/events.js +2 -2
  127. package/bundle/commands/query/reindex.js +2 -2
  128. package/bundle/commands/query/search.js +14 -46
  129. package/bundle/commands/tail.js +2 -2
  130. package/bundle/index.js +1 -1
  131. package/dist/commands/build/actor/setup.d.ts +22 -0
  132. package/dist/commands/build/actor/setup.d.ts.map +1 -0
  133. package/dist/commands/build/actor/setup.js +116 -0
  134. package/dist/commands/build/bucket-events/setup.d.ts +22 -0
  135. package/dist/commands/build/bucket-events/setup.d.ts.map +1 -0
  136. package/dist/commands/build/bucket-events/setup.js +134 -0
  137. package/dist/commands/build/features.d.ts +19 -0
  138. package/dist/commands/build/features.d.ts.map +1 -0
  139. package/dist/commands/build/features.js +97 -0
  140. package/dist/commands/build/generate.d.ts +2 -0
  141. package/dist/commands/build/generate.d.ts.map +1 -1
  142. package/dist/commands/build/generate.js +52 -0
  143. package/dist/commands/build/init.d.ts.map +1 -1
  144. package/dist/commands/build/init.js +10 -0
  145. package/dist/commands/build/queue/setup.d.ts +21 -0
  146. package/dist/commands/build/queue/setup.d.ts.map +1 -0
  147. package/dist/commands/build/queue/setup.js +120 -0
  148. package/dist/commands/build/smartbucket/setup.d.ts +23 -0
  149. package/dist/commands/build/smartbucket/setup.d.ts.map +1 -0
  150. package/dist/commands/build/smartbucket/setup.js +167 -0
  151. package/dist/commands/build/smartmemory/setup.d.ts +23 -0
  152. package/dist/commands/build/smartmemory/setup.d.ts.map +1 -0
  153. package/dist/commands/build/smartmemory/setup.js +172 -0
  154. package/dist/commands/build/smartsql/setup.d.ts +23 -0
  155. package/dist/commands/build/smartsql/setup.d.ts.map +1 -0
  156. package/dist/commands/build/smartsql/setup.js +169 -0
  157. package/dist/commands/build/validate.d.ts +2 -0
  158. package/dist/commands/build/validate.d.ts.map +1 -1
  159. package/dist/commands/build/validate.js +80 -8
  160. package/dist/commands/build/workos/jwt.d.ts +23 -0
  161. package/dist/commands/build/workos/jwt.d.ts.map +1 -0
  162. package/dist/commands/build/workos/jwt.js +172 -0
  163. package/dist/commands/doctor.d.ts +27 -0
  164. package/dist/commands/doctor.d.ts.map +1 -0
  165. package/dist/commands/doctor.js +328 -0
  166. package/dist/commands/object/delete.d.ts +0 -2
  167. package/dist/commands/object/delete.d.ts.map +1 -1
  168. package/dist/commands/object/delete.js +3 -38
  169. package/dist/commands/object/get.d.ts +0 -2
  170. package/dist/commands/object/get.d.ts.map +1 -1
  171. package/dist/commands/object/get.js +3 -38
  172. package/dist/commands/object/list.d.ts +0 -2
  173. package/dist/commands/object/list.d.ts.map +1 -1
  174. package/dist/commands/object/list.js +5 -40
  175. package/dist/commands/object/put.d.ts +0 -2
  176. package/dist/commands/object/put.d.ts.map +1 -1
  177. package/dist/commands/object/put.js +3 -38
  178. package/dist/commands/query/chunk-search.d.ts +0 -2
  179. package/dist/commands/query/chunk-search.d.ts.map +1 -1
  180. package/dist/commands/query/chunk-search.js +12 -46
  181. package/dist/commands/query/document.d.ts +1 -3
  182. package/dist/commands/query/document.d.ts.map +1 -1
  183. package/dist/commands/query/document.js +16 -60
  184. package/dist/commands/query/search.d.ts +0 -2
  185. package/dist/commands/query/search.d.ts.map +1 -1
  186. package/dist/commands/query/search.js +12 -46
  187. package/dist/feature-catalog.d.ts +28 -0
  188. package/dist/feature-catalog.d.ts.map +1 -0
  189. package/dist/feature-catalog.js +104 -0
  190. package/dist/index.d.ts.map +1 -1
  191. package/dist/index.js +16 -2
  192. package/oclif.manifest.json +4811 -3433
  193. package/package.json +3 -3
  194. package/templates/examples/smartbucket-minimal.ts.hbs +87 -0
  195. package/templates/examples/smartmemory-minimal.ts.hbs +82 -0
  196. package/templates/examples/smartsql-minimal.ts.hbs +69 -0
  197. package/templates/handlers/actor/index.test.ts.hbs +48 -85
  198. package/templates/handlers/actor/index.ts.hbs +16 -316
  199. package/templates/handlers/bucket-event-notification/index.ts.hbs +32 -235
  200. package/templates/handlers/bucket-event-observer.ts.hbs +79 -0
  201. package/templates/handlers/http-service/index.test.ts.hbs +3 -0
  202. package/templates/handlers/http-service/index.ts.hbs +43 -15
  203. package/templates/handlers/queue-consumer-setup.ts.hbs +45 -0
  204. package/templates/handlers/task/index.test.ts.hbs +30 -112
  205. package/templates/handlers/task/index.ts.hbs +19 -58
  206. package/templates/init/RAINDROP.md.hbs +97 -1
  207. package/templates/init/eslint.config.js +43 -0
  208. package/templates/init/package.json.hbs +4 -1
  209. package/templates/init/tsconfig.json +3 -3
  210. package/bundle/chunk-23UBI7BN.js +0 -48
  211. package/bundle/chunk-2QWMBNE3.js +0 -384
  212. package/bundle/chunk-45IYWQDC.js +0 -384
  213. package/bundle/chunk-5YUO23QU.js +0 -4585
  214. package/bundle/chunk-6MIGCNUO.js +0 -75
  215. package/bundle/chunk-7ZJWA6HP.js +0 -805
  216. package/bundle/chunk-AIYVX2M7.js +0 -44
  217. package/bundle/chunk-BB5TNIEM.js +0 -48
  218. package/bundle/chunk-BUR3HFKH.js +0 -488
  219. package/bundle/chunk-BYSBS7KT.js +0 -488
  220. package/bundle/chunk-CX3RWI62.js +0 -28658
  221. package/bundle/chunk-DLH7MI57.js +0 -305
  222. package/bundle/chunk-E3WJIYJZ.js +0 -12148
  223. package/bundle/chunk-EX7NOPRF.js +0 -12148
  224. package/bundle/chunk-F76JQS2J.js +0 -231
  225. package/bundle/chunk-FBOXMVKD.js +0 -28679
  226. package/bundle/chunk-FTPZ6SQW.js +0 -238909
  227. package/bundle/chunk-H3CFZ7ZH.js +0 -74
  228. package/bundle/chunk-HXOILVWA.js +0 -384
  229. package/bundle/chunk-IMP7O5AC.js +0 -22452
  230. package/bundle/chunk-IPYOAKRE.js +0 -231
  231. package/bundle/chunk-J7HN6XF2.js +0 -4461
  232. package/bundle/chunk-JOLOAALA.js +0 -231
  233. package/bundle/chunk-JZ2G4Q35.js +0 -4585
  234. package/bundle/chunk-KVAWPWF7.js +0 -231
  235. package/bundle/chunk-MEUAAIXV.js +0 -28657
  236. package/bundle/chunk-QBWFE57Z.js +0 -384
  237. package/bundle/chunk-SP3LOXPC.js +0 -46
  238. package/bundle/chunk-T7C564PR.js +0 -28678
  239. package/bundle/chunk-UFH545WJ.js +0 -22452
  240. package/bundle/chunk-UHVMPWM5.js +0 -315
  241. package/bundle/chunk-VB7ZTSZV.js +0 -1089
  242. package/bundle/chunk-VBIJDFMJ.js +0 -384
  243. package/bundle/chunk-VR7RLTE3.js +0 -231
  244. package/bundle/chunk-WFZUJLEC.js +0 -231
  245. package/bundle/chunk-YDGJTLVZ.js +0 -133
  246. package/bundle/chunk-YPNQ7UFK.js +0 -502
  247. package/bundle/chunk-YXFDRMSN.js +0 -384
  248. package/dist/lib/dns-utils.d.ts +0 -7
  249. package/dist/lib/dns-utils.d.ts.map +0 -1
  250. package/dist/lib/dns-utils.js +0 -44
@@ -1,1089 +0,0 @@
1
- import {
2
- __commonJS,
3
- init_cjs_shims
4
- } from "./chunk-PS3WZBDF.js";
5
-
6
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRMode.js
7
- var require_QRMode = __commonJS({
8
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRMode.js"(exports, module) {
9
- init_cjs_shims();
10
- module.exports = {
11
- MODE_NUMBER: 1 << 0,
12
- MODE_ALPHA_NUM: 1 << 1,
13
- MODE_8BIT_BYTE: 1 << 2,
14
- MODE_KANJI: 1 << 3
15
- };
16
- }
17
- });
18
-
19
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js
20
- var require_QR8bitByte = __commonJS({
21
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js"(exports, module) {
22
- init_cjs_shims();
23
- var QRMode = require_QRMode();
24
- function QR8bitByte(data) {
25
- this.mode = QRMode.MODE_8BIT_BYTE;
26
- this.data = data;
27
- }
28
- QR8bitByte.prototype = {
29
- getLength: function() {
30
- return this.data.length;
31
- },
32
- write: function(buffer) {
33
- for (var i = 0; i < this.data.length; i++) {
34
- buffer.put(this.data.charCodeAt(i), 8);
35
- }
36
- }
37
- };
38
- module.exports = QR8bitByte;
39
- }
40
- });
41
-
42
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRMath.js
43
- var require_QRMath = __commonJS({
44
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRMath.js"(exports, module) {
45
- init_cjs_shims();
46
- var QRMath = {
47
- glog: function(n) {
48
- if (n < 1) {
49
- throw new Error("glog(" + n + ")");
50
- }
51
- return QRMath.LOG_TABLE[n];
52
- },
53
- gexp: function(n) {
54
- while (n < 0) {
55
- n += 255;
56
- }
57
- while (n >= 256) {
58
- n -= 255;
59
- }
60
- return QRMath.EXP_TABLE[n];
61
- },
62
- EXP_TABLE: new Array(256),
63
- LOG_TABLE: new Array(256)
64
- };
65
- for (i = 0; i < 8; i++) {
66
- QRMath.EXP_TABLE[i] = 1 << i;
67
- }
68
- var i;
69
- for (i = 8; i < 256; i++) {
70
- QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
71
- }
72
- var i;
73
- for (i = 0; i < 255; i++) {
74
- QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
75
- }
76
- var i;
77
- module.exports = QRMath;
78
- }
79
- });
80
-
81
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js
82
- var require_QRPolynomial = __commonJS({
83
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js"(exports, module) {
84
- init_cjs_shims();
85
- var QRMath = require_QRMath();
86
- function QRPolynomial(num, shift) {
87
- if (num.length === void 0) {
88
- throw new Error(num.length + "/" + shift);
89
- }
90
- var offset = 0;
91
- while (offset < num.length && num[offset] === 0) {
92
- offset++;
93
- }
94
- this.num = new Array(num.length - offset + shift);
95
- for (var i = 0; i < num.length - offset; i++) {
96
- this.num[i] = num[i + offset];
97
- }
98
- }
99
- QRPolynomial.prototype = {
100
- get: function(index) {
101
- return this.num[index];
102
- },
103
- getLength: function() {
104
- return this.num.length;
105
- },
106
- multiply: function(e) {
107
- var num = new Array(this.getLength() + e.getLength() - 1);
108
- for (var i = 0; i < this.getLength(); i++) {
109
- for (var j = 0; j < e.getLength(); j++) {
110
- num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
111
- }
112
- }
113
- return new QRPolynomial(num, 0);
114
- },
115
- mod: function(e) {
116
- if (this.getLength() - e.getLength() < 0) {
117
- return this;
118
- }
119
- var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));
120
- var num = new Array(this.getLength());
121
- for (var i = 0; i < this.getLength(); i++) {
122
- num[i] = this.get(i);
123
- }
124
- for (var x = 0; x < e.getLength(); x++) {
125
- num[x] ^= QRMath.gexp(QRMath.glog(e.get(x)) + ratio);
126
- }
127
- return new QRPolynomial(num, 0).mod(e);
128
- }
129
- };
130
- module.exports = QRPolynomial;
131
- }
132
- });
133
-
134
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js
135
- var require_QRMaskPattern = __commonJS({
136
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js"(exports, module) {
137
- init_cjs_shims();
138
- module.exports = {
139
- PATTERN000: 0,
140
- PATTERN001: 1,
141
- PATTERN010: 2,
142
- PATTERN011: 3,
143
- PATTERN100: 4,
144
- PATTERN101: 5,
145
- PATTERN110: 6,
146
- PATTERN111: 7
147
- };
148
- }
149
- });
150
-
151
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js
152
- var require_QRUtil = __commonJS({
153
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js"(exports, module) {
154
- init_cjs_shims();
155
- var QRMode = require_QRMode();
156
- var QRPolynomial = require_QRPolynomial();
157
- var QRMath = require_QRMath();
158
- var QRMaskPattern = require_QRMaskPattern();
159
- var QRUtil = {
160
- PATTERN_POSITION_TABLE: [
161
- [],
162
- [6, 18],
163
- [6, 22],
164
- [6, 26],
165
- [6, 30],
166
- [6, 34],
167
- [6, 22, 38],
168
- [6, 24, 42],
169
- [6, 26, 46],
170
- [6, 28, 50],
171
- [6, 30, 54],
172
- [6, 32, 58],
173
- [6, 34, 62],
174
- [6, 26, 46, 66],
175
- [6, 26, 48, 70],
176
- [6, 26, 50, 74],
177
- [6, 30, 54, 78],
178
- [6, 30, 56, 82],
179
- [6, 30, 58, 86],
180
- [6, 34, 62, 90],
181
- [6, 28, 50, 72, 94],
182
- [6, 26, 50, 74, 98],
183
- [6, 30, 54, 78, 102],
184
- [6, 28, 54, 80, 106],
185
- [6, 32, 58, 84, 110],
186
- [6, 30, 58, 86, 114],
187
- [6, 34, 62, 90, 118],
188
- [6, 26, 50, 74, 98, 122],
189
- [6, 30, 54, 78, 102, 126],
190
- [6, 26, 52, 78, 104, 130],
191
- [6, 30, 56, 82, 108, 134],
192
- [6, 34, 60, 86, 112, 138],
193
- [6, 30, 58, 86, 114, 142],
194
- [6, 34, 62, 90, 118, 146],
195
- [6, 30, 54, 78, 102, 126, 150],
196
- [6, 24, 50, 76, 102, 128, 154],
197
- [6, 28, 54, 80, 106, 132, 158],
198
- [6, 32, 58, 84, 110, 136, 162],
199
- [6, 26, 54, 82, 110, 138, 166],
200
- [6, 30, 58, 86, 114, 142, 170]
201
- ],
202
- G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
203
- G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
204
- G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
205
- getBCHTypeInfo: function(data) {
206
- var d = data << 10;
207
- while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
208
- d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
209
- }
210
- return (data << 10 | d) ^ QRUtil.G15_MASK;
211
- },
212
- getBCHTypeNumber: function(data) {
213
- var d = data << 12;
214
- while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
215
- d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
216
- }
217
- return data << 12 | d;
218
- },
219
- getBCHDigit: function(data) {
220
- var digit = 0;
221
- while (data !== 0) {
222
- digit++;
223
- data >>>= 1;
224
- }
225
- return digit;
226
- },
227
- getPatternPosition: function(typeNumber) {
228
- return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
229
- },
230
- getMask: function(maskPattern, i, j) {
231
- switch (maskPattern) {
232
- case QRMaskPattern.PATTERN000:
233
- return (i + j) % 2 === 0;
234
- case QRMaskPattern.PATTERN001:
235
- return i % 2 === 0;
236
- case QRMaskPattern.PATTERN010:
237
- return j % 3 === 0;
238
- case QRMaskPattern.PATTERN011:
239
- return (i + j) % 3 === 0;
240
- case QRMaskPattern.PATTERN100:
241
- return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0;
242
- case QRMaskPattern.PATTERN101:
243
- return i * j % 2 + i * j % 3 === 0;
244
- case QRMaskPattern.PATTERN110:
245
- return (i * j % 2 + i * j % 3) % 2 === 0;
246
- case QRMaskPattern.PATTERN111:
247
- return (i * j % 3 + (i + j) % 2) % 2 === 0;
248
- default:
249
- throw new Error("bad maskPattern:" + maskPattern);
250
- }
251
- },
252
- getErrorCorrectPolynomial: function(errorCorrectLength) {
253
- var a = new QRPolynomial([1], 0);
254
- for (var i = 0; i < errorCorrectLength; i++) {
255
- a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
256
- }
257
- return a;
258
- },
259
- getLengthInBits: function(mode, type) {
260
- if (1 <= type && type < 10) {
261
- switch (mode) {
262
- case QRMode.MODE_NUMBER:
263
- return 10;
264
- case QRMode.MODE_ALPHA_NUM:
265
- return 9;
266
- case QRMode.MODE_8BIT_BYTE:
267
- return 8;
268
- case QRMode.MODE_KANJI:
269
- return 8;
270
- default:
271
- throw new Error("mode:" + mode);
272
- }
273
- } else if (type < 27) {
274
- switch (mode) {
275
- case QRMode.MODE_NUMBER:
276
- return 12;
277
- case QRMode.MODE_ALPHA_NUM:
278
- return 11;
279
- case QRMode.MODE_8BIT_BYTE:
280
- return 16;
281
- case QRMode.MODE_KANJI:
282
- return 10;
283
- default:
284
- throw new Error("mode:" + mode);
285
- }
286
- } else if (type < 41) {
287
- switch (mode) {
288
- case QRMode.MODE_NUMBER:
289
- return 14;
290
- case QRMode.MODE_ALPHA_NUM:
291
- return 13;
292
- case QRMode.MODE_8BIT_BYTE:
293
- return 16;
294
- case QRMode.MODE_KANJI:
295
- return 12;
296
- default:
297
- throw new Error("mode:" + mode);
298
- }
299
- } else {
300
- throw new Error("type:" + type);
301
- }
302
- },
303
- getLostPoint: function(qrCode) {
304
- var moduleCount = qrCode.getModuleCount();
305
- var lostPoint = 0;
306
- var row = 0;
307
- var col = 0;
308
- for (row = 0; row < moduleCount; row++) {
309
- for (col = 0; col < moduleCount; col++) {
310
- var sameCount = 0;
311
- var dark = qrCode.isDark(row, col);
312
- for (var r = -1; r <= 1; r++) {
313
- if (row + r < 0 || moduleCount <= row + r) {
314
- continue;
315
- }
316
- for (var c = -1; c <= 1; c++) {
317
- if (col + c < 0 || moduleCount <= col + c) {
318
- continue;
319
- }
320
- if (r === 0 && c === 0) {
321
- continue;
322
- }
323
- if (dark === qrCode.isDark(row + r, col + c)) {
324
- sameCount++;
325
- }
326
- }
327
- }
328
- if (sameCount > 5) {
329
- lostPoint += 3 + sameCount - 5;
330
- }
331
- }
332
- }
333
- for (row = 0; row < moduleCount - 1; row++) {
334
- for (col = 0; col < moduleCount - 1; col++) {
335
- var count = 0;
336
- if (qrCode.isDark(row, col)) count++;
337
- if (qrCode.isDark(row + 1, col)) count++;
338
- if (qrCode.isDark(row, col + 1)) count++;
339
- if (qrCode.isDark(row + 1, col + 1)) count++;
340
- if (count === 0 || count === 4) {
341
- lostPoint += 3;
342
- }
343
- }
344
- }
345
- for (row = 0; row < moduleCount; row++) {
346
- for (col = 0; col < moduleCount - 6; col++) {
347
- 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)) {
348
- lostPoint += 40;
349
- }
350
- }
351
- }
352
- for (col = 0; col < moduleCount; col++) {
353
- for (row = 0; row < moduleCount - 6; row++) {
354
- 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)) {
355
- lostPoint += 40;
356
- }
357
- }
358
- }
359
- var darkCount = 0;
360
- for (col = 0; col < moduleCount; col++) {
361
- for (row = 0; row < moduleCount; row++) {
362
- if (qrCode.isDark(row, col)) {
363
- darkCount++;
364
- }
365
- }
366
- }
367
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
368
- lostPoint += ratio * 10;
369
- return lostPoint;
370
- }
371
- };
372
- module.exports = QRUtil;
373
- }
374
- });
375
-
376
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js
377
- var require_QRErrorCorrectLevel = __commonJS({
378
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js"(exports, module) {
379
- init_cjs_shims();
380
- module.exports = {
381
- L: 1,
382
- M: 0,
383
- Q: 3,
384
- H: 2
385
- };
386
- }
387
- });
388
-
389
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js
390
- var require_QRRSBlock = __commonJS({
391
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js"(exports, module) {
392
- init_cjs_shims();
393
- var QRErrorCorrectLevel = require_QRErrorCorrectLevel();
394
- function QRRSBlock(totalCount, dataCount) {
395
- this.totalCount = totalCount;
396
- this.dataCount = dataCount;
397
- }
398
- QRRSBlock.RS_BLOCK_TABLE = [
399
- // L
400
- // M
401
- // Q
402
- // H
403
- // 1
404
- [1, 26, 19],
405
- [1, 26, 16],
406
- [1, 26, 13],
407
- [1, 26, 9],
408
- // 2
409
- [1, 44, 34],
410
- [1, 44, 28],
411
- [1, 44, 22],
412
- [1, 44, 16],
413
- // 3
414
- [1, 70, 55],
415
- [1, 70, 44],
416
- [2, 35, 17],
417
- [2, 35, 13],
418
- // 4
419
- [1, 100, 80],
420
- [2, 50, 32],
421
- [2, 50, 24],
422
- [4, 25, 9],
423
- // 5
424
- [1, 134, 108],
425
- [2, 67, 43],
426
- [2, 33, 15, 2, 34, 16],
427
- [2, 33, 11, 2, 34, 12],
428
- // 6
429
- [2, 86, 68],
430
- [4, 43, 27],
431
- [4, 43, 19],
432
- [4, 43, 15],
433
- // 7
434
- [2, 98, 78],
435
- [4, 49, 31],
436
- [2, 32, 14, 4, 33, 15],
437
- [4, 39, 13, 1, 40, 14],
438
- // 8
439
- [2, 121, 97],
440
- [2, 60, 38, 2, 61, 39],
441
- [4, 40, 18, 2, 41, 19],
442
- [4, 40, 14, 2, 41, 15],
443
- // 9
444
- [2, 146, 116],
445
- [3, 58, 36, 2, 59, 37],
446
- [4, 36, 16, 4, 37, 17],
447
- [4, 36, 12, 4, 37, 13],
448
- // 10
449
- [2, 86, 68, 2, 87, 69],
450
- [4, 69, 43, 1, 70, 44],
451
- [6, 43, 19, 2, 44, 20],
452
- [6, 43, 15, 2, 44, 16],
453
- // 11
454
- [4, 101, 81],
455
- [1, 80, 50, 4, 81, 51],
456
- [4, 50, 22, 4, 51, 23],
457
- [3, 36, 12, 8, 37, 13],
458
- // 12
459
- [2, 116, 92, 2, 117, 93],
460
- [6, 58, 36, 2, 59, 37],
461
- [4, 46, 20, 6, 47, 21],
462
- [7, 42, 14, 4, 43, 15],
463
- // 13
464
- [4, 133, 107],
465
- [8, 59, 37, 1, 60, 38],
466
- [8, 44, 20, 4, 45, 21],
467
- [12, 33, 11, 4, 34, 12],
468
- // 14
469
- [3, 145, 115, 1, 146, 116],
470
- [4, 64, 40, 5, 65, 41],
471
- [11, 36, 16, 5, 37, 17],
472
- [11, 36, 12, 5, 37, 13],
473
- // 15
474
- [5, 109, 87, 1, 110, 88],
475
- [5, 65, 41, 5, 66, 42],
476
- [5, 54, 24, 7, 55, 25],
477
- [11, 36, 12],
478
- // 16
479
- [5, 122, 98, 1, 123, 99],
480
- [7, 73, 45, 3, 74, 46],
481
- [15, 43, 19, 2, 44, 20],
482
- [3, 45, 15, 13, 46, 16],
483
- // 17
484
- [1, 135, 107, 5, 136, 108],
485
- [10, 74, 46, 1, 75, 47],
486
- [1, 50, 22, 15, 51, 23],
487
- [2, 42, 14, 17, 43, 15],
488
- // 18
489
- [5, 150, 120, 1, 151, 121],
490
- [9, 69, 43, 4, 70, 44],
491
- [17, 50, 22, 1, 51, 23],
492
- [2, 42, 14, 19, 43, 15],
493
- // 19
494
- [3, 141, 113, 4, 142, 114],
495
- [3, 70, 44, 11, 71, 45],
496
- [17, 47, 21, 4, 48, 22],
497
- [9, 39, 13, 16, 40, 14],
498
- // 20
499
- [3, 135, 107, 5, 136, 108],
500
- [3, 67, 41, 13, 68, 42],
501
- [15, 54, 24, 5, 55, 25],
502
- [15, 43, 15, 10, 44, 16],
503
- // 21
504
- [4, 144, 116, 4, 145, 117],
505
- [17, 68, 42],
506
- [17, 50, 22, 6, 51, 23],
507
- [19, 46, 16, 6, 47, 17],
508
- // 22
509
- [2, 139, 111, 7, 140, 112],
510
- [17, 74, 46],
511
- [7, 54, 24, 16, 55, 25],
512
- [34, 37, 13],
513
- // 23
514
- [4, 151, 121, 5, 152, 122],
515
- [4, 75, 47, 14, 76, 48],
516
- [11, 54, 24, 14, 55, 25],
517
- [16, 45, 15, 14, 46, 16],
518
- // 24
519
- [6, 147, 117, 4, 148, 118],
520
- [6, 73, 45, 14, 74, 46],
521
- [11, 54, 24, 16, 55, 25],
522
- [30, 46, 16, 2, 47, 17],
523
- // 25
524
- [8, 132, 106, 4, 133, 107],
525
- [8, 75, 47, 13, 76, 48],
526
- [7, 54, 24, 22, 55, 25],
527
- [22, 45, 15, 13, 46, 16],
528
- // 26
529
- [10, 142, 114, 2, 143, 115],
530
- [19, 74, 46, 4, 75, 47],
531
- [28, 50, 22, 6, 51, 23],
532
- [33, 46, 16, 4, 47, 17],
533
- // 27
534
- [8, 152, 122, 4, 153, 123],
535
- [22, 73, 45, 3, 74, 46],
536
- [8, 53, 23, 26, 54, 24],
537
- [12, 45, 15, 28, 46, 16],
538
- // 28
539
- [3, 147, 117, 10, 148, 118],
540
- [3, 73, 45, 23, 74, 46],
541
- [4, 54, 24, 31, 55, 25],
542
- [11, 45, 15, 31, 46, 16],
543
- // 29
544
- [7, 146, 116, 7, 147, 117],
545
- [21, 73, 45, 7, 74, 46],
546
- [1, 53, 23, 37, 54, 24],
547
- [19, 45, 15, 26, 46, 16],
548
- // 30
549
- [5, 145, 115, 10, 146, 116],
550
- [19, 75, 47, 10, 76, 48],
551
- [15, 54, 24, 25, 55, 25],
552
- [23, 45, 15, 25, 46, 16],
553
- // 31
554
- [13, 145, 115, 3, 146, 116],
555
- [2, 74, 46, 29, 75, 47],
556
- [42, 54, 24, 1, 55, 25],
557
- [23, 45, 15, 28, 46, 16],
558
- // 32
559
- [17, 145, 115],
560
- [10, 74, 46, 23, 75, 47],
561
- [10, 54, 24, 35, 55, 25],
562
- [19, 45, 15, 35, 46, 16],
563
- // 33
564
- [17, 145, 115, 1, 146, 116],
565
- [14, 74, 46, 21, 75, 47],
566
- [29, 54, 24, 19, 55, 25],
567
- [11, 45, 15, 46, 46, 16],
568
- // 34
569
- [13, 145, 115, 6, 146, 116],
570
- [14, 74, 46, 23, 75, 47],
571
- [44, 54, 24, 7, 55, 25],
572
- [59, 46, 16, 1, 47, 17],
573
- // 35
574
- [12, 151, 121, 7, 152, 122],
575
- [12, 75, 47, 26, 76, 48],
576
- [39, 54, 24, 14, 55, 25],
577
- [22, 45, 15, 41, 46, 16],
578
- // 36
579
- [6, 151, 121, 14, 152, 122],
580
- [6, 75, 47, 34, 76, 48],
581
- [46, 54, 24, 10, 55, 25],
582
- [2, 45, 15, 64, 46, 16],
583
- // 37
584
- [17, 152, 122, 4, 153, 123],
585
- [29, 74, 46, 14, 75, 47],
586
- [49, 54, 24, 10, 55, 25],
587
- [24, 45, 15, 46, 46, 16],
588
- // 38
589
- [4, 152, 122, 18, 153, 123],
590
- [13, 74, 46, 32, 75, 47],
591
- [48, 54, 24, 14, 55, 25],
592
- [42, 45, 15, 32, 46, 16],
593
- // 39
594
- [20, 147, 117, 4, 148, 118],
595
- [40, 75, 47, 7, 76, 48],
596
- [43, 54, 24, 22, 55, 25],
597
- [10, 45, 15, 67, 46, 16],
598
- // 40
599
- [19, 148, 118, 6, 149, 119],
600
- [18, 75, 47, 31, 76, 48],
601
- [34, 54, 24, 34, 55, 25],
602
- [20, 45, 15, 61, 46, 16]
603
- ];
604
- QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {
605
- var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
606
- if (rsBlock === void 0) {
607
- throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
608
- }
609
- var length = rsBlock.length / 3;
610
- var list = [];
611
- for (var i = 0; i < length; i++) {
612
- var count = rsBlock[i * 3 + 0];
613
- var totalCount = rsBlock[i * 3 + 1];
614
- var dataCount = rsBlock[i * 3 + 2];
615
- for (var j = 0; j < count; j++) {
616
- list.push(new QRRSBlock(totalCount, dataCount));
617
- }
618
- }
619
- return list;
620
- };
621
- QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {
622
- switch (errorCorrectLevel) {
623
- case QRErrorCorrectLevel.L:
624
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
625
- case QRErrorCorrectLevel.M:
626
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
627
- case QRErrorCorrectLevel.Q:
628
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
629
- case QRErrorCorrectLevel.H:
630
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
631
- default:
632
- return void 0;
633
- }
634
- };
635
- module.exports = QRRSBlock;
636
- }
637
- });
638
-
639
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js
640
- var require_QRBitBuffer = __commonJS({
641
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js"(exports, module) {
642
- init_cjs_shims();
643
- function QRBitBuffer() {
644
- this.buffer = [];
645
- this.length = 0;
646
- }
647
- QRBitBuffer.prototype = {
648
- get: function(index) {
649
- var bufIndex = Math.floor(index / 8);
650
- return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
651
- },
652
- put: function(num, length) {
653
- for (var i = 0; i < length; i++) {
654
- this.putBit((num >>> length - i - 1 & 1) == 1);
655
- }
656
- },
657
- getLengthInBits: function() {
658
- return this.length;
659
- },
660
- putBit: function(bit) {
661
- var bufIndex = Math.floor(this.length / 8);
662
- if (this.buffer.length <= bufIndex) {
663
- this.buffer.push(0);
664
- }
665
- if (bit) {
666
- this.buffer[bufIndex] |= 128 >>> this.length % 8;
667
- }
668
- this.length++;
669
- }
670
- };
671
- module.exports = QRBitBuffer;
672
- }
673
- });
674
-
675
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/index.js
676
- var require_QRCode = __commonJS({
677
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/vendor/QRCode/index.js"(exports, module) {
678
- init_cjs_shims();
679
- var QR8bitByte = require_QR8bitByte();
680
- var QRUtil = require_QRUtil();
681
- var QRPolynomial = require_QRPolynomial();
682
- var QRRSBlock = require_QRRSBlock();
683
- var QRBitBuffer = require_QRBitBuffer();
684
- function QRCode(typeNumber, errorCorrectLevel) {
685
- this.typeNumber = typeNumber;
686
- this.errorCorrectLevel = errorCorrectLevel;
687
- this.modules = null;
688
- this.moduleCount = 0;
689
- this.dataCache = null;
690
- this.dataList = [];
691
- }
692
- QRCode.prototype = {
693
- addData: function(data) {
694
- var newData = new QR8bitByte(data);
695
- this.dataList.push(newData);
696
- this.dataCache = null;
697
- },
698
- isDark: function(row, col) {
699
- if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
700
- throw new Error(row + "," + col);
701
- }
702
- return this.modules[row][col];
703
- },
704
- getModuleCount: function() {
705
- return this.moduleCount;
706
- },
707
- make: function() {
708
- if (this.typeNumber < 1) {
709
- var typeNumber = 1;
710
- for (typeNumber = 1; typeNumber < 40; typeNumber++) {
711
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
712
- var buffer = new QRBitBuffer();
713
- var totalDataCount = 0;
714
- for (var i = 0; i < rsBlocks.length; i++) {
715
- totalDataCount += rsBlocks[i].dataCount;
716
- }
717
- for (var x = 0; x < this.dataList.length; x++) {
718
- var data = this.dataList[x];
719
- buffer.put(data.mode, 4);
720
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
721
- data.write(buffer);
722
- }
723
- if (buffer.getLengthInBits() <= totalDataCount * 8)
724
- break;
725
- }
726
- this.typeNumber = typeNumber;
727
- }
728
- this.makeImpl(false, this.getBestMaskPattern());
729
- },
730
- makeImpl: function(test, maskPattern) {
731
- this.moduleCount = this.typeNumber * 4 + 17;
732
- this.modules = new Array(this.moduleCount);
733
- for (var row = 0; row < this.moduleCount; row++) {
734
- this.modules[row] = new Array(this.moduleCount);
735
- for (var col = 0; col < this.moduleCount; col++) {
736
- this.modules[row][col] = null;
737
- }
738
- }
739
- this.setupPositionProbePattern(0, 0);
740
- this.setupPositionProbePattern(this.moduleCount - 7, 0);
741
- this.setupPositionProbePattern(0, this.moduleCount - 7);
742
- this.setupPositionAdjustPattern();
743
- this.setupTimingPattern();
744
- this.setupTypeInfo(test, maskPattern);
745
- if (this.typeNumber >= 7) {
746
- this.setupTypeNumber(test);
747
- }
748
- if (this.dataCache === null) {
749
- this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
750
- }
751
- this.mapData(this.dataCache, maskPattern);
752
- },
753
- setupPositionProbePattern: function(row, col) {
754
- for (var r = -1; r <= 7; r++) {
755
- if (row + r <= -1 || this.moduleCount <= row + r) continue;
756
- for (var c = -1; c <= 7; c++) {
757
- if (col + c <= -1 || this.moduleCount <= col + c) continue;
758
- 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) {
759
- this.modules[row + r][col + c] = true;
760
- } else {
761
- this.modules[row + r][col + c] = false;
762
- }
763
- }
764
- }
765
- },
766
- getBestMaskPattern: function() {
767
- var minLostPoint = 0;
768
- var pattern = 0;
769
- for (var i = 0; i < 8; i++) {
770
- this.makeImpl(true, i);
771
- var lostPoint = QRUtil.getLostPoint(this);
772
- if (i === 0 || minLostPoint > lostPoint) {
773
- minLostPoint = lostPoint;
774
- pattern = i;
775
- }
776
- }
777
- return pattern;
778
- },
779
- createMovieClip: function(target_mc, instance_name, depth) {
780
- var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
781
- var cs = 1;
782
- this.make();
783
- for (var row = 0; row < this.modules.length; row++) {
784
- var y = row * cs;
785
- for (var col = 0; col < this.modules[row].length; col++) {
786
- var x = col * cs;
787
- var dark = this.modules[row][col];
788
- if (dark) {
789
- qr_mc.beginFill(0, 100);
790
- qr_mc.moveTo(x, y);
791
- qr_mc.lineTo(x + cs, y);
792
- qr_mc.lineTo(x + cs, y + cs);
793
- qr_mc.lineTo(x, y + cs);
794
- qr_mc.endFill();
795
- }
796
- }
797
- }
798
- return qr_mc;
799
- },
800
- setupTimingPattern: function() {
801
- for (var r = 8; r < this.moduleCount - 8; r++) {
802
- if (this.modules[r][6] !== null) {
803
- continue;
804
- }
805
- this.modules[r][6] = r % 2 === 0;
806
- }
807
- for (var c = 8; c < this.moduleCount - 8; c++) {
808
- if (this.modules[6][c] !== null) {
809
- continue;
810
- }
811
- this.modules[6][c] = c % 2 === 0;
812
- }
813
- },
814
- setupPositionAdjustPattern: function() {
815
- var pos = QRUtil.getPatternPosition(this.typeNumber);
816
- for (var i = 0; i < pos.length; i++) {
817
- for (var j = 0; j < pos.length; j++) {
818
- var row = pos[i];
819
- var col = pos[j];
820
- if (this.modules[row][col] !== null) {
821
- continue;
822
- }
823
- for (var r = -2; r <= 2; r++) {
824
- for (var c = -2; c <= 2; c++) {
825
- if (Math.abs(r) === 2 || Math.abs(c) === 2 || r === 0 && c === 0) {
826
- this.modules[row + r][col + c] = true;
827
- } else {
828
- this.modules[row + r][col + c] = false;
829
- }
830
- }
831
- }
832
- }
833
- }
834
- },
835
- setupTypeNumber: function(test) {
836
- var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
837
- var mod;
838
- for (var i = 0; i < 18; i++) {
839
- mod = !test && (bits >> i & 1) === 1;
840
- this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
841
- }
842
- for (var x = 0; x < 18; x++) {
843
- mod = !test && (bits >> x & 1) === 1;
844
- this.modules[x % 3 + this.moduleCount - 8 - 3][Math.floor(x / 3)] = mod;
845
- }
846
- },
847
- setupTypeInfo: function(test, maskPattern) {
848
- var data = this.errorCorrectLevel << 3 | maskPattern;
849
- var bits = QRUtil.getBCHTypeInfo(data);
850
- var mod;
851
- for (var v = 0; v < 15; v++) {
852
- mod = !test && (bits >> v & 1) === 1;
853
- if (v < 6) {
854
- this.modules[v][8] = mod;
855
- } else if (v < 8) {
856
- this.modules[v + 1][8] = mod;
857
- } else {
858
- this.modules[this.moduleCount - 15 + v][8] = mod;
859
- }
860
- }
861
- for (var h = 0; h < 15; h++) {
862
- mod = !test && (bits >> h & 1) === 1;
863
- if (h < 8) {
864
- this.modules[8][this.moduleCount - h - 1] = mod;
865
- } else if (h < 9) {
866
- this.modules[8][15 - h - 1 + 1] = mod;
867
- } else {
868
- this.modules[8][15 - h - 1] = mod;
869
- }
870
- }
871
- this.modules[this.moduleCount - 8][8] = !test;
872
- },
873
- mapData: function(data, maskPattern) {
874
- var inc = -1;
875
- var row = this.moduleCount - 1;
876
- var bitIndex = 7;
877
- var byteIndex = 0;
878
- for (var col = this.moduleCount - 1; col > 0; col -= 2) {
879
- if (col === 6) col--;
880
- while (true) {
881
- for (var c = 0; c < 2; c++) {
882
- if (this.modules[row][col - c] === null) {
883
- var dark = false;
884
- if (byteIndex < data.length) {
885
- dark = (data[byteIndex] >>> bitIndex & 1) === 1;
886
- }
887
- var mask = QRUtil.getMask(maskPattern, row, col - c);
888
- if (mask) {
889
- dark = !dark;
890
- }
891
- this.modules[row][col - c] = dark;
892
- bitIndex--;
893
- if (bitIndex === -1) {
894
- byteIndex++;
895
- bitIndex = 7;
896
- }
897
- }
898
- }
899
- row += inc;
900
- if (row < 0 || this.moduleCount <= row) {
901
- row -= inc;
902
- inc = -inc;
903
- break;
904
- }
905
- }
906
- }
907
- }
908
- };
909
- QRCode.PAD0 = 236;
910
- QRCode.PAD1 = 17;
911
- QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
912
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
913
- var buffer = new QRBitBuffer();
914
- for (var i = 0; i < dataList.length; i++) {
915
- var data = dataList[i];
916
- buffer.put(data.mode, 4);
917
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
918
- data.write(buffer);
919
- }
920
- var totalDataCount = 0;
921
- for (var x = 0; x < rsBlocks.length; x++) {
922
- totalDataCount += rsBlocks[x].dataCount;
923
- }
924
- if (buffer.getLengthInBits() > totalDataCount * 8) {
925
- throw new Error("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
926
- }
927
- if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
928
- buffer.put(0, 4);
929
- }
930
- while (buffer.getLengthInBits() % 8 !== 0) {
931
- buffer.putBit(false);
932
- }
933
- while (true) {
934
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
935
- break;
936
- }
937
- buffer.put(QRCode.PAD0, 8);
938
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
939
- break;
940
- }
941
- buffer.put(QRCode.PAD1, 8);
942
- }
943
- return QRCode.createBytes(buffer, rsBlocks);
944
- };
945
- QRCode.createBytes = function(buffer, rsBlocks) {
946
- var offset = 0;
947
- var maxDcCount = 0;
948
- var maxEcCount = 0;
949
- var dcdata = new Array(rsBlocks.length);
950
- var ecdata = new Array(rsBlocks.length);
951
- for (var r = 0; r < rsBlocks.length; r++) {
952
- var dcCount = rsBlocks[r].dataCount;
953
- var ecCount = rsBlocks[r].totalCount - dcCount;
954
- maxDcCount = Math.max(maxDcCount, dcCount);
955
- maxEcCount = Math.max(maxEcCount, ecCount);
956
- dcdata[r] = new Array(dcCount);
957
- for (var i = 0; i < dcdata[r].length; i++) {
958
- dcdata[r][i] = 255 & buffer.buffer[i + offset];
959
- }
960
- offset += dcCount;
961
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
962
- var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
963
- var modPoly = rawPoly.mod(rsPoly);
964
- ecdata[r] = new Array(rsPoly.getLength() - 1);
965
- for (var x = 0; x < ecdata[r].length; x++) {
966
- var modIndex = x + modPoly.getLength() - ecdata[r].length;
967
- ecdata[r][x] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
968
- }
969
- }
970
- var totalCodeCount = 0;
971
- for (var y = 0; y < rsBlocks.length; y++) {
972
- totalCodeCount += rsBlocks[y].totalCount;
973
- }
974
- var data = new Array(totalCodeCount);
975
- var index = 0;
976
- for (var z = 0; z < maxDcCount; z++) {
977
- for (var s = 0; s < rsBlocks.length; s++) {
978
- if (z < dcdata[s].length) {
979
- data[index++] = dcdata[s][z];
980
- }
981
- }
982
- }
983
- for (var xx = 0; xx < maxEcCount; xx++) {
984
- for (var t = 0; t < rsBlocks.length; t++) {
985
- if (xx < ecdata[t].length) {
986
- data[index++] = ecdata[t][xx];
987
- }
988
- }
989
- }
990
- return data;
991
- };
992
- module.exports = QRCode;
993
- }
994
- });
995
-
996
- // ../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/lib/main.js
997
- var require_main = __commonJS({
998
- "../../node_modules/.pnpm/qrcode-terminal@0.12.0/node_modules/qrcode-terminal/lib/main.js"(exports, module) {
999
- init_cjs_shims();
1000
- var QRCode = require_QRCode();
1001
- var QRErrorCorrectLevel = require_QRErrorCorrectLevel();
1002
- var black = "\x1B[40m \x1B[0m";
1003
- var white = "\x1B[47m \x1B[0m";
1004
- var toCell = function(isBlack) {
1005
- return isBlack ? black : white;
1006
- };
1007
- var repeat = function(color) {
1008
- return {
1009
- times: function(count) {
1010
- return new Array(count).join(color);
1011
- }
1012
- };
1013
- };
1014
- var fill = function(length, value) {
1015
- var arr = new Array(length);
1016
- for (var i = 0; i < length; i++) {
1017
- arr[i] = value;
1018
- }
1019
- return arr;
1020
- };
1021
- module.exports = {
1022
- error: QRErrorCorrectLevel.L,
1023
- generate: function(input, opts, cb) {
1024
- if (typeof opts === "function") {
1025
- cb = opts;
1026
- opts = {};
1027
- }
1028
- var qrcode = new QRCode(-1, this.error);
1029
- qrcode.addData(input);
1030
- qrcode.make();
1031
- var output = "";
1032
- if (opts && opts.small) {
1033
- var BLACK = true, WHITE = false;
1034
- var moduleCount = qrcode.getModuleCount();
1035
- var moduleData = qrcode.modules.slice();
1036
- var oddRow = moduleCount % 2 === 1;
1037
- if (oddRow) {
1038
- moduleData.push(fill(moduleCount, WHITE));
1039
- }
1040
- var platte = {
1041
- WHITE_ALL: "\u2588",
1042
- WHITE_BLACK: "\u2580",
1043
- BLACK_WHITE: "\u2584",
1044
- BLACK_ALL: " "
1045
- };
1046
- var borderTop = repeat(platte.BLACK_WHITE).times(moduleCount + 3);
1047
- var borderBottom = repeat(platte.WHITE_BLACK).times(moduleCount + 3);
1048
- output += borderTop + "\n";
1049
- for (var row = 0; row < moduleCount; row += 2) {
1050
- output += platte.WHITE_ALL;
1051
- for (var col = 0; col < moduleCount; col++) {
1052
- if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === WHITE) {
1053
- output += platte.WHITE_ALL;
1054
- } else if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === BLACK) {
1055
- output += platte.WHITE_BLACK;
1056
- } else if (moduleData[row][col] === BLACK && moduleData[row + 1][col] === WHITE) {
1057
- output += platte.BLACK_WHITE;
1058
- } else {
1059
- output += platte.BLACK_ALL;
1060
- }
1061
- }
1062
- output += platte.WHITE_ALL + "\n";
1063
- }
1064
- if (!oddRow) {
1065
- output += borderBottom;
1066
- }
1067
- } else {
1068
- var border = repeat(white).times(qrcode.getModuleCount() + 3);
1069
- output += border + "\n";
1070
- qrcode.modules.forEach(function(row2) {
1071
- output += white;
1072
- output += row2.map(toCell).join("");
1073
- output += white + "\n";
1074
- });
1075
- output += border;
1076
- }
1077
- if (cb) cb(output);
1078
- else console.log(output);
1079
- },
1080
- setErrorLevel: function(error) {
1081
- this.error = QRErrorCorrectLevel[error] || this.error;
1082
- }
1083
- };
1084
- }
1085
- });
1086
-
1087
- export {
1088
- require_main
1089
- };