@burdenoff/microfe-assethandler 2026.820.2 → 2026.820.4

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 (91) hide show
  1. package/dist/assethandler/components/AssetTag.d.ts +20 -0
  2. package/dist/assethandler/components/AssetTag.d.ts.map +1 -0
  3. package/dist/assethandler/components/AssetTag.js +8 -0
  4. package/dist/assethandler/components/AssetTag.js.map +1 -0
  5. package/dist/assethandler/components/index.d.ts +2 -0
  6. package/dist/assethandler/components/index.d.ts.map +1 -1
  7. package/dist/assethandler/components/index.js +1 -0
  8. package/dist/assethandler/pages/AssetsAssetCheckInOutPage.d.ts.map +1 -1
  9. package/dist/assethandler/pages/AssetsAssetCheckInOutPage.js +344 -181
  10. package/dist/assethandler/pages/AssetsAssetCheckInOutPage.js.map +1 -1
  11. package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
  12. package/dist/assethandler/pages/AssetsAssetDetailPage.js +338 -325
  13. package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
  14. package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
  15. package/dist/assethandler/pages/AssetsAssetListPage.js +177 -163
  16. package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
  17. package/dist/assethandler/pages/KnowledgeBasePage.d.ts.map +1 -1
  18. package/dist/assethandler/pages/KnowledgeBasePage.js +394 -287
  19. package/dist/assethandler/pages/KnowledgeBasePage.js.map +1 -1
  20. package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
  21. package/dist/assethandler/providers/AssetHandlerProvider.js +1 -0
  22. package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
  23. package/dist/assethandler/store/assethandlerStore.d.ts +2 -0
  24. package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
  25. package/dist/assethandler/store/assethandlerStore.js +1 -0
  26. package/dist/assethandler/store/assethandlerStore.js.map +1 -1
  27. package/dist/assethandler/utils/knowledgeBase.d.ts +17 -0
  28. package/dist/assethandler/utils/knowledgeBase.d.ts.map +1 -0
  29. package/dist/assethandler/utils/knowledgeBase.js +17 -0
  30. package/dist/assethandler/utils/knowledgeBase.js.map +1 -0
  31. package/dist/assethandler/utils/printAssetTag.d.ts +24 -0
  32. package/dist/assethandler/utils/printAssetTag.d.ts.map +1 -0
  33. package/dist/assethandler/utils/printAssetTag.js +124 -0
  34. package/dist/assethandler/utils/printAssetTag.js.map +1 -0
  35. package/dist/node_modules/dijkstrajs/dijkstra.js +61 -0
  36. package/dist/node_modules/dijkstrajs/dijkstra.js.map +1 -0
  37. package/dist/node_modules/qrcode/lib/browser.js +40 -0
  38. package/dist/node_modules/qrcode/lib/browser.js.map +1 -0
  39. package/dist/node_modules/qrcode/lib/can-promise.js +12 -0
  40. package/dist/node_modules/qrcode/lib/can-promise.js.map +1 -0
  41. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +21 -0
  42. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js.map +1 -0
  43. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +28 -0
  44. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js.map +1 -0
  45. package/dist/node_modules/qrcode/lib/core/bit-buffer.js +28 -0
  46. package/dist/node_modules/qrcode/lib/core/bit-buffer.js.map +1 -0
  47. package/dist/node_modules/qrcode/lib/core/bit-matrix.js +23 -0
  48. package/dist/node_modules/qrcode/lib/core/bit-matrix.js.map +1 -0
  49. package/dist/node_modules/qrcode/lib/core/byte-data.js +23 -0
  50. package/dist/node_modules/qrcode/lib/core/byte-data.js.map +1 -0
  51. package/dist/node_modules/qrcode/lib/core/error-correction-code.js +350 -0
  52. package/dist/node_modules/qrcode/lib/core/error-correction-code.js.map +1 -0
  53. package/dist/node_modules/qrcode/lib/core/error-correction-level.js +34 -0
  54. package/dist/node_modules/qrcode/lib/core/error-correction-level.js.map +1 -0
  55. package/dist/node_modules/qrcode/lib/core/finder-pattern.js +19 -0
  56. package/dist/node_modules/qrcode/lib/core/finder-pattern.js.map +1 -0
  57. package/dist/node_modules/qrcode/lib/core/format-info.js +16 -0
  58. package/dist/node_modules/qrcode/lib/core/format-info.js.map +1 -0
  59. package/dist/node_modules/qrcode/lib/core/galois-field.js +22 -0
  60. package/dist/node_modules/qrcode/lib/core/galois-field.js.map +1 -0
  61. package/dist/node_modules/qrcode/lib/core/kanji-data.js +31 -0
  62. package/dist/node_modules/qrcode/lib/core/kanji-data.js.map +1 -0
  63. package/dist/node_modules/qrcode/lib/core/mask-pattern.js +84 -0
  64. package/dist/node_modules/qrcode/lib/core/mask-pattern.js.map +1 -0
  65. package/dist/node_modules/qrcode/lib/core/mode.js +74 -0
  66. package/dist/node_modules/qrcode/lib/core/mode.js.map +1 -0
  67. package/dist/node_modules/qrcode/lib/core/numeric-data.js +26 -0
  68. package/dist/node_modules/qrcode/lib/core/numeric-data.js.map +1 -0
  69. package/dist/node_modules/qrcode/lib/core/polynomial.js +30 -0
  70. package/dist/node_modules/qrcode/lib/core/polynomial.js.map +1 -0
  71. package/dist/node_modules/qrcode/lib/core/qrcode.js +117 -0
  72. package/dist/node_modules/qrcode/lib/core/qrcode.js.map +1 -0
  73. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +27 -0
  74. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +1 -0
  75. package/dist/node_modules/qrcode/lib/core/regex.js +21 -0
  76. package/dist/node_modules/qrcode/lib/core/regex.js.map +1 -0
  77. package/dist/node_modules/qrcode/lib/core/segments.js +144 -0
  78. package/dist/node_modules/qrcode/lib/core/segments.js.map +1 -0
  79. package/dist/node_modules/qrcode/lib/core/utils.js +70 -0
  80. package/dist/node_modules/qrcode/lib/core/utils.js.map +1 -0
  81. package/dist/node_modules/qrcode/lib/core/version-check.js +12 -0
  82. package/dist/node_modules/qrcode/lib/core/version-check.js.map +1 -0
  83. package/dist/node_modules/qrcode/lib/core/version.js +60 -0
  84. package/dist/node_modules/qrcode/lib/core/version.js.map +1 -0
  85. package/dist/node_modules/qrcode/lib/renderer/canvas.js +32 -0
  86. package/dist/node_modules/qrcode/lib/renderer/canvas.js.map +1 -0
  87. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +31 -0
  88. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js.map +1 -0
  89. package/dist/node_modules/qrcode/lib/renderer/utils.js +55 -0
  90. package/dist/node_modules/qrcode/lib/renderer/utils.js.map +1 -0
  91. package/package.json +3 -1
