@mkbabb/value.js 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -8
- package/dist/value.cjs +6 -6
- package/dist/value.d.ts +5 -3
- package/dist/value.js +1138 -1100
- package/package.json +1 -1
package/dist/value.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _e = 16.666666666666668, gr = (e) => !!e && e.constructor === Object;
|
|
2
2
|
function at(e) {
|
|
3
|
-
return
|
|
3
|
+
return gr(e) ? Object.entries(e).map(([t, n]) => [t, at(n)]).reduce((t, [n, r]) => (t[n] = r, t), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(at) : e;
|
|
4
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const Da = (e, t) => {
|
|
6
6
|
if (!e || !t || e.length !== t.length)
|
|
7
7
|
return !1;
|
|
8
8
|
for (let n = 0; n < e.length; n++)
|
|
@@ -10,10 +10,10 @@ const $a = (e, t) => {
|
|
|
10
10
|
return !1;
|
|
11
11
|
return !0;
|
|
12
12
|
};
|
|
13
|
-
async function
|
|
13
|
+
async function Ga(e) {
|
|
14
14
|
return await new Promise((t) => setTimeout(t, e));
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
16
|
+
async function Va(e, t = _e) {
|
|
17
17
|
return await new Promise((n) => {
|
|
18
18
|
const r = setInterval(() => {
|
|
19
19
|
if (e())
|
|
@@ -21,7 +21,7 @@ async function Ua(e, t = Oe) {
|
|
|
21
21
|
}, t);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Wa(e, t = 100, n = !1) {
|
|
25
25
|
let r = null;
|
|
26
26
|
const o = function(...s) {
|
|
27
27
|
const i = this, a = function() {
|
|
@@ -33,55 +33,60 @@ function Ga(e, t = 100, n = !1) {
|
|
|
33
33
|
r && (clearTimeout(r), r = null);
|
|
34
34
|
}, o;
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
36
|
+
async function Xa(e, t) {
|
|
37
37
|
const n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
|
|
38
38
|
return Array.from(new Uint8Array(r)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const n = /* @__PURE__ */ new Map(), {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
function se(e, t = {}) {
|
|
41
|
+
const n = /* @__PURE__ */ new Map(), {
|
|
42
|
+
maxCacheSize: r = 1 / 0,
|
|
43
|
+
ttl: o = 1 / 0,
|
|
44
|
+
keyFn: s = JSON.stringify,
|
|
45
|
+
shouldCache: i
|
|
46
|
+
} = t, a = function(...c) {
|
|
47
|
+
const l = s.apply(this, c), f = Date.now();
|
|
48
|
+
if (n.has(l)) {
|
|
49
|
+
const u = n.get(l);
|
|
50
|
+
if (f - u.timestamp <= o)
|
|
51
|
+
return u.value;
|
|
52
|
+
n.delete(l);
|
|
48
53
|
}
|
|
49
|
-
const
|
|
50
|
-
if (n.set(
|
|
51
|
-
const
|
|
52
|
-
n.delete(
|
|
54
|
+
const p = e.apply(this, c);
|
|
55
|
+
if ((!i || i(p, ...c)) && (n.set(l, { value: p, timestamp: f }), n.size > r)) {
|
|
56
|
+
const u = n.keys().next().value;
|
|
57
|
+
n.delete(u);
|
|
53
58
|
}
|
|
54
|
-
return
|
|
59
|
+
return p;
|
|
55
60
|
};
|
|
56
|
-
return
|
|
61
|
+
return a.cache = n, a;
|
|
57
62
|
}
|
|
58
|
-
const
|
|
63
|
+
const Ha = (e) => e.replace(
|
|
59
64
|
/([-_][a-z])/gi,
|
|
60
65
|
(t) => t.toUpperCase().replace("-", "").replace("_", "")
|
|
61
66
|
);
|
|
62
|
-
function
|
|
67
|
+
function ja(e) {
|
|
63
68
|
return e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`);
|
|
64
69
|
}
|
|
65
|
-
function
|
|
70
|
+
function Ya(e, t, n) {
|
|
66
71
|
for (let r = e - 1; r >= 0; r--)
|
|
67
72
|
if (n(t[r]))
|
|
68
73
|
return r;
|
|
69
74
|
}
|
|
70
|
-
function
|
|
75
|
+
function qa(e) {
|
|
71
76
|
if (typeof window < "u" && window.requestAnimationFrame)
|
|
72
77
|
return window.requestAnimationFrame(e);
|
|
73
|
-
let t =
|
|
78
|
+
let t = _e, n = Date.now();
|
|
74
79
|
return setTimeout(() => {
|
|
75
80
|
let r = Date.now(), o = r - n;
|
|
76
|
-
n = r, t = Math.max(0,
|
|
81
|
+
n = r, t = Math.max(0, _e - o), e(r);
|
|
77
82
|
}, t);
|
|
78
83
|
}
|
|
79
|
-
function
|
|
84
|
+
function Za(e) {
|
|
80
85
|
if (typeof window < "u" && window.cancelAnimationFrame)
|
|
81
86
|
return window.cancelAnimationFrame(e);
|
|
82
87
|
clearTimeout(e);
|
|
83
88
|
}
|
|
84
|
-
const
|
|
89
|
+
const An = (e, t = 2) => typeof e == "number" && !Number.isFinite(e) ? "none" : String(e?.toFixed?.(t) ?? e).trim().replace(/\.0+$/, ""), In = (e, t, n) => `${e}(${t.join(" ")} / ${n})`;
|
|
85
90
|
let H = class {
|
|
86
91
|
constructor(t, n = 1) {
|
|
87
92
|
this.colorSpace = t, this.alpha = n, this.components = /* @__PURE__ */ new Map();
|
|
@@ -91,13 +96,13 @@ let H = class {
|
|
|
91
96
|
const t = Array.from(this.components.values()).map(
|
|
92
97
|
(r) => typeof r == "number" && Number.isNaN(r) ? "none" : r
|
|
93
98
|
), n = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
|
|
94
|
-
return
|
|
99
|
+
return In(this.colorSpace, t, n);
|
|
95
100
|
}
|
|
96
101
|
toFormattedString(t = 2) {
|
|
97
102
|
const n = Array.from(this.components.values()).map(
|
|
98
|
-
(o) =>
|
|
99
|
-
), r =
|
|
100
|
-
return
|
|
103
|
+
(o) => An(o, t)
|
|
104
|
+
), r = An(this.alpha, t);
|
|
105
|
+
return In(this.colorSpace, n, r);
|
|
101
106
|
}
|
|
102
107
|
valueOf() {
|
|
103
108
|
return [...this.values(), this.alpha];
|
|
@@ -130,12 +135,12 @@ let H = class {
|
|
|
130
135
|
this.components.set(t, n);
|
|
131
136
|
}
|
|
132
137
|
};
|
|
133
|
-
class
|
|
138
|
+
class Ve extends H {
|
|
134
139
|
constructor(t, n, r) {
|
|
135
140
|
super(t, n), this.whitePoint = r;
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
|
-
class
|
|
143
|
+
class U extends H {
|
|
139
144
|
constructor(t, n, r, o) {
|
|
140
145
|
super("rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
141
146
|
}
|
|
@@ -158,7 +163,7 @@ class D extends H {
|
|
|
158
163
|
this.setComponent("b", t);
|
|
159
164
|
}
|
|
160
165
|
}
|
|
161
|
-
class
|
|
166
|
+
class dt extends H {
|
|
162
167
|
constructor(t, n, r, o) {
|
|
163
168
|
super("hsl", o), this.components.set("h", t), this.components.set("s", n), this.components.set("l", r);
|
|
164
169
|
}
|
|
@@ -181,7 +186,7 @@ class vt extends H {
|
|
|
181
186
|
this.setComponent("l", t);
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
|
-
class
|
|
189
|
+
class We extends H {
|
|
185
190
|
constructor(t, n, r, o) {
|
|
186
191
|
super("hsv", o), this.components.set("h", t), this.components.set("s", n), this.components.set("v", r);
|
|
187
192
|
}
|
|
@@ -204,7 +209,7 @@ class De extends H {
|
|
|
204
209
|
this.setComponent("v", t);
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
|
-
class
|
|
212
|
+
class Xe extends H {
|
|
208
213
|
constructor(t, n, r, o) {
|
|
209
214
|
super("hwb", o), this.components.set("h", t), this.components.set("w", n), this.components.set("b", r);
|
|
210
215
|
}
|
|
@@ -227,7 +232,7 @@ class Ue extends H {
|
|
|
227
232
|
this.setComponent("b", t);
|
|
228
233
|
}
|
|
229
234
|
}
|
|
230
|
-
class
|
|
235
|
+
class ie extends Ve {
|
|
231
236
|
constructor(t, n, r, o) {
|
|
232
237
|
super("lab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
233
238
|
}
|
|
@@ -250,7 +255,7 @@ class se extends $e {
|
|
|
250
255
|
this.setComponent("b", t);
|
|
251
256
|
}
|
|
252
257
|
}
|
|
253
|
-
class
|
|
258
|
+
class He extends H {
|
|
254
259
|
constructor(t, n, r, o) {
|
|
255
260
|
super("lch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
256
261
|
}
|
|
@@ -273,7 +278,7 @@ class Ge extends H {
|
|
|
273
278
|
this.setComponent("h", t);
|
|
274
279
|
}
|
|
275
280
|
}
|
|
276
|
-
class
|
|
281
|
+
class ae extends Ve {
|
|
277
282
|
constructor(t, n, r, o) {
|
|
278
283
|
super("oklab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
279
284
|
}
|
|
@@ -296,7 +301,7 @@ class ie extends $e {
|
|
|
296
301
|
this.setComponent("b", t);
|
|
297
302
|
}
|
|
298
303
|
}
|
|
299
|
-
class
|
|
304
|
+
class je extends H {
|
|
300
305
|
constructor(t, n, r, o) {
|
|
301
306
|
super("oklch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
302
307
|
}
|
|
@@ -319,7 +324,7 @@ class Ve extends H {
|
|
|
319
324
|
this.setComponent("h", t);
|
|
320
325
|
}
|
|
321
326
|
}
|
|
322
|
-
class
|
|
327
|
+
class W extends Ve {
|
|
323
328
|
constructor(t, n, r, o) {
|
|
324
329
|
super("xyz", o, "D65"), this.components.set("x", t), this.components.set("y", n), this.components.set("z", r);
|
|
325
330
|
}
|
|
@@ -342,7 +347,7 @@ class X extends $e {
|
|
|
342
347
|
this.setComponent("z", t);
|
|
343
348
|
}
|
|
344
349
|
}
|
|
345
|
-
class
|
|
350
|
+
class dr extends H {
|
|
346
351
|
constructor(t, n) {
|
|
347
352
|
super("kelvin", n), this.components.set("kelvin", t);
|
|
348
353
|
}
|
|
@@ -353,7 +358,7 @@ class hr extends H {
|
|
|
353
358
|
this.setComponent("kelvin", t);
|
|
354
359
|
}
|
|
355
360
|
}
|
|
356
|
-
class
|
|
361
|
+
class Ye extends H {
|
|
357
362
|
constructor(t, n, r, o) {
|
|
358
363
|
super("srgb-linear", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
359
364
|
}
|
|
@@ -376,7 +381,7 @@ class Xe extends H {
|
|
|
376
381
|
this.setComponent("b", t);
|
|
377
382
|
}
|
|
378
383
|
}
|
|
379
|
-
class
|
|
384
|
+
class qe extends H {
|
|
380
385
|
constructor(t, n, r, o) {
|
|
381
386
|
super("display-p3", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
382
387
|
}
|
|
@@ -399,7 +404,7 @@ class We extends H {
|
|
|
399
404
|
this.setComponent("b", t);
|
|
400
405
|
}
|
|
401
406
|
}
|
|
402
|
-
class
|
|
407
|
+
class Ze extends H {
|
|
403
408
|
constructor(t, n, r, o) {
|
|
404
409
|
super("a98-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
405
410
|
}
|
|
@@ -422,7 +427,7 @@ class He extends H {
|
|
|
422
427
|
this.setComponent("b", t);
|
|
423
428
|
}
|
|
424
429
|
}
|
|
425
|
-
class
|
|
430
|
+
class Ke extends H {
|
|
426
431
|
constructor(t, n, r, o) {
|
|
427
432
|
super("prophoto-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
428
433
|
}
|
|
@@ -445,7 +450,7 @@ class je extends H {
|
|
|
445
450
|
this.setComponent("b", t);
|
|
446
451
|
}
|
|
447
452
|
}
|
|
448
|
-
class
|
|
453
|
+
class Je extends H {
|
|
449
454
|
constructor(t, n, r, o) {
|
|
450
455
|
super("rec2020", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
451
456
|
}
|
|
@@ -468,10 +473,10 @@ class Ye extends H {
|
|
|
468
473
|
this.setComponent("b", t);
|
|
469
474
|
}
|
|
470
475
|
}
|
|
471
|
-
const
|
|
472
|
-
function
|
|
476
|
+
const On = 4;
|
|
477
|
+
function Rn(e, t = "^", n = !1) {
|
|
473
478
|
const r = e.src.split(`
|
|
474
|
-
`), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o -
|
|
479
|
+
`), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o - On, 0), i = Math.min(o + On + 1, r.length), a = r.slice(s, i);
|
|
475
480
|
if (t) {
|
|
476
481
|
const l = " ".repeat(e.getColumnNumber()) + t;
|
|
477
482
|
a.splice(o - s + 1, 0, l);
|
|
@@ -480,7 +485,7 @@ function Tn(e, t = "^", n = !1) {
|
|
|
480
485
|
`);
|
|
481
486
|
}
|
|
482
487
|
const ht = /* @__PURE__ */ new Map();
|
|
483
|
-
function
|
|
488
|
+
function wr(e) {
|
|
484
489
|
if (ht.has(e.id))
|
|
485
490
|
return ht.get(e.id);
|
|
486
491
|
const t = (r, o) => {
|
|
@@ -532,7 +537,7 @@ function mr(e) {
|
|
|
532
537
|
case "sepBy":
|
|
533
538
|
return `${c} sepBy ${t(i[0], o)}`;
|
|
534
539
|
case "lazy": {
|
|
535
|
-
const [p] = i, u =
|
|
540
|
+
const [p] = i, u = Oo(p);
|
|
536
541
|
if (o)
|
|
537
542
|
return s;
|
|
538
543
|
{
|
|
@@ -550,14 +555,14 @@ function mr(e) {
|
|
|
550
555
|
}, n = t(e);
|
|
551
556
|
return ht.set(e.id, n), n;
|
|
552
557
|
}
|
|
553
|
-
function
|
|
554
|
-
const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ?
|
|
558
|
+
function kr(e, t = "", n = "") {
|
|
559
|
+
const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ? Rn(e, "", e.isError) : Rn(e, "^", e.isError);
|
|
555
560
|
return `${a}
|
|
556
561
|
${c}`;
|
|
557
562
|
}
|
|
558
|
-
function
|
|
563
|
+
function To(e, t = "", n = !1, r = console.log) {
|
|
559
564
|
const o = (s) => {
|
|
560
|
-
const i = e.parser(s), a = n ?
|
|
565
|
+
const i = e.parser(s), a = n ? wr(e) : e.context.name ?? "", c = kr(
|
|
561
566
|
i,
|
|
562
567
|
t,
|
|
563
568
|
a
|
|
@@ -566,7 +571,7 @@ function Eo(e, t = "", n = !1, r = console.log) {
|
|
|
566
571
|
};
|
|
567
572
|
return new T(o, R("debug", e, r));
|
|
568
573
|
}
|
|
569
|
-
class
|
|
574
|
+
class Vt {
|
|
570
575
|
constructor(t, n = void 0, r = 0, o = !1, s = 0) {
|
|
571
576
|
this.src = t, this.value = n, this.offset = r, this.isError = o, this.furthest = s;
|
|
572
577
|
}
|
|
@@ -588,7 +593,7 @@ class Gt {
|
|
|
588
593
|
return this.offset = t.offset, this.value = t.value, this.isError = !1, this;
|
|
589
594
|
}
|
|
590
595
|
clone() {
|
|
591
|
-
return new
|
|
596
|
+
return new Vt(
|
|
592
597
|
this.src,
|
|
593
598
|
this.value,
|
|
594
599
|
this.offset,
|
|
@@ -608,7 +613,7 @@ class Gt {
|
|
|
608
613
|
`).length : 0;
|
|
609
614
|
}
|
|
610
615
|
toString() {
|
|
611
|
-
return
|
|
616
|
+
return kr(this);
|
|
612
617
|
}
|
|
613
618
|
}
|
|
614
619
|
function R(e, t, ...n) {
|
|
@@ -618,35 +623,35 @@ function R(e, t, ...n) {
|
|
|
618
623
|
args: n
|
|
619
624
|
};
|
|
620
625
|
}
|
|
621
|
-
let
|
|
622
|
-
const mt = /* @__PURE__ */ new Map(),
|
|
623
|
-
let
|
|
626
|
+
let Ao = 0;
|
|
627
|
+
const mt = /* @__PURE__ */ new Map(), Lt = /* @__PURE__ */ new Map(), yr = 20, Io = (1 << yr) - 1;
|
|
628
|
+
let Nt = -1, Wt;
|
|
624
629
|
function z(e, t) {
|
|
625
|
-
return e.offset >
|
|
630
|
+
return e.offset > Nt ? (Nt = e.offset, Wt = e, e.expected = void 0) : e.offset, Wt;
|
|
626
631
|
}
|
|
627
|
-
function
|
|
632
|
+
function Oo(e) {
|
|
628
633
|
return e.parser ? e.parser : e.parser = e();
|
|
629
634
|
}
|
|
630
|
-
function
|
|
635
|
+
function Ro(e) {
|
|
631
636
|
let t;
|
|
632
637
|
return (n) => (t || (t = e()), t.parser(n));
|
|
633
638
|
}
|
|
634
|
-
const
|
|
639
|
+
const Bo = 0, Ft = 1, No = 2;
|
|
635
640
|
class T {
|
|
636
641
|
constructor(t, n = {}) {
|
|
637
642
|
this.parser = t, this.context = n;
|
|
638
643
|
}
|
|
639
|
-
id =
|
|
644
|
+
id = Ao++;
|
|
640
645
|
state;
|
|
641
|
-
flags =
|
|
646
|
+
flags = Bo;
|
|
642
647
|
reset() {
|
|
643
|
-
|
|
648
|
+
Wt = void 0, Nt = -1, mt.clear(), Lt.clear();
|
|
644
649
|
}
|
|
645
650
|
parseState(t) {
|
|
646
651
|
this.reset();
|
|
647
|
-
const n = new
|
|
648
|
-
if (this.parser(n), n.isError &&
|
|
649
|
-
const r = new
|
|
652
|
+
const n = new Vt(t);
|
|
653
|
+
if (this.parser(n), n.isError && Wt) {
|
|
654
|
+
const r = new Vt(t, void 0, Nt, !0);
|
|
650
655
|
this.state = r;
|
|
651
656
|
} else
|
|
652
657
|
this.state = n, n.isError;
|
|
@@ -656,19 +661,19 @@ class T {
|
|
|
656
661
|
return this.parseState(t).value;
|
|
657
662
|
}
|
|
658
663
|
getCijKey(t) {
|
|
659
|
-
return this.id <<
|
|
664
|
+
return this.id << yr | t.offset & Io;
|
|
660
665
|
}
|
|
661
666
|
atLeftRecursionLimit(t) {
|
|
662
|
-
return (
|
|
667
|
+
return (Lt.get(this.getCijKey(t)) ?? 0) > t.src.length - t.offset;
|
|
663
668
|
}
|
|
664
669
|
memoize() {
|
|
665
670
|
const t = (n) => {
|
|
666
|
-
const r = this.getCijKey(n), o =
|
|
671
|
+
const r = this.getCijKey(n), o = Lt.get(r) ?? 0, s = mt.get(this.id);
|
|
667
672
|
if (s && s.offset >= n.offset)
|
|
668
673
|
return n.offset = s.offset, n.value = s.value, n.isError = s.isError, n;
|
|
669
674
|
if (this.atLeftRecursionLimit(n))
|
|
670
675
|
return n.isError = !0, n;
|
|
671
|
-
|
|
676
|
+
Lt.set(r, o + 1), this.parser(n);
|
|
672
677
|
const i = mt.get(this.id);
|
|
673
678
|
return i && i.offset > n.offset ? n.offset = i.offset : i || mt.set(this.id, n.clone()), n;
|
|
674
679
|
};
|
|
@@ -816,14 +821,14 @@ class T {
|
|
|
816
821
|
call(t) {
|
|
817
822
|
if (this.flags === 0)
|
|
818
823
|
return this.parser(t);
|
|
819
|
-
if (this.flags ===
|
|
820
|
-
|
|
824
|
+
if (this.flags === Ft) {
|
|
825
|
+
kt(t);
|
|
821
826
|
const r = t.offset;
|
|
822
|
-
return this.parser(t), t.isError ? (z(t), t.offset = r, t.isError = !0, t) : (
|
|
827
|
+
return this.parser(t), t.isError ? (z(t), t.offset = r, t.isError = !0, t) : (kt(t), t);
|
|
823
828
|
}
|
|
824
|
-
this.flags &
|
|
829
|
+
this.flags & Ft && kt(t);
|
|
825
830
|
const n = t.offset;
|
|
826
|
-
return this.parser(t), t.isError ? (z(t), t.offset = n, t.isError = !0, t) : (this.flags &
|
|
831
|
+
return this.parser(t), t.isError ? (z(t), t.offset = n, t.isError = !0, t) : (this.flags & Ft && kt(t), this.flags & No && t.offset < t.src.length && (z(t), t.offset = n, t.isError = !0), t);
|
|
827
832
|
}
|
|
828
833
|
trim(t = w, n = !0) {
|
|
829
834
|
if (!n)
|
|
@@ -833,11 +838,11 @@ class T {
|
|
|
833
838
|
((i) => r.call(i)),
|
|
834
839
|
R("trimWhitespace", this)
|
|
835
840
|
);
|
|
836
|
-
o.flags = this.flags |
|
|
841
|
+
o.flags = this.flags | Ft;
|
|
837
842
|
const s = (i) => {
|
|
838
|
-
|
|
843
|
+
kt(i);
|
|
839
844
|
const a = i.offset;
|
|
840
|
-
return r.parser(i), i.isError ? (z(i), i.offset = a, i.isError = !0, i) : (
|
|
845
|
+
return r.parser(i), i.isError ? (z(i), i.offset = a, i.isError = !0, i) : (kt(i), i);
|
|
841
846
|
};
|
|
842
847
|
return new T(
|
|
843
848
|
s,
|
|
@@ -892,23 +897,23 @@ class T {
|
|
|
892
897
|
);
|
|
893
898
|
}
|
|
894
899
|
eof() {
|
|
895
|
-
const t = this.skip(
|
|
900
|
+
const t = this.skip(_o());
|
|
896
901
|
return t.context = R("eof", this), t;
|
|
897
902
|
}
|
|
898
903
|
debug(t = "", n = !1, r = console.log) {
|
|
899
|
-
return
|
|
904
|
+
return To(this, t, n, r);
|
|
900
905
|
}
|
|
901
906
|
toString() {
|
|
902
|
-
return
|
|
907
|
+
return wr(this);
|
|
903
908
|
}
|
|
904
909
|
static lazy(t) {
|
|
905
910
|
return new T(
|
|
906
|
-
|
|
911
|
+
Ro(t),
|
|
907
912
|
R("lazy", void 0, t)
|
|
908
913
|
);
|
|
909
914
|
}
|
|
910
915
|
}
|
|
911
|
-
function
|
|
916
|
+
function _o() {
|
|
912
917
|
const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (z(t), t.isError = !0, t);
|
|
913
918
|
return new T(
|
|
914
919
|
e,
|
|
@@ -945,7 +950,7 @@ function A(...e) {
|
|
|
945
950
|
R("all", void 0, ...e)
|
|
946
951
|
);
|
|
947
952
|
}
|
|
948
|
-
function
|
|
953
|
+
function y(e) {
|
|
949
954
|
const t = e.length;
|
|
950
955
|
let n;
|
|
951
956
|
if (t === 1) {
|
|
@@ -980,7 +985,7 @@ function Y(e, t) {
|
|
|
980
985
|
R("regex", void 0, e)
|
|
981
986
|
);
|
|
982
987
|
}
|
|
983
|
-
const
|
|
988
|
+
const kt = (e) => {
|
|
984
989
|
const t = e.src, n = t.length;
|
|
985
990
|
let r = e.offset;
|
|
986
991
|
if (r >= n || t.charCodeAt(r) > 32) return e;
|
|
@@ -1002,7 +1007,7 @@ function P(e, t) {
|
|
|
1002
1007
|
t[6] * n + t[7] * r + t[8] * o
|
|
1003
1008
|
];
|
|
1004
1009
|
}
|
|
1005
|
-
function
|
|
1010
|
+
function Ja(e) {
|
|
1006
1011
|
return [
|
|
1007
1012
|
e[0],
|
|
1008
1013
|
e[3],
|
|
@@ -1015,7 +1020,7 @@ function Ka(e) {
|
|
|
1015
1020
|
e[8]
|
|
1016
1021
|
];
|
|
1017
1022
|
}
|
|
1018
|
-
function
|
|
1023
|
+
function Qa(e, t) {
|
|
1019
1024
|
return [
|
|
1020
1025
|
e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
|
|
1021
1026
|
e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
|
|
@@ -1042,109 +1047,109 @@ function ct(e) {
|
|
|
1042
1047
|
(t * s - n * o) * m
|
|
1043
1048
|
];
|
|
1044
1049
|
}
|
|
1045
|
-
const L = 255,
|
|
1050
|
+
const L = 255, S = {
|
|
1046
1051
|
"%": { min: 0, max: 100 },
|
|
1047
1052
|
number: { min: 0, max: 1 }
|
|
1048
|
-
},
|
|
1049
|
-
"%":
|
|
1053
|
+
}, ye = {
|
|
1054
|
+
"%": S["%"],
|
|
1050
1055
|
number: { min: 0, max: L }
|
|
1051
|
-
},
|
|
1052
|
-
"%":
|
|
1053
|
-
number:
|
|
1054
|
-
},
|
|
1056
|
+
}, D = {
|
|
1057
|
+
"%": S["%"],
|
|
1058
|
+
number: S.number
|
|
1059
|
+
}, Rt = {
|
|
1055
1060
|
deg: { min: 0, max: 360 },
|
|
1056
1061
|
number: { min: 0, max: 360 },
|
|
1057
|
-
"%":
|
|
1062
|
+
"%": S["%"]
|
|
1058
1063
|
}, C = {
|
|
1059
1064
|
rgb: {
|
|
1060
|
-
r:
|
|
1061
|
-
g:
|
|
1062
|
-
b:
|
|
1063
|
-
alpha:
|
|
1065
|
+
r: ye,
|
|
1066
|
+
g: ye,
|
|
1067
|
+
b: ye,
|
|
1068
|
+
alpha: S
|
|
1064
1069
|
},
|
|
1065
1070
|
hsl: {
|
|
1066
|
-
h:
|
|
1067
|
-
s: { "%":
|
|
1068
|
-
l: { "%":
|
|
1069
|
-
alpha:
|
|
1071
|
+
h: Rt,
|
|
1072
|
+
s: { "%": S["%"], number: S.number },
|
|
1073
|
+
l: { "%": S["%"], number: S.number },
|
|
1074
|
+
alpha: S
|
|
1070
1075
|
},
|
|
1071
1076
|
hsv: {
|
|
1072
|
-
h:
|
|
1073
|
-
s: { "%":
|
|
1074
|
-
v: { "%":
|
|
1075
|
-
alpha:
|
|
1077
|
+
h: Rt,
|
|
1078
|
+
s: { "%": S["%"], number: S.number },
|
|
1079
|
+
v: { "%": S["%"], number: S.number },
|
|
1080
|
+
alpha: S
|
|
1076
1081
|
},
|
|
1077
1082
|
hwb: {
|
|
1078
|
-
h:
|
|
1079
|
-
w: { "%":
|
|
1080
|
-
b: { "%":
|
|
1081
|
-
alpha:
|
|
1083
|
+
h: Rt,
|
|
1084
|
+
w: { "%": S["%"], number: S.number },
|
|
1085
|
+
b: { "%": S["%"], number: S.number },
|
|
1086
|
+
alpha: S
|
|
1082
1087
|
},
|
|
1083
1088
|
lab: {
|
|
1084
|
-
l: { "%":
|
|
1089
|
+
l: { "%": S["%"], number: S["%"] },
|
|
1085
1090
|
a: { number: { min: -125, max: 125 }, "%": { min: -100, max: 100 } },
|
|
1086
1091
|
b: { number: { min: -125, max: 125 }, "%": { min: -100, max: 100 } },
|
|
1087
|
-
alpha:
|
|
1092
|
+
alpha: S
|
|
1088
1093
|
},
|
|
1089
1094
|
lch: {
|
|
1090
|
-
l: { "%":
|
|
1091
|
-
c: { number: { min: 0, max: 150 }, "%":
|
|
1092
|
-
h:
|
|
1093
|
-
alpha:
|
|
1095
|
+
l: { "%": S["%"], number: S["%"] },
|
|
1096
|
+
c: { number: { min: 0, max: 150 }, "%": S["%"] },
|
|
1097
|
+
h: Rt,
|
|
1098
|
+
alpha: S
|
|
1094
1099
|
},
|
|
1095
1100
|
oklab: {
|
|
1096
|
-
l: { "%":
|
|
1101
|
+
l: { "%": S["%"], number: S.number },
|
|
1097
1102
|
a: { number: { min: -0.4, max: 0.4 }, "%": { min: -100, max: 100 } },
|
|
1098
1103
|
b: { number: { min: -0.4, max: 0.4 }, "%": { min: -100, max: 100 } },
|
|
1099
|
-
alpha:
|
|
1104
|
+
alpha: S
|
|
1100
1105
|
},
|
|
1101
1106
|
oklch: {
|
|
1102
|
-
l: { "%":
|
|
1103
|
-
c: { number: { min: 0, max: 0.5 }, "%":
|
|
1104
|
-
h:
|
|
1105
|
-
alpha:
|
|
1107
|
+
l: { "%": S["%"], number: S.number },
|
|
1108
|
+
c: { number: { min: 0, max: 0.5 }, "%": S["%"] },
|
|
1109
|
+
h: Rt,
|
|
1110
|
+
alpha: S
|
|
1106
1111
|
},
|
|
1107
1112
|
xyz: {
|
|
1108
|
-
x: { "%":
|
|
1109
|
-
y: { "%":
|
|
1110
|
-
z: { "%":
|
|
1111
|
-
alpha:
|
|
1113
|
+
x: { "%": S["%"], number: S.number },
|
|
1114
|
+
y: { "%": S["%"], number: S.number },
|
|
1115
|
+
z: { "%": S["%"], number: S.number },
|
|
1116
|
+
alpha: S
|
|
1112
1117
|
},
|
|
1113
1118
|
kelvin: {
|
|
1114
1119
|
kelvin: { number: { min: 1e3, max: 4e4 } },
|
|
1115
|
-
alpha:
|
|
1120
|
+
alpha: S
|
|
1116
1121
|
},
|
|
1117
1122
|
"srgb-linear": {
|
|
1118
|
-
r:
|
|
1119
|
-
g:
|
|
1120
|
-
b:
|
|
1121
|
-
alpha:
|
|
1123
|
+
r: D,
|
|
1124
|
+
g: D,
|
|
1125
|
+
b: D,
|
|
1126
|
+
alpha: S
|
|
1122
1127
|
},
|
|
1123
1128
|
"display-p3": {
|
|
1124
|
-
r:
|
|
1125
|
-
g:
|
|
1126
|
-
b:
|
|
1127
|
-
alpha:
|
|
1129
|
+
r: D,
|
|
1130
|
+
g: D,
|
|
1131
|
+
b: D,
|
|
1132
|
+
alpha: S
|
|
1128
1133
|
},
|
|
1129
1134
|
"a98-rgb": {
|
|
1130
|
-
r:
|
|
1131
|
-
g:
|
|
1132
|
-
b:
|
|
1133
|
-
alpha:
|
|
1135
|
+
r: D,
|
|
1136
|
+
g: D,
|
|
1137
|
+
b: D,
|
|
1138
|
+
alpha: S
|
|
1134
1139
|
},
|
|
1135
1140
|
"prophoto-rgb": {
|
|
1136
|
-
r:
|
|
1137
|
-
g:
|
|
1138
|
-
b:
|
|
1139
|
-
alpha:
|
|
1141
|
+
r: D,
|
|
1142
|
+
g: D,
|
|
1143
|
+
b: D,
|
|
1144
|
+
alpha: S
|
|
1140
1145
|
},
|
|
1141
1146
|
rec2020: {
|
|
1142
|
-
r:
|
|
1143
|
-
g:
|
|
1144
|
-
b:
|
|
1145
|
-
alpha:
|
|
1147
|
+
r: D,
|
|
1148
|
+
g: D,
|
|
1149
|
+
b: D,
|
|
1150
|
+
alpha: S
|
|
1146
1151
|
}
|
|
1147
|
-
}, G = "%",
|
|
1152
|
+
}, G = "%", Sr = {
|
|
1148
1153
|
rgb: {
|
|
1149
1154
|
r: "",
|
|
1150
1155
|
g: "",
|
|
@@ -1233,7 +1238,7 @@ const L = 255, y = {
|
|
|
1233
1238
|
b: "",
|
|
1234
1239
|
alpha: G
|
|
1235
1240
|
}
|
|
1236
|
-
},
|
|
1241
|
+
}, tc = {
|
|
1237
1242
|
rgb: "RGB",
|
|
1238
1243
|
hsl: "HSL",
|
|
1239
1244
|
hsv: "HSV",
|
|
@@ -1249,15 +1254,15 @@ const L = 255, y = {
|
|
|
1249
1254
|
"a98-rgb": "Adobe RGB",
|
|
1250
1255
|
"prophoto-rgb": "ProPhoto RGB",
|
|
1251
1256
|
rec2020: "Rec. 2020"
|
|
1252
|
-
},
|
|
1257
|
+
}, Po = [
|
|
1253
1258
|
0.3127 / 0.329,
|
|
1254
1259
|
1,
|
|
1255
1260
|
(1 - 0.3127 - 0.329) / 0.329
|
|
1256
|
-
],
|
|
1261
|
+
], zo = [
|
|
1257
1262
|
0.3457 / 0.3585,
|
|
1258
1263
|
1,
|
|
1259
1264
|
(1 - 0.3457 - 0.3585) / 0.3585
|
|
1260
|
-
],
|
|
1265
|
+
], Qe = [
|
|
1261
1266
|
1.0479297925449969,
|
|
1262
1267
|
0.022946870601609652,
|
|
1263
1268
|
-0.05019226628920524,
|
|
@@ -1267,10 +1272,10 @@ const L = 255, y = {
|
|
|
1267
1272
|
-0.009243040646204504,
|
|
1268
1273
|
0.015055191490298152,
|
|
1269
1274
|
0.7518742814281371
|
|
1270
|
-
],
|
|
1271
|
-
D65:
|
|
1272
|
-
D50:
|
|
1273
|
-
},
|
|
1275
|
+
], Cr = ct(Qe), xr = {
|
|
1276
|
+
D65: Po,
|
|
1277
|
+
D50: zo
|
|
1278
|
+
}, Er = [
|
|
1274
1279
|
0.819022437996703,
|
|
1275
1280
|
0.3619062600528904,
|
|
1276
1281
|
-0.1288737815209879,
|
|
@@ -1280,7 +1285,7 @@ const L = 255, y = {
|
|
|
1280
1285
|
0.0481771893596242,
|
|
1281
1286
|
0.2642395317527308,
|
|
1282
1287
|
0.6335478284694309
|
|
1283
|
-
],
|
|
1288
|
+
], Lo = ct(Er), vr = [
|
|
1284
1289
|
0.210454268309314,
|
|
1285
1290
|
0.7936177747023054,
|
|
1286
1291
|
-0.0040720430116193,
|
|
@@ -1290,7 +1295,7 @@ const L = 255, y = {
|
|
|
1290
1295
|
0.0259040424655478,
|
|
1291
1296
|
0.7827717124575296,
|
|
1292
1297
|
-0.8086757549230774
|
|
1293
|
-
],
|
|
1298
|
+
], Fo = ct(vr), M = [
|
|
1294
1299
|
4.0767416621,
|
|
1295
1300
|
-3.3077115913,
|
|
1296
1301
|
0.2309699292,
|
|
@@ -1314,7 +1319,7 @@ const L = 255, y = {
|
|
|
1314
1319
|
l: [1, 0.3963377774, 0.2158037573],
|
|
1315
1320
|
m: [1, -0.1055613458, -0.0638541728],
|
|
1316
1321
|
s: [1, -0.0894841775, -1.291485548]
|
|
1317
|
-
},
|
|
1322
|
+
}, $o = [
|
|
1318
1323
|
{
|
|
1319
1324
|
// Red sector: -1.88170328*a - 0.80936493*b > 1
|
|
1320
1325
|
test: (e, t) => -1.88170328 * e - 0.80936493 * t > 1,
|
|
@@ -1351,7 +1356,7 @@ const L = 255, y = {
|
|
|
1351
1356
|
wm: -0.7034186147,
|
|
1352
1357
|
ws: 1.707614701
|
|
1353
1358
|
}
|
|
1354
|
-
],
|
|
1359
|
+
], Bn = {
|
|
1355
1360
|
aliceblue: "#f0f8ff",
|
|
1356
1361
|
antiquewhite: "#faebd7",
|
|
1357
1362
|
aqua: "#00ffff",
|
|
@@ -1502,7 +1507,7 @@ const L = 255, y = {
|
|
|
1502
1507
|
yellow: "#ffff00",
|
|
1503
1508
|
yellowgreen: "#9acd32",
|
|
1504
1509
|
padaleckipink: "oklch(100% 0.42 360deg / 71.70%)",
|
|
1505
|
-
"lodge
|
|
1510
|
+
"lodge blu color": "rgb(53 101 144)",
|
|
1506
1511
|
lavendi: "oklch(79.90% 0.11 318.24deg / 100%)",
|
|
1507
1512
|
shadyshroom: "oklch(53% 0.07 21.60deg / 100%)",
|
|
1508
1513
|
patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)"
|
|
@@ -1519,53 +1524,53 @@ function B(e, t, n, r = 0, o = 1) {
|
|
|
1519
1524
|
function Xt(e, t, n) {
|
|
1520
1525
|
return (1 - e) * t + e * n;
|
|
1521
1526
|
}
|
|
1522
|
-
function
|
|
1527
|
+
function ec(e, t, n) {
|
|
1523
1528
|
return t = t === 0 ? 1e-9 : t, t * Math.pow(n / t, e);
|
|
1524
1529
|
}
|
|
1525
|
-
function
|
|
1530
|
+
function Ht(e, t) {
|
|
1526
1531
|
const n = t.length - 1, r = [...t];
|
|
1527
1532
|
for (let o = 1; o <= n; o++)
|
|
1528
1533
|
for (let s = 0; s <= n - o; s++)
|
|
1529
1534
|
r[s] = Xt(e, r[s], r[s + 1]);
|
|
1530
1535
|
return r[0];
|
|
1531
1536
|
}
|
|
1532
|
-
function
|
|
1533
|
-
return [
|
|
1537
|
+
function Mr(e, t, n, r, o) {
|
|
1538
|
+
return [Ht(e, [0, t, r, 1]), Ht(e, [0, n, o, 1])];
|
|
1534
1539
|
}
|
|
1535
|
-
function
|
|
1540
|
+
function ce(e, t) {
|
|
1536
1541
|
const n = t.map((o) => o[0]), r = t.map((o) => o[1]);
|
|
1537
|
-
return [
|
|
1542
|
+
return [Ht(e, n), Ht(e, r)];
|
|
1538
1543
|
}
|
|
1539
|
-
function
|
|
1544
|
+
function nc(e, t, n, r) {
|
|
1540
1545
|
let o = "M0 0";
|
|
1541
1546
|
for (let s = 0; s <= 1; s += 1e-3) {
|
|
1542
|
-
const [i, a] =
|
|
1547
|
+
const [i, a] = Mr(s, e, t, n, r);
|
|
1543
1548
|
o += ` L${i} ${a}`;
|
|
1544
1549
|
}
|
|
1545
1550
|
return `<path d="${o}"/>`;
|
|
1546
1551
|
}
|
|
1547
|
-
function
|
|
1552
|
+
function rc(e, t, n, r) {
|
|
1548
1553
|
const o = (s) => s.toFixed(2);
|
|
1549
1554
|
return `cubic-bezier(${o(e)}, ${o(t)}, ${o(n)}, ${o(r)})`;
|
|
1550
1555
|
}
|
|
1551
|
-
const
|
|
1552
|
-
function
|
|
1556
|
+
const Tr = 2.4, jt = 0.055, tn = 12.92, Uo = 0.04045, Ar = Uo / tn;
|
|
1557
|
+
function Se(e) {
|
|
1553
1558
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1554
|
-
return n <=
|
|
1559
|
+
return n <= Ar ? e / tn : t * ((n + jt) / (1 + jt)) ** Tr;
|
|
1555
1560
|
}
|
|
1556
|
-
function
|
|
1561
|
+
function Ce(e) {
|
|
1557
1562
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1558
|
-
return n <=
|
|
1563
|
+
return n <= Ar ? e * tn : t * ((1 + jt) * n ** (1 / Tr) - jt);
|
|
1559
1564
|
}
|
|
1560
|
-
function
|
|
1565
|
+
function xe(e, t, n) {
|
|
1561
1566
|
return Math.min(Math.max(e, t), n);
|
|
1562
1567
|
}
|
|
1563
|
-
const
|
|
1564
|
-
function
|
|
1568
|
+
const oc = 0.02;
|
|
1569
|
+
function sc(e, t, n, r, o, s) {
|
|
1565
1570
|
const i = e - r, a = t - o, c = n - s;
|
|
1566
1571
|
return Math.sqrt(i * i + a * a + c * c);
|
|
1567
1572
|
}
|
|
1568
|
-
function
|
|
1573
|
+
function en(e, t, n) {
|
|
1569
1574
|
const r = e + $.l[1] * t + $.l[2] * n, o = e + $.m[1] * t + $.m[2] * n, s = e + $.s[1] * t + $.s[2] * n, i = r * r * r, a = o * o * o, c = s * s * s;
|
|
1570
1575
|
return [
|
|
1571
1576
|
M[0] * i + M[1] * a + M[2] * c,
|
|
@@ -1573,24 +1578,24 @@ function qe(e, t, n) {
|
|
|
1573
1578
|
M[6] * i + M[7] * a + M[8] * c
|
|
1574
1579
|
];
|
|
1575
1580
|
}
|
|
1576
|
-
function
|
|
1581
|
+
function Do(e, t, n) {
|
|
1577
1582
|
return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
|
|
1578
1583
|
}
|
|
1579
|
-
function
|
|
1580
|
-
const n =
|
|
1584
|
+
function Go(e, t) {
|
|
1585
|
+
const n = $o.find((x) => x.test(e, t)), { k0: r, k1: o, k2: s, k3: i, k4: a, wl: c, wm: l, ws: f } = n;
|
|
1581
1586
|
let p = r + o * e + s * t + i * e * e + a * e * t;
|
|
1582
1587
|
const u = $.l[1] * e + $.l[2] * t, h = $.m[1] * e + $.m[2] * t, m = $.s[1] * e + $.s[2] * t;
|
|
1583
1588
|
{
|
|
1584
|
-
const x = 1 + p * u, b = 1 + p * h, I = 1 + p * m, E = x * x * x, v = b * b * b, F = I * I * I, Q = 3 * u * x * x, ut = 3 * h * b * b, ft = 3 * m * I * I,
|
|
1585
|
-
p = p -
|
|
1589
|
+
const x = 1 + p * u, b = 1 + p * h, I = 1 + p * m, E = x * x * x, v = b * b * b, F = I * I * I, Q = 3 * u * x * x, ut = 3 * h * b * b, ft = 3 * m * I * I, At = 6 * u * u * x, It = 6 * h * h * b, Ot = 6 * m * m * I, wt = c * E + l * v + f * F, pt = c * Q + l * ut + f * ft, zt = c * At + l * It + f * Ot;
|
|
1590
|
+
p = p - wt * pt / (pt * pt - 0.5 * wt * zt);
|
|
1586
1591
|
}
|
|
1587
1592
|
return p;
|
|
1588
1593
|
}
|
|
1589
|
-
function
|
|
1590
|
-
const n =
|
|
1594
|
+
function Vo(e, t) {
|
|
1595
|
+
const n = Go(e, t), [r, o, s] = en(1, n * e, n * t), i = Math.cbrt(1 / Math.max(r, o, s)), a = i * n;
|
|
1591
1596
|
return { L: i, C: a };
|
|
1592
1597
|
}
|
|
1593
|
-
function
|
|
1598
|
+
function Wo(e, t, n, r, o, s) {
|
|
1594
1599
|
let i;
|
|
1595
1600
|
if ((n - o) * s.C - (s.L - o) * r <= 0)
|
|
1596
1601
|
i = s.C * o / (r * s.L + s.C * (o - n));
|
|
@@ -1598,69 +1603,69 @@ function Uo(e, t, n, r, o, s) {
|
|
|
1598
1603
|
i = s.C * (o - 1) / (r * (s.L - 1) + s.C * (o - n));
|
|
1599
1604
|
const a = n - o, c = r, l = $.l[1] * e + $.l[2] * t, f = $.m[1] * e + $.m[2] * t, p = $.s[1] * e + $.s[2] * t, u = a + c * l, h = a + c * f, m = a + c * p;
|
|
1600
1605
|
{
|
|
1601
|
-
const x = o * (1 - i) + i * n, b = i * r, I = x + b * l, E = x + b * f, v = x + b * p, F = I * I * I, Q = E * E * E, ut = v * v * v, ft = 3 * u * I * I,
|
|
1602
|
-
let
|
|
1603
|
-
const
|
|
1604
|
-
let
|
|
1605
|
-
const
|
|
1606
|
-
let
|
|
1607
|
-
|
|
1606
|
+
const x = o * (1 - i) + i * n, b = i * r, I = x + b * l, E = x + b * f, v = x + b * p, F = I * I * I, Q = E * E * E, ut = v * v * v, ft = 3 * u * I * I, At = 3 * h * E * E, It = 3 * m * v * v, Ot = 6 * u * u * I, wt = 6 * h * h * E, pt = 6 * m * m * v, zt = M[0] * F + M[1] * Q + M[2] * ut - 1, me = M[0] * ft + M[1] * At + M[2] * It, Eo = M[0] * Ot + M[1] * wt + M[2] * pt, xn = me / (me * me - 0.5 * zt * Eo);
|
|
1607
|
+
let be = -zt * xn;
|
|
1608
|
+
const En = M[3] * F + M[4] * Q + M[5] * ut - 1, ge = M[3] * ft + M[4] * At + M[5] * It, vo = M[3] * Ot + M[4] * wt + M[5] * pt, vn = ge / (ge * ge - 0.5 * En * vo);
|
|
1609
|
+
let de = -En * vn;
|
|
1610
|
+
const Mn = M[6] * F + M[7] * Q + M[8] * ut - 1, we = M[6] * ft + M[7] * At + M[8] * It, Mo = M[6] * Ot + M[7] * wt + M[8] * pt, Tn = we / (we * we - 0.5 * Mn * Mo);
|
|
1611
|
+
let ke = -Mn * Tn;
|
|
1612
|
+
be = xn >= 0 ? be : 1 / 0, de = vn >= 0 ? de : 1 / 0, ke = Tn >= 0 ? ke : 1 / 0, i += Math.min(be, de, ke);
|
|
1608
1613
|
}
|
|
1609
1614
|
}
|
|
1610
1615
|
return i;
|
|
1611
1616
|
}
|
|
1612
|
-
const
|
|
1613
|
-
function
|
|
1614
|
-
const [r, o, s] =
|
|
1615
|
-
if (
|
|
1617
|
+
const Xo = 1e-5, Ho = 0.05;
|
|
1618
|
+
function jo(e, t, n) {
|
|
1619
|
+
const [r, o, s] = en(e, t, n);
|
|
1620
|
+
if (Do(r, o, s))
|
|
1616
1621
|
return [e, t, n];
|
|
1617
|
-
const i = Math.max(
|
|
1622
|
+
const i = Math.max(Xo, Math.sqrt(t * t + n * n)), a = t / i, c = n / i, l = Vo(a, c), f = e - 0.5, p = 0.5 + Math.abs(f) + Ho * i, u = 0.5 * (1 + Math.sign(f) * (p - Math.sqrt(p * p - 2 * Math.abs(f)))), h = Wo(a, c, e, i, u, l), m = u * (1 - h) + h * e, x = h * i;
|
|
1618
1623
|
return [m, x * a, x * c];
|
|
1619
1624
|
}
|
|
1620
|
-
function
|
|
1621
|
-
const r =
|
|
1625
|
+
function Yo(e, t, n) {
|
|
1626
|
+
const r = Se(e), o = Se(t), s = Se(n), i = Math.cbrt(tt[0] * r + tt[1] * o + tt[2] * s), a = Math.cbrt(tt[3] * r + tt[4] * o + tt[5] * s), c = Math.cbrt(tt[6] * r + tt[7] * o + tt[8] * s);
|
|
1622
1627
|
return [
|
|
1623
1628
|
0.2104542553 * i + 0.793617785 * a - 0.0040720468 * c,
|
|
1624
1629
|
1.9779984951 * i - 2.428592205 * a + 0.4505937099 * c,
|
|
1625
1630
|
0.0259040371 * i + 0.7827717662 * a - 0.808675766 * c
|
|
1626
1631
|
];
|
|
1627
1632
|
}
|
|
1628
|
-
function
|
|
1633
|
+
function qo(e, t, n) {
|
|
1629
1634
|
if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1)
|
|
1630
1635
|
return [e, t, n];
|
|
1631
|
-
const [r, o, s] =
|
|
1636
|
+
const [r, o, s] = Yo(e, t, n), [i, a, c] = jo(r, o, s), [l, f, p] = en(i, a, c);
|
|
1632
1637
|
return [
|
|
1633
|
-
Ce(
|
|
1634
|
-
Ce(
|
|
1635
|
-
Ce(
|
|
1638
|
+
xe(Ce(l), 0, 1),
|
|
1639
|
+
xe(Ce(f), 0, 1),
|
|
1640
|
+
xe(Ce(p), 0, 1)
|
|
1636
1641
|
];
|
|
1637
1642
|
}
|
|
1638
|
-
const
|
|
1639
|
-
const t = C[e], n =
|
|
1643
|
+
const ic = (e) => {
|
|
1644
|
+
const t = C[e], n = Sr[e];
|
|
1640
1645
|
return Object.entries(t).reduce((r, [o, s]) => {
|
|
1641
1646
|
const i = n[o];
|
|
1642
1647
|
let { min: a, max: c } = s[i] ?? s.number;
|
|
1643
1648
|
return a = `${a}${i}`, c = `${c}${i}`, r[o] = { min: a, max: c }, r;
|
|
1644
1649
|
}, {});
|
|
1645
|
-
}, et = 16,
|
|
1650
|
+
}, et = 16, Zo = (e) => {
|
|
1646
1651
|
if (e = e.slice(1), e.length <= 4) {
|
|
1647
1652
|
const t = parseInt(e[0] + e[0], et), n = parseInt(e[1] + e[1], et), r = parseInt(e[2] + e[2], et), o = e[3] ? parseInt(e[3] + e[3], et) / L : 1;
|
|
1648
|
-
return new
|
|
1653
|
+
return new U(t, n, r, o);
|
|
1649
1654
|
} else {
|
|
1650
1655
|
const t = parseInt(e.slice(0, 2), et), n = parseInt(e.slice(2, 4), et), r = parseInt(e.slice(4, 6), et), o = e.length === 8 ? parseInt(e.slice(6, 8), et) / L : 1;
|
|
1651
|
-
return new
|
|
1656
|
+
return new U(t, n, r, o);
|
|
1652
1657
|
}
|
|
1653
|
-
},
|
|
1658
|
+
}, ac = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1654
1659
|
const o = (s) => {
|
|
1655
1660
|
const i = s.toString(et);
|
|
1656
1661
|
return i.length === 1 ? "0" + i : i;
|
|
1657
1662
|
};
|
|
1658
1663
|
return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r * L)) : ""}`;
|
|
1659
|
-
},
|
|
1660
|
-
e = _(e,
|
|
1664
|
+
}, Ir = 1e3, Or = 4e4, Rr = 100, Br = ({ kelvin: e, alpha: t }) => {
|
|
1665
|
+
e = _(e, Ir, Or) / Rr;
|
|
1661
1666
|
let n, r, o;
|
|
1662
|
-
return e <= 66 ? n = L : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = _(n, 0, L) / L, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = _(r, 0, L) / L, e >= 66 ? o = L : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = _(o, 0, L) / L, new
|
|
1663
|
-
},
|
|
1667
|
+
return e <= 66 ? n = L : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = _(n, 0, L) / L, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = _(r, 0, L) / L, e >= 66 ? o = L : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = _(o, 0, L) / L, new U(n, r, o, t);
|
|
1668
|
+
}, Ko = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1664
1669
|
e = _(e * L, 0, L), t = _(t * L, 0, L), n = _(n * L, 0, L);
|
|
1665
1670
|
let o;
|
|
1666
1671
|
if (n === L ? o = 6600 : n === 0 ? o = 1900 : o = Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < L) {
|
|
@@ -1668,26 +1673,27 @@ const oc = (e) => {
|
|
|
1668
1673
|
o = Math.max(o, i);
|
|
1669
1674
|
}
|
|
1670
1675
|
const s = o <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -0.0755148492) + 60;
|
|
1671
|
-
return o = (o + s) / 2, o = _(Math.round(o *
|
|
1672
|
-
},
|
|
1676
|
+
return o = (o + s) / 2, o = _(Math.round(o * Rr), Ir, Or), new dr(o, r);
|
|
1677
|
+
}, Nr = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
1673
1678
|
const o = n - n * t / 2;
|
|
1674
1679
|
let s;
|
|
1675
|
-
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new
|
|
1676
|
-
},
|
|
1680
|
+
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new dt(e, s, o, r);
|
|
1681
|
+
}, _r = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1677
1682
|
const o = n + t * Math.min(n, 1 - n);
|
|
1678
1683
|
let s;
|
|
1679
|
-
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new
|
|
1680
|
-
},
|
|
1684
|
+
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new We(e, s, o, r);
|
|
1685
|
+
}, Jo = ({ h: e, w: t, b: n, alpha: r }) => {
|
|
1681
1686
|
let o, s;
|
|
1682
1687
|
const i = t + n;
|
|
1683
|
-
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s),
|
|
1684
|
-
},
|
|
1685
|
-
const { h: o, s, v: i } =
|
|
1686
|
-
return new
|
|
1687
|
-
},
|
|
1688
|
+
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s), Nr(new We(e, o, s, r));
|
|
1689
|
+
}, Qo = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1690
|
+
const { h: o, s, v: i } = _r(new dt(e, t, n, r));
|
|
1691
|
+
return new Xe(o, i * (1 - s), 1 - i, r);
|
|
1692
|
+
}, Pr = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1688
1693
|
const o = Math.max(e, t, n), s = Math.min(e, t, n);
|
|
1689
1694
|
let [i, a, c] = [0, 0, (o + s) / 2];
|
|
1690
1695
|
const l = o - s;
|
|
1696
|
+
if (l === 0) return new dt(0, 0, c, r);
|
|
1691
1697
|
switch (a = l / (1 - Math.abs(2 * c - 1)), o) {
|
|
1692
1698
|
case e:
|
|
1693
1699
|
i = (t - n) / l + (t < n ? 6 : 0);
|
|
@@ -1699,26 +1705,26 @@ const oc = (e) => {
|
|
|
1699
1705
|
i = (e - t) / l + 4;
|
|
1700
1706
|
break;
|
|
1701
1707
|
}
|
|
1702
|
-
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new
|
|
1708
|
+
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new dt(i, a, c, r);
|
|
1703
1709
|
};
|
|
1704
|
-
function
|
|
1710
|
+
function ts({ h: e, s: t, l: n, alpha: r }) {
|
|
1705
1711
|
const o = (1 - Math.abs(2 * n - 1)) * t, s = o * (1 - Math.abs(e * 6 % 2 - 1)), i = n - o / 2;
|
|
1706
1712
|
let a, c, l;
|
|
1707
|
-
return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new
|
|
1713
|
+
return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new U(a + i, c + i, l + i, r);
|
|
1708
1714
|
}
|
|
1709
|
-
const
|
|
1710
|
-
function
|
|
1715
|
+
const es = 216 / 24389, ns = 24 / 116, Pe = 24389 / 27, rs = 8, _t = 16, Pt = 116, zr = 500, Lr = 200;
|
|
1716
|
+
function os(e) {
|
|
1711
1717
|
if (e.whitePoint === "D50") return [e.x, e.y, e.z];
|
|
1712
|
-
if (e.whitePoint === "D65") return P([e.x, e.y, e.z],
|
|
1718
|
+
if (e.whitePoint === "D65") return P([e.x, e.y, e.z], Qe);
|
|
1713
1719
|
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1714
1720
|
}
|
|
1715
|
-
function
|
|
1721
|
+
function ss(e) {
|
|
1716
1722
|
if (e.whitePoint === "D65") return [e.x, e.y, e.z];
|
|
1717
|
-
if (e.whitePoint === "D50") return P([e.x, e.y, e.z],
|
|
1723
|
+
if (e.whitePoint === "D50") return P([e.x, e.y, e.z], Cr);
|
|
1718
1724
|
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1719
1725
|
}
|
|
1720
|
-
function
|
|
1721
|
-
const n = (I) => I >
|
|
1726
|
+
function nn(e, t = "D50") {
|
|
1727
|
+
const n = (I) => I > es ? Math.cbrt(I) : (Pe * I + _t) / Pt, r = xr[t], [o, s, i] = os(e), a = o / r[0], c = s / r[1], l = i / r[2], f = n(a), p = n(c), u = n(l), h = Pt * p - _t, m = zr * (f - p), x = Lr * (p - u), b = new ie(
|
|
1722
1728
|
B(
|
|
1723
1729
|
h,
|
|
1724
1730
|
C.lab.l.number.min,
|
|
@@ -1738,8 +1744,8 @@ function Je(e, t = "D50") {
|
|
|
1738
1744
|
);
|
|
1739
1745
|
return b.whitePoint = t, b;
|
|
1740
1746
|
}
|
|
1741
|
-
function
|
|
1742
|
-
const t = (E) => E >
|
|
1747
|
+
function rn(e) {
|
|
1748
|
+
const t = (E) => E > ns ? E ** 3 : (Pt * E - _t) / Pe, n = (E) => E > rs ? ((E + _t) / Pt) ** 3 : E / Pe, r = xr[e.whitePoint];
|
|
1743
1749
|
let { l: o, a: s, b: i, alpha: a } = e;
|
|
1744
1750
|
o = B(
|
|
1745
1751
|
o,
|
|
@@ -1760,12 +1766,12 @@ function Qe(e) {
|
|
|
1760
1766
|
C.lab.b.number.min,
|
|
1761
1767
|
C.lab.b.number.max
|
|
1762
1768
|
);
|
|
1763
|
-
const c = (o +
|
|
1769
|
+
const c = (o + _t) / Pt, l = s / zr + c, f = c - i / Lr, [p, u, h] = [t(l), n(o), t(f)];
|
|
1764
1770
|
let m = p * r[0], x = u * r[1], b = h * r[2];
|
|
1765
|
-
const I = new
|
|
1766
|
-
return I.whitePoint = e.whitePoint, [m, x, b] =
|
|
1771
|
+
const I = new W(m, x, b, a);
|
|
1772
|
+
return I.whitePoint = e.whitePoint, [m, x, b] = ss(I), I.whitePoint = "D65", I.x = m, I.y = x, I.z = b, I;
|
|
1767
1773
|
}
|
|
1768
|
-
const
|
|
1774
|
+
const on = [
|
|
1769
1775
|
0.41239079926595934,
|
|
1770
1776
|
0.357584339383878,
|
|
1771
1777
|
0.1804807884018343,
|
|
@@ -1775,28 +1781,28 @@ const tn = [
|
|
|
1775
1781
|
0.01933081871559182,
|
|
1776
1782
|
0.11919477979462598,
|
|
1777
1783
|
0.9505321522496607
|
|
1778
|
-
],
|
|
1779
|
-
function
|
|
1784
|
+
], Fr = ct(on), $r = 2.4, Yt = 0.055, sn = 12.92, is = 0.04045, Ur = is / sn;
|
|
1785
|
+
function Et(e) {
|
|
1780
1786
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1781
|
-
return n <=
|
|
1787
|
+
return n <= Ur ? e / sn : t * ((n + Yt) / (1 + Yt)) ** $r;
|
|
1782
1788
|
}
|
|
1783
|
-
function
|
|
1789
|
+
function vt(e) {
|
|
1784
1790
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1785
|
-
return n <=
|
|
1791
|
+
return n <= Ur ? e * sn : t * ((1 + Yt) * n ** (1 / $r) - Yt);
|
|
1786
1792
|
}
|
|
1787
|
-
function
|
|
1788
|
-
const o = [
|
|
1789
|
-
return new
|
|
1793
|
+
function an({ r: e, g: t, b: n, alpha: r }) {
|
|
1794
|
+
const o = [Et(e), Et(t), Et(n)], [s, i, a] = P(o, on);
|
|
1795
|
+
return new W(s, i, a, r);
|
|
1790
1796
|
}
|
|
1791
|
-
const
|
|
1792
|
-
const s = P([e, t, n],
|
|
1797
|
+
const cn = ({ x: e, y: t, z: n, alpha: r }, o = !0) => {
|
|
1798
|
+
const s = P([e, t, n], Fr), i = vt(s[0]), a = vt(s[1]), c = vt(s[2]);
|
|
1793
1799
|
if (o) {
|
|
1794
|
-
const l = Ps(new
|
|
1795
|
-
return new
|
|
1800
|
+
const l = Ps(new U(i, a, c, r));
|
|
1801
|
+
return new U(l.r, l.g, l.b, r);
|
|
1796
1802
|
} else
|
|
1797
|
-
return new
|
|
1803
|
+
return new U(i, a, c, r);
|
|
1798
1804
|
};
|
|
1799
|
-
function
|
|
1805
|
+
function as({ l: e, c: t, h: n, alpha: r }) {
|
|
1800
1806
|
t = B(
|
|
1801
1807
|
t,
|
|
1802
1808
|
0,
|
|
@@ -1805,7 +1811,7 @@ function os({ l: e, c: t, h: n, alpha: r }) {
|
|
|
1805
1811
|
C.lch.c.number.max
|
|
1806
1812
|
);
|
|
1807
1813
|
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
1808
|
-
return new
|
|
1814
|
+
return new ie(
|
|
1809
1815
|
e,
|
|
1810
1816
|
B(
|
|
1811
1817
|
s,
|
|
@@ -1820,7 +1826,7 @@ function os({ l: e, c: t, h: n, alpha: r }) {
|
|
|
1820
1826
|
r
|
|
1821
1827
|
);
|
|
1822
1828
|
}
|
|
1823
|
-
function
|
|
1829
|
+
function cs({ l: e, a: t, b: n, alpha: r }) {
|
|
1824
1830
|
t = B(
|
|
1825
1831
|
t,
|
|
1826
1832
|
0,
|
|
@@ -1836,7 +1842,7 @@ function ss({ l: e, a: t, b: n, alpha: r }) {
|
|
|
1836
1842
|
);
|
|
1837
1843
|
const o = Math.hypot(t, n);
|
|
1838
1844
|
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
1839
|
-
return s < 0 && (s += 1), new
|
|
1845
|
+
return s < 0 && (s += 1), new He(
|
|
1840
1846
|
e,
|
|
1841
1847
|
B(
|
|
1842
1848
|
o,
|
|
@@ -1847,7 +1853,7 @@ function ss({ l: e, a: t, b: n, alpha: r }) {
|
|
|
1847
1853
|
r
|
|
1848
1854
|
);
|
|
1849
1855
|
}
|
|
1850
|
-
function
|
|
1856
|
+
function ln({ l: e, a: t, b: n, alpha: r }) {
|
|
1851
1857
|
t = B(
|
|
1852
1858
|
t,
|
|
1853
1859
|
0,
|
|
@@ -1861,12 +1867,12 @@ function on({ l: e, a: t, b: n, alpha: r }) {
|
|
|
1861
1867
|
C.oklab.b.number.min,
|
|
1862
1868
|
C.oklab.b.number.max
|
|
1863
1869
|
);
|
|
1864
|
-
const o = P([e, t, n],
|
|
1865
|
-
return new
|
|
1870
|
+
const o = P([e, t, n], Fo), s = [o[0] * o[0] * o[0], o[1] * o[1] * o[1], o[2] * o[2] * o[2]], [i, a, c] = P(s, Lo);
|
|
1871
|
+
return new W(i, a, c, r);
|
|
1866
1872
|
}
|
|
1867
|
-
function
|
|
1868
|
-
const { x: t, y: n, z: r } = e, o = P([t, n, r],
|
|
1869
|
-
return new
|
|
1873
|
+
function un(e) {
|
|
1874
|
+
const { x: t, y: n, z: r } = e, o = P([t, n, r], Er), s = [Math.cbrt(o[0]), Math.cbrt(o[1]), Math.cbrt(o[2])], [i, a, c] = P(s, vr);
|
|
1875
|
+
return new ae(
|
|
1870
1876
|
i,
|
|
1871
1877
|
B(
|
|
1872
1878
|
a,
|
|
@@ -1881,115 +1887,115 @@ function sn(e) {
|
|
|
1881
1887
|
e.alpha
|
|
1882
1888
|
);
|
|
1883
1889
|
}
|
|
1884
|
-
function
|
|
1885
|
-
const t =
|
|
1886
|
-
return
|
|
1890
|
+
function ls(e) {
|
|
1891
|
+
const t = ln(e);
|
|
1892
|
+
return nn(t);
|
|
1887
1893
|
}
|
|
1888
|
-
function
|
|
1889
|
-
const t =
|
|
1890
|
-
return
|
|
1894
|
+
function us(e) {
|
|
1895
|
+
const t = rn(e);
|
|
1896
|
+
return un(t);
|
|
1891
1897
|
}
|
|
1892
|
-
function
|
|
1898
|
+
function Dr({ l: e, a: t, b: n, alpha: r }) {
|
|
1893
1899
|
t = B(t, 0, 1, C.oklab.a.number.min, C.oklab.a.number.max), n = B(n, 0, 1, C.oklab.b.number.min, C.oklab.b.number.max);
|
|
1894
1900
|
const o = Math.hypot(t, n);
|
|
1895
1901
|
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
1896
|
-
return s < 0 && (s += 1), new
|
|
1902
|
+
return s < 0 && (s += 1), new je(
|
|
1897
1903
|
e,
|
|
1898
1904
|
B(o, C.oklch.c.number.min, C.oklch.c.number.max),
|
|
1899
1905
|
s,
|
|
1900
1906
|
r
|
|
1901
1907
|
);
|
|
1902
1908
|
}
|
|
1903
|
-
function
|
|
1909
|
+
function Gr({ l: e, c: t, h: n, alpha: r }) {
|
|
1904
1910
|
t = B(t, 0, 1, C.oklch.c.number.min, C.oklch.c.number.max);
|
|
1905
1911
|
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
1906
|
-
return new
|
|
1912
|
+
return new ae(
|
|
1907
1913
|
e,
|
|
1908
1914
|
B(s, C.oklab.a.number.min, C.oklab.a.number.max),
|
|
1909
1915
|
B(i, C.oklab.b.number.min, C.oklab.b.number.max),
|
|
1910
1916
|
r
|
|
1911
1917
|
);
|
|
1912
1918
|
}
|
|
1913
|
-
function
|
|
1914
|
-
return
|
|
1919
|
+
function cc(e) {
|
|
1920
|
+
return ls(Gr(e));
|
|
1915
1921
|
}
|
|
1916
|
-
function
|
|
1917
|
-
return
|
|
1922
|
+
function lc(e) {
|
|
1923
|
+
return Dr(us(e));
|
|
1918
1924
|
}
|
|
1919
|
-
function
|
|
1920
|
-
const t =
|
|
1921
|
-
return nn(t);
|
|
1922
|
-
}
|
|
1923
|
-
function cn(e) {
|
|
1924
|
-
const t = rn(e);
|
|
1925
|
-
return Rr(t);
|
|
1926
|
-
}
|
|
1927
|
-
function cs(e) {
|
|
1928
|
-
const t = Ir(e);
|
|
1925
|
+
function fn(e) {
|
|
1926
|
+
const t = ts(e);
|
|
1929
1927
|
return an(t);
|
|
1930
1928
|
}
|
|
1931
|
-
function
|
|
1929
|
+
function pn(e) {
|
|
1932
1930
|
const t = cn(e);
|
|
1933
|
-
return
|
|
1934
|
-
}
|
|
1935
|
-
function us(e) {
|
|
1936
|
-
const t = Zo(e);
|
|
1937
|
-
return an(t);
|
|
1931
|
+
return Pr(t);
|
|
1938
1932
|
}
|
|
1939
1933
|
function fs(e) {
|
|
1940
|
-
const t =
|
|
1941
|
-
return
|
|
1934
|
+
const t = Nr(e);
|
|
1935
|
+
return fn(t);
|
|
1942
1936
|
}
|
|
1943
1937
|
function ps(e) {
|
|
1944
|
-
const t =
|
|
1945
|
-
return
|
|
1938
|
+
const t = pn(e);
|
|
1939
|
+
return _r(t);
|
|
1946
1940
|
}
|
|
1947
1941
|
function hs(e) {
|
|
1948
|
-
const t =
|
|
1949
|
-
return
|
|
1942
|
+
const t = Jo(e);
|
|
1943
|
+
return fn(t);
|
|
1950
1944
|
}
|
|
1951
1945
|
function ms(e) {
|
|
1952
|
-
const t =
|
|
1953
|
-
return
|
|
1946
|
+
const t = pn(e);
|
|
1947
|
+
return Qo(t);
|
|
1954
1948
|
}
|
|
1955
1949
|
function bs(e) {
|
|
1956
|
-
const t =
|
|
1957
|
-
return
|
|
1950
|
+
const t = as(e);
|
|
1951
|
+
return rn(t);
|
|
1958
1952
|
}
|
|
1959
1953
|
function gs(e) {
|
|
1960
|
-
const t =
|
|
1961
|
-
return
|
|
1954
|
+
const t = nn(e);
|
|
1955
|
+
return cs(t);
|
|
1962
1956
|
}
|
|
1963
1957
|
function ds(e) {
|
|
1964
|
-
const t =
|
|
1965
|
-
return
|
|
1966
|
-
}
|
|
1967
|
-
const Dr = 563 / 256;
|
|
1968
|
-
function xe(e) {
|
|
1969
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** Dr;
|
|
1958
|
+
const t = Gr(e);
|
|
1959
|
+
return ln(t);
|
|
1970
1960
|
}
|
|
1971
1961
|
function ws(e) {
|
|
1972
|
-
|
|
1962
|
+
const t = un(e);
|
|
1963
|
+
return Dr(t);
|
|
1964
|
+
}
|
|
1965
|
+
function ks(e) {
|
|
1966
|
+
const t = Br(e);
|
|
1967
|
+
return an(t);
|
|
1968
|
+
}
|
|
1969
|
+
function ys(e) {
|
|
1970
|
+
const t = cn(e);
|
|
1971
|
+
return Ko(t);
|
|
1973
1972
|
}
|
|
1974
|
-
const
|
|
1973
|
+
const Vr = 563 / 256;
|
|
1975
1974
|
function Ee(e) {
|
|
1975
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** Vr;
|
|
1976
|
+
}
|
|
1977
|
+
function ve(e) {
|
|
1978
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / Vr);
|
|
1979
|
+
}
|
|
1980
|
+
const Wr = 1 / 512, Xr = 1.8;
|
|
1981
|
+
function Me(e) {
|
|
1976
1982
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1977
|
-
return t * (n <=
|
|
1983
|
+
return t * (n <= Wr * 16 ? n / 16 : n ** Xr);
|
|
1978
1984
|
}
|
|
1979
|
-
function
|
|
1985
|
+
function Te(e) {
|
|
1980
1986
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1981
|
-
return t * (n >=
|
|
1987
|
+
return t * (n >= Wr ? n ** (1 / Xr) : n * 16);
|
|
1982
1988
|
}
|
|
1983
|
-
const
|
|
1984
|
-
function
|
|
1989
|
+
const qt = 1.09929682680944, Hr = 0.018053968510807;
|
|
1990
|
+
function Ae(e) {
|
|
1985
1991
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1986
|
-
return n <
|
|
1992
|
+
return n < Hr * 4.5 ? t * n / 4.5 : t * ((n + qt - 1) / qt) ** (1 / 0.45);
|
|
1987
1993
|
}
|
|
1988
|
-
function
|
|
1994
|
+
function Ie(e) {
|
|
1989
1995
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1990
|
-
return n >=
|
|
1996
|
+
return n >= Hr ? t * (qt * n ** 0.45 - (qt - 1)) : t * 4.5 * n;
|
|
1991
1997
|
}
|
|
1992
|
-
const
|
|
1998
|
+
const jr = [
|
|
1993
1999
|
0.4865709486482162,
|
|
1994
2000
|
0.26566769316909306,
|
|
1995
2001
|
0.1982172852343625,
|
|
@@ -1999,7 +2005,7 @@ const Xr = [
|
|
|
1999
2005
|
0,
|
|
2000
2006
|
0.04511338185890264,
|
|
2001
2007
|
1.043944368900976
|
|
2002
|
-
], Ss = ct(
|
|
2008
|
+
], Ss = ct(jr), Yr = [
|
|
2003
2009
|
0.5766690429101305,
|
|
2004
2010
|
0.1855582379065463,
|
|
2005
2011
|
0.1882286462349947,
|
|
@@ -2009,7 +2015,7 @@ const Xr = [
|
|
|
2009
2015
|
0.02703136138641234,
|
|
2010
2016
|
0.07068885253582723,
|
|
2011
2017
|
0.9913375368376388
|
|
2012
|
-
], Cs = ct(
|
|
2018
|
+
], Cs = ct(Yr), qr = [
|
|
2013
2019
|
0.7977604896723027,
|
|
2014
2020
|
0.13518583717574031,
|
|
2015
2021
|
0.0313493495815248,
|
|
@@ -2019,7 +2025,7 @@ const Xr = [
|
|
|
2019
2025
|
0,
|
|
2020
2026
|
0,
|
|
2021
2027
|
0.8251046025104602
|
|
2022
|
-
], xs = ct(
|
|
2028
|
+
], xs = ct(qr), Zr = [
|
|
2023
2029
|
0.6369580483012914,
|
|
2024
2030
|
0.14461690358620832,
|
|
2025
2031
|
0.1688809751641721,
|
|
@@ -2029,57 +2035,57 @@ const Xr = [
|
|
|
2029
2035
|
0,
|
|
2030
2036
|
0.028072693049087428,
|
|
2031
2037
|
1.0609850577107909
|
|
2032
|
-
], Es = ct(
|
|
2038
|
+
], Es = ct(Zr);
|
|
2033
2039
|
function vs({ r: e, g: t, b: n, alpha: r }) {
|
|
2034
|
-
const [o, s, i] = P([e, t, n],
|
|
2035
|
-
return new
|
|
2040
|
+
const [o, s, i] = P([e, t, n], on);
|
|
2041
|
+
return new W(o, s, i, r);
|
|
2036
2042
|
}
|
|
2037
2043
|
function Ms({ x: e, y: t, z: n, alpha: r }) {
|
|
2038
|
-
const [o, s, i] = P([e, t, n],
|
|
2039
|
-
return new
|
|
2044
|
+
const [o, s, i] = P([e, t, n], Fr);
|
|
2045
|
+
return new Ye(o, s, i, r);
|
|
2040
2046
|
}
|
|
2041
2047
|
function Ts({ r: e, g: t, b: n, alpha: r }) {
|
|
2042
|
-
const o = [
|
|
2043
|
-
return new
|
|
2048
|
+
const o = [Et(e), Et(t), Et(n)], [s, i, a] = P(o, jr);
|
|
2049
|
+
return new W(s, i, a, r);
|
|
2044
2050
|
}
|
|
2045
2051
|
function As({ x: e, y: t, z: n, alpha: r }) {
|
|
2046
|
-
const o = P([e, t, n], Ss)
|
|
2047
|
-
return new
|
|
2052
|
+
const o = P([e, t, n], Ss);
|
|
2053
|
+
return new qe(vt(o[0]), vt(o[1]), vt(o[2]), r);
|
|
2048
2054
|
}
|
|
2049
2055
|
function Is({ r: e, g: t, b: n, alpha: r }) {
|
|
2050
|
-
const o = [
|
|
2051
|
-
return new
|
|
2056
|
+
const o = [Ee(e), Ee(t), Ee(n)], [s, i, a] = P(o, Yr);
|
|
2057
|
+
return new W(s, i, a, r);
|
|
2052
2058
|
}
|
|
2053
2059
|
function Os({ x: e, y: t, z: n, alpha: r }) {
|
|
2054
|
-
const o = P([e, t, n], Cs)
|
|
2055
|
-
return new
|
|
2060
|
+
const o = P([e, t, n], Cs);
|
|
2061
|
+
return new Ze(ve(o[0]), ve(o[1]), ve(o[2]), r);
|
|
2056
2062
|
}
|
|
2057
2063
|
function Rs({ r: e, g: t, b: n, alpha: r }) {
|
|
2058
|
-
const o = [
|
|
2059
|
-
return new
|
|
2064
|
+
const o = [Me(e), Me(t), Me(n)], s = P(o, qr), [i, a, c] = P(s, Cr);
|
|
2065
|
+
return new W(i, a, c, r);
|
|
2060
2066
|
}
|
|
2061
2067
|
function Bs({ x: e, y: t, z: n, alpha: r }) {
|
|
2062
|
-
const o = P([e, t, n],
|
|
2063
|
-
return new
|
|
2068
|
+
const o = P([e, t, n], Qe), s = P(o, xs);
|
|
2069
|
+
return new Ke(Te(s[0]), Te(s[1]), Te(s[2]), r);
|
|
2064
2070
|
}
|
|
2065
2071
|
function Ns({ r: e, g: t, b: n, alpha: r }) {
|
|
2066
|
-
const o = [
|
|
2067
|
-
return new
|
|
2072
|
+
const o = [Ae(e), Ae(t), Ae(n)], [s, i, a] = P(o, Zr);
|
|
2073
|
+
return new W(s, i, a, r);
|
|
2068
2074
|
}
|
|
2069
2075
|
function _s({ x: e, y: t, z: n, alpha: r }) {
|
|
2070
|
-
const o = P([e, t, n], Es)
|
|
2071
|
-
return new
|
|
2072
|
-
}
|
|
2073
|
-
const
|
|
2074
|
-
rgb: { to:
|
|
2075
|
-
hsl: { to:
|
|
2076
|
-
hsv: { to:
|
|
2077
|
-
hwb: { to:
|
|
2078
|
-
lab: { to:
|
|
2079
|
-
lch: { to:
|
|
2080
|
-
oklab: { to:
|
|
2081
|
-
oklch: { to:
|
|
2082
|
-
kelvin: { to:
|
|
2076
|
+
const o = P([e, t, n], Es);
|
|
2077
|
+
return new Je(Ie(o[0]), Ie(o[1]), Ie(o[2]), r);
|
|
2078
|
+
}
|
|
2079
|
+
const Nn = {
|
|
2080
|
+
rgb: { to: an, from: cn },
|
|
2081
|
+
hsl: { to: fn, from: pn },
|
|
2082
|
+
hsv: { to: fs, from: ps },
|
|
2083
|
+
hwb: { to: hs, from: ms },
|
|
2084
|
+
lab: { to: rn, from: nn },
|
|
2085
|
+
lch: { to: bs, from: gs },
|
|
2086
|
+
oklab: { to: ln, from: un },
|
|
2087
|
+
oklch: { to: ds, from: ws },
|
|
2088
|
+
kelvin: { to: ks, from: ys },
|
|
2083
2089
|
xyz: { to: (e) => e, from: (e) => e },
|
|
2084
2090
|
"srgb-linear": { to: vs, from: Ms },
|
|
2085
2091
|
"display-p3": { to: Ts, from: As },
|
|
@@ -2090,25 +2096,25 @@ const In = {
|
|
|
2090
2096
|
function gt(e, t) {
|
|
2091
2097
|
if (e.colorSpace === t)
|
|
2092
2098
|
return e;
|
|
2093
|
-
const n =
|
|
2099
|
+
const n = Nn[e.colorSpace];
|
|
2094
2100
|
if (!n)
|
|
2095
2101
|
throw new Error(`Unknown source color space: "${e.colorSpace}"`);
|
|
2096
|
-
const r =
|
|
2102
|
+
const r = Nn[t];
|
|
2097
2103
|
if (!r)
|
|
2098
2104
|
throw new Error(`Unknown target color space: "${t}"`);
|
|
2099
2105
|
const o = n.to(e), s = r.from;
|
|
2100
2106
|
return s(o);
|
|
2101
2107
|
}
|
|
2102
|
-
const
|
|
2108
|
+
const yt = 1e-6;
|
|
2103
2109
|
function Ps(e) {
|
|
2104
2110
|
const t = gt(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, o = Number.isNaN(t.b) ? 0 : t.b;
|
|
2105
2111
|
if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && o >= 0 && o <= 1)
|
|
2106
2112
|
return e;
|
|
2107
|
-
if (n >= -
|
|
2108
|
-
const l = new
|
|
2113
|
+
if (n >= -yt && n <= 1 + yt && r >= -yt && r <= 1 + yt && o >= -yt && o <= 1 + yt) {
|
|
2114
|
+
const l = new U(_(n, 0, 1), _(r, 0, 1), _(o, 0, 1), e.alpha);
|
|
2109
2115
|
return gt(l, e.colorSpace);
|
|
2110
2116
|
}
|
|
2111
|
-
const [s, i, a] =
|
|
2117
|
+
const [s, i, a] = qo(n, r, o), c = new U(s, i, a, e.alpha);
|
|
2112
2118
|
return gt(c, e.colorSpace);
|
|
2113
2119
|
}
|
|
2114
2120
|
const zs = {
|
|
@@ -2165,15 +2171,15 @@ function Fs(e, t, n, r, o = "oklab", s = "shorter") {
|
|
|
2165
2171
|
const $s = (e, t, n) => {
|
|
2166
2172
|
const r = C[t][n];
|
|
2167
2173
|
return r[e] ?? r.number;
|
|
2168
|
-
},
|
|
2169
|
-
t = o ?
|
|
2174
|
+
}, Us = (e, t, n, r, o = !1) => {
|
|
2175
|
+
t = o ? Sr[n][r] : t;
|
|
2170
2176
|
const { min: s, max: i } = $s(t, n, r), [a, c, l, f] = o ? [s, i, 0, 1] : [0, 1, s, i], p = B(e, l, f, a, c);
|
|
2171
|
-
return new
|
|
2172
|
-
},
|
|
2177
|
+
return new k(p, o ? t : "");
|
|
2178
|
+
}, Ds = (e, t = !1) => {
|
|
2173
2179
|
const n = e.colorSpace;
|
|
2174
2180
|
return e.keys().forEach((r) => {
|
|
2175
|
-
const o = e[r] instanceof
|
|
2176
|
-
e[r] =
|
|
2181
|
+
const o = e[r] instanceof k ? e[r].value : e[r];
|
|
2182
|
+
e[r] = Us(
|
|
2177
2183
|
o,
|
|
2178
2184
|
e[r]?.unit,
|
|
2179
2185
|
n,
|
|
@@ -2181,20 +2187,22 @@ const $s = (e, t, n) => {
|
|
|
2181
2187
|
t
|
|
2182
2188
|
);
|
|
2183
2189
|
}), e;
|
|
2184
|
-
},
|
|
2190
|
+
}, ze = (e, t = !1, n = !1) => {
|
|
2185
2191
|
e = n ? e : e.clone();
|
|
2186
|
-
const r =
|
|
2187
|
-
return n ? e : new
|
|
2188
|
-
},
|
|
2189
|
-
const s = n ? o ? e : e.clone() :
|
|
2192
|
+
const r = Ds(e.value, t);
|
|
2193
|
+
return n ? e : new k(r).coalesce(e, !0);
|
|
2194
|
+
}, _n = (e, t = "oklab", n = !1, r = !1, o = !1) => {
|
|
2195
|
+
const s = n ? o ? e : e.clone() : ze(e, !1, o), i = gt(s.toJSON(), t);
|
|
2190
2196
|
return i.entries().forEach(([a, c]) => {
|
|
2191
|
-
|
|
2192
|
-
|
|
2197
|
+
let l = c;
|
|
2198
|
+
for (; l instanceof k; ) l = l.value;
|
|
2199
|
+
i[a] = new k(l);
|
|
2200
|
+
}), s.value = i, s.superType[1] = t, r ? ze(s, !0, !0) : s;
|
|
2193
2201
|
}, Gs = (e, t, n = "oklab", r = !1, o = !1, s = !1, i) => [
|
|
2194
|
-
|
|
2195
|
-
|
|
2202
|
+
_n(e, n, r, o, s),
|
|
2203
|
+
_n(t, n, r, o, s),
|
|
2196
2204
|
i
|
|
2197
|
-
],
|
|
2205
|
+
], Kr = ["px", "cm", "mm", "Q", "in", "pc", "pt"], Jr = [
|
|
2198
2206
|
"em",
|
|
2199
2207
|
"ex",
|
|
2200
2208
|
"ch",
|
|
@@ -2234,22 +2242,22 @@ const $s = (e, t, n) => {
|
|
|
2234
2242
|
"cqmin",
|
|
2235
2243
|
"cqmax"
|
|
2236
2244
|
], Zt = [
|
|
2237
|
-
...
|
|
2238
|
-
...
|
|
2239
|
-
], Kt = ["s", "ms"],
|
|
2245
|
+
...Kr,
|
|
2246
|
+
...Jr
|
|
2247
|
+
], Kt = ["s", "ms"], Jt = ["deg", "rad", "grad", "turn"], Qr = ["%"], Qt = ["Hz", "kHz"], te = ["dpi", "dpcm", "dppx"], to = ["fr"], Le = ["var", "calc"], Vs = ["string"], Ws = ["color"], uc = [
|
|
2240
2248
|
...Zt,
|
|
2241
2249
|
...Kt,
|
|
2242
|
-
...qt,
|
|
2243
|
-
...Kr,
|
|
2244
2250
|
...Jt,
|
|
2251
|
+
...Qr,
|
|
2245
2252
|
...Qt,
|
|
2246
|
-
...
|
|
2247
|
-
...
|
|
2253
|
+
...te,
|
|
2254
|
+
...to,
|
|
2255
|
+
...Le,
|
|
2248
2256
|
...Vs,
|
|
2249
|
-
...
|
|
2257
|
+
...Ws,
|
|
2250
2258
|
"",
|
|
2251
2259
|
void 0
|
|
2252
|
-
],
|
|
2260
|
+
], Xs = ["string", "var", "calc"], Hs = [
|
|
2253
2261
|
"accentColor",
|
|
2254
2262
|
"additiveSymbols",
|
|
2255
2263
|
"alignContent",
|
|
@@ -2882,19 +2890,24 @@ const $s = (e, t, n) => {
|
|
|
2882
2890
|
"zIndex",
|
|
2883
2891
|
"zoom"
|
|
2884
2892
|
];
|
|
2885
|
-
function
|
|
2893
|
+
function Fe(e) {
|
|
2886
2894
|
return e.unit === "color";
|
|
2887
2895
|
}
|
|
2888
|
-
const
|
|
2896
|
+
const fc = (e) => {
|
|
2889
2897
|
const t = {}, n = (r, o = void 0) => {
|
|
2890
2898
|
if (Array.isArray(r)) {
|
|
2891
2899
|
r.forEach((i, a) => n(i, o));
|
|
2892
2900
|
return;
|
|
2893
2901
|
} else if (r instanceof N) {
|
|
2902
|
+
if (r.name === "calc") {
|
|
2903
|
+
const a = r.values.map((f) => f.toString()).join(", "), c = new k(a, "calc"), l = o ?? "calc";
|
|
2904
|
+
t[l] == null && (t[l] = new Tt()), t[l].push(c), t[l] = t[l].flat();
|
|
2905
|
+
return;
|
|
2906
|
+
}
|
|
2894
2907
|
let i = r.name;
|
|
2895
2908
|
o && (o.endsWith(r.name) ? i = o : i = `${o}.${r.name}`), r.values.forEach((a, c) => n(a, i));
|
|
2896
2909
|
return;
|
|
2897
|
-
} else if (
|
|
2910
|
+
} else if (gr(r)) {
|
|
2898
2911
|
for (const [i, a] of Object.entries(r)) {
|
|
2899
2912
|
const c = o ? `${o}.${i}` : i;
|
|
2900
2913
|
n(a, c);
|
|
@@ -2902,10 +2915,10 @@ const lc = (e) => {
|
|
|
2902
2915
|
return;
|
|
2903
2916
|
}
|
|
2904
2917
|
const s = o;
|
|
2905
|
-
t[s] == null && (t[s] = new
|
|
2918
|
+
t[s] == null && (t[s] = new Tt()), t[s].push(r), t[s] = t[s].flat();
|
|
2906
2919
|
};
|
|
2907
2920
|
return n(e), t;
|
|
2908
|
-
},
|
|
2921
|
+
}, pc = (e) => {
|
|
2909
2922
|
const t = {};
|
|
2910
2923
|
for (const [n, r] of Object.entries(e)) {
|
|
2911
2924
|
const o = n.split(".");
|
|
@@ -2916,7 +2929,7 @@ const lc = (e) => {
|
|
|
2916
2929
|
}
|
|
2917
2930
|
}
|
|
2918
2931
|
return t;
|
|
2919
|
-
},
|
|
2932
|
+
}, hc = (e) => {
|
|
2920
2933
|
const t = {};
|
|
2921
2934
|
for (const [n, r] of Object.entries(e)) {
|
|
2922
2935
|
const o = n.split("."), s = o[0];
|
|
@@ -2928,7 +2941,7 @@ const lc = (e) => {
|
|
|
2928
2941
|
}
|
|
2929
2942
|
return t;
|
|
2930
2943
|
}, js = new Set(Hs);
|
|
2931
|
-
function
|
|
2944
|
+
function mc(e) {
|
|
2932
2945
|
return js.has(e);
|
|
2933
2946
|
}
|
|
2934
2947
|
const Ys = (e) => {
|
|
@@ -3002,11 +3015,25 @@ const Ys = (e) => {
|
|
|
3002
3015
|
}
|
|
3003
3016
|
throw new Error("Unsupported matrix type or invalid number of values");
|
|
3004
3017
|
};
|
|
3005
|
-
function
|
|
3018
|
+
function qs(e) {
|
|
3019
|
+
let t = e.parentElement;
|
|
3020
|
+
for (; t; ) {
|
|
3021
|
+
const n = getComputedStyle(t).containerType;
|
|
3022
|
+
if (n === "inline-size" || n === "size")
|
|
3023
|
+
return t;
|
|
3024
|
+
t = t.parentElement;
|
|
3025
|
+
}
|
|
3026
|
+
return null;
|
|
3027
|
+
}
|
|
3028
|
+
function Zs(e) {
|
|
3029
|
+
const t = getComputedStyle(e).writingMode;
|
|
3030
|
+
return t?.startsWith("vertical") || t?.startsWith("sideways") || !1;
|
|
3031
|
+
}
|
|
3032
|
+
function Ks(e, t) {
|
|
3006
3033
|
let n = e;
|
|
3007
3034
|
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;
|
|
3008
3035
|
}
|
|
3009
|
-
function
|
|
3036
|
+
function eo(e, t, n, r) {
|
|
3010
3037
|
if (t === "em" && n)
|
|
3011
3038
|
e *= parseFloat(getComputedStyle(n).fontSize);
|
|
3012
3039
|
else if (t === "rem")
|
|
@@ -3040,115 +3067,121 @@ function Jr(e, t, n, r) {
|
|
|
3040
3067
|
} else if (t === "ex" && n) {
|
|
3041
3068
|
const o = parseFloat(getComputedStyle(n).fontSize) || 16;
|
|
3042
3069
|
e *= o * 0.5;
|
|
3070
|
+
} else if ((t === "cqw" || t === "cqh" || t === "cqi" || t === "cqb" || t === "cqmin" || t === "cqmax") && n) {
|
|
3071
|
+
const o = qs(n);
|
|
3072
|
+
if (o) {
|
|
3073
|
+
const s = o.clientWidth, i = o.clientHeight, a = Zs(o);
|
|
3074
|
+
t === "cqw" ? e *= s / 100 : t === "cqh" ? e *= i / 100 : t === "cqi" ? e *= (a ? i : s) / 100 : t === "cqb" ? e *= (a ? s : i) / 100 : t === "cqmin" ? e *= Math.min(s, i) / 100 : e *= Math.max(s, i) / 100;
|
|
3075
|
+
}
|
|
3043
3076
|
} else
|
|
3044
|
-
e =
|
|
3077
|
+
e = Ks(e, t);
|
|
3045
3078
|
return e;
|
|
3046
3079
|
}
|
|
3047
|
-
function
|
|
3080
|
+
function no(e, t) {
|
|
3048
3081
|
return t === "s" && (e *= 1e3), e;
|
|
3049
3082
|
}
|
|
3050
|
-
function
|
|
3083
|
+
function le(e, t) {
|
|
3051
3084
|
return t === "grad" ? e *= 0.9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
|
|
3052
3085
|
}
|
|
3053
|
-
function
|
|
3086
|
+
function Js(e, t) {
|
|
3054
3087
|
return t === "kHz" && (e *= 1e3), e;
|
|
3055
3088
|
}
|
|
3056
|
-
function
|
|
3089
|
+
function ro(e, t) {
|
|
3057
3090
|
return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
|
|
3058
3091
|
}
|
|
3059
|
-
const
|
|
3060
|
-
length:
|
|
3061
|
-
time:
|
|
3062
|
-
angle:
|
|
3063
|
-
frequency:
|
|
3064
|
-
resolution:
|
|
3092
|
+
const Qs = {
|
|
3093
|
+
length: eo,
|
|
3094
|
+
time: no,
|
|
3095
|
+
angle: le,
|
|
3096
|
+
frequency: Js,
|
|
3097
|
+
resolution: ro
|
|
3065
3098
|
};
|
|
3066
|
-
function
|
|
3067
|
-
return Zt.includes(e) ? [Zt, "length"] : Kt.includes(e) ? [Kt, "time"] :
|
|
3099
|
+
function Pn(e) {
|
|
3100
|
+
return Zt.includes(e) ? [Zt, "length"] : Kt.includes(e) ? [Kt, "time"] : Jt.includes(e) ? [Jt, "angle"] : Qt.includes(e) ? [Qt, "frequency"] : te.includes(e) ? [te, "resolution"] : null;
|
|
3068
3101
|
}
|
|
3069
|
-
function
|
|
3070
|
-
const o =
|
|
3102
|
+
function bc(e, t, n, r) {
|
|
3103
|
+
const o = Pn(t), s = Pn(n);
|
|
3071
3104
|
if (!o || !s || o[1] !== s[1])
|
|
3072
3105
|
throw new Error(`Incompatible units: ${t} and ${n}`);
|
|
3073
|
-
const [, i] = o, a =
|
|
3106
|
+
const [, i] = o, a = Qs[i], c = a(e, t, r), l = a(1, n, r);
|
|
3074
3107
|
return c / l;
|
|
3075
3108
|
}
|
|
3076
3109
|
const g = (e) => {
|
|
3077
3110
|
const t = new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
|
|
3078
3111
|
return Y(t);
|
|
3079
|
-
},
|
|
3080
|
-
function
|
|
3112
|
+
}, ti = Y(/-?[a-zA-Z][a-zA-Z0-9-]*/), hn = g("none"), ei = Y(/-?\d+/).map(Number), J = Y(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);
|
|
3113
|
+
function ni(e) {
|
|
3081
3114
|
return new T((t) => t.ok(e, 0));
|
|
3082
3115
|
}
|
|
3083
|
-
function
|
|
3116
|
+
function ri(e) {
|
|
3084
3117
|
return new T((t) => t.err(void 0, 0));
|
|
3085
3118
|
}
|
|
3086
|
-
function
|
|
3119
|
+
function Mt(e, t) {
|
|
3087
3120
|
const n = e.parseState(t);
|
|
3088
3121
|
if (n.isError)
|
|
3089
3122
|
throw new Error(`Parse error at offset ${n.offset}`);
|
|
3090
3123
|
return n.value;
|
|
3091
3124
|
}
|
|
3092
|
-
function
|
|
3125
|
+
function oi(e, t) {
|
|
3093
3126
|
const n = e.parseState(t);
|
|
3094
3127
|
return { status: !n.isError, value: n.value };
|
|
3095
3128
|
}
|
|
3096
|
-
const
|
|
3129
|
+
const si = d(...Zt.map(g)), ii = d(...Jt.map(g)), ai = d(...Kt.map(g)), ci = d(...Qt.map(g)), li = d(...te.map(g)), ui = d(...to.map(g)), fi = d(...Qr.map(g)), pi = y(","), hi = y(" "), mi = d(pi, hi).trim(w), oo = A(J, si).map(([e, t]) => {
|
|
3097
3130
|
const n = ["length"];
|
|
3098
|
-
return
|
|
3099
|
-
}),
|
|
3100
|
-
A(J,
|
|
3131
|
+
return Jr.includes(t) ? n.push("relative") : Kr.includes(t) && n.push("absolute"), new k(e, t, n);
|
|
3132
|
+
}), so = A(J, ii).map(([e, t]) => new k(e, t, ["angle"])), mn = A(J, ai).map(([e, t]) => new k(e, t, ["time"])), bi = T.lazy(() => d(bn, mn)), io = A(J, ci).map(([e, t]) => new k(e, t, ["frequency"])), ao = A(J, li).map(([e, t]) => new k(e, t, ["resolution"])), co = A(J, ui).map(([e, t]) => new k(e, t, ["flex"])), bn = d(
|
|
3133
|
+
A(J, fi),
|
|
3101
3134
|
g("from").map(() => [0, "%"]),
|
|
3102
3135
|
g("to").map(() => [100, "%"])
|
|
3103
|
-
).map(([e, t]) => new
|
|
3104
|
-
eo,
|
|
3105
|
-
no,
|
|
3106
|
-
un,
|
|
3107
|
-
ro,
|
|
3136
|
+
).map(([e, t]) => new k(e, t, ["percentage"])), lo = T.lazy(() => gn.Value), uo = y("/").trim(w).map(() => new k("/", "string")), fo = d(
|
|
3108
3137
|
oo,
|
|
3109
3138
|
so,
|
|
3110
|
-
|
|
3139
|
+
mn,
|
|
3111
3140
|
io,
|
|
3112
3141
|
ao,
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3142
|
+
co,
|
|
3143
|
+
bn,
|
|
3144
|
+
lo,
|
|
3145
|
+
uo,
|
|
3146
|
+
J.map((e) => new k(e)),
|
|
3147
|
+
hn.map(() => new k(NaN))
|
|
3148
|
+
).trim(w), X = {
|
|
3149
|
+
Length: oo,
|
|
3150
|
+
Angle: so,
|
|
3151
|
+
Time: mn,
|
|
3152
|
+
TimePercentage: bi,
|
|
3153
|
+
Frequency: io,
|
|
3154
|
+
Resolution: ao,
|
|
3155
|
+
Flex: co,
|
|
3156
|
+
Percentage: bn,
|
|
3157
|
+
Color: lo,
|
|
3158
|
+
Slash: uo,
|
|
3159
|
+
Value: fo,
|
|
3160
|
+
sep: mi
|
|
3128
3161
|
};
|
|
3129
|
-
function
|
|
3130
|
-
return
|
|
3162
|
+
function po(e) {
|
|
3163
|
+
return Mt(fo, e);
|
|
3131
3164
|
}
|
|
3132
|
-
const V = (e) => new
|
|
3165
|
+
const V = (e) => new k(
|
|
3133
3166
|
e,
|
|
3134
3167
|
"color",
|
|
3135
3168
|
["color", e.colorSpace],
|
|
3136
3169
|
void 0,
|
|
3137
3170
|
"color"
|
|
3138
3171
|
);
|
|
3139
|
-
function
|
|
3140
|
-
const n =
|
|
3172
|
+
function $e(e) {
|
|
3173
|
+
const n = ze(e).value, r = n.clone();
|
|
3141
3174
|
for (const o of n.keys()) {
|
|
3142
3175
|
const s = n[o];
|
|
3143
|
-
r[o] = s instanceof
|
|
3176
|
+
r[o] = s instanceof k ? s.value : s;
|
|
3144
3177
|
}
|
|
3145
3178
|
return r;
|
|
3146
3179
|
}
|
|
3147
|
-
function
|
|
3180
|
+
function gi(e) {
|
|
3148
3181
|
const t = e.replace(/[^0-9.+\-*/() e]/g, "");
|
|
3149
3182
|
return new Function(`return (${t})`)();
|
|
3150
3183
|
}
|
|
3151
|
-
function
|
|
3184
|
+
function zn(e, t) {
|
|
3152
3185
|
switch (e.type) {
|
|
3153
3186
|
case "ref":
|
|
3154
3187
|
return t[e.name] ?? 0;
|
|
@@ -3161,32 +3194,32 @@ function Bn(e, t) {
|
|
|
3161
3194
|
const r = Object.keys(t).sort((o, s) => s.length - o.length);
|
|
3162
3195
|
for (const o of r)
|
|
3163
3196
|
n = n.replace(new RegExp(`\\b${o}\\b`, "g"), String(t[o]));
|
|
3164
|
-
return
|
|
3197
|
+
return gi(n);
|
|
3165
3198
|
}
|
|
3166
3199
|
}
|
|
3167
3200
|
}
|
|
3168
|
-
function
|
|
3169
|
-
const o =
|
|
3201
|
+
function di(e, t, n, r) {
|
|
3202
|
+
const o = $e(e), s = gt(o, t), i = {};
|
|
3170
3203
|
for (const [u, h] of s.entries())
|
|
3171
3204
|
i[u] = h;
|
|
3172
|
-
const a = n.map((u) =>
|
|
3173
|
-
rgb:
|
|
3174
|
-
hsl:
|
|
3175
|
-
hwb:
|
|
3176
|
-
lab:
|
|
3177
|
-
lch:
|
|
3178
|
-
oklab:
|
|
3179
|
-
oklch:
|
|
3180
|
-
xyz:
|
|
3181
|
-
"srgb-linear":
|
|
3182
|
-
"display-p3":
|
|
3183
|
-
"a98-rgb":
|
|
3184
|
-
"prophoto-rgb":
|
|
3185
|
-
rec2020:
|
|
3186
|
-
}[t] ??
|
|
3205
|
+
const a = n.map((u) => zn(u, i)), c = r ? zn(r, i) : i.alpha ?? 1, f = {
|
|
3206
|
+
rgb: U,
|
|
3207
|
+
hsl: dt,
|
|
3208
|
+
hwb: Xe,
|
|
3209
|
+
lab: ie,
|
|
3210
|
+
lch: He,
|
|
3211
|
+
oklab: ae,
|
|
3212
|
+
oklch: je,
|
|
3213
|
+
xyz: W,
|
|
3214
|
+
"srgb-linear": Ye,
|
|
3215
|
+
"display-p3": qe,
|
|
3216
|
+
"a98-rgb": Ze,
|
|
3217
|
+
"prophoto-rgb": Ke,
|
|
3218
|
+
rec2020: Je
|
|
3219
|
+
}[t] ?? U, p = new f(...a, c);
|
|
3187
3220
|
return V(p);
|
|
3188
3221
|
}
|
|
3189
|
-
const
|
|
3222
|
+
const wi = {
|
|
3190
3223
|
srgb: "rgb",
|
|
3191
3224
|
"srgb-linear": "srgb-linear",
|
|
3192
3225
|
"display-p3": "display-p3",
|
|
@@ -3202,31 +3235,31 @@ const gi = {
|
|
|
3202
3235
|
xyz: "xyz",
|
|
3203
3236
|
"xyz-d65": "xyz",
|
|
3204
3237
|
"xyz-d50": "xyz"
|
|
3205
|
-
},
|
|
3206
|
-
srgb: { space: "rgb", ctor:
|
|
3207
|
-
"srgb-linear": { space: "srgb-linear", ctor:
|
|
3208
|
-
"display-p3": { space: "display-p3", ctor:
|
|
3209
|
-
"a98-rgb": { space: "a98-rgb", ctor:
|
|
3210
|
-
"prophoto-rgb": { space: "prophoto-rgb", ctor:
|
|
3211
|
-
rec2020: { space: "rec2020", ctor:
|
|
3212
|
-
xyz: { space: "xyz", ctor:
|
|
3213
|
-
"xyz-d65": { space: "xyz", ctor:
|
|
3214
|
-
"xyz-d50": { space: "xyz", ctor:
|
|
3215
|
-
},
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
const t =
|
|
3219
|
-
return new
|
|
3238
|
+
}, ki = {
|
|
3239
|
+
srgb: { space: "rgb", ctor: U },
|
|
3240
|
+
"srgb-linear": { space: "srgb-linear", ctor: Ye },
|
|
3241
|
+
"display-p3": { space: "display-p3", ctor: qe },
|
|
3242
|
+
"a98-rgb": { space: "a98-rgb", ctor: Ze },
|
|
3243
|
+
"prophoto-rgb": { space: "prophoto-rgb", ctor: Ke },
|
|
3244
|
+
rec2020: { space: "rec2020", ctor: Je },
|
|
3245
|
+
xyz: { space: "xyz", ctor: W },
|
|
3246
|
+
"xyz-d65": { space: "xyz", ctor: W },
|
|
3247
|
+
"xyz-d50": { space: "xyz", ctor: W }
|
|
3248
|
+
}, yi = y(","), Si = Y(/\s+/), ue = y("/"), fe = y("("), pe = y(")"), ee = d(yi.trim(w), Si), ho = d(ue.trim(w), ee), j = T.lazy(() => d(
|
|
3249
|
+
X.Percentage,
|
|
3250
|
+
X.Angle.map((e) => {
|
|
3251
|
+
const t = le(e.value, e.unit);
|
|
3252
|
+
return new k(t, "deg", ["angle"]);
|
|
3220
3253
|
}),
|
|
3221
|
-
d(J,
|
|
3222
|
-
|
|
3223
|
-
)),
|
|
3254
|
+
d(J, ei).map((e) => new k(e)),
|
|
3255
|
+
hn.map(() => new k(NaN))
|
|
3256
|
+
)), Bt = d(
|
|
3224
3257
|
// calc(...)
|
|
3225
3258
|
g("calc").next(
|
|
3226
3259
|
Y(/\(([^)]+)\)/, (e) => e?.[1] ?? null)
|
|
3227
3260
|
).map((e) => ({ type: "calc", expr: e })),
|
|
3228
3261
|
// none
|
|
3229
|
-
|
|
3262
|
+
hn.map(() => ({ type: "none" })),
|
|
3230
3263
|
// component reference (alpha must be tried before single 'a')
|
|
3231
3264
|
Y(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(
|
|
3232
3265
|
(e) => ({ type: "ref", name: e })
|
|
@@ -3234,76 +3267,76 @@ const gi = {
|
|
|
3234
3267
|
// literal number / percentage / angle
|
|
3235
3268
|
j.map((e) => ({ type: "literal", value: e.value }))
|
|
3236
3269
|
), rt = (e) => {
|
|
3237
|
-
const t =
|
|
3238
|
-
A(j.skip(
|
|
3270
|
+
const t = y(e).skip(g("a").opt()), n = d(
|
|
3271
|
+
A(j.skip(ho), j),
|
|
3239
3272
|
j.map((o) => [o])
|
|
3240
3273
|
), r = A(
|
|
3241
|
-
j.skip(
|
|
3242
|
-
j.skip(
|
|
3274
|
+
j.skip(ee),
|
|
3275
|
+
j.skip(ee),
|
|
3243
3276
|
n
|
|
3244
|
-
).trim(w).wrap(
|
|
3245
|
-
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new
|
|
3277
|
+
).trim(w).wrap(fe, pe);
|
|
3278
|
+
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new k(1)]);
|
|
3246
3279
|
};
|
|
3247
3280
|
function lt(e, t) {
|
|
3248
|
-
return
|
|
3281
|
+
return y(e).skip(g("a").opt()).next(
|
|
3249
3282
|
A(
|
|
3250
|
-
g("from").skip(w).next(T.lazy(() =>
|
|
3251
|
-
w.next(
|
|
3252
|
-
w.next(
|
|
3253
|
-
w.next(
|
|
3254
|
-
|
|
3255
|
-
).trim(w).wrap(
|
|
3256
|
-
).map(([n, r, o, s, i]) =>
|
|
3257
|
-
}
|
|
3258
|
-
const
|
|
3259
|
-
const { r: t, g: n, b: r, alpha: o } =
|
|
3260
|
-
return V(new
|
|
3261
|
-
}),
|
|
3262
|
-
const t =
|
|
3283
|
+
g("from").skip(w).next(T.lazy(() => gn.Value)),
|
|
3284
|
+
w.next(Bt),
|
|
3285
|
+
w.next(Bt),
|
|
3286
|
+
w.next(Bt),
|
|
3287
|
+
ue.trim(w).next(Bt).opt()
|
|
3288
|
+
).trim(w).wrap(fe, pe)
|
|
3289
|
+
).map(([n, r, o, s, i]) => di(n, t, [r, o, s], i));
|
|
3290
|
+
}
|
|
3291
|
+
const Ci = Y(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
3292
|
+
const { r: t, g: n, b: r, alpha: o } = Zo(e);
|
|
3293
|
+
return V(new U(t, n, r, o));
|
|
3294
|
+
}), xi = J.skip(g("k")).map((e) => {
|
|
3295
|
+
const t = Br(new dr(e));
|
|
3263
3296
|
return V(t);
|
|
3264
|
-
}),
|
|
3297
|
+
}), Ei = d(
|
|
3265
3298
|
lt("rgb", "rgb"),
|
|
3266
3299
|
rt("rgb").map(
|
|
3267
|
-
([e, t, n, r]) => V(new
|
|
3300
|
+
([e, t, n, r]) => V(new U(e, t, n, r))
|
|
3268
3301
|
)
|
|
3269
|
-
),
|
|
3302
|
+
), vi = d(
|
|
3270
3303
|
lt("hsl", "hsl"),
|
|
3271
3304
|
rt("hsl").map(
|
|
3272
|
-
([e, t, n, r]) => V(new
|
|
3305
|
+
([e, t, n, r]) => V(new dt(e, t, n, r))
|
|
3273
3306
|
)
|
|
3274
|
-
),
|
|
3275
|
-
([e, t, n, r]) => V(new
|
|
3276
|
-
),
|
|
3307
|
+
), Mi = rt("hsv").map(
|
|
3308
|
+
([e, t, n, r]) => V(new We(e, t, n, r))
|
|
3309
|
+
), Ti = d(
|
|
3277
3310
|
lt("hwb", "hwb"),
|
|
3278
3311
|
rt("hwb").map(
|
|
3279
|
-
([e, t, n, r]) => V(new
|
|
3312
|
+
([e, t, n, r]) => V(new Xe(e, t, n, r))
|
|
3280
3313
|
)
|
|
3281
|
-
),
|
|
3314
|
+
), Ai = d(
|
|
3282
3315
|
lt("lab", "lab"),
|
|
3283
3316
|
rt("lab").map(
|
|
3284
|
-
([e, t, n, r]) => V(new
|
|
3317
|
+
([e, t, n, r]) => V(new ie(e, t, n, r))
|
|
3285
3318
|
)
|
|
3286
|
-
),
|
|
3319
|
+
), Ii = d(
|
|
3287
3320
|
lt("lch", "lch"),
|
|
3288
3321
|
rt("lch").map(
|
|
3289
|
-
([e, t, n, r]) => V(new
|
|
3322
|
+
([e, t, n, r]) => V(new He(e, t, n, r))
|
|
3290
3323
|
)
|
|
3291
|
-
),
|
|
3324
|
+
), Oi = d(
|
|
3292
3325
|
lt("oklab", "oklab"),
|
|
3293
3326
|
rt("oklab").map(
|
|
3294
|
-
([e, t, n, r]) => V(new
|
|
3327
|
+
([e, t, n, r]) => V(new ae(e, t, n, r))
|
|
3295
3328
|
)
|
|
3296
|
-
),
|
|
3329
|
+
), Ri = d(
|
|
3297
3330
|
lt("oklch", "oklch"),
|
|
3298
3331
|
rt("oklch").map(
|
|
3299
|
-
([e, t, n, r]) => V(new
|
|
3332
|
+
([e, t, n, r]) => V(new je(e, t, n, r))
|
|
3300
3333
|
)
|
|
3301
|
-
),
|
|
3334
|
+
), Bi = d(
|
|
3302
3335
|
lt("xyz", "xyz"),
|
|
3303
3336
|
rt("xyz").map(
|
|
3304
|
-
([e, t, n, r]) => V(new
|
|
3337
|
+
([e, t, n, r]) => V(new W(e, t, n, r))
|
|
3305
3338
|
)
|
|
3306
|
-
),
|
|
3339
|
+
), Ni = d(
|
|
3307
3340
|
g("srgb-linear").map(() => "srgb-linear"),
|
|
3308
3341
|
g("srgb").map(() => "srgb"),
|
|
3309
3342
|
g("display-p3").map(() => "display-p3"),
|
|
@@ -3319,37 +3352,37 @@ const yi = Y(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
|
3319
3352
|
g("xyz-d65").map(() => "xyz-d65"),
|
|
3320
3353
|
g("xyz-d50").map(() => "xyz-d50"),
|
|
3321
3354
|
g("xyz").map(() => "xyz")
|
|
3322
|
-
),
|
|
3355
|
+
), _i = d(
|
|
3323
3356
|
g("shorter"),
|
|
3324
3357
|
g("longer"),
|
|
3325
3358
|
g("increasing"),
|
|
3326
3359
|
g("decreasing")
|
|
3327
|
-
).skip(w).skip(g("hue")),
|
|
3360
|
+
).skip(w).skip(g("hue")), Ln = T.lazy(
|
|
3328
3361
|
() => A(
|
|
3329
|
-
|
|
3330
|
-
w.next(
|
|
3362
|
+
gn.Value,
|
|
3363
|
+
w.next(X.Percentage).opt()
|
|
3331
3364
|
)
|
|
3332
|
-
),
|
|
3365
|
+
), Pi = g("color-mix").next(
|
|
3333
3366
|
A(
|
|
3334
3367
|
// "in <space> [<hueMethod>]"
|
|
3335
3368
|
g("in").skip(w).next(
|
|
3336
3369
|
A(
|
|
3337
|
-
|
|
3338
|
-
w.next(
|
|
3370
|
+
Ni,
|
|
3371
|
+
w.next(_i).opt()
|
|
3339
3372
|
)
|
|
3340
3373
|
),
|
|
3341
3374
|
// ", <color> [<pct>]?"
|
|
3342
|
-
|
|
3375
|
+
y(",").trim(w).next(Ln),
|
|
3343
3376
|
// ", <color> [<pct>]?"
|
|
3344
|
-
|
|
3345
|
-
).trim(w).wrap(
|
|
3377
|
+
y(",").trim(w).next(Ln)
|
|
3378
|
+
).trim(w).wrap(fe, pe)
|
|
3346
3379
|
).map(([[e, t], [n, r], [o, s]]) => {
|
|
3347
|
-
const i =
|
|
3380
|
+
const i = wi[e] ?? "oklab", a = t ?? "shorter";
|
|
3348
3381
|
let c = r != null ? r.value / 100 : -1, l = s != null ? s.value / 100 : -1;
|
|
3349
3382
|
c < 0 && l < 0 ? (c = 0.5, l = 0.5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c);
|
|
3350
|
-
const f =
|
|
3383
|
+
const f = $e(n), p = $e(o), u = Fs(f, p, c, l, i, a);
|
|
3351
3384
|
return V(u);
|
|
3352
|
-
}),
|
|
3385
|
+
}), zi = d(
|
|
3353
3386
|
g("srgb-linear").map(() => "srgb-linear"),
|
|
3354
3387
|
g("srgb").map(() => "srgb"),
|
|
3355
3388
|
g("display-p3").map(() => "display-p3"),
|
|
@@ -3359,45 +3392,43 @@ const yi = Y(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
|
3359
3392
|
g("xyz-d65").map(() => "xyz-d65"),
|
|
3360
3393
|
g("xyz-d50").map(() => "xyz-d50"),
|
|
3361
3394
|
g("xyz").map(() => "xyz")
|
|
3362
|
-
),
|
|
3395
|
+
), Li = g("color").next(
|
|
3363
3396
|
A(
|
|
3364
|
-
|
|
3397
|
+
zi.skip(w),
|
|
3365
3398
|
j.skip(w),
|
|
3366
3399
|
j.skip(w),
|
|
3367
3400
|
d(
|
|
3368
3401
|
A(
|
|
3369
|
-
j.skip(
|
|
3402
|
+
j.skip(ue.trim(w)),
|
|
3370
3403
|
j
|
|
3371
3404
|
),
|
|
3372
3405
|
j.map((e) => [e, void 0])
|
|
3373
3406
|
)
|
|
3374
|
-
).trim(w).wrap(
|
|
3407
|
+
).trim(w).wrap(fe, pe)
|
|
3375
3408
|
).map(([e, t, n, [r, o]]) => {
|
|
3376
|
-
const s =
|
|
3409
|
+
const s = ki[e];
|
|
3377
3410
|
if (!s)
|
|
3378
3411
|
throw new Error(`Unknown color() space: ${e}`);
|
|
3379
|
-
const i = o ?? new
|
|
3412
|
+
const i = o ?? new k(1);
|
|
3380
3413
|
if (e === "srgb") {
|
|
3381
3414
|
const c = (l) => l.value * 255;
|
|
3382
|
-
return V(new
|
|
3415
|
+
return V(new U(c(t), c(n), c(r), i.value));
|
|
3383
3416
|
}
|
|
3384
3417
|
const a = new s.ctor(t, n, r, i);
|
|
3385
|
-
return e === "xyz-d50" && a instanceof
|
|
3386
|
-
}),
|
|
3387
|
-
...Object.keys(
|
|
3418
|
+
return e === "xyz-d50" && a instanceof W && (a.whitePoint = "D50"), V(a);
|
|
3419
|
+
}), Fi = d(
|
|
3420
|
+
...Object.keys(Bn).sort((e, t) => t.length - e.length).map(g)
|
|
3388
3421
|
).chain((e) => {
|
|
3389
|
-
const t =
|
|
3422
|
+
const t = Bn[e.toLowerCase()];
|
|
3390
3423
|
if (t) {
|
|
3391
|
-
const n =
|
|
3424
|
+
const n = po(t);
|
|
3392
3425
|
if (n)
|
|
3393
|
-
return
|
|
3426
|
+
return ni(n);
|
|
3394
3427
|
}
|
|
3395
|
-
return
|
|
3396
|
-
}),
|
|
3397
|
-
Ni,
|
|
3428
|
+
return ri();
|
|
3429
|
+
}), Gt = d(
|
|
3398
3430
|
Pi,
|
|
3399
|
-
|
|
3400
|
-
Si,
|
|
3431
|
+
Li,
|
|
3401
3432
|
Ci,
|
|
3402
3433
|
xi,
|
|
3403
3434
|
Ei,
|
|
@@ -3407,23 +3438,25 @@ const yi = Y(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
|
3407
3438
|
Ai,
|
|
3408
3439
|
Ii,
|
|
3409
3440
|
Oi,
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3441
|
+
Ri,
|
|
3442
|
+
Bi,
|
|
3443
|
+
Fi
|
|
3444
|
+
).trim(w), gn = {
|
|
3445
|
+
Value: Gt,
|
|
3413
3446
|
colorValue: j,
|
|
3414
|
-
componentExpr:
|
|
3415
|
-
sep:
|
|
3416
|
-
alphaSep:
|
|
3417
|
-
div:
|
|
3418
|
-
},
|
|
3419
|
-
function
|
|
3420
|
-
const t =
|
|
3447
|
+
componentExpr: Bt,
|
|
3448
|
+
sep: ee,
|
|
3449
|
+
alphaSep: ho,
|
|
3450
|
+
div: ue
|
|
3451
|
+
}, $i = /* @__PURE__ */ new Map();
|
|
3452
|
+
function gc(e) {
|
|
3453
|
+
const t = oi(Gt, e);
|
|
3421
3454
|
if (t.status)
|
|
3422
3455
|
return t.value;
|
|
3423
|
-
const n = e.trim().toLowerCase(), r =
|
|
3424
|
-
return r ?
|
|
3456
|
+
const n = e.trim().toLowerCase(), r = $i.get(n);
|
|
3457
|
+
return r ? Mt(Gt, r) : Mt(Gt, e);
|
|
3425
3458
|
}
|
|
3426
|
-
class
|
|
3459
|
+
class k {
|
|
3427
3460
|
constructor(t, n, r, o, s, i) {
|
|
3428
3461
|
this.value = t, this.unit = n, this.superType = r, this.subProperty = o, this.property = s, this.targets = i;
|
|
3429
3462
|
}
|
|
@@ -3443,17 +3476,17 @@ class S {
|
|
|
3443
3476
|
this.value = t;
|
|
3444
3477
|
}
|
|
3445
3478
|
toString() {
|
|
3446
|
-
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` :
|
|
3479
|
+
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` : Fe(this) ? this.value.toString() : this.unit === "var" ? `var(${this.value})` : this.unit === "calc" ? `calc(${this.value})` : `${this.value}${this.unit}`;
|
|
3447
3480
|
}
|
|
3448
3481
|
toJSON() {
|
|
3449
3482
|
return this.valueOf();
|
|
3450
3483
|
}
|
|
3451
3484
|
toFixed(t = 2) {
|
|
3452
3485
|
const n = Number(this.value).toFixed(t).replace(/\.0+$/, "");
|
|
3453
|
-
return new
|
|
3486
|
+
return new k(n).coalesce(this, !0).toString();
|
|
3454
3487
|
}
|
|
3455
3488
|
clone() {
|
|
3456
|
-
return new
|
|
3489
|
+
return new k(
|
|
3457
3490
|
at(this.value),
|
|
3458
3491
|
this.unit,
|
|
3459
3492
|
at(this.superType),
|
|
@@ -3462,7 +3495,7 @@ class S {
|
|
|
3462
3495
|
);
|
|
3463
3496
|
}
|
|
3464
3497
|
coalesce(t, n = !1) {
|
|
3465
|
-
return t == null ? this :
|
|
3498
|
+
return t == null ? this : Xs.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 k(
|
|
3466
3499
|
at(this.value),
|
|
3467
3500
|
this.unit ?? t.unit,
|
|
3468
3501
|
at(this.superType ?? t.superType),
|
|
@@ -3508,7 +3541,7 @@ class N {
|
|
|
3508
3541
|
);
|
|
3509
3542
|
}
|
|
3510
3543
|
}
|
|
3511
|
-
class
|
|
3544
|
+
class Tt extends Array {
|
|
3512
3545
|
constructor(...t) {
|
|
3513
3546
|
super(...t);
|
|
3514
3547
|
}
|
|
@@ -3534,15 +3567,15 @@ class _t extends Array {
|
|
|
3534
3567
|
return this.map((t) => t.toJSON());
|
|
3535
3568
|
}
|
|
3536
3569
|
clone() {
|
|
3537
|
-
return new
|
|
3570
|
+
return new Tt(...this.map((t) => t.clone()));
|
|
3538
3571
|
}
|
|
3539
3572
|
}
|
|
3540
|
-
const
|
|
3541
|
-
function
|
|
3573
|
+
const q = y("("), Z = y(")"), Fn = y(",");
|
|
3574
|
+
function Ui(e, t) {
|
|
3542
3575
|
const n = T.lazy(
|
|
3543
3576
|
() => d(
|
|
3544
3577
|
// Nested parenthesized expression
|
|
3545
|
-
a.trim(w).wrap(
|
|
3578
|
+
a.trim(w).wrap(q, Z),
|
|
3546
3579
|
// Math function (min, max, etc.) — must come before plain value
|
|
3547
3580
|
t,
|
|
3548
3581
|
// Plain value (number, dimension, percentage)
|
|
@@ -3550,13 +3583,13 @@ function Fi(e, t) {
|
|
|
3550
3583
|
).trim(w)
|
|
3551
3584
|
), r = T.lazy(
|
|
3552
3585
|
() => d(
|
|
3553
|
-
A(
|
|
3554
|
-
([, c]) => new N("*", [new
|
|
3586
|
+
A(y("-").trim(w), n).map(
|
|
3587
|
+
([, c]) => new N("*", [new k(-1), c])
|
|
3555
3588
|
),
|
|
3556
|
-
A(
|
|
3589
|
+
A(y("+").trim(w), n).map(([, c]) => c),
|
|
3557
3590
|
n
|
|
3558
3591
|
)
|
|
3559
|
-
), o = d(
|
|
3592
|
+
), o = d(y("*"), y("/")).trim(w), s = d(y("+"), y("-")).trim(w), i = A(
|
|
3560
3593
|
r,
|
|
3561
3594
|
A(o, r).many()
|
|
3562
3595
|
).map(([c, l]) => {
|
|
@@ -3576,35 +3609,35 @@ function Fi(e, t) {
|
|
|
3576
3609
|
});
|
|
3577
3610
|
return a;
|
|
3578
3611
|
}
|
|
3579
|
-
function
|
|
3580
|
-
const t = T.lazy(() => E), n =
|
|
3612
|
+
function Di(e) {
|
|
3613
|
+
const t = T.lazy(() => E), n = Ui(e, t), r = y("calc").next(n.trim(w).wrap(q, Z)).map((v) => new N("calc", [v])), o = n.trim(w), s = o.sepBy(Fn.trim(w)), i = y("min").next(s.wrap(q, Z)).map((v) => new N("min", v)), a = y("max").next(s.wrap(q, Z)).map((v) => new N("max", v)), c = y("clamp").next(s.wrap(q, Z)).map((v) => {
|
|
3581
3614
|
if (v.length !== 3) throw new Error("clamp() requires exactly 3 arguments");
|
|
3582
3615
|
return new N("clamp", v);
|
|
3583
3616
|
}), l = d(
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
).trim(w), f =
|
|
3617
|
+
y("nearest"),
|
|
3618
|
+
y("up"),
|
|
3619
|
+
y("down"),
|
|
3620
|
+
y("to-zero")
|
|
3621
|
+
).trim(w), f = y("round").next(
|
|
3589
3622
|
A(
|
|
3590
|
-
l.skip(
|
|
3623
|
+
l.skip(Fn.trim(w)).opt(),
|
|
3591
3624
|
s
|
|
3592
|
-
).wrap(
|
|
3625
|
+
).wrap(q, Z)
|
|
3593
3626
|
).map(([v, F]) => {
|
|
3594
|
-
const Q = new
|
|
3627
|
+
const Q = new k(v ?? "nearest", "string");
|
|
3595
3628
|
return new N("round", [Q, ...F]);
|
|
3596
|
-
}), p = (v) =>
|
|
3629
|
+
}), p = (v) => y(v).next(s.wrap(q, Z)).map((F) => {
|
|
3597
3630
|
if (F.length !== 2) throw new Error(`${v}() requires exactly 2 arguments`);
|
|
3598
3631
|
return new N(v, F);
|
|
3599
|
-
}), u = (v) =>
|
|
3632
|
+
}), u = (v) => y(v).next(o.trim(w).wrap(q, Z)).map((F) => new N(v, [F])), h = p("pow"), m = p("atan2"), x = y("hypot").next(s.wrap(q, Z)).map((v) => new N("hypot", v)), b = y("log").next(s.wrap(q, Z)).map((v) => {
|
|
3600
3633
|
if (v.length < 1 || v.length > 2) throw new Error("log() requires 1 or 2 arguments");
|
|
3601
3634
|
return new N("log", v);
|
|
3602
3635
|
}), I = d(
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3636
|
+
y("infinity").map(() => new k(1 / 0)),
|
|
3637
|
+
y("-infinity").map(() => new k(-1 / 0)),
|
|
3638
|
+
y("NaN").map(() => new k(NaN)),
|
|
3639
|
+
y("pi").map(() => new k(Math.PI)),
|
|
3640
|
+
y("e").map(() => new k(Math.E))
|
|
3608
3641
|
), E = d(
|
|
3609
3642
|
r,
|
|
3610
3643
|
i,
|
|
@@ -3636,12 +3669,12 @@ function $i(e) {
|
|
|
3636
3669
|
};
|
|
3637
3670
|
}
|
|
3638
3671
|
function O(e) {
|
|
3639
|
-
return e instanceof
|
|
3672
|
+
return e instanceof k ? e.unit === "var" || e.unit === "calc" ? null : typeof e.value == "number" ? e.value : null : e instanceof N ? dn(e) : typeof e == "number" ? e : null;
|
|
3640
3673
|
}
|
|
3641
|
-
function
|
|
3642
|
-
return e instanceof
|
|
3674
|
+
function Oe(e) {
|
|
3675
|
+
return e instanceof k ? typeof e.value != "number" ? null : e.unit && e.superType?.[0] === "angle" ? le(e.value, e.unit) * Math.PI / 180 : e.value : e instanceof N ? dn(e) : null;
|
|
3643
3676
|
}
|
|
3644
|
-
function
|
|
3677
|
+
function dn(e) {
|
|
3645
3678
|
const t = e.name, n = e.values;
|
|
3646
3679
|
switch (t) {
|
|
3647
3680
|
// Arithmetic operators (from calc AST)
|
|
@@ -3681,7 +3714,7 @@ function hn(e) {
|
|
|
3681
3714
|
// Stepped value functions
|
|
3682
3715
|
case "round": {
|
|
3683
3716
|
if (n.length < 3) return null;
|
|
3684
|
-
const r = n[0] instanceof
|
|
3717
|
+
const r = n[0] instanceof k ? String(n[0].value) : "nearest", o = O(n[1]), s = O(n[2]);
|
|
3685
3718
|
if (o == null || s == null || s === 0) return null;
|
|
3686
3719
|
switch (r) {
|
|
3687
3720
|
case "nearest":
|
|
@@ -3715,15 +3748,15 @@ function hn(e) {
|
|
|
3715
3748
|
}
|
|
3716
3749
|
// Trigonometric (input in angle units → converted to radians)
|
|
3717
3750
|
case "sin": {
|
|
3718
|
-
const r =
|
|
3751
|
+
const r = Oe(n[0]);
|
|
3719
3752
|
return r == null ? null : Math.sin(r);
|
|
3720
3753
|
}
|
|
3721
3754
|
case "cos": {
|
|
3722
|
-
const r =
|
|
3755
|
+
const r = Oe(n[0]);
|
|
3723
3756
|
return r == null ? null : Math.cos(r);
|
|
3724
3757
|
}
|
|
3725
3758
|
case "tan": {
|
|
3726
|
-
const r =
|
|
3759
|
+
const r = Oe(n[0]);
|
|
3727
3760
|
return r == null ? null : Math.tan(r);
|
|
3728
3761
|
}
|
|
3729
3762
|
case "asin": {
|
|
@@ -3772,46 +3805,51 @@ function hn(e) {
|
|
|
3772
3805
|
return null;
|
|
3773
3806
|
}
|
|
3774
3807
|
}
|
|
3775
|
-
function
|
|
3776
|
-
const t =
|
|
3808
|
+
function dc(e) {
|
|
3809
|
+
const t = dn(e);
|
|
3777
3810
|
if (t == null) return null;
|
|
3778
|
-
const n =
|
|
3779
|
-
return new
|
|
3780
|
-
}
|
|
3781
|
-
function
|
|
3782
|
-
if (e instanceof
|
|
3783
|
-
|
|
3811
|
+
const n = mo(e);
|
|
3812
|
+
return new k(t, n?.unit, n?.superType);
|
|
3813
|
+
}
|
|
3814
|
+
function mo(e) {
|
|
3815
|
+
if (e instanceof k) {
|
|
3816
|
+
if (e.unit && e.unit !== "string" && typeof e.value == "number") {
|
|
3817
|
+
const t = { unit: e.unit };
|
|
3818
|
+
return e.superType && (t.superType = e.superType), t;
|
|
3819
|
+
}
|
|
3820
|
+
return;
|
|
3821
|
+
}
|
|
3784
3822
|
if (e instanceof N) {
|
|
3785
3823
|
if (["asin", "acos", "atan", "atan2"].includes(e.name))
|
|
3786
3824
|
return { unit: "rad", superType: ["angle"] };
|
|
3787
3825
|
for (const t of e.values) {
|
|
3788
|
-
const n =
|
|
3826
|
+
const n = mo(t);
|
|
3789
3827
|
if (n) return n;
|
|
3790
3828
|
}
|
|
3791
3829
|
}
|
|
3792
3830
|
}
|
|
3793
|
-
const
|
|
3794
|
-
() =>
|
|
3795
|
-
),
|
|
3796
|
-
e ||
|
|
3797
|
-
|
|
3798
|
-
),
|
|
3831
|
+
const ne = y("("), re = y(")"), Ue = y(","), bo = T.lazy(
|
|
3832
|
+
() => ko.sepBy(d(Ue, w)).trim(w).map((e) => new Tt(...e))
|
|
3833
|
+
), wn = (e) => A(
|
|
3834
|
+
e || ti,
|
|
3835
|
+
bo.wrap(ne, re)
|
|
3836
|
+
), Gi = () => {
|
|
3799
3837
|
const e = T.lazy(
|
|
3800
3838
|
() => d(
|
|
3801
3839
|
Y(/[^()]+/),
|
|
3802
|
-
e.many(1).wrap(
|
|
3840
|
+
e.many(1).wrap(ne, re).map((t) => `(${t.flat().join("")})`)
|
|
3803
3841
|
).many(1)
|
|
3804
3842
|
);
|
|
3805
|
-
return
|
|
3806
|
-
e.trim(w).wrap(
|
|
3807
|
-
).map((t) => new
|
|
3808
|
-
}, { mathFunction:
|
|
3843
|
+
return y("var").next(
|
|
3844
|
+
e.trim(w).wrap(ne, re).map((t) => [t].flat(1 / 0).join(""))
|
|
3845
|
+
).map((t) => new k(t, "var"));
|
|
3846
|
+
}, { mathFunction: go } = Di(X.Value), Vi = ["translate", "scale", "rotate", "skew"], De = ["x", "y", "z"], Wi = De.map(g), Xi = Vi.map(g), Hi = () => {
|
|
3809
3847
|
const e = A(
|
|
3810
|
-
d(...
|
|
3811
|
-
d(...
|
|
3848
|
+
d(...Xi),
|
|
3849
|
+
d(...Wi, y(""))
|
|
3812
3850
|
), t = (r, o) => r + o.toUpperCase();
|
|
3813
|
-
return
|
|
3814
|
-
const i = r.toLowerCase(), a = i === "skew" ?
|
|
3851
|
+
return wn(e).map(([[r, o], s]) => {
|
|
3852
|
+
const i = r.toLowerCase(), a = i === "skew" ? De.filter((f) => f !== "z") : De, c = {};
|
|
3815
3853
|
if (o) {
|
|
3816
3854
|
const f = i + o.toUpperCase();
|
|
3817
3855
|
c[f] = s[0];
|
|
@@ -3823,14 +3861,14 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3823
3861
|
c[u] = f;
|
|
3824
3862
|
});
|
|
3825
3863
|
const l = Object.entries(c).map(([f, p]) => new N(f, [p]));
|
|
3826
|
-
return new
|
|
3864
|
+
return new Tt(...l);
|
|
3827
3865
|
});
|
|
3828
|
-
},
|
|
3866
|
+
}, ji = {
|
|
3829
3867
|
left: 270,
|
|
3830
3868
|
right: 90,
|
|
3831
3869
|
top: 0,
|
|
3832
3870
|
bottom: 180
|
|
3833
|
-
},
|
|
3871
|
+
}, Yi = {
|
|
3834
3872
|
"top left": 315,
|
|
3835
3873
|
"left top": 315,
|
|
3836
3874
|
"top right": 45,
|
|
@@ -3839,7 +3877,7 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3839
3877
|
"right bottom": 135,
|
|
3840
3878
|
"bottom left": 225,
|
|
3841
3879
|
"left bottom": 225
|
|
3842
|
-
},
|
|
3880
|
+
}, qi = () => {
|
|
3843
3881
|
const t = d(...[
|
|
3844
3882
|
"linear-gradient",
|
|
3845
3883
|
"radial-gradient",
|
|
@@ -3848,68 +3886,68 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3848
3886
|
"repeating-radial-gradient",
|
|
3849
3887
|
"repeating-conic-gradient"
|
|
3850
3888
|
].map(g)), n = d(...["left", "right", "top", "bottom"].map(g)), r = A(
|
|
3851
|
-
|
|
3889
|
+
y("to").skip(w),
|
|
3852
3890
|
n.skip(w),
|
|
3853
3891
|
n
|
|
3854
3892
|
).map(([, u, h]) => {
|
|
3855
|
-
const m = `${u.toLowerCase()} ${h.toLowerCase()}`, x =
|
|
3893
|
+
const m = `${u.toLowerCase()} ${h.toLowerCase()}`, x = Yi[m];
|
|
3856
3894
|
if (x == null) throw new Error(`Invalid gradient corner: to ${u} ${h}`);
|
|
3857
|
-
return new
|
|
3895
|
+
return new k(x, "deg");
|
|
3858
3896
|
}), o = A(
|
|
3859
|
-
|
|
3897
|
+
y("to").skip(w),
|
|
3860
3898
|
n
|
|
3861
|
-
).map(([, u]) => new
|
|
3899
|
+
).map(([, u]) => new k(ji[u.toLowerCase()], "deg")), s = d(r, o), i = A(
|
|
3862
3900
|
g("from").skip(w),
|
|
3863
|
-
|
|
3864
|
-
).map(([, u]) => u), a = d(
|
|
3865
|
-
|
|
3901
|
+
X.Angle
|
|
3902
|
+
).map(([, u]) => u), a = d(X.Angle, s), c = d(X.Length, X.Percentage), l = A(
|
|
3903
|
+
X.Color,
|
|
3866
3904
|
c.sepBy(w)
|
|
3867
3905
|
).map(([u, h]) => !h || h.length === 0 ? [u] : [u, ...h]), f = A(
|
|
3868
3906
|
l,
|
|
3869
|
-
|
|
3907
|
+
Ue.trim(w).next(d(l, c)).many()
|
|
3870
3908
|
).map(([u, h]) => [u, ...h]);
|
|
3871
3909
|
return A(
|
|
3872
3910
|
t,
|
|
3873
3911
|
A(
|
|
3874
|
-
d(i, a).skip(
|
|
3912
|
+
d(i, a).skip(Ue).opt(),
|
|
3875
3913
|
f
|
|
3876
|
-
).trim(w).wrap(
|
|
3914
|
+
).trim(w).wrap(ne, re).map(([u, h]) => u ? [u, ...h].flat() : [h])
|
|
3877
3915
|
).map(([u, h]) => new N(u, h));
|
|
3878
|
-
},
|
|
3879
|
-
...
|
|
3880
|
-
).map((e) => new
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
),
|
|
3888
|
-
Function:
|
|
3889
|
-
Value:
|
|
3890
|
-
FunctionArgs:
|
|
3891
|
-
},
|
|
3916
|
+
}, Zi = () => wn(y("cubic-bezier")).map((e) => new N("cubic-bezier", e[1])), Ki = ["inherit", "initial", "unset", "revert", "revert-layer"], Ji = d(
|
|
3917
|
+
...Ki.map(g)
|
|
3918
|
+
).map((e) => new k(e.toLowerCase(), "string", ["keyword"])), wo = Y(/[^\(\)\{\}\s,;]+/).map((e) => new k(e)), kn = d(
|
|
3919
|
+
Hi(),
|
|
3920
|
+
Gi(),
|
|
3921
|
+
go,
|
|
3922
|
+
qi(),
|
|
3923
|
+
Zi(),
|
|
3924
|
+
wn().map(([e, t]) => new N(e, t))
|
|
3925
|
+
), ko = d(Ji, X.Value, kn, wo).trim(w), wc = {
|
|
3926
|
+
Function: kn,
|
|
3927
|
+
Value: ko,
|
|
3928
|
+
FunctionArgs: bo
|
|
3929
|
+
}, Qi = A(y("{"), Y(/[^{}]+/), y("}")).map(
|
|
3892
3930
|
(e) => {
|
|
3893
3931
|
const t = e.join(`
|
|
3894
3932
|
`);
|
|
3895
3933
|
let n = JSON.parse(t);
|
|
3896
|
-
return new
|
|
3897
|
-
}
|
|
3898
|
-
),
|
|
3899
|
-
Value:
|
|
3900
|
-
Values:
|
|
3901
|
-
},
|
|
3902
|
-
(e) =>
|
|
3903
|
-
),
|
|
3904
|
-
|
|
3934
|
+
return new k(n, "json");
|
|
3935
|
+
}
|
|
3936
|
+
), Ge = d(go, X.Value, kn, Qi, wo).trim(w), kc = {
|
|
3937
|
+
Value: Ge,
|
|
3938
|
+
Values: Ge.sepBy(w)
|
|
3939
|
+
}, ta = se((e) => Mt(Ge, e)), yc = se(
|
|
3940
|
+
(e) => Mt(X.Percentage, String(e)).valueOf()
|
|
3941
|
+
), Sc = se((e) => Mt(
|
|
3942
|
+
X.Time.map((t) => t.unit === "ms" ? t.value : t.unit === "s" ? t.value * 1e3 : t.value),
|
|
3905
3943
|
e
|
|
3906
|
-
)),
|
|
3944
|
+
)), Cc = se(
|
|
3907
3945
|
(e, t) => (() => {
|
|
3908
3946
|
if (!t)
|
|
3909
3947
|
return e;
|
|
3910
3948
|
if (e.unit === "var") {
|
|
3911
3949
|
const o = getComputedStyle(t).getPropertyValue(e.value);
|
|
3912
|
-
return
|
|
3950
|
+
return po(o);
|
|
3913
3951
|
}
|
|
3914
3952
|
if (e.unit === "calc" && e.property && e.subProperty && e.value && t) {
|
|
3915
3953
|
const o = e.property, s = t.style[o], i = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
|
|
@@ -3918,13 +3956,13 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3918
3956
|
o
|
|
3919
3957
|
);
|
|
3920
3958
|
t.style[o] = s;
|
|
3921
|
-
const c =
|
|
3922
|
-
if (c instanceof
|
|
3959
|
+
const c = ta(a);
|
|
3960
|
+
if (c instanceof k)
|
|
3923
3961
|
return c;
|
|
3924
3962
|
if (c.name.startsWith("matrix")) {
|
|
3925
3963
|
const f = Ys(c)[e.subProperty];
|
|
3926
3964
|
if (f != null)
|
|
3927
|
-
return new
|
|
3965
|
+
return new k(f, "px", [
|
|
3928
3966
|
"length",
|
|
3929
3967
|
"absolute"
|
|
3930
3968
|
]);
|
|
@@ -3933,29 +3971,29 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3933
3971
|
return e;
|
|
3934
3972
|
})().coalesce(e),
|
|
3935
3973
|
{ keyFn: (e, t) => `${e.toString()}-${JSON.stringify(t)}` }
|
|
3936
|
-
),
|
|
3974
|
+
), ea = (e, t, n = !1) => {
|
|
3937
3975
|
if (e?.superType?.[0] !== t?.superType?.[0])
|
|
3938
3976
|
return n ? [e, t] : [e.clone(), t.clone()];
|
|
3939
3977
|
const r = (i) => {
|
|
3940
3978
|
switch (i?.superType?.[0]) {
|
|
3941
3979
|
case "length":
|
|
3942
3980
|
return {
|
|
3943
|
-
value:
|
|
3981
|
+
value: eo(i.value, i.unit, i.targets?.[0]),
|
|
3944
3982
|
unit: "px"
|
|
3945
3983
|
};
|
|
3946
3984
|
case "angle":
|
|
3947
3985
|
return {
|
|
3948
|
-
value:
|
|
3986
|
+
value: le(i.value, i.unit),
|
|
3949
3987
|
unit: "deg"
|
|
3950
3988
|
};
|
|
3951
3989
|
case "time":
|
|
3952
3990
|
return {
|
|
3953
|
-
value:
|
|
3991
|
+
value: no(i.value, i.unit),
|
|
3954
3992
|
unit: "ms"
|
|
3955
3993
|
};
|
|
3956
3994
|
case "resolution":
|
|
3957
3995
|
return {
|
|
3958
|
-
value:
|
|
3996
|
+
value: ro(i.value, i.unit),
|
|
3959
3997
|
unit: "dpi"
|
|
3960
3998
|
};
|
|
3961
3999
|
default:
|
|
@@ -3963,7 +4001,7 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3963
4001
|
}
|
|
3964
4002
|
}, [o, s] = [r(e), r(t)];
|
|
3965
4003
|
return n ? (e.value = o.value, e.unit = o.unit, t.value = s.value, t.unit = s.unit, [e, t]) : [
|
|
3966
|
-
new
|
|
4004
|
+
new k(
|
|
3967
4005
|
o.value,
|
|
3968
4006
|
o.unit,
|
|
3969
4007
|
e.superType,
|
|
@@ -3971,7 +4009,7 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3971
4009
|
e.property,
|
|
3972
4010
|
e.targets
|
|
3973
4011
|
),
|
|
3974
|
-
new
|
|
4012
|
+
new k(
|
|
3975
4013
|
s.value,
|
|
3976
4014
|
s.unit,
|
|
3977
4015
|
t.superType,
|
|
@@ -3981,14 +4019,14 @@ const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
|
3981
4019
|
)
|
|
3982
4020
|
];
|
|
3983
4021
|
};
|
|
3984
|
-
function
|
|
4022
|
+
function xc(e, t) {
|
|
3985
4023
|
e = e.coalesce(t, !0), t = t.coalesce(e, !0);
|
|
3986
4024
|
const n = {
|
|
3987
4025
|
start: e,
|
|
3988
4026
|
stop: t,
|
|
3989
4027
|
value: e.clone()
|
|
3990
4028
|
};
|
|
3991
|
-
if (
|
|
4029
|
+
if (Fe(e) && Fe(t)) {
|
|
3992
4030
|
const [r, o] = Gs(
|
|
3993
4031
|
e,
|
|
3994
4032
|
t,
|
|
@@ -3998,24 +4036,24 @@ function Sc(e, t) {
|
|
|
3998
4036
|
n.start = r, n.stop = o, n.value = r.clone();
|
|
3999
4037
|
}
|
|
4000
4038
|
if (e.unit !== t.unit) {
|
|
4001
|
-
const [r, o] =
|
|
4039
|
+
const [r, o] = ea(
|
|
4002
4040
|
e,
|
|
4003
4041
|
t,
|
|
4004
4042
|
!0
|
|
4005
4043
|
);
|
|
4006
4044
|
n.start = r, n.stop = o, n.value = r.clone();
|
|
4007
4045
|
}
|
|
4008
|
-
return n.computed =
|
|
4046
|
+
return n.computed = Le.includes(e.unit) || Le.includes(t.unit), n;
|
|
4009
4047
|
}
|
|
4010
|
-
function
|
|
4048
|
+
function na(e) {
|
|
4011
4049
|
const t = (n, r = 1) => Math.round(e[n] * r);
|
|
4012
4050
|
return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
|
|
4013
4051
|
}
|
|
4014
|
-
const
|
|
4015
|
-
const t =
|
|
4016
|
-
return
|
|
4017
|
-
},
|
|
4018
|
-
function
|
|
4052
|
+
const yn = (e) => [e.r, e.g, e.b], he = (e, t, n) => new U(e, t, n), ra = (e, t, n) => new dt(e, t, n), yo = (e) => {
|
|
4053
|
+
const t = Pr(e);
|
|
4054
|
+
return ra(t.h, t.s, t.l);
|
|
4055
|
+
}, oa = 1, sa = 1 / 6, ia = 5, aa = 15, ca = 100, la = 7500, ua = 200, Re = 360, fa = 50, pa = 20, ha = 3750, ma = 50, ba = 100, ga = 100, ot = 0.2126, st = 0.7152, it = 0.0722;
|
|
4056
|
+
function da(e, t = 0) {
|
|
4019
4057
|
const n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180), o = [
|
|
4020
4058
|
ot + r * (1 - ot) - n * ot,
|
|
4021
4059
|
st - r * st - n * st,
|
|
@@ -4027,111 +4065,111 @@ function ba(e, t = 0) {
|
|
|
4027
4065
|
st - r * st + n * st,
|
|
4028
4066
|
it + r * (1 - it) + n * it
|
|
4029
4067
|
];
|
|
4030
|
-
return
|
|
4068
|
+
return Sn(e, o);
|
|
4031
4069
|
}
|
|
4032
|
-
const
|
|
4033
|
-
function
|
|
4070
|
+
const $n = 0.393, Un = 0.769, Dn = 0.189, Gn = 0.349, Vn = 0.686, Wn = 0.168, Xn = 0.272, Hn = 0.534, jn = 0.131;
|
|
4071
|
+
function wa(e, t = 1) {
|
|
4034
4072
|
const n = [
|
|
4035
|
-
Pn + (1 - Pn) * (1 - t),
|
|
4036
|
-
zn - zn * (1 - t),
|
|
4037
|
-
Ln - Ln * (1 - t),
|
|
4038
|
-
Fn - Fn * (1 - t),
|
|
4039
4073
|
$n + (1 - $n) * (1 - t),
|
|
4040
|
-
Dn - Dn * (1 - t),
|
|
4041
4074
|
Un - Un * (1 - t),
|
|
4075
|
+
Dn - Dn * (1 - t),
|
|
4042
4076
|
Gn - Gn * (1 - t),
|
|
4043
|
-
Vn + (1 - Vn) * (1 - t)
|
|
4077
|
+
Vn + (1 - Vn) * (1 - t),
|
|
4078
|
+
Wn - Wn * (1 - t),
|
|
4079
|
+
Xn - Xn * (1 - t),
|
|
4080
|
+
Hn - Hn * (1 - t),
|
|
4081
|
+
jn + (1 - jn) * (1 - t)
|
|
4044
4082
|
];
|
|
4045
|
-
return
|
|
4083
|
+
return Sn(e, n);
|
|
4046
4084
|
}
|
|
4047
|
-
const
|
|
4048
|
-
function
|
|
4085
|
+
const St = 0.213, Ct = 0.715, xt = 0.072;
|
|
4086
|
+
function ka(e, t = 1) {
|
|
4049
4087
|
const n = [
|
|
4050
|
-
yt + (1 - yt) * t,
|
|
4051
|
-
St - St * t,
|
|
4052
|
-
Ct - Ct * t,
|
|
4053
|
-
yt - yt * t,
|
|
4054
4088
|
St + (1 - St) * t,
|
|
4055
4089
|
Ct - Ct * t,
|
|
4056
|
-
|
|
4090
|
+
xt - xt * t,
|
|
4057
4091
|
St - St * t,
|
|
4058
|
-
Ct + (1 - Ct) * t
|
|
4092
|
+
Ct + (1 - Ct) * t,
|
|
4093
|
+
xt - xt * t,
|
|
4094
|
+
St - St * t,
|
|
4095
|
+
Ct - Ct * t,
|
|
4096
|
+
xt + (1 - xt) * t
|
|
4059
4097
|
];
|
|
4060
|
-
return
|
|
4098
|
+
return Sn(e, n);
|
|
4061
4099
|
}
|
|
4062
|
-
function
|
|
4063
|
-
const n = P(
|
|
4064
|
-
return
|
|
4100
|
+
function Sn(e, t) {
|
|
4101
|
+
const n = P(yn(e), t);
|
|
4102
|
+
return he(_(n[0], 0, 255), _(n[1], 0, 255), _(n[2], 0, 255));
|
|
4065
4103
|
}
|
|
4066
|
-
function
|
|
4067
|
-
return
|
|
4104
|
+
function ya(e, t = 1) {
|
|
4105
|
+
return So(e, t);
|
|
4068
4106
|
}
|
|
4069
|
-
function
|
|
4070
|
-
return
|
|
4107
|
+
function Sa(e, t = 1) {
|
|
4108
|
+
return So(e, t, -(0.5 * t) + 0.5);
|
|
4071
4109
|
}
|
|
4072
|
-
function
|
|
4073
|
-
const r =
|
|
4074
|
-
return
|
|
4110
|
+
function So(e, t = 1, n = 0) {
|
|
4111
|
+
const r = yn(e);
|
|
4112
|
+
return he(
|
|
4075
4113
|
_(r[0] * t + n * 255, 0, 255),
|
|
4076
4114
|
_(r[1] * t + n * 255, 0, 255),
|
|
4077
4115
|
_(r[2] * t + n * 255, 0, 255)
|
|
4078
4116
|
);
|
|
4079
4117
|
}
|
|
4080
|
-
function
|
|
4081
|
-
const n =
|
|
4082
|
-
return
|
|
4118
|
+
function Ca(e, t = 1) {
|
|
4119
|
+
const n = yn(e);
|
|
4120
|
+
return he(
|
|
4083
4121
|
_((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
4084
4122
|
_((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
4085
4123
|
_((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255)
|
|
4086
4124
|
);
|
|
4087
4125
|
}
|
|
4088
|
-
function
|
|
4089
|
-
let r =
|
|
4090
|
-
r =
|
|
4091
|
-
const o =
|
|
4126
|
+
function Be(e, t, n) {
|
|
4127
|
+
let r = he(0, 0, 0);
|
|
4128
|
+
r = Ca(r, e[0] / 100), r = wa(r, e[1] / 100), r = ka(r, e[2] / 100), r = da(r, e[3] * 3.6), r = ya(r, e[4] / 100), r = Sa(r, e[5] / 100);
|
|
4129
|
+
const o = yo(r);
|
|
4092
4130
|
return Math.abs(r.r - t.r) + Math.abs(r.g - t.g) + Math.abs(r.b - t.b) + Math.abs(o.h - n.h) + Math.abs(o.s - n.s) + Math.abs(o.l - n.l);
|
|
4093
4131
|
}
|
|
4094
|
-
function
|
|
4132
|
+
function Co(e, t, n, r, o, s, i) {
|
|
4095
4133
|
let a = null, c = 1 / 0;
|
|
4096
4134
|
const l = new Array(6), f = new Array(6), p = new Array(6);
|
|
4097
4135
|
for (let u = 0; u < o; u++) {
|
|
4098
|
-
const h = n / Math.pow(u + 1,
|
|
4136
|
+
const h = n / Math.pow(u + 1, sa);
|
|
4099
4137
|
for (let b = 0; b < 6; b++)
|
|
4100
4138
|
l[b] = Math.random() > 0.5 ? 1 : -1, f[b] = r[b] + h * l[b], p[b] = r[b] - h * l[b];
|
|
4101
|
-
const m =
|
|
4139
|
+
const m = Be(f, s, i) - Be(p, s, i);
|
|
4102
4140
|
for (let b = 0; b < 6; b++) {
|
|
4103
|
-
const I = m / (2 * h) * l[b], E = t[b] / Math.pow(e + u + 1,
|
|
4104
|
-
r[b] =
|
|
4141
|
+
const I = m / (2 * h) * l[b], E = t[b] / Math.pow(e + u + 1, oa);
|
|
4142
|
+
r[b] = xa(r[b] - E * I, b);
|
|
4105
4143
|
}
|
|
4106
|
-
const x =
|
|
4144
|
+
const x = Be(r, s, i);
|
|
4107
4145
|
x < c && (a = [...r], c = x);
|
|
4108
4146
|
}
|
|
4109
4147
|
return { values: a ?? [...r], loss: c };
|
|
4110
4148
|
}
|
|
4111
|
-
function
|
|
4112
|
-
let n =
|
|
4113
|
-
return t === 2 ? n =
|
|
4149
|
+
function xa(e, t) {
|
|
4150
|
+
let n = ca;
|
|
4151
|
+
return t === 2 ? n = la : (t === 4 || t === 5) && (n = ua), t === 3 ? (e % Re + Re) % Re : _(e, 0, n);
|
|
4114
4152
|
}
|
|
4115
|
-
function
|
|
4153
|
+
function Ea(e, t, n) {
|
|
4116
4154
|
const r = e.loss, o = 2, s = r + 1, i = [0.25 * s, 0.25 * s, s, 0.25 * s, 0.2 * s, 0.2 * s];
|
|
4117
|
-
return
|
|
4155
|
+
return Co(r, i, o, e.values, 500, t, n);
|
|
4118
4156
|
}
|
|
4119
|
-
function
|
|
4157
|
+
function va(e, t) {
|
|
4120
4158
|
const n = [60, 180, 18e3, 600, 1.2, 1.2];
|
|
4121
4159
|
let r = { loss: 1 / 0, values: [] };
|
|
4122
4160
|
for (let o = 0; o < 3; o++)
|
|
4123
4161
|
if (r.loss > 25) {
|
|
4124
|
-
const i =
|
|
4125
|
-
|
|
4162
|
+
const i = Co(
|
|
4163
|
+
ia,
|
|
4126
4164
|
n,
|
|
4127
|
-
|
|
4165
|
+
aa,
|
|
4128
4166
|
[
|
|
4129
|
-
la,
|
|
4130
|
-
ua,
|
|
4131
4167
|
fa,
|
|
4132
4168
|
pa,
|
|
4133
4169
|
ha,
|
|
4134
|
-
ma
|
|
4170
|
+
ma,
|
|
4171
|
+
ba,
|
|
4172
|
+
ga
|
|
4135
4173
|
],
|
|
4136
4174
|
1e3,
|
|
4137
4175
|
e,
|
|
@@ -4141,22 +4179,22 @@ function xa(e, t) {
|
|
|
4141
4179
|
}
|
|
4142
4180
|
return r;
|
|
4143
4181
|
}
|
|
4144
|
-
function
|
|
4145
|
-
const t =
|
|
4182
|
+
function Ma(e) {
|
|
4183
|
+
const t = yo(e), n = Ea(va(e, t), e, t);
|
|
4146
4184
|
return {
|
|
4147
4185
|
values: n.values,
|
|
4148
4186
|
loss: n.loss,
|
|
4149
|
-
filter:
|
|
4187
|
+
filter: na(n.values)
|
|
4150
4188
|
};
|
|
4151
4189
|
}
|
|
4152
|
-
function
|
|
4153
|
-
return
|
|
4190
|
+
function Ec(e) {
|
|
4191
|
+
return Ma(e);
|
|
4154
4192
|
}
|
|
4155
|
-
function
|
|
4193
|
+
function xo(e) {
|
|
4156
4194
|
return e;
|
|
4157
4195
|
}
|
|
4158
|
-
function
|
|
4159
|
-
if (e.length === 0) return
|
|
4196
|
+
function vc(e) {
|
|
4197
|
+
if (e.length === 0) return xo;
|
|
4160
4198
|
if (e.length === 1) return () => e[0].output;
|
|
4161
4199
|
const t = e.map((o) => ({
|
|
4162
4200
|
output: o.output,
|
|
@@ -4195,28 +4233,28 @@ function xc(e) {
|
|
|
4195
4233
|
return Xt(l, a.output, c.output);
|
|
4196
4234
|
};
|
|
4197
4235
|
}
|
|
4198
|
-
function
|
|
4236
|
+
function Yn(e) {
|
|
4199
4237
|
return e * e;
|
|
4200
4238
|
}
|
|
4201
|
-
function
|
|
4239
|
+
function qn(e) {
|
|
4202
4240
|
return -e * (e - 2);
|
|
4203
4241
|
}
|
|
4204
|
-
function
|
|
4242
|
+
function Zn(e) {
|
|
4205
4243
|
return (e /= 0.5) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
|
|
4206
4244
|
}
|
|
4207
|
-
function
|
|
4245
|
+
function Kn(e) {
|
|
4208
4246
|
return e * e * e;
|
|
4209
4247
|
}
|
|
4210
|
-
function
|
|
4248
|
+
function Jn(e) {
|
|
4211
4249
|
return (e = e - 1) * e * e + 1;
|
|
4212
4250
|
}
|
|
4213
|
-
function
|
|
4251
|
+
function Qn(e) {
|
|
4214
4252
|
return (e /= 0.5) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
|
|
4215
4253
|
}
|
|
4216
|
-
function
|
|
4254
|
+
function tr(e) {
|
|
4217
4255
|
return e * e * (3 - 2 * e);
|
|
4218
4256
|
}
|
|
4219
|
-
function
|
|
4257
|
+
function Ta(e, t, n, r = 1e-6) {
|
|
4220
4258
|
let o = e;
|
|
4221
4259
|
for (let a = 0; a < 8; a++) {
|
|
4222
4260
|
const c = o * o, l = c * o, f = 1 - o, p = f * f, u = 3 * p * o * t + 3 * f * c * n + l - e;
|
|
@@ -4237,75 +4275,75 @@ function va(e, t, n, r = 1e-6) {
|
|
|
4237
4275
|
const nt = (e, t, n, r) => (o) => {
|
|
4238
4276
|
if (o <= 0) return 0;
|
|
4239
4277
|
if (o >= 1) return 1;
|
|
4240
|
-
const s =
|
|
4241
|
-
return
|
|
4278
|
+
const s = Ta(o, e, n);
|
|
4279
|
+
return Mr(s, e, t, n, r)[1];
|
|
4242
4280
|
};
|
|
4243
|
-
function
|
|
4281
|
+
function er(e) {
|
|
4244
4282
|
return e = nt(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
4245
4283
|
}
|
|
4246
|
-
function
|
|
4284
|
+
function nr(e) {
|
|
4247
4285
|
return e = nt(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
4248
4286
|
}
|
|
4249
|
-
function
|
|
4250
|
-
return e =
|
|
4287
|
+
function rr(e) {
|
|
4288
|
+
return e = ce(e, [
|
|
4251
4289
|
[0, 0],
|
|
4252
4290
|
[0.026, 1.746],
|
|
4253
4291
|
[0.633, 1.06],
|
|
4254
4292
|
[1, 0]
|
|
4255
4293
|
])[1], e;
|
|
4256
4294
|
}
|
|
4257
|
-
function
|
|
4258
|
-
return e =
|
|
4295
|
+
function or(e) {
|
|
4296
|
+
return e = ce(e, [
|
|
4259
4297
|
[0, 0],
|
|
4260
4298
|
[0.367, 0.94],
|
|
4261
4299
|
[0.974, 0.254],
|
|
4262
4300
|
[1, 0]
|
|
4263
4301
|
])[1], e;
|
|
4264
4302
|
}
|
|
4265
|
-
function
|
|
4266
|
-
return e =
|
|
4303
|
+
function sr(e) {
|
|
4304
|
+
return e = ce(e, [
|
|
4267
4305
|
[0, 0],
|
|
4268
4306
|
[0.026, 1.746],
|
|
4269
4307
|
[0.633, 1.06],
|
|
4270
4308
|
[1, 0]
|
|
4271
4309
|
])[1], e;
|
|
4272
4310
|
}
|
|
4273
|
-
function
|
|
4274
|
-
return e =
|
|
4311
|
+
function ir(e) {
|
|
4312
|
+
return e = ce(e, [
|
|
4275
4313
|
[0, 0],
|
|
4276
4314
|
[0.026, 1.746],
|
|
4277
4315
|
[0.633, 1.06],
|
|
4278
4316
|
[1, 0]
|
|
4279
4317
|
])[1], e;
|
|
4280
4318
|
}
|
|
4281
|
-
function
|
|
4319
|
+
function ar(e) {
|
|
4282
4320
|
return 1 - Math.cos(e * Math.PI / 2);
|
|
4283
4321
|
}
|
|
4284
|
-
function
|
|
4322
|
+
function cr(e) {
|
|
4285
4323
|
return Math.sin(e * Math.PI / 2);
|
|
4286
4324
|
}
|
|
4287
|
-
function
|
|
4325
|
+
function lr(e) {
|
|
4288
4326
|
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
4289
4327
|
}
|
|
4290
|
-
function
|
|
4328
|
+
function ur(e) {
|
|
4291
4329
|
return 1 - Math.sqrt(1 - e * e);
|
|
4292
4330
|
}
|
|
4293
|
-
function
|
|
4331
|
+
function fr(e) {
|
|
4294
4332
|
return Math.sqrt(1 - --e * e);
|
|
4295
4333
|
}
|
|
4296
|
-
function
|
|
4334
|
+
function pr(e) {
|
|
4297
4335
|
return (e /= 0.5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
|
|
4298
4336
|
}
|
|
4299
|
-
function
|
|
4337
|
+
function hr(e) {
|
|
4300
4338
|
return e === 0 ? 0 : Math.pow(2, 10 * (e - 1));
|
|
4301
4339
|
}
|
|
4302
|
-
function
|
|
4340
|
+
function mr(e) {
|
|
4303
4341
|
return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
|
|
4304
4342
|
}
|
|
4305
|
-
function
|
|
4343
|
+
function br(e) {
|
|
4306
4344
|
return e === 0 ? 0 : e === 1 ? 1 : (e /= 0.5) < 1 ? 0.5 * Math.pow(2, 10 * (e - 1)) : 0.5 * (2 - Math.pow(2, -10 * --e));
|
|
4307
4345
|
}
|
|
4308
|
-
const
|
|
4346
|
+
const Mc = [
|
|
4309
4347
|
"jump-start",
|
|
4310
4348
|
"jump-end",
|
|
4311
4349
|
"jump-none",
|
|
@@ -4314,38 +4352,38 @@ const Ec = [
|
|
|
4314
4352
|
"end",
|
|
4315
4353
|
"both"
|
|
4316
4354
|
];
|
|
4317
|
-
function
|
|
4355
|
+
function Aa(e, t) {
|
|
4318
4356
|
return Math.ceil(e * t) / t;
|
|
4319
4357
|
}
|
|
4320
|
-
function
|
|
4358
|
+
function Ia(e, t) {
|
|
4321
4359
|
return Math.floor(e * t) / t;
|
|
4322
4360
|
}
|
|
4323
|
-
function
|
|
4361
|
+
function Oa(e, t) {
|
|
4324
4362
|
return Math.floor(e * (t + 1)) / (t + 1);
|
|
4325
4363
|
}
|
|
4326
|
-
function
|
|
4364
|
+
function Ra(e, t) {
|
|
4327
4365
|
return t <= 1 ? e : Math.floor(e * (t - 1)) / (t - 1);
|
|
4328
4366
|
}
|
|
4329
|
-
function
|
|
4367
|
+
function Cn(e, t = "jump-end") {
|
|
4330
4368
|
switch (t) {
|
|
4331
4369
|
case "jump-none":
|
|
4332
|
-
return (n) =>
|
|
4370
|
+
return (n) => Ra(n, e);
|
|
4333
4371
|
case "jump-start":
|
|
4334
4372
|
case "start":
|
|
4335
|
-
return (n) =>
|
|
4373
|
+
return (n) => Aa(n, e);
|
|
4336
4374
|
case "jump-end":
|
|
4337
4375
|
case "end":
|
|
4338
|
-
return (n) =>
|
|
4376
|
+
return (n) => Ia(n, e);
|
|
4339
4377
|
case "jump-both":
|
|
4340
4378
|
case "both":
|
|
4341
|
-
return (n) =>
|
|
4379
|
+
return (n) => Oa(n, e);
|
|
4342
4380
|
}
|
|
4343
4381
|
}
|
|
4344
|
-
function
|
|
4345
|
-
return
|
|
4382
|
+
function Ba() {
|
|
4383
|
+
return Cn(1, "jump-start");
|
|
4346
4384
|
}
|
|
4347
|
-
function
|
|
4348
|
-
return
|
|
4385
|
+
function Na() {
|
|
4386
|
+
return Cn(1, "jump-end");
|
|
4349
4387
|
}
|
|
4350
4388
|
const bt = {
|
|
4351
4389
|
ease: [0.25, 0.1, 0.25, 1],
|
|
@@ -4355,56 +4393,56 @@ const bt = {
|
|
|
4355
4393
|
"ease-in-back": [0.6, -0.28, 0.735, 0.045],
|
|
4356
4394
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
4357
4395
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
4358
|
-
},
|
|
4359
|
-
linear:
|
|
4360
|
-
easeInQuad:
|
|
4361
|
-
"ease-in-quad":
|
|
4396
|
+
}, Tc = {
|
|
4397
|
+
linear: xo,
|
|
4398
|
+
easeInQuad: Yn,
|
|
4399
|
+
"ease-in-quad": Yn,
|
|
4362
4400
|
// "easeInQuad",
|
|
4363
|
-
easeOutQuad:
|
|
4364
|
-
"ease-out-quad":
|
|
4401
|
+
easeOutQuad: qn,
|
|
4402
|
+
"ease-out-quad": qn,
|
|
4365
4403
|
// "easeOutQuad",
|
|
4366
|
-
easeInOutQuad:
|
|
4367
|
-
"ease-in-out-quad":
|
|
4404
|
+
easeInOutQuad: Zn,
|
|
4405
|
+
"ease-in-out-quad": Zn,
|
|
4368
4406
|
// "easeInOutQuad",
|
|
4369
|
-
easeInCubic:
|
|
4370
|
-
"ease-in-cubic":
|
|
4371
|
-
easeOutCubic:
|
|
4372
|
-
"ease-out-cubic":
|
|
4373
|
-
easeInOutCubic:
|
|
4374
|
-
"ease-in-out-cubic":
|
|
4375
|
-
easeInBounce:
|
|
4376
|
-
"ease-in-bounce":
|
|
4407
|
+
easeInCubic: Kn,
|
|
4408
|
+
"ease-in-cubic": Kn,
|
|
4409
|
+
easeOutCubic: Jn,
|
|
4410
|
+
"ease-out-cubic": Jn,
|
|
4411
|
+
easeInOutCubic: Qn,
|
|
4412
|
+
"ease-in-out-cubic": Qn,
|
|
4413
|
+
easeInBounce: er,
|
|
4414
|
+
"ease-in-bounce": er,
|
|
4377
4415
|
// "easeInBounce",
|
|
4378
|
-
bounceInEase:
|
|
4379
|
-
"bounce-in-ease":
|
|
4380
|
-
bounceInEaseHalf:
|
|
4381
|
-
"bounce-in-ease-half":
|
|
4382
|
-
bounceOutEase:
|
|
4383
|
-
"bounce-out-ease":
|
|
4384
|
-
bounceOutEaseHalf:
|
|
4385
|
-
"bounce-out-ease-half":
|
|
4386
|
-
bounceInOutEase:
|
|
4387
|
-
"bounce-in-out-ease":
|
|
4388
|
-
easeInSine:
|
|
4389
|
-
"ease-in-sine":
|
|
4390
|
-
easeOutSine:
|
|
4391
|
-
"ease-out-sine":
|
|
4392
|
-
easeInOutSine:
|
|
4393
|
-
"ease-in-out-sine":
|
|
4394
|
-
easeInCirc:
|
|
4395
|
-
"ease-in-circ":
|
|
4396
|
-
easeOutCirc:
|
|
4397
|
-
"ease-out-circ":
|
|
4398
|
-
easeInOutCirc:
|
|
4399
|
-
"ease-in-out-circ":
|
|
4400
|
-
easeInExpo:
|
|
4401
|
-
"ease-in-expo":
|
|
4402
|
-
easeOutExpo:
|
|
4403
|
-
"ease-out-expo":
|
|
4404
|
-
easeInOutExpo:
|
|
4405
|
-
"ease-in-out-expo":
|
|
4406
|
-
smoothStep3:
|
|
4407
|
-
"smooth-step-3":
|
|
4416
|
+
bounceInEase: nr,
|
|
4417
|
+
"bounce-in-ease": nr,
|
|
4418
|
+
bounceInEaseHalf: rr,
|
|
4419
|
+
"bounce-in-ease-half": rr,
|
|
4420
|
+
bounceOutEase: or,
|
|
4421
|
+
"bounce-out-ease": or,
|
|
4422
|
+
bounceOutEaseHalf: sr,
|
|
4423
|
+
"bounce-out-ease-half": sr,
|
|
4424
|
+
bounceInOutEase: ir,
|
|
4425
|
+
"bounce-in-out-ease": ir,
|
|
4426
|
+
easeInSine: ar,
|
|
4427
|
+
"ease-in-sine": ar,
|
|
4428
|
+
easeOutSine: cr,
|
|
4429
|
+
"ease-out-sine": cr,
|
|
4430
|
+
easeInOutSine: lr,
|
|
4431
|
+
"ease-in-out-sine": lr,
|
|
4432
|
+
easeInCirc: ur,
|
|
4433
|
+
"ease-in-circ": ur,
|
|
4434
|
+
easeOutCirc: fr,
|
|
4435
|
+
"ease-out-circ": fr,
|
|
4436
|
+
easeInOutCirc: pr,
|
|
4437
|
+
"ease-in-out-circ": pr,
|
|
4438
|
+
easeInExpo: hr,
|
|
4439
|
+
"ease-in-expo": hr,
|
|
4440
|
+
easeOutExpo: mr,
|
|
4441
|
+
"ease-out-expo": mr,
|
|
4442
|
+
easeInOutExpo: br,
|
|
4443
|
+
"ease-in-out-expo": br,
|
|
4444
|
+
smoothStep3: tr,
|
|
4445
|
+
"smooth-step-3": tr,
|
|
4408
4446
|
ease: nt(...bt.ease),
|
|
4409
4447
|
"ease-in": nt(...bt["ease-in"]),
|
|
4410
4448
|
"ease-out": nt(...bt["ease-out"]),
|
|
@@ -4412,11 +4450,11 @@ const bt = {
|
|
|
4412
4450
|
"ease-in-back": nt(...bt["ease-in-back"]),
|
|
4413
4451
|
"ease-out-back": nt(...bt["ease-out-back"]),
|
|
4414
4452
|
"ease-in-out-back": nt(...bt["ease-in-out-back"]),
|
|
4415
|
-
steps:
|
|
4416
|
-
"step-start":
|
|
4417
|
-
"step-end":
|
|
4453
|
+
steps: Cn,
|
|
4454
|
+
"step-start": Ba,
|
|
4455
|
+
"step-end": Na
|
|
4418
4456
|
};
|
|
4419
|
-
function
|
|
4457
|
+
function Ac(e, t, n, r, o, s) {
|
|
4420
4458
|
const i = o, a = s;
|
|
4421
4459
|
let c = e, l = t, f = n, p = r, u = Math.sqrt(c * c + l * l);
|
|
4422
4460
|
u !== 0 && (c /= u, l /= u);
|
|
@@ -4427,7 +4465,7 @@ function Mc(e, t, n, r, o, s) {
|
|
|
4427
4465
|
const b = Math.atan2(l, c);
|
|
4428
4466
|
return { translateX: i, translateY: a, scaleX: u, scaleY: m, angle: b, skew: h };
|
|
4429
4467
|
}
|
|
4430
|
-
function
|
|
4468
|
+
function $t() {
|
|
4431
4469
|
return [
|
|
4432
4470
|
1,
|
|
4433
4471
|
0,
|
|
@@ -4447,36 +4485,36 @@ function Ft() {
|
|
|
4447
4485
|
1
|
|
4448
4486
|
];
|
|
4449
4487
|
}
|
|
4450
|
-
function
|
|
4488
|
+
function oe(e, t, n) {
|
|
4451
4489
|
return e[n * 4 + t];
|
|
4452
4490
|
}
|
|
4453
|
-
function
|
|
4491
|
+
function K(e, t, n, r) {
|
|
4454
4492
|
e[n * 4 + t] = r;
|
|
4455
4493
|
}
|
|
4456
|
-
function
|
|
4494
|
+
function Ut(e, t) {
|
|
4457
4495
|
const n = new Array(16).fill(0);
|
|
4458
4496
|
for (let r = 0; r < 4; r++)
|
|
4459
4497
|
for (let o = 0; o < 4; o++) {
|
|
4460
4498
|
let s = 0;
|
|
4461
4499
|
for (let i = 0; i < 4; i++)
|
|
4462
|
-
s +=
|
|
4463
|
-
|
|
4500
|
+
s += oe(e, o, i) * oe(t, i, r);
|
|
4501
|
+
K(n, o, r, s);
|
|
4464
4502
|
}
|
|
4465
4503
|
return n;
|
|
4466
4504
|
}
|
|
4467
|
-
function
|
|
4505
|
+
function _a(e) {
|
|
4468
4506
|
const t = new Array(16).fill(0);
|
|
4469
4507
|
for (let n = 0; n < 4; n++)
|
|
4470
4508
|
for (let r = 0; r < 4; r++)
|
|
4471
|
-
|
|
4509
|
+
K(t, r, n, oe(e, n, r));
|
|
4472
4510
|
return t;
|
|
4473
4511
|
}
|
|
4474
|
-
function
|
|
4512
|
+
function Pa(e) {
|
|
4475
4513
|
const t = e[0], n = e[4], r = e[8], o = e[12], s = e[1], i = e[5], a = e[9], c = e[13], l = e[2], f = e[6], p = e[10], u = e[14], h = e[3], m = e[7], x = e[11], b = e[15];
|
|
4476
4514
|
return t * (i * (p * b - u * x) - a * (f * b - u * m) + c * (f * x - p * m)) - n * (s * (p * b - u * x) - a * (l * b - u * h) + c * (l * x - p * h)) + r * (s * (f * b - u * m) - i * (l * b - u * h) + c * (l * m - f * h)) - o * (s * (f * x - p * m) - i * (l * x - p * h) + a * (l * m - f * h));
|
|
4477
4515
|
}
|
|
4478
|
-
function
|
|
4479
|
-
const t =
|
|
4516
|
+
function za(e) {
|
|
4517
|
+
const t = Pa(e);
|
|
4480
4518
|
if (Math.abs(t) < 1e-12) return null;
|
|
4481
4519
|
const n = new Array(16).fill(0);
|
|
4482
4520
|
for (let r = 0; r < 4; r++)
|
|
@@ -4485,16 +4523,16 @@ function _a(e) {
|
|
|
4485
4523
|
for (let c = 0; c < 4; c++)
|
|
4486
4524
|
if (c !== r)
|
|
4487
4525
|
for (let l = 0; l < 4; l++)
|
|
4488
|
-
l !== o && s.push(
|
|
4526
|
+
l !== o && s.push(oe(e, l, c));
|
|
4489
4527
|
const i = s[0] * (s[4] * s[8] - s[5] * s[7]) - s[3] * (s[1] * s[8] - s[2] * s[7]) + s[6] * (s[1] * s[5] - s[2] * s[4]), a = (o + r & 1) === 0 ? 1 : -1;
|
|
4490
|
-
|
|
4528
|
+
K(n, r, o, a * i / t);
|
|
4491
4529
|
}
|
|
4492
4530
|
return n;
|
|
4493
4531
|
}
|
|
4494
|
-
function
|
|
4532
|
+
function Ne(e, t, n) {
|
|
4495
4533
|
return Math.sqrt(e * e + t * t + n * n);
|
|
4496
4534
|
}
|
|
4497
|
-
function
|
|
4535
|
+
function La(e, t) {
|
|
4498
4536
|
return [
|
|
4499
4537
|
e[1] * t[2] - e[2] * t[1],
|
|
4500
4538
|
e[2] * t[0] - e[0] * t[2],
|
|
@@ -4504,23 +4542,23 @@ function Pa(e, t) {
|
|
|
4504
4542
|
function Dt(e, t) {
|
|
4505
4543
|
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
|
|
4506
4544
|
}
|
|
4507
|
-
function
|
|
4545
|
+
function Ic(e) {
|
|
4508
4546
|
if (e.length !== 16) return null;
|
|
4509
4547
|
const t = [...e], n = t[15];
|
|
4510
4548
|
if (Math.abs(n) < 1e-12) return null;
|
|
4511
|
-
for (let b = 0; b < 16; b++) t[b]
|
|
4549
|
+
for (let b = 0; b < 16; b++) t[b] = t[b] / n;
|
|
4512
4550
|
const r = [0, 0, 0, 1];
|
|
4513
4551
|
if (Math.abs(t[3]) > 1e-12 || Math.abs(t[7]) > 1e-12 || Math.abs(t[11]) > 1e-12) {
|
|
4514
4552
|
const b = [...t];
|
|
4515
4553
|
b[3] = 0, b[7] = 0, b[11] = 0, b[15] = 1;
|
|
4516
|
-
const I =
|
|
4554
|
+
const I = za(b);
|
|
4517
4555
|
if (!I) return null;
|
|
4518
|
-
const E =
|
|
4556
|
+
const E = _a(I);
|
|
4519
4557
|
r[0] = E[0] * t[3] + E[4] * t[7] + E[8] * t[11] + E[12] * t[15], r[1] = E[1] * t[3] + E[5] * t[7] + E[9] * t[11] + E[13] * t[15], r[2] = E[2] * t[3] + E[6] * t[7] + E[10] * t[11] + E[14] * t[15], r[3] = E[3] * t[3] + E[7] * t[7] + E[11] * t[11] + E[15] * t[15];
|
|
4520
4558
|
}
|
|
4521
4559
|
const o = [t[12], t[13], t[14]];
|
|
4522
4560
|
let s = [t[0], t[1], t[2]], i = [t[4], t[5], t[6]], a = [t[8], t[9], t[10]];
|
|
4523
|
-
const c =
|
|
4561
|
+
const c = Ne(...s);
|
|
4524
4562
|
s = [s[0] / c, s[1] / c, s[2] / c];
|
|
4525
4563
|
let l = Dt(s, i);
|
|
4526
4564
|
i = [
|
|
@@ -4528,7 +4566,7 @@ function Tc(e) {
|
|
|
4528
4566
|
i[1] - s[1] * l,
|
|
4529
4567
|
i[2] - s[2] * l
|
|
4530
4568
|
];
|
|
4531
|
-
const f =
|
|
4569
|
+
const f = Ne(...i);
|
|
4532
4570
|
i = [i[0] / f, i[1] / f, i[2] / f], l /= f;
|
|
4533
4571
|
let p = Dt(s, a);
|
|
4534
4572
|
a = [
|
|
@@ -4542,11 +4580,11 @@ function Tc(e) {
|
|
|
4542
4580
|
a[1] - i[1] * u,
|
|
4543
4581
|
a[2] - i[2] * u
|
|
4544
4582
|
];
|
|
4545
|
-
const h =
|
|
4583
|
+
const h = Ne(...a);
|
|
4546
4584
|
a = [a[0] / h, a[1] / h, a[2] / h], p /= h, u /= h;
|
|
4547
|
-
const m =
|
|
4585
|
+
const m = La(i, a);
|
|
4548
4586
|
Dt(s, m) < 0 && (s = [-s[0], -s[1], -s[2]], i = [-i[0], -i[1], -i[2]], a = [-a[0], -a[1], -a[2]]);
|
|
4549
|
-
const x =
|
|
4587
|
+
const x = Fa(
|
|
4550
4588
|
s[0],
|
|
4551
4589
|
i[0],
|
|
4552
4590
|
a[0],
|
|
@@ -4565,7 +4603,7 @@ function Tc(e) {
|
|
|
4565
4603
|
perspective: r
|
|
4566
4604
|
};
|
|
4567
4605
|
}
|
|
4568
|
-
function
|
|
4606
|
+
function Fa(e, t, n, r, o, s, i, a, c) {
|
|
4569
4607
|
const l = e + o + c;
|
|
4570
4608
|
let f, p, u, h;
|
|
4571
4609
|
if (l > 0) {
|
|
@@ -4583,7 +4621,7 @@ function za(e, t, n, r, o, s, i, a, c) {
|
|
|
4583
4621
|
}
|
|
4584
4622
|
return [f, p, u, h];
|
|
4585
4623
|
}
|
|
4586
|
-
function
|
|
4624
|
+
function $a(e, t, n) {
|
|
4587
4625
|
let r = e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3];
|
|
4588
4626
|
if (r < 0 && (t = [-t[0], -t[1], -t[2], -t[3]], r = -r), r > 0.9995) {
|
|
4589
4627
|
const c = [
|
|
@@ -4604,33 +4642,33 @@ function La(e, t, n) {
|
|
|
4604
4642
|
e[3] * i + t[3] * a
|
|
4605
4643
|
];
|
|
4606
4644
|
}
|
|
4607
|
-
function
|
|
4608
|
-
const t =
|
|
4609
|
-
|
|
4610
|
-
const n =
|
|
4645
|
+
function Oc(e) {
|
|
4646
|
+
const t = $t();
|
|
4647
|
+
K(t, 0, 3, e.perspective[0]), K(t, 1, 3, e.perspective[1]), K(t, 2, 3, e.perspective[2]), K(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];
|
|
4648
|
+
const n = Ua(e.quaternion), r = Ut(t, n);
|
|
4611
4649
|
for (let a = 0; a < 16; a++) t[a] = r[a];
|
|
4612
4650
|
if (e.skew[2] !== 0) {
|
|
4613
|
-
const a =
|
|
4614
|
-
|
|
4615
|
-
const c =
|
|
4651
|
+
const a = $t();
|
|
4652
|
+
K(a, 1, 2, e.skew[2]);
|
|
4653
|
+
const c = Ut(t, a);
|
|
4616
4654
|
for (let l = 0; l < 16; l++) t[l] = c[l];
|
|
4617
4655
|
}
|
|
4618
4656
|
if (e.skew[1] !== 0) {
|
|
4619
|
-
const a =
|
|
4620
|
-
|
|
4621
|
-
const c =
|
|
4657
|
+
const a = $t();
|
|
4658
|
+
K(a, 0, 2, e.skew[1]);
|
|
4659
|
+
const c = Ut(t, a);
|
|
4622
4660
|
for (let l = 0; l < 16; l++) t[l] = c[l];
|
|
4623
4661
|
}
|
|
4624
4662
|
if (e.skew[0] !== 0) {
|
|
4625
|
-
const a =
|
|
4626
|
-
|
|
4627
|
-
const c =
|
|
4663
|
+
const a = $t();
|
|
4664
|
+
K(a, 0, 1, e.skew[0]);
|
|
4665
|
+
const c = Ut(t, a);
|
|
4628
4666
|
for (let l = 0; l < 16; l++) t[l] = c[l];
|
|
4629
4667
|
}
|
|
4630
4668
|
const [o, s, i] = e.scale;
|
|
4631
|
-
return t[0]
|
|
4669
|
+
return t[0] = t[0] * o, t[1] = t[1] * o, t[2] = t[2] * o, t[3] = t[3] * o, t[4] = t[4] * s, t[5] = t[5] * s, t[6] = t[6] * s, t[7] = t[7] * s, t[8] = t[8] * i, t[9] = t[9] * i, t[10] = t[10] * i, t[11] = t[11] * i, [...t];
|
|
4632
4670
|
}
|
|
4633
|
-
function
|
|
4671
|
+
function Ua(e) {
|
|
4634
4672
|
const [t, n, r, o] = e, s = t * t, i = n * n, a = r * r, c = t * n, l = t * r, f = n * r, p = o * t, u = o * n, h = o * r;
|
|
4635
4673
|
return [
|
|
4636
4674
|
1 - 2 * (i + a),
|
|
@@ -4651,7 +4689,7 @@ function Fa(e) {
|
|
|
4651
4689
|
1
|
|
4652
4690
|
];
|
|
4653
4691
|
}
|
|
4654
|
-
function
|
|
4692
|
+
function Rc(e, t, n) {
|
|
4655
4693
|
const r = (o, s) => o + (s - o) * n;
|
|
4656
4694
|
return {
|
|
4657
4695
|
translate: [
|
|
@@ -4669,7 +4707,7 @@ function Ic(e, t, n) {
|
|
|
4669
4707
|
r(e.skew[1], t.skew[1]),
|
|
4670
4708
|
r(e.skew[2], t.skew[2])
|
|
4671
4709
|
],
|
|
4672
|
-
quaternion:
|
|
4710
|
+
quaternion: $a(e.quaternion, t.quaternion, n),
|
|
4673
4711
|
perspective: [
|
|
4674
4712
|
r(e.perspective[0], t.perspective[0]),
|
|
4675
4713
|
r(e.perspective[1], t.perspective[1]),
|
|
@@ -4679,239 +4717,239 @@ function Ic(e, t, n) {
|
|
|
4679
4717
|
};
|
|
4680
4718
|
}
|
|
4681
4719
|
export {
|
|
4682
|
-
|
|
4720
|
+
Kr as ABSOLUTE_LENGTH_UNITS,
|
|
4683
4721
|
G as ALPHA_DENORM_UNIT,
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4722
|
+
S as ALPHA_RANGE,
|
|
4723
|
+
Jt as ANGLE_UNITS,
|
|
4724
|
+
Ze as AdobeRGBColor,
|
|
4725
|
+
Xs as BLACKLISTED_COALESCE_UNITS,
|
|
4726
|
+
Bn as COLOR_NAMES,
|
|
4727
|
+
Sr as COLOR_SPACE_DENORM_UNITS,
|
|
4728
|
+
tc as COLOR_SPACE_NAMES,
|
|
4691
4729
|
C as COLOR_SPACE_RANGES,
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4730
|
+
Ws as COLOR_UNITS,
|
|
4731
|
+
Le as COMPUTED_UNITS,
|
|
4732
|
+
gn as CSSColor,
|
|
4695
4733
|
nt as CSSCubicBezier,
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4734
|
+
wc as CSSFunction,
|
|
4735
|
+
Qi as CSSJSON,
|
|
4736
|
+
wo as CSSString,
|
|
4737
|
+
X as CSSValueUnit,
|
|
4738
|
+
kc as CSSValues,
|
|
4739
|
+
Ki as CSS_WIDE_KEYWORDS,
|
|
4702
4740
|
zs as CYLINDRICAL_HUE_COMPONENT,
|
|
4703
4741
|
H as Color,
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4742
|
+
oc as DELTA_E_OK_JND,
|
|
4743
|
+
qe as DisplayP3Color,
|
|
4744
|
+
to as FLEX_UNITS,
|
|
4745
|
+
_e as FRAME_RATE,
|
|
4746
|
+
Qt as FREQUENCY_UNITS,
|
|
4709
4747
|
N as FunctionValue,
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4748
|
+
$o as GAMUT_SECTOR_COEFFICIENTS,
|
|
4749
|
+
dt as HSLColor,
|
|
4750
|
+
We as HSVColor,
|
|
4751
|
+
Rt as HUE_RANGE,
|
|
4752
|
+
Xe as HWBColor,
|
|
4753
|
+
dr as KelvinColor,
|
|
4754
|
+
ie as LABColor,
|
|
4755
|
+
He as LCHColor,
|
|
4718
4756
|
Zt as LENGTH_UNITS,
|
|
4719
4757
|
tt as LINEAR_SRGB_TO_LMS,
|
|
4720
4758
|
M as LMS_TO_LINEAR_SRGB,
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4759
|
+
vr as LMS_TO_OKLAB_MATRIX,
|
|
4760
|
+
Lo as LMS_TO_XYZ_MATRIX,
|
|
4761
|
+
Ye as LinearSRGBColor,
|
|
4762
|
+
ae as OKLABColor,
|
|
4725
4763
|
$ as OKLAB_TO_LMS_COEFF,
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4764
|
+
Fo as OKLAB_TO_LMS_MATRIX,
|
|
4765
|
+
je as OKLCHColor,
|
|
4766
|
+
Qr as PERCENTAGE_UNITS,
|
|
4767
|
+
Ke as ProPhotoRGBColor,
|
|
4768
|
+
Jr as RELATIVE_LENGTH_UNITS,
|
|
4769
|
+
te as RESOLUTION_UNITS,
|
|
4732
4770
|
L as RGBA_MAX,
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4771
|
+
U as RGBColor,
|
|
4772
|
+
ye as RGB_RANGE,
|
|
4773
|
+
Je as Rec2020Color,
|
|
4736
4774
|
Vs as STRING_UNITS,
|
|
4737
4775
|
Hs as STYLE_NAMES,
|
|
4738
4776
|
Kt as TIME_UNITS,
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4777
|
+
uc as UNITS,
|
|
4778
|
+
D as UNIT_RANGE,
|
|
4779
|
+
Tt as ValueArray,
|
|
4780
|
+
k as ValueUnit,
|
|
4781
|
+
xr as WHITE_POINTS,
|
|
4782
|
+
zo as WHITE_POINT_D50,
|
|
4783
|
+
Cr as WHITE_POINT_D50_D65,
|
|
4784
|
+
Po as WHITE_POINT_D65,
|
|
4785
|
+
Qe as WHITE_POINT_D65_D50,
|
|
4786
|
+
W as XYZColor,
|
|
4787
|
+
Er as XYZ_TO_LMS_MATRIX,
|
|
4750
4788
|
Is as adobeRgb2xyz,
|
|
4751
|
-
|
|
4752
|
-
|
|
4789
|
+
Ee as adobeRgbToLinear,
|
|
4790
|
+
Da as arrayEquals,
|
|
4753
4791
|
bt as bezierPresets,
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4792
|
+
nr as bounceInEase,
|
|
4793
|
+
rr as bounceInEaseHalf,
|
|
4794
|
+
ir as bounceInOutEase,
|
|
4795
|
+
or as bounceOutEase,
|
|
4796
|
+
sr as bounceOutEaseHalf,
|
|
4797
|
+
ja as camelCaseToHyphen,
|
|
4798
|
+
Za as cancelAnimationFrame,
|
|
4761
4799
|
_ as clamp,
|
|
4762
4800
|
at as clone,
|
|
4763
4801
|
gt as color2,
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4802
|
+
_n as colorUnit2,
|
|
4803
|
+
Go as computeMaxSaturation,
|
|
4804
|
+
bc as convert2,
|
|
4805
|
+
Ks as convertAbsoluteUnitToPixels,
|
|
4806
|
+
ro as convertToDPI,
|
|
4807
|
+
le as convertToDegrees,
|
|
4808
|
+
Js as convertToHz,
|
|
4809
|
+
no as convertToMs,
|
|
4810
|
+
eo as convertToPixels,
|
|
4811
|
+
Xa as createHash,
|
|
4812
|
+
na as cssFiltersToString,
|
|
4813
|
+
vc as cssLinear,
|
|
4814
|
+
Mr as cubicBezier,
|
|
4815
|
+
nc as cubicBezierToSVG,
|
|
4816
|
+
rc as cubicBezierToString,
|
|
4817
|
+
Ht as deCasteljau,
|
|
4818
|
+
Wa as debounce,
|
|
4819
|
+
Ac as decomposeMatrix2D,
|
|
4820
|
+
Ic as decomposeMatrix3D,
|
|
4821
|
+
sc as deltaEOK,
|
|
4784
4822
|
Ts as displayP32xyz,
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4823
|
+
er as easeInBounce,
|
|
4824
|
+
ur as easeInCirc,
|
|
4825
|
+
Kn as easeInCubic,
|
|
4826
|
+
hr as easeInExpo,
|
|
4827
|
+
pr as easeInOutCirc,
|
|
4828
|
+
Qn as easeInOutCubic,
|
|
4829
|
+
br as easeInOutExpo,
|
|
4830
|
+
Zn as easeInOutQuad,
|
|
4831
|
+
lr as easeInOutSine,
|
|
4832
|
+
Yn as easeInQuad,
|
|
4833
|
+
ar as easeInSine,
|
|
4834
|
+
fr as easeOutCirc,
|
|
4835
|
+
Jn as easeOutCubic,
|
|
4836
|
+
mr as easeOutExpo,
|
|
4837
|
+
qn as easeOutQuad,
|
|
4838
|
+
cr as easeOutSine,
|
|
4839
|
+
dc as evaluateMathFunction,
|
|
4840
|
+
ri as fail,
|
|
4841
|
+
Vo as findCusp,
|
|
4842
|
+
Wo as findGamutIntersection,
|
|
4843
|
+
fc as flattenObject,
|
|
4806
4844
|
Ps as gamutMap,
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4845
|
+
jo as gamutMapOKLab,
|
|
4846
|
+
qo as gamutMapSRGB,
|
|
4847
|
+
Cc as getComputedValue,
|
|
4848
|
+
ic as getFormattedColorSpaceRange,
|
|
4849
|
+
Zo as hex2rgb,
|
|
4850
|
+
_r as hsl2hsv,
|
|
4851
|
+
Qo as hsl2hwb,
|
|
4852
|
+
ts as hsl2rgb,
|
|
4853
|
+
fn as hsl2xyz,
|
|
4854
|
+
Nr as hsv2hsl,
|
|
4855
|
+
fs as hsv2xyz,
|
|
4856
|
+
Jo as hwb2hsl,
|
|
4857
|
+
hs as hwb2xyz,
|
|
4858
|
+
Ha as hyphenToCamelCase,
|
|
4859
|
+
ti as identifier,
|
|
4860
|
+
ei as integer,
|
|
4861
|
+
ce as interpBezier,
|
|
4862
|
+
Rc as interpolateDecomposed,
|
|
4825
4863
|
Ls as interpolateHue,
|
|
4826
4864
|
ct as invertMat3,
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4865
|
+
mc as isCSSStyleName,
|
|
4866
|
+
Fe as isColorUnit,
|
|
4867
|
+
Do as isInSRGBGamut,
|
|
4868
|
+
gr as isObject,
|
|
4831
4869
|
g as istring,
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4870
|
+
Mc as jumpTerms,
|
|
4871
|
+
Br as kelvin2rgb,
|
|
4872
|
+
ks as kelvin2xyz,
|
|
4873
|
+
cs as lab2lch,
|
|
4874
|
+
us as lab2oklab,
|
|
4875
|
+
lc as lab2oklch,
|
|
4876
|
+
rn as lab2xyz,
|
|
4877
|
+
as as lch2lab,
|
|
4878
|
+
bs as lch2xyz,
|
|
4841
4879
|
Xt as lerp,
|
|
4842
|
-
|
|
4880
|
+
xo as linear,
|
|
4843
4881
|
vs as linearSrgb2xyz,
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4882
|
+
ve as linearToAdobeRgb,
|
|
4883
|
+
Te as linearToProPhoto,
|
|
4884
|
+
Ie as linearToRec2020,
|
|
4885
|
+
vt as linearToSrgb,
|
|
4886
|
+
ec as logerp,
|
|
4887
|
+
se as memoize,
|
|
4850
4888
|
Fs as mixColors,
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4889
|
+
Qa as multiplyMat3,
|
|
4890
|
+
hn as none,
|
|
4891
|
+
Ds as normalizeColor,
|
|
4892
|
+
ze as normalizeColorUnit,
|
|
4893
|
+
Us as normalizeColorUnitComponent,
|
|
4856
4894
|
Gs as normalizeColorUnits,
|
|
4857
|
-
|
|
4858
|
-
|
|
4895
|
+
ea as normalizeNumericUnits,
|
|
4896
|
+
xc as normalizeValueUnits,
|
|
4859
4897
|
J as number,
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4898
|
+
ls as oklab2lab,
|
|
4899
|
+
Dr as oklab2oklch,
|
|
4900
|
+
ln as oklab2xyz,
|
|
4901
|
+
en as oklabToLinearSRGB,
|
|
4902
|
+
cc as oklch2lab,
|
|
4903
|
+
Gr as oklch2oklab,
|
|
4904
|
+
ds as oklch2xyz,
|
|
4905
|
+
gc as parseCSSColor,
|
|
4906
|
+
yc as parseCSSPercent,
|
|
4907
|
+
Sc as parseCSSTime,
|
|
4908
|
+
ta as parseCSSValue,
|
|
4909
|
+
po as parseCSSValueUnit,
|
|
4910
|
+
oi as parseResult,
|
|
4873
4911
|
Rs as proPhoto2xyz,
|
|
4874
|
-
|
|
4912
|
+
Me as proPhotoToLinear,
|
|
4875
4913
|
Ns as rec20202xyz,
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4914
|
+
Ae as rec2020ToLinear,
|
|
4915
|
+
Oc as recomposeMatrix3D,
|
|
4916
|
+
qa as requestAnimationFrame,
|
|
4917
|
+
Ec as rgb2ColorFilter,
|
|
4918
|
+
ac as rgb2hex,
|
|
4919
|
+
Pr as rgb2hsl,
|
|
4920
|
+
Ko as rgb2kelvin,
|
|
4921
|
+
an as rgb2xyz,
|
|
4884
4922
|
B as scale,
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4923
|
+
Ya as seekPreviousValue,
|
|
4924
|
+
Ga as sleep,
|
|
4925
|
+
$a as slerp,
|
|
4926
|
+
tr as smoothStep3,
|
|
4927
|
+
Et as srgbToLinear,
|
|
4928
|
+
Yo as srgbToOKLab,
|
|
4929
|
+
Na as stepEnd,
|
|
4930
|
+
Ba as stepStart,
|
|
4931
|
+
Cn as steppedEase,
|
|
4932
|
+
ni as succeed,
|
|
4933
|
+
Tc as timingFunctions,
|
|
4896
4934
|
P as transformMat3,
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4935
|
+
Ja as transposeMat3,
|
|
4936
|
+
Mt as tryParse,
|
|
4937
|
+
pc as unflattenObject,
|
|
4938
|
+
hc as unflattenObjectToString,
|
|
4901
4939
|
Ys as unpackMatrixValues,
|
|
4902
|
-
|
|
4940
|
+
Va as waitUntil,
|
|
4903
4941
|
Os as xyz2adobeRgb,
|
|
4904
4942
|
As as xyz2displayP3,
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4943
|
+
pn as xyz2hsl,
|
|
4944
|
+
ps as xyz2hsv,
|
|
4945
|
+
ms as xyz2hwb,
|
|
4946
|
+
ys as xyz2kelvin,
|
|
4947
|
+
nn as xyz2lab,
|
|
4948
|
+
gs as xyz2lch,
|
|
4911
4949
|
Ms as xyz2linearSrgb,
|
|
4912
|
-
|
|
4913
|
-
|
|
4950
|
+
un as xyz2oklab,
|
|
4951
|
+
ws as xyz2oklch,
|
|
4914
4952
|
Bs as xyz2proPhoto,
|
|
4915
4953
|
_s as xyz2rec2020,
|
|
4916
|
-
|
|
4954
|
+
cn as xyz2rgb
|
|
4917
4955
|
};
|