@mkbabb/value.js 0.4.0 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -9
- package/dist/CNAME +1 -0
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/Katex-ClrxLHTj.js +131 -0
- package/dist/assets/Katex-rb5Khf8S.css +1 -0
- package/dist/assets/favicon-BpOvZXpk.svg +20 -0
- package/dist/assets/hsl-hvHpFpJT.js +1 -0
- package/dist/assets/hsv-Dw3FShnj.js +1 -0
- package/dist/assets/hwb-pA6JoiNj.js +1 -0
- package/dist/assets/index-Q19pIqw1.js +32 -0
- package/dist/assets/index-VnEkwzsm.css +1 -0
- package/dist/assets/kelvin-Csjui27y.js +1 -0
- package/dist/assets/lab-DAj67vs8.js +1 -0
- package/dist/assets/lch-D_dY1vUG.js +1 -0
- package/dist/assets/oklab-BPM7MOIw.js +1 -0
- package/dist/assets/oklch-DwTrS_34.js +1 -0
- package/dist/assets/rgb-BLbQuf-A.js +1 -0
- package/dist/assets/vendor-highlight-sMWp9TLU.js +3 -0
- package/dist/assets/vendor-katex-Dehg5p_Y.js +261 -0
- package/dist/assets/vendor-prettier-wO8BBsoP.js +166 -0
- package/dist/assets/xyz-CX5zPyPG.js +3 -0
- package/dist/index.html +18 -0
- package/package.json +3 -3
- package/dist/value.cjs +0 -8
- package/dist/value.d.ts +0 -1995
- package/dist/value.js +0 -4917
package/dist/value.js
DELETED
|
@@ -1,4917 +0,0 @@
|
|
|
1
|
-
const Oe = 16.666666666666668, pr = (e) => !!e && e.constructor === Object;
|
|
2
|
-
function at(e) {
|
|
3
|
-
return pr(e) ? Object.entries(e).map(([t, n]) => [t, at(n)]).reduce((t, [n, r]) => (t[n] = r, t), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(at) : e;
|
|
4
|
-
}
|
|
5
|
-
const $a = (e, t) => {
|
|
6
|
-
if (!e || !t || e.length !== t.length)
|
|
7
|
-
return !1;
|
|
8
|
-
for (let n = 0; n < e.length; n++)
|
|
9
|
-
if (e[n] !== t[n])
|
|
10
|
-
return !1;
|
|
11
|
-
return !0;
|
|
12
|
-
};
|
|
13
|
-
async function Da(e) {
|
|
14
|
-
return await new Promise((t) => setTimeout(t, e));
|
|
15
|
-
}
|
|
16
|
-
async function Ua(e, t = Oe) {
|
|
17
|
-
return await new Promise((n) => {
|
|
18
|
-
const r = setInterval(() => {
|
|
19
|
-
if (e())
|
|
20
|
-
return clearInterval(r), n();
|
|
21
|
-
}, t);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function Ga(e, t = 100, n = !1) {
|
|
25
|
-
let r = null;
|
|
26
|
-
const o = function(...s) {
|
|
27
|
-
const i = this, a = function() {
|
|
28
|
-
r = null, n || e.apply(i, s);
|
|
29
|
-
}, c = n && !r;
|
|
30
|
-
r && clearTimeout(r), r = setTimeout(a, t), c && e.apply(i, s);
|
|
31
|
-
};
|
|
32
|
-
return o.cancel = () => {
|
|
33
|
-
r && (clearTimeout(r), r = null);
|
|
34
|
-
}, o;
|
|
35
|
-
}
|
|
36
|
-
async function Va(e, t) {
|
|
37
|
-
const n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
|
|
38
|
-
return Array.from(new Uint8Array(r)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
39
|
-
}
|
|
40
|
-
function oe(e, t = {}) {
|
|
41
|
-
const n = /* @__PURE__ */ new Map(), { maxCacheSize: r = 1 / 0, ttl: o = 1 / 0, keyFn: s = JSON.stringify } = t, i = function(...a) {
|
|
42
|
-
const c = s.apply(this, a), l = Date.now();
|
|
43
|
-
if (n.has(c)) {
|
|
44
|
-
const p = n.get(c);
|
|
45
|
-
if (l - p.timestamp <= o)
|
|
46
|
-
return p.value;
|
|
47
|
-
n.delete(c);
|
|
48
|
-
}
|
|
49
|
-
const f = e.apply(this, a);
|
|
50
|
-
if (n.set(c, { value: f, timestamp: l }), n.size > r) {
|
|
51
|
-
const p = n.keys().next().value;
|
|
52
|
-
n.delete(p);
|
|
53
|
-
}
|
|
54
|
-
return f;
|
|
55
|
-
};
|
|
56
|
-
return i.cache = n, i;
|
|
57
|
-
}
|
|
58
|
-
const Xa = (e) => e.replace(
|
|
59
|
-
/([-_][a-z])/gi,
|
|
60
|
-
(t) => t.toUpperCase().replace("-", "").replace("_", "")
|
|
61
|
-
);
|
|
62
|
-
function Wa(e) {
|
|
63
|
-
return e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`);
|
|
64
|
-
}
|
|
65
|
-
function Ha(e, t, n) {
|
|
66
|
-
for (let r = e - 1; r >= 0; r--)
|
|
67
|
-
if (n(t[r]))
|
|
68
|
-
return r;
|
|
69
|
-
}
|
|
70
|
-
function ja(e) {
|
|
71
|
-
if (typeof window < "u" && window.requestAnimationFrame)
|
|
72
|
-
return window.requestAnimationFrame(e);
|
|
73
|
-
let t = Oe, n = Date.now();
|
|
74
|
-
return setTimeout(() => {
|
|
75
|
-
let r = Date.now(), o = r - n;
|
|
76
|
-
n = r, t = Math.max(0, Oe - o), e(r);
|
|
77
|
-
}, t);
|
|
78
|
-
}
|
|
79
|
-
function Ya(e) {
|
|
80
|
-
if (typeof window < "u" && window.cancelAnimationFrame)
|
|
81
|
-
return window.cancelAnimationFrame(e);
|
|
82
|
-
clearTimeout(e);
|
|
83
|
-
}
|
|
84
|
-
const En = (e, t = 2) => typeof e == "number" && Number.isNaN(e) ? "none" : String(e?.toFixed?.(t) ?? e).trim().replace(/\.0+$/, ""), vn = (e, t, n) => `${e}(${t.join(" ")} / ${n})`;
|
|
85
|
-
let H = class {
|
|
86
|
-
constructor(t, n = 1) {
|
|
87
|
-
this.colorSpace = t, this.alpha = n, this.components = /* @__PURE__ */ new Map();
|
|
88
|
-
}
|
|
89
|
-
components;
|
|
90
|
-
toString() {
|
|
91
|
-
const t = Array.from(this.components.values()).map(
|
|
92
|
-
(r) => typeof r == "number" && Number.isNaN(r) ? "none" : r
|
|
93
|
-
), n = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
|
|
94
|
-
return vn(this.colorSpace, t, n);
|
|
95
|
-
}
|
|
96
|
-
toFormattedString(t = 2) {
|
|
97
|
-
const n = Array.from(this.components.values()).map(
|
|
98
|
-
(o) => En(o, t)
|
|
99
|
-
), r = En(this.alpha, t);
|
|
100
|
-
return vn(this.colorSpace, n, r);
|
|
101
|
-
}
|
|
102
|
-
valueOf() {
|
|
103
|
-
return [...this.values(), this.alpha];
|
|
104
|
-
}
|
|
105
|
-
toJSON() {
|
|
106
|
-
const t = {};
|
|
107
|
-
for (const [n, r] of this.entries())
|
|
108
|
-
t[n] = r;
|
|
109
|
-
return t.alpha = this.alpha, t;
|
|
110
|
-
}
|
|
111
|
-
clone() {
|
|
112
|
-
const t = this.constructor, n = new t();
|
|
113
|
-
return n.alpha = at(this.alpha), this.components.forEach((r, o) => {
|
|
114
|
-
n.components.set(o, at(r));
|
|
115
|
-
}), n;
|
|
116
|
-
}
|
|
117
|
-
keys() {
|
|
118
|
-
return [...this.components.keys(), "alpha"];
|
|
119
|
-
}
|
|
120
|
-
values() {
|
|
121
|
-
return [...this.components.values(), this.alpha];
|
|
122
|
-
}
|
|
123
|
-
entries() {
|
|
124
|
-
return [...this.components.entries(), ["alpha", this.alpha]];
|
|
125
|
-
}
|
|
126
|
-
getComponent(t) {
|
|
127
|
-
return this.components.get(t);
|
|
128
|
-
}
|
|
129
|
-
setComponent(t, n) {
|
|
130
|
-
this.components.set(t, n);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
class $e extends H {
|
|
134
|
-
constructor(t, n, r) {
|
|
135
|
-
super(t, n), this.whitePoint = r;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
class D extends H {
|
|
139
|
-
constructor(t, n, r, o) {
|
|
140
|
-
super("rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
141
|
-
}
|
|
142
|
-
get r() {
|
|
143
|
-
return this.getComponent("r");
|
|
144
|
-
}
|
|
145
|
-
set r(t) {
|
|
146
|
-
this.setComponent("r", t);
|
|
147
|
-
}
|
|
148
|
-
get g() {
|
|
149
|
-
return this.getComponent("g");
|
|
150
|
-
}
|
|
151
|
-
set g(t) {
|
|
152
|
-
this.setComponent("g", t);
|
|
153
|
-
}
|
|
154
|
-
get b() {
|
|
155
|
-
return this.getComponent("b");
|
|
156
|
-
}
|
|
157
|
-
set b(t) {
|
|
158
|
-
this.setComponent("b", t);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
class vt extends H {
|
|
162
|
-
constructor(t, n, r, o) {
|
|
163
|
-
super("hsl", o), this.components.set("h", t), this.components.set("s", n), this.components.set("l", r);
|
|
164
|
-
}
|
|
165
|
-
get h() {
|
|
166
|
-
return this.getComponent("h");
|
|
167
|
-
}
|
|
168
|
-
set h(t) {
|
|
169
|
-
this.setComponent("h", t);
|
|
170
|
-
}
|
|
171
|
-
get s() {
|
|
172
|
-
return this.getComponent("s");
|
|
173
|
-
}
|
|
174
|
-
set s(t) {
|
|
175
|
-
this.setComponent("s", t);
|
|
176
|
-
}
|
|
177
|
-
get l() {
|
|
178
|
-
return this.getComponent("l");
|
|
179
|
-
}
|
|
180
|
-
set l(t) {
|
|
181
|
-
this.setComponent("l", t);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
class De extends H {
|
|
185
|
-
constructor(t, n, r, o) {
|
|
186
|
-
super("hsv", o), this.components.set("h", t), this.components.set("s", n), this.components.set("v", r);
|
|
187
|
-
}
|
|
188
|
-
get h() {
|
|
189
|
-
return this.getComponent("h");
|
|
190
|
-
}
|
|
191
|
-
set h(t) {
|
|
192
|
-
this.setComponent("h", t);
|
|
193
|
-
}
|
|
194
|
-
get s() {
|
|
195
|
-
return this.getComponent("s");
|
|
196
|
-
}
|
|
197
|
-
set s(t) {
|
|
198
|
-
this.setComponent("s", t);
|
|
199
|
-
}
|
|
200
|
-
get v() {
|
|
201
|
-
return this.getComponent("v");
|
|
202
|
-
}
|
|
203
|
-
set v(t) {
|
|
204
|
-
this.setComponent("v", t);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
class Ue extends H {
|
|
208
|
-
constructor(t, n, r, o) {
|
|
209
|
-
super("hwb", o), this.components.set("h", t), this.components.set("w", n), this.components.set("b", r);
|
|
210
|
-
}
|
|
211
|
-
get h() {
|
|
212
|
-
return this.getComponent("h");
|
|
213
|
-
}
|
|
214
|
-
set h(t) {
|
|
215
|
-
this.setComponent("h", t);
|
|
216
|
-
}
|
|
217
|
-
get w() {
|
|
218
|
-
return this.getComponent("w");
|
|
219
|
-
}
|
|
220
|
-
set w(t) {
|
|
221
|
-
this.setComponent("w", t);
|
|
222
|
-
}
|
|
223
|
-
get b() {
|
|
224
|
-
return this.getComponent("b");
|
|
225
|
-
}
|
|
226
|
-
set b(t) {
|
|
227
|
-
this.setComponent("b", t);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
class se extends $e {
|
|
231
|
-
constructor(t, n, r, o) {
|
|
232
|
-
super("lab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
233
|
-
}
|
|
234
|
-
get l() {
|
|
235
|
-
return this.getComponent("l");
|
|
236
|
-
}
|
|
237
|
-
set l(t) {
|
|
238
|
-
this.setComponent("l", t);
|
|
239
|
-
}
|
|
240
|
-
get a() {
|
|
241
|
-
return this.getComponent("a");
|
|
242
|
-
}
|
|
243
|
-
set a(t) {
|
|
244
|
-
this.setComponent("a", t);
|
|
245
|
-
}
|
|
246
|
-
get b() {
|
|
247
|
-
return this.getComponent("b");
|
|
248
|
-
}
|
|
249
|
-
set b(t) {
|
|
250
|
-
this.setComponent("b", t);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
class Ge extends H {
|
|
254
|
-
constructor(t, n, r, o) {
|
|
255
|
-
super("lch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
256
|
-
}
|
|
257
|
-
get l() {
|
|
258
|
-
return this.getComponent("l");
|
|
259
|
-
}
|
|
260
|
-
set l(t) {
|
|
261
|
-
this.setComponent("l", t);
|
|
262
|
-
}
|
|
263
|
-
get c() {
|
|
264
|
-
return this.getComponent("c");
|
|
265
|
-
}
|
|
266
|
-
set c(t) {
|
|
267
|
-
this.setComponent("c", t);
|
|
268
|
-
}
|
|
269
|
-
get h() {
|
|
270
|
-
return this.getComponent("h");
|
|
271
|
-
}
|
|
272
|
-
set h(t) {
|
|
273
|
-
this.setComponent("h", t);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
class ie extends $e {
|
|
277
|
-
constructor(t, n, r, o) {
|
|
278
|
-
super("oklab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
279
|
-
}
|
|
280
|
-
get l() {
|
|
281
|
-
return this.getComponent("l");
|
|
282
|
-
}
|
|
283
|
-
set l(t) {
|
|
284
|
-
this.setComponent("l", t);
|
|
285
|
-
}
|
|
286
|
-
get a() {
|
|
287
|
-
return this.getComponent("a");
|
|
288
|
-
}
|
|
289
|
-
set a(t) {
|
|
290
|
-
this.setComponent("a", t);
|
|
291
|
-
}
|
|
292
|
-
get b() {
|
|
293
|
-
return this.getComponent("b");
|
|
294
|
-
}
|
|
295
|
-
set b(t) {
|
|
296
|
-
this.setComponent("b", t);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
class Ve extends H {
|
|
300
|
-
constructor(t, n, r, o) {
|
|
301
|
-
super("oklch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
302
|
-
}
|
|
303
|
-
get l() {
|
|
304
|
-
return this.getComponent("l");
|
|
305
|
-
}
|
|
306
|
-
set l(t) {
|
|
307
|
-
this.setComponent("l", t);
|
|
308
|
-
}
|
|
309
|
-
get c() {
|
|
310
|
-
return this.getComponent("c");
|
|
311
|
-
}
|
|
312
|
-
set c(t) {
|
|
313
|
-
this.setComponent("c", t);
|
|
314
|
-
}
|
|
315
|
-
get h() {
|
|
316
|
-
return this.getComponent("h");
|
|
317
|
-
}
|
|
318
|
-
set h(t) {
|
|
319
|
-
this.setComponent("h", t);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
class X extends $e {
|
|
323
|
-
constructor(t, n, r, o) {
|
|
324
|
-
super("xyz", o, "D65"), this.components.set("x", t), this.components.set("y", n), this.components.set("z", r);
|
|
325
|
-
}
|
|
326
|
-
get x() {
|
|
327
|
-
return this.getComponent("x");
|
|
328
|
-
}
|
|
329
|
-
set x(t) {
|
|
330
|
-
this.setComponent("x", t);
|
|
331
|
-
}
|
|
332
|
-
get y() {
|
|
333
|
-
return this.getComponent("y");
|
|
334
|
-
}
|
|
335
|
-
set y(t) {
|
|
336
|
-
this.setComponent("y", t);
|
|
337
|
-
}
|
|
338
|
-
get z() {
|
|
339
|
-
return this.getComponent("z");
|
|
340
|
-
}
|
|
341
|
-
set z(t) {
|
|
342
|
-
this.setComponent("z", t);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
class hr extends H {
|
|
346
|
-
constructor(t, n) {
|
|
347
|
-
super("kelvin", n), this.components.set("kelvin", t);
|
|
348
|
-
}
|
|
349
|
-
get kelvin() {
|
|
350
|
-
return this.getComponent("kelvin");
|
|
351
|
-
}
|
|
352
|
-
set kelvin(t) {
|
|
353
|
-
this.setComponent("kelvin", t);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
class Xe extends H {
|
|
357
|
-
constructor(t, n, r, o) {
|
|
358
|
-
super("srgb-linear", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
359
|
-
}
|
|
360
|
-
get r() {
|
|
361
|
-
return this.getComponent("r");
|
|
362
|
-
}
|
|
363
|
-
set r(t) {
|
|
364
|
-
this.setComponent("r", t);
|
|
365
|
-
}
|
|
366
|
-
get g() {
|
|
367
|
-
return this.getComponent("g");
|
|
368
|
-
}
|
|
369
|
-
set g(t) {
|
|
370
|
-
this.setComponent("g", t);
|
|
371
|
-
}
|
|
372
|
-
get b() {
|
|
373
|
-
return this.getComponent("b");
|
|
374
|
-
}
|
|
375
|
-
set b(t) {
|
|
376
|
-
this.setComponent("b", t);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
class We extends H {
|
|
380
|
-
constructor(t, n, r, o) {
|
|
381
|
-
super("display-p3", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
382
|
-
}
|
|
383
|
-
get r() {
|
|
384
|
-
return this.getComponent("r");
|
|
385
|
-
}
|
|
386
|
-
set r(t) {
|
|
387
|
-
this.setComponent("r", t);
|
|
388
|
-
}
|
|
389
|
-
get g() {
|
|
390
|
-
return this.getComponent("g");
|
|
391
|
-
}
|
|
392
|
-
set g(t) {
|
|
393
|
-
this.setComponent("g", t);
|
|
394
|
-
}
|
|
395
|
-
get b() {
|
|
396
|
-
return this.getComponent("b");
|
|
397
|
-
}
|
|
398
|
-
set b(t) {
|
|
399
|
-
this.setComponent("b", t);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
class He extends H {
|
|
403
|
-
constructor(t, n, r, o) {
|
|
404
|
-
super("a98-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
405
|
-
}
|
|
406
|
-
get r() {
|
|
407
|
-
return this.getComponent("r");
|
|
408
|
-
}
|
|
409
|
-
set r(t) {
|
|
410
|
-
this.setComponent("r", t);
|
|
411
|
-
}
|
|
412
|
-
get g() {
|
|
413
|
-
return this.getComponent("g");
|
|
414
|
-
}
|
|
415
|
-
set g(t) {
|
|
416
|
-
this.setComponent("g", t);
|
|
417
|
-
}
|
|
418
|
-
get b() {
|
|
419
|
-
return this.getComponent("b");
|
|
420
|
-
}
|
|
421
|
-
set b(t) {
|
|
422
|
-
this.setComponent("b", t);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
class je extends H {
|
|
426
|
-
constructor(t, n, r, o) {
|
|
427
|
-
super("prophoto-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
428
|
-
}
|
|
429
|
-
get r() {
|
|
430
|
-
return this.getComponent("r");
|
|
431
|
-
}
|
|
432
|
-
set r(t) {
|
|
433
|
-
this.setComponent("r", t);
|
|
434
|
-
}
|
|
435
|
-
get g() {
|
|
436
|
-
return this.getComponent("g");
|
|
437
|
-
}
|
|
438
|
-
set g(t) {
|
|
439
|
-
this.setComponent("g", t);
|
|
440
|
-
}
|
|
441
|
-
get b() {
|
|
442
|
-
return this.getComponent("b");
|
|
443
|
-
}
|
|
444
|
-
set b(t) {
|
|
445
|
-
this.setComponent("b", t);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
class Ye extends H {
|
|
449
|
-
constructor(t, n, r, o) {
|
|
450
|
-
super("rec2020", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
451
|
-
}
|
|
452
|
-
get r() {
|
|
453
|
-
return this.getComponent("r");
|
|
454
|
-
}
|
|
455
|
-
set r(t) {
|
|
456
|
-
this.setComponent("r", t);
|
|
457
|
-
}
|
|
458
|
-
get g() {
|
|
459
|
-
return this.getComponent("g");
|
|
460
|
-
}
|
|
461
|
-
set g(t) {
|
|
462
|
-
this.setComponent("g", t);
|
|
463
|
-
}
|
|
464
|
-
get b() {
|
|
465
|
-
return this.getComponent("b");
|
|
466
|
-
}
|
|
467
|
-
set b(t) {
|
|
468
|
-
this.setComponent("b", t);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
const Mn = 4;
|
|
472
|
-
function Tn(e, t = "^", n = !1) {
|
|
473
|
-
const r = e.src.split(`
|
|
474
|
-
`), 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);
|
|
475
|
-
if (t) {
|
|
476
|
-
const l = " ".repeat(e.getColumnNumber()) + t;
|
|
477
|
-
a.splice(o - s + 1, 0, l);
|
|
478
|
-
}
|
|
479
|
-
return a.map((l, f) => ` ${s + f + 1}| ${l}`).join(`
|
|
480
|
-
`);
|
|
481
|
-
}
|
|
482
|
-
const ht = /* @__PURE__ */ new Map();
|
|
483
|
-
function mr(e) {
|
|
484
|
-
if (ht.has(e.id))
|
|
485
|
-
return ht.get(e.id);
|
|
486
|
-
const t = (r, o) => {
|
|
487
|
-
if (ht.has(r.id))
|
|
488
|
-
return ht.get(r.id);
|
|
489
|
-
const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown", f = (() => {
|
|
490
|
-
switch (s) {
|
|
491
|
-
case "string":
|
|
492
|
-
return `"${i[0]}"`;
|
|
493
|
-
case "regex":
|
|
494
|
-
case "regexConcat":
|
|
495
|
-
case "regexWrap":
|
|
496
|
-
return `${i[0]}`;
|
|
497
|
-
case "wrap":
|
|
498
|
-
case "trim": {
|
|
499
|
-
const [p, u] = i;
|
|
500
|
-
return `${t(p, o)} ${c} ${t(u, o)}`;
|
|
501
|
-
}
|
|
502
|
-
case "trimWhitespace":
|
|
503
|
-
return `${c}?w`;
|
|
504
|
-
case "not":
|
|
505
|
-
return `!${c}`;
|
|
506
|
-
case "opt":
|
|
507
|
-
return `${c}?`;
|
|
508
|
-
case "next": {
|
|
509
|
-
const [p] = i;
|
|
510
|
-
return `${c} >> ${t(p, o)}`;
|
|
511
|
-
}
|
|
512
|
-
case "skip": {
|
|
513
|
-
const [p] = i;
|
|
514
|
-
return `${c} << ${t(p, o)}`;
|
|
515
|
-
}
|
|
516
|
-
case "map":
|
|
517
|
-
return c;
|
|
518
|
-
case "all":
|
|
519
|
-
case "then":
|
|
520
|
-
return `[${i.map(
|
|
521
|
-
(u) => t(u, o)
|
|
522
|
-
).join(", ")}]`;
|
|
523
|
-
case "any":
|
|
524
|
-
case "or":
|
|
525
|
-
return i.map(
|
|
526
|
-
(u) => t(u, o)
|
|
527
|
-
).join(" | ");
|
|
528
|
-
case "many": {
|
|
529
|
-
const [p, u] = i, h = u === 1 / 0 ? `${p},` : `${p},${u}`;
|
|
530
|
-
return `${c} {${h}}`;
|
|
531
|
-
}
|
|
532
|
-
case "sepBy":
|
|
533
|
-
return `${c} sepBy ${t(i[0], o)}`;
|
|
534
|
-
case "lazy": {
|
|
535
|
-
const [p] = i, u = To(p);
|
|
536
|
-
if (o)
|
|
537
|
-
return s;
|
|
538
|
-
{
|
|
539
|
-
const h = t(u, u.id);
|
|
540
|
-
return ht.set(u.id, h), h;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
case "debug":
|
|
544
|
-
return c;
|
|
545
|
-
default:
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
})() ?? s ?? "unknown";
|
|
549
|
-
return o && ht.set(r.id, f), f;
|
|
550
|
-
}, n = t(e);
|
|
551
|
-
return ht.set(e.id, n), n;
|
|
552
|
-
}
|
|
553
|
-
function br(e, t = "", n = "") {
|
|
554
|
-
const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ? Tn(e, "", e.isError) : Tn(e, "^", e.isError);
|
|
555
|
-
return `${a}
|
|
556
|
-
${c}`;
|
|
557
|
-
}
|
|
558
|
-
function Eo(e, t = "", n = !1, r = console.log) {
|
|
559
|
-
const o = (s) => {
|
|
560
|
-
const i = e.parser(s), a = n ? mr(e) : e.context.name ?? "", c = br(
|
|
561
|
-
i,
|
|
562
|
-
t,
|
|
563
|
-
a
|
|
564
|
-
);
|
|
565
|
-
return r(c), i;
|
|
566
|
-
};
|
|
567
|
-
return new T(o, R("debug", e, r));
|
|
568
|
-
}
|
|
569
|
-
class Gt {
|
|
570
|
-
constructor(t, n = void 0, r = 0, o = !1, s = 0) {
|
|
571
|
-
this.src = t, this.value = n, this.offset = r, this.isError = o, this.furthest = s;
|
|
572
|
-
}
|
|
573
|
-
/** Parser names/descriptions that were expected at the failure point. */
|
|
574
|
-
expected;
|
|
575
|
-
ok(t, n = 0) {
|
|
576
|
-
return this.offset += n, this.value = t, this.isError = !1, this;
|
|
577
|
-
}
|
|
578
|
-
err(t, n = 0) {
|
|
579
|
-
return this.offset += n, this.value = t, this.isError = !0, this;
|
|
580
|
-
}
|
|
581
|
-
from(t, n = 0) {
|
|
582
|
-
return this.offset += n, this.value = t, this;
|
|
583
|
-
}
|
|
584
|
-
save() {
|
|
585
|
-
return { offset: this.offset, value: this.value };
|
|
586
|
-
}
|
|
587
|
-
restore(t) {
|
|
588
|
-
return this.offset = t.offset, this.value = t.value, this.isError = !1, this;
|
|
589
|
-
}
|
|
590
|
-
clone() {
|
|
591
|
-
return new Gt(
|
|
592
|
-
this.src,
|
|
593
|
-
this.value,
|
|
594
|
-
this.offset,
|
|
595
|
-
this.isError,
|
|
596
|
-
this.furthest
|
|
597
|
-
);
|
|
598
|
-
}
|
|
599
|
-
getColumnNumber() {
|
|
600
|
-
const t = this.offset, n = this.src.lastIndexOf(`
|
|
601
|
-
`, t), r = n === -1 ? t : t - (n + 1);
|
|
602
|
-
return Math.max(0, r);
|
|
603
|
-
}
|
|
604
|
-
getLineNumber() {
|
|
605
|
-
const t = this.src.lastIndexOf(`
|
|
606
|
-
`, this.offset);
|
|
607
|
-
return t >= 0 ? this.src.slice(0, t).split(`
|
|
608
|
-
`).length : 0;
|
|
609
|
-
}
|
|
610
|
-
toString() {
|
|
611
|
-
return br(this);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
function R(e, t, ...n) {
|
|
615
|
-
return {
|
|
616
|
-
name: e,
|
|
617
|
-
parser: t,
|
|
618
|
-
args: n
|
|
619
|
-
};
|
|
620
|
-
}
|
|
621
|
-
let vo = 0;
|
|
622
|
-
const mt = /* @__PURE__ */ new Map(), zt = /* @__PURE__ */ new Map(), gr = 20, Mo = (1 << gr) - 1;
|
|
623
|
-
let Rt = -1, Vt;
|
|
624
|
-
function z(e, t) {
|
|
625
|
-
return e.offset > Rt ? (Rt = e.offset, Vt = e, e.expected = void 0) : e.offset, Vt;
|
|
626
|
-
}
|
|
627
|
-
function To(e) {
|
|
628
|
-
return e.parser ? e.parser : e.parser = e();
|
|
629
|
-
}
|
|
630
|
-
function Ao(e) {
|
|
631
|
-
let t;
|
|
632
|
-
return (n) => (t || (t = e()), t.parser(n));
|
|
633
|
-
}
|
|
634
|
-
const Io = 0, Lt = 1, Oo = 2;
|
|
635
|
-
class T {
|
|
636
|
-
constructor(t, n = {}) {
|
|
637
|
-
this.parser = t, this.context = n;
|
|
638
|
-
}
|
|
639
|
-
id = vo++;
|
|
640
|
-
state;
|
|
641
|
-
flags = Io;
|
|
642
|
-
reset() {
|
|
643
|
-
Vt = void 0, Rt = -1, mt.clear(), zt.clear();
|
|
644
|
-
}
|
|
645
|
-
parseState(t) {
|
|
646
|
-
this.reset();
|
|
647
|
-
const n = new Gt(t);
|
|
648
|
-
if (this.parser(n), n.isError && Vt) {
|
|
649
|
-
const r = new Gt(t, void 0, Rt, !0);
|
|
650
|
-
this.state = r;
|
|
651
|
-
} else
|
|
652
|
-
this.state = n, n.isError;
|
|
653
|
-
return n;
|
|
654
|
-
}
|
|
655
|
-
parse(t) {
|
|
656
|
-
return this.parseState(t).value;
|
|
657
|
-
}
|
|
658
|
-
getCijKey(t) {
|
|
659
|
-
return this.id << gr | t.offset & Mo;
|
|
660
|
-
}
|
|
661
|
-
atLeftRecursionLimit(t) {
|
|
662
|
-
return (zt.get(this.getCijKey(t)) ?? 0) > t.src.length - t.offset;
|
|
663
|
-
}
|
|
664
|
-
memoize() {
|
|
665
|
-
const t = (n) => {
|
|
666
|
-
const r = this.getCijKey(n), o = zt.get(r) ?? 0, s = mt.get(this.id);
|
|
667
|
-
if (s && s.offset >= n.offset)
|
|
668
|
-
return n.offset = s.offset, n.value = s.value, n.isError = s.isError, n;
|
|
669
|
-
if (this.atLeftRecursionLimit(n))
|
|
670
|
-
return n.isError = !0, n;
|
|
671
|
-
zt.set(r, o + 1), this.parser(n);
|
|
672
|
-
const i = mt.get(this.id);
|
|
673
|
-
return i && i.offset > n.offset ? n.offset = i.offset : i || mt.set(this.id, n.clone()), n;
|
|
674
|
-
};
|
|
675
|
-
return new T(
|
|
676
|
-
t,
|
|
677
|
-
R("memoize", this)
|
|
678
|
-
);
|
|
679
|
-
}
|
|
680
|
-
mergeMemos() {
|
|
681
|
-
const t = (n) => {
|
|
682
|
-
const r = mt.get(this.id);
|
|
683
|
-
return r ? (n.offset = r.offset, n.value = r.value, n.isError = r.isError, n) : this.atLeftRecursionLimit(n) ? (n.isError = !0, n) : (this.parser(n), mt.get(this.id) || mt.set(this.id, n.clone()), n);
|
|
684
|
-
};
|
|
685
|
-
return new T(
|
|
686
|
-
t,
|
|
687
|
-
R("mergeMemo", this)
|
|
688
|
-
);
|
|
689
|
-
}
|
|
690
|
-
then(t) {
|
|
691
|
-
const n = (r) => {
|
|
692
|
-
const o = r.offset;
|
|
693
|
-
if (this.parser(r), !r.isError) {
|
|
694
|
-
const s = r.value;
|
|
695
|
-
if (t.parser(r), !r.isError)
|
|
696
|
-
return r.ok([s, r.value]);
|
|
697
|
-
}
|
|
698
|
-
return z(r), r.offset = o, r.isError = !0, r;
|
|
699
|
-
};
|
|
700
|
-
return new T(
|
|
701
|
-
n,
|
|
702
|
-
R("then", this, this, t)
|
|
703
|
-
);
|
|
704
|
-
}
|
|
705
|
-
or(t) {
|
|
706
|
-
const n = (r) => {
|
|
707
|
-
const o = r.offset;
|
|
708
|
-
return this.parser(r), r.isError ? (r.offset = o, r.isError = !1, t.parser(r)) : r;
|
|
709
|
-
};
|
|
710
|
-
return new T(
|
|
711
|
-
n,
|
|
712
|
-
R("or", this, this, t)
|
|
713
|
-
);
|
|
714
|
-
}
|
|
715
|
-
chain(t, n = !1) {
|
|
716
|
-
const r = (o) => (this.parser(o), o.isError ? o : o.value || n ? t(o.value).parser(o) : o);
|
|
717
|
-
return new T(
|
|
718
|
-
r,
|
|
719
|
-
R("chain", this, t)
|
|
720
|
-
);
|
|
721
|
-
}
|
|
722
|
-
map(t, n = !1) {
|
|
723
|
-
const r = (o) => (this.parser(o), !o.isError || n ? o.ok(t(o.value)) : o);
|
|
724
|
-
return new T(
|
|
725
|
-
r,
|
|
726
|
-
R("map", this)
|
|
727
|
-
);
|
|
728
|
-
}
|
|
729
|
-
mapState(t) {
|
|
730
|
-
const n = (r) => {
|
|
731
|
-
const o = r.offset, s = r.value;
|
|
732
|
-
if (this.parser(r), r.isError)
|
|
733
|
-
return r;
|
|
734
|
-
const i = Object.create(r);
|
|
735
|
-
return i.offset = o, i.value = s, t(r, i);
|
|
736
|
-
};
|
|
737
|
-
return new T(
|
|
738
|
-
n,
|
|
739
|
-
R("mapState", this)
|
|
740
|
-
);
|
|
741
|
-
}
|
|
742
|
-
skip(t) {
|
|
743
|
-
const n = (r) => {
|
|
744
|
-
const o = r.offset;
|
|
745
|
-
if (this.parser(r), !r.isError) {
|
|
746
|
-
const s = r.value;
|
|
747
|
-
if (t.parser(r), !r.isError)
|
|
748
|
-
return r.ok(s);
|
|
749
|
-
}
|
|
750
|
-
return z(r), r.offset = o, r.isError = !0, r;
|
|
751
|
-
};
|
|
752
|
-
return new T(
|
|
753
|
-
n,
|
|
754
|
-
R("skip", this, t)
|
|
755
|
-
);
|
|
756
|
-
}
|
|
757
|
-
next(t) {
|
|
758
|
-
const n = (r) => {
|
|
759
|
-
const o = r.offset;
|
|
760
|
-
return this.parser(r), !r.isError && (t.parser(r), !r.isError) || (z(r), r.offset = o, r.isError = !0), r;
|
|
761
|
-
};
|
|
762
|
-
return new T(
|
|
763
|
-
n,
|
|
764
|
-
R("next", this, t)
|
|
765
|
-
);
|
|
766
|
-
}
|
|
767
|
-
opt() {
|
|
768
|
-
const t = (n) => {
|
|
769
|
-
const r = n.offset;
|
|
770
|
-
return this.parser(n), n.isError ? (z(n), n.offset = r, n.ok(void 0)) : n;
|
|
771
|
-
};
|
|
772
|
-
return new T(
|
|
773
|
-
t,
|
|
774
|
-
R("opt", this)
|
|
775
|
-
);
|
|
776
|
-
}
|
|
777
|
-
not(t) {
|
|
778
|
-
const n = (o) => {
|
|
779
|
-
const s = o.offset, i = o.value;
|
|
780
|
-
return this.parser(o), o.isError ? (z(o), o.offset = s, o.ok(i)) : (o.offset = s, o.isError = !0, o);
|
|
781
|
-
}, r = (o) => {
|
|
782
|
-
const s = o.offset;
|
|
783
|
-
if (this.parser(o), o.isError)
|
|
784
|
-
return z(o), o.offset = s, o.isError = !0, o;
|
|
785
|
-
{
|
|
786
|
-
const i = o.value, a = o.offset;
|
|
787
|
-
return o.offset = s, o.isError = !1, t.parser(o), o.isError ? (o.offset = a, o.value = i, o.isError = !1, o) : (z(o), o.offset = s, o.isError = !0, o);
|
|
788
|
-
}
|
|
789
|
-
};
|
|
790
|
-
return new T(
|
|
791
|
-
t ? r : n,
|
|
792
|
-
R("not", this, t)
|
|
793
|
-
);
|
|
794
|
-
}
|
|
795
|
-
wrap(t, n, r = !0) {
|
|
796
|
-
if (!r)
|
|
797
|
-
return A(t, this, n);
|
|
798
|
-
const o = this, s = (i) => {
|
|
799
|
-
const a = i.offset;
|
|
800
|
-
if (t.parser(i), i.isError)
|
|
801
|
-
return i.offset = a, i;
|
|
802
|
-
if (o.parser(i), i.isError)
|
|
803
|
-
return z(i), i.offset = a, i.isError = !0, i;
|
|
804
|
-
const c = i.value;
|
|
805
|
-
return n.parser(i), i.isError ? (z(i), i.offset = a, i.isError = !0, i) : (i.value = c, i);
|
|
806
|
-
};
|
|
807
|
-
return new T(
|
|
808
|
-
s,
|
|
809
|
-
R("wrap", this, t, n)
|
|
810
|
-
);
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* Call the parser with flag-based pre/post processing.
|
|
814
|
-
* Fast path: flags === 0 just calls parser directly.
|
|
815
|
-
*/
|
|
816
|
-
call(t) {
|
|
817
|
-
if (this.flags === 0)
|
|
818
|
-
return this.parser(t);
|
|
819
|
-
if (this.flags === Lt) {
|
|
820
|
-
wt(t);
|
|
821
|
-
const r = t.offset;
|
|
822
|
-
return this.parser(t), t.isError ? (z(t), t.offset = r, t.isError = !0, t) : (wt(t), t);
|
|
823
|
-
}
|
|
824
|
-
this.flags & Lt && wt(t);
|
|
825
|
-
const n = t.offset;
|
|
826
|
-
return this.parser(t), t.isError ? (z(t), t.offset = n, t.isError = !0, t) : (this.flags & Lt && wt(t), this.flags & Oo && t.offset < t.src.length && (z(t), t.offset = n, t.isError = !0), t);
|
|
827
|
-
}
|
|
828
|
-
trim(t = w, n = !0) {
|
|
829
|
-
if (!n)
|
|
830
|
-
return A(t, this, t);
|
|
831
|
-
if (t.context?.name === "whitespace") {
|
|
832
|
-
const r = this, o = new T(
|
|
833
|
-
((i) => r.call(i)),
|
|
834
|
-
R("trimWhitespace", this)
|
|
835
|
-
);
|
|
836
|
-
o.flags = this.flags | Lt;
|
|
837
|
-
const s = (i) => {
|
|
838
|
-
wt(i);
|
|
839
|
-
const a = i.offset;
|
|
840
|
-
return r.parser(i), i.isError ? (z(i), i.offset = a, i.isError = !0, i) : (wt(i), i);
|
|
841
|
-
};
|
|
842
|
-
return new T(
|
|
843
|
-
s,
|
|
844
|
-
R("trimWhitespace", this)
|
|
845
|
-
);
|
|
846
|
-
}
|
|
847
|
-
return this.wrap(t, t);
|
|
848
|
-
}
|
|
849
|
-
many(t = 0, n = 1 / 0) {
|
|
850
|
-
const r = (o) => {
|
|
851
|
-
const s = t > 0 ? t : 0, i = s > 0 ? new Array(s) : [];
|
|
852
|
-
let a = 0;
|
|
853
|
-
for (let c = 0; c < n; c += 1) {
|
|
854
|
-
const l = o.offset;
|
|
855
|
-
if (this.parser(o), o.isError) {
|
|
856
|
-
o.offset = l, o.isError = !1;
|
|
857
|
-
break;
|
|
858
|
-
}
|
|
859
|
-
if (o.offset === l) break;
|
|
860
|
-
a < s ? i[a] = o.value : i.push(o.value), a++;
|
|
861
|
-
}
|
|
862
|
-
return a < s && (i.length = a), a >= t ? o.ok(i) : (z(o), o.isError = !0, o.value = [], o);
|
|
863
|
-
};
|
|
864
|
-
return new T(
|
|
865
|
-
r,
|
|
866
|
-
R("many", this, t, n)
|
|
867
|
-
);
|
|
868
|
-
}
|
|
869
|
-
sepBy(t, n = 0, r = 1 / 0) {
|
|
870
|
-
const o = (s) => {
|
|
871
|
-
const i = n > 0 ? n : 0, a = i > 0 ? new Array(i) : [];
|
|
872
|
-
let c = 0;
|
|
873
|
-
for (let l = 0; l < r; l += 1) {
|
|
874
|
-
const f = s.offset;
|
|
875
|
-
if (this.parser(s), s.isError) {
|
|
876
|
-
s.offset = f, s.isError = !1;
|
|
877
|
-
break;
|
|
878
|
-
}
|
|
879
|
-
if (s.offset === f) break;
|
|
880
|
-
c < i ? a[c] = s.value : a.push(s.value), c++;
|
|
881
|
-
const p = s.offset;
|
|
882
|
-
if (t.parser(s), s.isError) {
|
|
883
|
-
s.offset = p, s.isError = !1;
|
|
884
|
-
break;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
return c < i && (a.length = c), c >= n ? s.ok(a) : (z(s), s.isError = !0, s.value = [], s);
|
|
888
|
-
};
|
|
889
|
-
return new T(
|
|
890
|
-
o,
|
|
891
|
-
R("sepBy", this, t)
|
|
892
|
-
);
|
|
893
|
-
}
|
|
894
|
-
eof() {
|
|
895
|
-
const t = this.skip(Ro());
|
|
896
|
-
return t.context = R("eof", this), t;
|
|
897
|
-
}
|
|
898
|
-
debug(t = "", n = !1, r = console.log) {
|
|
899
|
-
return Eo(this, t, n, r);
|
|
900
|
-
}
|
|
901
|
-
toString() {
|
|
902
|
-
return mr(this);
|
|
903
|
-
}
|
|
904
|
-
static lazy(t) {
|
|
905
|
-
return new T(
|
|
906
|
-
Ao(t),
|
|
907
|
-
R("lazy", void 0, t)
|
|
908
|
-
);
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
function Ro() {
|
|
912
|
-
const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (z(t), t.isError = !0, t);
|
|
913
|
-
return new T(
|
|
914
|
-
e,
|
|
915
|
-
R("eof", void 0)
|
|
916
|
-
);
|
|
917
|
-
}
|
|
918
|
-
function d(...e) {
|
|
919
|
-
const t = (n) => {
|
|
920
|
-
const r = n.offset;
|
|
921
|
-
for (const o of e) {
|
|
922
|
-
if (o.parser(n), !n.isError)
|
|
923
|
-
return n;
|
|
924
|
-
n.offset = r, n.isError = !1;
|
|
925
|
-
}
|
|
926
|
-
return z(n), n.isError = !0, n;
|
|
927
|
-
};
|
|
928
|
-
return new T(
|
|
929
|
-
e.length === 1 ? e[0].parser : t,
|
|
930
|
-
R("any", void 0, ...e)
|
|
931
|
-
);
|
|
932
|
-
}
|
|
933
|
-
function A(...e) {
|
|
934
|
-
const t = (n) => {
|
|
935
|
-
const r = [], o = n.offset;
|
|
936
|
-
for (const s of e) {
|
|
937
|
-
if (s.parser(n), n.isError)
|
|
938
|
-
return n.offset = o, n.isError = !0, n;
|
|
939
|
-
n.value !== void 0 && r.push(n.value);
|
|
940
|
-
}
|
|
941
|
-
return n.ok(r);
|
|
942
|
-
};
|
|
943
|
-
return new T(
|
|
944
|
-
e.length === 1 ? e[0].parser : t,
|
|
945
|
-
R("all", void 0, ...e)
|
|
946
|
-
);
|
|
947
|
-
}
|
|
948
|
-
function k(e) {
|
|
949
|
-
const t = e.length;
|
|
950
|
-
let n;
|
|
951
|
-
if (t === 1) {
|
|
952
|
-
const r = e.charCodeAt(0);
|
|
953
|
-
n = ((o) => o.src.charCodeAt(o.offset) === r ? (o.offset += 1, o.value = e, o.isError = !1, o) : (z(o), o.isError = !0, o));
|
|
954
|
-
} else
|
|
955
|
-
n = ((r) => r.src.startsWith(e, r.offset) ? (r.offset += t, r.value = e, r.isError = !1, r) : (z(r), r.isError = !0, r));
|
|
956
|
-
return new T(
|
|
957
|
-
n,
|
|
958
|
-
R("string", void 0, e)
|
|
959
|
-
);
|
|
960
|
-
}
|
|
961
|
-
function Y(e, t) {
|
|
962
|
-
const n = e.flags.replace(/y/g, ""), r = new RegExp(e, n + "y"), o = t != null, s = (i) => {
|
|
963
|
-
if (i.offset >= i.src.length)
|
|
964
|
-
return i.isError = !0, i;
|
|
965
|
-
const a = i.offset;
|
|
966
|
-
if (r.lastIndex = a, o) {
|
|
967
|
-
const c = r.exec(i.src), l = t(c);
|
|
968
|
-
if (l)
|
|
969
|
-
return i.ok(l, r.lastIndex - a);
|
|
970
|
-
if (l === "")
|
|
971
|
-
return i.ok(void 0);
|
|
972
|
-
} else if (r.test(i.src)) {
|
|
973
|
-
const c = r.lastIndex;
|
|
974
|
-
return c > a ? (i.offset = c, i.value = i.src.substring(a, c), i.isError = !1, i) : (i.value = void 0, i.isError = !1, i);
|
|
975
|
-
}
|
|
976
|
-
return z(i), i.isError = !0, i;
|
|
977
|
-
};
|
|
978
|
-
return new T(
|
|
979
|
-
s,
|
|
980
|
-
R("regex", void 0, e)
|
|
981
|
-
);
|
|
982
|
-
}
|
|
983
|
-
const wt = (e) => {
|
|
984
|
-
const t = e.src, n = t.length;
|
|
985
|
-
let r = e.offset;
|
|
986
|
-
if (r >= n || t.charCodeAt(r) > 32) return e;
|
|
987
|
-
for (; r < n; ) {
|
|
988
|
-
const o = t.charCodeAt(r);
|
|
989
|
-
if (o === 32 || o >= 9 && o <= 13)
|
|
990
|
-
r++;
|
|
991
|
-
else
|
|
992
|
-
break;
|
|
993
|
-
}
|
|
994
|
-
return e.offset = r, e;
|
|
995
|
-
}, w = Y(/\s*/);
|
|
996
|
-
w.context.name = "whitespace";
|
|
997
|
-
function P(e, t) {
|
|
998
|
-
const [n, r, o] = e;
|
|
999
|
-
return [
|
|
1000
|
-
t[0] * n + t[1] * r + t[2] * o,
|
|
1001
|
-
t[3] * n + t[4] * r + t[5] * o,
|
|
1002
|
-
t[6] * n + t[7] * r + t[8] * o
|
|
1003
|
-
];
|
|
1004
|
-
}
|
|
1005
|
-
function Ka(e) {
|
|
1006
|
-
return [
|
|
1007
|
-
e[0],
|
|
1008
|
-
e[3],
|
|
1009
|
-
e[6],
|
|
1010
|
-
e[1],
|
|
1011
|
-
e[4],
|
|
1012
|
-
e[7],
|
|
1013
|
-
e[2],
|
|
1014
|
-
e[5],
|
|
1015
|
-
e[8]
|
|
1016
|
-
];
|
|
1017
|
-
}
|
|
1018
|
-
function qa(e, t) {
|
|
1019
|
-
return [
|
|
1020
|
-
e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
|
|
1021
|
-
e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
|
|
1022
|
-
e[0] * t[2] + e[1] * t[5] + e[2] * t[8],
|
|
1023
|
-
e[3] * t[0] + e[4] * t[3] + e[5] * t[6],
|
|
1024
|
-
e[3] * t[1] + e[4] * t[4] + e[5] * t[7],
|
|
1025
|
-
e[3] * t[2] + e[4] * t[5] + e[5] * t[8],
|
|
1026
|
-
e[6] * t[0] + e[7] * t[3] + e[8] * t[6],
|
|
1027
|
-
e[6] * t[1] + e[7] * t[4] + e[8] * t[7],
|
|
1028
|
-
e[6] * t[2] + e[7] * t[5] + e[8] * t[8]
|
|
1029
|
-
];
|
|
1030
|
-
}
|
|
1031
|
-
function ct(e) {
|
|
1032
|
-
const [t, n, r, o, s, i, a, c, l] = e, f = s * l - i * c, p = -(o * l - i * a), u = o * c - s * a, m = 1 / (t * f + n * p + r * u);
|
|
1033
|
-
return [
|
|
1034
|
-
f * m,
|
|
1035
|
-
(r * c - n * l) * m,
|
|
1036
|
-
(n * i - r * s) * m,
|
|
1037
|
-
p * m,
|
|
1038
|
-
(t * l - r * a) * m,
|
|
1039
|
-
(r * o - t * i) * m,
|
|
1040
|
-
u * m,
|
|
1041
|
-
(n * a - t * c) * m,
|
|
1042
|
-
(t * s - n * o) * m
|
|
1043
|
-
];
|
|
1044
|
-
}
|
|
1045
|
-
const L = 255, y = {
|
|
1046
|
-
"%": { min: 0, max: 100 },
|
|
1047
|
-
number: { min: 0, max: 1 }
|
|
1048
|
-
}, ke = {
|
|
1049
|
-
"%": y["%"],
|
|
1050
|
-
number: { min: 0, max: L }
|
|
1051
|
-
}, U = {
|
|
1052
|
-
"%": y["%"],
|
|
1053
|
-
number: y.number
|
|
1054
|
-
}, It = {
|
|
1055
|
-
deg: { min: 0, max: 360 },
|
|
1056
|
-
number: { min: 0, max: 360 },
|
|
1057
|
-
"%": y["%"]
|
|
1058
|
-
}, C = {
|
|
1059
|
-
rgb: {
|
|
1060
|
-
r: ke,
|
|
1061
|
-
g: ke,
|
|
1062
|
-
b: ke,
|
|
1063
|
-
alpha: y
|
|
1064
|
-
},
|
|
1065
|
-
hsl: {
|
|
1066
|
-
h: It,
|
|
1067
|
-
s: { "%": y["%"], number: y.number },
|
|
1068
|
-
l: { "%": y["%"], number: y.number },
|
|
1069
|
-
alpha: y
|
|
1070
|
-
},
|
|
1071
|
-
hsv: {
|
|
1072
|
-
h: It,
|
|
1073
|
-
s: { "%": y["%"], number: y.number },
|
|
1074
|
-
v: { "%": y["%"], number: y.number },
|
|
1075
|
-
alpha: y
|
|
1076
|
-
},
|
|
1077
|
-
hwb: {
|
|
1078
|
-
h: It,
|
|
1079
|
-
w: { "%": y["%"], number: y.number },
|
|
1080
|
-
b: { "%": y["%"], number: y.number },
|
|
1081
|
-
alpha: y
|
|
1082
|
-
},
|
|
1083
|
-
lab: {
|
|
1084
|
-
l: { "%": y["%"], number: y["%"] },
|
|
1085
|
-
a: { number: { min: -125, max: 125 }, "%": { min: -100, max: 100 } },
|
|
1086
|
-
b: { number: { min: -125, max: 125 }, "%": { min: -100, max: 100 } },
|
|
1087
|
-
alpha: y
|
|
1088
|
-
},
|
|
1089
|
-
lch: {
|
|
1090
|
-
l: { "%": y["%"], number: y["%"] },
|
|
1091
|
-
c: { number: { min: 0, max: 150 }, "%": y["%"] },
|
|
1092
|
-
h: It,
|
|
1093
|
-
alpha: y
|
|
1094
|
-
},
|
|
1095
|
-
oklab: {
|
|
1096
|
-
l: { "%": y["%"], number: y.number },
|
|
1097
|
-
a: { number: { min: -0.4, max: 0.4 }, "%": { min: -100, max: 100 } },
|
|
1098
|
-
b: { number: { min: -0.4, max: 0.4 }, "%": { min: -100, max: 100 } },
|
|
1099
|
-
alpha: y
|
|
1100
|
-
},
|
|
1101
|
-
oklch: {
|
|
1102
|
-
l: { "%": y["%"], number: y.number },
|
|
1103
|
-
c: { number: { min: 0, max: 0.5 }, "%": y["%"] },
|
|
1104
|
-
h: It,
|
|
1105
|
-
alpha: y
|
|
1106
|
-
},
|
|
1107
|
-
xyz: {
|
|
1108
|
-
x: { "%": y["%"], number: y.number },
|
|
1109
|
-
y: { "%": y["%"], number: y.number },
|
|
1110
|
-
z: { "%": y["%"], number: y.number },
|
|
1111
|
-
alpha: y
|
|
1112
|
-
},
|
|
1113
|
-
kelvin: {
|
|
1114
|
-
kelvin: { number: { min: 1e3, max: 4e4 } },
|
|
1115
|
-
alpha: y
|
|
1116
|
-
},
|
|
1117
|
-
"srgb-linear": {
|
|
1118
|
-
r: U,
|
|
1119
|
-
g: U,
|
|
1120
|
-
b: U,
|
|
1121
|
-
alpha: y
|
|
1122
|
-
},
|
|
1123
|
-
"display-p3": {
|
|
1124
|
-
r: U,
|
|
1125
|
-
g: U,
|
|
1126
|
-
b: U,
|
|
1127
|
-
alpha: y
|
|
1128
|
-
},
|
|
1129
|
-
"a98-rgb": {
|
|
1130
|
-
r: U,
|
|
1131
|
-
g: U,
|
|
1132
|
-
b: U,
|
|
1133
|
-
alpha: y
|
|
1134
|
-
},
|
|
1135
|
-
"prophoto-rgb": {
|
|
1136
|
-
r: U,
|
|
1137
|
-
g: U,
|
|
1138
|
-
b: U,
|
|
1139
|
-
alpha: y
|
|
1140
|
-
},
|
|
1141
|
-
rec2020: {
|
|
1142
|
-
r: U,
|
|
1143
|
-
g: U,
|
|
1144
|
-
b: U,
|
|
1145
|
-
alpha: y
|
|
1146
|
-
}
|
|
1147
|
-
}, G = "%", dr = {
|
|
1148
|
-
rgb: {
|
|
1149
|
-
r: "",
|
|
1150
|
-
g: "",
|
|
1151
|
-
b: "",
|
|
1152
|
-
alpha: G
|
|
1153
|
-
},
|
|
1154
|
-
hsl: {
|
|
1155
|
-
h: "deg",
|
|
1156
|
-
s: "%",
|
|
1157
|
-
l: "%",
|
|
1158
|
-
alpha: G
|
|
1159
|
-
},
|
|
1160
|
-
hsv: {
|
|
1161
|
-
h: "deg",
|
|
1162
|
-
s: "%",
|
|
1163
|
-
v: "%",
|
|
1164
|
-
alpha: G
|
|
1165
|
-
},
|
|
1166
|
-
hwb: {
|
|
1167
|
-
h: "deg",
|
|
1168
|
-
w: "%",
|
|
1169
|
-
b: "%",
|
|
1170
|
-
alpha: G
|
|
1171
|
-
},
|
|
1172
|
-
lab: {
|
|
1173
|
-
l: "%",
|
|
1174
|
-
a: "",
|
|
1175
|
-
b: "",
|
|
1176
|
-
alpha: G
|
|
1177
|
-
},
|
|
1178
|
-
lch: {
|
|
1179
|
-
l: "%",
|
|
1180
|
-
c: "",
|
|
1181
|
-
h: "deg",
|
|
1182
|
-
alpha: G
|
|
1183
|
-
},
|
|
1184
|
-
oklab: {
|
|
1185
|
-
l: "%",
|
|
1186
|
-
a: "",
|
|
1187
|
-
b: "",
|
|
1188
|
-
alpha: G
|
|
1189
|
-
},
|
|
1190
|
-
oklch: {
|
|
1191
|
-
l: "%",
|
|
1192
|
-
c: "",
|
|
1193
|
-
h: "deg",
|
|
1194
|
-
alpha: G
|
|
1195
|
-
},
|
|
1196
|
-
xyz: {
|
|
1197
|
-
x: "%",
|
|
1198
|
-
y: "%",
|
|
1199
|
-
z: "%",
|
|
1200
|
-
alpha: G
|
|
1201
|
-
},
|
|
1202
|
-
kelvin: {
|
|
1203
|
-
kelvin: "K",
|
|
1204
|
-
alpha: G
|
|
1205
|
-
},
|
|
1206
|
-
"srgb-linear": {
|
|
1207
|
-
r: "",
|
|
1208
|
-
g: "",
|
|
1209
|
-
b: "",
|
|
1210
|
-
alpha: G
|
|
1211
|
-
},
|
|
1212
|
-
"display-p3": {
|
|
1213
|
-
r: "",
|
|
1214
|
-
g: "",
|
|
1215
|
-
b: "",
|
|
1216
|
-
alpha: G
|
|
1217
|
-
},
|
|
1218
|
-
"a98-rgb": {
|
|
1219
|
-
r: "",
|
|
1220
|
-
g: "",
|
|
1221
|
-
b: "",
|
|
1222
|
-
alpha: G
|
|
1223
|
-
},
|
|
1224
|
-
"prophoto-rgb": {
|
|
1225
|
-
r: "",
|
|
1226
|
-
g: "",
|
|
1227
|
-
b: "",
|
|
1228
|
-
alpha: G
|
|
1229
|
-
},
|
|
1230
|
-
rec2020: {
|
|
1231
|
-
r: "",
|
|
1232
|
-
g: "",
|
|
1233
|
-
b: "",
|
|
1234
|
-
alpha: G
|
|
1235
|
-
}
|
|
1236
|
-
}, Ja = {
|
|
1237
|
-
rgb: "RGB",
|
|
1238
|
-
hsl: "HSL",
|
|
1239
|
-
hsv: "HSV",
|
|
1240
|
-
hwb: "HWB",
|
|
1241
|
-
lab: "Lab",
|
|
1242
|
-
lch: "LCh",
|
|
1243
|
-
oklab: "OKLab",
|
|
1244
|
-
oklch: "OKLCh",
|
|
1245
|
-
xyz: "XYZ",
|
|
1246
|
-
kelvin: "Kelvin",
|
|
1247
|
-
"srgb-linear": "sRGB Linear",
|
|
1248
|
-
"display-p3": "Display P3",
|
|
1249
|
-
"a98-rgb": "Adobe RGB",
|
|
1250
|
-
"prophoto-rgb": "ProPhoto RGB",
|
|
1251
|
-
rec2020: "Rec. 2020"
|
|
1252
|
-
}, Bo = [
|
|
1253
|
-
0.3127 / 0.329,
|
|
1254
|
-
1,
|
|
1255
|
-
(1 - 0.3127 - 0.329) / 0.329
|
|
1256
|
-
], No = [
|
|
1257
|
-
0.3457 / 0.3585,
|
|
1258
|
-
1,
|
|
1259
|
-
(1 - 0.3457 - 0.3585) / 0.3585
|
|
1260
|
-
], Ze = [
|
|
1261
|
-
1.0479297925449969,
|
|
1262
|
-
0.022946870601609652,
|
|
1263
|
-
-0.05019226628920524,
|
|
1264
|
-
0.02962780877005599,
|
|
1265
|
-
0.9904344267538799,
|
|
1266
|
-
-0.017073799063418826,
|
|
1267
|
-
-0.009243040646204504,
|
|
1268
|
-
0.015055191490298152,
|
|
1269
|
-
0.7518742814281371
|
|
1270
|
-
], wr = ct(Ze), kr = {
|
|
1271
|
-
D65: Bo,
|
|
1272
|
-
D50: No
|
|
1273
|
-
}, yr = [
|
|
1274
|
-
0.819022437996703,
|
|
1275
|
-
0.3619062600528904,
|
|
1276
|
-
-0.1288737815209879,
|
|
1277
|
-
0.0329836539323885,
|
|
1278
|
-
0.9292868615863434,
|
|
1279
|
-
0.0361446663506424,
|
|
1280
|
-
0.0481771893596242,
|
|
1281
|
-
0.2642395317527308,
|
|
1282
|
-
0.6335478284694309
|
|
1283
|
-
], _o = ct(yr), Sr = [
|
|
1284
|
-
0.210454268309314,
|
|
1285
|
-
0.7936177747023054,
|
|
1286
|
-
-0.0040720430116193,
|
|
1287
|
-
1.9779985324311684,
|
|
1288
|
-
-2.42859224204858,
|
|
1289
|
-
0.450593709617411,
|
|
1290
|
-
0.0259040424655478,
|
|
1291
|
-
0.7827717124575296,
|
|
1292
|
-
-0.8086757549230774
|
|
1293
|
-
], Po = ct(Sr), M = [
|
|
1294
|
-
4.0767416621,
|
|
1295
|
-
-3.3077115913,
|
|
1296
|
-
0.2309699292,
|
|
1297
|
-
-1.2684380046,
|
|
1298
|
-
2.6097574011,
|
|
1299
|
-
-0.3413193965,
|
|
1300
|
-
-0.0041960863,
|
|
1301
|
-
-0.7034186147,
|
|
1302
|
-
1.707614701
|
|
1303
|
-
], tt = [
|
|
1304
|
-
0.4122214708,
|
|
1305
|
-
0.5363325363,
|
|
1306
|
-
0.0514459929,
|
|
1307
|
-
0.2119034982,
|
|
1308
|
-
0.6806995451,
|
|
1309
|
-
0.1073969566,
|
|
1310
|
-
0.0883024619,
|
|
1311
|
-
0.2817188376,
|
|
1312
|
-
0.6299787005
|
|
1313
|
-
], $ = {
|
|
1314
|
-
l: [1, 0.3963377774, 0.2158037573],
|
|
1315
|
-
m: [1, -0.1055613458, -0.0638541728],
|
|
1316
|
-
s: [1, -0.0894841775, -1.291485548]
|
|
1317
|
-
}, zo = [
|
|
1318
|
-
{
|
|
1319
|
-
// Red sector: -1.88170328*a - 0.80936493*b > 1
|
|
1320
|
-
test: (e, t) => -1.88170328 * e - 0.80936493 * t > 1,
|
|
1321
|
-
k0: 1.19086277,
|
|
1322
|
-
k1: 1.76576728,
|
|
1323
|
-
k2: 0.59662641,
|
|
1324
|
-
k3: 0.75515197,
|
|
1325
|
-
k4: 0.56771245,
|
|
1326
|
-
wl: 4.0767416621,
|
|
1327
|
-
wm: -3.3077115913,
|
|
1328
|
-
ws: 0.2309699292
|
|
1329
|
-
},
|
|
1330
|
-
{
|
|
1331
|
-
// Green sector: 1.81444104*a - 1.19445276*b > 1
|
|
1332
|
-
test: (e, t) => 1.81444104 * e - 1.19445276 * t > 1,
|
|
1333
|
-
k0: 0.73956515,
|
|
1334
|
-
k1: -0.45954404,
|
|
1335
|
-
k2: 0.08285427,
|
|
1336
|
-
k3: 0.1254107,
|
|
1337
|
-
k4: 0.14503204,
|
|
1338
|
-
wl: -1.2684380046,
|
|
1339
|
-
wm: 2.6097574011,
|
|
1340
|
-
ws: -0.3413193965
|
|
1341
|
-
},
|
|
1342
|
-
{
|
|
1343
|
-
// Blue sector (fallback)
|
|
1344
|
-
test: () => !0,
|
|
1345
|
-
k0: 1.35733652,
|
|
1346
|
-
k1: -915799e-8,
|
|
1347
|
-
k2: -1.1513021,
|
|
1348
|
-
k3: -0.50559606,
|
|
1349
|
-
k4: 692167e-8,
|
|
1350
|
-
wl: -0.0041960863,
|
|
1351
|
-
wm: -0.7034186147,
|
|
1352
|
-
ws: 1.707614701
|
|
1353
|
-
}
|
|
1354
|
-
], An = {
|
|
1355
|
-
aliceblue: "#f0f8ff",
|
|
1356
|
-
antiquewhite: "#faebd7",
|
|
1357
|
-
aqua: "#00ffff",
|
|
1358
|
-
aquamarine: "#7fffd4",
|
|
1359
|
-
azure: "#f0ffff",
|
|
1360
|
-
beige: "#f5f5dc",
|
|
1361
|
-
bisque: "#ffe4c4",
|
|
1362
|
-
black: "#000000",
|
|
1363
|
-
blanchedalmond: "#ffebcd",
|
|
1364
|
-
blue: "#0000ff",
|
|
1365
|
-
blueviolet: "#8a2be2",
|
|
1366
|
-
brown: "#a52a2a",
|
|
1367
|
-
burlywood: "#deb887",
|
|
1368
|
-
cadetblue: "#5f9ea0",
|
|
1369
|
-
chartreuse: "#7fff00",
|
|
1370
|
-
chocolate: "#d2691e",
|
|
1371
|
-
coral: "#ff7f50",
|
|
1372
|
-
cornflowerblue: "#6495ed",
|
|
1373
|
-
cornsilk: "#fff8dc",
|
|
1374
|
-
crimson: "#dc143c",
|
|
1375
|
-
cyan: "#00ffff",
|
|
1376
|
-
darkblue: "#00008b",
|
|
1377
|
-
darkcyan: "#008b8b",
|
|
1378
|
-
darkgoldenrod: "#b8860b",
|
|
1379
|
-
darkgray: "#a9a9a9",
|
|
1380
|
-
darkgreen: "#006400",
|
|
1381
|
-
darkgrey: "#a9a9a9",
|
|
1382
|
-
darkkhaki: "#bdb76b",
|
|
1383
|
-
darkmagenta: "#8b008b",
|
|
1384
|
-
darkolivegreen: "#556b2f",
|
|
1385
|
-
darkorange: "#ff8c00",
|
|
1386
|
-
darkorchid: "#9932cc",
|
|
1387
|
-
darkred: "#8b0000",
|
|
1388
|
-
darksalmon: "#e9967a",
|
|
1389
|
-
darkseagreen: "#8fbc8f",
|
|
1390
|
-
darkslateblue: "#483d8b",
|
|
1391
|
-
darkslategray: "#2f4f4f",
|
|
1392
|
-
darkslategrey: "#2f4f4f",
|
|
1393
|
-
darkturquoise: "#00ced1",
|
|
1394
|
-
darkviolet: "#9400d3",
|
|
1395
|
-
deeppink: "#ff1493",
|
|
1396
|
-
deepskyblue: "#00bfff",
|
|
1397
|
-
dimgray: "#696969",
|
|
1398
|
-
dimgrey: "#696969",
|
|
1399
|
-
dodgerblue: "#1e90ff",
|
|
1400
|
-
firebrick: "#b22222",
|
|
1401
|
-
floralwhite: "#fffaf0",
|
|
1402
|
-
forestgreen: "#228b22",
|
|
1403
|
-
fuchsia: "#ff00ff",
|
|
1404
|
-
gainsboro: "#dcdcdc",
|
|
1405
|
-
ghostwhite: "#f8f8ff",
|
|
1406
|
-
gold: "#ffd700",
|
|
1407
|
-
goldenrod: "#daa520",
|
|
1408
|
-
gray: "#808080",
|
|
1409
|
-
green: "#008000",
|
|
1410
|
-
greenyellow: "#adff2f",
|
|
1411
|
-
grey: "#808080",
|
|
1412
|
-
honeydew: "#f0fff0",
|
|
1413
|
-
hotpink: "#ff69b4",
|
|
1414
|
-
indianred: "#cd5c5c",
|
|
1415
|
-
indigo: "#4b0082",
|
|
1416
|
-
ivory: "#fffff0",
|
|
1417
|
-
khaki: "#f0e68c",
|
|
1418
|
-
lavender: "#e6e6fa",
|
|
1419
|
-
lavenderblush: "#fff0f5",
|
|
1420
|
-
lawngreen: "#7cfc00",
|
|
1421
|
-
lemonchiffon: "#fffacd",
|
|
1422
|
-
lightblue: "#add8e6",
|
|
1423
|
-
lightcoral: "#f08080",
|
|
1424
|
-
lightcyan: "#e0ffff",
|
|
1425
|
-
lightgoldenrodyellow: "#fafad2",
|
|
1426
|
-
lightgray: "#d3d3d3",
|
|
1427
|
-
lightgreen: "#90ee90",
|
|
1428
|
-
lightgrey: "#d3d3d3",
|
|
1429
|
-
lightpink: "#ffb6c1",
|
|
1430
|
-
lightsalmon: "#ffa07a",
|
|
1431
|
-
lightseagreen: "#20b2aa",
|
|
1432
|
-
lightskyblue: "#87cefa",
|
|
1433
|
-
lightslategray: "#778899",
|
|
1434
|
-
lightslategrey: "#778899",
|
|
1435
|
-
lightsteelblue: "#b0c4de",
|
|
1436
|
-
lightyellow: "#ffffe0",
|
|
1437
|
-
lime: "#00ff00",
|
|
1438
|
-
limegreen: "#32cd32",
|
|
1439
|
-
linen: "#faf0e6",
|
|
1440
|
-
magenta: "#ff00ff",
|
|
1441
|
-
maroon: "#800000",
|
|
1442
|
-
mediumaquamarine: "#66cdaa",
|
|
1443
|
-
mediumblue: "#0000cd",
|
|
1444
|
-
mediumorchid: "#ba55d3",
|
|
1445
|
-
mediumpurple: "#9370db",
|
|
1446
|
-
mediumseagreen: "#3cb371",
|
|
1447
|
-
mediumslateblue: "#7b68ee",
|
|
1448
|
-
mediumspringgreen: "#00fa9a",
|
|
1449
|
-
mediumturquoise: "#48d1cc",
|
|
1450
|
-
mediumvioletred: "#c71585",
|
|
1451
|
-
midnightblue: "#191970",
|
|
1452
|
-
mintcream: "#f5fffa",
|
|
1453
|
-
mistyrose: "#ffe4e1",
|
|
1454
|
-
moccasin: "#ffe4b5",
|
|
1455
|
-
navajowhite: "#ffdead",
|
|
1456
|
-
navy: "#000080",
|
|
1457
|
-
oldlace: "#fdf5e6",
|
|
1458
|
-
olive: "#808000",
|
|
1459
|
-
olivedrab: "#6b8e23",
|
|
1460
|
-
orange: "#ffa500",
|
|
1461
|
-
orangered: "#ff4500",
|
|
1462
|
-
orchid: "#da70d6",
|
|
1463
|
-
palegoldenrod: "#eee8aa",
|
|
1464
|
-
palegreen: "#98fb98",
|
|
1465
|
-
paleturquoise: "#afeeee",
|
|
1466
|
-
palevioletred: "#db7093",
|
|
1467
|
-
papayawhip: "#ffefd5",
|
|
1468
|
-
peachpuff: "#ffdab9",
|
|
1469
|
-
peru: "#cd853f",
|
|
1470
|
-
pink: "#ffc0cb",
|
|
1471
|
-
plum: "#dda0dd",
|
|
1472
|
-
powderblue: "#b0e0e6",
|
|
1473
|
-
purple: "#800080",
|
|
1474
|
-
rebeccapurple: "#663399",
|
|
1475
|
-
red: "#ff0000",
|
|
1476
|
-
rosybrown: "#bc8f8f",
|
|
1477
|
-
royalblue: "#4169e1",
|
|
1478
|
-
saddlebrown: "#8b4513",
|
|
1479
|
-
salmon: "#fa8072",
|
|
1480
|
-
sandybrown: "#f4a460",
|
|
1481
|
-
seagreen: "#2e8b57",
|
|
1482
|
-
seashell: "#fff5ee",
|
|
1483
|
-
sienna: "#a0522d",
|
|
1484
|
-
silver: "#c0c0c0",
|
|
1485
|
-
skyblue: "#87ceeb",
|
|
1486
|
-
slateblue: "#6a5acd",
|
|
1487
|
-
slategray: "#708090",
|
|
1488
|
-
slategrey: "#708090",
|
|
1489
|
-
snow: "#fffafa",
|
|
1490
|
-
springgreen: "#00ff7f",
|
|
1491
|
-
steelblue: "#4682b4",
|
|
1492
|
-
tan: "#d2b48c",
|
|
1493
|
-
teal: "#008080",
|
|
1494
|
-
thistle: "#d8bfd8",
|
|
1495
|
-
transparent: "rgba(0, 0, 0, 0)",
|
|
1496
|
-
tomato: "#ff6347",
|
|
1497
|
-
turquoise: "#40e0d0",
|
|
1498
|
-
violet: "#ee82ee",
|
|
1499
|
-
wheat: "#f5deb3",
|
|
1500
|
-
white: "#ffffff",
|
|
1501
|
-
whitesmoke: "#f5f5f5",
|
|
1502
|
-
yellow: "#ffff00",
|
|
1503
|
-
yellowgreen: "#9acd32",
|
|
1504
|
-
padaleckipink: "oklch(100% 0.42 360deg / 71.70%)",
|
|
1505
|
-
"lodge-blu-color": "rgb(53 101 144)",
|
|
1506
|
-
lavendi: "oklch(79.90% 0.11 318.24deg / 100%)",
|
|
1507
|
-
shadyshroom: "oklch(53% 0.07 21.60deg / 100%)",
|
|
1508
|
-
patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)"
|
|
1509
|
-
};
|
|
1510
|
-
function _(e, t, n) {
|
|
1511
|
-
return Math.min(Math.max(e, t), n);
|
|
1512
|
-
}
|
|
1513
|
-
function B(e, t, n, r = 0, o = 1) {
|
|
1514
|
-
const s = (o - r) / (n - t);
|
|
1515
|
-
if (n === t)
|
|
1516
|
-
throw new Error("fromMax and fromMin cannot be equal");
|
|
1517
|
-
return (e - t) * s + r;
|
|
1518
|
-
}
|
|
1519
|
-
function Xt(e, t, n) {
|
|
1520
|
-
return (1 - e) * t + e * n;
|
|
1521
|
-
}
|
|
1522
|
-
function Qa(e, t, n) {
|
|
1523
|
-
return t = t === 0 ? 1e-9 : t, t * Math.pow(n / t, e);
|
|
1524
|
-
}
|
|
1525
|
-
function Wt(e, t) {
|
|
1526
|
-
const n = t.length - 1, r = [...t];
|
|
1527
|
-
for (let o = 1; o <= n; o++)
|
|
1528
|
-
for (let s = 0; s <= n - o; s++)
|
|
1529
|
-
r[s] = Xt(e, r[s], r[s + 1]);
|
|
1530
|
-
return r[0];
|
|
1531
|
-
}
|
|
1532
|
-
function Cr(e, t, n, r, o) {
|
|
1533
|
-
return [Wt(e, [0, t, r, 1]), Wt(e, [0, n, o, 1])];
|
|
1534
|
-
}
|
|
1535
|
-
function ae(e, t) {
|
|
1536
|
-
const n = t.map((o) => o[0]), r = t.map((o) => o[1]);
|
|
1537
|
-
return [Wt(e, n), Wt(e, r)];
|
|
1538
|
-
}
|
|
1539
|
-
function tc(e, t, n, r) {
|
|
1540
|
-
let o = "M0 0";
|
|
1541
|
-
for (let s = 0; s <= 1; s += 1e-3) {
|
|
1542
|
-
const [i, a] = Cr(s, e, t, n, r);
|
|
1543
|
-
o += ` L${i} ${a}`;
|
|
1544
|
-
}
|
|
1545
|
-
return `<path d="${o}"/>`;
|
|
1546
|
-
}
|
|
1547
|
-
function ec(e, t, n, r) {
|
|
1548
|
-
const o = (s) => s.toFixed(2);
|
|
1549
|
-
return `cubic-bezier(${o(e)}, ${o(t)}, ${o(n)}, ${o(r)})`;
|
|
1550
|
-
}
|
|
1551
|
-
const xr = 2.4, Ht = 0.055, Ke = 12.92, Lo = 0.04045, Er = Lo / Ke;
|
|
1552
|
-
function ye(e) {
|
|
1553
|
-
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1554
|
-
return n <= Er ? e / Ke : t * ((n + Ht) / (1 + Ht)) ** xr;
|
|
1555
|
-
}
|
|
1556
|
-
function Se(e) {
|
|
1557
|
-
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1558
|
-
return n <= Er ? e * Ke : t * ((1 + Ht) * n ** (1 / xr) - Ht);
|
|
1559
|
-
}
|
|
1560
|
-
function Ce(e, t, n) {
|
|
1561
|
-
return Math.min(Math.max(e, t), n);
|
|
1562
|
-
}
|
|
1563
|
-
const nc = 0.02;
|
|
1564
|
-
function rc(e, t, n, r, o, s) {
|
|
1565
|
-
const i = e - r, a = t - o, c = n - s;
|
|
1566
|
-
return Math.sqrt(i * i + a * a + c * c);
|
|
1567
|
-
}
|
|
1568
|
-
function qe(e, t, n) {
|
|
1569
|
-
const r = e + $.l[1] * t + $.l[2] * n, o = e + $.m[1] * t + $.m[2] * n, s = e + $.s[1] * t + $.s[2] * n, i = r * r * r, a = o * o * o, c = s * s * s;
|
|
1570
|
-
return [
|
|
1571
|
-
M[0] * i + M[1] * a + M[2] * c,
|
|
1572
|
-
M[3] * i + M[4] * a + M[5] * c,
|
|
1573
|
-
M[6] * i + M[7] * a + M[8] * c
|
|
1574
|
-
];
|
|
1575
|
-
}
|
|
1576
|
-
function Fo(e, t, n) {
|
|
1577
|
-
return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
|
|
1578
|
-
}
|
|
1579
|
-
function $o(e, t) {
|
|
1580
|
-
const n = zo.find((x) => x.test(e, t)), { k0: r, k1: o, k2: s, k3: i, k4: a, wl: c, wm: l, ws: f } = n;
|
|
1581
|
-
let p = r + o * e + s * t + i * e * e + a * e * t;
|
|
1582
|
-
const u = $.l[1] * e + $.l[2] * t, h = $.m[1] * e + $.m[2] * t, m = $.s[1] * e + $.s[2] * t;
|
|
1583
|
-
{
|
|
1584
|
-
const x = 1 + p * u, b = 1 + p * h, I = 1 + p * m, E = x * x * x, v = b * b * b, F = I * I * I, Q = 3 * u * x * x, ut = 3 * h * b * b, ft = 3 * m * I * I, Mt = 6 * u * u * x, Tt = 6 * h * h * b, At = 6 * m * m * I, dt = c * E + l * v + f * F, pt = c * Q + l * ut + f * ft, Pt = c * Mt + l * Tt + f * At;
|
|
1585
|
-
p = p - dt * pt / (pt * pt - 0.5 * dt * Pt);
|
|
1586
|
-
}
|
|
1587
|
-
return p;
|
|
1588
|
-
}
|
|
1589
|
-
function Do(e, t) {
|
|
1590
|
-
const n = $o(e, t), [r, o, s] = qe(1, n * e, n * t), i = Math.cbrt(1 / Math.max(r, o, s)), a = i * n;
|
|
1591
|
-
return { L: i, C: a };
|
|
1592
|
-
}
|
|
1593
|
-
function Uo(e, t, n, r, o, s) {
|
|
1594
|
-
let i;
|
|
1595
|
-
if ((n - o) * s.C - (s.L - o) * r <= 0)
|
|
1596
|
-
i = s.C * o / (r * s.L + s.C * (o - n));
|
|
1597
|
-
else {
|
|
1598
|
-
i = s.C * (o - 1) / (r * (s.L - 1) + s.C * (o - n));
|
|
1599
|
-
const a = n - o, c = r, l = $.l[1] * e + $.l[2] * t, f = $.m[1] * e + $.m[2] * t, p = $.s[1] * e + $.s[2] * t, u = a + c * l, h = a + c * f, m = a + c * p;
|
|
1600
|
-
{
|
|
1601
|
-
const x = o * (1 - i) + i * n, b = i * r, I = x + b * l, E = x + b * f, v = x + b * p, F = I * I * I, Q = E * E * E, ut = v * v * v, ft = 3 * u * I * I, Mt = 3 * h * E * E, Tt = 3 * m * v * v, At = 6 * u * u * I, dt = 6 * h * h * E, pt = 6 * m * m * v, Pt = M[0] * F + M[1] * Q + M[2] * ut - 1, he = M[0] * ft + M[1] * Mt + M[2] * Tt, So = M[0] * At + M[1] * dt + M[2] * pt, kn = he / (he * he - 0.5 * Pt * So);
|
|
1602
|
-
let me = -Pt * kn;
|
|
1603
|
-
const yn = M[3] * F + M[4] * Q + M[5] * ut - 1, be = M[3] * ft + M[4] * Mt + M[5] * Tt, Co = M[3] * At + M[4] * dt + M[5] * pt, Sn = be / (be * be - 0.5 * yn * Co);
|
|
1604
|
-
let ge = -yn * Sn;
|
|
1605
|
-
const Cn = M[6] * F + M[7] * Q + M[8] * ut - 1, de = M[6] * ft + M[7] * Mt + M[8] * Tt, xo = M[6] * At + M[7] * dt + M[8] * pt, xn = de / (de * de - 0.5 * Cn * xo);
|
|
1606
|
-
let we = -Cn * xn;
|
|
1607
|
-
me = kn >= 0 ? me : 1 / 0, ge = Sn >= 0 ? ge : 1 / 0, we = xn >= 0 ? we : 1 / 0, i += Math.min(me, ge, we);
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
return i;
|
|
1611
|
-
}
|
|
1612
|
-
const Go = 1e-5, Vo = 0.05;
|
|
1613
|
-
function Xo(e, t, n) {
|
|
1614
|
-
const [r, o, s] = qe(e, t, n);
|
|
1615
|
-
if (Fo(r, o, s))
|
|
1616
|
-
return [e, t, n];
|
|
1617
|
-
const i = Math.max(Go, Math.sqrt(t * t + n * n)), a = t / i, c = n / i, l = Do(a, c), f = e - 0.5, p = 0.5 + Math.abs(f) + Vo * i, u = 0.5 * (1 + Math.sign(f) * (p - Math.sqrt(p * p - 2 * Math.abs(f)))), h = Uo(a, c, e, i, u, l), m = u * (1 - h) + h * e, x = h * i;
|
|
1618
|
-
return [m, x * a, x * c];
|
|
1619
|
-
}
|
|
1620
|
-
function Wo(e, t, n) {
|
|
1621
|
-
const r = ye(e), o = ye(t), s = ye(n), i = Math.cbrt(tt[0] * r + tt[1] * o + tt[2] * s), a = Math.cbrt(tt[3] * r + tt[4] * o + tt[5] * s), c = Math.cbrt(tt[6] * r + tt[7] * o + tt[8] * s);
|
|
1622
|
-
return [
|
|
1623
|
-
0.2104542553 * i + 0.793617785 * a - 0.0040720468 * c,
|
|
1624
|
-
1.9779984951 * i - 2.428592205 * a + 0.4505937099 * c,
|
|
1625
|
-
0.0259040371 * i + 0.7827717662 * a - 0.808675766 * c
|
|
1626
|
-
];
|
|
1627
|
-
}
|
|
1628
|
-
function Ho(e, t, n) {
|
|
1629
|
-
if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1)
|
|
1630
|
-
return [e, t, n];
|
|
1631
|
-
const [r, o, s] = Wo(e, t, n), [i, a, c] = Xo(r, o, s), [l, f, p] = qe(i, a, c);
|
|
1632
|
-
return [
|
|
1633
|
-
Ce(Se(l), 0, 1),
|
|
1634
|
-
Ce(Se(f), 0, 1),
|
|
1635
|
-
Ce(Se(p), 0, 1)
|
|
1636
|
-
];
|
|
1637
|
-
}
|
|
1638
|
-
const oc = (e) => {
|
|
1639
|
-
const t = C[e], n = dr[e];
|
|
1640
|
-
return Object.entries(t).reduce((r, [o, s]) => {
|
|
1641
|
-
const i = n[o];
|
|
1642
|
-
let { min: a, max: c } = s[i] ?? s.number;
|
|
1643
|
-
return a = `${a}${i}`, c = `${c}${i}`, r[o] = { min: a, max: c }, r;
|
|
1644
|
-
}, {});
|
|
1645
|
-
}, et = 16, jo = (e) => {
|
|
1646
|
-
if (e = e.slice(1), e.length <= 4) {
|
|
1647
|
-
const t = parseInt(e[0] + e[0], et), n = parseInt(e[1] + e[1], et), r = parseInt(e[2] + e[2], et), o = e[3] ? parseInt(e[3] + e[3], et) / L : 1;
|
|
1648
|
-
return new D(t, n, r, o);
|
|
1649
|
-
} else {
|
|
1650
|
-
const t = parseInt(e.slice(0, 2), et), n = parseInt(e.slice(2, 4), et), r = parseInt(e.slice(4, 6), et), o = e.length === 8 ? parseInt(e.slice(6, 8), et) / L : 1;
|
|
1651
|
-
return new D(t, n, r, o);
|
|
1652
|
-
}
|
|
1653
|
-
}, sc = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1654
|
-
const o = (s) => {
|
|
1655
|
-
const i = s.toString(et);
|
|
1656
|
-
return i.length === 1 ? "0" + i : i;
|
|
1657
|
-
};
|
|
1658
|
-
return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r * L)) : ""}`;
|
|
1659
|
-
}, vr = 1e3, Mr = 4e4, Tr = 100, Ar = ({ kelvin: e, alpha: t }) => {
|
|
1660
|
-
e = _(e, vr, Mr) / Tr;
|
|
1661
|
-
let n, r, o;
|
|
1662
|
-
return e <= 66 ? n = L : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = _(n, 0, L) / L, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = _(r, 0, L) / L, e >= 66 ? o = L : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = _(o, 0, L) / L, new D(n, r, o, t);
|
|
1663
|
-
}, Yo = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1664
|
-
e = _(e * L, 0, L), t = _(t * L, 0, L), n = _(n * L, 0, L);
|
|
1665
|
-
let o;
|
|
1666
|
-
if (n === L ? o = 6600 : n === 0 ? o = 1900 : o = Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < L) {
|
|
1667
|
-
const i = (329.698727446 / e) ** -7.507239275877164 + 60;
|
|
1668
|
-
o = Math.max(o, i);
|
|
1669
|
-
}
|
|
1670
|
-
const s = o <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -0.0755148492) + 60;
|
|
1671
|
-
return o = (o + s) / 2, o = _(Math.round(o * Tr), vr, Mr), new hr(o, r);
|
|
1672
|
-
}, Ir = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
1673
|
-
const o = n - n * t / 2;
|
|
1674
|
-
let s;
|
|
1675
|
-
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new vt(e, s, o, r);
|
|
1676
|
-
}, Or = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1677
|
-
const o = n + t * Math.min(n, 1 - n);
|
|
1678
|
-
let s;
|
|
1679
|
-
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new De(e, s, o, r);
|
|
1680
|
-
}, Zo = ({ h: e, w: t, b: n, alpha: r }) => {
|
|
1681
|
-
let o, s;
|
|
1682
|
-
const i = t + n;
|
|
1683
|
-
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s), Ir(new De(e, o, s, r));
|
|
1684
|
-
}, Ko = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
1685
|
-
const { h: o, s, v: i } = Or(new vt(e, t, n, r));
|
|
1686
|
-
return new Ue(o, i * (1 - s), 1 - i, r);
|
|
1687
|
-
}, Rr = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
1688
|
-
const o = Math.max(e, t, n), s = Math.min(e, t, n);
|
|
1689
|
-
let [i, a, c] = [0, 0, (o + s) / 2];
|
|
1690
|
-
const l = o - s;
|
|
1691
|
-
switch (a = l / (1 - Math.abs(2 * c - 1)), o) {
|
|
1692
|
-
case e:
|
|
1693
|
-
i = (t - n) / l + (t < n ? 6 : 0);
|
|
1694
|
-
break;
|
|
1695
|
-
case t:
|
|
1696
|
-
i = (n - e) / l + 2;
|
|
1697
|
-
break;
|
|
1698
|
-
case n:
|
|
1699
|
-
i = (e - t) / l + 4;
|
|
1700
|
-
break;
|
|
1701
|
-
}
|
|
1702
|
-
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new vt(i, a, c, r);
|
|
1703
|
-
};
|
|
1704
|
-
function qo({ h: e, s: t, l: n, alpha: r }) {
|
|
1705
|
-
const o = (1 - Math.abs(2 * n - 1)) * t, s = o * (1 - Math.abs(e * 6 % 2 - 1)), i = n - o / 2;
|
|
1706
|
-
let a, c, l;
|
|
1707
|
-
return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new D(a + i, c + i, l + i, r);
|
|
1708
|
-
}
|
|
1709
|
-
const Jo = 216 / 24389, Qo = 24 / 116, Re = 24389 / 27, ts = 8, Bt = 16, Nt = 116, Br = 500, Nr = 200;
|
|
1710
|
-
function es(e) {
|
|
1711
|
-
if (e.whitePoint === "D50") return [e.x, e.y, e.z];
|
|
1712
|
-
if (e.whitePoint === "D65") return P([e.x, e.y, e.z], Ze);
|
|
1713
|
-
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1714
|
-
}
|
|
1715
|
-
function ns(e) {
|
|
1716
|
-
if (e.whitePoint === "D65") return [e.x, e.y, e.z];
|
|
1717
|
-
if (e.whitePoint === "D50") return P([e.x, e.y, e.z], wr);
|
|
1718
|
-
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
1719
|
-
}
|
|
1720
|
-
function Je(e, t = "D50") {
|
|
1721
|
-
const n = (I) => I > Jo ? Math.cbrt(I) : (Re * I + Bt) / Nt, r = kr[t], [o, s, i] = es(e), a = o / r[0], c = s / r[1], l = i / r[2], f = n(a), p = n(c), u = n(l), h = Nt * p - Bt, m = Br * (f - p), x = Nr * (p - u), b = new se(
|
|
1722
|
-
B(
|
|
1723
|
-
h,
|
|
1724
|
-
C.lab.l.number.min,
|
|
1725
|
-
C.lab.l.number.max
|
|
1726
|
-
),
|
|
1727
|
-
B(
|
|
1728
|
-
m,
|
|
1729
|
-
C.lab.a.number.min,
|
|
1730
|
-
C.lab.a.number.max
|
|
1731
|
-
),
|
|
1732
|
-
B(
|
|
1733
|
-
x,
|
|
1734
|
-
C.lab.b.number.min,
|
|
1735
|
-
C.lab.b.number.max
|
|
1736
|
-
),
|
|
1737
|
-
e.alpha
|
|
1738
|
-
);
|
|
1739
|
-
return b.whitePoint = t, b;
|
|
1740
|
-
}
|
|
1741
|
-
function Qe(e) {
|
|
1742
|
-
const t = (E) => E > Qo ? E ** 3 : (Nt * E - Bt) / Re, n = (E) => E > ts ? ((E + Bt) / Nt) ** 3 : E / Re, r = kr[e.whitePoint];
|
|
1743
|
-
let { l: o, a: s, b: i, alpha: a } = e;
|
|
1744
|
-
o = B(
|
|
1745
|
-
o,
|
|
1746
|
-
0,
|
|
1747
|
-
1,
|
|
1748
|
-
C.lab.l.number.min,
|
|
1749
|
-
C.lab.l.number.max
|
|
1750
|
-
), s = B(
|
|
1751
|
-
s,
|
|
1752
|
-
0,
|
|
1753
|
-
1,
|
|
1754
|
-
C.lab.a.number.min,
|
|
1755
|
-
C.lab.a.number.max
|
|
1756
|
-
), i = B(
|
|
1757
|
-
i,
|
|
1758
|
-
0,
|
|
1759
|
-
1,
|
|
1760
|
-
C.lab.b.number.min,
|
|
1761
|
-
C.lab.b.number.max
|
|
1762
|
-
);
|
|
1763
|
-
const c = (o + Bt) / Nt, l = s / Br + c, f = c - i / Nr, [p, u, h] = [t(l), n(o), t(f)];
|
|
1764
|
-
let m = p * r[0], x = u * r[1], b = h * r[2];
|
|
1765
|
-
const I = new X(m, x, b, a);
|
|
1766
|
-
return I.whitePoint = e.whitePoint, [m, x, b] = ns(I), I.whitePoint = "D65", I.x = m, I.y = x, I.z = b, I;
|
|
1767
|
-
}
|
|
1768
|
-
const tn = [
|
|
1769
|
-
0.41239079926595934,
|
|
1770
|
-
0.357584339383878,
|
|
1771
|
-
0.1804807884018343,
|
|
1772
|
-
0.21263900587151027,
|
|
1773
|
-
0.715168678767756,
|
|
1774
|
-
0.07219231536073371,
|
|
1775
|
-
0.01933081871559182,
|
|
1776
|
-
0.11919477979462598,
|
|
1777
|
-
0.9505321522496607
|
|
1778
|
-
], _r = ct(tn), Pr = 2.4, jt = 0.055, en = 12.92, rs = 0.04045, zr = rs / en;
|
|
1779
|
-
function xt(e) {
|
|
1780
|
-
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1781
|
-
return n <= zr ? e / en : t * ((n + jt) / (1 + jt)) ** Pr;
|
|
1782
|
-
}
|
|
1783
|
-
function Lr(e) {
|
|
1784
|
-
const t = e < 0 ? -1 : 1, n = e * t;
|
|
1785
|
-
return n <= zr ? e * en : t * ((1 + jt) * n ** (1 / Pr) - jt);
|
|
1786
|
-
}
|
|
1787
|
-
function nn({ r: e, g: t, b: n, alpha: r }) {
|
|
1788
|
-
const o = [xt(e), xt(t), xt(n)], [s, i, a] = P(o, tn);
|
|
1789
|
-
return new X(s, i, a, r);
|
|
1790
|
-
}
|
|
1791
|
-
const rn = ({ x: e, y: t, z: n, alpha: r }, o = !0) => {
|
|
1792
|
-
const s = P([e, t, n], _r), [i, a, c] = s.map(Lr);
|
|
1793
|
-
if (o) {
|
|
1794
|
-
const l = Ps(new D(i, a, c, r));
|
|
1795
|
-
return new D(l.r, l.g, l.b, r);
|
|
1796
|
-
} else
|
|
1797
|
-
return new D(i, a, c, r);
|
|
1798
|
-
};
|
|
1799
|
-
function os({ l: e, c: t, h: n, alpha: r }) {
|
|
1800
|
-
t = B(
|
|
1801
|
-
t,
|
|
1802
|
-
0,
|
|
1803
|
-
1,
|
|
1804
|
-
C.lch.c.number.min,
|
|
1805
|
-
C.lch.c.number.max
|
|
1806
|
-
);
|
|
1807
|
-
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
1808
|
-
return new se(
|
|
1809
|
-
e,
|
|
1810
|
-
B(
|
|
1811
|
-
s,
|
|
1812
|
-
C.lab.a.number.min,
|
|
1813
|
-
C.lab.a.number.max
|
|
1814
|
-
),
|
|
1815
|
-
B(
|
|
1816
|
-
i,
|
|
1817
|
-
C.lab.b.number.min,
|
|
1818
|
-
C.lab.b.number.max
|
|
1819
|
-
),
|
|
1820
|
-
r
|
|
1821
|
-
);
|
|
1822
|
-
}
|
|
1823
|
-
function ss({ l: e, a: t, b: n, alpha: r }) {
|
|
1824
|
-
t = B(
|
|
1825
|
-
t,
|
|
1826
|
-
0,
|
|
1827
|
-
1,
|
|
1828
|
-
C.lab.a.number.min,
|
|
1829
|
-
C.lab.a.number.max
|
|
1830
|
-
), n = B(
|
|
1831
|
-
n,
|
|
1832
|
-
0,
|
|
1833
|
-
1,
|
|
1834
|
-
C.lab.b.number.min,
|
|
1835
|
-
C.lab.b.number.max
|
|
1836
|
-
);
|
|
1837
|
-
const o = Math.hypot(t, n);
|
|
1838
|
-
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
1839
|
-
return s < 0 && (s += 1), new Ge(
|
|
1840
|
-
e,
|
|
1841
|
-
B(
|
|
1842
|
-
o,
|
|
1843
|
-
C.lch.c.number.min,
|
|
1844
|
-
C.lch.c.number.max
|
|
1845
|
-
),
|
|
1846
|
-
s,
|
|
1847
|
-
r
|
|
1848
|
-
);
|
|
1849
|
-
}
|
|
1850
|
-
function on({ l: e, a: t, b: n, alpha: r }) {
|
|
1851
|
-
t = B(
|
|
1852
|
-
t,
|
|
1853
|
-
0,
|
|
1854
|
-
1,
|
|
1855
|
-
C.oklab.a.number.min,
|
|
1856
|
-
C.oklab.a.number.max
|
|
1857
|
-
), n = B(
|
|
1858
|
-
n,
|
|
1859
|
-
0,
|
|
1860
|
-
1,
|
|
1861
|
-
C.oklab.b.number.min,
|
|
1862
|
-
C.oklab.b.number.max
|
|
1863
|
-
);
|
|
1864
|
-
const o = P([e, t, n], Po), s = [o[0] * o[0] * o[0], o[1] * o[1] * o[1], o[2] * o[2] * o[2]], [i, a, c] = P(s, _o);
|
|
1865
|
-
return new X(i, a, c, r);
|
|
1866
|
-
}
|
|
1867
|
-
function sn(e) {
|
|
1868
|
-
const { x: t, y: n, z: r } = e, o = P([t, n, r], yr), s = [Math.cbrt(o[0]), Math.cbrt(o[1]), Math.cbrt(o[2])], [i, a, c] = P(s, Sr);
|
|
1869
|
-
return new ie(
|
|
1870
|
-
i,
|
|
1871
|
-
B(
|
|
1872
|
-
a,
|
|
1873
|
-
C.oklab.a.number.min,
|
|
1874
|
-
C.oklab.a.number.max
|
|
1875
|
-
),
|
|
1876
|
-
B(
|
|
1877
|
-
c,
|
|
1878
|
-
C.oklab.b.number.min,
|
|
1879
|
-
C.oklab.b.number.max
|
|
1880
|
-
),
|
|
1881
|
-
e.alpha
|
|
1882
|
-
);
|
|
1883
|
-
}
|
|
1884
|
-
function is(e) {
|
|
1885
|
-
const t = on(e);
|
|
1886
|
-
return Je(t);
|
|
1887
|
-
}
|
|
1888
|
-
function as(e) {
|
|
1889
|
-
const t = Qe(e);
|
|
1890
|
-
return sn(t);
|
|
1891
|
-
}
|
|
1892
|
-
function Fr({ l: e, a: t, b: n, alpha: r }) {
|
|
1893
|
-
t = B(t, 0, 1, C.oklab.a.number.min, C.oklab.a.number.max), n = B(n, 0, 1, C.oklab.b.number.min, C.oklab.b.number.max);
|
|
1894
|
-
const o = Math.hypot(t, n);
|
|
1895
|
-
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
1896
|
-
return s < 0 && (s += 1), new Ve(
|
|
1897
|
-
e,
|
|
1898
|
-
B(o, C.oklch.c.number.min, C.oklch.c.number.max),
|
|
1899
|
-
s,
|
|
1900
|
-
r
|
|
1901
|
-
);
|
|
1902
|
-
}
|
|
1903
|
-
function $r({ l: e, c: t, h: n, alpha: r }) {
|
|
1904
|
-
t = B(t, 0, 1, C.oklch.c.number.min, C.oklch.c.number.max);
|
|
1905
|
-
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
1906
|
-
return new ie(
|
|
1907
|
-
e,
|
|
1908
|
-
B(s, C.oklab.a.number.min, C.oklab.a.number.max),
|
|
1909
|
-
B(i, C.oklab.b.number.min, C.oklab.b.number.max),
|
|
1910
|
-
r
|
|
1911
|
-
);
|
|
1912
|
-
}
|
|
1913
|
-
function ic(e) {
|
|
1914
|
-
return is($r(e));
|
|
1915
|
-
}
|
|
1916
|
-
function ac(e) {
|
|
1917
|
-
return Fr(as(e));
|
|
1918
|
-
}
|
|
1919
|
-
function an(e) {
|
|
1920
|
-
const t = qo(e);
|
|
1921
|
-
return nn(t);
|
|
1922
|
-
}
|
|
1923
|
-
function cn(e) {
|
|
1924
|
-
const t = rn(e);
|
|
1925
|
-
return Rr(t);
|
|
1926
|
-
}
|
|
1927
|
-
function cs(e) {
|
|
1928
|
-
const t = Ir(e);
|
|
1929
|
-
return an(t);
|
|
1930
|
-
}
|
|
1931
|
-
function ls(e) {
|
|
1932
|
-
const t = cn(e);
|
|
1933
|
-
return Or(t);
|
|
1934
|
-
}
|
|
1935
|
-
function us(e) {
|
|
1936
|
-
const t = Zo(e);
|
|
1937
|
-
return an(t);
|
|
1938
|
-
}
|
|
1939
|
-
function fs(e) {
|
|
1940
|
-
const t = cn(e);
|
|
1941
|
-
return Ko(t);
|
|
1942
|
-
}
|
|
1943
|
-
function ps(e) {
|
|
1944
|
-
const t = os(e);
|
|
1945
|
-
return Qe(t);
|
|
1946
|
-
}
|
|
1947
|
-
function hs(e) {
|
|
1948
|
-
const t = Je(e);
|
|
1949
|
-
return ss(t);
|
|
1950
|
-
}
|
|
1951
|
-
function ms(e) {
|
|
1952
|
-
const t = $r(e);
|
|
1953
|
-
return on(t);
|
|
1954
|
-
}
|
|
1955
|
-
function bs(e) {
|
|
1956
|
-
const t = sn(e);
|
|
1957
|
-
return Fr(t);
|
|
1958
|
-
}
|
|
1959
|
-
function gs(e) {
|
|
1960
|
-
const t = Ar(e);
|
|
1961
|
-
return nn(t);
|
|
1962
|
-
}
|
|
1963
|
-
function ds(e) {
|
|
1964
|
-
const t = rn(e);
|
|
1965
|
-
return Yo(t);
|
|
1966
|
-
}
|
|
1967
|
-
const Dr = 563 / 256;
|
|
1968
|
-
function xe(e) {
|
|
1969
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** Dr;
|
|
1970
|
-
}
|
|
1971
|
-
function ws(e) {
|
|
1972
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / Dr);
|
|
1973
|
-
}
|
|
1974
|
-
const Ur = 1 / 512, Gr = 1.8;
|
|
1975
|
-
function Ee(e) {
|
|
1976
|
-
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1977
|
-
return t * (n <= Ur * 16 ? n / 16 : n ** Gr);
|
|
1978
|
-
}
|
|
1979
|
-
function ks(e) {
|
|
1980
|
-
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1981
|
-
return t * (n >= Ur ? n ** (1 / Gr) : n * 16);
|
|
1982
|
-
}
|
|
1983
|
-
const Yt = 1.09929682680944, Vr = 0.018053968510807;
|
|
1984
|
-
function ve(e) {
|
|
1985
|
-
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1986
|
-
return n < Vr * 4.5 ? t * n / 4.5 : t * ((n + Yt - 1) / Yt) ** (1 / 0.45);
|
|
1987
|
-
}
|
|
1988
|
-
function ys(e) {
|
|
1989
|
-
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
1990
|
-
return n >= Vr ? t * (Yt * n ** 0.45 - (Yt - 1)) : t * 4.5 * n;
|
|
1991
|
-
}
|
|
1992
|
-
const Xr = [
|
|
1993
|
-
0.4865709486482162,
|
|
1994
|
-
0.26566769316909306,
|
|
1995
|
-
0.1982172852343625,
|
|
1996
|
-
0.22897456406974884,
|
|
1997
|
-
0.6917385218365064,
|
|
1998
|
-
0.079286914093745,
|
|
1999
|
-
0,
|
|
2000
|
-
0.04511338185890264,
|
|
2001
|
-
1.043944368900976
|
|
2002
|
-
], Ss = ct(Xr), Wr = [
|
|
2003
|
-
0.5766690429101305,
|
|
2004
|
-
0.1855582379065463,
|
|
2005
|
-
0.1882286462349947,
|
|
2006
|
-
0.29734497525053605,
|
|
2007
|
-
0.6273635662554661,
|
|
2008
|
-
0.07529145849399788,
|
|
2009
|
-
0.02703136138641234,
|
|
2010
|
-
0.07068885253582723,
|
|
2011
|
-
0.9913375368376388
|
|
2012
|
-
], Cs = ct(Wr), Hr = [
|
|
2013
|
-
0.7977604896723027,
|
|
2014
|
-
0.13518583717574031,
|
|
2015
|
-
0.0313493495815248,
|
|
2016
|
-
0.2880711282292934,
|
|
2017
|
-
0.7118432178101014,
|
|
2018
|
-
8565396060525902e-20,
|
|
2019
|
-
0,
|
|
2020
|
-
0,
|
|
2021
|
-
0.8251046025104602
|
|
2022
|
-
], xs = ct(Hr), jr = [
|
|
2023
|
-
0.6369580483012914,
|
|
2024
|
-
0.14461690358620832,
|
|
2025
|
-
0.1688809751641721,
|
|
2026
|
-
0.2627002120112671,
|
|
2027
|
-
0.6779980715188708,
|
|
2028
|
-
0.05930171646986196,
|
|
2029
|
-
0,
|
|
2030
|
-
0.028072693049087428,
|
|
2031
|
-
1.0609850577107909
|
|
2032
|
-
], Es = ct(jr);
|
|
2033
|
-
function vs({ r: e, g: t, b: n, alpha: r }) {
|
|
2034
|
-
const [o, s, i] = P([e, t, n], tn);
|
|
2035
|
-
return new X(o, s, i, r);
|
|
2036
|
-
}
|
|
2037
|
-
function Ms({ x: e, y: t, z: n, alpha: r }) {
|
|
2038
|
-
const [o, s, i] = P([e, t, n], _r);
|
|
2039
|
-
return new Xe(o, s, i, r);
|
|
2040
|
-
}
|
|
2041
|
-
function Ts({ r: e, g: t, b: n, alpha: r }) {
|
|
2042
|
-
const o = [xt(e), xt(t), xt(n)], [s, i, a] = P(o, Xr);
|
|
2043
|
-
return new X(s, i, a, r);
|
|
2044
|
-
}
|
|
2045
|
-
function As({ x: e, y: t, z: n, alpha: r }) {
|
|
2046
|
-
const o = P([e, t, n], Ss), [s, i, a] = o.map(Lr);
|
|
2047
|
-
return new We(s, i, a, r);
|
|
2048
|
-
}
|
|
2049
|
-
function Is({ r: e, g: t, b: n, alpha: r }) {
|
|
2050
|
-
const o = [xe(e), xe(t), xe(n)], [s, i, a] = P(o, Wr);
|
|
2051
|
-
return new X(s, i, a, r);
|
|
2052
|
-
}
|
|
2053
|
-
function Os({ x: e, y: t, z: n, alpha: r }) {
|
|
2054
|
-
const o = P([e, t, n], Cs), [s, i, a] = o.map(ws);
|
|
2055
|
-
return new He(s, i, a, r);
|
|
2056
|
-
}
|
|
2057
|
-
function Rs({ r: e, g: t, b: n, alpha: r }) {
|
|
2058
|
-
const o = [Ee(e), Ee(t), Ee(n)], s = P(o, Hr), [i, a, c] = P(s, wr);
|
|
2059
|
-
return new X(i, a, c, r);
|
|
2060
|
-
}
|
|
2061
|
-
function Bs({ x: e, y: t, z: n, alpha: r }) {
|
|
2062
|
-
const o = P([e, t, n], Ze), s = P(o, xs), [i, a, c] = s.map(ks);
|
|
2063
|
-
return new je(i, a, c, r);
|
|
2064
|
-
}
|
|
2065
|
-
function Ns({ r: e, g: t, b: n, alpha: r }) {
|
|
2066
|
-
const o = [ve(e), ve(t), ve(n)], [s, i, a] = P(o, jr);
|
|
2067
|
-
return new X(s, i, a, r);
|
|
2068
|
-
}
|
|
2069
|
-
function _s({ x: e, y: t, z: n, alpha: r }) {
|
|
2070
|
-
const o = P([e, t, n], Es), [s, i, a] = o.map(ys);
|
|
2071
|
-
return new Ye(s, i, a, r);
|
|
2072
|
-
}
|
|
2073
|
-
const In = {
|
|
2074
|
-
rgb: { to: nn, from: rn },
|
|
2075
|
-
hsl: { to: an, from: cn },
|
|
2076
|
-
hsv: { to: cs, from: ls },
|
|
2077
|
-
hwb: { to: us, from: fs },
|
|
2078
|
-
lab: { to: Qe, from: Je },
|
|
2079
|
-
lch: { to: ps, from: hs },
|
|
2080
|
-
oklab: { to: on, from: sn },
|
|
2081
|
-
oklch: { to: ms, from: bs },
|
|
2082
|
-
kelvin: { to: gs, from: ds },
|
|
2083
|
-
xyz: { to: (e) => e, from: (e) => e },
|
|
2084
|
-
"srgb-linear": { to: vs, from: Ms },
|
|
2085
|
-
"display-p3": { to: Ts, from: As },
|
|
2086
|
-
"a98-rgb": { to: Is, from: Os },
|
|
2087
|
-
"prophoto-rgb": { to: Rs, from: Bs },
|
|
2088
|
-
rec2020: { to: Ns, from: _s }
|
|
2089
|
-
};
|
|
2090
|
-
function gt(e, t) {
|
|
2091
|
-
if (e.colorSpace === t)
|
|
2092
|
-
return e;
|
|
2093
|
-
const n = In[e.colorSpace];
|
|
2094
|
-
if (!n)
|
|
2095
|
-
throw new Error(`Unknown source color space: "${e.colorSpace}"`);
|
|
2096
|
-
const r = In[t];
|
|
2097
|
-
if (!r)
|
|
2098
|
-
throw new Error(`Unknown target color space: "${t}"`);
|
|
2099
|
-
const o = n.to(e), s = r.from;
|
|
2100
|
-
return s(o);
|
|
2101
|
-
}
|
|
2102
|
-
const kt = 1e-6;
|
|
2103
|
-
function Ps(e) {
|
|
2104
|
-
const t = gt(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, o = Number.isNaN(t.b) ? 0 : t.b;
|
|
2105
|
-
if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && o >= 0 && o <= 1)
|
|
2106
|
-
return e;
|
|
2107
|
-
if (n >= -kt && n <= 1 + kt && r >= -kt && r <= 1 + kt && o >= -kt && o <= 1 + kt) {
|
|
2108
|
-
const l = new D(_(n, 0, 1), _(r, 0, 1), _(o, 0, 1), e.alpha);
|
|
2109
|
-
return gt(l, e.colorSpace);
|
|
2110
|
-
}
|
|
2111
|
-
const [s, i, a] = Ho(n, r, o), c = new D(s, i, a, e.alpha);
|
|
2112
|
-
return gt(c, e.colorSpace);
|
|
2113
|
-
}
|
|
2114
|
-
const zs = {
|
|
2115
|
-
hsl: "h",
|
|
2116
|
-
hsv: "h",
|
|
2117
|
-
hwb: "h",
|
|
2118
|
-
lch: "h",
|
|
2119
|
-
oklch: "h"
|
|
2120
|
-
};
|
|
2121
|
-
function Ls(e, t, n, r = "shorter") {
|
|
2122
|
-
if (Number.isNaN(e) && Number.isNaN(t)) return 0;
|
|
2123
|
-
if (Number.isNaN(e)) return t;
|
|
2124
|
-
if (Number.isNaN(t)) return e;
|
|
2125
|
-
let o = t - e;
|
|
2126
|
-
switch (r) {
|
|
2127
|
-
case "shorter":
|
|
2128
|
-
o > 0.5 ? e += 1 : o < -0.5 && (t += 1);
|
|
2129
|
-
break;
|
|
2130
|
-
case "longer":
|
|
2131
|
-
o > 0 && o < 0.5 ? e += 1 : o > -0.5 && o <= 0 && (t += 1);
|
|
2132
|
-
break;
|
|
2133
|
-
case "increasing":
|
|
2134
|
-
o < 0 && (t += 1);
|
|
2135
|
-
break;
|
|
2136
|
-
case "decreasing":
|
|
2137
|
-
o > 0 && (e += 1);
|
|
2138
|
-
break;
|
|
2139
|
-
}
|
|
2140
|
-
let s = e + n * (t - e);
|
|
2141
|
-
return s = (s % 1 + 1) % 1, s;
|
|
2142
|
-
}
|
|
2143
|
-
function Fs(e, t, n, r, o = "oklab", s = "shorter") {
|
|
2144
|
-
const i = gt(e, o), a = gt(t, o);
|
|
2145
|
-
n < 0 && (n = 0), r < 0 && (r = 0);
|
|
2146
|
-
const c = n + r;
|
|
2147
|
-
c === 0 ? (n = 0.5, r = 0.5) : c !== 1 && (n = n / c, r = r / c);
|
|
2148
|
-
const l = Math.min(c, 1), f = zs[o], p = i.keys().filter((E) => E !== "alpha"), u = Number.isNaN(i.alpha) ? a.alpha : i.alpha, h = Number.isNaN(a.alpha) ? i.alpha : a.alpha, m = Xt(r, u, h) * l, x = [];
|
|
2149
|
-
for (const E of p) {
|
|
2150
|
-
let v = i[E], F = a[E];
|
|
2151
|
-
if (Number.isNaN(v) && Number.isNaN(F)) {
|
|
2152
|
-
x.push(0);
|
|
2153
|
-
continue;
|
|
2154
|
-
}
|
|
2155
|
-
if (Number.isNaN(v) && (v = F), Number.isNaN(F) && (F = v), E === f)
|
|
2156
|
-
x.push(Ls(v, F, r, s));
|
|
2157
|
-
else {
|
|
2158
|
-
const Q = v * u, ut = F * h, ft = Xt(r, Q, ut);
|
|
2159
|
-
x.push(m > 0 ? ft / m : 0);
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
const b = i.constructor;
|
|
2163
|
-
return new b(...x, m);
|
|
2164
|
-
}
|
|
2165
|
-
const $s = (e, t, n) => {
|
|
2166
|
-
const r = C[t][n];
|
|
2167
|
-
return r[e] ?? r.number;
|
|
2168
|
-
}, Ds = (e, t, n, r, o = !1) => {
|
|
2169
|
-
t = o ? dr[n][r] : t;
|
|
2170
|
-
const { min: s, max: i } = $s(t, n, r), [a, c, l, f] = o ? [s, i, 0, 1] : [0, 1, s, i], p = B(e, l, f, a, c);
|
|
2171
|
-
return new S(p, o ? t : "");
|
|
2172
|
-
}, Us = (e, t = !1) => {
|
|
2173
|
-
const n = e.colorSpace;
|
|
2174
|
-
return e.keys().forEach((r) => {
|
|
2175
|
-
const o = e[r] instanceof S ? e[r].value : e[r];
|
|
2176
|
-
e[r] = Ds(
|
|
2177
|
-
o,
|
|
2178
|
-
e[r]?.unit,
|
|
2179
|
-
n,
|
|
2180
|
-
r,
|
|
2181
|
-
t
|
|
2182
|
-
);
|
|
2183
|
-
}), e;
|
|
2184
|
-
}, Be = (e, t = !1, n = !1) => {
|
|
2185
|
-
e = n ? e : e.clone();
|
|
2186
|
-
const r = Us(e.value, t);
|
|
2187
|
-
return n ? e : new S(r).coalesce(e, !0);
|
|
2188
|
-
}, On = (e, t = "oklab", n = !1, r = !1, o = !1) => {
|
|
2189
|
-
const s = n ? o ? e : e.clone() : Be(e, !1, o), i = gt(s.toJSON(), t);
|
|
2190
|
-
return i.entries().forEach(([a, c]) => {
|
|
2191
|
-
i[a] = new S(c);
|
|
2192
|
-
}), s.value = i, s.superType[1] = t, r ? Be(s, !0, !0) : s;
|
|
2193
|
-
}, Gs = (e, t, n = "oklab", r = !1, o = !1, s = !1, i) => [
|
|
2194
|
-
On(e, n, r, o, s),
|
|
2195
|
-
On(t, n, r, o, s),
|
|
2196
|
-
i
|
|
2197
|
-
], Yr = ["px", "cm", "mm", "Q", "in", "pc", "pt"], Zr = [
|
|
2198
|
-
"em",
|
|
2199
|
-
"ex",
|
|
2200
|
-
"ch",
|
|
2201
|
-
"cap",
|
|
2202
|
-
"ic",
|
|
2203
|
-
"rem",
|
|
2204
|
-
"lh",
|
|
2205
|
-
"rlh",
|
|
2206
|
-
"vw",
|
|
2207
|
-
"vh",
|
|
2208
|
-
"vmin",
|
|
2209
|
-
"vmax",
|
|
2210
|
-
"vb",
|
|
2211
|
-
"vi",
|
|
2212
|
-
"svw",
|
|
2213
|
-
"svh",
|
|
2214
|
-
"svi",
|
|
2215
|
-
"svb",
|
|
2216
|
-
"svmin",
|
|
2217
|
-
"svmax",
|
|
2218
|
-
"lvw",
|
|
2219
|
-
"lvh",
|
|
2220
|
-
"lvi",
|
|
2221
|
-
"lvb",
|
|
2222
|
-
"lvmin",
|
|
2223
|
-
"lvmax",
|
|
2224
|
-
"dvw",
|
|
2225
|
-
"dvh",
|
|
2226
|
-
"dvi",
|
|
2227
|
-
"dvb",
|
|
2228
|
-
"dvmin",
|
|
2229
|
-
"dvmax",
|
|
2230
|
-
"cqw",
|
|
2231
|
-
"cqh",
|
|
2232
|
-
"cqi",
|
|
2233
|
-
"cqb",
|
|
2234
|
-
"cqmin",
|
|
2235
|
-
"cqmax"
|
|
2236
|
-
], Zt = [
|
|
2237
|
-
...Yr,
|
|
2238
|
-
...Zr
|
|
2239
|
-
], Kt = ["s", "ms"], qt = ["deg", "rad", "grad", "turn"], Kr = ["%"], Jt = ["Hz", "kHz"], Qt = ["dpi", "dpcm", "dppx"], qr = ["fr"], Ne = ["var", "calc"], Vs = ["string"], Xs = ["color"], cc = [
|
|
2240
|
-
...Zt,
|
|
2241
|
-
...Kt,
|
|
2242
|
-
...qt,
|
|
2243
|
-
...Kr,
|
|
2244
|
-
...Jt,
|
|
2245
|
-
...Qt,
|
|
2246
|
-
...qr,
|
|
2247
|
-
...Ne,
|
|
2248
|
-
...Vs,
|
|
2249
|
-
...Xs,
|
|
2250
|
-
"",
|
|
2251
|
-
void 0
|
|
2252
|
-
], Ws = ["string", "var", "calc"], Hs = [
|
|
2253
|
-
"accentColor",
|
|
2254
|
-
"additiveSymbols",
|
|
2255
|
-
"alignContent",
|
|
2256
|
-
"alignItems",
|
|
2257
|
-
"alignSelf",
|
|
2258
|
-
"alignmentBaseline",
|
|
2259
|
-
"all",
|
|
2260
|
-
"anchorName",
|
|
2261
|
-
"animation",
|
|
2262
|
-
"animationComposition",
|
|
2263
|
-
"animationDelay",
|
|
2264
|
-
"animationDirection",
|
|
2265
|
-
"animationDuration",
|
|
2266
|
-
"animationFillMode",
|
|
2267
|
-
"animationIterationCount",
|
|
2268
|
-
"animationName",
|
|
2269
|
-
"animationPlayState",
|
|
2270
|
-
"animationRange",
|
|
2271
|
-
"animationRangeEnd",
|
|
2272
|
-
"animationRangeStart",
|
|
2273
|
-
"animationTimeline",
|
|
2274
|
-
"animationTimingFunction",
|
|
2275
|
-
"appRegion",
|
|
2276
|
-
"appearance",
|
|
2277
|
-
"ascentOverride",
|
|
2278
|
-
"aspectRatio",
|
|
2279
|
-
"backdropFilter",
|
|
2280
|
-
"backfaceVisibility",
|
|
2281
|
-
"background",
|
|
2282
|
-
"backgroundAttachment",
|
|
2283
|
-
"backgroundBlendMode",
|
|
2284
|
-
"backgroundClip",
|
|
2285
|
-
"backgroundColor",
|
|
2286
|
-
"backgroundImage",
|
|
2287
|
-
"backgroundOrigin",
|
|
2288
|
-
"backgroundPosition",
|
|
2289
|
-
"backgroundPositionX",
|
|
2290
|
-
"backgroundPositionY",
|
|
2291
|
-
"backgroundRepeat",
|
|
2292
|
-
"backgroundSize",
|
|
2293
|
-
"basePalette",
|
|
2294
|
-
"baselineShift",
|
|
2295
|
-
"baselineSource",
|
|
2296
|
-
"blockSize",
|
|
2297
|
-
"border",
|
|
2298
|
-
"borderBlock",
|
|
2299
|
-
"borderBlockColor",
|
|
2300
|
-
"borderBlockEnd",
|
|
2301
|
-
"borderBlockEndColor",
|
|
2302
|
-
"borderBlockEndStyle",
|
|
2303
|
-
"borderBlockEndWidth",
|
|
2304
|
-
"borderBlockStart",
|
|
2305
|
-
"borderBlockStartColor",
|
|
2306
|
-
"borderBlockStartStyle",
|
|
2307
|
-
"borderBlockStartWidth",
|
|
2308
|
-
"borderBlockStyle",
|
|
2309
|
-
"borderBlockWidth",
|
|
2310
|
-
"borderBottom",
|
|
2311
|
-
"borderBottomColor",
|
|
2312
|
-
"borderBottomLeftRadius",
|
|
2313
|
-
"borderBottomRightRadius",
|
|
2314
|
-
"borderBottomStyle",
|
|
2315
|
-
"borderBottomWidth",
|
|
2316
|
-
"borderCollapse",
|
|
2317
|
-
"borderColor",
|
|
2318
|
-
"borderEndEndRadius",
|
|
2319
|
-
"borderEndStartRadius",
|
|
2320
|
-
"borderImage",
|
|
2321
|
-
"borderImageOutset",
|
|
2322
|
-
"borderImageRepeat",
|
|
2323
|
-
"borderImageSlice",
|
|
2324
|
-
"borderImageSource",
|
|
2325
|
-
"borderImageWidth",
|
|
2326
|
-
"borderInline",
|
|
2327
|
-
"borderInlineColor",
|
|
2328
|
-
"borderInlineEnd",
|
|
2329
|
-
"borderInlineEndColor",
|
|
2330
|
-
"borderInlineEndStyle",
|
|
2331
|
-
"borderInlineEndWidth",
|
|
2332
|
-
"borderInlineStart",
|
|
2333
|
-
"borderInlineStartColor",
|
|
2334
|
-
"borderInlineStartStyle",
|
|
2335
|
-
"borderInlineStartWidth",
|
|
2336
|
-
"borderInlineStyle",
|
|
2337
|
-
"borderInlineWidth",
|
|
2338
|
-
"borderLeft",
|
|
2339
|
-
"borderLeftColor",
|
|
2340
|
-
"borderLeftStyle",
|
|
2341
|
-
"borderLeftWidth",
|
|
2342
|
-
"borderRadius",
|
|
2343
|
-
"borderRight",
|
|
2344
|
-
"borderRightColor",
|
|
2345
|
-
"borderRightStyle",
|
|
2346
|
-
"borderRightWidth",
|
|
2347
|
-
"borderSpacing",
|
|
2348
|
-
"borderStartEndRadius",
|
|
2349
|
-
"borderStartStartRadius",
|
|
2350
|
-
"borderStyle",
|
|
2351
|
-
"borderTop",
|
|
2352
|
-
"borderTopColor",
|
|
2353
|
-
"borderTopLeftRadius",
|
|
2354
|
-
"borderTopRightRadius",
|
|
2355
|
-
"borderTopStyle",
|
|
2356
|
-
"borderTopWidth",
|
|
2357
|
-
"borderWidth",
|
|
2358
|
-
"bottom",
|
|
2359
|
-
"boxShadow",
|
|
2360
|
-
"boxSizing",
|
|
2361
|
-
"breakAfter",
|
|
2362
|
-
"breakBefore",
|
|
2363
|
-
"breakInside",
|
|
2364
|
-
"bufferedRendering",
|
|
2365
|
-
"captionSide",
|
|
2366
|
-
"caretColor",
|
|
2367
|
-
"clear",
|
|
2368
|
-
"clip",
|
|
2369
|
-
"clipPath",
|
|
2370
|
-
"clipRule",
|
|
2371
|
-
"color",
|
|
2372
|
-
"colorInterpolation",
|
|
2373
|
-
"colorInterpolationFilters",
|
|
2374
|
-
"colorRendering",
|
|
2375
|
-
"colorScheme",
|
|
2376
|
-
"columnCount",
|
|
2377
|
-
"columnFill",
|
|
2378
|
-
"columnGap",
|
|
2379
|
-
"columnRule",
|
|
2380
|
-
"columnRuleColor",
|
|
2381
|
-
"columnRuleStyle",
|
|
2382
|
-
"columnRuleWidth",
|
|
2383
|
-
"columnSpan",
|
|
2384
|
-
"columnWidth",
|
|
2385
|
-
"columns",
|
|
2386
|
-
"contain",
|
|
2387
|
-
"containIntrinsicBlockSize",
|
|
2388
|
-
"containIntrinsicHeight",
|
|
2389
|
-
"containIntrinsicInlineSize",
|
|
2390
|
-
"containIntrinsicSize",
|
|
2391
|
-
"containIntrinsicWidth",
|
|
2392
|
-
"container",
|
|
2393
|
-
"containerName",
|
|
2394
|
-
"containerType",
|
|
2395
|
-
"content",
|
|
2396
|
-
"contentVisibility",
|
|
2397
|
-
"counterIncrement",
|
|
2398
|
-
"counterReset",
|
|
2399
|
-
"counterSet",
|
|
2400
|
-
"cursor",
|
|
2401
|
-
"cx",
|
|
2402
|
-
"cy",
|
|
2403
|
-
"d",
|
|
2404
|
-
"descentOverride",
|
|
2405
|
-
"direction",
|
|
2406
|
-
"display",
|
|
2407
|
-
"dominantBaseline",
|
|
2408
|
-
"emptyCells",
|
|
2409
|
-
"fallback",
|
|
2410
|
-
"fieldSizing",
|
|
2411
|
-
"fill",
|
|
2412
|
-
"fillOpacity",
|
|
2413
|
-
"fillRule",
|
|
2414
|
-
"filter",
|
|
2415
|
-
"flex",
|
|
2416
|
-
"flexBasis",
|
|
2417
|
-
"flexDirection",
|
|
2418
|
-
"flexFlow",
|
|
2419
|
-
"flexGrow",
|
|
2420
|
-
"flexShrink",
|
|
2421
|
-
"flexWrap",
|
|
2422
|
-
"float",
|
|
2423
|
-
"floodColor",
|
|
2424
|
-
"floodOpacity",
|
|
2425
|
-
"font",
|
|
2426
|
-
"fontDisplay",
|
|
2427
|
-
"fontFamily",
|
|
2428
|
-
"fontFeatureSettings",
|
|
2429
|
-
"fontKerning",
|
|
2430
|
-
"fontOpticalSizing",
|
|
2431
|
-
"fontPalette",
|
|
2432
|
-
"fontSize",
|
|
2433
|
-
"fontStretch",
|
|
2434
|
-
"fontStyle",
|
|
2435
|
-
"fontSynthesis",
|
|
2436
|
-
"fontSynthesisSmallCaps",
|
|
2437
|
-
"fontSynthesisStyle",
|
|
2438
|
-
"fontSynthesisWeight",
|
|
2439
|
-
"fontVariant",
|
|
2440
|
-
"fontVariantAlternates",
|
|
2441
|
-
"fontVariantCaps",
|
|
2442
|
-
"fontVariantEastAsian",
|
|
2443
|
-
"fontVariantLigatures",
|
|
2444
|
-
"fontVariantNumeric",
|
|
2445
|
-
"fontVariantPosition",
|
|
2446
|
-
"fontVariationSettings",
|
|
2447
|
-
"fontWeight",
|
|
2448
|
-
"forcedColorAdjust",
|
|
2449
|
-
"gap",
|
|
2450
|
-
"grid",
|
|
2451
|
-
"gridArea",
|
|
2452
|
-
"gridAutoColumns",
|
|
2453
|
-
"gridAutoFlow",
|
|
2454
|
-
"gridAutoRows",
|
|
2455
|
-
"gridColumn",
|
|
2456
|
-
"gridColumnEnd",
|
|
2457
|
-
"gridColumnGap",
|
|
2458
|
-
"gridColumnStart",
|
|
2459
|
-
"gridGap",
|
|
2460
|
-
"gridRow",
|
|
2461
|
-
"gridRowEnd",
|
|
2462
|
-
"gridRowGap",
|
|
2463
|
-
"gridRowStart",
|
|
2464
|
-
"gridTemplate",
|
|
2465
|
-
"gridTemplateAreas",
|
|
2466
|
-
"gridTemplateColumns",
|
|
2467
|
-
"gridTemplateRows",
|
|
2468
|
-
"height",
|
|
2469
|
-
"hyphenateCharacter",
|
|
2470
|
-
"hyphenateLimitChars",
|
|
2471
|
-
"hyphens",
|
|
2472
|
-
"imageOrientation",
|
|
2473
|
-
"imageRendering",
|
|
2474
|
-
"inherits",
|
|
2475
|
-
"initialLetter",
|
|
2476
|
-
"initialValue",
|
|
2477
|
-
"inlineSize",
|
|
2478
|
-
"inset",
|
|
2479
|
-
"insetArea",
|
|
2480
|
-
"insetBlock",
|
|
2481
|
-
"insetBlockEnd",
|
|
2482
|
-
"insetBlockStart",
|
|
2483
|
-
"insetInline",
|
|
2484
|
-
"insetInlineEnd",
|
|
2485
|
-
"insetInlineStart",
|
|
2486
|
-
"isolation",
|
|
2487
|
-
"justifyContent",
|
|
2488
|
-
"justifyItems",
|
|
2489
|
-
"justifySelf",
|
|
2490
|
-
"left",
|
|
2491
|
-
"letterSpacing",
|
|
2492
|
-
"lightingColor",
|
|
2493
|
-
"lineBreak",
|
|
2494
|
-
"lineGapOverride",
|
|
2495
|
-
"lineHeight",
|
|
2496
|
-
"listStyle",
|
|
2497
|
-
"listStyleImage",
|
|
2498
|
-
"listStylePosition",
|
|
2499
|
-
"listStyleType",
|
|
2500
|
-
"margin",
|
|
2501
|
-
"marginBlock",
|
|
2502
|
-
"marginBlockEnd",
|
|
2503
|
-
"marginBlockStart",
|
|
2504
|
-
"marginBottom",
|
|
2505
|
-
"marginInline",
|
|
2506
|
-
"marginInlineEnd",
|
|
2507
|
-
"marginInlineStart",
|
|
2508
|
-
"marginLeft",
|
|
2509
|
-
"marginRight",
|
|
2510
|
-
"marginTop",
|
|
2511
|
-
"marker",
|
|
2512
|
-
"markerEnd",
|
|
2513
|
-
"markerMid",
|
|
2514
|
-
"markerStart",
|
|
2515
|
-
"mask",
|
|
2516
|
-
"maskClip",
|
|
2517
|
-
"maskComposite",
|
|
2518
|
-
"maskImage",
|
|
2519
|
-
"maskMode",
|
|
2520
|
-
"maskOrigin",
|
|
2521
|
-
"maskPosition",
|
|
2522
|
-
"maskRepeat",
|
|
2523
|
-
"maskSize",
|
|
2524
|
-
"maskType",
|
|
2525
|
-
"mathDepth",
|
|
2526
|
-
"mathShift",
|
|
2527
|
-
"mathStyle",
|
|
2528
|
-
"maxBlockSize",
|
|
2529
|
-
"maxHeight",
|
|
2530
|
-
"maxInlineSize",
|
|
2531
|
-
"maxWidth",
|
|
2532
|
-
"minBlockSize",
|
|
2533
|
-
"minHeight",
|
|
2534
|
-
"minInlineSize",
|
|
2535
|
-
"minWidth",
|
|
2536
|
-
"mixBlendMode",
|
|
2537
|
-
"navigation",
|
|
2538
|
-
"negative",
|
|
2539
|
-
"objectFit",
|
|
2540
|
-
"objectPosition",
|
|
2541
|
-
"objectViewBox",
|
|
2542
|
-
"offset",
|
|
2543
|
-
"offsetAnchor",
|
|
2544
|
-
"offsetDistance",
|
|
2545
|
-
"offsetPath",
|
|
2546
|
-
"offsetPosition",
|
|
2547
|
-
"offsetRotate",
|
|
2548
|
-
"opacity",
|
|
2549
|
-
"order",
|
|
2550
|
-
"orphans",
|
|
2551
|
-
"outline",
|
|
2552
|
-
"outlineColor",
|
|
2553
|
-
"outlineOffset",
|
|
2554
|
-
"outlineStyle",
|
|
2555
|
-
"outlineWidth",
|
|
2556
|
-
"overflow",
|
|
2557
|
-
"overflowAnchor",
|
|
2558
|
-
"overflowClipMargin",
|
|
2559
|
-
"overflowWrap",
|
|
2560
|
-
"overflowX",
|
|
2561
|
-
"overflowY",
|
|
2562
|
-
"overlay",
|
|
2563
|
-
"overrideColors",
|
|
2564
|
-
"overscrollBehavior",
|
|
2565
|
-
"overscrollBehaviorBlock",
|
|
2566
|
-
"overscrollBehaviorInline",
|
|
2567
|
-
"overscrollBehaviorX",
|
|
2568
|
-
"overscrollBehaviorY",
|
|
2569
|
-
"pad",
|
|
2570
|
-
"padding",
|
|
2571
|
-
"paddingBlock",
|
|
2572
|
-
"paddingBlockEnd",
|
|
2573
|
-
"paddingBlockStart",
|
|
2574
|
-
"paddingBottom",
|
|
2575
|
-
"paddingInline",
|
|
2576
|
-
"paddingInlineEnd",
|
|
2577
|
-
"paddingInlineStart",
|
|
2578
|
-
"paddingLeft",
|
|
2579
|
-
"paddingRight",
|
|
2580
|
-
"paddingTop",
|
|
2581
|
-
"page",
|
|
2582
|
-
"pageBreakAfter",
|
|
2583
|
-
"pageBreakBefore",
|
|
2584
|
-
"pageBreakInside",
|
|
2585
|
-
"pageOrientation",
|
|
2586
|
-
"paintOrder",
|
|
2587
|
-
"perspective",
|
|
2588
|
-
"perspectiveOrigin",
|
|
2589
|
-
"placeContent",
|
|
2590
|
-
"placeItems",
|
|
2591
|
-
"placeSelf",
|
|
2592
|
-
"pointerEvents",
|
|
2593
|
-
"position",
|
|
2594
|
-
"positionAnchor",
|
|
2595
|
-
"positionTry",
|
|
2596
|
-
"positionTryOptions",
|
|
2597
|
-
"positionTryOrder",
|
|
2598
|
-
"positionVisibility",
|
|
2599
|
-
"prefix",
|
|
2600
|
-
"quotes",
|
|
2601
|
-
"r",
|
|
2602
|
-
"range",
|
|
2603
|
-
"resize",
|
|
2604
|
-
"right",
|
|
2605
|
-
"rotate",
|
|
2606
|
-
"rowGap",
|
|
2607
|
-
"rubyPosition",
|
|
2608
|
-
"rx",
|
|
2609
|
-
"ry",
|
|
2610
|
-
"scale",
|
|
2611
|
-
"scrollBehavior",
|
|
2612
|
-
"scrollMargin",
|
|
2613
|
-
"scrollMarginBlock",
|
|
2614
|
-
"scrollMarginBlockEnd",
|
|
2615
|
-
"scrollMarginBlockStart",
|
|
2616
|
-
"scrollMarginBottom",
|
|
2617
|
-
"scrollMarginInline",
|
|
2618
|
-
"scrollMarginInlineEnd",
|
|
2619
|
-
"scrollMarginInlineStart",
|
|
2620
|
-
"scrollMarginLeft",
|
|
2621
|
-
"scrollMarginRight",
|
|
2622
|
-
"scrollMarginTop",
|
|
2623
|
-
"scrollPadding",
|
|
2624
|
-
"scrollPaddingBlock",
|
|
2625
|
-
"scrollPaddingBlockEnd",
|
|
2626
|
-
"scrollPaddingBlockStart",
|
|
2627
|
-
"scrollPaddingBottom",
|
|
2628
|
-
"scrollPaddingInline",
|
|
2629
|
-
"scrollPaddingInlineEnd",
|
|
2630
|
-
"scrollPaddingInlineStart",
|
|
2631
|
-
"scrollPaddingLeft",
|
|
2632
|
-
"scrollPaddingRight",
|
|
2633
|
-
"scrollPaddingTop",
|
|
2634
|
-
"scrollSnapAlign",
|
|
2635
|
-
"scrollSnapStop",
|
|
2636
|
-
"scrollSnapType",
|
|
2637
|
-
"scrollTimeline",
|
|
2638
|
-
"scrollTimelineAxis",
|
|
2639
|
-
"scrollTimelineName",
|
|
2640
|
-
"scrollbarColor",
|
|
2641
|
-
"scrollbarGutter",
|
|
2642
|
-
"scrollbarWidth",
|
|
2643
|
-
"shapeImageThreshold",
|
|
2644
|
-
"shapeMargin",
|
|
2645
|
-
"shapeOutside",
|
|
2646
|
-
"shapeRendering",
|
|
2647
|
-
"size",
|
|
2648
|
-
"sizeAdjust",
|
|
2649
|
-
"speak",
|
|
2650
|
-
"speakAs",
|
|
2651
|
-
"src",
|
|
2652
|
-
"stopColor",
|
|
2653
|
-
"stopOpacity",
|
|
2654
|
-
"stroke",
|
|
2655
|
-
"strokeDasharray",
|
|
2656
|
-
"strokeDashoffset",
|
|
2657
|
-
"strokeLinecap",
|
|
2658
|
-
"strokeLinejoin",
|
|
2659
|
-
"strokeMiterlimit",
|
|
2660
|
-
"strokeOpacity",
|
|
2661
|
-
"strokeWidth",
|
|
2662
|
-
"suffix",
|
|
2663
|
-
"symbols",
|
|
2664
|
-
"syntax",
|
|
2665
|
-
"system",
|
|
2666
|
-
"tabSize",
|
|
2667
|
-
"tableLayout",
|
|
2668
|
-
"textAlign",
|
|
2669
|
-
"textAlignLast",
|
|
2670
|
-
"textAnchor",
|
|
2671
|
-
"textCombineUpright",
|
|
2672
|
-
"textDecoration",
|
|
2673
|
-
"textDecorationColor",
|
|
2674
|
-
"textDecorationLine",
|
|
2675
|
-
"textDecorationSkipInk",
|
|
2676
|
-
"textDecorationStyle",
|
|
2677
|
-
"textDecorationThickness",
|
|
2678
|
-
"textEmphasis",
|
|
2679
|
-
"textEmphasisColor",
|
|
2680
|
-
"textEmphasisPosition",
|
|
2681
|
-
"textEmphasisStyle",
|
|
2682
|
-
"textIndent",
|
|
2683
|
-
"textOrientation",
|
|
2684
|
-
"textOverflow",
|
|
2685
|
-
"textRendering",
|
|
2686
|
-
"textShadow",
|
|
2687
|
-
"textSizeAdjust",
|
|
2688
|
-
"textSpacingTrim",
|
|
2689
|
-
"textTransform",
|
|
2690
|
-
"textUnderlineOffset",
|
|
2691
|
-
"textUnderlinePosition",
|
|
2692
|
-
"textWrap",
|
|
2693
|
-
"timelineScope",
|
|
2694
|
-
"top",
|
|
2695
|
-
"touchAction",
|
|
2696
|
-
"transform",
|
|
2697
|
-
"transformBox",
|
|
2698
|
-
"transformOrigin",
|
|
2699
|
-
"transformStyle",
|
|
2700
|
-
"transition",
|
|
2701
|
-
"transitionBehavior",
|
|
2702
|
-
"transitionDelay",
|
|
2703
|
-
"transitionDuration",
|
|
2704
|
-
"transitionProperty",
|
|
2705
|
-
"transitionTimingFunction",
|
|
2706
|
-
"translate",
|
|
2707
|
-
"types",
|
|
2708
|
-
"unicodeBidi",
|
|
2709
|
-
"unicodeRange",
|
|
2710
|
-
"userSelect",
|
|
2711
|
-
"vectorEffect",
|
|
2712
|
-
"verticalAlign",
|
|
2713
|
-
"viewTimeline",
|
|
2714
|
-
"viewTimelineAxis",
|
|
2715
|
-
"viewTimelineInset",
|
|
2716
|
-
"viewTimelineName",
|
|
2717
|
-
"viewTransitionClass",
|
|
2718
|
-
"viewTransitionName",
|
|
2719
|
-
"visibility",
|
|
2720
|
-
"webkitAlignContent",
|
|
2721
|
-
"webkitAlignItems",
|
|
2722
|
-
"webkitAlignSelf",
|
|
2723
|
-
"webkitAnimation",
|
|
2724
|
-
"webkitAnimationDelay",
|
|
2725
|
-
"webkitAnimationDirection",
|
|
2726
|
-
"webkitAnimationDuration",
|
|
2727
|
-
"webkitAnimationFillMode",
|
|
2728
|
-
"webkitAnimationIterationCount",
|
|
2729
|
-
"webkitAnimationName",
|
|
2730
|
-
"webkitAnimationPlayState",
|
|
2731
|
-
"webkitAnimationTimingFunction",
|
|
2732
|
-
"webkitAppRegion",
|
|
2733
|
-
"webkitAppearance",
|
|
2734
|
-
"webkitBackfaceVisibility",
|
|
2735
|
-
"webkitBackgroundClip",
|
|
2736
|
-
"webkitBackgroundOrigin",
|
|
2737
|
-
"webkitBackgroundSize",
|
|
2738
|
-
"webkitBorderAfter",
|
|
2739
|
-
"webkitBorderAfterColor",
|
|
2740
|
-
"webkitBorderAfterStyle",
|
|
2741
|
-
"webkitBorderAfterWidth",
|
|
2742
|
-
"webkitBorderBefore",
|
|
2743
|
-
"webkitBorderBeforeColor",
|
|
2744
|
-
"webkitBorderBeforeStyle",
|
|
2745
|
-
"webkitBorderBeforeWidth",
|
|
2746
|
-
"webkitBorderBottomLeftRadius",
|
|
2747
|
-
"webkitBorderBottomRightRadius",
|
|
2748
|
-
"webkitBorderEnd",
|
|
2749
|
-
"webkitBorderEndColor",
|
|
2750
|
-
"webkitBorderEndStyle",
|
|
2751
|
-
"webkitBorderEndWidth",
|
|
2752
|
-
"webkitBorderHorizontalSpacing",
|
|
2753
|
-
"webkitBorderImage",
|
|
2754
|
-
"webkitBorderRadius",
|
|
2755
|
-
"webkitBorderStart",
|
|
2756
|
-
"webkitBorderStartColor",
|
|
2757
|
-
"webkitBorderStartStyle",
|
|
2758
|
-
"webkitBorderStartWidth",
|
|
2759
|
-
"webkitBorderTopLeftRadius",
|
|
2760
|
-
"webkitBorderTopRightRadius",
|
|
2761
|
-
"webkitBorderVerticalSpacing",
|
|
2762
|
-
"webkitBoxAlign",
|
|
2763
|
-
"webkitBoxDecorationBreak",
|
|
2764
|
-
"webkitBoxDirection",
|
|
2765
|
-
"webkitBoxFlex",
|
|
2766
|
-
"webkitBoxOrdinalGroup",
|
|
2767
|
-
"webkitBoxOrient",
|
|
2768
|
-
"webkitBoxPack",
|
|
2769
|
-
"webkitBoxReflect",
|
|
2770
|
-
"webkitBoxShadow",
|
|
2771
|
-
"webkitBoxSizing",
|
|
2772
|
-
"webkitClipPath",
|
|
2773
|
-
"webkitColumnBreakAfter",
|
|
2774
|
-
"webkitColumnBreakBefore",
|
|
2775
|
-
"webkitColumnBreakInside",
|
|
2776
|
-
"webkitColumnCount",
|
|
2777
|
-
"webkitColumnGap",
|
|
2778
|
-
"webkitColumnRule",
|
|
2779
|
-
"webkitColumnRuleColor",
|
|
2780
|
-
"webkitColumnRuleStyle",
|
|
2781
|
-
"webkitColumnRuleWidth",
|
|
2782
|
-
"webkitColumnSpan",
|
|
2783
|
-
"webkitColumnWidth",
|
|
2784
|
-
"webkitColumns",
|
|
2785
|
-
"webkitFilter",
|
|
2786
|
-
"webkitFlex",
|
|
2787
|
-
"webkitFlexBasis",
|
|
2788
|
-
"webkitFlexDirection",
|
|
2789
|
-
"webkitFlexFlow",
|
|
2790
|
-
"webkitFlexGrow",
|
|
2791
|
-
"webkitFlexShrink",
|
|
2792
|
-
"webkitFlexWrap",
|
|
2793
|
-
"webkitFontFeatureSettings",
|
|
2794
|
-
"webkitFontSmoothing",
|
|
2795
|
-
"webkitHyphenateCharacter",
|
|
2796
|
-
"webkitJustifyContent",
|
|
2797
|
-
"webkitLineBreak",
|
|
2798
|
-
"webkitLineClamp",
|
|
2799
|
-
"webkitLocale",
|
|
2800
|
-
"webkitLogicalHeight",
|
|
2801
|
-
"webkitLogicalWidth",
|
|
2802
|
-
"webkitMarginAfter",
|
|
2803
|
-
"webkitMarginBefore",
|
|
2804
|
-
"webkitMarginEnd",
|
|
2805
|
-
"webkitMarginStart",
|
|
2806
|
-
"webkitMask",
|
|
2807
|
-
"webkitMaskBoxImage",
|
|
2808
|
-
"webkitMaskBoxImageOutset",
|
|
2809
|
-
"webkitMaskBoxImageRepeat",
|
|
2810
|
-
"webkitMaskBoxImageSlice",
|
|
2811
|
-
"webkitMaskBoxImageSource",
|
|
2812
|
-
"webkitMaskBoxImageWidth",
|
|
2813
|
-
"webkitMaskClip",
|
|
2814
|
-
"webkitMaskComposite",
|
|
2815
|
-
"webkitMaskImage",
|
|
2816
|
-
"webkitMaskOrigin",
|
|
2817
|
-
"webkitMaskPosition",
|
|
2818
|
-
"webkitMaskPositionX",
|
|
2819
|
-
"webkitMaskPositionY",
|
|
2820
|
-
"webkitMaskRepeat",
|
|
2821
|
-
"webkitMaskSize",
|
|
2822
|
-
"webkitMaxLogicalHeight",
|
|
2823
|
-
"webkitMaxLogicalWidth",
|
|
2824
|
-
"webkitMinLogicalHeight",
|
|
2825
|
-
"webkitMinLogicalWidth",
|
|
2826
|
-
"webkitOpacity",
|
|
2827
|
-
"webkitOrder",
|
|
2828
|
-
"webkitPaddingAfter",
|
|
2829
|
-
"webkitPaddingBefore",
|
|
2830
|
-
"webkitPaddingEnd",
|
|
2831
|
-
"webkitPaddingStart",
|
|
2832
|
-
"webkitPerspective",
|
|
2833
|
-
"webkitPerspectiveOrigin",
|
|
2834
|
-
"webkitPerspectiveOriginX",
|
|
2835
|
-
"webkitPerspectiveOriginY",
|
|
2836
|
-
"webkitPrintColorAdjust",
|
|
2837
|
-
"webkitRtlOrdering",
|
|
2838
|
-
"webkitRubyPosition",
|
|
2839
|
-
"webkitShapeImageThreshold",
|
|
2840
|
-
"webkitShapeMargin",
|
|
2841
|
-
"webkitShapeOutside",
|
|
2842
|
-
"webkitTapHighlightColor",
|
|
2843
|
-
"webkitTextCombine",
|
|
2844
|
-
"webkitTextDecorationsInEffect",
|
|
2845
|
-
"webkitTextEmphasis",
|
|
2846
|
-
"webkitTextEmphasisColor",
|
|
2847
|
-
"webkitTextEmphasisPosition",
|
|
2848
|
-
"webkitTextEmphasisStyle",
|
|
2849
|
-
"webkitTextFillColor",
|
|
2850
|
-
"webkitTextOrientation",
|
|
2851
|
-
"webkitTextSecurity",
|
|
2852
|
-
"webkitTextSizeAdjust",
|
|
2853
|
-
"webkitTextStroke",
|
|
2854
|
-
"webkitTextStrokeColor",
|
|
2855
|
-
"webkitTextStrokeWidth",
|
|
2856
|
-
"webkitTransform",
|
|
2857
|
-
"webkitTransformOrigin",
|
|
2858
|
-
"webkitTransformOriginX",
|
|
2859
|
-
"webkitTransformOriginY",
|
|
2860
|
-
"webkitTransformOriginZ",
|
|
2861
|
-
"webkitTransformStyle",
|
|
2862
|
-
"webkitTransition",
|
|
2863
|
-
"webkitTransitionDelay",
|
|
2864
|
-
"webkitTransitionDuration",
|
|
2865
|
-
"webkitTransitionProperty",
|
|
2866
|
-
"webkitTransitionTimingFunction",
|
|
2867
|
-
"webkitUserDrag",
|
|
2868
|
-
"webkitUserModify",
|
|
2869
|
-
"webkitUserSelect",
|
|
2870
|
-
"webkitWritingMode",
|
|
2871
|
-
"whiteSpace",
|
|
2872
|
-
"whiteSpaceCollapse",
|
|
2873
|
-
"widows",
|
|
2874
|
-
"width",
|
|
2875
|
-
"willChange",
|
|
2876
|
-
"wordBreak",
|
|
2877
|
-
"wordSpacing",
|
|
2878
|
-
"wordWrap",
|
|
2879
|
-
"writingMode",
|
|
2880
|
-
"x",
|
|
2881
|
-
"y",
|
|
2882
|
-
"zIndex",
|
|
2883
|
-
"zoom"
|
|
2884
|
-
];
|
|
2885
|
-
function _e(e) {
|
|
2886
|
-
return e.unit === "color";
|
|
2887
|
-
}
|
|
2888
|
-
const lc = (e) => {
|
|
2889
|
-
const t = {}, n = (r, o = void 0) => {
|
|
2890
|
-
if (Array.isArray(r)) {
|
|
2891
|
-
r.forEach((i, a) => n(i, o));
|
|
2892
|
-
return;
|
|
2893
|
-
} else if (r instanceof N) {
|
|
2894
|
-
let i = r.name;
|
|
2895
|
-
o && (o.endsWith(r.name) ? i = o : i = `${o}.${r.name}`), r.values.forEach((a, c) => n(a, i));
|
|
2896
|
-
return;
|
|
2897
|
-
} else if (pr(r)) {
|
|
2898
|
-
for (const [i, a] of Object.entries(r)) {
|
|
2899
|
-
const c = o ? `${o}.${i}` : i;
|
|
2900
|
-
n(a, c);
|
|
2901
|
-
}
|
|
2902
|
-
return;
|
|
2903
|
-
}
|
|
2904
|
-
const s = o;
|
|
2905
|
-
t[s] == null && (t[s] = new _t()), t[s].push(r), t[s] = t[s].flat();
|
|
2906
|
-
};
|
|
2907
|
-
return n(e), t;
|
|
2908
|
-
}, uc = (e) => {
|
|
2909
|
-
const t = {};
|
|
2910
|
-
for (const [n, r] of Object.entries(e)) {
|
|
2911
|
-
const o = n.split(".");
|
|
2912
|
-
let s = t;
|
|
2913
|
-
for (let i = 0; i < o.length; i++) {
|
|
2914
|
-
const a = o[i];
|
|
2915
|
-
i === o.length - 1 ? Array.isArray(s) ? s.push(r) : s[a] = r : (a in s || (s[a] = {}), s = s[a]);
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
return t;
|
|
2919
|
-
}, fc = (e) => {
|
|
2920
|
-
const t = {};
|
|
2921
|
-
for (const [n, r] of Object.entries(e)) {
|
|
2922
|
-
const o = n.split("."), s = o[0];
|
|
2923
|
-
let i = t[s] ?? "", a = "", c = "";
|
|
2924
|
-
for (let f = 1; f < o.length; f++)
|
|
2925
|
-
a += `${o[f]}(`, c += ")";
|
|
2926
|
-
let l = "";
|
|
2927
|
-
o.length > 1 && Array.isArray(r) ? l = r.join(", ") : l = r.toString(), i += ` ${a}${l}${c}`, t[s] = i.trim();
|
|
2928
|
-
}
|
|
2929
|
-
return t;
|
|
2930
|
-
}, js = new Set(Hs);
|
|
2931
|
-
function pc(e) {
|
|
2932
|
-
return js.has(e);
|
|
2933
|
-
}
|
|
2934
|
-
const Ys = (e) => {
|
|
2935
|
-
const t = e.name, n = e.valueOf();
|
|
2936
|
-
if (!e.name.startsWith("matrix"))
|
|
2937
|
-
throw new Error("Input must be a matrix or matrix3d value");
|
|
2938
|
-
const r = {
|
|
2939
|
-
scaleX: 1,
|
|
2940
|
-
scaleY: 1,
|
|
2941
|
-
scaleZ: 1,
|
|
2942
|
-
skewX: 0,
|
|
2943
|
-
skewY: 0,
|
|
2944
|
-
skewZ: 0,
|
|
2945
|
-
translateX: 0,
|
|
2946
|
-
translateY: 0,
|
|
2947
|
-
translateZ: 0,
|
|
2948
|
-
rotateX: 0,
|
|
2949
|
-
rotateY: 0,
|
|
2950
|
-
rotateZ: 0,
|
|
2951
|
-
perspectiveX: 0,
|
|
2952
|
-
perspectiveY: 0,
|
|
2953
|
-
perspectiveZ: 0,
|
|
2954
|
-
perspectiveW: 1
|
|
2955
|
-
};
|
|
2956
|
-
if (e.name === "matrix")
|
|
2957
|
-
return {
|
|
2958
|
-
...r,
|
|
2959
|
-
scaleX: n[0] ?? 1,
|
|
2960
|
-
skewY: n[1] ?? 0,
|
|
2961
|
-
skewX: n[2] ?? 0,
|
|
2962
|
-
scaleY: n[3] ?? 1,
|
|
2963
|
-
translateX: n[4] ?? 0,
|
|
2964
|
-
translateY: n[5] ?? 0,
|
|
2965
|
-
rotateZ: Math.atan2(n[1] ?? 0, n[0] ?? 1),
|
|
2966
|
-
rotateY: Math.atan2(-(n[2] ?? 0), n[0] ?? 1),
|
|
2967
|
-
rotateX: Math.atan2(n[1] ?? 0, n[3] ?? 1)
|
|
2968
|
-
};
|
|
2969
|
-
if (t === "matrix3d") {
|
|
2970
|
-
if (n.length === 4)
|
|
2971
|
-
return {
|
|
2972
|
-
...r,
|
|
2973
|
-
translateX: n[0] ?? 0,
|
|
2974
|
-
translateY: n[1] ?? 0,
|
|
2975
|
-
translateZ: n[2] ?? 0,
|
|
2976
|
-
perspectiveW: n[3] ?? 1
|
|
2977
|
-
};
|
|
2978
|
-
if (n.length === 16)
|
|
2979
|
-
return {
|
|
2980
|
-
scaleX: n[0] ?? 1,
|
|
2981
|
-
skewY: n[1] ?? 0,
|
|
2982
|
-
skewX: n[4] ?? 0,
|
|
2983
|
-
scaleY: n[5] ?? 1,
|
|
2984
|
-
scaleZ: n[10] ?? 1,
|
|
2985
|
-
skewZ: n[2] ?? 0,
|
|
2986
|
-
translateX: n[12] ?? 0,
|
|
2987
|
-
translateY: n[13] ?? 0,
|
|
2988
|
-
translateZ: n[14] ?? 0,
|
|
2989
|
-
rotateX: Math.atan2(-(n[9] ?? 0), n[10] ?? 1),
|
|
2990
|
-
rotateY: Math.atan2(
|
|
2991
|
-
n[8] ?? 0,
|
|
2992
|
-
Math.sqrt(
|
|
2993
|
-
Math.pow(n[0] ?? 1, 2) + Math.pow(n[1] ?? 0, 2)
|
|
2994
|
-
)
|
|
2995
|
-
),
|
|
2996
|
-
rotateZ: Math.atan2(n[1] ?? 0, n[0] ?? 1),
|
|
2997
|
-
perspectiveX: n[3] ?? 0,
|
|
2998
|
-
perspectiveY: n[7] ?? 0,
|
|
2999
|
-
perspectiveZ: n[11] ?? 0,
|
|
3000
|
-
perspectiveW: n[15] ?? 1
|
|
3001
|
-
};
|
|
3002
|
-
}
|
|
3003
|
-
throw new Error("Unsupported matrix type or invalid number of values");
|
|
3004
|
-
};
|
|
3005
|
-
function Zs(e, t) {
|
|
3006
|
-
let n = e;
|
|
3007
|
-
return t === "cm" ? n *= 96 / 2.54 : t === "mm" ? n *= 96 / 25.4 : t === "Q" ? n *= 96 / (25.4 * 4) : t === "in" ? n *= 96 : t === "pt" ? n *= 4 / 3 : t === "pc" && (n *= 16), n;
|
|
3008
|
-
}
|
|
3009
|
-
function Jr(e, t, n, r) {
|
|
3010
|
-
if (t === "em" && n)
|
|
3011
|
-
e *= parseFloat(getComputedStyle(n).fontSize);
|
|
3012
|
-
else if (t === "rem")
|
|
3013
|
-
e *= parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
3014
|
-
else if (t === "vh")
|
|
3015
|
-
e *= window.innerHeight / 100;
|
|
3016
|
-
else if (t === "vw")
|
|
3017
|
-
e *= window.innerWidth / 100;
|
|
3018
|
-
else if (t === "vmin")
|
|
3019
|
-
e *= Math.min(window.innerHeight, window.innerWidth) / 100;
|
|
3020
|
-
else if (t === "vmax")
|
|
3021
|
-
e *= Math.max(window.innerHeight, window.innerWidth) / 100;
|
|
3022
|
-
else if (t === "%" && n?.parentElement && r) {
|
|
3023
|
-
const o = parseFloat(
|
|
3024
|
-
getComputedStyle(n.parentElement).getPropertyValue(r)
|
|
3025
|
-
);
|
|
3026
|
-
e = e / 100 * o;
|
|
3027
|
-
} else if (t === "ch" && n) {
|
|
3028
|
-
const o = parseFloat(getComputedStyle(n).fontSize) || 16;
|
|
3029
|
-
if (typeof OffscreenCanvas < "u" || typeof document < "u")
|
|
3030
|
-
try {
|
|
3031
|
-
const i = (typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : document.createElement("canvas")).getContext("2d");
|
|
3032
|
-
i.font = `${o}px ${getComputedStyle(n).fontFamily}`;
|
|
3033
|
-
const a = i.measureText("0").width;
|
|
3034
|
-
e *= a > 0 ? a : o * 0.5;
|
|
3035
|
-
} catch {
|
|
3036
|
-
e *= o * 0.5;
|
|
3037
|
-
}
|
|
3038
|
-
else
|
|
3039
|
-
e *= o * 0.5;
|
|
3040
|
-
} else if (t === "ex" && n) {
|
|
3041
|
-
const o = parseFloat(getComputedStyle(n).fontSize) || 16;
|
|
3042
|
-
e *= o * 0.5;
|
|
3043
|
-
} else
|
|
3044
|
-
e = Zs(e, t);
|
|
3045
|
-
return e;
|
|
3046
|
-
}
|
|
3047
|
-
function Qr(e, t) {
|
|
3048
|
-
return t === "s" && (e *= 1e3), e;
|
|
3049
|
-
}
|
|
3050
|
-
function ce(e, t) {
|
|
3051
|
-
return t === "grad" ? e *= 0.9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
|
|
3052
|
-
}
|
|
3053
|
-
function Ks(e, t) {
|
|
3054
|
-
return t === "kHz" && (e *= 1e3), e;
|
|
3055
|
-
}
|
|
3056
|
-
function to(e, t) {
|
|
3057
|
-
return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
|
|
3058
|
-
}
|
|
3059
|
-
const qs = {
|
|
3060
|
-
length: Jr,
|
|
3061
|
-
time: Qr,
|
|
3062
|
-
angle: ce,
|
|
3063
|
-
frequency: Ks,
|
|
3064
|
-
resolution: to
|
|
3065
|
-
};
|
|
3066
|
-
function Rn(e) {
|
|
3067
|
-
return Zt.includes(e) ? [Zt, "length"] : Kt.includes(e) ? [Kt, "time"] : qt.includes(e) ? [qt, "angle"] : Jt.includes(e) ? [Jt, "frequency"] : Qt.includes(e) ? [Qt, "resolution"] : null;
|
|
3068
|
-
}
|
|
3069
|
-
function hc(e, t, n, r) {
|
|
3070
|
-
const o = Rn(t), s = Rn(n);
|
|
3071
|
-
if (!o || !s || o[1] !== s[1])
|
|
3072
|
-
throw new Error(`Incompatible units: ${t} and ${n}`);
|
|
3073
|
-
const [, i] = o, a = qs[i], c = a(e, t, r), l = a(1, n, r);
|
|
3074
|
-
return c / l;
|
|
3075
|
-
}
|
|
3076
|
-
const g = (e) => {
|
|
3077
|
-
const t = new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
|
|
3078
|
-
return Y(t);
|
|
3079
|
-
}, Js = Y(/-?[a-zA-Z][a-zA-Z0-9-]*/), ln = g("none"), Qs = Y(/-?\d+/).map(Number), J = Y(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);
|
|
3080
|
-
function ti(e) {
|
|
3081
|
-
return new T((t) => t.ok(e, 0));
|
|
3082
|
-
}
|
|
3083
|
-
function ei(e) {
|
|
3084
|
-
return new T((t) => t.err(void 0, 0));
|
|
3085
|
-
}
|
|
3086
|
-
function Et(e, t) {
|
|
3087
|
-
const n = e.parseState(t);
|
|
3088
|
-
if (n.isError)
|
|
3089
|
-
throw new Error(`Parse error at offset ${n.offset}`);
|
|
3090
|
-
return n.value;
|
|
3091
|
-
}
|
|
3092
|
-
function ni(e, t) {
|
|
3093
|
-
const n = e.parseState(t);
|
|
3094
|
-
return { status: !n.isError, value: n.value };
|
|
3095
|
-
}
|
|
3096
|
-
const ri = d(...Zt.map(g)), oi = d(...qt.map(g)), si = d(...Kt.map(g)), ii = d(...Jt.map(g)), ai = d(...Qt.map(g)), ci = d(...qr.map(g)), li = d(...Kr.map(g)), ui = k(","), fi = k(" "), pi = d(ui, fi).trim(w), eo = A(J, ri).map(([e, t]) => {
|
|
3097
|
-
const n = ["length"];
|
|
3098
|
-
return Zr.includes(t) ? n.push("relative") : Yr.includes(t) && n.push("absolute"), new S(e, t, n);
|
|
3099
|
-
}), no = A(J, oi).map(([e, t]) => new S(e, t, ["angle"])), un = A(J, si).map(([e, t]) => new S(e, t, ["time"])), hi = T.lazy(() => d(fn, un)), ro = A(J, ii).map(([e, t]) => new S(e, t, ["frequency"])), oo = A(J, ai).map(([e, t]) => new S(e, t, ["resolution"])), so = A(J, ci).map(([e, t]) => new S(e, t, ["flex"])), fn = d(
|
|
3100
|
-
A(J, li),
|
|
3101
|
-
g("from").map(() => [0, "%"]),
|
|
3102
|
-
g("to").map(() => [100, "%"])
|
|
3103
|
-
).map(([e, t]) => new S(e, t, ["percentage"])), io = T.lazy(() => pn.Value), ao = k("/").trim(w).map(() => new S("/", "string")), co = d(
|
|
3104
|
-
eo,
|
|
3105
|
-
no,
|
|
3106
|
-
un,
|
|
3107
|
-
ro,
|
|
3108
|
-
oo,
|
|
3109
|
-
so,
|
|
3110
|
-
fn,
|
|
3111
|
-
io,
|
|
3112
|
-
ao,
|
|
3113
|
-
J.map((e) => new S(e)),
|
|
3114
|
-
ln.map(() => new S(NaN))
|
|
3115
|
-
).trim(w), W = {
|
|
3116
|
-
Length: eo,
|
|
3117
|
-
Angle: no,
|
|
3118
|
-
Time: un,
|
|
3119
|
-
TimePercentage: hi,
|
|
3120
|
-
Frequency: ro,
|
|
3121
|
-
Resolution: oo,
|
|
3122
|
-
Flex: so,
|
|
3123
|
-
Percentage: fn,
|
|
3124
|
-
Color: io,
|
|
3125
|
-
Slash: ao,
|
|
3126
|
-
Value: co,
|
|
3127
|
-
sep: pi
|
|
3128
|
-
};
|
|
3129
|
-
function lo(e) {
|
|
3130
|
-
return Et(co, e);
|
|
3131
|
-
}
|
|
3132
|
-
const V = (e) => new S(
|
|
3133
|
-
e,
|
|
3134
|
-
"color",
|
|
3135
|
-
["color", e.colorSpace],
|
|
3136
|
-
void 0,
|
|
3137
|
-
"color"
|
|
3138
|
-
);
|
|
3139
|
-
function Pe(e) {
|
|
3140
|
-
const n = Be(e).value, r = n.clone();
|
|
3141
|
-
for (const o of n.keys()) {
|
|
3142
|
-
const s = n[o];
|
|
3143
|
-
r[o] = s instanceof S ? s.value : s;
|
|
3144
|
-
}
|
|
3145
|
-
return r;
|
|
3146
|
-
}
|
|
3147
|
-
function mi(e) {
|
|
3148
|
-
const t = e.replace(/[^0-9.+\-*/() e]/g, "");
|
|
3149
|
-
return new Function(`return (${t})`)();
|
|
3150
|
-
}
|
|
3151
|
-
function Bn(e, t) {
|
|
3152
|
-
switch (e.type) {
|
|
3153
|
-
case "ref":
|
|
3154
|
-
return t[e.name] ?? 0;
|
|
3155
|
-
case "literal":
|
|
3156
|
-
return e.value;
|
|
3157
|
-
case "none":
|
|
3158
|
-
return NaN;
|
|
3159
|
-
case "calc": {
|
|
3160
|
-
let n = e.expr;
|
|
3161
|
-
const r = Object.keys(t).sort((o, s) => s.length - o.length);
|
|
3162
|
-
for (const o of r)
|
|
3163
|
-
n = n.replace(new RegExp(`\\b${o}\\b`, "g"), String(t[o]));
|
|
3164
|
-
return mi(n);
|
|
3165
|
-
}
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
function bi(e, t, n, r) {
|
|
3169
|
-
const o = Pe(e), s = gt(o, t), i = {};
|
|
3170
|
-
for (const [u, h] of s.entries())
|
|
3171
|
-
i[u] = h;
|
|
3172
|
-
const a = n.map((u) => Bn(u, i)), c = r ? Bn(r, i) : i.alpha ?? 1, f = {
|
|
3173
|
-
rgb: D,
|
|
3174
|
-
hsl: vt,
|
|
3175
|
-
hwb: Ue,
|
|
3176
|
-
lab: se,
|
|
3177
|
-
lch: Ge,
|
|
3178
|
-
oklab: ie,
|
|
3179
|
-
oklch: Ve,
|
|
3180
|
-
xyz: X,
|
|
3181
|
-
"srgb-linear": Xe,
|
|
3182
|
-
"display-p3": We,
|
|
3183
|
-
"a98-rgb": He,
|
|
3184
|
-
"prophoto-rgb": je,
|
|
3185
|
-
rec2020: Ye
|
|
3186
|
-
}[t] ?? D, p = new f(...a, c);
|
|
3187
|
-
return V(p);
|
|
3188
|
-
}
|
|
3189
|
-
const gi = {
|
|
3190
|
-
srgb: "rgb",
|
|
3191
|
-
"srgb-linear": "srgb-linear",
|
|
3192
|
-
"display-p3": "display-p3",
|
|
3193
|
-
"a98-rgb": "a98-rgb",
|
|
3194
|
-
"prophoto-rgb": "prophoto-rgb",
|
|
3195
|
-
rec2020: "rec2020",
|
|
3196
|
-
lab: "lab",
|
|
3197
|
-
oklab: "oklab",
|
|
3198
|
-
oklch: "oklch",
|
|
3199
|
-
hsl: "hsl",
|
|
3200
|
-
hwb: "hwb",
|
|
3201
|
-
lch: "lch",
|
|
3202
|
-
xyz: "xyz",
|
|
3203
|
-
"xyz-d65": "xyz",
|
|
3204
|
-
"xyz-d50": "xyz"
|
|
3205
|
-
}, di = {
|
|
3206
|
-
srgb: { space: "rgb", ctor: D },
|
|
3207
|
-
"srgb-linear": { space: "srgb-linear", ctor: Xe },
|
|
3208
|
-
"display-p3": { space: "display-p3", ctor: We },
|
|
3209
|
-
"a98-rgb": { space: "a98-rgb", ctor: He },
|
|
3210
|
-
"prophoto-rgb": { space: "prophoto-rgb", ctor: je },
|
|
3211
|
-
rec2020: { space: "rec2020", ctor: Ye },
|
|
3212
|
-
xyz: { space: "xyz", ctor: X },
|
|
3213
|
-
"xyz-d65": { space: "xyz", ctor: X },
|
|
3214
|
-
"xyz-d50": { space: "xyz", ctor: X }
|
|
3215
|
-
}, wi = k(","), ki = Y(/\s+/), le = k("/"), ue = k("("), fe = k(")"), te = d(wi.trim(w), ki), uo = d(le.trim(w), te), j = T.lazy(() => d(
|
|
3216
|
-
W.Percentage,
|
|
3217
|
-
W.Angle.map((e) => {
|
|
3218
|
-
const t = ce(e.value, e.unit);
|
|
3219
|
-
return new S(t, "deg", ["angle"]);
|
|
3220
|
-
}),
|
|
3221
|
-
d(J, Qs).map((e) => new S(e)),
|
|
3222
|
-
ln.map(() => new S(NaN))
|
|
3223
|
-
)), Ot = d(
|
|
3224
|
-
// calc(...)
|
|
3225
|
-
g("calc").next(
|
|
3226
|
-
Y(/\(([^)]+)\)/, (e) => e?.[1] ?? null)
|
|
3227
|
-
).map((e) => ({ type: "calc", expr: e })),
|
|
3228
|
-
// none
|
|
3229
|
-
ln.map(() => ({ type: "none" })),
|
|
3230
|
-
// component reference (alpha must be tried before single 'a')
|
|
3231
|
-
Y(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(
|
|
3232
|
-
(e) => ({ type: "ref", name: e })
|
|
3233
|
-
),
|
|
3234
|
-
// literal number / percentage / angle
|
|
3235
|
-
j.map((e) => ({ type: "literal", value: e.value }))
|
|
3236
|
-
), rt = (e) => {
|
|
3237
|
-
const t = k(e).skip(g("a").opt()), n = d(
|
|
3238
|
-
A(j.skip(uo), j),
|
|
3239
|
-
j.map((o) => [o])
|
|
3240
|
-
), r = A(
|
|
3241
|
-
j.skip(te),
|
|
3242
|
-
j.skip(te),
|
|
3243
|
-
n
|
|
3244
|
-
).trim(w).wrap(ue, fe);
|
|
3245
|
-
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new S(1)]);
|
|
3246
|
-
};
|
|
3247
|
-
function lt(e, t) {
|
|
3248
|
-
return k(e).skip(g("a").opt()).next(
|
|
3249
|
-
A(
|
|
3250
|
-
g("from").skip(w).next(T.lazy(() => pn.Value)),
|
|
3251
|
-
w.next(Ot),
|
|
3252
|
-
w.next(Ot),
|
|
3253
|
-
w.next(Ot),
|
|
3254
|
-
le.trim(w).next(Ot).opt()
|
|
3255
|
-
).trim(w).wrap(ue, fe)
|
|
3256
|
-
).map(([n, r, o, s, i]) => bi(n, t, [r, o, s], i));
|
|
3257
|
-
}
|
|
3258
|
-
const yi = Y(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
3259
|
-
const { r: t, g: n, b: r, alpha: o } = jo(e);
|
|
3260
|
-
return V(new D(t, n, r, o));
|
|
3261
|
-
}), Si = J.skip(g("k")).map((e) => {
|
|
3262
|
-
const t = Ar(new hr(e));
|
|
3263
|
-
return V(t);
|
|
3264
|
-
}), Ci = d(
|
|
3265
|
-
lt("rgb", "rgb"),
|
|
3266
|
-
rt("rgb").map(
|
|
3267
|
-
([e, t, n, r]) => V(new D(e, t, n, r))
|
|
3268
|
-
)
|
|
3269
|
-
), xi = d(
|
|
3270
|
-
lt("hsl", "hsl"),
|
|
3271
|
-
rt("hsl").map(
|
|
3272
|
-
([e, t, n, r]) => V(new vt(e, t, n, r))
|
|
3273
|
-
)
|
|
3274
|
-
), Ei = rt("hsv").map(
|
|
3275
|
-
([e, t, n, r]) => V(new De(e, t, n, r))
|
|
3276
|
-
), vi = d(
|
|
3277
|
-
lt("hwb", "hwb"),
|
|
3278
|
-
rt("hwb").map(
|
|
3279
|
-
([e, t, n, r]) => V(new Ue(e, t, n, r))
|
|
3280
|
-
)
|
|
3281
|
-
), Mi = d(
|
|
3282
|
-
lt("lab", "lab"),
|
|
3283
|
-
rt("lab").map(
|
|
3284
|
-
([e, t, n, r]) => V(new se(e, t, n, r))
|
|
3285
|
-
)
|
|
3286
|
-
), Ti = d(
|
|
3287
|
-
lt("lch", "lch"),
|
|
3288
|
-
rt("lch").map(
|
|
3289
|
-
([e, t, n, r]) => V(new Ge(e, t, n, r))
|
|
3290
|
-
)
|
|
3291
|
-
), Ai = d(
|
|
3292
|
-
lt("oklab", "oklab"),
|
|
3293
|
-
rt("oklab").map(
|
|
3294
|
-
([e, t, n, r]) => V(new ie(e, t, n, r))
|
|
3295
|
-
)
|
|
3296
|
-
), Ii = d(
|
|
3297
|
-
lt("oklch", "oklch"),
|
|
3298
|
-
rt("oklch").map(
|
|
3299
|
-
([e, t, n, r]) => V(new Ve(e, t, n, r))
|
|
3300
|
-
)
|
|
3301
|
-
), Oi = d(
|
|
3302
|
-
lt("xyz", "xyz"),
|
|
3303
|
-
rt("xyz").map(
|
|
3304
|
-
([e, t, n, r]) => V(new X(e, t, n, r))
|
|
3305
|
-
)
|
|
3306
|
-
), Ri = d(
|
|
3307
|
-
g("srgb-linear").map(() => "srgb-linear"),
|
|
3308
|
-
g("srgb").map(() => "srgb"),
|
|
3309
|
-
g("display-p3").map(() => "display-p3"),
|
|
3310
|
-
g("a98-rgb").map(() => "a98-rgb"),
|
|
3311
|
-
g("prophoto-rgb").map(() => "prophoto-rgb"),
|
|
3312
|
-
g("rec2020").map(() => "rec2020"),
|
|
3313
|
-
g("oklab").map(() => "oklab"),
|
|
3314
|
-
g("oklch").map(() => "oklch"),
|
|
3315
|
-
g("lab").map(() => "lab"),
|
|
3316
|
-
g("lch").map(() => "lch"),
|
|
3317
|
-
g("hsl").map(() => "hsl"),
|
|
3318
|
-
g("hwb").map(() => "hwb"),
|
|
3319
|
-
g("xyz-d65").map(() => "xyz-d65"),
|
|
3320
|
-
g("xyz-d50").map(() => "xyz-d50"),
|
|
3321
|
-
g("xyz").map(() => "xyz")
|
|
3322
|
-
), Bi = d(
|
|
3323
|
-
g("shorter"),
|
|
3324
|
-
g("longer"),
|
|
3325
|
-
g("increasing"),
|
|
3326
|
-
g("decreasing")
|
|
3327
|
-
).skip(w).skip(g("hue")), Nn = T.lazy(
|
|
3328
|
-
() => A(
|
|
3329
|
-
pn.Value,
|
|
3330
|
-
w.next(W.Percentage).opt()
|
|
3331
|
-
)
|
|
3332
|
-
), Ni = g("color-mix").next(
|
|
3333
|
-
A(
|
|
3334
|
-
// "in <space> [<hueMethod>]"
|
|
3335
|
-
g("in").skip(w).next(
|
|
3336
|
-
A(
|
|
3337
|
-
Ri,
|
|
3338
|
-
w.next(Bi).opt()
|
|
3339
|
-
)
|
|
3340
|
-
),
|
|
3341
|
-
// ", <color> [<pct>]?"
|
|
3342
|
-
k(",").trim(w).next(Nn),
|
|
3343
|
-
// ", <color> [<pct>]?"
|
|
3344
|
-
k(",").trim(w).next(Nn)
|
|
3345
|
-
).trim(w).wrap(ue, fe)
|
|
3346
|
-
).map(([[e, t], [n, r], [o, s]]) => {
|
|
3347
|
-
const i = gi[e] ?? "oklab", a = t ?? "shorter";
|
|
3348
|
-
let c = r != null ? r.value / 100 : -1, l = s != null ? s.value / 100 : -1;
|
|
3349
|
-
c < 0 && l < 0 ? (c = 0.5, l = 0.5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c);
|
|
3350
|
-
const f = Pe(n), p = Pe(o), u = Fs(f, p, c, l, i, a);
|
|
3351
|
-
return V(u);
|
|
3352
|
-
}), _i = d(
|
|
3353
|
-
g("srgb-linear").map(() => "srgb-linear"),
|
|
3354
|
-
g("srgb").map(() => "srgb"),
|
|
3355
|
-
g("display-p3").map(() => "display-p3"),
|
|
3356
|
-
g("a98-rgb").map(() => "a98-rgb"),
|
|
3357
|
-
g("prophoto-rgb").map(() => "prophoto-rgb"),
|
|
3358
|
-
g("rec2020").map(() => "rec2020"),
|
|
3359
|
-
g("xyz-d65").map(() => "xyz-d65"),
|
|
3360
|
-
g("xyz-d50").map(() => "xyz-d50"),
|
|
3361
|
-
g("xyz").map(() => "xyz")
|
|
3362
|
-
), Pi = g("color").next(
|
|
3363
|
-
A(
|
|
3364
|
-
_i.skip(w),
|
|
3365
|
-
j.skip(w),
|
|
3366
|
-
j.skip(w),
|
|
3367
|
-
d(
|
|
3368
|
-
A(
|
|
3369
|
-
j.skip(le.trim(w)),
|
|
3370
|
-
j
|
|
3371
|
-
),
|
|
3372
|
-
j.map((e) => [e, void 0])
|
|
3373
|
-
)
|
|
3374
|
-
).trim(w).wrap(ue, fe)
|
|
3375
|
-
).map(([e, t, n, [r, o]]) => {
|
|
3376
|
-
const s = di[e];
|
|
3377
|
-
if (!s)
|
|
3378
|
-
throw new Error(`Unknown color() space: ${e}`);
|
|
3379
|
-
const i = o ?? new S(1);
|
|
3380
|
-
if (e === "srgb") {
|
|
3381
|
-
const c = (l) => l.value * 255;
|
|
3382
|
-
return V(new D(c(t), c(n), c(r), i.value));
|
|
3383
|
-
}
|
|
3384
|
-
const a = new s.ctor(t, n, r, i);
|
|
3385
|
-
return e === "xyz-d50" && a instanceof X && (a.whitePoint = "D50"), V(a);
|
|
3386
|
-
}), zi = d(
|
|
3387
|
-
...Object.keys(An).sort((e, t) => t.length - e.length).map(g)
|
|
3388
|
-
).chain((e) => {
|
|
3389
|
-
const t = An[e.toLowerCase()];
|
|
3390
|
-
if (t) {
|
|
3391
|
-
const n = lo(t);
|
|
3392
|
-
if (n)
|
|
3393
|
-
return ti(n);
|
|
3394
|
-
}
|
|
3395
|
-
return ei();
|
|
3396
|
-
}), Ut = d(
|
|
3397
|
-
Ni,
|
|
3398
|
-
Pi,
|
|
3399
|
-
yi,
|
|
3400
|
-
Si,
|
|
3401
|
-
Ci,
|
|
3402
|
-
xi,
|
|
3403
|
-
Ei,
|
|
3404
|
-
vi,
|
|
3405
|
-
Mi,
|
|
3406
|
-
Ti,
|
|
3407
|
-
Ai,
|
|
3408
|
-
Ii,
|
|
3409
|
-
Oi,
|
|
3410
|
-
zi
|
|
3411
|
-
).trim(w), pn = {
|
|
3412
|
-
Value: Ut,
|
|
3413
|
-
colorValue: j,
|
|
3414
|
-
componentExpr: Ot,
|
|
3415
|
-
sep: te,
|
|
3416
|
-
alphaSep: uo,
|
|
3417
|
-
div: le
|
|
3418
|
-
}, Li = /* @__PURE__ */ new Map();
|
|
3419
|
-
function mc(e) {
|
|
3420
|
-
const t = ni(Ut, e);
|
|
3421
|
-
if (t.status)
|
|
3422
|
-
return t.value;
|
|
3423
|
-
const n = e.trim().toLowerCase(), r = Li.get(n);
|
|
3424
|
-
return r ? Et(Ut, r) : Et(Ut, e);
|
|
3425
|
-
}
|
|
3426
|
-
class S {
|
|
3427
|
-
constructor(t, n, r, o, s, i) {
|
|
3428
|
-
this.value = t, this.unit = n, this.superType = r, this.subProperty = o, this.property = s, this.targets = i;
|
|
3429
|
-
}
|
|
3430
|
-
setSubProperty(t) {
|
|
3431
|
-
this.subProperty = t;
|
|
3432
|
-
}
|
|
3433
|
-
setProperty(t) {
|
|
3434
|
-
this.property = t;
|
|
3435
|
-
}
|
|
3436
|
-
setTargets(t) {
|
|
3437
|
-
this.targets = t;
|
|
3438
|
-
}
|
|
3439
|
-
valueOf() {
|
|
3440
|
-
return this.value;
|
|
3441
|
-
}
|
|
3442
|
-
setValue(t) {
|
|
3443
|
-
this.value = t;
|
|
3444
|
-
}
|
|
3445
|
-
toString() {
|
|
3446
|
-
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` : _e(this) ? this.value.toString() : this.unit === "var" ? `var(${this.value})` : this.unit === "calc" ? `calc(${this.value})` : `${this.value}${this.unit}`;
|
|
3447
|
-
}
|
|
3448
|
-
toJSON() {
|
|
3449
|
-
return this.valueOf();
|
|
3450
|
-
}
|
|
3451
|
-
toFixed(t = 2) {
|
|
3452
|
-
const n = Number(this.value).toFixed(t).replace(/\.0+$/, "");
|
|
3453
|
-
return new S(n).coalesce(this, !0).toString();
|
|
3454
|
-
}
|
|
3455
|
-
clone() {
|
|
3456
|
-
return new S(
|
|
3457
|
-
at(this.value),
|
|
3458
|
-
this.unit,
|
|
3459
|
-
at(this.superType),
|
|
3460
|
-
this.subProperty,
|
|
3461
|
-
this.property
|
|
3462
|
-
);
|
|
3463
|
-
}
|
|
3464
|
-
coalesce(t, n = !1) {
|
|
3465
|
-
return t == null ? this : Ws.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(
|
|
3466
|
-
at(this.value),
|
|
3467
|
-
this.unit ?? t.unit,
|
|
3468
|
-
at(this.superType ?? t.superType),
|
|
3469
|
-
this.subProperty ?? t.subProperty,
|
|
3470
|
-
this.property ?? t.property,
|
|
3471
|
-
this.targets ?? t.targets
|
|
3472
|
-
);
|
|
3473
|
-
}
|
|
3474
|
-
}
|
|
3475
|
-
class N {
|
|
3476
|
-
constructor(t, n) {
|
|
3477
|
-
this.name = t, this.values = n, n.forEach((r) => {
|
|
3478
|
-
this.setSubProperty(t);
|
|
3479
|
-
});
|
|
3480
|
-
}
|
|
3481
|
-
setSubProperty(t) {
|
|
3482
|
-
this.values.forEach((n) => n.setSubProperty(t));
|
|
3483
|
-
}
|
|
3484
|
-
setProperty(t) {
|
|
3485
|
-
this.values.forEach((n) => n.setProperty(t));
|
|
3486
|
-
}
|
|
3487
|
-
setTargets(t) {
|
|
3488
|
-
this.values.forEach((n) => n.setTargets(t));
|
|
3489
|
-
}
|
|
3490
|
-
setValue(t, n) {
|
|
3491
|
-
n != null ? this.values[n].setValue(t) : this.values.forEach((r) => r.setValue(t));
|
|
3492
|
-
}
|
|
3493
|
-
valueOf() {
|
|
3494
|
-
return this.values.map((t) => t.valueOf());
|
|
3495
|
-
}
|
|
3496
|
-
toString() {
|
|
3497
|
-
return (this.name === "+" || this.name === "-" || this.name === "*" || this.name === "/") && this.values.length === 2 ? `${this.values[0].toString()} ${this.name} ${this.values[1].toString()}` : `${this.name}(${this.values.map((t) => t.toString()).join(", ")})`;
|
|
3498
|
-
}
|
|
3499
|
-
toJSON() {
|
|
3500
|
-
return {
|
|
3501
|
-
[this.name]: this.values.map((t) => t.toJSON())
|
|
3502
|
-
};
|
|
3503
|
-
}
|
|
3504
|
-
clone() {
|
|
3505
|
-
return new N(
|
|
3506
|
-
this.name,
|
|
3507
|
-
this.values.map((t) => t.clone())
|
|
3508
|
-
);
|
|
3509
|
-
}
|
|
3510
|
-
}
|
|
3511
|
-
class _t extends Array {
|
|
3512
|
-
constructor(...t) {
|
|
3513
|
-
super(...t);
|
|
3514
|
-
}
|
|
3515
|
-
setSubProperty(t) {
|
|
3516
|
-
this.forEach((n) => n.setSubProperty(t));
|
|
3517
|
-
}
|
|
3518
|
-
setProperty(t) {
|
|
3519
|
-
this.forEach((n) => n.setProperty(t));
|
|
3520
|
-
}
|
|
3521
|
-
setTargets(t) {
|
|
3522
|
-
this.forEach((n) => n.setTargets(t));
|
|
3523
|
-
}
|
|
3524
|
-
setValue(t, n) {
|
|
3525
|
-
n != null ? this[n].setValue(t) : this.forEach((r) => r.setValue(t));
|
|
3526
|
-
}
|
|
3527
|
-
valueOf() {
|
|
3528
|
-
return this.map((t) => t.valueOf());
|
|
3529
|
-
}
|
|
3530
|
-
toString() {
|
|
3531
|
-
return this.map((t) => t.toString()).join(" ");
|
|
3532
|
-
}
|
|
3533
|
-
toJSON() {
|
|
3534
|
-
return this.map((t) => t.toJSON());
|
|
3535
|
-
}
|
|
3536
|
-
clone() {
|
|
3537
|
-
return new _t(...this.map((t) => t.clone()));
|
|
3538
|
-
}
|
|
3539
|
-
}
|
|
3540
|
-
const Z = k("("), K = k(")"), _n = k(",");
|
|
3541
|
-
function Fi(e, t) {
|
|
3542
|
-
const n = T.lazy(
|
|
3543
|
-
() => d(
|
|
3544
|
-
// Nested parenthesized expression
|
|
3545
|
-
a.trim(w).wrap(Z, K),
|
|
3546
|
-
// Math function (min, max, etc.) — must come before plain value
|
|
3547
|
-
t,
|
|
3548
|
-
// Plain value (number, dimension, percentage)
|
|
3549
|
-
e
|
|
3550
|
-
).trim(w)
|
|
3551
|
-
), r = T.lazy(
|
|
3552
|
-
() => d(
|
|
3553
|
-
A(k("-").trim(w), n).map(
|
|
3554
|
-
([, c]) => new N("*", [new S(-1), c])
|
|
3555
|
-
),
|
|
3556
|
-
A(k("+").trim(w), n).map(([, c]) => c),
|
|
3557
|
-
n
|
|
3558
|
-
)
|
|
3559
|
-
), o = d(k("*"), k("/")).trim(w), s = d(k("+"), k("-")).trim(w), i = A(
|
|
3560
|
-
r,
|
|
3561
|
-
A(o, r).many()
|
|
3562
|
-
).map(([c, l]) => {
|
|
3563
|
-
let f = c;
|
|
3564
|
-
for (const [p, u] of l)
|
|
3565
|
-
f = new N(p, [f, u]);
|
|
3566
|
-
return f;
|
|
3567
|
-
}), a = A(
|
|
3568
|
-
i,
|
|
3569
|
-
// CSS spec requires whitespace around + and - in calc
|
|
3570
|
-
A(s, i).many()
|
|
3571
|
-
).map(([c, l]) => {
|
|
3572
|
-
let f = c;
|
|
3573
|
-
for (const [p, u] of l)
|
|
3574
|
-
f = new N(p, [f, u]);
|
|
3575
|
-
return f;
|
|
3576
|
-
});
|
|
3577
|
-
return a;
|
|
3578
|
-
}
|
|
3579
|
-
function $i(e) {
|
|
3580
|
-
const t = T.lazy(() => E), n = Fi(e, t), r = k("calc").next(n.trim(w).wrap(Z, K)).map((v) => new N("calc", [v])), o = n.trim(w), s = o.sepBy(_n.trim(w)), i = k("min").next(s.wrap(Z, K)).map((v) => new N("min", v)), a = k("max").next(s.wrap(Z, K)).map((v) => new N("max", v)), c = k("clamp").next(s.wrap(Z, K)).map((v) => {
|
|
3581
|
-
if (v.length !== 3) throw new Error("clamp() requires exactly 3 arguments");
|
|
3582
|
-
return new N("clamp", v);
|
|
3583
|
-
}), l = d(
|
|
3584
|
-
k("nearest"),
|
|
3585
|
-
k("up"),
|
|
3586
|
-
k("down"),
|
|
3587
|
-
k("to-zero")
|
|
3588
|
-
).trim(w), f = k("round").next(
|
|
3589
|
-
A(
|
|
3590
|
-
l.skip(_n.trim(w)).opt(),
|
|
3591
|
-
s
|
|
3592
|
-
).wrap(Z, K)
|
|
3593
|
-
).map(([v, F]) => {
|
|
3594
|
-
const Q = new S(v ?? "nearest", "string");
|
|
3595
|
-
return new N("round", [Q, ...F]);
|
|
3596
|
-
}), p = (v) => k(v).next(s.wrap(Z, K)).map((F) => {
|
|
3597
|
-
if (F.length !== 2) throw new Error(`${v}() requires exactly 2 arguments`);
|
|
3598
|
-
return new N(v, F);
|
|
3599
|
-
}), u = (v) => k(v).next(o.trim(w).wrap(Z, K)).map((F) => new N(v, [F])), h = p("pow"), m = p("atan2"), x = k("hypot").next(s.wrap(Z, K)).map((v) => new N("hypot", v)), b = k("log").next(s.wrap(Z, K)).map((v) => {
|
|
3600
|
-
if (v.length < 1 || v.length > 2) throw new Error("log() requires 1 or 2 arguments");
|
|
3601
|
-
return new N("log", v);
|
|
3602
|
-
}), I = d(
|
|
3603
|
-
k("infinity").map(() => new S(1 / 0)),
|
|
3604
|
-
k("-infinity").map(() => new S(-1 / 0)),
|
|
3605
|
-
k("NaN").map(() => new S(NaN)),
|
|
3606
|
-
k("pi").map(() => new S(Math.PI)),
|
|
3607
|
-
k("e").map(() => new S(Math.E))
|
|
3608
|
-
), E = d(
|
|
3609
|
-
r,
|
|
3610
|
-
i,
|
|
3611
|
-
a,
|
|
3612
|
-
c,
|
|
3613
|
-
f,
|
|
3614
|
-
p("mod"),
|
|
3615
|
-
p("rem"),
|
|
3616
|
-
u("abs"),
|
|
3617
|
-
u("sign"),
|
|
3618
|
-
u("sin"),
|
|
3619
|
-
u("cos"),
|
|
3620
|
-
u("tan"),
|
|
3621
|
-
u("asin"),
|
|
3622
|
-
u("acos"),
|
|
3623
|
-
u("atan"),
|
|
3624
|
-
m,
|
|
3625
|
-
h,
|
|
3626
|
-
u("sqrt"),
|
|
3627
|
-
x,
|
|
3628
|
-
b,
|
|
3629
|
-
u("exp"),
|
|
3630
|
-
I
|
|
3631
|
-
);
|
|
3632
|
-
return {
|
|
3633
|
-
calcFn: r,
|
|
3634
|
-
mathFunction: E,
|
|
3635
|
-
calcSum: n
|
|
3636
|
-
};
|
|
3637
|
-
}
|
|
3638
|
-
function O(e) {
|
|
3639
|
-
return e instanceof S ? e.unit === "var" || e.unit === "calc" ? null : typeof e.value == "number" ? e.value : null : e instanceof N ? hn(e) : typeof e == "number" ? e : null;
|
|
3640
|
-
}
|
|
3641
|
-
function Me(e) {
|
|
3642
|
-
return e instanceof S ? typeof e.value != "number" ? null : e.unit && e.superType?.[0] === "angle" ? ce(e.value, e.unit) * Math.PI / 180 : e.value : e instanceof N ? hn(e) : null;
|
|
3643
|
-
}
|
|
3644
|
-
function hn(e) {
|
|
3645
|
-
const t = e.name, n = e.values;
|
|
3646
|
-
switch (t) {
|
|
3647
|
-
// Arithmetic operators (from calc AST)
|
|
3648
|
-
case "+": {
|
|
3649
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3650
|
-
return r == null || o == null ? null : r + o;
|
|
3651
|
-
}
|
|
3652
|
-
case "-": {
|
|
3653
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3654
|
-
return r == null || o == null ? null : r - o;
|
|
3655
|
-
}
|
|
3656
|
-
case "*": {
|
|
3657
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3658
|
-
return r == null || o == null ? null : r * o;
|
|
3659
|
-
}
|
|
3660
|
-
case "/": {
|
|
3661
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3662
|
-
return r == null || o == null || o === 0 ? null : r / o;
|
|
3663
|
-
}
|
|
3664
|
-
// calc() wrapper
|
|
3665
|
-
case "calc":
|
|
3666
|
-
return O(n[0]);
|
|
3667
|
-
// Comparison functions
|
|
3668
|
-
case "min": {
|
|
3669
|
-
const r = n.map(O);
|
|
3670
|
-
return r.some((o) => o == null) ? null : Math.min(...r);
|
|
3671
|
-
}
|
|
3672
|
-
case "max": {
|
|
3673
|
-
const r = n.map(O);
|
|
3674
|
-
return r.some((o) => o == null) ? null : Math.max(...r);
|
|
3675
|
-
}
|
|
3676
|
-
case "clamp": {
|
|
3677
|
-
if (n.length !== 3) return null;
|
|
3678
|
-
const [r, o, s] = n.map(O);
|
|
3679
|
-
return r == null || o == null || s == null ? null : Math.max(r, Math.min(o, s));
|
|
3680
|
-
}
|
|
3681
|
-
// Stepped value functions
|
|
3682
|
-
case "round": {
|
|
3683
|
-
if (n.length < 3) return null;
|
|
3684
|
-
const r = n[0] instanceof S ? String(n[0].value) : "nearest", o = O(n[1]), s = O(n[2]);
|
|
3685
|
-
if (o == null || s == null || s === 0) return null;
|
|
3686
|
-
switch (r) {
|
|
3687
|
-
case "nearest":
|
|
3688
|
-
return Math.round(o / s) * s;
|
|
3689
|
-
case "up":
|
|
3690
|
-
return Math.ceil(o / s) * s;
|
|
3691
|
-
case "down":
|
|
3692
|
-
return Math.floor(o / s) * s;
|
|
3693
|
-
case "to-zero":
|
|
3694
|
-
return Math.trunc(o / s) * s;
|
|
3695
|
-
default:
|
|
3696
|
-
return null;
|
|
3697
|
-
}
|
|
3698
|
-
}
|
|
3699
|
-
case "mod": {
|
|
3700
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3701
|
-
return r == null || o == null || o === 0 ? null : (r % o + o) % o;
|
|
3702
|
-
}
|
|
3703
|
-
case "rem": {
|
|
3704
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3705
|
-
return r == null || o == null || o === 0 ? null : r % o;
|
|
3706
|
-
}
|
|
3707
|
-
// Sign-related
|
|
3708
|
-
case "abs": {
|
|
3709
|
-
const r = O(n[0]);
|
|
3710
|
-
return r == null ? null : Math.abs(r);
|
|
3711
|
-
}
|
|
3712
|
-
case "sign": {
|
|
3713
|
-
const r = O(n[0]);
|
|
3714
|
-
return r == null ? null : Math.sign(r);
|
|
3715
|
-
}
|
|
3716
|
-
// Trigonometric (input in angle units → converted to radians)
|
|
3717
|
-
case "sin": {
|
|
3718
|
-
const r = Me(n[0]);
|
|
3719
|
-
return r == null ? null : Math.sin(r);
|
|
3720
|
-
}
|
|
3721
|
-
case "cos": {
|
|
3722
|
-
const r = Me(n[0]);
|
|
3723
|
-
return r == null ? null : Math.cos(r);
|
|
3724
|
-
}
|
|
3725
|
-
case "tan": {
|
|
3726
|
-
const r = Me(n[0]);
|
|
3727
|
-
return r == null ? null : Math.tan(r);
|
|
3728
|
-
}
|
|
3729
|
-
case "asin": {
|
|
3730
|
-
const r = O(n[0]);
|
|
3731
|
-
return r == null ? null : Math.asin(r);
|
|
3732
|
-
}
|
|
3733
|
-
case "acos": {
|
|
3734
|
-
const r = O(n[0]);
|
|
3735
|
-
return r == null ? null : Math.acos(r);
|
|
3736
|
-
}
|
|
3737
|
-
case "atan": {
|
|
3738
|
-
const r = O(n[0]);
|
|
3739
|
-
return r == null ? null : Math.atan(r);
|
|
3740
|
-
}
|
|
3741
|
-
case "atan2": {
|
|
3742
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3743
|
-
return r == null || o == null ? null : Math.atan2(r, o);
|
|
3744
|
-
}
|
|
3745
|
-
// Exponential
|
|
3746
|
-
case "pow": {
|
|
3747
|
-
const r = O(n[0]), o = O(n[1]);
|
|
3748
|
-
return r == null || o == null ? null : Math.pow(r, o);
|
|
3749
|
-
}
|
|
3750
|
-
case "sqrt": {
|
|
3751
|
-
const r = O(n[0]);
|
|
3752
|
-
return r == null ? null : Math.sqrt(r);
|
|
3753
|
-
}
|
|
3754
|
-
case "hypot": {
|
|
3755
|
-
const r = n.map(O);
|
|
3756
|
-
return r.some((o) => o == null) ? null : Math.hypot(...r);
|
|
3757
|
-
}
|
|
3758
|
-
case "log": {
|
|
3759
|
-
const r = O(n[0]);
|
|
3760
|
-
if (r == null) return null;
|
|
3761
|
-
if (n.length === 2) {
|
|
3762
|
-
const o = O(n[1]);
|
|
3763
|
-
return o == null ? null : Math.log(r) / Math.log(o);
|
|
3764
|
-
}
|
|
3765
|
-
return Math.log(r);
|
|
3766
|
-
}
|
|
3767
|
-
case "exp": {
|
|
3768
|
-
const r = O(n[0]);
|
|
3769
|
-
return r == null ? null : Math.exp(r);
|
|
3770
|
-
}
|
|
3771
|
-
default:
|
|
3772
|
-
return null;
|
|
3773
|
-
}
|
|
3774
|
-
}
|
|
3775
|
-
function bc(e) {
|
|
3776
|
-
const t = hn(e);
|
|
3777
|
-
if (t == null) return null;
|
|
3778
|
-
const n = fo(e);
|
|
3779
|
-
return new S(t, n?.unit, n?.superType);
|
|
3780
|
-
}
|
|
3781
|
-
function fo(e) {
|
|
3782
|
-
if (e instanceof S)
|
|
3783
|
-
return e.unit && e.unit !== "string" && typeof e.value == "number" ? { unit: e.unit, superType: e.superType } : void 0;
|
|
3784
|
-
if (e instanceof N) {
|
|
3785
|
-
if (["asin", "acos", "atan", "atan2"].includes(e.name))
|
|
3786
|
-
return { unit: "rad", superType: ["angle"] };
|
|
3787
|
-
for (const t of e.values) {
|
|
3788
|
-
const n = fo(t);
|
|
3789
|
-
if (n) return n;
|
|
3790
|
-
}
|
|
3791
|
-
}
|
|
3792
|
-
}
|
|
3793
|
-
const ee = k("("), ne = k(")"), ze = k(","), po = T.lazy(
|
|
3794
|
-
() => bo.sepBy(d(ze, w)).trim(w).map((e) => new _t(...e))
|
|
3795
|
-
), mn = (e) => A(
|
|
3796
|
-
e || Js,
|
|
3797
|
-
po.wrap(ee, ne)
|
|
3798
|
-
), Di = () => {
|
|
3799
|
-
const e = T.lazy(
|
|
3800
|
-
() => d(
|
|
3801
|
-
Y(/[^()]+/),
|
|
3802
|
-
e.many(1).wrap(ee, ne).map((t) => `(${t.flat().join("")})`)
|
|
3803
|
-
).many(1)
|
|
3804
|
-
);
|
|
3805
|
-
return k("var").next(
|
|
3806
|
-
e.trim(w).wrap(ee, ne).map((t) => [t].flat(1 / 0).join(""))
|
|
3807
|
-
).map((t) => new S(t, "var"));
|
|
3808
|
-
}, { mathFunction: ho } = $i(W.Value), Ui = ["translate", "scale", "rotate", "skew"], Le = ["x", "y", "z"], Gi = Le.map(g), Vi = Ui.map(g), Xi = () => {
|
|
3809
|
-
const e = A(
|
|
3810
|
-
d(...Vi),
|
|
3811
|
-
d(...Gi, k(""))
|
|
3812
|
-
), t = (r, o) => r + o.toUpperCase();
|
|
3813
|
-
return mn(e).map(([[r, o], s]) => {
|
|
3814
|
-
const i = r.toLowerCase(), a = i === "skew" ? Le.filter((f) => f !== "z") : Le, c = {};
|
|
3815
|
-
if (o) {
|
|
3816
|
-
const f = i + o.toUpperCase();
|
|
3817
|
-
c[f] = s[0];
|
|
3818
|
-
} else s.length === 1 ? a.forEach((f) => {
|
|
3819
|
-
const p = t(i, f);
|
|
3820
|
-
c[p] = s[0];
|
|
3821
|
-
}) : s.forEach((f, p) => {
|
|
3822
|
-
const u = t(i, a[p]);
|
|
3823
|
-
c[u] = f;
|
|
3824
|
-
});
|
|
3825
|
-
const l = Object.entries(c).map(([f, p]) => new N(f, [p]));
|
|
3826
|
-
return new _t(...l);
|
|
3827
|
-
});
|
|
3828
|
-
}, Wi = {
|
|
3829
|
-
left: 270,
|
|
3830
|
-
right: 90,
|
|
3831
|
-
top: 0,
|
|
3832
|
-
bottom: 180
|
|
3833
|
-
}, Hi = {
|
|
3834
|
-
"top left": 315,
|
|
3835
|
-
"left top": 315,
|
|
3836
|
-
"top right": 45,
|
|
3837
|
-
"right top": 45,
|
|
3838
|
-
"bottom right": 135,
|
|
3839
|
-
"right bottom": 135,
|
|
3840
|
-
"bottom left": 225,
|
|
3841
|
-
"left bottom": 225
|
|
3842
|
-
}, ji = () => {
|
|
3843
|
-
const t = d(...[
|
|
3844
|
-
"linear-gradient",
|
|
3845
|
-
"radial-gradient",
|
|
3846
|
-
"conic-gradient",
|
|
3847
|
-
"repeating-linear-gradient",
|
|
3848
|
-
"repeating-radial-gradient",
|
|
3849
|
-
"repeating-conic-gradient"
|
|
3850
|
-
].map(g)), n = d(...["left", "right", "top", "bottom"].map(g)), r = A(
|
|
3851
|
-
k("to").skip(w),
|
|
3852
|
-
n.skip(w),
|
|
3853
|
-
n
|
|
3854
|
-
).map(([, u, h]) => {
|
|
3855
|
-
const m = `${u.toLowerCase()} ${h.toLowerCase()}`, x = Hi[m];
|
|
3856
|
-
if (x == null) throw new Error(`Invalid gradient corner: to ${u} ${h}`);
|
|
3857
|
-
return new S(x, "deg");
|
|
3858
|
-
}), o = A(
|
|
3859
|
-
k("to").skip(w),
|
|
3860
|
-
n
|
|
3861
|
-
).map(([, u]) => new S(Wi[u.toLowerCase()], "deg")), s = d(r, o), i = A(
|
|
3862
|
-
g("from").skip(w),
|
|
3863
|
-
W.Angle
|
|
3864
|
-
).map(([, u]) => u), a = d(W.Angle, s), c = d(W.Length, W.Percentage), l = A(
|
|
3865
|
-
W.Color,
|
|
3866
|
-
c.sepBy(w)
|
|
3867
|
-
).map(([u, h]) => !h || h.length === 0 ? [u] : [u, ...h]), f = A(
|
|
3868
|
-
l,
|
|
3869
|
-
ze.trim(w).next(d(l, c)).many()
|
|
3870
|
-
).map(([u, h]) => [u, ...h]);
|
|
3871
|
-
return A(
|
|
3872
|
-
t,
|
|
3873
|
-
A(
|
|
3874
|
-
d(i, a).skip(ze).opt(),
|
|
3875
|
-
f
|
|
3876
|
-
).trim(w).wrap(ee, ne).map(([u, h]) => u ? [u, ...h].flat() : [h])
|
|
3877
|
-
).map(([u, h]) => new N(u, h));
|
|
3878
|
-
}, Yi = () => mn(k("cubic-bezier")).map((e) => new N("cubic-bezier", e[1])), Zi = ["inherit", "initial", "unset", "revert", "revert-layer"], Ki = d(
|
|
3879
|
-
...Zi.map(g)
|
|
3880
|
-
).map((e) => new S(e.toLowerCase(), "string", ["keyword"])), mo = Y(/[^\(\)\{\}\s,;]+/).map((e) => new S(e)), bn = d(
|
|
3881
|
-
Xi(),
|
|
3882
|
-
Di(),
|
|
3883
|
-
ho,
|
|
3884
|
-
ji(),
|
|
3885
|
-
Yi(),
|
|
3886
|
-
mn().map(([e, t]) => new N(e, t))
|
|
3887
|
-
), bo = d(Ki, W.Value, bn, mo).trim(w), gc = {
|
|
3888
|
-
Function: bn,
|
|
3889
|
-
Value: bo,
|
|
3890
|
-
FunctionArgs: po
|
|
3891
|
-
}, qi = A(k("{"), Y(/[^{}]+/), k("}")).map(
|
|
3892
|
-
(e) => {
|
|
3893
|
-
const t = e.join(`
|
|
3894
|
-
`);
|
|
3895
|
-
let n = JSON.parse(t);
|
|
3896
|
-
return new S(n, "json");
|
|
3897
|
-
}
|
|
3898
|
-
), Fe = d(ho, W.Value, bn, qi, mo).trim(w), dc = {
|
|
3899
|
-
Value: Fe,
|
|
3900
|
-
Values: Fe.sepBy(w)
|
|
3901
|
-
}, Ji = oe((e) => Et(Fe, e)), wc = oe(
|
|
3902
|
-
(e) => Et(W.Percentage, String(e)).valueOf()
|
|
3903
|
-
), kc = oe((e) => Et(
|
|
3904
|
-
W.Time.map((t) => t.unit === "ms" ? t.value : t.unit === "s" ? t.value * 1e3 : t.value),
|
|
3905
|
-
e
|
|
3906
|
-
)), yc = oe(
|
|
3907
|
-
(e, t) => (() => {
|
|
3908
|
-
if (!t)
|
|
3909
|
-
return e;
|
|
3910
|
-
if (e.unit === "var") {
|
|
3911
|
-
const o = getComputedStyle(t).getPropertyValue(e.value);
|
|
3912
|
-
return lo(o);
|
|
3913
|
-
}
|
|
3914
|
-
if (e.unit === "calc" && e.property && e.subProperty && e.value && t) {
|
|
3915
|
-
const o = e.property, s = t.style[o], i = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
|
|
3916
|
-
t.style[o] = i;
|
|
3917
|
-
const a = getComputedStyle(t).getPropertyValue(
|
|
3918
|
-
o
|
|
3919
|
-
);
|
|
3920
|
-
t.style[o] = s;
|
|
3921
|
-
const c = Ji(a);
|
|
3922
|
-
if (c instanceof S)
|
|
3923
|
-
return c;
|
|
3924
|
-
if (c.name.startsWith("matrix")) {
|
|
3925
|
-
const f = Ys(c)[e.subProperty];
|
|
3926
|
-
if (f != null)
|
|
3927
|
-
return new S(f, "px", [
|
|
3928
|
-
"length",
|
|
3929
|
-
"absolute"
|
|
3930
|
-
]);
|
|
3931
|
-
}
|
|
3932
|
-
}
|
|
3933
|
-
return e;
|
|
3934
|
-
})().coalesce(e),
|
|
3935
|
-
{ keyFn: (e, t) => `${e.toString()}-${JSON.stringify(t)}` }
|
|
3936
|
-
), Qi = (e, t, n = !1) => {
|
|
3937
|
-
if (e?.superType?.[0] !== t?.superType?.[0])
|
|
3938
|
-
return n ? [e, t] : [e.clone(), t.clone()];
|
|
3939
|
-
const r = (i) => {
|
|
3940
|
-
switch (i?.superType?.[0]) {
|
|
3941
|
-
case "length":
|
|
3942
|
-
return {
|
|
3943
|
-
value: Jr(i.value, i.unit, i.targets?.[0]),
|
|
3944
|
-
unit: "px"
|
|
3945
|
-
};
|
|
3946
|
-
case "angle":
|
|
3947
|
-
return {
|
|
3948
|
-
value: ce(i.value, i.unit),
|
|
3949
|
-
unit: "deg"
|
|
3950
|
-
};
|
|
3951
|
-
case "time":
|
|
3952
|
-
return {
|
|
3953
|
-
value: Qr(i.value, i.unit),
|
|
3954
|
-
unit: "ms"
|
|
3955
|
-
};
|
|
3956
|
-
case "resolution":
|
|
3957
|
-
return {
|
|
3958
|
-
value: to(i.value, i.unit),
|
|
3959
|
-
unit: "dpi"
|
|
3960
|
-
};
|
|
3961
|
-
default:
|
|
3962
|
-
return { value: i.value, unit: i.unit };
|
|
3963
|
-
}
|
|
3964
|
-
}, [o, s] = [r(e), r(t)];
|
|
3965
|
-
return n ? (e.value = o.value, e.unit = o.unit, t.value = s.value, t.unit = s.unit, [e, t]) : [
|
|
3966
|
-
new S(
|
|
3967
|
-
o.value,
|
|
3968
|
-
o.unit,
|
|
3969
|
-
e.superType,
|
|
3970
|
-
e.subProperty,
|
|
3971
|
-
e.property,
|
|
3972
|
-
e.targets
|
|
3973
|
-
),
|
|
3974
|
-
new S(
|
|
3975
|
-
s.value,
|
|
3976
|
-
s.unit,
|
|
3977
|
-
t.superType,
|
|
3978
|
-
t.subProperty,
|
|
3979
|
-
t.property,
|
|
3980
|
-
t.targets
|
|
3981
|
-
)
|
|
3982
|
-
];
|
|
3983
|
-
};
|
|
3984
|
-
function Sc(e, t) {
|
|
3985
|
-
e = e.coalesce(t, !0), t = t.coalesce(e, !0);
|
|
3986
|
-
const n = {
|
|
3987
|
-
start: e,
|
|
3988
|
-
stop: t,
|
|
3989
|
-
value: e.clone()
|
|
3990
|
-
};
|
|
3991
|
-
if (_e(e) && _e(t)) {
|
|
3992
|
-
const [r, o] = Gs(
|
|
3993
|
-
e,
|
|
3994
|
-
t,
|
|
3995
|
-
"lab",
|
|
3996
|
-
!0
|
|
3997
|
-
);
|
|
3998
|
-
n.start = r, n.stop = o, n.value = r.clone();
|
|
3999
|
-
}
|
|
4000
|
-
if (e.unit !== t.unit) {
|
|
4001
|
-
const [r, o] = Qi(
|
|
4002
|
-
e,
|
|
4003
|
-
t,
|
|
4004
|
-
!0
|
|
4005
|
-
);
|
|
4006
|
-
n.start = r, n.stop = o, n.value = r.clone();
|
|
4007
|
-
}
|
|
4008
|
-
return n.computed = Ne.includes(e.unit) || Ne.includes(t.unit), n;
|
|
4009
|
-
}
|
|
4010
|
-
function ta(e) {
|
|
4011
|
-
const t = (n, r = 1) => Math.round(e[n] * r);
|
|
4012
|
-
return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
|
|
4013
|
-
}
|
|
4014
|
-
const gn = (e) => [e.r, e.g, e.b], pe = (e, t, n) => new D(e, t, n), ea = (e, t, n) => new vt(e, t, n), go = (e) => {
|
|
4015
|
-
const t = Rr(e);
|
|
4016
|
-
return ea(t.h, t.s, t.l);
|
|
4017
|
-
}, na = 1, ra = 1 / 6, oa = 5, sa = 15, ia = 100, aa = 7500, ca = 200, Te = 360, la = 50, ua = 20, fa = 3750, pa = 50, ha = 100, ma = 100, ot = 0.2126, st = 0.7152, it = 0.0722;
|
|
4018
|
-
function ba(e, t = 0) {
|
|
4019
|
-
const n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180), o = [
|
|
4020
|
-
ot + r * (1 - ot) - n * ot,
|
|
4021
|
-
st - r * st - n * st,
|
|
4022
|
-
it - r * it + n * (1 - it),
|
|
4023
|
-
ot - r * ot + n * 0.143,
|
|
4024
|
-
st + r * (1 - st) + n * 0.14,
|
|
4025
|
-
it - r * it - n * 0.283,
|
|
4026
|
-
ot - r * ot - n * (1 - ot),
|
|
4027
|
-
st - r * st + n * st,
|
|
4028
|
-
it + r * (1 - it) + n * it
|
|
4029
|
-
];
|
|
4030
|
-
return dn(e, o);
|
|
4031
|
-
}
|
|
4032
|
-
const Pn = 0.393, zn = 0.769, Ln = 0.189, Fn = 0.349, $n = 0.686, Dn = 0.168, Un = 0.272, Gn = 0.534, Vn = 0.131;
|
|
4033
|
-
function ga(e, t = 1) {
|
|
4034
|
-
const n = [
|
|
4035
|
-
Pn + (1 - Pn) * (1 - t),
|
|
4036
|
-
zn - zn * (1 - t),
|
|
4037
|
-
Ln - Ln * (1 - t),
|
|
4038
|
-
Fn - Fn * (1 - t),
|
|
4039
|
-
$n + (1 - $n) * (1 - t),
|
|
4040
|
-
Dn - Dn * (1 - t),
|
|
4041
|
-
Un - Un * (1 - t),
|
|
4042
|
-
Gn - Gn * (1 - t),
|
|
4043
|
-
Vn + (1 - Vn) * (1 - t)
|
|
4044
|
-
];
|
|
4045
|
-
return dn(e, n);
|
|
4046
|
-
}
|
|
4047
|
-
const yt = 0.213, St = 0.715, Ct = 0.072;
|
|
4048
|
-
function da(e, t = 1) {
|
|
4049
|
-
const n = [
|
|
4050
|
-
yt + (1 - yt) * t,
|
|
4051
|
-
St - St * t,
|
|
4052
|
-
Ct - Ct * t,
|
|
4053
|
-
yt - yt * t,
|
|
4054
|
-
St + (1 - St) * t,
|
|
4055
|
-
Ct - Ct * t,
|
|
4056
|
-
yt - yt * t,
|
|
4057
|
-
St - St * t,
|
|
4058
|
-
Ct + (1 - Ct) * t
|
|
4059
|
-
];
|
|
4060
|
-
return dn(e, n);
|
|
4061
|
-
}
|
|
4062
|
-
function dn(e, t) {
|
|
4063
|
-
const n = P(gn(e), t);
|
|
4064
|
-
return pe(_(n[0], 0, 255), _(n[1], 0, 255), _(n[2], 0, 255));
|
|
4065
|
-
}
|
|
4066
|
-
function wa(e, t = 1) {
|
|
4067
|
-
return wo(e, t);
|
|
4068
|
-
}
|
|
4069
|
-
function ka(e, t = 1) {
|
|
4070
|
-
return wo(e, t, -(0.5 * t) + 0.5);
|
|
4071
|
-
}
|
|
4072
|
-
function wo(e, t = 1, n = 0) {
|
|
4073
|
-
const r = gn(e);
|
|
4074
|
-
return pe(
|
|
4075
|
-
_(r[0] * t + n * 255, 0, 255),
|
|
4076
|
-
_(r[1] * t + n * 255, 0, 255),
|
|
4077
|
-
_(r[2] * t + n * 255, 0, 255)
|
|
4078
|
-
);
|
|
4079
|
-
}
|
|
4080
|
-
function ya(e, t = 1) {
|
|
4081
|
-
const n = gn(e);
|
|
4082
|
-
return pe(
|
|
4083
|
-
_((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
4084
|
-
_((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
4085
|
-
_((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255)
|
|
4086
|
-
);
|
|
4087
|
-
}
|
|
4088
|
-
function Ae(e, t, n) {
|
|
4089
|
-
let r = pe(0, 0, 0);
|
|
4090
|
-
r = ya(r, e[0] / 100), r = ga(r, e[1] / 100), r = da(r, e[2] / 100), r = ba(r, e[3] * 3.6), r = wa(r, e[4] / 100), r = ka(r, e[5] / 100);
|
|
4091
|
-
const o = go(r);
|
|
4092
|
-
return Math.abs(r.r - t.r) + Math.abs(r.g - t.g) + Math.abs(r.b - t.b) + Math.abs(o.h - n.h) + Math.abs(o.s - n.s) + Math.abs(o.l - n.l);
|
|
4093
|
-
}
|
|
4094
|
-
function ko(e, t, n, r, o, s, i) {
|
|
4095
|
-
let a = null, c = 1 / 0;
|
|
4096
|
-
const l = new Array(6), f = new Array(6), p = new Array(6);
|
|
4097
|
-
for (let u = 0; u < o; u++) {
|
|
4098
|
-
const h = n / Math.pow(u + 1, ra);
|
|
4099
|
-
for (let b = 0; b < 6; b++)
|
|
4100
|
-
l[b] = Math.random() > 0.5 ? 1 : -1, f[b] = r[b] + h * l[b], p[b] = r[b] - h * l[b];
|
|
4101
|
-
const m = Ae(f, s, i) - Ae(p, s, i);
|
|
4102
|
-
for (let b = 0; b < 6; b++) {
|
|
4103
|
-
const I = m / (2 * h) * l[b], E = t[b] / Math.pow(e + u + 1, na);
|
|
4104
|
-
r[b] = Sa(r[b] - E * I, b);
|
|
4105
|
-
}
|
|
4106
|
-
const x = Ae(r, s, i);
|
|
4107
|
-
x < c && (a = [...r], c = x);
|
|
4108
|
-
}
|
|
4109
|
-
return { values: a ?? [...r], loss: c };
|
|
4110
|
-
}
|
|
4111
|
-
function Sa(e, t) {
|
|
4112
|
-
let n = ia;
|
|
4113
|
-
return t === 2 ? n = aa : (t === 4 || t === 5) && (n = ca), t === 3 ? (e % Te + Te) % Te : _(e, 0, n);
|
|
4114
|
-
}
|
|
4115
|
-
function Ca(e, t, n) {
|
|
4116
|
-
const r = e.loss, o = 2, s = r + 1, i = [0.25 * s, 0.25 * s, s, 0.25 * s, 0.2 * s, 0.2 * s];
|
|
4117
|
-
return ko(r, i, o, e.values, 500, t, n);
|
|
4118
|
-
}
|
|
4119
|
-
function xa(e, t) {
|
|
4120
|
-
const n = [60, 180, 18e3, 600, 1.2, 1.2];
|
|
4121
|
-
let r = { loss: 1 / 0, values: [] };
|
|
4122
|
-
for (let o = 0; o < 3; o++)
|
|
4123
|
-
if (r.loss > 25) {
|
|
4124
|
-
const i = ko(
|
|
4125
|
-
oa,
|
|
4126
|
-
n,
|
|
4127
|
-
sa,
|
|
4128
|
-
[
|
|
4129
|
-
la,
|
|
4130
|
-
ua,
|
|
4131
|
-
fa,
|
|
4132
|
-
pa,
|
|
4133
|
-
ha,
|
|
4134
|
-
ma
|
|
4135
|
-
],
|
|
4136
|
-
1e3,
|
|
4137
|
-
e,
|
|
4138
|
-
t
|
|
4139
|
-
);
|
|
4140
|
-
i.loss < r.loss && (r = i);
|
|
4141
|
-
}
|
|
4142
|
-
return r;
|
|
4143
|
-
}
|
|
4144
|
-
function Ea(e) {
|
|
4145
|
-
const t = go(e), n = Ca(xa(e, t), e, t);
|
|
4146
|
-
return {
|
|
4147
|
-
values: n.values,
|
|
4148
|
-
loss: n.loss,
|
|
4149
|
-
filter: ta(n.values)
|
|
4150
|
-
};
|
|
4151
|
-
}
|
|
4152
|
-
function Cc(e) {
|
|
4153
|
-
return Ea(e);
|
|
4154
|
-
}
|
|
4155
|
-
function yo(e) {
|
|
4156
|
-
return e;
|
|
4157
|
-
}
|
|
4158
|
-
function xc(e) {
|
|
4159
|
-
if (e.length === 0) return yo;
|
|
4160
|
-
if (e.length === 1) return () => e[0].output;
|
|
4161
|
-
const t = e.map((o) => ({
|
|
4162
|
-
output: o.output,
|
|
4163
|
-
input: o.input ?? -1
|
|
4164
|
-
// -1 = unset
|
|
4165
|
-
}));
|
|
4166
|
-
t[0].input < 0 && (t[0].input = 0), t[t.length - 1].input < 0 && (t[t.length - 1].input = 100);
|
|
4167
|
-
let n = 0;
|
|
4168
|
-
for (; n < t.length; ) {
|
|
4169
|
-
if (t[n].input >= 0) {
|
|
4170
|
-
n++;
|
|
4171
|
-
continue;
|
|
4172
|
-
}
|
|
4173
|
-
const o = n - 1;
|
|
4174
|
-
let s = n;
|
|
4175
|
-
for (; s < t.length && t[s].input < 0; ) s++;
|
|
4176
|
-
const i = t[o].input, a = t[s].input, c = s - o;
|
|
4177
|
-
for (let l = o + 1; l < s; l++)
|
|
4178
|
-
t[l].input = i + (a - i) * (l - o) / c;
|
|
4179
|
-
n = s + 1;
|
|
4180
|
-
}
|
|
4181
|
-
for (let o = 1; o < t.length; o++)
|
|
4182
|
-
t[o].input < t[o - 1].input && (t[o].input = t[o - 1].input);
|
|
4183
|
-
const r = t.map((o) => ({ output: o.output, input: o.input / 100 }));
|
|
4184
|
-
return (o) => {
|
|
4185
|
-
if (o <= r[0].input) return r[0].output;
|
|
4186
|
-
if (o >= r[r.length - 1].input) return r[r.length - 1].output;
|
|
4187
|
-
let s = 0, i = r.length - 1;
|
|
4188
|
-
for (; s < i - 1; ) {
|
|
4189
|
-
const f = s + i >> 1;
|
|
4190
|
-
r[f].input <= o ? s = f : i = f;
|
|
4191
|
-
}
|
|
4192
|
-
const a = r[s], c = r[i];
|
|
4193
|
-
if (a.input === c.input) return a.output;
|
|
4194
|
-
const l = (o - a.input) / (c.input - a.input);
|
|
4195
|
-
return Xt(l, a.output, c.output);
|
|
4196
|
-
};
|
|
4197
|
-
}
|
|
4198
|
-
function Xn(e) {
|
|
4199
|
-
return e * e;
|
|
4200
|
-
}
|
|
4201
|
-
function Wn(e) {
|
|
4202
|
-
return -e * (e - 2);
|
|
4203
|
-
}
|
|
4204
|
-
function Hn(e) {
|
|
4205
|
-
return (e /= 0.5) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
|
|
4206
|
-
}
|
|
4207
|
-
function jn(e) {
|
|
4208
|
-
return e * e * e;
|
|
4209
|
-
}
|
|
4210
|
-
function Yn(e) {
|
|
4211
|
-
return (e = e - 1) * e * e + 1;
|
|
4212
|
-
}
|
|
4213
|
-
function Zn(e) {
|
|
4214
|
-
return (e /= 0.5) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
|
|
4215
|
-
}
|
|
4216
|
-
function Kn(e) {
|
|
4217
|
-
return e * e * (3 - 2 * e);
|
|
4218
|
-
}
|
|
4219
|
-
function va(e, t, n, r = 1e-6) {
|
|
4220
|
-
let o = e;
|
|
4221
|
-
for (let a = 0; a < 8; a++) {
|
|
4222
|
-
const c = o * o, l = c * o, f = 1 - o, p = f * f, u = 3 * p * o * t + 3 * f * c * n + l - e;
|
|
4223
|
-
if (Math.abs(u) < r) return o;
|
|
4224
|
-
const h = 3 * p * t + 6 * f * o * (n - t) + 3 * c * (1 - n);
|
|
4225
|
-
if (Math.abs(h) < 1e-12) break;
|
|
4226
|
-
o -= u / h;
|
|
4227
|
-
}
|
|
4228
|
-
let s = 0, i = 1;
|
|
4229
|
-
o = e;
|
|
4230
|
-
for (let a = 0; a < 64; a++) {
|
|
4231
|
-
const c = 1 - o, l = 3 * c * c * o * t + 3 * c * o * o * n + o * o * o;
|
|
4232
|
-
if (Math.abs(l - e) < r) return o;
|
|
4233
|
-
e > l ? s = o : i = o, o = (s + i) / 2;
|
|
4234
|
-
}
|
|
4235
|
-
return o;
|
|
4236
|
-
}
|
|
4237
|
-
const nt = (e, t, n, r) => (o) => {
|
|
4238
|
-
if (o <= 0) return 0;
|
|
4239
|
-
if (o >= 1) return 1;
|
|
4240
|
-
const s = va(o, e, n);
|
|
4241
|
-
return Cr(s, e, t, n, r)[1];
|
|
4242
|
-
};
|
|
4243
|
-
function qn(e) {
|
|
4244
|
-
return e = nt(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
4245
|
-
}
|
|
4246
|
-
function Jn(e) {
|
|
4247
|
-
return e = nt(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
4248
|
-
}
|
|
4249
|
-
function Qn(e) {
|
|
4250
|
-
return e = ae(e, [
|
|
4251
|
-
[0, 0],
|
|
4252
|
-
[0.026, 1.746],
|
|
4253
|
-
[0.633, 1.06],
|
|
4254
|
-
[1, 0]
|
|
4255
|
-
])[1], e;
|
|
4256
|
-
}
|
|
4257
|
-
function tr(e) {
|
|
4258
|
-
return e = ae(e, [
|
|
4259
|
-
[0, 0],
|
|
4260
|
-
[0.367, 0.94],
|
|
4261
|
-
[0.974, 0.254],
|
|
4262
|
-
[1, 0]
|
|
4263
|
-
])[1], e;
|
|
4264
|
-
}
|
|
4265
|
-
function er(e) {
|
|
4266
|
-
return e = ae(e, [
|
|
4267
|
-
[0, 0],
|
|
4268
|
-
[0.026, 1.746],
|
|
4269
|
-
[0.633, 1.06],
|
|
4270
|
-
[1, 0]
|
|
4271
|
-
])[1], e;
|
|
4272
|
-
}
|
|
4273
|
-
function nr(e) {
|
|
4274
|
-
return e = ae(e, [
|
|
4275
|
-
[0, 0],
|
|
4276
|
-
[0.026, 1.746],
|
|
4277
|
-
[0.633, 1.06],
|
|
4278
|
-
[1, 0]
|
|
4279
|
-
])[1], e;
|
|
4280
|
-
}
|
|
4281
|
-
function rr(e) {
|
|
4282
|
-
return 1 - Math.cos(e * Math.PI / 2);
|
|
4283
|
-
}
|
|
4284
|
-
function or(e) {
|
|
4285
|
-
return Math.sin(e * Math.PI / 2);
|
|
4286
|
-
}
|
|
4287
|
-
function sr(e) {
|
|
4288
|
-
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
4289
|
-
}
|
|
4290
|
-
function ir(e) {
|
|
4291
|
-
return 1 - Math.sqrt(1 - e * e);
|
|
4292
|
-
}
|
|
4293
|
-
function ar(e) {
|
|
4294
|
-
return Math.sqrt(1 - --e * e);
|
|
4295
|
-
}
|
|
4296
|
-
function cr(e) {
|
|
4297
|
-
return (e /= 0.5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
|
|
4298
|
-
}
|
|
4299
|
-
function lr(e) {
|
|
4300
|
-
return e === 0 ? 0 : Math.pow(2, 10 * (e - 1));
|
|
4301
|
-
}
|
|
4302
|
-
function ur(e) {
|
|
4303
|
-
return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
|
|
4304
|
-
}
|
|
4305
|
-
function fr(e) {
|
|
4306
|
-
return e === 0 ? 0 : e === 1 ? 1 : (e /= 0.5) < 1 ? 0.5 * Math.pow(2, 10 * (e - 1)) : 0.5 * (2 - Math.pow(2, -10 * --e));
|
|
4307
|
-
}
|
|
4308
|
-
const Ec = [
|
|
4309
|
-
"jump-start",
|
|
4310
|
-
"jump-end",
|
|
4311
|
-
"jump-none",
|
|
4312
|
-
"jump-both",
|
|
4313
|
-
"start",
|
|
4314
|
-
"end",
|
|
4315
|
-
"both"
|
|
4316
|
-
];
|
|
4317
|
-
function Ma(e, t) {
|
|
4318
|
-
return Math.ceil(e * t) / t;
|
|
4319
|
-
}
|
|
4320
|
-
function Ta(e, t) {
|
|
4321
|
-
return Math.floor(e * t) / t;
|
|
4322
|
-
}
|
|
4323
|
-
function Aa(e, t) {
|
|
4324
|
-
return Math.floor(e * (t + 1)) / (t + 1);
|
|
4325
|
-
}
|
|
4326
|
-
function Ia(e, t) {
|
|
4327
|
-
return t <= 1 ? e : Math.floor(e * (t - 1)) / (t - 1);
|
|
4328
|
-
}
|
|
4329
|
-
function wn(e, t = "jump-end") {
|
|
4330
|
-
switch (t) {
|
|
4331
|
-
case "jump-none":
|
|
4332
|
-
return (n) => Ia(n, e);
|
|
4333
|
-
case "jump-start":
|
|
4334
|
-
case "start":
|
|
4335
|
-
return (n) => Ma(n, e);
|
|
4336
|
-
case "jump-end":
|
|
4337
|
-
case "end":
|
|
4338
|
-
return (n) => Ta(n, e);
|
|
4339
|
-
case "jump-both":
|
|
4340
|
-
case "both":
|
|
4341
|
-
return (n) => Aa(n, e);
|
|
4342
|
-
}
|
|
4343
|
-
}
|
|
4344
|
-
function Oa() {
|
|
4345
|
-
return wn(1, "jump-start");
|
|
4346
|
-
}
|
|
4347
|
-
function Ra() {
|
|
4348
|
-
return wn(1, "jump-end");
|
|
4349
|
-
}
|
|
4350
|
-
const bt = {
|
|
4351
|
-
ease: [0.25, 0.1, 0.25, 1],
|
|
4352
|
-
"ease-in": [0.42, 0, 1, 1],
|
|
4353
|
-
"ease-out": [0, 0, 0.58, 1],
|
|
4354
|
-
"ease-in-out": [0.42, 0, 0.58, 1],
|
|
4355
|
-
"ease-in-back": [0.6, -0.28, 0.735, 0.045],
|
|
4356
|
-
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
4357
|
-
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
4358
|
-
}, vc = {
|
|
4359
|
-
linear: yo,
|
|
4360
|
-
easeInQuad: Xn,
|
|
4361
|
-
"ease-in-quad": Xn,
|
|
4362
|
-
// "easeInQuad",
|
|
4363
|
-
easeOutQuad: Wn,
|
|
4364
|
-
"ease-out-quad": Wn,
|
|
4365
|
-
// "easeOutQuad",
|
|
4366
|
-
easeInOutQuad: Hn,
|
|
4367
|
-
"ease-in-out-quad": Hn,
|
|
4368
|
-
// "easeInOutQuad",
|
|
4369
|
-
easeInCubic: jn,
|
|
4370
|
-
"ease-in-cubic": jn,
|
|
4371
|
-
easeOutCubic: Yn,
|
|
4372
|
-
"ease-out-cubic": Yn,
|
|
4373
|
-
easeInOutCubic: Zn,
|
|
4374
|
-
"ease-in-out-cubic": Zn,
|
|
4375
|
-
easeInBounce: qn,
|
|
4376
|
-
"ease-in-bounce": qn,
|
|
4377
|
-
// "easeInBounce",
|
|
4378
|
-
bounceInEase: Jn,
|
|
4379
|
-
"bounce-in-ease": Jn,
|
|
4380
|
-
bounceInEaseHalf: Qn,
|
|
4381
|
-
"bounce-in-ease-half": Qn,
|
|
4382
|
-
bounceOutEase: tr,
|
|
4383
|
-
"bounce-out-ease": tr,
|
|
4384
|
-
bounceOutEaseHalf: er,
|
|
4385
|
-
"bounce-out-ease-half": er,
|
|
4386
|
-
bounceInOutEase: nr,
|
|
4387
|
-
"bounce-in-out-ease": nr,
|
|
4388
|
-
easeInSine: rr,
|
|
4389
|
-
"ease-in-sine": rr,
|
|
4390
|
-
easeOutSine: or,
|
|
4391
|
-
"ease-out-sine": or,
|
|
4392
|
-
easeInOutSine: sr,
|
|
4393
|
-
"ease-in-out-sine": sr,
|
|
4394
|
-
easeInCirc: ir,
|
|
4395
|
-
"ease-in-circ": ir,
|
|
4396
|
-
easeOutCirc: ar,
|
|
4397
|
-
"ease-out-circ": ar,
|
|
4398
|
-
easeInOutCirc: cr,
|
|
4399
|
-
"ease-in-out-circ": cr,
|
|
4400
|
-
easeInExpo: lr,
|
|
4401
|
-
"ease-in-expo": lr,
|
|
4402
|
-
easeOutExpo: ur,
|
|
4403
|
-
"ease-out-expo": ur,
|
|
4404
|
-
easeInOutExpo: fr,
|
|
4405
|
-
"ease-in-out-expo": fr,
|
|
4406
|
-
smoothStep3: Kn,
|
|
4407
|
-
"smooth-step-3": Kn,
|
|
4408
|
-
ease: nt(...bt.ease),
|
|
4409
|
-
"ease-in": nt(...bt["ease-in"]),
|
|
4410
|
-
"ease-out": nt(...bt["ease-out"]),
|
|
4411
|
-
"ease-in-out": nt(...bt["ease-in-out"]),
|
|
4412
|
-
"ease-in-back": nt(...bt["ease-in-back"]),
|
|
4413
|
-
"ease-out-back": nt(...bt["ease-out-back"]),
|
|
4414
|
-
"ease-in-out-back": nt(...bt["ease-in-out-back"]),
|
|
4415
|
-
steps: wn,
|
|
4416
|
-
"step-start": Oa,
|
|
4417
|
-
"step-end": Ra
|
|
4418
|
-
};
|
|
4419
|
-
function Mc(e, t, n, r, o, s) {
|
|
4420
|
-
const i = o, a = s;
|
|
4421
|
-
let c = e, l = t, f = n, p = r, u = Math.sqrt(c * c + l * l);
|
|
4422
|
-
u !== 0 && (c /= u, l /= u);
|
|
4423
|
-
let h = c * f + l * p;
|
|
4424
|
-
f -= c * h, p -= l * h;
|
|
4425
|
-
let m = Math.sqrt(f * f + p * p);
|
|
4426
|
-
m !== 0 && (f /= m, p /= m, h /= m), c * p - l * f < 0 && (u = -u, c = -c, l = -l);
|
|
4427
|
-
const b = Math.atan2(l, c);
|
|
4428
|
-
return { translateX: i, translateY: a, scaleX: u, scaleY: m, angle: b, skew: h };
|
|
4429
|
-
}
|
|
4430
|
-
function Ft() {
|
|
4431
|
-
return [
|
|
4432
|
-
1,
|
|
4433
|
-
0,
|
|
4434
|
-
0,
|
|
4435
|
-
0,
|
|
4436
|
-
0,
|
|
4437
|
-
1,
|
|
4438
|
-
0,
|
|
4439
|
-
0,
|
|
4440
|
-
0,
|
|
4441
|
-
0,
|
|
4442
|
-
1,
|
|
4443
|
-
0,
|
|
4444
|
-
0,
|
|
4445
|
-
0,
|
|
4446
|
-
0,
|
|
4447
|
-
1
|
|
4448
|
-
];
|
|
4449
|
-
}
|
|
4450
|
-
function re(e, t, n) {
|
|
4451
|
-
return e[n * 4 + t];
|
|
4452
|
-
}
|
|
4453
|
-
function q(e, t, n, r) {
|
|
4454
|
-
e[n * 4 + t] = r;
|
|
4455
|
-
}
|
|
4456
|
-
function $t(e, t) {
|
|
4457
|
-
const n = new Array(16).fill(0);
|
|
4458
|
-
for (let r = 0; r < 4; r++)
|
|
4459
|
-
for (let o = 0; o < 4; o++) {
|
|
4460
|
-
let s = 0;
|
|
4461
|
-
for (let i = 0; i < 4; i++)
|
|
4462
|
-
s += re(e, o, i) * re(t, i, r);
|
|
4463
|
-
q(n, o, r, s);
|
|
4464
|
-
}
|
|
4465
|
-
return n;
|
|
4466
|
-
}
|
|
4467
|
-
function Ba(e) {
|
|
4468
|
-
const t = new Array(16).fill(0);
|
|
4469
|
-
for (let n = 0; n < 4; n++)
|
|
4470
|
-
for (let r = 0; r < 4; r++)
|
|
4471
|
-
q(t, r, n, re(e, n, r));
|
|
4472
|
-
return t;
|
|
4473
|
-
}
|
|
4474
|
-
function Na(e) {
|
|
4475
|
-
const t = e[0], n = e[4], r = e[8], o = e[12], s = e[1], i = e[5], a = e[9], c = e[13], l = e[2], f = e[6], p = e[10], u = e[14], h = e[3], m = e[7], x = e[11], b = e[15];
|
|
4476
|
-
return t * (i * (p * b - u * x) - a * (f * b - u * m) + c * (f * x - p * m)) - n * (s * (p * b - u * x) - a * (l * b - u * h) + c * (l * x - p * h)) + r * (s * (f * b - u * m) - i * (l * b - u * h) + c * (l * m - f * h)) - o * (s * (f * x - p * m) - i * (l * x - p * h) + a * (l * m - f * h));
|
|
4477
|
-
}
|
|
4478
|
-
function _a(e) {
|
|
4479
|
-
const t = Na(e);
|
|
4480
|
-
if (Math.abs(t) < 1e-12) return null;
|
|
4481
|
-
const n = new Array(16).fill(0);
|
|
4482
|
-
for (let r = 0; r < 4; r++)
|
|
4483
|
-
for (let o = 0; o < 4; o++) {
|
|
4484
|
-
const s = [];
|
|
4485
|
-
for (let c = 0; c < 4; c++)
|
|
4486
|
-
if (c !== r)
|
|
4487
|
-
for (let l = 0; l < 4; l++)
|
|
4488
|
-
l !== o && s.push(re(e, l, c));
|
|
4489
|
-
const i = s[0] * (s[4] * s[8] - s[5] * s[7]) - s[3] * (s[1] * s[8] - s[2] * s[7]) + s[6] * (s[1] * s[5] - s[2] * s[4]), a = (o + r & 1) === 0 ? 1 : -1;
|
|
4490
|
-
q(n, r, o, a * i / t);
|
|
4491
|
-
}
|
|
4492
|
-
return n;
|
|
4493
|
-
}
|
|
4494
|
-
function Ie(e, t, n) {
|
|
4495
|
-
return Math.sqrt(e * e + t * t + n * n);
|
|
4496
|
-
}
|
|
4497
|
-
function Pa(e, t) {
|
|
4498
|
-
return [
|
|
4499
|
-
e[1] * t[2] - e[2] * t[1],
|
|
4500
|
-
e[2] * t[0] - e[0] * t[2],
|
|
4501
|
-
e[0] * t[1] - e[1] * t[0]
|
|
4502
|
-
];
|
|
4503
|
-
}
|
|
4504
|
-
function Dt(e, t) {
|
|
4505
|
-
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
|
|
4506
|
-
}
|
|
4507
|
-
function Tc(e) {
|
|
4508
|
-
if (e.length !== 16) return null;
|
|
4509
|
-
const t = [...e], n = t[15];
|
|
4510
|
-
if (Math.abs(n) < 1e-12) return null;
|
|
4511
|
-
for (let b = 0; b < 16; b++) t[b] /= n;
|
|
4512
|
-
const r = [0, 0, 0, 1];
|
|
4513
|
-
if (Math.abs(t[3]) > 1e-12 || Math.abs(t[7]) > 1e-12 || Math.abs(t[11]) > 1e-12) {
|
|
4514
|
-
const b = [...t];
|
|
4515
|
-
b[3] = 0, b[7] = 0, b[11] = 0, b[15] = 1;
|
|
4516
|
-
const I = _a(b);
|
|
4517
|
-
if (!I) return null;
|
|
4518
|
-
const E = Ba(I);
|
|
4519
|
-
r[0] = E[0] * t[3] + E[4] * t[7] + E[8] * t[11] + E[12] * t[15], r[1] = E[1] * t[3] + E[5] * t[7] + E[9] * t[11] + E[13] * t[15], r[2] = E[2] * t[3] + E[6] * t[7] + E[10] * t[11] + E[14] * t[15], r[3] = E[3] * t[3] + E[7] * t[7] + E[11] * t[11] + E[15] * t[15];
|
|
4520
|
-
}
|
|
4521
|
-
const o = [t[12], t[13], t[14]];
|
|
4522
|
-
let s = [t[0], t[1], t[2]], i = [t[4], t[5], t[6]], a = [t[8], t[9], t[10]];
|
|
4523
|
-
const c = Ie(...s);
|
|
4524
|
-
s = [s[0] / c, s[1] / c, s[2] / c];
|
|
4525
|
-
let l = Dt(s, i);
|
|
4526
|
-
i = [
|
|
4527
|
-
i[0] - s[0] * l,
|
|
4528
|
-
i[1] - s[1] * l,
|
|
4529
|
-
i[2] - s[2] * l
|
|
4530
|
-
];
|
|
4531
|
-
const f = Ie(...i);
|
|
4532
|
-
i = [i[0] / f, i[1] / f, i[2] / f], l /= f;
|
|
4533
|
-
let p = Dt(s, a);
|
|
4534
|
-
a = [
|
|
4535
|
-
a[0] - s[0] * p,
|
|
4536
|
-
a[1] - s[1] * p,
|
|
4537
|
-
a[2] - s[2] * p
|
|
4538
|
-
];
|
|
4539
|
-
let u = Dt(i, a);
|
|
4540
|
-
a = [
|
|
4541
|
-
a[0] - i[0] * u,
|
|
4542
|
-
a[1] - i[1] * u,
|
|
4543
|
-
a[2] - i[2] * u
|
|
4544
|
-
];
|
|
4545
|
-
const h = Ie(...a);
|
|
4546
|
-
a = [a[0] / h, a[1] / h, a[2] / h], p /= h, u /= h;
|
|
4547
|
-
const m = Pa(i, a);
|
|
4548
|
-
Dt(s, m) < 0 && (s = [-s[0], -s[1], -s[2]], i = [-i[0], -i[1], -i[2]], a = [-a[0], -a[1], -a[2]]);
|
|
4549
|
-
const x = za(
|
|
4550
|
-
s[0],
|
|
4551
|
-
i[0],
|
|
4552
|
-
a[0],
|
|
4553
|
-
s[1],
|
|
4554
|
-
i[1],
|
|
4555
|
-
a[1],
|
|
4556
|
-
s[2],
|
|
4557
|
-
i[2],
|
|
4558
|
-
a[2]
|
|
4559
|
-
);
|
|
4560
|
-
return {
|
|
4561
|
-
translate: o,
|
|
4562
|
-
scale: [c, f, h],
|
|
4563
|
-
skew: [l, p, u],
|
|
4564
|
-
quaternion: x,
|
|
4565
|
-
perspective: r
|
|
4566
|
-
};
|
|
4567
|
-
}
|
|
4568
|
-
function za(e, t, n, r, o, s, i, a, c) {
|
|
4569
|
-
const l = e + o + c;
|
|
4570
|
-
let f, p, u, h;
|
|
4571
|
-
if (l > 0) {
|
|
4572
|
-
const m = 0.5 / Math.sqrt(l + 1);
|
|
4573
|
-
h = 0.25 / m, f = (a - s) * m, p = (n - i) * m, u = (r - t) * m;
|
|
4574
|
-
} else if (e > o && e > c) {
|
|
4575
|
-
const m = 2 * Math.sqrt(1 + e - o - c);
|
|
4576
|
-
h = (a - s) / m, f = 0.25 * m, p = (t + r) / m, u = (n + i) / m;
|
|
4577
|
-
} else if (o > c) {
|
|
4578
|
-
const m = 2 * Math.sqrt(1 + o - e - c);
|
|
4579
|
-
h = (n - i) / m, f = (t + r) / m, p = 0.25 * m, u = (s + a) / m;
|
|
4580
|
-
} else {
|
|
4581
|
-
const m = 2 * Math.sqrt(1 + c - e - o);
|
|
4582
|
-
h = (r - t) / m, f = (n + i) / m, p = (s + a) / m, u = 0.25 * m;
|
|
4583
|
-
}
|
|
4584
|
-
return [f, p, u, h];
|
|
4585
|
-
}
|
|
4586
|
-
function La(e, t, n) {
|
|
4587
|
-
let r = e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3];
|
|
4588
|
-
if (r < 0 && (t = [-t[0], -t[1], -t[2], -t[3]], r = -r), r > 0.9995) {
|
|
4589
|
-
const c = [
|
|
4590
|
-
e[0] + n * (t[0] - e[0]),
|
|
4591
|
-
e[1] + n * (t[1] - e[1]),
|
|
4592
|
-
e[2] + n * (t[2] - e[2]),
|
|
4593
|
-
e[3] + n * (t[3] - e[3])
|
|
4594
|
-
], l = Math.sqrt(
|
|
4595
|
-
c[0] * c[0] + c[1] * c[1] + c[2] * c[2] + c[3] * c[3]
|
|
4596
|
-
);
|
|
4597
|
-
return [c[0] / l, c[1] / l, c[2] / l, c[3] / l];
|
|
4598
|
-
}
|
|
4599
|
-
const o = Math.acos(r), s = Math.sin(o), i = Math.sin((1 - n) * o) / s, a = Math.sin(n * o) / s;
|
|
4600
|
-
return [
|
|
4601
|
-
e[0] * i + t[0] * a,
|
|
4602
|
-
e[1] * i + t[1] * a,
|
|
4603
|
-
e[2] * i + t[2] * a,
|
|
4604
|
-
e[3] * i + t[3] * a
|
|
4605
|
-
];
|
|
4606
|
-
}
|
|
4607
|
-
function Ac(e) {
|
|
4608
|
-
const t = Ft();
|
|
4609
|
-
q(t, 0, 3, e.perspective[0]), q(t, 1, 3, e.perspective[1]), q(t, 2, 3, e.perspective[2]), q(t, 3, 3, e.perspective[3]), t[12] += e.translate[0] * t[0] + e.translate[1] * t[4] + e.translate[2] * t[8], t[13] += e.translate[0] * t[1] + e.translate[1] * t[5] + e.translate[2] * t[9], t[14] += e.translate[0] * t[2] + e.translate[1] * t[6] + e.translate[2] * t[10], t[15] += e.translate[0] * t[3] + e.translate[1] * t[7] + e.translate[2] * t[11];
|
|
4610
|
-
const n = Fa(e.quaternion), r = $t(t, n);
|
|
4611
|
-
for (let a = 0; a < 16; a++) t[a] = r[a];
|
|
4612
|
-
if (e.skew[2] !== 0) {
|
|
4613
|
-
const a = Ft();
|
|
4614
|
-
q(a, 1, 2, e.skew[2]);
|
|
4615
|
-
const c = $t(t, a);
|
|
4616
|
-
for (let l = 0; l < 16; l++) t[l] = c[l];
|
|
4617
|
-
}
|
|
4618
|
-
if (e.skew[1] !== 0) {
|
|
4619
|
-
const a = Ft();
|
|
4620
|
-
q(a, 0, 2, e.skew[1]);
|
|
4621
|
-
const c = $t(t, a);
|
|
4622
|
-
for (let l = 0; l < 16; l++) t[l] = c[l];
|
|
4623
|
-
}
|
|
4624
|
-
if (e.skew[0] !== 0) {
|
|
4625
|
-
const a = Ft();
|
|
4626
|
-
q(a, 0, 1, e.skew[0]);
|
|
4627
|
-
const c = $t(t, a);
|
|
4628
|
-
for (let l = 0; l < 16; l++) t[l] = c[l];
|
|
4629
|
-
}
|
|
4630
|
-
const [o, s, i] = e.scale;
|
|
4631
|
-
return t[0] *= o, t[1] *= o, t[2] *= o, t[3] *= o, t[4] *= s, t[5] *= s, t[6] *= s, t[7] *= s, t[8] *= i, t[9] *= i, t[10] *= i, t[11] *= i, [...t];
|
|
4632
|
-
}
|
|
4633
|
-
function Fa(e) {
|
|
4634
|
-
const [t, n, r, o] = e, s = t * t, i = n * n, a = r * r, c = t * n, l = t * r, f = n * r, p = o * t, u = o * n, h = o * r;
|
|
4635
|
-
return [
|
|
4636
|
-
1 - 2 * (i + a),
|
|
4637
|
-
2 * (c + h),
|
|
4638
|
-
2 * (l - u),
|
|
4639
|
-
0,
|
|
4640
|
-
2 * (c - h),
|
|
4641
|
-
1 - 2 * (s + a),
|
|
4642
|
-
2 * (f + p),
|
|
4643
|
-
0,
|
|
4644
|
-
2 * (l + u),
|
|
4645
|
-
2 * (f - p),
|
|
4646
|
-
1 - 2 * (s + i),
|
|
4647
|
-
0,
|
|
4648
|
-
0,
|
|
4649
|
-
0,
|
|
4650
|
-
0,
|
|
4651
|
-
1
|
|
4652
|
-
];
|
|
4653
|
-
}
|
|
4654
|
-
function Ic(e, t, n) {
|
|
4655
|
-
const r = (o, s) => o + (s - o) * n;
|
|
4656
|
-
return {
|
|
4657
|
-
translate: [
|
|
4658
|
-
r(e.translate[0], t.translate[0]),
|
|
4659
|
-
r(e.translate[1], t.translate[1]),
|
|
4660
|
-
r(e.translate[2], t.translate[2])
|
|
4661
|
-
],
|
|
4662
|
-
scale: [
|
|
4663
|
-
r(e.scale[0], t.scale[0]),
|
|
4664
|
-
r(e.scale[1], t.scale[1]),
|
|
4665
|
-
r(e.scale[2], t.scale[2])
|
|
4666
|
-
],
|
|
4667
|
-
skew: [
|
|
4668
|
-
r(e.skew[0], t.skew[0]),
|
|
4669
|
-
r(e.skew[1], t.skew[1]),
|
|
4670
|
-
r(e.skew[2], t.skew[2])
|
|
4671
|
-
],
|
|
4672
|
-
quaternion: La(e.quaternion, t.quaternion, n),
|
|
4673
|
-
perspective: [
|
|
4674
|
-
r(e.perspective[0], t.perspective[0]),
|
|
4675
|
-
r(e.perspective[1], t.perspective[1]),
|
|
4676
|
-
r(e.perspective[2], t.perspective[2]),
|
|
4677
|
-
r(e.perspective[3], t.perspective[3])
|
|
4678
|
-
]
|
|
4679
|
-
};
|
|
4680
|
-
}
|
|
4681
|
-
export {
|
|
4682
|
-
Yr as ABSOLUTE_LENGTH_UNITS,
|
|
4683
|
-
G as ALPHA_DENORM_UNIT,
|
|
4684
|
-
y as ALPHA_RANGE,
|
|
4685
|
-
qt as ANGLE_UNITS,
|
|
4686
|
-
He as AdobeRGBColor,
|
|
4687
|
-
Ws as BLACKLISTED_COALESCE_UNITS,
|
|
4688
|
-
An as COLOR_NAMES,
|
|
4689
|
-
dr as COLOR_SPACE_DENORM_UNITS,
|
|
4690
|
-
Ja as COLOR_SPACE_NAMES,
|
|
4691
|
-
C as COLOR_SPACE_RANGES,
|
|
4692
|
-
Xs as COLOR_UNITS,
|
|
4693
|
-
Ne as COMPUTED_UNITS,
|
|
4694
|
-
pn as CSSColor,
|
|
4695
|
-
nt as CSSCubicBezier,
|
|
4696
|
-
gc as CSSFunction,
|
|
4697
|
-
qi as CSSJSON,
|
|
4698
|
-
mo as CSSString,
|
|
4699
|
-
W as CSSValueUnit,
|
|
4700
|
-
dc as CSSValues,
|
|
4701
|
-
Zi as CSS_WIDE_KEYWORDS,
|
|
4702
|
-
zs as CYLINDRICAL_HUE_COMPONENT,
|
|
4703
|
-
H as Color,
|
|
4704
|
-
nc as DELTA_E_OK_JND,
|
|
4705
|
-
We as DisplayP3Color,
|
|
4706
|
-
qr as FLEX_UNITS,
|
|
4707
|
-
Oe as FRAME_RATE,
|
|
4708
|
-
Jt as FREQUENCY_UNITS,
|
|
4709
|
-
N as FunctionValue,
|
|
4710
|
-
zo as GAMUT_SECTOR_COEFFICIENTS,
|
|
4711
|
-
vt as HSLColor,
|
|
4712
|
-
De as HSVColor,
|
|
4713
|
-
It as HUE_RANGE,
|
|
4714
|
-
Ue as HWBColor,
|
|
4715
|
-
hr as KelvinColor,
|
|
4716
|
-
se as LABColor,
|
|
4717
|
-
Ge as LCHColor,
|
|
4718
|
-
Zt as LENGTH_UNITS,
|
|
4719
|
-
tt as LINEAR_SRGB_TO_LMS,
|
|
4720
|
-
M as LMS_TO_LINEAR_SRGB,
|
|
4721
|
-
Sr as LMS_TO_OKLAB_MATRIX,
|
|
4722
|
-
_o as LMS_TO_XYZ_MATRIX,
|
|
4723
|
-
Xe as LinearSRGBColor,
|
|
4724
|
-
ie as OKLABColor,
|
|
4725
|
-
$ as OKLAB_TO_LMS_COEFF,
|
|
4726
|
-
Po as OKLAB_TO_LMS_MATRIX,
|
|
4727
|
-
Ve as OKLCHColor,
|
|
4728
|
-
Kr as PERCENTAGE_UNITS,
|
|
4729
|
-
je as ProPhotoRGBColor,
|
|
4730
|
-
Zr as RELATIVE_LENGTH_UNITS,
|
|
4731
|
-
Qt as RESOLUTION_UNITS,
|
|
4732
|
-
L as RGBA_MAX,
|
|
4733
|
-
D as RGBColor,
|
|
4734
|
-
ke as RGB_RANGE,
|
|
4735
|
-
Ye as Rec2020Color,
|
|
4736
|
-
Vs as STRING_UNITS,
|
|
4737
|
-
Hs as STYLE_NAMES,
|
|
4738
|
-
Kt as TIME_UNITS,
|
|
4739
|
-
cc as UNITS,
|
|
4740
|
-
U as UNIT_RANGE,
|
|
4741
|
-
_t as ValueArray,
|
|
4742
|
-
S as ValueUnit,
|
|
4743
|
-
kr as WHITE_POINTS,
|
|
4744
|
-
No as WHITE_POINT_D50,
|
|
4745
|
-
wr as WHITE_POINT_D50_D65,
|
|
4746
|
-
Bo as WHITE_POINT_D65,
|
|
4747
|
-
Ze as WHITE_POINT_D65_D50,
|
|
4748
|
-
X as XYZColor,
|
|
4749
|
-
yr as XYZ_TO_LMS_MATRIX,
|
|
4750
|
-
Is as adobeRgb2xyz,
|
|
4751
|
-
xe as adobeRgbToLinear,
|
|
4752
|
-
$a as arrayEquals,
|
|
4753
|
-
bt as bezierPresets,
|
|
4754
|
-
Jn as bounceInEase,
|
|
4755
|
-
Qn as bounceInEaseHalf,
|
|
4756
|
-
nr as bounceInOutEase,
|
|
4757
|
-
tr as bounceOutEase,
|
|
4758
|
-
er as bounceOutEaseHalf,
|
|
4759
|
-
Wa as camelCaseToHyphen,
|
|
4760
|
-
Ya as cancelAnimationFrame,
|
|
4761
|
-
_ as clamp,
|
|
4762
|
-
at as clone,
|
|
4763
|
-
gt as color2,
|
|
4764
|
-
On as colorUnit2,
|
|
4765
|
-
$o as computeMaxSaturation,
|
|
4766
|
-
hc as convert2,
|
|
4767
|
-
Zs as convertAbsoluteUnitToPixels,
|
|
4768
|
-
to as convertToDPI,
|
|
4769
|
-
ce as convertToDegrees,
|
|
4770
|
-
Ks as convertToHz,
|
|
4771
|
-
Qr as convertToMs,
|
|
4772
|
-
Jr as convertToPixels,
|
|
4773
|
-
Va as createHash,
|
|
4774
|
-
ta as cssFiltersToString,
|
|
4775
|
-
xc as cssLinear,
|
|
4776
|
-
Cr as cubicBezier,
|
|
4777
|
-
tc as cubicBezierToSVG,
|
|
4778
|
-
ec as cubicBezierToString,
|
|
4779
|
-
Wt as deCasteljau,
|
|
4780
|
-
Ga as debounce,
|
|
4781
|
-
Mc as decomposeMatrix2D,
|
|
4782
|
-
Tc as decomposeMatrix3D,
|
|
4783
|
-
rc as deltaEOK,
|
|
4784
|
-
Ts as displayP32xyz,
|
|
4785
|
-
qn as easeInBounce,
|
|
4786
|
-
ir as easeInCirc,
|
|
4787
|
-
jn as easeInCubic,
|
|
4788
|
-
lr as easeInExpo,
|
|
4789
|
-
cr as easeInOutCirc,
|
|
4790
|
-
Zn as easeInOutCubic,
|
|
4791
|
-
fr as easeInOutExpo,
|
|
4792
|
-
Hn as easeInOutQuad,
|
|
4793
|
-
sr as easeInOutSine,
|
|
4794
|
-
Xn as easeInQuad,
|
|
4795
|
-
rr as easeInSine,
|
|
4796
|
-
ar as easeOutCirc,
|
|
4797
|
-
Yn as easeOutCubic,
|
|
4798
|
-
ur as easeOutExpo,
|
|
4799
|
-
Wn as easeOutQuad,
|
|
4800
|
-
or as easeOutSine,
|
|
4801
|
-
bc as evaluateMathFunction,
|
|
4802
|
-
ei as fail,
|
|
4803
|
-
Do as findCusp,
|
|
4804
|
-
Uo as findGamutIntersection,
|
|
4805
|
-
lc as flattenObject,
|
|
4806
|
-
Ps as gamutMap,
|
|
4807
|
-
Xo as gamutMapOKLab,
|
|
4808
|
-
Ho as gamutMapSRGB,
|
|
4809
|
-
yc as getComputedValue,
|
|
4810
|
-
oc as getFormattedColorSpaceRange,
|
|
4811
|
-
jo as hex2rgb,
|
|
4812
|
-
Or as hsl2hsv,
|
|
4813
|
-
Ko as hsl2hwb,
|
|
4814
|
-
qo as hsl2rgb,
|
|
4815
|
-
an as hsl2xyz,
|
|
4816
|
-
Ir as hsv2hsl,
|
|
4817
|
-
cs as hsv2xyz,
|
|
4818
|
-
Zo as hwb2hsl,
|
|
4819
|
-
us as hwb2xyz,
|
|
4820
|
-
Xa as hyphenToCamelCase,
|
|
4821
|
-
Js as identifier,
|
|
4822
|
-
Qs as integer,
|
|
4823
|
-
ae as interpBezier,
|
|
4824
|
-
Ic as interpolateDecomposed,
|
|
4825
|
-
Ls as interpolateHue,
|
|
4826
|
-
ct as invertMat3,
|
|
4827
|
-
pc as isCSSStyleName,
|
|
4828
|
-
_e as isColorUnit,
|
|
4829
|
-
Fo as isInSRGBGamut,
|
|
4830
|
-
pr as isObject,
|
|
4831
|
-
g as istring,
|
|
4832
|
-
Ec as jumpTerms,
|
|
4833
|
-
Ar as kelvin2rgb,
|
|
4834
|
-
gs as kelvin2xyz,
|
|
4835
|
-
ss as lab2lch,
|
|
4836
|
-
as as lab2oklab,
|
|
4837
|
-
ac as lab2oklch,
|
|
4838
|
-
Qe as lab2xyz,
|
|
4839
|
-
os as lch2lab,
|
|
4840
|
-
ps as lch2xyz,
|
|
4841
|
-
Xt as lerp,
|
|
4842
|
-
yo as linear,
|
|
4843
|
-
vs as linearSrgb2xyz,
|
|
4844
|
-
ws as linearToAdobeRgb,
|
|
4845
|
-
ks as linearToProPhoto,
|
|
4846
|
-
ys as linearToRec2020,
|
|
4847
|
-
Lr as linearToSrgb,
|
|
4848
|
-
Qa as logerp,
|
|
4849
|
-
oe as memoize,
|
|
4850
|
-
Fs as mixColors,
|
|
4851
|
-
qa as multiplyMat3,
|
|
4852
|
-
ln as none,
|
|
4853
|
-
Us as normalizeColor,
|
|
4854
|
-
Be as normalizeColorUnit,
|
|
4855
|
-
Ds as normalizeColorUnitComponent,
|
|
4856
|
-
Gs as normalizeColorUnits,
|
|
4857
|
-
Qi as normalizeNumericUnits,
|
|
4858
|
-
Sc as normalizeValueUnits,
|
|
4859
|
-
J as number,
|
|
4860
|
-
is as oklab2lab,
|
|
4861
|
-
Fr as oklab2oklch,
|
|
4862
|
-
on as oklab2xyz,
|
|
4863
|
-
qe as oklabToLinearSRGB,
|
|
4864
|
-
ic as oklch2lab,
|
|
4865
|
-
$r as oklch2oklab,
|
|
4866
|
-
ms as oklch2xyz,
|
|
4867
|
-
mc as parseCSSColor,
|
|
4868
|
-
wc as parseCSSPercent,
|
|
4869
|
-
kc as parseCSSTime,
|
|
4870
|
-
Ji as parseCSSValue,
|
|
4871
|
-
lo as parseCSSValueUnit,
|
|
4872
|
-
ni as parseResult,
|
|
4873
|
-
Rs as proPhoto2xyz,
|
|
4874
|
-
Ee as proPhotoToLinear,
|
|
4875
|
-
Ns as rec20202xyz,
|
|
4876
|
-
ve as rec2020ToLinear,
|
|
4877
|
-
Ac as recomposeMatrix3D,
|
|
4878
|
-
ja as requestAnimationFrame,
|
|
4879
|
-
Cc as rgb2ColorFilter,
|
|
4880
|
-
sc as rgb2hex,
|
|
4881
|
-
Rr as rgb2hsl,
|
|
4882
|
-
Yo as rgb2kelvin,
|
|
4883
|
-
nn as rgb2xyz,
|
|
4884
|
-
B as scale,
|
|
4885
|
-
Ha as seekPreviousValue,
|
|
4886
|
-
Da as sleep,
|
|
4887
|
-
La as slerp,
|
|
4888
|
-
Kn as smoothStep3,
|
|
4889
|
-
xt as srgbToLinear,
|
|
4890
|
-
Wo as srgbToOKLab,
|
|
4891
|
-
Ra as stepEnd,
|
|
4892
|
-
Oa as stepStart,
|
|
4893
|
-
wn as steppedEase,
|
|
4894
|
-
ti as succeed,
|
|
4895
|
-
vc as timingFunctions,
|
|
4896
|
-
P as transformMat3,
|
|
4897
|
-
Ka as transposeMat3,
|
|
4898
|
-
Et as tryParse,
|
|
4899
|
-
uc as unflattenObject,
|
|
4900
|
-
fc as unflattenObjectToString,
|
|
4901
|
-
Ys as unpackMatrixValues,
|
|
4902
|
-
Ua as waitUntil,
|
|
4903
|
-
Os as xyz2adobeRgb,
|
|
4904
|
-
As as xyz2displayP3,
|
|
4905
|
-
cn as xyz2hsl,
|
|
4906
|
-
ls as xyz2hsv,
|
|
4907
|
-
fs as xyz2hwb,
|
|
4908
|
-
ds as xyz2kelvin,
|
|
4909
|
-
Je as xyz2lab,
|
|
4910
|
-
hs as xyz2lch,
|
|
4911
|
-
Ms as xyz2linearSrgb,
|
|
4912
|
-
sn as xyz2oklab,
|
|
4913
|
-
bs as xyz2oklch,
|
|
4914
|
-
Bs as xyz2proPhoto,
|
|
4915
|
-
_s as xyz2rec2020,
|
|
4916
|
-
rn as xyz2rgb
|
|
4917
|
-
};
|