earthnut 0.1.7-alpha.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +105 -2
  2. package/components/image/index.d.ts +12 -0
  3. package/components/image/types.d.ts +12 -0
  4. package/components/image/useSrcChange.d.ts +11 -0
  5. package/components/ripples/LazyRippleEle.d.ts +1 -1
  6. package/components/ripples/RipplesEle.d.ts +2 -2
  7. package/components/ripples/types.d.ts +1 -1
  8. package/components/ripples/useOptionUpdate.d.ts +1 -1
  9. package/customHooks/useAnimationFrame.d.ts +36 -17
  10. package/customHooks/useInputIsComposing.d.ts +7 -7
  11. package/customHooks/useRipples/buildBackground/utils/create-canvas-element.d.ts +1 -1
  12. package/customHooks/useRipples/index.d.ts +2 -4
  13. package/customHooks/useRipples/use-lazy-ripple.d.ts +5 -4
  14. package/customHooks/useTimeId.d.ts +0 -2
  15. package/index.cjs +1 -1
  16. package/index.d.ts +17 -3
  17. package/index.mjs +1 -1
  18. package/package.json +4 -54
  19. package/styles/common.css +252 -137
  20. package/styles/common.scss +26 -106
  21. package/styles/reset.scss +103 -0
  22. package/styles/respond.scss +54 -0
  23. package/styles/root.scss +94 -0
  24. package/styles/vars.scss +248 -0
  25. package/705/index.cjs +0 -7
  26. package/705/index.mjs +0 -7
  27. package/BackgroundRipple/index.cjs +0 -7
  28. package/BackgroundRipple/index.mjs +0 -7
  29. package/Layout/index.cjs +0 -7
  30. package/Layout/index.mjs +0 -7
  31. package/LazyBackgroundRipple/index.cjs +0 -7
  32. package/LazyBackgroundRipple/index.mjs +0 -7
  33. package/components/index.d.ts +0 -12
  34. package/customHooks/index.d.ts +0 -12
  35. package/dog.d.ts +0 -8
  36. package/useAnimationFrame/index.cjs +0 -7
  37. package/useAnimationFrame/index.mjs +0 -7
  38. package/useInputIsComposing/index.cjs +0 -7
  39. package/useInputIsComposing/index.mjs +0 -7
  40. package/useLazyRipples/index.cjs +0 -7
  41. package/useLazyRipples/index.mjs +0 -7
  42. package/useRipples/index.cjs +0 -7
  43. package/useRipples/index.mjs +0 -7
  44. package/useTimeId/index.cjs +0 -7
  45. package/useTimeId/index.mjs +0 -7
