asterui 0.10.2
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.
- package/LICENSE +15 -0
- package/README.md +214 -0
- package/dist/components/Affix.d.ts +14 -0
- package/dist/components/Alert.d.ts +10 -0
- package/dist/components/Autocomplete.d.ts +18 -0
- package/dist/components/Avatar.d.ts +28 -0
- package/dist/components/Badge.d.ts +20 -0
- package/dist/components/Breadcrumb.d.ts +15 -0
- package/dist/components/Browser.d.ts +7 -0
- package/dist/components/Button.d.ts +23 -0
- package/dist/components/Card.d.ts +26 -0
- package/dist/components/Carousel.d.ts +14 -0
- package/dist/components/Cascader.d.ts +19 -0
- package/dist/components/Chart.d.ts +19 -0
- package/dist/components/Chat.d.ts +11 -0
- package/dist/components/Checkbox.d.ts +27 -0
- package/dist/components/Code.d.ts +14 -0
- package/dist/components/Collapse.d.ts +25 -0
- package/dist/components/ColorPicker.d.ts +10 -0
- package/dist/components/Container.d.ts +6 -0
- package/dist/components/ContextMenu.d.ts +23 -0
- package/dist/components/Countdown.d.ts +27 -0
- package/dist/components/DatePicker.d.ts +11 -0
- package/dist/components/Descriptions.d.ts +34 -0
- package/dist/components/Divider.d.ts +8 -0
- package/dist/components/Drawer.d.ts +10 -0
- package/dist/components/Dropdown.d.ts +39 -0
- package/dist/components/Empty.d.ts +8 -0
- package/dist/components/Fieldset.d.ts +15 -0
- package/dist/components/FileInput.d.ts +9 -0
- package/dist/components/Flex.d.ts +14 -0
- package/dist/components/FloatButton.d.ts +34 -0
- package/dist/components/Footer.d.ts +16 -0
- package/dist/components/Form.d.ts +66 -0
- package/dist/components/Grid.d.ts +26 -0
- package/dist/components/Hero.d.ts +9 -0
- package/dist/components/Image.d.ts +14 -0
- package/dist/components/Indicator.d.ts +7 -0
- package/dist/components/Input.d.ts +14 -0
- package/dist/components/InputNumber.d.ts +19 -0
- package/dist/components/Join.d.ts +6 -0
- package/dist/components/Label.d.ts +15 -0
- package/dist/components/Layout.d.ts +59 -0
- package/dist/components/List.d.ts +13 -0
- package/dist/components/Loading.d.ts +9 -0
- package/dist/components/Masonry.d.ts +15 -0
- package/dist/components/Mention.d.ts +30 -0
- package/dist/components/Menu.d.ts +45 -0
- package/dist/components/Modal.d.ts +42 -0
- package/dist/components/Navbar.d.ts +8 -0
- package/dist/components/Notification.d.ts +43 -0
- package/dist/components/OTPInput.d.ts +32 -0
- package/dist/components/PageLayout.d.ts +9 -0
- package/dist/components/Pagination.d.ts +18 -0
- package/dist/components/Phone.d.ts +8 -0
- package/dist/components/Popconfirm.d.ts +17 -0
- package/dist/components/Popover.d.ts +15 -0
- package/dist/components/Progress.d.ts +5 -0
- package/dist/components/QRCode.d.ts +19 -0
- package/dist/components/RadialProgress.d.ts +10 -0
- package/dist/components/Radio.d.ts +20 -0
- package/dist/components/Range.d.ts +16 -0
- package/dist/components/Rating.d.ts +22 -0
- package/dist/components/Responsive.d.ts +18 -0
- package/dist/components/Result.d.ts +12 -0
- package/dist/components/Select.d.ts +10 -0
- package/dist/components/Skeleton.d.ts +9 -0
- package/dist/components/Space.d.ts +10 -0
- package/dist/components/Splitter.d.ts +27 -0
- package/dist/components/Stack.d.ts +10 -0
- package/dist/components/Stat.d.ts +18 -0
- package/dist/components/Steps.d.ts +16 -0
- package/dist/components/Table.d.ts +51 -0
- package/dist/components/Tabs.d.ts +21 -0
- package/dist/components/Tag.d.ts +18 -0
- package/dist/components/Textarea.d.ts +9 -0
- package/dist/components/ThemeController.d.ts +20 -0
- package/dist/components/TimePicker.d.ts +12 -0
- package/dist/components/Timeline.d.ts +24 -0
- package/dist/components/Toggle.d.ts +7 -0
- package/dist/components/Tooltip.d.ts +9 -0
- package/dist/components/Transfer.d.ts +22 -0
- package/dist/components/Tree.d.ts +40 -0
- package/dist/components/TreeSelect.d.ts +20 -0
- package/dist/components/Typography.d.ts +53 -0
- package/dist/components/Upload.d.ts +38 -0
- package/dist/components/Window.d.ts +7 -0
- package/dist/hooks/useBreakpoint.d.ts +10 -0
- package/dist/index.d.ts +172 -0
- package/dist/index.js +182 -0
- package/dist/index.js.map +1 -0
- package/dist/index10.js +33 -0
- package/dist/index10.js.map +1 -0
- package/dist/index100.js +24 -0
- package/dist/index100.js.map +1 -0
- package/dist/index101.js +27 -0
- package/dist/index101.js.map +1 -0
- package/dist/index102.js +23 -0
- package/dist/index102.js.map +1 -0
- package/dist/index103.js +103 -0
- package/dist/index103.js.map +1 -0
- package/dist/index104.js +363 -0
- package/dist/index104.js.map +1 -0
- package/dist/index105.js +28 -0
- package/dist/index105.js.map +1 -0
- package/dist/index106.js +76 -0
- package/dist/index106.js.map +1 -0
- package/dist/index107.js +19 -0
- package/dist/index107.js.map +1 -0
- package/dist/index108.js +69 -0
- package/dist/index108.js.map +1 -0
- package/dist/index109.js +147 -0
- package/dist/index109.js.map +1 -0
- package/dist/index11.js +268 -0
- package/dist/index11.js.map +1 -0
- package/dist/index110.js +5 -0
- package/dist/index110.js.map +1 -0
- package/dist/index111.js +59 -0
- package/dist/index111.js.map +1 -0
- package/dist/index112.js +5 -0
- package/dist/index112.js.map +1 -0
- package/dist/index113.js +5 -0
- package/dist/index113.js.map +1 -0
- package/dist/index114.js +5 -0
- package/dist/index114.js.map +1 -0
- package/dist/index115.js +5 -0
- package/dist/index115.js.map +1 -0
- package/dist/index116.js +5 -0
- package/dist/index116.js.map +1 -0
- package/dist/index117.js +5 -0
- package/dist/index117.js.map +1 -0
- package/dist/index118.js +5 -0
- package/dist/index118.js.map +1 -0
- package/dist/index119.js +5 -0
- package/dist/index119.js.map +1 -0
- package/dist/index12.js +98 -0
- package/dist/index12.js.map +1 -0
- package/dist/index120.js +35 -0
- package/dist/index120.js.map +1 -0
- package/dist/index121.js +5 -0
- package/dist/index121.js.map +1 -0
- package/dist/index122.js +11 -0
- package/dist/index122.js.map +1 -0
- package/dist/index123.js +5 -0
- package/dist/index123.js.map +1 -0
- package/dist/index124.js +5 -0
- package/dist/index124.js.map +1 -0
- package/dist/index125.js +24 -0
- package/dist/index125.js.map +1 -0
- package/dist/index126.js +5 -0
- package/dist/index126.js.map +1 -0
- package/dist/index127.js +27 -0
- package/dist/index127.js.map +1 -0
- package/dist/index128.js +74 -0
- package/dist/index128.js.map +1 -0
- package/dist/index129.js +24 -0
- package/dist/index129.js.map +1 -0
- package/dist/index13.js +161 -0
- package/dist/index13.js.map +1 -0
- package/dist/index130.js +37 -0
- package/dist/index130.js.map +1 -0
- package/dist/index131.js +73 -0
- package/dist/index131.js.map +1 -0
- package/dist/index132.js +5 -0
- package/dist/index132.js.map +1 -0
- package/dist/index133.js +25 -0
- package/dist/index133.js.map +1 -0
- package/dist/index134.js +5 -0
- package/dist/index134.js.map +1 -0
- package/dist/index135.js +5 -0
- package/dist/index135.js.map +1 -0
- package/dist/index136.js +5 -0
- package/dist/index136.js.map +1 -0
- package/dist/index137.js +5 -0
- package/dist/index137.js.map +1 -0
- package/dist/index138.js +7 -0
- package/dist/index138.js.map +1 -0
- package/dist/index14.js +153 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.js +8 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.js +74 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.js +20 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.js +101 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.js +117 -0
- package/dist/index19.js.map +1 -0
- package/dist/index2.js +50 -0
- package/dist/index2.js.map +1 -0
- package/dist/index20.js +187 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.js +113 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.js +35 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.js +44 -0
- package/dist/index23.js.map +1 -0
- package/dist/index24.js +15 -0
- package/dist/index24.js.map +1 -0
- package/dist/index25.js +36 -0
- package/dist/index25.js.map +1 -0
- package/dist/index26.js +66 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.js +83 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.js +21 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.js +164 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.js +31 -0
- package/dist/index3.js.map +1 -0
- package/dist/index30.js +1085 -0
- package/dist/index30.js.map +1 -0
- package/dist/index31.js +21 -0
- package/dist/index31.js.map +1 -0
- package/dist/index32.js +125 -0
- package/dist/index32.js.map +1 -0
- package/dist/index33.js +43 -0
- package/dist/index33.js.map +1 -0
- package/dist/index34.js +194 -0
- package/dist/index34.js.map +1 -0
- package/dist/index35.js +100 -0
- package/dist/index35.js.map +1 -0
- package/dist/index36.js +165 -0
- package/dist/index36.js.map +1 -0
- package/dist/index37.js +149 -0
- package/dist/index37.js.map +1 -0
- package/dist/index38.js +18 -0
- package/dist/index38.js.map +1 -0
- package/dist/index39.js +24 -0
- package/dist/index39.js.map +1 -0
- package/dist/index4.js +104 -0
- package/dist/index4.js.map +1 -0
- package/dist/index40.js +122 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.js +16 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +38 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.js +119 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.js +179 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +150 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +15 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.js +25 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +17 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +10 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +64 -0
- package/dist/index5.js.map +1 -0
- package/dist/index50.js +269 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +20 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +125 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +113 -0
- package/dist/index53.js.map +1 -0
- package/dist/index54.js +173 -0
- package/dist/index54.js.map +1 -0
- package/dist/index55.js +35 -0
- package/dist/index55.js.map +1 -0
- package/dist/index56.js +125 -0
- package/dist/index56.js.map +1 -0
- package/dist/index57.js +89 -0
- package/dist/index57.js.map +1 -0
- package/dist/index58.js +23 -0
- package/dist/index58.js.map +1 -0
- package/dist/index59.js +77 -0
- package/dist/index59.js.map +1 -0
- package/dist/index6.js +133 -0
- package/dist/index6.js.map +1 -0
- package/dist/index60.js +60 -0
- package/dist/index60.js.map +1 -0
- package/dist/index61.js +48 -0
- package/dist/index61.js.map +1 -0
- package/dist/index62.js +55 -0
- package/dist/index62.js.map +1 -0
- package/dist/index63.js +65 -0
- package/dist/index63.js.map +1 -0
- package/dist/index64.js +110 -0
- package/dist/index64.js.map +1 -0
- package/dist/index65.js +44 -0
- package/dist/index65.js.map +1 -0
- package/dist/index66.js +24 -0
- package/dist/index66.js.map +1 -0
- package/dist/index67.js +49 -0
- package/dist/index67.js.map +1 -0
- package/dist/index68.js +137 -0
- package/dist/index68.js.map +1 -0
- package/dist/index69.js +55 -0
- package/dist/index69.js.map +1 -0
- package/dist/index7.js +14 -0
- package/dist/index7.js.map +1 -0
- package/dist/index70.js +25 -0
- package/dist/index70.js.map +1 -0
- package/dist/index71.js +25 -0
- package/dist/index71.js.map +1 -0
- package/dist/index72.js +332 -0
- package/dist/index72.js.map +1 -0
- package/dist/index73.js +59 -0
- package/dist/index73.js.map +1 -0
- package/dist/index74.js +43 -0
- package/dist/index74.js.map +1 -0
- package/dist/index75.js +98 -0
- package/dist/index75.js.map +1 -0
- package/dist/index76.js +133 -0
- package/dist/index76.js.map +1 -0
- package/dist/index77.js +164 -0
- package/dist/index77.js.map +1 -0
- package/dist/index78.js +68 -0
- package/dist/index78.js.map +1 -0
- package/dist/index79.js +38 -0
- package/dist/index79.js.map +1 -0
- package/dist/index8.js +73 -0
- package/dist/index8.js.map +1 -0
- package/dist/index80.js +37 -0
- package/dist/index80.js.map +1 -0
- package/dist/index81.js +213 -0
- package/dist/index81.js.map +1 -0
- package/dist/index82.js +216 -0
- package/dist/index82.js.map +1 -0
- package/dist/index83.js +298 -0
- package/dist/index83.js.map +1 -0
- package/dist/index84.js +181 -0
- package/dist/index84.js.map +1 -0
- package/dist/index85.js +261 -0
- package/dist/index85.js.map +1 -0
- package/dist/index86.js +17 -0
- package/dist/index86.js.map +1 -0
- package/dist/index87.js +36 -0
- package/dist/index87.js.map +1 -0
- package/dist/index88.js +10796 -0
- package/dist/index88.js.map +1 -0
- package/dist/index89.js +8 -0
- package/dist/index89.js.map +1 -0
- package/dist/index9.js +95 -0
- package/dist/index9.js.map +1 -0
- package/dist/index90.js +45 -0
- package/dist/index90.js.map +1 -0
- package/dist/index91.js +5 -0
- package/dist/index91.js.map +1 -0
- package/dist/index92.js +10 -0
- package/dist/index92.js.map +1 -0
- package/dist/index93.js +155 -0
- package/dist/index93.js.map +1 -0
- package/dist/index94.js +33 -0
- package/dist/index94.js.map +1 -0
- package/dist/index95.js +33 -0
- package/dist/index95.js.map +1 -0
- package/dist/index96.js +5 -0
- package/dist/index96.js.map +1 -0
- package/dist/index97.js +75 -0
- package/dist/index97.js.map +1 -0
- package/dist/index98.js +42 -0
- package/dist/index98.js.map +1 -0
- package/dist/index99.js +29 -0
- package/dist/index99.js.map +1 -0
- package/package.json +71 -0
package/dist/index103.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { __exports as c } from "./index118.js";
|
|
2
|
+
var T;
|
|
3
|
+
function R() {
|
|
4
|
+
return T ? c : (T = 1, (function(r) {
|
|
5
|
+
r.Patterns = {
|
|
6
|
+
PATTERN000: 0,
|
|
7
|
+
PATTERN001: 1,
|
|
8
|
+
PATTERN010: 2,
|
|
9
|
+
PATTERN011: 3,
|
|
10
|
+
PATTERN100: 4,
|
|
11
|
+
PATTERN101: 5,
|
|
12
|
+
PATTERN110: 6,
|
|
13
|
+
PATTERN111: 7
|
|
14
|
+
};
|
|
15
|
+
const u = {
|
|
16
|
+
N1: 3,
|
|
17
|
+
N2: 3,
|
|
18
|
+
N3: 40,
|
|
19
|
+
N4: 10
|
|
20
|
+
};
|
|
21
|
+
r.isValid = function(t) {
|
|
22
|
+
return t != null && t !== "" && !isNaN(t) && t >= 0 && t <= 7;
|
|
23
|
+
}, r.from = function(t) {
|
|
24
|
+
return r.isValid(t) ? parseInt(t, 10) : void 0;
|
|
25
|
+
}, r.getPenaltyN1 = function(t) {
|
|
26
|
+
const l = t.size;
|
|
27
|
+
let s = 0, n = 0, e = 0, i = null, o = null;
|
|
28
|
+
for (let f = 0; f < l; f++) {
|
|
29
|
+
n = e = 0, i = o = null;
|
|
30
|
+
for (let N = 0; N < l; N++) {
|
|
31
|
+
let a = t.get(f, N);
|
|
32
|
+
a === i ? n++ : (n >= 5 && (s += u.N1 + (n - 5)), i = a, n = 1), a = t.get(N, f), a === o ? e++ : (e >= 5 && (s += u.N1 + (e - 5)), o = a, e = 1);
|
|
33
|
+
}
|
|
34
|
+
n >= 5 && (s += u.N1 + (n - 5)), e >= 5 && (s += u.N1 + (e - 5));
|
|
35
|
+
}
|
|
36
|
+
return s;
|
|
37
|
+
}, r.getPenaltyN2 = function(t) {
|
|
38
|
+
const l = t.size;
|
|
39
|
+
let s = 0;
|
|
40
|
+
for (let n = 0; n < l - 1; n++)
|
|
41
|
+
for (let e = 0; e < l - 1; e++) {
|
|
42
|
+
const i = t.get(n, e) + t.get(n, e + 1) + t.get(n + 1, e) + t.get(n + 1, e + 1);
|
|
43
|
+
(i === 4 || i === 0) && s++;
|
|
44
|
+
}
|
|
45
|
+
return s * u.N2;
|
|
46
|
+
}, r.getPenaltyN3 = function(t) {
|
|
47
|
+
const l = t.size;
|
|
48
|
+
let s = 0, n = 0, e = 0;
|
|
49
|
+
for (let i = 0; i < l; i++) {
|
|
50
|
+
n = e = 0;
|
|
51
|
+
for (let o = 0; o < l; o++)
|
|
52
|
+
n = n << 1 & 2047 | t.get(i, o), o >= 10 && (n === 1488 || n === 93) && s++, e = e << 1 & 2047 | t.get(o, i), o >= 10 && (e === 1488 || e === 93) && s++;
|
|
53
|
+
}
|
|
54
|
+
return s * u.N3;
|
|
55
|
+
}, r.getPenaltyN4 = function(t) {
|
|
56
|
+
let l = 0;
|
|
57
|
+
const s = t.data.length;
|
|
58
|
+
for (let e = 0; e < s; e++) l += t.data[e];
|
|
59
|
+
return Math.abs(Math.ceil(l * 100 / s / 5) - 10) * u.N4;
|
|
60
|
+
};
|
|
61
|
+
function g(P, t, l) {
|
|
62
|
+
switch (P) {
|
|
63
|
+
case r.Patterns.PATTERN000:
|
|
64
|
+
return (t + l) % 2 === 0;
|
|
65
|
+
case r.Patterns.PATTERN001:
|
|
66
|
+
return t % 2 === 0;
|
|
67
|
+
case r.Patterns.PATTERN010:
|
|
68
|
+
return l % 3 === 0;
|
|
69
|
+
case r.Patterns.PATTERN011:
|
|
70
|
+
return (t + l) % 3 === 0;
|
|
71
|
+
case r.Patterns.PATTERN100:
|
|
72
|
+
return (Math.floor(t / 2) + Math.floor(l / 3)) % 2 === 0;
|
|
73
|
+
case r.Patterns.PATTERN101:
|
|
74
|
+
return t * l % 2 + t * l % 3 === 0;
|
|
75
|
+
case r.Patterns.PATTERN110:
|
|
76
|
+
return (t * l % 2 + t * l % 3) % 2 === 0;
|
|
77
|
+
case r.Patterns.PATTERN111:
|
|
78
|
+
return (t * l % 3 + (t + l) % 2) % 2 === 0;
|
|
79
|
+
default:
|
|
80
|
+
throw new Error("bad maskPattern:" + P);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
r.applyMask = function(t, l) {
|
|
84
|
+
const s = l.size;
|
|
85
|
+
for (let n = 0; n < s; n++)
|
|
86
|
+
for (let e = 0; e < s; e++)
|
|
87
|
+
l.isReserved(e, n) || l.xor(e, n, g(t, e, n));
|
|
88
|
+
}, r.getBestMask = function(t, l) {
|
|
89
|
+
const s = Object.keys(r.Patterns).length;
|
|
90
|
+
let n = 0, e = 1 / 0;
|
|
91
|
+
for (let i = 0; i < s; i++) {
|
|
92
|
+
l(i), r.applyMask(i, t);
|
|
93
|
+
const o = r.getPenaltyN1(t) + r.getPenaltyN2(t) + r.getPenaltyN3(t) + r.getPenaltyN4(t);
|
|
94
|
+
r.applyMask(i, t), o < e && (e = o, n = i);
|
|
95
|
+
}
|
|
96
|
+
return n;
|
|
97
|
+
};
|
|
98
|
+
})(c), c);
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
R as __require
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=index103.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index103.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js"],"sourcesContent":["/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n PATTERN000: 0,\n PATTERN001: 1,\n PATTERN010: 2,\n PATTERN011: 3,\n PATTERN100: 4,\n PATTERN101: 5,\n PATTERN110: 6,\n PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n N1: 3,\n N2: 3,\n N3: 40,\n N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param {Number} mask Mask pattern\n * @return {Boolean} true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param {Number|String} value Mask pattern value\n * @return {Number} Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n const size = data.size\n let points = 0\n let sameCountCol = 0\n let sameCountRow = 0\n let lastCol = null\n let lastRow = null\n\n for (let row = 0; row < size; row++) {\n sameCountCol = sameCountRow = 0\n lastCol = lastRow = null\n\n for (let col = 0; col < size; col++) {\n let module = data.get(row, col)\n if (module === lastCol) {\n sameCountCol++\n } else {\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n lastCol = module\n sameCountCol = 1\n }\n\n module = data.get(col, row)\n if (module === lastRow) {\n sameCountRow++\n } else {\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n lastRow = module\n sameCountRow = 1\n }\n }\n\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n }\n\n return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n const size = data.size\n let points = 0\n\n for (let row = 0; row < size - 1; row++) {\n for (let col = 0; col < size - 1; col++) {\n const last = data.get(row, col) +\n data.get(row, col + 1) +\n data.get(row + 1, col) +\n data.get(row + 1, col + 1)\n\n if (last === 4 || last === 0) points++\n }\n }\n\n return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n const size = data.size\n let points = 0\n let bitsCol = 0\n let bitsRow = 0\n\n for (let row = 0; row < size; row++) {\n bitsCol = bitsRow = 0\n for (let col = 0; col < size; col++) {\n bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n }\n }\n\n return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n let darkCount = 0\n const modulesCount = data.data.length\n\n for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param {Number} maskPattern Pattern reference value\n * @param {Number} i Row\n * @param {Number} j Column\n * @return {Boolean} Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n switch (maskPattern) {\n case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n case exports.Patterns.PATTERN001: return i % 2 === 0\n case exports.Patterns.PATTERN010: return j % 3 === 0\n case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n default: throw new Error('bad maskPattern:' + maskPattern)\n }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param {Number} pattern Pattern reference number\n * @param {BitMatrix} data BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n const size = data.size\n\n for (let col = 0; col < size; col++) {\n for (let row = 0; row < size; row++) {\n if (data.isReserved(row, col)) continue\n data.xor(row, col, getMaskAt(pattern, row, col))\n }\n }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n const numPatterns = Object.keys(exports.Patterns).length\n let bestPattern = 0\n let lowerPenalty = Infinity\n\n for (let p = 0; p < numPatterns; p++) {\n setupFormatFunc(p)\n exports.applyMask(p, data)\n\n // Calculate penalty\n const penalty =\n exports.getPenaltyN1(data) +\n exports.getPenaltyN2(data) +\n exports.getPenaltyN3(data) +\n exports.getPenaltyN4(data)\n\n // Undo previously applied mask\n exports.applyMask(p, data)\n\n if (penalty < lowerPenalty) {\n lowerPenalty = penalty\n bestPattern = p\n }\n }\n\n return bestPattern\n}\n"],"names":["exports","PenaltyScores","mask","value","data","size","points","sameCountCol","sameCountRow","lastCol","lastRow","row","col","module","last","bitsCol","bitsRow","darkCount","modulesCount","i","getMaskAt","maskPattern","j","pattern","setupFormatFunc","numPatterns","bestPattern","lowerPenalty","p","penalty"],"mappings":";;;;AAIAA,IAAAA,EAAA,WAAmB;AAAA,MACjB,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAMA,UAAMC,IAAgB;AAAA,MACpB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAQAD,IAAAA,EAAA,UAAkB,SAAkBE,GAAM;AACxC,aAAOA,KAAQ,QAAQA,MAAS,MAAM,CAAC,MAAMA,CAAI,KAAKA,KAAQ,KAAKA,KAAQ;AAAA,IAC7E,GASAF,EAAA,OAAe,SAAeG,GAAO;AACnC,aAAOH,EAAQ,QAAQG,CAAK,IAAI,SAASA,GAAO,EAAE,IAAI;AAAA,IACxD,GASAH,EAAA,eAAuB,SAAuBI,GAAM;AAClD,YAAMC,IAAOD,EAAK;AAClB,UAAIE,IAAS,GACTC,IAAe,GACfC,IAAe,GACfC,IAAU,MACVC,IAAU;AAEd,eAASC,IAAM,GAAGA,IAAMN,GAAMM,KAAO;AACnC,QAAAJ,IAAeC,IAAe,GAC9BC,IAAUC,IAAU;AAEpB,iBAASE,IAAM,GAAGA,IAAMP,GAAMO,KAAO;AACnC,cAAIC,IAAST,EAAK,IAAIO,GAAKC,CAAG;AAC9B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eAASQ,IAAM,GAAGA,IAAMP,GAAMO;AAC5B,iBAASD,IAAM,GAAGA,IAAMN,GAAMM;AAC5B,UAAIP,EAAK,WAAWO,GAAKC,CAAG,KAC5BR,EAAK,IAAIO,GAAKC,GAAKQ,EAAUG,GAASZ,GAAKC,CAAG,CAAC;AAAA,IAGrD,GAQAZ,EAAA,cAAsB,SAAsBI,GAAMoB,GAAiB;AACjE,YAAMC,IAAc,OAAO,KAAKzB,EAAQ,QAAQ,EAAE;AAClD,UAAI0B,IAAc,GACdC,IAAe;AAEnB,eAASC,IAAI,GAAGA,IAAIH,GAAaG,KAAK;AACpC,QAAAJ,EAAgBI,CAAC,GACjB5B,EAAQ,UAAU4B,GAAGxB,CAAI;AAGzB,cAAMyB,IACJ7B,EAAQ,aAAaI,CAAI,IACzBJ,EAAQ,aAAaI,CAAI,IACzBJ,EAAQ,aAAaI,CAAI,IACzBJ,EAAQ,aAAaI,CAAI;AAG3BJ,QAAAA,EAAQ,UAAU4B,GAAGxB,CAAI,GAErByB,IAAUF,MACZA,IAAeE,GACfH,IAAcE;AAAA,MAEpB;AAEE,aAAOF;AAAA,IACT;AAAA;;","x_google_ignoreList":[0]}
|
package/dist/index104.js
ADDED
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { __exports as u } from "./index119.js";
|
|
2
|
+
import { __require as a } from "./index98.js";
|
|
3
|
+
var c;
|
|
4
|
+
function i() {
|
|
5
|
+
if (c) return u;
|
|
6
|
+
c = 1;
|
|
7
|
+
const e = a(), t = [
|
|
8
|
+
// L M Q H
|
|
9
|
+
1,
|
|
10
|
+
1,
|
|
11
|
+
1,
|
|
12
|
+
1,
|
|
13
|
+
1,
|
|
14
|
+
1,
|
|
15
|
+
1,
|
|
16
|
+
1,
|
|
17
|
+
1,
|
|
18
|
+
1,
|
|
19
|
+
2,
|
|
20
|
+
2,
|
|
21
|
+
1,
|
|
22
|
+
2,
|
|
23
|
+
2,
|
|
24
|
+
4,
|
|
25
|
+
1,
|
|
26
|
+
2,
|
|
27
|
+
4,
|
|
28
|
+
4,
|
|
29
|
+
2,
|
|
30
|
+
4,
|
|
31
|
+
4,
|
|
32
|
+
4,
|
|
33
|
+
2,
|
|
34
|
+
4,
|
|
35
|
+
6,
|
|
36
|
+
5,
|
|
37
|
+
2,
|
|
38
|
+
4,
|
|
39
|
+
6,
|
|
40
|
+
6,
|
|
41
|
+
2,
|
|
42
|
+
5,
|
|
43
|
+
8,
|
|
44
|
+
8,
|
|
45
|
+
4,
|
|
46
|
+
5,
|
|
47
|
+
8,
|
|
48
|
+
8,
|
|
49
|
+
4,
|
|
50
|
+
5,
|
|
51
|
+
8,
|
|
52
|
+
11,
|
|
53
|
+
4,
|
|
54
|
+
8,
|
|
55
|
+
10,
|
|
56
|
+
11,
|
|
57
|
+
4,
|
|
58
|
+
9,
|
|
59
|
+
12,
|
|
60
|
+
16,
|
|
61
|
+
4,
|
|
62
|
+
9,
|
|
63
|
+
16,
|
|
64
|
+
16,
|
|
65
|
+
6,
|
|
66
|
+
10,
|
|
67
|
+
12,
|
|
68
|
+
18,
|
|
69
|
+
6,
|
|
70
|
+
10,
|
|
71
|
+
17,
|
|
72
|
+
16,
|
|
73
|
+
6,
|
|
74
|
+
11,
|
|
75
|
+
16,
|
|
76
|
+
19,
|
|
77
|
+
6,
|
|
78
|
+
13,
|
|
79
|
+
18,
|
|
80
|
+
21,
|
|
81
|
+
7,
|
|
82
|
+
14,
|
|
83
|
+
21,
|
|
84
|
+
25,
|
|
85
|
+
8,
|
|
86
|
+
16,
|
|
87
|
+
20,
|
|
88
|
+
25,
|
|
89
|
+
8,
|
|
90
|
+
17,
|
|
91
|
+
23,
|
|
92
|
+
25,
|
|
93
|
+
9,
|
|
94
|
+
17,
|
|
95
|
+
23,
|
|
96
|
+
34,
|
|
97
|
+
9,
|
|
98
|
+
18,
|
|
99
|
+
25,
|
|
100
|
+
30,
|
|
101
|
+
10,
|
|
102
|
+
20,
|
|
103
|
+
27,
|
|
104
|
+
32,
|
|
105
|
+
12,
|
|
106
|
+
21,
|
|
107
|
+
29,
|
|
108
|
+
35,
|
|
109
|
+
12,
|
|
110
|
+
23,
|
|
111
|
+
34,
|
|
112
|
+
37,
|
|
113
|
+
12,
|
|
114
|
+
25,
|
|
115
|
+
34,
|
|
116
|
+
40,
|
|
117
|
+
13,
|
|
118
|
+
26,
|
|
119
|
+
35,
|
|
120
|
+
42,
|
|
121
|
+
14,
|
|
122
|
+
28,
|
|
123
|
+
38,
|
|
124
|
+
45,
|
|
125
|
+
15,
|
|
126
|
+
29,
|
|
127
|
+
40,
|
|
128
|
+
48,
|
|
129
|
+
16,
|
|
130
|
+
31,
|
|
131
|
+
43,
|
|
132
|
+
51,
|
|
133
|
+
17,
|
|
134
|
+
33,
|
|
135
|
+
45,
|
|
136
|
+
54,
|
|
137
|
+
18,
|
|
138
|
+
35,
|
|
139
|
+
48,
|
|
140
|
+
57,
|
|
141
|
+
19,
|
|
142
|
+
37,
|
|
143
|
+
51,
|
|
144
|
+
60,
|
|
145
|
+
19,
|
|
146
|
+
38,
|
|
147
|
+
53,
|
|
148
|
+
63,
|
|
149
|
+
20,
|
|
150
|
+
40,
|
|
151
|
+
56,
|
|
152
|
+
66,
|
|
153
|
+
21,
|
|
154
|
+
43,
|
|
155
|
+
59,
|
|
156
|
+
70,
|
|
157
|
+
22,
|
|
158
|
+
45,
|
|
159
|
+
62,
|
|
160
|
+
74,
|
|
161
|
+
24,
|
|
162
|
+
47,
|
|
163
|
+
65,
|
|
164
|
+
77,
|
|
165
|
+
25,
|
|
166
|
+
49,
|
|
167
|
+
68,
|
|
168
|
+
81
|
|
169
|
+
], o = [
|
|
170
|
+
// L M Q H
|
|
171
|
+
7,
|
|
172
|
+
10,
|
|
173
|
+
13,
|
|
174
|
+
17,
|
|
175
|
+
10,
|
|
176
|
+
16,
|
|
177
|
+
22,
|
|
178
|
+
28,
|
|
179
|
+
15,
|
|
180
|
+
26,
|
|
181
|
+
36,
|
|
182
|
+
44,
|
|
183
|
+
20,
|
|
184
|
+
36,
|
|
185
|
+
52,
|
|
186
|
+
64,
|
|
187
|
+
26,
|
|
188
|
+
48,
|
|
189
|
+
72,
|
|
190
|
+
88,
|
|
191
|
+
36,
|
|
192
|
+
64,
|
|
193
|
+
96,
|
|
194
|
+
112,
|
|
195
|
+
40,
|
|
196
|
+
72,
|
|
197
|
+
108,
|
|
198
|
+
130,
|
|
199
|
+
48,
|
|
200
|
+
88,
|
|
201
|
+
132,
|
|
202
|
+
156,
|
|
203
|
+
60,
|
|
204
|
+
110,
|
|
205
|
+
160,
|
|
206
|
+
192,
|
|
207
|
+
72,
|
|
208
|
+
130,
|
|
209
|
+
192,
|
|
210
|
+
224,
|
|
211
|
+
80,
|
|
212
|
+
150,
|
|
213
|
+
224,
|
|
214
|
+
264,
|
|
215
|
+
96,
|
|
216
|
+
176,
|
|
217
|
+
260,
|
|
218
|
+
308,
|
|
219
|
+
104,
|
|
220
|
+
198,
|
|
221
|
+
288,
|
|
222
|
+
352,
|
|
223
|
+
120,
|
|
224
|
+
216,
|
|
225
|
+
320,
|
|
226
|
+
384,
|
|
227
|
+
132,
|
|
228
|
+
240,
|
|
229
|
+
360,
|
|
230
|
+
432,
|
|
231
|
+
144,
|
|
232
|
+
280,
|
|
233
|
+
408,
|
|
234
|
+
480,
|
|
235
|
+
168,
|
|
236
|
+
308,
|
|
237
|
+
448,
|
|
238
|
+
532,
|
|
239
|
+
180,
|
|
240
|
+
338,
|
|
241
|
+
504,
|
|
242
|
+
588,
|
|
243
|
+
196,
|
|
244
|
+
364,
|
|
245
|
+
546,
|
|
246
|
+
650,
|
|
247
|
+
224,
|
|
248
|
+
416,
|
|
249
|
+
600,
|
|
250
|
+
700,
|
|
251
|
+
224,
|
|
252
|
+
442,
|
|
253
|
+
644,
|
|
254
|
+
750,
|
|
255
|
+
252,
|
|
256
|
+
476,
|
|
257
|
+
690,
|
|
258
|
+
816,
|
|
259
|
+
270,
|
|
260
|
+
504,
|
|
261
|
+
750,
|
|
262
|
+
900,
|
|
263
|
+
300,
|
|
264
|
+
560,
|
|
265
|
+
810,
|
|
266
|
+
960,
|
|
267
|
+
312,
|
|
268
|
+
588,
|
|
269
|
+
870,
|
|
270
|
+
1050,
|
|
271
|
+
336,
|
|
272
|
+
644,
|
|
273
|
+
952,
|
|
274
|
+
1110,
|
|
275
|
+
360,
|
|
276
|
+
700,
|
|
277
|
+
1020,
|
|
278
|
+
1200,
|
|
279
|
+
390,
|
|
280
|
+
728,
|
|
281
|
+
1050,
|
|
282
|
+
1260,
|
|
283
|
+
420,
|
|
284
|
+
784,
|
|
285
|
+
1140,
|
|
286
|
+
1350,
|
|
287
|
+
450,
|
|
288
|
+
812,
|
|
289
|
+
1200,
|
|
290
|
+
1440,
|
|
291
|
+
480,
|
|
292
|
+
868,
|
|
293
|
+
1290,
|
|
294
|
+
1530,
|
|
295
|
+
510,
|
|
296
|
+
924,
|
|
297
|
+
1350,
|
|
298
|
+
1620,
|
|
299
|
+
540,
|
|
300
|
+
980,
|
|
301
|
+
1440,
|
|
302
|
+
1710,
|
|
303
|
+
570,
|
|
304
|
+
1036,
|
|
305
|
+
1530,
|
|
306
|
+
1800,
|
|
307
|
+
570,
|
|
308
|
+
1064,
|
|
309
|
+
1590,
|
|
310
|
+
1890,
|
|
311
|
+
600,
|
|
312
|
+
1120,
|
|
313
|
+
1680,
|
|
314
|
+
1980,
|
|
315
|
+
630,
|
|
316
|
+
1204,
|
|
317
|
+
1770,
|
|
318
|
+
2100,
|
|
319
|
+
660,
|
|
320
|
+
1260,
|
|
321
|
+
1860,
|
|
322
|
+
2220,
|
|
323
|
+
720,
|
|
324
|
+
1316,
|
|
325
|
+
1950,
|
|
326
|
+
2310,
|
|
327
|
+
750,
|
|
328
|
+
1372,
|
|
329
|
+
2040,
|
|
330
|
+
2430
|
|
331
|
+
];
|
|
332
|
+
return u.getBlocksCount = function(r, n) {
|
|
333
|
+
switch (n) {
|
|
334
|
+
case e.L:
|
|
335
|
+
return t[(r - 1) * 4 + 0];
|
|
336
|
+
case e.M:
|
|
337
|
+
return t[(r - 1) * 4 + 1];
|
|
338
|
+
case e.Q:
|
|
339
|
+
return t[(r - 1) * 4 + 2];
|
|
340
|
+
case e.H:
|
|
341
|
+
return t[(r - 1) * 4 + 3];
|
|
342
|
+
default:
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
}, u.getTotalCodewordsCount = function(r, n) {
|
|
346
|
+
switch (n) {
|
|
347
|
+
case e.L:
|
|
348
|
+
return o[(r - 1) * 4 + 0];
|
|
349
|
+
case e.M:
|
|
350
|
+
return o[(r - 1) * 4 + 1];
|
|
351
|
+
case e.Q:
|
|
352
|
+
return o[(r - 1) * 4 + 2];
|
|
353
|
+
case e.H:
|
|
354
|
+
return o[(r - 1) * 4 + 3];
|
|
355
|
+
default:
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
}, u;
|
|
359
|
+
}
|
|
360
|
+
export {
|
|
361
|
+
i as __require
|
|
362
|
+
};
|
|
363
|
+
//# sourceMappingURL=index104.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index104.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js"],"sourcesContent":["const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L M Q H\r\n 1, 1, 1, 1,\r\n 1, 1, 1, 1,\r\n 1, 1, 2, 2,\r\n 1, 2, 2, 4,\r\n 1, 2, 4, 4,\r\n 2, 4, 4, 4,\r\n 2, 4, 6, 5,\r\n 2, 4, 6, 6,\r\n 2, 5, 8, 8,\r\n 4, 5, 8, 8,\r\n 4, 5, 8, 11,\r\n 4, 8, 10, 11,\r\n 4, 9, 12, 16,\r\n 4, 9, 16, 16,\r\n 6, 10, 12, 18,\r\n 6, 10, 17, 16,\r\n 6, 11, 16, 19,\r\n 6, 13, 18, 21,\r\n 7, 14, 21, 25,\r\n 8, 16, 20, 25,\r\n 8, 17, 23, 25,\r\n 9, 17, 23, 34,\r\n 9, 18, 25, 30,\r\n 10, 20, 27, 32,\r\n 12, 21, 29, 35,\r\n 12, 23, 34, 37,\r\n 12, 25, 34, 40,\r\n 13, 26, 35, 42,\r\n 14, 28, 38, 45,\r\n 15, 29, 40, 48,\r\n 16, 31, 43, 51,\r\n 17, 33, 45, 54,\r\n 18, 35, 48, 57,\r\n 19, 37, 51, 60,\r\n 19, 38, 53, 63,\r\n 20, 40, 56, 66,\r\n 21, 43, 59, 70,\r\n 22, 45, 62, 74,\r\n 24, 47, 65, 77,\r\n 25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L M Q H\r\n 7, 10, 13, 17,\r\n 10, 16, 22, 28,\r\n 15, 26, 36, 44,\r\n 20, 36, 52, 64,\r\n 26, 48, 72, 88,\r\n 36, 64, 96, 112,\r\n 40, 72, 108, 130,\r\n 48, 88, 132, 156,\r\n 60, 110, 160, 192,\r\n 72, 130, 192, 224,\r\n 80, 150, 224, 264,\r\n 96, 176, 260, 308,\r\n 104, 198, 288, 352,\r\n 120, 216, 320, 384,\r\n 132, 240, 360, 432,\r\n 144, 280, 408, 480,\r\n 168, 308, 448, 532,\r\n 180, 338, 504, 588,\r\n 196, 364, 546, 650,\r\n 224, 416, 600, 700,\r\n 224, 442, 644, 750,\r\n 252, 476, 690, 816,\r\n 270, 504, 750, 900,\r\n 300, 560, 810, 960,\r\n 312, 588, 870, 1050,\r\n 336, 644, 952, 1110,\r\n 360, 700, 1020, 1200,\r\n 390, 728, 1050, 1260,\r\n 420, 784, 1140, 1350,\r\n 450, 812, 1200, 1440,\r\n 480, 868, 1290, 1530,\r\n 510, 924, 1350, 1620,\r\n 540, 980, 1440, 1710,\r\n 570, 1036, 1530, 1800,\r\n 570, 1064, 1590, 1890,\r\n 600, 1120, 1680, 1980,\r\n 630, 1204, 1770, 2100,\r\n 660, 1260, 1860, 2220,\r\n 720, 1316, 1950, 2310,\r\n 750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n"],"names":["ECLevel","require$$0","EC_BLOCKS_TABLE","EC_CODEWORDS_TABLE","errorCorrectionCode","version","errorCorrectionLevel"],"mappings":";;;;;;AAAA,QAAMA,IAAUC,EAAA,GAEVC,IAAkB;AAAA;AAAA,IAEtB;AAAA,IAAG;AAAA,IAAG;AAAA,IAAG;AAAA,IACT;AAAA,IAAG;AAAA,IAAG;AAAA,IAAG;AAAA,IACT;AA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A,IAAM;AAAA,IAAM;AAAA;AAWnB,SAAAC,EAAA,iBAAyB,SAAyBC,GAASC,GAAsB;AAC/E,YAAQA,GAAoB;AAAA,MAC1B,KAAKN,EAAQ;AACX,eAAOE,GAAiBG,IAAU,KAAK,IAAI,CAAC;AAAA,MAC9C,KAAKL,EAAQ;AACX,eAAOE,GAAiBG,IAAU,KAAK,IAAI,CAAC;AAAA,MAC9C,KAAKL,EAAQ;AACX,eAAOE,GAAiBG,IAAU,KAAK,IAAI,CAAC;AAAA,MAC9C,KAAKL,EAAQ;AACX,eAAOE,GAAiBG,IAAU,KAAK,IAAI,CAAC;AAAA,MAC9C;AACE;AAAA;EAEN,GAUAD,EAAA,yBAAiC,SAAiCC,GAASC,GAAsB;AAC/F,YAAQA,GAAoB;AAAA,MAC1B,KAAKN,EAAQ;AACX,eAAOG,GAAoBE,IAAU,KAAK,IAAI,CAAC;AAAA,MACjD,KAAKL,EAAQ;AACX,eAAOG,GAAoBE,IAAU,KAAK,IAAI,CAAC;AAAA,MACjD,KAAKL,EAAQ;AACX,eAAOG,GAAoBE,IAAU,KAAK,IAAI,CAAC;AAAA,MACjD,KAAKL,EAAQ;AACX,eAAOG,GAAoBE,IAAU,KAAK,IAAI,CAAC;AAAA,MACjD;AACE;AAAA;EAEN;;","x_google_ignoreList":[0]}
|
package/dist/index105.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __require as h } from "./index120.js";
|
|
2
|
+
var o, a;
|
|
3
|
+
function g() {
|
|
4
|
+
if (a) return o;
|
|
5
|
+
a = 1;
|
|
6
|
+
const t = h();
|
|
7
|
+
function n(i) {
|
|
8
|
+
this.genPoly = void 0, this.degree = i, this.degree && this.initialize(this.degree);
|
|
9
|
+
}
|
|
10
|
+
return n.prototype.initialize = function(e) {
|
|
11
|
+
this.degree = e, this.genPoly = t.generateECPolynomial(this.degree);
|
|
12
|
+
}, n.prototype.encode = function(e) {
|
|
13
|
+
if (!this.genPoly)
|
|
14
|
+
throw new Error("Encoder not initialized");
|
|
15
|
+
const d = new Uint8Array(e.length + this.degree);
|
|
16
|
+
d.set(e);
|
|
17
|
+
const r = t.mod(d, this.genPoly), s = this.degree - r.length;
|
|
18
|
+
if (s > 0) {
|
|
19
|
+
const l = new Uint8Array(this.degree);
|
|
20
|
+
return l.set(r, s), l;
|
|
21
|
+
}
|
|
22
|
+
return r;
|
|
23
|
+
}, o = n, o;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
g as __require
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index105.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index105.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/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"],"names":["Polynomial","require$$0","ReedSolomonEncoder","degree","data","paddedData","remainder","start","buff","reedSolomonEncoder"],"mappings":";;;;;AAAA,QAAMA,IAAaC,EAAA;AAEnB,WAASC,EAAoBC,GAAQ;AACnC,SAAK,UAAU,QACf,KAAK,SAASA,GAEV,KAAK,UAAQ,KAAK,WAAW,KAAK,MAAM;AAAA,EAC9C;AAQA,SAAAD,EAAmB,UAAU,aAAa,SAAqBC,GAAQ;AAErE,SAAK,SAASA,GACd,KAAK,UAAUH,EAAW,qBAAqB,KAAK,MAAM;AAAA,EAC5D,GAQAE,EAAmB,UAAU,SAAS,SAAiBE,GAAM;AAC3D,QAAI,CAAC,KAAK;AACR,YAAM,IAAI,MAAM,yBAAyB;AAK3C,UAAMC,IAAa,IAAI,WAAWD,EAAK,SAAS,KAAK,MAAM;AAC3D,IAAAC,EAAW,IAAID,CAAI;AAInB,UAAME,IAAYN,EAAW,IAAIK,GAAY,KAAK,OAAO,GAKnDE,IAAQ,KAAK,SAASD,EAAU;AACtC,QAAIC,IAAQ,GAAG;AACb,YAAMC,IAAO,IAAI,WAAW,KAAK,MAAM;AACvC,aAAAA,EAAK,IAAIF,GAAWC,CAAK,GAElBC;AAAA,IACX;AAEE,WAAOF;AAAA,EACT,GAEAG,IAAiBP;;","x_google_ignoreList":[0]}
|
package/dist/index106.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __exports as f } from "./index121.js";
|
|
2
|
+
import { __require as M } from "./index97.js";
|
|
3
|
+
import { __require as w } from "./index104.js";
|
|
4
|
+
import { __require as D } from "./index98.js";
|
|
5
|
+
import { __require as p } from "./index108.js";
|
|
6
|
+
import { __require as y } from "./index122.js";
|
|
7
|
+
var B;
|
|
8
|
+
function H() {
|
|
9
|
+
return B ? f : (B = 1, (function(i) {
|
|
10
|
+
const u = M(), m = w(), l = D(), n = p(), a = y(), d = 7973, g = u.getBCHDigit(d);
|
|
11
|
+
function E(o, e, r) {
|
|
12
|
+
for (let t = 1; t <= 40; t++)
|
|
13
|
+
if (e <= i.getCapacity(t, r, o))
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
function C(o, e) {
|
|
17
|
+
return n.getCharCountIndicator(o, e) + 4;
|
|
18
|
+
}
|
|
19
|
+
function _(o, e) {
|
|
20
|
+
let r = 0;
|
|
21
|
+
return o.forEach(function(t) {
|
|
22
|
+
const s = C(t.mode, e);
|
|
23
|
+
r += s + t.getBitsLength();
|
|
24
|
+
}), r;
|
|
25
|
+
}
|
|
26
|
+
function q(o, e) {
|
|
27
|
+
for (let r = 1; r <= 40; r++)
|
|
28
|
+
if (_(o, r) <= i.getCapacity(r, e, n.MIXED))
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
i.from = function(e, r) {
|
|
32
|
+
return a.isValid(e) ? parseInt(e, 10) : r;
|
|
33
|
+
}, i.getCapacity = function(e, r, t) {
|
|
34
|
+
if (!a.isValid(e))
|
|
35
|
+
throw new Error("Invalid QR Code version");
|
|
36
|
+
typeof t > "u" && (t = n.BYTE);
|
|
37
|
+
const s = u.getSymbolTotalCodewords(e), V = m.getTotalCodewordsCount(e, r), h = (s - V) * 8;
|
|
38
|
+
if (t === n.MIXED) return h;
|
|
39
|
+
const c = h - C(t, e);
|
|
40
|
+
switch (t) {
|
|
41
|
+
case n.NUMERIC:
|
|
42
|
+
return Math.floor(c / 10 * 3);
|
|
43
|
+
case n.ALPHANUMERIC:
|
|
44
|
+
return Math.floor(c / 11 * 2);
|
|
45
|
+
case n.KANJI:
|
|
46
|
+
return Math.floor(c / 13);
|
|
47
|
+
case n.BYTE:
|
|
48
|
+
default:
|
|
49
|
+
return Math.floor(c / 8);
|
|
50
|
+
}
|
|
51
|
+
}, i.getBestVersionForData = function(e, r) {
|
|
52
|
+
let t;
|
|
53
|
+
const s = l.from(r, l.M);
|
|
54
|
+
if (Array.isArray(e)) {
|
|
55
|
+
if (e.length > 1)
|
|
56
|
+
return q(e, s);
|
|
57
|
+
if (e.length === 0)
|
|
58
|
+
return 1;
|
|
59
|
+
t = e[0];
|
|
60
|
+
} else
|
|
61
|
+
t = e;
|
|
62
|
+
return E(t.mode, t.getLength(), s);
|
|
63
|
+
}, i.getEncodedBits = function(e) {
|
|
64
|
+
if (!a.isValid(e) || e < 7)
|
|
65
|
+
throw new Error("Invalid QR Code version");
|
|
66
|
+
let r = e << 12;
|
|
67
|
+
for (; u.getBCHDigit(r) - g >= 0; )
|
|
68
|
+
r ^= d << u.getBCHDigit(r) - g;
|
|
69
|
+
return e << 12 | r;
|
|
70
|
+
};
|
|
71
|
+
})(f), f);
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
H as __require
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=index106.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index106.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js"],"sourcesContent":["const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\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 dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n"],"names":["Utils","require$$0","ECCode","require$$1","ECLevel","require$$2","Mode","require$$3","VersionCheck","require$$4","G18","G18_BCH","getBestVersionForDataLength","mode","length","errorCorrectionLevel","currentVersion","exports","getReservedBitsCount","version","getTotalBitsFromDataArray","segments","totalBits","data","reservedBits","getBestVersionForMixedData","value","defaultValue","totalCodewords","ecTotalCodewords","dataTotalCodewordsBits","usableBits","seg","ecl","d"],"mappings":";;;;;;;;;AAAA,UAAMA,IAAQC,EAAA,GACRC,IAASC,EAAA,GACTC,IAAUC,EAAA,GACVC,IAAOC,EAAA,GACPC,IAAeC,EAAA,GAGfC,IAAO,MACPC,IAAUX,EAAM,YAAYU,CAAG;AAErC,aAASE,EAA6BC,GAAMC,GAAQC,GAAsB;AACxE,eAASC,IAAiB,GAAGA,KAAkB,IAAIA;AACjD,Y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AK,MAAOyB,IAAa,KAAM,CAAC;AAAA,QAEzC,KAAKzB,EAAK;AACR,iBAAO,KAAK,MAAMyB,IAAa,EAAE;AAAA,QAEnC,KAAKzB,EAAK;AAAA,QACV;AACE,iBAAO,KAAK,MAAMyB,IAAa,CAAC;AAAA,MACtC;AAAA,IACA,GAUAd,EAAA,wBAAgC,SAAgCM,GAAMR,GAAsB;AAC1F,UAAIiB;AAEJ,YAAMC,IAAM7B,EAAQ,KAAKW,GAAsBX,EAAQ,CAAC;AAExD,UAAI,MAAM,QAAQmB,CAAI,GAAG;AACvB,YAAIA,EAAK,SAAS;AAChB,iBAAOE,EAA2BF,GAAMU,CAAG;AAG7C,YAAIV,EAAK,WAAW;AAClB,iBAAO;AAGT,QAAAS,IAAMT,EAAK,CAAC;AAAA,MAChB;AACI,QAAAS,IAAMT;AAGR,aAAOX,EAA4BoB,EAAI,MAAMA,EAAI,UAAS,GAAIC,CAAG;AAAA,IACnE,GAYAhB,EAAA,iBAAyB,SAAyBE,GAAS;AACzD,UAAI,CAACX,EAAa,QAAQW,CAAO,KAAKA,IAAU;AAC9C,cAAM,IAAI,MAAM,yBAAyB;AAG3C,UAAIe,IAAIf,KAAW;AAEnB,aAAOnB,EAAM,YAAYkC,CAAC,IAAIvB,KAAW;AACvC,QAAAuB,KAAMxB,KAAQV,EAAM,YAAYkC,CAAC,IAAIvB;AAGvC,aAAQQ,KAAW,KAAMe;AAAA,IAC3B;AAAA;;","x_google_ignoreList":[0]}
|
package/dist/index107.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __exports as e } from "./index123.js";
|
|
2
|
+
import { __require as f } from "./index97.js";
|
|
3
|
+
var s;
|
|
4
|
+
function m() {
|
|
5
|
+
if (s) return e;
|
|
6
|
+
s = 1;
|
|
7
|
+
const r = f(), i = 1335, a = 21522, o = r.getBCHDigit(i);
|
|
8
|
+
return e.getEncodedBits = function(u, c) {
|
|
9
|
+
const n = u.bit << 3 | c;
|
|
10
|
+
let t = n << 10;
|
|
11
|
+
for (; r.getBCHDigit(t) - o >= 0; )
|
|
12
|
+
t ^= i << r.getBCHDigit(t) - o;
|
|
13
|
+
return (n << 10 | t) ^ a;
|
|
14
|
+
}, e;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
m as __require
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index107.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index107.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js"],"sourcesContent":["const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Number} mask Mask pattern\n * @return {Number} Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n const data = ((errorCorrectionLevel.bit << 3) | mask)\n let d = data << 10\n\n while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n }\n\n // xor final data with mask pattern in order to ensure that\n // no combination of Error Correction Level and data mask pattern\n // will result in an all-zero data string\n return ((data << 10) | d) ^ G15_MASK\n}\n"],"names":["Utils","require$$0","G15","G15_MASK","G15_BCH","formatInfo","errorCorrectionLevel","mask","data","d"],"mappings":";;;;;;AAAA,QAAMA,IAAQC,EAAA,GAERC,IAAO,MACPC,IAAY,OACZC,IAAUJ,EAAM,YAAYE,CAAG;AAYrC,SAAAG,EAAA,iBAAyB,SAAyBC,GAAsBC,GAAM;AAC5E,UAAMC,IAASF,EAAqB,OAAO,IAAKC;AAChD,QAAIE,IAAID,KAAQ;AAEhB,WAAOR,EAAM,YAAYS,CAAC,IAAIL,KAAW;AACvC,MAAAK,KAAMP,KAAQF,EAAM,YAAYS,CAAC,IAAIL;AAMvC,YAASI,KAAQ,KAAMC,KAAKN;AAAA,EAC9B;;","x_google_ignoreList":[0]}
|