@@ -0,0 +1,74 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_version_check as t } from "./version-check.js";
3
+ import { require_regex as n } from "./regex.js";
4
+ //#region node_modules/qrcode/lib/core/mode.js
5
+ var r = /* @__PURE__ */ e(((e) => {
6
+ var r = t(), i = n();
7
+ e.NUMERIC = {
8
+ id: "Numeric",
9
+ bit: 1,
10
+ ccBits: [
11
+ 10,
12
+ 12,
13
+ 14
14
+ ]
15
+ }, e.ALPHANUMERIC = {
16
+ id: "Alphanumeric",
17
+ bit: 2,
18
+ ccBits: [
19
+ 9,
20
+ 11,
21
+ 13
22
+ ]
23
+ }, e.BYTE = {
24
+ id: "Byte",
25
+ bit: 4,
26
+ ccBits: [
27
+ 8,
28
+ 16,
29
+ 16
30
+ ]
31
+ }, e.KANJI = {
32
+ id: "Kanji",
33
+ bit: 8,
34
+ ccBits: [
35
+ 8,
36
+ 10,
37
+ 12
38
+ ]
39
+ }, e.MIXED = { bit: -1 }, e.getCharCountIndicator = function(e, t) {
40
+ if (!e.ccBits) throw Error("Invalid mode: " + e);
41
+ if (!r.isValid(t)) throw Error("Invalid version: " + t);
42
+ return t >= 1 && t < 10 ? e.ccBits[0] : t < 27 ? e.ccBits[1] : e.ccBits[2];
43
+ }, e.getBestModeForData = function(t) {
44
+ return i.testNumeric(t) ? e.NUMERIC : i.testAlphanumeric(t) ? e.ALPHANUMERIC : i.testKanji(t) ? e.KANJI : e.BYTE;
45
+ }, e.toString = function(e) {
46
+ if (e && e.id) return e.id;
47
+ throw Error("Invalid mode");
48
+ }, e.isValid = function(e) {
49
+ return e && e.bit && e.ccBits;
50
+ };
51
+ function a(t) {
52
+ if (typeof t != "string") throw Error("Param is not a string");
53
+ switch (t.toLowerCase()) {
54
+ case "numeric": return e.NUMERIC;
55
+ case "alphanumeric": return e.ALPHANUMERIC;
56
+ case "kanji": return e.KANJI;
57
+ case "byte": return e.BYTE;
58
+ default: throw Error("Unknown mode: " + t);
59
+ }
60
+ }
61
+ e.from = function(t, n) {
62
+ if (e.isValid(t)) return t;
63
+ try {
64
+ return a(t);
65
+ } catch {
66
+ return n;
67
+ }
68
+ };
69
+ }));
70
+ //#endregion
71
+ export default r();
72
+ export { r as require_mode };
73
+
74
+ //# sourceMappingURL=mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/mode.js"],"sourcesContent":["const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n id: 'Numeric',\n bit: 1 << 0,\n ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n * 26 alphabetic characters (A - Z),\n * and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n id: 'Alphanumeric',\n bit: 1 << 1,\n ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n id: 'Byte',\n bit: 1 << 2,\n ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n id: 'Kanji',\n bit: 1 << 3,\n ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param {Mode} mode Data mode\n * @param {Number} version QR Code version\n * @return {Number} Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid version: ' + version)\n }\n\n if (version >= 1 && version < 10) return mode.ccBits[0]\n else if (version < 27) return mode.ccBits[1]\n return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param {String} dataStr Input data string\n * @return {Mode} Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n else if (Regex.testKanji(dataStr)) return exports.KANJI\n else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String} Mode name\n */\nexports.toString = function toString (mode) {\n if (mode && mode.id) return mode.id\n throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param {Mode} mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param {String} string Mode name\n * @returns {Mode} Mode object\n */\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'numeric':\n return exports.NUMERIC\n case 'alphanumeric':\n return exports.ALPHANUMERIC\n case 'kanji':\n return exports.KANJI\n case 'byte':\n return exports.BYTE\n default:\n throw new Error('Unknown mode: ' + string)\n }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param {Mode|String} value Encoding mode\n * @param {Mode} defaultValue Fallback value\n * @return {Mode} Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAAA,IAAM,IAAA,GAAA,EACA,IAAA,GAAA;AAoHN,CA3GA,EAAQ,UAAU;EAChB,IAAI;EACJ,KAAK;EACL,QAAQ;GAAC;GAAI;GAAI;GAAG;EACrB,EAWD,EAAQ,eAAe;EACrB,IAAI;EACJ,KAAK;EACL,QAAQ;GAAC;GAAG;GAAI;GAAG;EACpB,EAOD,EAAQ,OAAO;EACb,IAAI;EACJ,KAAK;EACL,QAAQ;GAAC;GAAG;GAAI;GAAG;EACpB,EAWD,EAAQ,QAAQ;EACd,IAAI;EACJ,KAAK;EACL,QAAQ;GAAC;GAAG;GAAI;GAAG;EACpB,EAQD,EAAQ,QAAQ,EACd,KAAK,IACN,EAUD,EAAQ,wBAAwB,SAAgC,GAAM,GAAS;AAC7E,MAAI,CAAC,EAAK,OAAQ,OAAU,MAAM,mBAAmB,EAAK;AAE1D,MAAI,CAAC,EAAa,QAAQ,EAAQ,CAChC,OAAU,MAAM,sBAAsB,EAAQ;AAKhD,SAFI,KAAW,KAAK,IAAU,KAAW,EAAK,OAAO,KAC5C,IAAU,KAAW,EAAK,OAAO,KACnC,EAAK,OAAO;IASrB,EAAQ,qBAAqB,SAA6B,GAAS;AAI5D,SAHD,EAAM,YAAY,EAAQ,GAAS,EAAQ,UACtC,EAAM,iBAAiB,EAAQ,GAAS,EAAQ,eAChD,EAAM,UAAU,EAAQ,GAAS,EAAQ,QACtC,EAAQ;IAStB,EAAQ,WAAW,SAAmB,GAAM;AAC1C,MAAI,KAAQ,EAAK,GAAI,QAAO,EAAK;AACjC,QAAU,MAAM,eAAe;IASjC,EAAQ,UAAU,SAAkB,GAAM;AACxC,SAAO,KAAQ,EAAK,OAAO,EAAK;;CASlC,SAAS,EAAY,GAAQ;AAC3B,MAAI,OAAO,KAAW,SACpB,OAAU,MAAM,wBAAwB;AAK1C,UAFc,EAAO,aAAa,EAElC;GACE,KAAK,UACH,QAAO,EAAQ;GACjB,KAAK,eACH,QAAO,EAAQ;GACjB,KAAK,QACH,QAAO,EAAQ;GACjB,KAAK,OACH,QAAO,EAAQ;GACjB,QACE,OAAU,MAAM,mBAAmB,EAAO;;;AAYhD,GAAQ,OAAO,SAAe,GAAO,GAAc;AACjD,MAAI,EAAQ,QAAQ,EAAM,CACxB,QAAO;AAGT,MAAI;AACF,UAAO,EAAW,EAAM;UACd;AACV,UAAO"}
@@ -0,0 +1,26 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_mode as t } from "./mode.js";
3
+ //#region node_modules/qrcode/lib/core/numeric-data.js
4
+ var n = /* @__PURE__ */ e(((e, n) => {
5
+ var r = t();
6
+ function i(e) {
7
+ this.mode = r.NUMERIC, this.data = e.toString();
8
+ }
9
+ i.getBitsLength = function(e) {
10
+ return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
11
+ }, i.prototype.getLength = function() {
12
+ return this.data.length;
13
+ }, i.prototype.getBitsLength = function() {
14
+ return i.getBitsLength(this.data.length);
15
+ }, i.prototype.write = function(e) {
16
+ let t, n, r;
17
+ for (t = 0; t + 3 <= this.data.length; t += 3) n = this.data.substr(t, 3), r = parseInt(n, 10), e.put(r, 10);
18
+ let i = this.data.length - t;
19
+ i > 0 && (n = this.data.substr(t), r = parseInt(n, 10), e.put(r, i * 3 + 1));
20
+ }, n.exports = i;
21
+ }));
22
+ //#endregion
23
+ export default n();
24
+ export { n as require_numeric_data };
25
+
26
+ //# sourceMappingURL=numeric-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-data.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/numeric-data.js"],"sourcesContent":["const Mode = require('./mode')\n\nfunction NumericData (data) {\n this.mode = Mode.NUMERIC\n this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n let i, group, value\n\n // The input data string is divided into groups of three digits,\n // and each group is converted to its 10-bit binary equivalent.\n for (i = 0; i + 3 <= this.data.length; i += 3) {\n group = this.data.substr(i, 3)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, 10)\n }\n\n // If the number of input digits is not an exact multiple of three,\n // the final one or two digits are converted to 4 or 7 bits respectively.\n const remainingNum = this.data.length - i\n if (remainingNum > 0) {\n group = this.data.substr(i)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, remainingNum * 3 + 1)\n }\n}\n\nmodule.exports = NumericData\n"],"x_google_ignoreList":[0],"mappings":";;;;CAAA,IAAM,IAAA,GAAA;CAEN,SAAS,EAAa,GAAM;AAE1B,EADA,KAAK,OAAO,EAAK,SACjB,KAAK,OAAO,EAAK,UAAU;;AAsC7B,CAnCA,EAAY,gBAAgB,SAAwB,GAAQ;AAC1D,SAAO,KAAK,KAAK,MAAM,IAAS,EAAE,IAAK,IAAS,IAAO,IAAS,IAAK,IAAI,IAAK;IAGhF,EAAY,UAAU,YAAY,WAAsB;AACtD,SAAO,KAAK,KAAK;IAGnB,EAAY,UAAU,gBAAgB,WAA0B;AAC9D,SAAO,EAAY,cAAc,KAAK,KAAK,OAAO;IAGpD,EAAY,UAAU,QAAQ,SAAgB,GAAW;EACvD,IAAI,GAAG,GAAO;AAId,OAAK,IAAI,GAAG,IAAI,KAAK,KAAK,KAAK,QAAQ,KAAK,EAI1C,CAHA,IAAQ,KAAK,KAAK,OAAO,GAAG,EAAE,EAC9B,IAAQ,SAAS,GAAO,GAAG,EAE3B,EAAU,IAAI,GAAO,GAAG;EAK1B,IAAM,IAAe,KAAK,KAAK,SAAS;AACxC,EAAI,IAAe,MACjB,IAAQ,KAAK,KAAK,OAAO,EAAE,EAC3B,IAAQ,SAAS,GAAO,GAAG,EAE3B,EAAU,IAAI,GAAO,IAAe,IAAI,EAAE;IAI9C,EAAO,UAAU"}
@@ -0,0 +1,30 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_galois_field as t } from "./galois-field.js";
3
+ //#region node_modules/qrcode/lib/core/polynomial.js
4
+ var n = /* @__PURE__ */ e(((e) => {
5
+ var n = t();
6
+ e.mul = function(e, t) {
7
+ let r = new Uint8Array(e.length + t.length - 1);
8
+ for (let i = 0; i < e.length; i++) for (let a = 0; a < t.length; a++) r[i + a] ^= n.mul(e[i], t[a]);
9
+ return r;
10
+ }, e.mod = function(e, t) {
11
+ let r = new Uint8Array(e);
12
+ for (; r.length - t.length >= 0;) {
13
+ let e = r[0];
14
+ for (let i = 0; i < t.length; i++) r[i] ^= n.mul(t[i], e);
15
+ let i = 0;
16
+ for (; i < r.length && r[i] === 0;) i++;
17
+ r = r.slice(i);
18
+ }
19
+ return r;
20
+ }, e.generateECPolynomial = function(t) {
21
+ let r = new Uint8Array([1]);
22
+ for (let i = 0; i < t; i++) r = e.mul(r, new Uint8Array([1, n.exp(i)]));
23
+ return r;
24
+ };
25
+ }));
26
+ //#endregion
27
+ export default n();
28
+ export { n as require_polynomial };
29
+
30
+ //# sourceMappingURL=polynomial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polynomial.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/polynomial.js"],"sourcesContent":["const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param {Uint8Array} p1 Polynomial\n * @param {Uint8Array} p2 Polynomial\n * @return {Uint8Array} Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n for (let i = 0; i < p1.length; i++) {\n for (let j = 0; j < p2.length; j++) {\n coeff[i + j] ^= GF.mul(p1[i], p2[j])\n }\n }\n\n return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param {Uint8Array} divident Polynomial\n * @param {Uint8Array} divisor Polynomial\n * @return {Uint8Array} Remainder\n */\nexports.mod = function mod (divident, divisor) {\n let result = new Uint8Array(divident)\n\n while ((result.length - divisor.length) >= 0) {\n const coeff = result[0]\n\n for (let i = 0; i < divisor.length; i++) {\n result[i] ^= GF.mul(divisor[i], coeff)\n }\n\n // remove all zeros from buffer head\n let offset = 0\n while (offset < result.length && result[offset] === 0) offset++\n result = result.slice(offset)\n }\n\n return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param {Number} degree Degree of the generator polynomial\n * @return {Uint8Array} Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n let poly = new Uint8Array([1])\n for (let i = 0; i < degree; i++) {\n poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n }\n\n return poly\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;CAAA,IAAM,IAAA,GAAA;AAsDN,CA7CA,EAAQ,MAAM,SAAc,GAAI,GAAI;EAClC,IAAM,IAAQ,IAAI,WAAW,EAAG,SAAS,EAAG,SAAS,EAAE;AAEvD,OAAK,IAAI,IAAI,GAAG,IAAI,EAAG,QAAQ,IAC7B,MAAK,IAAI,IAAI,GAAG,IAAI,EAAG,QAAQ,IAC7B,GAAM,IAAI,MAAM,EAAG,IAAI,EAAG,IAAI,EAAG,GAAG;AAIxC,SAAO;IAUT,EAAQ,MAAM,SAAc,GAAU,GAAS;EAC7C,IAAI,IAAS,IAAI,WAAW,EAAS;AAErC,SAAQ,EAAO,SAAS,EAAQ,UAAW,IAAG;GAC5C,IAAM,IAAQ,EAAO;AAErB,QAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,IAClC,GAAO,MAAM,EAAG,IAAI,EAAQ,IAAI,EAAM;GAIxC,IAAI,IAAS;AACb,UAAO,IAAS,EAAO,UAAU,EAAO,OAAY,GAAG;AACvD,OAAS,EAAO,MAAM,EAAO;;AAG/B,SAAO;IAUT,EAAQ,uBAAuB,SAA+B,GAAQ;EACpE,IAAI,IAAO,IAAI,WAAW,CAAC,EAAE,CAAC;AAC9B,OAAK,IAAI,IAAI,GAAG,IAAI,GAAQ,IAC1B,KAAO,EAAQ,IAAI,GAAM,IAAI,WAAW,CAAC,GAAG,EAAG,IAAI,EAAE,CAAC,CAAC,CAAC;AAG1D,SAAO"}
@@ -0,0 +1,117 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_utils as t } from "./utils.js";
3
+ import { require_error_correction_level as n } from "./error-correction-level.js";
4
+ import { require_bit_buffer as r } from "./bit-buffer.js";
5
+ import { require_bit_matrix as i } from "./bit-matrix.js";
6
+ import { require_alignment_pattern as a } from "./alignment-pattern.js";
7
+ import { require_finder_pattern as o } from "./finder-pattern.js";
8
+ import { require_mask_pattern as s } from "./mask-pattern.js";
9
+ import { require_error_correction_code as c } from "./error-correction-code.js";
10
+ import { require_reed_solomon_encoder as l } from "./reed-solomon-encoder.js";
11
+ import { require_mode as u } from "./mode.js";
12
+ import { require_version as d } from "./version.js";
13
+ import { require_format_info as f } from "./format-info.js";
14
+ import { require_segments as p } from "./segments.js";
15
+ //#region node_modules/qrcode/lib/core/qrcode.js
16
+ var m = /* @__PURE__ */ e(((e) => {
17
+ var m = t(), h = n(), g = r(), _ = i(), v = a(), y = o(), b = s(), x = c(), S = l(), C = d(), w = f(), T = u(), E = p();
18
+ function D(e, t) {
19
+ let n = e.size, r = y.getPositions(t);
20
+ for (let t = 0; t < r.length; t++) {
21
+ let i = r[t][0], a = r[t][1];
22
+ for (let t = -1; t <= 7; t++) if (!(i + t <= -1 || n <= i + t)) for (let r = -1; r <= 7; r++) a + r <= -1 || n <= a + r || (t >= 0 && t <= 6 && (r === 0 || r === 6) || r >= 0 && r <= 6 && (t === 0 || t === 6) || t >= 2 && t <= 4 && r >= 2 && r <= 4 ? e.set(i + t, a + r, !0, !0) : e.set(i + t, a + r, !1, !0));
23
+ }
24
+ }
25
+ function O(e) {
26
+ let t = e.size;
27
+ for (let n = 8; n < t - 8; n++) {
28
+ let t = n % 2 == 0;
29
+ e.set(n, 6, t, !0), e.set(6, n, t, !0);
30
+ }
31
+ }
32
+ function k(e, t) {
33
+ let n = v.getPositions(t);
34
+ for (let t = 0; t < n.length; t++) {
35
+ let r = n[t][0], i = n[t][1];
36
+ for (let t = -2; t <= 2; t++) for (let n = -2; n <= 2; n++) t === -2 || t === 2 || n === -2 || n === 2 || t === 0 && n === 0 ? e.set(r + t, i + n, !0, !0) : e.set(r + t, i + n, !1, !0);
37
+ }
38
+ }
39
+ function A(e, t) {
40
+ let n = e.size, r = C.getEncodedBits(t), i, a, o;
41
+ for (let t = 0; t < 18; t++) i = Math.floor(t / 3), a = t % 3 + n - 8 - 3, o = (r >> t & 1) == 1, e.set(i, a, o, !0), e.set(a, i, o, !0);
42
+ }
43
+ function j(e, t, n) {
44
+ let r = e.size, i = w.getEncodedBits(t, n), a, o;
45
+ for (a = 0; a < 15; a++) o = (i >> a & 1) == 1, a < 6 ? e.set(a, 8, o, !0) : a < 8 ? e.set(a + 1, 8, o, !0) : e.set(r - 15 + a, 8, o, !0), a < 8 ? e.set(8, r - a - 1, o, !0) : a < 9 ? e.set(8, 15 - a - 1 + 1, o, !0) : e.set(8, 15 - a - 1, o, !0);
46
+ e.set(r - 8, 8, 1, !0);
47
+ }
48
+ function M(e, t) {
49
+ let n = e.size, r = -1, i = n - 1, a = 7, o = 0;
50
+ for (let s = n - 1; s > 0; s -= 2) for (s === 6 && s--;;) {
51
+ for (let n = 0; n < 2; n++) if (!e.isReserved(i, s - n)) {
52
+ let r = !1;
53
+ o < t.length && (r = (t[o] >>> a & 1) == 1), e.set(i, s - n, r), a--, a === -1 && (o++, a = 7);
54
+ }
55
+ if (i += r, i < 0 || n <= i) {
56
+ i -= r, r = -r;
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ function N(e, t, n) {
62
+ let r = new g();
63
+ n.forEach(function(t) {
64
+ r.put(t.mode.bit, 4), r.put(t.getLength(), T.getCharCountIndicator(t.mode, e)), t.write(r);
65
+ });
66
+ let i = (m.getSymbolTotalCodewords(e) - x.getTotalCodewordsCount(e, t)) * 8;
67
+ for (r.getLengthInBits() + 4 <= i && r.put(0, 4); r.getLengthInBits() % 8 != 0;) r.putBit(0);
68
+ let a = (i - r.getLengthInBits()) / 8;
69
+ for (let e = 0; e < a; e++) r.put(e % 2 ? 17 : 236, 8);
70
+ return P(r, e, t);
71
+ }
72
+ function P(e, t, n) {
73
+ let r = m.getSymbolTotalCodewords(t), i = r - x.getTotalCodewordsCount(t, n), a = x.getBlocksCount(t, n), o = a - r % a, s = Math.floor(r / a), c = Math.floor(i / a), l = c + 1, u = s - c, d = new S(u), f = 0, p = Array(a), h = Array(a), g = 0, _ = new Uint8Array(e.buffer);
74
+ for (let e = 0; e < a; e++) {
75
+ let t = e < o ? c : l;
76
+ p[e] = _.slice(f, f + t), h[e] = d.encode(p[e]), f += t, g = Math.max(g, t);
77
+ }
78
+ let v = new Uint8Array(r), y = 0, b, C;
79
+ for (b = 0; b < g; b++) for (C = 0; C < a; C++) b < p[C].length && (v[y++] = p[C][b]);
80
+ for (b = 0; b < u; b++) for (C = 0; C < a; C++) v[y++] = h[C][b];
81
+ return v;
82
+ }
83
+ function F(e, t, n, r) {
84
+ let i;
85
+ if (Array.isArray(e)) i = E.fromArray(e);
86
+ else if (typeof e == "string") {
87
+ let r = t;
88
+ if (!r) {
89
+ let t = E.rawSplit(e);
90
+ r = C.getBestVersionForData(t, n);
91
+ }
92
+ i = E.fromString(e, r || 40);
93
+ } else throw Error("Invalid data");
94
+ let a = C.getBestVersionForData(i, n);
95
+ if (!a) throw Error("The amount of data is too big to be stored in a QR Code");
96
+ if (!t) t = a;
97
+ else if (t < a) throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + a + ".\n");
98
+ let o = N(t, n, i), s = new _(m.getSymbolSize(t));
99
+ return D(s, t), O(s), k(s, t), j(s, n, 0), t >= 7 && A(s, t), M(s, o), isNaN(r) && (r = b.getBestMask(s, j.bind(null, s, n))), b.applyMask(r, s), j(s, n, r), {
100
+ modules: s,
101
+ version: t,
102
+ errorCorrectionLevel: n,
103
+ maskPattern: r,
104
+ segments: i
105
+ };
106
+ }
107
+ e.create = function(e, t) {
108
+ if (e === void 0 || e === "") throw Error("No input text");
109
+ let n = h.M, r, i;
110
+ return t !== void 0 && (n = h.from(t.errorCorrectionLevel, h.M), r = C.from(t.version), i = b.from(t.maskPattern), t.toSJISFunc && m.setToSJISFunction(t.toSJISFunc)), F(e, r, n, i);
111
+ };
112
+ }));
113
+ //#endregion
114
+ export default m();
115
+ export { m as require_qrcode };
116
+
117
+ //# sourceMappingURL=qrcode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrcode.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/qrcode.js"],"sourcesContent":["const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n// http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n const size = matrix.size\n const pos = FinderPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -1; r <= 7; r++) {\n if (row + r <= -1 || size <= row + r) continue\n\n for (let c = -1; c <= 7; c++) {\n if (col + c <= -1 || size <= col + c) continue\n\n if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n const size = matrix.size\n\n for (let r = 8; r < size - 8; r++) {\n const value = r % 2 === 0\n matrix.set(r, 6, value, true)\n matrix.set(6, r, value, true)\n }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n const pos = AlignmentPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -2; r <= 2; r++) {\n for (let c = -2; c <= 2; c++) {\n if (r === -2 || r === 2 || c === -2 || c === 2 ||\n (r === 0 && c === 0)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n const size = matrix.size\n const bits = Version.getEncodedBits(version)\n let row, col, mod\n\n for (let i = 0; i < 18; i++) {\n row = Math.floor(i / 3)\n col = i % 3 + size - 8 - 3\n mod = ((bits >> i) & 1) === 1\n\n matrix.set(row, col, mod, true)\n matrix.set(col, row, mod, true)\n }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {Number} maskPattern Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n const size = matrix.size\n const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n let i, mod\n\n for (i = 0; i < 15; i++) {\n mod = ((bits >> i) & 1) === 1\n\n // vertical\n if (i < 6) {\n matrix.set(i, 8, mod, true)\n } else if (i < 8) {\n matrix.set(i + 1, 8, mod, true)\n } else {\n matrix.set(size - 15 + i, 8, mod, true)\n }\n\n // horizontal\n if (i < 8) {\n matrix.set(8, size - i - 1, mod, true)\n } else if (i < 9) {\n matrix.set(8, 15 - i - 1 + 1, mod, true)\n } else {\n matrix.set(8, 15 - i - 1, mod, true)\n }\n }\n\n // fixed module\n matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Uint8Array} data Data codewords\n */\nfunction setupData (matrix, data) {\n const size = matrix.size\n let inc = -1\n let row = size - 1\n let bitIndex = 7\n let byteIndex = 0\n\n for (let col = size - 1; col > 0; col -= 2) {\n if (col === 6) col--\n\n while (true) {\n for (let c = 0; c < 2; c++) {\n if (!matrix.isReserved(row, col - c)) {\n let dark = false\n\n if (byteIndex < data.length) {\n dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n }\n\n matrix.set(row, col - c, dark)\n bitIndex--\n\n if (bitIndex === -1) {\n byteIndex++\n bitIndex = 7\n }\n }\n }\n\n row += inc\n\n if (row < 0 || size <= row) {\n row -= inc\n inc = -inc\n break\n }\n }\n }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {ByteData} data Data input\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n // Prepare data buffer\n const buffer = new BitBuffer()\n\n segments.forEach(function (data) {\n // prefix data with mode indicator (4 bits)\n buffer.put(data.mode.bit, 4)\n\n // Prefix data with character count indicator.\n // The character count indicator is a string of bits that represents the\n // number of characters that are being encoded.\n // The character count indicator must be placed after the mode indicator\n // and must be a certain number of bits long, depending on the QR version\n // and data mode\n // @see {@link Mode.getCharCountIndicator}.\n buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n // add binary data sequence to buffer\n data.write(buffer)\n })\n\n // Calculate required number of bits\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n // Add a terminator.\n // If the bit string is shorter than the total number of required bits,\n // a terminator of up to four 0s must be added to the right side of the string.\n // If the bit string is more than four bits shorter than the required number of bits,\n // add four 0s to the end.\n if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n buffer.put(0, 4)\n }\n\n // If the bit string is fewer than four bits shorter, add only the number of 0s that\n // are needed to reach the required number of bits.\n\n // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n // pad the string on the right with 0s to make the string's length a multiple of 8.\n while (buffer.getLengthInBits() % 8 !== 0) {\n buffer.putBit(0)\n }\n\n // Add pad bytes if the string is still shorter than the total number of required bits.\n // Extend the buffer to fill the data capacity of the symbol corresponding to\n // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n // and 00010001 (0x11) alternately.\n const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n for (let i = 0; i < remainingByte; i++) {\n buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n }\n\n return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param {BitBuffer} bitBuffer Data to encode\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n // Total number of blocks\n const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n // Calculate how many blocks each group should contain\n const blocksInGroup2 = totalCodewords % ecTotalBlocks\n const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n // Number of EC codewords is the same for both groups\n const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n const rs = new ReedSolomonEncoder(ecCount)\n\n let offset = 0\n const dcData = new Array(ecTotalBlocks)\n const ecData = new Array(ecTotalBlocks)\n let maxDataSize = 0\n const buffer = new Uint8Array(bitBuffer.buffer)\n\n // Divide the buffer into the required number of blocks\n for (let b = 0; b < ecTotalBlocks; b++) {\n const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n // extract a block of data from buffer\n dcData[b] = buffer.slice(offset, offset + dataSize)\n\n // Calculate EC codewords for this data block\n ecData[b] = rs.encode(dcData[b])\n\n offset += dataSize\n maxDataSize = Math.max(maxDataSize, dataSize)\n }\n\n // Create final data\n // Interleave the data and error correction codewords from each block\n const data = new Uint8Array(totalCodewords)\n let index = 0\n let i, r\n\n // Add data codewords\n for (i = 0; i < maxDataSize; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n if (i < dcData[r].length) {\n data[index++] = dcData[r][i]\n }\n }\n }\n\n // Apped EC codewords\n for (i = 0; i < ecCount; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n data[index++] = ecData[r][i]\n }\n }\n\n return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @param {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param {MaskPattern} maskPattern Mask pattern\n * @return {Object} Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n let segments\n\n if (Array.isArray(data)) {\n segments = Segments.fromArray(data)\n } else if (typeof data === 'string') {\n let estimatedVersion = version\n\n if (!estimatedVersion) {\n const rawSegments = Segments.rawSplit(data)\n\n // Estimate best version that can contain raw splitted segments\n estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n }\n\n // Build optimized segments\n // If estimated version is undefined, try with the highest version\n segments = Segments.fromString(data, estimatedVersion || 40)\n } else {\n throw new Error('Invalid data')\n }\n\n // Get the min version that can contain data\n const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n // If no version is found, data cannot be stored\n if (!bestVersion) {\n throw new Error('The amount of data is too big to be stored in a QR Code')\n }\n\n // If not specified, use min version as default\n if (!version) {\n version = bestVersion\n\n // Check if the specified version can contain the data\n } else if (version < bestVersion) {\n throw new Error('\\n' +\n 'The chosen QR Code version cannot contain this amount of data.\\n' +\n 'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n )\n }\n\n const dataBits = createData(version, errorCorrectionLevel, segments)\n\n // Allocate matrix buffer\n const moduleCount = Utils.getSymbolSize(version)\n const modules = new BitMatrix(moduleCount)\n\n // Add function modules\n setupFinderPattern(modules, version)\n setupTimingPattern(modules)\n setupAlignmentPattern(modules, version)\n\n // Add temporary dummy bits for format info just to set them as reserved.\n // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n // since the masking operation must be performed only on the encoding region.\n // These blocks will be replaced with correct values later in code.\n setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n if (version >= 7) {\n setupVersionInfo(modules, version)\n }\n\n // Add data codewords\n setupData(modules, dataBits)\n\n if (isNaN(maskPattern)) {\n // Find best mask pattern\n maskPattern = MaskPattern.getBestMask(modules,\n setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n }\n\n // Apply mask pattern\n MaskPattern.applyMask(maskPattern, modules)\n\n // Replace format info bits with correct values\n setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n return {\n modules: modules,\n version: version,\n errorCorrectionLevel: errorCorrectionLevel,\n maskPattern: maskPattern,\n segments: segments\n }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data Input data\n * @param {Object} options Optional configurations\n * @param {Number} options.version QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n if (typeof data === 'undefined' || data === '') {\n throw new Error('No input text')\n }\n\n let errorCorrectionLevel = ECLevel.M\n let version\n let mask\n\n if (typeof options !== 'undefined') {\n // Use higher error correction level as default\n errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n version = Version.from(options.version)\n mask = MaskPattern.from(options.maskPattern)\n\n if (options.toSJISFunc) {\n Utils.setToSJISFunction(options.toSJISFunc)\n }\n }\n\n return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;CAAA,IAAM,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA;CAkCN,SAAS,EAAoB,GAAQ,GAAS;EAC5C,IAAM,IAAO,EAAO,MACd,IAAM,EAAc,aAAa,EAAQ;AAE/C,OAAK,IAAI,IAAI,GAAG,IAAI,EAAI,QAAQ,KAAK;GACnC,IAAM,IAAM,EAAI,GAAG,IACb,IAAM,EAAI,GAAG;AAEnB,QAAK,IAAI,IAAI,IAAI,KAAK,GAAG,IACnB,WAAM,KAAK,MAAM,KAAQ,IAAM,GAEnC,MAAK,IAAI,IAAI,IAAI,KAAK,GAAG,IACnB,KAAM,KAAK,MAAM,KAAQ,IAAM,MAE9B,KAAK,KAAK,KAAK,MAAM,MAAM,KAAK,MAAM,MACxC,KAAK,KAAK,KAAK,MAAM,MAAM,KAAK,MAAM,MACtC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IACpC,EAAO,IAAI,IAAM,GAAG,IAAM,GAAG,IAAM,GAAK,GAExC,EAAO,IAAI,IAAM,GAAG,IAAM,GAAG,IAAO,GAAK;;;CAcnD,SAAS,EAAoB,GAAQ;EACnC,IAAM,IAAO,EAAO;AAEpB,OAAK,IAAI,IAAI,GAAG,IAAI,IAAO,GAAG,KAAK;GACjC,IAAM,IAAQ,IAAI,KAAM;AAExB,GADA,EAAO,IAAI,GAAG,GAAG,GAAO,G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,cACV,EAAM,kBAAkB,EAAQ,WAAW,GAIxC,EAAa,GAAM,GAAS,GAAsB,EAAK"}
@@ -0,0 +1,27 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_polynomial as t } from "./polynomial.js";
3
+ //#region node_modules/qrcode/lib/core/reed-solomon-encoder.js
4
+ var n = /* @__PURE__ */ e(((e, n) => {
5
+ var r = t();
6
+ function i(e) {
7
+ this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
8
+ }
9
+ i.prototype.initialize = function(e) {
10
+ this.degree = e, this.genPoly = r.generateECPolynomial(this.degree);
11
+ }, i.prototype.encode = function(e) {
12
+ if (!this.genPoly) throw Error("Encoder not initialized");
13
+ let t = new Uint8Array(e.length + this.degree);
14
+ t.set(e);
15
+ let n = r.mod(t, this.genPoly), i = this.degree - n.length;
16
+ if (i > 0) {
17
+ let e = new Uint8Array(this.degree);
18
+ return e.set(n, i), e;
19
+ }
20
+ return n;
21
+ }, n.exports = i;
22
+ }));
23
+ //#endregion
24
+ export default n();
25
+ export { n as require_reed_solomon_encoder };
26
+
27
+ //# sourceMappingURL=reed-solomon-encoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reed-solomon-encoder.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/reed-solomon-encoder.js"],"sourcesContent":["const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n this.genPoly = undefined\n this.degree = degree\n\n if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n // create an irreducible generator polynomial\n this.degree = degree\n this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param {Uint8Array} data Buffer containing input data\n * @return {Uint8Array} Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n if (!this.genPoly) {\n throw new Error('Encoder not initialized')\n }\n\n // Calculate EC for this data block\n // extends data size to data+genPoly size\n const paddedData = new Uint8Array(data.length + this.degree)\n paddedData.set(data)\n\n // The error correction codewords are the remainder after dividing the data codewords\n // by a generator polynomial\n const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n // return EC data blocks (last n byte, where n is the degree of genPoly)\n // If coefficients number in remainder are less than genPoly degree,\n // pad with 0s to the left to reach the needed number of coefficients\n const start = this.degree - remainder.length\n if (start > 0) {\n const buff = new Uint8Array(this.degree)\n buff.set(remainder, start)\n\n return buff\n }\n\n return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n"],"x_google_ignoreList":[0],"mappings":";;;;CAAA,IAAM,IAAA,GAAA;CAEN,SAAS,EAAoB,GAAQ;AAInC,EAHA,KAAK,UAAU,KAAA,GACf,KAAK,SAAS,GAEV,KAAK,UAAQ,KAAK,WAAW,KAAK,OAAO;;AAiD/C,CAxCA,EAAmB,UAAU,aAAa,SAAqB,GAAQ;AAGrE,EADA,KAAK,SAAS,GACd,KAAK,UAAU,EAAW,qBAAqB,KAAK,OAAO;IAS7D,EAAmB,UAAU,SAAS,SAAiB,GAAM;AAC3D,MAAI,CAAC,KAAK,QACR,OAAU,MAAM,0BAA0B;EAK5C,IAAM,IAAa,IAAI,WAAW,EAAK,SAAS,KAAK,OAAO;AAC5D,IAAW,IAAI,EAAK;EAIpB,IAAM,IAAY,EAAW,IAAI,GAAY,KAAK,QAAQ,EAKpD,IAAQ,KAAK,SAAS,EAAU;AACtC,MAAI,IAAQ,GAAG;GACb,IAAM,IAAO,IAAI,WAAW,KAAK,OAAO;AAGxC,UAFA,EAAK,IAAI,GAAW,EAAM,EAEnB;;AAGT,SAAO;IAGT,EAAO,UAAU"}
@@ -0,0 +1,21 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ //#region node_modules/qrcode/lib/core/regex.js
3
+ var t = /* @__PURE__ */ e(((e) => {
4
+ var t = "[0-9]+", n = "[A-Z $%*+\\-./:]+", r = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
5
+ r = r.replace(/u/g, "\\u");
6
+ var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + r + ")(?:.|[\r\n]))+";
7
+ e.KANJI = new RegExp(r, "g"), e.BYTE_KANJI = /* @__PURE__ */ RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), e.BYTE = new RegExp(i, "g"), e.NUMERIC = new RegExp(t, "g"), e.ALPHANUMERIC = new RegExp(n, "g");
8
+ var a = RegExp("^" + r + "$"), o = RegExp("^" + t + "$"), s = /* @__PURE__ */ RegExp("^[A-Z0-9 $%*+\\-./:]+$");
9
+ e.testKanji = function(e) {
10
+ return a.test(e);
11
+ }, e.testNumeric = function(e) {
12
+ return o.test(e);
13
+ }, e.testAlphanumeric = function(e) {
14
+ return s.test(e);
15
+ };
16
+ }));
17
+ //#endregion
18
+ export default t();
19
+ export { t as require_regex };
20
+
21
+ //# sourceMappingURL=regex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/regex.js"],"sourcesContent":["const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n return TEST_ALPHANUMERIC.test(str)\n}\n"],"x_google_ignoreList":[0],"mappings":";;;CAAA,IAAM,IAAU,UACV,IAAe,qBACjB,IAAQ;AAIZ,KAAQ,EAAM,QAAQ,MAAM,MAAM;CAElC,IAAM,IAAO,+BAA+B,IAAQ;AAMpD,CAJA,EAAQ,QAAQ,IAAI,OAAO,GAAO,IAAI,EACtC,EAAQ,aAAa,gBAAI,OAAO,yBAAyB,IAAI,EAC7D,EAAQ,OAAO,IAAI,OAAO,GAAM,IAAI,EACpC,EAAQ,UAAU,IAAI,OAAO,GAAS,IAAI,EAC1C,EAAQ,eAAe,IAAI,OAAO,GAAc,IAAI;CAEpD,IAAM,IAAiB,OAAO,MAAM,IAAQ,IAAI,EAC1C,IAAmB,OAAO,MAAM,IAAU,IAAI,EAC9C,IAAoB,gBAAI,OAAO,yBAAyB;AAU9D,CARA,EAAQ,YAAY,SAAoB,GAAK;AAC3C,SAAO,EAAW,KAAK,EAAI;IAG7B,EAAQ,cAAc,SAAsB,GAAK;AAC/C,SAAO,EAAa,KAAK,EAAI;IAG/B,EAAQ,mBAAmB,SAA2B,GAAK;AACzD,SAAO,EAAkB,KAAK,EAAI"}
@@ -0,0 +1,144 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_utils as t } from "./utils.js";
3
+ import { require_regex as n } from "./regex.js";
4
+ import { require_mode as r } from "./mode.js";
5
+ import { require_numeric_data as i } from "./numeric-data.js";
6
+ import { require_alphanumeric_data as a } from "./alphanumeric-data.js";
7
+ import { require_byte_data as o } from "./byte-data.js";
8
+ import { require_kanji_data as s } from "./kanji-data.js";
9
+ import { require_dijkstra as c } from "../../../dijkstrajs/dijkstra.js";
10
+ //#region node_modules/qrcode/lib/core/segments.js
11
+ var l = /* @__PURE__ */ e(((e) => {
12
+ var l = r(), u = i(), d = a(), f = o(), p = s(), m = n(), h = t(), g = c();
13
+ function _(e) {
14
+ return unescape(encodeURIComponent(e)).length;
15
+ }
16
+ function v(e, t, n) {
17
+ let r = [], i;
18
+ for (; (i = e.exec(n)) !== null;) r.push({
19
+ data: i[0],
20
+ index: i.index,
21
+ mode: t,
22
+ length: i[0].length
23
+ });
24
+ return r;
25
+ }
26
+ function y(e) {
27
+ let t = v(m.NUMERIC, l.NUMERIC, e), n = v(m.ALPHANUMERIC, l.ALPHANUMERIC, e), r, i;
28
+ return h.isKanjiModeEnabled() ? (r = v(m.BYTE, l.BYTE, e), i = v(m.KANJI, l.KANJI, e)) : (r = v(m.BYTE_KANJI, l.BYTE, e), i = []), t.concat(n, r, i).sort(function(e, t) {
29
+ return e.index - t.index;
30
+ }).map(function(e) {
31
+ return {
32
+ data: e.data,
33
+ mode: e.mode,
34
+ length: e.length
35
+ };
36
+ });
37
+ }
38
+ function b(e, t) {
39
+ switch (t) {
40
+ case l.NUMERIC: return u.getBitsLength(e);
41
+ case l.ALPHANUMERIC: return d.getBitsLength(e);
42
+ case l.KANJI: return p.getBitsLength(e);
43
+ case l.BYTE: return f.getBitsLength(e);
44
+ }
45
+ }
46
+ function x(e) {
47
+ return e.reduce(function(e, t) {
48
+ let n = e.length - 1 >= 0 ? e[e.length - 1] : null;
49
+ return n && n.mode === t.mode ? (e[e.length - 1].data += t.data, e) : (e.push(t), e);
50
+ }, []);
51
+ }
52
+ function S(e) {
53
+ let t = [];
54
+ for (let n = 0; n < e.length; n++) {
55
+ let r = e[n];
56
+ switch (r.mode) {
57
+ case l.NUMERIC:
58
+ t.push([
59
+ r,
60
+ {
61
+ data: r.data,
62
+ mode: l.ALPHANUMERIC,
63
+ length: r.length
64
+ },
65
+ {
66
+ data: r.data,
67
+ mode: l.BYTE,
68
+ length: r.length
69
+ }
70
+ ]);
71
+ break;
72
+ case l.ALPHANUMERIC:
73
+ t.push([r, {
74
+ data: r.data,
75
+ mode: l.BYTE,
76
+ length: r.length
77
+ }]);
78
+ break;
79
+ case l.KANJI:
80
+ t.push([r, {
81
+ data: r.data,
82
+ mode: l.BYTE,
83
+ length: _(r.data)
84
+ }]);
85
+ break;
86
+ case l.BYTE: t.push([{
87
+ data: r.data,
88
+ mode: l.BYTE,
89
+ length: _(r.data)
90
+ }]);
91
+ }
92
+ }
93
+ return t;
94
+ }
95
+ function C(e, t) {
96
+ let n = {}, r = { start: {} }, i = ["start"];
97
+ for (let a = 0; a < e.length; a++) {
98
+ let o = e[a], s = [];
99
+ for (let e = 0; e < o.length; e++) {
100
+ let c = o[e], u = "" + a + e;
101
+ s.push(u), n[u] = {
102
+ node: c,
103
+ lastCount: 0
104
+ }, r[u] = {};
105
+ for (let e = 0; e < i.length; e++) {
106
+ let a = i[e];
107
+ n[a] && n[a].node.mode === c.mode ? (r[a][u] = b(n[a].lastCount + c.length, c.mode) - b(n[a].lastCount, c.mode), n[a].lastCount += c.length) : (n[a] && (n[a].lastCount = c.length), r[a][u] = b(c.length, c.mode) + 4 + l.getCharCountIndicator(c.mode, t));
108
+ }
109
+ }
110
+ i = s;
111
+ }
112
+ for (let e = 0; e < i.length; e++) r[i[e]].end = 0;
113
+ return {
114
+ map: r,
115
+ table: n
116
+ };
117
+ }
118
+ function w(e, t) {
119
+ let n, r = l.getBestModeForData(e);
120
+ if (n = l.from(t, r), n !== l.BYTE && n.bit < r.bit) throw Error("\"" + e + "\" cannot be encoded with mode " + l.toString(n) + ".\n Suggested mode is: " + l.toString(r));
121
+ switch (n === l.KANJI && !h.isKanjiModeEnabled() && (n = l.BYTE), n) {
122
+ case l.NUMERIC: return new u(e);
123
+ case l.ALPHANUMERIC: return new d(e);
124
+ case l.KANJI: return new p(e);
125
+ case l.BYTE: return new f(e);
126
+ }
127
+ }
128
+ e.fromArray = function(e) {
129
+ return e.reduce(function(e, t) {
130
+ return typeof t == "string" ? e.push(w(t, null)) : t.data && e.push(w(t.data, t.mode)), e;
131
+ }, []);
132
+ }, e.fromString = function(t, n) {
133
+ let r = C(S(y(t, h.isKanjiModeEnabled())), n), i = g.find_path(r.map, "start", "end"), a = [];
134
+ for (let e = 1; e < i.length - 1; e++) a.push(r.table[i[e]].node);
135
+ return e.fromArray(x(a));
136
+ }, e.rawSplit = function(t) {
137
+ return e.fromArray(y(t, h.isKanjiModeEnabled()));
138
+ };
139
+ }));
140
+ //#endregion
141
+ export default l();
142
+ export { l as require_segments };
143
+
144
+ //# sourceMappingURL=segments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segments.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/segments.js"],"sourcesContent":["const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param {String} str Input string\n * @return {Number} Number of byte\n */\nfunction getStringByteLength (str) {\n return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param {Mode} mode Segment mode\n * @param {String} str String to process\n * @return {Array} Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n const segments = []\n let result\n\n while ((result = regex.exec(str)) !== null) {\n segments.push({\n data: result[0],\n index: result.index,\n mode: mode,\n length: result[0].length\n })\n }\n\n return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param {String} dataStr Input string\n * @return {Array} Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n let byteSegs\n let kanjiSegs\n\n if (Utils.isKanjiModeEnabled()) {\n byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n } else {\n byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n kanjiSegs = []\n }\n\n const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n return segs\n .sort(function (s1, s2) {\n return s1.index - s2.index\n })\n .map(function (obj) {\n return {\n data: obj.data,\n mode: obj.mode,\n length: obj.length\n }\n })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param {Number} length String length\n * @param {Mode} mode Segment mode\n * @return {Number} Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n switch (mode) {\n case Mode.NUMERIC:\n return NumericData.getBitsLength(length)\n case Mode.ALPHANUMERIC:\n return AlphanumericData.getBitsLength(length)\n case Mode.KANJI:\n return KanjiData.getBitsLength(length)\n case Mode.BYTE:\n return ByteData.getBitsLength(length)\n }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction mergeSegments (segs) {\n return segs.reduce(function (acc, curr) {\n const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n if (prevSeg && prevSeg.mode === curr.mode) {\n acc[acc.length - 1].data += curr.data\n return acc\n }\n\n acc.push(curr)\n return acc\n }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction buildNodes (segs) {\n const nodes = []\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n\n switch (seg.mode) {\n case Mode.NUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.ALPHANUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.KANJI:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n break\n case Mode.BYTE:\n nodes.push([\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n }\n }\n\n return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param {Array} nodes Array of object with segments data\n * @param {Number} version QR Code version\n * @return {Object} Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n const table = {}\n const graph = { start: {} }\n let prevNodeIds = ['start']\n\n for (let i = 0; i < nodes.length; i++) {\n const nodeGroup = nodes[i]\n const currentNodeIds = []\n\n for (let j = 0; j < nodeGroup.length; j++) {\n const node = nodeGroup[j]\n const key = '' + i + j\n\n currentNodeIds.push(key)\n table[key] = { node: node, lastCount: 0 }\n graph[key] = {}\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n const prevNodeId = prevNodeIds[n]\n\n if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n graph[prevNodeId][key] =\n getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n table[prevNodeId].lastCount += node.length\n } else {\n if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n }\n }\n }\n\n prevNodeIds = currentNodeIds\n }\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n graph[prevNodeIds[n]].end = 0\n }\n\n return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param {String} data Input data\n * @param {Mode | String} modesHint Data mode\n * @return {Segment} Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n let mode\n const bestMode = Mode.getBestModeForData(data)\n\n mode = Mode.from(modesHint, bestMode)\n\n // Make sure data can be encoded\n if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n throw new Error('\"' + data + '\"' +\n ' cannot be encoded with mode ' + Mode.toString(mode) +\n '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n }\n\n // Use Mode.BYTE if Kanji support is disabled\n if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n mode = Mode.BYTE\n }\n\n switch (mode) {\n case Mode.NUMERIC:\n return new NumericData(data)\n\n case Mode.ALPHANUMERIC:\n return new AlphanumericData(data)\n\n case Mode.KANJI:\n return new KanjiData(data)\n\n case Mode.BYTE:\n return new ByteData(data)\n }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param {Array} array Array of objects with segments data\n * @return {Array} Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n return array.reduce(function (acc, seg) {\n if (typeof seg === 'string') {\n acc.push(buildSingleSegment(seg, null))\n } else if (seg.data) {\n acc.push(buildSingleSegment(seg.data, seg.mode))\n }\n\n return acc\n }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @return {Array} Array of segments\n */\nexports.fromString = function fromString (data, version) {\n const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n const nodes = buildNodes(segs)\n const graph = buildGraph(nodes, version)\n const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n const optimizedSegs = []\n for (let i = 1; i < path.length - 1; i++) {\n optimizedSegs.push(graph.table[path[i]].node)\n }\n\n return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param {string} data Input string\n * @return {Array} Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n return exports.fromArray(\n getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n )\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;CAAA,IAAM,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA,EACA,IAAA,GAAA;CAQN,SAAS,EAAqB,GAAK;AACjC,SAAO,SAAS,mBAAmB,EAAI,CAAC,CAAC;;CAW3C,SAAS,EAAa,GAAO,GAAM,GAAK;EACtC,IAAM,IAAW,EAAE,EACf;AAEJ,UAAQ,IAAS,EAAM,KAAK,EAAI,MAAM,MACpC,GAAS,KAAK;GACZ,MAAM,EAAO;GACb,OAAO,EAAO;GACR;GACN,QAAQ,EAAO,GAAG;GACnB,CAAC;AAGJ,SAAO;;CAUT,SAAS,EAAuB,GAAS;EACvC,IAAM,IAAU,EAAY,EAAM,SAAS,EAAK,SAAS,EAAQ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ACxB,OAAK,IAAI,IAAI,GAAG,IAAI,EAAK,SAAS,GAAG,IACnC,GAAc,KAAK,EAAM,MAAM,EAAK,IAAI,KAAK;AAG/C,SAAO,EAAQ,UAAU,EAAc,EAAc,CAAC;IAaxD,EAAQ,WAAW,SAAmB,GAAM;AAC1C,SAAO,EAAQ,UACb,EAAsB,GAAM,EAAM,oBAAoB,CAAC,CACxD"}
@@ -0,0 +1,70 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ //#region node_modules/qrcode/lib/core/utils.js
3
+ var t = /* @__PURE__ */ e(((e) => {
4
+ var t, n = [
5
+ 0,
6
+ 26,
7
+ 44,
8
+ 70,
9
+ 100,
10
+ 134,
11
+ 172,
12
+ 196,
13
+ 242,
14
+ 292,
15
+ 346,
16
+ 404,
17
+ 466,
18
+ 532,
19
+ 581,
20
+ 655,
21
+ 733,
22
+ 815,
23
+ 901,
24
+ 991,
25
+ 1085,
26
+ 1156,
27
+ 1258,
28
+ 1364,
29
+ 1474,
30
+ 1588,
31
+ 1706,
32
+ 1828,
33
+ 1921,
34
+ 2051,
35
+ 2185,
36
+ 2323,
37
+ 2465,
38
+ 2611,
39
+ 2761,
40
+ 2876,
41
+ 3034,
42
+ 3196,
43
+ 3362,
44
+ 3532,
45
+ 3706
46
+ ];
47
+ e.getSymbolSize = function(e) {
48
+ if (!e) throw Error("\"version\" cannot be null or undefined");
49
+ if (e < 1 || e > 40) throw Error("\"version\" should be in range from 1 to 40");
50
+ return e * 4 + 17;
51
+ }, e.getSymbolTotalCodewords = function(e) {
52
+ return n[e];
53
+ }, e.getBCHDigit = function(e) {
54
+ let t = 0;
55
+ for (; e !== 0;) t++, e >>>= 1;
56
+ return t;
57
+ }, e.setToSJISFunction = function(e) {
58
+ if (typeof e != "function") throw Error("\"toSJISFunc\" is not a valid function.");
59
+ t = e;
60
+ }, e.isKanjiModeEnabled = function() {
61
+ return t !== void 0;
62
+ }, e.toSJIS = function(e) {
63
+ return t(e);
64
+ };
65
+ }));
66
+ //#endregion
67
+ export default t();
68
+ export { t as require_utils };
69
+
70
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../../../../node_modules/qrcode/lib/core/utils.js"],"sourcesContent":["let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n"],"x_google_ignoreList":[0],"mappings":";;;CAAA,IAAI,GACE,IAAkB;EACtB;EACA;EAAI;EAAI;EAAI;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAC1C;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAAK;EAC7C;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EACtD;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EAAM;EACvD;AAqDD,CA7CA,EAAQ,gBAAgB,SAAwB,GAAS;AACvD,MAAI,CAAC,EAAS,OAAU,MAAM,0CAAwC;AACtE,MAAI,IAAU,KAAK,IAAU,GAAI,OAAU,MAAM,8CAA4C;AAC7F,SAAO,IAAU,IAAI;IASvB,EAAQ,0BAA0B,SAAkC,GAAS;AAC3E,SAAO,EAAgB;IASzB,EAAQ,cAAc,SAAU,GAAM;EACpC,IAAI,IAAQ;AAEZ,SAAO,MAAS,GAEd,CADA,KACA,OAAU;AAGZ,SAAO;IAGT,EAAQ,oBAAoB,SAA4B,GAAG;AACzD,MAAI,OAAO,KAAM,WACf,OAAU,MAAM,0CAAwC;AAG1D,MAAiB;IAGnB,EAAQ,qBAAqB,WAAY;AACvC,SAAc,MAAmB;IAGnC,EAAQ,SAAS,SAAiB,GAAO;AACvC,SAAO,EAAe,EAAM"}