@mkbabb/value.js 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/value.cjs +8 -8
- package/dist/value.d.ts +133 -0
- package/dist/value.js +1526 -1141
- package/package.json +1 -1
package/dist/value.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
const he = 16.666666666666668, Jn = (e) => !!e && e.constructor === Object;
|
|
2
|
+
function tt(e) {
|
|
3
|
+
return Jn(e) ? Object.entries(e).map(([t, n]) => [t, tt(n)]).reduce((t, [n, r]) => (t[n] = r, t), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(tt) : e;
|
|
4
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const Ji = (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 vs = (e, t) => {
|
|
|
10
10
|
return !1;
|
|
11
11
|
return !0;
|
|
12
12
|
};
|
|
13
|
-
async function
|
|
13
|
+
async function Qi(e) {
|
|
14
14
|
return await new Promise((t) => setTimeout(t, e));
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
16
|
+
async function ta(e, t = he) {
|
|
17
17
|
return await new Promise((n) => {
|
|
18
18
|
const r = setInterval(() => {
|
|
19
19
|
if (e())
|
|
@@ -21,7 +21,7 @@ async function Bs(e, t = ee) {
|
|
|
21
21
|
}, t);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ea(e, t = 100, n = !1) {
|
|
25
25
|
let r = null;
|
|
26
26
|
const o = function(...s) {
|
|
27
27
|
const i = this, a = function() {
|
|
@@ -33,11 +33,11 @@ function Es(e, t = 100, n = !1) {
|
|
|
33
33
|
r && (clearTimeout(r), r = null);
|
|
34
34
|
}, o;
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
36
|
+
async function na(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
|
|
40
|
+
function Wt(e, t = {}) {
|
|
41
41
|
const n = /* @__PURE__ */ new Map(), { maxCacheSize: r = 1 / 0, ttl: o = 1 / 0, keyFn: s = JSON.stringify } = t, i = function(...a) {
|
|
42
42
|
const c = s.apply(this, a), l = Date.now();
|
|
43
43
|
if (n.has(c)) {
|
|
@@ -46,42 +46,42 @@ function _t(e, t = {}) {
|
|
|
46
46
|
return u.value;
|
|
47
47
|
n.delete(c);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
if (n.set(c, { value:
|
|
49
|
+
const p = e.apply(this, a);
|
|
50
|
+
if (n.set(c, { value: p, timestamp: l }), n.size > r) {
|
|
51
51
|
const u = n.keys().next().value;
|
|
52
52
|
n.delete(u);
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return p;
|
|
55
55
|
};
|
|
56
56
|
return i.cache = n, i;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const ra = (e) => e.replace(
|
|
59
59
|
/([-_][a-z])/gi,
|
|
60
60
|
(t) => t.toUpperCase().replace("-", "").replace("_", "")
|
|
61
61
|
);
|
|
62
|
-
function
|
|
62
|
+
function oa(e) {
|
|
63
63
|
return e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function sa(e, t, n) {
|
|
66
66
|
for (let r = e - 1; r >= 0; r--)
|
|
67
67
|
if (n(t[r]))
|
|
68
68
|
return r;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ia(e) {
|
|
71
71
|
if (typeof window < "u" && window.requestAnimationFrame)
|
|
72
72
|
return window.requestAnimationFrame(e);
|
|
73
|
-
let t =
|
|
73
|
+
let t = he, n = Date.now();
|
|
74
74
|
return setTimeout(() => {
|
|
75
75
|
let r = Date.now(), o = r - n;
|
|
76
|
-
n = r, t = Math.max(0,
|
|
76
|
+
n = r, t = Math.max(0, he - o), e(r);
|
|
77
77
|
}, t);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function aa(e) {
|
|
80
80
|
if (typeof window < "u" && window.cancelAnimationFrame)
|
|
81
81
|
return window.cancelAnimationFrame(e);
|
|
82
82
|
clearTimeout(e);
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Qn = ["px", "cm", "mm", "Q", "in", "pc", "pt"], tr = [
|
|
85
85
|
"em",
|
|
86
86
|
"ex",
|
|
87
87
|
"ch",
|
|
@@ -100,21 +100,21 @@ const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
|
|
|
100
100
|
"lvh",
|
|
101
101
|
"dvw",
|
|
102
102
|
"dvh"
|
|
103
|
-
],
|
|
104
|
-
...
|
|
105
|
-
...
|
|
106
|
-
],
|
|
107
|
-
...
|
|
108
|
-
...
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
...
|
|
112
|
-
...
|
|
113
|
-
...
|
|
114
|
-
...
|
|
103
|
+
], Pt = [
|
|
104
|
+
...Qn,
|
|
105
|
+
...tr
|
|
106
|
+
], Ot = ["s", "ms"], Lt = ["deg", "rad", "grad", "turn"], er = ["%"], zt = ["dpi", "dpcm", "dppx", "cqw"], fe = ["var", "calc"], oo = ["string"], so = ["color"], ca = [
|
|
107
|
+
...Pt,
|
|
108
|
+
...Ot,
|
|
109
|
+
...Lt,
|
|
110
|
+
...er,
|
|
111
|
+
...zt,
|
|
112
|
+
...fe,
|
|
113
|
+
...oo,
|
|
114
|
+
...so,
|
|
115
115
|
"",
|
|
116
116
|
void 0
|
|
117
|
-
],
|
|
117
|
+
], io = ["string", "var", "calc"], ao = [
|
|
118
118
|
"accentColor",
|
|
119
119
|
"additiveSymbols",
|
|
120
120
|
"alignContent",
|
|
@@ -746,8 +746,8 @@ const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
|
|
|
746
746
|
"y",
|
|
747
747
|
"zIndex",
|
|
748
748
|
"zoom"
|
|
749
|
-
],
|
|
750
|
-
let
|
|
749
|
+
], ln = (e, t = 2) => typeof e == "number" && Number.isNaN(e) ? "none" : String(e?.toFixed?.(t) ?? e).trim().replace(/\.0+$/, ""), un = (e, t, n) => `${e}(${t.join(" ")} / ${n})`;
|
|
750
|
+
let V = class {
|
|
751
751
|
constructor(t, n = 1) {
|
|
752
752
|
this.colorSpace = t, this.alpha = n, this.components = /* @__PURE__ */ new Map();
|
|
753
753
|
}
|
|
@@ -756,13 +756,13 @@ let U = class {
|
|
|
756
756
|
const t = Array.from(this.components.values()).map(
|
|
757
757
|
(r) => typeof r == "number" && Number.isNaN(r) ? "none" : r
|
|
758
758
|
), n = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
|
|
759
|
-
return
|
|
759
|
+
return un(this.colorSpace, t, n);
|
|
760
760
|
}
|
|
761
761
|
toFormattedString(t = 2) {
|
|
762
762
|
const n = Array.from(this.components.values()).map(
|
|
763
|
-
(o) =>
|
|
764
|
-
), r =
|
|
765
|
-
return
|
|
763
|
+
(o) => ln(o, t)
|
|
764
|
+
), r = ln(this.alpha, t);
|
|
765
|
+
return un(this.colorSpace, n, r);
|
|
766
766
|
}
|
|
767
767
|
valueOf() {
|
|
768
768
|
return [...this.values(), this.alpha];
|
|
@@ -775,8 +775,8 @@ let U = class {
|
|
|
775
775
|
}
|
|
776
776
|
clone() {
|
|
777
777
|
const t = this.constructor, n = new t();
|
|
778
|
-
return n.alpha =
|
|
779
|
-
n.components.set(o,
|
|
778
|
+
return n.alpha = tt(this.alpha), this.components.forEach((r, o) => {
|
|
779
|
+
n.components.set(o, tt(r));
|
|
780
780
|
}), n;
|
|
781
781
|
}
|
|
782
782
|
keys() {
|
|
@@ -795,12 +795,12 @@ let U = class {
|
|
|
795
795
|
this.components.set(t, n);
|
|
796
796
|
}
|
|
797
797
|
};
|
|
798
|
-
class
|
|
798
|
+
class xe extends V {
|
|
799
799
|
constructor(t, n, r) {
|
|
800
800
|
super(t, n), this.whitePoint = r;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
-
class
|
|
803
|
+
class O extends V {
|
|
804
804
|
constructor(t, n, r, o) {
|
|
805
805
|
super("rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
806
806
|
}
|
|
@@ -823,7 +823,7 @@ class $ extends U {
|
|
|
823
823
|
this.setComponent("b", t);
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
class
|
|
826
|
+
class yt extends V {
|
|
827
827
|
constructor(t, n, r, o) {
|
|
828
828
|
super("hsl", o), this.components.set("h", t), this.components.set("s", n), this.components.set("l", r);
|
|
829
829
|
}
|
|
@@ -846,7 +846,7 @@ class St extends U {
|
|
|
846
846
|
this.setComponent("l", t);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
class
|
|
849
|
+
class Ee extends V {
|
|
850
850
|
constructor(t, n, r, o) {
|
|
851
851
|
super("hsv", o), this.components.set("h", t), this.components.set("s", n), this.components.set("v", r);
|
|
852
852
|
}
|
|
@@ -869,7 +869,7 @@ class pe extends U {
|
|
|
869
869
|
this.setComponent("v", t);
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
-
class
|
|
872
|
+
class Te extends V {
|
|
873
873
|
constructor(t, n, r, o) {
|
|
874
874
|
super("hwb", o), this.components.set("h", t), this.components.set("w", n), this.components.set("b", r);
|
|
875
875
|
}
|
|
@@ -892,7 +892,7 @@ class he extends U {
|
|
|
892
892
|
this.setComponent("b", t);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
|
-
class
|
|
895
|
+
class Xt extends xe {
|
|
896
896
|
constructor(t, n, r, o) {
|
|
897
897
|
super("lab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
898
898
|
}
|
|
@@ -915,7 +915,7 @@ class Lt extends me {
|
|
|
915
915
|
this.setComponent("b", t);
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
class
|
|
918
|
+
class Ae extends V {
|
|
919
919
|
constructor(t, n, r, o) {
|
|
920
920
|
super("lch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
921
921
|
}
|
|
@@ -938,7 +938,7 @@ class fe extends U {
|
|
|
938
938
|
this.setComponent("h", t);
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
|
-
class
|
|
941
|
+
class Ht extends xe {
|
|
942
942
|
constructor(t, n, r, o) {
|
|
943
943
|
super("oklab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
944
944
|
}
|
|
@@ -961,7 +961,7 @@ class $t extends me {
|
|
|
961
961
|
this.setComponent("b", t);
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
class
|
|
964
|
+
class Me extends V {
|
|
965
965
|
constructor(t, n, r, o) {
|
|
966
966
|
super("oklch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
967
967
|
}
|
|
@@ -984,7 +984,7 @@ class be extends U {
|
|
|
984
984
|
this.setComponent("h", t);
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
class
|
|
987
|
+
class U extends xe {
|
|
988
988
|
constructor(t, n, r, o) {
|
|
989
989
|
super("xyz", o, "D65"), this.components.set("x", t), this.components.set("y", n), this.components.set("z", r);
|
|
990
990
|
}
|
|
@@ -1007,7 +1007,7 @@ class D extends me {
|
|
|
1007
1007
|
this.setComponent("z", t);
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
class
|
|
1010
|
+
class nr extends V {
|
|
1011
1011
|
constructor(t, n) {
|
|
1012
1012
|
super("kelvin", n), this.components.set("kelvin", t);
|
|
1013
1013
|
}
|
|
@@ -1018,7 +1018,7 @@ class un extends U {
|
|
|
1018
1018
|
this.setComponent("kelvin", t);
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
class
|
|
1021
|
+
class Ie extends V {
|
|
1022
1022
|
constructor(t, n, r, o) {
|
|
1023
1023
|
super("srgb-linear", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1024
1024
|
}
|
|
@@ -1041,7 +1041,7 @@ class de extends U {
|
|
|
1041
1041
|
this.setComponent("b", t);
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
class
|
|
1044
|
+
class Re extends V {
|
|
1045
1045
|
constructor(t, n, r, o) {
|
|
1046
1046
|
super("display-p3", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1047
1047
|
}
|
|
@@ -1064,7 +1064,7 @@ class ge extends U {
|
|
|
1064
1064
|
this.setComponent("b", t);
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
class
|
|
1067
|
+
class ve extends V {
|
|
1068
1068
|
constructor(t, n, r, o) {
|
|
1069
1069
|
super("a98-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1070
1070
|
}
|
|
@@ -1087,7 +1087,7 @@ class we extends U {
|
|
|
1087
1087
|
this.setComponent("b", t);
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
|
-
class
|
|
1090
|
+
class Be extends V {
|
|
1091
1091
|
constructor(t, n, r, o) {
|
|
1092
1092
|
super("prophoto-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1093
1093
|
}
|
|
@@ -1110,7 +1110,7 @@ class ke extends U {
|
|
|
1110
1110
|
this.setComponent("b", t);
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
|
-
class
|
|
1113
|
+
class Ne extends V {
|
|
1114
1114
|
constructor(t, n, r, o) {
|
|
1115
1115
|
super("rec2020", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1116
1116
|
}
|
|
@@ -1133,19 +1133,19 @@ class ye extends U {
|
|
|
1133
1133
|
this.setComponent("b", t);
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function be(e) {
|
|
1137
1137
|
return e.unit === "color";
|
|
1138
1138
|
}
|
|
1139
|
-
const
|
|
1139
|
+
const ua = (e) => {
|
|
1140
1140
|
const t = {}, n = (r, o = void 0) => {
|
|
1141
1141
|
if (Array.isArray(r)) {
|
|
1142
1142
|
r.forEach((i, a) => n(i, o));
|
|
1143
1143
|
return;
|
|
1144
|
-
} else if (r instanceof
|
|
1144
|
+
} else if (r instanceof mt) {
|
|
1145
1145
|
let i = r.name;
|
|
1146
1146
|
o && (o.endsWith(r.name) ? i = o : i = `${o}.${r.name}`), r.values.forEach((a, c) => n(a, i));
|
|
1147
1147
|
return;
|
|
1148
|
-
} else if (
|
|
1148
|
+
} else if (Jn(r)) {
|
|
1149
1149
|
for (const [i, a] of Object.entries(r)) {
|
|
1150
1150
|
const c = o ? `${o}.${i}` : i;
|
|
1151
1151
|
n(a, c);
|
|
@@ -1153,10 +1153,10 @@ const Ls = (e) => {
|
|
|
1153
1153
|
return;
|
|
1154
1154
|
}
|
|
1155
1155
|
const s = o;
|
|
1156
|
-
t[s] == null && (t[s] = new
|
|
1156
|
+
t[s] == null && (t[s] = new vt()), t[s].push(r), t[s] = t[s].flat();
|
|
1157
1157
|
};
|
|
1158
1158
|
return n(e), t;
|
|
1159
|
-
},
|
|
1159
|
+
}, pa = (e) => {
|
|
1160
1160
|
const t = {};
|
|
1161
1161
|
for (const [n, r] of Object.entries(e)) {
|
|
1162
1162
|
const o = n.split(".");
|
|
@@ -1167,22 +1167,22 @@ const Ls = (e) => {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
1169
|
return t;
|
|
1170
|
-
},
|
|
1170
|
+
}, ma = (e) => {
|
|
1171
1171
|
const t = {};
|
|
1172
1172
|
for (const [n, r] of Object.entries(e)) {
|
|
1173
1173
|
const o = n.split("."), s = o[0];
|
|
1174
1174
|
let i = t[s] ?? "", a = "", c = "";
|
|
1175
|
-
for (let
|
|
1176
|
-
a += `${o[
|
|
1175
|
+
for (let p = 1; p < o.length; p++)
|
|
1176
|
+
a += `${o[p]}(`, c += ")";
|
|
1177
1177
|
let l = "";
|
|
1178
1178
|
o.length > 1 && Array.isArray(r) ? l = r.join(", ") : l = r.toString(), i += ` ${a}${l}${c}`, t[s] = i.trim();
|
|
1179
1179
|
}
|
|
1180
1180
|
return t;
|
|
1181
|
-
},
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1181
|
+
}, co = new Set(ao);
|
|
1182
|
+
function ha(e) {
|
|
1183
|
+
return co.has(e);
|
|
1184
1184
|
}
|
|
1185
|
-
const
|
|
1185
|
+
const lo = (e) => {
|
|
1186
1186
|
const t = e.name, n = e.valueOf();
|
|
1187
1187
|
if (!e.name.startsWith("matrix"))
|
|
1188
1188
|
throw new Error("Input must be a matrix or matrix3d value");
|
|
@@ -1253,11 +1253,11 @@ const mr = (e) => {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
throw new Error("Unsupported matrix type or invalid number of values");
|
|
1255
1255
|
};
|
|
1256
|
-
function
|
|
1256
|
+
function uo(e, t) {
|
|
1257
1257
|
let n = e;
|
|
1258
1258
|
return t === "cm" ? n *= 96 / 2.54 : t === "mm" ? n *= 96 / 25.4 : t === "in" ? n *= 96 : t === "pt" ? n *= 4 / 3 : t === "pc" && (n *= 16), n;
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function rr(e, t, n, r) {
|
|
1261
1261
|
if (t === "em" && n)
|
|
1262
1262
|
e *= parseFloat(getComputedStyle(n).fontSize);
|
|
1263
1263
|
else if (t === "rem")
|
|
@@ -1275,35 +1275,35 @@ function mn(e, t, n, r) {
|
|
|
1275
1275
|
getComputedStyle(n.parentElement).getPropertyValue(r)
|
|
1276
1276
|
);
|
|
1277
1277
|
e = e / 100 * o;
|
|
1278
|
-
} else t === "ex" || t === "ch" ? e *= parseFloat(getComputedStyle(n).fontSize) ?? 16 : e =
|
|
1278
|
+
} else t === "ex" || t === "ch" ? e *= parseFloat(getComputedStyle(n).fontSize) ?? 16 : e = uo(e, t);
|
|
1279
1279
|
return e;
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function or(e, t) {
|
|
1282
1282
|
return t === "s" && (e *= 1e3), e;
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function _e(e, t) {
|
|
1285
1285
|
return t === "grad" ? e *= 0.9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function sr(e, t) {
|
|
1288
1288
|
return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
|
|
1289
1289
|
}
|
|
1290
|
-
const
|
|
1291
|
-
length:
|
|
1292
|
-
time:
|
|
1293
|
-
angle:
|
|
1294
|
-
resolution:
|
|
1290
|
+
const po = {
|
|
1291
|
+
length: rr,
|
|
1292
|
+
time: or,
|
|
1293
|
+
angle: _e,
|
|
1294
|
+
resolution: sr
|
|
1295
1295
|
};
|
|
1296
|
-
function
|
|
1297
|
-
return
|
|
1296
|
+
function pn(e) {
|
|
1297
|
+
return Pt.includes(e) ? [Pt, "length"] : Ot.includes(e) ? [Ot, "time"] : Lt.includes(e) ? [Lt, "angle"] : zt.includes(e) ? [zt, "resolution"] : null;
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1300
|
-
const o =
|
|
1299
|
+
function fa(e, t, n, r) {
|
|
1300
|
+
const o = pn(t), s = pn(n);
|
|
1301
1301
|
if (!o || !s || o[1] !== s[1])
|
|
1302
1302
|
throw new Error(`Incompatible units: ${t} and ${n}`);
|
|
1303
|
-
const [, i] = o, a =
|
|
1303
|
+
const [, i] = o, a = po[i], c = a(e, t, r), l = a(1, n, r);
|
|
1304
1304
|
return c / l;
|
|
1305
1305
|
}
|
|
1306
|
-
class
|
|
1306
|
+
class S {
|
|
1307
1307
|
constructor(t, n, r, o, s, i) {
|
|
1308
1308
|
this.value = t, this.unit = n, this.superType = r, this.subProperty = o, this.property = s, this.targets = i;
|
|
1309
1309
|
}
|
|
@@ -1323,36 +1323,36 @@ class k {
|
|
|
1323
1323
|
this.value = t;
|
|
1324
1324
|
}
|
|
1325
1325
|
toString() {
|
|
1326
|
-
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` :
|
|
1326
|
+
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` : be(this) ? this.value.toString() : this.unit === "var" ? `var(${this.value})` : this.unit === "calc" ? `calc(${this.value})` : `${this.value}${this.unit}`;
|
|
1327
1327
|
}
|
|
1328
1328
|
toJSON() {
|
|
1329
1329
|
return this.valueOf();
|
|
1330
1330
|
}
|
|
1331
1331
|
toFixed(t = 2) {
|
|
1332
1332
|
const n = Number(this.value).toFixed(t).replace(/\.0+$/, "");
|
|
1333
|
-
return new
|
|
1333
|
+
return new S(n).coalesce(this, !0).toString();
|
|
1334
1334
|
}
|
|
1335
1335
|
clone() {
|
|
1336
|
-
return new
|
|
1337
|
-
|
|
1336
|
+
return new S(
|
|
1337
|
+
tt(this.value),
|
|
1338
1338
|
this.unit,
|
|
1339
|
-
|
|
1339
|
+
tt(this.superType),
|
|
1340
1340
|
this.subProperty,
|
|
1341
1341
|
this.property
|
|
1342
1342
|
);
|
|
1343
1343
|
}
|
|
1344
1344
|
coalesce(t, n = !1) {
|
|
1345
|
-
return t == null ? this :
|
|
1346
|
-
|
|
1345
|
+
return t == null ? this : io.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 S(
|
|
1346
|
+
tt(this.value),
|
|
1347
1347
|
this.unit ?? t.unit,
|
|
1348
|
-
|
|
1348
|
+
tt(this.superType ?? t.superType),
|
|
1349
1349
|
this.subProperty ?? t.subProperty,
|
|
1350
1350
|
this.property ?? t.property,
|
|
1351
1351
|
this.targets ?? t.targets
|
|
1352
1352
|
);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
class
|
|
1355
|
+
class mt {
|
|
1356
1356
|
constructor(t, n) {
|
|
1357
1357
|
this.name = t, this.values = n, n.forEach((r) => {
|
|
1358
1358
|
this.setSubProperty(t);
|
|
@@ -1382,13 +1382,13 @@ class at {
|
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
clone() {
|
|
1385
|
-
return new
|
|
1385
|
+
return new mt(
|
|
1386
1386
|
this.name,
|
|
1387
1387
|
this.values.map((t) => t.clone())
|
|
1388
1388
|
);
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
|
-
class
|
|
1391
|
+
class vt extends Array {
|
|
1392
1392
|
constructor(...t) {
|
|
1393
1393
|
super(...t);
|
|
1394
1394
|
}
|
|
@@ -1414,28 +1414,28 @@ class xt extends Array {
|
|
|
1414
1414
|
return this.map((t) => t.toJSON());
|
|
1415
1415
|
}
|
|
1416
1416
|
clone() {
|
|
1417
|
-
return new
|
|
1417
|
+
return new vt(...this.map((t) => t.clone()));
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
const
|
|
1421
|
-
function
|
|
1420
|
+
const mn = 4;
|
|
1421
|
+
function hn(e, t = "^", n = !1) {
|
|
1422
1422
|
const r = e.src.split(`
|
|
1423
|
-
`), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o -
|
|
1423
|
+
`), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o - mn, 0), i = Math.min(o + mn + 1, r.length), a = r.slice(s, i);
|
|
1424
1424
|
if (t) {
|
|
1425
1425
|
const l = " ".repeat(e.getColumnNumber()) + t;
|
|
1426
1426
|
a.splice(o - s + 1, 0, l);
|
|
1427
1427
|
}
|
|
1428
|
-
return a.map((l,
|
|
1428
|
+
return a.map((l, p) => ` ${s + p + 1}| ${l}`).join(`
|
|
1429
1429
|
`);
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
function
|
|
1433
|
-
if (
|
|
1434
|
-
return
|
|
1431
|
+
const ct = /* @__PURE__ */ new Map();
|
|
1432
|
+
function ir(e) {
|
|
1433
|
+
if (ct.has(e.id))
|
|
1434
|
+
return ct.get(e.id);
|
|
1435
1435
|
const t = (r, o) => {
|
|
1436
|
-
if (
|
|
1437
|
-
return
|
|
1438
|
-
const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown",
|
|
1436
|
+
if (ct.has(r.id))
|
|
1437
|
+
return ct.get(r.id);
|
|
1438
|
+
const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown", p = (() => {
|
|
1439
1439
|
switch (s) {
|
|
1440
1440
|
case "string":
|
|
1441
1441
|
return `"${i[0]}"`;
|
|
@@ -1445,8 +1445,8 @@ function fn(e) {
|
|
|
1445
1445
|
return `${i[0]}`;
|
|
1446
1446
|
case "wrap":
|
|
1447
1447
|
case "trim": {
|
|
1448
|
-
const [u,
|
|
1449
|
-
return `${t(u, o)} ${c} ${t(
|
|
1448
|
+
const [u, f] = i;
|
|
1449
|
+
return `${t(u, o)} ${c} ${t(f, o)}`;
|
|
1450
1450
|
}
|
|
1451
1451
|
case "trimWhitespace":
|
|
1452
1452
|
return `${c}?w`;
|
|
@@ -1467,26 +1467,26 @@ function fn(e) {
|
|
|
1467
1467
|
case "all":
|
|
1468
1468
|
case "then":
|
|
1469
1469
|
return `[${i.map(
|
|
1470
|
-
(
|
|
1470
|
+
(f) => t(f, o)
|
|
1471
1471
|
).join(", ")}]`;
|
|
1472
1472
|
case "any":
|
|
1473
1473
|
case "or":
|
|
1474
1474
|
return i.map(
|
|
1475
|
-
(
|
|
1475
|
+
(f) => t(f, o)
|
|
1476
1476
|
).join(" | ");
|
|
1477
1477
|
case "many": {
|
|
1478
|
-
const [u,
|
|
1479
|
-
return `${c} {${
|
|
1478
|
+
const [u, f] = i, C = f === 1 / 0 ? `${u},` : `${u},${f}`;
|
|
1479
|
+
return `${c} {${C}}`;
|
|
1480
1480
|
}
|
|
1481
1481
|
case "sepBy":
|
|
1482
1482
|
return `${c} sepBy ${t(i[0], o)}`;
|
|
1483
1483
|
case "lazy": {
|
|
1484
|
-
const [u] = i,
|
|
1484
|
+
const [u] = i, f = cr(u);
|
|
1485
1485
|
if (o)
|
|
1486
1486
|
return s;
|
|
1487
1487
|
{
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1488
|
+
const C = t(f, f.id);
|
|
1489
|
+
return ct.set(f.id, C), C;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
1492
|
case "debug":
|
|
@@ -1495,39 +1495,39 @@ function fn(e) {
|
|
|
1495
1495
|
return;
|
|
1496
1496
|
}
|
|
1497
1497
|
})() ?? s ?? "unknown";
|
|
1498
|
-
return o &&
|
|
1498
|
+
return o && ct.set(r.id, p), p;
|
|
1499
1499
|
}, n = t(e);
|
|
1500
|
-
return
|
|
1500
|
+
return ct.set(e.id, n), n;
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
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 ?
|
|
1502
|
+
function ar(e, t = "", n = "") {
|
|
1503
|
+
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 ? hn(e, "", e.isError) : hn(e, "^", e.isError);
|
|
1504
1504
|
return `${a}
|
|
1505
1505
|
${c}`;
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function mo(e, t = "", n = !1, r = console.log) {
|
|
1508
1508
|
const o = (s) => {
|
|
1509
|
-
const i = e.parser(s), a = n ?
|
|
1509
|
+
const i = e.parser(s), a = n ? ir(e) : e.context.name ?? "", c = ar(
|
|
1510
1510
|
i,
|
|
1511
1511
|
t,
|
|
1512
1512
|
a
|
|
1513
1513
|
);
|
|
1514
1514
|
return r(c), i;
|
|
1515
1515
|
};
|
|
1516
|
-
return new
|
|
1516
|
+
return new x(o, M("debug", e, r));
|
|
1517
1517
|
}
|
|
1518
|
-
class
|
|
1518
|
+
class $t {
|
|
1519
1519
|
constructor(t, n = void 0, r = 0, o = !1, s = 0) {
|
|
1520
1520
|
this.src = t, this.value = n, this.offset = r, this.isError = o, this.furthest = s;
|
|
1521
1521
|
}
|
|
1522
1522
|
ok(t, n = 0) {
|
|
1523
|
-
return n += this.offset, new
|
|
1523
|
+
return n += this.offset, new $t(this.src, t, n, !1);
|
|
1524
1524
|
}
|
|
1525
1525
|
err(t, n = 0) {
|
|
1526
1526
|
const r = this.ok(t, n);
|
|
1527
1527
|
return r.isError = !0, r;
|
|
1528
1528
|
}
|
|
1529
1529
|
from(t, n = 0) {
|
|
1530
|
-
return n += this.offset, new
|
|
1530
|
+
return n += this.offset, new $t(this.src, t, n, this.isError);
|
|
1531
1531
|
}
|
|
1532
1532
|
getColumnNumber() {
|
|
1533
1533
|
const t = this.offset, n = this.src.lastIndexOf(`
|
|
@@ -1541,38 +1541,38 @@ class It {
|
|
|
1541
1541
|
`).length : 0;
|
|
1542
1542
|
}
|
|
1543
1543
|
toString() {
|
|
1544
|
-
return
|
|
1544
|
+
return ar(this);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function M(e, t, ...n) {
|
|
1548
1548
|
return {
|
|
1549
1549
|
name: e,
|
|
1550
1550
|
parser: t,
|
|
1551
1551
|
args: n
|
|
1552
1552
|
};
|
|
1553
1553
|
}
|
|
1554
|
-
let
|
|
1555
|
-
const
|
|
1556
|
-
let
|
|
1557
|
-
function
|
|
1558
|
-
return (!
|
|
1554
|
+
let ho = 0;
|
|
1555
|
+
const lt = /* @__PURE__ */ new Map(), _t = /* @__PURE__ */ new Map();
|
|
1556
|
+
let At;
|
|
1557
|
+
function F(e) {
|
|
1558
|
+
return (!At || e.offset > At.offset) && (At = e), At;
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1560
|
+
function cr(e) {
|
|
1561
1561
|
return e.parser ? e.parser : e.parser = e();
|
|
1562
1562
|
}
|
|
1563
|
-
class
|
|
1563
|
+
class x {
|
|
1564
1564
|
constructor(t, n = {}) {
|
|
1565
1565
|
this.parser = t, this.context = n;
|
|
1566
1566
|
}
|
|
1567
|
-
id =
|
|
1567
|
+
id = ho++;
|
|
1568
1568
|
state;
|
|
1569
1569
|
reset() {
|
|
1570
|
-
|
|
1570
|
+
At = void 0, lt.clear(), _t.clear();
|
|
1571
1571
|
}
|
|
1572
1572
|
parseState(t) {
|
|
1573
1573
|
this.reset();
|
|
1574
|
-
const n = this.parser(new
|
|
1575
|
-
return this.state =
|
|
1574
|
+
const n = this.parser(new $t(t));
|
|
1575
|
+
return this.state = F(n), this.state.isError = n.isError, this.state.isError, n;
|
|
1576
1576
|
}
|
|
1577
1577
|
parse(t) {
|
|
1578
1578
|
return this.parseState(t).value;
|
|
@@ -1581,38 +1581,38 @@ class y {
|
|
|
1581
1581
|
return `${this.id}${t.offset}`;
|
|
1582
1582
|
}
|
|
1583
1583
|
atLeftRecursionLimit(t) {
|
|
1584
|
-
return (
|
|
1584
|
+
return (_t.get(this.getCijKey(t)) ?? 0) > t.src.length - t.offset;
|
|
1585
1585
|
}
|
|
1586
1586
|
memoize() {
|
|
1587
1587
|
const t = (n) => {
|
|
1588
|
-
const r = this.getCijKey(n), o =
|
|
1589
|
-
let s =
|
|
1588
|
+
const r = this.getCijKey(n), o = _t.get(r) ?? 0;
|
|
1589
|
+
let s = lt.get(this.id);
|
|
1590
1590
|
if (s && s.offset >= n.offset)
|
|
1591
1591
|
return s;
|
|
1592
1592
|
if (this.atLeftRecursionLimit(n))
|
|
1593
1593
|
return n.err(void 0);
|
|
1594
|
-
|
|
1594
|
+
_t.set(r, o + 1);
|
|
1595
1595
|
const i = this.parser(n);
|
|
1596
|
-
return s =
|
|
1596
|
+
return s = lt.get(this.id), s && s.offset > i.offset ? i.offset = s.offset : s || lt.set(this.id, i), i;
|
|
1597
1597
|
};
|
|
1598
|
-
return new
|
|
1598
|
+
return new x(
|
|
1599
1599
|
t,
|
|
1600
|
-
|
|
1600
|
+
M("memoize", this)
|
|
1601
1601
|
);
|
|
1602
1602
|
}
|
|
1603
1603
|
mergeMemos() {
|
|
1604
1604
|
const t = (n) => {
|
|
1605
|
-
let r =
|
|
1605
|
+
let r = lt.get(this.id);
|
|
1606
1606
|
if (r)
|
|
1607
1607
|
return r;
|
|
1608
1608
|
if (this.atLeftRecursionLimit(n))
|
|
1609
1609
|
return n.err(void 0);
|
|
1610
1610
|
const o = this.parser(n);
|
|
1611
|
-
return r =
|
|
1611
|
+
return r = lt.get(this.id), r || lt.set(this.id, o), o;
|
|
1612
1612
|
};
|
|
1613
|
-
return new
|
|
1613
|
+
return new x(
|
|
1614
1614
|
t,
|
|
1615
|
-
|
|
1615
|
+
M("mergeMemo", this)
|
|
1616
1616
|
);
|
|
1617
1617
|
}
|
|
1618
1618
|
then(t) {
|
|
@@ -1623,11 +1623,11 @@ class y {
|
|
|
1623
1623
|
if (!s.isError)
|
|
1624
1624
|
return s.ok([o.value, s.value]);
|
|
1625
1625
|
}
|
|
1626
|
-
return
|
|
1626
|
+
return F(r), r.err(void 0);
|
|
1627
1627
|
};
|
|
1628
|
-
return new
|
|
1628
|
+
return new x(
|
|
1629
1629
|
n,
|
|
1630
|
-
|
|
1630
|
+
M("then", this, this, t)
|
|
1631
1631
|
);
|
|
1632
1632
|
}
|
|
1633
1633
|
or(t) {
|
|
@@ -1635,9 +1635,9 @@ class y {
|
|
|
1635
1635
|
const o = this.parser(r);
|
|
1636
1636
|
return o.isError ? t.parser(r) : o;
|
|
1637
1637
|
};
|
|
1638
|
-
return new
|
|
1638
|
+
return new x(
|
|
1639
1639
|
n,
|
|
1640
|
-
|
|
1640
|
+
M("or", this, this, t)
|
|
1641
1641
|
);
|
|
1642
1642
|
}
|
|
1643
1643
|
chain(t, n = !1) {
|
|
@@ -1645,9 +1645,9 @@ class y {
|
|
|
1645
1645
|
const s = this.parser(o);
|
|
1646
1646
|
return s.isError ? s : s.value || n ? t(s.value).parser(s) : o;
|
|
1647
1647
|
};
|
|
1648
|
-
return new
|
|
1648
|
+
return new x(
|
|
1649
1649
|
r,
|
|
1650
|
-
|
|
1650
|
+
M("chain", this, t)
|
|
1651
1651
|
);
|
|
1652
1652
|
}
|
|
1653
1653
|
map(t, n = !1) {
|
|
@@ -1655,9 +1655,9 @@ class y {
|
|
|
1655
1655
|
const s = this.parser(o);
|
|
1656
1656
|
return !s.isError || n ? s.ok(t(s.value)) : s;
|
|
1657
1657
|
};
|
|
1658
|
-
return new
|
|
1658
|
+
return new x(
|
|
1659
1659
|
r,
|
|
1660
|
-
|
|
1660
|
+
M("map", this)
|
|
1661
1661
|
);
|
|
1662
1662
|
}
|
|
1663
1663
|
mapState(t) {
|
|
@@ -1665,9 +1665,9 @@ class y {
|
|
|
1665
1665
|
const o = this.parser(r);
|
|
1666
1666
|
return t(o, r);
|
|
1667
1667
|
};
|
|
1668
|
-
return new
|
|
1668
|
+
return new x(
|
|
1669
1669
|
n,
|
|
1670
|
-
|
|
1670
|
+
M("mapState", this)
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
1673
1673
|
skip(t) {
|
|
@@ -1678,54 +1678,54 @@ class y {
|
|
|
1678
1678
|
if (!s.isError)
|
|
1679
1679
|
return s.ok(o.value);
|
|
1680
1680
|
}
|
|
1681
|
-
return
|
|
1681
|
+
return F(r), r.err(void 0);
|
|
1682
1682
|
};
|
|
1683
|
-
return new
|
|
1683
|
+
return new x(
|
|
1684
1684
|
n,
|
|
1685
|
-
|
|
1685
|
+
M("skip", this, t)
|
|
1686
1686
|
);
|
|
1687
1687
|
}
|
|
1688
1688
|
next(t) {
|
|
1689
1689
|
const n = this.then(t).map(([, r]) => r);
|
|
1690
|
-
return n.context =
|
|
1690
|
+
return n.context = M("next", this, t), n;
|
|
1691
1691
|
}
|
|
1692
1692
|
opt() {
|
|
1693
1693
|
const t = (n) => {
|
|
1694
1694
|
const r = this.parser(n);
|
|
1695
|
-
return r.isError ? (
|
|
1695
|
+
return r.isError ? (F(n), n.ok(void 0)) : r;
|
|
1696
1696
|
};
|
|
1697
|
-
return new
|
|
1697
|
+
return new x(
|
|
1698
1698
|
t,
|
|
1699
|
-
|
|
1699
|
+
M("opt", this)
|
|
1700
1700
|
);
|
|
1701
1701
|
}
|
|
1702
1702
|
not(t) {
|
|
1703
|
-
const n = (o) => this.parser(o).isError ? (
|
|
1703
|
+
const n = (o) => this.parser(o).isError ? (F(o), o.ok(o.value)) : o.err(void 0), r = (o) => {
|
|
1704
1704
|
const s = this.parser(o);
|
|
1705
|
-
return s.isError ? (
|
|
1705
|
+
return s.isError ? (F(o), s) : t.parser(o).isError ? s : (F(o), o.err(void 0));
|
|
1706
1706
|
};
|
|
1707
|
-
return new
|
|
1707
|
+
return new x(
|
|
1708
1708
|
t ? r : n,
|
|
1709
|
-
|
|
1709
|
+
M("not", this, t)
|
|
1710
1710
|
);
|
|
1711
1711
|
}
|
|
1712
1712
|
wrap(t, n, r = !0) {
|
|
1713
1713
|
if (!r)
|
|
1714
|
-
return
|
|
1714
|
+
return I(t, this, n);
|
|
1715
1715
|
const o = t.next(this).skip(n);
|
|
1716
|
-
return o.context =
|
|
1716
|
+
return o.context = M("wrap", this, t, n), o;
|
|
1717
1717
|
}
|
|
1718
1718
|
trim(t = g, n = !0) {
|
|
1719
1719
|
if (!n)
|
|
1720
|
-
return
|
|
1720
|
+
return I(t, this, t);
|
|
1721
1721
|
if (t.context?.name === "whitespace") {
|
|
1722
1722
|
const r = (o) => {
|
|
1723
|
-
const s =
|
|
1724
|
-
return i.isError ? (
|
|
1723
|
+
const s = bn(o), i = this.parser(s);
|
|
1724
|
+
return i.isError ? (F(o), o.err(void 0)) : bn(i);
|
|
1725
1725
|
};
|
|
1726
|
-
return new
|
|
1726
|
+
return new x(
|
|
1727
1727
|
r,
|
|
1728
|
-
|
|
1728
|
+
M("trimWhitespace", this)
|
|
1729
1729
|
);
|
|
1730
1730
|
}
|
|
1731
1731
|
return this.wrap(t, t);
|
|
@@ -1740,11 +1740,11 @@ class y {
|
|
|
1740
1740
|
break;
|
|
1741
1741
|
s.push(c.value), i = c;
|
|
1742
1742
|
}
|
|
1743
|
-
return s.length >= t ? i.ok(s) : (
|
|
1743
|
+
return s.length >= t ? i.ok(s) : (F(o), o.err([]));
|
|
1744
1744
|
};
|
|
1745
|
-
return new
|
|
1745
|
+
return new x(
|
|
1746
1746
|
r,
|
|
1747
|
-
|
|
1747
|
+
M("many", this, t, n)
|
|
1748
1748
|
);
|
|
1749
1749
|
}
|
|
1750
1750
|
sepBy(t, n = 0, r = 1 / 0) {
|
|
@@ -1756,58 +1756,58 @@ class y {
|
|
|
1756
1756
|
if (l.isError)
|
|
1757
1757
|
break;
|
|
1758
1758
|
a = l, i.push(a.value);
|
|
1759
|
-
const
|
|
1760
|
-
if (
|
|
1759
|
+
const p = t.parser(a);
|
|
1760
|
+
if (p.isError)
|
|
1761
1761
|
break;
|
|
1762
|
-
a =
|
|
1762
|
+
a = p;
|
|
1763
1763
|
}
|
|
1764
|
-
return i.length > n ? a.ok(i) : (
|
|
1764
|
+
return i.length > n ? a.ok(i) : (F(s), s.err([]));
|
|
1765
1765
|
};
|
|
1766
|
-
return new
|
|
1766
|
+
return new x(
|
|
1767
1767
|
o,
|
|
1768
|
-
|
|
1768
|
+
M("sepBy", this, t)
|
|
1769
1769
|
);
|
|
1770
1770
|
}
|
|
1771
1771
|
eof() {
|
|
1772
|
-
const t = this.skip(
|
|
1773
|
-
return t.context =
|
|
1772
|
+
const t = this.skip(fo());
|
|
1773
|
+
return t.context = M("eof", this), t;
|
|
1774
1774
|
}
|
|
1775
1775
|
debug(t = "", n = !1, r = console.log) {
|
|
1776
|
-
return
|
|
1776
|
+
return mo(this, t, n, r);
|
|
1777
1777
|
}
|
|
1778
1778
|
toString() {
|
|
1779
|
-
return
|
|
1779
|
+
return ir(this);
|
|
1780
1780
|
}
|
|
1781
1781
|
static lazy(t) {
|
|
1782
|
-
const n = (r) =>
|
|
1783
|
-
return new
|
|
1782
|
+
const n = (r) => cr(t).parser(r);
|
|
1783
|
+
return new x(
|
|
1784
1784
|
n,
|
|
1785
|
-
|
|
1785
|
+
M("lazy", void 0, t)
|
|
1786
1786
|
);
|
|
1787
1787
|
}
|
|
1788
1788
|
}
|
|
1789
|
-
function
|
|
1790
|
-
const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (
|
|
1791
|
-
return new
|
|
1789
|
+
function fo() {
|
|
1790
|
+
const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (F(t), t.err());
|
|
1791
|
+
return new x(
|
|
1792
1792
|
e,
|
|
1793
|
-
|
|
1793
|
+
M("eof", void 0)
|
|
1794
1794
|
);
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function d(...e) {
|
|
1797
1797
|
const t = (n) => {
|
|
1798
1798
|
for (const r of e) {
|
|
1799
1799
|
const o = r.parser(n);
|
|
1800
1800
|
if (!o.isError)
|
|
1801
1801
|
return o;
|
|
1802
1802
|
}
|
|
1803
|
-
return
|
|
1803
|
+
return F(n), n.err(void 0);
|
|
1804
1804
|
};
|
|
1805
|
-
return new
|
|
1805
|
+
return new x(
|
|
1806
1806
|
e.length === 1 ? e[0].parser : t,
|
|
1807
|
-
|
|
1807
|
+
M("any", void 0, ...e)
|
|
1808
1808
|
);
|
|
1809
1809
|
}
|
|
1810
|
-
function
|
|
1810
|
+
function I(...e) {
|
|
1811
1811
|
const t = (n) => {
|
|
1812
1812
|
const r = [];
|
|
1813
1813
|
let o = n;
|
|
@@ -1817,67 +1817,67 @@ function M(...e) {
|
|
|
1817
1817
|
return i;
|
|
1818
1818
|
i.value !== void 0 && r.push(i.value), o = i;
|
|
1819
1819
|
}
|
|
1820
|
-
return
|
|
1820
|
+
return F(o), o.ok(r);
|
|
1821
1821
|
};
|
|
1822
|
-
return new
|
|
1822
|
+
return new x(
|
|
1823
1823
|
e.length === 1 ? e[0].parser : t,
|
|
1824
|
-
|
|
1824
|
+
M("all", void 0, ...e)
|
|
1825
1825
|
);
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function B(e) {
|
|
1828
1828
|
const t = (n) => {
|
|
1829
1829
|
if (n.offset >= n.src.length)
|
|
1830
1830
|
return n.err(void 0);
|
|
1831
1831
|
const r = n.src.slice(n.offset, n.offset + e.length);
|
|
1832
|
-
return r === e ? n.ok(r, r.length) : (
|
|
1832
|
+
return r === e ? n.ok(r, r.length) : (F(n), n.err(void 0));
|
|
1833
1833
|
};
|
|
1834
|
-
return new
|
|
1834
|
+
return new x(
|
|
1835
1835
|
t,
|
|
1836
|
-
|
|
1836
|
+
M("string", void 0, e)
|
|
1837
1837
|
);
|
|
1838
1838
|
}
|
|
1839
|
-
function
|
|
1839
|
+
function D(e, t = (n) => n?.[0] ?? null) {
|
|
1840
1840
|
const n = e.flags.replace(/y/g, ""), r = new RegExp(e, n + "y"), o = (s) => {
|
|
1841
1841
|
if (s.offset >= s.src.length)
|
|
1842
1842
|
return s.err(void 0);
|
|
1843
1843
|
r.lastIndex = s.offset;
|
|
1844
1844
|
const i = t(s.src.match(r));
|
|
1845
|
-
return i ? s.ok(i, r.lastIndex - s.offset) : i === "" ? s.ok(void 0) : (
|
|
1845
|
+
return i ? s.ok(i, r.lastIndex - s.offset) : i === "" ? s.ok(void 0) : (F(s), s.err(void 0));
|
|
1846
1846
|
};
|
|
1847
|
-
return new
|
|
1847
|
+
return new x(
|
|
1848
1848
|
o,
|
|
1849
|
-
|
|
1849
|
+
M("regex", void 0, e)
|
|
1850
1850
|
);
|
|
1851
1851
|
}
|
|
1852
|
-
const
|
|
1852
|
+
const fn = /\s*/y, bn = (e) => {
|
|
1853
1853
|
if (e.offset >= e.src.length)
|
|
1854
1854
|
return e;
|
|
1855
|
-
|
|
1856
|
-
const t = e.src.match(
|
|
1855
|
+
fn.lastIndex = e.offset;
|
|
1856
|
+
const t = e.src.match(fn)?.[0] ?? "";
|
|
1857
1857
|
return e.ok(e.value, t.length);
|
|
1858
|
-
}, g =
|
|
1858
|
+
}, g = D(/\s*/);
|
|
1859
1859
|
g.context.name = "whitespace";
|
|
1860
|
-
const
|
|
1860
|
+
const m = (e) => {
|
|
1861
1861
|
const t = new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
|
|
1862
|
-
return
|
|
1863
|
-
},
|
|
1864
|
-
function
|
|
1865
|
-
return new
|
|
1862
|
+
return D(t);
|
|
1863
|
+
}, bo = D(/-?[a-zA-Z][a-zA-Z0-9-]*/), Pe = m("none"), go = D(/-?\d+/).map(Number), et = D(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);
|
|
1864
|
+
function wo(e) {
|
|
1865
|
+
return new x((t) => t.ok(e, 0));
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1868
|
-
return new
|
|
1867
|
+
function ko(e) {
|
|
1868
|
+
return new x((t) => t.err(void 0, 0));
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1870
|
+
function Bt(e, t) {
|
|
1871
1871
|
const n = e.parseState(t);
|
|
1872
1872
|
if (n.isError)
|
|
1873
1873
|
throw new Error(`Parse error at offset ${n.offset}`);
|
|
1874
1874
|
return n.value;
|
|
1875
1875
|
}
|
|
1876
|
-
function
|
|
1876
|
+
function ba(e, t) {
|
|
1877
1877
|
const n = e.parseState(t);
|
|
1878
1878
|
return { status: !n.isError, value: n.value };
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1880
|
+
function N(e, t) {
|
|
1881
1881
|
const [n, r, o] = e;
|
|
1882
1882
|
return [
|
|
1883
1883
|
t[0] * n + t[1] * r + t[2] * o,
|
|
@@ -1885,7 +1885,7 @@ function R(e, t) {
|
|
|
1885
1885
|
t[6] * n + t[7] * r + t[8] * o
|
|
1886
1886
|
];
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function da(e) {
|
|
1889
1889
|
return [
|
|
1890
1890
|
e[0],
|
|
1891
1891
|
e[3],
|
|
@@ -1898,7 +1898,7 @@ function Vs(e) {
|
|
|
1898
1898
|
e[8]
|
|
1899
1899
|
];
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1901
|
+
function ga(e, t) {
|
|
1902
1902
|
return [
|
|
1903
1903
|
e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
|
|
1904
1904
|
e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
|
|
@@ -1911,54 +1911,54 @@ function Ws(e, t) {
|
|
|
1911
1911
|
e[6] * t[2] + e[7] * t[5] + e[8] * t[8]
|
|
1912
1912
|
];
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1915
|
-
const [t, n, r, o, s, i, a, c, l] = e,
|
|
1914
|
+
function nt(e) {
|
|
1915
|
+
const [t, n, r, o, s, i, a, c, l] = e, p = s * l - i * c, u = -(o * l - i * a), f = o * c - s * a, y = 1 / (t * p + n * u + r * f);
|
|
1916
1916
|
return [
|
|
1917
|
-
|
|
1918
|
-
(r * c - n * l) *
|
|
1919
|
-
(n * i - r * s) *
|
|
1920
|
-
u *
|
|
1921
|
-
(t * l - r * a) *
|
|
1922
|
-
(r * o - t * i) *
|
|
1923
|
-
|
|
1924
|
-
(n * a - t * c) *
|
|
1925
|
-
(t * s - n * o) *
|
|
1917
|
+
p * y,
|
|
1918
|
+
(r * c - n * l) * y,
|
|
1919
|
+
(n * i - r * s) * y,
|
|
1920
|
+
u * y,
|
|
1921
|
+
(t * l - r * a) * y,
|
|
1922
|
+
(r * o - t * i) * y,
|
|
1923
|
+
f * y,
|
|
1924
|
+
(n * a - t * c) * y,
|
|
1925
|
+
(t * s - n * o) * y
|
|
1926
1926
|
];
|
|
1927
1927
|
}
|
|
1928
|
-
const
|
|
1928
|
+
const _ = 255, h = {
|
|
1929
1929
|
"%": { min: 0, max: 100 },
|
|
1930
1930
|
number: { min: 0, max: 1 }
|
|
1931
|
-
},
|
|
1931
|
+
}, oe = {
|
|
1932
1932
|
"%": h["%"],
|
|
1933
|
-
number: { min: 0, max:
|
|
1933
|
+
number: { min: 0, max: _ }
|
|
1934
1934
|
}, z = {
|
|
1935
1935
|
"%": h["%"],
|
|
1936
1936
|
number: h.number
|
|
1937
|
-
},
|
|
1937
|
+
}, Tt = {
|
|
1938
1938
|
deg: { min: 0, max: 360 },
|
|
1939
1939
|
number: { min: 0, max: 360 },
|
|
1940
1940
|
"%": h["%"]
|
|
1941
|
-
},
|
|
1941
|
+
}, b = {
|
|
1942
1942
|
rgb: {
|
|
1943
|
-
r:
|
|
1944
|
-
g:
|
|
1945
|
-
b:
|
|
1943
|
+
r: oe,
|
|
1944
|
+
g: oe,
|
|
1945
|
+
b: oe,
|
|
1946
1946
|
alpha: h
|
|
1947
1947
|
},
|
|
1948
1948
|
hsl: {
|
|
1949
|
-
h:
|
|
1949
|
+
h: Tt,
|
|
1950
1950
|
s: { "%": h["%"], number: h.number },
|
|
1951
1951
|
l: { "%": h["%"], number: h.number },
|
|
1952
1952
|
alpha: h
|
|
1953
1953
|
},
|
|
1954
1954
|
hsv: {
|
|
1955
|
-
h:
|
|
1955
|
+
h: Tt,
|
|
1956
1956
|
s: { "%": h["%"], number: h.number },
|
|
1957
1957
|
v: { "%": h["%"], number: h.number },
|
|
1958
1958
|
alpha: h
|
|
1959
1959
|
},
|
|
1960
1960
|
hwb: {
|
|
1961
|
-
h:
|
|
1961
|
+
h: Tt,
|
|
1962
1962
|
w: { "%": h["%"], number: h.number },
|
|
1963
1963
|
b: { "%": h["%"], number: h.number },
|
|
1964
1964
|
alpha: h
|
|
@@ -1972,7 +1972,7 @@ const I = 255, h = {
|
|
|
1972
1972
|
lch: {
|
|
1973
1973
|
l: { "%": h["%"], number: h["%"] },
|
|
1974
1974
|
c: { number: { min: 0, max: 150 }, "%": h["%"] },
|
|
1975
|
-
h:
|
|
1975
|
+
h: Tt,
|
|
1976
1976
|
alpha: h
|
|
1977
1977
|
},
|
|
1978
1978
|
oklab: {
|
|
@@ -1984,7 +1984,7 @@ const I = 255, h = {
|
|
|
1984
1984
|
oklch: {
|
|
1985
1985
|
l: { "%": h["%"], number: h["%"] },
|
|
1986
1986
|
c: { number: { min: 0, max: 0.5 }, "%": h["%"] },
|
|
1987
|
-
h:
|
|
1987
|
+
h: Tt,
|
|
1988
1988
|
alpha: h
|
|
1989
1989
|
},
|
|
1990
1990
|
xyz: {
|
|
@@ -2027,96 +2027,96 @@ const I = 255, h = {
|
|
|
2027
2027
|
b: z,
|
|
2028
2028
|
alpha: h
|
|
2029
2029
|
}
|
|
2030
|
-
},
|
|
2030
|
+
}, $ = "%", lr = {
|
|
2031
2031
|
rgb: {
|
|
2032
2032
|
r: "",
|
|
2033
2033
|
g: "",
|
|
2034
2034
|
b: "",
|
|
2035
|
-
alpha:
|
|
2035
|
+
alpha: $
|
|
2036
2036
|
},
|
|
2037
2037
|
hsl: {
|
|
2038
2038
|
h: "deg",
|
|
2039
2039
|
s: "%",
|
|
2040
2040
|
l: "%",
|
|
2041
|
-
alpha:
|
|
2041
|
+
alpha: $
|
|
2042
2042
|
},
|
|
2043
2043
|
hsv: {
|
|
2044
2044
|
h: "deg",
|
|
2045
2045
|
s: "%",
|
|
2046
2046
|
v: "%",
|
|
2047
|
-
alpha:
|
|
2047
|
+
alpha: $
|
|
2048
2048
|
},
|
|
2049
2049
|
hwb: {
|
|
2050
2050
|
h: "deg",
|
|
2051
2051
|
w: "%",
|
|
2052
2052
|
b: "%",
|
|
2053
|
-
alpha:
|
|
2053
|
+
alpha: $
|
|
2054
2054
|
},
|
|
2055
2055
|
lab: {
|
|
2056
2056
|
l: "%",
|
|
2057
2057
|
a: "",
|
|
2058
2058
|
b: "",
|
|
2059
|
-
alpha:
|
|
2059
|
+
alpha: $
|
|
2060
2060
|
},
|
|
2061
2061
|
lch: {
|
|
2062
2062
|
l: "%",
|
|
2063
2063
|
c: "",
|
|
2064
2064
|
h: "deg",
|
|
2065
|
-
alpha:
|
|
2065
|
+
alpha: $
|
|
2066
2066
|
},
|
|
2067
2067
|
oklab: {
|
|
2068
2068
|
l: "%",
|
|
2069
2069
|
a: "",
|
|
2070
2070
|
b: "",
|
|
2071
|
-
alpha:
|
|
2071
|
+
alpha: $
|
|
2072
2072
|
},
|
|
2073
2073
|
oklch: {
|
|
2074
2074
|
l: "%",
|
|
2075
2075
|
c: "",
|
|
2076
2076
|
h: "deg",
|
|
2077
|
-
alpha:
|
|
2077
|
+
alpha: $
|
|
2078
2078
|
},
|
|
2079
2079
|
xyz: {
|
|
2080
2080
|
x: "%",
|
|
2081
2081
|
y: "%",
|
|
2082
2082
|
z: "%",
|
|
2083
|
-
alpha:
|
|
2083
|
+
alpha: $
|
|
2084
2084
|
},
|
|
2085
2085
|
kelvin: {
|
|
2086
2086
|
kelvin: "K",
|
|
2087
|
-
alpha:
|
|
2087
|
+
alpha: $
|
|
2088
2088
|
},
|
|
2089
2089
|
"srgb-linear": {
|
|
2090
2090
|
r: "",
|
|
2091
2091
|
g: "",
|
|
2092
2092
|
b: "",
|
|
2093
|
-
alpha:
|
|
2093
|
+
alpha: $
|
|
2094
2094
|
},
|
|
2095
2095
|
"display-p3": {
|
|
2096
2096
|
r: "",
|
|
2097
2097
|
g: "",
|
|
2098
2098
|
b: "",
|
|
2099
|
-
alpha:
|
|
2099
|
+
alpha: $
|
|
2100
2100
|
},
|
|
2101
2101
|
"a98-rgb": {
|
|
2102
2102
|
r: "",
|
|
2103
2103
|
g: "",
|
|
2104
2104
|
b: "",
|
|
2105
|
-
alpha:
|
|
2105
|
+
alpha: $
|
|
2106
2106
|
},
|
|
2107
2107
|
"prophoto-rgb": {
|
|
2108
2108
|
r: "",
|
|
2109
2109
|
g: "",
|
|
2110
2110
|
b: "",
|
|
2111
|
-
alpha:
|
|
2111
|
+
alpha: $
|
|
2112
2112
|
},
|
|
2113
2113
|
rec2020: {
|
|
2114
2114
|
r: "",
|
|
2115
2115
|
g: "",
|
|
2116
2116
|
b: "",
|
|
2117
|
-
alpha:
|
|
2117
|
+
alpha: $
|
|
2118
2118
|
}
|
|
2119
|
-
},
|
|
2119
|
+
}, wa = {
|
|
2120
2120
|
rgb: "RGB",
|
|
2121
2121
|
hsl: "HSL",
|
|
2122
2122
|
hsv: "HSV",
|
|
@@ -2132,15 +2132,15 @@ const I = 255, h = {
|
|
|
2132
2132
|
"a98-rgb": "Adobe RGB",
|
|
2133
2133
|
"prophoto-rgb": "ProPhoto RGB",
|
|
2134
2134
|
rec2020: "Rec. 2020"
|
|
2135
|
-
},
|
|
2135
|
+
}, So = [
|
|
2136
2136
|
0.3127 / 0.329,
|
|
2137
2137
|
1,
|
|
2138
2138
|
(1 - 0.3127 - 0.329) / 0.329
|
|
2139
|
-
],
|
|
2139
|
+
], yo = [
|
|
2140
2140
|
0.3457 / 0.3585,
|
|
2141
2141
|
1,
|
|
2142
2142
|
(1 - 0.3457 - 0.3585) / 0.3585
|
|
2143
|
-
],
|
|
2143
|
+
], Oe = [
|
|
2144
2144
|
1.0479297925449969,
|
|
2145
2145
|
0.022946870601609652,
|
|
2146
2146
|
-0.05019226628920524,
|
|
@@ -2150,10 +2150,10 @@ const I = 255, h = {
|
|
|
2150
2150
|
-0.009243040646204504,
|
|
2151
2151
|
0.015055191490298152,
|
|
2152
2152
|
0.7518742814281371
|
|
2153
|
-
],
|
|
2154
|
-
D65:
|
|
2155
|
-
D50:
|
|
2156
|
-
},
|
|
2153
|
+
], ur = nt(Oe), pr = {
|
|
2154
|
+
D65: So,
|
|
2155
|
+
D50: yo
|
|
2156
|
+
}, mr = [
|
|
2157
2157
|
0.819022437996703,
|
|
2158
2158
|
0.3619062600528904,
|
|
2159
2159
|
-0.1288737815209879,
|
|
@@ -2163,7 +2163,7 @@ const I = 255, h = {
|
|
|
2163
2163
|
0.0481771893596242,
|
|
2164
2164
|
0.2642395317527308,
|
|
2165
2165
|
0.6335478284694309
|
|
2166
|
-
],
|
|
2166
|
+
], Co = nt(mr), hr = [
|
|
2167
2167
|
0.210454268309314,
|
|
2168
2168
|
0.7936177747023054,
|
|
2169
2169
|
-0.0040720430116193,
|
|
@@ -2173,7 +2173,7 @@ const I = 255, h = {
|
|
|
2173
2173
|
0.0259040424655478,
|
|
2174
2174
|
0.7827717124575296,
|
|
2175
2175
|
-0.8086757549230774
|
|
2176
|
-
],
|
|
2176
|
+
], xo = nt(hr), k = [
|
|
2177
2177
|
4.0767416621,
|
|
2178
2178
|
-3.3077115913,
|
|
2179
2179
|
0.2309699292,
|
|
@@ -2183,7 +2183,7 @@ const I = 255, h = {
|
|
|
2183
2183
|
-0.0041960863,
|
|
2184
2184
|
-0.7034186147,
|
|
2185
2185
|
1.707614701
|
|
2186
|
-
],
|
|
2186
|
+
], j = [
|
|
2187
2187
|
0.4122214708,
|
|
2188
2188
|
0.5363325363,
|
|
2189
2189
|
0.0514459929,
|
|
@@ -2193,11 +2193,11 @@ const I = 255, h = {
|
|
|
2193
2193
|
0.0883024619,
|
|
2194
2194
|
0.2817188376,
|
|
2195
2195
|
0.6299787005
|
|
2196
|
-
],
|
|
2196
|
+
], P = {
|
|
2197
2197
|
l: [1, 0.3963377774, 0.2158037573],
|
|
2198
2198
|
m: [1, -0.1055613458, -0.0638541728],
|
|
2199
2199
|
s: [1, -0.0894841775, -1.291485548]
|
|
2200
|
-
},
|
|
2200
|
+
}, Eo = [
|
|
2201
2201
|
{
|
|
2202
2202
|
// Red sector: -1.88170328*a - 0.80936493*b > 1
|
|
2203
2203
|
test: (e, t) => -1.88170328 * e - 0.80936493 * t > 1,
|
|
@@ -2234,7 +2234,7 @@ const I = 255, h = {
|
|
|
2234
2234
|
wm: -0.7034186147,
|
|
2235
2235
|
ws: 1.707614701
|
|
2236
2236
|
}
|
|
2237
|
-
],
|
|
2237
|
+
], dn = {
|
|
2238
2238
|
aliceblue: "#f0f8ff",
|
|
2239
2239
|
antiquewhite: "#faebd7",
|
|
2240
2240
|
aqua: "#00ffff",
|
|
@@ -2375,6 +2375,7 @@ const I = 255, h = {
|
|
|
2375
2375
|
tan: "#d2b48c",
|
|
2376
2376
|
teal: "#008080",
|
|
2377
2377
|
thistle: "#d8bfd8",
|
|
2378
|
+
transparent: "rgba(0, 0, 0, 0)",
|
|
2378
2379
|
tomato: "#ff6347",
|
|
2379
2380
|
turquoise: "#40e0d0",
|
|
2380
2381
|
violet: "#ee82ee",
|
|
@@ -2389,184 +2390,184 @@ const I = 255, h = {
|
|
|
2389
2390
|
shadyshroom: "oklch(53% 0.07 21.60deg / 100%)",
|
|
2390
2391
|
patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)"
|
|
2391
2392
|
};
|
|
2392
|
-
function
|
|
2393
|
+
function v(e, t, n) {
|
|
2393
2394
|
return Math.min(Math.max(e, t), n);
|
|
2394
2395
|
}
|
|
2395
|
-
function
|
|
2396
|
+
function R(e, t, n, r = 0, o = 1) {
|
|
2396
2397
|
const s = (o - r) / (n - t);
|
|
2397
2398
|
if (n === t)
|
|
2398
2399
|
throw new Error("fromMax and fromMin cannot be equal");
|
|
2399
2400
|
return (e - t) * s + r;
|
|
2400
2401
|
}
|
|
2401
|
-
function
|
|
2402
|
+
function de(e, t, n) {
|
|
2402
2403
|
return (1 - e) * t + e * n;
|
|
2403
2404
|
}
|
|
2404
|
-
function
|
|
2405
|
+
function ka(e, t, n) {
|
|
2405
2406
|
return t = t === 0 ? 1e-9 : t, t * Math.pow(n / t, e);
|
|
2406
2407
|
}
|
|
2407
|
-
function
|
|
2408
|
+
function Ft(e, t) {
|
|
2408
2409
|
const n = t.length - 1, r = [...t];
|
|
2409
2410
|
for (let o = 1; o <= n; o++)
|
|
2410
2411
|
for (let s = 0; s <= n - o; s++)
|
|
2411
|
-
r[s] =
|
|
2412
|
+
r[s] = de(e, r[s], r[s + 1]);
|
|
2412
2413
|
return r[0];
|
|
2413
2414
|
}
|
|
2414
|
-
function
|
|
2415
|
-
return [
|
|
2415
|
+
function fr(e, t, n, r, o) {
|
|
2416
|
+
return [Ft(e, [0, t, r, 1]), Ft(e, [0, n, o, 1])];
|
|
2416
2417
|
}
|
|
2417
|
-
function
|
|
2418
|
+
function jt(e, t) {
|
|
2418
2419
|
const n = t.map((o) => o[0]), r = t.map((o) => o[1]);
|
|
2419
|
-
return [
|
|
2420
|
+
return [Ft(e, n), Ft(e, r)];
|
|
2420
2421
|
}
|
|
2421
|
-
function
|
|
2422
|
+
function Sa(e, t, n, r) {
|
|
2422
2423
|
let o = "M0 0";
|
|
2423
2424
|
for (let s = 0; s <= 1; s += 1e-3) {
|
|
2424
|
-
const [i, a] =
|
|
2425
|
+
const [i, a] = fr(s, e, t, n, r);
|
|
2425
2426
|
o += ` L${i} ${a}`;
|
|
2426
2427
|
}
|
|
2427
2428
|
return `<path d="${o}"/>`;
|
|
2428
2429
|
}
|
|
2429
|
-
function
|
|
2430
|
+
function ya(e, t, n, r) {
|
|
2430
2431
|
const o = (s) => s.toFixed(2);
|
|
2431
2432
|
return `cubic-bezier(${o(e)}, ${o(t)}, ${o(n)}, ${o(r)})`;
|
|
2432
2433
|
}
|
|
2433
|
-
const
|
|
2434
|
-
function
|
|
2434
|
+
const br = 2.4, Gt = 0.055, Le = 12.92, To = 0.04045, dr = To / Le;
|
|
2435
|
+
function se(e) {
|
|
2435
2436
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2436
|
-
return n <=
|
|
2437
|
+
return n <= dr ? e / Le : t * ((n + Gt) / (1 + Gt)) ** br;
|
|
2437
2438
|
}
|
|
2438
|
-
function
|
|
2439
|
+
function ie(e) {
|
|
2439
2440
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2440
|
-
return n <=
|
|
2441
|
+
return n <= dr ? e * Le : t * ((1 + Gt) * n ** (1 / br) - Gt);
|
|
2441
2442
|
}
|
|
2442
|
-
function
|
|
2443
|
+
function ae(e, t, n) {
|
|
2443
2444
|
return Math.min(Math.max(e, t), n);
|
|
2444
2445
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2446
|
+
const Ca = 0.02;
|
|
2447
|
+
function xa(e, t, n, r, o, s) {
|
|
2447
2448
|
const i = e - r, a = t - o, c = n - s;
|
|
2448
2449
|
return Math.sqrt(i * i + a * a + c * c);
|
|
2449
2450
|
}
|
|
2450
|
-
function
|
|
2451
|
-
const r = e +
|
|
2451
|
+
function ze(e, t, n) {
|
|
2452
|
+
const r = e + P.l[1] * t + P.l[2] * n, o = e + P.m[1] * t + P.m[2] * n, s = e + P.s[1] * t + P.s[2] * n, i = r * r * r, a = o * o * o, c = s * s * s;
|
|
2452
2453
|
return [
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2454
|
+
k[0] * i + k[1] * a + k[2] * c,
|
|
2455
|
+
k[3] * i + k[4] * a + k[5] * c,
|
|
2456
|
+
k[6] * i + k[7] * a + k[8] * c
|
|
2456
2457
|
];
|
|
2457
2458
|
}
|
|
2458
|
-
function
|
|
2459
|
+
function Ao(e, t, n) {
|
|
2459
2460
|
return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
|
|
2460
2461
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const n =
|
|
2462
|
+
function Mo(e, t) {
|
|
2463
|
+
const n = Eo.find((E) => E.test(e, t)), { k0: r, k1: o, k2: s, k3: i, k4: a, wl: c, wm: l, ws: p } = n;
|
|
2463
2464
|
let u = r + o * e + s * t + i * e * e + a * e * t;
|
|
2464
|
-
const
|
|
2465
|
+
const f = P.l[1] * e + P.l[2] * t, C = P.m[1] * e + P.m[2] * t, y = P.s[1] * e + P.s[2] * t;
|
|
2465
2466
|
{
|
|
2466
|
-
const
|
|
2467
|
-
u = u -
|
|
2467
|
+
const E = 1 + u * f, w = 1 + u * C, T = 1 + u * y, A = E * E * E, L = w * w * w, W = T * T * T, ot = 3 * f * E * E, st = 3 * C * w * w, it = 3 * y * T * T, Ct = 6 * f * f * E, xt = 6 * C * C * w, Et = 6 * y * y * T, ht = c * A + l * L + p * W, at = c * ot + l * st + p * it, Nt = c * Ct + l * xt + p * Et;
|
|
2468
|
+
u = u - ht * at / (at * at - 0.5 * ht * Nt);
|
|
2468
2469
|
}
|
|
2469
2470
|
return u;
|
|
2470
2471
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const n =
|
|
2472
|
+
function Io(e, t) {
|
|
2473
|
+
const n = Mo(e, t), [r, o, s] = ze(1, n * e, n * t), i = Math.cbrt(1 / Math.max(r, o, s)), a = i * n;
|
|
2473
2474
|
return { L: i, C: a };
|
|
2474
2475
|
}
|
|
2475
|
-
function
|
|
2476
|
+
function Ro(e, t, n, r, o, s) {
|
|
2476
2477
|
let i;
|
|
2477
2478
|
if ((n - o) * s.C - (s.L - o) * r <= 0)
|
|
2478
2479
|
i = s.C * o / (r * s.L + s.C * (o - n));
|
|
2479
2480
|
else {
|
|
2480
2481
|
i = s.C * (o - 1) / (r * (s.L - 1) + s.C * (o - n));
|
|
2481
|
-
const a = n - o, c = r, l =
|
|
2482
|
+
const a = n - o, c = r, l = P.l[1] * e + P.l[2] * t, p = P.m[1] * e + P.m[2] * t, u = P.s[1] * e + P.s[2] * t, f = a + c * l, C = a + c * p, y = a + c * u;
|
|
2482
2483
|
{
|
|
2483
|
-
const
|
|
2484
|
-
let
|
|
2485
|
-
const
|
|
2486
|
-
let
|
|
2487
|
-
const
|
|
2488
|
-
let
|
|
2489
|
-
|
|
2484
|
+
const E = o * (1 - i) + i * n, w = i * r, T = E + w * l, A = E + w * p, L = E + w * u, W = T * T * T, ot = A * A * A, st = L * L * L, it = 3 * f * T * T, Ct = 3 * C * A * A, xt = 3 * y * L * L, Et = 6 * f * f * T, ht = 6 * C * C * A, at = 6 * y * y * L, Nt = k[0] * W + k[1] * ot + k[2] * st - 1, Jt = k[0] * it + k[1] * Ct + k[2] * xt, eo = k[0] * Et + k[1] * ht + k[2] * at, rn = Jt / (Jt * Jt - 0.5 * Nt * eo);
|
|
2485
|
+
let Qt = -Nt * rn;
|
|
2486
|
+
const on = k[3] * W + k[4] * ot + k[5] * st - 1, te = k[3] * it + k[4] * Ct + k[5] * xt, no = k[3] * Et + k[4] * ht + k[5] * at, sn = te / (te * te - 0.5 * on * no);
|
|
2487
|
+
let ee = -on * sn;
|
|
2488
|
+
const an = k[6] * W + k[7] * ot + k[8] * st - 1, ne = k[6] * it + k[7] * Ct + k[8] * xt, ro = k[6] * Et + k[7] * ht + k[8] * at, cn = ne / (ne * ne - 0.5 * an * ro);
|
|
2489
|
+
let re = -an * cn;
|
|
2490
|
+
Qt = rn >= 0 ? Qt : 1 / 0, ee = sn >= 0 ? ee : 1 / 0, re = cn >= 0 ? re : 1 / 0, i += Math.min(Qt, ee, re);
|
|
2490
2491
|
}
|
|
2491
2492
|
}
|
|
2492
2493
|
return i;
|
|
2493
2494
|
}
|
|
2494
|
-
const
|
|
2495
|
-
function
|
|
2496
|
-
const [r, o, s] =
|
|
2497
|
-
if (
|
|
2495
|
+
const vo = 1e-5, Bo = 0.05;
|
|
2496
|
+
function No(e, t, n) {
|
|
2497
|
+
const [r, o, s] = ze(e, t, n);
|
|
2498
|
+
if (Ao(r, o, s))
|
|
2498
2499
|
return [e, t, n];
|
|
2499
|
-
const i = Math.max(
|
|
2500
|
-
return [
|
|
2500
|
+
const i = Math.max(vo, Math.sqrt(t * t + n * n)), a = t / i, c = n / i, l = Io(a, c), p = e - 0.5, u = 0.5 + Math.abs(p) + Bo * i, f = 0.5 * (1 + Math.sign(p) * (u - Math.sqrt(u * u - 2 * Math.abs(p)))), C = Ro(a, c, e, i, f, l), y = f * (1 - C) + C * e, E = C * i;
|
|
2501
|
+
return [y, E * a, E * c];
|
|
2501
2502
|
}
|
|
2502
|
-
function
|
|
2503
|
-
const r =
|
|
2503
|
+
function _o(e, t, n) {
|
|
2504
|
+
const r = se(e), o = se(t), s = se(n), i = Math.cbrt(j[0] * r + j[1] * o + j[2] * s), a = Math.cbrt(j[3] * r + j[4] * o + j[5] * s), c = Math.cbrt(j[6] * r + j[7] * o + j[8] * s);
|
|
2504
2505
|
return [
|
|
2505
2506
|
0.2104542553 * i + 0.793617785 * a - 0.0040720468 * c,
|
|
2506
2507
|
1.9779984951 * i - 2.428592205 * a + 0.4505937099 * c,
|
|
2507
2508
|
0.0259040371 * i + 0.7827717662 * a - 0.808675766 * c
|
|
2508
2509
|
];
|
|
2509
2510
|
}
|
|
2510
|
-
function
|
|
2511
|
+
function Po(e, t, n) {
|
|
2511
2512
|
if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1)
|
|
2512
2513
|
return [e, t, n];
|
|
2513
|
-
const [r, o, s] =
|
|
2514
|
+
const [r, o, s] = _o(e, t, n), [i, a, c] = No(r, o, s), [l, p, u] = ze(i, a, c);
|
|
2514
2515
|
return [
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2516
|
+
ae(ie(l), 0, 1),
|
|
2517
|
+
ae(ie(p), 0, 1),
|
|
2518
|
+
ae(ie(u), 0, 1)
|
|
2518
2519
|
];
|
|
2519
2520
|
}
|
|
2520
|
-
const
|
|
2521
|
-
const t =
|
|
2521
|
+
const Ea = (e) => {
|
|
2522
|
+
const t = b[e], n = lr[e];
|
|
2522
2523
|
return Object.entries(t).reduce((r, [o, s]) => {
|
|
2523
2524
|
const i = n[o];
|
|
2524
2525
|
let { min: a, max: c } = s[i] ?? s.number;
|
|
2525
2526
|
return a = `${a}${i}`, c = `${c}${i}`, r[o] = { min: a, max: c }, r;
|
|
2526
2527
|
}, {});
|
|
2527
|
-
},
|
|
2528
|
+
}, Y = 16, Oo = (e) => {
|
|
2528
2529
|
if (e = e.slice(1), e.length <= 4) {
|
|
2529
|
-
const t = parseInt(e[0] + e[0],
|
|
2530
|
-
return new
|
|
2530
|
+
const t = parseInt(e[0] + e[0], Y), n = parseInt(e[1] + e[1], Y), r = parseInt(e[2] + e[2], Y), o = e[3] ? parseInt(e[3] + e[3], Y) / _ : 1;
|
|
2531
|
+
return new O(t, n, r, o);
|
|
2531
2532
|
} else {
|
|
2532
|
-
const t = parseInt(e.slice(0, 2),
|
|
2533
|
-
return new
|
|
2533
|
+
const t = parseInt(e.slice(0, 2), Y), n = parseInt(e.slice(2, 4), Y), r = parseInt(e.slice(4, 6), Y), o = e.length === 8 ? parseInt(e.slice(6, 8), Y) / _ : 1;
|
|
2534
|
+
return new O(t, n, r, o);
|
|
2534
2535
|
}
|
|
2535
|
-
},
|
|
2536
|
+
}, Ta = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
2536
2537
|
const o = (s) => {
|
|
2537
|
-
const i = s.toString(
|
|
2538
|
+
const i = s.toString(Y);
|
|
2538
2539
|
return i.length === 1 ? "0" + i : i;
|
|
2539
2540
|
};
|
|
2540
|
-
return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r *
|
|
2541
|
-
},
|
|
2542
|
-
e =
|
|
2541
|
+
return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r * _)) : ""}`;
|
|
2542
|
+
}, gr = 1e3, wr = 4e4, kr = 100, Sr = ({ kelvin: e, alpha: t }) => {
|
|
2543
|
+
e = v(e, gr, wr) / kr;
|
|
2543
2544
|
let n, r, o;
|
|
2544
|
-
return e <= 66 ? n =
|
|
2545
|
-
},
|
|
2546
|
-
e =
|
|
2545
|
+
return e <= 66 ? n = _ : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = v(n, 0, _) / _, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = v(r, 0, _) / _, e >= 66 ? o = _ : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = v(o, 0, _) / _, new O(n, r, o, t);
|
|
2546
|
+
}, Lo = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
2547
|
+
e = v(e * _, 0, _), t = v(t * _, 0, _), n = v(n * _, 0, _);
|
|
2547
2548
|
let o;
|
|
2548
|
-
if (n ===
|
|
2549
|
+
if (n === _ ? o = 6600 : n === 0 ? o = 1900 : o = Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < _) {
|
|
2549
2550
|
const i = (329.698727446 / e) ** -7.507239275877164 + 60;
|
|
2550
2551
|
o = Math.max(o, i);
|
|
2551
2552
|
}
|
|
2552
2553
|
const s = o <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -0.0755148492) + 60;
|
|
2553
|
-
return o = (o + s) / 2, o =
|
|
2554
|
-
},
|
|
2554
|
+
return o = (o + s) / 2, o = v(Math.round(o * kr), gr, wr), new nr(o, r);
|
|
2555
|
+
}, yr = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
2555
2556
|
const o = n - n * t / 2;
|
|
2556
2557
|
let s;
|
|
2557
|
-
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new
|
|
2558
|
-
},
|
|
2558
|
+
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new yt(e, s, o, r);
|
|
2559
|
+
}, Cr = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
2559
2560
|
const o = n + t * Math.min(n, 1 - n);
|
|
2560
2561
|
let s;
|
|
2561
|
-
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new
|
|
2562
|
-
},
|
|
2562
|
+
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new Ee(e, s, o, r);
|
|
2563
|
+
}, zo = ({ h: e, w: t, b: n, alpha: r }) => {
|
|
2563
2564
|
let o, s;
|
|
2564
2565
|
const i = t + n;
|
|
2565
|
-
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s),
|
|
2566
|
-
},
|
|
2567
|
-
const { h: o, s, v: i } =
|
|
2568
|
-
return new
|
|
2569
|
-
},
|
|
2566
|
+
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s), yr(new Ee(e, o, s, r));
|
|
2567
|
+
}, $o = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
2568
|
+
const { h: o, s, v: i } = Cr(new yt(e, t, n, r));
|
|
2569
|
+
return new Te(o, i * (1 - s), 1 - i, r);
|
|
2570
|
+
}, xr = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
2570
2571
|
const o = Math.max(e, t, n), s = Math.min(e, t, n);
|
|
2571
2572
|
let [i, a, c] = [0, 0, (o + s) / 2];
|
|
2572
2573
|
const l = o - s;
|
|
@@ -2581,73 +2582,73 @@ const Js = (e) => {
|
|
|
2581
2582
|
i = (e - t) / l + 4;
|
|
2582
2583
|
break;
|
|
2583
2584
|
}
|
|
2584
|
-
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new
|
|
2585
|
+
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new yt(i, a, c, r);
|
|
2585
2586
|
};
|
|
2586
|
-
function
|
|
2587
|
+
function Fo({ h: e, s: t, l: n, alpha: r }) {
|
|
2587
2588
|
const o = (1 - Math.abs(2 * n - 1)) * t, s = o * (1 - Math.abs(e * 6 % 2 - 1)), i = n - o / 2;
|
|
2588
2589
|
let a, c, l;
|
|
2589
|
-
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
|
|
2590
|
+
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 O(a + i, c + i, l + i, r);
|
|
2590
2591
|
}
|
|
2591
|
-
const
|
|
2592
|
-
function
|
|
2592
|
+
const Go = 216 / 24389, Uo = 24 / 116, ge = 24389 / 27, Do = 8, It = 16, Rt = 116, Er = 500, Tr = 200;
|
|
2593
|
+
function Vo(e) {
|
|
2593
2594
|
if (e.whitePoint === "D50") return [e.x, e.y, e.z];
|
|
2594
|
-
if (e.whitePoint === "D65") return
|
|
2595
|
+
if (e.whitePoint === "D65") return N([e.x, e.y, e.z], Oe);
|
|
2595
2596
|
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
2596
2597
|
}
|
|
2597
|
-
function
|
|
2598
|
+
function Wo(e) {
|
|
2598
2599
|
if (e.whitePoint === "D65") return [e.x, e.y, e.z];
|
|
2599
|
-
if (e.whitePoint === "D50") return
|
|
2600
|
+
if (e.whitePoint === "D50") return N([e.x, e.y, e.z], ur);
|
|
2600
2601
|
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
2601
2602
|
}
|
|
2602
|
-
function
|
|
2603
|
-
const n = (T) => T >
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2603
|
+
function $e(e, t = "D50") {
|
|
2604
|
+
const n = (T) => T > Go ? Math.cbrt(T) : (ge * T + It) / Rt, r = pr[t], [o, s, i] = Vo(e), a = o / r[0], c = s / r[1], l = i / r[2], p = n(a), u = n(c), f = n(l), C = Rt * u - It, y = Er * (p - u), E = Tr * (u - f), w = new Xt(
|
|
2605
|
+
R(
|
|
2606
|
+
C,
|
|
2607
|
+
b.lab.l.number.min,
|
|
2608
|
+
b.lab.l.number.max
|
|
2608
2609
|
),
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2610
|
+
R(
|
|
2611
|
+
y,
|
|
2612
|
+
b.lab.a.number.min,
|
|
2613
|
+
b.lab.a.number.max
|
|
2613
2614
|
),
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2615
|
+
R(
|
|
2616
|
+
E,
|
|
2617
|
+
b.lab.b.number.min,
|
|
2618
|
+
b.lab.b.number.max
|
|
2618
2619
|
),
|
|
2619
2620
|
e.alpha
|
|
2620
2621
|
);
|
|
2621
|
-
return
|
|
2622
|
+
return w.whitePoint = t, w;
|
|
2622
2623
|
}
|
|
2623
|
-
function
|
|
2624
|
-
const t = (
|
|
2624
|
+
function Fe(e) {
|
|
2625
|
+
const t = (A) => A > Uo ? A ** 3 : (Rt * A - It) / ge, n = (A) => A > Do ? ((A + It) / Rt) ** 3 : A / ge, r = pr[e.whitePoint];
|
|
2625
2626
|
let { l: o, a: s, b: i, alpha: a } = e;
|
|
2626
|
-
o =
|
|
2627
|
+
o = R(
|
|
2627
2628
|
o,
|
|
2628
2629
|
0,
|
|
2629
2630
|
1,
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
), s =
|
|
2631
|
+
b.lab.l.number.min,
|
|
2632
|
+
b.lab.l.number.max
|
|
2633
|
+
), s = R(
|
|
2633
2634
|
s,
|
|
2634
2635
|
0,
|
|
2635
2636
|
1,
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
), i =
|
|
2637
|
+
b.lab.a.number.min,
|
|
2638
|
+
b.lab.a.number.max
|
|
2639
|
+
), i = R(
|
|
2639
2640
|
i,
|
|
2640
2641
|
0,
|
|
2641
2642
|
1,
|
|
2642
|
-
|
|
2643
|
-
|
|
2643
|
+
b.lab.b.number.min,
|
|
2644
|
+
b.lab.b.number.max
|
|
2644
2645
|
);
|
|
2645
|
-
const c = (o +
|
|
2646
|
-
let
|
|
2647
|
-
const T = new
|
|
2648
|
-
return T.whitePoint = e.whitePoint, [
|
|
2646
|
+
const c = (o + It) / Rt, l = s / Er + c, p = c - i / Tr, [u, f, C] = [t(l), n(o), t(p)];
|
|
2647
|
+
let y = u * r[0], E = f * r[1], w = C * r[2];
|
|
2648
|
+
const T = new U(y, E, w, a);
|
|
2649
|
+
return T.whitePoint = e.whitePoint, [y, E, w] = Wo(T), T.whitePoint = "D65", T.x = y, T.y = E, T.z = w, T;
|
|
2649
2650
|
}
|
|
2650
|
-
const
|
|
2651
|
+
const Ge = [
|
|
2651
2652
|
0.41239079926595934,
|
|
2652
2653
|
0.357584339383878,
|
|
2653
2654
|
0.1804807884018343,
|
|
@@ -2657,221 +2658,221 @@ const Ee = [
|
|
|
2657
2658
|
0.01933081871559182,
|
|
2658
2659
|
0.11919477979462598,
|
|
2659
2660
|
0.9505321522496607
|
|
2660
|
-
],
|
|
2661
|
-
function
|
|
2661
|
+
], Ar = nt(Ge), Mr = 2.4, Ut = 0.055, Ue = 12.92, Xo = 0.04045, Ir = Xo / Ue;
|
|
2662
|
+
function wt(e) {
|
|
2662
2663
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2663
|
-
return n <=
|
|
2664
|
+
return n <= Ir ? e / Ue : t * ((n + Ut) / (1 + Ut)) ** Mr;
|
|
2664
2665
|
}
|
|
2665
|
-
function
|
|
2666
|
+
function Rr(e) {
|
|
2666
2667
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2667
|
-
return n <=
|
|
2668
|
+
return n <= Ir ? e * Ue : t * ((1 + Ut) * n ** (1 / Mr) - Ut);
|
|
2668
2669
|
}
|
|
2669
|
-
function
|
|
2670
|
-
const o = [
|
|
2671
|
-
return new
|
|
2670
|
+
function De({ r: e, g: t, b: n, alpha: r }) {
|
|
2671
|
+
const o = [wt(e), wt(t), wt(n)], [s, i, a] = N(o, Ge);
|
|
2672
|
+
return new U(s, i, a, r);
|
|
2672
2673
|
}
|
|
2673
|
-
const
|
|
2674
|
-
const s =
|
|
2674
|
+
const Ve = ({ x: e, y: t, z: n, alpha: r }, o = !0) => {
|
|
2675
|
+
const s = N([e, t, n], Ar), [i, a, c] = s.map(Rr);
|
|
2675
2676
|
if (o) {
|
|
2676
|
-
const l =
|
|
2677
|
-
return new
|
|
2677
|
+
const l = xs(new O(i, a, c, r));
|
|
2678
|
+
return new O(l.r, l.g, l.b, r);
|
|
2678
2679
|
} else
|
|
2679
|
-
return new
|
|
2680
|
+
return new O(i, a, c, r);
|
|
2680
2681
|
};
|
|
2681
|
-
function
|
|
2682
|
-
t =
|
|
2682
|
+
function Ho({ l: e, c: t, h: n, alpha: r }) {
|
|
2683
|
+
t = R(
|
|
2683
2684
|
t,
|
|
2684
2685
|
0,
|
|
2685
2686
|
1,
|
|
2686
|
-
|
|
2687
|
-
|
|
2687
|
+
b.lch.c.number.min,
|
|
2688
|
+
b.lch.c.number.max
|
|
2688
2689
|
);
|
|
2689
2690
|
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
2690
|
-
return new
|
|
2691
|
+
return new Xt(
|
|
2691
2692
|
e,
|
|
2692
|
-
|
|
2693
|
+
R(
|
|
2693
2694
|
s,
|
|
2694
|
-
|
|
2695
|
-
|
|
2695
|
+
b.lab.a.number.min,
|
|
2696
|
+
b.lab.a.number.max
|
|
2696
2697
|
),
|
|
2697
|
-
|
|
2698
|
+
R(
|
|
2698
2699
|
i,
|
|
2699
|
-
|
|
2700
|
-
|
|
2700
|
+
b.lab.b.number.min,
|
|
2701
|
+
b.lab.b.number.max
|
|
2701
2702
|
),
|
|
2702
2703
|
r
|
|
2703
2704
|
);
|
|
2704
2705
|
}
|
|
2705
|
-
function
|
|
2706
|
-
t =
|
|
2706
|
+
function jo({ l: e, a: t, b: n, alpha: r }) {
|
|
2707
|
+
t = R(
|
|
2707
2708
|
t,
|
|
2708
2709
|
0,
|
|
2709
2710
|
1,
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
), n =
|
|
2711
|
+
b.lab.a.number.min,
|
|
2712
|
+
b.lab.a.number.max
|
|
2713
|
+
), n = R(
|
|
2713
2714
|
n,
|
|
2714
2715
|
0,
|
|
2715
2716
|
1,
|
|
2716
|
-
|
|
2717
|
-
|
|
2717
|
+
b.lab.b.number.min,
|
|
2718
|
+
b.lab.b.number.max
|
|
2718
2719
|
);
|
|
2719
2720
|
const o = Math.hypot(t, n);
|
|
2720
2721
|
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
2721
|
-
return s < 0 && (s += 1), new
|
|
2722
|
+
return s < 0 && (s += 1), new Ae(
|
|
2722
2723
|
e,
|
|
2723
|
-
|
|
2724
|
+
R(
|
|
2724
2725
|
o,
|
|
2725
|
-
|
|
2726
|
-
|
|
2726
|
+
b.lch.c.number.min,
|
|
2727
|
+
b.lch.c.number.max
|
|
2727
2728
|
),
|
|
2728
2729
|
s,
|
|
2729
2730
|
r
|
|
2730
2731
|
);
|
|
2731
2732
|
}
|
|
2732
|
-
function
|
|
2733
|
-
t =
|
|
2733
|
+
function We({ l: e, a: t, b: n, alpha: r }) {
|
|
2734
|
+
t = R(
|
|
2734
2735
|
t,
|
|
2735
2736
|
0,
|
|
2736
2737
|
1,
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
), n =
|
|
2738
|
+
b.oklab.a.number.min,
|
|
2739
|
+
b.oklab.a.number.max
|
|
2740
|
+
), n = R(
|
|
2740
2741
|
n,
|
|
2741
2742
|
0,
|
|
2742
2743
|
1,
|
|
2743
|
-
|
|
2744
|
-
|
|
2744
|
+
b.oklab.b.number.min,
|
|
2745
|
+
b.oklab.b.number.max
|
|
2745
2746
|
);
|
|
2746
|
-
const o =
|
|
2747
|
-
return new
|
|
2747
|
+
const o = N([e, t, n], xo), s = [o[0] * o[0] * o[0], o[1] * o[1] * o[1], o[2] * o[2] * o[2]], [i, a, c] = N(s, Co);
|
|
2748
|
+
return new U(i, a, c, r);
|
|
2748
2749
|
}
|
|
2749
|
-
function
|
|
2750
|
-
const { x: t, y: n, z: r } = e, o =
|
|
2751
|
-
return new
|
|
2750
|
+
function Xe(e) {
|
|
2751
|
+
const { x: t, y: n, z: r } = e, o = N([t, n, r], mr), s = [Math.cbrt(o[0]), Math.cbrt(o[1]), Math.cbrt(o[2])], [i, a, c] = N(s, hr);
|
|
2752
|
+
return new Ht(
|
|
2752
2753
|
i,
|
|
2753
|
-
|
|
2754
|
+
R(
|
|
2754
2755
|
a,
|
|
2755
|
-
|
|
2756
|
-
|
|
2756
|
+
b.oklab.a.number.min,
|
|
2757
|
+
b.oklab.a.number.max
|
|
2757
2758
|
),
|
|
2758
|
-
|
|
2759
|
+
R(
|
|
2759
2760
|
c,
|
|
2760
|
-
|
|
2761
|
-
|
|
2761
|
+
b.oklab.b.number.min,
|
|
2762
|
+
b.oklab.b.number.max
|
|
2762
2763
|
),
|
|
2763
2764
|
e.alpha
|
|
2764
2765
|
);
|
|
2765
2766
|
}
|
|
2766
|
-
function
|
|
2767
|
-
const t =
|
|
2768
|
-
return
|
|
2767
|
+
function Yo(e) {
|
|
2768
|
+
const t = We(e);
|
|
2769
|
+
return $e(t);
|
|
2769
2770
|
}
|
|
2770
|
-
function
|
|
2771
|
-
const t =
|
|
2772
|
-
return
|
|
2771
|
+
function Zo(e) {
|
|
2772
|
+
const t = Fe(e);
|
|
2773
|
+
return Xe(t);
|
|
2773
2774
|
}
|
|
2774
|
-
function
|
|
2775
|
-
t =
|
|
2775
|
+
function vr({ l: e, a: t, b: n, alpha: r }) {
|
|
2776
|
+
t = R(t, 0, 1, b.oklab.a.number.min, b.oklab.a.number.max), n = R(n, 0, 1, b.oklab.b.number.min, b.oklab.b.number.max);
|
|
2776
2777
|
const o = Math.hypot(t, n);
|
|
2777
2778
|
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
2778
|
-
return s < 0 && (s += 1), new
|
|
2779
|
+
return s < 0 && (s += 1), new Me(
|
|
2779
2780
|
e,
|
|
2780
|
-
|
|
2781
|
+
R(o, b.oklch.c.number.min, b.oklch.c.number.max),
|
|
2781
2782
|
s,
|
|
2782
2783
|
r
|
|
2783
2784
|
);
|
|
2784
2785
|
}
|
|
2785
|
-
function
|
|
2786
|
-
t =
|
|
2786
|
+
function Br({ l: e, c: t, h: n, alpha: r }) {
|
|
2787
|
+
t = R(t, 0, 1, b.oklch.c.number.min, b.oklch.c.number.max);
|
|
2787
2788
|
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
2788
|
-
return new
|
|
2789
|
+
return new Ht(
|
|
2789
2790
|
e,
|
|
2790
|
-
|
|
2791
|
-
|
|
2791
|
+
R(s, b.oklab.a.number.min, b.oklab.a.number.max),
|
|
2792
|
+
R(i, b.oklab.b.number.min, b.oklab.b.number.max),
|
|
2792
2793
|
r
|
|
2793
2794
|
);
|
|
2794
2795
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2796
|
+
function Aa(e) {
|
|
2797
|
+
return Yo(Br(e));
|
|
2797
2798
|
}
|
|
2798
|
-
function
|
|
2799
|
-
return
|
|
2799
|
+
function Ma(e) {
|
|
2800
|
+
return vr(Zo(e));
|
|
2800
2801
|
}
|
|
2801
|
-
function
|
|
2802
|
-
const t =
|
|
2803
|
-
return
|
|
2802
|
+
function He(e) {
|
|
2803
|
+
const t = Fo(e);
|
|
2804
|
+
return De(t);
|
|
2804
2805
|
}
|
|
2805
|
-
function
|
|
2806
|
-
const t =
|
|
2807
|
-
return
|
|
2806
|
+
function je(e) {
|
|
2807
|
+
const t = Ve(e);
|
|
2808
|
+
return xr(t);
|
|
2808
2809
|
}
|
|
2809
|
-
function
|
|
2810
|
-
const t =
|
|
2811
|
-
return
|
|
2810
|
+
function qo(e) {
|
|
2811
|
+
const t = yr(e);
|
|
2812
|
+
return He(t);
|
|
2812
2813
|
}
|
|
2813
|
-
function
|
|
2814
|
-
const t =
|
|
2815
|
-
return
|
|
2814
|
+
function Ko(e) {
|
|
2815
|
+
const t = je(e);
|
|
2816
|
+
return Cr(t);
|
|
2816
2817
|
}
|
|
2817
|
-
function
|
|
2818
|
-
const t =
|
|
2819
|
-
return
|
|
2818
|
+
function Jo(e) {
|
|
2819
|
+
const t = zo(e);
|
|
2820
|
+
return He(t);
|
|
2820
2821
|
}
|
|
2821
|
-
function
|
|
2822
|
-
const t =
|
|
2823
|
-
return
|
|
2822
|
+
function Qo(e) {
|
|
2823
|
+
const t = je(e);
|
|
2824
|
+
return $o(t);
|
|
2824
2825
|
}
|
|
2825
|
-
function
|
|
2826
|
-
const t =
|
|
2827
|
-
return
|
|
2826
|
+
function ts(e) {
|
|
2827
|
+
const t = Ho(e);
|
|
2828
|
+
return Fe(t);
|
|
2828
2829
|
}
|
|
2829
|
-
function
|
|
2830
|
-
const t =
|
|
2831
|
-
return
|
|
2830
|
+
function es(e) {
|
|
2831
|
+
const t = $e(e);
|
|
2832
|
+
return jo(t);
|
|
2832
2833
|
}
|
|
2833
|
-
function
|
|
2834
|
-
const t =
|
|
2835
|
-
return
|
|
2834
|
+
function ns(e) {
|
|
2835
|
+
const t = Br(e);
|
|
2836
|
+
return We(t);
|
|
2836
2837
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const t =
|
|
2839
|
-
return
|
|
2838
|
+
function rs(e) {
|
|
2839
|
+
const t = Xe(e);
|
|
2840
|
+
return vr(t);
|
|
2840
2841
|
}
|
|
2841
|
-
function
|
|
2842
|
-
const t =
|
|
2843
|
-
return
|
|
2842
|
+
function os(e) {
|
|
2843
|
+
const t = Sr(e);
|
|
2844
|
+
return De(t);
|
|
2844
2845
|
}
|
|
2845
|
-
function
|
|
2846
|
-
const t =
|
|
2847
|
-
return
|
|
2846
|
+
function ss(e) {
|
|
2847
|
+
const t = Ve(e);
|
|
2848
|
+
return Lo(t);
|
|
2848
2849
|
}
|
|
2849
|
-
const
|
|
2850
|
-
function
|
|
2851
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) **
|
|
2850
|
+
const Nr = 563 / 256;
|
|
2851
|
+
function ce(e) {
|
|
2852
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** Nr;
|
|
2852
2853
|
}
|
|
2853
|
-
function
|
|
2854
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 /
|
|
2854
|
+
function is(e) {
|
|
2855
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / Nr);
|
|
2855
2856
|
}
|
|
2856
|
-
const
|
|
2857
|
-
function
|
|
2857
|
+
const _r = 1 / 512, Pr = 1.8;
|
|
2858
|
+
function le(e) {
|
|
2858
2859
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2859
|
-
return t * (n <=
|
|
2860
|
+
return t * (n <= _r * 16 ? n / 16 : n ** Pr);
|
|
2860
2861
|
}
|
|
2861
|
-
function
|
|
2862
|
+
function as(e) {
|
|
2862
2863
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2863
|
-
return t * (n >=
|
|
2864
|
+
return t * (n >= _r ? n ** (1 / Pr) : n * 16);
|
|
2864
2865
|
}
|
|
2865
|
-
const
|
|
2866
|
-
function
|
|
2866
|
+
const Dt = 1.09929682680944, Or = 0.018053968510807;
|
|
2867
|
+
function ue(e) {
|
|
2867
2868
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2868
|
-
return n <
|
|
2869
|
+
return n < Or * 4.5 ? t * n / 4.5 : t * ((n + Dt - 1) / Dt) ** (1 / 0.45);
|
|
2869
2870
|
}
|
|
2870
|
-
function
|
|
2871
|
+
function cs(e) {
|
|
2871
2872
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2872
|
-
return n >=
|
|
2873
|
+
return n >= Or ? t * (Dt * n ** 0.45 - (Dt - 1)) : t * 4.5 * n;
|
|
2873
2874
|
}
|
|
2874
|
-
const
|
|
2875
|
+
const Lr = [
|
|
2875
2876
|
0.4865709486482162,
|
|
2876
2877
|
0.26566769316909306,
|
|
2877
2878
|
0.1982172852343625,
|
|
@@ -2881,7 +2882,7 @@ const Un = [
|
|
|
2881
2882
|
0,
|
|
2882
2883
|
0.04511338185890264,
|
|
2883
2884
|
1.043944368900976
|
|
2884
|
-
],
|
|
2885
|
+
], ls = nt(Lr), zr = [
|
|
2885
2886
|
0.5766690429101305,
|
|
2886
2887
|
0.1855582379065463,
|
|
2887
2888
|
0.1882286462349947,
|
|
@@ -2891,7 +2892,7 @@ const Un = [
|
|
|
2891
2892
|
0.02703136138641234,
|
|
2892
2893
|
0.07068885253582723,
|
|
2893
2894
|
0.9913375368376388
|
|
2894
|
-
],
|
|
2895
|
+
], us = nt(zr), $r = [
|
|
2895
2896
|
0.7977604896723027,
|
|
2896
2897
|
0.13518583717574031,
|
|
2897
2898
|
0.0313493495815248,
|
|
@@ -2901,7 +2902,7 @@ const Un = [
|
|
|
2901
2902
|
0,
|
|
2902
2903
|
0,
|
|
2903
2904
|
0.8251046025104602
|
|
2904
|
-
],
|
|
2905
|
+
], ps = nt($r), Fr = [
|
|
2905
2906
|
0.6369580483012914,
|
|
2906
2907
|
0.14461690358620832,
|
|
2907
2908
|
0.1688809751641721,
|
|
@@ -2911,90 +2912,96 @@ const Un = [
|
|
|
2911
2912
|
0,
|
|
2912
2913
|
0.028072693049087428,
|
|
2913
2914
|
1.0609850577107909
|
|
2914
|
-
],
|
|
2915
|
-
function
|
|
2916
|
-
const [o, s, i] =
|
|
2917
|
-
return new
|
|
2918
|
-
}
|
|
2919
|
-
function
|
|
2920
|
-
const [o, s, i] =
|
|
2921
|
-
return new
|
|
2922
|
-
}
|
|
2923
|
-
function
|
|
2924
|
-
const o = [
|
|
2925
|
-
return new
|
|
2926
|
-
}
|
|
2927
|
-
function
|
|
2928
|
-
const o =
|
|
2929
|
-
return new
|
|
2930
|
-
}
|
|
2931
|
-
function
|
|
2932
|
-
const o = [
|
|
2933
|
-
return new
|
|
2934
|
-
}
|
|
2935
|
-
function
|
|
2936
|
-
const o =
|
|
2937
|
-
return new
|
|
2938
|
-
}
|
|
2939
|
-
function
|
|
2940
|
-
const o = [
|
|
2941
|
-
return new
|
|
2942
|
-
}
|
|
2943
|
-
function
|
|
2944
|
-
const o =
|
|
2945
|
-
return new
|
|
2946
|
-
}
|
|
2947
|
-
function
|
|
2948
|
-
const o = [
|
|
2949
|
-
return new
|
|
2950
|
-
}
|
|
2951
|
-
function
|
|
2952
|
-
const o =
|
|
2953
|
-
return new
|
|
2954
|
-
}
|
|
2955
|
-
const
|
|
2956
|
-
rgb: { to:
|
|
2957
|
-
hsl: { to:
|
|
2958
|
-
hsv: { to:
|
|
2959
|
-
hwb: { to:
|
|
2960
|
-
lab: { to:
|
|
2961
|
-
lch: { to:
|
|
2962
|
-
oklab: { to:
|
|
2963
|
-
oklch: { to:
|
|
2964
|
-
kelvin: { to:
|
|
2915
|
+
], ms = nt(Fr);
|
|
2916
|
+
function hs({ r: e, g: t, b: n, alpha: r }) {
|
|
2917
|
+
const [o, s, i] = N([e, t, n], Ge);
|
|
2918
|
+
return new U(o, s, i, r);
|
|
2919
|
+
}
|
|
2920
|
+
function fs({ x: e, y: t, z: n, alpha: r }) {
|
|
2921
|
+
const [o, s, i] = N([e, t, n], Ar);
|
|
2922
|
+
return new Ie(o, s, i, r);
|
|
2923
|
+
}
|
|
2924
|
+
function bs({ r: e, g: t, b: n, alpha: r }) {
|
|
2925
|
+
const o = [wt(e), wt(t), wt(n)], [s, i, a] = N(o, Lr);
|
|
2926
|
+
return new U(s, i, a, r);
|
|
2927
|
+
}
|
|
2928
|
+
function ds({ x: e, y: t, z: n, alpha: r }) {
|
|
2929
|
+
const o = N([e, t, n], ls), [s, i, a] = o.map(Rr);
|
|
2930
|
+
return new Re(s, i, a, r);
|
|
2931
|
+
}
|
|
2932
|
+
function gs({ r: e, g: t, b: n, alpha: r }) {
|
|
2933
|
+
const o = [ce(e), ce(t), ce(n)], [s, i, a] = N(o, zr);
|
|
2934
|
+
return new U(s, i, a, r);
|
|
2935
|
+
}
|
|
2936
|
+
function ws({ x: e, y: t, z: n, alpha: r }) {
|
|
2937
|
+
const o = N([e, t, n], us), [s, i, a] = o.map(is);
|
|
2938
|
+
return new ve(s, i, a, r);
|
|
2939
|
+
}
|
|
2940
|
+
function ks({ r: e, g: t, b: n, alpha: r }) {
|
|
2941
|
+
const o = [le(e), le(t), le(n)], s = N(o, $r), [i, a, c] = N(s, ur);
|
|
2942
|
+
return new U(i, a, c, r);
|
|
2943
|
+
}
|
|
2944
|
+
function Ss({ x: e, y: t, z: n, alpha: r }) {
|
|
2945
|
+
const o = N([e, t, n], Oe), s = N(o, ps), [i, a, c] = s.map(as);
|
|
2946
|
+
return new Be(i, a, c, r);
|
|
2947
|
+
}
|
|
2948
|
+
function ys({ r: e, g: t, b: n, alpha: r }) {
|
|
2949
|
+
const o = [ue(e), ue(t), ue(n)], [s, i, a] = N(o, Fr);
|
|
2950
|
+
return new U(s, i, a, r);
|
|
2951
|
+
}
|
|
2952
|
+
function Cs({ x: e, y: t, z: n, alpha: r }) {
|
|
2953
|
+
const o = N([e, t, n], ms), [s, i, a] = o.map(cs);
|
|
2954
|
+
return new Ne(s, i, a, r);
|
|
2955
|
+
}
|
|
2956
|
+
const gn = {
|
|
2957
|
+
rgb: { to: De, from: Ve },
|
|
2958
|
+
hsl: { to: He, from: je },
|
|
2959
|
+
hsv: { to: qo, from: Ko },
|
|
2960
|
+
hwb: { to: Jo, from: Qo },
|
|
2961
|
+
lab: { to: Fe, from: $e },
|
|
2962
|
+
lch: { to: ts, from: es },
|
|
2963
|
+
oklab: { to: We, from: Xe },
|
|
2964
|
+
oklch: { to: ns, from: rs },
|
|
2965
|
+
kelvin: { to: os, from: ss },
|
|
2965
2966
|
xyz: { to: (e) => e, from: (e) => e },
|
|
2966
|
-
"srgb-linear": { to:
|
|
2967
|
-
"display-p3": { to:
|
|
2968
|
-
"a98-rgb": { to:
|
|
2969
|
-
"prophoto-rgb": { to:
|
|
2970
|
-
rec2020: { to:
|
|
2967
|
+
"srgb-linear": { to: hs, from: fs },
|
|
2968
|
+
"display-p3": { to: bs, from: ds },
|
|
2969
|
+
"a98-rgb": { to: gs, from: ws },
|
|
2970
|
+
"prophoto-rgb": { to: ks, from: Ss },
|
|
2971
|
+
rec2020: { to: ys, from: Cs }
|
|
2971
2972
|
};
|
|
2972
|
-
function
|
|
2973
|
+
function pt(e, t) {
|
|
2973
2974
|
if (e.colorSpace === t)
|
|
2974
2975
|
return e;
|
|
2975
|
-
const n =
|
|
2976
|
-
|
|
2977
|
-
}
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
-
|
|
2976
|
+
const n = gn[e.colorSpace];
|
|
2977
|
+
if (!n)
|
|
2978
|
+
throw new Error(`Unknown source color space: "${e.colorSpace}"`);
|
|
2979
|
+
const r = gn[t];
|
|
2980
|
+
if (!r)
|
|
2981
|
+
throw new Error(`Unknown target color space: "${t}"`);
|
|
2982
|
+
const o = n.to(e), s = r.from;
|
|
2983
|
+
return s(o);
|
|
2984
|
+
}
|
|
2985
|
+
const ft = 1e-6;
|
|
2986
|
+
function xs(e) {
|
|
2987
|
+
const t = pt(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;
|
|
2981
2988
|
if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && o >= 0 && o <= 1)
|
|
2982
2989
|
return e;
|
|
2983
|
-
if (n >= -
|
|
2984
|
-
const l = new
|
|
2985
|
-
return
|
|
2990
|
+
if (n >= -ft && n <= 1 + ft && r >= -ft && r <= 1 + ft && o >= -ft && o <= 1 + ft) {
|
|
2991
|
+
const l = new O(v(n, 0, 1), v(r, 0, 1), v(o, 0, 1), e.alpha);
|
|
2992
|
+
return pt(l, e.colorSpace);
|
|
2986
2993
|
}
|
|
2987
|
-
const [s, i, a] =
|
|
2988
|
-
return
|
|
2994
|
+
const [s, i, a] = Po(n, r, o), c = new O(s, i, a, e.alpha);
|
|
2995
|
+
return pt(c, e.colorSpace);
|
|
2989
2996
|
}
|
|
2990
|
-
const
|
|
2997
|
+
const Es = {
|
|
2991
2998
|
hsl: "h",
|
|
2992
2999
|
hsv: "h",
|
|
2993
3000
|
hwb: "h",
|
|
2994
3001
|
lch: "h",
|
|
2995
3002
|
oklch: "h"
|
|
2996
3003
|
};
|
|
2997
|
-
function
|
|
3004
|
+
function Ts(e, t, n, r = "shorter") {
|
|
2998
3005
|
if (Number.isNaN(e) && Number.isNaN(t)) return 0;
|
|
2999
3006
|
if (Number.isNaN(e)) return t;
|
|
3000
3007
|
if (Number.isNaN(t)) return e;
|
|
@@ -3016,40 +3023,40 @@ function Ao(e, t, n, r = "shorter") {
|
|
|
3016
3023
|
let s = e + n * (t - e);
|
|
3017
3024
|
return s = (s % 1 + 1) % 1, s;
|
|
3018
3025
|
}
|
|
3019
|
-
function
|
|
3020
|
-
const i =
|
|
3026
|
+
function As(e, t, n, r, o = "oklab", s = "shorter") {
|
|
3027
|
+
const i = pt(e, o), a = pt(t, o);
|
|
3021
3028
|
n < 0 && (n = 0), r < 0 && (r = 0);
|
|
3022
3029
|
const c = n + r;
|
|
3023
3030
|
c === 0 ? (n = 0.5, r = 0.5) : c !== 1 && (n = n / c, r = r / c);
|
|
3024
|
-
const l = Math.min(c, 1),
|
|
3025
|
-
for (const
|
|
3026
|
-
let
|
|
3027
|
-
if (Number.isNaN(
|
|
3028
|
-
|
|
3031
|
+
const l = Math.min(c, 1), p = Es[o], u = i.keys().filter((A) => A !== "alpha"), f = Number.isNaN(i.alpha) ? a.alpha : i.alpha, C = Number.isNaN(a.alpha) ? i.alpha : a.alpha, y = de(r, f, C) * l, E = [];
|
|
3032
|
+
for (const A of u) {
|
|
3033
|
+
let L = i[A], W = a[A];
|
|
3034
|
+
if (Number.isNaN(L) && Number.isNaN(W)) {
|
|
3035
|
+
E.push(0);
|
|
3029
3036
|
continue;
|
|
3030
3037
|
}
|
|
3031
|
-
if (Number.isNaN(
|
|
3032
|
-
|
|
3038
|
+
if (Number.isNaN(L) && (L = W), Number.isNaN(W) && (W = L), A === p)
|
|
3039
|
+
E.push(Ts(L, W, r, s));
|
|
3033
3040
|
else {
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3041
|
+
const ot = L * f, st = W * C, it = de(r, ot, st);
|
|
3042
|
+
E.push(y > 0 ? it / y : 0);
|
|
3036
3043
|
}
|
|
3037
3044
|
}
|
|
3038
|
-
const
|
|
3039
|
-
return new
|
|
3045
|
+
const w = i.constructor;
|
|
3046
|
+
return new w(...E, y);
|
|
3040
3047
|
}
|
|
3041
|
-
const
|
|
3042
|
-
const r =
|
|
3048
|
+
const Ms = (e, t, n) => {
|
|
3049
|
+
const r = b[t][n];
|
|
3043
3050
|
return r[e] ?? r.number;
|
|
3044
|
-
},
|
|
3045
|
-
t = o ?
|
|
3046
|
-
const { min: s, max: i } =
|
|
3047
|
-
return new
|
|
3048
|
-
},
|
|
3051
|
+
}, Is = (e, t, n, r, o = !1) => {
|
|
3052
|
+
t = o ? lr[n][r] : t;
|
|
3053
|
+
const { min: s, max: i } = Ms(t, n, r), [a, c, l, p] = o ? [s, i, 0, 1] : [0, 1, s, i], u = R(e, l, p, a, c);
|
|
3054
|
+
return new S(u, o ? t : "");
|
|
3055
|
+
}, Rs = (e, t = !1) => {
|
|
3049
3056
|
const n = e.colorSpace;
|
|
3050
3057
|
return e.keys().forEach((r) => {
|
|
3051
|
-
const o = e[r] instanceof
|
|
3052
|
-
e[r] =
|
|
3058
|
+
const o = e[r] instanceof S ? e[r].value : e[r];
|
|
3059
|
+
e[r] = Is(
|
|
3053
3060
|
o,
|
|
3054
3061
|
e[r]?.unit,
|
|
3055
3062
|
n,
|
|
@@ -3057,38 +3064,38 @@ const Ro = (e, t, n) => {
|
|
|
3057
3064
|
t
|
|
3058
3065
|
);
|
|
3059
3066
|
}), e;
|
|
3060
|
-
},
|
|
3067
|
+
}, we = (e, t = !1, n = !1) => {
|
|
3061
3068
|
e = n ? e : e.clone();
|
|
3062
|
-
const r =
|
|
3063
|
-
return n ? e : new
|
|
3064
|
-
},
|
|
3065
|
-
const s = n ? o ? e : e.clone() :
|
|
3069
|
+
const r = Rs(e.value, t);
|
|
3070
|
+
return n ? e : new S(r).coalesce(e, !0);
|
|
3071
|
+
}, wn = (e, t = "lab", n = !1, r = !1, o = !1) => {
|
|
3072
|
+
const s = n ? o ? e : e.clone() : we(e, !1, o), i = pt(s.toJSON(), t);
|
|
3066
3073
|
return i.entries().forEach(([a, c]) => {
|
|
3067
|
-
i[a] = new
|
|
3068
|
-
}), s.value = i, s.superType[1] = t, r ?
|
|
3069
|
-
},
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
],
|
|
3074
|
+
i[a] = new S(c);
|
|
3075
|
+
}), s.value = i, s.superType[1] = t, r ? we(s, !0, !0) : s;
|
|
3076
|
+
}, vs = (e, t, n = "lab", r = !1, o = !1, s = !1) => [
|
|
3077
|
+
wn(e, n, r, o, s),
|
|
3078
|
+
wn(t, n, r, o, s)
|
|
3079
|
+
], G = (e) => new S(
|
|
3073
3080
|
e,
|
|
3074
3081
|
"color",
|
|
3075
3082
|
["color", e.colorSpace],
|
|
3076
3083
|
void 0,
|
|
3077
3084
|
"color"
|
|
3078
3085
|
);
|
|
3079
|
-
function
|
|
3080
|
-
const n =
|
|
3086
|
+
function ke(e) {
|
|
3087
|
+
const n = we(e).value, r = n.clone();
|
|
3081
3088
|
for (const o of n.keys()) {
|
|
3082
3089
|
const s = n[o];
|
|
3083
|
-
r[o] = s instanceof
|
|
3090
|
+
r[o] = s instanceof S ? s.value : s;
|
|
3084
3091
|
}
|
|
3085
3092
|
return r;
|
|
3086
3093
|
}
|
|
3087
|
-
function
|
|
3094
|
+
function Bs(e) {
|
|
3088
3095
|
const t = e.replace(/[^0-9.+\-*/() e]/g, "");
|
|
3089
3096
|
return new Function(`return (${t})`)();
|
|
3090
3097
|
}
|
|
3091
|
-
function
|
|
3098
|
+
function kn(e, t) {
|
|
3092
3099
|
switch (e.type) {
|
|
3093
3100
|
case "ref":
|
|
3094
3101
|
return t[e.name] ?? 0;
|
|
@@ -3101,32 +3108,32 @@ function rn(e, t) {
|
|
|
3101
3108
|
const r = Object.keys(t).sort((o, s) => s.length - o.length);
|
|
3102
3109
|
for (const o of r)
|
|
3103
3110
|
n = n.replace(new RegExp(`\\b${o}\\b`, "g"), String(t[o]));
|
|
3104
|
-
return
|
|
3111
|
+
return Bs(n);
|
|
3105
3112
|
}
|
|
3106
3113
|
}
|
|
3107
3114
|
}
|
|
3108
|
-
function
|
|
3109
|
-
const o =
|
|
3110
|
-
for (const [
|
|
3111
|
-
i[
|
|
3112
|
-
const a = n.map((
|
|
3113
|
-
rgb:
|
|
3114
|
-
hsl:
|
|
3115
|
-
hwb:
|
|
3116
|
-
lab:
|
|
3117
|
-
lch:
|
|
3118
|
-
oklab:
|
|
3119
|
-
oklch:
|
|
3120
|
-
xyz:
|
|
3121
|
-
"srgb-linear":
|
|
3122
|
-
"display-p3":
|
|
3123
|
-
"a98-rgb":
|
|
3124
|
-
"prophoto-rgb":
|
|
3125
|
-
rec2020:
|
|
3126
|
-
}[t] ??
|
|
3127
|
-
return
|
|
3128
|
-
}
|
|
3129
|
-
const
|
|
3115
|
+
function Ns(e, t, n, r) {
|
|
3116
|
+
const o = ke(e), s = pt(o, t), i = {};
|
|
3117
|
+
for (const [f, C] of s.entries())
|
|
3118
|
+
i[f] = C;
|
|
3119
|
+
const a = n.map((f) => kn(f, i)), c = r ? kn(r, i) : i.alpha ?? 1, p = {
|
|
3120
|
+
rgb: O,
|
|
3121
|
+
hsl: yt,
|
|
3122
|
+
hwb: Te,
|
|
3123
|
+
lab: Xt,
|
|
3124
|
+
lch: Ae,
|
|
3125
|
+
oklab: Ht,
|
|
3126
|
+
oklch: Me,
|
|
3127
|
+
xyz: U,
|
|
3128
|
+
"srgb-linear": Ie,
|
|
3129
|
+
"display-p3": Re,
|
|
3130
|
+
"a98-rgb": ve,
|
|
3131
|
+
"prophoto-rgb": Be,
|
|
3132
|
+
rec2020: Ne
|
|
3133
|
+
}[t] ?? O, u = new p(...a, c);
|
|
3134
|
+
return G(u);
|
|
3135
|
+
}
|
|
3136
|
+
const _s = {
|
|
3130
3137
|
srgb: "rgb",
|
|
3131
3138
|
"srgb-linear": "srgb-linear",
|
|
3132
3139
|
"display-p3": "display-p3",
|
|
@@ -3142,352 +3149,352 @@ const Lo = {
|
|
|
3142
3149
|
xyz: "xyz",
|
|
3143
3150
|
"xyz-d65": "xyz",
|
|
3144
3151
|
"xyz-d50": "xyz"
|
|
3145
|
-
},
|
|
3146
|
-
srgb: { space: "rgb", ctor:
|
|
3147
|
-
"srgb-linear": { space: "srgb-linear", ctor:
|
|
3148
|
-
"display-p3": { space: "display-p3", ctor:
|
|
3149
|
-
"a98-rgb": { space: "a98-rgb", ctor:
|
|
3150
|
-
"prophoto-rgb": { space: "prophoto-rgb", ctor:
|
|
3151
|
-
rec2020: { space: "rec2020", ctor:
|
|
3152
|
-
xyz: { space: "xyz", ctor:
|
|
3153
|
-
"xyz-d65": { space: "xyz", ctor:
|
|
3154
|
-
"xyz-d50": { space: "xyz", ctor:
|
|
3155
|
-
},
|
|
3152
|
+
}, Ps = {
|
|
3153
|
+
srgb: { space: "rgb", ctor: O },
|
|
3154
|
+
"srgb-linear": { space: "srgb-linear", ctor: Ie },
|
|
3155
|
+
"display-p3": { space: "display-p3", ctor: Re },
|
|
3156
|
+
"a98-rgb": { space: "a98-rgb", ctor: ve },
|
|
3157
|
+
"prophoto-rgb": { space: "prophoto-rgb", ctor: Be },
|
|
3158
|
+
rec2020: { space: "rec2020", ctor: Ne },
|
|
3159
|
+
xyz: { space: "xyz", ctor: U },
|
|
3160
|
+
"xyz-d65": { space: "xyz", ctor: U },
|
|
3161
|
+
"xyz-d50": { space: "xyz", ctor: U }
|
|
3162
|
+
}, Os = B(","), Ls = D(/\s+/), Yt = B("/"), Zt = B("("), qt = B(")"), Vt = d(Os.trim(g), Ls), Gr = d(Yt.trim(g), Vt), X = x.lazy(() => d(
|
|
3156
3163
|
H.Percentage,
|
|
3157
3164
|
H.Angle.map((e) => {
|
|
3158
|
-
const t =
|
|
3159
|
-
return new
|
|
3165
|
+
const t = _e(e.value, e.unit);
|
|
3166
|
+
return new S(t, "deg", ["angle"]);
|
|
3160
3167
|
}),
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
)),
|
|
3168
|
+
d(et, go).map((e) => new S(e)),
|
|
3169
|
+
Pe.map(() => new S(NaN))
|
|
3170
|
+
)), Mt = d(
|
|
3164
3171
|
// calc(...)
|
|
3165
|
-
|
|
3166
|
-
|
|
3172
|
+
m("calc").next(
|
|
3173
|
+
D(/\(([^)]+)\)/, (e) => e?.[1] ?? null)
|
|
3167
3174
|
).map((e) => ({ type: "calc", expr: e })),
|
|
3168
3175
|
// none
|
|
3169
|
-
|
|
3176
|
+
Pe.map(() => ({ type: "none" })),
|
|
3170
3177
|
// component reference (alpha must be tried before single 'a')
|
|
3171
|
-
|
|
3178
|
+
D(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(
|
|
3172
3179
|
(e) => ({ type: "ref", name: e })
|
|
3173
3180
|
),
|
|
3174
3181
|
// literal number / percentage / angle
|
|
3175
|
-
|
|
3176
|
-
),
|
|
3177
|
-
const t =
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
), r =
|
|
3181
|
-
|
|
3182
|
-
|
|
3182
|
+
X.map((e) => ({ type: "literal", value: e.value }))
|
|
3183
|
+
), q = (e) => {
|
|
3184
|
+
const t = B(e).skip(m("a").opt()), n = d(
|
|
3185
|
+
I(X.skip(Gr), X),
|
|
3186
|
+
X.map((o) => [o])
|
|
3187
|
+
), r = I(
|
|
3188
|
+
X.skip(Vt),
|
|
3189
|
+
X.skip(Vt),
|
|
3183
3190
|
n
|
|
3184
|
-
).trim(g).wrap(
|
|
3185
|
-
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new
|
|
3191
|
+
).trim(g).wrap(Zt, qt);
|
|
3192
|
+
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new S(1)]);
|
|
3186
3193
|
};
|
|
3187
|
-
function
|
|
3188
|
-
return
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
g.next(
|
|
3192
|
-
g.next(
|
|
3193
|
-
g.next(
|
|
3194
|
-
|
|
3195
|
-
).trim(g).wrap(
|
|
3196
|
-
).map(([n, r, o, s, i]) =>
|
|
3197
|
-
}
|
|
3198
|
-
const
|
|
3199
|
-
const { r: t, g: n, b: r, alpha: o } =
|
|
3200
|
-
return
|
|
3201
|
-
}),
|
|
3202
|
-
const t =
|
|
3203
|
-
return
|
|
3204
|
-
}),
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
([e, t, n, r]) =>
|
|
3194
|
+
function rt(e, t) {
|
|
3195
|
+
return B(e).skip(m("a").opt()).next(
|
|
3196
|
+
I(
|
|
3197
|
+
m("from").skip(g).next(x.lazy(() => Ye.Value)),
|
|
3198
|
+
g.next(Mt),
|
|
3199
|
+
g.next(Mt),
|
|
3200
|
+
g.next(Mt),
|
|
3201
|
+
Yt.trim(g).next(Mt).opt()
|
|
3202
|
+
).trim(g).wrap(Zt, qt)
|
|
3203
|
+
).map(([n, r, o, s, i]) => Ns(n, t, [r, o, s], i));
|
|
3204
|
+
}
|
|
3205
|
+
const zs = D(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
3206
|
+
const { r: t, g: n, b: r, alpha: o } = Oo(e);
|
|
3207
|
+
return G(new O(t, n, r, o));
|
|
3208
|
+
}), $s = et.skip(m("k")).map((e) => {
|
|
3209
|
+
const t = Sr(new nr(e));
|
|
3210
|
+
return G(t);
|
|
3211
|
+
}), Fs = d(
|
|
3212
|
+
rt("rgb", "rgb"),
|
|
3213
|
+
q("rgb").map(
|
|
3214
|
+
([e, t, n, r]) => G(new O(e, t, n, r))
|
|
3208
3215
|
)
|
|
3209
|
-
),
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
([e, t, n, r]) =>
|
|
3216
|
+
), Gs = d(
|
|
3217
|
+
rt("hsl", "hsl"),
|
|
3218
|
+
q("hsl").map(
|
|
3219
|
+
([e, t, n, r]) => G(new yt(e, t, n, r))
|
|
3213
3220
|
)
|
|
3214
|
-
),
|
|
3215
|
-
([e, t, n, r]) =>
|
|
3216
|
-
),
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
([e, t, n, r]) =>
|
|
3221
|
+
), Us = q("hsv").map(
|
|
3222
|
+
([e, t, n, r]) => G(new Ee(e, t, n, r))
|
|
3223
|
+
), Ds = d(
|
|
3224
|
+
rt("hwb", "hwb"),
|
|
3225
|
+
q("hwb").map(
|
|
3226
|
+
([e, t, n, r]) => G(new Te(e, t, n, r))
|
|
3220
3227
|
)
|
|
3221
|
-
),
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
([e, t, n, r]) =>
|
|
3228
|
+
), Vs = d(
|
|
3229
|
+
rt("lab", "lab"),
|
|
3230
|
+
q("lab").map(
|
|
3231
|
+
([e, t, n, r]) => G(new Xt(e, t, n, r))
|
|
3225
3232
|
)
|
|
3226
|
-
),
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
([e, t, n, r]) =>
|
|
3233
|
+
), Ws = d(
|
|
3234
|
+
rt("lch", "lch"),
|
|
3235
|
+
q("lch").map(
|
|
3236
|
+
([e, t, n, r]) => G(new Ae(e, t, n, r))
|
|
3230
3237
|
)
|
|
3231
|
-
),
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
([e, t, n, r]) =>
|
|
3238
|
+
), Xs = d(
|
|
3239
|
+
rt("oklab", "oklab"),
|
|
3240
|
+
q("oklab").map(
|
|
3241
|
+
([e, t, n, r]) => G(new Ht(e, t, n, r))
|
|
3235
3242
|
)
|
|
3236
|
-
),
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
([e, t, n, r]) =>
|
|
3243
|
+
), Hs = d(
|
|
3244
|
+
rt("oklch", "oklch"),
|
|
3245
|
+
q("oklch").map(
|
|
3246
|
+
([e, t, n, r]) => G(new Me(e, t, n, r))
|
|
3240
3247
|
)
|
|
3241
|
-
),
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
([e, t, n, r]) =>
|
|
3248
|
+
), js = d(
|
|
3249
|
+
rt("xyz", "xyz"),
|
|
3250
|
+
q("xyz").map(
|
|
3251
|
+
([e, t, n, r]) => G(new U(e, t, n, r))
|
|
3245
3252
|
)
|
|
3246
|
-
),
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
),
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
).skip(g).skip(
|
|
3268
|
-
() =>
|
|
3269
|
-
|
|
3253
|
+
), Ys = d(
|
|
3254
|
+
m("srgb-linear").map(() => "srgb-linear"),
|
|
3255
|
+
m("srgb").map(() => "srgb"),
|
|
3256
|
+
m("display-p3").map(() => "display-p3"),
|
|
3257
|
+
m("a98-rgb").map(() => "a98-rgb"),
|
|
3258
|
+
m("prophoto-rgb").map(() => "prophoto-rgb"),
|
|
3259
|
+
m("rec2020").map(() => "rec2020"),
|
|
3260
|
+
m("oklab").map(() => "oklab"),
|
|
3261
|
+
m("oklch").map(() => "oklch"),
|
|
3262
|
+
m("lab").map(() => "lab"),
|
|
3263
|
+
m("lch").map(() => "lch"),
|
|
3264
|
+
m("hsl").map(() => "hsl"),
|
|
3265
|
+
m("hwb").map(() => "hwb"),
|
|
3266
|
+
m("xyz-d65").map(() => "xyz-d65"),
|
|
3267
|
+
m("xyz-d50").map(() => "xyz-d50"),
|
|
3268
|
+
m("xyz").map(() => "xyz")
|
|
3269
|
+
), Zs = d(
|
|
3270
|
+
m("shorter"),
|
|
3271
|
+
m("longer"),
|
|
3272
|
+
m("increasing"),
|
|
3273
|
+
m("decreasing")
|
|
3274
|
+
).skip(g).skip(m("hue")), Sn = x.lazy(
|
|
3275
|
+
() => I(
|
|
3276
|
+
Ye.Value,
|
|
3270
3277
|
g.next(H.Percentage).opt()
|
|
3271
3278
|
)
|
|
3272
|
-
),
|
|
3273
|
-
|
|
3279
|
+
), qs = m("color-mix").next(
|
|
3280
|
+
I(
|
|
3274
3281
|
// "in <space> [<hueMethod>]"
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
g.next(
|
|
3282
|
+
m("in").skip(g).next(
|
|
3283
|
+
I(
|
|
3284
|
+
Ys,
|
|
3285
|
+
g.next(Zs).opt()
|
|
3279
3286
|
)
|
|
3280
3287
|
),
|
|
3281
3288
|
// ", <color> [<pct>]?"
|
|
3282
|
-
|
|
3289
|
+
B(",").trim(g).next(Sn),
|
|
3283
3290
|
// ", <color> [<pct>]?"
|
|
3284
|
-
|
|
3285
|
-
).trim(g).wrap(
|
|
3291
|
+
B(",").trim(g).next(Sn)
|
|
3292
|
+
).trim(g).wrap(Zt, qt)
|
|
3286
3293
|
).map(([[e, t], [n, r], [o, s]]) => {
|
|
3287
|
-
const i =
|
|
3294
|
+
const i = _s[e] ?? "oklab", a = t ?? "shorter";
|
|
3288
3295
|
let c = r != null ? r.value / 100 : -1, l = s != null ? s.value / 100 : -1;
|
|
3289
3296
|
c < 0 && l < 0 ? (c = 0.5, l = 0.5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c);
|
|
3290
|
-
const
|
|
3291
|
-
return
|
|
3292
|
-
}),
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
),
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3297
|
+
const p = ke(n), u = ke(o), f = As(p, u, c, l, i, a);
|
|
3298
|
+
return G(f);
|
|
3299
|
+
}), Ks = d(
|
|
3300
|
+
m("srgb-linear").map(() => "srgb-linear"),
|
|
3301
|
+
m("srgb").map(() => "srgb"),
|
|
3302
|
+
m("display-p3").map(() => "display-p3"),
|
|
3303
|
+
m("a98-rgb").map(() => "a98-rgb"),
|
|
3304
|
+
m("prophoto-rgb").map(() => "prophoto-rgb"),
|
|
3305
|
+
m("rec2020").map(() => "rec2020"),
|
|
3306
|
+
m("xyz-d65").map(() => "xyz-d65"),
|
|
3307
|
+
m("xyz-d50").map(() => "xyz-d50"),
|
|
3308
|
+
m("xyz").map(() => "xyz")
|
|
3309
|
+
), Js = m("color").next(
|
|
3310
|
+
I(
|
|
3311
|
+
Ks.skip(g),
|
|
3312
|
+
X.skip(g),
|
|
3313
|
+
X.skip(g),
|
|
3314
|
+
d(
|
|
3315
|
+
I(
|
|
3316
|
+
X.skip(Yt.trim(g)),
|
|
3317
|
+
X
|
|
3311
3318
|
),
|
|
3312
|
-
|
|
3319
|
+
X.map((e) => [e, void 0])
|
|
3313
3320
|
)
|
|
3314
|
-
).trim(g).wrap(
|
|
3321
|
+
).trim(g).wrap(Zt, qt)
|
|
3315
3322
|
).map(([e, t, n, [r, o]]) => {
|
|
3316
|
-
const s =
|
|
3323
|
+
const s = Ps[e];
|
|
3317
3324
|
if (!s)
|
|
3318
3325
|
throw new Error(`Unknown color() space: ${e}`);
|
|
3319
|
-
const i = o ?? new
|
|
3326
|
+
const i = o ?? new S(1);
|
|
3320
3327
|
if (e === "srgb") {
|
|
3321
3328
|
const c = (l) => l.value * 255;
|
|
3322
|
-
return
|
|
3329
|
+
return G(new O(c(t), c(n), c(r), i.value));
|
|
3323
3330
|
}
|
|
3324
3331
|
const a = new s.ctor(t, n, r, i);
|
|
3325
|
-
return
|
|
3326
|
-
}),
|
|
3327
|
-
...Object.keys(
|
|
3332
|
+
return G(a);
|
|
3333
|
+
}), Qs = d(
|
|
3334
|
+
...Object.keys(dn).sort((e, t) => t.length - e.length).map(m)
|
|
3328
3335
|
).chain((e) => {
|
|
3329
|
-
const t =
|
|
3336
|
+
const t = dn[e.toLowerCase()];
|
|
3330
3337
|
if (t) {
|
|
3331
|
-
const n =
|
|
3338
|
+
const n = Yr(t);
|
|
3332
3339
|
if (n)
|
|
3333
|
-
return
|
|
3334
|
-
}
|
|
3335
|
-
return
|
|
3336
|
-
}),
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
).trim(g),
|
|
3352
|
-
Value:
|
|
3353
|
-
colorValue:
|
|
3354
|
-
componentExpr:
|
|
3355
|
-
sep:
|
|
3356
|
-
alphaSep:
|
|
3357
|
-
div:
|
|
3340
|
+
return wo(n);
|
|
3341
|
+
}
|
|
3342
|
+
return ko();
|
|
3343
|
+
}), Ur = d(
|
|
3344
|
+
qs,
|
|
3345
|
+
Js,
|
|
3346
|
+
zs,
|
|
3347
|
+
$s,
|
|
3348
|
+
Fs,
|
|
3349
|
+
Gs,
|
|
3350
|
+
Us,
|
|
3351
|
+
Ds,
|
|
3352
|
+
Vs,
|
|
3353
|
+
Ws,
|
|
3354
|
+
Xs,
|
|
3355
|
+
Hs,
|
|
3356
|
+
js,
|
|
3357
|
+
Qs
|
|
3358
|
+
).trim(g), Ye = {
|
|
3359
|
+
Value: Ur,
|
|
3360
|
+
colorValue: X,
|
|
3361
|
+
componentExpr: Mt,
|
|
3362
|
+
sep: Vt,
|
|
3363
|
+
alphaSep: Gr,
|
|
3364
|
+
div: Yt
|
|
3358
3365
|
};
|
|
3359
|
-
function
|
|
3360
|
-
return
|
|
3366
|
+
function Ia(e) {
|
|
3367
|
+
return Bt(Ur, e);
|
|
3361
3368
|
}
|
|
3362
|
-
const
|
|
3369
|
+
const ti = d(...Pt.map(m)), ei = d(...Lt.map(m)), ni = d(...Ot.map(m)), ri = d(...zt.map(m)), oi = d(...er.map(m)), si = B(","), ii = B(" "), ai = d(si, ii).trim(g), Dr = I(et, ti).map(([e, t]) => {
|
|
3363
3370
|
const n = ["length"];
|
|
3364
|
-
return
|
|
3365
|
-
}),
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
).map(([e, t]) => new
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3371
|
+
return tr.includes(t) ? n.push("relative") : Qn.includes(t) && n.push("absolute"), new S(e, t, n);
|
|
3372
|
+
}), Vr = I(et, ei).map(([e, t]) => new S(e, t, ["angle"])), Ze = I(et, ni).map(([e, t]) => new S(e, t, ["time"])), ci = x.lazy(() => d(qe, Ze)), Wr = I(et, ri).map(([e, t]) => new S(e, t, ["resolution"])), qe = d(
|
|
3373
|
+
I(et, oi),
|
|
3374
|
+
m("from").map(() => [0, "%"]),
|
|
3375
|
+
m("to").map(() => [100, "%"])
|
|
3376
|
+
).map(([e, t]) => new S(e, t, ["percentage"])), Xr = x.lazy(() => Ye.Value), Hr = B("/").trim(g).map(() => new S("/", "string")), jr = d(
|
|
3377
|
+
Dr,
|
|
3378
|
+
Vr,
|
|
3379
|
+
Ze,
|
|
3380
|
+
Wr,
|
|
3381
|
+
qe,
|
|
3382
|
+
Xr,
|
|
3383
|
+
Hr,
|
|
3384
|
+
et.map((e) => new S(e)),
|
|
3385
|
+
Pe.map(() => new S(NaN))
|
|
3379
3386
|
).trim(g), H = {
|
|
3380
|
-
Length:
|
|
3381
|
-
Angle:
|
|
3382
|
-
Time:
|
|
3383
|
-
TimePercentage:
|
|
3384
|
-
Resolution:
|
|
3385
|
-
Percentage:
|
|
3386
|
-
Color:
|
|
3387
|
-
Slash:
|
|
3388
|
-
Value:
|
|
3389
|
-
sep:
|
|
3387
|
+
Length: Dr,
|
|
3388
|
+
Angle: Vr,
|
|
3389
|
+
Time: Ze,
|
|
3390
|
+
TimePercentage: ci,
|
|
3391
|
+
Resolution: Wr,
|
|
3392
|
+
Percentage: qe,
|
|
3393
|
+
Color: Xr,
|
|
3394
|
+
Slash: Hr,
|
|
3395
|
+
Value: jr,
|
|
3396
|
+
sep: ai
|
|
3390
3397
|
};
|
|
3391
|
-
function
|
|
3392
|
-
return
|
|
3393
|
-
}
|
|
3394
|
-
const
|
|
3395
|
-
() =>
|
|
3396
|
-
),
|
|
3397
|
-
e ||
|
|
3398
|
-
|
|
3399
|
-
),
|
|
3400
|
-
const e =
|
|
3401
|
-
return
|
|
3402
|
-
},
|
|
3403
|
-
const e =
|
|
3404
|
-
() =>
|
|
3405
|
-
|
|
3406
|
-
e.many(1).wrap(
|
|
3398
|
+
function Yr(e) {
|
|
3399
|
+
return Bt(jr, e);
|
|
3400
|
+
}
|
|
3401
|
+
const kt = B("("), St = B(")"), Se = B(","), Zr = x.lazy(
|
|
3402
|
+
() => Qe.sepBy(d(Se, g)).trim(g).map((e) => new vt(...e))
|
|
3403
|
+
), Ke = (e) => I(
|
|
3404
|
+
e || bo,
|
|
3405
|
+
Zr.wrap(kt, St)
|
|
3406
|
+
), li = () => {
|
|
3407
|
+
const e = D(/[^)]+/);
|
|
3408
|
+
return B("var").next(e.trim(g).wrap(kt, St)).map((t) => new S(t, "var"));
|
|
3409
|
+
}, ui = () => {
|
|
3410
|
+
const e = x.lazy(
|
|
3411
|
+
() => d(
|
|
3412
|
+
D(/[^()]+/),
|
|
3413
|
+
e.many(1).wrap(kt, St).map((t) => `(${t.join(" ")})`)
|
|
3407
3414
|
).many(1)
|
|
3408
3415
|
);
|
|
3409
|
-
return
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
e.wrap(
|
|
3416
|
+
return B("calc").next(
|
|
3417
|
+
d(
|
|
3418
|
+
x.lazy(() => Qe).trim(g).wrap(kt, St),
|
|
3419
|
+
e.wrap(kt, St).map((t) => t.join(" "))
|
|
3413
3420
|
)
|
|
3414
|
-
).map((t) => t instanceof
|
|
3415
|
-
},
|
|
3416
|
-
const e =
|
|
3417
|
-
|
|
3418
|
-
|
|
3421
|
+
).map((t) => t instanceof S ? t : new S(t, "calc"));
|
|
3422
|
+
}, pi = ["translate", "scale", "rotate", "skew"], ye = ["x", "y", "z"], mi = ye.map(m), hi = pi.map(m), fi = () => {
|
|
3423
|
+
const e = I(
|
|
3424
|
+
d(...hi),
|
|
3425
|
+
d(...mi, B(""))
|
|
3419
3426
|
), t = (r, o) => r + o.toUpperCase();
|
|
3420
|
-
return
|
|
3427
|
+
return Ke(e).map(([[r, o], s]) => {
|
|
3421
3428
|
const i = r.toLowerCase(), a = {};
|
|
3422
3429
|
if (o) {
|
|
3423
3430
|
const l = i + o.toUpperCase();
|
|
3424
3431
|
a[l] = s[0];
|
|
3425
|
-
} else s.length === 1 ?
|
|
3426
|
-
const
|
|
3427
|
-
a[
|
|
3428
|
-
}) : s.forEach((l,
|
|
3429
|
-
const u = t(i,
|
|
3432
|
+
} else s.length === 1 ? ye.forEach((l) => {
|
|
3433
|
+
const p = t(i, l);
|
|
3434
|
+
a[p] = s[0];
|
|
3435
|
+
}) : s.forEach((l, p) => {
|
|
3436
|
+
const u = t(i, ye[p]);
|
|
3430
3437
|
a[u] = l;
|
|
3431
3438
|
});
|
|
3432
|
-
const c = Object.entries(a).map(([l,
|
|
3433
|
-
return new
|
|
3439
|
+
const c = Object.entries(a).map(([l, p]) => new mt(l, [p]));
|
|
3440
|
+
return new vt(...c);
|
|
3434
3441
|
});
|
|
3435
|
-
},
|
|
3442
|
+
}, bi = {
|
|
3436
3443
|
left: "270",
|
|
3437
3444
|
right: "90",
|
|
3438
3445
|
top: "0",
|
|
3439
3446
|
bottom: "180"
|
|
3440
|
-
},
|
|
3441
|
-
const e =
|
|
3442
|
-
|
|
3443
|
-
|
|
3447
|
+
}, di = () => {
|
|
3448
|
+
const e = d(...["linear-gradient", "radial-gradient"].map(m)), t = I(
|
|
3449
|
+
B("to").skip(g),
|
|
3450
|
+
d(...["left", "right", "top", "bottom"].map(m))
|
|
3444
3451
|
).map(([, a]) => {
|
|
3445
|
-
const c =
|
|
3446
|
-
return new
|
|
3447
|
-
}), n =
|
|
3452
|
+
const c = bi[a.toLowerCase()];
|
|
3453
|
+
return new S(c, "deg");
|
|
3454
|
+
}), n = d(H.Angle, t), r = d(H.Length, H.Percentage), o = I(
|
|
3448
3455
|
H.Color,
|
|
3449
3456
|
r.sepBy(g)
|
|
3450
|
-
).map(([a, c]) => !c || c.length === 0 ? [a] : [a, ...c]), s =
|
|
3457
|
+
).map(([a, c]) => !c || c.length === 0 ? [a] : [a, ...c]), s = I(
|
|
3451
3458
|
o,
|
|
3452
|
-
|
|
3459
|
+
Se.trim(g).next(d(o, r)).many()
|
|
3453
3460
|
).map(([a, c]) => [a, ...c]);
|
|
3454
|
-
return
|
|
3461
|
+
return I(
|
|
3455
3462
|
e,
|
|
3456
|
-
|
|
3457
|
-
).map(([a, c]) => new
|
|
3458
|
-
},
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
),
|
|
3466
|
-
Function:
|
|
3467
|
-
Value:
|
|
3468
|
-
FunctionArgs:
|
|
3469
|
-
},
|
|
3463
|
+
I(n.skip(Se).opt(), s).trim(g).wrap(kt, St).map(([a, c]) => a ? [a, ...c].flat() : [c])
|
|
3464
|
+
).map(([a, c]) => new mt(a, c));
|
|
3465
|
+
}, gi = () => Ke(B("cubic-bezier")).map((e) => new mt("cubic-bezier", e[1])), qr = D(/[^\(\)\{\}\s,;]+/).map((e) => new S(e)), Je = d(
|
|
3466
|
+
fi(),
|
|
3467
|
+
li(),
|
|
3468
|
+
ui(),
|
|
3469
|
+
di(),
|
|
3470
|
+
gi(),
|
|
3471
|
+
Ke().map(([e, t]) => new mt(e, t))
|
|
3472
|
+
), Qe = d(H.Value, Je, qr).trim(g), Ra = {
|
|
3473
|
+
Function: Je,
|
|
3474
|
+
Value: Qe,
|
|
3475
|
+
FunctionArgs: Zr
|
|
3476
|
+
}, wi = I(B("{"), D(/[^{}]+/), B("}")).map(
|
|
3470
3477
|
(e) => {
|
|
3471
3478
|
const t = e.join(`
|
|
3472
3479
|
`);
|
|
3473
3480
|
let n = JSON.parse(t);
|
|
3474
|
-
return new
|
|
3475
|
-
}
|
|
3476
|
-
),
|
|
3477
|
-
Value:
|
|
3478
|
-
Values:
|
|
3479
|
-
},
|
|
3480
|
-
(e) =>
|
|
3481
|
-
),
|
|
3481
|
+
return new S(n, "json");
|
|
3482
|
+
}
|
|
3483
|
+
), Ce = d(H.Value, Je, wi, qr).trim(g), va = {
|
|
3484
|
+
Value: Ce,
|
|
3485
|
+
Values: Ce.sepBy(g)
|
|
3486
|
+
}, ki = Wt((e) => Bt(Ce, e)), Ba = Wt(
|
|
3487
|
+
(e) => Bt(H.Percentage, String(e)).valueOf()
|
|
3488
|
+
), Na = Wt((e) => Bt(
|
|
3482
3489
|
H.Time.map((t) => t.unit === "ms" ? t.value : t.unit === "s" ? t.value * 1e3 : t.value),
|
|
3483
3490
|
e
|
|
3484
|
-
)),
|
|
3491
|
+
)), _a = Wt(
|
|
3485
3492
|
(e, t) => (() => {
|
|
3486
3493
|
if (!t)
|
|
3487
3494
|
return e;
|
|
3488
3495
|
if (e.unit === "var") {
|
|
3489
3496
|
const o = getComputedStyle(t).getPropertyValue(e.value);
|
|
3490
|
-
return
|
|
3497
|
+
return Yr(o);
|
|
3491
3498
|
}
|
|
3492
3499
|
if (e.unit === "calc" && e.property && e.subProperty && e.value && t) {
|
|
3493
3500
|
const o = e.property, s = t.style[o], i = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
|
|
@@ -3496,13 +3503,13 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3496
3503
|
o
|
|
3497
3504
|
);
|
|
3498
3505
|
t.style[o] = s;
|
|
3499
|
-
const c =
|
|
3500
|
-
if (c instanceof
|
|
3506
|
+
const c = ki(a);
|
|
3507
|
+
if (c instanceof S)
|
|
3501
3508
|
return c;
|
|
3502
3509
|
if (c.name.startsWith("matrix")) {
|
|
3503
|
-
const
|
|
3504
|
-
if (
|
|
3505
|
-
return new
|
|
3510
|
+
const p = lo(c)[e.subProperty];
|
|
3511
|
+
if (p != null)
|
|
3512
|
+
return new S(p, "px", [
|
|
3506
3513
|
"length",
|
|
3507
3514
|
"absolute"
|
|
3508
3515
|
]);
|
|
@@ -3511,29 +3518,29 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3511
3518
|
return e;
|
|
3512
3519
|
})().coalesce(e),
|
|
3513
3520
|
{ keyFn: (e, t) => `${e.toString()}-${JSON.stringify(t)}` }
|
|
3514
|
-
),
|
|
3521
|
+
), Si = (e, t, n = !1) => {
|
|
3515
3522
|
if (e?.superType?.[0] !== t?.superType?.[0])
|
|
3516
3523
|
return n ? [e, t] : [e.clone(), t.clone()];
|
|
3517
3524
|
const r = (i) => {
|
|
3518
3525
|
switch (i?.superType?.[0]) {
|
|
3519
3526
|
case "length":
|
|
3520
3527
|
return {
|
|
3521
|
-
value:
|
|
3528
|
+
value: rr(i.value, i.unit, i.targets?.[0]),
|
|
3522
3529
|
unit: "px"
|
|
3523
3530
|
};
|
|
3524
3531
|
case "angle":
|
|
3525
3532
|
return {
|
|
3526
|
-
value:
|
|
3533
|
+
value: _e(i.value, i.unit),
|
|
3527
3534
|
unit: "deg"
|
|
3528
3535
|
};
|
|
3529
3536
|
case "time":
|
|
3530
3537
|
return {
|
|
3531
|
-
value:
|
|
3538
|
+
value: or(i.value, i.unit),
|
|
3532
3539
|
unit: "ms"
|
|
3533
3540
|
};
|
|
3534
3541
|
case "resolution":
|
|
3535
3542
|
return {
|
|
3536
|
-
value:
|
|
3543
|
+
value: sr(i.value, i.unit),
|
|
3537
3544
|
unit: "dpi"
|
|
3538
3545
|
};
|
|
3539
3546
|
default:
|
|
@@ -3541,7 +3548,7 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3541
3548
|
}
|
|
3542
3549
|
}, [o, s] = [r(e), r(t)];
|
|
3543
3550
|
return n ? (e.value = o.value, e.unit = o.unit, t.value = s.value, t.unit = s.unit, [e, t]) : [
|
|
3544
|
-
new
|
|
3551
|
+
new S(
|
|
3545
3552
|
o.value,
|
|
3546
3553
|
o.unit,
|
|
3547
3554
|
e.superType,
|
|
@@ -3549,7 +3556,7 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3549
3556
|
e.property,
|
|
3550
3557
|
e.targets
|
|
3551
3558
|
),
|
|
3552
|
-
new
|
|
3559
|
+
new S(
|
|
3553
3560
|
s.value,
|
|
3554
3561
|
s.unit,
|
|
3555
3562
|
t.superType,
|
|
@@ -3559,15 +3566,15 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3559
3566
|
)
|
|
3560
3567
|
];
|
|
3561
3568
|
};
|
|
3562
|
-
function
|
|
3569
|
+
function Pa(e, t) {
|
|
3563
3570
|
e = e.coalesce(t, !0), t = t.coalesce(e, !0);
|
|
3564
3571
|
const n = {
|
|
3565
3572
|
start: e,
|
|
3566
3573
|
stop: t,
|
|
3567
3574
|
value: e.clone()
|
|
3568
3575
|
};
|
|
3569
|
-
if (
|
|
3570
|
-
const [r, o] =
|
|
3576
|
+
if (be(e) && be(t)) {
|
|
3577
|
+
const [r, o] = vs(
|
|
3571
3578
|
e,
|
|
3572
3579
|
t,
|
|
3573
3580
|
"lab",
|
|
@@ -3576,206 +3583,584 @@ function ci(e, t) {
|
|
|
3576
3583
|
n.start = r, n.stop = o, n.value = r.clone();
|
|
3577
3584
|
}
|
|
3578
3585
|
if (e.unit !== t.unit) {
|
|
3579
|
-
const [r, o] =
|
|
3586
|
+
const [r, o] = Si(
|
|
3580
3587
|
e,
|
|
3581
3588
|
t,
|
|
3582
3589
|
!0
|
|
3583
3590
|
);
|
|
3584
3591
|
n.start = r, n.stop = o, n.value = r.clone();
|
|
3585
3592
|
}
|
|
3586
|
-
return n.computed =
|
|
3593
|
+
return n.computed = fe.includes(e.unit) || fe.includes(t.unit), n;
|
|
3594
|
+
}
|
|
3595
|
+
function yi(e) {
|
|
3596
|
+
const t = (n, r = 1) => Math.round(e[n] * r);
|
|
3597
|
+
return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
|
|
3598
|
+
}
|
|
3599
|
+
const tn = (e) => [e.r, e.g, e.b], Kt = (e, t, n) => new O(e, t, n), Ci = (e, t, n) => new yt(e, t, n), Kr = (e) => {
|
|
3600
|
+
const t = xr(e);
|
|
3601
|
+
return Ci(t.h, t.s, t.l);
|
|
3602
|
+
}, xi = 1, Ei = 1 / 6, Ti = 5, Ai = 15, Mi = 100, Ii = 7500, Ri = 200, pe = 360, vi = 50, Bi = 20, Ni = 3750, _i = 50, Pi = 100, Oi = 100, K = 0.2126, J = 0.7152, Q = 0.0722;
|
|
3603
|
+
function Li(e, t = 0) {
|
|
3604
|
+
const n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180), o = [
|
|
3605
|
+
K + r * (1 - K) - n * K,
|
|
3606
|
+
J - r * J - n * J,
|
|
3607
|
+
Q - r * Q + n * (1 - Q),
|
|
3608
|
+
K - r * K + n * 0.143,
|
|
3609
|
+
J + r * (1 - J) + n * 0.14,
|
|
3610
|
+
Q - r * Q - n * 0.283,
|
|
3611
|
+
K - r * K - n * (1 - K),
|
|
3612
|
+
J - r * J + n * J,
|
|
3613
|
+
Q + r * (1 - Q) + n * Q
|
|
3614
|
+
];
|
|
3615
|
+
return en(e, o);
|
|
3616
|
+
}
|
|
3617
|
+
const yn = 0.393, Cn = 0.769, xn = 0.189, En = 0.349, Tn = 0.686, An = 0.168, Mn = 0.272, In = 0.534, Rn = 0.131;
|
|
3618
|
+
function zi(e, t = 1) {
|
|
3619
|
+
const n = [
|
|
3620
|
+
yn + (1 - yn) * (1 - t),
|
|
3621
|
+
Cn - Cn * (1 - t),
|
|
3622
|
+
xn - xn * (1 - t),
|
|
3623
|
+
En - En * (1 - t),
|
|
3624
|
+
Tn + (1 - Tn) * (1 - t),
|
|
3625
|
+
An - An * (1 - t),
|
|
3626
|
+
Mn - Mn * (1 - t),
|
|
3627
|
+
In - In * (1 - t),
|
|
3628
|
+
Rn + (1 - Rn) * (1 - t)
|
|
3629
|
+
];
|
|
3630
|
+
return en(e, n);
|
|
3631
|
+
}
|
|
3632
|
+
const bt = 0.213, dt = 0.715, gt = 0.072;
|
|
3633
|
+
function $i(e, t = 1) {
|
|
3634
|
+
const n = [
|
|
3635
|
+
bt + (1 - bt) * t,
|
|
3636
|
+
dt - dt * t,
|
|
3637
|
+
gt - gt * t,
|
|
3638
|
+
bt - bt * t,
|
|
3639
|
+
dt + (1 - dt) * t,
|
|
3640
|
+
gt - gt * t,
|
|
3641
|
+
bt - bt * t,
|
|
3642
|
+
dt - dt * t,
|
|
3643
|
+
gt + (1 - gt) * t
|
|
3644
|
+
];
|
|
3645
|
+
return en(e, n);
|
|
3646
|
+
}
|
|
3647
|
+
function en(e, t) {
|
|
3648
|
+
const n = N(tn(e), t);
|
|
3649
|
+
return Kt(v(n[0], 0, 255), v(n[1], 0, 255), v(n[2], 0, 255));
|
|
3650
|
+
}
|
|
3651
|
+
function Fi(e, t = 1) {
|
|
3652
|
+
return Jr(e, t);
|
|
3653
|
+
}
|
|
3654
|
+
function Gi(e, t = 1) {
|
|
3655
|
+
return Jr(e, t, -(0.5 * t) + 0.5);
|
|
3656
|
+
}
|
|
3657
|
+
function Jr(e, t = 1, n = 0) {
|
|
3658
|
+
const r = tn(e);
|
|
3659
|
+
return Kt(
|
|
3660
|
+
v(r[0] * t + n * 255, 0, 255),
|
|
3661
|
+
v(r[1] * t + n * 255, 0, 255),
|
|
3662
|
+
v(r[2] * t + n * 255, 0, 255)
|
|
3663
|
+
);
|
|
3664
|
+
}
|
|
3665
|
+
function Ui(e, t = 1) {
|
|
3666
|
+
const n = tn(e);
|
|
3667
|
+
return Kt(
|
|
3668
|
+
v((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
3669
|
+
v((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
3670
|
+
v((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255)
|
|
3671
|
+
);
|
|
3672
|
+
}
|
|
3673
|
+
function me(e, t, n) {
|
|
3674
|
+
let r = Kt(0, 0, 0);
|
|
3675
|
+
r = Ui(r, e[0] / 100), r = zi(r, e[1] / 100), r = $i(r, e[2] / 100), r = Li(r, e[3] * 3.6), r = Fi(r, e[4] / 100), r = Gi(r, e[5] / 100);
|
|
3676
|
+
const o = Kr(r);
|
|
3677
|
+
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);
|
|
3678
|
+
}
|
|
3679
|
+
function Qr(e, t, n, r, o, s, i) {
|
|
3680
|
+
let a = null, c = 1 / 0;
|
|
3681
|
+
const l = new Array(6), p = new Array(6), u = new Array(6);
|
|
3682
|
+
for (let f = 0; f < o; f++) {
|
|
3683
|
+
const C = n / Math.pow(f + 1, Ei);
|
|
3684
|
+
for (let w = 0; w < 6; w++)
|
|
3685
|
+
l[w] = Math.random() > 0.5 ? 1 : -1, p[w] = r[w] + C * l[w], u[w] = r[w] - C * l[w];
|
|
3686
|
+
const y = me(p, s, i) - me(u, s, i);
|
|
3687
|
+
for (let w = 0; w < 6; w++) {
|
|
3688
|
+
const T = y / (2 * C) * l[w], A = t[w] / Math.pow(e + f + 1, xi);
|
|
3689
|
+
r[w] = Di(r[w] - A * T, w);
|
|
3690
|
+
}
|
|
3691
|
+
const E = me(r, s, i);
|
|
3692
|
+
E < c && (a = [...r], c = E);
|
|
3693
|
+
}
|
|
3694
|
+
return { values: a ?? [...r], loss: c };
|
|
3695
|
+
}
|
|
3696
|
+
function Di(e, t) {
|
|
3697
|
+
let n = Mi;
|
|
3698
|
+
return t === 2 ? n = Ii : (t === 4 || t === 5) && (n = Ri), t === 3 ? (e % pe + pe) % pe : v(e, 0, n);
|
|
3699
|
+
}
|
|
3700
|
+
function Vi(e, t, n) {
|
|
3701
|
+
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];
|
|
3702
|
+
return Qr(r, i, o, e.values, 500, t, n);
|
|
3703
|
+
}
|
|
3704
|
+
function Wi(e, t) {
|
|
3705
|
+
const n = [60, 180, 18e3, 600, 1.2, 1.2];
|
|
3706
|
+
let r = { loss: 1 / 0, values: [] };
|
|
3707
|
+
for (let o = 0; o < 3; o++)
|
|
3708
|
+
if (r.loss > 25) {
|
|
3709
|
+
const i = Qr(
|
|
3710
|
+
Ti,
|
|
3711
|
+
n,
|
|
3712
|
+
Ai,
|
|
3713
|
+
[
|
|
3714
|
+
vi,
|
|
3715
|
+
Bi,
|
|
3716
|
+
Ni,
|
|
3717
|
+
_i,
|
|
3718
|
+
Pi,
|
|
3719
|
+
Oi
|
|
3720
|
+
],
|
|
3721
|
+
1e3,
|
|
3722
|
+
e,
|
|
3723
|
+
t
|
|
3724
|
+
);
|
|
3725
|
+
i.loss < r.loss && (r = i);
|
|
3726
|
+
}
|
|
3727
|
+
return r;
|
|
3728
|
+
}
|
|
3729
|
+
function Xi(e) {
|
|
3730
|
+
const t = Kr(e), n = Vi(Wi(e, t), e, t);
|
|
3731
|
+
return {
|
|
3732
|
+
values: n.values,
|
|
3733
|
+
loss: n.loss,
|
|
3734
|
+
filter: yi(n.values)
|
|
3735
|
+
};
|
|
3736
|
+
}
|
|
3737
|
+
function Oa(e) {
|
|
3738
|
+
return Xi(e);
|
|
3739
|
+
}
|
|
3740
|
+
function Hi(e) {
|
|
3741
|
+
return e;
|
|
3587
3742
|
}
|
|
3743
|
+
function vn(e) {
|
|
3744
|
+
return e * e;
|
|
3745
|
+
}
|
|
3746
|
+
function Bn(e) {
|
|
3747
|
+
return -e * (e - 2);
|
|
3748
|
+
}
|
|
3749
|
+
function Nn(e) {
|
|
3750
|
+
return (e /= 0.5) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
|
|
3751
|
+
}
|
|
3752
|
+
function _n(e) {
|
|
3753
|
+
return e * e * e;
|
|
3754
|
+
}
|
|
3755
|
+
function Pn(e) {
|
|
3756
|
+
return (e = e - 1) * e * e + 1;
|
|
3757
|
+
}
|
|
3758
|
+
function On(e) {
|
|
3759
|
+
return (e /= 0.5) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
|
|
3760
|
+
}
|
|
3761
|
+
function Ln(e) {
|
|
3762
|
+
return e * e * (3 - 2 * e);
|
|
3763
|
+
}
|
|
3764
|
+
const Z = (e, t, n, r) => (o) => (o = fr(o, e, t, n, r)[1], o);
|
|
3765
|
+
function zn(e) {
|
|
3766
|
+
return e = Z(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
3767
|
+
}
|
|
3768
|
+
function $n(e) {
|
|
3769
|
+
return e = Z(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
3770
|
+
}
|
|
3771
|
+
function Fn(e) {
|
|
3772
|
+
return e = jt(e, [
|
|
3773
|
+
[0, 0],
|
|
3774
|
+
[0.026, 1.746],
|
|
3775
|
+
[0.633, 1.06],
|
|
3776
|
+
[1, 0]
|
|
3777
|
+
])[1], e;
|
|
3778
|
+
}
|
|
3779
|
+
function Gn(e) {
|
|
3780
|
+
return e = jt(e, [
|
|
3781
|
+
[0, 0],
|
|
3782
|
+
[0.367, 0.94],
|
|
3783
|
+
[0.974, 0.254],
|
|
3784
|
+
[1, 0]
|
|
3785
|
+
])[1], e;
|
|
3786
|
+
}
|
|
3787
|
+
function Un(e) {
|
|
3788
|
+
return e = jt(e, [
|
|
3789
|
+
[0, 0],
|
|
3790
|
+
[0.026, 1.746],
|
|
3791
|
+
[0.633, 1.06],
|
|
3792
|
+
[1, 0]
|
|
3793
|
+
])[1], e;
|
|
3794
|
+
}
|
|
3795
|
+
function Dn(e) {
|
|
3796
|
+
return e = jt(e, [
|
|
3797
|
+
[0, 0],
|
|
3798
|
+
[0.026, 1.746],
|
|
3799
|
+
[0.633, 1.06],
|
|
3800
|
+
[1, 0]
|
|
3801
|
+
])[1], e;
|
|
3802
|
+
}
|
|
3803
|
+
function Vn(e) {
|
|
3804
|
+
return 1 - Math.cos(e * Math.PI / 2);
|
|
3805
|
+
}
|
|
3806
|
+
function Wn(e) {
|
|
3807
|
+
return Math.sin(e * Math.PI / 2);
|
|
3808
|
+
}
|
|
3809
|
+
function Xn(e) {
|
|
3810
|
+
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
3811
|
+
}
|
|
3812
|
+
function Hn(e) {
|
|
3813
|
+
return 1 - Math.sqrt(1 - e * e);
|
|
3814
|
+
}
|
|
3815
|
+
function jn(e) {
|
|
3816
|
+
return Math.sqrt(1 - --e * e);
|
|
3817
|
+
}
|
|
3818
|
+
function Yn(e) {
|
|
3819
|
+
return (e /= 0.5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
|
|
3820
|
+
}
|
|
3821
|
+
function Zn(e) {
|
|
3822
|
+
return e === 0 ? 0 : Math.pow(2, 10 * (e - 1));
|
|
3823
|
+
}
|
|
3824
|
+
function qn(e) {
|
|
3825
|
+
return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
|
|
3826
|
+
}
|
|
3827
|
+
function Kn(e) {
|
|
3828
|
+
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));
|
|
3829
|
+
}
|
|
3830
|
+
const La = [
|
|
3831
|
+
"jump-start",
|
|
3832
|
+
"jump-end",
|
|
3833
|
+
"jump-none",
|
|
3834
|
+
"jump-both",
|
|
3835
|
+
"start",
|
|
3836
|
+
"end",
|
|
3837
|
+
"both"
|
|
3838
|
+
];
|
|
3839
|
+
function to(e, t) {
|
|
3840
|
+
return Math.floor(e * t) / t;
|
|
3841
|
+
}
|
|
3842
|
+
function ji(e, t) {
|
|
3843
|
+
return Math.ceil(e * t) / t;
|
|
3844
|
+
}
|
|
3845
|
+
function Yi(e, t) {
|
|
3846
|
+
return e === 0 || e === 1 ? e : to(e, t);
|
|
3847
|
+
}
|
|
3848
|
+
function Zi(e, t) {
|
|
3849
|
+
return Math.round(e * t) / t;
|
|
3850
|
+
}
|
|
3851
|
+
function nn(e, t = "jump-start") {
|
|
3852
|
+
switch (t) {
|
|
3853
|
+
case "jump-none":
|
|
3854
|
+
return (n) => Zi(n, e);
|
|
3855
|
+
case "jump-start":
|
|
3856
|
+
case "start":
|
|
3857
|
+
return (n) => to(n, e);
|
|
3858
|
+
case "jump-end":
|
|
3859
|
+
case "end":
|
|
3860
|
+
return (n) => ji(n, e);
|
|
3861
|
+
case "jump-both":
|
|
3862
|
+
case "both":
|
|
3863
|
+
return (n) => Yi(n, e);
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
function qi() {
|
|
3867
|
+
return nn(1, "jump-start");
|
|
3868
|
+
}
|
|
3869
|
+
function Ki() {
|
|
3870
|
+
return nn(1, "jump-end");
|
|
3871
|
+
}
|
|
3872
|
+
const ut = {
|
|
3873
|
+
ease: [0.25, 0.1, 0.25, 1],
|
|
3874
|
+
"ease-in": [0.42, 0, 1, 1],
|
|
3875
|
+
"ease-out": [0, 0, 0.58, 1],
|
|
3876
|
+
"ease-in-out": [0.42, 0, 0.58, 1],
|
|
3877
|
+
"ease-in-back": [0.6, -0.28, 0.735, 0.045],
|
|
3878
|
+
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
3879
|
+
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
3880
|
+
}, za = {
|
|
3881
|
+
linear: Hi,
|
|
3882
|
+
easeInQuad: vn,
|
|
3883
|
+
"ease-in-quad": vn,
|
|
3884
|
+
// "easeInQuad",
|
|
3885
|
+
easeOutQuad: Bn,
|
|
3886
|
+
"ease-out-quad": Bn,
|
|
3887
|
+
// "easeOutQuad",
|
|
3888
|
+
easeInOutQuad: Nn,
|
|
3889
|
+
"ease-in-out-quad": Nn,
|
|
3890
|
+
// "easeInOutQuad",
|
|
3891
|
+
easeInCubic: _n,
|
|
3892
|
+
"ease-in-cubic": _n,
|
|
3893
|
+
easeOutCubic: Pn,
|
|
3894
|
+
"ease-out-cubic": Pn,
|
|
3895
|
+
easeInOutCubic: On,
|
|
3896
|
+
"ease-in-out-cubic": On,
|
|
3897
|
+
easeInBounce: zn,
|
|
3898
|
+
"ease-in-bounce": zn,
|
|
3899
|
+
// "easeInBounce",
|
|
3900
|
+
bounceInEase: $n,
|
|
3901
|
+
"bounce-in-ease": $n,
|
|
3902
|
+
bounceInEaseHalf: Fn,
|
|
3903
|
+
"bounce-in-ease-half": Fn,
|
|
3904
|
+
bounceOutEase: Gn,
|
|
3905
|
+
"bounce-out-ease": Gn,
|
|
3906
|
+
bounceOutEaseHalf: Un,
|
|
3907
|
+
"bounce-out-ease-half": Un,
|
|
3908
|
+
bounceInOutEase: Dn,
|
|
3909
|
+
"bounce-in-out-ease": Dn,
|
|
3910
|
+
easeInSine: Vn,
|
|
3911
|
+
"ease-in-sine": Vn,
|
|
3912
|
+
easeOutSine: Wn,
|
|
3913
|
+
"ease-out-sine": Wn,
|
|
3914
|
+
easeInOutSine: Xn,
|
|
3915
|
+
"ease-in-out-sine": Xn,
|
|
3916
|
+
easeInCirc: Hn,
|
|
3917
|
+
"ease-in-circ": Hn,
|
|
3918
|
+
easeOutCirc: jn,
|
|
3919
|
+
"ease-out-circ": jn,
|
|
3920
|
+
easeInOutCirc: Yn,
|
|
3921
|
+
"ease-in-out-circ": Yn,
|
|
3922
|
+
easeInExpo: Zn,
|
|
3923
|
+
"ease-in-expo": Zn,
|
|
3924
|
+
easeOutExpo: qn,
|
|
3925
|
+
"ease-out-expo": qn,
|
|
3926
|
+
easeInOutExpo: Kn,
|
|
3927
|
+
"ease-in-out-expo": Kn,
|
|
3928
|
+
smoothStep3: Ln,
|
|
3929
|
+
"smooth-step-3": Ln,
|
|
3930
|
+
ease: Z(...ut.ease),
|
|
3931
|
+
"ease-in": Z(...ut["ease-in"]),
|
|
3932
|
+
"ease-out": Z(...ut["ease-out"]),
|
|
3933
|
+
"ease-in-out": Z(...ut["ease-in-out"]),
|
|
3934
|
+
"ease-in-back": Z(...ut["ease-in-back"]),
|
|
3935
|
+
"ease-out-back": Z(...ut["ease-out-back"]),
|
|
3936
|
+
"ease-in-out-back": Z(...ut["ease-in-out-back"]),
|
|
3937
|
+
steps: nn,
|
|
3938
|
+
"step-start": qi,
|
|
3939
|
+
"step-end": Ki
|
|
3940
|
+
};
|
|
3588
3941
|
export {
|
|
3589
|
-
|
|
3590
|
-
|
|
3942
|
+
Qn as ABSOLUTE_LENGTH_UNITS,
|
|
3943
|
+
$ as ALPHA_DENORM_UNIT,
|
|
3591
3944
|
h as ALPHA_RANGE,
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3945
|
+
Lt as ANGLE_UNITS,
|
|
3946
|
+
ve as AdobeRGBColor,
|
|
3947
|
+
io as BLACKLISTED_COALESCE_UNITS,
|
|
3948
|
+
dn as COLOR_NAMES,
|
|
3949
|
+
lr as COLOR_SPACE_DENORM_UNITS,
|
|
3950
|
+
wa as COLOR_SPACE_NAMES,
|
|
3951
|
+
b as COLOR_SPACE_RANGES,
|
|
3952
|
+
so as COLOR_UNITS,
|
|
3953
|
+
fe as COMPUTED_UNITS,
|
|
3954
|
+
Ye as CSSColor,
|
|
3955
|
+
Z as CSSCubicBezier,
|
|
3956
|
+
Ra as CSSFunction,
|
|
3957
|
+
wi as CSSJSON,
|
|
3958
|
+
qr as CSSString,
|
|
3605
3959
|
H as CSSValueUnit,
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3960
|
+
va as CSSValues,
|
|
3961
|
+
Es as CYLINDRICAL_HUE_COMPONENT,
|
|
3962
|
+
V as Color,
|
|
3963
|
+
Ca as DELTA_E_OK_JND,
|
|
3964
|
+
Re as DisplayP3Color,
|
|
3965
|
+
he as FRAME_RATE,
|
|
3966
|
+
mt as FunctionValue,
|
|
3967
|
+
Eo as GAMUT_SECTOR_COEFFICIENTS,
|
|
3968
|
+
yt as HSLColor,
|
|
3969
|
+
Ee as HSVColor,
|
|
3970
|
+
Tt as HUE_RANGE,
|
|
3971
|
+
Te as HWBColor,
|
|
3972
|
+
nr as KelvinColor,
|
|
3973
|
+
Xt as LABColor,
|
|
3974
|
+
Ae as LCHColor,
|
|
3975
|
+
Pt as LENGTH_UNITS,
|
|
3976
|
+
j as LINEAR_SRGB_TO_LMS,
|
|
3977
|
+
k as LMS_TO_LINEAR_SRGB,
|
|
3978
|
+
hr as LMS_TO_OKLAB_MATRIX,
|
|
3979
|
+
Co as LMS_TO_XYZ_MATRIX,
|
|
3980
|
+
Ie as LinearSRGBColor,
|
|
3981
|
+
Ht as OKLABColor,
|
|
3982
|
+
P as OKLAB_TO_LMS_COEFF,
|
|
3983
|
+
xo as OKLAB_TO_LMS_MATRIX,
|
|
3984
|
+
Me as OKLCHColor,
|
|
3985
|
+
er as PERCENTAGE_UNITS,
|
|
3986
|
+
Be as ProPhotoRGBColor,
|
|
3987
|
+
tr as RELATIVE_LENGTH_UNITS,
|
|
3988
|
+
zt as RESOLUTION_UNITS,
|
|
3989
|
+
_ as RGBA_MAX,
|
|
3990
|
+
O as RGBColor,
|
|
3991
|
+
oe as RGB_RANGE,
|
|
3992
|
+
Ne as Rec2020Color,
|
|
3993
|
+
oo as STRING_UNITS,
|
|
3994
|
+
ao as STYLE_NAMES,
|
|
3995
|
+
Ot as TIME_UNITS,
|
|
3996
|
+
ca as UNITS,
|
|
3643
3997
|
z as UNIT_RANGE,
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3998
|
+
vt as ValueArray,
|
|
3999
|
+
S as ValueUnit,
|
|
4000
|
+
pr as WHITE_POINTS,
|
|
4001
|
+
yo as WHITE_POINT_D50,
|
|
4002
|
+
ur as WHITE_POINT_D50_D65,
|
|
4003
|
+
So as WHITE_POINT_D65,
|
|
4004
|
+
Oe as WHITE_POINT_D65_D50,
|
|
4005
|
+
U as XYZColor,
|
|
4006
|
+
mr as XYZ_TO_LMS_MATRIX,
|
|
4007
|
+
gs as adobeRgb2xyz,
|
|
4008
|
+
ce as adobeRgbToLinear,
|
|
4009
|
+
Ji as arrayEquals,
|
|
4010
|
+
ut as bezierPresets,
|
|
4011
|
+
$n as bounceInEase,
|
|
4012
|
+
Fn as bounceInEaseHalf,
|
|
4013
|
+
Dn as bounceInOutEase,
|
|
4014
|
+
Gn as bounceOutEase,
|
|
4015
|
+
Un as bounceOutEaseHalf,
|
|
4016
|
+
oa as camelCaseToHyphen,
|
|
4017
|
+
aa as cancelAnimationFrame,
|
|
4018
|
+
v as clamp,
|
|
4019
|
+
tt as clone,
|
|
4020
|
+
pt as color2,
|
|
4021
|
+
wn as colorUnit2,
|
|
4022
|
+
Mo as computeMaxSaturation,
|
|
4023
|
+
fa as convert2,
|
|
4024
|
+
uo as convertAbsoluteUnitToPixels,
|
|
4025
|
+
sr as convertToDPI,
|
|
4026
|
+
_e as convertToDegrees,
|
|
4027
|
+
or as convertToMs,
|
|
4028
|
+
rr as convertToPixels,
|
|
4029
|
+
na as createHash,
|
|
4030
|
+
yi as cssFiltersToString,
|
|
4031
|
+
fr as cubicBezier,
|
|
4032
|
+
Sa as cubicBezierToSVG,
|
|
4033
|
+
ya as cubicBezierToString,
|
|
4034
|
+
Ft as deCasteljau,
|
|
4035
|
+
ea as debounce,
|
|
4036
|
+
xa as deltaEOK,
|
|
4037
|
+
bs as displayP32xyz,
|
|
4038
|
+
zn as easeInBounce,
|
|
4039
|
+
Hn as easeInCirc,
|
|
4040
|
+
_n as easeInCubic,
|
|
4041
|
+
Zn as easeInExpo,
|
|
4042
|
+
Yn as easeInOutCirc,
|
|
4043
|
+
On as easeInOutCubic,
|
|
4044
|
+
Kn as easeInOutExpo,
|
|
4045
|
+
Nn as easeInOutQuad,
|
|
4046
|
+
Xn as easeInOutSine,
|
|
4047
|
+
vn as easeInQuad,
|
|
4048
|
+
Vn as easeInSine,
|
|
4049
|
+
jn as easeOutCirc,
|
|
4050
|
+
Pn as easeOutCubic,
|
|
4051
|
+
qn as easeOutExpo,
|
|
4052
|
+
Bn as easeOutQuad,
|
|
4053
|
+
Wn as easeOutSine,
|
|
4054
|
+
ko as fail,
|
|
4055
|
+
Io as findCusp,
|
|
4056
|
+
Ro as findGamutIntersection,
|
|
4057
|
+
ua as flattenObject,
|
|
4058
|
+
xs as gamutMap,
|
|
4059
|
+
No as gamutMapOKLab,
|
|
4060
|
+
Po as gamutMapSRGB,
|
|
4061
|
+
_a as getComputedValue,
|
|
4062
|
+
Ea as getFormattedColorSpaceRange,
|
|
4063
|
+
Oo as hex2rgb,
|
|
4064
|
+
Cr as hsl2hsv,
|
|
4065
|
+
$o as hsl2hwb,
|
|
4066
|
+
Fo as hsl2rgb,
|
|
4067
|
+
He as hsl2xyz,
|
|
4068
|
+
yr as hsv2hsl,
|
|
4069
|
+
qo as hsv2xyz,
|
|
4070
|
+
zo as hwb2hsl,
|
|
4071
|
+
Jo as hwb2xyz,
|
|
4072
|
+
ra as hyphenToCamelCase,
|
|
4073
|
+
bo as identifier,
|
|
4074
|
+
go as integer,
|
|
4075
|
+
jt as interpBezier,
|
|
4076
|
+
Ts as interpolateHue,
|
|
4077
|
+
nt as invertMat3,
|
|
4078
|
+
ha as isCSSStyleName,
|
|
4079
|
+
be as isColorUnit,
|
|
4080
|
+
Ao as isInSRGBGamut,
|
|
4081
|
+
Jn as isObject,
|
|
4082
|
+
m as istring,
|
|
4083
|
+
La as jumpTerms,
|
|
4084
|
+
Sr as kelvin2rgb,
|
|
4085
|
+
os as kelvin2xyz,
|
|
4086
|
+
jo as lab2lch,
|
|
4087
|
+
Zo as lab2oklab,
|
|
4088
|
+
Ma as lab2oklch,
|
|
4089
|
+
Fe as lab2xyz,
|
|
4090
|
+
Ho as lch2lab,
|
|
4091
|
+
ts as lch2xyz,
|
|
4092
|
+
de as lerp,
|
|
4093
|
+
Hi as linear,
|
|
4094
|
+
hs as linearSrgb2xyz,
|
|
4095
|
+
is as linearToAdobeRgb,
|
|
4096
|
+
as as linearToProPhoto,
|
|
4097
|
+
cs as linearToRec2020,
|
|
4098
|
+
Rr as linearToSrgb,
|
|
4099
|
+
ka as logerp,
|
|
4100
|
+
Wt as memoize,
|
|
4101
|
+
As as mixColors,
|
|
4102
|
+
ga as multiplyMat3,
|
|
4103
|
+
Pe as none,
|
|
4104
|
+
Rs as normalizeColor,
|
|
4105
|
+
we as normalizeColorUnit,
|
|
4106
|
+
Is as normalizeColorUnitComponent,
|
|
4107
|
+
vs as normalizeColorUnits,
|
|
4108
|
+
Si as normalizeNumericUnits,
|
|
4109
|
+
Pa as normalizeValueUnits,
|
|
4110
|
+
et as number,
|
|
4111
|
+
Yo as oklab2lab,
|
|
4112
|
+
vr as oklab2oklch,
|
|
4113
|
+
We as oklab2xyz,
|
|
4114
|
+
ze as oklabToLinearSRGB,
|
|
4115
|
+
Aa as oklch2lab,
|
|
4116
|
+
Br as oklch2oklab,
|
|
4117
|
+
ns as oklch2xyz,
|
|
4118
|
+
Ia as parseCSSColor,
|
|
4119
|
+
Ba as parseCSSPercent,
|
|
4120
|
+
Na as parseCSSTime,
|
|
4121
|
+
ki as parseCSSValue,
|
|
4122
|
+
Yr as parseCSSValueUnit,
|
|
4123
|
+
ba as parseResult,
|
|
4124
|
+
ks as proPhoto2xyz,
|
|
4125
|
+
le as proPhotoToLinear,
|
|
4126
|
+
ys as rec20202xyz,
|
|
4127
|
+
ue as rec2020ToLinear,
|
|
4128
|
+
ia as requestAnimationFrame,
|
|
4129
|
+
Oa as rgb2ColorFilter,
|
|
4130
|
+
Ta as rgb2hex,
|
|
4131
|
+
xr as rgb2hsl,
|
|
4132
|
+
Lo as rgb2kelvin,
|
|
4133
|
+
De as rgb2xyz,
|
|
4134
|
+
R as scale,
|
|
4135
|
+
sa as seekPreviousValue,
|
|
4136
|
+
Qi as sleep,
|
|
4137
|
+
Ln as smoothStep3,
|
|
4138
|
+
wt as srgbToLinear,
|
|
4139
|
+
_o as srgbToOKLab,
|
|
4140
|
+
Ki as stepEnd,
|
|
4141
|
+
qi as stepStart,
|
|
4142
|
+
nn as steppedEase,
|
|
4143
|
+
wo as succeed,
|
|
4144
|
+
za as timingFunctions,
|
|
4145
|
+
N as transformMat3,
|
|
4146
|
+
da as transposeMat3,
|
|
4147
|
+
Bt as tryParse,
|
|
4148
|
+
pa as unflattenObject,
|
|
4149
|
+
ma as unflattenObjectToString,
|
|
4150
|
+
lo as unpackMatrixValues,
|
|
4151
|
+
ta as waitUntil,
|
|
4152
|
+
ws as xyz2adobeRgb,
|
|
4153
|
+
ds as xyz2displayP3,
|
|
4154
|
+
je as xyz2hsl,
|
|
4155
|
+
Ko as xyz2hsv,
|
|
4156
|
+
Qo as xyz2hwb,
|
|
4157
|
+
ss as xyz2kelvin,
|
|
4158
|
+
$e as xyz2lab,
|
|
4159
|
+
es as xyz2lch,
|
|
4160
|
+
fs as xyz2linearSrgb,
|
|
4161
|
+
Xe as xyz2oklab,
|
|
4162
|
+
rs as xyz2oklch,
|
|
4163
|
+
Ss as xyz2proPhoto,
|
|
4164
|
+
Cs as xyz2rec2020,
|
|
4165
|
+
Ve as xyz2rgb
|
|
3781
4166
|
};
|