@mkbabb/value.js 0.10.0 → 0.11.1
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 +1 -1
- package/README.md +9 -9
- package/dist/index.d.ts +4 -3
- package/dist/math.d.ts +16 -0
- package/dist/parsing/utils.d.ts +14 -0
- package/dist/units/color/dispatch.d.ts +0 -1
- package/dist/units/color/index.d.ts +2 -1
- package/dist/units/index.d.ts +32 -0
- package/dist/units/interpolate.d.ts +24 -1
- package/dist/units/normalize.d.ts +10 -0
- package/dist/value.js +1133 -1009
- package/package.json +5 -16
- package/scripts/migrate-keyframes-js-lerp.mjs +0 -257
- /package/dist/{postcss-CRluLK2m.js → postcss-CWmVrHvs.js} +0 -0
- /package/dist/{standalone-Ck3UyY5I.js → standalone-DlyrSOeX.js} +0 -0
package/dist/value.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Parser as e, all as t, any as n,
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { Parser as e, all as t, any as n, dispatch as r, regex as i, string as a, whitespace as o } from "@mkbabb/parse-that";
|
|
2
|
+
var s = 1e3 / 60, c = (e) => !!e && e.constructor === Object;
|
|
3
|
+
function l(e) {
|
|
4
|
+
return c(e) ? Object.entries(e).map(([e, t]) => [e, l(t)]).reduce((e, [t, n]) => (e[t] = n, e), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(l) : e;
|
|
5
5
|
}
|
|
6
|
-
var
|
|
6
|
+
var u = (e, t) => {
|
|
7
7
|
if (!e || !t || e.length !== t.length) return !1;
|
|
8
8
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
9
9
|
return !0;
|
|
10
10
|
};
|
|
11
|
-
async function
|
|
11
|
+
async function d(e) {
|
|
12
12
|
return await new Promise((t) => setTimeout(t, e));
|
|
13
13
|
}
|
|
14
|
-
async function
|
|
14
|
+
async function f(e, t = s) {
|
|
15
15
|
return await new Promise((n) => {
|
|
16
16
|
let r = setInterval(() => {
|
|
17
17
|
if (e()) return clearInterval(r), n();
|
|
18
18
|
}, t);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function p(e, t = 100, n = !1) {
|
|
22
22
|
let r = null, i = function(...i) {
|
|
23
23
|
let a = this, o = function() {
|
|
24
24
|
r = null, n || e.apply(a, i);
|
|
@@ -29,46 +29,46 @@ function f(e, t = 100, n = !1) {
|
|
|
29
29
|
r &&= (clearTimeout(r), null);
|
|
30
30
|
}, i;
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
32
|
+
async function m(e, t) {
|
|
33
33
|
let n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
|
|
34
34
|
return Array.from(new Uint8Array(r)).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
let n = /* @__PURE__ */ new Map(), { maxCacheSize: r = Infinity, ttl: i = Infinity, keyFn: a = JSON.stringify, shouldCache: o } = t, s = function(...t) {
|
|
38
|
-
let
|
|
39
|
-
if (n.has(
|
|
40
|
-
let e = n.get(
|
|
41
|
-
if (
|
|
42
|
-
n.delete(
|
|
36
|
+
function h(e, t = {}) {
|
|
37
|
+
let n = /* @__PURE__ */ new Map(), { maxCacheSize: r = Infinity, ttl: i = Infinity, keyFn: a = JSON.stringify, shouldCache: o } = t, s = i !== Infinity, c = function(...t) {
|
|
38
|
+
let c = a.apply(this, t);
|
|
39
|
+
if (n.has(c)) {
|
|
40
|
+
let e = n.get(c);
|
|
41
|
+
if (!s || Date.now() - e.timestamp <= i) return e.value;
|
|
42
|
+
n.delete(c);
|
|
43
43
|
}
|
|
44
44
|
let l = e.apply(this, t);
|
|
45
|
-
if ((!o || o(l, ...t)) && (n.set(
|
|
45
|
+
if ((!o || o(l, ...t)) && (n.set(c, {
|
|
46
46
|
value: l,
|
|
47
|
-
timestamp:
|
|
47
|
+
timestamp: s ? Date.now() : 0
|
|
48
48
|
}), n.size > r)) {
|
|
49
49
|
let e = n.keys().next().value;
|
|
50
50
|
n.delete(e);
|
|
51
51
|
}
|
|
52
52
|
return l;
|
|
53
53
|
};
|
|
54
|
-
return
|
|
54
|
+
return c.cache = n, c;
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
function
|
|
56
|
+
var g = (e) => e.replace(/([-_][a-z])/gi, (e) => e.toUpperCase().replace("-", "").replace("_", ""));
|
|
57
|
+
function _(e) {
|
|
58
58
|
return e.replace(/([A-Z])/g, (e) => `-${e[0].toLowerCase()}`);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ee(e, t, n) {
|
|
61
61
|
for (let r = e - 1; r >= 0; r--) if (n(t[r])) return r;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function te(e) {
|
|
64
64
|
if (typeof window < "u" && window.requestAnimationFrame) return window.requestAnimationFrame(e);
|
|
65
|
-
let t =
|
|
65
|
+
let t = s, n = Date.now();
|
|
66
66
|
return setTimeout(() => {
|
|
67
67
|
let r = Date.now(), i = r - n;
|
|
68
|
-
n = r, t = Math.max(0,
|
|
68
|
+
n = r, t = Math.max(0, s - i), e(r);
|
|
69
69
|
}, t);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ne(e) {
|
|
72
72
|
if (typeof window < "u" && window.cancelAnimationFrame) return window.cancelAnimationFrame(e);
|
|
73
73
|
clearTimeout(e);
|
|
74
74
|
}
|
|
@@ -83,41 +83,46 @@ function y(e, t, n, r = 0, i = 1) {
|
|
|
83
83
|
function b(e, t, n) {
|
|
84
84
|
return (1 - n) * e + n * t;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function re(e, t, n, r) {
|
|
87
|
+
let i = e.length, a = 1 - n;
|
|
88
|
+
for (let o = 0; o < i; o++) r[o] = a * e[o] + n * t[o];
|
|
89
|
+
return r;
|
|
90
|
+
}
|
|
91
|
+
function ie(e, t, n) {
|
|
87
92
|
return t = t === 0 ? 1e-9 : t, t * (n / t) ** +e;
|
|
88
93
|
}
|
|
89
|
-
function
|
|
94
|
+
function ae(e, t) {
|
|
90
95
|
let n = t.length - 1, r = [...t];
|
|
91
96
|
for (let t = 1; t <= n; t++) for (let i = 0; i <= n - t; i++) r[i] = b(r[i], r[i + 1], e);
|
|
92
97
|
return r[0];
|
|
93
98
|
}
|
|
94
|
-
function
|
|
95
|
-
return [
|
|
99
|
+
function oe(e, t, n, r, i) {
|
|
100
|
+
return [ae(e, [
|
|
96
101
|
0,
|
|
97
102
|
t,
|
|
98
103
|
r,
|
|
99
104
|
1
|
|
100
|
-
]),
|
|
105
|
+
]), ae(e, [
|
|
101
106
|
0,
|
|
102
107
|
n,
|
|
103
108
|
i,
|
|
104
109
|
1
|
|
105
110
|
])];
|
|
106
111
|
}
|
|
107
|
-
function
|
|
112
|
+
function se(e, t) {
|
|
108
113
|
let n = t.map((e) => e[0]), r = t.map((e) => e[1]);
|
|
109
|
-
return [
|
|
114
|
+
return [ae(e, n), ae(e, r)];
|
|
110
115
|
}
|
|
111
|
-
function
|
|
116
|
+
function ce(e, t, n, r) {
|
|
112
117
|
let i = "M0 0";
|
|
113
118
|
`${e}${t}${n}${r}`;
|
|
114
119
|
for (let a = 0; a <= 1; a += .001) {
|
|
115
|
-
let [o, s] =
|
|
120
|
+
let [o, s] = oe(a, e, t, n, r);
|
|
116
121
|
i += ` L${o} ${s}`;
|
|
117
122
|
}
|
|
118
123
|
return `<path d="${i}"/>`;
|
|
119
124
|
}
|
|
120
|
-
function
|
|
125
|
+
function le(e, t, n, r) {
|
|
121
126
|
let i = (e) => e.toFixed(2);
|
|
122
127
|
return `cubic-bezier(${i(e)}, ${i(t)}, ${i(n)}, ${i(r)})`;
|
|
123
128
|
}
|
|
@@ -129,7 +134,7 @@ function x(e, t) {
|
|
|
129
134
|
t[6] * n + t[7] * r + t[8] * i
|
|
130
135
|
];
|
|
131
136
|
}
|
|
132
|
-
function
|
|
137
|
+
function ue(e) {
|
|
133
138
|
return [
|
|
134
139
|
e[0],
|
|
135
140
|
e[3],
|
|
@@ -142,7 +147,7 @@ function ce(e) {
|
|
|
142
147
|
e[8]
|
|
143
148
|
];
|
|
144
149
|
}
|
|
145
|
-
function
|
|
150
|
+
function de(e, t) {
|
|
146
151
|
return [
|
|
147
152
|
e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
|
|
148
153
|
e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
|
|
@@ -169,7 +174,7 @@ function S(e) {
|
|
|
169
174
|
(t * a - n * i) * p
|
|
170
175
|
];
|
|
171
176
|
}
|
|
172
|
-
var
|
|
177
|
+
var fe = 255, C = {
|
|
173
178
|
"%": {
|
|
174
179
|
min: 0,
|
|
175
180
|
max: 100
|
|
@@ -178,7 +183,7 @@ var ue = 255, C = {
|
|
|
178
183
|
min: 0,
|
|
179
184
|
max: 1
|
|
180
185
|
}
|
|
181
|
-
},
|
|
186
|
+
}, pe = {
|
|
182
187
|
"%": C["%"],
|
|
183
188
|
number: {
|
|
184
189
|
min: 0,
|
|
@@ -187,7 +192,7 @@ var ue = 255, C = {
|
|
|
187
192
|
}, w = {
|
|
188
193
|
"%": C["%"],
|
|
189
194
|
number: C.number
|
|
190
|
-
},
|
|
195
|
+
}, me = {
|
|
191
196
|
deg: {
|
|
192
197
|
min: 0,
|
|
193
198
|
max: 360
|
|
@@ -197,15 +202,15 @@ var ue = 255, C = {
|
|
|
197
202
|
max: 360
|
|
198
203
|
},
|
|
199
204
|
"%": C["%"]
|
|
200
|
-
},
|
|
205
|
+
}, T = {
|
|
201
206
|
rgb: {
|
|
202
|
-
r:
|
|
203
|
-
g:
|
|
204
|
-
b:
|
|
207
|
+
r: pe,
|
|
208
|
+
g: pe,
|
|
209
|
+
b: pe,
|
|
205
210
|
alpha: C
|
|
206
211
|
},
|
|
207
212
|
hsl: {
|
|
208
|
-
h:
|
|
213
|
+
h: me,
|
|
209
214
|
s: {
|
|
210
215
|
"%": C["%"],
|
|
211
216
|
number: C.number
|
|
@@ -217,7 +222,7 @@ var ue = 255, C = {
|
|
|
217
222
|
alpha: C
|
|
218
223
|
},
|
|
219
224
|
hsv: {
|
|
220
|
-
h:
|
|
225
|
+
h: me,
|
|
221
226
|
s: {
|
|
222
227
|
"%": C["%"],
|
|
223
228
|
number: C.number
|
|
@@ -229,7 +234,7 @@ var ue = 255, C = {
|
|
|
229
234
|
alpha: C
|
|
230
235
|
},
|
|
231
236
|
hwb: {
|
|
232
|
-
h:
|
|
237
|
+
h: me,
|
|
233
238
|
w: {
|
|
234
239
|
"%": C["%"],
|
|
235
240
|
number: C.number
|
|
@@ -279,7 +284,7 @@ var ue = 255, C = {
|
|
|
279
284
|
},
|
|
280
285
|
"%": C["%"]
|
|
281
286
|
},
|
|
282
|
-
h:
|
|
287
|
+
h: me,
|
|
283
288
|
alpha: C
|
|
284
289
|
},
|
|
285
290
|
oklab: {
|
|
@@ -321,7 +326,7 @@ var ue = 255, C = {
|
|
|
321
326
|
},
|
|
322
327
|
"%": C["%"]
|
|
323
328
|
},
|
|
324
|
-
h:
|
|
329
|
+
h: me,
|
|
325
330
|
alpha: C
|
|
326
331
|
},
|
|
327
332
|
xyz: {
|
|
@@ -376,7 +381,7 @@ var ue = 255, C = {
|
|
|
376
381
|
b: w,
|
|
377
382
|
alpha: C
|
|
378
383
|
}
|
|
379
|
-
},
|
|
384
|
+
}, he = "%", ge = {
|
|
380
385
|
rgb: {
|
|
381
386
|
r: "",
|
|
382
387
|
g: "",
|
|
@@ -465,10 +470,10 @@ var ue = 255, C = {
|
|
|
465
470
|
b: "",
|
|
466
471
|
alpha: "%"
|
|
467
472
|
}
|
|
468
|
-
},
|
|
469
|
-
let r =
|
|
473
|
+
}, _e = (e, t, n) => {
|
|
474
|
+
let r = T[e][t] ?? {};
|
|
470
475
|
return r[n] ?? r.number;
|
|
471
|
-
},
|
|
476
|
+
}, ve = (e, t) => ge[e][t] ?? "", ye = {
|
|
472
477
|
rgb: "RGB",
|
|
473
478
|
hsl: "HSL",
|
|
474
479
|
hsv: "HSV",
|
|
@@ -484,15 +489,15 @@ var ue = 255, C = {
|
|
|
484
489
|
"a98-rgb": "Adobe RGB",
|
|
485
490
|
"prophoto-rgb": "ProPhoto RGB",
|
|
486
491
|
rec2020: "Rec. 2020"
|
|
487
|
-
},
|
|
492
|
+
}, be = [
|
|
488
493
|
.3127 / .329,
|
|
489
494
|
1,
|
|
490
495
|
.3583 / .329
|
|
491
|
-
],
|
|
496
|
+
], xe = [
|
|
492
497
|
.3457 / .3585,
|
|
493
498
|
1,
|
|
494
499
|
.2958 / .3585
|
|
495
|
-
],
|
|
500
|
+
], Se = [
|
|
496
501
|
1.0479297925449969,
|
|
497
502
|
.022946870601609652,
|
|
498
503
|
-.05019226628920524,
|
|
@@ -502,10 +507,10 @@ var ue = 255, C = {
|
|
|
502
507
|
-.009243040646204504,
|
|
503
508
|
.015055191490298152,
|
|
504
509
|
.7518742814281371
|
|
505
|
-
],
|
|
506
|
-
D65:
|
|
507
|
-
D50:
|
|
508
|
-
},
|
|
510
|
+
], Ce = S(Se), we = {
|
|
511
|
+
D65: be,
|
|
512
|
+
D50: xe
|
|
513
|
+
}, Te = [
|
|
509
514
|
.819022437996703,
|
|
510
515
|
.3619062600528904,
|
|
511
516
|
-.1288737815209879,
|
|
@@ -515,7 +520,7 @@ var ue = 255, C = {
|
|
|
515
520
|
.0481771893596242,
|
|
516
521
|
.2642395317527308,
|
|
517
522
|
.6335478284694309
|
|
518
|
-
],
|
|
523
|
+
], Ee = S(Te), E = [
|
|
519
524
|
.210454268309314,
|
|
520
525
|
.7936177747023054,
|
|
521
526
|
-.0040720430116193,
|
|
@@ -525,7 +530,7 @@ var ue = 255, C = {
|
|
|
525
530
|
.0259040424655478,
|
|
526
531
|
.7827717124575296,
|
|
527
532
|
-.8086757549230774
|
|
528
|
-
],
|
|
533
|
+
], De = S(E), D = [
|
|
529
534
|
4.0767416621,
|
|
530
535
|
-3.3077115913,
|
|
531
536
|
.2309699292,
|
|
@@ -535,7 +540,7 @@ var ue = 255, C = {
|
|
|
535
540
|
-.0041960863,
|
|
536
541
|
-.7034186147,
|
|
537
542
|
1.707614701
|
|
538
|
-
],
|
|
543
|
+
], O = [
|
|
539
544
|
.4122214708,
|
|
540
545
|
.5363325363,
|
|
541
546
|
.0514459929,
|
|
@@ -545,7 +550,7 @@ var ue = 255, C = {
|
|
|
545
550
|
.0883024619,
|
|
546
551
|
.2817188376,
|
|
547
552
|
.6299787005
|
|
548
|
-
],
|
|
553
|
+
], k = {
|
|
549
554
|
l: [
|
|
550
555
|
1,
|
|
551
556
|
.3963377774,
|
|
@@ -561,7 +566,7 @@ var ue = 255, C = {
|
|
|
561
566
|
-.0894841775,
|
|
562
567
|
-1.291485548
|
|
563
568
|
]
|
|
564
|
-
},
|
|
569
|
+
}, Oe = [
|
|
565
570
|
{
|
|
566
571
|
test: (e, t) => -1.88170328 * e - .80936493 * t > 1,
|
|
567
572
|
k0: 1.19086277,
|
|
@@ -595,7 +600,7 @@ var ue = 255, C = {
|
|
|
595
600
|
wm: -.7034186147,
|
|
596
601
|
ws: 1.707614701
|
|
597
602
|
}
|
|
598
|
-
],
|
|
603
|
+
], ke = {
|
|
599
604
|
aliceblue: "#f0f8ff",
|
|
600
605
|
antiquewhite: "#faebd7",
|
|
601
606
|
aqua: "#00ffff",
|
|
@@ -752,99 +757,99 @@ var ue = 255, C = {
|
|
|
752
757
|
patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)",
|
|
753
758
|
winterwind: "oklch(21.80% 0.28 210.96deg / 82.70%)",
|
|
754
759
|
blackwellberry: "oklch(53.60% 0.35 267.12deg / 100%)"
|
|
755
|
-
},
|
|
756
|
-
function
|
|
760
|
+
}, Ae = 2.4, je = .055, Me = 12.92, Ne = .04045 / Me;
|
|
761
|
+
function Pe(e) {
|
|
757
762
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
758
|
-
return n <=
|
|
763
|
+
return n <= Ne ? e / Me : t * ((n + je) / 1.055) ** Ae;
|
|
759
764
|
}
|
|
760
|
-
function
|
|
765
|
+
function Fe(e) {
|
|
761
766
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
762
|
-
return n <=
|
|
767
|
+
return n <= Ne ? e * Me : t * (1.055 * n ** (1 / Ae) - je);
|
|
763
768
|
}
|
|
764
|
-
function
|
|
769
|
+
function Ie(e, t, n) {
|
|
765
770
|
return Math.min(Math.max(e, t), n);
|
|
766
771
|
}
|
|
767
|
-
var
|
|
768
|
-
function
|
|
772
|
+
var Le = .02;
|
|
773
|
+
function Re(e, t, n, r, i, a) {
|
|
769
774
|
let o = e - r, s = t - i, c = n - a;
|
|
770
775
|
return Math.sqrt(o * o + s * s + c * c);
|
|
771
776
|
}
|
|
772
|
-
function
|
|
773
|
-
let r = e +
|
|
777
|
+
function ze(e, t, n) {
|
|
778
|
+
let r = e + k.l[1] * t + k.l[2] * n, i = e + k.m[1] * t + k.m[2] * n, a = e + k.s[1] * t + k.s[2] * n, o = r * r * r, s = i * i * i, c = a * a * a;
|
|
774
779
|
return [
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
780
|
+
D[0] * o + D[1] * s + D[2] * c,
|
|
781
|
+
D[3] * o + D[4] * s + D[5] * c,
|
|
782
|
+
D[6] * o + D[7] * s + D[8] * c
|
|
778
783
|
];
|
|
779
784
|
}
|
|
780
|
-
function
|
|
785
|
+
function Be(e, t, n) {
|
|
781
786
|
return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
|
|
782
787
|
}
|
|
783
|
-
function
|
|
784
|
-
let { k0: n, k1: r, k2: i, k3: a, k4: o, wl: s, wm: c, ws: l } =
|
|
788
|
+
function Ve(e, t) {
|
|
789
|
+
let { k0: n, k1: r, k2: i, k3: a, k4: o, wl: s, wm: c, ws: l } = Oe.find((n) => n.test(e, t)), u = n + r * e + i * t + a * e * e + o * e * t, d = k.l[1] * e + k.l[2] * t, f = k.m[1] * e + k.m[2] * t, p = k.s[1] * e + k.s[2] * t;
|
|
785
790
|
{
|
|
786
|
-
let e = 1 + u * d, t = 1 + u * f, n = 1 + u * p, r = e * e * e, i = t * t * t, a = n * n * n, o = 3 * d * e * e, m = 3 * f * t * t, h = 3 * p * n * n, g = 6 * d * d * e, _ = 6 * f * f * t, ee = 6 * p * p * n, te = s * r + c * i + l * a,
|
|
787
|
-
u -= te *
|
|
791
|
+
let e = 1 + u * d, t = 1 + u * f, n = 1 + u * p, r = e * e * e, i = t * t * t, a = n * n * n, o = 3 * d * e * e, m = 3 * f * t * t, h = 3 * p * n * n, g = 6 * d * d * e, _ = 6 * f * f * t, ee = 6 * p * p * n, te = s * r + c * i + l * a, ne = s * o + c * m + l * h, v = s * g + c * _ + l * ee;
|
|
792
|
+
u -= te * ne / (ne * ne - .5 * te * v);
|
|
788
793
|
}
|
|
789
794
|
return u;
|
|
790
795
|
}
|
|
791
|
-
function
|
|
792
|
-
let n =
|
|
796
|
+
function He(e, t) {
|
|
797
|
+
let n = Ve(e, t), [r, i, a] = ze(1, n * e, n * t), o = Math.cbrt(1 / Math.max(r, i, a));
|
|
793
798
|
return {
|
|
794
799
|
L: o,
|
|
795
800
|
C: o * n
|
|
796
801
|
};
|
|
797
802
|
}
|
|
798
|
-
function
|
|
803
|
+
function Ue(e, t, n, r, i, a) {
|
|
799
804
|
let o;
|
|
800
805
|
if ((n - i) * a.C - (a.L - i) * r <= 0) o = a.C * i / (r * a.L + a.C * (i - n));
|
|
801
806
|
else {
|
|
802
807
|
o = a.C * (i - 1) / (r * (a.L - 1) + a.C * (i - n));
|
|
803
|
-
let s = n - i, c = r, l =
|
|
808
|
+
let s = n - i, c = r, l = k.l[1] * e + k.l[2] * t, u = k.m[1] * e + k.m[2] * t, d = k.s[1] * e + k.s[2] * t, f = s + c * l, p = s + c * u, m = s + c * d;
|
|
804
809
|
{
|
|
805
|
-
let e = i * (1 - o) + o * n, t = o * r, a = e + t * l, s = e + t * u, c = e + t * d, h = a * a * a, g = s * s * s, _ = c * c * c, ee = 3 * f * a * a, te = 3 * p * s * s,
|
|
806
|
-
se = oe >= 0 ? se : Infinity,
|
|
810
|
+
let e = i * (1 - o) + o * n, t = o * r, a = e + t * l, s = e + t * u, c = e + t * d, h = a * a * a, g = s * s * s, _ = c * c * c, ee = 3 * f * a * a, te = 3 * p * s * s, ne = 3 * m * c * c, v = 6 * f * f * a, y = 6 * p * p * s, b = 6 * m * m * c, re = D[0] * h + D[1] * g + D[2] * _ - 1, ie = D[0] * ee + D[1] * te + D[2] * ne, ae = D[0] * v + D[1] * y + D[2] * b, oe = ie / (ie * ie - .5 * re * ae), se = -re * oe, ce = D[3] * h + D[4] * g + D[5] * _ - 1, le = D[3] * ee + D[4] * te + D[5] * ne, x = D[3] * v + D[4] * y + D[5] * b, ue = le / (le * le - .5 * ce * x), de = -ce * ue, S = D[6] * h + D[7] * g + D[8] * _ - 1, fe = D[6] * ee + D[7] * te + D[8] * ne, C = D[6] * v + D[7] * y + D[8] * b, pe = fe / (fe * fe - .5 * S * C), w = -S * pe;
|
|
811
|
+
se = oe >= 0 ? se : Infinity, de = ue >= 0 ? de : Infinity, w = pe >= 0 ? w : Infinity, o += Math.min(se, de, w);
|
|
807
812
|
}
|
|
808
813
|
}
|
|
809
814
|
return o;
|
|
810
815
|
}
|
|
811
|
-
var
|
|
812
|
-
function
|
|
813
|
-
let [r, i, a] =
|
|
814
|
-
if (
|
|
816
|
+
var We = 1e-5, Ge = .05;
|
|
817
|
+
function Ke(e, t, n) {
|
|
818
|
+
let [r, i, a] = ze(e, t, n);
|
|
819
|
+
if (Be(r, i, a)) return [
|
|
815
820
|
e,
|
|
816
821
|
t,
|
|
817
822
|
n
|
|
818
823
|
];
|
|
819
|
-
let o = Math.max(
|
|
824
|
+
let o = Math.max(We, Math.sqrt(t * t + n * n)), s = t / o, c = n / o, l = He(s, c), u = e - .5, d = .5 + Math.abs(u) + Ge * o, f = .5 * (1 + Math.sign(u) * (d - Math.sqrt(d * d - 2 * Math.abs(u)))), p = Ue(s, c, e, o, f, l), m = f * (1 - p) + p * e, h = p * o;
|
|
820
825
|
return [
|
|
821
826
|
m,
|
|
822
827
|
h * s,
|
|
823
828
|
h * c
|
|
824
829
|
];
|
|
825
830
|
}
|
|
826
|
-
function
|
|
827
|
-
let r =
|
|
831
|
+
function qe(e, t, n) {
|
|
832
|
+
let r = Pe(e), i = Pe(t), a = Pe(n), o = Math.cbrt(O[0] * r + O[1] * i + O[2] * a), s = Math.cbrt(O[3] * r + O[4] * i + O[5] * a), c = Math.cbrt(O[6] * r + O[7] * i + O[8] * a);
|
|
828
833
|
return [
|
|
829
834
|
.2104542553 * o + .793617785 * s - .0040720468 * c,
|
|
830
835
|
1.9779984951 * o - 2.428592205 * s + .4505937099 * c,
|
|
831
836
|
.0259040371 * o + .7827717662 * s - .808675766 * c
|
|
832
837
|
];
|
|
833
838
|
}
|
|
834
|
-
function
|
|
839
|
+
function Je(e, t, n) {
|
|
835
840
|
if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1) return [
|
|
836
841
|
e,
|
|
837
842
|
t,
|
|
838
843
|
n
|
|
839
844
|
];
|
|
840
|
-
let [r, i, a] =
|
|
845
|
+
let [r, i, a] = qe(e, t, n), [o, s, c] = Ke(r, i, a), [l, u, d] = ze(o, s, c);
|
|
841
846
|
return [
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
847
|
+
Ie(Fe(l), 0, 1),
|
|
848
|
+
Ie(Fe(u), 0, 1),
|
|
849
|
+
Ie(Fe(d), 0, 1)
|
|
845
850
|
];
|
|
846
851
|
}
|
|
847
|
-
function
|
|
852
|
+
function Ye(e, t, n) {
|
|
848
853
|
let r = Math.sqrt(t * t + n * n), i = 180 / Math.PI * Math.atan2(n, t);
|
|
849
854
|
return i < 0 && (i += 360), [
|
|
850
855
|
e,
|
|
@@ -852,7 +857,7 @@ function Ke(e, t, n) {
|
|
|
852
857
|
i
|
|
853
858
|
];
|
|
854
859
|
}
|
|
855
|
-
function
|
|
860
|
+
function Xe(e, t, n) {
|
|
856
861
|
let r = n * Math.PI / 180;
|
|
857
862
|
return [
|
|
858
863
|
e,
|
|
@@ -860,49 +865,49 @@ function qe(e, t, n) {
|
|
|
860
865
|
t * Math.sin(r)
|
|
861
866
|
];
|
|
862
867
|
}
|
|
863
|
-
function
|
|
864
|
-
let [r, i, a] =
|
|
868
|
+
function Ze(e, t, n) {
|
|
869
|
+
let [r, i, a] = ze(e, t, n);
|
|
865
870
|
return [
|
|
866
|
-
Math.round(
|
|
867
|
-
Math.round(
|
|
868
|
-
Math.round(
|
|
871
|
+
Math.round(Ie(Fe(r), 0, 1) * 255),
|
|
872
|
+
Math.round(Ie(Fe(i), 0, 1) * 255),
|
|
873
|
+
Math.round(Ie(Fe(a), 0, 1) * 255)
|
|
869
874
|
];
|
|
870
875
|
}
|
|
871
|
-
var
|
|
872
|
-
function
|
|
876
|
+
var Qe = 16, $e = (e) => (e = e.slice(1), e.length <= 4 ? new I(parseInt(e[0] + e[0], Qe), parseInt(e[1] + e[1], Qe), parseInt(e[2] + e[2], Qe), e[3] ? parseInt(e[3] + e[3], Qe) / 255 : 1) : new I(parseInt(e.slice(0, 2), Qe), parseInt(e.slice(2, 4), Qe), parseInt(e.slice(4, 6), Qe), e.length === 8 ? parseInt(e.slice(6, 8), Qe) / 255 : 1)), et = 2.4, tt = .055, nt = 12.92, rt = .04045 / nt;
|
|
877
|
+
function A(e) {
|
|
873
878
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
874
|
-
return n <=
|
|
879
|
+
return n <= rt ? e / nt : t * ((n + tt) / 1.055) ** et;
|
|
875
880
|
}
|
|
876
|
-
function
|
|
881
|
+
function j(e) {
|
|
877
882
|
let t = e < 0 ? -1 : 1, n = e * t;
|
|
878
|
-
return n <=
|
|
883
|
+
return n <= rt ? e * nt : t * (1.055 * n ** (1 / et) - tt);
|
|
879
884
|
}
|
|
880
|
-
var
|
|
881
|
-
function
|
|
882
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) **
|
|
885
|
+
var it = (e) => e, at = 563 / 256;
|
|
886
|
+
function ot(e) {
|
|
887
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** at;
|
|
883
888
|
}
|
|
884
|
-
function it(e) {
|
|
885
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / nt);
|
|
886
|
-
}
|
|
887
|
-
var at = 1 / 512, ot = 1.8;
|
|
888
889
|
function st(e) {
|
|
889
|
-
|
|
890
|
-
return t * (n <= at * 16 ? n / 16 : n ** ot);
|
|
890
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / at);
|
|
891
891
|
}
|
|
892
|
-
|
|
892
|
+
var ct = 1 / 512, lt = 1.8;
|
|
893
|
+
function ut(e) {
|
|
893
894
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
894
|
-
return t * (n
|
|
895
|
+
return t * (n <= ct * 16 ? n / 16 : n ** lt);
|
|
895
896
|
}
|
|
896
|
-
var lt = 1.09929682680944, ut = .018053968510807;
|
|
897
897
|
function dt(e) {
|
|
898
898
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
899
|
-
return
|
|
899
|
+
return t * (n >= ct ? n ** (1 / lt) : n * 16);
|
|
900
|
+
}
|
|
901
|
+
var ft = 1.09929682680944, pt = .018053968510807;
|
|
902
|
+
function mt(e) {
|
|
903
|
+
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
904
|
+
return n < pt * 4.5 ? t * n / 4.5 : t * ((n + ft - 1) / ft) ** (1 / .45);
|
|
900
905
|
}
|
|
901
|
-
function
|
|
906
|
+
function ht(e) {
|
|
902
907
|
let t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
903
|
-
return n >=
|
|
908
|
+
return n >= pt ? t * (ft * n ** .45 - (ft - 1)) : t * 4.5 * n;
|
|
904
909
|
}
|
|
905
|
-
var
|
|
910
|
+
var gt = [
|
|
906
911
|
.41239079926595934,
|
|
907
912
|
.357584339383878,
|
|
908
913
|
.1804807884018343,
|
|
@@ -912,26 +917,26 @@ var pt = [
|
|
|
912
917
|
.01933081871559182,
|
|
913
918
|
.11919477979462598,
|
|
914
919
|
.9505321522496607
|
|
915
|
-
],
|
|
916
|
-
function
|
|
920
|
+
], _t = S(gt);
|
|
921
|
+
function vt({ r: e, g: t, b: n, alpha: r }) {
|
|
917
922
|
let [i, a, o] = x([
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
],
|
|
923
|
+
A(e),
|
|
924
|
+
A(t),
|
|
925
|
+
A(n)
|
|
926
|
+
], gt);
|
|
922
927
|
return new L(i, a, o, r);
|
|
923
928
|
}
|
|
924
|
-
var
|
|
929
|
+
var yt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
925
930
|
let a = x([
|
|
926
931
|
e,
|
|
927
932
|
t,
|
|
928
933
|
n
|
|
929
|
-
],
|
|
934
|
+
], _t), o = j(a[0]), s = j(a[1]), c = j(a[2]);
|
|
930
935
|
if (i) {
|
|
931
|
-
let e =
|
|
936
|
+
let e = Bn(new I(o, s, c, r));
|
|
932
937
|
return new I(e.r, e.g, e.b, r);
|
|
933
938
|
} else return new I(o, s, c, r);
|
|
934
|
-
},
|
|
939
|
+
}, bt = [
|
|
935
940
|
.4865709486482162,
|
|
936
941
|
.26566769316909306,
|
|
937
942
|
.1982172852343625,
|
|
@@ -941,7 +946,7 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
941
946
|
0,
|
|
942
947
|
.04511338185890264,
|
|
943
948
|
1.043944368900976
|
|
944
|
-
],
|
|
949
|
+
], xt = S(bt), St = [
|
|
945
950
|
.5766690429101305,
|
|
946
951
|
.1855582379065463,
|
|
947
952
|
.1882286462349947,
|
|
@@ -951,7 +956,7 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
951
956
|
.02703136138641234,
|
|
952
957
|
.07068885253582723,
|
|
953
958
|
.9913375368376388
|
|
954
|
-
],
|
|
959
|
+
], Ct = S(St), wt = [
|
|
955
960
|
.7977604896723027,
|
|
956
961
|
.13518583717574031,
|
|
957
962
|
.0313493495815248,
|
|
@@ -961,7 +966,7 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
961
966
|
0,
|
|
962
967
|
0,
|
|
963
968
|
.8251046025104602
|
|
964
|
-
],
|
|
969
|
+
], Tt = S(wt), Et = [
|
|
965
970
|
.6369580483012914,
|
|
966
971
|
.14461690358620832,
|
|
967
972
|
.1688809751641721,
|
|
@@ -971,8 +976,8 @@ var gt = ({ x: e, y: t, z: n, alpha: r }, i = !0) => {
|
|
|
971
976
|
0,
|
|
972
977
|
.028072693049087428,
|
|
973
978
|
1.0609850577107909
|
|
974
|
-
],
|
|
975
|
-
function
|
|
979
|
+
], Dt = S(Et);
|
|
980
|
+
function Ot({ r: e, g: t, b: n, alpha: r }, i, a) {
|
|
976
981
|
let [o, s, c] = x([
|
|
977
982
|
i(e),
|
|
978
983
|
i(t),
|
|
@@ -980,7 +985,7 @@ function Tt({ r: e, g: t, b: n, alpha: r }, i, a) {
|
|
|
980
985
|
], a);
|
|
981
986
|
return new L(o, s, c, r);
|
|
982
987
|
}
|
|
983
|
-
function
|
|
988
|
+
function kt({ x: e, y: t, z: n, alpha: r }, i, a, o) {
|
|
984
989
|
let s = x([
|
|
985
990
|
e,
|
|
986
991
|
t,
|
|
@@ -988,85 +993,85 @@ function Et({ x: e, y: t, z: n, alpha: r }, i, a, o) {
|
|
|
988
993
|
], i);
|
|
989
994
|
return o(a(s[0]), a(s[1]), a(s[2]), r);
|
|
990
995
|
}
|
|
991
|
-
function Dt(e) {
|
|
992
|
-
return Tt(e, tt, pt);
|
|
993
|
-
}
|
|
994
|
-
function Ot(e) {
|
|
995
|
-
return Et(e, mt, tt, (e, t, n, r) => new Sr(e, t, n, r));
|
|
996
|
-
}
|
|
997
|
-
function kt(e) {
|
|
998
|
-
return Tt(e, j, _t);
|
|
999
|
-
}
|
|
1000
996
|
function At(e) {
|
|
1001
|
-
return
|
|
997
|
+
return Ot(e, it, gt);
|
|
1002
998
|
}
|
|
1003
999
|
function jt(e) {
|
|
1004
|
-
return
|
|
1000
|
+
return kt(e, _t, it, (e, t, n, r) => new Cr(e, t, n, r));
|
|
1005
1001
|
}
|
|
1006
1002
|
function Mt(e) {
|
|
1007
|
-
return
|
|
1003
|
+
return Ot(e, A, bt);
|
|
1004
|
+
}
|
|
1005
|
+
function Nt(e) {
|
|
1006
|
+
return kt(e, xt, j, (e, t, n, r) => new wr(e, t, n, r));
|
|
1007
|
+
}
|
|
1008
|
+
function Pt(e) {
|
|
1009
|
+
return Ot(e, ot, St);
|
|
1010
|
+
}
|
|
1011
|
+
function Ft(e) {
|
|
1012
|
+
return kt(e, Ct, st, (e, t, n, r) => new Tr(e, t, n, r));
|
|
1008
1013
|
}
|
|
1009
|
-
function
|
|
1014
|
+
function It({ r: e, g: t, b: n, alpha: r }) {
|
|
1010
1015
|
let [i, a, o] = x(x([
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
],
|
|
1016
|
+
ut(e),
|
|
1017
|
+
ut(t),
|
|
1018
|
+
ut(n)
|
|
1019
|
+
], wt), Ce);
|
|
1015
1020
|
return new L(i, a, o, r);
|
|
1016
1021
|
}
|
|
1017
|
-
function
|
|
1022
|
+
function Lt({ x: e, y: t, z: n, alpha: r }) {
|
|
1018
1023
|
let i = x(x([
|
|
1019
1024
|
e,
|
|
1020
1025
|
t,
|
|
1021
1026
|
n
|
|
1022
|
-
],
|
|
1023
|
-
return new
|
|
1027
|
+
], Se), Tt);
|
|
1028
|
+
return new Er(dt(i[0]), dt(i[1]), dt(i[2]), r);
|
|
1024
1029
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1030
|
+
function Rt(e) {
|
|
1031
|
+
return Ot(e, mt, Et);
|
|
1027
1032
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return
|
|
1033
|
+
function zt(e) {
|
|
1034
|
+
return kt(e, Dt, ht, (e, t, n, r) => new Dr(e, t, n, r));
|
|
1030
1035
|
}
|
|
1031
|
-
var
|
|
1032
|
-
e =
|
|
1036
|
+
var Bt = 1e3, Vt = 4e4, Ht = 100, Ut = ({ kelvin: e, alpha: t }) => {
|
|
1037
|
+
e = N(v(e, Bt, Vt) / Ht);
|
|
1033
1038
|
let n, r, i;
|
|
1034
1039
|
return e <= 66 ? n = 255 : (n = e - 60, n = 329.698727446 * n ** -.1332047592), n = v(n, 0, 255) / 255, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -.0755148492), r = v(r, 0, 255) / 255, e >= 66 ? i = 255 : e <= 19 ? i = 0 : (i = e - 10, i = 138.5177312231 * Math.log(i) - 305.0447927307), i = v(i, 0, 255) / 255, new I(n, r, i, t);
|
|
1035
|
-
},
|
|
1036
|
-
e =
|
|
1040
|
+
}, Wt = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1041
|
+
e = N(v(e * 255, 0, 255)), t = N(v(t * 255, 0, 255)), n = N(v(n * 255, 0, 255));
|
|
1037
1042
|
let i;
|
|
1038
1043
|
if (i = n === 255 ? 6600 : n === 0 ? 1900 : Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < 255) {
|
|
1039
1044
|
let t = (329.698727446 / e) ** (1 / -.1332047592) + 60;
|
|
1040
1045
|
i = Math.max(i, t);
|
|
1041
1046
|
}
|
|
1042
1047
|
let a = i <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -.0755148492) + 60;
|
|
1043
|
-
return i = (i + a) / 2, i = v(Math.round(i *
|
|
1048
|
+
return i = (i + a) / 2, i = v(Math.round(i * Ht), Bt, Vt), new Sr(i, r);
|
|
1044
1049
|
};
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
1050
|
+
function Gt(e) {
|
|
1051
|
+
return vt(Ut(e));
|
|
1047
1052
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return
|
|
1053
|
+
function Kt(e) {
|
|
1054
|
+
return Wt(yt(e));
|
|
1050
1055
|
}
|
|
1051
|
-
var
|
|
1056
|
+
var qt = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
1052
1057
|
let i = n - n * t / 2, a;
|
|
1053
|
-
return a = i === 0 || i === 1 ? 0 : (n - i) / Math.min(i, 1 - i), new
|
|
1054
|
-
},
|
|
1058
|
+
return a = i === 0 || i === 1 ? 0 : (n - i) / Math.min(i, 1 - i), new hr(e, a, i, r);
|
|
1059
|
+
}, Jt = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1055
1060
|
let i = n + t * Math.min(n, 1 - n), a;
|
|
1056
|
-
return a = i === 0 ? 0 : 2 * (1 - n / i), new
|
|
1057
|
-
},
|
|
1061
|
+
return a = i === 0 ? 0 : 2 * (1 - n / i), new gr(e, a, i, r);
|
|
1062
|
+
}, Yt = ({ h: e, w: t, b: n, alpha: r }) => {
|
|
1058
1063
|
let i, a, o = t + n;
|
|
1059
|
-
return o >= 1 ? (a = t / o, i = 0) : (a = 1 - n, i = a === 0 ? 0 : 1 - t / a),
|
|
1060
|
-
},
|
|
1061
|
-
let { h: i, s: a, v: o } =
|
|
1062
|
-
return new
|
|
1063
|
-
},
|
|
1064
|
+
return o >= 1 ? (a = t / o, i = 0) : (a = 1 - n, i = a === 0 ? 0 : 1 - t / a), qt(new gr(e, i, a, r));
|
|
1065
|
+
}, Xt = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1066
|
+
let { h: i, s: a, v: o } = Jt(new hr(e, t, n, r));
|
|
1067
|
+
return new _r(i, o * (1 - a), 1 - o, r);
|
|
1068
|
+
}, Zt = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1064
1069
|
let i = Math.max(e, t, n), a = Math.min(e, t, n), [o, s, c] = [
|
|
1065
1070
|
0,
|
|
1066
1071
|
0,
|
|
1067
1072
|
(i + a) / 2
|
|
1068
1073
|
], l = i - a;
|
|
1069
|
-
if (l === 0) return new
|
|
1074
|
+
if (l === 0) return new hr(0, 0, c, r);
|
|
1070
1075
|
switch (s = l / (1 - Math.abs(2 * c - 1)), i) {
|
|
1071
1076
|
case e:
|
|
1072
1077
|
o = (t - n) / l + (t < n ? 6 : 0);
|
|
@@ -1078,9 +1083,9 @@ var Wt = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
|
1078
1083
|
o = (e - t) / l + 4;
|
|
1079
1084
|
break;
|
|
1080
1085
|
}
|
|
1081
|
-
return o /= 6, s < 0 && (o = (o + .5) % 1, s = Math.abs(s) % 1), o >= 1 && --o, new
|
|
1086
|
+
return o /= 6, s < 0 && (o = (o + .5) % 1, s = Math.abs(s) % 1), o >= 1 && --o, new hr(o, s, c, r);
|
|
1082
1087
|
};
|
|
1083
|
-
function
|
|
1088
|
+
function Qt({ h: e, s: t, l: n, alpha: r }) {
|
|
1084
1089
|
let i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(e * 6 % 2 - 1)), o = n - i / 2, s, c, l;
|
|
1085
1090
|
return e < 1 / 6 ? [s, c, l] = [
|
|
1086
1091
|
i,
|
|
@@ -1108,25 +1113,25 @@ function Yt({ h: e, s: t, l: n, alpha: r }) {
|
|
|
1108
1113
|
a
|
|
1109
1114
|
], new I(s + o, c + o, l + o, r);
|
|
1110
1115
|
}
|
|
1111
|
-
function Xt(e) {
|
|
1112
|
-
return ht(Yt(e));
|
|
1113
|
-
}
|
|
1114
|
-
function Zt(e) {
|
|
1115
|
-
return Jt(gt(e));
|
|
1116
|
-
}
|
|
1117
|
-
function Qt(e) {
|
|
1118
|
-
return Xt(Wt(e));
|
|
1119
|
-
}
|
|
1120
1116
|
function $t(e) {
|
|
1121
|
-
return
|
|
1117
|
+
return vt(Qt(e));
|
|
1122
1118
|
}
|
|
1123
1119
|
function en(e) {
|
|
1124
|
-
return
|
|
1120
|
+
return Zt(yt(e));
|
|
1125
1121
|
}
|
|
1126
1122
|
function tn(e) {
|
|
1127
|
-
return qt(
|
|
1123
|
+
return $t(qt(e));
|
|
1128
1124
|
}
|
|
1129
1125
|
function nn(e) {
|
|
1126
|
+
return Jt(en(e));
|
|
1127
|
+
}
|
|
1128
|
+
function rn(e) {
|
|
1129
|
+
return $t(Yt(e));
|
|
1130
|
+
}
|
|
1131
|
+
function an(e) {
|
|
1132
|
+
return Xt(en(e));
|
|
1133
|
+
}
|
|
1134
|
+
function on(e) {
|
|
1130
1135
|
if (e.whitePoint === "D50") return [
|
|
1131
1136
|
e.x,
|
|
1132
1137
|
e.y,
|
|
@@ -1136,10 +1141,10 @@ function nn(e) {
|
|
|
1136
1141
|
e.x,
|
|
1137
1142
|
e.y,
|
|
1138
1143
|
e.z
|
|
1139
|
-
],
|
|
1144
|
+
], Se);
|
|
1140
1145
|
throw Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1141
1146
|
}
|
|
1142
|
-
function
|
|
1147
|
+
function sn(e) {
|
|
1143
1148
|
if (e.whitePoint === "D65") return [
|
|
1144
1149
|
e.x,
|
|
1145
1150
|
e.y,
|
|
@@ -1149,235 +1154,207 @@ function rn(e) {
|
|
|
1149
1154
|
e.x,
|
|
1150
1155
|
e.y,
|
|
1151
1156
|
e.z
|
|
1152
|
-
],
|
|
1157
|
+
], Ce);
|
|
1153
1158
|
throw Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1154
1159
|
}
|
|
1155
|
-
var
|
|
1156
|
-
function
|
|
1157
|
-
let n = (e) => e >
|
|
1160
|
+
var cn = 216 / 24389, ln = 24 / 116, un = 24389 / 27, dn = 8, fn = 16, pn = 116, mn = 500, hn = 200;
|
|
1161
|
+
function gn(e, t = "D50") {
|
|
1162
|
+
let n = (e) => e > cn ? Math.cbrt(e) : (un * e + fn) / pn, r = we[t], [i, a, o] = on(e), s = i / r[0], c = a / r[1], l = o / r[2], u = n(s), d = n(c), f = n(l), p = pn * d - fn, m = mn * (u - d), h = hn * (d - f), g = new vr(y(p, T.lab.l.number.min, T.lab.l.number.max), y(m, T.lab.a.number.min, T.lab.a.number.max), y(h, T.lab.b.number.min, T.lab.b.number.max), e.alpha);
|
|
1158
1163
|
return g.whitePoint = t, g;
|
|
1159
1164
|
}
|
|
1160
|
-
function
|
|
1161
|
-
let t = (e) => e >
|
|
1162
|
-
i =
|
|
1163
|
-
let c = (i +
|
|
1165
|
+
function _n(e) {
|
|
1166
|
+
let t = (e) => e > ln ? e ** 3 : (pn * e - fn) / un, n = (e) => e > dn ? ((e + fn) / pn) ** 3 : e / un, r = we[e.whitePoint], { l: i, a, b: o, alpha: s } = e;
|
|
1167
|
+
i = N(y(i, 0, 1, T.lab.l.number.min, T.lab.l.number.max)), a = N(y(a, 0, 1, T.lab.a.number.min, T.lab.a.number.max)), o = N(y(o, 0, 1, T.lab.b.number.min, T.lab.b.number.max));
|
|
1168
|
+
let c = (i + fn) / pn, l = a / mn + c, u = c - o / hn, [d, f, p] = [
|
|
1164
1169
|
t(l),
|
|
1165
1170
|
n(i),
|
|
1166
1171
|
t(u)
|
|
1167
1172
|
], m = d * r[0], h = f * r[1], g = p * r[2], _ = new L(m, h, g, s);
|
|
1168
|
-
return _.whitePoint = e.whitePoint, [m, h, g] =
|
|
1173
|
+
return _.whitePoint = e.whitePoint, [m, h, g] = sn(_), _.whitePoint = "D65", _.x = N(m), _.y = N(h), _.z = N(g), _;
|
|
1169
1174
|
}
|
|
1170
|
-
function
|
|
1171
|
-
t =
|
|
1175
|
+
function vn({ l: e, c: t, h: n, alpha: r }) {
|
|
1176
|
+
t = N(y(t, 0, 1, T.lch.c.number.min, T.lch.c.number.max));
|
|
1172
1177
|
let i = n * 2 * Math.PI, a = Math.cos(i) * t, o = Math.sin(i) * t;
|
|
1173
|
-
return new
|
|
1178
|
+
return new vr(e, y(a, T.lab.a.number.min, T.lab.a.number.max), y(o, T.lab.b.number.min, T.lab.b.number.max), r);
|
|
1174
1179
|
}
|
|
1175
|
-
function
|
|
1176
|
-
t =
|
|
1180
|
+
function yn({ l: e, a: t, b: n, alpha: r }) {
|
|
1181
|
+
t = N(y(t, 0, 1, T.lab.a.number.min, T.lab.a.number.max)), n = N(y(n, 0, 1, T.lab.b.number.min, T.lab.b.number.max));
|
|
1177
1182
|
let i = Math.hypot(t, n), a = Math.atan2(n, t) / (2 * Math.PI);
|
|
1178
|
-
return a < 0 && (a += 1), new
|
|
1183
|
+
return a < 0 && (a += 1), new yr(e, y(i, T.lch.c.number.min, T.lch.c.number.max), a, r);
|
|
1179
1184
|
}
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1185
|
+
function bn(e) {
|
|
1186
|
+
return _n(vn(e));
|
|
1182
1187
|
}
|
|
1183
|
-
function
|
|
1184
|
-
return gn(
|
|
1188
|
+
function xn(e) {
|
|
1189
|
+
return yn(gn(e));
|
|
1185
1190
|
}
|
|
1186
|
-
function
|
|
1187
|
-
t =
|
|
1191
|
+
function Sn({ l: e, a: t, b: n, alpha: r }) {
|
|
1192
|
+
t = N(y(t, 0, 1, T.oklab.a.number.min, T.oklab.a.number.max)), n = N(y(n, 0, 1, T.oklab.b.number.min, T.oklab.b.number.max));
|
|
1188
1193
|
let i = x([
|
|
1189
1194
|
e,
|
|
1190
1195
|
t,
|
|
1191
1196
|
n
|
|
1192
|
-
],
|
|
1197
|
+
], De), [a, o, s] = x([
|
|
1193
1198
|
i[0] * i[0] * i[0],
|
|
1194
1199
|
i[1] * i[1] * i[1],
|
|
1195
1200
|
i[2] * i[2] * i[2]
|
|
1196
|
-
],
|
|
1201
|
+
], Ee);
|
|
1197
1202
|
return new L(a, o, s, r);
|
|
1198
1203
|
}
|
|
1199
|
-
function
|
|
1204
|
+
function Cn(e) {
|
|
1200
1205
|
let { x: t, y: n, z: r } = e, i = x([
|
|
1201
1206
|
t,
|
|
1202
1207
|
n,
|
|
1203
1208
|
r
|
|
1204
|
-
],
|
|
1209
|
+
], Te), [a, o, s] = x([
|
|
1205
1210
|
Math.cbrt(i[0]),
|
|
1206
1211
|
Math.cbrt(i[1]),
|
|
1207
1212
|
Math.cbrt(i[2])
|
|
1208
|
-
],
|
|
1209
|
-
return new
|
|
1213
|
+
], E);
|
|
1214
|
+
return new br(a, y(o, T.oklab.a.number.min, T.oklab.a.number.max), y(s, T.oklab.b.number.min, T.oklab.b.number.max), e.alpha);
|
|
1210
1215
|
}
|
|
1211
|
-
function
|
|
1212
|
-
t =
|
|
1216
|
+
function wn({ l: e, a: t, b: n, alpha: r }) {
|
|
1217
|
+
t = N(y(t, 0, 1, T.oklab.a.number.min, T.oklab.a.number.max)), n = N(y(n, 0, 1, T.oklab.b.number.min, T.oklab.b.number.max));
|
|
1213
1218
|
let i = Math.hypot(t, n), a = Math.atan2(n, t) / (2 * Math.PI);
|
|
1214
|
-
return a < 0 && (a += 1), new
|
|
1219
|
+
return a < 0 && (a += 1), new xr(e, y(i, T.oklch.c.number.min, T.oklch.c.number.max), a, r);
|
|
1215
1220
|
}
|
|
1216
|
-
function
|
|
1217
|
-
t =
|
|
1221
|
+
function Tn({ l: e, c: t, h: n, alpha: r }) {
|
|
1222
|
+
t = N(y(t, 0, 1, T.oklch.c.number.min, T.oklch.c.number.max));
|
|
1218
1223
|
let i = n * 2 * Math.PI, a = Math.cos(i) * t, o = Math.sin(i) * t;
|
|
1219
|
-
return new
|
|
1220
|
-
}
|
|
1221
|
-
function Cn(e) {
|
|
1222
|
-
return yn(Sn(e));
|
|
1223
|
-
}
|
|
1224
|
-
function wn(e) {
|
|
1225
|
-
return xn(bn(e));
|
|
1226
|
-
}
|
|
1227
|
-
function Tn(e) {
|
|
1228
|
-
let t = y(e.a, 0, 1, E.oklab.a.number.min, E.oklab.a.number.max), n = y(e.b, 0, 1, E.oklab.b.number.min, E.oklab.b.number.max), r = e.l, i = r + A.l[1] * t + A.l[2] * n, a = r + A.m[1] * t + A.m[2] * n, o = r + A.s[1] * t + A.s[2] * n, s = i * i * i, c = a * a * a, l = o * o * o, u = O[0] * s + O[1] * c + O[2] * l, d = O[3] * s + O[4] * c + O[5] * l, f = O[6] * s + O[7] * c + O[8] * l, p = Un(new I(M(u), M(d), M(f), e.alpha));
|
|
1229
|
-
return new I(p.r, p.g, p.b, e.alpha);
|
|
1224
|
+
return new br(e, y(a, T.oklab.a.number.min, T.oklab.a.number.max), y(o, T.oklab.b.number.min, T.oklab.b.number.max), r);
|
|
1230
1225
|
}
|
|
1231
1226
|
function En(e) {
|
|
1232
|
-
|
|
1233
|
-
return new yr(s, y(c, E.oklab.a.number.min, E.oklab.a.number.max), y(l, E.oklab.b.number.min, E.oklab.b.number.max), e.alpha);
|
|
1227
|
+
return Sn(Tn(e));
|
|
1234
1228
|
}
|
|
1235
1229
|
function Dn(e) {
|
|
1236
|
-
|
|
1237
|
-
return new I(h.r, h.g, h.b, e.alpha);
|
|
1230
|
+
return wn(Cn(e));
|
|
1238
1231
|
}
|
|
1239
1232
|
function On(e) {
|
|
1240
|
-
let t =
|
|
1241
|
-
return
|
|
1233
|
+
let t = y(e.a, 0, 1, T.oklab.a.number.min, T.oklab.a.number.max), n = y(e.b, 0, 1, T.oklab.b.number.min, T.oklab.b.number.max), r = e.l, i = r + k.l[1] * t + k.l[2] * n, a = r + k.m[1] * t + k.m[2] * n, o = r + k.s[1] * t + k.s[2] * n, s = i * i * i, c = a * a * a, l = o * o * o, u = D[0] * s + D[1] * c + D[2] * l, d = D[3] * s + D[4] * c + D[5] * l, f = D[6] * s + D[7] * c + D[8] * l, p = Bn(new I(j(u), j(d), j(f), e.alpha));
|
|
1234
|
+
return new I(p.r, p.g, p.b, e.alpha);
|
|
1242
1235
|
}
|
|
1243
1236
|
function kn(e) {
|
|
1244
|
-
|
|
1237
|
+
let t = A(e.r), n = A(e.g), r = A(e.b), i = Math.cbrt(O[0] * t + O[1] * n + O[2] * r), a = Math.cbrt(O[3] * t + O[4] * n + O[5] * r), o = Math.cbrt(O[6] * t + O[7] * n + O[8] * r), s = E[0] * i + E[1] * a + E[2] * o, c = E[3] * i + E[4] * a + E[5] * o, l = E[6] * i + E[7] * a + E[8] * o;
|
|
1238
|
+
return new br(s, y(c, T.oklab.a.number.min, T.oklab.a.number.max), y(l, T.oklab.b.number.min, T.oklab.b.number.max), e.alpha);
|
|
1245
1239
|
}
|
|
1246
1240
|
function An(e) {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
var jn = {
|
|
1250
|
-
"oklab->rgb": Tn,
|
|
1251
|
-
"rgb->oklab": En,
|
|
1252
|
-
"oklch->rgb": Dn,
|
|
1253
|
-
"rgb->oklch": On,
|
|
1254
|
-
"hsl->rgb": kn,
|
|
1255
|
-
"rgb->hsl": An
|
|
1256
|
-
}, Mn = (e, t) => jn[`${e}->${t}`], Nn = .35;
|
|
1257
|
-
function Pn(e, t, n, r, i = Nn) {
|
|
1258
|
-
if (Math.abs(e - r) >= i) return {
|
|
1259
|
-
L: e,
|
|
1260
|
-
C: t,
|
|
1261
|
-
H: n
|
|
1262
|
-
};
|
|
1263
|
-
let a = r < .5, o = a ? r + i : r - i;
|
|
1264
|
-
o = v(o, .05, .95), Math.abs(o - r) < i * .8 && (o = v(a ? r - i : r + i, .05, .95));
|
|
1265
|
-
let s = t * (1 - .5 * Math.max(0, Math.abs(o - .5) - .3));
|
|
1266
|
-
return {
|
|
1267
|
-
L: o,
|
|
1268
|
-
C: s,
|
|
1269
|
-
H: n
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
function Fn(e) {
|
|
1273
|
-
return (e.colorSpace === "oklch" ? e : N(e, "oklch")).l;
|
|
1274
|
-
}
|
|
1275
|
-
function In(e, t, n = Nn) {
|
|
1276
|
-
let r = Fn(e);
|
|
1277
|
-
return Math.abs(r - t) < n;
|
|
1278
|
-
}
|
|
1279
|
-
function Ln(e, t, n = Nn) {
|
|
1280
|
-
let r = e.colorSpace === "oklch" ? e.clone() : N(e, "oklch"), i = r.l, a = r.c, o = r.h, s = Pn(i, a, o, t, n);
|
|
1281
|
-
return r.l = P(s.L), r.c = P(s.C), r.h = P(s.H), r;
|
|
1241
|
+
let t = y(e.c, 0, 1, T.oklch.c.number.min, T.oklch.c.number.max), n = e.h * 2 * Math.PI, r = Math.cos(n) * t, i = Math.sin(n) * t, a = e.l, o = a + k.l[1] * r + k.l[2] * i, s = a + k.m[1] * r + k.m[2] * i, c = a + k.s[1] * r + k.s[2] * i, l = o * o * o, u = s * s * s, d = c * c * c, f = D[0] * l + D[1] * u + D[2] * d, p = D[3] * l + D[4] * u + D[5] * d, m = D[6] * l + D[7] * u + D[8] * d, h = Bn(new I(j(f), j(p), j(m), e.alpha));
|
|
1242
|
+
return new I(h.r, h.g, h.b, e.alpha);
|
|
1282
1243
|
}
|
|
1283
|
-
|
|
1284
|
-
let t =
|
|
1244
|
+
function jn(e) {
|
|
1245
|
+
let t = A(e.r), n = A(e.g), r = A(e.b), i = Math.cbrt(O[0] * t + O[1] * n + O[2] * r), a = Math.cbrt(O[3] * t + O[4] * n + O[5] * r), o = Math.cbrt(O[6] * t + O[7] * n + O[8] * r), s = E[0] * i + E[1] * a + E[2] * o, c = E[3] * i + E[4] * a + E[5] * o, l = E[6] * i + E[7] * a + E[8] * o, u = Math.hypot(c, l), d = Math.atan2(l, c) / (2 * Math.PI);
|
|
1246
|
+
return d < 0 && (d += 1), new xr(s, y(u, T.oklch.c.number.min, T.oklch.c.number.max), d, e.alpha);
|
|
1247
|
+
}
|
|
1248
|
+
function Mn(e) {
|
|
1249
|
+
return Bn(Qt(e));
|
|
1250
|
+
}
|
|
1251
|
+
function Nn(e) {
|
|
1252
|
+
return Zt(e);
|
|
1253
|
+
}
|
|
1254
|
+
var Pn = {
|
|
1255
|
+
"oklab->rgb": On,
|
|
1256
|
+
"rgb->oklab": kn,
|
|
1257
|
+
"oklch->rgb": An,
|
|
1258
|
+
"rgb->oklch": jn,
|
|
1259
|
+
"hsl->rgb": Mn,
|
|
1260
|
+
"rgb->hsl": Nn
|
|
1261
|
+
}, Fn = (e, t) => Pn[`${e}->${t}`], In = (e) => {
|
|
1262
|
+
let t = T[e], n = {};
|
|
1285
1263
|
for (let r of Object.keys(t)) {
|
|
1286
|
-
let t =
|
|
1264
|
+
let t = ve(e, r), { min: i, max: a } = _e(e, r, t);
|
|
1287
1265
|
n[r] = {
|
|
1288
1266
|
min: `${i}${t}`,
|
|
1289
1267
|
max: `${a}${t}`
|
|
1290
1268
|
};
|
|
1291
1269
|
}
|
|
1292
1270
|
return n;
|
|
1293
|
-
},
|
|
1271
|
+
}, Ln = {
|
|
1294
1272
|
rgb: {
|
|
1295
|
-
to:
|
|
1296
|
-
from:
|
|
1273
|
+
to: vt,
|
|
1274
|
+
from: yt
|
|
1297
1275
|
},
|
|
1298
1276
|
hsl: {
|
|
1299
|
-
to:
|
|
1300
|
-
from:
|
|
1277
|
+
to: $t,
|
|
1278
|
+
from: en
|
|
1301
1279
|
},
|
|
1302
1280
|
hsv: {
|
|
1303
|
-
to:
|
|
1304
|
-
from:
|
|
1281
|
+
to: tn,
|
|
1282
|
+
from: nn
|
|
1305
1283
|
},
|
|
1306
1284
|
hwb: {
|
|
1307
|
-
to:
|
|
1308
|
-
from:
|
|
1285
|
+
to: rn,
|
|
1286
|
+
from: an
|
|
1309
1287
|
},
|
|
1310
1288
|
lab: {
|
|
1311
|
-
to:
|
|
1312
|
-
from:
|
|
1289
|
+
to: _n,
|
|
1290
|
+
from: gn
|
|
1313
1291
|
},
|
|
1314
1292
|
lch: {
|
|
1315
|
-
to:
|
|
1316
|
-
from:
|
|
1293
|
+
to: bn,
|
|
1294
|
+
from: xn
|
|
1317
1295
|
},
|
|
1318
1296
|
oklab: {
|
|
1319
|
-
to:
|
|
1320
|
-
from:
|
|
1297
|
+
to: Sn,
|
|
1298
|
+
from: Cn
|
|
1321
1299
|
},
|
|
1322
1300
|
oklch: {
|
|
1323
|
-
to:
|
|
1324
|
-
from:
|
|
1301
|
+
to: En,
|
|
1302
|
+
from: Dn
|
|
1325
1303
|
},
|
|
1326
1304
|
kelvin: {
|
|
1327
|
-
to:
|
|
1328
|
-
from:
|
|
1305
|
+
to: Gt,
|
|
1306
|
+
from: Kt
|
|
1329
1307
|
},
|
|
1330
1308
|
xyz: {
|
|
1331
1309
|
to: (e) => e,
|
|
1332
1310
|
from: (e) => e
|
|
1333
1311
|
},
|
|
1334
1312
|
"srgb-linear": {
|
|
1335
|
-
to:
|
|
1336
|
-
from:
|
|
1313
|
+
to: At,
|
|
1314
|
+
from: jt
|
|
1337
1315
|
},
|
|
1338
1316
|
"display-p3": {
|
|
1339
|
-
to:
|
|
1340
|
-
from:
|
|
1317
|
+
to: Mt,
|
|
1318
|
+
from: Nt
|
|
1341
1319
|
},
|
|
1342
1320
|
"a98-rgb": {
|
|
1343
|
-
to:
|
|
1344
|
-
from:
|
|
1321
|
+
to: Pt,
|
|
1322
|
+
from: Ft
|
|
1345
1323
|
},
|
|
1346
1324
|
"prophoto-rgb": {
|
|
1347
|
-
to:
|
|
1348
|
-
from:
|
|
1325
|
+
to: It,
|
|
1326
|
+
from: Lt
|
|
1349
1327
|
},
|
|
1350
1328
|
rec2020: {
|
|
1351
|
-
to:
|
|
1352
|
-
from:
|
|
1329
|
+
to: Rt,
|
|
1330
|
+
from: zt
|
|
1353
1331
|
}
|
|
1354
|
-
},
|
|
1355
|
-
function
|
|
1332
|
+
}, Rn = (e) => Ln[e]?.to, zn = (e) => Ln[e]?.from;
|
|
1333
|
+
function M(e, t) {
|
|
1356
1334
|
if (e.colorSpace === t) return e;
|
|
1357
|
-
let n =
|
|
1335
|
+
let n = Fn(e.colorSpace, t);
|
|
1358
1336
|
if (n) return n(e);
|
|
1359
|
-
let r =
|
|
1337
|
+
let r = Rn(e.colorSpace);
|
|
1360
1338
|
if (!r) throw Error(`Unknown source color space: "${e.colorSpace}"`);
|
|
1361
|
-
let i = r(e), a =
|
|
1339
|
+
let i = r(e), a = zn(t);
|
|
1362
1340
|
if (!a) throw Error(`Unknown target color space: "${t}"`);
|
|
1363
1341
|
return a(i);
|
|
1364
1342
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
let t = N(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, i = Number.isNaN(t.b) ? 0 : t.b;
|
|
1343
|
+
function Bn(e) {
|
|
1344
|
+
let t = M(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, i = Number.isNaN(t.b) ? 0 : t.b;
|
|
1368
1345
|
if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && i >= 0 && i <= 1) return e;
|
|
1369
|
-
if (n >= -
|
|
1370
|
-
let [a, o, s] =
|
|
1371
|
-
return
|
|
1346
|
+
if (n >= -1e-6 && n <= 1.000001 && r >= -1e-6 && r <= 1.000001 && i >= -1e-6 && i <= 1.000001) return M(new I(v(n, 0, 1), v(r, 0, 1), v(i, 0, 1), e.alpha), e.colorSpace);
|
|
1347
|
+
let [a, o, s] = Je(n, r, i);
|
|
1348
|
+
return M(new I(a, o, s, e.alpha), e.colorSpace);
|
|
1372
1349
|
}
|
|
1373
|
-
var
|
|
1350
|
+
var Vn = {
|
|
1374
1351
|
hsl: "h",
|
|
1375
1352
|
hsv: "h",
|
|
1376
1353
|
hwb: "h",
|
|
1377
1354
|
lch: "h",
|
|
1378
1355
|
oklch: "h"
|
|
1379
1356
|
};
|
|
1380
|
-
function
|
|
1357
|
+
function Hn(e, t, n, r = "shorter") {
|
|
1381
1358
|
if (Number.isNaN(e) && Number.isNaN(t)) return 0;
|
|
1382
1359
|
if (Number.isNaN(e)) return t;
|
|
1383
1360
|
if (Number.isNaN(t)) return e;
|
|
@@ -1399,19 +1376,19 @@ function Gn(e, t, n, r = "shorter") {
|
|
|
1399
1376
|
let a = e + n * (t - e);
|
|
1400
1377
|
return a = (a % 1 + 1) % 1, a;
|
|
1401
1378
|
}
|
|
1402
|
-
function
|
|
1403
|
-
let o =
|
|
1379
|
+
function Un(e, t, n, r, i = "oklab", a = "shorter") {
|
|
1380
|
+
let o = M(e, i), s = M(t, i);
|
|
1404
1381
|
n < 0 && (n = 0), r < 0 && (r = 0);
|
|
1405
1382
|
let c = n + r;
|
|
1406
1383
|
c === 0 ? (n = .5, r = .5) : c !== 1 && (n /= c, r /= c);
|
|
1407
|
-
let l = Math.min(c, 1), u =
|
|
1384
|
+
let l = Math.min(c, 1), u = Vn[i], d = o.keys().filter((e) => e !== "alpha"), f = Number.isNaN(o.alpha) ? s.alpha : o.alpha, p = Number.isNaN(s.alpha) ? o.alpha : s.alpha, m = b(f, p, r) * l, h = [];
|
|
1408
1385
|
for (let e of d) {
|
|
1409
1386
|
let t = o[e], n = s[e];
|
|
1410
1387
|
if (Number.isNaN(t) && Number.isNaN(n)) {
|
|
1411
1388
|
h.push(0);
|
|
1412
1389
|
continue;
|
|
1413
1390
|
}
|
|
1414
|
-
if (Number.isNaN(t) && (t = n), Number.isNaN(n) && (n = t), e === u) h.push(
|
|
1391
|
+
if (Number.isNaN(t) && (t = n), Number.isNaN(n) && (n = t), e === u) h.push(Hn(t, n, r, a));
|
|
1415
1392
|
else {
|
|
1416
1393
|
let e = b(t * f, n * p, r);
|
|
1417
1394
|
h.push(m > 0 ? e / m : 0);
|
|
@@ -1420,7 +1397,34 @@ function Kn(e, t, n, r, i = "oklab", a = "shorter") {
|
|
|
1420
1397
|
let g = o.constructor;
|
|
1421
1398
|
return new g(...h, m);
|
|
1422
1399
|
}
|
|
1423
|
-
var
|
|
1400
|
+
var Wn = .35;
|
|
1401
|
+
function Gn(e, t, n, r, i = Wn) {
|
|
1402
|
+
if (Math.abs(e - r) >= i) return {
|
|
1403
|
+
L: e,
|
|
1404
|
+
C: t,
|
|
1405
|
+
H: n
|
|
1406
|
+
};
|
|
1407
|
+
let a = r < .5, o = a ? r + i : r - i;
|
|
1408
|
+
o = v(o, .05, .95), Math.abs(o - r) < i * .8 && (o = v(a ? r - i : r + i, .05, .95));
|
|
1409
|
+
let s = t * (1 - .5 * Math.max(0, Math.abs(o - .5) - .3));
|
|
1410
|
+
return {
|
|
1411
|
+
L: o,
|
|
1412
|
+
C: s,
|
|
1413
|
+
H: n
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
function Kn(e) {
|
|
1417
|
+
return (e.colorSpace === "oklch" ? e : M(e, "oklch")).l;
|
|
1418
|
+
}
|
|
1419
|
+
function qn(e, t, n = Wn) {
|
|
1420
|
+
let r = Kn(e);
|
|
1421
|
+
return Math.abs(r - t) < n;
|
|
1422
|
+
}
|
|
1423
|
+
function Jn(e, t, n = Wn) {
|
|
1424
|
+
let r = e.colorSpace === "oklch" ? e.clone() : M(e, "oklch"), i = r.l, a = r.c, o = r.h, s = Gn(i, a, o, t, n);
|
|
1425
|
+
return r.l = N(s.L), r.c = N(s.C), r.h = N(s.H), r;
|
|
1426
|
+
}
|
|
1427
|
+
var Yn = (e) => e != null && typeof e.toFixed == "function", Xn = (e, t = 2) => typeof e == "number" && !Number.isFinite(e) ? "none" : (Yn(e) ? e.toFixed(t) : String(e)).trim().replace(/\.0+$/, ""), Zn = (e, t, n) => Number(n) === 1 ? `${e}(${t.join(" ")})` : `${e}(${t.join(" ")} / ${n})`, N = (e) => e, P = (e, t) => e[t], Qn = (e, t, n) => {
|
|
1424
1428
|
e[t] = n;
|
|
1425
1429
|
}, F = class e {
|
|
1426
1430
|
colorSpace;
|
|
@@ -1438,11 +1442,11 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1438
1442
|
static CLONE_DEPTH_LIMIT = 16;
|
|
1439
1443
|
toString() {
|
|
1440
1444
|
let e = this.values().slice(0, -1).map((e) => typeof e == "number" && Number.isNaN(e) ? "none" : e), t = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
|
|
1441
|
-
return
|
|
1445
|
+
return Zn(this.colorSpace, e, t);
|
|
1442
1446
|
}
|
|
1443
1447
|
toFormattedString(e = 2) {
|
|
1444
|
-
let t = this.values().slice(0, -1).map((t) =>
|
|
1445
|
-
return
|
|
1448
|
+
let t = this.values().slice(0, -1).map((t) => Xn(t, e)), n = Xn(this.alpha, e);
|
|
1449
|
+
return Zn(this.colorSpace, t, n);
|
|
1446
1450
|
}
|
|
1447
1451
|
valueOf() {
|
|
1448
1452
|
return [...this.values(), this.alpha];
|
|
@@ -1456,8 +1460,8 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1456
1460
|
if (++e._cloneDepth > e.CLONE_DEPTH_LIMIT) throw e._cloneDepth = 0, Error(`Color.clone() exceeded depth ${e.CLONE_DEPTH_LIMIT}. This is the iOS Safari stack-overflow precursor. Inspect the structure for ValueUnit/Color self-nesting.`);
|
|
1457
1461
|
try {
|
|
1458
1462
|
let e = this.constructor, t = new e();
|
|
1459
|
-
t.alpha =
|
|
1460
|
-
for (let e of this.channels)
|
|
1463
|
+
t.alpha = l(this.alpha);
|
|
1464
|
+
for (let e of this.channels) Qn(t, e, l(P(this, e)));
|
|
1461
1465
|
return t;
|
|
1462
1466
|
} finally {
|
|
1463
1467
|
e._cloneDepth--;
|
|
@@ -1468,92 +1472,84 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1468
1472
|
}
|
|
1469
1473
|
values() {
|
|
1470
1474
|
let e = [], t = this.channels;
|
|
1471
|
-
for (let n = 0; n < t.length; n++) e.push(
|
|
1475
|
+
for (let n = 0; n < t.length; n++) e.push(P(this, t[n]));
|
|
1472
1476
|
return e.push(this.alpha), e;
|
|
1473
1477
|
}
|
|
1474
1478
|
entries() {
|
|
1475
1479
|
let e = [], t = this.channels;
|
|
1476
|
-
for (let n = 0; n < t.length; n++) e.push([t[n],
|
|
1480
|
+
for (let n = 0; n < t.length; n++) e.push([t[n], P(this, t[n])]);
|
|
1477
1481
|
return e.push(["alpha", this.alpha]), e;
|
|
1478
1482
|
}
|
|
1479
|
-
},
|
|
1483
|
+
}, $n = [
|
|
1480
1484
|
"r",
|
|
1481
1485
|
"g",
|
|
1482
1486
|
"b"
|
|
1483
|
-
],
|
|
1487
|
+
], er = [
|
|
1484
1488
|
"h",
|
|
1485
1489
|
"s",
|
|
1486
1490
|
"l"
|
|
1487
|
-
],
|
|
1491
|
+
], tr = [
|
|
1488
1492
|
"h",
|
|
1489
1493
|
"s",
|
|
1490
1494
|
"v"
|
|
1491
|
-
],
|
|
1495
|
+
], nr = [
|
|
1492
1496
|
"h",
|
|
1493
1497
|
"w",
|
|
1494
1498
|
"b"
|
|
1495
|
-
],
|
|
1499
|
+
], rr = [
|
|
1496
1500
|
"l",
|
|
1497
1501
|
"a",
|
|
1498
1502
|
"b"
|
|
1499
|
-
],
|
|
1503
|
+
], ir = [
|
|
1500
1504
|
"l",
|
|
1501
1505
|
"c",
|
|
1502
1506
|
"h"
|
|
1503
|
-
],
|
|
1507
|
+
], ar = [
|
|
1504
1508
|
"x",
|
|
1505
1509
|
"y",
|
|
1506
1510
|
"z"
|
|
1507
|
-
],
|
|
1511
|
+
], or = ["kelvin"], sr = [
|
|
1508
1512
|
"r",
|
|
1509
1513
|
"g",
|
|
1510
1514
|
"b",
|
|
1511
1515
|
"alpha"
|
|
1512
|
-
],
|
|
1516
|
+
], cr = [
|
|
1513
1517
|
"h",
|
|
1514
1518
|
"s",
|
|
1515
1519
|
"l",
|
|
1516
1520
|
"alpha"
|
|
1517
|
-
],
|
|
1521
|
+
], lr = [
|
|
1518
1522
|
"h",
|
|
1519
1523
|
"s",
|
|
1520
1524
|
"v",
|
|
1521
1525
|
"alpha"
|
|
1522
|
-
],
|
|
1526
|
+
], ur = [
|
|
1523
1527
|
"h",
|
|
1524
1528
|
"w",
|
|
1525
1529
|
"b",
|
|
1526
1530
|
"alpha"
|
|
1527
|
-
],
|
|
1531
|
+
], dr = [
|
|
1528
1532
|
"l",
|
|
1529
1533
|
"a",
|
|
1530
1534
|
"b",
|
|
1531
1535
|
"alpha"
|
|
1532
|
-
],
|
|
1536
|
+
], fr = [
|
|
1533
1537
|
"l",
|
|
1534
1538
|
"c",
|
|
1535
1539
|
"h",
|
|
1536
1540
|
"alpha"
|
|
1537
|
-
],
|
|
1541
|
+
], pr = [
|
|
1538
1542
|
"x",
|
|
1539
1543
|
"y",
|
|
1540
1544
|
"z",
|
|
1541
1545
|
"alpha"
|
|
1542
|
-
],
|
|
1543
|
-
static channelKeysWithAlpha = or;
|
|
1544
|
-
get channels() {
|
|
1545
|
-
return Qn;
|
|
1546
|
-
}
|
|
1547
|
-
constructor(e, t, n, r) {
|
|
1548
|
-
super("rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1549
|
-
}
|
|
1550
|
-
}, mr = class extends F {
|
|
1546
|
+
], mr = ["kelvin", "alpha"], I = class extends F {
|
|
1551
1547
|
static channelKeysWithAlpha = sr;
|
|
1552
1548
|
get channels() {
|
|
1553
1549
|
return $n;
|
|
1554
1550
|
}
|
|
1555
1551
|
constructor(e, t, n, r) {
|
|
1556
|
-
super("
|
|
1552
|
+
super("rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1557
1553
|
}
|
|
1558
1554
|
}, hr = class extends F {
|
|
1559
1555
|
static channelKeysWithAlpha = cr;
|
|
@@ -1561,7 +1557,7 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1561
1557
|
return er;
|
|
1562
1558
|
}
|
|
1563
1559
|
constructor(e, t, n, r) {
|
|
1564
|
-
super("
|
|
1560
|
+
super("hsl", r), this.h = e, this.s = t, this.l = n;
|
|
1565
1561
|
}
|
|
1566
1562
|
}, gr = class extends F {
|
|
1567
1563
|
static channelKeysWithAlpha = lr;
|
|
@@ -1569,7 +1565,7 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1569
1565
|
return tr;
|
|
1570
1566
|
}
|
|
1571
1567
|
constructor(e, t, n, r) {
|
|
1572
|
-
super("
|
|
1568
|
+
super("hsv", r), this.h = e, this.s = t, this.v = n;
|
|
1573
1569
|
}
|
|
1574
1570
|
}, _r = class extends F {
|
|
1575
1571
|
static channelKeysWithAlpha = ur;
|
|
@@ -1577,7 +1573,7 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1577
1573
|
return nr;
|
|
1578
1574
|
}
|
|
1579
1575
|
constructor(e, t, n, r) {
|
|
1580
|
-
super("
|
|
1576
|
+
super("hwb", r), this.h = e, this.w = t, this.b = n;
|
|
1581
1577
|
}
|
|
1582
1578
|
}, vr = class extends F {
|
|
1583
1579
|
static channelKeysWithAlpha = dr;
|
|
@@ -1585,15 +1581,15 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1585
1581
|
return rr;
|
|
1586
1582
|
}
|
|
1587
1583
|
constructor(e, t, n, r) {
|
|
1588
|
-
super("
|
|
1584
|
+
super("lab", r), this.whitePoint = "D50", this.l = e, this.a = t, this.b = n;
|
|
1589
1585
|
}
|
|
1590
1586
|
}, yr = class extends F {
|
|
1591
|
-
static channelKeysWithAlpha =
|
|
1587
|
+
static channelKeysWithAlpha = fr;
|
|
1592
1588
|
get channels() {
|
|
1593
|
-
return
|
|
1589
|
+
return ir;
|
|
1594
1590
|
}
|
|
1595
1591
|
constructor(e, t, n, r) {
|
|
1596
|
-
super("
|
|
1592
|
+
super("lch", r), this.l = e, this.c = t, this.h = n;
|
|
1597
1593
|
}
|
|
1598
1594
|
}, br = class extends F {
|
|
1599
1595
|
static channelKeysWithAlpha = dr;
|
|
@@ -1601,67 +1597,75 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1601
1597
|
return rr;
|
|
1602
1598
|
}
|
|
1603
1599
|
constructor(e, t, n, r) {
|
|
1604
|
-
super("
|
|
1600
|
+
super("oklab", r), this.whitePoint = "D50", this.l = e, this.a = t, this.b = n;
|
|
1605
1601
|
}
|
|
1606
|
-
},
|
|
1602
|
+
}, xr = class extends F {
|
|
1607
1603
|
static channelKeysWithAlpha = fr;
|
|
1608
1604
|
get channels() {
|
|
1609
1605
|
return ir;
|
|
1610
1606
|
}
|
|
1611
1607
|
constructor(e, t, n, r) {
|
|
1612
|
-
super("
|
|
1608
|
+
super("oklch", r), this.l = e, this.c = t, this.h = n;
|
|
1613
1609
|
}
|
|
1614
|
-
},
|
|
1610
|
+
}, L = class extends F {
|
|
1615
1611
|
static channelKeysWithAlpha = pr;
|
|
1616
1612
|
get channels() {
|
|
1617
1613
|
return ar;
|
|
1618
1614
|
}
|
|
1615
|
+
constructor(e, t, n, r) {
|
|
1616
|
+
super("xyz", r), this.x = e, this.y = t, this.z = n;
|
|
1617
|
+
}
|
|
1618
|
+
}, Sr = class extends F {
|
|
1619
|
+
static channelKeysWithAlpha = mr;
|
|
1620
|
+
get channels() {
|
|
1621
|
+
return or;
|
|
1622
|
+
}
|
|
1619
1623
|
constructor(e, t) {
|
|
1620
1624
|
super("kelvin", t), this.kelvin = e;
|
|
1621
1625
|
}
|
|
1622
|
-
},
|
|
1623
|
-
static channelKeysWithAlpha =
|
|
1626
|
+
}, Cr = class extends F {
|
|
1627
|
+
static channelKeysWithAlpha = sr;
|
|
1624
1628
|
get channels() {
|
|
1625
|
-
return
|
|
1629
|
+
return $n;
|
|
1626
1630
|
}
|
|
1627
1631
|
constructor(e, t, n, r) {
|
|
1628
1632
|
super("srgb-linear", r), this.r = e, this.g = t, this.b = n;
|
|
1629
1633
|
}
|
|
1630
|
-
},
|
|
1631
|
-
static channelKeysWithAlpha =
|
|
1634
|
+
}, wr = class extends F {
|
|
1635
|
+
static channelKeysWithAlpha = sr;
|
|
1632
1636
|
get channels() {
|
|
1633
|
-
return
|
|
1637
|
+
return $n;
|
|
1634
1638
|
}
|
|
1635
1639
|
constructor(e, t, n, r) {
|
|
1636
1640
|
super("display-p3", r), this.r = e, this.g = t, this.b = n;
|
|
1637
1641
|
}
|
|
1638
|
-
},
|
|
1639
|
-
static channelKeysWithAlpha =
|
|
1642
|
+
}, Tr = class extends F {
|
|
1643
|
+
static channelKeysWithAlpha = sr;
|
|
1640
1644
|
get channels() {
|
|
1641
|
-
return
|
|
1645
|
+
return $n;
|
|
1642
1646
|
}
|
|
1643
1647
|
constructor(e, t, n, r) {
|
|
1644
1648
|
super("a98-rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1645
1649
|
}
|
|
1646
|
-
},
|
|
1647
|
-
static channelKeysWithAlpha =
|
|
1650
|
+
}, Er = class extends F {
|
|
1651
|
+
static channelKeysWithAlpha = sr;
|
|
1648
1652
|
get channels() {
|
|
1649
|
-
return
|
|
1653
|
+
return $n;
|
|
1650
1654
|
}
|
|
1651
1655
|
constructor(e, t, n, r) {
|
|
1652
1656
|
super("prophoto-rgb", r), this.r = e, this.g = t, this.b = n;
|
|
1653
1657
|
}
|
|
1654
|
-
},
|
|
1655
|
-
static channelKeysWithAlpha =
|
|
1658
|
+
}, Dr = class extends F {
|
|
1659
|
+
static channelKeysWithAlpha = sr;
|
|
1656
1660
|
get channels() {
|
|
1657
|
-
return
|
|
1661
|
+
return $n;
|
|
1658
1662
|
}
|
|
1659
1663
|
constructor(e, t, n, r) {
|
|
1660
1664
|
super("rec2020", r), this.r = e, this.g = t, this.b = n;
|
|
1661
1665
|
}
|
|
1662
|
-
},
|
|
1663
|
-
t = i ?
|
|
1664
|
-
let { min: a, max: o } =
|
|
1666
|
+
}, Or = (e, t, n, r, i = !1) => {
|
|
1667
|
+
t = i ? ve(n, r) : t;
|
|
1668
|
+
let { min: a, max: o } = _e(n, r, t ?? ""), [s, c, l, u] = i ? [
|
|
1665
1669
|
a,
|
|
1666
1670
|
o,
|
|
1667
1671
|
0,
|
|
@@ -1673,26 +1677,26 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1673
1677
|
o
|
|
1674
1678
|
];
|
|
1675
1679
|
return new J(y(e, l, u, s, c), i ? t : "");
|
|
1676
|
-
},
|
|
1680
|
+
}, kr = (e, t = !1) => {
|
|
1677
1681
|
let n = e.colorSpace;
|
|
1678
1682
|
return e.keys().forEach((r) => {
|
|
1679
1683
|
let i = e[r];
|
|
1680
|
-
e[r] =
|
|
1684
|
+
e[r] = Or(J.unwrapDeep(i), i instanceof J ? i.unit : void 0, n, r, t);
|
|
1681
1685
|
}), e;
|
|
1682
|
-
},
|
|
1686
|
+
}, Ar = (e, t = !1, n = !1) => {
|
|
1683
1687
|
e = n ? e : e.clone();
|
|
1684
|
-
let r =
|
|
1688
|
+
let r = kr(e.value, t);
|
|
1685
1689
|
return n ? e : new J(r).coalesce(e, !0);
|
|
1686
|
-
},
|
|
1687
|
-
let a = n ? i ? e : e.clone() :
|
|
1690
|
+
}, jr = (e, t = "oklab", n = !1, r = !1, i = !1) => {
|
|
1691
|
+
let a = n ? i ? e : e.clone() : Ar(e, !1, i), o = M(a.toJSON(), t);
|
|
1688
1692
|
return o.entries().forEach(([e, t]) => {
|
|
1689
1693
|
o[e] = new J(J.unwrapDeep(t));
|
|
1690
|
-
}), a.value = o, a.superType[1] = t, r ?
|
|
1691
|
-
},
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
+
}), a.value = o, a.superType[1] = t, r ? Ar(a, !0, !0) : a;
|
|
1695
|
+
}, Mr = (e, t, n = "oklab", r = !1, i = !1, a = !1, o) => [
|
|
1696
|
+
jr(e, n, r, i, a),
|
|
1697
|
+
jr(t, n, r, i, a),
|
|
1694
1698
|
o
|
|
1695
|
-
],
|
|
1699
|
+
], Nr = [
|
|
1696
1700
|
"px",
|
|
1697
1701
|
"cm",
|
|
1698
1702
|
"mm",
|
|
@@ -1700,17 +1704,16 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1700
1704
|
"in",
|
|
1701
1705
|
"pc",
|
|
1702
1706
|
"pt"
|
|
1703
|
-
],
|
|
1707
|
+
], Pr = /* @__PURE__ */ "em.ex.ch.cap.ic.rem.lh.rlh.vw.vh.vmin.vmax.vb.vi.svw.svh.svi.svb.svmin.svmax.lvw.lvh.lvi.lvb.lvmin.lvmax.dvw.dvh.dvi.dvb.dvmin.dvmax.cqw.cqh.cqi.cqb.cqmin.cqmax".split("."), Fr = [...Nr, ...Pr], Ir = ["s", "ms"], Lr = [
|
|
1704
1708
|
"deg",
|
|
1705
1709
|
"rad",
|
|
1706
1710
|
"grad",
|
|
1707
1711
|
"turn"
|
|
1708
|
-
],
|
|
1712
|
+
], Rr = ["%"], zr = ["Hz", "kHz"], Br = [
|
|
1709
1713
|
"dpi",
|
|
1710
1714
|
"dpcm",
|
|
1711
1715
|
"dppx"
|
|
1712
|
-
],
|
|
1713
|
-
...Pr,
|
|
1716
|
+
], Vr = ["fr"], Hr = ["var", "calc"], Ur = ["string"], Wr = ["color"], Gr = [
|
|
1714
1717
|
...Fr,
|
|
1715
1718
|
...Ir,
|
|
1716
1719
|
...Lr,
|
|
@@ -1720,17 +1723,18 @@ var qn = (e) => e != null && typeof e.toFixed == "function", Jn = (e, t = 2) =>
|
|
|
1720
1723
|
...Vr,
|
|
1721
1724
|
...Hr,
|
|
1722
1725
|
...Ur,
|
|
1726
|
+
...Wr,
|
|
1723
1727
|
"",
|
|
1724
1728
|
void 0
|
|
1725
|
-
],
|
|
1729
|
+
], Kr = [
|
|
1726
1730
|
"string",
|
|
1727
1731
|
"var",
|
|
1728
1732
|
"calc"
|
|
1729
|
-
],
|
|
1730
|
-
function
|
|
1733
|
+
], qr = /* @__PURE__ */ "accentColor.additiveSymbols.alignContent.alignItems.alignSelf.alignmentBaseline.all.anchorName.animation.animationComposition.animationDelay.animationDirection.animationDuration.animationFillMode.animationIterationCount.animationName.animationPlayState.animationRange.animationRangeEnd.animationRangeStart.animationTimeline.animationTimingFunction.appRegion.appearance.ascentOverride.aspectRatio.backdropFilter.backfaceVisibility.background.backgroundAttachment.backgroundBlendMode.backgroundClip.backgroundColor.backgroundImage.backgroundOrigin.backgroundPosition.backgroundPositionX.backgroundPositionY.backgroundRepeat.backgroundSize.basePalette.baselineShift.baselineSource.blockSize.border.borderBlock.borderBlockColor.borderBlockEnd.borderBlockEndColor.borderBlockEndStyle.borderBlockEndWidth.borderBlockStart.borderBlockStartColor.borderBlockStartStyle.borderBlockStartWidth.borderBlockStyle.borderBlockWidth.borderBottom.borderBottomColor.borderBottomLeftRadius.borderBottomRightRadius.borderBottomStyle.borderBottomWidth.borderCollapse.borderColor.borderEndEndRadius.borderEndStartRadius.borderImage.borderImageOutset.borderImageRepeat.borderImageSlice.borderImageSource.borderImageWidth.borderInline.borderInlineColor.borderInlineEnd.borderInlineEndColor.borderInlineEndStyle.borderInlineEndWidth.borderInlineStart.borderInlineStartColor.borderInlineStartStyle.borderInlineStartWidth.borderInlineStyle.borderInlineWidth.borderLeft.borderLeftColor.borderLeftStyle.borderLeftWidth.borderRadius.borderRight.borderRightColor.borderRightStyle.borderRightWidth.borderSpacing.borderStartEndRadius.borderStartStartRadius.borderStyle.borderTop.borderTopColor.borderTopLeftRadius.borderTopRightRadius.borderTopStyle.borderTopWidth.borderWidth.bottom.boxShadow.boxSizing.breakAfter.breakBefore.breakInside.bufferedRendering.captionSide.caretColor.clear.clip.clipPath.clipRule.color.colorInterpolation.colorInterpolationFilters.colorRendering.colorScheme.columnCount.columnFill.columnGap.columnRule.columnRuleColor.columnRuleStyle.columnRuleWidth.columnSpan.columnWidth.columns.contain.containIntrinsicBlockSize.containIntrinsicHeight.containIntrinsicInlineSize.containIntrinsicSize.containIntrinsicWidth.container.containerName.containerType.content.contentVisibility.counterIncrement.counterReset.counterSet.cursor.cx.cy.d.descentOverride.direction.display.dominantBaseline.emptyCells.fallback.fieldSizing.fill.fillOpacity.fillRule.filter.flex.flexBasis.flexDirection.flexFlow.flexGrow.flexShrink.flexWrap.float.floodColor.floodOpacity.font.fontDisplay.fontFamily.fontFeatureSettings.fontKerning.fontOpticalSizing.fontPalette.fontSize.fontStretch.fontStyle.fontSynthesis.fontSynthesisSmallCaps.fontSynthesisStyle.fontSynthesisWeight.fontVariant.fontVariantAlternates.fontVariantCaps.fontVariantEastAsian.fontVariantLigatures.fontVariantNumeric.fontVariantPosition.fontVariationSettings.fontWeight.forcedColorAdjust.gap.grid.gridArea.gridAutoColumns.gridAutoFlow.gridAutoRows.gridColumn.gridColumnEnd.gridColumnGap.gridColumnStart.gridGap.gridRow.gridRowEnd.gridRowGap.gridRowStart.gridTemplate.gridTemplateAreas.gridTemplateColumns.gridTemplateRows.height.hyphenateCharacter.hyphenateLimitChars.hyphens.imageOrientation.imageRendering.inherits.initialLetter.initialValue.inlineSize.inset.insetArea.insetBlock.insetBlockEnd.insetBlockStart.insetInline.insetInlineEnd.insetInlineStart.isolation.justifyContent.justifyItems.justifySelf.left.letterSpacing.lightingColor.lineBreak.lineGapOverride.lineHeight.listStyle.listStyleImage.listStylePosition.listStyleType.margin.marginBlock.marginBlockEnd.marginBlockStart.marginBottom.marginInline.marginInlineEnd.marginInlineStart.marginLeft.marginRight.marginTop.marker.markerEnd.markerMid.markerStart.mask.maskClip.maskComposite.maskImage.maskMode.maskOrigin.maskPosition.maskRepeat.maskSize.maskType.mathDepth.mathShift.mathStyle.maxBlockSize.maxHeight.maxInlineSize.maxWidth.minBlockSize.minHeight.minInlineSize.minWidth.mixBlendMode.navigation.negative.objectFit.objectPosition.objectViewBox.offset.offsetAnchor.offsetDistance.offsetPath.offsetPosition.offsetRotate.opacity.order.orphans.outline.outlineColor.outlineOffset.outlineStyle.outlineWidth.overflow.overflowAnchor.overflowClipMargin.overflowWrap.overflowX.overflowY.overlay.overrideColors.overscrollBehavior.overscrollBehaviorBlock.overscrollBehaviorInline.overscrollBehaviorX.overscrollBehaviorY.pad.padding.paddingBlock.paddingBlockEnd.paddingBlockStart.paddingBottom.paddingInline.paddingInlineEnd.paddingInlineStart.paddingLeft.paddingRight.paddingTop.page.pageBreakAfter.pageBreakBefore.pageBreakInside.pageOrientation.paintOrder.perspective.perspectiveOrigin.placeContent.placeItems.placeSelf.pointerEvents.position.positionAnchor.positionTry.positionTryOptions.positionTryOrder.positionVisibility.prefix.quotes.r.range.resize.right.rotate.rowGap.rubyPosition.rx.ry.scale.scrollBehavior.scrollMargin.scrollMarginBlock.scrollMarginBlockEnd.scrollMarginBlockStart.scrollMarginBottom.scrollMarginInline.scrollMarginInlineEnd.scrollMarginInlineStart.scrollMarginLeft.scrollMarginRight.scrollMarginTop.scrollPadding.scrollPaddingBlock.scrollPaddingBlockEnd.scrollPaddingBlockStart.scrollPaddingBottom.scrollPaddingInline.scrollPaddingInlineEnd.scrollPaddingInlineStart.scrollPaddingLeft.scrollPaddingRight.scrollPaddingTop.scrollSnapAlign.scrollSnapStop.scrollSnapType.scrollTimeline.scrollTimelineAxis.scrollTimelineName.scrollbarColor.scrollbarGutter.scrollbarWidth.shapeImageThreshold.shapeMargin.shapeOutside.shapeRendering.size.sizeAdjust.speak.speakAs.src.stopColor.stopOpacity.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.suffix.symbols.syntax.system.tabSize.tableLayout.textAlign.textAlignLast.textAnchor.textCombineUpright.textDecoration.textDecorationColor.textDecorationLine.textDecorationSkipInk.textDecorationStyle.textDecorationThickness.textEmphasis.textEmphasisColor.textEmphasisPosition.textEmphasisStyle.textIndent.textOrientation.textOverflow.textRendering.textShadow.textSizeAdjust.textSpacingTrim.textTransform.textUnderlineOffset.textUnderlinePosition.textWrap.timelineScope.top.touchAction.transform.transformBox.transformOrigin.transformStyle.transition.transitionBehavior.transitionDelay.transitionDuration.transitionProperty.transitionTimingFunction.translate.types.unicodeBidi.unicodeRange.userSelect.vectorEffect.verticalAlign.viewTimeline.viewTimelineAxis.viewTimelineInset.viewTimelineName.viewTransitionClass.viewTransitionName.visibility.webkitAlignContent.webkitAlignItems.webkitAlignSelf.webkitAnimation.webkitAnimationDelay.webkitAnimationDirection.webkitAnimationDuration.webkitAnimationFillMode.webkitAnimationIterationCount.webkitAnimationName.webkitAnimationPlayState.webkitAnimationTimingFunction.webkitAppRegion.webkitAppearance.webkitBackfaceVisibility.webkitBackgroundClip.webkitBackgroundOrigin.webkitBackgroundSize.webkitBorderAfter.webkitBorderAfterColor.webkitBorderAfterStyle.webkitBorderAfterWidth.webkitBorderBefore.webkitBorderBeforeColor.webkitBorderBeforeStyle.webkitBorderBeforeWidth.webkitBorderBottomLeftRadius.webkitBorderBottomRightRadius.webkitBorderEnd.webkitBorderEndColor.webkitBorderEndStyle.webkitBorderEndWidth.webkitBorderHorizontalSpacing.webkitBorderImage.webkitBorderRadius.webkitBorderStart.webkitBorderStartColor.webkitBorderStartStyle.webkitBorderStartWidth.webkitBorderTopLeftRadius.webkitBorderTopRightRadius.webkitBorderVerticalSpacing.webkitBoxAlign.webkitBoxDecorationBreak.webkitBoxDirection.webkitBoxFlex.webkitBoxOrdinalGroup.webkitBoxOrient.webkitBoxPack.webkitBoxReflect.webkitBoxShadow.webkitBoxSizing.webkitClipPath.webkitColumnBreakAfter.webkitColumnBreakBefore.webkitColumnBreakInside.webkitColumnCount.webkitColumnGap.webkitColumnRule.webkitColumnRuleColor.webkitColumnRuleStyle.webkitColumnRuleWidth.webkitColumnSpan.webkitColumnWidth.webkitColumns.webkitFilter.webkitFlex.webkitFlexBasis.webkitFlexDirection.webkitFlexFlow.webkitFlexGrow.webkitFlexShrink.webkitFlexWrap.webkitFontFeatureSettings.webkitFontSmoothing.webkitHyphenateCharacter.webkitJustifyContent.webkitLineBreak.webkitLineClamp.webkitLocale.webkitLogicalHeight.webkitLogicalWidth.webkitMarginAfter.webkitMarginBefore.webkitMarginEnd.webkitMarginStart.webkitMask.webkitMaskBoxImage.webkitMaskBoxImageOutset.webkitMaskBoxImageRepeat.webkitMaskBoxImageSlice.webkitMaskBoxImageSource.webkitMaskBoxImageWidth.webkitMaskClip.webkitMaskComposite.webkitMaskImage.webkitMaskOrigin.webkitMaskPosition.webkitMaskPositionX.webkitMaskPositionY.webkitMaskRepeat.webkitMaskSize.webkitMaxLogicalHeight.webkitMaxLogicalWidth.webkitMinLogicalHeight.webkitMinLogicalWidth.webkitOpacity.webkitOrder.webkitPaddingAfter.webkitPaddingBefore.webkitPaddingEnd.webkitPaddingStart.webkitPerspective.webkitPerspectiveOrigin.webkitPerspectiveOriginX.webkitPerspectiveOriginY.webkitPrintColorAdjust.webkitRtlOrdering.webkitRubyPosition.webkitShapeImageThreshold.webkitShapeMargin.webkitShapeOutside.webkitTapHighlightColor.webkitTextCombine.webkitTextDecorationsInEffect.webkitTextEmphasis.webkitTextEmphasisColor.webkitTextEmphasisPosition.webkitTextEmphasisStyle.webkitTextFillColor.webkitTextOrientation.webkitTextSecurity.webkitTextSizeAdjust.webkitTextStroke.webkitTextStrokeColor.webkitTextStrokeWidth.webkitTransform.webkitTransformOrigin.webkitTransformOriginX.webkitTransformOriginY.webkitTransformOriginZ.webkitTransformStyle.webkitTransition.webkitTransitionDelay.webkitTransitionDuration.webkitTransitionProperty.webkitTransitionTimingFunction.webkitUserDrag.webkitUserModify.webkitUserSelect.webkitWritingMode.whiteSpace.whiteSpaceCollapse.widows.width.willChange.wordBreak.wordSpacing.wordWrap.writingMode.x.y.zIndex.zoom".split(".");
|
|
1734
|
+
function Jr(e) {
|
|
1731
1735
|
return e.unit === "color";
|
|
1732
1736
|
}
|
|
1733
|
-
var
|
|
1737
|
+
var Yr = (e) => {
|
|
1734
1738
|
let t = {}, n = (e, r = void 0) => {
|
|
1735
1739
|
if (Array.isArray(e)) {
|
|
1736
1740
|
e.forEach((e, t) => n(e, r));
|
|
@@ -1738,21 +1742,21 @@ var Jr = (e) => {
|
|
|
1738
1742
|
} else if (e instanceof Y) {
|
|
1739
1743
|
if (e.name === "calc") {
|
|
1740
1744
|
let n = new J(e.values.map((e) => e.toString()).join(", "), "calc"), i = r ?? "calc";
|
|
1741
|
-
t[i] ?? (t[i] = new
|
|
1745
|
+
t[i] ?? (t[i] = new Wa()), t[i].push(n), t[i] = t[i].flat();
|
|
1742
1746
|
return;
|
|
1743
1747
|
}
|
|
1744
1748
|
let i = e.name;
|
|
1745
1749
|
r && (i = r.endsWith(e.name) ? r : `${r}.${e.name}`), e.values.forEach((e, t) => n(e, i));
|
|
1746
1750
|
return;
|
|
1747
|
-
} else if (
|
|
1751
|
+
} else if (c(e)) {
|
|
1748
1752
|
for (let [t, i] of Object.entries(e)) n(i, r ? `${r}.${t}` : t);
|
|
1749
1753
|
return;
|
|
1750
1754
|
}
|
|
1751
1755
|
let i = r;
|
|
1752
|
-
t[i] ?? (t[i] = new
|
|
1756
|
+
t[i] ?? (t[i] = new Wa()), t[i].push(e), t[i] = t[i].flat();
|
|
1753
1757
|
};
|
|
1754
1758
|
return n(e), t;
|
|
1755
|
-
},
|
|
1759
|
+
}, Xr = (e) => {
|
|
1756
1760
|
let t = {};
|
|
1757
1761
|
for (let [n, r] of Object.entries(e)) {
|
|
1758
1762
|
let e = n.split("."), i = t;
|
|
@@ -1762,7 +1766,7 @@ var Jr = (e) => {
|
|
|
1762
1766
|
}
|
|
1763
1767
|
}
|
|
1764
1768
|
return t;
|
|
1765
|
-
},
|
|
1769
|
+
}, Zr = (e) => {
|
|
1766
1770
|
let t = {};
|
|
1767
1771
|
for (let [n, r] of Object.entries(e)) {
|
|
1768
1772
|
let e = n.split("."), i = e[0], a = t[i] ?? "", o = "", s = "";
|
|
@@ -1771,11 +1775,11 @@ var Jr = (e) => {
|
|
|
1771
1775
|
c = e.length > 1 && Array.isArray(r) ? r.join(", ") : r.toString(), a += ` ${o}${c}${s}`, t[i] = a.trim();
|
|
1772
1776
|
}
|
|
1773
1777
|
return t;
|
|
1774
|
-
},
|
|
1775
|
-
function
|
|
1776
|
-
return
|
|
1778
|
+
}, Qr = new Set(qr);
|
|
1779
|
+
function $r(e) {
|
|
1780
|
+
return Qr.has(e);
|
|
1777
1781
|
}
|
|
1778
|
-
var
|
|
1782
|
+
var ei = (e) => {
|
|
1779
1783
|
let t = e.name, n = e.valueOf();
|
|
1780
1784
|
if (!e.name.startsWith("matrix")) throw Error("Input must be a matrix or matrix3d value");
|
|
1781
1785
|
let r = {
|
|
@@ -1837,7 +1841,7 @@ var $r = (e) => {
|
|
|
1837
1841
|
}
|
|
1838
1842
|
throw Error("Unsupported matrix type or invalid number of values");
|
|
1839
1843
|
};
|
|
1840
|
-
function
|
|
1844
|
+
function ti(e) {
|
|
1841
1845
|
let t = e.parentElement;
|
|
1842
1846
|
for (; t;) {
|
|
1843
1847
|
let e = getComputedStyle(t).containerType;
|
|
@@ -1846,15 +1850,62 @@ function ei(e) {
|
|
|
1846
1850
|
}
|
|
1847
1851
|
return null;
|
|
1848
1852
|
}
|
|
1849
|
-
function
|
|
1853
|
+
function ni(e) {
|
|
1850
1854
|
let t = getComputedStyle(e).writingMode;
|
|
1851
1855
|
return t?.startsWith("vertical") || t?.startsWith("sideways") || !1;
|
|
1852
1856
|
}
|
|
1853
|
-
|
|
1857
|
+
var ri = new Set(/* @__PURE__ */ "em.rem.ch.ex.cap.ic.lh.rlh.vw.vh.vmin.vmax.vi.vb.svw.svh.svi.svb.svmin.svmax.lvw.lvh.lvi.lvb.lvmin.lvmax.dvw.dvh.dvi.dvb.dvmin.dvmax.cqw.cqh.cqi.cqb.cqmin.cqmax".split("."));
|
|
1858
|
+
function ii(e, t, n) {
|
|
1859
|
+
let r = /^(sv|lv|dv|v)(w|h|i|b|min|max)$/.exec(t);
|
|
1860
|
+
if (!r) return null;
|
|
1861
|
+
let i = r[1], a = r[2], o, s;
|
|
1862
|
+
if (i === "sv") {
|
|
1863
|
+
let e = typeof window < "u" ? window.visualViewport : void 0;
|
|
1864
|
+
o = e?.width ?? window.innerWidth, s = e?.height ?? window.innerHeight;
|
|
1865
|
+
} else o = window.innerWidth, s = window.innerHeight;
|
|
1866
|
+
let c = n ? ni(n) : !1, l;
|
|
1867
|
+
switch (a) {
|
|
1868
|
+
case "w":
|
|
1869
|
+
l = o;
|
|
1870
|
+
break;
|
|
1871
|
+
case "h":
|
|
1872
|
+
l = s;
|
|
1873
|
+
break;
|
|
1874
|
+
case "i":
|
|
1875
|
+
l = c ? s : o;
|
|
1876
|
+
break;
|
|
1877
|
+
case "b":
|
|
1878
|
+
l = c ? o : s;
|
|
1879
|
+
break;
|
|
1880
|
+
case "min":
|
|
1881
|
+
l = Math.min(o, s);
|
|
1882
|
+
break;
|
|
1883
|
+
default:
|
|
1884
|
+
l = Math.max(o, s);
|
|
1885
|
+
break;
|
|
1886
|
+
}
|
|
1887
|
+
return l / 100 * e;
|
|
1888
|
+
}
|
|
1889
|
+
function ai(e, t, n) {
|
|
1890
|
+
let r = t === "rlh" ? typeof document < "u" ? document.documentElement : void 0 : n;
|
|
1891
|
+
if (!r) return null;
|
|
1892
|
+
let i = getComputedStyle(r), a = parseFloat(i.fontSize) || 16;
|
|
1893
|
+
switch (t) {
|
|
1894
|
+
case "lh":
|
|
1895
|
+
case "rlh": {
|
|
1896
|
+
let t = parseFloat(i.lineHeight);
|
|
1897
|
+
return e * (Number.isFinite(t) ? t : a * 1.2);
|
|
1898
|
+
}
|
|
1899
|
+
case "cap": return e * a * .7;
|
|
1900
|
+
case "ic": return e * a;
|
|
1901
|
+
default: return null;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
function oi(e, t) {
|
|
1854
1905
|
let n = e;
|
|
1855
1906
|
return t === "cm" ? n *= 96 / 2.54 : t === "mm" ? n *= 96 / 25.4 : t === "Q" ? n *= 96 / (25.4 * 4) : t === "in" ? n *= 96 : t === "pt" ? n *= 4 / 3 : t === "pc" && (n *= 16), n;
|
|
1856
1907
|
}
|
|
1857
|
-
function
|
|
1908
|
+
function si(e, t, n, r) {
|
|
1858
1909
|
if (t === "em" && n) e *= parseFloat(getComputedStyle(n).fontSize);
|
|
1859
1910
|
else if (t === "rem") e *= parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
1860
1911
|
else if (t === "vh") e *= window.innerHeight / 100;
|
|
@@ -1879,55 +1930,68 @@ function ri(e, t, n, r) {
|
|
|
1879
1930
|
let t = parseFloat(getComputedStyle(n).fontSize) || 16;
|
|
1880
1931
|
e *= t * .5;
|
|
1881
1932
|
} else if ((t === "cqw" || t === "cqh" || t === "cqi" || t === "cqb" || t === "cqmin" || t === "cqmax") && n) {
|
|
1882
|
-
let r =
|
|
1933
|
+
let r = ti(n);
|
|
1883
1934
|
if (r) {
|
|
1884
|
-
let n = r.clientWidth, i = r.clientHeight, a =
|
|
1935
|
+
let n = r.clientWidth, i = r.clientHeight, a = ni(r);
|
|
1885
1936
|
t === "cqw" ? e *= n / 100 : t === "cqh" ? e *= i / 100 : t === "cqi" ? e *= (a ? i : n) / 100 : t === "cqb" ? e *= (a ? n : i) / 100 : t === "cqmin" ? e *= Math.min(n, i) / 100 : e *= Math.max(n, i) / 100;
|
|
1886
1937
|
}
|
|
1887
|
-
} else
|
|
1938
|
+
} else {
|
|
1939
|
+
let r = typeof window < "u" ? ii(e, t, n) : null, i = r === null ? ai(e, t, n) : null;
|
|
1940
|
+
if (r !== null) e = r;
|
|
1941
|
+
else if (i !== null) e = i;
|
|
1942
|
+
else if (Pr.includes(t) && !ri.has(t)) throw Error(`convertToPixels: relative length unit "${t}" has no resolution branch. Add one in src/units/utils.ts (C5 fail-loud guard).`);
|
|
1943
|
+
else e = oi(e, t);
|
|
1944
|
+
}
|
|
1888
1945
|
return e;
|
|
1889
1946
|
}
|
|
1890
|
-
function
|
|
1947
|
+
function ci(e, t) {
|
|
1891
1948
|
return t === "s" && (e *= 1e3), e;
|
|
1892
1949
|
}
|
|
1893
|
-
function
|
|
1950
|
+
function li(e, t) {
|
|
1894
1951
|
return t === "grad" ? e *= .9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
|
|
1895
1952
|
}
|
|
1896
|
-
function
|
|
1953
|
+
function ui(e, t) {
|
|
1897
1954
|
return t === "kHz" && (e *= 1e3), e;
|
|
1898
1955
|
}
|
|
1899
|
-
function
|
|
1956
|
+
function di(e, t) {
|
|
1900
1957
|
return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
|
|
1901
1958
|
}
|
|
1902
|
-
var
|
|
1903
|
-
length:
|
|
1904
|
-
time:
|
|
1905
|
-
angle:
|
|
1906
|
-
frequency:
|
|
1907
|
-
resolution:
|
|
1908
|
-
},
|
|
1909
|
-
[
|
|
1910
|
-
[
|
|
1911
|
-
[
|
|
1912
|
-
[
|
|
1913
|
-
[
|
|
1959
|
+
var fi = {
|
|
1960
|
+
length: si,
|
|
1961
|
+
time: ci,
|
|
1962
|
+
angle: li,
|
|
1963
|
+
frequency: ui,
|
|
1964
|
+
resolution: di
|
|
1965
|
+
}, pi = [
|
|
1966
|
+
[Fr, "length"],
|
|
1967
|
+
[Ir, "time"],
|
|
1968
|
+
[Lr, "angle"],
|
|
1969
|
+
[zr, "frequency"],
|
|
1970
|
+
[Br, "resolution"]
|
|
1914
1971
|
];
|
|
1915
|
-
function
|
|
1972
|
+
function mi(e) {
|
|
1916
1973
|
if (typeof e != "string" || e === "") return null;
|
|
1917
|
-
for (let t of
|
|
1974
|
+
for (let t of pi) if (t[0].includes(e)) return t;
|
|
1918
1975
|
return null;
|
|
1919
1976
|
}
|
|
1920
|
-
function
|
|
1921
|
-
let i =
|
|
1977
|
+
function hi(e, t, n, r) {
|
|
1978
|
+
let i = mi(t), a = mi(n);
|
|
1922
1979
|
if (!i || !a || i[1] !== a[1]) throw Error(`Incompatible units: ${t} and ${n}`);
|
|
1923
|
-
let [, o] = i, s =
|
|
1980
|
+
let [, o] = i, s = fi[o];
|
|
1924
1981
|
return s(e, t, r) / s(1, n, r);
|
|
1925
1982
|
}
|
|
1926
|
-
var R = (e) =>
|
|
1927
|
-
|
|
1983
|
+
var R = (e) => i(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i")), gi = i(/[a-zA-Z]+/), _i = (e) => {
|
|
1984
|
+
let t = /* @__PURE__ */ new Map();
|
|
1985
|
+
for (let n of e) t.set(n.toLowerCase(), n);
|
|
1986
|
+
return gi.chain((e) => {
|
|
1987
|
+
let n = t.get(e.toLowerCase());
|
|
1988
|
+
return n == null ? Si(`unit:${e}`) : xi(n);
|
|
1989
|
+
});
|
|
1990
|
+
}, vi = i(/-?[a-zA-Z][a-zA-Z0-9-]*/), yi = R("none"), bi = i(/-?\d+/).map(Number), z = i(/-?(?:(0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?/).map(Number);
|
|
1991
|
+
function xi(t) {
|
|
1928
1992
|
return new e((e) => e.ok(t, 0));
|
|
1929
1993
|
}
|
|
1930
|
-
function
|
|
1994
|
+
function Si(t) {
|
|
1931
1995
|
return new e((e) => e.err(void 0, 0));
|
|
1932
1996
|
}
|
|
1933
1997
|
function B(e, t) {
|
|
@@ -1938,39 +2002,39 @@ function B(e, t) {
|
|
|
1938
2002
|
}
|
|
1939
2003
|
return n.value;
|
|
1940
2004
|
}
|
|
1941
|
-
function
|
|
2005
|
+
function Ci(e, t) {
|
|
1942
2006
|
let n = e.parseState(t);
|
|
1943
2007
|
return {
|
|
1944
2008
|
status: !n.isError,
|
|
1945
2009
|
value: n.value
|
|
1946
2010
|
};
|
|
1947
2011
|
}
|
|
1948
|
-
var
|
|
2012
|
+
var wi = _i(Fr), Ti = _i(Lr), Ei = _i(Ir), Di = _i(zr), Oi = _i(Br), ki = _i(Vr), Ai = n(...Rr.map(R)), ji = n(a(","), a(" ")).trim(o), Mi = t(z, wi).map(([e, t]) => {
|
|
1949
2013
|
let n = ["length"];
|
|
1950
|
-
return
|
|
1951
|
-
}),
|
|
1952
|
-
Length:
|
|
1953
|
-
Angle:
|
|
1954
|
-
Time:
|
|
1955
|
-
TimePercentage:
|
|
1956
|
-
Frequency:
|
|
1957
|
-
Resolution:
|
|
1958
|
-
Flex:
|
|
1959
|
-
Percentage:
|
|
1960
|
-
Color:
|
|
1961
|
-
Slash:
|
|
1962
|
-
Value:
|
|
1963
|
-
sep:
|
|
1964
|
-
},
|
|
1965
|
-
function
|
|
2014
|
+
return Pr.includes(t) ? n.push("relative") : Nr.includes(t) && n.push("absolute"), new J(e, t, n);
|
|
2015
|
+
}), Ni = t(z, Ti).map(([e, t]) => new J(e, t, ["angle"])), Pi = t(z, Ei).map(([e, t]) => new J(e, t, ["time"])), Fi = e.lazy(() => n(zi, Pi)), Ii = t(z, Di).map(([e, t]) => new J(e, t, ["frequency"])), Li = t(z, Oi).map(([e, t]) => new J(e, t, ["resolution"])), Ri = t(z, ki).map(([e, t]) => new J(e, t, ["flex"])), zi = n(t(z, Ai), R("from").map(() => [0, "%"]), R("to").map(() => [100, "%"])).map(([e, t]) => new J(e, t, ["percentage"])), Bi = e.lazy(() => Ra.Value), Vi = a("/").trim(o).map(() => new J("/", "string")), Hi = n(Mi, Ni, Pi, Ii, Li, Ri, zi, Bi, Vi, z.map((e) => new J(e)), yi.map(() => new J(NaN))).trim(o), V = {
|
|
2016
|
+
Length: Mi,
|
|
2017
|
+
Angle: Ni,
|
|
2018
|
+
Time: Pi,
|
|
2019
|
+
TimePercentage: Fi,
|
|
2020
|
+
Frequency: Ii,
|
|
2021
|
+
Resolution: Li,
|
|
2022
|
+
Flex: Ri,
|
|
2023
|
+
Percentage: zi,
|
|
2024
|
+
Color: Bi,
|
|
2025
|
+
Slash: Vi,
|
|
2026
|
+
Value: Hi,
|
|
2027
|
+
sep: ji
|
|
2028
|
+
}, Ui = h((e) => B(Hi, e), { keyFn: (e) => e });
|
|
2029
|
+
function Wi(e) {
|
|
1966
2030
|
return e >= 5e3 ? `${e / 1e3}s` : `${e}ms`;
|
|
1967
2031
|
}
|
|
1968
|
-
function
|
|
2032
|
+
function Gi(e) {
|
|
1969
2033
|
return e === Infinity ? "infinite" : String(e);
|
|
1970
2034
|
}
|
|
1971
|
-
var H =
|
|
1972
|
-
function
|
|
1973
|
-
let s = e.lazy(() => n(f.trim(
|
|
2035
|
+
var H = a("("), U = a(")"), Ki = a(",");
|
|
2036
|
+
function qi(r, i) {
|
|
2037
|
+
let s = e.lazy(() => n(f.trim(o).wrap(H, U), i, r).trim(o)), c = e.lazy(() => n(t(a("-").trim(o), s).map(([, e]) => new Y("*", [new J(-1), e])), t(a("+").trim(o), s).map(([, e]) => e), s)), l = n(a("*"), a("/")).trim(o), u = n(a("+"), a("-")).trim(o), d = t(c, t(l, c).many()).map(([e, t]) => {
|
|
1974
2038
|
let n = e;
|
|
1975
2039
|
for (let [e, r] of t) n = new Y(e, [n, r]);
|
|
1976
2040
|
return n;
|
|
@@ -1981,30 +2045,30 @@ function Vi(r, o) {
|
|
|
1981
2045
|
});
|
|
1982
2046
|
return f;
|
|
1983
2047
|
}
|
|
1984
|
-
function
|
|
1985
|
-
let
|
|
2048
|
+
function Ji(r) {
|
|
2049
|
+
let a = qi(r, e.lazy(() => b)), s = R("calc").next(a.trim(o).wrap(H, U)).map((e) => new Y("calc", [e])), c = a.trim(o), l = c.sepBy(Ki.trim(o)), u = R("min").next(l.wrap(H, U)).map((e) => new Y("min", e)), d = R("max").next(l.wrap(H, U)).map((e) => new Y("max", e)), f = R("clamp").next(l.wrap(H, U)).map((e) => {
|
|
1986
2050
|
if (e.length !== 3) throw Error("clamp() requires exactly 3 arguments");
|
|
1987
2051
|
return new Y("clamp", e);
|
|
1988
|
-
}), p = n(R("nearest"), R("up"), R("down"), R("to-zero")).trim(
|
|
2052
|
+
}), p = n(R("nearest"), R("up"), R("down"), R("to-zero")).trim(o), m = R("round").next(t(p.skip(Ki.trim(o)).opt(), l).wrap(H, U)).map(([e, t]) => new Y("round", [new J(e ?? "nearest", "string"), ...t])), h = (e) => R(e).next(l.wrap(H, U)).map((t) => {
|
|
1989
2053
|
if (t.length !== 2) throw Error(`${e}() requires exactly 2 arguments`);
|
|
1990
2054
|
return new Y(e, t);
|
|
1991
|
-
}), g = (e) => R(e).next(c.trim(
|
|
2055
|
+
}), g = (e) => R(e).next(c.trim(o).wrap(H, U)).map((t) => new Y(e, [t])), _ = h("pow"), ee = h("atan2"), te = R("hypot").next(l.wrap(H, U)).map((e) => new Y("hypot", e)), ne = R("log").next(l.wrap(H, U)).map((e) => {
|
|
1992
2056
|
if (e.length < 1 || e.length > 2) throw Error("log() requires 1 or 2 arguments");
|
|
1993
2057
|
return new Y("log", e);
|
|
1994
|
-
}),
|
|
2058
|
+
}), v = i(/[a-zA-Z0-9_-]/), y = n(R("infinity").not(v).map(() => new J(Infinity)), R("-infinity").not(v).map(() => new J(-Infinity)), R("NaN").not(v).map(() => new J(NaN)), R("pi").not(v).map(() => new J(Math.PI)), R("e").not(v).map(() => new J(Math.E))), b = n(s, u, d, f, m, h("mod"), h("rem"), g("abs"), g("sign"), g("sin"), g("cos"), g("tan"), g("asin"), g("acos"), g("atan"), ee, _, g("sqrt"), te, ne, g("exp"), y);
|
|
1995
2059
|
return {
|
|
1996
2060
|
calcFn: s,
|
|
1997
|
-
mathFunction:
|
|
1998
|
-
calcSum:
|
|
2061
|
+
mathFunction: b,
|
|
2062
|
+
calcSum: a
|
|
1999
2063
|
};
|
|
2000
2064
|
}
|
|
2001
2065
|
function W(e) {
|
|
2002
|
-
return e instanceof J ? e.unit === "var" || e.unit === "calc" ? null : typeof e.value == "number" ? e.value : null : e instanceof Y ?
|
|
2066
|
+
return e instanceof J ? e.unit === "var" || e.unit === "calc" ? null : typeof e.value == "number" ? e.value : null : e instanceof Y ? Xi(e) : typeof e == "number" ? e : null;
|
|
2003
2067
|
}
|
|
2004
|
-
function
|
|
2005
|
-
return e instanceof J ? typeof e.value == "number" ? e.unit && e.superType?.[0] === "angle" ?
|
|
2068
|
+
function Yi(e) {
|
|
2069
|
+
return e instanceof J ? typeof e.value == "number" ? e.unit && e.superType?.[0] === "angle" ? li(e.value, e.unit) * Math.PI / 180 : e.value : null : e instanceof Y ? Xi(e) : null;
|
|
2006
2070
|
}
|
|
2007
|
-
function
|
|
2071
|
+
function Xi(e) {
|
|
2008
2072
|
let t = e.name, n = e.values;
|
|
2009
2073
|
switch (t) {
|
|
2010
2074
|
case "+": {
|
|
@@ -2066,15 +2130,15 @@ function Wi(e) {
|
|
|
2066
2130
|
return e == null ? null : Math.sign(e);
|
|
2067
2131
|
}
|
|
2068
2132
|
case "sin": {
|
|
2069
|
-
let e =
|
|
2133
|
+
let e = Yi(n[0]);
|
|
2070
2134
|
return e == null ? null : Math.sin(e);
|
|
2071
2135
|
}
|
|
2072
2136
|
case "cos": {
|
|
2073
|
-
let e =
|
|
2137
|
+
let e = Yi(n[0]);
|
|
2074
2138
|
return e == null ? null : Math.cos(e);
|
|
2075
2139
|
}
|
|
2076
2140
|
case "tan": {
|
|
2077
|
-
let e =
|
|
2141
|
+
let e = Yi(n[0]);
|
|
2078
2142
|
return e == null ? null : Math.tan(e);
|
|
2079
2143
|
}
|
|
2080
2144
|
case "asin": {
|
|
@@ -2121,13 +2185,13 @@ function Wi(e) {
|
|
|
2121
2185
|
default: return null;
|
|
2122
2186
|
}
|
|
2123
2187
|
}
|
|
2124
|
-
function
|
|
2125
|
-
let t =
|
|
2188
|
+
function Zi(e) {
|
|
2189
|
+
let t = Xi(e);
|
|
2126
2190
|
if (t == null) return null;
|
|
2127
|
-
let n =
|
|
2191
|
+
let n = Qi(e);
|
|
2128
2192
|
return new J(t, n?.unit, n?.superType);
|
|
2129
2193
|
}
|
|
2130
|
-
function
|
|
2194
|
+
function Qi(e) {
|
|
2131
2195
|
if (e instanceof J) {
|
|
2132
2196
|
if (e.unit && e.unit !== "string" && typeof e.value == "number") {
|
|
2133
2197
|
let t = { unit: e.unit };
|
|
@@ -2146,34 +2210,34 @@ function Ki(e) {
|
|
|
2146
2210
|
superType: ["angle"]
|
|
2147
2211
|
};
|
|
2148
2212
|
for (let t of e.values) {
|
|
2149
|
-
let e =
|
|
2213
|
+
let e = Qi(t);
|
|
2150
2214
|
if (e) return e;
|
|
2151
2215
|
}
|
|
2152
2216
|
}
|
|
2153
2217
|
}
|
|
2154
2218
|
var G = (e) => new J(e, "color", ["color", e.colorSpace], void 0, "color");
|
|
2155
|
-
function
|
|
2156
|
-
let t =
|
|
2157
|
-
for (let e of t.keys())
|
|
2219
|
+
function $i(e) {
|
|
2220
|
+
let t = Ar(e).value, n = t.clone();
|
|
2221
|
+
for (let e of t.keys()) Qn(n, e, N(J.unwrapDeep(P(t, e))));
|
|
2158
2222
|
return n;
|
|
2159
2223
|
}
|
|
2160
|
-
var
|
|
2161
|
-
function
|
|
2162
|
-
if (
|
|
2163
|
-
let { mathFunction: e } =
|
|
2164
|
-
return
|
|
2224
|
+
var ea = null;
|
|
2225
|
+
function ta() {
|
|
2226
|
+
if (ea) return ea;
|
|
2227
|
+
let { mathFunction: e } = Ji(V.Value);
|
|
2228
|
+
return ea = qi(V.Value, e), ea;
|
|
2165
2229
|
}
|
|
2166
|
-
function
|
|
2167
|
-
let t = B(
|
|
2230
|
+
function na(e) {
|
|
2231
|
+
let t = B(ta(), e);
|
|
2168
2232
|
if (t instanceof J) return t.value;
|
|
2169
2233
|
if (t instanceof Y) {
|
|
2170
|
-
let n =
|
|
2234
|
+
let n = Zi(t);
|
|
2171
2235
|
if (n == null || typeof n.value != "number") throw Error(`Could not evaluate calc expression: ${e}`);
|
|
2172
2236
|
return n.value;
|
|
2173
2237
|
}
|
|
2174
2238
|
throw Error(`Could not evaluate calc expression: ${e}`);
|
|
2175
2239
|
}
|
|
2176
|
-
function
|
|
2240
|
+
function ra(e, t) {
|
|
2177
2241
|
switch (e.type) {
|
|
2178
2242
|
case "ref": return t[e.name] ?? 0;
|
|
2179
2243
|
case "literal": return e.value;
|
|
@@ -2181,31 +2245,31 @@ function Zi(e, t) {
|
|
|
2181
2245
|
case "calc": {
|
|
2182
2246
|
let n = e.expr, r = Object.keys(t).sort((e, t) => t.length - e.length);
|
|
2183
2247
|
for (let e of r) n = n.replace(RegExp(`\\b${e}\\b`, "g"), String(t[e]));
|
|
2184
|
-
return
|
|
2248
|
+
return na(n);
|
|
2185
2249
|
}
|
|
2186
2250
|
}
|
|
2187
2251
|
}
|
|
2188
|
-
function
|
|
2189
|
-
let i =
|
|
2252
|
+
function ia(e, t, n, r) {
|
|
2253
|
+
let i = M($i(e), t), a = {};
|
|
2190
2254
|
for (let [e, t] of i.entries()) a[e] = t;
|
|
2191
|
-
let o = n.map((e) =>
|
|
2255
|
+
let o = n.map((e) => ra(e, a)), s = r ? ra(r, a) : a.alpha ?? 1;
|
|
2192
2256
|
return G(new ({
|
|
2193
2257
|
rgb: I,
|
|
2194
|
-
hsl:
|
|
2195
|
-
hwb:
|
|
2196
|
-
lab:
|
|
2197
|
-
lch:
|
|
2198
|
-
oklab:
|
|
2199
|
-
oklch:
|
|
2258
|
+
hsl: hr,
|
|
2259
|
+
hwb: _r,
|
|
2260
|
+
lab: vr,
|
|
2261
|
+
lch: yr,
|
|
2262
|
+
oklab: br,
|
|
2263
|
+
oklch: xr,
|
|
2200
2264
|
xyz: L,
|
|
2201
|
-
"srgb-linear":
|
|
2202
|
-
"display-p3":
|
|
2203
|
-
"a98-rgb":
|
|
2204
|
-
"prophoto-rgb":
|
|
2205
|
-
rec2020:
|
|
2265
|
+
"srgb-linear": Cr,
|
|
2266
|
+
"display-p3": wr,
|
|
2267
|
+
"a98-rgb": Tr,
|
|
2268
|
+
"prophoto-rgb": Er,
|
|
2269
|
+
rec2020: Dr
|
|
2206
2270
|
}[t] ?? I)(...o, s));
|
|
2207
2271
|
}
|
|
2208
|
-
var
|
|
2272
|
+
var aa = {
|
|
2209
2273
|
srgb: "rgb",
|
|
2210
2274
|
"srgb-linear": "srgb-linear",
|
|
2211
2275
|
"display-p3": "display-p3",
|
|
@@ -2221,30 +2285,30 @@ var $i = {
|
|
|
2221
2285
|
xyz: "xyz",
|
|
2222
2286
|
"xyz-d65": "xyz",
|
|
2223
2287
|
"xyz-d50": "xyz"
|
|
2224
|
-
},
|
|
2288
|
+
}, oa = {
|
|
2225
2289
|
srgb: {
|
|
2226
2290
|
space: "rgb",
|
|
2227
2291
|
ctor: I
|
|
2228
2292
|
},
|
|
2229
2293
|
"srgb-linear": {
|
|
2230
2294
|
space: "srgb-linear",
|
|
2231
|
-
ctor:
|
|
2295
|
+
ctor: Cr
|
|
2232
2296
|
},
|
|
2233
2297
|
"display-p3": {
|
|
2234
2298
|
space: "display-p3",
|
|
2235
|
-
ctor:
|
|
2299
|
+
ctor: wr
|
|
2236
2300
|
},
|
|
2237
2301
|
"a98-rgb": {
|
|
2238
2302
|
space: "a98-rgb",
|
|
2239
|
-
ctor:
|
|
2303
|
+
ctor: Tr
|
|
2240
2304
|
},
|
|
2241
2305
|
"prophoto-rgb": {
|
|
2242
2306
|
space: "prophoto-rgb",
|
|
2243
|
-
ctor:
|
|
2307
|
+
ctor: Er
|
|
2244
2308
|
},
|
|
2245
2309
|
rec2020: {
|
|
2246
2310
|
space: "rec2020",
|
|
2247
|
-
ctor:
|
|
2311
|
+
ctor: Dr
|
|
2248
2312
|
},
|
|
2249
2313
|
xyz: {
|
|
2250
2314
|
space: "xyz",
|
|
@@ -2258,39 +2322,39 @@ var $i = {
|
|
|
2258
2322
|
space: "xyz",
|
|
2259
2323
|
ctor: L
|
|
2260
2324
|
}
|
|
2261
|
-
},
|
|
2325
|
+
}, sa = a(","), ca = i(/\s+/), la = a("/"), ua = a("("), da = a(")"), fa = n(sa.trim(o), ca), pa = n(la.trim(o), fa), K = e.lazy(() => n(V.Percentage, V.Angle.map((e) => new J(li(e.value, e.unit), "deg", ["angle"])), n(z, bi).map((e) => new J(e)), yi.map(() => new J(NaN)))), ma = n(R("calc").next(i(/\(([^)]+)\)/, (e) => e?.[1] ?? null)).map((e) => ({
|
|
2262
2326
|
type: "calc",
|
|
2263
2327
|
expr: e
|
|
2264
|
-
})),
|
|
2328
|
+
})), yi.map(() => ({ type: "none" })), i(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map((e) => ({
|
|
2265
2329
|
type: "ref",
|
|
2266
2330
|
name: e
|
|
2267
2331
|
})), K.map((e) => ({
|
|
2268
2332
|
type: "literal",
|
|
2269
2333
|
value: e.value
|
|
2270
2334
|
}))), q = (e) => {
|
|
2271
|
-
let r = R(e).skip(R("a").opt()), i = n(t(K.skip(
|
|
2272
|
-
return r.next(
|
|
2335
|
+
let r = R(e).skip(R("a").opt()), i = n(t(K.skip(pa), K), K.map((e) => [e])), a = t(K.skip(fa), K.skip(fa), i).trim(o).wrap(ua, da);
|
|
2336
|
+
return r.next(a).map(([e, t, [n, r]]) => [
|
|
2273
2337
|
e,
|
|
2274
2338
|
t,
|
|
2275
2339
|
n,
|
|
2276
2340
|
r ?? new J(1)
|
|
2277
2341
|
]);
|
|
2278
2342
|
};
|
|
2279
|
-
function
|
|
2280
|
-
return R(n).skip(R("a").opt()).next(t(R("from").skip(
|
|
2343
|
+
function ha(n, r) {
|
|
2344
|
+
return R(n).skip(R("a").opt()).next(t(R("from").skip(o).next(e.lazy(() => Ra.Value)), o.next(ma), o.next(ma), o.next(ma), la.trim(o).next(ma).opt()).trim(o).wrap(ua, da)).map(([e, t, n, i, a]) => ia(e, r, [
|
|
2281
2345
|
t,
|
|
2282
2346
|
n,
|
|
2283
2347
|
i
|
|
2284
2348
|
], a));
|
|
2285
2349
|
}
|
|
2286
|
-
var
|
|
2287
|
-
let { r: t, g: n, b: r, alpha: i } =
|
|
2350
|
+
var ga = i(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
2351
|
+
let { r: t, g: n, b: r, alpha: i } = $e(e);
|
|
2288
2352
|
return G(new I(t, n, r, i));
|
|
2289
|
-
}),
|
|
2290
|
-
let o =
|
|
2291
|
-
return c < 0 && l < 0 ? (c = .5, l = .5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c), G(
|
|
2292
|
-
}),
|
|
2293
|
-
let a =
|
|
2353
|
+
}), _a = z.skip(R("k")).map((e) => G(Ut(new Sr(e)))), va = n(ha("rgb", "rgb"), q("rgb").map(([e, t, n, r]) => G(new I(e, t, n, r)))), ya = n(ha("hsl", "hsl"), q("hsl").map(([e, t, n, r]) => G(new hr(e, t, n, r)))), ba = q("hsv").map(([e, t, n, r]) => G(new gr(e, t, n, r))), xa = n(ha("hwb", "hwb"), q("hwb").map(([e, t, n, r]) => G(new _r(e, t, n, r)))), Sa = n(ha("lab", "lab"), q("lab").map(([e, t, n, r]) => G(new vr(e, t, n, r)))), Ca = n(ha("lch", "lch"), q("lch").map(([e, t, n, r]) => G(new yr(e, t, n, r)))), wa = n(ha("oklab", "oklab"), q("oklab").map(([e, t, n, r]) => G(new br(e, t, n, r)))), Ta = n(ha("oklch", "oklch"), q("oklch").map(([e, t, n, r]) => G(new xr(e, t, n, r)))), Ea = n(ha("xyz", "xyz"), q("xyz").map(([e, t, n, r]) => G(new L(e, t, n, r)))), Da = n(R("srgb-linear").map(() => "srgb-linear"), R("srgb").map(() => "srgb"), R("display-p3").map(() => "display-p3"), R("a98-rgb").map(() => "a98-rgb"), R("prophoto-rgb").map(() => "prophoto-rgb"), R("rec2020").map(() => "rec2020"), R("oklab").map(() => "oklab"), R("oklch").map(() => "oklch"), R("lab").map(() => "lab"), R("lch").map(() => "lch"), R("hsl").map(() => "hsl"), R("hwb").map(() => "hwb"), R("xyz-d65").map(() => "xyz-d65"), R("xyz-d50").map(() => "xyz-d50"), R("xyz").map(() => "xyz")), Oa = n(R("shorter"), R("longer"), R("increasing"), R("decreasing")).skip(o).skip(R("hue")), ka = e.lazy(() => t(Ra.Value, o.next(V.Percentage).opt())), Aa = R("color-mix").next(t(R("in").skip(o).next(t(Da, o.next(Oa).opt())), a(",").trim(o).next(ka), a(",").trim(o).next(ka)).trim(o).wrap(ua, da)).map(([[e, t], [n, r], [i, a]]) => {
|
|
2354
|
+
let o = aa[e] ?? "oklab", s = t ?? "shorter", c = r == null ? -1 : r.value / 100, l = a == null ? -1 : a.value / 100;
|
|
2355
|
+
return c < 0 && l < 0 ? (c = .5, l = .5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c), G(Un($i(n), $i(i), c, l, o, s));
|
|
2356
|
+
}), ja = n(R("srgb-linear").map(() => "srgb-linear"), R("srgb").map(() => "srgb"), R("display-p3").map(() => "display-p3"), R("a98-rgb").map(() => "a98-rgb"), R("prophoto-rgb").map(() => "prophoto-rgb"), R("rec2020").map(() => "rec2020"), R("xyz-d65").map(() => "xyz-d65"), R("xyz-d50").map(() => "xyz-d50"), R("xyz").map(() => "xyz")), Ma = R("color").next(t(ja.skip(o), K.skip(o), K.skip(o), n(t(K.skip(la.trim(o)), K), K.map((e) => [e, void 0]))).trim(o).wrap(ua, da)).map(([e, t, n, [r, i]]) => {
|
|
2357
|
+
let a = oa[e];
|
|
2294
2358
|
if (!a) throw Error(`Unknown color() space: ${e}`);
|
|
2295
2359
|
let o = i ?? new J(1);
|
|
2296
2360
|
if (e === "srgb") {
|
|
@@ -2299,39 +2363,59 @@ var ua = r(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
|
2299
2363
|
}
|
|
2300
2364
|
let s = new a.ctor(t, n, r, o);
|
|
2301
2365
|
return e === "xyz-d50" && s instanceof L && (s.whitePoint = "D50"), G(s);
|
|
2302
|
-
}),
|
|
2366
|
+
}), Na = new Set(Object.keys(ke)), Pa = i(/[a-zA-Z][a-zA-Z0-9-]*/).chain((e) => {
|
|
2303
2367
|
let t = e.toLowerCase();
|
|
2304
|
-
if (
|
|
2305
|
-
let e =
|
|
2368
|
+
if (Na.has(t)) {
|
|
2369
|
+
let e = ke[t];
|
|
2306
2370
|
if (e) {
|
|
2307
|
-
let t =
|
|
2308
|
-
if (t) return
|
|
2371
|
+
let t = Ui(e);
|
|
2372
|
+
if (t) return xi(t);
|
|
2309
2373
|
}
|
|
2310
2374
|
}
|
|
2311
|
-
return
|
|
2312
|
-
})
|
|
2313
|
-
|
|
2375
|
+
return Si(`Invalid color name: ${e}`);
|
|
2376
|
+
}), Fa = {
|
|
2377
|
+
c: n(Aa, Ma, Pa),
|
|
2378
|
+
r: n(va, Pa),
|
|
2379
|
+
h: n(ya, ba, xa, Pa),
|
|
2380
|
+
l: n(Sa, Ca, Pa),
|
|
2381
|
+
o: n(wa, Ta, Pa),
|
|
2382
|
+
x: n(Ea, Pa)
|
|
2383
|
+
}, Ia = {
|
|
2384
|
+
"#": ga,
|
|
2385
|
+
"0-9": _a,
|
|
2386
|
+
"+": _a,
|
|
2387
|
+
"-": _a,
|
|
2388
|
+
".": _a
|
|
2389
|
+
};
|
|
2390
|
+
for (let e = 97; e <= 122; e++) {
|
|
2391
|
+
let t = String.fromCharCode(e), n = t.toUpperCase(), r = Fa[t] ?? Pa;
|
|
2392
|
+
Ia[t] = r, Ia[n] = r;
|
|
2393
|
+
}
|
|
2394
|
+
var La = r(Ia).trim(o), Ra = {
|
|
2395
|
+
Value: La,
|
|
2314
2396
|
colorValue: K,
|
|
2315
|
-
componentExpr:
|
|
2316
|
-
sep:
|
|
2317
|
-
alphaSep:
|
|
2318
|
-
div:
|
|
2319
|
-
},
|
|
2320
|
-
function
|
|
2321
|
-
for (let [t, n] of Object.entries(e))
|
|
2322
|
-
|
|
2323
|
-
}
|
|
2324
|
-
function
|
|
2325
|
-
|
|
2326
|
-
}
|
|
2327
|
-
function
|
|
2328
|
-
return
|
|
2329
|
-
}
|
|
2330
|
-
var
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2397
|
+
componentExpr: ma,
|
|
2398
|
+
sep: fa,
|
|
2399
|
+
alphaSep: pa,
|
|
2400
|
+
div: la
|
|
2401
|
+
}, za = /* @__PURE__ */ new Map();
|
|
2402
|
+
function Ba(e) {
|
|
2403
|
+
for (let [t, n] of Object.entries(e)) za.set(t.trim().toLowerCase(), n);
|
|
2404
|
+
Ua.cache.clear();
|
|
2405
|
+
}
|
|
2406
|
+
function Va() {
|
|
2407
|
+
za.clear(), Ua.cache.clear();
|
|
2408
|
+
}
|
|
2409
|
+
function Ha() {
|
|
2410
|
+
return za;
|
|
2411
|
+
}
|
|
2412
|
+
var Ua = h((e) => {
|
|
2413
|
+
if (za.size > 0) {
|
|
2414
|
+
let t = e.trim().toLowerCase(), n = za.get(t);
|
|
2415
|
+
if (n) return B(La, n);
|
|
2416
|
+
}
|
|
2417
|
+
let t = Ci(La, e);
|
|
2418
|
+
return t.status ? t.value : B(La, e);
|
|
2335
2419
|
}, { keyFn: (e) => e }), J = class e {
|
|
2336
2420
|
value;
|
|
2337
2421
|
unit;
|
|
@@ -2372,12 +2456,12 @@ var Pa = m((e) => {
|
|
|
2372
2456
|
return new e(Number(this.value).toFixed(t).replace(/\.0+$/, "")).coalesce(this, !0).toString();
|
|
2373
2457
|
}
|
|
2374
2458
|
clone() {
|
|
2375
|
-
return new e(
|
|
2459
|
+
return new e(l(this.value), this.unit, l(this.superType), this.subProperty, this.property);
|
|
2376
2460
|
}
|
|
2377
2461
|
coalesce(t, n = !1) {
|
|
2378
2462
|
if (t == null) return this;
|
|
2379
|
-
let r =
|
|
2380
|
-
return this.unit != null && r.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new e(
|
|
2463
|
+
let r = Kr;
|
|
2464
|
+
return this.unit != null && r.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new e(l(this.value), this.unit ?? t.unit, l(this.superType ?? t.superType), this.subProperty ?? t.subProperty, this.property ?? t.property, this.targets ?? t.targets);
|
|
2381
2465
|
}
|
|
2382
2466
|
}, Y = class e {
|
|
2383
2467
|
name;
|
|
@@ -2411,7 +2495,7 @@ var Pa = m((e) => {
|
|
|
2411
2495
|
clone() {
|
|
2412
2496
|
return new e(this.name, this.values.map((e) => e.clone()));
|
|
2413
2497
|
}
|
|
2414
|
-
},
|
|
2498
|
+
}, Wa = class e extends Array {
|
|
2415
2499
|
constructor(...e) {
|
|
2416
2500
|
super(...e);
|
|
2417
2501
|
}
|
|
@@ -2439,22 +2523,22 @@ var Pa = m((e) => {
|
|
|
2439
2523
|
clone() {
|
|
2440
2524
|
return new e(...this.map((e) => e.clone()));
|
|
2441
2525
|
}
|
|
2442
|
-
},
|
|
2443
|
-
let t = e.lazy(() => n(
|
|
2444
|
-
return
|
|
2445
|
-
}, { mathFunction:
|
|
2526
|
+
}, Ga = a("("), Ka = a(")"), qa = a(","), Ja = e.lazy(() => po.sepBy(n(qa, o)).trim(o).map((e) => new Wa(...e))), Ya = (e) => t(e || vi, Ja.wrap(Ga, Ka)), Xa = () => {
|
|
2527
|
+
let t = e.lazy(() => n(i(/[^()]+/), t.many(1).wrap(Ga, Ka).map((e) => `(${e.flat().join("")})`)).many(1));
|
|
2528
|
+
return a("var").next(t.trim(o).wrap(Ga, Ka).map((e) => [e].flat(Infinity).join(""))).map((e) => new J(e, "var"));
|
|
2529
|
+
}, { mathFunction: Za, calcFn: Qa } = Ji(V.Value), $a = [
|
|
2446
2530
|
"translate",
|
|
2447
2531
|
"scale",
|
|
2448
2532
|
"rotate",
|
|
2449
2533
|
"skew"
|
|
2450
|
-
],
|
|
2534
|
+
], eo = [
|
|
2451
2535
|
"x",
|
|
2452
2536
|
"y",
|
|
2453
2537
|
"z"
|
|
2454
|
-
],
|
|
2455
|
-
let e = t(n(...
|
|
2456
|
-
return
|
|
2457
|
-
let i = e.toLowerCase(), a = i === "skew" ?
|
|
2538
|
+
], to = eo.map(R), no = $a.map(R), ro = () => {
|
|
2539
|
+
let e = t(n(...no), n(...to, a(""))), r = (e, t) => e + t.toUpperCase();
|
|
2540
|
+
return Ya(e).map(([[e, t], n]) => {
|
|
2541
|
+
let i = e.toLowerCase(), a = i === "skew" ? eo.filter((e) => e !== "z") : eo, o = {};
|
|
2458
2542
|
if (t) {
|
|
2459
2543
|
let e = i + t.toUpperCase();
|
|
2460
2544
|
o[e] = n[0];
|
|
@@ -2465,14 +2549,14 @@ var Pa = m((e) => {
|
|
|
2465
2549
|
let n = r(i, a[t]);
|
|
2466
2550
|
o[n] = e;
|
|
2467
2551
|
});
|
|
2468
|
-
return new
|
|
2552
|
+
return new Wa(...Object.entries(o).map(([e, t]) => new Y(e, [t])));
|
|
2469
2553
|
});
|
|
2470
|
-
},
|
|
2554
|
+
}, io = {
|
|
2471
2555
|
left: 270,
|
|
2472
2556
|
right: 90,
|
|
2473
2557
|
top: 0,
|
|
2474
2558
|
bottom: 180
|
|
2475
|
-
},
|
|
2559
|
+
}, ao = {
|
|
2476
2560
|
"top left": 315,
|
|
2477
2561
|
"left top": 315,
|
|
2478
2562
|
"top right": 45,
|
|
@@ -2481,7 +2565,7 @@ var Pa = m((e) => {
|
|
|
2481
2565
|
"right bottom": 135,
|
|
2482
2566
|
"bottom left": 225,
|
|
2483
2567
|
"left bottom": 225
|
|
2484
|
-
},
|
|
2568
|
+
}, oo = () => {
|
|
2485
2569
|
let e = n(...[
|
|
2486
2570
|
"linear-gradient",
|
|
2487
2571
|
"radial-gradient",
|
|
@@ -2494,32 +2578,32 @@ var Pa = m((e) => {
|
|
|
2494
2578
|
"right",
|
|
2495
2579
|
"top",
|
|
2496
2580
|
"bottom"
|
|
2497
|
-
].map(R)),
|
|
2498
|
-
let n =
|
|
2581
|
+
].map(R)), i = n(t(a("to").skip(o), r.skip(o), r).map(([, e, t]) => {
|
|
2582
|
+
let n = ao[`${e.toLowerCase()} ${t.toLowerCase()}`];
|
|
2499
2583
|
if (n == null) throw Error(`Invalid gradient corner: to ${e} ${t}`);
|
|
2500
2584
|
return new J(n, "deg");
|
|
2501
|
-
}), t(
|
|
2502
|
-
return t(e, t(n(s, c).skip(
|
|
2503
|
-
},
|
|
2585
|
+
}), t(a("to").skip(o), r).map(([, e]) => new J(io[e.toLowerCase()], "deg"))), s = t(R("from").skip(o), V.Angle).map(([, e]) => e), c = n(V.Angle, i), l = n(V.Length, V.Percentage), u = t(V.Color, l.sepBy(o)).map(([e, t]) => !t || t.length === 0 ? [e] : [e, ...t]), d = t(u, qa.trim(o).next(n(u, l)).many()).map(([e, t]) => [e, ...t]);
|
|
2586
|
+
return t(e, t(n(s, c).skip(qa).opt(), d).trim(o).wrap(Ga, Ka).map(([e, t]) => e ? [e, ...t].flat() : [t])).map(([e, t]) => new Y(e, t));
|
|
2587
|
+
}, so = () => Ya(a("cubic-bezier")).map((e) => new Y("cubic-bezier", e[1])), co = [
|
|
2504
2588
|
"inherit",
|
|
2505
2589
|
"initial",
|
|
2506
2590
|
"unset",
|
|
2507
2591
|
"revert",
|
|
2508
2592
|
"revert-layer"
|
|
2509
|
-
],
|
|
2510
|
-
Function:
|
|
2511
|
-
Value:
|
|
2512
|
-
FunctionArgs:
|
|
2513
|
-
},
|
|
2593
|
+
], lo = n(...co.map(R)).map((e) => new J(e.toLowerCase(), "string", ["keyword"])), uo = i(/[^\(\)\{\}\s,;]+/).map((e) => new J(e)), fo = n(ro(), Xa(), Za, oo(), so(), Ya().map(([e, t]) => new Y(e, t))), po = n(lo, V.Value, fo, uo).trim(o), mo = {
|
|
2594
|
+
Function: fo,
|
|
2595
|
+
Value: po,
|
|
2596
|
+
FunctionArgs: Ja
|
|
2597
|
+
}, ho = t(a("{"), i(/[^{}]+/), a("}")).map((e) => {
|
|
2514
2598
|
let t = e.join("\n");
|
|
2515
2599
|
return new J(JSON.parse(t), "json");
|
|
2516
|
-
}),
|
|
2517
|
-
Value:
|
|
2518
|
-
Values:
|
|
2519
|
-
},
|
|
2600
|
+
}), go = n(lo, Za, V.Value, fo, ho, uo).trim(o), _o = {
|
|
2601
|
+
Value: go,
|
|
2602
|
+
Values: go.sepBy(o)
|
|
2603
|
+
}, vo = h((e) => B(go, e), { keyFn: (e) => e }), yo = h((e) => B(V.Percentage, String(e)).valueOf(), { keyFn: (e) => String(e) }), bo = h((e) => B(V.Time.map((e) => e.unit === "ms" ? e.value : e.unit === "s" ? e.value * 1e3 : e.value), e), { keyFn: (e) => e }), xo = (e) => typeof e == "string" && Fr.includes(e), So = (e) => typeof e == "string" && Lr.includes(e), Co = (e) => typeof e == "string" && Ir.includes(e), wo = (e) => typeof e == "string" && Br.includes(e), To = (e) => typeof e == "string" && Hr.includes(e), Eo = (e, t) => {
|
|
2520
2604
|
if (typeof e != "number" || !Number.isFinite(e)) throw TypeError(`Expected numeric ${t}, got ${String(e)}.`);
|
|
2521
2605
|
return e;
|
|
2522
|
-
},
|
|
2606
|
+
}, Do = new Set([
|
|
2523
2607
|
"scaleX",
|
|
2524
2608
|
"scaleY",
|
|
2525
2609
|
"scaleZ",
|
|
@@ -2536,22 +2620,27 @@ var Pa = m((e) => {
|
|
|
2536
2620
|
"perspectiveY",
|
|
2537
2621
|
"perspectiveZ",
|
|
2538
2622
|
"perspectiveW"
|
|
2539
|
-
]),
|
|
2540
|
-
let t =
|
|
2541
|
-
return t === void 0 && (t =
|
|
2542
|
-
},
|
|
2623
|
+
]), Oo = (e) => Do.has(e), ko = /* @__PURE__ */ new WeakMap(), Ao = 0, jo = (e) => {
|
|
2624
|
+
let t = ko.get(e);
|
|
2625
|
+
return t === void 0 && (t = Ao++, ko.set(e, t)), t;
|
|
2626
|
+
}, Mo = /* @__PURE__ */ new WeakMap(), No = 0, Po = (e) => {
|
|
2627
|
+
let t = Mo.get(e);
|
|
2628
|
+
return t === void 0 && (t = No++, Mo.set(e, t)), t;
|
|
2629
|
+
}, Fo = (e) => e, Io = 0, Lo = () => Io, Ro = () => (Io++, Bo.cache.clear(), Io), zo = !1;
|
|
2630
|
+
zo || typeof window > "u" || typeof window.addEventListener != "function" || (zo = !0, window.addEventListener("resize", () => Ro(), { passive: !0 }));
|
|
2631
|
+
var Bo = h((e, t) => (() => {
|
|
2543
2632
|
if (!t) return e;
|
|
2544
|
-
if (e.unit === "var") return
|
|
2633
|
+
if (e.unit === "var") return Ui(getComputedStyle(t).getPropertyValue(e.value));
|
|
2545
2634
|
if (e.unit === "calc" && e.property && e.subProperty && e.value) {
|
|
2546
|
-
let n = e.property, r =
|
|
2635
|
+
let n = e.property, r = Fo(t.style), i = r[n] ?? "";
|
|
2547
2636
|
r[n] = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
|
|
2548
2637
|
let a = getComputedStyle(t).getPropertyValue(n);
|
|
2549
2638
|
r[n] = i;
|
|
2550
|
-
let o =
|
|
2639
|
+
let o = vo(a);
|
|
2551
2640
|
if (o instanceof J) return o;
|
|
2552
2641
|
if (o.name.startsWith("matrix")) {
|
|
2553
|
-
let t =
|
|
2554
|
-
if (
|
|
2642
|
+
let t = ei(o);
|
|
2643
|
+
if (Oo(e.subProperty)) {
|
|
2555
2644
|
let n = t[e.subProperty];
|
|
2556
2645
|
if (n != null) return new J(n, "px", ["length", "absolute"]);
|
|
2557
2646
|
}
|
|
@@ -2559,35 +2648,35 @@ var Pa = m((e) => {
|
|
|
2559
2648
|
}
|
|
2560
2649
|
return e;
|
|
2561
2650
|
})().coalesce(e), {
|
|
2562
|
-
keyFn: (e, t) => `${e
|
|
2651
|
+
keyFn: (e, t) => `${Po(e)}-${t ? jo(t) : "null"}`,
|
|
2563
2652
|
shouldCache: (e, t, n) => !n || n.isConnected
|
|
2564
|
-
}),
|
|
2653
|
+
}), Vo = (e, t, n = !1) => {
|
|
2565
2654
|
if (e?.superType?.[0] !== t?.superType?.[0]) return n ? [e, t] : [e.clone(), t.clone()];
|
|
2566
2655
|
let r = (e) => {
|
|
2567
|
-
let t = e?.superType?.[0], n =
|
|
2656
|
+
let t = e?.superType?.[0], n = Eo(e.value, "ValueUnit");
|
|
2568
2657
|
switch (t) {
|
|
2569
2658
|
case "length":
|
|
2570
|
-
if (!
|
|
2659
|
+
if (!xo(e.unit)) throw TypeError(`Unsupported length unit: ${String(e.unit)}`);
|
|
2571
2660
|
return {
|
|
2572
|
-
value:
|
|
2661
|
+
value: si(n, e.unit, e.targets?.[0]),
|
|
2573
2662
|
unit: "px"
|
|
2574
2663
|
};
|
|
2575
2664
|
case "angle":
|
|
2576
|
-
if (!
|
|
2665
|
+
if (!So(e.unit)) throw TypeError(`Unsupported angle unit: ${String(e.unit)}`);
|
|
2577
2666
|
return {
|
|
2578
|
-
value:
|
|
2667
|
+
value: li(n, e.unit),
|
|
2579
2668
|
unit: "deg"
|
|
2580
2669
|
};
|
|
2581
2670
|
case "time":
|
|
2582
|
-
if (!
|
|
2671
|
+
if (!Co(e.unit)) throw TypeError(`Unsupported time unit: ${String(e.unit)}`);
|
|
2583
2672
|
return {
|
|
2584
|
-
value:
|
|
2673
|
+
value: ci(n, e.unit),
|
|
2585
2674
|
unit: "ms"
|
|
2586
2675
|
};
|
|
2587
2676
|
case "resolution":
|
|
2588
|
-
if (!
|
|
2677
|
+
if (!wo(e.unit)) throw TypeError(`Unsupported resolution unit: ${String(e.unit)}`);
|
|
2589
2678
|
return {
|
|
2590
|
-
value:
|
|
2679
|
+
value: di(n, e.unit),
|
|
2591
2680
|
unit: "dpi"
|
|
2592
2681
|
};
|
|
2593
2682
|
default: return {
|
|
@@ -2597,8 +2686,8 @@ var Pa = m((e) => {
|
|
|
2597
2686
|
}
|
|
2598
2687
|
}, [i, a] = [r(e), r(t)];
|
|
2599
2688
|
return n ? (e.value = i.value, e.unit = i.unit, t.value = a.value, t.unit = a.unit, [e, t]) : [new J(i.value, i.unit, e.superType, e.subProperty, e.property, e.targets), new J(a.value, a.unit, t.superType, t.subProperty, t.property, t.targets)];
|
|
2600
|
-
},
|
|
2601
|
-
function
|
|
2689
|
+
}, Ho = (e) => e.unit === "color";
|
|
2690
|
+
function Uo(e, t, n = {}) {
|
|
2602
2691
|
let r = n.colorSpace ?? "oklab", i = n.hueMethod;
|
|
2603
2692
|
e = e.coalesce(t), t = t.coalesce(e);
|
|
2604
2693
|
let a = {
|
|
@@ -2607,43 +2696,78 @@ function Do(e, t, n = {}) {
|
|
|
2607
2696
|
value: e.clone(),
|
|
2608
2697
|
computed: !1
|
|
2609
2698
|
};
|
|
2610
|
-
if (
|
|
2611
|
-
let [n, o] =
|
|
2699
|
+
if (Ho(e) && Ho(t)) {
|
|
2700
|
+
let [n, o] = Mr(e, t, r, !1, !0, !1, i);
|
|
2612
2701
|
a.start = n, a.stop = o, a.value = n.clone(), a.colorSpace = r, i && (a.hueMethod = i);
|
|
2613
2702
|
}
|
|
2614
2703
|
if (e.unit !== t.unit) {
|
|
2615
|
-
let [n, r] =
|
|
2704
|
+
let [n, r] = Vo(e, t, !0);
|
|
2616
2705
|
a.start = n, a.stop = r, a.value = n.clone();
|
|
2617
2706
|
}
|
|
2618
|
-
return a.computed =
|
|
2619
|
-
}
|
|
2620
|
-
function
|
|
2621
|
-
let i = t.targets?.[0] ??
|
|
2622
|
-
if (!
|
|
2623
|
-
let
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
}
|
|
2707
|
+
return a.computed = To(e.unit) || To(t.unit), a;
|
|
2708
|
+
}
|
|
2709
|
+
function Wo(e, t) {
|
|
2710
|
+
let { start: n, stop: r, value: i } = t, a = n.targets?.[0] ?? r.targets?.[0];
|
|
2711
|
+
if (!a) throw Error("Cannot interpolate computed values without a target element.");
|
|
2712
|
+
let o = Lo(), s = t._computedCache;
|
|
2713
|
+
if (s === void 0 || s.target !== a || s.epoch !== o) {
|
|
2714
|
+
let e = Bo(n, a), c = Bo(r, a), l = Hr.includes(e.unit ?? "") ? c.unit : e.unit;
|
|
2715
|
+
s = {
|
|
2716
|
+
startN: e.value,
|
|
2717
|
+
stopN: c.value,
|
|
2718
|
+
unit: l,
|
|
2719
|
+
target: a,
|
|
2720
|
+
epoch: o
|
|
2721
|
+
}, t._computedCache = s, i.unit = s.unit;
|
|
2722
|
+
}
|
|
2723
|
+
return i.value = b(s.startN, s.stopN, e), i;
|
|
2724
|
+
}
|
|
2725
|
+
function Go(e, t) {
|
|
2726
|
+
let { value: n, _colorPlan: r, hueMethod: i } = t;
|
|
2727
|
+
if (r) {
|
|
2728
|
+
let { keys: t, startN: a, stopN: o, hueIndex: s, dstVU: c } = r, l = n.value;
|
|
2729
|
+
for (let n = 0; n < t.length; n++) {
|
|
2730
|
+
let r = a[n], u = o[n], d = n === s ? Hn(r, u, e, i) * 360 : b(r, u, e), f = c[n];
|
|
2731
|
+
f == null ? Qn(l, t[n], N(d)) : f.value = d;
|
|
2732
|
+
}
|
|
2733
|
+
return n;
|
|
2734
|
+
}
|
|
2735
|
+
let { start: a, stop: o, colorSpace: s } = t, c = s ? Vn[s] : void 0;
|
|
2736
|
+
return a.value.keys().forEach((t) => {
|
|
2737
|
+
let r = P(a.value, t), s = P(o.value, t), l = J.unwrapDeep(r), u = J.unwrapDeep(s), d;
|
|
2738
|
+
d = t === c ? Hn(l / 360, u / 360, e, i) * 360 : b(l, u, e);
|
|
2739
|
+
let f = P(n.value, t);
|
|
2740
|
+
f instanceof J ? f.value = d : Qn(n.value, t, N(d));
|
|
2741
|
+
}), n;
|
|
2634
2742
|
}
|
|
2635
|
-
function
|
|
2743
|
+
function Ko(e, { start: t, stop: n, value: r }) {
|
|
2636
2744
|
return r.value = b(t.value, n.value, e), r;
|
|
2637
2745
|
}
|
|
2638
|
-
function
|
|
2746
|
+
function qo(e, t) {
|
|
2639
2747
|
if (t._lerp) return t._lerp(e, t);
|
|
2640
2748
|
let { start: n, stop: r, computed: i } = t;
|
|
2641
|
-
return typeof n.value == "number" && typeof r.value == "number" ? (t.value.value = b(n.value, r.value, e), t.value) : n.unit === "color" ?
|
|
2749
|
+
return typeof n.value == "number" && typeof r.value == "number" ? (t.value.value = b(n.value, r.value, e), t.value) : n.unit === "color" ? Go(e, t) : i ? Wo(e, t) : t.value;
|
|
2642
2750
|
}
|
|
2643
|
-
function
|
|
2644
|
-
return e._lerp = e.computed ?
|
|
2751
|
+
function Jo(e) {
|
|
2752
|
+
return e._lerp = e.computed ? Wo : e.start.unit === "color" ? Go : Ko, !e.computed && e.start.unit === "color" && (e._colorPlan = Yo(e)), e;
|
|
2645
2753
|
}
|
|
2646
|
-
function
|
|
2754
|
+
function Yo(e) {
|
|
2755
|
+
let { start: t, stop: n, value: r, colorSpace: i } = e, a = i ? Vn[i] : void 0, o = t.value.keys(), s = o.length, c = new Float64Array(s), l = new Float64Array(s), u = Array(s).fill(null), d = -1;
|
|
2756
|
+
for (let e = 0; e < s; e++) {
|
|
2757
|
+
let i = o[e], s = J.unwrapDeep(P(t.value, i)), f = J.unwrapDeep(P(n.value, i));
|
|
2758
|
+
i === a ? (d = e, c[e] = s / 360, l[e] = f / 360) : (c[e] = s, l[e] = f);
|
|
2759
|
+
let p = P(r.value, i);
|
|
2760
|
+
u[e] = p instanceof J ? p : null;
|
|
2761
|
+
}
|
|
2762
|
+
return {
|
|
2763
|
+
keys: o,
|
|
2764
|
+
startN: c,
|
|
2765
|
+
stopN: l,
|
|
2766
|
+
hueIndex: d,
|
|
2767
|
+
dstVU: u
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
function Xo(e, t, n = "oklab", r = "shorter") {
|
|
2647
2771
|
if (e.length === 0) throw Error("mixColorsN requires at least one color");
|
|
2648
2772
|
if (e.length === 1) return e[0];
|
|
2649
2773
|
let i = t ?? e.map(() => 1);
|
|
@@ -2658,89 +2782,89 @@ function No(e, t, n = "oklab", r = "shorter") {
|
|
|
2658
2782
|
let a = i[t], c = s + a;
|
|
2659
2783
|
if (c === 0) continue;
|
|
2660
2784
|
let l = s / c, u = a / c;
|
|
2661
|
-
o =
|
|
2785
|
+
o = Un(o, e[t], l, u, n, r), s = c;
|
|
2662
2786
|
}
|
|
2663
2787
|
return o;
|
|
2664
2788
|
}
|
|
2665
|
-
function
|
|
2789
|
+
function Zo(e) {
|
|
2666
2790
|
let t = (t, n = 1) => Math.round(e[t] * n);
|
|
2667
2791
|
return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
|
|
2668
2792
|
}
|
|
2669
|
-
var
|
|
2793
|
+
var Qo = (e) => [
|
|
2670
2794
|
e.r,
|
|
2671
2795
|
e.g,
|
|
2672
2796
|
e.b
|
|
2673
|
-
],
|
|
2674
|
-
let t =
|
|
2675
|
-
return
|
|
2676
|
-
},
|
|
2677
|
-
function
|
|
2797
|
+
], $o = (e, t, n) => new I(e, t, n), es = (e, t, n) => new hr(e, t, n), ts = (e) => {
|
|
2798
|
+
let t = Zt(e);
|
|
2799
|
+
return es(t.h, t.s, t.l);
|
|
2800
|
+
}, ns = 1, rs = 1 / 6, is = 5, as = 15, os = 100, ss = 7500, cs = 200, ls = 360, us = 50, ds = 20, fs = 3750, ps = 50, ms = 100, hs = 100, gs = .2126, _s = .7152, X = .0722;
|
|
2801
|
+
function vs(e, t = 0) {
|
|
2678
2802
|
let n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180);
|
|
2679
|
-
return
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2803
|
+
return Ns(e, [
|
|
2804
|
+
gs + r * (1 - gs) - n * gs,
|
|
2805
|
+
_s - r * _s - n * _s,
|
|
2806
|
+
X - r * X + n * (1 - X),
|
|
2807
|
+
gs - r * gs + n * .143,
|
|
2808
|
+
_s + r * (1 - _s) + n * .14,
|
|
2809
|
+
X - r * X - n * .283,
|
|
2810
|
+
gs - r * gs - n * (1 - gs),
|
|
2811
|
+
_s - r * _s + n * _s,
|
|
2812
|
+
X + r * (1 - X) + n * X
|
|
2689
2813
|
]);
|
|
2690
2814
|
}
|
|
2691
|
-
var
|
|
2692
|
-
function
|
|
2693
|
-
return
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2815
|
+
var ys = .393, bs = .769, xs = .189, Ss = .349, Cs = .686, ws = .168, Ts = .272, Es = .534, Ds = .131;
|
|
2816
|
+
function Os(e, t = 1) {
|
|
2817
|
+
return Ns(e, [
|
|
2818
|
+
ys + (1 - ys) * (1 - t),
|
|
2819
|
+
bs - bs * (1 - t),
|
|
2820
|
+
xs - xs * (1 - t),
|
|
2821
|
+
Ss - Ss * (1 - t),
|
|
2822
|
+
Cs + (1 - Cs) * (1 - t),
|
|
2823
|
+
ws - ws * (1 - t),
|
|
2824
|
+
Ts - Ts * (1 - t),
|
|
2825
|
+
Es - Es * (1 - t),
|
|
2826
|
+
Ds + (1 - Ds) * (1 - t)
|
|
2703
2827
|
]);
|
|
2704
2828
|
}
|
|
2705
|
-
var
|
|
2706
|
-
function
|
|
2707
|
-
return
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2829
|
+
var ks = .213, As = .715, js = .072;
|
|
2830
|
+
function Ms(e, t = 1) {
|
|
2831
|
+
return Ns(e, [
|
|
2832
|
+
ks + (1 - ks) * t,
|
|
2833
|
+
As - As * t,
|
|
2834
|
+
js - js * t,
|
|
2835
|
+
ks - ks * t,
|
|
2836
|
+
As + (1 - As) * t,
|
|
2837
|
+
js - js * t,
|
|
2838
|
+
ks - ks * t,
|
|
2839
|
+
As - As * t,
|
|
2840
|
+
js + (1 - js) * t
|
|
2717
2841
|
]);
|
|
2718
2842
|
}
|
|
2719
|
-
function
|
|
2720
|
-
let n = x(
|
|
2721
|
-
return
|
|
2843
|
+
function Ns(e, t) {
|
|
2844
|
+
let n = x(Qo(e), t);
|
|
2845
|
+
return $o(v(n[0], 0, 255), v(n[1], 0, 255), v(n[2], 0, 255));
|
|
2722
2846
|
}
|
|
2723
|
-
function
|
|
2724
|
-
return
|
|
2847
|
+
function Ps(e, t = 1) {
|
|
2848
|
+
return Is(e, t);
|
|
2725
2849
|
}
|
|
2726
|
-
function
|
|
2727
|
-
return
|
|
2850
|
+
function Fs(e, t = 1) {
|
|
2851
|
+
return Is(e, t, -(.5 * t) + .5);
|
|
2728
2852
|
}
|
|
2729
|
-
function
|
|
2730
|
-
let r =
|
|
2731
|
-
return
|
|
2853
|
+
function Is(e, t = 1, n = 0) {
|
|
2854
|
+
let r = Qo(e);
|
|
2855
|
+
return $o(v(r[0] * t + n * 255, 0, 255), v(r[1] * t + n * 255, 0, 255), v(r[2] * t + n * 255, 0, 255));
|
|
2732
2856
|
}
|
|
2733
|
-
function
|
|
2734
|
-
let n =
|
|
2735
|
-
return
|
|
2857
|
+
function Ls(e, t = 1) {
|
|
2858
|
+
let n = Qo(e);
|
|
2859
|
+
return $o(v((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255), v((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255), v((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255));
|
|
2736
2860
|
}
|
|
2737
|
-
function
|
|
2738
|
-
let r =
|
|
2739
|
-
r =
|
|
2740
|
-
let i =
|
|
2861
|
+
function Rs(e, t, n) {
|
|
2862
|
+
let r = $o(0, 0, 0);
|
|
2863
|
+
r = Ls(r, e[0] / 100), r = Os(r, e[1] / 100), r = Ms(r, e[2] / 100), r = vs(r, e[3] * 3.6), r = Ps(r, e[4] / 100), r = Fs(r, e[5] / 100);
|
|
2864
|
+
let i = ts(r);
|
|
2741
2865
|
return Math.abs(r.r - t.r) + Math.abs(r.g - t.g) + Math.abs(r.b - t.b) + Math.abs(i.h - n.h) + Math.abs(i.s - n.s) + Math.abs(i.l - n.l);
|
|
2742
2866
|
}
|
|
2743
|
-
function
|
|
2867
|
+
function zs(e, t, n, r, i, a, o) {
|
|
2744
2868
|
let s = null, c = Infinity, l = [
|
|
2745
2869
|
,
|
|
2746
2870
|
,
|
|
@@ -2764,14 +2888,14 @@ function Ss(e, t, n, r, i, a, o) {
|
|
|
2764
2888
|
,
|
|
2765
2889
|
];
|
|
2766
2890
|
for (let f = 0; f < i; f++) {
|
|
2767
|
-
let i = n / (f + 1) ** +
|
|
2891
|
+
let i = n / (f + 1) ** +rs;
|
|
2768
2892
|
for (let e = 0; e < 6; e++) l[e] = Math.random() > .5 ? 1 : -1, u[e] = r[e] + i * l[e], d[e] = r[e] - i * l[e];
|
|
2769
|
-
let p =
|
|
2893
|
+
let p = Rs(u, a, o) - Rs(d, a, o);
|
|
2770
2894
|
for (let n = 0; n < 6; n++) {
|
|
2771
|
-
let a = p / (2 * i) * l[n], o = t[n] / (e + f + 1) ** +
|
|
2772
|
-
r[n] =
|
|
2895
|
+
let a = p / (2 * i) * l[n], o = t[n] / (e + f + 1) ** +ns;
|
|
2896
|
+
r[n] = Bs(r[n] - o * a, n);
|
|
2773
2897
|
}
|
|
2774
|
-
let m =
|
|
2898
|
+
let m = Rs(r, a, o);
|
|
2775
2899
|
m < c && (s = [...r], c = m);
|
|
2776
2900
|
}
|
|
2777
2901
|
return {
|
|
@@ -2779,13 +2903,13 @@ function Ss(e, t, n, r, i, a, o) {
|
|
|
2779
2903
|
loss: c
|
|
2780
2904
|
};
|
|
2781
2905
|
}
|
|
2782
|
-
function
|
|
2783
|
-
let n =
|
|
2784
|
-
return t === 2 ? n =
|
|
2906
|
+
function Bs(e, t) {
|
|
2907
|
+
let n = os;
|
|
2908
|
+
return t === 2 ? n = ss : (t === 4 || t === 5) && (n = cs), t === 3 ? (e % ls + ls) % ls : v(e, 0, n);
|
|
2785
2909
|
}
|
|
2786
|
-
function
|
|
2910
|
+
function Vs(e, t, n) {
|
|
2787
2911
|
let r = e.loss, i = r + 1;
|
|
2788
|
-
return
|
|
2912
|
+
return zs(r, [
|
|
2789
2913
|
.25 * i,
|
|
2790
2914
|
.25 * i,
|
|
2791
2915
|
i,
|
|
@@ -2794,7 +2918,7 @@ function ws(e, t, n) {
|
|
|
2794
2918
|
.2 * i
|
|
2795
2919
|
], 2, e.values, 500, t, n);
|
|
2796
2920
|
}
|
|
2797
|
-
function
|
|
2921
|
+
function Hs(e, t) {
|
|
2798
2922
|
let n = [
|
|
2799
2923
|
60,
|
|
2800
2924
|
180,
|
|
@@ -2807,34 +2931,34 @@ function Ts(e, t) {
|
|
|
2807
2931
|
values: []
|
|
2808
2932
|
};
|
|
2809
2933
|
for (let i = 0; i < 3; i++) if (r.loss > 25) {
|
|
2810
|
-
let i =
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2934
|
+
let i = zs(is, n, as, [
|
|
2935
|
+
us,
|
|
2936
|
+
ds,
|
|
2937
|
+
fs,
|
|
2938
|
+
ps,
|
|
2939
|
+
ms,
|
|
2940
|
+
hs
|
|
2817
2941
|
], 1e3, e, t);
|
|
2818
2942
|
i.loss < r.loss && (r = i);
|
|
2819
2943
|
}
|
|
2820
2944
|
return r;
|
|
2821
2945
|
}
|
|
2822
|
-
function
|
|
2823
|
-
let t =
|
|
2946
|
+
function Us(e) {
|
|
2947
|
+
let t = ts(e), n = Vs(Hs(e, t), e, t);
|
|
2824
2948
|
return {
|
|
2825
2949
|
values: n.values,
|
|
2826
2950
|
loss: n.loss,
|
|
2827
|
-
filter:
|
|
2951
|
+
filter: Zo(n.values)
|
|
2828
2952
|
};
|
|
2829
2953
|
}
|
|
2830
|
-
function
|
|
2831
|
-
return
|
|
2954
|
+
function Ws(e) {
|
|
2955
|
+
return Us(e);
|
|
2832
2956
|
}
|
|
2833
|
-
function
|
|
2957
|
+
function Gs(e) {
|
|
2834
2958
|
return e;
|
|
2835
2959
|
}
|
|
2836
|
-
function
|
|
2837
|
-
if (e.length === 0) return
|
|
2960
|
+
function Ks(e) {
|
|
2961
|
+
if (e.length === 0) return Gs;
|
|
2838
2962
|
if (e.length === 1) return () => e[0].output;
|
|
2839
2963
|
let t = e.map((e) => ({
|
|
2840
2964
|
output: e.output,
|
|
@@ -2872,28 +2996,28 @@ function ks(e) {
|
|
|
2872
2996
|
return b(i.output, a.output, o);
|
|
2873
2997
|
};
|
|
2874
2998
|
}
|
|
2875
|
-
function
|
|
2999
|
+
function qs(e) {
|
|
2876
3000
|
return e * e;
|
|
2877
3001
|
}
|
|
2878
|
-
function
|
|
3002
|
+
function Js(e) {
|
|
2879
3003
|
return -e * (e - 2);
|
|
2880
3004
|
}
|
|
2881
|
-
function
|
|
3005
|
+
function Ys(e) {
|
|
2882
3006
|
return (e /= .5) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1);
|
|
2883
3007
|
}
|
|
2884
|
-
function
|
|
3008
|
+
function Xs(e) {
|
|
2885
3009
|
return e * e * e;
|
|
2886
3010
|
}
|
|
2887
|
-
function
|
|
3011
|
+
function Zs(e) {
|
|
2888
3012
|
return --e * e * e + 1;
|
|
2889
3013
|
}
|
|
2890
|
-
function
|
|
3014
|
+
function Qs(e) {
|
|
2891
3015
|
return (e /= .5) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2);
|
|
2892
3016
|
}
|
|
2893
|
-
function
|
|
3017
|
+
function $s(e) {
|
|
2894
3018
|
return e * e * (3 - 2 * e);
|
|
2895
3019
|
}
|
|
2896
|
-
function
|
|
3020
|
+
function ec(e, t, n, r = 1e-6) {
|
|
2897
3021
|
let i = e;
|
|
2898
3022
|
for (let a = 0; a < 8; a++) {
|
|
2899
3023
|
let a = i * i, o = a * i, s = 1 - i, c = s * s, l = 3 * c * i * t + 3 * s * a * n + o - e;
|
|
@@ -2911,73 +3035,73 @@ function Ls(e, t, n, r = 1e-6) {
|
|
|
2911
3035
|
}
|
|
2912
3036
|
return i;
|
|
2913
3037
|
}
|
|
2914
|
-
var Z = (e, t, n, r) => (i) => i <= 0 ? 0 : i >= 1 ? 1 :
|
|
2915
|
-
function
|
|
3038
|
+
var Z = (e, t, n, r) => (i) => i <= 0 ? 0 : i >= 1 ? 1 : oe(ec(i, e, n), e, t, n, r)[1];
|
|
3039
|
+
function tc(e) {
|
|
2916
3040
|
return e = Z(.09, .91, .5, 1.5)(e), e;
|
|
2917
3041
|
}
|
|
2918
|
-
function
|
|
3042
|
+
function nc(e) {
|
|
2919
3043
|
return e = Z(.09, .91, .5, 1.5)(e), e;
|
|
2920
3044
|
}
|
|
2921
|
-
function
|
|
2922
|
-
return e =
|
|
3045
|
+
function rc(e) {
|
|
3046
|
+
return e = se(e, [
|
|
2923
3047
|
[0, 0],
|
|
2924
3048
|
[.026, 1.746],
|
|
2925
3049
|
[.633, 1.06],
|
|
2926
3050
|
[1, 0]
|
|
2927
3051
|
])[1], e;
|
|
2928
3052
|
}
|
|
2929
|
-
function
|
|
2930
|
-
return e =
|
|
3053
|
+
function ic(e) {
|
|
3054
|
+
return e = se(e, [
|
|
2931
3055
|
[0, 0],
|
|
2932
3056
|
[.367, .94],
|
|
2933
3057
|
[.974, .254],
|
|
2934
3058
|
[1, 0]
|
|
2935
3059
|
])[1], e;
|
|
2936
3060
|
}
|
|
2937
|
-
function
|
|
2938
|
-
return e =
|
|
3061
|
+
function ac(e) {
|
|
3062
|
+
return e = se(e, [
|
|
2939
3063
|
[0, 0],
|
|
2940
3064
|
[.026, 1.746],
|
|
2941
3065
|
[.633, 1.06],
|
|
2942
3066
|
[1, 0]
|
|
2943
3067
|
])[1], e;
|
|
2944
3068
|
}
|
|
2945
|
-
function
|
|
2946
|
-
return e =
|
|
3069
|
+
function oc(e) {
|
|
3070
|
+
return e = se(e, [
|
|
2947
3071
|
[0, 0],
|
|
2948
3072
|
[.026, 1.746],
|
|
2949
3073
|
[.633, 1.06],
|
|
2950
3074
|
[1, 0]
|
|
2951
3075
|
])[1], e;
|
|
2952
3076
|
}
|
|
2953
|
-
function
|
|
3077
|
+
function sc(e) {
|
|
2954
3078
|
return 1 - Math.cos(e * Math.PI / 2);
|
|
2955
3079
|
}
|
|
2956
|
-
function
|
|
3080
|
+
function cc(e) {
|
|
2957
3081
|
return Math.sin(e * Math.PI / 2);
|
|
2958
3082
|
}
|
|
2959
|
-
function
|
|
3083
|
+
function lc(e) {
|
|
2960
3084
|
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
2961
3085
|
}
|
|
2962
|
-
function
|
|
3086
|
+
function uc(e) {
|
|
2963
3087
|
return 1 - Math.sqrt(1 - e * e);
|
|
2964
3088
|
}
|
|
2965
|
-
function
|
|
3089
|
+
function dc(e) {
|
|
2966
3090
|
return Math.sqrt(1 - --e * e);
|
|
2967
3091
|
}
|
|
2968
|
-
function
|
|
3092
|
+
function fc(e) {
|
|
2969
3093
|
return (e /= .5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
|
|
2970
3094
|
}
|
|
2971
|
-
function
|
|
3095
|
+
function pc(e) {
|
|
2972
3096
|
return e === 0 ? 0 : 2 ** (10 * (e - 1));
|
|
2973
3097
|
}
|
|
2974
|
-
function
|
|
3098
|
+
function mc(e) {
|
|
2975
3099
|
return e === 1 ? 1 : 1 - 2 ** (-10 * e);
|
|
2976
3100
|
}
|
|
2977
|
-
function
|
|
3101
|
+
function hc(e) {
|
|
2978
3102
|
return e === 0 ? 0 : e === 1 ? 1 : (e /= .5) < 1 ? .5 * 2 ** (10 * (e - 1)) : .5 * (2 - 2 ** (-10 * --e));
|
|
2979
3103
|
}
|
|
2980
|
-
var
|
|
3104
|
+
var gc = [
|
|
2981
3105
|
"jump-start",
|
|
2982
3106
|
"jump-end",
|
|
2983
3107
|
"jump-none",
|
|
@@ -2986,36 +3110,36 @@ var $s = [
|
|
|
2986
3110
|
"end",
|
|
2987
3111
|
"both"
|
|
2988
3112
|
];
|
|
2989
|
-
function
|
|
3113
|
+
function _c(e, t) {
|
|
2990
3114
|
return Math.ceil(e * t) / t;
|
|
2991
3115
|
}
|
|
2992
|
-
function
|
|
3116
|
+
function vc(e, t) {
|
|
2993
3117
|
return Math.floor(e * t) / t;
|
|
2994
3118
|
}
|
|
2995
|
-
function
|
|
3119
|
+
function yc(e, t) {
|
|
2996
3120
|
return Math.floor(e * (t + 1)) / (t + 1);
|
|
2997
3121
|
}
|
|
2998
|
-
function
|
|
3122
|
+
function bc(e, t) {
|
|
2999
3123
|
return t <= 1 ? e : Math.floor(e * (t - 1)) / (t - 1);
|
|
3000
3124
|
}
|
|
3001
|
-
function
|
|
3125
|
+
function xc(e, t = "jump-end") {
|
|
3002
3126
|
switch (t) {
|
|
3003
|
-
case "jump-none": return (t) =>
|
|
3127
|
+
case "jump-none": return (t) => bc(t, e);
|
|
3004
3128
|
case "jump-start":
|
|
3005
|
-
case "start": return (t) =>
|
|
3129
|
+
case "start": return (t) => _c(t, e);
|
|
3006
3130
|
case "jump-end":
|
|
3007
|
-
case "end": return (t) =>
|
|
3131
|
+
case "end": return (t) => vc(t, e);
|
|
3008
3132
|
case "jump-both":
|
|
3009
|
-
case "both": return (t) =>
|
|
3133
|
+
case "both": return (t) => yc(t, e);
|
|
3010
3134
|
}
|
|
3011
3135
|
}
|
|
3012
|
-
function
|
|
3013
|
-
return
|
|
3136
|
+
function Sc() {
|
|
3137
|
+
return xc(1, "jump-start");
|
|
3014
3138
|
}
|
|
3015
|
-
function
|
|
3016
|
-
return
|
|
3139
|
+
function Cc() {
|
|
3140
|
+
return xc(1, "jump-end");
|
|
3017
3141
|
}
|
|
3018
|
-
var
|
|
3142
|
+
var wc = {
|
|
3019
3143
|
linear: [
|
|
3020
3144
|
0,
|
|
3021
3145
|
0,
|
|
@@ -3154,7 +3278,7 @@ var sc = {
|
|
|
3154
3278
|
.265,
|
|
3155
3279
|
1.55
|
|
3156
3280
|
]
|
|
3157
|
-
},
|
|
3281
|
+
}, Tc = {
|
|
3158
3282
|
"cubic-bezier": "custom curve",
|
|
3159
3283
|
linear: "constant velocity",
|
|
3160
3284
|
ease: "gentle start & end",
|
|
@@ -3189,65 +3313,65 @@ var sc = {
|
|
|
3189
3313
|
steps: "discrete jumps",
|
|
3190
3314
|
"step-start": "jump at start",
|
|
3191
3315
|
"step-end": "jump at end"
|
|
3192
|
-
},
|
|
3193
|
-
linear:
|
|
3194
|
-
easeInQuad:
|
|
3195
|
-
"ease-in-quad":
|
|
3196
|
-
easeOutQuad:
|
|
3197
|
-
"ease-out-quad":
|
|
3198
|
-
easeInOutQuad:
|
|
3199
|
-
"ease-in-out-quad":
|
|
3200
|
-
easeInCubic:
|
|
3201
|
-
"ease-in-cubic":
|
|
3202
|
-
easeOutCubic:
|
|
3203
|
-
"ease-out-cubic":
|
|
3204
|
-
easeInOutCubic:
|
|
3205
|
-
"ease-in-out-cubic":
|
|
3206
|
-
easeInBounce:
|
|
3207
|
-
"ease-in-bounce":
|
|
3208
|
-
bounceInEase:
|
|
3209
|
-
"bounce-in-ease":
|
|
3210
|
-
bounceInEaseHalf:
|
|
3211
|
-
"bounce-in-ease-half":
|
|
3212
|
-
bounceOutEase:
|
|
3213
|
-
"bounce-out-ease":
|
|
3214
|
-
bounceOutEaseHalf:
|
|
3215
|
-
"bounce-out-ease-half":
|
|
3216
|
-
bounceInOutEase:
|
|
3217
|
-
"bounce-in-out-ease":
|
|
3218
|
-
easeInSine:
|
|
3219
|
-
"ease-in-sine":
|
|
3220
|
-
easeOutSine:
|
|
3221
|
-
"ease-out-sine":
|
|
3222
|
-
easeInOutSine:
|
|
3223
|
-
"ease-in-out-sine":
|
|
3224
|
-
easeInCirc:
|
|
3225
|
-
"ease-in-circ":
|
|
3226
|
-
easeOutCirc:
|
|
3227
|
-
"ease-out-circ":
|
|
3228
|
-
easeInOutCirc:
|
|
3229
|
-
"ease-in-out-circ":
|
|
3230
|
-
easeInExpo:
|
|
3231
|
-
"ease-in-expo":
|
|
3232
|
-
easeOutExpo:
|
|
3233
|
-
"ease-out-expo":
|
|
3234
|
-
easeInOutExpo:
|
|
3235
|
-
"ease-in-out-expo":
|
|
3236
|
-
smoothStep3:
|
|
3237
|
-
"smooth-step-3":
|
|
3238
|
-
ease: Z(...
|
|
3239
|
-
"ease-in": Z(...
|
|
3240
|
-
"ease-out": Z(...
|
|
3241
|
-
"ease-in-out": Z(...
|
|
3242
|
-
"ease-in-back": Z(...
|
|
3243
|
-
"ease-out-back": Z(...
|
|
3244
|
-
"ease-in-out-back": Z(...
|
|
3245
|
-
steps:
|
|
3246
|
-
"step-start":
|
|
3247
|
-
"step-end":
|
|
3248
|
-
}, Q =
|
|
3249
|
-
|
|
3250
|
-
var
|
|
3316
|
+
}, Ec = {
|
|
3317
|
+
linear: Gs,
|
|
3318
|
+
easeInQuad: qs,
|
|
3319
|
+
"ease-in-quad": qs,
|
|
3320
|
+
easeOutQuad: Js,
|
|
3321
|
+
"ease-out-quad": Js,
|
|
3322
|
+
easeInOutQuad: Ys,
|
|
3323
|
+
"ease-in-out-quad": Ys,
|
|
3324
|
+
easeInCubic: Xs,
|
|
3325
|
+
"ease-in-cubic": Xs,
|
|
3326
|
+
easeOutCubic: Zs,
|
|
3327
|
+
"ease-out-cubic": Zs,
|
|
3328
|
+
easeInOutCubic: Qs,
|
|
3329
|
+
"ease-in-out-cubic": Qs,
|
|
3330
|
+
easeInBounce: tc,
|
|
3331
|
+
"ease-in-bounce": tc,
|
|
3332
|
+
bounceInEase: nc,
|
|
3333
|
+
"bounce-in-ease": nc,
|
|
3334
|
+
bounceInEaseHalf: rc,
|
|
3335
|
+
"bounce-in-ease-half": rc,
|
|
3336
|
+
bounceOutEase: ic,
|
|
3337
|
+
"bounce-out-ease": ic,
|
|
3338
|
+
bounceOutEaseHalf: ac,
|
|
3339
|
+
"bounce-out-ease-half": ac,
|
|
3340
|
+
bounceInOutEase: oc,
|
|
3341
|
+
"bounce-in-out-ease": oc,
|
|
3342
|
+
easeInSine: sc,
|
|
3343
|
+
"ease-in-sine": sc,
|
|
3344
|
+
easeOutSine: cc,
|
|
3345
|
+
"ease-out-sine": cc,
|
|
3346
|
+
easeInOutSine: lc,
|
|
3347
|
+
"ease-in-out-sine": lc,
|
|
3348
|
+
easeInCirc: uc,
|
|
3349
|
+
"ease-in-circ": uc,
|
|
3350
|
+
easeOutCirc: dc,
|
|
3351
|
+
"ease-out-circ": dc,
|
|
3352
|
+
easeInOutCirc: fc,
|
|
3353
|
+
"ease-in-out-circ": fc,
|
|
3354
|
+
easeInExpo: pc,
|
|
3355
|
+
"ease-in-expo": pc,
|
|
3356
|
+
easeOutExpo: mc,
|
|
3357
|
+
"ease-out-expo": mc,
|
|
3358
|
+
easeInOutExpo: hc,
|
|
3359
|
+
"ease-in-out-expo": hc,
|
|
3360
|
+
smoothStep3: $s,
|
|
3361
|
+
"smooth-step-3": $s,
|
|
3362
|
+
ease: Z(...wc.ease),
|
|
3363
|
+
"ease-in": Z(...wc["ease-in"]),
|
|
3364
|
+
"ease-out": Z(...wc["ease-out"]),
|
|
3365
|
+
"ease-in-out": Z(...wc["ease-in-out"]),
|
|
3366
|
+
"ease-in-back": Z(...wc["ease-in-back"]),
|
|
3367
|
+
"ease-out-back": Z(...wc["ease-out-back"]),
|
|
3368
|
+
"ease-in-out-back": Z(...wc["ease-in-out-back"]),
|
|
3369
|
+
steps: xc,
|
|
3370
|
+
"step-start": Sc,
|
|
3371
|
+
"step-end": Cc
|
|
3372
|
+
}, Q = o, Dc = a("{"), Oc = a("}");
|
|
3373
|
+
a("("), a(")"), a("["), a("]");
|
|
3374
|
+
var kc = a(";"), Ac = a(":"), jc = a(","), Mc = a("@"), Nc = i(/--[a-zA-Z_][a-zA-Z0-9_-]*/), Pc = n(Nc, vi), Fc = (e) => e.replace(/\/\*[\s\S]*?\*\//g, ""), Ic = (t) => new e((e) => {
|
|
3251
3375
|
let n = e.src, r = e.offset, i = r, a = 0, o = 0, s = 0, c = null;
|
|
3252
3376
|
for (; i < n.length;) {
|
|
3253
3377
|
let e = n[i];
|
|
@@ -3295,53 +3419,53 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3295
3419
|
}
|
|
3296
3420
|
let l = n.slice(r, i);
|
|
3297
3421
|
return e.ok(l, i - r);
|
|
3298
|
-
}),
|
|
3422
|
+
}), Lc = Ic((e, t) => {
|
|
3299
3423
|
let n = e[t];
|
|
3300
3424
|
return n === ";" || n === "}" ? !0 : n === "!" ? /^!important\b/i.test(e.slice(t)) : !1;
|
|
3301
|
-
}),
|
|
3425
|
+
}), Rc = Ic((e, t) => e[t] === "{"), zc = Ic((e, t) => e[t] === "}"), Bc = Ic((e, t) => {
|
|
3302
3426
|
let n = e[t];
|
|
3303
3427
|
return n === "{" || n === ";";
|
|
3304
|
-
}),
|
|
3428
|
+
}), Vc = a("!").skip(Q).next(R("important")).map(() => !0), Hc = (e) => {
|
|
3305
3429
|
let t = e.trim();
|
|
3306
|
-
if (t.length === 0) return new
|
|
3307
|
-
let n =
|
|
3430
|
+
if (t.length === 0) return new Wa();
|
|
3431
|
+
let n = Ci(_o.Values, t);
|
|
3308
3432
|
if (n.status && Array.isArray(n.value) && n.value.length > 0) {
|
|
3309
3433
|
let e = [];
|
|
3310
3434
|
for (let t of n.value) if (Array.isArray(t)) for (let n of t) e.push(n);
|
|
3311
3435
|
else e.push(t);
|
|
3312
|
-
return new
|
|
3436
|
+
return new Wa(...e);
|
|
3313
3437
|
}
|
|
3314
|
-
return new
|
|
3315
|
-
},
|
|
3316
|
-
let r =
|
|
3438
|
+
return new Wa(new J(t, "string"));
|
|
3439
|
+
}, Uc = t(Pc.skip(Ac.trim(Q)), Lc, Vc.opt()).skip(kc.opt()).trim(Q).map(([e, t, n]) => {
|
|
3440
|
+
let r = Hc(t);
|
|
3317
3441
|
return r.setProperty(e), {
|
|
3318
3442
|
name: e,
|
|
3319
3443
|
value: r,
|
|
3320
3444
|
important: n === !0
|
|
3321
3445
|
};
|
|
3322
|
-
}).many(),
|
|
3446
|
+
}).many(), Wc = n(R("entry"), R("exit"), R("cover"), R("contain")).map((e) => ({
|
|
3323
3447
|
kind: "named",
|
|
3324
3448
|
name: e.toLowerCase()
|
|
3325
|
-
})),
|
|
3449
|
+
})), Gc = R("from").map(() => ({
|
|
3326
3450
|
kind: "percent",
|
|
3327
3451
|
value: 0
|
|
3328
|
-
})),
|
|
3452
|
+
})), Kc = R("to").map(() => ({
|
|
3329
3453
|
kind: "percent",
|
|
3330
3454
|
value: 100
|
|
3331
|
-
})),
|
|
3455
|
+
})), qc = n(V.Percentage.map((e) => ({
|
|
3332
3456
|
kind: "percent",
|
|
3333
3457
|
value: Number(e.valueOf())
|
|
3334
|
-
})),
|
|
3458
|
+
})), Gc, Kc, Wc, z.map((e) => ({
|
|
3335
3459
|
kind: "percent",
|
|
3336
3460
|
value: e
|
|
3337
|
-
}))).trim(Q).sepBy(
|
|
3461
|
+
}))).trim(Q).sepBy(jc.trim(Q)), Jc = "animation-timing-function", Yc = "animation-composition", Xc = (e) => {
|
|
3338
3462
|
let t = { declarations: [] };
|
|
3339
3463
|
for (let n of e) if (!n.important) {
|
|
3340
|
-
if (n.name ===
|
|
3464
|
+
if (n.name === Jc) {
|
|
3341
3465
|
t.timingFunction = n.value.toString().trim();
|
|
3342
3466
|
continue;
|
|
3343
3467
|
}
|
|
3344
|
-
if (n.name ===
|
|
3468
|
+
if (n.name === Yc) {
|
|
3345
3469
|
let e = n.value.toString().trim().toLowerCase();
|
|
3346
3470
|
(e === "replace" || e === "add" || e === "accumulate") && (t.composition = e);
|
|
3347
3471
|
continue;
|
|
@@ -3349,13 +3473,13 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3349
3473
|
t.declarations.push(n);
|
|
3350
3474
|
}
|
|
3351
3475
|
return t;
|
|
3352
|
-
},
|
|
3353
|
-
let n =
|
|
3476
|
+
}, Zc = t(qc, Uc.trim(Q).wrap(Dc.trim(Q), Oc.trim(Q))).trim(Q).map(([e, t]) => {
|
|
3477
|
+
let n = Xc(t), r = {
|
|
3354
3478
|
selectors: e,
|
|
3355
3479
|
declarations: n.declarations
|
|
3356
3480
|
};
|
|
3357
3481
|
return n.timingFunction != null && (r.timingFunction = n.timingFunction), n.composition != null && (r.composition = n.composition), r;
|
|
3358
|
-
}),
|
|
3482
|
+
}), Qc = t(vi.trim(Q).opt(), Zc.many().trim(Q).wrap(Dc.trim(Q), Oc.trim(Q))).map((e) => {
|
|
3359
3483
|
let t = e[e.length - 1], n = e.length === 2 ? e[0] : void 0;
|
|
3360
3484
|
return n == null ? {
|
|
3361
3485
|
kind: "keyframes",
|
|
@@ -3365,15 +3489,15 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3365
3489
|
name: n,
|
|
3366
3490
|
rules: t
|
|
3367
3491
|
};
|
|
3368
|
-
}),
|
|
3492
|
+
}), $c = (e) => {
|
|
3369
3493
|
let t = {};
|
|
3370
3494
|
for (let n of e) n.name === "syntax" ? t.syntax = n.value.toString().trim().replace(/^["']|["']$/g, "") : n.name === "inherits" ? t.inherits = n.value.toString().trim().toLowerCase() === "true" : n.name === "initial-value" && (t.initialValue = n.value);
|
|
3371
3495
|
return t;
|
|
3372
|
-
},
|
|
3496
|
+
}, el = t(Nc.trim(Q), Uc.trim(Q).wrap(Dc.trim(Q), Oc.trim(Q))).map(([e, t]) => ({
|
|
3373
3497
|
kind: "property",
|
|
3374
3498
|
name: e,
|
|
3375
|
-
descriptor:
|
|
3376
|
-
})),
|
|
3499
|
+
descriptor: $c(t)
|
|
3500
|
+
})), tl = (e) => {
|
|
3377
3501
|
let t = [], n = 0, r = null, i = "";
|
|
3378
3502
|
for (let a = 0; a < e.length; a++) {
|
|
3379
3503
|
let o = e[a];
|
|
@@ -3406,19 +3530,19 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3406
3530
|
}
|
|
3407
3531
|
let a = i.trim();
|
|
3408
3532
|
return a.length > 0 && t.push(a), t;
|
|
3409
|
-
},
|
|
3533
|
+
}, nl = t(Rc, Uc.trim(Q).wrap(Dc.trim(Q), Oc.trim(Q))).trim(Q).map(([e, t]) => ({
|
|
3410
3534
|
kind: "style",
|
|
3411
|
-
selectors:
|
|
3535
|
+
selectors: tl(e),
|
|
3412
3536
|
declarations: t
|
|
3413
|
-
})),
|
|
3537
|
+
})), rl = (e) => t(Bc.map((e) => e.trim()), n(kc.map(() => null), zc.wrap(Dc.trim(Q), Oc.trim(Q)))).map(([t, n]) => ({
|
|
3414
3538
|
kind: "unknown",
|
|
3415
3539
|
atName: e,
|
|
3416
3540
|
prelude: t,
|
|
3417
3541
|
body: n
|
|
3418
|
-
})),
|
|
3542
|
+
})), il = n(Mc.next(vi).chain((e) => {
|
|
3419
3543
|
let t = e.toLowerCase();
|
|
3420
|
-
return t === "keyframes" ?
|
|
3421
|
-
}),
|
|
3544
|
+
return t === "keyframes" ? Qc : t === "property" ? el : rl(t);
|
|
3545
|
+
}), nl).trim(Q).many().trim(Q).skip(new e((e) => e.offset >= e.src.length ? e.ok(null, 0) : e.err(void 0, 0))), al = h((e) => B(il, Fc(e)), { keyFn: (e) => e }), ol = (e) => {
|
|
3422
3546
|
let t = [], n = "", r = 0, i = null, a = () => {
|
|
3423
3547
|
let e = n.trim();
|
|
3424
3548
|
e.length > 0 && t.push(e), n = "";
|
|
@@ -3452,7 +3576,7 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3452
3576
|
n += o;
|
|
3453
3577
|
}
|
|
3454
3578
|
return a(), t;
|
|
3455
|
-
},
|
|
3579
|
+
}, sl = /^-?(?:\d+\.?\d*|\.\d+)(?:s|ms)$/i, cl = /^\d+\.?\d*$/, ll = new Set([
|
|
3456
3580
|
"linear",
|
|
3457
3581
|
"ease",
|
|
3458
3582
|
"ease-in",
|
|
@@ -3460,35 +3584,35 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3460
3584
|
"ease-in-out",
|
|
3461
3585
|
"step-start",
|
|
3462
3586
|
"step-end"
|
|
3463
|
-
]),
|
|
3587
|
+
]), ul = new Set([
|
|
3464
3588
|
"cubic-bezier",
|
|
3465
3589
|
"steps",
|
|
3466
3590
|
"linear"
|
|
3467
|
-
]),
|
|
3591
|
+
]), dl = new Set([
|
|
3468
3592
|
"normal",
|
|
3469
3593
|
"reverse",
|
|
3470
3594
|
"alternate",
|
|
3471
3595
|
"alternate-reverse"
|
|
3472
|
-
]),
|
|
3596
|
+
]), fl = new Set([
|
|
3473
3597
|
"none",
|
|
3474
3598
|
"forwards",
|
|
3475
3599
|
"backwards",
|
|
3476
3600
|
"both"
|
|
3477
|
-
]),
|
|
3601
|
+
]), pl = new Set([
|
|
3478
3602
|
"replace",
|
|
3479
3603
|
"add",
|
|
3480
3604
|
"accumulate"
|
|
3481
|
-
]),
|
|
3605
|
+
]), ml = new Set(["running", "paused"]), hl = (e) => {
|
|
3482
3606
|
let t = e.toLowerCase();
|
|
3483
|
-
if (
|
|
3607
|
+
if (ll.has(t)) return !0;
|
|
3484
3608
|
let n = t.split("(", 1)[0];
|
|
3485
|
-
return
|
|
3486
|
-
},
|
|
3487
|
-
let t = {}, n =
|
|
3609
|
+
return ul.has(n);
|
|
3610
|
+
}, gl = (e) => /^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e), _l = (e) => {
|
|
3611
|
+
let t = {}, n = ol(e), r = 0, i = !1;
|
|
3488
3612
|
for (let e of n) {
|
|
3489
3613
|
let n = e.toLowerCase();
|
|
3490
|
-
if (
|
|
3491
|
-
let n =
|
|
3614
|
+
if (sl.test(e)) {
|
|
3615
|
+
let n = bo(e);
|
|
3492
3616
|
r === 0 ? t.duration = n : r === 1 && (t.delay = n), r++;
|
|
3493
3617
|
continue;
|
|
3494
3618
|
}
|
|
@@ -3496,42 +3620,42 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3496
3620
|
t.iterationCount = Infinity;
|
|
3497
3621
|
continue;
|
|
3498
3622
|
}
|
|
3499
|
-
if (
|
|
3623
|
+
if (cl.test(e)) {
|
|
3500
3624
|
let n = Number(e);
|
|
3501
3625
|
if (Number.isFinite(n) && n >= 0) {
|
|
3502
3626
|
t.iterationCount = n;
|
|
3503
3627
|
continue;
|
|
3504
3628
|
}
|
|
3505
3629
|
}
|
|
3506
|
-
if (
|
|
3630
|
+
if (dl.has(n)) {
|
|
3507
3631
|
t.direction = n;
|
|
3508
3632
|
continue;
|
|
3509
3633
|
}
|
|
3510
|
-
if (
|
|
3634
|
+
if (fl.has(n) && i) {
|
|
3511
3635
|
t.fillMode = n;
|
|
3512
3636
|
continue;
|
|
3513
3637
|
}
|
|
3514
|
-
if (
|
|
3638
|
+
if (fl.has(n) && n !== "none") {
|
|
3515
3639
|
t.fillMode = n;
|
|
3516
3640
|
continue;
|
|
3517
3641
|
}
|
|
3518
|
-
if (
|
|
3642
|
+
if (pl.has(n)) {
|
|
3519
3643
|
t.composition = n;
|
|
3520
3644
|
continue;
|
|
3521
3645
|
}
|
|
3522
|
-
if (!
|
|
3523
|
-
if (
|
|
3646
|
+
if (!ml.has(n)) {
|
|
3647
|
+
if (hl(e) && t.timingFunction == null) {
|
|
3524
3648
|
t.timingFunction = e;
|
|
3525
3649
|
continue;
|
|
3526
3650
|
}
|
|
3527
|
-
if (!i &&
|
|
3651
|
+
if (!i && gl(e)) {
|
|
3528
3652
|
t.name = e, i = !0;
|
|
3529
3653
|
continue;
|
|
3530
3654
|
}
|
|
3531
3655
|
}
|
|
3532
3656
|
}
|
|
3533
3657
|
return t;
|
|
3534
|
-
},
|
|
3658
|
+
}, vl = h((e) => yl(e).map((e) => _l(e)), { keyFn: (e) => e }), yl = (e) => {
|
|
3535
3659
|
let t = [], n = "", r = 0, i = null;
|
|
3536
3660
|
for (let a = 0; a < e.length; a++) {
|
|
3537
3661
|
let o = e[a];
|
|
@@ -3564,10 +3688,10 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3564
3688
|
}
|
|
3565
3689
|
let a = n.trim();
|
|
3566
3690
|
return a.length > 0 && t.push(a), t;
|
|
3567
|
-
},
|
|
3691
|
+
}, bl = (e) => {
|
|
3568
3692
|
let t = [];
|
|
3569
|
-
return e.duration != null && t.push(
|
|
3570
|
-
},
|
|
3693
|
+
return e.duration != null && t.push(xl(e.duration)), e.timingFunction != null && t.push(e.timingFunction), e.delay != null && t.push(xl(e.delay)), e.iterationCount != null && t.push(e.iterationCount === Infinity ? "infinite" : String(e.iterationCount)), e.direction != null && t.push(e.direction), e.fillMode != null && t.push(e.fillMode), e.composition != null && t.push(e.composition), e.name != null && t.push(e.name), t.join(" ");
|
|
3694
|
+
}, xl = (e) => e >= 5e3 && e % 1e3 == 0 || e >= 1e3 && e % 1 == 0 && e < 5e3 ? `${e / 1e3}s` : `${e}ms`, Sl = (e) => {
|
|
3571
3695
|
let t = /* @__PURE__ */ new Map();
|
|
3572
3696
|
for (let n of e) {
|
|
3573
3697
|
if (n.kind !== "keyframes") continue;
|
|
@@ -3575,46 +3699,46 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3575
3699
|
r ? r.push(...n.rules) : t.set(e, [...n.rules]);
|
|
3576
3700
|
}
|
|
3577
3701
|
return t;
|
|
3578
|
-
},
|
|
3702
|
+
}, Cl = (e) => {
|
|
3579
3703
|
let t = /* @__PURE__ */ new Map();
|
|
3580
3704
|
for (let n of e) n.kind === "property" && t.set(n.name, n.descriptor);
|
|
3581
3705
|
return t;
|
|
3582
|
-
},
|
|
3706
|
+
}, wl = (e) => {
|
|
3583
3707
|
let t = [];
|
|
3584
3708
|
for (let n of e) n.kind === "style" && t.push({
|
|
3585
3709
|
selectors: n.selectors,
|
|
3586
3710
|
declarations: n.declarations
|
|
3587
3711
|
});
|
|
3588
3712
|
return t;
|
|
3589
|
-
},
|
|
3713
|
+
}, Tl = new Set([
|
|
3590
3714
|
"normal",
|
|
3591
3715
|
"reverse",
|
|
3592
3716
|
"alternate",
|
|
3593
3717
|
"alternate-reverse"
|
|
3594
|
-
]),
|
|
3718
|
+
]), El = new Set([
|
|
3595
3719
|
"none",
|
|
3596
3720
|
"forwards",
|
|
3597
3721
|
"backwards",
|
|
3598
3722
|
"both"
|
|
3599
|
-
]),
|
|
3723
|
+
]), Dl = new Set([
|
|
3600
3724
|
"replace",
|
|
3601
3725
|
"add",
|
|
3602
3726
|
"accumulate"
|
|
3603
|
-
]),
|
|
3727
|
+
]), Ol = (e) => {
|
|
3604
3728
|
try {
|
|
3605
|
-
return
|
|
3729
|
+
return bo(e);
|
|
3606
3730
|
} catch {
|
|
3607
3731
|
return;
|
|
3608
3732
|
}
|
|
3609
|
-
},
|
|
3733
|
+
}, kl = (e) => {
|
|
3610
3734
|
let t = e.trim().toLowerCase();
|
|
3611
3735
|
if (t === "infinite") return Infinity;
|
|
3612
3736
|
let n = Number(t);
|
|
3613
3737
|
return Number.isFinite(n) && n >= 0 ? n : void 0;
|
|
3614
|
-
},
|
|
3738
|
+
}, Al = (e, t, n) => {
|
|
3615
3739
|
let r = n.trim();
|
|
3616
3740
|
if (t === "animation") {
|
|
3617
|
-
let t =
|
|
3741
|
+
let t = vl(r)[0];
|
|
3618
3742
|
t != null && Object.assign(e, t);
|
|
3619
3743
|
return;
|
|
3620
3744
|
}
|
|
@@ -3623,28 +3747,28 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3623
3747
|
e.name = r;
|
|
3624
3748
|
return;
|
|
3625
3749
|
case "animation-duration": {
|
|
3626
|
-
let t =
|
|
3750
|
+
let t = Ol(r);
|
|
3627
3751
|
t != null && (e.duration = t);
|
|
3628
3752
|
return;
|
|
3629
3753
|
}
|
|
3630
3754
|
case "animation-delay": {
|
|
3631
|
-
let t =
|
|
3755
|
+
let t = Ol(r);
|
|
3632
3756
|
t != null && (e.delay = t);
|
|
3633
3757
|
return;
|
|
3634
3758
|
}
|
|
3635
3759
|
case "animation-iteration-count": {
|
|
3636
|
-
let t =
|
|
3760
|
+
let t = kl(r);
|
|
3637
3761
|
t != null && (e.iterationCount = t);
|
|
3638
3762
|
return;
|
|
3639
3763
|
}
|
|
3640
3764
|
case "animation-direction": {
|
|
3641
3765
|
let t = r.toLowerCase();
|
|
3642
|
-
|
|
3766
|
+
Tl.has(t) && (e.direction = t);
|
|
3643
3767
|
return;
|
|
3644
3768
|
}
|
|
3645
3769
|
case "animation-fill-mode": {
|
|
3646
3770
|
let t = r.toLowerCase();
|
|
3647
|
-
|
|
3771
|
+
El.has(t) && (e.fillMode = t);
|
|
3648
3772
|
return;
|
|
3649
3773
|
}
|
|
3650
3774
|
case "animation-timing-function":
|
|
@@ -3652,60 +3776,60 @@ var fc = i(";"), pc = i(":"), mc = i(","), hc = i("@"), gc = r(/--[a-zA-Z_][a-zA
|
|
|
3652
3776
|
return;
|
|
3653
3777
|
case "animation-composition": {
|
|
3654
3778
|
let t = r.toLowerCase();
|
|
3655
|
-
|
|
3779
|
+
Dl.has(t) && (e.composition = t);
|
|
3656
3780
|
return;
|
|
3657
3781
|
}
|
|
3658
3782
|
}
|
|
3659
|
-
},
|
|
3783
|
+
}, jl = (e) => {
|
|
3660
3784
|
let t = {};
|
|
3661
|
-
for (let n of e) if (n.kind === "style") for (let e of n.declarations)
|
|
3785
|
+
for (let n of e) if (n.kind === "style") for (let e of n.declarations) Al(t, e.name, e.value.toString());
|
|
3662
3786
|
return t;
|
|
3663
|
-
},
|
|
3787
|
+
}, Ml = (e) => e.kind === "percent" ? `${e.value}%` : e.name, Nl = (e) => {
|
|
3664
3788
|
let t = e.value.toString(), n = e.important ? " !important" : "";
|
|
3665
3789
|
return `${e.name}: ${t}${n}`;
|
|
3666
|
-
},
|
|
3667
|
-
let t = e.selectors.map(
|
|
3790
|
+
}, Pl = (e) => {
|
|
3791
|
+
let t = e.selectors.map(Ml).join(", "), n = e.declarations.map(Nl);
|
|
3668
3792
|
return e.timingFunction != null && n.push(`animation-timing-function: ${e.timingFunction}`), e.composition != null && n.push(`animation-composition: ${e.composition}`), ` ${t} {\n${n.map((e) => ` ${e};`).join("\n")}\n }`;
|
|
3669
|
-
},
|
|
3793
|
+
}, Fl = (e) => `@keyframes${e.name == null ? "" : ` ${e.name}`} {\n${e.rules.map(Pl).join("\n")}\n}`, Il = (e) => {
|
|
3670
3794
|
let t = [];
|
|
3671
3795
|
return e.descriptor.syntax !== void 0 && t.push(` syntax: "${e.descriptor.syntax}";`), e.descriptor.inherits !== void 0 && t.push(` inherits: ${e.descriptor.inherits};`), e.descriptor.initialValue !== void 0 && t.push(` initial-value: ${e.descriptor.initialValue.toString()};`), `@property ${e.name} {\n${t.join("\n")}\n}`;
|
|
3672
|
-
},
|
|
3796
|
+
}, Ll = (e) => `${e.selectors.join(", ")} {\n${e.declarations.map((e) => ` ${Nl(e)};`).join("\n")}\n}`, Rl = (e) => {
|
|
3673
3797
|
let t = e.prelude.length > 0 ? ` ${e.prelude}` : "";
|
|
3674
3798
|
return e.body == null ? `@${e.atName}${t};` : `@${e.atName}${t} {\n${e.body.trim()}\n}`;
|
|
3675
|
-
},
|
|
3799
|
+
}, zl = (e) => {
|
|
3676
3800
|
switch (e.kind) {
|
|
3677
|
-
case "keyframes": return
|
|
3678
|
-
case "property": return
|
|
3679
|
-
case "style": return
|
|
3680
|
-
case "unknown": return
|
|
3681
|
-
}
|
|
3682
|
-
},
|
|
3683
|
-
async function
|
|
3684
|
-
let [n, r] = await Promise.all([import("./standalone-
|
|
3801
|
+
case "keyframes": return Fl(e);
|
|
3802
|
+
case "property": return Il(e);
|
|
3803
|
+
case "style": return Ll(e);
|
|
3804
|
+
case "unknown": return Rl(e);
|
|
3805
|
+
}
|
|
3806
|
+
}, Bl = (e) => e.map(zl).join("\n\n"), Vl = 80;
|
|
3807
|
+
async function Hl(e, t = Vl) {
|
|
3808
|
+
let [n, r] = await Promise.all([import("./standalone-DlyrSOeX.js"), import("./postcss-CWmVrHvs.js")]), i = (e) => e.default ?? e, a = i(n), o = i(r);
|
|
3685
3809
|
return await a.format(e, {
|
|
3686
3810
|
parser: "scss",
|
|
3687
3811
|
plugins: [o],
|
|
3688
3812
|
printWidth: t
|
|
3689
3813
|
});
|
|
3690
3814
|
}
|
|
3691
|
-
async function
|
|
3692
|
-
return
|
|
3815
|
+
async function Ul(e, t = Vl) {
|
|
3816
|
+
return Hl(Bl(e), t);
|
|
3693
3817
|
}
|
|
3694
|
-
var
|
|
3818
|
+
var Wl = {
|
|
3695
3819
|
k: 5,
|
|
3696
3820
|
maxIterations: 10,
|
|
3697
3821
|
targetPixels: 2e4,
|
|
3698
3822
|
chromaWeight: .5,
|
|
3699
|
-
dedupeThreshold:
|
|
3823
|
+
dedupeThreshold: Le
|
|
3700
3824
|
};
|
|
3701
|
-
function
|
|
3825
|
+
function Gl(e, t, n, r, i, a, o) {
|
|
3702
3826
|
let s = e - r, c = t - i, l = n - a, u = Math.sqrt(t * t + n * n);
|
|
3703
3827
|
return s * s + (1 + o * u) * (c * c + l * l);
|
|
3704
3828
|
}
|
|
3705
|
-
function
|
|
3829
|
+
function Kl(e, t, n) {
|
|
3706
3830
|
return `oklch(${(e * 100).toFixed(2).replace(/\.?0+$/, "")}% ${t.toFixed(4).replace(/\.?0+$/, "")} ${n.toFixed(2).replace(/\.?0+$/, "")})`;
|
|
3707
3831
|
}
|
|
3708
|
-
function
|
|
3832
|
+
function ql(e, t) {
|
|
3709
3833
|
let { pixels: n, count: r } = e, i = Infinity, a = -Infinity;
|
|
3710
3834
|
for (let e = 0; e < r; e++) {
|
|
3711
3835
|
let r = n[e * 3 + t];
|
|
@@ -3713,7 +3837,7 @@ function Al(e, t) {
|
|
|
3713
3837
|
}
|
|
3714
3838
|
return a - i;
|
|
3715
3839
|
}
|
|
3716
|
-
function
|
|
3840
|
+
function Jl(e) {
|
|
3717
3841
|
let { pixels: t, count: n } = e, r = 0, i = 0, a = 0;
|
|
3718
3842
|
for (let e = 0; e < n; e++) {
|
|
3719
3843
|
let n = e * 3;
|
|
@@ -3725,8 +3849,8 @@ function jl(e) {
|
|
|
3725
3849
|
a / n
|
|
3726
3850
|
];
|
|
3727
3851
|
}
|
|
3728
|
-
function
|
|
3729
|
-
let t =
|
|
3852
|
+
function Yl(e) {
|
|
3853
|
+
let t = ql(e, 0), n = ql(e, 1), r = ql(e, 2), i = 0;
|
|
3730
3854
|
n >= t && n >= r ? i = 1 : r >= t && r >= n && (i = 2);
|
|
3731
3855
|
let { pixels: a, count: o } = e, s = new Uint32Array(o);
|
|
3732
3856
|
for (let e = 0; e < o; e++) s[e] = e;
|
|
@@ -3745,9 +3869,9 @@ function Ml(e) {
|
|
|
3745
3869
|
count: o - l
|
|
3746
3870
|
}];
|
|
3747
3871
|
}
|
|
3748
|
-
function
|
|
3872
|
+
function Xl(e, t, n) {
|
|
3749
3873
|
if (n <= 1 || t === 0) return [{
|
|
3750
|
-
centroid: t > 0 ?
|
|
3874
|
+
centroid: t > 0 ? Jl({
|
|
3751
3875
|
pixels: e,
|
|
3752
3876
|
count: t
|
|
3753
3877
|
}) : [
|
|
@@ -3766,19 +3890,19 @@ function Nl(e, t, n) {
|
|
|
3766
3890
|
for (let n = 0; n < r.length; n++) {
|
|
3767
3891
|
let i = r[n];
|
|
3768
3892
|
if (i.count < 2) continue;
|
|
3769
|
-
let a =
|
|
3893
|
+
let a = ql(i, 0), o = ql(i, 1), s = ql(i, 2), c = Math.max(a, o, s);
|
|
3770
3894
|
c > t && (t = c, e = n);
|
|
3771
3895
|
}
|
|
3772
3896
|
if (t <= 0) break;
|
|
3773
|
-
let [n, i] =
|
|
3897
|
+
let [n, i] = Yl(r[e]);
|
|
3774
3898
|
r.splice(e, 1, n, i);
|
|
3775
3899
|
}
|
|
3776
3900
|
return r.map((e) => ({
|
|
3777
|
-
centroid:
|
|
3901
|
+
centroid: Jl(e),
|
|
3778
3902
|
population: e.count
|
|
3779
3903
|
}));
|
|
3780
3904
|
}
|
|
3781
|
-
function
|
|
3905
|
+
function Zl(e, t, n) {
|
|
3782
3906
|
let r = e.length;
|
|
3783
3907
|
if (r <= t) return e.map((e) => [...e.centroid]);
|
|
3784
3908
|
let i = [], a = new Float64Array(r).fill(Infinity), o = 0, s = 0;
|
|
@@ -3790,7 +3914,7 @@ function Pl(e, t, n) {
|
|
|
3790
3914
|
let c = i[0];
|
|
3791
3915
|
for (let t = 0; t < r; t++) {
|
|
3792
3916
|
let r = e[t].centroid;
|
|
3793
|
-
a[t] =
|
|
3917
|
+
a[t] = Gl(r[0], r[1], r[2], c[0], c[1], c[2], n);
|
|
3794
3918
|
}
|
|
3795
3919
|
for (let o = 1; o < t; o++) {
|
|
3796
3920
|
let t = 0;
|
|
@@ -3804,20 +3928,20 @@ function Pl(e, t, n) {
|
|
|
3804
3928
|
i.push([...e[c].centroid]);
|
|
3805
3929
|
let l = i[o];
|
|
3806
3930
|
for (let t = 0; t < r; t++) {
|
|
3807
|
-
let r = e[t].centroid, i =
|
|
3931
|
+
let r = e[t].centroid, i = Gl(r[0], r[1], r[2], l[0], l[1], l[2], n);
|
|
3808
3932
|
i < a[t] && (a[t] = i);
|
|
3809
3933
|
}
|
|
3810
3934
|
}
|
|
3811
3935
|
return i;
|
|
3812
3936
|
}
|
|
3813
|
-
function
|
|
3937
|
+
function Ql(e, t, n, r, i) {
|
|
3814
3938
|
let a = n.length, o = n.map((e) => [...e]), s = new Float64Array(a), c = new Float64Array(a), l = new Float64Array(a), u = new Float64Array(a), d = new Float64Array(a);
|
|
3815
3939
|
for (let n = 0; n < r; n++) {
|
|
3816
3940
|
c.fill(0), l.fill(0), u.fill(0), d.fill(0);
|
|
3817
3941
|
for (let n = 0; n < t; n++) {
|
|
3818
3942
|
let t = n * 3, r = e[t], s = e[t + 1], f = e[t + 2], p = 0, m = Infinity;
|
|
3819
3943
|
for (let e = 0; e < a; e++) {
|
|
3820
|
-
let t = o[e], n =
|
|
3944
|
+
let t = o[e], n = Gl(r, s, f, t[0], t[1], t[2], i);
|
|
3821
3945
|
n < m && (m = n, p = e);
|
|
3822
3946
|
}
|
|
3823
3947
|
c[p] = c[p] + r, l[p] = l[p] + s, u[p] = u[p] + f, d[p] = d[p] + 1;
|
|
@@ -3827,7 +3951,7 @@ function Fl(e, t, n, r, i) {
|
|
|
3827
3951
|
let t = d[e];
|
|
3828
3952
|
if (t === 0) continue;
|
|
3829
3953
|
let r = c[e] / t, i = l[e] / t, a = u[e] / t, f = o[e];
|
|
3830
|
-
|
|
3954
|
+
Gl(f[0], f[1], f[2], r, i, a, 0) > 1e-10 && (n = !1), f[0] = r, f[1] = i, f[2] = a, s[e] = t;
|
|
3831
3955
|
}
|
|
3832
3956
|
if (n) break;
|
|
3833
3957
|
}
|
|
@@ -3837,7 +3961,7 @@ function Fl(e, t, n, r, i) {
|
|
|
3837
3961
|
populations: Array.from(s)
|
|
3838
3962
|
};
|
|
3839
3963
|
}
|
|
3840
|
-
function
|
|
3964
|
+
function $l(e, t, n) {
|
|
3841
3965
|
let r = e.length, i = Array(r).fill(!1), a = [], o = [];
|
|
3842
3966
|
for (let s = 0; s < r; s++) {
|
|
3843
3967
|
if (i[s]) continue;
|
|
@@ -3845,7 +3969,7 @@ function Il(e, t, n) {
|
|
|
3845
3969
|
for (let a = s + 1; a < r; a++) {
|
|
3846
3970
|
if (i[a]) continue;
|
|
3847
3971
|
let r = e[a], o = t[a];
|
|
3848
|
-
|
|
3972
|
+
Re(c[0], c[1], c[2], r[0], r[1], r[2]) < n && (i[a] = !0, d += r[0] * o, f += r[1] * o, p += r[2] * o, u += o);
|
|
3849
3973
|
}
|
|
3850
3974
|
u > 0 ? a.push([
|
|
3851
3975
|
d / u,
|
|
@@ -3862,15 +3986,15 @@ function Il(e, t, n) {
|
|
|
3862
3986
|
populations: o
|
|
3863
3987
|
};
|
|
3864
3988
|
}
|
|
3865
|
-
function
|
|
3989
|
+
function eu(e, t) {
|
|
3866
3990
|
let n = Math.abs(e - t);
|
|
3867
3991
|
return n > 180 ? 360 - n : n;
|
|
3868
3992
|
}
|
|
3869
|
-
function
|
|
3870
|
-
let n =
|
|
3993
|
+
function tu(e, t) {
|
|
3994
|
+
let n = eu(e.oklch[2], t.oklch[2]) / 180, r = Math.abs(e.oklch[0] - t.oklch[0]), i = Math.abs(e.oklch[1] - t.oklch[1]) / .4;
|
|
3871
3995
|
return 1.5 * n + 1 * r + .5 * i;
|
|
3872
3996
|
}
|
|
3873
|
-
function
|
|
3997
|
+
function nu(e) {
|
|
3874
3998
|
if (e.length <= 2) return e;
|
|
3875
3999
|
let t = 0;
|
|
3876
4000
|
for (let n = 1; n < e.length; n++) e[n].oklch[0] < e[t].oklch[0] && (t = n);
|
|
@@ -3879,16 +4003,16 @@ function zl(e) {
|
|
|
3879
4003
|
let i = n[t - 1], a = -1, o = Infinity;
|
|
3880
4004
|
for (let t = 0; t < e.length; t++) {
|
|
3881
4005
|
if (r.has(t)) continue;
|
|
3882
|
-
let n =
|
|
4006
|
+
let n = tu(i, e[t]);
|
|
3883
4007
|
n < o && (o = n, a = t);
|
|
3884
4008
|
}
|
|
3885
4009
|
n.push(e[a]), r.add(a);
|
|
3886
4010
|
}
|
|
3887
4011
|
return n;
|
|
3888
4012
|
}
|
|
3889
|
-
function
|
|
4013
|
+
function ru(e, t, n, r) {
|
|
3890
4014
|
let i = {
|
|
3891
|
-
...
|
|
4015
|
+
...Wl,
|
|
3892
4016
|
...r
|
|
3893
4017
|
}, a = Math.max(1, Math.min(16, i.k)), o = t * n;
|
|
3894
4018
|
if (o === 0) return [];
|
|
@@ -3896,14 +4020,14 @@ function Bl(e, t, n, r) {
|
|
|
3896
4020
|
for (let r = 0; r < n; r += s) for (let n = 0; n < t; n += s) {
|
|
3897
4021
|
let i = (r * t + n) * 4, a = e[i] / 255, o = e[i + 1] / 255, s = e[i + 2] / 255;
|
|
3898
4022
|
if (e[i + 3] < 10) continue;
|
|
3899
|
-
let [c, d, f] =
|
|
4023
|
+
let [c, d, f] = qe(a, o, s);
|
|
3900
4024
|
l[u * 3] = c, l[u * 3 + 1] = d, l[u * 3 + 2] = f, u++;
|
|
3901
4025
|
}
|
|
3902
4026
|
let d = u;
|
|
3903
4027
|
if (d === 0) return [];
|
|
3904
|
-
let f = Math.min(d, Math.max(a * 4, 64)), { centroids: p, populations: m } =
|
|
3905
|
-
return
|
|
3906
|
-
let [n, r, i] = e, a =
|
|
4028
|
+
let f = Math.min(d, Math.max(a * 4, 64)), { centroids: p, populations: m } = Ql(l, d, Zl(Xl(l.slice(0, d * 3), d, f), a, i.chromaWeight), i.maxIterations, i.chromaWeight), h = $l(p, m, i.dedupeThreshold);
|
|
4029
|
+
return nu(h.centroids.map((e, t) => {
|
|
4030
|
+
let [n, r, i] = e, a = Ye(n, r, i), o = Ze(n, r, i);
|
|
3907
4031
|
return {
|
|
3908
4032
|
oklab: [
|
|
3909
4033
|
n,
|
|
@@ -3912,19 +4036,19 @@ function Bl(e, t, n, r) {
|
|
|
3912
4036
|
],
|
|
3913
4037
|
oklch: a,
|
|
3914
4038
|
rgb: o,
|
|
3915
|
-
css:
|
|
4039
|
+
css: Kl(a[0], a[1], a[2]),
|
|
3916
4040
|
population: h.populations[t]
|
|
3917
4041
|
};
|
|
3918
4042
|
}));
|
|
3919
4043
|
}
|
|
3920
|
-
function
|
|
3921
|
-
let r =
|
|
4044
|
+
function iu(e, t, n) {
|
|
4045
|
+
let r = ru(e, t, n, { k: 5 });
|
|
3922
4046
|
if (r.length === 0) return null;
|
|
3923
4047
|
let i = r[0];
|
|
3924
4048
|
for (let e = 1; e < r.length; e++) r[e].oklch[1] > i.oklch[1] && (i = r[e]);
|
|
3925
4049
|
return i;
|
|
3926
4050
|
}
|
|
3927
|
-
function
|
|
4051
|
+
function au(e, t, n, r, i, a) {
|
|
3928
4052
|
let o = i, s = a, c = e, l = t, u = n, d = r, f = Math.sqrt(c * c + l * l);
|
|
3929
4053
|
f !== 0 && (c /= f, l /= f);
|
|
3930
4054
|
let p = c * u + l * d;
|
|
@@ -3939,7 +4063,7 @@ function Hl(e, t, n, r, i, a) {
|
|
|
3939
4063
|
skew: p
|
|
3940
4064
|
};
|
|
3941
4065
|
}
|
|
3942
|
-
function
|
|
4066
|
+
function ou() {
|
|
3943
4067
|
return [
|
|
3944
4068
|
1,
|
|
3945
4069
|
0,
|
|
@@ -3959,56 +4083,56 @@ function Ul() {
|
|
|
3959
4083
|
1
|
|
3960
4084
|
];
|
|
3961
4085
|
}
|
|
3962
|
-
function
|
|
4086
|
+
function su(e, t, n) {
|
|
3963
4087
|
return e[n * 4 + t];
|
|
3964
4088
|
}
|
|
3965
4089
|
function $(e, t, n, r) {
|
|
3966
4090
|
e[n * 4 + t] = r;
|
|
3967
4091
|
}
|
|
3968
|
-
function
|
|
4092
|
+
function cu(e, t) {
|
|
3969
4093
|
let n = Array(16).fill(0);
|
|
3970
4094
|
for (let r = 0; r < 4; r++) for (let i = 0; i < 4; i++) {
|
|
3971
4095
|
let a = 0;
|
|
3972
|
-
for (let n = 0; n < 4; n++) a +=
|
|
4096
|
+
for (let n = 0; n < 4; n++) a += su(e, i, n) * su(t, n, r);
|
|
3973
4097
|
$(n, i, r, a);
|
|
3974
4098
|
}
|
|
3975
4099
|
return n;
|
|
3976
4100
|
}
|
|
3977
|
-
function
|
|
4101
|
+
function lu(e) {
|
|
3978
4102
|
let t = Array(16).fill(0);
|
|
3979
|
-
for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) $(t, r, n,
|
|
4103
|
+
for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) $(t, r, n, su(e, n, r));
|
|
3980
4104
|
return t;
|
|
3981
4105
|
}
|
|
3982
|
-
function
|
|
4106
|
+
function uu(e) {
|
|
3983
4107
|
let t = e[0], n = e[4], r = e[8], i = e[12], a = e[1], o = e[5], s = e[9], c = e[13], l = e[2], u = e[6], d = e[10], f = e[14], p = e[3], m = e[7], h = e[11], g = e[15];
|
|
3984
4108
|
return t * (o * (d * g - f * h) - s * (u * g - f * m) + c * (u * h - d * m)) - n * (a * (d * g - f * h) - s * (l * g - f * p) + c * (l * h - d * p)) + r * (a * (u * g - f * m) - o * (l * g - f * p) + c * (l * m - u * p)) - i * (a * (u * h - d * m) - o * (l * h - d * p) + s * (l * m - u * p));
|
|
3985
4109
|
}
|
|
3986
|
-
function
|
|
3987
|
-
let t =
|
|
4110
|
+
function du(e) {
|
|
4111
|
+
let t = uu(e);
|
|
3988
4112
|
if (Math.abs(t) < 1e-12) return null;
|
|
3989
4113
|
let n = Array(16).fill(0);
|
|
3990
4114
|
for (let r = 0; r < 4; r++) for (let i = 0; i < 4; i++) {
|
|
3991
4115
|
let a = [];
|
|
3992
|
-
for (let t = 0; t < 4; t++) if (t !== r) for (let n = 0; n < 4; n++) n !== i && a.push(
|
|
4116
|
+
for (let t = 0; t < 4; t++) if (t !== r) for (let n = 0; n < 4; n++) n !== i && a.push(su(e, n, t));
|
|
3993
4117
|
let o = a[0] * (a[4] * a[8] - a[5] * a[7]) - a[3] * (a[1] * a[8] - a[2] * a[7]) + a[6] * (a[1] * a[5] - a[2] * a[4]), s = i + r & 1 ? -1 : 1;
|
|
3994
4118
|
$(n, r, i, s * o / t);
|
|
3995
4119
|
}
|
|
3996
4120
|
return n;
|
|
3997
4121
|
}
|
|
3998
|
-
function
|
|
4122
|
+
function fu(e, t, n) {
|
|
3999
4123
|
return Math.sqrt(e * e + t * t + n * n);
|
|
4000
4124
|
}
|
|
4001
|
-
function
|
|
4125
|
+
function pu(e, t) {
|
|
4002
4126
|
return [
|
|
4003
4127
|
e[1] * t[2] - e[2] * t[1],
|
|
4004
4128
|
e[2] * t[0] - e[0] * t[2],
|
|
4005
4129
|
e[0] * t[1] - e[1] * t[0]
|
|
4006
4130
|
];
|
|
4007
4131
|
}
|
|
4008
|
-
function
|
|
4132
|
+
function mu(e, t) {
|
|
4009
4133
|
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
|
|
4010
4134
|
}
|
|
4011
|
-
function
|
|
4135
|
+
function hu(e) {
|
|
4012
4136
|
if (e.length !== 16) return null;
|
|
4013
4137
|
let t = [...e], n = t[15];
|
|
4014
4138
|
if (Math.abs(n) < 1e-12) return null;
|
|
@@ -4022,9 +4146,9 @@ function Ql(e) {
|
|
|
4022
4146
|
if (Math.abs(t[3]) > 1e-12 || Math.abs(t[7]) > 1e-12 || Math.abs(t[11]) > 1e-12) {
|
|
4023
4147
|
let e = [...t];
|
|
4024
4148
|
e[3] = 0, e[7] = 0, e[11] = 0, e[15] = 1;
|
|
4025
|
-
let n =
|
|
4149
|
+
let n = du(e);
|
|
4026
4150
|
if (!n) return null;
|
|
4027
|
-
let i =
|
|
4151
|
+
let i = lu(n);
|
|
4028
4152
|
r[0] = i[0] * t[3] + i[4] * t[7] + i[8] * t[11] + i[12] * t[15], r[1] = i[1] * t[3] + i[5] * t[7] + i[9] * t[11] + i[13] * t[15], r[2] = i[2] * t[3] + i[6] * t[7] + i[10] * t[11] + i[14] * t[15], r[3] = i[3] * t[3] + i[7] * t[7] + i[11] * t[11] + i[15] * t[15];
|
|
4029
4153
|
}
|
|
4030
4154
|
let i = [
|
|
@@ -4043,44 +4167,44 @@ function Ql(e) {
|
|
|
4043
4167
|
t[8],
|
|
4044
4168
|
t[9],
|
|
4045
4169
|
t[10]
|
|
4046
|
-
], c =
|
|
4170
|
+
], c = fu(...a);
|
|
4047
4171
|
a = [
|
|
4048
4172
|
a[0] / c,
|
|
4049
4173
|
a[1] / c,
|
|
4050
4174
|
a[2] / c
|
|
4051
4175
|
];
|
|
4052
|
-
let l =
|
|
4176
|
+
let l = mu(a, o);
|
|
4053
4177
|
o = [
|
|
4054
4178
|
o[0] - a[0] * l,
|
|
4055
4179
|
o[1] - a[1] * l,
|
|
4056
4180
|
o[2] - a[2] * l
|
|
4057
4181
|
];
|
|
4058
|
-
let u =
|
|
4182
|
+
let u = fu(...o);
|
|
4059
4183
|
o = [
|
|
4060
4184
|
o[0] / u,
|
|
4061
4185
|
o[1] / u,
|
|
4062
4186
|
o[2] / u
|
|
4063
4187
|
], l /= u;
|
|
4064
|
-
let d =
|
|
4188
|
+
let d = mu(a, s);
|
|
4065
4189
|
s = [
|
|
4066
4190
|
s[0] - a[0] * d,
|
|
4067
4191
|
s[1] - a[1] * d,
|
|
4068
4192
|
s[2] - a[2] * d
|
|
4069
4193
|
];
|
|
4070
|
-
let f =
|
|
4194
|
+
let f = mu(o, s);
|
|
4071
4195
|
s = [
|
|
4072
4196
|
s[0] - o[0] * f,
|
|
4073
4197
|
s[1] - o[1] * f,
|
|
4074
4198
|
s[2] - o[2] * f
|
|
4075
4199
|
];
|
|
4076
|
-
let p =
|
|
4200
|
+
let p = fu(...s);
|
|
4077
4201
|
s = [
|
|
4078
4202
|
s[0] / p,
|
|
4079
4203
|
s[1] / p,
|
|
4080
4204
|
s[2] / p
|
|
4081
4205
|
], d /= p, f /= p;
|
|
4082
|
-
let m =
|
|
4083
|
-
|
|
4206
|
+
let m = pu(o, s);
|
|
4207
|
+
mu(a, m) < 0 && (a = [
|
|
4084
4208
|
-a[0],
|
|
4085
4209
|
-a[1],
|
|
4086
4210
|
-a[2]
|
|
@@ -4093,7 +4217,7 @@ function Ql(e) {
|
|
|
4093
4217
|
-s[1],
|
|
4094
4218
|
-s[2]
|
|
4095
4219
|
]);
|
|
4096
|
-
let h =
|
|
4220
|
+
let h = gu(a[0], o[0], s[0], a[1], o[1], s[1], a[2], o[2], s[2]);
|
|
4097
4221
|
return {
|
|
4098
4222
|
translate: i,
|
|
4099
4223
|
scale: [
|
|
@@ -4110,7 +4234,7 @@ function Ql(e) {
|
|
|
4110
4234
|
perspective: r
|
|
4111
4235
|
};
|
|
4112
4236
|
}
|
|
4113
|
-
function
|
|
4237
|
+
function gu(e, t, n, r, i, a, o, s, c) {
|
|
4114
4238
|
let l = e + i + c, u, d, f, p;
|
|
4115
4239
|
if (l > 0) {
|
|
4116
4240
|
let e = .5 / Math.sqrt(l + 1);
|
|
@@ -4132,7 +4256,7 @@ function $l(e, t, n, r, i, a, o, s, c) {
|
|
|
4132
4256
|
p
|
|
4133
4257
|
];
|
|
4134
4258
|
}
|
|
4135
|
-
function
|
|
4259
|
+
function _u(e, t, n) {
|
|
4136
4260
|
let r = e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3];
|
|
4137
4261
|
if (r < 0 && (t = [
|
|
4138
4262
|
-t[0],
|
|
@@ -4161,33 +4285,33 @@ function eu(e, t, n) {
|
|
|
4161
4285
|
e[3] * o + t[3] * s
|
|
4162
4286
|
];
|
|
4163
4287
|
}
|
|
4164
|
-
function
|
|
4165
|
-
let t =
|
|
4288
|
+
function vu(e) {
|
|
4289
|
+
let t = ou();
|
|
4166
4290
|
$(t, 0, 3, e.perspective[0]), $(t, 1, 3, e.perspective[1]), $(t, 2, 3, e.perspective[2]), $(t, 3, 3, e.perspective[3]), t[12] = t[12] + e.translate[0] * t[0] + e.translate[1] * t[4] + e.translate[2] * t[8], t[13] = t[13] + e.translate[0] * t[1] + e.translate[1] * t[5] + e.translate[2] * t[9], t[14] = t[14] + e.translate[0] * t[2] + e.translate[1] * t[6] + e.translate[2] * t[10], t[15] = t[15] + e.translate[0] * t[3] + e.translate[1] * t[7] + e.translate[2] * t[11];
|
|
4167
|
-
let n =
|
|
4291
|
+
let n = cu(t, yu(e.quaternion));
|
|
4168
4292
|
for (let e = 0; e < 16; e++) t[e] = n[e];
|
|
4169
4293
|
if (e.skew[2] !== 0) {
|
|
4170
|
-
let n =
|
|
4294
|
+
let n = ou();
|
|
4171
4295
|
$(n, 1, 2, e.skew[2]);
|
|
4172
|
-
let r =
|
|
4296
|
+
let r = cu(t, n);
|
|
4173
4297
|
for (let e = 0; e < 16; e++) t[e] = r[e];
|
|
4174
4298
|
}
|
|
4175
4299
|
if (e.skew[1] !== 0) {
|
|
4176
|
-
let n =
|
|
4300
|
+
let n = ou();
|
|
4177
4301
|
$(n, 0, 2, e.skew[1]);
|
|
4178
|
-
let r =
|
|
4302
|
+
let r = cu(t, n);
|
|
4179
4303
|
for (let e = 0; e < 16; e++) t[e] = r[e];
|
|
4180
4304
|
}
|
|
4181
4305
|
if (e.skew[0] !== 0) {
|
|
4182
|
-
let n =
|
|
4306
|
+
let n = ou();
|
|
4183
4307
|
$(n, 0, 1, e.skew[0]);
|
|
4184
|
-
let r =
|
|
4308
|
+
let r = cu(t, n);
|
|
4185
4309
|
for (let e = 0; e < 16; e++) t[e] = r[e];
|
|
4186
4310
|
}
|
|
4187
4311
|
let [r, i, a] = e.scale;
|
|
4188
4312
|
return t[0] *= r, t[1] *= r, t[2] *= r, t[3] *= r, t[4] *= i, t[5] *= i, t[6] *= i, t[7] *= i, t[8] *= a, t[9] *= a, t[10] *= a, t[11] *= a, [...t];
|
|
4189
4313
|
}
|
|
4190
|
-
function
|
|
4314
|
+
function yu(e) {
|
|
4191
4315
|
let [t, n, r, i] = e, a = t * t, o = n * n, s = r * r, c = t * n, l = t * r, u = n * r, d = i * t, f = i * n, p = i * r;
|
|
4192
4316
|
return [
|
|
4193
4317
|
1 - 2 * (o + s),
|
|
@@ -4208,7 +4332,7 @@ function nu(e) {
|
|
|
4208
4332
|
1
|
|
4209
4333
|
];
|
|
4210
4334
|
}
|
|
4211
|
-
function
|
|
4335
|
+
function bu(e, t, n) {
|
|
4212
4336
|
let r = (e, t) => e + (t - e) * n;
|
|
4213
4337
|
return {
|
|
4214
4338
|
translate: [
|
|
@@ -4226,7 +4350,7 @@ function ru(e, t, n) {
|
|
|
4226
4350
|
r(e.skew[1], t.skew[1]),
|
|
4227
4351
|
r(e.skew[2], t.skew[2])
|
|
4228
4352
|
],
|
|
4229
|
-
quaternion:
|
|
4353
|
+
quaternion: _u(e.quaternion, t.quaternion, n),
|
|
4230
4354
|
perspective: [
|
|
4231
4355
|
r(e.perspective[0], t.perspective[0]),
|
|
4232
4356
|
r(e.perspective[1], t.perspective[1]),
|
|
@@ -4235,4 +4359,4 @@ function ru(e, t, n) {
|
|
|
4235
4359
|
]
|
|
4236
4360
|
};
|
|
4237
4361
|
}
|
|
4238
|
-
export {
|
|
4362
|
+
export { Nr as ABSOLUTE_LENGTH_UNITS, he as ALPHA_DENORM_UNIT, C as ALPHA_RANGE, Lr as ANGLE_UNITS, Tr as AdobeRGBColor, ke as COLOR_NAMES, ge as COLOR_SPACE_DENORM_UNITS, ye as COLOR_SPACE_NAMES, T as COLOR_SPACE_RANGES, Hr as COMPUTED_UNITS, Ra as CSSColor, Z as CSSCubicBezier, mo as CSSFunction, ho as CSSJSON, uo as CSSString, V as CSSValueUnit, _o as CSSValues, co as CSS_WIDE_KEYWORDS, Vn as CYLINDRICAL_HUE_COMPONENT, F as Color, Le as DELTA_E_OK_JND, wr as DisplayP3Color, Vr as FLEX_UNITS, s as FRAME_RATE, zr as FREQUENCY_UNITS, Y as FunctionValue, Oe as GAMUT_SECTOR_COEFFICIENTS, hr as HSLColor, gr as HSVColor, me as HUE_RANGE, _r as HWBColor, Sr as KelvinColor, vr as LABColor, yr as LCHColor, Fr as LENGTH_UNITS, O as LINEAR_SRGB_TO_LMS, D as LMS_TO_LINEAR_SRGB, E as LMS_TO_OKLAB_MATRIX, Ee as LMS_TO_XYZ_MATRIX, Cr as LinearSRGBColor, br as OKLABColor, k as OKLAB_TO_LMS_COEFF, De as OKLAB_TO_LMS_MATRIX, xr as OKLCHColor, Rr as PERCENTAGE_UNITS, Er as ProPhotoRGBColor, Pr as RELATIVE_LENGTH_UNITS, Br as RESOLUTION_UNITS, fe as RGBA_MAX, I as RGBColor, pe as RGB_RANGE, Dr as Rec2020Color, qr as STYLE_NAMES, Ir as TIME_UNITS, Gr as UNITS, w as UNIT_RANGE, Wa as ValueArray, J as ValueUnit, we as WHITE_POINTS, xe as WHITE_POINT_D50, Ce as WHITE_POINT_D50_D65, be as WHITE_POINT_D65, Se as WHITE_POINT_D65_D50, L as XYZColor, Te as XYZ_TO_LMS_MATRIX, u as arrayEquals, wc as bezierPresets, nc as bounceInEase, rc as bounceInEaseHalf, oc as bounceInOutEase, ic as bounceOutEase, ac as bounceOutEaseHalf, Ro as bumpLayoutEpoch, _ as camelCaseToHyphen, ne as cancelAnimationFrame, v as clamp, Va as clearCustomColorNames, l as clone, M as color2, jr as colorUnit2, Ve as computeMaxSaturation, Gn as computeSafeAccent, hi as convert2, oi as convertAbsoluteUnitToPixels, di as convertToDPI, li as convertToDegrees, ui as convertToHz, ci as convertToMs, si as convertToPixels, m as createHash, Zo as cssFiltersToString, Ks as cssLinear, oe as cubicBezier, ce as cubicBezierToSVG, le as cubicBezierToString, ae as deCasteljau, p as debounce, au as decomposeMatrix2D, hu as decomposeMatrix3D, Re as deltaEOK, iu as dominantColor, tc as easeInBounce, uc as easeInCirc, Xs as easeInCubic, pc as easeInExpo, fc as easeInOutCirc, Qs as easeInOutCubic, hc as easeInOutExpo, Ys as easeInOutQuad, lc as easeInOutSine, qs as easeInQuad, sc as easeInSine, dc as easeOutCirc, Zs as easeOutCubic, mc as easeOutExpo, Js as easeOutQuad, cc as easeOutSine, Zi as evaluateMathFunction, jl as extractAnimationOptions, Sl as extractKeyframes, Cl as extractProperties, wl as extractStyleRules, Si as fail, He as findCusp, Ue as findGamutIntersection, Yr as flattenObject, Hl as formatCSS, Bn as gamutMap, Ke as gamutMapOKLab, Je as gamutMapSRGB, Bo as getComputedValue, Ha as getCustomColorNames, In as getFormattedColorSpaceRange, Lo as getLayoutEpoch, Kn as getOklchLightness, g as hyphenToCamelCase, vi as identifier, bi as integer, se as interpBezier, bu as interpolateDecomposed, Hn as interpolateHue, S as invertMat3, $r as isCSSStyleName, Jr as isColorUnit, Be as isInSRGBGamut, c as isObject, R as istring, gc as jumpTerms, b as lerp, re as lerpArray, Go as lerpColorValue, Wo as lerpComputedValue, Ko as lerpNumericValue, qo as lerpValue, Gs as linear, ie as logerp, h as memoize, Un as mixColors, Xo as mixColorsN, de as multiplyMat3, qn as needsContrastAdjustment, yi as none, kr as normalizeColor, Ar as normalizeColorUnit, Or as normalizeColorUnitComponent, Mr as normalizeColorUnits, Vo as normalizeNumericUnits, Uo as normalizeValueUnits, z as number, ze as oklabToLinearSRGB, Ze as oklabToRgb255, vl as parseAnimationShorthand, Ua as parseCSSColor, yo as parseCSSPercent, al as parseCSSStylesheet, bo as parseCSSTime, vo as parseCSSValue, Ui as parseCSSValueUnit, Ci as parseResult, Jo as prepareInterpVar, ru as quantizePixels, Ye as rawOklabToOklch, Xe as rawOklchToOklab, vu as recomposeMatrix3D, Ba as registerColorNames, te as requestAnimationFrame, bl as reverseAnimationShorthand, Gi as reverseCSSIterationCount, Wi as reverseCSSTime, Ws as rgb2ColorFilter, Jn as safeAccentColor, y as scale, ee as seekPreviousValue, Nl as serializeDeclaration, Ml as serializeKeyframeSelector, Bl as serializeStylesheet, zl as serializeStylesheetItem, d as sleep, _u as slerp, $s as smoothStep3, ec as solveCubicBezierX, qe as srgbToOKLab, Cc as stepEnd, Sc as stepStart, xc as steppedEase, Ul as stylesheetToString, xi as succeed, Tc as timingFunctionDescriptions, Ec as timingFunctions, x as transformMat3, ue as transposeMat3, B as tryParse, Xr as unflattenObject, Zr as unflattenObjectToString, ei as unpackMatrixValues, f as waitUntil };
|