@angular/material 18.0.0-next.4 → 18.0.0-next.5

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.
@@ -0,0 +1,2682 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+ var __async = (__this, __arguments, generator) => {
33
+ return new Promise((resolve, reject) => {
34
+ var fulfilled = (value) => {
35
+ try {
36
+ step(generator.next(value));
37
+ } catch (e) {
38
+ reject(e);
39
+ }
40
+ };
41
+ var rejected = (value) => {
42
+ try {
43
+ step(generator.throw(value));
44
+ } catch (e) {
45
+ reject(e);
46
+ }
47
+ };
48
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
49
+ step((generator = generator.apply(__this, __arguments)).next());
50
+ });
51
+ };
52
+
53
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
54
+ var m3_theme_exports = {};
55
+ __export(m3_theme_exports, {
56
+ default: () => m3_theme_default,
57
+ generateSCSSTheme: () => generateSCSSTheme
58
+ });
59
+ module.exports = __toCommonJS(m3_theme_exports);
60
+
61
+ // node_modules/@material/material-color-utilities/utils/math_utils.js
62
+ function signum(num) {
63
+ if (num < 0) {
64
+ return -1;
65
+ } else if (num === 0) {
66
+ return 0;
67
+ } else {
68
+ return 1;
69
+ }
70
+ }
71
+ function lerp(start, stop, amount) {
72
+ return (1 - amount) * start + amount * stop;
73
+ }
74
+ function clampInt(min, max, input) {
75
+ if (input < min) {
76
+ return min;
77
+ } else if (input > max) {
78
+ return max;
79
+ }
80
+ return input;
81
+ }
82
+ function clampDouble(min, max, input) {
83
+ if (input < min) {
84
+ return min;
85
+ } else if (input > max) {
86
+ return max;
87
+ }
88
+ return input;
89
+ }
90
+ function sanitizeDegreesInt(degrees) {
91
+ degrees = degrees % 360;
92
+ if (degrees < 0) {
93
+ degrees = degrees + 360;
94
+ }
95
+ return degrees;
96
+ }
97
+ function sanitizeDegreesDouble(degrees) {
98
+ degrees = degrees % 360;
99
+ if (degrees < 0) {
100
+ degrees = degrees + 360;
101
+ }
102
+ return degrees;
103
+ }
104
+ function rotationDirection(from, to) {
105
+ const increasingDifference = sanitizeDegreesDouble(to - from);
106
+ return increasingDifference <= 180 ? 1 : -1;
107
+ }
108
+ function differenceDegrees(a, b) {
109
+ return 180 - Math.abs(Math.abs(a - b) - 180);
110
+ }
111
+ function matrixMultiply(row, matrix) {
112
+ const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];
113
+ const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];
114
+ const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];
115
+ return [a, b, c];
116
+ }
117
+
118
+ // node_modules/@material/material-color-utilities/utils/color_utils.js
119
+ var SRGB_TO_XYZ = [
120
+ [0.41233895, 0.35762064, 0.18051042],
121
+ [0.2126, 0.7152, 0.0722],
122
+ [0.01932141, 0.11916382, 0.95034478]
123
+ ];
124
+ var XYZ_TO_SRGB = [
125
+ [
126
+ 3.2413774792388685,
127
+ -1.5376652402851851,
128
+ -0.49885366846268053
129
+ ],
130
+ [
131
+ -0.9691452513005321,
132
+ 1.8758853451067872,
133
+ 0.04156585616912061
134
+ ],
135
+ [
136
+ 0.05562093689691305,
137
+ -0.20395524564742123,
138
+ 1.0571799111220335
139
+ ]
140
+ ];
141
+ var WHITE_POINT_D65 = [95.047, 100, 108.883];
142
+ function argbFromRgb(red, green, blue) {
143
+ return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>> 0;
144
+ }
145
+ function argbFromLinrgb(linrgb) {
146
+ const r = delinearized(linrgb[0]);
147
+ const g = delinearized(linrgb[1]);
148
+ const b = delinearized(linrgb[2]);
149
+ return argbFromRgb(r, g, b);
150
+ }
151
+ function redFromArgb(argb) {
152
+ return argb >> 16 & 255;
153
+ }
154
+ function greenFromArgb(argb) {
155
+ return argb >> 8 & 255;
156
+ }
157
+ function blueFromArgb(argb) {
158
+ return argb & 255;
159
+ }
160
+ function argbFromXyz(x, y, z) {
161
+ const matrix = XYZ_TO_SRGB;
162
+ const linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z;
163
+ const linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z;
164
+ const linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;
165
+ const r = delinearized(linearR);
166
+ const g = delinearized(linearG);
167
+ const b = delinearized(linearB);
168
+ return argbFromRgb(r, g, b);
169
+ }
170
+ function xyzFromArgb(argb) {
171
+ const r = linearized(redFromArgb(argb));
172
+ const g = linearized(greenFromArgb(argb));
173
+ const b = linearized(blueFromArgb(argb));
174
+ return matrixMultiply([r, g, b], SRGB_TO_XYZ);
175
+ }
176
+ function argbFromLstar(lstar) {
177
+ const y = yFromLstar(lstar);
178
+ const component = delinearized(y);
179
+ return argbFromRgb(component, component, component);
180
+ }
181
+ function lstarFromArgb(argb) {
182
+ const y = xyzFromArgb(argb)[1];
183
+ return 116 * labF(y / 100) - 16;
184
+ }
185
+ function yFromLstar(lstar) {
186
+ return 100 * labInvf((lstar + 16) / 116);
187
+ }
188
+ function lstarFromY(y) {
189
+ return labF(y / 100) * 116 - 16;
190
+ }
191
+ function linearized(rgbComponent) {
192
+ const normalized = rgbComponent / 255;
193
+ if (normalized <= 0.040449936) {
194
+ return normalized / 12.92 * 100;
195
+ } else {
196
+ return Math.pow((normalized + 0.055) / 1.055, 2.4) * 100;
197
+ }
198
+ }
199
+ function delinearized(rgbComponent) {
200
+ const normalized = rgbComponent / 100;
201
+ let delinearized2 = 0;
202
+ if (normalized <= 31308e-7) {
203
+ delinearized2 = normalized * 12.92;
204
+ } else {
205
+ delinearized2 = 1.055 * Math.pow(normalized, 1 / 2.4) - 0.055;
206
+ }
207
+ return clampInt(0, 255, Math.round(delinearized2 * 255));
208
+ }
209
+ function whitePointD65() {
210
+ return WHITE_POINT_D65;
211
+ }
212
+ function labF(t) {
213
+ const e = 216 / 24389;
214
+ const kappa = 24389 / 27;
215
+ if (t > e) {
216
+ return Math.pow(t, 1 / 3);
217
+ } else {
218
+ return (kappa * t + 16) / 116;
219
+ }
220
+ }
221
+ function labInvf(ft) {
222
+ const e = 216 / 24389;
223
+ const kappa = 24389 / 27;
224
+ const ft3 = ft * ft * ft;
225
+ if (ft3 > e) {
226
+ return ft3;
227
+ } else {
228
+ return (116 * ft - 16) / kappa;
229
+ }
230
+ }
231
+
232
+ // node_modules/@material/material-color-utilities/hct/viewing_conditions.js
233
+ var ViewingConditions = class {
234
+ static make(whitePoint = whitePointD65(), adaptingLuminance = 200 / Math.PI * yFromLstar(50) / 100, backgroundLstar = 50, surround = 2, discountingIlluminant = false) {
235
+ const xyz = whitePoint;
236
+ const rW = xyz[0] * 0.401288 + xyz[1] * 0.650173 + xyz[2] * -0.051461;
237
+ const gW = xyz[0] * -0.250268 + xyz[1] * 1.204414 + xyz[2] * 0.045854;
238
+ const bW = xyz[0] * -2079e-6 + xyz[1] * 0.048952 + xyz[2] * 0.953127;
239
+ const f = 0.8 + surround / 10;
240
+ const c = f >= 0.9 ? lerp(0.59, 0.69, (f - 0.9) * 10) : lerp(0.525, 0.59, (f - 0.8) * 10);
241
+ let d = discountingIlluminant ? 1 : f * (1 - 1 / 3.6 * Math.exp((-adaptingLuminance - 42) / 92));
242
+ d = d > 1 ? 1 : d < 0 ? 0 : d;
243
+ const nc = f;
244
+ const rgbD = [
245
+ d * (100 / rW) + 1 - d,
246
+ d * (100 / gW) + 1 - d,
247
+ d * (100 / bW) + 1 - d
248
+ ];
249
+ const k = 1 / (5 * adaptingLuminance + 1);
250
+ const k4 = k * k * k * k;
251
+ const k4F = 1 - k4;
252
+ const fl = k4 * adaptingLuminance + 0.1 * k4F * k4F * Math.cbrt(5 * adaptingLuminance);
253
+ const n = yFromLstar(backgroundLstar) / whitePoint[1];
254
+ const z = 1.48 + Math.sqrt(n);
255
+ const nbb = 0.725 / Math.pow(n, 0.2);
256
+ const ncb = nbb;
257
+ const rgbAFactors = [
258
+ Math.pow(fl * rgbD[0] * rW / 100, 0.42),
259
+ Math.pow(fl * rgbD[1] * gW / 100, 0.42),
260
+ Math.pow(fl * rgbD[2] * bW / 100, 0.42)
261
+ ];
262
+ const rgbA = [
263
+ 400 * rgbAFactors[0] / (rgbAFactors[0] + 27.13),
264
+ 400 * rgbAFactors[1] / (rgbAFactors[1] + 27.13),
265
+ 400 * rgbAFactors[2] / (rgbAFactors[2] + 27.13)
266
+ ];
267
+ const aw = (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;
268
+ return new ViewingConditions(n, aw, nbb, ncb, c, nc, rgbD, fl, Math.pow(fl, 0.25), z);
269
+ }
270
+ constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {
271
+ this.n = n;
272
+ this.aw = aw;
273
+ this.nbb = nbb;
274
+ this.ncb = ncb;
275
+ this.c = c;
276
+ this.nc = nc;
277
+ this.rgbD = rgbD;
278
+ this.fl = fl;
279
+ this.fLRoot = fLRoot;
280
+ this.z = z;
281
+ }
282
+ };
283
+ ViewingConditions.DEFAULT = ViewingConditions.make();
284
+
285
+ // node_modules/@material/material-color-utilities/hct/cam16.js
286
+ var Cam16 = class {
287
+ constructor(hue, chroma, j, q, m, s, jstar, astar, bstar) {
288
+ this.hue = hue;
289
+ this.chroma = chroma;
290
+ this.j = j;
291
+ this.q = q;
292
+ this.m = m;
293
+ this.s = s;
294
+ this.jstar = jstar;
295
+ this.astar = astar;
296
+ this.bstar = bstar;
297
+ }
298
+ distance(other) {
299
+ const dJ = this.jstar - other.jstar;
300
+ const dA = this.astar - other.astar;
301
+ const dB = this.bstar - other.bstar;
302
+ const dEPrime = Math.sqrt(dJ * dJ + dA * dA + dB * dB);
303
+ const dE = 1.41 * Math.pow(dEPrime, 0.63);
304
+ return dE;
305
+ }
306
+ static fromInt(argb) {
307
+ return Cam16.fromIntInViewingConditions(argb, ViewingConditions.DEFAULT);
308
+ }
309
+ static fromIntInViewingConditions(argb, viewingConditions) {
310
+ const red = (argb & 16711680) >> 16;
311
+ const green = (argb & 65280) >> 8;
312
+ const blue = argb & 255;
313
+ const redL = linearized(red);
314
+ const greenL = linearized(green);
315
+ const blueL = linearized(blue);
316
+ const x = 0.41233895 * redL + 0.35762064 * greenL + 0.18051042 * blueL;
317
+ const y = 0.2126 * redL + 0.7152 * greenL + 0.0722 * blueL;
318
+ const z = 0.01932141 * redL + 0.11916382 * greenL + 0.95034478 * blueL;
319
+ const rC = 0.401288 * x + 0.650173 * y - 0.051461 * z;
320
+ const gC = -0.250268 * x + 1.204414 * y + 0.045854 * z;
321
+ const bC = -2079e-6 * x + 0.048952 * y + 0.953127 * z;
322
+ const rD = viewingConditions.rgbD[0] * rC;
323
+ const gD = viewingConditions.rgbD[1] * gC;
324
+ const bD = viewingConditions.rgbD[2] * bC;
325
+ const rAF = Math.pow(viewingConditions.fl * Math.abs(rD) / 100, 0.42);
326
+ const gAF = Math.pow(viewingConditions.fl * Math.abs(gD) / 100, 0.42);
327
+ const bAF = Math.pow(viewingConditions.fl * Math.abs(bD) / 100, 0.42);
328
+ const rA = signum(rD) * 400 * rAF / (rAF + 27.13);
329
+ const gA = signum(gD) * 400 * gAF / (gAF + 27.13);
330
+ const bA = signum(bD) * 400 * bAF / (bAF + 27.13);
331
+ const a = (11 * rA + -12 * gA + bA) / 11;
332
+ const b = (rA + gA - 2 * bA) / 9;
333
+ const u = (20 * rA + 20 * gA + 21 * bA) / 20;
334
+ const p2 = (40 * rA + 20 * gA + bA) / 20;
335
+ const atan2 = Math.atan2(b, a);
336
+ const atanDegrees = atan2 * 180 / Math.PI;
337
+ const hue = atanDegrees < 0 ? atanDegrees + 360 : atanDegrees >= 360 ? atanDegrees - 360 : atanDegrees;
338
+ const hueRadians = hue * Math.PI / 180;
339
+ const ac = p2 * viewingConditions.nbb;
340
+ const j = 100 * Math.pow(ac / viewingConditions.aw, viewingConditions.c * viewingConditions.z);
341
+ const q = 4 / viewingConditions.c * Math.sqrt(j / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot;
342
+ const huePrime = hue < 20.14 ? hue + 360 : hue;
343
+ const eHue = 0.25 * (Math.cos(huePrime * Math.PI / 180 + 2) + 3.8);
344
+ const p1 = 5e4 / 13 * eHue * viewingConditions.nc * viewingConditions.ncb;
345
+ const t = p1 * Math.sqrt(a * a + b * b) / (u + 0.305);
346
+ const alpha = Math.pow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73);
347
+ const c = alpha * Math.sqrt(j / 100);
348
+ const m = c * viewingConditions.fLRoot;
349
+ const s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4));
350
+ const jstar = (1 + 100 * 7e-3) * j / (1 + 7e-3 * j);
351
+ const mstar = 1 / 0.0228 * Math.log(1 + 0.0228 * m);
352
+ const astar = mstar * Math.cos(hueRadians);
353
+ const bstar = mstar * Math.sin(hueRadians);
354
+ return new Cam16(hue, c, j, q, m, s, jstar, astar, bstar);
355
+ }
356
+ static fromJch(j, c, h) {
357
+ return Cam16.fromJchInViewingConditions(j, c, h, ViewingConditions.DEFAULT);
358
+ }
359
+ static fromJchInViewingConditions(j, c, h, viewingConditions) {
360
+ const q = 4 / viewingConditions.c * Math.sqrt(j / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot;
361
+ const m = c * viewingConditions.fLRoot;
362
+ const alpha = c / Math.sqrt(j / 100);
363
+ const s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4));
364
+ const hueRadians = h * Math.PI / 180;
365
+ const jstar = (1 + 100 * 7e-3) * j / (1 + 7e-3 * j);
366
+ const mstar = 1 / 0.0228 * Math.log(1 + 0.0228 * m);
367
+ const astar = mstar * Math.cos(hueRadians);
368
+ const bstar = mstar * Math.sin(hueRadians);
369
+ return new Cam16(h, c, j, q, m, s, jstar, astar, bstar);
370
+ }
371
+ static fromUcs(jstar, astar, bstar) {
372
+ return Cam16.fromUcsInViewingConditions(jstar, astar, bstar, ViewingConditions.DEFAULT);
373
+ }
374
+ static fromUcsInViewingConditions(jstar, astar, bstar, viewingConditions) {
375
+ const a = astar;
376
+ const b = bstar;
377
+ const m = Math.sqrt(a * a + b * b);
378
+ const M = (Math.exp(m * 0.0228) - 1) / 0.0228;
379
+ const c = M / viewingConditions.fLRoot;
380
+ let h = Math.atan2(b, a) * (180 / Math.PI);
381
+ if (h < 0) {
382
+ h += 360;
383
+ }
384
+ const j = jstar / (1 - (jstar - 100) * 7e-3);
385
+ return Cam16.fromJchInViewingConditions(j, c, h, viewingConditions);
386
+ }
387
+ toInt() {
388
+ return this.viewed(ViewingConditions.DEFAULT);
389
+ }
390
+ viewed(viewingConditions) {
391
+ const alpha = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100);
392
+ const t = Math.pow(alpha / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), 1 / 0.9);
393
+ const hRad = this.hue * Math.PI / 180;
394
+ const eHue = 0.25 * (Math.cos(hRad + 2) + 3.8);
395
+ const ac = viewingConditions.aw * Math.pow(this.j / 100, 1 / viewingConditions.c / viewingConditions.z);
396
+ const p1 = eHue * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb;
397
+ const p2 = ac / viewingConditions.nbb;
398
+ const hSin = Math.sin(hRad);
399
+ const hCos = Math.cos(hRad);
400
+ const gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin);
401
+ const a = gamma * hCos;
402
+ const b = gamma * hSin;
403
+ const rA = (460 * p2 + 451 * a + 288 * b) / 1403;
404
+ const gA = (460 * p2 - 891 * a - 261 * b) / 1403;
405
+ const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;
406
+ const rCBase = Math.max(0, 27.13 * Math.abs(rA) / (400 - Math.abs(rA)));
407
+ const rC = signum(rA) * (100 / viewingConditions.fl) * Math.pow(rCBase, 1 / 0.42);
408
+ const gCBase = Math.max(0, 27.13 * Math.abs(gA) / (400 - Math.abs(gA)));
409
+ const gC = signum(gA) * (100 / viewingConditions.fl) * Math.pow(gCBase, 1 / 0.42);
410
+ const bCBase = Math.max(0, 27.13 * Math.abs(bA) / (400 - Math.abs(bA)));
411
+ const bC = signum(bA) * (100 / viewingConditions.fl) * Math.pow(bCBase, 1 / 0.42);
412
+ const rF = rC / viewingConditions.rgbD[0];
413
+ const gF = gC / viewingConditions.rgbD[1];
414
+ const bF = bC / viewingConditions.rgbD[2];
415
+ const x = 1.86206786 * rF - 1.01125463 * gF + 0.14918677 * bF;
416
+ const y = 0.38752654 * rF + 0.62144744 * gF - 897398e-8 * bF;
417
+ const z = -0.0158415 * rF - 0.03412294 * gF + 1.04996444 * bF;
418
+ const argb = argbFromXyz(x, y, z);
419
+ return argb;
420
+ }
421
+ static fromXyzInViewingConditions(x, y, z, viewingConditions) {
422
+ const rC = 0.401288 * x + 0.650173 * y - 0.051461 * z;
423
+ const gC = -0.250268 * x + 1.204414 * y + 0.045854 * z;
424
+ const bC = -2079e-6 * x + 0.048952 * y + 0.953127 * z;
425
+ const rD = viewingConditions.rgbD[0] * rC;
426
+ const gD = viewingConditions.rgbD[1] * gC;
427
+ const bD = viewingConditions.rgbD[2] * bC;
428
+ const rAF = Math.pow(viewingConditions.fl * Math.abs(rD) / 100, 0.42);
429
+ const gAF = Math.pow(viewingConditions.fl * Math.abs(gD) / 100, 0.42);
430
+ const bAF = Math.pow(viewingConditions.fl * Math.abs(bD) / 100, 0.42);
431
+ const rA = signum(rD) * 400 * rAF / (rAF + 27.13);
432
+ const gA = signum(gD) * 400 * gAF / (gAF + 27.13);
433
+ const bA = signum(bD) * 400 * bAF / (bAF + 27.13);
434
+ const a = (11 * rA + -12 * gA + bA) / 11;
435
+ const b = (rA + gA - 2 * bA) / 9;
436
+ const u = (20 * rA + 20 * gA + 21 * bA) / 20;
437
+ const p2 = (40 * rA + 20 * gA + bA) / 20;
438
+ const atan2 = Math.atan2(b, a);
439
+ const atanDegrees = atan2 * 180 / Math.PI;
440
+ const hue = atanDegrees < 0 ? atanDegrees + 360 : atanDegrees >= 360 ? atanDegrees - 360 : atanDegrees;
441
+ const hueRadians = hue * Math.PI / 180;
442
+ const ac = p2 * viewingConditions.nbb;
443
+ const J = 100 * Math.pow(ac / viewingConditions.aw, viewingConditions.c * viewingConditions.z);
444
+ const Q = 4 / viewingConditions.c * Math.sqrt(J / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot;
445
+ const huePrime = hue < 20.14 ? hue + 360 : hue;
446
+ const eHue = 1 / 4 * (Math.cos(huePrime * Math.PI / 180 + 2) + 3.8);
447
+ const p1 = 5e4 / 13 * eHue * viewingConditions.nc * viewingConditions.ncb;
448
+ const t = p1 * Math.sqrt(a * a + b * b) / (u + 0.305);
449
+ const alpha = Math.pow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73);
450
+ const C = alpha * Math.sqrt(J / 100);
451
+ const M = C * viewingConditions.fLRoot;
452
+ const s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4));
453
+ const jstar = (1 + 100 * 7e-3) * J / (1 + 7e-3 * J);
454
+ const mstar = Math.log(1 + 0.0228 * M) / 0.0228;
455
+ const astar = mstar * Math.cos(hueRadians);
456
+ const bstar = mstar * Math.sin(hueRadians);
457
+ return new Cam16(hue, C, J, Q, M, s, jstar, astar, bstar);
458
+ }
459
+ xyzInViewingConditions(viewingConditions) {
460
+ const alpha = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100);
461
+ const t = Math.pow(alpha / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73), 1 / 0.9);
462
+ const hRad = this.hue * Math.PI / 180;
463
+ const eHue = 0.25 * (Math.cos(hRad + 2) + 3.8);
464
+ const ac = viewingConditions.aw * Math.pow(this.j / 100, 1 / viewingConditions.c / viewingConditions.z);
465
+ const p1 = eHue * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb;
466
+ const p2 = ac / viewingConditions.nbb;
467
+ const hSin = Math.sin(hRad);
468
+ const hCos = Math.cos(hRad);
469
+ const gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin);
470
+ const a = gamma * hCos;
471
+ const b = gamma * hSin;
472
+ const rA = (460 * p2 + 451 * a + 288 * b) / 1403;
473
+ const gA = (460 * p2 - 891 * a - 261 * b) / 1403;
474
+ const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;
475
+ const rCBase = Math.max(0, 27.13 * Math.abs(rA) / (400 - Math.abs(rA)));
476
+ const rC = signum(rA) * (100 / viewingConditions.fl) * Math.pow(rCBase, 1 / 0.42);
477
+ const gCBase = Math.max(0, 27.13 * Math.abs(gA) / (400 - Math.abs(gA)));
478
+ const gC = signum(gA) * (100 / viewingConditions.fl) * Math.pow(gCBase, 1 / 0.42);
479
+ const bCBase = Math.max(0, 27.13 * Math.abs(bA) / (400 - Math.abs(bA)));
480
+ const bC = signum(bA) * (100 / viewingConditions.fl) * Math.pow(bCBase, 1 / 0.42);
481
+ const rF = rC / viewingConditions.rgbD[0];
482
+ const gF = gC / viewingConditions.rgbD[1];
483
+ const bF = bC / viewingConditions.rgbD[2];
484
+ const x = 1.86206786 * rF - 1.01125463 * gF + 0.14918677 * bF;
485
+ const y = 0.38752654 * rF + 0.62144744 * gF - 897398e-8 * bF;
486
+ const z = -0.0158415 * rF - 0.03412294 * gF + 1.04996444 * bF;
487
+ return [x, y, z];
488
+ }
489
+ };
490
+
491
+ // node_modules/@material/material-color-utilities/hct/hct_solver.js
492
+ var HctSolver = class {
493
+ static sanitizeRadians(angle) {
494
+ return (angle + Math.PI * 8) % (Math.PI * 2);
495
+ }
496
+ static trueDelinearized(rgbComponent) {
497
+ const normalized = rgbComponent / 100;
498
+ let delinearized2 = 0;
499
+ if (normalized <= 31308e-7) {
500
+ delinearized2 = normalized * 12.92;
501
+ } else {
502
+ delinearized2 = 1.055 * Math.pow(normalized, 1 / 2.4) - 0.055;
503
+ }
504
+ return delinearized2 * 255;
505
+ }
506
+ static chromaticAdaptation(component) {
507
+ const af = Math.pow(Math.abs(component), 0.42);
508
+ return signum(component) * 400 * af / (af + 27.13);
509
+ }
510
+ static hueOf(linrgb) {
511
+ const scaledDiscount = matrixMultiply(linrgb, HctSolver.SCALED_DISCOUNT_FROM_LINRGB);
512
+ const rA = HctSolver.chromaticAdaptation(scaledDiscount[0]);
513
+ const gA = HctSolver.chromaticAdaptation(scaledDiscount[1]);
514
+ const bA = HctSolver.chromaticAdaptation(scaledDiscount[2]);
515
+ const a = (11 * rA + -12 * gA + bA) / 11;
516
+ const b = (rA + gA - 2 * bA) / 9;
517
+ return Math.atan2(b, a);
518
+ }
519
+ static areInCyclicOrder(a, b, c) {
520
+ const deltaAB = HctSolver.sanitizeRadians(b - a);
521
+ const deltaAC = HctSolver.sanitizeRadians(c - a);
522
+ return deltaAB < deltaAC;
523
+ }
524
+ static intercept(source, mid, target) {
525
+ return (mid - source) / (target - source);
526
+ }
527
+ static lerpPoint(source, t, target) {
528
+ return [
529
+ source[0] + (target[0] - source[0]) * t,
530
+ source[1] + (target[1] - source[1]) * t,
531
+ source[2] + (target[2] - source[2]) * t
532
+ ];
533
+ }
534
+ static setCoordinate(source, coordinate, target, axis) {
535
+ const t = HctSolver.intercept(source[axis], coordinate, target[axis]);
536
+ return HctSolver.lerpPoint(source, t, target);
537
+ }
538
+ static isBounded(x) {
539
+ return 0 <= x && x <= 100;
540
+ }
541
+ static nthVertex(y, n) {
542
+ const kR = HctSolver.Y_FROM_LINRGB[0];
543
+ const kG = HctSolver.Y_FROM_LINRGB[1];
544
+ const kB = HctSolver.Y_FROM_LINRGB[2];
545
+ const coordA = n % 4 <= 1 ? 0 : 100;
546
+ const coordB = n % 2 === 0 ? 0 : 100;
547
+ if (n < 4) {
548
+ const g = coordA;
549
+ const b = coordB;
550
+ const r = (y - g * kG - b * kB) / kR;
551
+ if (HctSolver.isBounded(r)) {
552
+ return [r, g, b];
553
+ } else {
554
+ return [-1, -1, -1];
555
+ }
556
+ } else if (n < 8) {
557
+ const b = coordA;
558
+ const r = coordB;
559
+ const g = (y - r * kR - b * kB) / kG;
560
+ if (HctSolver.isBounded(g)) {
561
+ return [r, g, b];
562
+ } else {
563
+ return [-1, -1, -1];
564
+ }
565
+ } else {
566
+ const r = coordA;
567
+ const g = coordB;
568
+ const b = (y - r * kR - g * kG) / kB;
569
+ if (HctSolver.isBounded(b)) {
570
+ return [r, g, b];
571
+ } else {
572
+ return [-1, -1, -1];
573
+ }
574
+ }
575
+ }
576
+ static bisectToSegment(y, targetHue) {
577
+ let left = [-1, -1, -1];
578
+ let right = left;
579
+ let leftHue = 0;
580
+ let rightHue = 0;
581
+ let initialized = false;
582
+ let uncut = true;
583
+ for (let n = 0; n < 12; n++) {
584
+ const mid = HctSolver.nthVertex(y, n);
585
+ if (mid[0] < 0) {
586
+ continue;
587
+ }
588
+ const midHue = HctSolver.hueOf(mid);
589
+ if (!initialized) {
590
+ left = mid;
591
+ right = mid;
592
+ leftHue = midHue;
593
+ rightHue = midHue;
594
+ initialized = true;
595
+ continue;
596
+ }
597
+ if (uncut || HctSolver.areInCyclicOrder(leftHue, midHue, rightHue)) {
598
+ uncut = false;
599
+ if (HctSolver.areInCyclicOrder(leftHue, targetHue, midHue)) {
600
+ right = mid;
601
+ rightHue = midHue;
602
+ } else {
603
+ left = mid;
604
+ leftHue = midHue;
605
+ }
606
+ }
607
+ }
608
+ return [left, right];
609
+ }
610
+ static midpoint(a, b) {
611
+ return [
612
+ (a[0] + b[0]) / 2,
613
+ (a[1] + b[1]) / 2,
614
+ (a[2] + b[2]) / 2
615
+ ];
616
+ }
617
+ static criticalPlaneBelow(x) {
618
+ return Math.floor(x - 0.5);
619
+ }
620
+ static criticalPlaneAbove(x) {
621
+ return Math.ceil(x - 0.5);
622
+ }
623
+ static bisectToLimit(y, targetHue) {
624
+ const segment = HctSolver.bisectToSegment(y, targetHue);
625
+ let left = segment[0];
626
+ let leftHue = HctSolver.hueOf(left);
627
+ let right = segment[1];
628
+ for (let axis = 0; axis < 3; axis++) {
629
+ if (left[axis] !== right[axis]) {
630
+ let lPlane = -1;
631
+ let rPlane = 255;
632
+ if (left[axis] < right[axis]) {
633
+ lPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(left[axis]));
634
+ rPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(right[axis]));
635
+ } else {
636
+ lPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(left[axis]));
637
+ rPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(right[axis]));
638
+ }
639
+ for (let i = 0; i < 8; i++) {
640
+ if (Math.abs(rPlane - lPlane) <= 1) {
641
+ break;
642
+ } else {
643
+ const mPlane = Math.floor((lPlane + rPlane) / 2);
644
+ const midPlaneCoordinate = HctSolver.CRITICAL_PLANES[mPlane];
645
+ const mid = HctSolver.setCoordinate(left, midPlaneCoordinate, right, axis);
646
+ const midHue = HctSolver.hueOf(mid);
647
+ if (HctSolver.areInCyclicOrder(leftHue, targetHue, midHue)) {
648
+ right = mid;
649
+ rPlane = mPlane;
650
+ } else {
651
+ left = mid;
652
+ leftHue = midHue;
653
+ lPlane = mPlane;
654
+ }
655
+ }
656
+ }
657
+ }
658
+ }
659
+ return HctSolver.midpoint(left, right);
660
+ }
661
+ static inverseChromaticAdaptation(adapted) {
662
+ const adaptedAbs = Math.abs(adapted);
663
+ const base = Math.max(0, 27.13 * adaptedAbs / (400 - adaptedAbs));
664
+ return signum(adapted) * Math.pow(base, 1 / 0.42);
665
+ }
666
+ static findResultByJ(hueRadians, chroma, y) {
667
+ let j = Math.sqrt(y) * 11;
668
+ const viewingConditions = ViewingConditions.DEFAULT;
669
+ const tInnerCoeff = 1 / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73);
670
+ const eHue = 0.25 * (Math.cos(hueRadians + 2) + 3.8);
671
+ const p1 = eHue * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb;
672
+ const hSin = Math.sin(hueRadians);
673
+ const hCos = Math.cos(hueRadians);
674
+ for (let iterationRound = 0; iterationRound < 5; iterationRound++) {
675
+ const jNormalized = j / 100;
676
+ const alpha = chroma === 0 || j === 0 ? 0 : chroma / Math.sqrt(jNormalized);
677
+ const t = Math.pow(alpha * tInnerCoeff, 1 / 0.9);
678
+ const ac = viewingConditions.aw * Math.pow(jNormalized, 1 / viewingConditions.c / viewingConditions.z);
679
+ const p2 = ac / viewingConditions.nbb;
680
+ const gamma = 23 * (p2 + 0.305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin);
681
+ const a = gamma * hCos;
682
+ const b = gamma * hSin;
683
+ const rA = (460 * p2 + 451 * a + 288 * b) / 1403;
684
+ const gA = (460 * p2 - 891 * a - 261 * b) / 1403;
685
+ const bA = (460 * p2 - 220 * a - 6300 * b) / 1403;
686
+ const rCScaled = HctSolver.inverseChromaticAdaptation(rA);
687
+ const gCScaled = HctSolver.inverseChromaticAdaptation(gA);
688
+ const bCScaled = HctSolver.inverseChromaticAdaptation(bA);
689
+ const linrgb = matrixMultiply([rCScaled, gCScaled, bCScaled], HctSolver.LINRGB_FROM_SCALED_DISCOUNT);
690
+ if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0) {
691
+ return 0;
692
+ }
693
+ const kR = HctSolver.Y_FROM_LINRGB[0];
694
+ const kG = HctSolver.Y_FROM_LINRGB[1];
695
+ const kB = HctSolver.Y_FROM_LINRGB[2];
696
+ const fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];
697
+ if (fnj <= 0) {
698
+ return 0;
699
+ }
700
+ if (iterationRound === 4 || Math.abs(fnj - y) < 2e-3) {
701
+ if (linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01) {
702
+ return 0;
703
+ }
704
+ return argbFromLinrgb(linrgb);
705
+ }
706
+ j = j - (fnj - y) * j / (2 * fnj);
707
+ }
708
+ return 0;
709
+ }
710
+ static solveToInt(hueDegrees, chroma, lstar) {
711
+ if (chroma < 1e-4 || lstar < 1e-4 || lstar > 99.9999) {
712
+ return argbFromLstar(lstar);
713
+ }
714
+ hueDegrees = sanitizeDegreesDouble(hueDegrees);
715
+ const hueRadians = hueDegrees / 180 * Math.PI;
716
+ const y = yFromLstar(lstar);
717
+ const exactAnswer = HctSolver.findResultByJ(hueRadians, chroma, y);
718
+ if (exactAnswer !== 0) {
719
+ return exactAnswer;
720
+ }
721
+ const linrgb = HctSolver.bisectToLimit(y, hueRadians);
722
+ return argbFromLinrgb(linrgb);
723
+ }
724
+ static solveToCam(hueDegrees, chroma, lstar) {
725
+ return Cam16.fromInt(HctSolver.solveToInt(hueDegrees, chroma, lstar));
726
+ }
727
+ };
728
+ HctSolver.SCALED_DISCOUNT_FROM_LINRGB = [
729
+ [
730
+ 0.001200833568784504,
731
+ 0.002389694492170889,
732
+ 2795742885861124e-19
733
+ ],
734
+ [
735
+ 5891086651375999e-19,
736
+ 0.0029785502573438758,
737
+ 3270666104008398e-19
738
+ ],
739
+ [
740
+ 10146692491640572e-20,
741
+ 5364214359186694e-19,
742
+ 0.0032979401770712076
743
+ ]
744
+ ];
745
+ HctSolver.LINRGB_FROM_SCALED_DISCOUNT = [
746
+ [
747
+ 1373.2198709594231,
748
+ -1100.4251190754821,
749
+ -7.278681089101213
750
+ ],
751
+ [
752
+ -271.815969077903,
753
+ 559.6580465940733,
754
+ -32.46047482791194
755
+ ],
756
+ [
757
+ 1.9622899599665666,
758
+ -57.173814538844006,
759
+ 308.7233197812385
760
+ ]
761
+ ];
762
+ HctSolver.Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722];
763
+ HctSolver.CRITICAL_PLANES = [
764
+ 0.015176349177441876,
765
+ 0.045529047532325624,
766
+ 0.07588174588720938,
767
+ 0.10623444424209313,
768
+ 0.13658714259697685,
769
+ 0.16693984095186062,
770
+ 0.19729253930674434,
771
+ 0.2276452376616281,
772
+ 0.2579979360165119,
773
+ 0.28835063437139563,
774
+ 0.3188300904430532,
775
+ 0.350925934958123,
776
+ 0.3848314933096426,
777
+ 0.42057480301049466,
778
+ 0.458183274052838,
779
+ 0.4976837250274023,
780
+ 0.5391024159806381,
781
+ 0.5824650784040898,
782
+ 0.6277969426914107,
783
+ 0.6751227633498623,
784
+ 0.7244668422128921,
785
+ 0.775853049866786,
786
+ 0.829304845476233,
787
+ 0.8848452951698498,
788
+ 0.942497089126609,
789
+ 1.0022825574869039,
790
+ 1.0642236851973577,
791
+ 1.1283421258858297,
792
+ 1.1946592148522128,
793
+ 1.2631959812511864,
794
+ 1.3339731595349034,
795
+ 1.407011200216447,
796
+ 1.4823302800086415,
797
+ 1.5599503113873272,
798
+ 1.6398909516233677,
799
+ 1.7221716113234105,
800
+ 1.8068114625156377,
801
+ 1.8938294463134073,
802
+ 1.9832442801866852,
803
+ 2.075074464868551,
804
+ 2.1693382909216234,
805
+ 2.2660538449872063,
806
+ 2.36523901573795,
807
+ 2.4669114995532007,
808
+ 2.5710888059345764,
809
+ 2.6777882626779785,
810
+ 2.7870270208169257,
811
+ 2.898822059350997,
812
+ 3.0131901897720907,
813
+ 3.1301480604002863,
814
+ 3.2497121605402226,
815
+ 3.3718988244681087,
816
+ 3.4967242352587946,
817
+ 3.624204428461639,
818
+ 3.754355295633311,
819
+ 3.887192587735158,
820
+ 4.022731918402185,
821
+ 4.160988767090289,
822
+ 4.301978482107941,
823
+ 4.445716283538092,
824
+ 4.592217266055746,
825
+ 4.741496401646282,
826
+ 4.893568542229298,
827
+ 5.048448422192488,
828
+ 5.20615066083972,
829
+ 5.3666897647573375,
830
+ 5.5300801301023865,
831
+ 5.696336044816294,
832
+ 5.865471690767354,
833
+ 6.037501145825082,
834
+ 6.212438385869475,
835
+ 6.390297286737924,
836
+ 6.571091626112461,
837
+ 6.7548350853498045,
838
+ 6.941541251256611,
839
+ 7.131223617812143,
840
+ 7.323895587840543,
841
+ 7.5195704746346665,
842
+ 7.7182615035334345,
843
+ 7.919981813454504,
844
+ 8.124744458384042,
845
+ 8.332562408825165,
846
+ 8.543448553206703,
847
+ 8.757415699253682,
848
+ 8.974476575321063,
849
+ 9.194643831691977,
850
+ 9.417930041841839,
851
+ 9.644347703669503,
852
+ 9.873909240696694,
853
+ 10.106627003236781,
854
+ 10.342513269534024,
855
+ 10.58158024687427,
856
+ 10.8238400726681,
857
+ 11.069304815507364,
858
+ 11.317986476196008,
859
+ 11.569896988756009,
860
+ 11.825048221409341,
861
+ 12.083451977536606,
862
+ 12.345119996613247,
863
+ 12.610063955123938,
864
+ 12.878295467455942,
865
+ 13.149826086772048,
866
+ 13.42466730586372,
867
+ 13.702830557985108,
868
+ 13.984327217668513,
869
+ 14.269168601521828,
870
+ 14.55736596900856,
871
+ 14.848930523210871,
872
+ 15.143873411576273,
873
+ 15.44220572664832,
874
+ 15.743938506781891,
875
+ 16.04908273684337,
876
+ 16.35764934889634,
877
+ 16.66964922287304,
878
+ 16.985093187232053,
879
+ 17.30399201960269,
880
+ 17.62635644741625,
881
+ 17.95219714852476,
882
+ 18.281524751807332,
883
+ 18.614349837764564,
884
+ 18.95068293910138,
885
+ 19.290534541298456,
886
+ 19.633915083172692,
887
+ 19.98083495742689,
888
+ 20.331304511189067,
889
+ 20.685334046541502,
890
+ 21.042933821039977,
891
+ 21.404114048223256,
892
+ 21.76888489811322,
893
+ 22.137256497705877,
894
+ 22.50923893145328,
895
+ 22.884842241736916,
896
+ 23.264076429332462,
897
+ 23.6469514538663,
898
+ 24.033477234264016,
899
+ 24.42366364919083,
900
+ 24.817520537484558,
901
+ 25.21505769858089,
902
+ 25.61628489293138,
903
+ 26.021211842414342,
904
+ 26.429848230738664,
905
+ 26.842203703840827,
906
+ 27.258287870275353,
907
+ 27.678110301598522,
908
+ 28.10168053274597,
909
+ 28.529008062403893,
910
+ 28.96010235337422,
911
+ 29.39497283293396,
912
+ 29.83362889318845,
913
+ 30.276079891419332,
914
+ 30.722335150426627,
915
+ 31.172403958865512,
916
+ 31.62629557157785,
917
+ 32.08401920991837,
918
+ 32.54558406207592,
919
+ 33.010999283389665,
920
+ 33.4802739966603,
921
+ 33.953417292456834,
922
+ 34.430438229418264,
923
+ 34.911345834551085,
924
+ 35.39614910352207,
925
+ 35.88485700094671,
926
+ 36.37747846067349,
927
+ 36.87402238606382,
928
+ 37.37449765026789,
929
+ 37.87891309649659,
930
+ 38.38727753828926,
931
+ 38.89959975977785,
932
+ 39.41588851594697,
933
+ 39.93615253289054,
934
+ 40.460400508064545,
935
+ 40.98864111053629,
936
+ 41.520882981230194,
937
+ 42.05713473317016,
938
+ 42.597404951718396,
939
+ 43.141702194811224,
940
+ 43.6900349931913,
941
+ 44.24241185063697,
942
+ 44.798841244188324,
943
+ 45.35933162437017,
944
+ 45.92389141541209,
945
+ 46.49252901546552,
946
+ 47.065252796817916,
947
+ 47.64207110610409,
948
+ 48.22299226451468,
949
+ 48.808024568002054,
950
+ 49.3971762874833,
951
+ 49.9904556690408,
952
+ 50.587870934119984,
953
+ 51.189430279724725,
954
+ 51.79514187861014,
955
+ 52.40501387947288,
956
+ 53.0190544071392,
957
+ 53.637271562750364,
958
+ 54.259673423945976,
959
+ 54.88626804504493,
960
+ 55.517063457223934,
961
+ 56.15206766869424,
962
+ 56.79128866487574,
963
+ 57.43473440856916,
964
+ 58.08241284012621,
965
+ 58.734331877617365,
966
+ 59.39049941699807,
967
+ 60.05092333227251,
968
+ 60.715611475655585,
969
+ 61.38457167773311,
970
+ 62.057811747619894,
971
+ 62.7353394731159,
972
+ 63.417162620860914,
973
+ 64.10328893648692,
974
+ 64.79372614476921,
975
+ 65.48848194977529,
976
+ 66.18756403501224,
977
+ 66.89098006357258,
978
+ 67.59873767827808,
979
+ 68.31084450182222,
980
+ 69.02730813691093,
981
+ 69.74813616640164,
982
+ 70.47333615344107,
983
+ 71.20291564160104,
984
+ 71.93688215501312,
985
+ 72.67524319850172,
986
+ 73.41800625771542,
987
+ 74.16517879925733,
988
+ 74.9167682708136,
989
+ 75.67278210128072,
990
+ 76.43322770089146,
991
+ 77.1981124613393,
992
+ 77.96744375590167,
993
+ 78.74122893956174,
994
+ 79.51947534912904,
995
+ 80.30219030335869,
996
+ 81.08938110306934,
997
+ 81.88105503125999,
998
+ 82.67721935322541,
999
+ 83.4778813166706,
1000
+ 84.28304815182372,
1001
+ 85.09272707154808,
1002
+ 85.90692527145302,
1003
+ 86.72564993000343,
1004
+ 87.54890820862819,
1005
+ 88.3767072518277,
1006
+ 89.2090541872801,
1007
+ 90.04595612594655,
1008
+ 90.88742016217518,
1009
+ 91.73345337380438,
1010
+ 92.58406282226491,
1011
+ 93.43925555268066,
1012
+ 94.29903859396902,
1013
+ 95.16341895893969,
1014
+ 96.03240364439274,
1015
+ 96.9059996312159,
1016
+ 97.78421388448044,
1017
+ 98.6670533535366,
1018
+ 99.55452497210776
1019
+ ];
1020
+
1021
+ // node_modules/@material/material-color-utilities/hct/hct.js
1022
+ var Hct = class {
1023
+ static from(hue, chroma, tone) {
1024
+ return new Hct(HctSolver.solveToInt(hue, chroma, tone));
1025
+ }
1026
+ static fromInt(argb) {
1027
+ return new Hct(argb);
1028
+ }
1029
+ toInt() {
1030
+ return this.argb;
1031
+ }
1032
+ get hue() {
1033
+ return this.internalHue;
1034
+ }
1035
+ set hue(newHue) {
1036
+ this.setInternalState(HctSolver.solveToInt(newHue, this.internalChroma, this.internalTone));
1037
+ }
1038
+ get chroma() {
1039
+ return this.internalChroma;
1040
+ }
1041
+ set chroma(newChroma) {
1042
+ this.setInternalState(HctSolver.solveToInt(this.internalHue, newChroma, this.internalTone));
1043
+ }
1044
+ get tone() {
1045
+ return this.internalTone;
1046
+ }
1047
+ set tone(newTone) {
1048
+ this.setInternalState(HctSolver.solveToInt(this.internalHue, this.internalChroma, newTone));
1049
+ }
1050
+ constructor(argb) {
1051
+ this.argb = argb;
1052
+ const cam = Cam16.fromInt(argb);
1053
+ this.internalHue = cam.hue;
1054
+ this.internalChroma = cam.chroma;
1055
+ this.internalTone = lstarFromArgb(argb);
1056
+ this.argb = argb;
1057
+ }
1058
+ setInternalState(argb) {
1059
+ const cam = Cam16.fromInt(argb);
1060
+ this.internalHue = cam.hue;
1061
+ this.internalChroma = cam.chroma;
1062
+ this.internalTone = lstarFromArgb(argb);
1063
+ this.argb = argb;
1064
+ }
1065
+ inViewingConditions(vc) {
1066
+ const cam = Cam16.fromInt(this.toInt());
1067
+ const viewedInVc = cam.xyzInViewingConditions(vc);
1068
+ const recastInVc = Cam16.fromXyzInViewingConditions(viewedInVc[0], viewedInVc[1], viewedInVc[2], ViewingConditions.make());
1069
+ const recastHct = Hct.from(recastInVc.hue, recastInVc.chroma, lstarFromY(viewedInVc[1]));
1070
+ return recastHct;
1071
+ }
1072
+ };
1073
+
1074
+ // node_modules/@material/material-color-utilities/blend/blend.js
1075
+ var Blend = class {
1076
+ static harmonize(designColor, sourceColor) {
1077
+ const fromHct = Hct.fromInt(designColor);
1078
+ const toHct = Hct.fromInt(sourceColor);
1079
+ const differenceDegrees2 = differenceDegrees(fromHct.hue, toHct.hue);
1080
+ const rotationDegrees = Math.min(differenceDegrees2 * 0.5, 15);
1081
+ const outputHue = sanitizeDegreesDouble(fromHct.hue + rotationDegrees * rotationDirection(fromHct.hue, toHct.hue));
1082
+ return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();
1083
+ }
1084
+ static hctHue(from, to, amount) {
1085
+ const ucs = Blend.cam16Ucs(from, to, amount);
1086
+ const ucsCam = Cam16.fromInt(ucs);
1087
+ const fromCam = Cam16.fromInt(from);
1088
+ const blended = Hct.from(ucsCam.hue, fromCam.chroma, lstarFromArgb(from));
1089
+ return blended.toInt();
1090
+ }
1091
+ static cam16Ucs(from, to, amount) {
1092
+ const fromCam = Cam16.fromInt(from);
1093
+ const toCam = Cam16.fromInt(to);
1094
+ const fromJ = fromCam.jstar;
1095
+ const fromA = fromCam.astar;
1096
+ const fromB = fromCam.bstar;
1097
+ const toJ = toCam.jstar;
1098
+ const toA = toCam.astar;
1099
+ const toB = toCam.bstar;
1100
+ const jstar = fromJ + (toJ - fromJ) * amount;
1101
+ const astar = fromA + (toA - fromA) * amount;
1102
+ const bstar = fromB + (toB - fromB) * amount;
1103
+ return Cam16.fromUcs(jstar, astar, bstar).toInt();
1104
+ }
1105
+ };
1106
+
1107
+ // node_modules/@material/material-color-utilities/contrast/contrast.js
1108
+ var Contrast = class {
1109
+ static ratioOfTones(toneA, toneB) {
1110
+ toneA = clampDouble(0, 100, toneA);
1111
+ toneB = clampDouble(0, 100, toneB);
1112
+ return Contrast.ratioOfYs(yFromLstar(toneA), yFromLstar(toneB));
1113
+ }
1114
+ static ratioOfYs(y1, y2) {
1115
+ const lighter = y1 > y2 ? y1 : y2;
1116
+ const darker = lighter === y2 ? y1 : y2;
1117
+ return (lighter + 5) / (darker + 5);
1118
+ }
1119
+ static lighter(tone, ratio) {
1120
+ if (tone < 0 || tone > 100) {
1121
+ return -1;
1122
+ }
1123
+ const darkY = yFromLstar(tone);
1124
+ const lightY = ratio * (darkY + 5) - 5;
1125
+ const realContrast = Contrast.ratioOfYs(lightY, darkY);
1126
+ const delta = Math.abs(realContrast - ratio);
1127
+ if (realContrast < ratio && delta > 0.04) {
1128
+ return -1;
1129
+ }
1130
+ const returnValue = lstarFromY(lightY) + 0.4;
1131
+ if (returnValue < 0 || returnValue > 100) {
1132
+ return -1;
1133
+ }
1134
+ return returnValue;
1135
+ }
1136
+ static darker(tone, ratio) {
1137
+ if (tone < 0 || tone > 100) {
1138
+ return -1;
1139
+ }
1140
+ const lightY = yFromLstar(tone);
1141
+ const darkY = (lightY + 5) / ratio - 5;
1142
+ const realContrast = Contrast.ratioOfYs(lightY, darkY);
1143
+ const delta = Math.abs(realContrast - ratio);
1144
+ if (realContrast < ratio && delta > 0.04) {
1145
+ return -1;
1146
+ }
1147
+ const returnValue = lstarFromY(darkY) - 0.4;
1148
+ if (returnValue < 0 || returnValue > 100) {
1149
+ return -1;
1150
+ }
1151
+ return returnValue;
1152
+ }
1153
+ static lighterUnsafe(tone, ratio) {
1154
+ const lighterSafe = Contrast.lighter(tone, ratio);
1155
+ return lighterSafe < 0 ? 100 : lighterSafe;
1156
+ }
1157
+ static darkerUnsafe(tone, ratio) {
1158
+ const darkerSafe = Contrast.darker(tone, ratio);
1159
+ return darkerSafe < 0 ? 0 : darkerSafe;
1160
+ }
1161
+ };
1162
+
1163
+ // node_modules/@material/material-color-utilities/dislike/dislike_analyzer.js
1164
+ var DislikeAnalyzer = class {
1165
+ static isDisliked(hct) {
1166
+ const huePasses = Math.round(hct.hue) >= 90 && Math.round(hct.hue) <= 111;
1167
+ const chromaPasses = Math.round(hct.chroma) > 16;
1168
+ const tonePasses = Math.round(hct.tone) < 65;
1169
+ return huePasses && chromaPasses && tonePasses;
1170
+ }
1171
+ static fixIfDisliked(hct) {
1172
+ if (DislikeAnalyzer.isDisliked(hct)) {
1173
+ return Hct.from(hct.hue, hct.chroma, 70);
1174
+ }
1175
+ return hct;
1176
+ }
1177
+ };
1178
+
1179
+ // node_modules/@material/material-color-utilities/dynamiccolor/dynamic_color.js
1180
+ var DynamicColor = class {
1181
+ static fromPalette(args) {
1182
+ var _a, _b;
1183
+ return new DynamicColor((_a = args.name) != null ? _a : "", args.palette, args.tone, (_b = args.isBackground) != null ? _b : false, args.background, args.secondBackground, args.contrastCurve, args.toneDeltaPair);
1184
+ }
1185
+ constructor(name, palette, tone, isBackground, background, secondBackground, contrastCurve, toneDeltaPair) {
1186
+ this.name = name;
1187
+ this.palette = palette;
1188
+ this.tone = tone;
1189
+ this.isBackground = isBackground;
1190
+ this.background = background;
1191
+ this.secondBackground = secondBackground;
1192
+ this.contrastCurve = contrastCurve;
1193
+ this.toneDeltaPair = toneDeltaPair;
1194
+ this.hctCache = /* @__PURE__ */ new Map();
1195
+ if (!background && secondBackground) {
1196
+ throw new Error(`Color ${name} has secondBackgrounddefined, but background is not defined.`);
1197
+ }
1198
+ if (!background && contrastCurve) {
1199
+ throw new Error(`Color ${name} has contrastCurvedefined, but background is not defined.`);
1200
+ }
1201
+ if (background && !contrastCurve) {
1202
+ throw new Error(`Color ${name} has backgrounddefined, but contrastCurve is not defined.`);
1203
+ }
1204
+ }
1205
+ getArgb(scheme) {
1206
+ return this.getHct(scheme).toInt();
1207
+ }
1208
+ getHct(scheme) {
1209
+ const cachedAnswer = this.hctCache.get(scheme);
1210
+ if (cachedAnswer != null) {
1211
+ return cachedAnswer;
1212
+ }
1213
+ const tone = this.getTone(scheme);
1214
+ const answer = this.palette(scheme).getHct(tone);
1215
+ if (this.hctCache.size > 4) {
1216
+ this.hctCache.clear();
1217
+ }
1218
+ this.hctCache.set(scheme, answer);
1219
+ return answer;
1220
+ }
1221
+ getTone(scheme) {
1222
+ const decreasingContrast = scheme.contrastLevel < 0;
1223
+ if (this.toneDeltaPair) {
1224
+ const toneDeltaPair = this.toneDeltaPair(scheme);
1225
+ const roleA = toneDeltaPair.roleA;
1226
+ const roleB = toneDeltaPair.roleB;
1227
+ const delta = toneDeltaPair.delta;
1228
+ const polarity = toneDeltaPair.polarity;
1229
+ const stayTogether = toneDeltaPair.stayTogether;
1230
+ const bg = this.background(scheme);
1231
+ const bgTone = bg.getTone(scheme);
1232
+ const aIsNearer = polarity === "nearer" || polarity === "lighter" && !scheme.isDark || polarity === "darker" && scheme.isDark;
1233
+ const nearer = aIsNearer ? roleA : roleB;
1234
+ const farther = aIsNearer ? roleB : roleA;
1235
+ const amNearer = this.name === nearer.name;
1236
+ const expansionDir = scheme.isDark ? 1 : -1;
1237
+ const nContrast = nearer.contrastCurve.getContrast(scheme.contrastLevel);
1238
+ const fContrast = farther.contrastCurve.getContrast(scheme.contrastLevel);
1239
+ const nInitialTone = nearer.tone(scheme);
1240
+ let nTone = Contrast.ratioOfTones(bgTone, nInitialTone) >= nContrast ? nInitialTone : DynamicColor.foregroundTone(bgTone, nContrast);
1241
+ const fInitialTone = farther.tone(scheme);
1242
+ let fTone = Contrast.ratioOfTones(bgTone, fInitialTone) >= fContrast ? fInitialTone : DynamicColor.foregroundTone(bgTone, fContrast);
1243
+ if (decreasingContrast) {
1244
+ nTone = DynamicColor.foregroundTone(bgTone, nContrast);
1245
+ fTone = DynamicColor.foregroundTone(bgTone, fContrast);
1246
+ }
1247
+ if ((fTone - nTone) * expansionDir >= delta) {
1248
+ } else {
1249
+ fTone = clampDouble(0, 100, nTone + delta * expansionDir);
1250
+ if ((fTone - nTone) * expansionDir >= delta) {
1251
+ } else {
1252
+ nTone = clampDouble(0, 100, fTone - delta * expansionDir);
1253
+ }
1254
+ }
1255
+ if (50 <= nTone && nTone < 60) {
1256
+ if (expansionDir > 0) {
1257
+ nTone = 60;
1258
+ fTone = Math.max(fTone, nTone + delta * expansionDir);
1259
+ } else {
1260
+ nTone = 49;
1261
+ fTone = Math.min(fTone, nTone + delta * expansionDir);
1262
+ }
1263
+ } else if (50 <= fTone && fTone < 60) {
1264
+ if (stayTogether) {
1265
+ if (expansionDir > 0) {
1266
+ nTone = 60;
1267
+ fTone = Math.max(fTone, nTone + delta * expansionDir);
1268
+ } else {
1269
+ nTone = 49;
1270
+ fTone = Math.min(fTone, nTone + delta * expansionDir);
1271
+ }
1272
+ } else {
1273
+ if (expansionDir > 0) {
1274
+ fTone = 60;
1275
+ } else {
1276
+ fTone = 49;
1277
+ }
1278
+ }
1279
+ }
1280
+ return amNearer ? nTone : fTone;
1281
+ } else {
1282
+ let answer = this.tone(scheme);
1283
+ if (this.background == null) {
1284
+ return answer;
1285
+ }
1286
+ const bgTone = this.background(scheme).getTone(scheme);
1287
+ const desiredRatio = this.contrastCurve.getContrast(scheme.contrastLevel);
1288
+ if (Contrast.ratioOfTones(bgTone, answer) >= desiredRatio) {
1289
+ } else {
1290
+ answer = DynamicColor.foregroundTone(bgTone, desiredRatio);
1291
+ }
1292
+ if (decreasingContrast) {
1293
+ answer = DynamicColor.foregroundTone(bgTone, desiredRatio);
1294
+ }
1295
+ if (this.isBackground && 50 <= answer && answer < 60) {
1296
+ if (Contrast.ratioOfTones(49, bgTone) >= desiredRatio) {
1297
+ answer = 49;
1298
+ } else {
1299
+ answer = 60;
1300
+ }
1301
+ }
1302
+ if (this.secondBackground) {
1303
+ const [bg1, bg2] = [this.background, this.secondBackground];
1304
+ const [bgTone1, bgTone2] = [bg1(scheme).getTone(scheme), bg2(scheme).getTone(scheme)];
1305
+ const [upper, lower] = [Math.max(bgTone1, bgTone2), Math.min(bgTone1, bgTone2)];
1306
+ if (Contrast.ratioOfTones(upper, answer) >= desiredRatio && Contrast.ratioOfTones(lower, answer) >= desiredRatio) {
1307
+ return answer;
1308
+ }
1309
+ const lightOption = Contrast.lighter(upper, desiredRatio);
1310
+ const darkOption = Contrast.darker(lower, desiredRatio);
1311
+ const availables = [];
1312
+ if (lightOption !== -1)
1313
+ availables.push(lightOption);
1314
+ if (darkOption !== -1)
1315
+ availables.push(darkOption);
1316
+ const prefersLight = DynamicColor.tonePrefersLightForeground(bgTone1) || DynamicColor.tonePrefersLightForeground(bgTone2);
1317
+ if (prefersLight) {
1318
+ return lightOption < 0 ? 100 : lightOption;
1319
+ }
1320
+ if (availables.length === 1) {
1321
+ return availables[0];
1322
+ }
1323
+ return darkOption < 0 ? 0 : darkOption;
1324
+ }
1325
+ return answer;
1326
+ }
1327
+ }
1328
+ static foregroundTone(bgTone, ratio) {
1329
+ const lighterTone = Contrast.lighterUnsafe(bgTone, ratio);
1330
+ const darkerTone = Contrast.darkerUnsafe(bgTone, ratio);
1331
+ const lighterRatio = Contrast.ratioOfTones(lighterTone, bgTone);
1332
+ const darkerRatio = Contrast.ratioOfTones(darkerTone, bgTone);
1333
+ const preferLighter = DynamicColor.tonePrefersLightForeground(bgTone);
1334
+ if (preferLighter) {
1335
+ const negligibleDifference = Math.abs(lighterRatio - darkerRatio) < 0.1 && lighterRatio < ratio && darkerRatio < ratio;
1336
+ return lighterRatio >= ratio || lighterRatio >= darkerRatio || negligibleDifference ? lighterTone : darkerTone;
1337
+ } else {
1338
+ return darkerRatio >= ratio || darkerRatio >= lighterRatio ? darkerTone : lighterTone;
1339
+ }
1340
+ }
1341
+ static tonePrefersLightForeground(tone) {
1342
+ return Math.round(tone) < 60;
1343
+ }
1344
+ static toneAllowsLightForeground(tone) {
1345
+ return Math.round(tone) <= 49;
1346
+ }
1347
+ static enableLightForeground(tone) {
1348
+ if (DynamicColor.tonePrefersLightForeground(tone) && !DynamicColor.toneAllowsLightForeground(tone)) {
1349
+ return 49;
1350
+ }
1351
+ return tone;
1352
+ }
1353
+ };
1354
+
1355
+ // node_modules/@material/material-color-utilities/scheme/variant.js
1356
+ var Variant;
1357
+ (function(Variant2) {
1358
+ Variant2[Variant2["MONOCHROME"] = 0] = "MONOCHROME";
1359
+ Variant2[Variant2["NEUTRAL"] = 1] = "NEUTRAL";
1360
+ Variant2[Variant2["TONAL_SPOT"] = 2] = "TONAL_SPOT";
1361
+ Variant2[Variant2["VIBRANT"] = 3] = "VIBRANT";
1362
+ Variant2[Variant2["EXPRESSIVE"] = 4] = "EXPRESSIVE";
1363
+ Variant2[Variant2["FIDELITY"] = 5] = "FIDELITY";
1364
+ Variant2[Variant2["CONTENT"] = 6] = "CONTENT";
1365
+ Variant2[Variant2["RAINBOW"] = 7] = "RAINBOW";
1366
+ Variant2[Variant2["FRUIT_SALAD"] = 8] = "FRUIT_SALAD";
1367
+ })(Variant || (Variant = {}));
1368
+
1369
+ // node_modules/@material/material-color-utilities/dynamiccolor/contrast_curve.js
1370
+ var ContrastCurve = class {
1371
+ constructor(low, normal, medium, high) {
1372
+ this.low = low;
1373
+ this.normal = normal;
1374
+ this.medium = medium;
1375
+ this.high = high;
1376
+ }
1377
+ getContrast(contrastLevel) {
1378
+ if (contrastLevel <= -1) {
1379
+ return this.low;
1380
+ } else if (contrastLevel < 0) {
1381
+ return lerp(this.low, this.normal, (contrastLevel - -1) / 1);
1382
+ } else if (contrastLevel < 0.5) {
1383
+ return lerp(this.normal, this.medium, (contrastLevel - 0) / 0.5);
1384
+ } else if (contrastLevel < 1) {
1385
+ return lerp(this.medium, this.high, (contrastLevel - 0.5) / 0.5);
1386
+ } else {
1387
+ return this.high;
1388
+ }
1389
+ }
1390
+ };
1391
+
1392
+ // node_modules/@material/material-color-utilities/dynamiccolor/tone_delta_pair.js
1393
+ var ToneDeltaPair = class {
1394
+ constructor(roleA, roleB, delta, polarity, stayTogether) {
1395
+ this.roleA = roleA;
1396
+ this.roleB = roleB;
1397
+ this.delta = delta;
1398
+ this.polarity = polarity;
1399
+ this.stayTogether = stayTogether;
1400
+ }
1401
+ };
1402
+
1403
+ // node_modules/@material/material-color-utilities/dynamiccolor/material_dynamic_colors.js
1404
+ function isFidelity(scheme) {
1405
+ return scheme.variant === Variant.FIDELITY || scheme.variant === Variant.CONTENT;
1406
+ }
1407
+ function isMonochrome(scheme) {
1408
+ return scheme.variant === Variant.MONOCHROME;
1409
+ }
1410
+ function findDesiredChromaByTone(hue, chroma, tone, byDecreasingTone) {
1411
+ let answer = tone;
1412
+ let closestToChroma = Hct.from(hue, chroma, tone);
1413
+ if (closestToChroma.chroma < chroma) {
1414
+ let chromaPeak = closestToChroma.chroma;
1415
+ while (closestToChroma.chroma < chroma) {
1416
+ answer += byDecreasingTone ? -1 : 1;
1417
+ const potentialSolution = Hct.from(hue, chroma, answer);
1418
+ if (chromaPeak > potentialSolution.chroma) {
1419
+ break;
1420
+ }
1421
+ if (Math.abs(potentialSolution.chroma - chroma) < 0.4) {
1422
+ break;
1423
+ }
1424
+ const potentialDelta = Math.abs(potentialSolution.chroma - chroma);
1425
+ const currentDelta = Math.abs(closestToChroma.chroma - chroma);
1426
+ if (potentialDelta < currentDelta) {
1427
+ closestToChroma = potentialSolution;
1428
+ }
1429
+ chromaPeak = Math.max(chromaPeak, potentialSolution.chroma);
1430
+ }
1431
+ }
1432
+ return answer;
1433
+ }
1434
+ function viewingConditionsForAlbers(scheme) {
1435
+ return ViewingConditions.make(
1436
+ void 0,
1437
+ void 0,
1438
+ scheme.isDark ? 30 : 80,
1439
+ void 0,
1440
+ void 0
1441
+ );
1442
+ }
1443
+ function performAlbers(prealbers, scheme) {
1444
+ const albersd = prealbers.inViewingConditions(viewingConditionsForAlbers(scheme));
1445
+ if (DynamicColor.tonePrefersLightForeground(prealbers.tone) && !DynamicColor.toneAllowsLightForeground(albersd.tone)) {
1446
+ return DynamicColor.enableLightForeground(prealbers.tone);
1447
+ } else {
1448
+ return DynamicColor.enableLightForeground(albersd.tone);
1449
+ }
1450
+ }
1451
+ var MaterialDynamicColors = class {
1452
+ static highestSurface(s) {
1453
+ return s.isDark ? MaterialDynamicColors.surfaceBright : MaterialDynamicColors.surfaceDim;
1454
+ }
1455
+ };
1456
+ MaterialDynamicColors.contentAccentToneDelta = 15;
1457
+ MaterialDynamicColors.primaryPaletteKeyColor = DynamicColor.fromPalette({
1458
+ name: "primary_palette_key_color",
1459
+ palette: (s) => s.primaryPalette,
1460
+ tone: (s) => s.primaryPalette.keyColor.tone
1461
+ });
1462
+ MaterialDynamicColors.secondaryPaletteKeyColor = DynamicColor.fromPalette({
1463
+ name: "secondary_palette_key_color",
1464
+ palette: (s) => s.secondaryPalette,
1465
+ tone: (s) => s.secondaryPalette.keyColor.tone
1466
+ });
1467
+ MaterialDynamicColors.tertiaryPaletteKeyColor = DynamicColor.fromPalette({
1468
+ name: "tertiary_palette_key_color",
1469
+ palette: (s) => s.tertiaryPalette,
1470
+ tone: (s) => s.tertiaryPalette.keyColor.tone
1471
+ });
1472
+ MaterialDynamicColors.neutralPaletteKeyColor = DynamicColor.fromPalette({
1473
+ name: "neutral_palette_key_color",
1474
+ palette: (s) => s.neutralPalette,
1475
+ tone: (s) => s.neutralPalette.keyColor.tone
1476
+ });
1477
+ MaterialDynamicColors.neutralVariantPaletteKeyColor = DynamicColor.fromPalette({
1478
+ name: "neutral_variant_palette_key_color",
1479
+ palette: (s) => s.neutralVariantPalette,
1480
+ tone: (s) => s.neutralVariantPalette.keyColor.tone
1481
+ });
1482
+ MaterialDynamicColors.background = DynamicColor.fromPalette({
1483
+ name: "background",
1484
+ palette: (s) => s.neutralPalette,
1485
+ tone: (s) => s.isDark ? 6 : 98,
1486
+ isBackground: true
1487
+ });
1488
+ MaterialDynamicColors.onBackground = DynamicColor.fromPalette({
1489
+ name: "on_background",
1490
+ palette: (s) => s.neutralPalette,
1491
+ tone: (s) => s.isDark ? 90 : 10,
1492
+ background: (s) => MaterialDynamicColors.background,
1493
+ contrastCurve: new ContrastCurve(3, 3, 4.5, 7)
1494
+ });
1495
+ MaterialDynamicColors.surface = DynamicColor.fromPalette({
1496
+ name: "surface",
1497
+ palette: (s) => s.neutralPalette,
1498
+ tone: (s) => s.isDark ? 6 : 98,
1499
+ isBackground: true
1500
+ });
1501
+ MaterialDynamicColors.surfaceDim = DynamicColor.fromPalette({
1502
+ name: "surface_dim",
1503
+ palette: (s) => s.neutralPalette,
1504
+ tone: (s) => s.isDark ? 6 : 87,
1505
+ isBackground: true
1506
+ });
1507
+ MaterialDynamicColors.surfaceBright = DynamicColor.fromPalette({
1508
+ name: "surface_bright",
1509
+ palette: (s) => s.neutralPalette,
1510
+ tone: (s) => s.isDark ? 24 : 98,
1511
+ isBackground: true
1512
+ });
1513
+ MaterialDynamicColors.surfaceContainerLowest = DynamicColor.fromPalette({
1514
+ name: "surface_container_lowest",
1515
+ palette: (s) => s.neutralPalette,
1516
+ tone: (s) => s.isDark ? 4 : 100,
1517
+ isBackground: true
1518
+ });
1519
+ MaterialDynamicColors.surfaceContainerLow = DynamicColor.fromPalette({
1520
+ name: "surface_container_low",
1521
+ palette: (s) => s.neutralPalette,
1522
+ tone: (s) => s.isDark ? 10 : 96,
1523
+ isBackground: true
1524
+ });
1525
+ MaterialDynamicColors.surfaceContainer = DynamicColor.fromPalette({
1526
+ name: "surface_container",
1527
+ palette: (s) => s.neutralPalette,
1528
+ tone: (s) => s.isDark ? 12 : 94,
1529
+ isBackground: true
1530
+ });
1531
+ MaterialDynamicColors.surfaceContainerHigh = DynamicColor.fromPalette({
1532
+ name: "surface_container_high",
1533
+ palette: (s) => s.neutralPalette,
1534
+ tone: (s) => s.isDark ? 17 : 92,
1535
+ isBackground: true
1536
+ });
1537
+ MaterialDynamicColors.surfaceContainerHighest = DynamicColor.fromPalette({
1538
+ name: "surface_container_highest",
1539
+ palette: (s) => s.neutralPalette,
1540
+ tone: (s) => s.isDark ? 22 : 90,
1541
+ isBackground: true
1542
+ });
1543
+ MaterialDynamicColors.onSurface = DynamicColor.fromPalette({
1544
+ name: "on_surface",
1545
+ palette: (s) => s.neutralPalette,
1546
+ tone: (s) => s.isDark ? 90 : 10,
1547
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1548
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1549
+ });
1550
+ MaterialDynamicColors.surfaceVariant = DynamicColor.fromPalette({
1551
+ name: "surface_variant",
1552
+ palette: (s) => s.neutralVariantPalette,
1553
+ tone: (s) => s.isDark ? 30 : 90,
1554
+ isBackground: true
1555
+ });
1556
+ MaterialDynamicColors.onSurfaceVariant = DynamicColor.fromPalette({
1557
+ name: "on_surface_variant",
1558
+ palette: (s) => s.neutralVariantPalette,
1559
+ tone: (s) => s.isDark ? 80 : 30,
1560
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1561
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
1562
+ });
1563
+ MaterialDynamicColors.inverseSurface = DynamicColor.fromPalette({
1564
+ name: "inverse_surface",
1565
+ palette: (s) => s.neutralPalette,
1566
+ tone: (s) => s.isDark ? 90 : 20
1567
+ });
1568
+ MaterialDynamicColors.inverseOnSurface = DynamicColor.fromPalette({
1569
+ name: "inverse_on_surface",
1570
+ palette: (s) => s.neutralPalette,
1571
+ tone: (s) => s.isDark ? 20 : 95,
1572
+ background: (s) => MaterialDynamicColors.inverseSurface,
1573
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1574
+ });
1575
+ MaterialDynamicColors.outline = DynamicColor.fromPalette({
1576
+ name: "outline",
1577
+ palette: (s) => s.neutralVariantPalette,
1578
+ tone: (s) => s.isDark ? 60 : 50,
1579
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1580
+ contrastCurve: new ContrastCurve(1.5, 3, 4.5, 7)
1581
+ });
1582
+ MaterialDynamicColors.outlineVariant = DynamicColor.fromPalette({
1583
+ name: "outline_variant",
1584
+ palette: (s) => s.neutralVariantPalette,
1585
+ tone: (s) => s.isDark ? 30 : 80,
1586
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1587
+ contrastCurve: new ContrastCurve(1, 1, 3, 7)
1588
+ });
1589
+ MaterialDynamicColors.shadow = DynamicColor.fromPalette({
1590
+ name: "shadow",
1591
+ palette: (s) => s.neutralPalette,
1592
+ tone: (s) => 0
1593
+ });
1594
+ MaterialDynamicColors.scrim = DynamicColor.fromPalette({
1595
+ name: "scrim",
1596
+ palette: (s) => s.neutralPalette,
1597
+ tone: (s) => 0
1598
+ });
1599
+ MaterialDynamicColors.surfaceTint = DynamicColor.fromPalette({
1600
+ name: "surface_tint",
1601
+ palette: (s) => s.primaryPalette,
1602
+ tone: (s) => s.isDark ? 80 : 40,
1603
+ isBackground: true
1604
+ });
1605
+ MaterialDynamicColors.primary = DynamicColor.fromPalette({
1606
+ name: "primary",
1607
+ palette: (s) => s.primaryPalette,
1608
+ tone: (s) => {
1609
+ if (isMonochrome(s)) {
1610
+ return s.isDark ? 100 : 0;
1611
+ }
1612
+ return s.isDark ? 80 : 40;
1613
+ },
1614
+ isBackground: true,
1615
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1616
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11),
1617
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryContainer, MaterialDynamicColors.primary, 15, "nearer", false)
1618
+ });
1619
+ MaterialDynamicColors.onPrimary = DynamicColor.fromPalette({
1620
+ name: "on_primary",
1621
+ palette: (s) => s.primaryPalette,
1622
+ tone: (s) => {
1623
+ if (isMonochrome(s)) {
1624
+ return s.isDark ? 10 : 90;
1625
+ }
1626
+ return s.isDark ? 20 : 100;
1627
+ },
1628
+ background: (s) => MaterialDynamicColors.primary,
1629
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1630
+ });
1631
+ MaterialDynamicColors.primaryContainer = DynamicColor.fromPalette({
1632
+ name: "primary_container",
1633
+ palette: (s) => s.primaryPalette,
1634
+ tone: (s) => {
1635
+ if (isFidelity(s)) {
1636
+ return performAlbers(s.sourceColorHct, s);
1637
+ }
1638
+ if (isMonochrome(s)) {
1639
+ return s.isDark ? 85 : 25;
1640
+ }
1641
+ return s.isDark ? 30 : 90;
1642
+ },
1643
+ isBackground: true,
1644
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1645
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1646
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryContainer, MaterialDynamicColors.primary, 15, "nearer", false)
1647
+ });
1648
+ MaterialDynamicColors.onPrimaryContainer = DynamicColor.fromPalette({
1649
+ name: "on_primary_container",
1650
+ palette: (s) => s.primaryPalette,
1651
+ tone: (s) => {
1652
+ if (isFidelity(s)) {
1653
+ return DynamicColor.foregroundTone(MaterialDynamicColors.primaryContainer.tone(s), 4.5);
1654
+ }
1655
+ if (isMonochrome(s)) {
1656
+ return s.isDark ? 0 : 100;
1657
+ }
1658
+ return s.isDark ? 90 : 10;
1659
+ },
1660
+ background: (s) => MaterialDynamicColors.primaryContainer,
1661
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1662
+ });
1663
+ MaterialDynamicColors.inversePrimary = DynamicColor.fromPalette({
1664
+ name: "inverse_primary",
1665
+ palette: (s) => s.primaryPalette,
1666
+ tone: (s) => s.isDark ? 40 : 80,
1667
+ background: (s) => MaterialDynamicColors.inverseSurface,
1668
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
1669
+ });
1670
+ MaterialDynamicColors.secondary = DynamicColor.fromPalette({
1671
+ name: "secondary",
1672
+ palette: (s) => s.secondaryPalette,
1673
+ tone: (s) => s.isDark ? 80 : 40,
1674
+ isBackground: true,
1675
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1676
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11),
1677
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryContainer, MaterialDynamicColors.secondary, 15, "nearer", false)
1678
+ });
1679
+ MaterialDynamicColors.onSecondary = DynamicColor.fromPalette({
1680
+ name: "on_secondary",
1681
+ palette: (s) => s.secondaryPalette,
1682
+ tone: (s) => {
1683
+ if (isMonochrome(s)) {
1684
+ return s.isDark ? 10 : 100;
1685
+ } else {
1686
+ return s.isDark ? 20 : 100;
1687
+ }
1688
+ },
1689
+ background: (s) => MaterialDynamicColors.secondary,
1690
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1691
+ });
1692
+ MaterialDynamicColors.secondaryContainer = DynamicColor.fromPalette({
1693
+ name: "secondary_container",
1694
+ palette: (s) => s.secondaryPalette,
1695
+ tone: (s) => {
1696
+ const initialTone = s.isDark ? 30 : 90;
1697
+ if (isMonochrome(s)) {
1698
+ return s.isDark ? 30 : 85;
1699
+ }
1700
+ if (!isFidelity(s)) {
1701
+ return initialTone;
1702
+ }
1703
+ let answer = findDesiredChromaByTone(s.secondaryPalette.hue, s.secondaryPalette.chroma, initialTone, s.isDark ? false : true);
1704
+ answer = performAlbers(s.secondaryPalette.getHct(answer), s);
1705
+ return answer;
1706
+ },
1707
+ isBackground: true,
1708
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1709
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1710
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryContainer, MaterialDynamicColors.secondary, 15, "nearer", false)
1711
+ });
1712
+ MaterialDynamicColors.onSecondaryContainer = DynamicColor.fromPalette({
1713
+ name: "on_secondary_container",
1714
+ palette: (s) => s.secondaryPalette,
1715
+ tone: (s) => {
1716
+ if (!isFidelity(s)) {
1717
+ return s.isDark ? 90 : 10;
1718
+ }
1719
+ return DynamicColor.foregroundTone(MaterialDynamicColors.secondaryContainer.tone(s), 4.5);
1720
+ },
1721
+ background: (s) => MaterialDynamicColors.secondaryContainer,
1722
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1723
+ });
1724
+ MaterialDynamicColors.tertiary = DynamicColor.fromPalette({
1725
+ name: "tertiary",
1726
+ palette: (s) => s.tertiaryPalette,
1727
+ tone: (s) => {
1728
+ if (isMonochrome(s)) {
1729
+ return s.isDark ? 90 : 25;
1730
+ }
1731
+ return s.isDark ? 80 : 40;
1732
+ },
1733
+ isBackground: true,
1734
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1735
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11),
1736
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer, MaterialDynamicColors.tertiary, 15, "nearer", false)
1737
+ });
1738
+ MaterialDynamicColors.onTertiary = DynamicColor.fromPalette({
1739
+ name: "on_tertiary",
1740
+ palette: (s) => s.tertiaryPalette,
1741
+ tone: (s) => {
1742
+ if (isMonochrome(s)) {
1743
+ return s.isDark ? 10 : 90;
1744
+ }
1745
+ return s.isDark ? 20 : 100;
1746
+ },
1747
+ background: (s) => MaterialDynamicColors.tertiary,
1748
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1749
+ });
1750
+ MaterialDynamicColors.tertiaryContainer = DynamicColor.fromPalette({
1751
+ name: "tertiary_container",
1752
+ palette: (s) => s.tertiaryPalette,
1753
+ tone: (s) => {
1754
+ if (isMonochrome(s)) {
1755
+ return s.isDark ? 60 : 49;
1756
+ }
1757
+ if (!isFidelity(s)) {
1758
+ return s.isDark ? 30 : 90;
1759
+ }
1760
+ const albersTone = performAlbers(s.tertiaryPalette.getHct(s.sourceColorHct.tone), s);
1761
+ const proposedHct = s.tertiaryPalette.getHct(albersTone);
1762
+ return DislikeAnalyzer.fixIfDisliked(proposedHct).tone;
1763
+ },
1764
+ isBackground: true,
1765
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1766
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1767
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer, MaterialDynamicColors.tertiary, 15, "nearer", false)
1768
+ });
1769
+ MaterialDynamicColors.onTertiaryContainer = DynamicColor.fromPalette({
1770
+ name: "on_tertiary_container",
1771
+ palette: (s) => s.tertiaryPalette,
1772
+ tone: (s) => {
1773
+ if (isMonochrome(s)) {
1774
+ return s.isDark ? 0 : 100;
1775
+ }
1776
+ if (!isFidelity(s)) {
1777
+ return s.isDark ? 90 : 10;
1778
+ }
1779
+ return DynamicColor.foregroundTone(MaterialDynamicColors.tertiaryContainer.tone(s), 4.5);
1780
+ },
1781
+ background: (s) => MaterialDynamicColors.tertiaryContainer,
1782
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1783
+ });
1784
+ MaterialDynamicColors.error = DynamicColor.fromPalette({
1785
+ name: "error",
1786
+ palette: (s) => s.errorPalette,
1787
+ tone: (s) => s.isDark ? 80 : 40,
1788
+ isBackground: true,
1789
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1790
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11),
1791
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.errorContainer, MaterialDynamicColors.error, 15, "nearer", false)
1792
+ });
1793
+ MaterialDynamicColors.onError = DynamicColor.fromPalette({
1794
+ name: "on_error",
1795
+ palette: (s) => s.errorPalette,
1796
+ tone: (s) => s.isDark ? 20 : 100,
1797
+ background: (s) => MaterialDynamicColors.error,
1798
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1799
+ });
1800
+ MaterialDynamicColors.errorContainer = DynamicColor.fromPalette({
1801
+ name: "error_container",
1802
+ palette: (s) => s.errorPalette,
1803
+ tone: (s) => s.isDark ? 30 : 90,
1804
+ isBackground: true,
1805
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1806
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1807
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.errorContainer, MaterialDynamicColors.error, 15, "nearer", false)
1808
+ });
1809
+ MaterialDynamicColors.onErrorContainer = DynamicColor.fromPalette({
1810
+ name: "on_error_container",
1811
+ palette: (s) => s.errorPalette,
1812
+ tone: (s) => s.isDark ? 90 : 10,
1813
+ background: (s) => MaterialDynamicColors.errorContainer,
1814
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1815
+ });
1816
+ MaterialDynamicColors.primaryFixed = DynamicColor.fromPalette({
1817
+ name: "primary_fixed",
1818
+ palette: (s) => s.primaryPalette,
1819
+ tone: (s) => isMonochrome(s) ? 40 : 90,
1820
+ isBackground: true,
1821
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1822
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1823
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryFixed, MaterialDynamicColors.primaryFixedDim, 10, "lighter", true)
1824
+ });
1825
+ MaterialDynamicColors.primaryFixedDim = DynamicColor.fromPalette({
1826
+ name: "primary_fixed_dim",
1827
+ palette: (s) => s.primaryPalette,
1828
+ tone: (s) => isMonochrome(s) ? 30 : 80,
1829
+ isBackground: true,
1830
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1831
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1832
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryFixed, MaterialDynamicColors.primaryFixedDim, 10, "lighter", true)
1833
+ });
1834
+ MaterialDynamicColors.onPrimaryFixed = DynamicColor.fromPalette({
1835
+ name: "on_primary_fixed",
1836
+ palette: (s) => s.primaryPalette,
1837
+ tone: (s) => isMonochrome(s) ? 100 : 10,
1838
+ background: (s) => MaterialDynamicColors.primaryFixedDim,
1839
+ secondBackground: (s) => MaterialDynamicColors.primaryFixed,
1840
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1841
+ });
1842
+ MaterialDynamicColors.onPrimaryFixedVariant = DynamicColor.fromPalette({
1843
+ name: "on_primary_fixed_variant",
1844
+ palette: (s) => s.primaryPalette,
1845
+ tone: (s) => isMonochrome(s) ? 90 : 30,
1846
+ background: (s) => MaterialDynamicColors.primaryFixedDim,
1847
+ secondBackground: (s) => MaterialDynamicColors.primaryFixed,
1848
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
1849
+ });
1850
+ MaterialDynamicColors.secondaryFixed = DynamicColor.fromPalette({
1851
+ name: "secondary_fixed",
1852
+ palette: (s) => s.secondaryPalette,
1853
+ tone: (s) => isMonochrome(s) ? 80 : 90,
1854
+ isBackground: true,
1855
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1856
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1857
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryFixed, MaterialDynamicColors.secondaryFixedDim, 10, "lighter", true)
1858
+ });
1859
+ MaterialDynamicColors.secondaryFixedDim = DynamicColor.fromPalette({
1860
+ name: "secondary_fixed_dim",
1861
+ palette: (s) => s.secondaryPalette,
1862
+ tone: (s) => isMonochrome(s) ? 70 : 80,
1863
+ isBackground: true,
1864
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1865
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1866
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryFixed, MaterialDynamicColors.secondaryFixedDim, 10, "lighter", true)
1867
+ });
1868
+ MaterialDynamicColors.onSecondaryFixed = DynamicColor.fromPalette({
1869
+ name: "on_secondary_fixed",
1870
+ palette: (s) => s.secondaryPalette,
1871
+ tone: (s) => 10,
1872
+ background: (s) => MaterialDynamicColors.secondaryFixedDim,
1873
+ secondBackground: (s) => MaterialDynamicColors.secondaryFixed,
1874
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1875
+ });
1876
+ MaterialDynamicColors.onSecondaryFixedVariant = DynamicColor.fromPalette({
1877
+ name: "on_secondary_fixed_variant",
1878
+ palette: (s) => s.secondaryPalette,
1879
+ tone: (s) => isMonochrome(s) ? 25 : 30,
1880
+ background: (s) => MaterialDynamicColors.secondaryFixedDim,
1881
+ secondBackground: (s) => MaterialDynamicColors.secondaryFixed,
1882
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
1883
+ });
1884
+ MaterialDynamicColors.tertiaryFixed = DynamicColor.fromPalette({
1885
+ name: "tertiary_fixed",
1886
+ palette: (s) => s.tertiaryPalette,
1887
+ tone: (s) => isMonochrome(s) ? 40 : 90,
1888
+ isBackground: true,
1889
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1890
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1891
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed, MaterialDynamicColors.tertiaryFixedDim, 10, "lighter", true)
1892
+ });
1893
+ MaterialDynamicColors.tertiaryFixedDim = DynamicColor.fromPalette({
1894
+ name: "tertiary_fixed_dim",
1895
+ palette: (s) => s.tertiaryPalette,
1896
+ tone: (s) => isMonochrome(s) ? 30 : 80,
1897
+ isBackground: true,
1898
+ background: (s) => MaterialDynamicColors.highestSurface(s),
1899
+ contrastCurve: new ContrastCurve(1, 1, 3, 7),
1900
+ toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed, MaterialDynamicColors.tertiaryFixedDim, 10, "lighter", true)
1901
+ });
1902
+ MaterialDynamicColors.onTertiaryFixed = DynamicColor.fromPalette({
1903
+ name: "on_tertiary_fixed",
1904
+ palette: (s) => s.tertiaryPalette,
1905
+ tone: (s) => isMonochrome(s) ? 100 : 10,
1906
+ background: (s) => MaterialDynamicColors.tertiaryFixedDim,
1907
+ secondBackground: (s) => MaterialDynamicColors.tertiaryFixed,
1908
+ contrastCurve: new ContrastCurve(4.5, 7, 11, 21)
1909
+ });
1910
+ MaterialDynamicColors.onTertiaryFixedVariant = DynamicColor.fromPalette({
1911
+ name: "on_tertiary_fixed_variant",
1912
+ palette: (s) => s.tertiaryPalette,
1913
+ tone: (s) => isMonochrome(s) ? 90 : 30,
1914
+ background: (s) => MaterialDynamicColors.tertiaryFixedDim,
1915
+ secondBackground: (s) => MaterialDynamicColors.tertiaryFixed,
1916
+ contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
1917
+ });
1918
+
1919
+ // node_modules/@material/material-color-utilities/palettes/tonal_palette.js
1920
+ var TonalPalette = class {
1921
+ static fromInt(argb) {
1922
+ const hct = Hct.fromInt(argb);
1923
+ return TonalPalette.fromHct(hct);
1924
+ }
1925
+ static fromHct(hct) {
1926
+ return new TonalPalette(hct.hue, hct.chroma, hct);
1927
+ }
1928
+ static fromHueAndChroma(hue, chroma) {
1929
+ return new TonalPalette(hue, chroma, TonalPalette.createKeyColor(hue, chroma));
1930
+ }
1931
+ constructor(hue, chroma, keyColor) {
1932
+ this.hue = hue;
1933
+ this.chroma = chroma;
1934
+ this.keyColor = keyColor;
1935
+ this.cache = /* @__PURE__ */ new Map();
1936
+ }
1937
+ static createKeyColor(hue, chroma) {
1938
+ const startTone = 50;
1939
+ let smallestDeltaHct = Hct.from(hue, chroma, startTone);
1940
+ let smallestDelta = Math.abs(smallestDeltaHct.chroma - chroma);
1941
+ for (let delta = 1; delta < 50; delta += 1) {
1942
+ if (Math.round(chroma) === Math.round(smallestDeltaHct.chroma)) {
1943
+ return smallestDeltaHct;
1944
+ }
1945
+ const hctAdd = Hct.from(hue, chroma, startTone + delta);
1946
+ const hctAddDelta = Math.abs(hctAdd.chroma - chroma);
1947
+ if (hctAddDelta < smallestDelta) {
1948
+ smallestDelta = hctAddDelta;
1949
+ smallestDeltaHct = hctAdd;
1950
+ }
1951
+ const hctSubtract = Hct.from(hue, chroma, startTone - delta);
1952
+ const hctSubtractDelta = Math.abs(hctSubtract.chroma - chroma);
1953
+ if (hctSubtractDelta < smallestDelta) {
1954
+ smallestDelta = hctSubtractDelta;
1955
+ smallestDeltaHct = hctSubtract;
1956
+ }
1957
+ }
1958
+ return smallestDeltaHct;
1959
+ }
1960
+ tone(tone) {
1961
+ let argb = this.cache.get(tone);
1962
+ if (argb === void 0) {
1963
+ argb = Hct.from(this.hue, this.chroma, tone).toInt();
1964
+ this.cache.set(tone, argb);
1965
+ }
1966
+ return argb;
1967
+ }
1968
+ getHct(tone) {
1969
+ return Hct.fromInt(this.tone(tone));
1970
+ }
1971
+ };
1972
+
1973
+ // node_modules/@material/material-color-utilities/palettes/core_palette.js
1974
+ var CorePalette = class {
1975
+ static of(argb) {
1976
+ return new CorePalette(argb, false);
1977
+ }
1978
+ static contentOf(argb) {
1979
+ return new CorePalette(argb, true);
1980
+ }
1981
+ static fromColors(colors) {
1982
+ return CorePalette.createPaletteFromColors(false, colors);
1983
+ }
1984
+ static contentFromColors(colors) {
1985
+ return CorePalette.createPaletteFromColors(true, colors);
1986
+ }
1987
+ static createPaletteFromColors(content, colors) {
1988
+ const palette = new CorePalette(colors.primary, content);
1989
+ if (colors.secondary) {
1990
+ const p = new CorePalette(colors.secondary, content);
1991
+ palette.a2 = p.a1;
1992
+ }
1993
+ if (colors.tertiary) {
1994
+ const p = new CorePalette(colors.tertiary, content);
1995
+ palette.a3 = p.a1;
1996
+ }
1997
+ if (colors.error) {
1998
+ const p = new CorePalette(colors.error, content);
1999
+ palette.error = p.a1;
2000
+ }
2001
+ if (colors.neutral) {
2002
+ const p = new CorePalette(colors.neutral, content);
2003
+ palette.n1 = p.n1;
2004
+ }
2005
+ if (colors.neutralVariant) {
2006
+ const p = new CorePalette(colors.neutralVariant, content);
2007
+ palette.n2 = p.n2;
2008
+ }
2009
+ return palette;
2010
+ }
2011
+ constructor(argb, isContent) {
2012
+ const hct = Hct.fromInt(argb);
2013
+ const hue = hct.hue;
2014
+ const chroma = hct.chroma;
2015
+ if (isContent) {
2016
+ this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);
2017
+ this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);
2018
+ this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);
2019
+ this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));
2020
+ this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));
2021
+ } else {
2022
+ this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));
2023
+ this.a2 = TonalPalette.fromHueAndChroma(hue, 16);
2024
+ this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);
2025
+ this.n1 = TonalPalette.fromHueAndChroma(hue, 4);
2026
+ this.n2 = TonalPalette.fromHueAndChroma(hue, 8);
2027
+ }
2028
+ this.error = TonalPalette.fromHueAndChroma(25, 84);
2029
+ }
2030
+ };
2031
+
2032
+ // node_modules/@material/material-color-utilities/scheme/dynamic_scheme.js
2033
+ var DynamicScheme = class {
2034
+ constructor(args) {
2035
+ this.sourceColorArgb = args.sourceColorArgb;
2036
+ this.variant = args.variant;
2037
+ this.contrastLevel = args.contrastLevel;
2038
+ this.isDark = args.isDark;
2039
+ this.sourceColorHct = Hct.fromInt(args.sourceColorArgb);
2040
+ this.primaryPalette = args.primaryPalette;
2041
+ this.secondaryPalette = args.secondaryPalette;
2042
+ this.tertiaryPalette = args.tertiaryPalette;
2043
+ this.neutralPalette = args.neutralPalette;
2044
+ this.neutralVariantPalette = args.neutralVariantPalette;
2045
+ this.errorPalette = TonalPalette.fromHueAndChroma(25, 84);
2046
+ }
2047
+ static getRotatedHue(sourceColor, hues, rotations) {
2048
+ const sourceHue = sourceColor.hue;
2049
+ if (hues.length !== rotations.length) {
2050
+ throw new Error(`mismatch between hue length ${hues.length} & rotations ${rotations.length}`);
2051
+ }
2052
+ if (rotations.length === 1) {
2053
+ return sanitizeDegreesDouble(sourceColor.hue + rotations[0]);
2054
+ }
2055
+ const size = hues.length;
2056
+ for (let i = 0; i <= size - 2; i++) {
2057
+ const thisHue = hues[i];
2058
+ const nextHue = hues[i + 1];
2059
+ if (thisHue < sourceHue && sourceHue < nextHue) {
2060
+ return sanitizeDegreesDouble(sourceHue + rotations[i]);
2061
+ }
2062
+ }
2063
+ return sourceHue;
2064
+ }
2065
+ };
2066
+
2067
+ // node_modules/@material/material-color-utilities/scheme/scheme.js
2068
+ var Scheme = class {
2069
+ get primary() {
2070
+ return this.props.primary;
2071
+ }
2072
+ get onPrimary() {
2073
+ return this.props.onPrimary;
2074
+ }
2075
+ get primaryContainer() {
2076
+ return this.props.primaryContainer;
2077
+ }
2078
+ get onPrimaryContainer() {
2079
+ return this.props.onPrimaryContainer;
2080
+ }
2081
+ get secondary() {
2082
+ return this.props.secondary;
2083
+ }
2084
+ get onSecondary() {
2085
+ return this.props.onSecondary;
2086
+ }
2087
+ get secondaryContainer() {
2088
+ return this.props.secondaryContainer;
2089
+ }
2090
+ get onSecondaryContainer() {
2091
+ return this.props.onSecondaryContainer;
2092
+ }
2093
+ get tertiary() {
2094
+ return this.props.tertiary;
2095
+ }
2096
+ get onTertiary() {
2097
+ return this.props.onTertiary;
2098
+ }
2099
+ get tertiaryContainer() {
2100
+ return this.props.tertiaryContainer;
2101
+ }
2102
+ get onTertiaryContainer() {
2103
+ return this.props.onTertiaryContainer;
2104
+ }
2105
+ get error() {
2106
+ return this.props.error;
2107
+ }
2108
+ get onError() {
2109
+ return this.props.onError;
2110
+ }
2111
+ get errorContainer() {
2112
+ return this.props.errorContainer;
2113
+ }
2114
+ get onErrorContainer() {
2115
+ return this.props.onErrorContainer;
2116
+ }
2117
+ get background() {
2118
+ return this.props.background;
2119
+ }
2120
+ get onBackground() {
2121
+ return this.props.onBackground;
2122
+ }
2123
+ get surface() {
2124
+ return this.props.surface;
2125
+ }
2126
+ get onSurface() {
2127
+ return this.props.onSurface;
2128
+ }
2129
+ get surfaceVariant() {
2130
+ return this.props.surfaceVariant;
2131
+ }
2132
+ get onSurfaceVariant() {
2133
+ return this.props.onSurfaceVariant;
2134
+ }
2135
+ get outline() {
2136
+ return this.props.outline;
2137
+ }
2138
+ get outlineVariant() {
2139
+ return this.props.outlineVariant;
2140
+ }
2141
+ get shadow() {
2142
+ return this.props.shadow;
2143
+ }
2144
+ get scrim() {
2145
+ return this.props.scrim;
2146
+ }
2147
+ get inverseSurface() {
2148
+ return this.props.inverseSurface;
2149
+ }
2150
+ get inverseOnSurface() {
2151
+ return this.props.inverseOnSurface;
2152
+ }
2153
+ get inversePrimary() {
2154
+ return this.props.inversePrimary;
2155
+ }
2156
+ static light(argb) {
2157
+ return Scheme.lightFromCorePalette(CorePalette.of(argb));
2158
+ }
2159
+ static dark(argb) {
2160
+ return Scheme.darkFromCorePalette(CorePalette.of(argb));
2161
+ }
2162
+ static lightContent(argb) {
2163
+ return Scheme.lightFromCorePalette(CorePalette.contentOf(argb));
2164
+ }
2165
+ static darkContent(argb) {
2166
+ return Scheme.darkFromCorePalette(CorePalette.contentOf(argb));
2167
+ }
2168
+ static lightFromCorePalette(core) {
2169
+ return new Scheme({
2170
+ primary: core.a1.tone(40),
2171
+ onPrimary: core.a1.tone(100),
2172
+ primaryContainer: core.a1.tone(90),
2173
+ onPrimaryContainer: core.a1.tone(10),
2174
+ secondary: core.a2.tone(40),
2175
+ onSecondary: core.a2.tone(100),
2176
+ secondaryContainer: core.a2.tone(90),
2177
+ onSecondaryContainer: core.a2.tone(10),
2178
+ tertiary: core.a3.tone(40),
2179
+ onTertiary: core.a3.tone(100),
2180
+ tertiaryContainer: core.a3.tone(90),
2181
+ onTertiaryContainer: core.a3.tone(10),
2182
+ error: core.error.tone(40),
2183
+ onError: core.error.tone(100),
2184
+ errorContainer: core.error.tone(90),
2185
+ onErrorContainer: core.error.tone(10),
2186
+ background: core.n1.tone(99),
2187
+ onBackground: core.n1.tone(10),
2188
+ surface: core.n1.tone(99),
2189
+ onSurface: core.n1.tone(10),
2190
+ surfaceVariant: core.n2.tone(90),
2191
+ onSurfaceVariant: core.n2.tone(30),
2192
+ outline: core.n2.tone(50),
2193
+ outlineVariant: core.n2.tone(80),
2194
+ shadow: core.n1.tone(0),
2195
+ scrim: core.n1.tone(0),
2196
+ inverseSurface: core.n1.tone(20),
2197
+ inverseOnSurface: core.n1.tone(95),
2198
+ inversePrimary: core.a1.tone(80)
2199
+ });
2200
+ }
2201
+ static darkFromCorePalette(core) {
2202
+ return new Scheme({
2203
+ primary: core.a1.tone(80),
2204
+ onPrimary: core.a1.tone(20),
2205
+ primaryContainer: core.a1.tone(30),
2206
+ onPrimaryContainer: core.a1.tone(90),
2207
+ secondary: core.a2.tone(80),
2208
+ onSecondary: core.a2.tone(20),
2209
+ secondaryContainer: core.a2.tone(30),
2210
+ onSecondaryContainer: core.a2.tone(90),
2211
+ tertiary: core.a3.tone(80),
2212
+ onTertiary: core.a3.tone(20),
2213
+ tertiaryContainer: core.a3.tone(30),
2214
+ onTertiaryContainer: core.a3.tone(90),
2215
+ error: core.error.tone(80),
2216
+ onError: core.error.tone(20),
2217
+ errorContainer: core.error.tone(30),
2218
+ onErrorContainer: core.error.tone(80),
2219
+ background: core.n1.tone(10),
2220
+ onBackground: core.n1.tone(90),
2221
+ surface: core.n1.tone(10),
2222
+ onSurface: core.n1.tone(90),
2223
+ surfaceVariant: core.n2.tone(30),
2224
+ onSurfaceVariant: core.n2.tone(80),
2225
+ outline: core.n2.tone(60),
2226
+ outlineVariant: core.n2.tone(30),
2227
+ shadow: core.n1.tone(0),
2228
+ scrim: core.n1.tone(0),
2229
+ inverseSurface: core.n1.tone(90),
2230
+ inverseOnSurface: core.n1.tone(20),
2231
+ inversePrimary: core.a1.tone(40)
2232
+ });
2233
+ }
2234
+ constructor(props) {
2235
+ this.props = props;
2236
+ }
2237
+ toJSON() {
2238
+ return __spreadValues({}, this.props);
2239
+ }
2240
+ };
2241
+
2242
+ // node_modules/@material/material-color-utilities/scheme/scheme_expressive.js
2243
+ var SchemeExpressive = class extends DynamicScheme {
2244
+ constructor(sourceColorHct, isDark, contrastLevel) {
2245
+ super({
2246
+ sourceColorArgb: sourceColorHct.toInt(),
2247
+ variant: Variant.EXPRESSIVE,
2248
+ contrastLevel,
2249
+ isDark,
2250
+ primaryPalette: TonalPalette.fromHueAndChroma(sanitizeDegreesDouble(sourceColorHct.hue + 240), 40),
2251
+ secondaryPalette: TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct, SchemeExpressive.hues, SchemeExpressive.secondaryRotations), 24),
2252
+ tertiaryPalette: TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct, SchemeExpressive.hues, SchemeExpressive.tertiaryRotations), 32),
2253
+ neutralPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue + 15, 8),
2254
+ neutralVariantPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue + 15, 12)
2255
+ });
2256
+ }
2257
+ };
2258
+ SchemeExpressive.hues = [
2259
+ 0,
2260
+ 21,
2261
+ 51,
2262
+ 121,
2263
+ 151,
2264
+ 191,
2265
+ 271,
2266
+ 321,
2267
+ 360
2268
+ ];
2269
+ SchemeExpressive.secondaryRotations = [
2270
+ 45,
2271
+ 95,
2272
+ 45,
2273
+ 20,
2274
+ 45,
2275
+ 90,
2276
+ 45,
2277
+ 45,
2278
+ 45
2279
+ ];
2280
+ SchemeExpressive.tertiaryRotations = [
2281
+ 120,
2282
+ 120,
2283
+ 20,
2284
+ 45,
2285
+ 20,
2286
+ 15,
2287
+ 20,
2288
+ 120,
2289
+ 120
2290
+ ];
2291
+
2292
+ // node_modules/@material/material-color-utilities/scheme/scheme_vibrant.js
2293
+ var SchemeVibrant = class extends DynamicScheme {
2294
+ constructor(sourceColorHct, isDark, contrastLevel) {
2295
+ super({
2296
+ sourceColorArgb: sourceColorHct.toInt(),
2297
+ variant: Variant.VIBRANT,
2298
+ contrastLevel,
2299
+ isDark,
2300
+ primaryPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, 200),
2301
+ secondaryPalette: TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct, SchemeVibrant.hues, SchemeVibrant.secondaryRotations), 24),
2302
+ tertiaryPalette: TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct, SchemeVibrant.hues, SchemeVibrant.tertiaryRotations), 32),
2303
+ neutralPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, 10),
2304
+ neutralVariantPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, 12)
2305
+ });
2306
+ }
2307
+ };
2308
+ SchemeVibrant.hues = [
2309
+ 0,
2310
+ 41,
2311
+ 61,
2312
+ 101,
2313
+ 131,
2314
+ 181,
2315
+ 251,
2316
+ 301,
2317
+ 360
2318
+ ];
2319
+ SchemeVibrant.secondaryRotations = [
2320
+ 18,
2321
+ 15,
2322
+ 10,
2323
+ 12,
2324
+ 15,
2325
+ 18,
2326
+ 15,
2327
+ 12,
2328
+ 12
2329
+ ];
2330
+ SchemeVibrant.tertiaryRotations = [
2331
+ 35,
2332
+ 30,
2333
+ 20,
2334
+ 25,
2335
+ 30,
2336
+ 35,
2337
+ 30,
2338
+ 25,
2339
+ 25
2340
+ ];
2341
+
2342
+ // node_modules/@material/material-color-utilities/score/score.js
2343
+ var SCORE_OPTION_DEFAULTS = {
2344
+ desired: 4,
2345
+ fallbackColorARGB: 4282549748,
2346
+ filter: true
2347
+ };
2348
+ function compare(a, b) {
2349
+ if (a.score > b.score) {
2350
+ return -1;
2351
+ } else if (a.score < b.score) {
2352
+ return 1;
2353
+ }
2354
+ return 0;
2355
+ }
2356
+ var Score = class {
2357
+ constructor() {
2358
+ }
2359
+ static score(colorsToPopulation, options) {
2360
+ const { desired, fallbackColorARGB, filter } = __spreadValues(__spreadValues({}, SCORE_OPTION_DEFAULTS), options);
2361
+ const colorsHct = [];
2362
+ const huePopulation = new Array(360).fill(0);
2363
+ let populationSum = 0;
2364
+ for (const [argb, population] of colorsToPopulation.entries()) {
2365
+ const hct = Hct.fromInt(argb);
2366
+ colorsHct.push(hct);
2367
+ const hue = Math.floor(hct.hue);
2368
+ huePopulation[hue] += population;
2369
+ populationSum += population;
2370
+ }
2371
+ const hueExcitedProportions = new Array(360).fill(0);
2372
+ for (let hue = 0; hue < 360; hue++) {
2373
+ const proportion = huePopulation[hue] / populationSum;
2374
+ for (let i = hue - 14; i < hue + 16; i++) {
2375
+ const neighborHue = sanitizeDegreesInt(i);
2376
+ hueExcitedProportions[neighborHue] += proportion;
2377
+ }
2378
+ }
2379
+ const scoredHct = new Array();
2380
+ for (const hct of colorsHct) {
2381
+ const hue = sanitizeDegreesInt(Math.round(hct.hue));
2382
+ const proportion = hueExcitedProportions[hue];
2383
+ if (filter && (hct.chroma < Score.CUTOFF_CHROMA || proportion <= Score.CUTOFF_EXCITED_PROPORTION)) {
2384
+ continue;
2385
+ }
2386
+ const proportionScore = proportion * 100 * Score.WEIGHT_PROPORTION;
2387
+ const chromaWeight = hct.chroma < Score.TARGET_CHROMA ? Score.WEIGHT_CHROMA_BELOW : Score.WEIGHT_CHROMA_ABOVE;
2388
+ const chromaScore = (hct.chroma - Score.TARGET_CHROMA) * chromaWeight;
2389
+ const score = proportionScore + chromaScore;
2390
+ scoredHct.push({ hct, score });
2391
+ }
2392
+ scoredHct.sort(compare);
2393
+ const chosenColors = [];
2394
+ for (let differenceDegrees2 = 90; differenceDegrees2 >= 15; differenceDegrees2--) {
2395
+ chosenColors.length = 0;
2396
+ for (const { hct } of scoredHct) {
2397
+ const duplicateHue = chosenColors.find((chosenHct) => {
2398
+ return differenceDegrees(hct.hue, chosenHct.hue) < differenceDegrees2;
2399
+ });
2400
+ if (!duplicateHue) {
2401
+ chosenColors.push(hct);
2402
+ }
2403
+ if (chosenColors.length >= desired)
2404
+ break;
2405
+ }
2406
+ if (chosenColors.length >= desired)
2407
+ break;
2408
+ }
2409
+ const colors = [];
2410
+ if (chosenColors.length === 0) {
2411
+ colors.push(fallbackColorARGB);
2412
+ }
2413
+ for (const chosenHct of chosenColors) {
2414
+ colors.push(chosenHct.toInt());
2415
+ }
2416
+ return colors;
2417
+ }
2418
+ };
2419
+ Score.TARGET_CHROMA = 48;
2420
+ Score.WEIGHT_PROPORTION = 0.7;
2421
+ Score.WEIGHT_CHROMA_ABOVE = 0.3;
2422
+ Score.WEIGHT_CHROMA_BELOW = 0.1;
2423
+ Score.CUTOFF_CHROMA = 5;
2424
+ Score.CUTOFF_EXCITED_PROPORTION = 0.01;
2425
+
2426
+ // node_modules/@material/material-color-utilities/utils/string_utils.js
2427
+ function hexFromArgb(argb) {
2428
+ const r = redFromArgb(argb);
2429
+ const g = greenFromArgb(argb);
2430
+ const b = blueFromArgb(argb);
2431
+ const outParts = [r.toString(16), g.toString(16), b.toString(16)];
2432
+ for (const [i, part] of outParts.entries()) {
2433
+ if (part.length === 1) {
2434
+ outParts[i] = "0" + part;
2435
+ }
2436
+ }
2437
+ return "#" + outParts.join("");
2438
+ }
2439
+ function argbFromHex(hex) {
2440
+ hex = hex.replace("#", "");
2441
+ const isThree = hex.length === 3;
2442
+ const isSix = hex.length === 6;
2443
+ const isEight = hex.length === 8;
2444
+ if (!isThree && !isSix && !isEight) {
2445
+ throw new Error("unexpected hex " + hex);
2446
+ }
2447
+ let r = 0;
2448
+ let g = 0;
2449
+ let b = 0;
2450
+ if (isThree) {
2451
+ r = parseIntHex(hex.slice(0, 1).repeat(2));
2452
+ g = parseIntHex(hex.slice(1, 2).repeat(2));
2453
+ b = parseIntHex(hex.slice(2, 3).repeat(2));
2454
+ } else if (isSix) {
2455
+ r = parseIntHex(hex.slice(0, 2));
2456
+ g = parseIntHex(hex.slice(2, 4));
2457
+ b = parseIntHex(hex.slice(4, 6));
2458
+ } else if (isEight) {
2459
+ r = parseIntHex(hex.slice(2, 4));
2460
+ g = parseIntHex(hex.slice(4, 6));
2461
+ b = parseIntHex(hex.slice(6, 8));
2462
+ }
2463
+ return (255 << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255) >>> 0;
2464
+ }
2465
+ function parseIntHex(value) {
2466
+ return parseInt(value, 16);
2467
+ }
2468
+
2469
+ // node_modules/@material/material-color-utilities/utils/theme_utils.js
2470
+ function themeFromSourceColor(source, customColors = []) {
2471
+ const palette = CorePalette.of(source);
2472
+ return {
2473
+ source,
2474
+ schemes: {
2475
+ light: Scheme.light(source),
2476
+ dark: Scheme.dark(source)
2477
+ },
2478
+ palettes: {
2479
+ primary: palette.a1,
2480
+ secondary: palette.a2,
2481
+ tertiary: palette.a3,
2482
+ neutral: palette.n1,
2483
+ neutralVariant: palette.n2,
2484
+ error: palette.error
2485
+ },
2486
+ customColors: customColors.map((c) => customColor(source, c))
2487
+ };
2488
+ }
2489
+ function customColor(source, color) {
2490
+ let value = color.value;
2491
+ const from = value;
2492
+ const to = source;
2493
+ if (color.blend) {
2494
+ value = Blend.harmonize(from, to);
2495
+ }
2496
+ const palette = CorePalette.of(value);
2497
+ const tones = palette.a1;
2498
+ return {
2499
+ color,
2500
+ value,
2501
+ light: {
2502
+ color: tones.tone(40),
2503
+ onColor: tones.tone(100),
2504
+ colorContainer: tones.tone(90),
2505
+ onColorContainer: tones.tone(10)
2506
+ },
2507
+ dark: {
2508
+ color: tones.tone(80),
2509
+ onColor: tones.tone(20),
2510
+ colorContainer: tones.tone(30),
2511
+ onColorContainer: tones.tone(90)
2512
+ }
2513
+ };
2514
+ }
2515
+
2516
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
2517
+ var HUE_TONES = [0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
2518
+ var NEUTRAL_HUE_TONES = HUE_TONES.concat([4, 6, 12, 17, 22, 24, 87, 92, 94, 96]);
2519
+ function getMaterialTonalPalettes(color) {
2520
+ try {
2521
+ let argbColor = argbFromHex(color);
2522
+ const theme = themeFromSourceColor(argbColor, [
2523
+ {
2524
+ name: "m3-theme",
2525
+ value: argbColor,
2526
+ blend: true
2527
+ }
2528
+ ]);
2529
+ return theme.palettes;
2530
+ } catch (e) {
2531
+ throw new Error("Cannot parse the specified color " + color + ". Please verify it is a hex color (ex. #ffffff or ffffff).");
2532
+ }
2533
+ }
2534
+ function getColorTonalPalettes(color) {
2535
+ const tonalPalettes = getMaterialTonalPalettes(color);
2536
+ const palettes = /* @__PURE__ */ new Map();
2537
+ for (const [key, palette] of Object.entries(tonalPalettes)) {
2538
+ const paletteKey = key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
2539
+ const tones = paletteKey === "neutral" ? NEUTRAL_HUE_TONES : HUE_TONES;
2540
+ const colorPalette = /* @__PURE__ */ new Map();
2541
+ for (const tone of tones) {
2542
+ const color2 = hexFromArgb(palette.tone(tone));
2543
+ colorPalette.set(tone, color2);
2544
+ }
2545
+ palettes.set(paletteKey, colorPalette);
2546
+ }
2547
+ return palettes;
2548
+ }
2549
+ function getColorPalettesSCSS(colorPalettes) {
2550
+ let scss = "(\n";
2551
+ for (const [variant, palette] of colorPalettes.entries()) {
2552
+ scss += " " + variant + ": (\n";
2553
+ for (const [key, value] of palette.entries()) {
2554
+ scss += " " + key + ": " + value + ",\n";
2555
+ }
2556
+ scss += " ),\n";
2557
+ }
2558
+ scss += ");";
2559
+ return scss;
2560
+ }
2561
+ function generateSCSSTheme(colorPalettes, themeTypes, colorComment) {
2562
+ let scss = [
2563
+ "// This file was generated by running 'ng generate @angular/material:m3-theme'.",
2564
+ "// Proceed with caution if making changes to this file.",
2565
+ "",
2566
+ "@use 'sass:map';",
2567
+ "@use '@angular/material-experimental' as matx;",
2568
+ "",
2569
+ "// Note: " + colorComment,
2570
+ "$_palettes: " + getColorPalettesSCSS(colorPalettes),
2571
+ "",
2572
+ "$_rest: (",
2573
+ " secondary: map.get($_palettes, secondary),",
2574
+ " neutral: map.get($_palettes, neutral),",
2575
+ " neutral-variant: map.get($_palettes, neutral-variant),",
2576
+ " error: map.get($_palettes, error),",
2577
+ ");",
2578
+ "$_primary: map.merge(map.get($_palettes, primary), $_rest);",
2579
+ "$_tertiary: map.merge(map.get($_palettes, tertiary), $_rest);",
2580
+ ""
2581
+ ];
2582
+ for (const themeType of themeTypes) {
2583
+ scss = scss.concat([
2584
+ "$" + themeType + "-theme: matx.define-theme((",
2585
+ " color: (",
2586
+ " theme-type: " + themeType + ",",
2587
+ " primary: $_primary,",
2588
+ " tertiary: $_tertiary,",
2589
+ " )",
2590
+ "));"
2591
+ ]);
2592
+ }
2593
+ return scss.join("\n");
2594
+ }
2595
+ function createThemeFile(scss, tree, directory) {
2596
+ const filePath = directory ? directory + "m3-theme.scss" : "m3-theme.scss";
2597
+ tree.create(filePath, scss);
2598
+ }
2599
+ function m3_theme_default(options) {
2600
+ return (tree, context) => __async(this, null, function* () {
2601
+ const colorPalettes = getColorTonalPalettes(options.primaryColor);
2602
+ let colorComment = "Color palettes are generated from primary: " + options.primaryColor;
2603
+ if (options.secondaryColor) {
2604
+ colorPalettes.set("secondary", getColorTonalPalettes(options.secondaryColor).get("primary"));
2605
+ colorComment += ", secondary: " + options.secondaryColor;
2606
+ }
2607
+ if (options.tertiaryColor) {
2608
+ colorPalettes.set("tertiary", getColorTonalPalettes(options.tertiaryColor).get("primary"));
2609
+ colorComment += ", tertiary: " + options.tertiaryColor;
2610
+ }
2611
+ if (options.neutralColor) {
2612
+ colorPalettes.set("neutral", getColorTonalPalettes(options.neutralColor).get("primary"));
2613
+ colorComment += ", neutral: " + options.neutralColor;
2614
+ }
2615
+ if (options.themeTypes.length === 0) {
2616
+ context.logger.info("No theme types specified, creating both light and dark themes.");
2617
+ options.themeTypes = ["light", "dark"];
2618
+ }
2619
+ const themeScss = generateSCSSTheme(colorPalettes, options.themeTypes, colorComment);
2620
+ createThemeFile(themeScss, tree, options.directory);
2621
+ });
2622
+ }
2623
+ // Annotate the CommonJS export names for ESM import in node:
2624
+ 0 && (module.exports = {
2625
+ generateSCSSTheme
2626
+ });
2627
+ /**
2628
+ * @license
2629
+ * Copyright 2021 Google LLC
2630
+ *
2631
+ * Licensed under the Apache License, Version 2.0 (the "License");
2632
+ * you may not use this file except in compliance with the License.
2633
+ * You may obtain a copy of the License at
2634
+ *
2635
+ * http://www.apache.org/licenses/LICENSE-2.0
2636
+ *
2637
+ * Unless required by applicable law or agreed to in writing, software
2638
+ * distributed under the License is distributed on an "AS IS" BASIS,
2639
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2640
+ * See the License for the specific language governing permissions and
2641
+ * limitations under the License.
2642
+ */
2643
+ /**
2644
+ * @license
2645
+ * Copyright 2022 Google LLC
2646
+ *
2647
+ * Licensed under the Apache License, Version 2.0 (the "License");
2648
+ * you may not use this file except in compliance with the License.
2649
+ * You may obtain a copy of the License at
2650
+ *
2651
+ * http://www.apache.org/licenses/LICENSE-2.0
2652
+ *
2653
+ * Unless required by applicable law or agreed to in writing, software
2654
+ * distributed under the License is distributed on an "AS IS" BASIS,
2655
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2656
+ * See the License for the specific language governing permissions and
2657
+ * limitations under the License.
2658
+ */
2659
+ /**
2660
+ * @license
2661
+ * Copyright 2023 Google LLC
2662
+ *
2663
+ * Licensed under the Apache License, Version 2.0 (the "License");
2664
+ * you may not use this file except in compliance with the License.
2665
+ * You may obtain a copy of the License at
2666
+ *
2667
+ * http://www.apache.org/licenses/LICENSE-2.0
2668
+ *
2669
+ * Unless required by applicable law or agreed to in writing, software
2670
+ * distributed under the License is distributed on an "AS IS" BASIS,
2671
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2672
+ * See the License for the specific language governing permissions and
2673
+ * limitations under the License.
2674
+ */
2675
+ /**
2676
+ * @license
2677
+ * Copyright Google LLC All Rights Reserved.
2678
+ *
2679
+ * Use of this source code is governed by an MIT-style license that can be
2680
+ * found in the LICENSE file at https://angular.io/license
2681
+ */
2682
+ //# sourceMappingURL=index_bundled.js.map