@@ -0,0 +1,103 @@
1
+ @use "./root.scss";
2
+
3
+ /* 盒模型 规则 */
4
+ *,
5
+ *::before,
6
+ *::after {
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ /* 移除默认的 margin 外边距 */
11
+ body,
12
+ h1,
13
+ h2,
14
+ h3,
15
+ h4,
16
+ p,
17
+ figure,
18
+ blockquote,
19
+ dl,
20
+ dd {
21
+ margin: 0;
22
+ }
23
+
24
+ ul,
25
+ ol {
26
+ list-style: none;
27
+ margin: 0;
28
+ padding: 0;
29
+ }
30
+
31
+ /* 设置根元素 html 默认样式 */
32
+ html {
33
+ scroll-behavior: smooth;
34
+ }
35
+
36
+ /* 设置默认的 body 元素的样式 */
37
+ body {
38
+ font-family: var(--en-font-body);
39
+ font-size: var(--en-base-font-size);
40
+ line-height: var(--en-font-content-line-height);
41
+ text-rendering: optimizeSpeed;
42
+ }
43
+
44
+ /* 链接元素没有 class 类时的展示 */
45
+ a:not([class]) {
46
+ text-decoration-skip-ink: auto;
47
+ }
48
+
49
+ a {
50
+ text-decoration: none;
51
+ }
52
+
53
+ /* 设置图片样式 */
54
+ img,
55
+ picture {
56
+ display: block;
57
+ max-width: 100%;
58
+ }
59
+
60
+ /* Fix Inter font bug: 'em' not slanted in Safari. See issue: https://github.com/mdn/yari/issues/7203 */
61
+ em {
62
+ font-variation-settings: "slnt" -10;
63
+ }
64
+
65
+ /* Inherit fonts for inputs and buttons */
66
+ input,
67
+ button,
68
+ textarea,
69
+ select {
70
+ font: inherit;
71
+ }
72
+
73
+ /* 自动填充的密码的背景色设置动画已取消背景色 */
74
+ input:-webkit-autofill,
75
+ input:-webkit-autofill:hover,
76
+ input:-webkit-autofill:focus,
77
+ input:-webkit-autofill:active {
78
+ transition-delay: 99999s;
79
+ transition:
80
+ color 99999s ease-out,
81
+ background-color 99999s ease-out;
82
+ -webkit-transition-delay: 99999s;
83
+ -webkit-transition:
84
+ color 99999s ease-out,
85
+ background-color 99999s ease-out;
86
+ -webkit-text-fill-color: var(--text-primary);
87
+ }
88
+
89
+ /* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
90
+ @media (prefers-reduced-motion: reduce) {
91
+ html {
92
+ scroll-behavior: auto;
93
+ }
94
+
95
+ *,
96
+ *::before,
97
+ *::after {
98
+ animation-duration: 0.01ms !important;
99
+ animation-iteration-count: 1 !important;
100
+ scroll-behavior: auto !important;
101
+ transition-duration: 0.01ms !important;
102
+ }
103
+ }
@@ -0,0 +1,54 @@
1
+ @use "./root.scss";
2
+
3
+ // 响应式断点变量
4
+ $breakpoints: (
5
+ // 手机竖屏
6
+ sm: 576px,
7
+ // 平板,大手机
8
+ md: 768px,
9
+ // 小桌面
10
+ lg: 992px,
11
+ // 标准桌面
12
+ xl: 1200px,
13
+ // 大桌面
14
+ xxl: 1400px
15
+ );
16
+
17
+ // 移动优先
18
+ // 基础媒体查询混入
19
+ @mixin respond-to($breakpoint) {
20
+ $value: map-get($breakpoints, $breakpoint);
21
+
22
+ @if $value {
23
+ @media screen and (min-width: $value) {
24
+ @content;
25
+ }
26
+ } @else {
27
+ @error "为定义的断点:`#{$breakpoint}`。";
28
+ }
29
+ }
30
+
31
+ // 悬停能力检测混入 - 移动优先
32
+ @mixin hover-supported {
33
+ @media (hover: hover) and (pointer: fine) {
34
+ &:hover {
35
+ @content;
36
+ }
37
+ }
38
+ }
39
+
40
+ // 混合响应式和悬停的复合混入
41
+ @mixin respond-with-hover($breakpoint) {
42
+ @include respond-to($breakpoint) {
43
+ @include hover-supported {
44
+ @content;
45
+ }
46
+ }
47
+ }
48
+
49
+ // 禁用动画
50
+ @mixin hover-forbidden {
51
+ @media (hover: none) {
52
+ @content;
53
+ }
54
+ }
@@ -0,0 +1,94 @@
1
+ $color-white: #ffffff;
2
+
3
+ @mixin light {
4
+ // 基色
5
+ --en-primary-white: $color-white;
6
+ --en-primary-black: #1b1b1b;
7
+ --en-primary-dust: #6f6f6f;
8
+ --en-primary-red: #d30038;
9
+ --en-primary-green: #007936;
10
+ --en-primary-blue: #0069c2;
11
+ --en-primary-yellow: #746a00;
12
+ --en-primary-super-yellow: #ffff00;
13
+ // 文本色
14
+ --en-text-primary: #1b1b1b;
15
+ --en-text-secondary: #4e4e4e;
16
+ --en-text-invert: var(--en-primary-white); // 文本反转色
17
+ --en-text-muted: var(--en-primary-dust); // 温和文本色
18
+ // 链接文本色
19
+ --en-text-link: #0069c2;
20
+ --en-text-visited: #551a8b;
21
+ --en-text-hover: var(--en-primary-red);
22
+ --en-text-visited: #551a8b;
23
+ --en-text-active: #858585;
24
+ --en-text-inactive: #9e9e9ea6; // 无效链接色
25
+ // 背景色
26
+ --en-background-primary: var(--en-primary-white);
27
+ --en-background-tab-level-1: var(--en-primary-black);
28
+ --en-background-tab-level-2: var(--en-primary-dust);
29
+ --en-background-tab-transparent: #6666;
30
+ --en-table-border-color: #000;
31
+ --en-curriculum-shadow: 4px 4px 8px 0 #b3b3b32e, -4px 4px 8px 0 #b3b3b326;
32
+ --en-curriculum-shadow-landing-about-ul: 0 4px 10px 0 #e3642a0f, 0 -2px 4px 0 #b25c350f;
33
+ --en-box-shadow: 1px 1px 12px #6666;
34
+ --en-box-shadow-primary: 1px 1px 12px #6666;
35
+ --en-box-shadow-primary-small: 1px 1px 3px #6666;
36
+ --en-box-shadow-primary-large: 1px 1px 24px #6666;
37
+ color-scheme: light;
38
+ }
39
+
40
+ @mixin dark {
41
+ // 基色
42
+ --en-primary-white: #ffffff;
43
+ --en-primary-black: #1b1b1b;
44
+ --en-primary-dust: #858585;
45
+ --en-primary-red: #ff97a0;
46
+ --en-primary-green: #00d061;
47
+ --en-primary-blue: #8cb4ff;
48
+ --en-primary-yellow: #c7b700;
49
+ // 文本色
50
+ --en-text-primary: #fff;
51
+ --en-text-secondary: #cdcdcd;
52
+ --en-text-invert: var(--en-primary-black); // 文本反转色
53
+ --en-text-muted: var(--en-primary-dust); // 温和文本色
54
+ // 普通链接文本色
55
+ --en-text-link: #8cb4ff;
56
+ --en-text-visited: #ffadff;
57
+ --en-text-hover: var(--en-primary-red);
58
+ --en-text-active: #858585;
59
+ --en-text-inactive: #cdcdcda6; // 无效链接色
60
+ // 背景色
61
+ --en-background-primary: var(--en-primary-black);
62
+ --en-background-tab-level-1: #666666;
63
+ --en-background-tab-level-2: var(--en-primary-dust);
64
+ --en-background-tab-transparent: #6666;
65
+ --en-table-border-color: #ff3663;
66
+ --en-box-shadow: 1px 1px 12px #6666;
67
+ --en-box-shadow-primary: 1px 1px 12px #6666;
68
+ --en-box-shadow-primary-small: 1px 1px 3px #6666;
69
+ --en-box-shadow-primary-large: 1px 1px 24px #6666;
70
+ color-scheme: dark;
71
+ }
72
+
73
+ :root {
74
+ @include light();
75
+ }
76
+
77
+ @media (prefers-color-scheme: light) {
78
+ :root:not(.en-light):not(.en-dark) {
79
+ @include light();
80
+ }
81
+ }
82
+ @media (prefers-color-scheme: dark) {
83
+ :root:not(.en-light):not(.en-dark) {
84
+ @include dark();
85
+ }
86
+ }
87
+
88
+ .en-light {
89
+ @include light();
90
+ }
91
+
92
+ .en-dark {
93
+ @include dark();
94
+ }
@@ -0,0 +1,248 @@
1
+ $en-color-neutral-light-70: #f9f9fb;
2
+ $en-color-neutral-light-80: #f2f1f1;
3
+ $en-color-neutral-light-90: #ebeaea;
4
+
5
+ $en-color-neutral-10: #e2e2e2;
6
+ $en-color-neutral-20: #cdcdcd;
7
+ $en-color-neutral-30: #b3b3b3;
8
+ $en-color-neutral-40: #9e9e9e;
9
+ $en-color-neutral-50: #858585;
10
+ $en-color-neutral-60: #696969;
11
+ $en-color-neutral-70: #4e4e4e;
12
+ $en-color-neutral-75: #313131;
13
+ $en-color-neutral-80: #343434;
14
+ $en-color-neutral-90: #1b1b1b;
15
+
16
+ $en-color-light-theme-blue: #0085f2;
17
+ $en-color-light-theme-green: #009a46;
18
+ $en-color-light-theme-yellow: #928700;
19
+ $en-color-light-theme-red: #d30038;
20
+ $en-color-light-theme-violet: #9b65ff;
21
+ $en-color-light-theme-pink: #d00058;
22
+
23
+ $en-color-dark-theme-blue: $en-color-light-theme-blue;
24
+ $en-color-dark-theme-green: $en-color-light-theme-green;
25
+ $en-color-dark-theme-yellow: $en-color-light-theme-yellow;
26
+ $en-color-dark-theme-red: $en-color-light-theme-red;
27
+ $en-color-dark-theme-violet: $en-color-light-theme-violet;
28
+ $en-color-dark-theme-pink: $en-color-light-theme-pink;
29
+
30
+ $en-color-light-theme-blue-10: #dce2f2;
31
+ $en-color-light-theme-blue-20: #c1cff1;
32
+ $en-color-light-theme-blue-30: #8cb4ff;
33
+ $en-color-light-theme-blue-40: #5e9eff;
34
+ $en-color-light-theme-blue-50: #0085f2;
35
+ $en-color-light-theme-blue-60: #0069c2;
36
+ $en-color-light-theme-blue-70: #004d92;
37
+ $en-color-light-theme-blue-80: #003465;
38
+ $en-color-light-theme-blue-90: #001b3a;
39
+
40
+ $en-color-dark-theme-blue-10: $en-color-light-theme-blue-10;
41
+ $en-color-dark-theme-blue-20: $en-color-light-theme-blue-20;
42
+ $en-color-dark-theme-blue-30: $en-color-light-theme-blue-30;
43
+ $en-color-dark-theme-blue-40: $en-color-light-theme-blue-40;
44
+ $en-color-dark-theme-blue-50: $en-color-light-theme-blue-50;
45
+ $en-color-dark-theme-blue-60: $en-color-light-theme-blue-60;
46
+ $en-color-dark-theme-blue-70: $en-color-light-theme-blue-70;
47
+ $en-color-dark-theme-blue-80: $en-color-light-theme-blue-80;
48
+ $en-color-dark-theme-blue-90: $en-color-light-theme-blue-90;
49
+
50
+ $en-color-light-theme-green-10: #a9f3ba;
51
+ $en-color-light-theme-green-20: #73e693;
52
+ $en-color-light-theme-green-30: #00d061;
53
+ $en-color-light-theme-green-40: #00b755;
54
+ $en-color-light-theme-green-50: #009a46;
55
+ $en-color-light-theme-green-60: #007936;
56
+ $en-color-light-theme-green-70: #005a26;
57
+ $en-color-light-theme-green-80: #003d18;
58
+ $en-color-light-theme-green-90: #00210a;
59
+
60
+ $en-color-dark-theme-green-10: $en-color-light-theme-green-10;
61
+ $en-color-dark-theme-green-20: $en-color-light-theme-green-20;
62
+ $en-color-dark-theme-green-30: $en-color-light-theme-green-30;
63
+ $en-color-dark-theme-green-40: $en-color-light-theme-green-40;
64
+ $en-color-dark-theme-green-50: $en-color-light-theme-green-50;
65
+ $en-color-dark-theme-green-60: $en-color-light-theme-green-60;
66
+ $en-color-dark-theme-green-70: $en-color-light-theme-green-70;
67
+ $en-color-dark-theme-green-80: $en-color-light-theme-green-80;
68
+ $en-color-dark-theme-green-90: $en-color-light-theme-green-90;
69
+
70
+ $en-color-light-theme-yellow-10: #f0e498;
71
+ $en-color-light-theme-yellow-20: #dfd172;
72
+ $en-color-light-theme-yellow-30: #c7b700;
73
+ $en-color-light-theme-yellow-40: #afa100;
74
+ $en-color-light-theme-yellow-50: #938700;
75
+ $en-color-light-theme-yellow-60: #746a00;
76
+ $en-color-light-theme-yellow-70: #564e00;
77
+ $en-color-light-theme-yellow-80: #3a3500;
78
+ $en-color-light-theme-yellow-90: #1f1c00;
79
+
80
+ $en-color-dark-theme-yellow-10: $en-color-light-theme-yellow-10;
81
+ $en-color-dark-theme-yellow-20: $en-color-light-theme-yellow-20;
82
+ $en-color-dark-theme-yellow-30: $en-color-light-theme-yellow-30;
83
+ $en-color-dark-theme-yellow-40: $en-color-light-theme-yellow-40;
84
+ $en-color-dark-theme-yellow-50: $en-color-light-theme-yellow-50;
85
+ $en-color-dark-theme-yellow-60: $en-color-light-theme-yellow-60;
86
+ $en-color-dark-theme-yellow-70: $en-color-light-theme-yellow-70;
87
+ $en-color-dark-theme-yellow-80: $en-color-light-theme-yellow-80;
88
+ $en-color-dark-theme-yellow-90: $en-color-light-theme-yellow-90;
89
+
90
+ $en-color-light-theme-red-10: #ffd9dc;
91
+ $en-color-light-theme-red-20: #ffc0c4;
92
+ $en-color-light-theme-red-30: #ff97a0;
93
+ $en-color-light-theme-red-40: #ff707f;
94
+ $en-color-light-theme-red-50: #ff2a51;
95
+ $en-color-light-theme-red-60: #d30038;
96
+ $en-color-light-theme-red-70: #9e0027;
97
+ $en-color-light-theme-red-80: #6f0019;
98
+ $en-color-light-theme-red-90: #40000a;
99
+
100
+ $en-color-dark-theme-red-10: $en-color-light-theme-red-10;
101
+ $en-color-dark-theme-red-20: $en-color-light-theme-red-20;
102
+ $en-color-dark-theme-red-30: $en-color-light-theme-red-30;
103
+ $en-color-dark-theme-red-40: $en-color-light-theme-red-40;
104
+ $en-color-dark-theme-red-50: $en-color-light-theme-red-50;
105
+ $en-color-dark-theme-red-60: $en-color-light-theme-red-60;
106
+ $en-color-dark-theme-red-70: $en-color-light-theme-red-70;
107
+ $en-color-dark-theme-red-80: $en-color-light-theme-red-80;
108
+ $en-color-dark-theme-red-90: $en-color-light-theme-red-90;
109
+
110
+ $en-color-light-theme-violet-10: #e6deff;
111
+ $en-color-light-theme-violet-20: #d4c5ff;
112
+ $en-color-light-theme-violet-30: #bea5ff;
113
+ $en-color-light-theme-violet-40: #ae8aff;
114
+ $en-color-light-theme-violet-50: #9b65ff;
115
+ $en-color-light-theme-violet-60: #872bff;
116
+ $en-color-light-theme-violet-70: #6800cf;
117
+ $en-color-light-theme-violet-80: #480091;
118
+ $en-color-light-theme-violet-90: #280056;
119
+
120
+ $en-color-dark-theme-violet-10: $en-color-light-theme-violet-10;
121
+ $en-color-dark-theme-violet-20: $en-color-light-theme-violet-20;
122
+ $en-color-dark-theme-violet-30: $en-color-light-theme-violet-30;
123
+ $en-color-dark-theme-violet-40: $en-color-light-theme-violet-40;
124
+ $en-color-dark-theme-violet-50: $en-color-light-theme-violet-50;
125
+ $en-color-dark-theme-violet-60: $en-color-light-theme-violet-60;
126
+ $en-color-dark-theme-violet-70: $en-color-light-theme-violet-70;
127
+ $en-color-dark-theme-violet-80: $en-color-light-theme-violet-80;
128
+ $en-color-dark-theme-violet-90: $en-color-light-theme-violet-90;
129
+
130
+ $en-color-light-theme-pink-10: #ffd9df;
131
+ $en-color-light-theme-pink-20: #ffbbc8;
132
+ $en-color-light-theme-pink-30: #ff93aa;
133
+ $en-color-light-theme-pink-40: #ff6d91;
134
+ $en-color-light-theme-pink-50: #ff1f72;
135
+ $en-color-light-theme-pink-60: #d00058;
136
+ $en-color-light-theme-pink-70: #9e0041;
137
+ $en-color-light-theme-pink-80: #6d002b;
138
+ $en-color-light-theme-pink-90: #3f0015;
139
+
140
+ $en-color-dark-theme-pink-10: $en-color-light-theme-pink-10;
141
+ $en-color-dark-theme-pink-20: $en-color-light-theme-pink-20;
142
+ $en-color-dark-theme-pink-30: $en-color-light-theme-pink-30;
143
+ $en-color-dark-theme-pink-40: $en-color-light-theme-pink-40;
144
+ $en-color-dark-theme-pink-50: $en-color-light-theme-pink-50;
145
+ $en-color-dark-theme-pink-60: $en-color-light-theme-pink-60;
146
+ $en-color-dark-theme-pink-70: $en-color-light-theme-pink-70;
147
+ $en-color-dark-theme-pink-80: $en-color-light-theme-pink-80;
148
+ $en-color-dark-theme-pink-90: $en-color-light-theme-pink-90;
149
+
150
+ $en-color-black: #000;
151
+ $en-color-white: #fff;
152
+ $en-color-ads: #00d0aa;
153
+
154
+ $en-theme-light-text-primary: $en-color-neutral-90;
155
+ $en-theme-light-text-secondary: $en-color-neutral-70;
156
+ $en-theme-light-text-active: #{$en-color-neutral-50};
157
+ $en-theme-light-text-inactive: #{$en-color-neutral-40}a6;
158
+ $en-theme-light-text-link: $en-color-light-theme-blue-60;
159
+ $en-theme-light-text-invert: $en-color-white;
160
+ $en-theme-light-text-muted: #6f6f6f;
161
+ $en-theme-light-background-primary: $en-color-white;
162
+ $en-theme-light-background-secondary: $en-color-neutral-light-70;
163
+ $en-theme-light-background-tertiary: #ebeaea;
164
+ $en-theme-light-background-toc-active: $en-color-neutral-light-90;
165
+ $en-theme-light-border-primary: $en-color-neutral-20;
166
+ $en-theme-light-border-secondary: $en-color-neutral-20;
167
+ $en-theme-light-border-success: $en-color-light-theme-green-20;
168
+ $en-theme-light-button-primary-default: $en-color-neutral-90;
169
+ $en-theme-light-button-primary-hover: $en-color-neutral-60;
170
+ $en-theme-light-button-primary-active: $en-color-neutral-40;
171
+ $en-theme-light-button-primary-inactive: $en-color-neutral-90;
172
+ $en-theme-light-button-secondary-default: $en-color-white;
173
+ $en-theme-light-button-secondary-hover: $en-color-neutral-20;
174
+ $en-theme-light-button-secondary-active: $en-color-neutral-20;
175
+ $en-theme-light-button-secondary-inactive: $en-color-neutral-light-70;
176
+ $en-theme-light-button-secondary-border-focus: $en-color-light-theme-blue-50;
177
+ $en-theme-light-button-secondary-border-red: $en-color-light-theme-red-30;
178
+ $en-theme-light-button-secondary-border-red-focus: $en-color-light-theme-red-10;
179
+ $en-theme-light-icon-primary: $en-color-neutral-60;
180
+ $en-theme-light-icon-secondary: $en-color-neutral-30;
181
+ $en-theme-light-icon-information: $en-color-light-theme-blue-50;
182
+ $en-theme-light-icon-warning: $en-color-light-theme-red-50;
183
+ $en-theme-light-icon-critical: $en-color-light-theme-red-60;
184
+ $en-theme-light-icon-success: $en-color-light-theme-green-60;
185
+ $en-theme-light-accent-primary: $en-color-light-theme-blue-50;
186
+ $en-theme-light-accent-secondary: $en-color-light-theme-blue-50;
187
+ $en-theme-light-field-focus-border: $en-color-light-theme-blue-50;
188
+ $en-theme-light-focus-01: 0 0 0 3px rgba(0, 144, 237, 0.4);
189
+ $en-theme-light-shadow-01: 0 1px 2px rgba(43, 42, 51, 0.05);
190
+ $en-theme-light-shadow-02: 0 1px 6px rgba(43, 42, 51, 0.1);
191
+
192
+ $en-theme-light-code-token-tag: $en-color-light-theme-blue-60;
193
+ $en-theme-light-code-token-punctuation: $en-color-neutral-50;
194
+ $en-theme-light-code-token-attribute-name: $en-color-light-theme-red-60;
195
+ $en-theme-light-code-token-attribute-value: $en-color-light-theme-green-60;
196
+ $en-theme-light-code-token-comment: $en-color-neutral-50;
197
+ $en-theme-light-code-token-default: $en-color-neutral-90;
198
+ $en-theme-light-code-token-selector: $en-color-light-theme-violet-60;
199
+ $en-theme-light-code-background-inline: $en-color-neutral-light-80;
200
+ $en-theme-light-code-background-block: $en-color-neutral-light-80;
201
+
202
+ $en-theme-dark-text-primary: $en-color-white;
203
+ $en-theme-dark-text-secondary: $en-color-neutral-20;
204
+ $en-theme-dark-text-active: #{$en-color-neutral-50};
205
+ $en-theme-dark-text-inactive: #{$en-color-neutral-20}a6;
206
+ $en-theme-dark-text-link: $en-color-dark-theme-blue-30;
207
+ $en-theme-dark-text-invert: $en-color-neutral-90;
208
+ $en-theme-dark-text-muted: #858585;
209
+ $en-theme-dark-background-primary: $en-color-neutral-90;
210
+ $en-theme-dark-background-secondary: $en-color-neutral-75;
211
+ $en-theme-dark-background-tertiary: #858585;
212
+ $en-theme-dark-background-toc-active: $en-color-neutral-80;
213
+ $en-theme-dark-border-primary: $en-color-neutral-50;
214
+ $en-theme-dark-border-secondary: $en-color-neutral-60;
215
+ $en-theme-dark-border-success: $en-color-dark-theme-green-20;
216
+ $en-theme-dark-button-primary-default: $en-color-white;
217
+ $en-theme-dark-button-primary-hover: $en-color-neutral-20;
218
+ $en-theme-dark-button-primary-active: $en-color-neutral-40;
219
+ $en-theme-dark-button-primary-inactive: $en-color-white;
220
+ $en-theme-dark-button-secondary-default: $en-color-neutral-70;
221
+ $en-theme-dark-button-secondary-hover: $en-color-neutral-50;
222
+ $en-theme-dark-button-secondary-active: $en-color-neutral-40;
223
+ $en-theme-dark-button-secondary-inactive: $en-color-neutral-70;
224
+ $en-theme-dark-shadow-01: 0 1px 2px rgba(251, 251, 254, 0.2);
225
+ $en-theme-dark-shadow-02: 0 1px 6px rgba(251, 251, 254, 0.2);
226
+ $en-theme-dark-icon-primary: $en-color-white;
227
+ $en-theme-dark-icon-secondary: $en-color-neutral-30;
228
+ $en-theme-dark-icon-information: $en-color-dark-theme-blue-40;
229
+ $en-theme-dark-icon-warning: $en-color-dark-theme-yellow-40;
230
+ $en-theme-dark-icon-critical: $en-color-dark-theme-red-40;
231
+ $en-theme-dark-icon-success: $en-color-dark-theme-green-40;
232
+ $en-theme-dark-accent-primary: $en-color-dark-theme-blue-40;
233
+ $en-theme-dark-accent-secondary: $en-color-dark-theme-blue-40;
234
+ $en-theme-dark-field-focus-border: $en-color-white;
235
+ $en-theme-dark-focus-01: 0 0 0 3px rgba(251, 251, 254, 0.5);
236
+
237
+ $en-theme-dark-code-token-tag: $en-color-dark-theme-blue-20;
238
+ $en-theme-dark-code-token-punctuation: $en-color-neutral-30;
239
+ $en-theme-dark-code-token-attribute-name: $en-color-dark-theme-red-30;
240
+ $en-theme-dark-code-token-attribute-value: $en-color-dark-theme-green-30;
241
+ $en-theme-dark-code-token-comment: $en-color-neutral-30;
242
+ $en-theme-dark-code-token-default: $en-color-white;
243
+ $en-theme-dark-code-token-selector: $en-color-dark-theme-violet-30;
244
+ $en-theme-dark-code-background-inline: $en-color-neutral-80;
245
+ $en-theme-dark-code-background-block: $en-color-neutral-80;
246
+
247
+ // screen is to small for sticky placement
248
+ $screen-height-place-limit: 44rem;
package/705/index.cjs DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * @license MIT
3
- * earthnut@705/index.cjs
4
- * Copyright (c) 2025 earthnut.dev
5
- * 请在项目根参看详细许可证明
6
- */
7
- "use client";"use strict";(self.webpackChunkearthnut=self.webpackChunkearthnut||[]).push([[705],{705:(t,e,r)=>{r.r(e),r.d(e,{useRipples:()=>ne});var n=r(953),i=r(378),o=r(570);function a(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var a,l={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(l.id,i(r.VERTEX_SHADER,t)),r.attachShader(l.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(l.id),!r.getProgramParameter(l.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(l.id));r.useProgram(l.id),r.enableVertexAttribArray(0);for(var s=t+e,u=/uniform (\w+) (\w+)/g;!(0,o.isNull)(a=u.exec(s));){var c=a[2];l.locations[c]=r.getUniformLocation(l.id,c)}return l}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function s(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function u(t){return"none"===t||""===t}function c(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce(function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t},[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var s=null,u=0;u<i.length;u++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[u].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){s=i[u];break}return s}function f(t){"@babel/helpers - typeof";return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,g(n.key),n)}}function p(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}var m=p(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,"canvas",void 0),d(this,"gl",void 0),d(this,"config",void 0),d(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,o.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(c,this,[])}),v=r(86),y={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0,darkMode:void 0};Object.freeze(y);var b;r(713);function E(t){"@babel/helpers - typeof";return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R(n.key),n)}}function R(t){var e=function(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==E(e)?e:e+""}function T(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function k(t,e,r){return t.set(P(t,e),r),r}function S(t,e){return t.get(P(t,e))}function P(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function D(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={list:[],diameter:48,radius:0,cells:0};r.diameter%2!=0&&r.diameter++;var n=r.diameter,i=r.list,o=n/2;r.radius=o,r.cells=Math.pow(n,2);for(var a=0;a<n;a++){i[a]=[];for(var l=0;l<n;l++)i[a][l]=[0,0,0,0]}for(var s=0;s<=o;s++)for(var u=function(){var t=i[s][c],r=Math.ceil(Math.sqrt(Math.pow(s,2)+Math.pow(c,2)))<=o,n=e?10:255,a=e?25:190,l=r?e?160:120:e?160:180,u=r?e?230:160:e?250:240,f=function(){return(0,v.getRandomInt)(n,a)};t[0]=f(),t[1]=f(),t[2]=f(),t[3]=(0,v.getRandomInt)(l,u)},c=s;c<=o;c++)u();for(var f=0;f<=o;f++)for(var h=0;h<=f;h++)i[f][h]=i[h][f];for(var p=o;p<n;p++)for(var d=0;d<=o;d++)i[p][d]=i[n-p][d];for(var g=0;g<o;g++)for(var m=o;m<n;m++)i[g][m]=i[g][n-m];for(var y=o;y<n;y++)for(var b=o;b<n;b++)i[y][b]=i[y][n-b];var E=t%n;return r.list=[].concat(D(i.slice(E)),D(i.slice(0,E))),r},A=new(b=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,b,1),e=this,r="data",n=x(),(r=R(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(t){S(b,this)>100&&k(b,this,0),this.data=x(k(b,this,S(b,this)+4),t)}}])&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function O(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),a=n.getContext("2d");return(0,o.isNull)(i)||(0,o.isNull)(a)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),a.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=A.data,o=i.diameter,a=i.list,l=t*o,s=0;s<n.length;s+=4){var u=s/4%l,c=u%t%o,f=Math.floor(u/t),h=a[c][f];n[s]=h[0],n[s+1]=h[1],n[s+2]=h[2],n[s+3]=h[3]}return r}(t,e),0,0),a.fillStyle="#ffffff",a.fillRect(0,0,t,e),a.drawImage(r,0,0,t||1,e||1),a.globalCompositeOperation="source-over",n)}function I(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.fadeData,n=this.options,i=r.backgroundInfo,o=r.toBeList,a=i.width,l=i.height,s=(0,v.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});A.build(null!==(t=n.darkMode)&&void 0!==t?t:r.isDark),o.push({resource:O(a,l),width:a,height:l,kind:"default",tag:s}),e&&r.run()}function F(t,e){var r,n,i=t.imgUrl;return(0,o.isString)(i)&&i||(r=e.backgroundImage,n=/url\(["']?([^"']*)["']?\)/.exec(r),(0,o.isNull)(n)?null:n[1])}function U(t,e){return(0,o.isArray)(t.imgUrl)&&1===t.imgUrl.length&&t.imgUrl[0]||e.backgroundColor}function j(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,o.isNull)(t))return Reflect.apply(I,this,[]);var n=t.originStyle;if(s(n.backgroundColor)&&(!(0,o.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(I,this,[]);var i=document.createElement("canvas"),a=i.getContext("2d");if((0,o.isNull)(a))return Reflect.apply(I,this,[]);var l=e.backgroundInfo,u=l.width,c=l.height;i.width=u,i.height=c,a.clearRect(0,0,u,c);var f=U(r,n);a.beginPath(),a.fillStyle=f,a.fillRect(0,0,u,c),a.fill(),e.isTransitioning&&!(0,o.isEmptyArray)(e.toBeList)?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var h={resource:i,kind:"background-color",tag:f,width:u,height:c};e.toBeList.push(h),e.run()}function N(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,o.isNull)(e))return Reflect.apply(j,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,o.isArray)(r.imgUrl))return Reflect.apply(j,this,[]);var i=(0,o.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map(function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t}).filter(function(t){return t.startsWith("rgb")||t.startsWith("#")});if(i.length<2)return Reflect.apply(j,this,[]);var a=document.createElement("canvas"),l=a.getContext("2d");if((0,o.isNull)(l))return Reflect.apply(j,this,[]);var s=t.backgroundInfo,u=s.width,c=s.height;a.width=u,a.height=c,l.fillStyle="#fff",l.fillRect(0,0,u,c);var f=l.createLinearGradient(0,0,0,c);i.forEach(function(t,e){return f.addColorStop(e/(i.length-1),t)}),l.fillStyle=f,l.fillRect(0,0,u,c),t.isTransitioning&&!(0,o.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:a,kind:"linear-gradient",tag:i.join("_"),width:u,height:c}),t.run()}function C(t){return function(t){if(Array.isArray(t))return L(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return L(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function B(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,o.isNull)(e))Reflect.apply(N,this,[]);else{var i=e.lastUseStyle,a=n.backgroundInfo,l=a.width,s=a.height,u=F(r,i);if(e.imageSource=u,u){var c=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(u,l,s);c.onload=function(){clearTimeout(n.transparentId),n.isTransitioning&&!(0,o.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(C(n.toBeList.slice(1).filter(function(t){return"image"===t.kind&&(Math.abs(t.width-l)>2||Math.abs(t.height-s)>2||t.tag!==u)}))):n.toBeList=[],n.toBeList.push({resource:c,width:l,height:s,kind:"image",tag:u}),n.run()},c.onerror=function(){Reflect.apply(N,t,[])},c.crossOrigin=r.crossOrigin}else Reflect.apply(N,this,[])}}function M(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach(function(t){return e.style.setProperty(t[0],t[1],"important")})}}function X(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function W(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function z(t){"@babel/helpers - typeof";return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Y(n.key),n)}}function H(t,e,r){return(e=Y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}var q=function(){return t=function t(e,r,n){var i,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),H(this,"quad",null),H(this,"lastRaindropsFallTime",0),H(this,"parentElement",void 0),H(this,"mutationObserver",void 0),H(this,"resizeObserver",void 0),H(this,"renderProgram",void 0),H(this,"imageSource",""),H(this,"dropProgram",void 0),H(this,"updateProgram",void 0),H(this,"textures",[]),H(this,"backgroundTexture",[]),H(this,"textureDelta",void 0),H(this,"framebuffers",[]),H(this,"bufferWriteIndex",0),H(this,"bufferReadIndex",1),H(this,"originStyle",void 0),H(this,"lastUseStyle",void 0),H(this,"events",{}),H(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(M,n,[]),this.originStyle=this.lastUseStyle=X(this.parentElement),this.mutationObserver=new MutationObserver(function(t){t.forEach(function(t){if(t.target===a.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(a.lastUseStyle),i=X(a.parentElement),l=Object.values(i);if((0,o.isEmptyArray)(v.enArr.difference(e,l)))return;var c=u(i.backgroundImage),f=s(i.backgroundColor);if(c&&f)return;a.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(M,n,[])}})}),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver(function(t){t.forEach(function(t){t.target===a.parentElement&&Reflect.apply(r,n,[])})}),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(W,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach(function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])}),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&G(t.prototype,e),r&&G(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function $(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r,n,i,a=t.parentElement,l=window.getComputedStyle(a),s=l.backgroundSize,u=l.backgroundAttachment,c=l.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):K(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],h={left:0,top:0,width:0,height:0};"fixed"===u?(h.height=window.innerHeight,h.left=window.screenX,h.top=window.screenY,h.width=window.innerWidth):(h.left=0,h.top=0,h.width=a.scrollWidth,h.height=a.scrollHeight);var p=e.backgroundInfo||{width:100,height:100},d=p.width,g=p.height;if("cover"===s){var m=Math.max(h.width/d,h.height/g);n=d*m,i=g*m}else if("contain"===s){var v=Math.min(h.width/d,h.height/g);n=d*v,i=g*v}else{var y=s.split(" ");n=y[0]||"",i=y[1]||n,K(n)?n=h.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),K(i)?i=h.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var b=f&&f[0]||"0%",E=f&&f[1]||"0%";b=K(b)?(h.left+(h.width-Number(n))*parseFloat(b)/100).toString():(h.left+parseFloat(b)).toString(),E=K(E)?(h.top+(h.height-Number(i))*parseFloat(E)/100).toString():(h.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([-Number(b)/n,-Number(E)/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+a.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+a.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function K(t){return t.endsWith("%")}function V(){var t=this.gl,e=this.renderData;(0,o.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function Z(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.textures,i=e.backgroundTexture,a=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(l,this,[i,0]),Reflect.apply(l,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,a),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(V,this,[]),t.disable(t.BLEND)}}function J(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function Q(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.updateProgram,i=e.textures,a=e.framebuffers,s=e.bufferWriteIndex,u=e.bufferReadIndex,c=r.resolution;t.viewport(0,0,c,c),t.bindFramebuffer(t.FRAMEBUFFER,a[s]),Reflect.apply(l,this,[i[u]]),t.useProgram(n.id),Reflect.apply(V,this,[]),Reflect.apply(J,this,[])}}function tt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)){var i=e.parentElement,a=n.isTransitioning,l=r.running,s=r.idleFluctuations,u=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply($,this,[]),l?(u||(r.lastRunningState=!0,this.show()),s&&this.raindropsFall(),a&&this.fade(),Reflect.apply(Q,this,[]),Reflect.apply(Z,this,[])):u&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(tt,t,[])})}}function et(t,e,r){var n=this.renderData;if(!(0,o.isNull)(n)){var i=n.parentElement,a=window.getComputedStyle(i),l=parseInt(a.borderLeftWidth)||0,s=parseInt(a.borderTopWidth)||0,u=i.getBoundingClientRect(),c=t.clientX-u.left-l,f=t.clientY-u.top-s;this.drop(c,f,e,r)}}function rt(){var t=this,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.parentElement,i=e.events,a=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(et,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)a(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)a(e[r])},i.mousedown=function(t){return a(t,!0)},Object.keys(i).forEach(function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})})}}var nt="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function it(){var t=this.gl,e=this.renderData;if(!(0,o.isNull)(e)){var r=e.textureDelta;e.dropProgram=a(nt,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=a(nt,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=a("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function ot(){var t=this.gl,e=this.renderData;if(!(0,o.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function at(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,o.isNull)(r)){var i=r.backgroundTexture,a=r.parentElement,l=n.backgroundInfo,s=l.width,u=l.height,c=function(t){return(0,o.isZero)(t&t-1)},f=c(s)&&c(u)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,f),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,f),a.dataset.render_img=t.tag,a.dataset.render_width=t.width+"px",a.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function lt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)&&this.config){var i=e.textures,a=e.framebuffers,l=r.resolution,s=this.gl,u=1/l;e.textureDelta=new Float32Array([u,u]),this.config.extensions.forEach(function(t){return s.getExtension(t)});for(var c=this.config.arrayType,f=c?new c(l*l*4):null,h=this.config,p=0;p<2;p++){var d=s.createTexture(),g=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,g),s.bindTexture(s.TEXTURE_2D,d),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,h.linearSupport?s.LINEAR:s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,h.linearSupport?s.LINEAR:s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,l,l,0,s.RGBA,h.type,f),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),i.push(d),a.push(g)}e.quad=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,e.quad),s.bufferData(s.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),s.STATIC_DRAW),Reflect.apply(it,this,[]),Reflect.apply(ot,this,[]),Reflect.apply(B,this,[]),s.clearColor(0,0,0,0),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(rt,this,[]),Reflect.apply(at,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(tt,t,[])})}}function st(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,a=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=a,Reflect.apply(B,this,[])}}function ut(){var t=this.renderData,e=this.fadeData;(0,o.isNull)(t)||(t.destroy(),Object.keys(t).forEach(function(e){return t[e]=null}),this.renderData=null),e.destroy(),Object.keys(e).forEach(function(t){return e[t]=null}),this.fadeData=null,this.gl&&(this.gl=null)}function ct(t,e,r,n){var i=this.renderData,a=this.options,s=this.gl;if(!(0,o.isNull)(i)){var u=i.parentElement,c=i.dropProgram,f=i.textures,h=i.framebuffers,p=i.bufferWriteIndex,d=i.bufferReadIndex,g=a.resolution,m=u.offsetWidth,v=u.offsetHeight,y=Math.max(m,v);r/=y;var b=new Float32Array([(2*t-m)/y,(v-2*e)/y]);s.viewport(0,0,g,g),s.bindFramebuffer(s.FRAMEBUFFER,h[p]),Reflect.apply(l,this,[f[d]]),s.useProgram(c.id),s.uniform2fv(c.locations.center,b),s.uniform1f(c.locations.radius,r),s.uniform1f(c.locations.strength,n),Reflect.apply(V,this,[]),Reflect.apply(J,this,[])}}function ft(t){"@babel/helpers - typeof";return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dt(n.key),n)}}function pt(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(t){var e=function(t,e){if("object"!=ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ft(e)?e:e+""}function gt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function mt(t,e){return t.get(yt(t,e))}function vt(t,e,r){return t.set(yt(t,e),r),r}function yt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var bt=new WeakMap,Et=new WeakMap,wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,St=new WeakMap,Pt=new WeakMap,Dt=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),gt(this,bt,y.accelerating),gt(this,Et,y.interactive),gt(this,wt,y.resolution),gt(this,Rt,y.perturbance),gt(this,Tt,y.dropRadius),pt(this,"imgUrl",y.imgUrl),gt(this,kt,y.idleFluctuations),gt(this,St,y.raindropsTimeInterval),pt(this,"crossOrigin","no-cors"),pt(this,"visible",!1),pt(this,"running",!1),gt(this,Pt,void 0),pt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin,this.darkMode=e.darkMode},(e=[{key:"accelerating",get:function(){return mt(bt,this)},set:function(t){t>100||t<2||vt(bt,this,t)}},{key:"interactive",get:function(){return mt(Et,this)},set:function(t){(0,o.isBoolean)(t)&&vt(Et,this,t)}},{key:"resolution",get:function(){return mt(wt,this)},set:function(t){t<100||t>550||vt(wt,this,t)}},{key:"perturbance",get:function(){return mt(Rt,this)},set:function(t){t<1e-4||t>1||vt(Rt,this,t)}},{key:"dropRadius",get:function(){return mt(Tt,this)},set:function(t){!isFinite(t)||t<10||vt(Tt,this,t)}},{key:"idleFluctuations",get:function(){return mt(kt,this)},set:function(t){(0,o.isBoolean)(t)&&vt(kt,this,t)}},{key:"raindropsTimeInterval",get:function(){return mt(St,this)},set:function(t){t<10||t>12e3||vt(St,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}},{key:"darkMode",get:function(){return mt(Pt,this)},set:function(t){vt(Pt,this,(0,o.isUndefined)(t)?void 0:Boolean(t))}}])&&ht(t.prototype,e),r&&ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function _t(){var t=this.fadeData,e=this.options,r=this.renderData;if((0,o.isNull)(r))return!0;var n=e.imgUrl,i=r.lastUseStyle,a=t.lastDrawImage,l=t.backgroundInfo,s=l.width,u=l.height,c=a.tag,f=a.kind,h=F(e,i),p=a.width===s,d=a.height===u,g=p&&d;if("image"===f&&g&&(0,o.isString)(h)&&h===c)return!0;var m=(0,o.isArray)(n)&&n.join("_")||"";if("linear-gradient"===f&&g&&m===c)return!0;var v=U(e,i);return!("background-color"!==f||!g||c!==v)}function xt(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout(function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(xt,t,[]);Reflect.apply(_t,t,[])||r.run()},2*e.raindropsTimeInterval)}function At(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,o.isNull)(t))return Reflect.apply(Ot,this,["还没有准备好,即将退出"]);if((0,o.isEmptyArray)(n))return Reflect.apply(Ot,this,["由于缺少当前渲染的背景,退出"]);if(0===e.drawProgress&&n.forEach(function(t){}),e.drawProgress>1e3){if(e.lastDrawImage=n.shift(),Reflect.apply(at,this,[e.lastDrawImage]),(0,o.isEmptyArray)(n)){var i=t.lastUseStyle;((0,o.isNull)(r.imgUrl)||(0,o.isBusinessEmptyString)(r.imgUrl)||(0,o.isZero)(r.imgUrl.length))&&s(i.backgroundColor)&&u(i.backgroundImage)&&Reflect.apply(I,this,[!1])}return Reflect.apply(Ot,this,["当前执行完毕,开启下次执行"])}var a=e.lastDrawImage,l=e.backgroundInfo;e.drawProgress+=18;var c=document.createElement("canvas"),f=c.getContext("2d");if((0,o.isNull)(f)||(0,o.isNull)(a.resource)||(0,o.isEmptyArray)(n))return Reflect.apply(Ot,this,"环境值错误");var h=l.width,p=l.height;c.width=h,c.height=p,f.clearRect(0,0,h,p),f.drawImage(a.resource,0,0,h,p),f.globalAlpha=e.drawProgress/1e3,f.drawImage(n[0].resource,0,0,h,p),f.globalAlpha=1;var d={resource:c,width:h,height:p,kind:"mix",tag:"".concat(a.tag," >> ").concat(n[0].tag)};Reflect.apply(at,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}function Ot(t){this.fadeData.isTransitioning=!1,Reflect.apply(xt,this,[])}function It(t){"@babel/helpers - typeof";return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nt(n.key),n)}}function Ut(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,r){return(e=Nt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nt(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}function Ct(t,e){return t.get(Lt(t,e))}function Lt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Bt=new WeakMap,Mt=new WeakSet,Xt=function(){return t=function t(e){var r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ut(r=this,n=Mt),n.add(r),jt(this,"backgroundInfo",{width:0,height:0}),jt(this,"transparentId",setTimeout(Boolean)),jt(this,"lastDrawImage",void 0),jt(this,"toBeList",[]),jt(this,"drawProgress",0),jt(this,"isTransitioning",!1),function(t,e,r){Ut(t,e),e.set(t,r)}(this,Bt,void 0),jt(this,"isDark",!1);var i,a,l=e.renderData;if((0,o.isNull)(l))i=10,a=10;else{var s=getComputedStyle(l.parentElement);i=parseInt(s.width),a=parseInt(s.height)}this.backgroundInfo={width:i,height:a},this.lastDrawImage={resource:O(i,a),width:i,height:a,kind:"default",tag:""},function(t,e,r){t.set(Lt(t,e),r)}(Bt,this,window.matchMedia("(prefers-color-scheme: dark)")),this.isDark=Ct(Bt,this).matches,Ct(Bt,this).addEventListener("change",Lt(Mt,this,Wt));var u=this;Object.defineProperty(Ct(Bt,this),"isDark",{get:function(){return u.isDark},set:function(t){u.isDark=t,Reflect.apply(_t,e,[])||Reflect.apply(I,e,[!0])}})},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId),Ct(Bt,this).removeEventListener("change",Lt(Mt,this,Wt))}}])&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Wt(t){this.isDark=t.matches}function zt(t){"@babel/helpers - typeof";return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function Gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(r),!0).forEach(function(e){Jt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qt(n.key),n)}}function qt(t,e,r){return e=Kt(e),function(t,e){if(e&&("object"==zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,$t()?Reflect.construct(e,r||[],Kt(t).constructor):e.apply(t,r))}function $t(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($t=function(){return!!t})()}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kt(t)}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(t,e)}function Zt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Jt(t,e,r){return(e=Qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qt(t){var e=function(t,e){if("object"!=zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==zt(e)?e:e+""}function te(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var ee=new WeakMap,re=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Jt(n=qt(this,e,[t]),"renderData",null),Jt(n,"options",void 0),Jt(n,"fadeData",void 0),Jt(n,"defaults",y),Jt(n,"initialized",!1),Zt(n,ee,(0,v.debounce)(st,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Dt(Ht(Ht({},n.defaults),r)),n.renderData=new q(t,n.reloadBackground,n),n.fadeData=new Xt(n),(0,o.isFalse)(n.initState)||(0,o.isNull)(t.parentElement)||(0,o.isNull)(n.config)||(0,o.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,i.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(lt,n,[])),window.matchMedia("(prefers-color-scheme: dark)"),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vt(t,e)}(e,t),r=e,(n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,o.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,a=e.raindropsTimeInterval,l=e.dropRadius,s=Date.now();if(!(s-i<a)){t.lastRaindropsFallTime=s;var u=function(t){return(0,v.getRandomInt)(t)},c=n.width,f=n.height;this.drop(u(c),u(f),l,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(ct,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(At,this,[])}},{key:"reloadBackground",value:function(){te(ee,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(ut,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(M,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(W,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(B,this,[])):"darkMode"===t?(this.options.darkMode=e,Reflect.apply(_t,this,[])||Reflect.apply(I,this,[!0])):this.options[t]=e}}])&&Yt(r.prototype,n),a&&Yt(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(m);function ne(t,e){var r=(0,n.useRef)(null);return(0,n.useEffect)(function(){if(!(0,o.isNull)(t.current))return r.current=new re(t.current,e),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}},[]),r}},713:()=>{function t(e){"@babel/helpers - typeof";return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}function r(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(r=[{key:"clear",value:function(){}}])&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}())({name:"earthnut",type:!1})}}]);