@flux-ui/application 3.0.0-next.39

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.
Files changed (59) hide show
  1. package/README.md +16 -0
  2. package/dist/component/FluxApplication.vue.d.ts +28 -0
  3. package/dist/component/FluxApplicationContent.vue.d.ts +24 -0
  4. package/dist/component/FluxApplicationHero.vue.d.ts +26 -0
  5. package/dist/component/FluxApplicationMenu.vue.d.ts +29 -0
  6. package/dist/component/FluxApplicationMenuAccount.vue.d.ts +29 -0
  7. package/dist/component/FluxApplicationMenuContext.vue.d.ts +15 -0
  8. package/dist/component/FluxApplicationMenuContextStack.vue.d.ts +6 -0
  9. package/dist/component/FluxApplicationMenuPromo.vue.d.ts +22 -0
  10. package/dist/component/FluxApplicationMenuToggle.vue.d.ts +3 -0
  11. package/dist/component/FluxApplicationSection.vue.d.ts +26 -0
  12. package/dist/component/FluxApplicationSide.vue.d.ts +20 -0
  13. package/dist/component/FluxApplicationTop.vue.d.ts +29 -0
  14. package/dist/component/index.d.ts +12 -0
  15. package/dist/composable/index.d.ts +3 -0
  16. package/dist/composable/useApplicationContextMenu.d.ts +7 -0
  17. package/dist/composable/useApplicationContextRegistration.d.ts +2 -0
  18. package/dist/composable/useApplicationInjection.d.ts +2 -0
  19. package/dist/composable/useApplicationMenu.d.ts +26 -0
  20. package/dist/data/index.d.ts +29 -0
  21. package/dist/index.css +746 -0
  22. package/dist/index.d.ts +3 -0
  23. package/dist/index.js +4331 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/routing/useNamedRoutes.d.ts +14 -0
  26. package/dist/routing/useRoute.d.ts +8 -0
  27. package/dist/types.d.ts +13 -0
  28. package/package.json +71 -0
  29. package/src/component/FluxApplication.vue +144 -0
  30. package/src/component/FluxApplicationContent.vue +37 -0
  31. package/src/component/FluxApplicationHero.vue +34 -0
  32. package/src/component/FluxApplicationMenu.vue +73 -0
  33. package/src/component/FluxApplicationMenuAccount.vue +47 -0
  34. package/src/component/FluxApplicationMenuContext.vue +78 -0
  35. package/src/component/FluxApplicationMenuContextStack.vue +53 -0
  36. package/src/component/FluxApplicationMenuPromo.vue +23 -0
  37. package/src/component/FluxApplicationMenuToggle.vue +30 -0
  38. package/src/component/FluxApplicationSection.vue +40 -0
  39. package/src/component/FluxApplicationSide.vue +16 -0
  40. package/src/component/FluxApplicationTop.vue +74 -0
  41. package/src/component/index.ts +12 -0
  42. package/src/composable/index.ts +3 -0
  43. package/src/composable/useApplicationContextMenu.ts +19 -0
  44. package/src/composable/useApplicationContextRegistration.ts +25 -0
  45. package/src/composable/useApplicationInjection.ts +12 -0
  46. package/src/composable/useApplicationMenu.ts +79 -0
  47. package/src/css/component/Application.module.scss +88 -0
  48. package/src/css/component/ApplicationContent.module.scss +119 -0
  49. package/src/css/component/ApplicationHero.module.scss +17 -0
  50. package/src/css/component/ApplicationMenu.module.scss +421 -0
  51. package/src/css/component/ApplicationSection.module.scss +43 -0
  52. package/src/css/component/ApplicationSide.module.scss +21 -0
  53. package/src/css/component/ApplicationTop.module.scss +111 -0
  54. package/src/data/index.ts +38 -0
  55. package/src/index.ts +3 -0
  56. package/src/routing/useNamedRoutes.ts +34 -0
  57. package/src/routing/useRoute.ts +11 -0
  58. package/src/types.d.ts +13 -0
  59. package/tsconfig.json +7 -0
package/dist/index.js ADDED
@@ -0,0 +1,4331 @@
1
+ import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, customRef, defineComponent, getCurrentInstance, h, inject, markRaw, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, shallowRef, toDisplayString, toRef, unref, useSlots, watch, withCtx } from "vue";
2
+ import { DateTime } from "luxon";
3
+ import { FluxFadeTransition, FluxFlyout, FluxIcon, FluxMenu, FluxMenuItem, FluxPane, FluxRouteTransition, FluxSecondaryButton, FluxSpacer, FluxTabBar } from "@flux-ui/components";
4
+ //#region ../../node_modules/.bun/@basmilius+utils@3.19.0/node_modules/@basmilius/utils/dist/index.mjs
5
+ function x$2(e) {
6
+ let t = {};
7
+ do {
8
+ if (e.name === ``) break;
9
+ for (let [n, r] of Object.entries(Object.getOwnPropertyDescriptors(e.prototype))) [
10
+ `constructor`,
11
+ `clone`,
12
+ `toJSON`
13
+ ].includes(n) || !r.get && !r.set || (t[n] = r);
14
+ } while (e = Object.getPrototypeOf(e));
15
+ return t;
16
+ }
17
+ function G$1(e, t, n) {
18
+ e.prototype[t] = n;
19
+ }
20
+ function K$1(e, t, n) {
21
+ Object.defineProperty(e, t, { value: n });
22
+ }
23
+ //#endregion
24
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseNumber.js
25
+ var parseNumber = (color, len) => {
26
+ if (typeof color !== "number") return;
27
+ if (len === 3) return {
28
+ mode: "rgb",
29
+ r: (color >> 8 & 15 | color >> 4 & 240) / 255,
30
+ g: (color >> 4 & 15 | color & 240) / 255,
31
+ b: (color & 15 | color << 4 & 240) / 255
32
+ };
33
+ if (len === 4) return {
34
+ mode: "rgb",
35
+ r: (color >> 12 & 15 | color >> 8 & 240) / 255,
36
+ g: (color >> 8 & 15 | color >> 4 & 240) / 255,
37
+ b: (color >> 4 & 15 | color & 240) / 255,
38
+ alpha: (color & 15 | color << 4 & 240) / 255
39
+ };
40
+ if (len === 6) return {
41
+ mode: "rgb",
42
+ r: (color >> 16 & 255) / 255,
43
+ g: (color >> 8 & 255) / 255,
44
+ b: (color & 255) / 255
45
+ };
46
+ if (len === 8) return {
47
+ mode: "rgb",
48
+ r: (color >> 24 & 255) / 255,
49
+ g: (color >> 16 & 255) / 255,
50
+ b: (color >> 8 & 255) / 255,
51
+ alpha: (color & 255) / 255
52
+ };
53
+ };
54
+ //#endregion
55
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/colors/named.js
56
+ var named = {
57
+ aliceblue: 15792383,
58
+ antiquewhite: 16444375,
59
+ aqua: 65535,
60
+ aquamarine: 8388564,
61
+ azure: 15794175,
62
+ beige: 16119260,
63
+ bisque: 16770244,
64
+ black: 0,
65
+ blanchedalmond: 16772045,
66
+ blue: 255,
67
+ blueviolet: 9055202,
68
+ brown: 10824234,
69
+ burlywood: 14596231,
70
+ cadetblue: 6266528,
71
+ chartreuse: 8388352,
72
+ chocolate: 13789470,
73
+ coral: 16744272,
74
+ cornflowerblue: 6591981,
75
+ cornsilk: 16775388,
76
+ crimson: 14423100,
77
+ cyan: 65535,
78
+ darkblue: 139,
79
+ darkcyan: 35723,
80
+ darkgoldenrod: 12092939,
81
+ darkgray: 11119017,
82
+ darkgreen: 25600,
83
+ darkgrey: 11119017,
84
+ darkkhaki: 12433259,
85
+ darkmagenta: 9109643,
86
+ darkolivegreen: 5597999,
87
+ darkorange: 16747520,
88
+ darkorchid: 10040012,
89
+ darkred: 9109504,
90
+ darksalmon: 15308410,
91
+ darkseagreen: 9419919,
92
+ darkslateblue: 4734347,
93
+ darkslategray: 3100495,
94
+ darkslategrey: 3100495,
95
+ darkturquoise: 52945,
96
+ darkviolet: 9699539,
97
+ deeppink: 16716947,
98
+ deepskyblue: 49151,
99
+ dimgray: 6908265,
100
+ dimgrey: 6908265,
101
+ dodgerblue: 2003199,
102
+ firebrick: 11674146,
103
+ floralwhite: 16775920,
104
+ forestgreen: 2263842,
105
+ fuchsia: 16711935,
106
+ gainsboro: 14474460,
107
+ ghostwhite: 16316671,
108
+ gold: 16766720,
109
+ goldenrod: 14329120,
110
+ gray: 8421504,
111
+ green: 32768,
112
+ greenyellow: 11403055,
113
+ grey: 8421504,
114
+ honeydew: 15794160,
115
+ hotpink: 16738740,
116
+ indianred: 13458524,
117
+ indigo: 4915330,
118
+ ivory: 16777200,
119
+ khaki: 15787660,
120
+ lavender: 15132410,
121
+ lavenderblush: 16773365,
122
+ lawngreen: 8190976,
123
+ lemonchiffon: 16775885,
124
+ lightblue: 11393254,
125
+ lightcoral: 15761536,
126
+ lightcyan: 14745599,
127
+ lightgoldenrodyellow: 16448210,
128
+ lightgray: 13882323,
129
+ lightgreen: 9498256,
130
+ lightgrey: 13882323,
131
+ lightpink: 16758465,
132
+ lightsalmon: 16752762,
133
+ lightseagreen: 2142890,
134
+ lightskyblue: 8900346,
135
+ lightslategray: 7833753,
136
+ lightslategrey: 7833753,
137
+ lightsteelblue: 11584734,
138
+ lightyellow: 16777184,
139
+ lime: 65280,
140
+ limegreen: 3329330,
141
+ linen: 16445670,
142
+ magenta: 16711935,
143
+ maroon: 8388608,
144
+ mediumaquamarine: 6737322,
145
+ mediumblue: 205,
146
+ mediumorchid: 12211667,
147
+ mediumpurple: 9662683,
148
+ mediumseagreen: 3978097,
149
+ mediumslateblue: 8087790,
150
+ mediumspringgreen: 64154,
151
+ mediumturquoise: 4772300,
152
+ mediumvioletred: 13047173,
153
+ midnightblue: 1644912,
154
+ mintcream: 16121850,
155
+ mistyrose: 16770273,
156
+ moccasin: 16770229,
157
+ navajowhite: 16768685,
158
+ navy: 128,
159
+ oldlace: 16643558,
160
+ olive: 8421376,
161
+ olivedrab: 7048739,
162
+ orange: 16753920,
163
+ orangered: 16729344,
164
+ orchid: 14315734,
165
+ palegoldenrod: 15657130,
166
+ palegreen: 10025880,
167
+ paleturquoise: 11529966,
168
+ palevioletred: 14381203,
169
+ papayawhip: 16773077,
170
+ peachpuff: 16767673,
171
+ peru: 13468991,
172
+ pink: 16761035,
173
+ plum: 14524637,
174
+ powderblue: 11591910,
175
+ purple: 8388736,
176
+ rebeccapurple: 6697881,
177
+ red: 16711680,
178
+ rosybrown: 12357519,
179
+ royalblue: 4286945,
180
+ saddlebrown: 9127187,
181
+ salmon: 16416882,
182
+ sandybrown: 16032864,
183
+ seagreen: 3050327,
184
+ seashell: 16774638,
185
+ sienna: 10506797,
186
+ silver: 12632256,
187
+ skyblue: 8900331,
188
+ slateblue: 6970061,
189
+ slategray: 7372944,
190
+ slategrey: 7372944,
191
+ snow: 16775930,
192
+ springgreen: 65407,
193
+ steelblue: 4620980,
194
+ tan: 13808780,
195
+ teal: 32896,
196
+ thistle: 14204888,
197
+ tomato: 16737095,
198
+ turquoise: 4251856,
199
+ violet: 15631086,
200
+ wheat: 16113331,
201
+ white: 16777215,
202
+ whitesmoke: 16119285,
203
+ yellow: 16776960,
204
+ yellowgreen: 10145074
205
+ };
206
+ //#endregion
207
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseNamed.js
208
+ var parseNamed = (color) => {
209
+ return parseNumber(named[color.toLowerCase()], 6);
210
+ };
211
+ //#endregion
212
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseHex.js
213
+ var hex = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
214
+ var parseHex = (color) => {
215
+ let match;
216
+ return (match = color.match(hex)) ? parseNumber(parseInt(match[1], 16), match[1].length) : void 0;
217
+ };
218
+ //#endregion
219
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/util/regex.js
220
+ var num$1 = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";
221
+ `${num$1}`;
222
+ var per = `${num$1}%`;
223
+ `${num$1}`;
224
+ var num_per = `(?:${num$1}%|${num$1})`;
225
+ var num_per_none = `(?:${num$1}%|${num$1}|none)`;
226
+ var hue$1 = `(?:${num$1}(deg|grad|rad|turn)|${num$1})`;
227
+ `${num$1}${num$1}`;
228
+ var c$1 = `\\s*,\\s*`;
229
+ new RegExp("^" + num_per_none + "$");
230
+ //#endregion
231
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js
232
+ var rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c$1}${num$1}${c$1}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
233
+ var rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c$1}${per}${c$1}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
234
+ var parseRgbLegacy = (color) => {
235
+ let res = { mode: "rgb" };
236
+ let match;
237
+ if (match = color.match(rgb_num_old)) {
238
+ if (match[1] !== void 0) res.r = match[1] / 255;
239
+ if (match[2] !== void 0) res.g = match[2] / 255;
240
+ if (match[3] !== void 0) res.b = match[3] / 255;
241
+ } else if (match = color.match(rgb_per_old)) {
242
+ if (match[1] !== void 0) res.r = match[1] / 100;
243
+ if (match[2] !== void 0) res.g = match[2] / 100;
244
+ if (match[3] !== void 0) res.b = match[3] / 100;
245
+ } else return;
246
+ if (match[4] !== void 0) res.alpha = Math.max(0, Math.min(1, match[4] / 100));
247
+ else if (match[5] !== void 0) res.alpha = Math.max(0, Math.min(1, +match[5]));
248
+ return res;
249
+ };
250
+ //#endregion
251
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/_prepare.js
252
+ var prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "object" ? parse(color) : color.mode !== void 0 ? color : mode ? {
253
+ ...color,
254
+ mode
255
+ } : void 0;
256
+ //#endregion
257
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/converter.js
258
+ var converter = (target_mode = "rgb") => (color) => (color = prepare(color, target_mode)) !== void 0 ? color.mode === target_mode ? color : converters[color.mode][target_mode] ? converters[color.mode][target_mode](color) : target_mode === "rgb" ? converters[color.mode].rgb(color) : converters.rgb[target_mode](converters[color.mode].rgb(color)) : void 0;
259
+ //#endregion
260
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/modes.js
261
+ var converters = {};
262
+ var modes = {};
263
+ var parsers = [];
264
+ var colorProfiles = {};
265
+ var identity = (v) => v;
266
+ var useMode = (definition) => {
267
+ converters[definition.mode] = {
268
+ ...converters[definition.mode],
269
+ ...definition.toMode
270
+ };
271
+ Object.keys(definition.fromMode || {}).forEach((k) => {
272
+ if (!converters[k]) converters[k] = {};
273
+ converters[k][definition.mode] = definition.fromMode[k];
274
+ });
275
+ if (!definition.ranges) definition.ranges = {};
276
+ if (!definition.difference) definition.difference = {};
277
+ definition.channels.forEach((channel) => {
278
+ if (definition.ranges[channel] === void 0) definition.ranges[channel] = [0, 1];
279
+ if (!definition.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
280
+ if (typeof definition.interpolate[channel] === "function") definition.interpolate[channel] = { use: definition.interpolate[channel] };
281
+ if (!definition.interpolate[channel].fixup) definition.interpolate[channel].fixup = identity;
282
+ });
283
+ modes[definition.mode] = definition;
284
+ (definition.parse || []).forEach((parser) => {
285
+ useParser(parser, definition.mode);
286
+ });
287
+ return converter(definition.mode);
288
+ };
289
+ var getMode = (mode) => modes[mode];
290
+ var useParser = (parser, mode) => {
291
+ if (typeof parser === "string") {
292
+ if (!mode) throw new Error(`'mode' required when 'parser' is a string`);
293
+ colorProfiles[parser] = mode;
294
+ } else if (typeof parser === "function") {
295
+ if (parsers.indexOf(parser) < 0) parsers.push(parser);
296
+ }
297
+ };
298
+ //#endregion
299
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/parse.js
300
+ var IdentStartCodePoint = /[^\x00-\x7F]|[a-zA-Z_]/;
301
+ var IdentCodePoint = /[^\x00-\x7F]|[-\w]/;
302
+ var Tok = {
303
+ Function: "function",
304
+ Ident: "ident",
305
+ Number: "number",
306
+ Percentage: "percentage",
307
+ ParenClose: ")",
308
+ None: "none",
309
+ Hue: "hue",
310
+ Alpha: "alpha"
311
+ };
312
+ var _i = 0;
313
+ function is_num(chars) {
314
+ let ch = chars[_i];
315
+ let ch1 = chars[_i + 1];
316
+ if (ch === "-" || ch === "+") return /\d/.test(ch1) || ch1 === "." && /\d/.test(chars[_i + 2]);
317
+ if (ch === ".") return /\d/.test(ch1);
318
+ return /\d/.test(ch);
319
+ }
320
+ function is_ident(chars) {
321
+ if (_i >= chars.length) return false;
322
+ let ch = chars[_i];
323
+ if (IdentStartCodePoint.test(ch)) return true;
324
+ if (ch === "-") {
325
+ if (chars.length - _i < 2) return false;
326
+ let ch1 = chars[_i + 1];
327
+ if (ch1 === "-" || IdentStartCodePoint.test(ch1)) return true;
328
+ return false;
329
+ }
330
+ return false;
331
+ }
332
+ var huenits = {
333
+ deg: 1,
334
+ rad: 180 / Math.PI,
335
+ grad: 9 / 10,
336
+ turn: 360
337
+ };
338
+ function num(chars) {
339
+ let value = "";
340
+ if (chars[_i] === "-" || chars[_i] === "+") value += chars[_i++];
341
+ value += digits(chars);
342
+ if (chars[_i] === "." && /\d/.test(chars[_i + 1])) value += chars[_i++] + digits(chars);
343
+ if (chars[_i] === "e" || chars[_i] === "E") {
344
+ if ((chars[_i + 1] === "-" || chars[_i + 1] === "+") && /\d/.test(chars[_i + 2])) value += chars[_i++] + chars[_i++] + digits(chars);
345
+ else if (/\d/.test(chars[_i + 1])) value += chars[_i++] + digits(chars);
346
+ }
347
+ if (is_ident(chars)) {
348
+ let id = ident(chars);
349
+ if (id === "deg" || id === "rad" || id === "turn" || id === "grad") return {
350
+ type: Tok.Hue,
351
+ value: value * huenits[id]
352
+ };
353
+ return;
354
+ }
355
+ if (chars[_i] === "%") {
356
+ _i++;
357
+ return {
358
+ type: Tok.Percentage,
359
+ value: +value
360
+ };
361
+ }
362
+ return {
363
+ type: Tok.Number,
364
+ value: +value
365
+ };
366
+ }
367
+ function digits(chars) {
368
+ let v = "";
369
+ while (/\d/.test(chars[_i])) v += chars[_i++];
370
+ return v;
371
+ }
372
+ function ident(chars) {
373
+ let v = "";
374
+ while (_i < chars.length && IdentCodePoint.test(chars[_i])) v += chars[_i++];
375
+ return v;
376
+ }
377
+ function identlike(chars) {
378
+ let v = ident(chars);
379
+ if (chars[_i] === "(") {
380
+ _i++;
381
+ return {
382
+ type: Tok.Function,
383
+ value: v
384
+ };
385
+ }
386
+ if (v === "none") return {
387
+ type: Tok.None,
388
+ value: void 0
389
+ };
390
+ return {
391
+ type: Tok.Ident,
392
+ value: v
393
+ };
394
+ }
395
+ function tokenize(str = "") {
396
+ let chars = str.trim();
397
+ let tokens = [];
398
+ let ch;
399
+ _i = 0;
400
+ while (_i < chars.length) {
401
+ ch = chars[_i++];
402
+ if (ch === "\n" || ch === " " || ch === " ") {
403
+ while (_i < chars.length && (chars[_i] === "\n" || chars[_i] === " " || chars[_i] === " ")) _i++;
404
+ continue;
405
+ }
406
+ if (ch === ",") return;
407
+ if (ch === ")") {
408
+ tokens.push({ type: Tok.ParenClose });
409
+ continue;
410
+ }
411
+ if (ch === "+") {
412
+ _i--;
413
+ if (is_num(chars)) {
414
+ tokens.push(num(chars));
415
+ continue;
416
+ }
417
+ return;
418
+ }
419
+ if (ch === "-") {
420
+ _i--;
421
+ if (is_num(chars)) {
422
+ tokens.push(num(chars));
423
+ continue;
424
+ }
425
+ if (is_ident(chars)) {
426
+ tokens.push({
427
+ type: Tok.Ident,
428
+ value: ident(chars)
429
+ });
430
+ continue;
431
+ }
432
+ return;
433
+ }
434
+ if (ch === ".") {
435
+ _i--;
436
+ if (is_num(chars)) {
437
+ tokens.push(num(chars));
438
+ continue;
439
+ }
440
+ return;
441
+ }
442
+ if (ch === "/") {
443
+ while (_i < chars.length && (chars[_i] === "\n" || chars[_i] === " " || chars[_i] === " ")) _i++;
444
+ let alpha;
445
+ if (is_num(chars)) {
446
+ alpha = num(chars);
447
+ if (alpha.type !== Tok.Hue) {
448
+ tokens.push({
449
+ type: Tok.Alpha,
450
+ value: alpha
451
+ });
452
+ continue;
453
+ }
454
+ }
455
+ if (is_ident(chars)) {
456
+ if (ident(chars) === "none") {
457
+ tokens.push({
458
+ type: Tok.Alpha,
459
+ value: {
460
+ type: Tok.None,
461
+ value: void 0
462
+ }
463
+ });
464
+ continue;
465
+ }
466
+ }
467
+ return;
468
+ }
469
+ if (/\d/.test(ch)) {
470
+ _i--;
471
+ tokens.push(num(chars));
472
+ continue;
473
+ }
474
+ if (IdentStartCodePoint.test(ch)) {
475
+ _i--;
476
+ tokens.push(identlike(chars));
477
+ continue;
478
+ }
479
+ return;
480
+ }
481
+ return tokens;
482
+ }
483
+ function parseColorSyntax(tokens) {
484
+ tokens._i = 0;
485
+ let token = tokens[tokens._i++];
486
+ if (!token || token.type !== Tok.Function || token.value !== "color") return;
487
+ token = tokens[tokens._i++];
488
+ if (token.type !== Tok.Ident) return;
489
+ const mode = colorProfiles[token.value];
490
+ if (!mode) return;
491
+ const res = { mode };
492
+ const coords = consumeCoords(tokens, false);
493
+ if (!coords) return;
494
+ const channels = getMode(mode).channels;
495
+ for (let ii = 0, c, ch; ii < channels.length; ii++) {
496
+ c = coords[ii];
497
+ ch = channels[ii];
498
+ if (c.type !== Tok.None) {
499
+ res[ch] = c.type === Tok.Number ? c.value : c.value / 100;
500
+ if (ch === "alpha") res[ch] = Math.max(0, Math.min(1, res[ch]));
501
+ }
502
+ }
503
+ return res;
504
+ }
505
+ function consumeCoords(tokens, includeHue) {
506
+ const coords = [];
507
+ let token;
508
+ while (tokens._i < tokens.length) {
509
+ token = tokens[tokens._i++];
510
+ if (token.type === Tok.None || token.type === Tok.Number || token.type === Tok.Alpha || token.type === Tok.Percentage || includeHue && token.type === Tok.Hue) {
511
+ coords.push(token);
512
+ continue;
513
+ }
514
+ if (token.type === Tok.ParenClose) {
515
+ if (tokens._i < tokens.length) return;
516
+ continue;
517
+ }
518
+ return;
519
+ }
520
+ if (coords.length < 3 || coords.length > 4) return;
521
+ if (coords.length === 4) {
522
+ if (coords[3].type !== Tok.Alpha) return;
523
+ coords[3] = coords[3].value;
524
+ }
525
+ if (coords.length === 3) coords.push({
526
+ type: Tok.None,
527
+ value: void 0
528
+ });
529
+ return coords.every((c) => c.type !== Tok.Alpha) ? coords : void 0;
530
+ }
531
+ function parseModernSyntax(tokens, includeHue) {
532
+ tokens._i = 0;
533
+ let token = tokens[tokens._i++];
534
+ if (!token || token.type !== Tok.Function) return;
535
+ let coords = consumeCoords(tokens, includeHue);
536
+ if (!coords) return;
537
+ coords.unshift(token.value);
538
+ return coords;
539
+ }
540
+ var parse = (color) => {
541
+ if (typeof color !== "string") return;
542
+ const tokens = tokenize(color);
543
+ const parsed = tokens ? parseModernSyntax(tokens, true) : void 0;
544
+ let result = void 0;
545
+ let i = 0;
546
+ let len = parsers.length;
547
+ while (i < len) if ((result = parsers[i++](color, parsed)) !== void 0) return result;
548
+ return tokens ? parseColorSyntax(tokens) : void 0;
549
+ };
550
+ //#endregion
551
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseRgb.js
552
+ function parseRgb(color, parsed) {
553
+ if (!parsed || parsed[0] !== "rgb" && parsed[0] !== "rgba") return;
554
+ const res = { mode: "rgb" };
555
+ const [, r, g, b, alpha] = parsed;
556
+ if (r.type === Tok.Hue || g.type === Tok.Hue || b.type === Tok.Hue) return;
557
+ if (r.type !== Tok.None) res.r = r.type === Tok.Number ? r.value / 255 : r.value / 100;
558
+ if (g.type !== Tok.None) res.g = g.type === Tok.Number ? g.value / 255 : g.value / 100;
559
+ if (b.type !== Tok.None) res.b = b.type === Tok.Number ? b.value / 255 : b.value / 100;
560
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
561
+ return res;
562
+ }
563
+ //#endregion
564
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseTransparent.js
565
+ var parseTransparent = (c) => c === "transparent" ? {
566
+ mode: "rgb",
567
+ r: 0,
568
+ g: 0,
569
+ b: 0,
570
+ alpha: 0
571
+ } : void 0;
572
+ //#endregion
573
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/interpolate/lerp.js
574
+ var lerp = (a, b, t) => a + t * (b - a);
575
+ //#endregion
576
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/interpolate/piecewise.js
577
+ var get_classes = (arr) => {
578
+ let classes = [];
579
+ for (let i = 0; i < arr.length - 1; i++) {
580
+ let a = arr[i];
581
+ let b = arr[i + 1];
582
+ if (a === void 0 && b === void 0) classes.push(void 0);
583
+ else if (a !== void 0 && b !== void 0) classes.push([a, b]);
584
+ else classes.push(a !== void 0 ? [a, a] : [b, b]);
585
+ }
586
+ return classes;
587
+ };
588
+ var interpolatorPiecewise = (interpolator) => (arr) => {
589
+ let classes = get_classes(arr);
590
+ return (t) => {
591
+ let cls = t * classes.length;
592
+ let idx = t >= 1 ? classes.length - 1 : Math.max(Math.floor(cls), 0);
593
+ let pair = classes[idx];
594
+ return pair === void 0 ? void 0 : interpolator(pair[0], pair[1], cls - idx);
595
+ };
596
+ };
597
+ //#endregion
598
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/interpolate/linear.js
599
+ var interpolatorLinear = interpolatorPiecewise(lerp);
600
+ //#endregion
601
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/fixup/alpha.js
602
+ var fixupAlpha = (arr) => {
603
+ let some_defined = false;
604
+ let res = arr.map((v) => {
605
+ if (v !== void 0) {
606
+ some_defined = true;
607
+ return v;
608
+ }
609
+ return 1;
610
+ });
611
+ return some_defined ? res : arr;
612
+ };
613
+ //#endregion
614
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/definition.js
615
+ var definition$27 = {
616
+ mode: "rgb",
617
+ channels: [
618
+ "r",
619
+ "g",
620
+ "b",
621
+ "alpha"
622
+ ],
623
+ parse: [
624
+ parseRgb,
625
+ parseHex,
626
+ parseRgbLegacy,
627
+ parseNamed,
628
+ parseTransparent,
629
+ "srgb"
630
+ ],
631
+ serialize: "srgb",
632
+ interpolate: {
633
+ r: interpolatorLinear,
634
+ g: interpolatorLinear,
635
+ b: interpolatorLinear,
636
+ alpha: {
637
+ use: interpolatorLinear,
638
+ fixup: fixupAlpha
639
+ }
640
+ },
641
+ gamut: true,
642
+ white: {
643
+ r: 1,
644
+ g: 1,
645
+ b: 1
646
+ },
647
+ black: {
648
+ r: 0,
649
+ g: 0,
650
+ b: 0
651
+ }
652
+ };
653
+ //#endregion
654
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/a98/convertA98ToXyz65.js
655
+ var linearize$2 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
656
+ var convertA98ToXyz65 = (a98) => {
657
+ let r = linearize$2(a98.r);
658
+ let g = linearize$2(a98.g);
659
+ let b = linearize$2(a98.b);
660
+ let res = {
661
+ mode: "xyz65",
662
+ x: .5766690429101305 * r + .1855582379065463 * g + .1882286462349947 * b,
663
+ y: .297344975250536 * r + .6273635662554661 * g + .0752914584939979 * b,
664
+ z: .0270313613864123 * r + .0706888525358272 * g + .9913375368376386 * b
665
+ };
666
+ if (a98.alpha !== void 0) res.alpha = a98.alpha;
667
+ return res;
668
+ };
669
+ //#endregion
670
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/a98/convertXyz65ToA98.js
671
+ var gamma$2 = (v) => Math.pow(Math.abs(v), 256 / 563) * Math.sign(v);
672
+ var convertXyz65ToA98 = ({ x, y, z, alpha }) => {
673
+ if (x === void 0) x = 0;
674
+ if (y === void 0) y = 0;
675
+ if (z === void 0) z = 0;
676
+ let res = {
677
+ mode: "a98",
678
+ r: gamma$2(x * 2.0415879038107465 - y * .5650069742788597 - .3447313507783297 * z),
679
+ g: gamma$2(x * -.9692436362808798 + y * 1.8759675015077206 + .0415550574071756 * z),
680
+ b: gamma$2(x * .0134442806320312 - y * .1183623922310184 + 1.0151749943912058 * z)
681
+ };
682
+ if (alpha !== void 0) res.alpha = alpha;
683
+ return res;
684
+ };
685
+ //#endregion
686
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lrgb/convertRgbToLrgb.js
687
+ var fn$3 = (c = 0) => {
688
+ const abs = Math.abs(c);
689
+ if (abs <= .04045) return c / 12.92;
690
+ return (Math.sign(c) || 1) * Math.pow((abs + .055) / 1.055, 2.4);
691
+ };
692
+ var convertRgbToLrgb = ({ r, g, b, alpha }) => {
693
+ let res = {
694
+ mode: "lrgb",
695
+ r: fn$3(r),
696
+ g: fn$3(g),
697
+ b: fn$3(b)
698
+ };
699
+ if (alpha !== void 0) res.alpha = alpha;
700
+ return res;
701
+ };
702
+ //#endregion
703
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/convertRgbToXyz65.js
704
+ var convertRgbToXyz65 = (rgb) => {
705
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb);
706
+ let res = {
707
+ mode: "xyz65",
708
+ x: .4123907992659593 * r + .357584339383878 * g + .1804807884018343 * b,
709
+ y: .2126390058715102 * r + .715168678767756 * g + .0721923153607337 * b,
710
+ z: .0193308187155918 * r + .119194779794626 * g + .9505321522496607 * b
711
+ };
712
+ if (alpha !== void 0) res.alpha = alpha;
713
+ return res;
714
+ };
715
+ //#endregion
716
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lrgb/convertLrgbToRgb.js
717
+ var fn$2 = (c = 0) => {
718
+ const abs = Math.abs(c);
719
+ if (abs > .0031308) return (Math.sign(c) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
720
+ return c * 12.92;
721
+ };
722
+ var convertLrgbToRgb = ({ r, g, b, alpha }, mode = "rgb") => {
723
+ let res = {
724
+ mode,
725
+ r: fn$2(r),
726
+ g: fn$2(g),
727
+ b: fn$2(b)
728
+ };
729
+ if (alpha !== void 0) res.alpha = alpha;
730
+ return res;
731
+ };
732
+ //#endregion
733
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToRgb.js
734
+ var convertXyz65ToRgb = ({ x, y, z, alpha }) => {
735
+ if (x === void 0) x = 0;
736
+ if (y === void 0) y = 0;
737
+ if (z === void 0) z = 0;
738
+ let res = convertLrgbToRgb({
739
+ r: x * 3.2409699419045226 - y * 1.537383177570094 - .4986107602930034 * z,
740
+ g: x * -.9692436362808796 + y * 1.8759675015077204 + .0415550574071756 * z,
741
+ b: x * .0556300796969936 - y * .2039769588889765 + 1.0569715142428784 * z
742
+ });
743
+ if (alpha !== void 0) res.alpha = alpha;
744
+ return res;
745
+ };
746
+ //#endregion
747
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/a98/definition.js
748
+ var definition$26 = {
749
+ ...definition$27,
750
+ mode: "a98",
751
+ parse: ["a98-rgb"],
752
+ serialize: "a98-rgb",
753
+ fromMode: {
754
+ rgb: (color) => convertXyz65ToA98(convertRgbToXyz65(color)),
755
+ xyz65: convertXyz65ToA98
756
+ },
757
+ toMode: {
758
+ rgb: (color) => convertXyz65ToRgb(convertA98ToXyz65(color)),
759
+ xyz65: convertA98ToXyz65
760
+ }
761
+ };
762
+ //#endregion
763
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/util/normalizeHue.js
764
+ var normalizeHue = (hue) => (hue = hue % 360) < 0 ? hue + 360 : hue;
765
+ //#endregion
766
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/fixup/hue.js
767
+ var hue = (hues, fn) => {
768
+ return hues.map((hue, idx, arr) => {
769
+ if (hue === void 0) return hue;
770
+ let normalized = normalizeHue(hue);
771
+ if (idx === 0 || hues[idx - 1] === void 0) return normalized;
772
+ return fn(normalized - normalizeHue(arr[idx - 1]));
773
+ }).reduce((acc, curr) => {
774
+ if (!acc.length || curr === void 0 || acc[acc.length - 1] === void 0) {
775
+ acc.push(curr);
776
+ return acc;
777
+ }
778
+ acc.push(curr + acc[acc.length - 1]);
779
+ return acc;
780
+ }, []);
781
+ };
782
+ var fixupHueShorter = (arr) => hue(arr, (d) => Math.abs(d) <= 180 ? d : d - 360 * Math.sign(d));
783
+ //#endregion
784
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/cubehelix/constants.js
785
+ var M = [
786
+ -.14861,
787
+ 1.78277,
788
+ -.29227,
789
+ -.90649,
790
+ 1.97294,
791
+ 0
792
+ ];
793
+ var degToRad = Math.PI / 180;
794
+ var radToDeg = 180 / Math.PI;
795
+ //#endregion
796
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/cubehelix/convertRgbToCubehelix.js
797
+ var DE = M[3] * M[4];
798
+ var BE = M[1] * M[4];
799
+ var BCAD = M[1] * M[2] - M[0] * M[3];
800
+ var convertRgbToCubehelix = ({ r, g, b, alpha }) => {
801
+ if (r === void 0) r = 0;
802
+ if (g === void 0) g = 0;
803
+ if (b === void 0) b = 0;
804
+ let l = (BCAD * b + r * DE - g * BE) / (BCAD + DE - BE);
805
+ let x = b - l;
806
+ let y = (M[4] * (g - l) - M[2] * x) / M[3];
807
+ let res = {
808
+ mode: "cubehelix",
809
+ l,
810
+ s: l === 0 || l === 1 ? void 0 : Math.sqrt(x * x + y * y) / (M[4] * l * (1 - l))
811
+ };
812
+ if (res.s) res.h = Math.atan2(y, x) * radToDeg - 120;
813
+ if (alpha !== void 0) res.alpha = alpha;
814
+ return res;
815
+ };
816
+ //#endregion
817
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/cubehelix/convertCubehelixToRgb.js
818
+ var convertCubehelixToRgb = ({ h, s, l, alpha }) => {
819
+ let res = { mode: "rgb" };
820
+ h = (h === void 0 ? 0 : h + 120) * degToRad;
821
+ if (l === void 0) l = 0;
822
+ let amp = s === void 0 ? 0 : s * l * (1 - l);
823
+ let cosh = Math.cos(h);
824
+ let sinh = Math.sin(h);
825
+ res.r = l + amp * (M[0] * cosh + M[1] * sinh);
826
+ res.g = l + amp * (M[2] * cosh + M[3] * sinh);
827
+ res.b = l + amp * (M[4] * cosh + M[5] * sinh);
828
+ if (alpha !== void 0) res.alpha = alpha;
829
+ return res;
830
+ };
831
+ //#endregion
832
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/difference.js
833
+ var differenceHueSaturation = (std, smp) => {
834
+ if (std.h === void 0 || smp.h === void 0 || !std.s || !smp.s) return 0;
835
+ let std_h = normalizeHue(std.h);
836
+ let smp_h = normalizeHue(smp.h);
837
+ let dH = Math.sin((smp_h - std_h + 360) / 2 * Math.PI / 180);
838
+ return 2 * Math.sqrt(std.s * smp.s) * dH;
839
+ };
840
+ var differenceHueNaive = (std, smp) => {
841
+ if (std.h === void 0 || smp.h === void 0) return 0;
842
+ let std_h = normalizeHue(std.h);
843
+ let smp_h = normalizeHue(smp.h);
844
+ if (Math.abs(smp_h - std_h) > 180) return std_h - (smp_h - 360 * Math.sign(smp_h - std_h));
845
+ return smp_h - std_h;
846
+ };
847
+ var differenceHueChroma = (std, smp) => {
848
+ if (std.h === void 0 || smp.h === void 0 || !std.c || !smp.c) return 0;
849
+ let std_h = normalizeHue(std.h);
850
+ let smp_h = normalizeHue(smp.h);
851
+ let dH = Math.sin((smp_h - std_h + 360) / 2 * Math.PI / 180);
852
+ return 2 * Math.sqrt(std.c * smp.c) * dH;
853
+ };
854
+ //#endregion
855
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/average.js
856
+ var averageAngle = (val) => {
857
+ let sum = val.reduce((sum, val) => {
858
+ if (val !== void 0) {
859
+ let rad = val * Math.PI / 180;
860
+ sum.sin += Math.sin(rad);
861
+ sum.cos += Math.cos(rad);
862
+ }
863
+ return sum;
864
+ }, {
865
+ sin: 0,
866
+ cos: 0
867
+ });
868
+ let angle = Math.atan2(sum.sin, sum.cos) * 180 / Math.PI;
869
+ return angle < 0 ? 360 + angle : angle;
870
+ };
871
+ //#endregion
872
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/cubehelix/definition.js
873
+ var definition$25 = {
874
+ mode: "cubehelix",
875
+ channels: [
876
+ "h",
877
+ "s",
878
+ "l",
879
+ "alpha"
880
+ ],
881
+ parse: ["--cubehelix"],
882
+ serialize: "--cubehelix",
883
+ ranges: {
884
+ h: [0, 360],
885
+ s: [0, 4.614],
886
+ l: [0, 1]
887
+ },
888
+ fromMode: { rgb: convertRgbToCubehelix },
889
+ toMode: { rgb: convertCubehelixToRgb },
890
+ interpolate: {
891
+ h: {
892
+ use: interpolatorLinear,
893
+ fixup: fixupHueShorter
894
+ },
895
+ s: interpolatorLinear,
896
+ l: interpolatorLinear,
897
+ alpha: {
898
+ use: interpolatorLinear,
899
+ fixup: fixupAlpha
900
+ }
901
+ },
902
+ difference: { h: differenceHueSaturation },
903
+ average: { h: averageAngle }
904
+ };
905
+ //#endregion
906
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lch/convertLabToLch.js
907
+ var convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
908
+ if (a === void 0) a = 0;
909
+ if (b === void 0) b = 0;
910
+ let c = Math.sqrt(a * a + b * b);
911
+ let res = {
912
+ mode,
913
+ l,
914
+ c
915
+ };
916
+ if (c) res.h = normalizeHue(Math.atan2(b, a) * 180 / Math.PI);
917
+ if (alpha !== void 0) res.alpha = alpha;
918
+ return res;
919
+ };
920
+ //#endregion
921
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lch/convertLchToLab.js
922
+ var convertLchToLab = ({ l, c, h, alpha }, mode = "lab") => {
923
+ if (h === void 0) h = 0;
924
+ let res = {
925
+ mode,
926
+ l,
927
+ a: c ? c * Math.cos(h / 180 * Math.PI) : 0,
928
+ b: c ? c * Math.sin(h / 180 * Math.PI) : 0
929
+ };
930
+ if (alpha !== void 0) res.alpha = alpha;
931
+ return res;
932
+ };
933
+ //#endregion
934
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/constants.js
935
+ var k$4 = Math.pow(29, 3) / Math.pow(3, 3);
936
+ var e$2 = Math.pow(6, 3) / Math.pow(29, 3);
937
+ //#endregion
938
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/constants.js
939
+ var D50 = {
940
+ X: .3457 / .3585,
941
+ Y: 1,
942
+ Z: .2958 / .3585
943
+ };
944
+ var D65 = {
945
+ X: .3127 / .329,
946
+ Y: 1,
947
+ Z: .3583 / .329
948
+ };
949
+ Math.pow(29, 3) / Math.pow(3, 3);
950
+ Math.pow(6, 3) / Math.pow(29, 3);
951
+ //#endregion
952
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToXyz65.js
953
+ var fn$1 = (v) => Math.pow(v, 3) > e$2 ? Math.pow(v, 3) : (116 * v - 16) / k$4;
954
+ var convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
955
+ if (l === void 0) l = 0;
956
+ if (a === void 0) a = 0;
957
+ if (b === void 0) b = 0;
958
+ let fy = (l + 16) / 116;
959
+ let fx = a / 500 + fy;
960
+ let fz = fy - b / 200;
961
+ let res = {
962
+ mode: "xyz65",
963
+ x: fn$1(fx) * D65.X,
964
+ y: fn$1(fy) * D65.Y,
965
+ z: fn$1(fz) * D65.Z
966
+ };
967
+ if (alpha !== void 0) res.alpha = alpha;
968
+ return res;
969
+ };
970
+ //#endregion
971
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToRgb.js
972
+ var convertLab65ToRgb = (lab) => convertXyz65ToRgb(convertLab65ToXyz65(lab));
973
+ //#endregion
974
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/convertXyz65ToLab65.js
975
+ var f$2 = (value) => value > e$2 ? Math.cbrt(value) : (k$4 * value + 16) / 116;
976
+ var convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
977
+ if (x === void 0) x = 0;
978
+ if (y === void 0) y = 0;
979
+ if (z === void 0) z = 0;
980
+ let f0 = f$2(x / D65.X);
981
+ let f1 = f$2(y / D65.Y);
982
+ let f2 = f$2(z / D65.Z);
983
+ let res = {
984
+ mode: "lab65",
985
+ l: 116 * f1 - 16,
986
+ a: 500 * (f0 - f1),
987
+ b: 200 * (f1 - f2)
988
+ };
989
+ if (alpha !== void 0) res.alpha = alpha;
990
+ return res;
991
+ };
992
+ //#endregion
993
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/convertRgbToLab65.js
994
+ var convertRgbToLab65 = (rgb) => {
995
+ let res = convertXyz65ToLab65(convertRgbToXyz65(rgb));
996
+ if (rgb.r === rgb.b && rgb.b === rgb.g) res.a = res.b = 0;
997
+ return res;
998
+ };
999
+ //#endregion
1000
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/dlch/constants.js
1001
+ var θ = 26 / 180 * Math.PI;
1002
+ var cosθ = Math.cos(θ);
1003
+ var sinθ = Math.sin(θ);
1004
+ var factor = 100 / Math.log(139 / 100);
1005
+ //#endregion
1006
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/dlch/convertDlchToLab65.js
1007
+ var convertDlchToLab65 = ({ l, c, h, alpha }) => {
1008
+ if (l === void 0) l = 0;
1009
+ if (c === void 0) c = 0;
1010
+ if (h === void 0) h = 0;
1011
+ let res = {
1012
+ mode: "lab65",
1013
+ l: (Math.exp(l * 1 / factor) - 1) / .0039
1014
+ };
1015
+ let G = (Math.exp(.0435 * c * 1 * 1) - 1) / .075;
1016
+ let e = G * Math.cos(h / 180 * Math.PI - θ);
1017
+ let f = G * Math.sin(h / 180 * Math.PI - θ);
1018
+ res.a = e * cosθ - f / .83 * sinθ;
1019
+ res.b = e * sinθ + f / .83 * cosθ;
1020
+ if (alpha !== void 0) res.alpha = alpha;
1021
+ return res;
1022
+ };
1023
+ //#endregion
1024
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/dlch/convertLab65ToDlch.js
1025
+ var convertLab65ToDlch = ({ l, a, b, alpha }) => {
1026
+ if (l === void 0) l = 0;
1027
+ if (a === void 0) a = 0;
1028
+ if (b === void 0) b = 0;
1029
+ let e = a * cosθ + b * sinθ;
1030
+ let f = .83 * (b * cosθ - a * sinθ);
1031
+ let G = Math.sqrt(e * e + f * f);
1032
+ let res = {
1033
+ mode: "dlch",
1034
+ l: factor / 1 * Math.log(1 + .0039 * l),
1035
+ c: Math.log(1 + .075 * G) / (.0435 * 1 * 1)
1036
+ };
1037
+ if (res.c) res.h = normalizeHue((Math.atan2(f, e) + θ) / Math.PI * 180);
1038
+ if (alpha !== void 0) res.alpha = alpha;
1039
+ return res;
1040
+ };
1041
+ //#endregion
1042
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/dlab/definition.js
1043
+ var convertDlabToLab65 = (c) => convertDlchToLab65(convertLabToLch(c, "dlch"));
1044
+ var convertLab65ToDlab = (c) => convertLchToLab(convertLab65ToDlch(c), "dlab");
1045
+ var definition$24 = {
1046
+ mode: "dlab",
1047
+ parse: ["--din99o-lab"],
1048
+ serialize: "--din99o-lab",
1049
+ toMode: {
1050
+ lab65: convertDlabToLab65,
1051
+ rgb: (c) => convertLab65ToRgb(convertDlabToLab65(c))
1052
+ },
1053
+ fromMode: {
1054
+ lab65: convertLab65ToDlab,
1055
+ rgb: (c) => convertLab65ToDlab(convertRgbToLab65(c))
1056
+ },
1057
+ channels: [
1058
+ "l",
1059
+ "a",
1060
+ "b",
1061
+ "alpha"
1062
+ ],
1063
+ ranges: {
1064
+ l: [0, 100],
1065
+ a: [-40.09, 45.501],
1066
+ b: [-40.469, 44.344]
1067
+ },
1068
+ interpolate: {
1069
+ l: interpolatorLinear,
1070
+ a: interpolatorLinear,
1071
+ b: interpolatorLinear,
1072
+ alpha: {
1073
+ use: interpolatorLinear,
1074
+ fixup: fixupAlpha
1075
+ }
1076
+ }
1077
+ };
1078
+ //#endregion
1079
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/dlch/definition.js
1080
+ var definition$23 = {
1081
+ mode: "dlch",
1082
+ parse: ["--din99o-lch"],
1083
+ serialize: "--din99o-lch",
1084
+ toMode: {
1085
+ lab65: convertDlchToLab65,
1086
+ dlab: (c) => convertLchToLab(c, "dlab"),
1087
+ rgb: (c) => convertLab65ToRgb(convertDlchToLab65(c))
1088
+ },
1089
+ fromMode: {
1090
+ lab65: convertLab65ToDlch,
1091
+ dlab: (c) => convertLabToLch(c, "dlch"),
1092
+ rgb: (c) => convertLab65ToDlch(convertRgbToLab65(c))
1093
+ },
1094
+ channels: [
1095
+ "l",
1096
+ "c",
1097
+ "h",
1098
+ "alpha"
1099
+ ],
1100
+ ranges: {
1101
+ l: [0, 100],
1102
+ c: [0, 51.484],
1103
+ h: [0, 360]
1104
+ },
1105
+ interpolate: {
1106
+ l: interpolatorLinear,
1107
+ c: interpolatorLinear,
1108
+ h: {
1109
+ use: interpolatorLinear,
1110
+ fixup: fixupHueShorter
1111
+ },
1112
+ alpha: {
1113
+ use: interpolatorLinear,
1114
+ fixup: fixupAlpha
1115
+ }
1116
+ },
1117
+ difference: { h: differenceHueChroma },
1118
+ average: { h: averageAngle }
1119
+ };
1120
+ //#endregion
1121
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsi/convertHsiToRgb.js
1122
+ function convertHsiToRgb({ h, s, i, alpha }) {
1123
+ h = normalizeHue(h !== void 0 ? h : 0);
1124
+ if (s === void 0) s = 0;
1125
+ if (i === void 0) i = 0;
1126
+ let f = Math.abs(h / 60 % 2 - 1);
1127
+ let res;
1128
+ switch (Math.floor(h / 60)) {
1129
+ case 0:
1130
+ res = {
1131
+ r: i * (1 + s * (3 / (2 - f) - 1)),
1132
+ g: i * (1 + s * (3 * (1 - f) / (2 - f) - 1)),
1133
+ b: i * (1 - s)
1134
+ };
1135
+ break;
1136
+ case 1:
1137
+ res = {
1138
+ r: i * (1 + s * (3 * (1 - f) / (2 - f) - 1)),
1139
+ g: i * (1 + s * (3 / (2 - f) - 1)),
1140
+ b: i * (1 - s)
1141
+ };
1142
+ break;
1143
+ case 2:
1144
+ res = {
1145
+ r: i * (1 - s),
1146
+ g: i * (1 + s * (3 / (2 - f) - 1)),
1147
+ b: i * (1 + s * (3 * (1 - f) / (2 - f) - 1))
1148
+ };
1149
+ break;
1150
+ case 3:
1151
+ res = {
1152
+ r: i * (1 - s),
1153
+ g: i * (1 + s * (3 * (1 - f) / (2 - f) - 1)),
1154
+ b: i * (1 + s * (3 / (2 - f) - 1))
1155
+ };
1156
+ break;
1157
+ case 4:
1158
+ res = {
1159
+ r: i * (1 + s * (3 * (1 - f) / (2 - f) - 1)),
1160
+ g: i * (1 - s),
1161
+ b: i * (1 + s * (3 / (2 - f) - 1))
1162
+ };
1163
+ break;
1164
+ case 5:
1165
+ res = {
1166
+ r: i * (1 + s * (3 / (2 - f) - 1)),
1167
+ g: i * (1 - s),
1168
+ b: i * (1 + s * (3 * (1 - f) / (2 - f) - 1))
1169
+ };
1170
+ break;
1171
+ default: res = {
1172
+ r: i * (1 - s),
1173
+ g: i * (1 - s),
1174
+ b: i * (1 - s)
1175
+ };
1176
+ }
1177
+ res.mode = "rgb";
1178
+ if (alpha !== void 0) res.alpha = alpha;
1179
+ return res;
1180
+ }
1181
+ //#endregion
1182
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsi/convertRgbToHsi.js
1183
+ function convertRgbToHsi({ r, g, b, alpha }) {
1184
+ if (r === void 0) r = 0;
1185
+ if (g === void 0) g = 0;
1186
+ if (b === void 0) b = 0;
1187
+ let M = Math.max(r, g, b), m = Math.min(r, g, b);
1188
+ let res = {
1189
+ mode: "hsi",
1190
+ s: r + g + b === 0 ? 0 : 1 - 3 * m / (r + g + b),
1191
+ i: (r + g + b) / 3
1192
+ };
1193
+ if (M - m !== 0) res.h = (M === r ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r) / (M - m) + 2 : (r - g) / (M - m) + 4) * 60;
1194
+ if (alpha !== void 0) res.alpha = alpha;
1195
+ return res;
1196
+ }
1197
+ //#endregion
1198
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsi/definition.js
1199
+ var definition$22 = {
1200
+ mode: "hsi",
1201
+ toMode: { rgb: convertHsiToRgb },
1202
+ parse: ["--hsi"],
1203
+ serialize: "--hsi",
1204
+ fromMode: { rgb: convertRgbToHsi },
1205
+ channels: [
1206
+ "h",
1207
+ "s",
1208
+ "i",
1209
+ "alpha"
1210
+ ],
1211
+ ranges: { h: [0, 360] },
1212
+ gamut: "rgb",
1213
+ interpolate: {
1214
+ h: {
1215
+ use: interpolatorLinear,
1216
+ fixup: fixupHueShorter
1217
+ },
1218
+ s: interpolatorLinear,
1219
+ i: interpolatorLinear,
1220
+ alpha: {
1221
+ use: interpolatorLinear,
1222
+ fixup: fixupAlpha
1223
+ }
1224
+ },
1225
+ difference: { h: differenceHueSaturation },
1226
+ average: { h: averageAngle }
1227
+ };
1228
+ //#endregion
1229
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsl/convertHslToRgb.js
1230
+ function convertHslToRgb({ h, s, l, alpha }) {
1231
+ h = normalizeHue(h !== void 0 ? h : 0);
1232
+ if (s === void 0) s = 0;
1233
+ if (l === void 0) l = 0;
1234
+ let m1 = l + s * (l < .5 ? l : 1 - l);
1235
+ let m2 = m1 - (m1 - l) * 2 * Math.abs(h / 60 % 2 - 1);
1236
+ let res;
1237
+ switch (Math.floor(h / 60)) {
1238
+ case 0:
1239
+ res = {
1240
+ r: m1,
1241
+ g: m2,
1242
+ b: 2 * l - m1
1243
+ };
1244
+ break;
1245
+ case 1:
1246
+ res = {
1247
+ r: m2,
1248
+ g: m1,
1249
+ b: 2 * l - m1
1250
+ };
1251
+ break;
1252
+ case 2:
1253
+ res = {
1254
+ r: 2 * l - m1,
1255
+ g: m1,
1256
+ b: m2
1257
+ };
1258
+ break;
1259
+ case 3:
1260
+ res = {
1261
+ r: 2 * l - m1,
1262
+ g: m2,
1263
+ b: m1
1264
+ };
1265
+ break;
1266
+ case 4:
1267
+ res = {
1268
+ r: m2,
1269
+ g: 2 * l - m1,
1270
+ b: m1
1271
+ };
1272
+ break;
1273
+ case 5:
1274
+ res = {
1275
+ r: m1,
1276
+ g: 2 * l - m1,
1277
+ b: m2
1278
+ };
1279
+ break;
1280
+ default: res = {
1281
+ r: 2 * l - m1,
1282
+ g: 2 * l - m1,
1283
+ b: 2 * l - m1
1284
+ };
1285
+ }
1286
+ res.mode = "rgb";
1287
+ if (alpha !== void 0) res.alpha = alpha;
1288
+ return res;
1289
+ }
1290
+ //#endregion
1291
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsl/convertRgbToHsl.js
1292
+ function convertRgbToHsl({ r, g, b, alpha }) {
1293
+ if (r === void 0) r = 0;
1294
+ if (g === void 0) g = 0;
1295
+ if (b === void 0) b = 0;
1296
+ let M = Math.max(r, g, b), m = Math.min(r, g, b);
1297
+ let res = {
1298
+ mode: "hsl",
1299
+ s: M === m ? 0 : (M - m) / (1 - Math.abs(M + m - 1)),
1300
+ l: .5 * (M + m)
1301
+ };
1302
+ if (M - m !== 0) res.h = (M === r ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r) / (M - m) + 2 : (r - g) / (M - m) + 4) * 60;
1303
+ if (alpha !== void 0) res.alpha = alpha;
1304
+ return res;
1305
+ }
1306
+ //#endregion
1307
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/util/hue.js
1308
+ var hueToDeg = (val, unit) => {
1309
+ switch (unit) {
1310
+ case "deg": return +val;
1311
+ case "rad": return val / Math.PI * 180;
1312
+ case "grad": return val / 10 * 9;
1313
+ case "turn": return val * 360;
1314
+ }
1315
+ };
1316
+ //#endregion
1317
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js
1318
+ var hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c$1}${per}${c$1}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
1319
+ var parseHslLegacy = (color) => {
1320
+ let match = color.match(hsl_old);
1321
+ if (!match) return;
1322
+ let res = { mode: "hsl" };
1323
+ if (match[3] !== void 0) res.h = +match[3];
1324
+ else if (match[1] !== void 0 && match[2] !== void 0) res.h = hueToDeg(match[1], match[2]);
1325
+ if (match[4] !== void 0) res.s = Math.min(Math.max(0, match[4] / 100), 1);
1326
+ if (match[5] !== void 0) res.l = Math.min(Math.max(0, match[5] / 100), 1);
1327
+ if (match[6] !== void 0) res.alpha = Math.max(0, Math.min(1, match[6] / 100));
1328
+ else if (match[7] !== void 0) res.alpha = Math.max(0, Math.min(1, +match[7]));
1329
+ return res;
1330
+ };
1331
+ //#endregion
1332
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsl/parseHsl.js
1333
+ function parseHsl(color, parsed) {
1334
+ if (!parsed || parsed[0] !== "hsl" && parsed[0] !== "hsla") return;
1335
+ const res = { mode: "hsl" };
1336
+ const [, h, s, l, alpha] = parsed;
1337
+ if (h.type !== Tok.None) {
1338
+ if (h.type === Tok.Percentage) return;
1339
+ res.h = h.value;
1340
+ }
1341
+ if (s.type !== Tok.None) {
1342
+ if (s.type === Tok.Hue) return;
1343
+ res.s = s.value / 100;
1344
+ }
1345
+ if (l.type !== Tok.None) {
1346
+ if (l.type === Tok.Hue) return;
1347
+ res.l = l.value / 100;
1348
+ }
1349
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
1350
+ return res;
1351
+ }
1352
+ //#endregion
1353
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsl/definition.js
1354
+ var definition$21 = {
1355
+ mode: "hsl",
1356
+ toMode: { rgb: convertHslToRgb },
1357
+ fromMode: { rgb: convertRgbToHsl },
1358
+ channels: [
1359
+ "h",
1360
+ "s",
1361
+ "l",
1362
+ "alpha"
1363
+ ],
1364
+ ranges: { h: [0, 360] },
1365
+ gamut: "rgb",
1366
+ parse: [parseHsl, parseHslLegacy],
1367
+ serialize: (c) => `hsl(${c.h !== void 0 ? c.h : "none"} ${c.s !== void 0 ? c.s * 100 + "%" : "none"} ${c.l !== void 0 ? c.l * 100 + "%" : "none"}${c.alpha < 1 ? ` / ${c.alpha}` : ""})`,
1368
+ interpolate: {
1369
+ h: {
1370
+ use: interpolatorLinear,
1371
+ fixup: fixupHueShorter
1372
+ },
1373
+ s: interpolatorLinear,
1374
+ l: interpolatorLinear,
1375
+ alpha: {
1376
+ use: interpolatorLinear,
1377
+ fixup: fixupAlpha
1378
+ }
1379
+ },
1380
+ difference: { h: differenceHueSaturation },
1381
+ average: { h: averageAngle }
1382
+ };
1383
+ //#endregion
1384
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsv/convertHsvToRgb.js
1385
+ function convertHsvToRgb({ h, s, v, alpha }) {
1386
+ h = normalizeHue(h !== void 0 ? h : 0);
1387
+ if (s === void 0) s = 0;
1388
+ if (v === void 0) v = 0;
1389
+ let f = Math.abs(h / 60 % 2 - 1);
1390
+ let res;
1391
+ switch (Math.floor(h / 60)) {
1392
+ case 0:
1393
+ res = {
1394
+ r: v,
1395
+ g: v * (1 - s * f),
1396
+ b: v * (1 - s)
1397
+ };
1398
+ break;
1399
+ case 1:
1400
+ res = {
1401
+ r: v * (1 - s * f),
1402
+ g: v,
1403
+ b: v * (1 - s)
1404
+ };
1405
+ break;
1406
+ case 2:
1407
+ res = {
1408
+ r: v * (1 - s),
1409
+ g: v,
1410
+ b: v * (1 - s * f)
1411
+ };
1412
+ break;
1413
+ case 3:
1414
+ res = {
1415
+ r: v * (1 - s),
1416
+ g: v * (1 - s * f),
1417
+ b: v
1418
+ };
1419
+ break;
1420
+ case 4:
1421
+ res = {
1422
+ r: v * (1 - s * f),
1423
+ g: v * (1 - s),
1424
+ b: v
1425
+ };
1426
+ break;
1427
+ case 5:
1428
+ res = {
1429
+ r: v,
1430
+ g: v * (1 - s),
1431
+ b: v * (1 - s * f)
1432
+ };
1433
+ break;
1434
+ default: res = {
1435
+ r: v * (1 - s),
1436
+ g: v * (1 - s),
1437
+ b: v * (1 - s)
1438
+ };
1439
+ }
1440
+ res.mode = "rgb";
1441
+ if (alpha !== void 0) res.alpha = alpha;
1442
+ return res;
1443
+ }
1444
+ //#endregion
1445
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsv/convertRgbToHsv.js
1446
+ function convertRgbToHsv({ r, g, b, alpha }) {
1447
+ if (r === void 0) r = 0;
1448
+ if (g === void 0) g = 0;
1449
+ if (b === void 0) b = 0;
1450
+ let M = Math.max(r, g, b), m = Math.min(r, g, b);
1451
+ let res = {
1452
+ mode: "hsv",
1453
+ s: M === 0 ? 0 : 1 - m / M,
1454
+ v: M
1455
+ };
1456
+ if (M - m !== 0) res.h = (M === r ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r) / (M - m) + 2 : (r - g) / (M - m) + 4) * 60;
1457
+ if (alpha !== void 0) res.alpha = alpha;
1458
+ return res;
1459
+ }
1460
+ //#endregion
1461
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsv/definition.js
1462
+ var definition$20 = {
1463
+ mode: "hsv",
1464
+ toMode: { rgb: convertHsvToRgb },
1465
+ parse: ["--hsv"],
1466
+ serialize: "--hsv",
1467
+ fromMode: { rgb: convertRgbToHsv },
1468
+ channels: [
1469
+ "h",
1470
+ "s",
1471
+ "v",
1472
+ "alpha"
1473
+ ],
1474
+ ranges: { h: [0, 360] },
1475
+ gamut: "rgb",
1476
+ interpolate: {
1477
+ h: {
1478
+ use: interpolatorLinear,
1479
+ fixup: fixupHueShorter
1480
+ },
1481
+ s: interpolatorLinear,
1482
+ v: interpolatorLinear,
1483
+ alpha: {
1484
+ use: interpolatorLinear,
1485
+ fixup: fixupAlpha
1486
+ }
1487
+ },
1488
+ difference: { h: differenceHueSaturation },
1489
+ average: { h: averageAngle }
1490
+ };
1491
+ //#endregion
1492
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hwb/convertHwbToRgb.js
1493
+ function convertHwbToRgb({ h, w, b, alpha }) {
1494
+ if (w === void 0) w = 0;
1495
+ if (b === void 0) b = 0;
1496
+ if (w + b > 1) {
1497
+ let s = w + b;
1498
+ w /= s;
1499
+ b /= s;
1500
+ }
1501
+ return convertHsvToRgb({
1502
+ h,
1503
+ s: b === 1 ? 1 : 1 - w / (1 - b),
1504
+ v: 1 - b,
1505
+ alpha
1506
+ });
1507
+ }
1508
+ //#endregion
1509
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hwb/convertRgbToHwb.js
1510
+ function convertRgbToHwb(rgba) {
1511
+ let hsv = convertRgbToHsv(rgba);
1512
+ if (hsv === void 0) return void 0;
1513
+ let s = hsv.s !== void 0 ? hsv.s : 0;
1514
+ let v = hsv.v !== void 0 ? hsv.v : 0;
1515
+ let res = {
1516
+ mode: "hwb",
1517
+ w: (1 - s) * v,
1518
+ b: 1 - v
1519
+ };
1520
+ if (hsv.h !== void 0) res.h = hsv.h;
1521
+ if (hsv.alpha !== void 0) res.alpha = hsv.alpha;
1522
+ return res;
1523
+ }
1524
+ //#endregion
1525
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hwb/parseHwb.js
1526
+ function ParseHwb(color, parsed) {
1527
+ if (!parsed || parsed[0] !== "hwb") return;
1528
+ const res = { mode: "hwb" };
1529
+ const [, h, w, b, alpha] = parsed;
1530
+ if (h.type !== Tok.None) {
1531
+ if (h.type === Tok.Percentage) return;
1532
+ res.h = h.value;
1533
+ }
1534
+ if (w.type !== Tok.None) {
1535
+ if (w.type === Tok.Hue) return;
1536
+ res.w = w.value / 100;
1537
+ }
1538
+ if (b.type !== Tok.None) {
1539
+ if (b.type === Tok.Hue) return;
1540
+ res.b = b.value / 100;
1541
+ }
1542
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
1543
+ return res;
1544
+ }
1545
+ //#endregion
1546
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hwb/definition.js
1547
+ var definition$19 = {
1548
+ mode: "hwb",
1549
+ toMode: { rgb: convertHwbToRgb },
1550
+ fromMode: { rgb: convertRgbToHwb },
1551
+ channels: [
1552
+ "h",
1553
+ "w",
1554
+ "b",
1555
+ "alpha"
1556
+ ],
1557
+ ranges: { h: [0, 360] },
1558
+ gamut: "rgb",
1559
+ parse: [ParseHwb],
1560
+ serialize: (c) => `hwb(${c.h !== void 0 ? c.h : "none"} ${c.w !== void 0 ? c.w * 100 + "%" : "none"} ${c.b !== void 0 ? c.b * 100 + "%" : "none"}${c.alpha < 1 ? ` / ${c.alpha}` : ""})`,
1561
+ interpolate: {
1562
+ h: {
1563
+ use: interpolatorLinear,
1564
+ fixup: fixupHueShorter
1565
+ },
1566
+ w: interpolatorLinear,
1567
+ b: interpolatorLinear,
1568
+ alpha: {
1569
+ use: interpolatorLinear,
1570
+ fixup: fixupAlpha
1571
+ }
1572
+ },
1573
+ difference: { h: differenceHueNaive },
1574
+ average: { h: averageAngle }
1575
+ };
1576
+ //#endregion
1577
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hdr/transfer.js
1578
+ var M1 = .1593017578125;
1579
+ var M2 = 78.84375;
1580
+ var C1 = .8359375;
1581
+ var C2 = 18.8515625;
1582
+ var C3 = 18.6875;
1583
+ function transferPqDecode(v) {
1584
+ if (v < 0) return 0;
1585
+ const c = Math.pow(v, 1 / M2);
1586
+ return 1e4 * Math.pow(Math.max(0, c - C1) / (C2 - C3 * c), 1 / M1);
1587
+ }
1588
+ function transferPqEncode(v) {
1589
+ if (v < 0) return 0;
1590
+ const c = Math.pow(v / 1e4, M1);
1591
+ return Math.pow((C1 + C2 * c) / (1 + C3 * c), M2);
1592
+ }
1593
+ //#endregion
1594
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/itp/convertItpToXyz65.js
1595
+ var toRel = (c) => Math.max(c / 203, 0);
1596
+ var convertItpToXyz65 = ({ i, t, p, alpha }) => {
1597
+ if (i === void 0) i = 0;
1598
+ if (t === void 0) t = 0;
1599
+ if (p === void 0) p = 0;
1600
+ const l = transferPqDecode(i + .008609037037932761 * t + .11102962500302593 * p);
1601
+ const m = transferPqDecode(i - .00860903703793275 * t - .11102962500302599 * p);
1602
+ const s = transferPqDecode(i + .5600313357106791 * t - .32062717498731885 * p);
1603
+ const res = {
1604
+ mode: "xyz65",
1605
+ x: toRel(2.070152218389422 * l - 1.3263473389671556 * m + .2066510476294051 * s),
1606
+ y: toRel(.3647385209748074 * l + .680566024947227 * m - .0453045459220346 * s),
1607
+ z: toRel(-.049747207535812 * l - .0492609666966138 * m + 1.1880659249923042 * s)
1608
+ };
1609
+ if (alpha !== void 0) res.alpha = alpha;
1610
+ return res;
1611
+ };
1612
+ //#endregion
1613
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/itp/convertXyz65ToItp.js
1614
+ var toAbs = (c = 0) => Math.max(c * 203, 0);
1615
+ var convertXyz65ToItp = ({ x, y, z, alpha }) => {
1616
+ const absX = toAbs(x);
1617
+ const absY = toAbs(y);
1618
+ const absZ = toAbs(z);
1619
+ const l = transferPqEncode(.3592832590121217 * absX + .6976051147779502 * absY - .0358915932320289 * absZ);
1620
+ const m = transferPqEncode(-.1920808463704995 * absX + 1.1004767970374323 * absY + .0753748658519118 * absZ);
1621
+ const s = transferPqEncode(.0070797844607477 * absX + .0748396662186366 * absY + .8433265453898765 * absZ);
1622
+ const res = {
1623
+ mode: "itp",
1624
+ i: .5 * l + .5 * m,
1625
+ t: 1.61376953125 * l - 3.323486328125 * m + 1.709716796875 * s,
1626
+ p: 4.378173828125 * l - 4.24560546875 * m - .132568359375 * s
1627
+ };
1628
+ if (alpha !== void 0) res.alpha = alpha;
1629
+ return res;
1630
+ };
1631
+ //#endregion
1632
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/itp/definition.js
1633
+ var definition$18 = {
1634
+ mode: "itp",
1635
+ channels: [
1636
+ "i",
1637
+ "t",
1638
+ "p",
1639
+ "alpha"
1640
+ ],
1641
+ parse: ["--ictcp"],
1642
+ serialize: "--ictcp",
1643
+ toMode: {
1644
+ xyz65: convertItpToXyz65,
1645
+ rgb: (color) => convertXyz65ToRgb(convertItpToXyz65(color))
1646
+ },
1647
+ fromMode: {
1648
+ xyz65: convertXyz65ToItp,
1649
+ rgb: (color) => convertXyz65ToItp(convertRgbToXyz65(color))
1650
+ },
1651
+ ranges: {
1652
+ i: [0, .581],
1653
+ t: [-.369, .272],
1654
+ p: [-.164, .331]
1655
+ },
1656
+ interpolate: {
1657
+ i: interpolatorLinear,
1658
+ t: interpolatorLinear,
1659
+ p: interpolatorLinear,
1660
+ alpha: {
1661
+ use: interpolatorLinear,
1662
+ fixup: fixupAlpha
1663
+ }
1664
+ }
1665
+ };
1666
+ //#endregion
1667
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/convertXyz65ToJab.js
1668
+ var p$2 = 134.03437499999998;
1669
+ var d0$1 = 16295499532821565e-27;
1670
+ var jabPqEncode = (v) => {
1671
+ if (v < 0) return 0;
1672
+ let vn = Math.pow(v / 1e4, M1);
1673
+ return Math.pow((C1 + C2 * vn) / (1 + C3 * vn), p$2);
1674
+ };
1675
+ var abs = (v = 0) => Math.max(v * 203, 0);
1676
+ var convertXyz65ToJab = ({ x, y, z, alpha }) => {
1677
+ x = abs(x);
1678
+ y = abs(y);
1679
+ z = abs(z);
1680
+ let xp = 1.15 * x - .15 * z;
1681
+ let yp = .66 * y + .34 * x;
1682
+ let l = jabPqEncode(.41478972 * xp + .579999 * yp + .014648 * z);
1683
+ let m = jabPqEncode(-.20151 * xp + 1.120649 * yp + .0531008 * z);
1684
+ let s = jabPqEncode(-.0166008 * xp + .2648 * yp + .6684799 * z);
1685
+ let i = (l + m) / 2;
1686
+ let res = {
1687
+ mode: "jab",
1688
+ j: .44 * i / (1 - .56 * i) - d0$1,
1689
+ a: 3.524 * l - 4.066708 * m + .542708 * s,
1690
+ b: .199076 * l + 1.096799 * m - 1.295875 * s
1691
+ };
1692
+ if (alpha !== void 0) res.alpha = alpha;
1693
+ return res;
1694
+ };
1695
+ //#endregion
1696
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/convertJabToXyz65.js
1697
+ var p$1 = 134.03437499999998;
1698
+ var d0 = 16295499532821565e-27;
1699
+ var jabPqDecode = (v) => {
1700
+ if (v < 0) return 0;
1701
+ let vp = Math.pow(v, 1 / p$1);
1702
+ return 1e4 * Math.pow((C1 - vp) / (C3 * vp - C2), 1 / M1);
1703
+ };
1704
+ var rel = (v) => v / 203;
1705
+ var convertJabToXyz65 = ({ j, a, b, alpha }) => {
1706
+ if (j === void 0) j = 0;
1707
+ if (a === void 0) a = 0;
1708
+ if (b === void 0) b = 0;
1709
+ let i = (j + d0) / (.44 + .56 * (j + d0));
1710
+ let l = jabPqDecode(i + .13860504 * a + .058047316 * b);
1711
+ let m = jabPqDecode(i - .13860504 * a - .058047316 * b);
1712
+ let s = jabPqDecode(i - .096019242 * a - .8118919 * b);
1713
+ let res = {
1714
+ mode: "xyz65",
1715
+ x: rel(1.661373024652174 * l - .914523081304348 * m + .23136208173913045 * s),
1716
+ y: rel(-.3250758611844533 * l + 1.571847026732543 * m - .21825383453227928 * s),
1717
+ z: rel(-.090982811 * l - .31272829 * m + 1.5227666 * s)
1718
+ };
1719
+ if (alpha !== void 0) res.alpha = alpha;
1720
+ return res;
1721
+ };
1722
+ //#endregion
1723
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/convertRgbToJab.js
1724
+ var convertRgbToJab = (rgb) => {
1725
+ let res = convertXyz65ToJab(convertRgbToXyz65(rgb));
1726
+ if (rgb.r === rgb.b && rgb.b === rgb.g) res.a = res.b = 0;
1727
+ return res;
1728
+ };
1729
+ //#endregion
1730
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/convertJabToRgb.js
1731
+ var convertJabToRgb = (color) => convertXyz65ToRgb(convertJabToXyz65(color));
1732
+ //#endregion
1733
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/definition.js
1734
+ var definition$17 = {
1735
+ mode: "jab",
1736
+ channels: [
1737
+ "j",
1738
+ "a",
1739
+ "b",
1740
+ "alpha"
1741
+ ],
1742
+ parse: ["--jzazbz"],
1743
+ serialize: "--jzazbz",
1744
+ fromMode: {
1745
+ rgb: convertRgbToJab,
1746
+ xyz65: convertXyz65ToJab
1747
+ },
1748
+ toMode: {
1749
+ rgb: convertJabToRgb,
1750
+ xyz65: convertJabToXyz65
1751
+ },
1752
+ ranges: {
1753
+ j: [0, .222],
1754
+ a: [-.109, .129],
1755
+ b: [-.185, .134]
1756
+ },
1757
+ interpolate: {
1758
+ j: interpolatorLinear,
1759
+ a: interpolatorLinear,
1760
+ b: interpolatorLinear,
1761
+ alpha: {
1762
+ use: interpolatorLinear,
1763
+ fixup: fixupAlpha
1764
+ }
1765
+ }
1766
+ };
1767
+ //#endregion
1768
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jch/convertJabToJch.js
1769
+ var convertJabToJch = ({ j, a, b, alpha }) => {
1770
+ if (a === void 0) a = 0;
1771
+ if (b === void 0) b = 0;
1772
+ let c = Math.sqrt(a * a + b * b);
1773
+ let res = {
1774
+ mode: "jch",
1775
+ j,
1776
+ c
1777
+ };
1778
+ if (c) res.h = normalizeHue(Math.atan2(b, a) * 180 / Math.PI);
1779
+ if (alpha !== void 0) res.alpha = alpha;
1780
+ return res;
1781
+ };
1782
+ //#endregion
1783
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jch/convertJchToJab.js
1784
+ var convertJchToJab = ({ j, c, h, alpha }) => {
1785
+ if (h === void 0) h = 0;
1786
+ let res = {
1787
+ mode: "jab",
1788
+ j,
1789
+ a: c ? c * Math.cos(h / 180 * Math.PI) : 0,
1790
+ b: c ? c * Math.sin(h / 180 * Math.PI) : 0
1791
+ };
1792
+ if (alpha !== void 0) res.alpha = alpha;
1793
+ return res;
1794
+ };
1795
+ //#endregion
1796
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jch/definition.js
1797
+ var definition$16 = {
1798
+ mode: "jch",
1799
+ parse: ["--jzczhz"],
1800
+ serialize: "--jzczhz",
1801
+ toMode: {
1802
+ jab: convertJchToJab,
1803
+ rgb: (c) => convertJabToRgb(convertJchToJab(c))
1804
+ },
1805
+ fromMode: {
1806
+ rgb: (c) => convertJabToJch(convertRgbToJab(c)),
1807
+ jab: convertJabToJch
1808
+ },
1809
+ channels: [
1810
+ "j",
1811
+ "c",
1812
+ "h",
1813
+ "alpha"
1814
+ ],
1815
+ ranges: {
1816
+ j: [0, .221],
1817
+ c: [0, .19],
1818
+ h: [0, 360]
1819
+ },
1820
+ interpolate: {
1821
+ h: {
1822
+ use: interpolatorLinear,
1823
+ fixup: fixupHueShorter
1824
+ },
1825
+ c: interpolatorLinear,
1826
+ j: interpolatorLinear,
1827
+ alpha: {
1828
+ use: interpolatorLinear,
1829
+ fixup: fixupAlpha
1830
+ }
1831
+ },
1832
+ difference: { h: differenceHueChroma },
1833
+ average: { h: averageAngle }
1834
+ };
1835
+ //#endregion
1836
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz50/constants.js
1837
+ var k$2 = Math.pow(29, 3) / Math.pow(3, 3);
1838
+ var e = Math.pow(6, 3) / Math.pow(29, 3);
1839
+ //#endregion
1840
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/convertLabToXyz50.js
1841
+ var fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k$2;
1842
+ var convertLabToXyz50 = ({ l, a, b, alpha }) => {
1843
+ if (l === void 0) l = 0;
1844
+ if (a === void 0) a = 0;
1845
+ if (b === void 0) b = 0;
1846
+ let fy = (l + 16) / 116;
1847
+ let fx = a / 500 + fy;
1848
+ let fz = fy - b / 200;
1849
+ let res = {
1850
+ mode: "xyz50",
1851
+ x: fn(fx) * D50.X,
1852
+ y: fn(fy) * D50.Y,
1853
+ z: fn(fz) * D50.Z
1854
+ };
1855
+ if (alpha !== void 0) res.alpha = alpha;
1856
+ return res;
1857
+ };
1858
+ //#endregion
1859
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz50/convertXyz50ToRgb.js
1860
+ var convertXyz50ToRgb = ({ x, y, z, alpha }) => {
1861
+ if (x === void 0) x = 0;
1862
+ if (y === void 0) y = 0;
1863
+ if (z === void 0) z = 0;
1864
+ let res = convertLrgbToRgb({
1865
+ r: x * 3.1341359569958707 - y * 1.6173863321612538 - .4906619460083532 * z,
1866
+ g: x * -.978795502912089 + y * 1.916254567259524 + .03344273116131949 * z,
1867
+ b: x * .07195537988411677 - y * .2289768264158322 + 1.405386058324125 * z
1868
+ });
1869
+ if (alpha !== void 0) res.alpha = alpha;
1870
+ return res;
1871
+ };
1872
+ //#endregion
1873
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/convertLabToRgb.js
1874
+ var convertLabToRgb = (lab) => convertXyz50ToRgb(convertLabToXyz50(lab));
1875
+ //#endregion
1876
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz50/convertRgbToXyz50.js
1877
+ var convertRgbToXyz50 = (rgb) => {
1878
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb);
1879
+ let res = {
1880
+ mode: "xyz50",
1881
+ x: .436065742824811 * r + .3851514688337912 * g + .14307845442264197 * b,
1882
+ y: .22249319175623702 * r + .7168870538238823 * g + .06061979053616537 * b,
1883
+ z: .013923904500943465 * r + .09708128566574634 * g + .7140993584005155 * b
1884
+ };
1885
+ if (alpha !== void 0) res.alpha = alpha;
1886
+ return res;
1887
+ };
1888
+ //#endregion
1889
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/convertXyz50ToLab.js
1890
+ var f$1 = (value) => value > e ? Math.cbrt(value) : (k$2 * value + 16) / 116;
1891
+ var convertXyz50ToLab = ({ x, y, z, alpha }) => {
1892
+ if (x === void 0) x = 0;
1893
+ if (y === void 0) y = 0;
1894
+ if (z === void 0) z = 0;
1895
+ let f0 = f$1(x / D50.X);
1896
+ let f1 = f$1(y / D50.Y);
1897
+ let f2 = f$1(z / D50.Z);
1898
+ let res = {
1899
+ mode: "lab",
1900
+ l: 116 * f1 - 16,
1901
+ a: 500 * (f0 - f1),
1902
+ b: 200 * (f1 - f2)
1903
+ };
1904
+ if (alpha !== void 0) res.alpha = alpha;
1905
+ return res;
1906
+ };
1907
+ //#endregion
1908
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/convertRgbToLab.js
1909
+ var convertRgbToLab = (rgb) => {
1910
+ let res = convertXyz50ToLab(convertRgbToXyz50(rgb));
1911
+ if (rgb.r === rgb.b && rgb.b === rgb.g) res.a = res.b = 0;
1912
+ return res;
1913
+ };
1914
+ //#endregion
1915
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/parseLab.js
1916
+ function parseLab(color, parsed) {
1917
+ if (!parsed || parsed[0] !== "lab") return;
1918
+ const res = { mode: "lab" };
1919
+ const [, l, a, b, alpha] = parsed;
1920
+ if (l.type === Tok.Hue || a.type === Tok.Hue || b.type === Tok.Hue) return;
1921
+ if (l.type !== Tok.None) res.l = Math.min(Math.max(0, l.value), 100);
1922
+ if (a.type !== Tok.None) res.a = a.type === Tok.Number ? a.value : a.value * 125 / 100;
1923
+ if (b.type !== Tok.None) res.b = b.type === Tok.Number ? b.value : b.value * 125 / 100;
1924
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
1925
+ return res;
1926
+ }
1927
+ //#endregion
1928
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/definition.js
1929
+ var definition$15 = {
1930
+ mode: "lab",
1931
+ toMode: {
1932
+ xyz50: convertLabToXyz50,
1933
+ rgb: convertLabToRgb
1934
+ },
1935
+ fromMode: {
1936
+ xyz50: convertXyz50ToLab,
1937
+ rgb: convertRgbToLab
1938
+ },
1939
+ channels: [
1940
+ "l",
1941
+ "a",
1942
+ "b",
1943
+ "alpha"
1944
+ ],
1945
+ ranges: {
1946
+ l: [0, 100],
1947
+ a: [-125, 125],
1948
+ b: [-125, 125]
1949
+ },
1950
+ parse: [parseLab],
1951
+ serialize: (c) => `lab(${c.l !== void 0 ? c.l : "none"} ${c.a !== void 0 ? c.a : "none"} ${c.b !== void 0 ? c.b : "none"}${c.alpha < 1 ? ` / ${c.alpha}` : ""})`,
1952
+ interpolate: {
1953
+ l: interpolatorLinear,
1954
+ a: interpolatorLinear,
1955
+ b: interpolatorLinear,
1956
+ alpha: {
1957
+ use: interpolatorLinear,
1958
+ fixup: fixupAlpha
1959
+ }
1960
+ }
1961
+ };
1962
+ //#endregion
1963
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/definition.js
1964
+ var definition$14 = {
1965
+ ...definition$15,
1966
+ mode: "lab65",
1967
+ parse: ["--lab-d65"],
1968
+ serialize: "--lab-d65",
1969
+ toMode: {
1970
+ xyz65: convertLab65ToXyz65,
1971
+ rgb: convertLab65ToRgb
1972
+ },
1973
+ fromMode: {
1974
+ xyz65: convertXyz65ToLab65,
1975
+ rgb: convertRgbToLab65
1976
+ },
1977
+ ranges: {
1978
+ l: [0, 100],
1979
+ a: [-125, 125],
1980
+ b: [-125, 125]
1981
+ }
1982
+ };
1983
+ //#endregion
1984
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lch/parseLch.js
1985
+ function parseLch(color, parsed) {
1986
+ if (!parsed || parsed[0] !== "lch") return;
1987
+ const res = { mode: "lch" };
1988
+ const [, l, c, h, alpha] = parsed;
1989
+ if (l.type !== Tok.None) {
1990
+ if (l.type === Tok.Hue) return;
1991
+ res.l = Math.min(Math.max(0, l.value), 100);
1992
+ }
1993
+ if (c.type !== Tok.None) res.c = Math.max(0, c.type === Tok.Number ? c.value : c.value * 150 / 100);
1994
+ if (h.type !== Tok.None) {
1995
+ if (h.type === Tok.Percentage) return;
1996
+ res.h = h.value;
1997
+ }
1998
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
1999
+ return res;
2000
+ }
2001
+ //#endregion
2002
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lch/definition.js
2003
+ var definition$13 = {
2004
+ mode: "lch",
2005
+ toMode: {
2006
+ lab: convertLchToLab,
2007
+ rgb: (c) => convertLabToRgb(convertLchToLab(c))
2008
+ },
2009
+ fromMode: {
2010
+ rgb: (c) => convertLabToLch(convertRgbToLab(c)),
2011
+ lab: convertLabToLch
2012
+ },
2013
+ channels: [
2014
+ "l",
2015
+ "c",
2016
+ "h",
2017
+ "alpha"
2018
+ ],
2019
+ ranges: {
2020
+ l: [0, 100],
2021
+ c: [0, 150],
2022
+ h: [0, 360]
2023
+ },
2024
+ parse: [parseLch],
2025
+ serialize: (c) => `lch(${c.l !== void 0 ? c.l : "none"} ${c.c !== void 0 ? c.c : "none"} ${c.h !== void 0 ? c.h : "none"}${c.alpha < 1 ? ` / ${c.alpha}` : ""})`,
2026
+ interpolate: {
2027
+ h: {
2028
+ use: interpolatorLinear,
2029
+ fixup: fixupHueShorter
2030
+ },
2031
+ c: interpolatorLinear,
2032
+ l: interpolatorLinear,
2033
+ alpha: {
2034
+ use: interpolatorLinear,
2035
+ fixup: fixupAlpha
2036
+ }
2037
+ },
2038
+ difference: { h: differenceHueChroma },
2039
+ average: { h: averageAngle }
2040
+ };
2041
+ //#endregion
2042
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lch65/definition.js
2043
+ var definition$12 = {
2044
+ ...definition$13,
2045
+ mode: "lch65",
2046
+ parse: ["--lch-d65"],
2047
+ serialize: "--lch-d65",
2048
+ toMode: {
2049
+ lab65: (c) => convertLchToLab(c, "lab65"),
2050
+ rgb: (c) => convertLab65ToRgb(convertLchToLab(c, "lab65"))
2051
+ },
2052
+ fromMode: {
2053
+ rgb: (c) => convertLabToLch(convertRgbToLab65(c), "lch65"),
2054
+ lab65: (c) => convertLabToLch(c, "lch65")
2055
+ },
2056
+ ranges: {
2057
+ l: [0, 100],
2058
+ c: [0, 150],
2059
+ h: [0, 360]
2060
+ }
2061
+ };
2062
+ //#endregion
2063
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lchuv/convertLuvToLchuv.js
2064
+ var convertLuvToLchuv = ({ l, u, v, alpha }) => {
2065
+ if (u === void 0) u = 0;
2066
+ if (v === void 0) v = 0;
2067
+ let c = Math.sqrt(u * u + v * v);
2068
+ let res = {
2069
+ mode: "lchuv",
2070
+ l,
2071
+ c
2072
+ };
2073
+ if (c) res.h = normalizeHue(Math.atan2(v, u) * 180 / Math.PI);
2074
+ if (alpha !== void 0) res.alpha = alpha;
2075
+ return res;
2076
+ };
2077
+ //#endregion
2078
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lchuv/convertLchuvToLuv.js
2079
+ var convertLchuvToLuv = ({ l, c, h, alpha }) => {
2080
+ if (h === void 0) h = 0;
2081
+ let res = {
2082
+ mode: "luv",
2083
+ l,
2084
+ u: c ? c * Math.cos(h / 180 * Math.PI) : 0,
2085
+ v: c ? c * Math.sin(h / 180 * Math.PI) : 0
2086
+ };
2087
+ if (alpha !== void 0) res.alpha = alpha;
2088
+ return res;
2089
+ };
2090
+ //#endregion
2091
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/luv/convertXyz50ToLuv.js
2092
+ var u_fn$1 = (x, y, z) => 4 * x / (x + 15 * y + 3 * z);
2093
+ var v_fn$1 = (x, y, z) => 9 * y / (x + 15 * y + 3 * z);
2094
+ var un$1 = u_fn$1(D50.X, D50.Y, D50.Z);
2095
+ var vn$1 = v_fn$1(D50.X, D50.Y, D50.Z);
2096
+ var l_fn = (value) => value <= e ? k$2 * value : 116 * Math.cbrt(value) - 16;
2097
+ var convertXyz50ToLuv = ({ x, y, z, alpha }) => {
2098
+ if (x === void 0) x = 0;
2099
+ if (y === void 0) y = 0;
2100
+ if (z === void 0) z = 0;
2101
+ let l = l_fn(y / D50.Y);
2102
+ let u = u_fn$1(x, y, z);
2103
+ let v = v_fn$1(x, y, z);
2104
+ if (!isFinite(u) || !isFinite(v)) l = u = v = 0;
2105
+ else {
2106
+ u = 13 * l * (u - un$1);
2107
+ v = 13 * l * (v - vn$1);
2108
+ }
2109
+ let res = {
2110
+ mode: "luv",
2111
+ l,
2112
+ u,
2113
+ v
2114
+ };
2115
+ if (alpha !== void 0) res.alpha = alpha;
2116
+ return res;
2117
+ };
2118
+ //#endregion
2119
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/luv/convertLuvToXyz50.js
2120
+ var u_fn = (x, y, z) => 4 * x / (x + 15 * y + 3 * z);
2121
+ var v_fn = (x, y, z) => 9 * y / (x + 15 * y + 3 * z);
2122
+ var un = u_fn(D50.X, D50.Y, D50.Z);
2123
+ var vn = v_fn(D50.X, D50.Y, D50.Z);
2124
+ var convertLuvToXyz50 = ({ l, u, v, alpha }) => {
2125
+ if (l === void 0) l = 0;
2126
+ if (l === 0) return {
2127
+ mode: "xyz50",
2128
+ x: 0,
2129
+ y: 0,
2130
+ z: 0
2131
+ };
2132
+ if (u === void 0) u = 0;
2133
+ if (v === void 0) v = 0;
2134
+ let up = u / (13 * l) + un;
2135
+ let vp = v / (13 * l) + vn;
2136
+ let y = D50.Y * (l <= 8 ? l / k$2 : Math.pow((l + 16) / 116, 3));
2137
+ let res = {
2138
+ mode: "xyz50",
2139
+ x: y * (9 * up) / (4 * vp),
2140
+ y,
2141
+ z: y * (12 - 3 * up - 20 * vp) / (4 * vp)
2142
+ };
2143
+ if (alpha !== void 0) res.alpha = alpha;
2144
+ return res;
2145
+ };
2146
+ //#endregion
2147
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lchuv/definition.js
2148
+ var convertRgbToLchuv = (rgb) => convertLuvToLchuv(convertXyz50ToLuv(convertRgbToXyz50(rgb)));
2149
+ var convertLchuvToRgb = (lchuv) => convertXyz50ToRgb(convertLuvToXyz50(convertLchuvToLuv(lchuv)));
2150
+ var definition$11 = {
2151
+ mode: "lchuv",
2152
+ toMode: {
2153
+ luv: convertLchuvToLuv,
2154
+ rgb: convertLchuvToRgb
2155
+ },
2156
+ fromMode: {
2157
+ rgb: convertRgbToLchuv,
2158
+ luv: convertLuvToLchuv
2159
+ },
2160
+ channels: [
2161
+ "l",
2162
+ "c",
2163
+ "h",
2164
+ "alpha"
2165
+ ],
2166
+ parse: ["--lchuv"],
2167
+ serialize: "--lchuv",
2168
+ ranges: {
2169
+ l: [0, 100],
2170
+ c: [0, 176.956],
2171
+ h: [0, 360]
2172
+ },
2173
+ interpolate: {
2174
+ h: {
2175
+ use: interpolatorLinear,
2176
+ fixup: fixupHueShorter
2177
+ },
2178
+ c: interpolatorLinear,
2179
+ l: interpolatorLinear,
2180
+ alpha: {
2181
+ use: interpolatorLinear,
2182
+ fixup: fixupAlpha
2183
+ }
2184
+ },
2185
+ difference: { h: differenceHueChroma },
2186
+ average: { h: averageAngle }
2187
+ };
2188
+ //#endregion
2189
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lrgb/definition.js
2190
+ var definition$10 = {
2191
+ ...definition$27,
2192
+ mode: "lrgb",
2193
+ toMode: { rgb: convertLrgbToRgb },
2194
+ fromMode: { rgb: convertRgbToLrgb },
2195
+ parse: ["srgb-linear"],
2196
+ serialize: "srgb-linear"
2197
+ };
2198
+ //#endregion
2199
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/luv/definition.js
2200
+ var definition$9 = {
2201
+ mode: "luv",
2202
+ toMode: {
2203
+ xyz50: convertLuvToXyz50,
2204
+ rgb: (luv) => convertXyz50ToRgb(convertLuvToXyz50(luv))
2205
+ },
2206
+ fromMode: {
2207
+ xyz50: convertXyz50ToLuv,
2208
+ rgb: (rgb) => convertXyz50ToLuv(convertRgbToXyz50(rgb))
2209
+ },
2210
+ channels: [
2211
+ "l",
2212
+ "u",
2213
+ "v",
2214
+ "alpha"
2215
+ ],
2216
+ parse: ["--luv"],
2217
+ serialize: "--luv",
2218
+ ranges: {
2219
+ l: [0, 100],
2220
+ u: [-84.936, 175.042],
2221
+ v: [-125.882, 87.243]
2222
+ },
2223
+ interpolate: {
2224
+ l: interpolatorLinear,
2225
+ u: interpolatorLinear,
2226
+ v: interpolatorLinear,
2227
+ alpha: {
2228
+ use: interpolatorLinear,
2229
+ fixup: fixupAlpha
2230
+ }
2231
+ }
2232
+ };
2233
+ //#endregion
2234
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklab/convertLrgbToOklab.js
2235
+ var convertLrgbToOklab = ({ r, g, b, alpha }) => {
2236
+ if (r === void 0) r = 0;
2237
+ if (g === void 0) g = 0;
2238
+ if (b === void 0) b = 0;
2239
+ let L = Math.cbrt(.412221469470763 * r + .5363325372617348 * g + .0514459932675022 * b);
2240
+ let M = Math.cbrt(.2119034958178252 * r + .6806995506452344 * g + .1073969535369406 * b);
2241
+ let S = Math.cbrt(.0883024591900564 * r + .2817188391361215 * g + .6299787016738222 * b);
2242
+ let res = {
2243
+ mode: "oklab",
2244
+ l: .210454268309314 * L + .7936177747023054 * M - .0040720430116193 * S,
2245
+ a: 1.9779985324311684 * L - 2.42859224204858 * M + .450593709617411 * S,
2246
+ b: .0259040424655478 * L + .7827717124575296 * M - .8086757549230774 * S
2247
+ };
2248
+ if (alpha !== void 0) res.alpha = alpha;
2249
+ return res;
2250
+ };
2251
+ //#endregion
2252
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklab/convertRgbToOklab.js
2253
+ var convertRgbToOklab = (rgb) => {
2254
+ let res = convertLrgbToOklab(convertRgbToLrgb(rgb));
2255
+ if (rgb.r === rgb.b && rgb.b === rgb.g) res.a = res.b = 0;
2256
+ return res;
2257
+ };
2258
+ //#endregion
2259
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToLrgb.js
2260
+ var convertOklabToLrgb = ({ l, a, b, alpha }) => {
2261
+ if (l === void 0) l = 0;
2262
+ if (a === void 0) a = 0;
2263
+ if (b === void 0) b = 0;
2264
+ let L = Math.pow(l + .3963377773761749 * a + .2158037573099136 * b, 3);
2265
+ let M = Math.pow(l - .1055613458156586 * a - .0638541728258133 * b, 3);
2266
+ let S = Math.pow(l - .0894841775298119 * a - 1.2914855480194092 * b, 3);
2267
+ let res = {
2268
+ mode: "lrgb",
2269
+ r: 4.076741636075957 * L - 3.3077115392580616 * M + .2309699031821044 * S,
2270
+ g: -1.2684379732850317 * L + 2.6097573492876887 * M - .3413193760026573 * S,
2271
+ b: -.0041960761386756 * L - .7034186179359362 * M + 1.7076146940746117 * S
2272
+ };
2273
+ if (alpha !== void 0) res.alpha = alpha;
2274
+ return res;
2275
+ };
2276
+ //#endregion
2277
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToRgb.js
2278
+ var convertOklabToRgb = (c) => convertLrgbToRgb(convertOklabToLrgb(c));
2279
+ //#endregion
2280
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsl/helpers.js
2281
+ function toe(x) {
2282
+ const k_1 = .206;
2283
+ const k_2 = .03;
2284
+ const k_3 = (1 + k_1) / (1 + k_2);
2285
+ return .5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
2286
+ }
2287
+ function toe_inv(x) {
2288
+ const k_1 = .206;
2289
+ const k_2 = .03;
2290
+ const k_3 = (1 + k_1) / (1 + k_2);
2291
+ return (x * x + k_1 * x) / (k_3 * (x + k_2));
2292
+ }
2293
+ function compute_max_saturation(a, b) {
2294
+ let k0, k1, k2, k3, k4, wl, wm, ws;
2295
+ if (-1.88170328 * a - .80936493 * b > 1) {
2296
+ k0 = 1.19086277;
2297
+ k1 = 1.76576728;
2298
+ k2 = .59662641;
2299
+ k3 = .75515197;
2300
+ k4 = .56771245;
2301
+ wl = 4.0767416621;
2302
+ wm = -3.3077115913;
2303
+ ws = .2309699292;
2304
+ } else if (1.81444104 * a - 1.19445276 * b > 1) {
2305
+ k0 = .73956515;
2306
+ k1 = -.45954404;
2307
+ k2 = .08285427;
2308
+ k3 = .1254107;
2309
+ k4 = .14503204;
2310
+ wl = -1.2684380046;
2311
+ wm = 2.6097574011;
2312
+ ws = -.3413193965;
2313
+ } else {
2314
+ k0 = 1.35733652;
2315
+ k1 = -.00915799;
2316
+ k2 = -1.1513021;
2317
+ k3 = -.50559606;
2318
+ k4 = .00692167;
2319
+ wl = -.0041960863;
2320
+ wm = -.7034186147;
2321
+ ws = 1.707614701;
2322
+ }
2323
+ let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
2324
+ let k_l = .3963377774 * a + .2158037573 * b;
2325
+ let k_m = -.1055613458 * a - .0638541728 * b;
2326
+ let k_s = -.0894841775 * a - 1.291485548 * b;
2327
+ {
2328
+ let l_ = 1 + S * k_l;
2329
+ let m_ = 1 + S * k_m;
2330
+ let s_ = 1 + S * k_s;
2331
+ let l = l_ * l_ * l_;
2332
+ let m = m_ * m_ * m_;
2333
+ let s = s_ * s_ * s_;
2334
+ let l_dS = 3 * k_l * l_ * l_;
2335
+ let m_dS = 3 * k_m * m_ * m_;
2336
+ let s_dS = 3 * k_s * s_ * s_;
2337
+ let l_dS2 = 6 * k_l * k_l * l_;
2338
+ let m_dS2 = 6 * k_m * k_m * m_;
2339
+ let s_dS2 = 6 * k_s * k_s * s_;
2340
+ let f = wl * l + wm * m + ws * s;
2341
+ let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
2342
+ let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
2343
+ S = S - f * f1 / (f1 * f1 - .5 * f * f2);
2344
+ }
2345
+ return S;
2346
+ }
2347
+ function find_cusp(a, b) {
2348
+ let S_cusp = compute_max_saturation(a, b);
2349
+ let rgb = convertOklabToLrgb({
2350
+ l: 1,
2351
+ a: S_cusp * a,
2352
+ b: S_cusp * b
2353
+ });
2354
+ let L_cusp = Math.cbrt(1 / Math.max(rgb.r, rgb.g, rgb.b));
2355
+ return [L_cusp, L_cusp * S_cusp];
2356
+ }
2357
+ function find_gamut_intersection(a, b, L1, C1, L0, cusp = null) {
2358
+ if (!cusp) cusp = find_cusp(a, b);
2359
+ let t;
2360
+ if ((L1 - L0) * cusp[1] - (cusp[0] - L0) * C1 <= 0) t = cusp[1] * L0 / (C1 * cusp[0] + cusp[1] * (L0 - L1));
2361
+ else {
2362
+ t = cusp[1] * (L0 - 1) / (C1 * (cusp[0] - 1) + cusp[1] * (L0 - L1));
2363
+ {
2364
+ let dL = L1 - L0;
2365
+ let dC = C1;
2366
+ let k_l = .3963377774 * a + .2158037573 * b;
2367
+ let k_m = -.1055613458 * a - .0638541728 * b;
2368
+ let k_s = -.0894841775 * a - 1.291485548 * b;
2369
+ let l_dt = dL + dC * k_l;
2370
+ let m_dt = dL + dC * k_m;
2371
+ let s_dt = dL + dC * k_s;
2372
+ {
2373
+ let L = L0 * (1 - t) + t * L1;
2374
+ let C = t * C1;
2375
+ let l_ = L + C * k_l;
2376
+ let m_ = L + C * k_m;
2377
+ let s_ = L + C * k_s;
2378
+ let l = l_ * l_ * l_;
2379
+ let m = m_ * m_ * m_;
2380
+ let s = s_ * s_ * s_;
2381
+ let ldt = 3 * l_dt * l_ * l_;
2382
+ let mdt = 3 * m_dt * m_ * m_;
2383
+ let sdt = 3 * s_dt * s_ * s_;
2384
+ let ldt2 = 6 * l_dt * l_dt * l_;
2385
+ let mdt2 = 6 * m_dt * m_dt * m_;
2386
+ let sdt2 = 6 * s_dt * s_dt * s_;
2387
+ let r = 4.0767416621 * l - 3.3077115913 * m + .2309699292 * s - 1;
2388
+ let r1 = 4.0767416621 * ldt - 3.3077115913 * mdt + .2309699292 * sdt;
2389
+ let r2 = 4.0767416621 * ldt2 - 3.3077115913 * mdt2 + .2309699292 * sdt2;
2390
+ let u_r = r1 / (r1 * r1 - .5 * r * r2);
2391
+ let t_r = -r * u_r;
2392
+ let g = -1.2684380046 * l + 2.6097574011 * m - .3413193965 * s - 1;
2393
+ let g1 = -1.2684380046 * ldt + 2.6097574011 * mdt - .3413193965 * sdt;
2394
+ let g2 = -1.2684380046 * ldt2 + 2.6097574011 * mdt2 - .3413193965 * sdt2;
2395
+ let u_g = g1 / (g1 * g1 - .5 * g * g2);
2396
+ let t_g = -g * u_g;
2397
+ let b = -.0041960863 * l - .7034186147 * m + 1.707614701 * s - 1;
2398
+ let b1 = -.0041960863 * ldt - .7034186147 * mdt + 1.707614701 * sdt;
2399
+ let b2 = -.0041960863 * ldt2 - .7034186147 * mdt2 + 1.707614701 * sdt2;
2400
+ let u_b = b1 / (b1 * b1 - .5 * b * b2);
2401
+ let t_b = -b * u_b;
2402
+ t_r = u_r >= 0 ? t_r : 1e6;
2403
+ t_g = u_g >= 0 ? t_g : 1e6;
2404
+ t_b = u_b >= 0 ? t_b : 1e6;
2405
+ t += Math.min(t_r, Math.min(t_g, t_b));
2406
+ }
2407
+ }
2408
+ }
2409
+ return t;
2410
+ }
2411
+ function get_ST_max(a_, b_, cusp = null) {
2412
+ if (!cusp) cusp = find_cusp(a_, b_);
2413
+ let L = cusp[0];
2414
+ let C = cusp[1];
2415
+ return [C / L, C / (1 - L)];
2416
+ }
2417
+ function get_Cs(L, a_, b_) {
2418
+ let cusp = find_cusp(a_, b_);
2419
+ let C_max = find_gamut_intersection(a_, b_, L, 1, L, cusp);
2420
+ let ST_max = get_ST_max(a_, b_, cusp);
2421
+ let S_mid = .11516993 + 1 / (7.4477897 + 4.1590124 * b_ + a_ * (-2.19557347 + 1.75198401 * b_ + a_ * (-2.13704948 - 10.02301043 * b_ + a_ * (-4.24894561 + 5.38770819 * b_ + 4.69891013 * a_))));
2422
+ let T_mid = .11239642 + 1 / (1.6132032 - .68124379 * b_ + a_ * (.40370612 + .90148123 * b_ + a_ * (-.27087943 + .6122399 * b_ + a_ * (.00299215 - .45399568 * b_ - .14661872 * a_))));
2423
+ let k = C_max / Math.min(L * ST_max[0], (1 - L) * ST_max[1]);
2424
+ let C_a = L * S_mid;
2425
+ let C_b = (1 - L) * T_mid;
2426
+ let C_mid = .9 * k * Math.sqrt(Math.sqrt(1 / (1 / (C_a * C_a * C_a * C_a) + 1 / (C_b * C_b * C_b * C_b))));
2427
+ C_a = L * .4;
2428
+ C_b = (1 - L) * .8;
2429
+ return [
2430
+ Math.sqrt(1 / (1 / (C_a * C_a) + 1 / (C_b * C_b))),
2431
+ C_mid,
2432
+ C_max
2433
+ ];
2434
+ }
2435
+ //#endregion
2436
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsl/convertOklabToOkhsl.js
2437
+ function convertOklabToOkhsl(lab) {
2438
+ const l = lab.l !== void 0 ? lab.l : 0;
2439
+ const a = lab.a !== void 0 ? lab.a : 0;
2440
+ const b = lab.b !== void 0 ? lab.b : 0;
2441
+ const ret = {
2442
+ mode: "okhsl",
2443
+ l: toe(l)
2444
+ };
2445
+ if (lab.alpha !== void 0) ret.alpha = lab.alpha;
2446
+ let c = Math.sqrt(a * a + b * b);
2447
+ if (!c) {
2448
+ ret.s = 0;
2449
+ return ret;
2450
+ }
2451
+ let [C_0, C_mid, C_max] = get_Cs(l, a / c, b / c);
2452
+ let s;
2453
+ if (c < C_mid) {
2454
+ let k_0 = 0;
2455
+ let k_1 = .8 * C_0;
2456
+ let k_2 = 1 - k_1 / C_mid;
2457
+ s = (c - k_0) / (k_1 + k_2 * (c - k_0)) * .8;
2458
+ } else {
2459
+ let k_0 = C_mid;
2460
+ let k_1 = .2 * C_mid * C_mid * 1.25 * 1.25 / C_0;
2461
+ let k_2 = 1 - k_1 / (C_max - C_mid);
2462
+ s = .8 + .2 * ((c - k_0) / (k_1 + k_2 * (c - k_0)));
2463
+ }
2464
+ if (s) {
2465
+ ret.s = s;
2466
+ ret.h = normalizeHue(Math.atan2(b, a) * 180 / Math.PI);
2467
+ }
2468
+ return ret;
2469
+ }
2470
+ //#endregion
2471
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsl/convertOkhslToOklab.js
2472
+ function convertOkhslToOklab(hsl) {
2473
+ let h = hsl.h !== void 0 ? hsl.h : 0;
2474
+ let s = hsl.s !== void 0 ? hsl.s : 0;
2475
+ let l = hsl.l !== void 0 ? hsl.l : 0;
2476
+ const ret = {
2477
+ mode: "oklab",
2478
+ l: toe_inv(l)
2479
+ };
2480
+ if (hsl.alpha !== void 0) ret.alpha = hsl.alpha;
2481
+ if (!s || l === 1) {
2482
+ ret.a = ret.b = 0;
2483
+ return ret;
2484
+ }
2485
+ let a_ = Math.cos(h / 180 * Math.PI);
2486
+ let b_ = Math.sin(h / 180 * Math.PI);
2487
+ let [C_0, C_mid, C_max] = get_Cs(ret.l, a_, b_);
2488
+ let t, k_0, k_1, k_2;
2489
+ if (s < .8) {
2490
+ t = 1.25 * s;
2491
+ k_0 = 0;
2492
+ k_1 = .8 * C_0;
2493
+ k_2 = 1 - k_1 / C_mid;
2494
+ } else {
2495
+ t = 5 * (s - .8);
2496
+ k_0 = C_mid;
2497
+ k_1 = .2 * C_mid * C_mid * 1.25 * 1.25 / C_0;
2498
+ k_2 = 1 - k_1 / (C_max - C_mid);
2499
+ }
2500
+ let C = k_0 + t * k_1 / (1 - k_2 * t);
2501
+ ret.a = C * a_;
2502
+ ret.b = C * b_;
2503
+ return ret;
2504
+ }
2505
+ //#endregion
2506
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsl/modeOkhsl.js
2507
+ var modeOkhsl = {
2508
+ ...definition$21,
2509
+ mode: "okhsl",
2510
+ channels: [
2511
+ "h",
2512
+ "s",
2513
+ "l",
2514
+ "alpha"
2515
+ ],
2516
+ parse: ["--okhsl"],
2517
+ serialize: "--okhsl",
2518
+ fromMode: {
2519
+ oklab: convertOklabToOkhsl,
2520
+ rgb: (c) => convertOklabToOkhsl(convertRgbToOklab(c))
2521
+ },
2522
+ toMode: {
2523
+ oklab: convertOkhslToOklab,
2524
+ rgb: (c) => convertOklabToRgb(convertOkhslToOklab(c))
2525
+ }
2526
+ };
2527
+ //#endregion
2528
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsv/convertOklabToOkhsv.js
2529
+ function convertOklabToOkhsv(lab) {
2530
+ let l = lab.l !== void 0 ? lab.l : 0;
2531
+ let a = lab.a !== void 0 ? lab.a : 0;
2532
+ let b = lab.b !== void 0 ? lab.b : 0;
2533
+ let c = Math.sqrt(a * a + b * b);
2534
+ let a_ = c ? a / c : 1;
2535
+ let b_ = c ? b / c : 1;
2536
+ let [S_max, T] = get_ST_max(a_, b_);
2537
+ let S_0 = .5;
2538
+ let k = 1 - S_0 / S_max;
2539
+ let t = T / (c + l * T);
2540
+ let L_v = t * l;
2541
+ let C_v = t * c;
2542
+ let L_vt = toe_inv(L_v);
2543
+ let C_vt = C_v * L_vt / L_v;
2544
+ let rgb_scale = convertOklabToLrgb({
2545
+ l: L_vt,
2546
+ a: a_ * C_vt,
2547
+ b: b_ * C_vt
2548
+ });
2549
+ let scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
2550
+ l = l / scale_L;
2551
+ c = c / scale_L * toe(l) / l;
2552
+ l = toe(l);
2553
+ const ret = {
2554
+ mode: "okhsv",
2555
+ s: c ? (S_0 + T) * C_v / (T * S_0 + T * k * C_v) : 0,
2556
+ v: l ? l / L_v : 0
2557
+ };
2558
+ if (ret.s) ret.h = normalizeHue(Math.atan2(b, a) * 180 / Math.PI);
2559
+ if (lab.alpha !== void 0) ret.alpha = lab.alpha;
2560
+ return ret;
2561
+ }
2562
+ //#endregion
2563
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
2564
+ function convertOkhsvToOklab(hsv) {
2565
+ const ret = { mode: "oklab" };
2566
+ if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
2567
+ const h = hsv.h !== void 0 ? hsv.h : 0;
2568
+ const s = hsv.s !== void 0 ? hsv.s : 0;
2569
+ const v = hsv.v !== void 0 ? hsv.v : 0;
2570
+ const a_ = Math.cos(h / 180 * Math.PI);
2571
+ const b_ = Math.sin(h / 180 * Math.PI);
2572
+ const [S_max, T] = get_ST_max(a_, b_);
2573
+ const S_0 = .5;
2574
+ const k = 1 - S_0 / S_max;
2575
+ const L_v = 1 - s * S_0 / (S_0 + T - T * k * s);
2576
+ const C_v = s * T * S_0 / (S_0 + T - T * k * s);
2577
+ const L_vt = toe_inv(L_v);
2578
+ const C_vt = C_v * L_vt / L_v;
2579
+ const rgb_scale = convertOklabToLrgb({
2580
+ l: L_vt,
2581
+ a: a_ * C_vt,
2582
+ b: b_ * C_vt
2583
+ });
2584
+ const scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
2585
+ const L_new = toe_inv(v * L_v);
2586
+ const C = C_v * L_new / L_v;
2587
+ ret.l = L_new * scale_L;
2588
+ ret.a = C * a_ * scale_L;
2589
+ ret.b = C * b_ * scale_L;
2590
+ return ret;
2591
+ }
2592
+ //#endregion
2593
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/okhsv/modeOkhsv.js
2594
+ var modeOkhsv = {
2595
+ ...definition$20,
2596
+ mode: "okhsv",
2597
+ channels: [
2598
+ "h",
2599
+ "s",
2600
+ "v",
2601
+ "alpha"
2602
+ ],
2603
+ parse: ["--okhsv"],
2604
+ serialize: "--okhsv",
2605
+ fromMode: {
2606
+ oklab: convertOklabToOkhsv,
2607
+ rgb: (c) => convertOklabToOkhsv(convertRgbToOklab(c))
2608
+ },
2609
+ toMode: {
2610
+ oklab: convertOkhsvToOklab,
2611
+ rgb: (c) => convertOklabToRgb(convertOkhsvToOklab(c))
2612
+ }
2613
+ };
2614
+ //#endregion
2615
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklab/parseOklab.js
2616
+ function parseOklab(color, parsed) {
2617
+ if (!parsed || parsed[0] !== "oklab") return;
2618
+ const res = { mode: "oklab" };
2619
+ const [, l, a, b, alpha] = parsed;
2620
+ if (l.type === Tok.Hue || a.type === Tok.Hue || b.type === Tok.Hue) return;
2621
+ if (l.type !== Tok.None) res.l = Math.min(Math.max(0, l.type === Tok.Number ? l.value : l.value / 100), 1);
2622
+ if (a.type !== Tok.None) res.a = a.type === Tok.Number ? a.value : a.value * .4 / 100;
2623
+ if (b.type !== Tok.None) res.b = b.type === Tok.Number ? b.value : b.value * .4 / 100;
2624
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
2625
+ return res;
2626
+ }
2627
+ //#endregion
2628
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklab/definition.js
2629
+ var definition$8 = {
2630
+ ...definition$15,
2631
+ mode: "oklab",
2632
+ toMode: {
2633
+ lrgb: convertOklabToLrgb,
2634
+ rgb: convertOklabToRgb
2635
+ },
2636
+ fromMode: {
2637
+ lrgb: convertLrgbToOklab,
2638
+ rgb: convertRgbToOklab
2639
+ },
2640
+ ranges: {
2641
+ l: [0, 1],
2642
+ a: [-.4, .4],
2643
+ b: [-.4, .4]
2644
+ },
2645
+ parse: [parseOklab],
2646
+ serialize: (c) => `oklab(${c.l !== void 0 ? c.l : "none"} ${c.a !== void 0 ? c.a : "none"} ${c.b !== void 0 ? c.b : "none"}${c.alpha < 1 ? ` / ${c.alpha}` : ""})`
2647
+ };
2648
+ //#endregion
2649
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklch/parseOklch.js
2650
+ function parseOklch(color, parsed) {
2651
+ if (!parsed || parsed[0] !== "oklch") return;
2652
+ const res = { mode: "oklch" };
2653
+ const [, l, c, h, alpha] = parsed;
2654
+ if (l.type !== Tok.None) {
2655
+ if (l.type === Tok.Hue) return;
2656
+ res.l = Math.min(Math.max(0, l.type === Tok.Number ? l.value : l.value / 100), 1);
2657
+ }
2658
+ if (c.type !== Tok.None) res.c = Math.max(0, c.type === Tok.Number ? c.value : c.value * .4 / 100);
2659
+ if (h.type !== Tok.None) {
2660
+ if (h.type === Tok.Percentage) return;
2661
+ res.h = h.value;
2662
+ }
2663
+ if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
2664
+ return res;
2665
+ }
2666
+ //#endregion
2667
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/oklch/definition.js
2668
+ var definition$7 = {
2669
+ ...definition$13,
2670
+ mode: "oklch",
2671
+ toMode: {
2672
+ oklab: (c) => convertLchToLab(c, "oklab"),
2673
+ rgb: (c) => convertOklabToRgb(convertLchToLab(c, "oklab"))
2674
+ },
2675
+ fromMode: {
2676
+ rgb: (c) => convertLabToLch(convertRgbToOklab(c), "oklch"),
2677
+ oklab: (c) => convertLabToLch(c, "oklch")
2678
+ },
2679
+ parse: [parseOklch],
2680
+ serialize: (c) => `oklch(${c.l !== void 0 ? c.l : "none"} ${c.c !== void 0 ? c.c : "none"} ${c.h !== void 0 ? c.h : "none"}${c.alpha < 1 ? ` / ${c.alpha}` : ""})`,
2681
+ ranges: {
2682
+ l: [0, 1],
2683
+ c: [0, .4],
2684
+ h: [0, 360]
2685
+ }
2686
+ };
2687
+ //#endregion
2688
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/p3/convertP3ToXyz65.js
2689
+ var convertP3ToXyz65 = (rgb) => {
2690
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb);
2691
+ let res = {
2692
+ mode: "xyz65",
2693
+ x: .486570948648216 * r + .265667693169093 * g + .1982172852343625 * b,
2694
+ y: .2289745640697487 * r + .6917385218365062 * g + .079286914093745 * b,
2695
+ z: 0 * r + .0451133818589026 * g + 1.043944368900976 * b
2696
+ };
2697
+ if (alpha !== void 0) res.alpha = alpha;
2698
+ return res;
2699
+ };
2700
+ //#endregion
2701
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/p3/convertXyz65ToP3.js
2702
+ var convertXyz65ToP3 = ({ x, y, z, alpha }) => {
2703
+ if (x === void 0) x = 0;
2704
+ if (y === void 0) y = 0;
2705
+ if (z === void 0) z = 0;
2706
+ let res = convertLrgbToRgb({
2707
+ r: x * 2.4934969119414263 - y * .9313836179191242 - .402710784450717 * z,
2708
+ g: x * -.8294889695615749 + y * 1.7626640603183465 + .0236246858419436 * z,
2709
+ b: x * .0358458302437845 - y * .0761723892680418 + .9568845240076871 * z
2710
+ }, "p3");
2711
+ if (alpha !== void 0) res.alpha = alpha;
2712
+ return res;
2713
+ };
2714
+ //#endregion
2715
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/p3/definition.js
2716
+ var definition$6 = {
2717
+ ...definition$27,
2718
+ mode: "p3",
2719
+ parse: ["display-p3"],
2720
+ serialize: "display-p3",
2721
+ fromMode: {
2722
+ rgb: (color) => convertXyz65ToP3(convertRgbToXyz65(color)),
2723
+ xyz65: convertXyz65ToP3
2724
+ },
2725
+ toMode: {
2726
+ rgb: (color) => convertXyz65ToRgb(convertP3ToXyz65(color)),
2727
+ xyz65: convertP3ToXyz65
2728
+ }
2729
+ };
2730
+ //#endregion
2731
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
2732
+ var gamma$1 = (v) => {
2733
+ let abs = Math.abs(v);
2734
+ if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
2735
+ return 16 * v;
2736
+ };
2737
+ var convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
2738
+ if (x === void 0) x = 0;
2739
+ if (y === void 0) y = 0;
2740
+ if (z === void 0) z = 0;
2741
+ let res = {
2742
+ mode: "prophoto",
2743
+ r: gamma$1(x * 1.3457868816471585 - y * .2555720873797946 - .0511018649755453 * z),
2744
+ g: gamma$1(x * -.5446307051249019 + y * 1.5082477428451466 + .0205274474364214 * z),
2745
+ b: gamma$1(x * 0 + y * 0 + 1.2119675456389452 * z)
2746
+ };
2747
+ if (alpha !== void 0) res.alpha = alpha;
2748
+ return res;
2749
+ };
2750
+ //#endregion
2751
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
2752
+ var linearize$1 = (v = 0) => {
2753
+ let abs = Math.abs(v);
2754
+ if (abs >= 16 / 512) return Math.sign(v) * Math.pow(abs, 1.8);
2755
+ return v / 16;
2756
+ };
2757
+ var convertProphotoToXyz50 = (prophoto) => {
2758
+ let r = linearize$1(prophoto.r);
2759
+ let g = linearize$1(prophoto.g);
2760
+ let b = linearize$1(prophoto.b);
2761
+ let res = {
2762
+ mode: "xyz50",
2763
+ x: .7977666449006423 * r + .1351812974005331 * g + .0313477341283922 * b,
2764
+ y: .2880748288194013 * r + .7118352342418731 * g + 899369387256e-16 * b,
2765
+ z: 0 * r + 0 * g + .8251046025104602 * b
2766
+ };
2767
+ if (prophoto.alpha !== void 0) res.alpha = prophoto.alpha;
2768
+ return res;
2769
+ };
2770
+ //#endregion
2771
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/prophoto/definition.js
2772
+ var definition$5 = {
2773
+ ...definition$27,
2774
+ mode: "prophoto",
2775
+ parse: ["prophoto-rgb"],
2776
+ serialize: "prophoto-rgb",
2777
+ fromMode: {
2778
+ xyz50: convertXyz50ToProphoto,
2779
+ rgb: (color) => convertXyz50ToProphoto(convertRgbToXyz50(color))
2780
+ },
2781
+ toMode: {
2782
+ xyz50: convertProphotoToXyz50,
2783
+ rgb: (color) => convertXyz50ToRgb(convertProphotoToXyz50(color))
2784
+ }
2785
+ };
2786
+ //#endregion
2787
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
2788
+ var α$1 = 1.09929682680944;
2789
+ var β$1 = .018053968510807;
2790
+ var gamma = (v) => {
2791
+ const abs = Math.abs(v);
2792
+ if (abs > β$1) return (Math.sign(v) || 1) * (α$1 * Math.pow(abs, .45) - (α$1 - 1));
2793
+ return 4.5 * v;
2794
+ };
2795
+ var convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
2796
+ if (x === void 0) x = 0;
2797
+ if (y === void 0) y = 0;
2798
+ if (z === void 0) z = 0;
2799
+ let res = {
2800
+ mode: "rec2020",
2801
+ r: gamma(x * 1.7166511879712683 - y * .3556707837763925 - .2533662813736599 * z),
2802
+ g: gamma(x * -.6666843518324893 + y * 1.6164812366349395 + .0157685458139111 * z),
2803
+ b: gamma(x * .0176398574453108 - y * .0427706132578085 + .9421031212354739 * z)
2804
+ };
2805
+ if (alpha !== void 0) res.alpha = alpha;
2806
+ return res;
2807
+ };
2808
+ //#endregion
2809
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
2810
+ var α = 1.09929682680944;
2811
+ var β = .018053968510807;
2812
+ var linearize = (v = 0) => {
2813
+ let abs = Math.abs(v);
2814
+ if (abs < β * 4.5) return v / 4.5;
2815
+ return (Math.sign(v) || 1) * Math.pow((abs + α - 1) / α, 1 / .45);
2816
+ };
2817
+ var convertRec2020ToXyz65 = (rec2020) => {
2818
+ let r = linearize(rec2020.r);
2819
+ let g = linearize(rec2020.g);
2820
+ let b = linearize(rec2020.b);
2821
+ let res = {
2822
+ mode: "xyz65",
2823
+ x: .6369580483012911 * r + .1446169035862083 * g + .1688809751641721 * b,
2824
+ y: .262700212011267 * r + .6779980715188708 * g + .059301716469862 * b,
2825
+ z: 0 * r + .0280726930490874 * g + 1.0609850577107909 * b
2826
+ };
2827
+ if (rec2020.alpha !== void 0) res.alpha = rec2020.alpha;
2828
+ return res;
2829
+ };
2830
+ //#endregion
2831
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rec2020/definition.js
2832
+ var definition$4 = {
2833
+ ...definition$27,
2834
+ mode: "rec2020",
2835
+ fromMode: {
2836
+ xyz65: convertXyz65ToRec2020,
2837
+ rgb: (color) => convertXyz65ToRec2020(convertRgbToXyz65(color))
2838
+ },
2839
+ toMode: {
2840
+ xyz65: convertRec2020ToXyz65,
2841
+ rgb: (color) => convertXyz65ToRgb(convertRec2020ToXyz65(color))
2842
+ },
2843
+ parse: ["rec2020"],
2844
+ serialize: "rec2020"
2845
+ };
2846
+ //#endregion
2847
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyb/constants.js
2848
+ var bias = .0037930732552754493;
2849
+ var bias_cbrt = Math.cbrt(bias);
2850
+ //#endregion
2851
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyb/convertRgbToXyb.js
2852
+ var transfer$1 = (v) => Math.cbrt(v) - bias_cbrt;
2853
+ var convertRgbToXyb = (color) => {
2854
+ const { r, g, b, alpha } = convertRgbToLrgb(color);
2855
+ const l = transfer$1(.3 * r + .622 * g + .078 * b + bias);
2856
+ const m = transfer$1(.23 * r + .692 * g + .078 * b + bias);
2857
+ const s = transfer$1(.2434226892454782 * r + .2047674442449682 * g + .5518098665095535 * b + bias);
2858
+ const res = {
2859
+ mode: "xyb",
2860
+ x: (l - m) / 2,
2861
+ y: (l + m) / 2,
2862
+ b: s - (l + m) / 2
2863
+ };
2864
+ if (alpha !== void 0) res.alpha = alpha;
2865
+ return res;
2866
+ };
2867
+ //#endregion
2868
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyb/convertXybToRgb.js
2869
+ var transfer = (v) => Math.pow(v + bias_cbrt, 3);
2870
+ var convertXybToRgb = ({ x, y, b, alpha }) => {
2871
+ if (x === void 0) x = 0;
2872
+ if (y === void 0) y = 0;
2873
+ if (b === void 0) b = 0;
2874
+ const l = transfer(x + y) - bias;
2875
+ const m = transfer(y - x) - bias;
2876
+ const s = transfer(b + y) - bias;
2877
+ const res = convertLrgbToRgb({
2878
+ r: 11.031566904639861 * l - 9.866943908131562 * m - .16462299650829934 * s,
2879
+ g: -3.2541473810744237 * l + 4.418770377582723 * m - .16462299650829934 * s,
2880
+ b: -3.6588512867136815 * l + 2.7129230459360922 * m + 1.9459282407775895 * s
2881
+ });
2882
+ if (alpha !== void 0) res.alpha = alpha;
2883
+ return res;
2884
+ };
2885
+ //#endregion
2886
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyb/definition.js
2887
+ var definition$3 = {
2888
+ mode: "xyb",
2889
+ channels: [
2890
+ "x",
2891
+ "y",
2892
+ "b",
2893
+ "alpha"
2894
+ ],
2895
+ parse: ["--xyb"],
2896
+ serialize: "--xyb",
2897
+ toMode: { rgb: convertXybToRgb },
2898
+ fromMode: { rgb: convertRgbToXyb },
2899
+ ranges: {
2900
+ x: [-.0154, .0281],
2901
+ y: [0, .8453],
2902
+ b: [-.2778, .388]
2903
+ },
2904
+ interpolate: {
2905
+ x: interpolatorLinear,
2906
+ y: interpolatorLinear,
2907
+ b: interpolatorLinear,
2908
+ alpha: {
2909
+ use: interpolatorLinear,
2910
+ fixup: fixupAlpha
2911
+ }
2912
+ }
2913
+ };
2914
+ //#endregion
2915
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz50/definition.js
2916
+ var definition$2 = {
2917
+ mode: "xyz50",
2918
+ parse: ["xyz-d50"],
2919
+ serialize: "xyz-d50",
2920
+ toMode: {
2921
+ rgb: convertXyz50ToRgb,
2922
+ lab: convertXyz50ToLab
2923
+ },
2924
+ fromMode: {
2925
+ rgb: convertRgbToXyz50,
2926
+ lab: convertLabToXyz50
2927
+ },
2928
+ channels: [
2929
+ "x",
2930
+ "y",
2931
+ "z",
2932
+ "alpha"
2933
+ ],
2934
+ ranges: {
2935
+ x: [0, .964],
2936
+ y: [0, .999],
2937
+ z: [0, .825]
2938
+ },
2939
+ interpolate: {
2940
+ x: interpolatorLinear,
2941
+ y: interpolatorLinear,
2942
+ z: interpolatorLinear,
2943
+ alpha: {
2944
+ use: interpolatorLinear,
2945
+ fixup: fixupAlpha
2946
+ }
2947
+ }
2948
+ };
2949
+ //#endregion
2950
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
2951
+ var convertXyz65ToXyz50 = (xyz65) => {
2952
+ let { x, y, z, alpha } = xyz65;
2953
+ if (x === void 0) x = 0;
2954
+ if (y === void 0) y = 0;
2955
+ if (z === void 0) z = 0;
2956
+ let res = {
2957
+ mode: "xyz50",
2958
+ x: 1.0479298208405488 * x + .0229467933410191 * y - .0501922295431356 * z,
2959
+ y: .0296278156881593 * x + .990434484573249 * y - .0170738250293851 * z,
2960
+ z: -.0092430581525912 * x + .0150551448965779 * y + .7518742899580008 * z
2961
+ };
2962
+ if (alpha !== void 0) res.alpha = alpha;
2963
+ return res;
2964
+ };
2965
+ //#endregion
2966
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
2967
+ var convertXyz50ToXyz65 = (xyz50) => {
2968
+ let { x, y, z, alpha } = xyz50;
2969
+ if (x === void 0) x = 0;
2970
+ if (y === void 0) y = 0;
2971
+ if (z === void 0) z = 0;
2972
+ let res = {
2973
+ mode: "xyz65",
2974
+ x: .9554734527042182 * x - .0230985368742614 * y + .0632593086610217 * z,
2975
+ y: -.0283697069632081 * x + 1.0099954580058226 * y + .021041398966943 * z,
2976
+ z: .0123140016883199 * x - .0205076964334779 * y + 1.3303659366080753 * z
2977
+ };
2978
+ if (alpha !== void 0) res.alpha = alpha;
2979
+ return res;
2980
+ };
2981
+ //#endregion
2982
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/definition.js
2983
+ var definition$1 = {
2984
+ mode: "xyz65",
2985
+ toMode: {
2986
+ rgb: convertXyz65ToRgb,
2987
+ xyz50: convertXyz65ToXyz50
2988
+ },
2989
+ fromMode: {
2990
+ rgb: convertRgbToXyz65,
2991
+ xyz50: convertXyz50ToXyz65
2992
+ },
2993
+ ranges: {
2994
+ x: [0, .95],
2995
+ y: [0, 1],
2996
+ z: [0, 1.088]
2997
+ },
2998
+ channels: [
2999
+ "x",
3000
+ "y",
3001
+ "z",
3002
+ "alpha"
3003
+ ],
3004
+ parse: ["xyz", "xyz-d65"],
3005
+ serialize: "xyz-d65",
3006
+ interpolate: {
3007
+ x: interpolatorLinear,
3008
+ y: interpolatorLinear,
3009
+ z: interpolatorLinear,
3010
+ alpha: {
3011
+ use: interpolatorLinear,
3012
+ fixup: fixupAlpha
3013
+ }
3014
+ }
3015
+ };
3016
+ //#endregion
3017
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/yiq/convertRgbToYiq.js
3018
+ var convertRgbToYiq = ({ r, g, b, alpha }) => {
3019
+ if (r === void 0) r = 0;
3020
+ if (g === void 0) g = 0;
3021
+ if (b === void 0) b = 0;
3022
+ const res = {
3023
+ mode: "yiq",
3024
+ y: .29889531 * r + .58662247 * g + .11448223 * b,
3025
+ i: .59597799 * r - .2741761 * g - .32180189 * b,
3026
+ q: .21147017 * r - .52261711 * g + .31114694 * b
3027
+ };
3028
+ if (alpha !== void 0) res.alpha = alpha;
3029
+ return res;
3030
+ };
3031
+ //#endregion
3032
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/yiq/convertYiqToRgb.js
3033
+ var convertYiqToRgb = ({ y, i, q, alpha }) => {
3034
+ if (y === void 0) y = 0;
3035
+ if (i === void 0) i = 0;
3036
+ if (q === void 0) q = 0;
3037
+ const res = {
3038
+ mode: "rgb",
3039
+ r: y + .95608445 * i + .6208885 * q,
3040
+ g: y - .27137664 * i - .6486059 * q,
3041
+ b: y - 1.10561724 * i + 1.70250126 * q
3042
+ };
3043
+ if (alpha !== void 0) res.alpha = alpha;
3044
+ return res;
3045
+ };
3046
+ //#endregion
3047
+ //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/yiq/definition.js
3048
+ var definition = {
3049
+ mode: "yiq",
3050
+ toMode: { rgb: convertYiqToRgb },
3051
+ fromMode: { rgb: convertRgbToYiq },
3052
+ channels: [
3053
+ "y",
3054
+ "i",
3055
+ "q",
3056
+ "alpha"
3057
+ ],
3058
+ parse: ["--yiq"],
3059
+ serialize: "--yiq",
3060
+ ranges: {
3061
+ i: [-.595, .595],
3062
+ q: [-.522, .522]
3063
+ },
3064
+ interpolate: {
3065
+ y: interpolatorLinear,
3066
+ i: interpolatorLinear,
3067
+ q: interpolatorLinear,
3068
+ alpha: {
3069
+ use: interpolatorLinear,
3070
+ fixup: fixupAlpha
3071
+ }
3072
+ }
3073
+ };
3074
+ useMode(definition$26);
3075
+ useMode(definition$25);
3076
+ useMode(definition$24);
3077
+ useMode(definition$23);
3078
+ useMode(definition$22);
3079
+ useMode(definition$21);
3080
+ useMode(definition$20);
3081
+ useMode(definition$19);
3082
+ useMode(definition$18);
3083
+ useMode(definition$17);
3084
+ useMode(definition$16);
3085
+ useMode(definition$15);
3086
+ useMode(definition$14);
3087
+ useMode(definition$13);
3088
+ useMode(definition$12);
3089
+ useMode(definition$11);
3090
+ useMode(definition$10);
3091
+ useMode(definition$9);
3092
+ useMode(modeOkhsl);
3093
+ useMode(modeOkhsv);
3094
+ useMode(definition$8);
3095
+ useMode(definition$7);
3096
+ useMode(definition$6);
3097
+ useMode(definition$5);
3098
+ useMode(definition$4);
3099
+ useMode(definition$27);
3100
+ useMode(definition$3);
3101
+ useMode(definition$2);
3102
+ useMode(definition$1);
3103
+ useMode(definition);
3104
+ //#endregion
3105
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.19.0+7524df1edfed9f02/node_modules/@basmilius/http-client/dist/index.mjs
3106
+ function c(e) {
3107
+ return class extends e {
3108
+ constructor(...e) {
3109
+ throw Error(`@adapter: cannot create instance of class.`);
3110
+ }
3111
+ };
3112
+ }
3113
+ function ne(e, t) {
3114
+ return e === t ? !0 : e === t;
3115
+ }
3116
+ var l = Symbol(), u = Symbol(), d = Symbol(), f = Symbol(), p = Symbol(), m = Symbol(), h$1 = Symbol(), g = Symbol(), _ = Symbol(), re = Symbol(), ie = Symbol();
3117
+ function v(e) {
3118
+ return e && typeof e == `object` && !!e[p];
3119
+ }
3120
+ function y$1(e) {
3121
+ if (!v(e)) throw Error(`@dto assert given object is not a class decorated with @Dto.`);
3122
+ }
3123
+ var ae = Symbol();
3124
+ function b(e, t = 0, n) {
3125
+ return function(...r) {
3126
+ let i = e[ae] ??= /* @__PURE__ */ new WeakMap(), a = r[t], o = n === void 0 ? `self` : r[n];
3127
+ if (typeof a != `object` || !a) return e.call(this, ...r);
3128
+ i.has(a) || i.set(a, []);
3129
+ let s = i.get(a);
3130
+ if (!s.includes(o)) {
3131
+ s.push(o);
3132
+ try {
3133
+ return e.call(this, ...r);
3134
+ } finally {
3135
+ let e = s.lastIndexOf(o);
3136
+ e !== -1 && s.splice(e, 1), s.length === 0 && i.delete(a);
3137
+ }
3138
+ }
3139
+ };
3140
+ }
3141
+ function x$1(e) {
3142
+ return y$1(e), e[f];
3143
+ }
3144
+ var S = b(function(e, t, n, r) {
3145
+ let i = e[ie];
3146
+ i(e, t, n, r), e[m] && S(e[m], e[h$1], e[m][e[h$1]]);
3147
+ }, 0, 1), C$1 = b(function(e) {
3148
+ y$1(e), e[f] && (e[f] = !1, S(e, f, !1, !0)), !(!e[u] || e[u].length === 0) && e[u].filter(x$1).forEach(C$1);
3149
+ });
3150
+ var w = b(function(e, t) {
3151
+ y$1(e), e[f] || (e[f] = !0, S(e, f, !0, !1)), e[m] && w(e[m], e[h$1]);
3152
+ });
3153
+ function T(e, t, n) {
3154
+ t[u] ??= [], !t[u].includes(e) && t[u].push(e), e[m] !== t && (e[m] = t), e[h$1] !== n && (e[h$1] = n);
3155
+ }
3156
+ function E(e, t, n) {
3157
+ if (v(n)) T(n, e, t);
3158
+ else if (Array.isArray(n)) {
3159
+ for (let r of n) v(r) && T(r, e, t);
3160
+ n[m] = e, n[h$1] = t;
3161
+ }
3162
+ }
3163
+ function le(e, t) {
3164
+ let n = e[re];
3165
+ n(e, t);
3166
+ }
3167
+ function D(e, t) {
3168
+ if (u in t) {
3169
+ let n = t[u].indexOf(e);
3170
+ n !== -1 && t[u].splice(n, 1);
3171
+ }
3172
+ e[m] = void 0, e[h$1] = void 0;
3173
+ }
3174
+ function ue(e, t) {
3175
+ if (v(t)) D(t, e);
3176
+ else if (Array.isArray(t)) {
3177
+ for (let n of t) v(n) && D(n, e);
3178
+ t[m] = void 0, t[h$1] = void 0;
3179
+ }
3180
+ }
3181
+ var O$1 = {};
3182
+ var k$1 = {
3183
+ deleteProperty(e, t) {
3184
+ if (Reflect.deleteProperty(e, t), A$1(e, t)) return !0;
3185
+ let n = e[m];
3186
+ return n && S(n, e[h$1], n[e[h$1]]), n && w(n, e[h$1]), !0;
3187
+ },
3188
+ get(e, t, n) {
3189
+ if (t === _) return !0;
3190
+ if (A$1(e, t)) return Reflect.get(e, t, n);
3191
+ let r = e[m];
3192
+ return r && le(r, e[h$1]), Reflect.get(e, t);
3193
+ },
3194
+ set(e, t, n, r) {
3195
+ if (A$1(e, t)) return Reflect.set(e, t, n, r);
3196
+ let i = e[m];
3197
+ return i && S(i, e[h$1], i[e[h$1]]), i && w(i, e[h$1]), Reflect.set(e, t, n);
3198
+ }
3199
+ };
3200
+ function A$1(e, t) {
3201
+ return typeof t == `symbol` || typeof e[t] == `function` || t === `length`;
3202
+ }
3203
+ var de = {
3204
+ get(e, t, n) {
3205
+ if (t === _) return !0;
3206
+ if (typeof t == `symbol`) return Reflect.get(e, t, n);
3207
+ let r = e[d][t];
3208
+ if (!r || !r.get) return Reflect.get(e, t, n);
3209
+ let i = r.get.call(e);
3210
+ return le(e, t), E(e, t, i), i;
3211
+ },
3212
+ getOwnPropertyDescriptor(e, t) {
3213
+ return e[d][t];
3214
+ },
3215
+ ownKeys(e) {
3216
+ return e[g];
3217
+ },
3218
+ set(e, t, n, r) {
3219
+ if (typeof t == `symbol`) return Reflect.set(e, t, n, r);
3220
+ let i = e[d][t];
3221
+ if (!i || !i.set) return Reflect.set(e, t, n, r);
3222
+ let a = i.get?.call(e) ?? void 0;
3223
+ return ne(n, a) ? !0 : (ue(e, a), Array.isArray(n) && !n[_] && (n = new Proxy(n, k$1)), i.set.call(e, n), E(e, t, n), w(e, t), S(e, t, n, a), !0);
3224
+ }
3225
+ }, fe$1 = {
3226
+ get(e, t, n) {
3227
+ return t === `__v_isRef` ? !1 : t === _ ? !0 : t in e ? Reflect.get(e, t, n) : Reflect.get(e.value, t);
3228
+ },
3229
+ getOwnPropertyDescriptor(e, t) {
3230
+ return Reflect.getOwnPropertyDescriptor(e.value, t);
3231
+ },
3232
+ ownKeys(e) {
3233
+ return Reflect.ownKeys(e.value);
3234
+ },
3235
+ set(e, t, n, r) {
3236
+ return t in e ? Reflect.set(e, t, n, r) : Reflect.set(e.value, t, n);
3237
+ }
3238
+ }, pe$1 = { construct(e, t, n) {
3239
+ t = t.map((e) => Array.isArray(e) ? new Proxy(e, k$1) : e);
3240
+ let r = customRef((r, i) => {
3241
+ let a = markRaw(Reflect.construct(e, t, n));
3242
+ a[l] = t, a[f] = !1, a[re] = r, a[ie] = i;
3243
+ let s = new Proxy(a, de);
3244
+ return {
3245
+ get: () => (r(), s),
3246
+ set: () => void 0
3247
+ };
3248
+ });
3249
+ return new Proxy(r, fe$1);
3250
+ } };
3251
+ function me() {
3252
+ let e = this;
3253
+ y$1(e);
3254
+ let t = O$1[e[p]], n = new t(...e[l]);
3255
+ for (let [e, t] of Object.entries(this[d])) t.set && (n[e] = v(this[e]) ? this[e].clone() : this[e]);
3256
+ return n;
3257
+ }
3258
+ function he(e) {
3259
+ for (let t in e) {
3260
+ let n = this[d][t];
3261
+ v(this[t]) && typeof e[t] == `object` ? this[t].fill(e[t]) : n && n.set && (this[t] = e[t]);
3262
+ }
3263
+ }
3264
+ function ge() {
3265
+ let e = {};
3266
+ for (let t of this[g]) {
3267
+ let n = this[t];
3268
+ v(n) && (n = n.toJSON()), e[t] = n;
3269
+ }
3270
+ return e;
3271
+ }
3272
+ function j(e) {
3273
+ ve(e);
3274
+ let t = Object.freeze(x$2(e)), a = Object.keys(t);
3275
+ return K$1(e.prototype, d, t), K$1(e.prototype, p, e.name), K$1(e.prototype, g, a), K$1(e, Symbol.hasInstance, (t) => typeof t == `object` && t?.[p] === e.name), G$1(e, `clone`, me), G$1(e, `fill`, he), G$1(e, `toJSON`, ge), _e(e);
3276
+ }
3277
+ function _e(e) {
3278
+ let t = new Proxy(e, pe$1);
3279
+ return O$1[e.name] = t, t;
3280
+ }
3281
+ function ve(e) {
3282
+ let t = Object.getPrototypeOf(e.prototype);
3283
+ if (p in t) throw Error(`⛔️ @dto ${e.name} cannot extend parent class which is also decorated with @dto ${t[p]}.`);
3284
+ }
3285
+ function B(e, t, n, r) {
3286
+ var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
3287
+ if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a = Reflect.decorate(e, t, n, r);
3288
+ else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
3289
+ return i > 3 && a && Object.defineProperty(t, n, a), a;
3290
+ }
3291
+ var V = class {
3292
+ get blob() {
3293
+ return this.#e;
3294
+ }
3295
+ get name() {
3296
+ return this.#t;
3297
+ }
3298
+ #e;
3299
+ #t;
3300
+ constructor(e, t) {
3301
+ this.#e = e, this.#t = t;
3302
+ }
3303
+ };
3304
+ V = B([j], V);
3305
+ var U = class {
3306
+ get items() {
3307
+ return this.#e;
3308
+ }
3309
+ get page() {
3310
+ return this.#t;
3311
+ }
3312
+ get pageSize() {
3313
+ return this.#n;
3314
+ }
3315
+ get pages() {
3316
+ return this.#r;
3317
+ }
3318
+ get total() {
3319
+ return this.#i;
3320
+ }
3321
+ #e;
3322
+ #t;
3323
+ #n;
3324
+ #r;
3325
+ #i;
3326
+ constructor(e, t, n, r, i) {
3327
+ this.#e = e, this.#t = t, this.#n = n, this.#r = r, this.#i = i;
3328
+ }
3329
+ };
3330
+ U = B([j], U);
3331
+ var W = U;
3332
+ var G = class {
3333
+ get code() {
3334
+ return this.#e;
3335
+ }
3336
+ get error() {
3337
+ return this.#t;
3338
+ }
3339
+ get errorDescription() {
3340
+ return this.#n;
3341
+ }
3342
+ get statusCode() {
3343
+ return this.#r;
3344
+ }
3345
+ #e;
3346
+ #t;
3347
+ #n;
3348
+ #r;
3349
+ constructor(e, t, n, r) {
3350
+ this.#e = e, this.#t = t, this.#n = n, this.#r = r;
3351
+ }
3352
+ };
3353
+ G = B([j], G);
3354
+ var K = G;
3355
+ var q = class {
3356
+ get code() {
3357
+ return this.#e;
3358
+ }
3359
+ get error() {
3360
+ return this.#t;
3361
+ }
3362
+ get errorDescription() {
3363
+ return this.#n;
3364
+ }
3365
+ get errors() {
3366
+ return this.#r;
3367
+ }
3368
+ get params() {
3369
+ return this.#i;
3370
+ }
3371
+ #e;
3372
+ #t;
3373
+ #n;
3374
+ #r;
3375
+ #i;
3376
+ constructor(e, t, n, r, i) {
3377
+ this.#e = e, this.#t = t, this.#n = n, this.#r = r, this.#i = i;
3378
+ }
3379
+ };
3380
+ q = B([j], q);
3381
+ var J = q, Y;
3382
+ var X = Y = class {
3383
+ static parsePaginatedAdapter(e, t) {
3384
+ return new W(e.items.map(t), e.page, e.page_size, e.pages, e.total);
3385
+ }
3386
+ static parseFileNameFromContentDispositionHeader(t) {
3387
+ let n = `download-${DateTime.now().toFormat(`yyyy-MM-dd HH-mm-ss`)}`;
3388
+ if (!t.startsWith(`attachment`)) return n;
3389
+ let r = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);
3390
+ return (r?.length || 0) < 2 ? n : r[1].replaceAll(`'`, ``).replaceAll(`"`, ``).replaceAll(`/`, `-`).replaceAll(`:`, `-`);
3391
+ }
3392
+ static parseRequestError(e, t) {
3393
+ return new K(e.code, e.error, e.error_description, t);
3394
+ }
3395
+ static parseValidationError(e) {
3396
+ let t;
3397
+ return e.errors && (t = {}, Object.entries(e.errors).forEach(([e, n]) => {
3398
+ t[e] = Y.parseValidationError(n);
3399
+ })), new J(e.code, e.error, e.error_description, t, e.params);
3400
+ }
3401
+ };
3402
+ X = Y = B([c], X);
3403
+ //#endregion
3404
+ //#region ../../node_modules/.bun/vue-router@5.0.6+b33d84df931f4fef/node_modules/vue-router/dist/useApi-DtucMc-S.js
3405
+ /*!
3406
+ * vue-router v5.0.6
3407
+ * (c) 2026 Eduardo San Martin Morote
3408
+ * @license MIT
3409
+ */
3410
+ var isBrowser = typeof document !== "undefined";
3411
+ var assign = Object.assign;
3412
+ /**
3413
+ * Typesafe alternative to Array.isArray
3414
+ * https://github.com/microsoft/TypeScript/pull/48228
3415
+ *
3416
+ * @internal
3417
+ */
3418
+ var isArray = Array.isArray;
3419
+ /**
3420
+ * Flags so we can combine them when checking for multiple errors. This is the internal version of
3421
+ * {@link NavigationFailureType}.
3422
+ *
3423
+ * @internal
3424
+ */
3425
+ var ErrorTypes = /* @__PURE__ */ function(ErrorTypes) {
3426
+ ErrorTypes[ErrorTypes["MATCHER_NOT_FOUND"] = 1] = "MATCHER_NOT_FOUND";
3427
+ ErrorTypes[ErrorTypes["NAVIGATION_GUARD_REDIRECT"] = 2] = "NAVIGATION_GUARD_REDIRECT";
3428
+ ErrorTypes[ErrorTypes["NAVIGATION_ABORTED"] = 4] = "NAVIGATION_ABORTED";
3429
+ ErrorTypes[ErrorTypes["NAVIGATION_CANCELLED"] = 8] = "NAVIGATION_CANCELLED";
3430
+ ErrorTypes[ErrorTypes["NAVIGATION_DUPLICATED"] = 16] = "NAVIGATION_DUPLICATED";
3431
+ return ErrorTypes;
3432
+ }({});
3433
+ Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
3434
+ ErrorTypes.MATCHER_NOT_FOUND, ErrorTypes.NAVIGATION_GUARD_REDIRECT, ErrorTypes.NAVIGATION_ABORTED, ErrorTypes.NAVIGATION_CANCELLED, ErrorTypes.NAVIGATION_DUPLICATED;
3435
+ /**
3436
+ * RouteRecord being rendered by the closest ancestor Router View. Used for
3437
+ * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
3438
+ * Location Matched
3439
+ *
3440
+ * @internal
3441
+ */
3442
+ var matchedRouteKey = Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
3443
+ /**
3444
+ * Allows overriding the router view depth to control which component in
3445
+ * `matched` is rendered. rvd stands for Router View Depth
3446
+ *
3447
+ * @internal
3448
+ */
3449
+ var viewDepthKey = Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
3450
+ Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
3451
+ /**
3452
+ * Allows overriding the current route returned by `useRoute` in tests. rl
3453
+ * stands for route location
3454
+ *
3455
+ * @internal
3456
+ */
3457
+ var routeLocationKey = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
3458
+ /**
3459
+ * Allows overriding the current route used by router-view. Internally this is
3460
+ * used when the `route` prop is passed.
3461
+ *
3462
+ * @internal
3463
+ */
3464
+ var routerViewLocationKey = Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
3465
+ /**
3466
+ * Returns the current route location. Equivalent to using `$route` inside
3467
+ * templates.
3468
+ */
3469
+ function useRoute(_name) {
3470
+ return inject(routeLocationKey);
3471
+ }
3472
+ //#endregion
3473
+ //#region ../../node_modules/.bun/vue-router@5.0.6+b33d84df931f4fef/node_modules/vue-router/dist/devtools-BPov6AZY.js
3474
+ function warn$1(msg) {
3475
+ const args = Array.from(arguments).slice(1);
3476
+ console.warn.apply(console, ["[Vue Router warn]: " + msg].concat(args));
3477
+ }
3478
+ /**
3479
+ * Check if two `RouteRecords` are equal. Takes into account aliases: they are
3480
+ * considered equal to the `RouteRecord` they are aliasing.
3481
+ *
3482
+ * @param a - first {@link RouteRecord}
3483
+ * @param b - second {@link RouteRecord}
3484
+ */
3485
+ function isSameRouteRecord(a, b) {
3486
+ return (a.aliasOf || a) === (b.aliasOf || b);
3487
+ }
3488
+ (/* @__PURE__ */ (function(TokenType) {
3489
+ TokenType[TokenType["Static"] = 0] = "Static";
3490
+ TokenType[TokenType["Param"] = 1] = "Param";
3491
+ TokenType[TokenType["Group"] = 2] = "Group";
3492
+ return TokenType;
3493
+ })({})).Static;
3494
+ var RouterViewImpl = /* @__PURE__ */ defineComponent({
3495
+ name: "RouterView",
3496
+ inheritAttrs: false,
3497
+ props: {
3498
+ name: {
3499
+ type: String,
3500
+ default: "default"
3501
+ },
3502
+ route: Object
3503
+ },
3504
+ compatConfig: { MODE: 3 },
3505
+ setup(props, { attrs, slots }) {
3506
+ process.env.NODE_ENV !== "production" && warnDeprecatedUsage();
3507
+ const injectedRoute = inject(routerViewLocationKey);
3508
+ const routeToDisplay = computed(() => props.route || injectedRoute.value);
3509
+ const injectedDepth = inject(viewDepthKey, 0);
3510
+ const depth = computed(() => {
3511
+ let initialDepth = unref(injectedDepth);
3512
+ const { matched } = routeToDisplay.value;
3513
+ let matchedRoute;
3514
+ while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
3515
+ return initialDepth;
3516
+ });
3517
+ const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
3518
+ provide(viewDepthKey, computed(() => depth.value + 1));
3519
+ provide(matchedRouteKey, matchedRouteRef);
3520
+ provide(routerViewLocationKey, routeToDisplay);
3521
+ const viewRef = ref();
3522
+ watch(() => [
3523
+ viewRef.value,
3524
+ matchedRouteRef.value,
3525
+ props.name
3526
+ ], ([instance, to, name], [oldInstance, from, _oldName]) => {
3527
+ if (to) {
3528
+ to.instances[name] = instance;
3529
+ if (from && from !== to && instance && instance === oldInstance) {
3530
+ if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
3531
+ if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
3532
+ }
3533
+ }
3534
+ if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
3535
+ }, { flush: "post" });
3536
+ return () => {
3537
+ const route = routeToDisplay.value;
3538
+ const currentName = props.name;
3539
+ const matchedRoute = matchedRouteRef.value;
3540
+ const ViewComponent = matchedRoute && matchedRoute.components[currentName];
3541
+ if (!ViewComponent) return normalizeSlot(slots.default, {
3542
+ Component: ViewComponent,
3543
+ route
3544
+ });
3545
+ const routePropsOption = matchedRoute.props[currentName];
3546
+ const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
3547
+ const onVnodeUnmounted = (vnode) => {
3548
+ if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
3549
+ };
3550
+ const component = h(ViewComponent, assign({}, routeProps, attrs, {
3551
+ onVnodeUnmounted,
3552
+ ref: viewRef
3553
+ }));
3554
+ if ((process.env.NODE_ENV !== "production" || false) && isBrowser && component.ref) {
3555
+ const info = {
3556
+ depth: depth.value,
3557
+ name: matchedRoute.name,
3558
+ path: matchedRoute.path,
3559
+ meta: matchedRoute.meta
3560
+ };
3561
+ (isArray(component.ref) ? component.ref.map((r) => r.i) : [component.ref.i]).forEach((instance) => {
3562
+ instance.__vrv_devtools = info;
3563
+ });
3564
+ }
3565
+ return normalizeSlot(slots.default, {
3566
+ Component: component,
3567
+ route
3568
+ }) || component;
3569
+ };
3570
+ }
3571
+ });
3572
+ function normalizeSlot(slot, data) {
3573
+ if (!slot) return null;
3574
+ const slotContent = slot(data);
3575
+ return slotContent.length === 1 ? slotContent[0] : slotContent;
3576
+ }
3577
+ /**
3578
+ * Component to display the current route the user is at.
3579
+ */
3580
+ var RouterView = RouterViewImpl;
3581
+ function warnDeprecatedUsage() {
3582
+ const instance = getCurrentInstance();
3583
+ const parentName = instance.parent && instance.parent.type.name;
3584
+ const parentSubTreeType = instance.parent && instance.parent.subTree && instance.parent.subTree.type;
3585
+ if (parentName && (parentName === "KeepAlive" || parentName.includes("Transition")) && typeof parentSubTreeType === "object" && parentSubTreeType.name === "RouterView") {
3586
+ const comp = parentName === "KeepAlive" ? "keep-alive" : "transition";
3587
+ warn$1(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
3588
+ Use slot props instead:
3589
+
3590
+ <router-view v-slot="{ Component }">
3591
+ <${comp}>\n <component :is="Component" />\n </${comp}>\n</router-view>`);
3592
+ }
3593
+ }
3594
+ converter(`oklch`);
3595
+ RegExp(`[a-z]`), RegExp(`[A-Z]`), RegExp(`[0-9]`), RegExp(`[!"#$%&'()*+,-./:;<=>?@[\\\\\\]^_\`{|}~]`);
3596
+ //#endregion
3597
+ //#region ../internals/dist/composable-CJXC7sly.js
3598
+ function y(e, t, n, r = { passive: !0 }) {
3599
+ watch(e, (e, i, a) => {
3600
+ e && (e.addEventListener(t, n, r), a(() => e.removeEventListener(t, n)));
3601
+ }, { immediate: !0 });
3602
+ }
3603
+ function x(e, t) {
3604
+ let n = `flux/${e}`, r = ref(i() ?? t);
3605
+ function i() {
3606
+ if (n in localStorage) {
3607
+ let e = JSON.parse(localStorage.getItem(n));
3608
+ return Array.isArray(e) && e[0] === `DateTime` && (e = DateTime.fromISO(e[1])), e;
3609
+ }
3610
+ return null;
3611
+ }
3612
+ return watch(r, (e) => {
3613
+ let t = e;
3614
+ DateTime.isDateTime(e) && (t = [`DateTime`, e.toISO({
3615
+ includeOffset: !0,
3616
+ extendedZone: !0
3617
+ })]), localStorage.setItem(n, JSON.stringify(t));
3618
+ }), r;
3619
+ }
3620
+ function C(e) {
3621
+ let t = ref(0), n = ref(0);
3622
+ return e ||= ref(document), y(e, `scroll`, () => {
3623
+ let r = unref(e);
3624
+ r instanceof Document && (r = r.scrollingElement), t.value = r?.scrollLeft ?? 0, n.value = r?.scrollTop ?? 0;
3625
+ }), {
3626
+ x: t,
3627
+ y: n
3628
+ };
3629
+ }
3630
+ //#endregion
3631
+ //#region src/data/index.ts
3632
+ var FluxApplicationInjectionKey = Symbol();
3633
+ //#endregion
3634
+ //#region src/routing/useRoute.ts
3635
+ /**
3636
+ * Internal alias for vue-router's `useRoute`. Exists so the rest of the
3637
+ * package can import a single, controlled `useRoute` symbol — making it
3638
+ * trivial to swap in a wrapper later (e.g. modal-aware variants) without
3639
+ * touching every call site.
3640
+ */
3641
+ function useRoute_default() {
3642
+ return useRoute();
3643
+ }
3644
+ //#endregion
3645
+ //#region src/routing/useNamedRoutes.ts
3646
+ /**
3647
+ * Returns **all** matched route records that expose a named view with
3648
+ * the given `name`, paired with their depth in `route.matched`. Powers
3649
+ * `<FluxApplicationMenuContextStack>` so every level of a nested route
3650
+ * tree can render its own menu component (instead of vue-router's
3651
+ * default behaviour of only rendering the deepest one).
3652
+ */
3653
+ function useNamedRoutes_default(nameRef) {
3654
+ const route = useRoute_default();
3655
+ return computed(() => {
3656
+ const name = unref(nameRef);
3657
+ const matches = [];
3658
+ route.matched.forEach((record, depth) => {
3659
+ if (!record.components || !(name in record.components)) return;
3660
+ matches.push({
3661
+ depth,
3662
+ record
3663
+ });
3664
+ });
3665
+ return matches;
3666
+ });
3667
+ }
3668
+ var Application_module_default = {
3669
+ application: `application`,
3670
+ applicationSide: `application-side`,
3671
+ applicationBody: `application-body`,
3672
+ applicationContentFull: `application-content-full`,
3673
+ calendar: `calendar`,
3674
+ table: `table`,
3675
+ applicationMenuBackdrop: `application-menu-backdrop`,
3676
+ applicationMenu: `application-menu`
3677
+ };
3678
+ //#endregion
3679
+ //#region src/component/FluxApplication.vue
3680
+ var FluxApplication_default = /* @__PURE__ */ defineComponent({
3681
+ __name: "FluxApplication",
3682
+ props: {
3683
+ contextMenuName: { default: "menu" },
3684
+ showDesktopMenuToggle: {
3685
+ type: Boolean,
3686
+ default: false
3687
+ }
3688
+ },
3689
+ setup(__props) {
3690
+ const route = useRoute_default();
3691
+ const matchedMenuRoutes = useNamedRoutes_default(toRef(() => __props.contextMenuName));
3692
+ const isMenuCollapsed = x("application-menu-collapsed", true);
3693
+ const layout = ref("default");
3694
+ const totalLevels = computed(() => 1 + matchedMenuRoutes.value.length);
3695
+ const viewIndex = ref(0);
3696
+ function clampViewIndex(target) {
3697
+ if (target < 0) return 0;
3698
+ const max = totalLevels.value - 1;
3699
+ if (target > max) return max;
3700
+ return target;
3701
+ }
3702
+ function goToLevel(index) {
3703
+ viewIndex.value = clampViewIndex(index);
3704
+ }
3705
+ function goToMain() {
3706
+ viewIndex.value = 0;
3707
+ }
3708
+ function goToCurrent() {
3709
+ viewIndex.value = totalLevels.value - 1;
3710
+ }
3711
+ function goToParent() {
3712
+ viewIndex.value = clampViewIndex(viewIndex.value - 1);
3713
+ }
3714
+ function goToChild() {
3715
+ viewIndex.value = clampViewIndex(viewIndex.value + 1);
3716
+ }
3717
+ const contextStack = shallowRef([]);
3718
+ const contexts = computed(() => contextStack.value);
3719
+ const activeContext = computed(() => contextStack.value.at(-1));
3720
+ function pushContext(info) {
3721
+ contextStack.value = [...contextStack.value, info];
3722
+ }
3723
+ function removeContext(id) {
3724
+ contextStack.value = contextStack.value.filter((entry) => entry.id !== id);
3725
+ }
3726
+ provide(FluxApplicationInjectionKey, {
3727
+ activeContext,
3728
+ contexts,
3729
+ isMenuCollapsed,
3730
+ layout,
3731
+ showDesktopMenuToggle: toRef(() => __props.showDesktopMenuToggle),
3732
+ totalLevels,
3733
+ viewIndex,
3734
+ goToChild,
3735
+ goToCurrent,
3736
+ goToLevel,
3737
+ goToMain,
3738
+ goToParent,
3739
+ pushContext,
3740
+ removeContext
3741
+ });
3742
+ watch(() => route.fullPath, () => {
3743
+ viewIndex.value = totalLevels.value - 1;
3744
+ });
3745
+ watch(totalLevels, (next) => {
3746
+ viewIndex.value = clampViewIndex(viewIndex.value);
3747
+ if (viewIndex.value === 0 && next > 1) viewIndex.value = next - 1;
3748
+ }, { immediate: true });
3749
+ watch(isMenuCollapsed, (collapsed) => {
3750
+ if (typeof document === "undefined") return;
3751
+ if (collapsed) delete document.documentElement.dataset.applicationMenuOpen;
3752
+ else document.documentElement.dataset.applicationMenuOpen = "";
3753
+ }, { immediate: true });
3754
+ onUnmounted(() => {
3755
+ if (typeof document !== "undefined") delete document.documentElement.dataset.applicationMenuOpen;
3756
+ });
3757
+ return (_ctx, _cache) => {
3758
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(Application_module_default).application) }, [
3759
+ renderSlot(_ctx.$slots, "menu"),
3760
+ createElementVNode("div", { class: normalizeClass(unref(Application_module_default).applicationBody) }, [renderSlot(_ctx.$slots, "default")], 2),
3761
+ renderSlot(_ctx.$slots, "side"),
3762
+ createElementVNode("button", {
3763
+ type: "button",
3764
+ "aria-label": "Close menu",
3765
+ class: normalizeClass(unref(Application_module_default).applicationMenuBackdrop),
3766
+ onClick: _cache[0] || (_cache[0] = ($event) => isMenuCollapsed.value = true)
3767
+ }, null, 2)
3768
+ ], 2);
3769
+ };
3770
+ }
3771
+ });
3772
+ //#endregion
3773
+ //#region ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
3774
+ function r(e) {
3775
+ var t, f, n = "";
3776
+ if ("string" == typeof e || "number" == typeof e) n += e;
3777
+ else if ("object" == typeof e) if (Array.isArray(e)) {
3778
+ var o = e.length;
3779
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
3780
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
3781
+ return n;
3782
+ }
3783
+ function clsx() {
3784
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
3785
+ return n;
3786
+ }
3787
+ //#endregion
3788
+ //#region src/composable/useApplicationContextMenu.ts
3789
+ function useApplicationContextMenu_default(name = "menu") {
3790
+ const matches = useNamedRoutes_default(toRef(() => name));
3791
+ const hasContextMenu = computed(() => matches.value.length > 0);
3792
+ return {
3793
+ contextMenuKey: computed(() => matches.value.map((m) => m.record.path).join("|") || void 0),
3794
+ hasContextMenu
3795
+ };
3796
+ }
3797
+ //#endregion
3798
+ //#region src/composable/useApplicationInjection.ts
3799
+ function useApplicationInjection_default() {
3800
+ const injection = inject(FluxApplicationInjectionKey);
3801
+ if (!injection) throw new Error("[Flux] useApplicationInjection() was used outside a FluxApplication component.");
3802
+ return injection;
3803
+ }
3804
+ //#endregion
3805
+ //#region src/composable/useApplicationMenu.ts
3806
+ function useApplicationMenu_default() {
3807
+ const { activeContext, contexts, isMenuCollapsed, layout, totalLevels, viewIndex, goToChild, goToCurrent, goToLevel, goToMain, goToParent } = useApplicationInjection_default();
3808
+ const isMainMenuVisible = computed(() => viewIndex.value === 0);
3809
+ return {
3810
+ activeContext,
3811
+ canGoBack: computed(() => viewIndex.value > 0),
3812
+ canGoForward: computed(() => viewIndex.value < totalLevels.value - 1),
3813
+ contexts,
3814
+ isMainMenuVisible,
3815
+ isMenuCollapsed,
3816
+ layout,
3817
+ totalLevels,
3818
+ viewIndex,
3819
+ goToChild,
3820
+ goToCurrent,
3821
+ goToLevel,
3822
+ goToMain,
3823
+ goToParent,
3824
+ close: () => isMenuCollapsed.value = true,
3825
+ open: () => isMenuCollapsed.value = false,
3826
+ toggle: () => isMenuCollapsed.value = !isMenuCollapsed.value,
3827
+ showMainMenu: goToMain,
3828
+ showContextMenu: goToCurrent,
3829
+ toggleMainMenu: () => {
3830
+ if (viewIndex.value === 0) goToCurrent();
3831
+ else goToMain();
3832
+ }
3833
+ };
3834
+ }
3835
+ var ApplicationContent_module_default = {
3836
+ applicationContent: `application-content`,
3837
+ applicationContentDefault: `application-content-default application-content`,
3838
+ applicationContentDashboard: `application-content-dashboard application-content`,
3839
+ applicationContentFull: `application-content-full application-content`,
3840
+ applicationContentMedium: `application-content-medium application-content`,
3841
+ applicationContentNarrow: `application-content-narrow application-content`,
3842
+ calendar: `calendar`,
3843
+ table: `table`,
3844
+ calendarActions: `calendar-actions`,
3845
+ tableCell: `table-cell`,
3846
+ tableCellContent: `table-cell-content`
3847
+ };
3848
+ //#endregion
3849
+ //#region src/component/FluxApplicationContent.vue
3850
+ var FluxApplicationContent_default = /* @__PURE__ */ defineComponent({
3851
+ __name: "FluxApplicationContent",
3852
+ props: { layout: { default: "default" } },
3853
+ setup(__props) {
3854
+ const { layout: layoutRef } = useApplicationInjection_default();
3855
+ watch(() => __props.layout, () => layoutRef.value = __props.layout, { immediate: true });
3856
+ return (_ctx, _cache) => {
3857
+ return openBlock(), createElementBlock("main", {
3858
+ class: normalizeClass(unref(clsx)(__props.layout === "default" && unref(ApplicationContent_module_default).applicationContentDefault, __props.layout === "dashboard" && unref(ApplicationContent_module_default).applicationContentDashboard, __props.layout === "full" && unref(ApplicationContent_module_default).applicationContentFull, __props.layout === "medium" && unref(ApplicationContent_module_default).applicationContentMedium, __props.layout === "narrow" && unref(ApplicationContent_module_default).applicationContentNarrow)),
3859
+ "aria-label": "Application Content"
3860
+ }, [renderSlot(_ctx.$slots, "default")], 2);
3861
+ };
3862
+ }
3863
+ });
3864
+ var ApplicationHero_module_default = {
3865
+ applicationHero: `application-hero`,
3866
+ applicationHeroBody: `application-hero-body`,
3867
+ applicationHeroSubtitle: `application-hero-subtitle`
3868
+ };
3869
+ //#endregion
3870
+ //#region src/component/FluxApplicationHero.vue
3871
+ var FluxApplicationHero_default = /* @__PURE__ */ defineComponent({
3872
+ __name: "FluxApplicationHero",
3873
+ props: {
3874
+ title: {},
3875
+ subtitle: {}
3876
+ },
3877
+ setup(__props) {
3878
+ return (_ctx, _cache) => {
3879
+ return openBlock(), createElementBlock("header", { class: normalizeClass(unref(ApplicationHero_module_default).applicationHero) }, [
3880
+ renderSlot(_ctx.$slots, "start"),
3881
+ createElementVNode("div", { class: normalizeClass(unref(ApplicationHero_module_default).applicationHeroBody) }, [createElementVNode("h1", null, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("p", {
3882
+ key: 0,
3883
+ class: normalizeClass(unref(ApplicationHero_module_default).applicationHeroSubtitle)
3884
+ }, toDisplayString(__props.subtitle), 3)) : createCommentVNode("", true)], 2),
3885
+ renderSlot(_ctx.$slots, "end")
3886
+ ], 2);
3887
+ };
3888
+ }
3889
+ });
3890
+ var ApplicationMenu_module_default = {
3891
+ applicationMenu: `application-menu`,
3892
+ applicationMenuFooter: `application-menu-footer`,
3893
+ applicationMenuHeader: `application-menu-header`,
3894
+ applicationMenuPanel: `application-menu-panel`,
3895
+ applicationMenuStage: `application-menu-stage`,
3896
+ applicationMenuTrack: `application-menu-track`,
3897
+ applicationMenuPageIndicator: `application-menu-page-indicator`,
3898
+ applicationMenuPageIndicatorDot: `application-menu-page-indicator-dot`,
3899
+ applicationMenuPageIndicatorDotActive: `application-menu-page-indicator-dot-active`,
3900
+ applicationMenuPanelEnterActive: `application-menu-panel-enter-active`,
3901
+ applicationMenuPanelEnterFrom: `application-menu-panel-enter-from`,
3902
+ applicationMenuPanelLeaveActive: `application-menu-panel-leave-active`,
3903
+ applicationMenuPanelLeaveTo: `application-menu-panel-leave-to`,
3904
+ divider: `divider`,
3905
+ dividerContent: `divider-content`,
3906
+ dividerLine: `divider-line`,
3907
+ menuSubHeader: `menu-sub-header`,
3908
+ menuItem: `menu-item`,
3909
+ menuItemIcon: `menu-item-icon`,
3910
+ menuItemLabel: `menu-item-label`,
3911
+ menuItemActive: `menu-item-active`,
3912
+ applicationMenuAccount: `application-menu-account`,
3913
+ applicationMenuAccountSwitcher: `application-menu-account-switcher application-menu-account`,
3914
+ avatar: `avatar`,
3915
+ applicationMenuContext: `application-menu-context`,
3916
+ applicationMenuContextContent: `application-menu-context-content`,
3917
+ applicationMenuContextPill: `application-menu-context-pill`,
3918
+ applicationMenuContextPillContent: `application-menu-context-pill-content`,
3919
+ applicationMenuPromo: `application-menu-promo`,
3920
+ icon: `icon`,
3921
+ applicationMenuPromoContent: `application-menu-promo-content`,
3922
+ applicationMenuToggle: `application-menu-toggle`,
3923
+ applicationMenuToggleIcon: `application-menu-toggle-icon`
3924
+ };
3925
+ //#endregion
3926
+ //#region src/component/FluxApplicationMenu.vue?vue&type=script&setup=true&lang.ts
3927
+ var _hoisted_1$3 = ["data-collapsed", "data-collapsible"];
3928
+ var _hoisted_2 = [
3929
+ "aria-current",
3930
+ "aria-label",
3931
+ "onClick"
3932
+ ];
3933
+ //#endregion
3934
+ //#region src/component/FluxApplicationMenu.vue
3935
+ var FluxApplicationMenu_default = /* @__PURE__ */ defineComponent({
3936
+ __name: "FluxApplicationMenu",
3937
+ props: { showPageIndicator: {
3938
+ type: Boolean,
3939
+ default: true
3940
+ } },
3941
+ setup(__props) {
3942
+ const slots = useSlots();
3943
+ const { isMenuCollapsed, showDesktopMenuToggle } = useApplicationInjection_default();
3944
+ const { goToLevel, isMainMenuVisible, totalLevels, viewIndex } = useApplicationMenu_default();
3945
+ return (_ctx, _cache) => {
3946
+ return openBlock(), createElementBlock("aside", {
3947
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenu),
3948
+ "data-collapsed": unref(isMenuCollapsed) ? "" : void 0,
3949
+ "data-collapsible": unref(showDesktopMenuToggle) ? "" : void 0
3950
+ }, [
3951
+ slots.header ? (openBlock(), createBlock(unref(FluxMenu), {
3952
+ key: 0,
3953
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuHeader)
3954
+ }, {
3955
+ default: withCtx(() => [renderSlot(_ctx.$slots, "header")]),
3956
+ _: 3
3957
+ }, 8, ["class"])) : createCommentVNode("", true),
3958
+ createElementVNode("div", { class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuStage) }, [createElementVNode("div", {
3959
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuTrack),
3960
+ style: normalizeStyle({ "--view-index": unref(viewIndex) })
3961
+ }, [createVNode(unref(FluxMenu), { class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuPanel) }, {
3962
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
3963
+ _: 3
3964
+ }, 8, ["class"]), renderSlot(_ctx.$slots, "context")], 6)], 2),
3965
+ __props.showPageIndicator && unref(totalLevels) > 1 ? (openBlock(), createElementBlock("nav", {
3966
+ key: 1,
3967
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuPageIndicator),
3968
+ "aria-label": "Menu levels"
3969
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(totalLevels), (level) => {
3970
+ return openBlock(), createElementBlock("button", {
3971
+ key: level - 1,
3972
+ type: "button",
3973
+ class: normalizeClass([unref(ApplicationMenu_module_default).applicationMenuPageIndicatorDot, level - 1 === unref(viewIndex) && unref(ApplicationMenu_module_default).applicationMenuPageIndicatorDotActive]),
3974
+ "aria-current": level - 1 === unref(viewIndex) ? "true" : void 0,
3975
+ "aria-label": level - 1 === 0 ? "Hoofdmenu" : `Niveau ${level - 1}`,
3976
+ onClick: ($event) => unref(goToLevel)(level - 1)
3977
+ }, null, 10, _hoisted_2);
3978
+ }), 128))], 2)) : createCommentVNode("", true),
3979
+ slots.footer ? (openBlock(), createBlock(unref(FluxMenu), {
3980
+ key: 2,
3981
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuFooter),
3982
+ "data-hidden": !unref(isMainMenuVisible) ? "" : void 0
3983
+ }, {
3984
+ default: withCtx(() => [renderSlot(_ctx.$slots, "footer")]),
3985
+ _: 3
3986
+ }, 8, ["class", "data-hidden"])) : createCommentVNode("", true)
3987
+ ], 10, _hoisted_1$3);
3988
+ };
3989
+ }
3990
+ });
3991
+ //#endregion
3992
+ //#region src/component/FluxApplicationMenuAccount.vue
3993
+ var FluxApplicationMenuAccount_default = /* @__PURE__ */ defineComponent({
3994
+ __name: "FluxApplicationMenuAccount",
3995
+ props: {
3996
+ icon: {},
3997
+ imageAlt: {},
3998
+ imageSrc: {},
3999
+ label: {}
4000
+ },
4001
+ setup(__props) {
4002
+ const slots = useSlots();
4003
+ return (_ctx, _cache) => {
4004
+ return openBlock(), createBlock(unref(FluxFlyout), { "is-auto-width": "" }, {
4005
+ opener: withCtx(({ open }) => [createVNode(unref(FluxMenuItem), {
4006
+ class: normalizeClass(slots.switcher ? unref(ApplicationMenu_module_default).applicationMenuAccountSwitcher : unref(ApplicationMenu_module_default).applicationMenuAccount),
4007
+ "icon-leading": __props.icon,
4008
+ "icon-trailing": slots.switcher ? "angle-down" : void 0,
4009
+ "image-alt": __props.imageAlt,
4010
+ "image-src": __props.imageSrc,
4011
+ label: __props.label,
4012
+ onClick: ($event) => slots.switcher && open()
4013
+ }, createSlots({ _: 2 }, [slots.avatar ? {
4014
+ name: "before",
4015
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "avatar")]),
4016
+ key: "0"
4017
+ } : void 0]), 1032, [
4018
+ "class",
4019
+ "icon-leading",
4020
+ "icon-trailing",
4021
+ "image-alt",
4022
+ "image-src",
4023
+ "label",
4024
+ "onClick"
4025
+ ])]),
4026
+ default: withCtx(() => [slots.switcher ? (openBlock(), createBlock(unref(FluxPane), { key: 0 }, {
4027
+ default: withCtx(() => [renderSlot(_ctx.$slots, "switcher")]),
4028
+ _: 3
4029
+ })) : createCommentVNode("", true)]),
4030
+ _: 3
4031
+ });
4032
+ };
4033
+ }
4034
+ });
4035
+ //#endregion
4036
+ //#region src/composable/useApplicationContextRegistration.ts
4037
+ function useApplicationContextRegistration_default(info) {
4038
+ const injection = inject(FluxApplicationInjectionKey, null);
4039
+ if (!injection) return;
4040
+ const id = Symbol("application-context");
4041
+ onMounted(() => {
4042
+ injection.pushContext({
4043
+ id,
4044
+ ...info()
4045
+ });
4046
+ });
4047
+ watch(info, (next) => {
4048
+ injection.removeContext(id);
4049
+ injection.pushContext({
4050
+ id,
4051
+ ...next
4052
+ });
4053
+ });
4054
+ onBeforeUnmount(() => {
4055
+ injection.removeContext(id);
4056
+ });
4057
+ }
4058
+ //#endregion
4059
+ //#region src/component/FluxApplicationMenuContext.vue?vue&type=script&setup=true&lang.ts
4060
+ var _hoisted_1$2 = { key: 0 };
4061
+ //#endregion
4062
+ //#region src/component/FluxApplicationMenuContext.vue
4063
+ var FluxApplicationMenuContext_default = /* @__PURE__ */ defineComponent({
4064
+ __name: "FluxApplicationMenuContext",
4065
+ props: {
4066
+ subtitle: {},
4067
+ title: {},
4068
+ tabindex: {},
4069
+ href: {},
4070
+ rel: {},
4071
+ target: {},
4072
+ to: {},
4073
+ entryTo: {},
4074
+ type: {}
4075
+ },
4076
+ setup(__props) {
4077
+ const props = __props;
4078
+ const injection = inject(FluxApplicationInjectionKey, null);
4079
+ const matchedRoute = inject(matchedRouteKey, null);
4080
+ const canSlide = computed(() => {
4081
+ if (!injection) return false;
4082
+ return injection.viewIndex.value > 0;
4083
+ });
4084
+ const autoEntryTo = computed(() => {
4085
+ const record = matchedRoute?.value;
4086
+ if (!record || typeof record.name !== "string") return;
4087
+ return { name: record.name };
4088
+ });
4089
+ function onBack() {
4090
+ if (canSlide.value && injection) injection.goToParent();
4091
+ }
4092
+ useApplicationContextRegistration_default(() => ({
4093
+ title: props.title,
4094
+ subtitle: props.subtitle,
4095
+ to: props.to,
4096
+ entryTo: props.entryTo ?? autoEntryTo.value,
4097
+ href: props.href,
4098
+ type: props.type
4099
+ }));
4100
+ return (_ctx, _cache) => {
4101
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuContext) }, [createVNode(unref(FluxSecondaryButton), {
4102
+ "icon-leading": "angle-left",
4103
+ size: "small",
4104
+ tabindex: __props.tabindex,
4105
+ href: canSlide.value ? void 0 : __props.href,
4106
+ rel: __props.rel,
4107
+ target: __props.target,
4108
+ to: canSlide.value ? void 0 : __props.to,
4109
+ type: canSlide.value ? "button" : __props.type,
4110
+ onClick: onBack
4111
+ }, null, 8, [
4112
+ "tabindex",
4113
+ "href",
4114
+ "rel",
4115
+ "target",
4116
+ "to",
4117
+ "type"
4118
+ ]), createElementVNode("div", { class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuContextContent) }, [createElementVNode("strong", null, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("span", _hoisted_1$2, toDisplayString(__props.subtitle), 1)) : createCommentVNode("", true)], 2)], 2);
4119
+ };
4120
+ }
4121
+ });
4122
+ //#endregion
4123
+ //#region src/component/FluxApplicationMenuContextStack.vue
4124
+ var FluxApplicationMenuContextStack_default = /* @__PURE__ */ defineComponent({
4125
+ __name: "FluxApplicationMenuContextStack",
4126
+ props: { name: { default: "menu" } },
4127
+ setup(__props) {
4128
+ const matches = useNamedRoutes_default(toRef(() => __props.name));
4129
+ const ScopedRouterView = defineComponent({
4130
+ name: "FluxApplicationMenuScopedRouterView",
4131
+ props: {
4132
+ depth: {
4133
+ type: Number,
4134
+ required: true
4135
+ },
4136
+ viewName: {
4137
+ type: String,
4138
+ required: true
4139
+ }
4140
+ },
4141
+ setup(props) {
4142
+ provide(viewDepthKey, ref(props.depth));
4143
+ return () => h(RouterView, { name: props.viewName });
4144
+ }
4145
+ });
4146
+ return (_ctx, _cache) => {
4147
+ return openBlock(), createBlock(TransitionGroup, {
4148
+ "enter-active-class": unref(ApplicationMenu_module_default).applicationMenuPanelEnterActive,
4149
+ "enter-from-class": unref(ApplicationMenu_module_default).applicationMenuPanelEnterFrom,
4150
+ "leave-active-class": unref(ApplicationMenu_module_default).applicationMenuPanelLeaveActive,
4151
+ "leave-to-class": unref(ApplicationMenu_module_default).applicationMenuPanelLeaveTo
4152
+ }, {
4153
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(matches), (match) => {
4154
+ return openBlock(), createBlock(unref(FluxMenu), {
4155
+ key: match.record.path,
4156
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuPanel)
4157
+ }, {
4158
+ default: withCtx(() => [createVNode(unref(ScopedRouterView), {
4159
+ depth: match.depth,
4160
+ "view-name": __props.name
4161
+ }, null, 8, ["depth", "view-name"])]),
4162
+ _: 2
4163
+ }, 1032, ["class"]);
4164
+ }), 128))]),
4165
+ _: 1
4166
+ }, 8, [
4167
+ "enter-active-class",
4168
+ "enter-from-class",
4169
+ "leave-active-class",
4170
+ "leave-to-class"
4171
+ ]);
4172
+ };
4173
+ }
4174
+ });
4175
+ //#endregion
4176
+ //#region src/component/FluxApplicationMenuPromo.vue
4177
+ var FluxApplicationMenuPromo_default = /* @__PURE__ */ defineComponent({
4178
+ __name: "FluxApplicationMenuPromo",
4179
+ props: { icon: {} },
4180
+ setup(__props) {
4181
+ return (_ctx, _cache) => {
4182
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuPromo) }, [__props.icon ? (openBlock(), createBlock(unref(FluxIcon), {
4183
+ key: 0,
4184
+ name: __props.icon
4185
+ }, null, 8, ["name"])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuPromoContent) }, [renderSlot(_ctx.$slots, "default")], 2)], 2);
4186
+ };
4187
+ }
4188
+ });
4189
+ //#endregion
4190
+ //#region src/component/FluxApplicationMenuToggle.vue
4191
+ var FluxApplicationMenuToggle_default = /* @__PURE__ */ defineComponent({
4192
+ __name: "FluxApplicationMenuToggle",
4193
+ setup(__props) {
4194
+ const { isMenuCollapsed } = useApplicationInjection_default();
4195
+ return (_ctx, _cache) => {
4196
+ return openBlock(), createBlock(unref(FluxMenuItem), {
4197
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuToggle),
4198
+ onClick: _cache[0] || (_cache[0] = ($event) => isMenuCollapsed.value = !unref(isMenuCollapsed))
4199
+ }, {
4200
+ before: withCtx(() => [(openBlock(), createElementBlock("svg", {
4201
+ xmlns: "http://www.w3.org/2000/svg",
4202
+ fill: "none",
4203
+ viewBox: "0 0 18 18",
4204
+ class: normalizeClass(unref(ApplicationMenu_module_default).applicationMenuToggleIcon)
4205
+ }, [..._cache[1] || (_cache[1] = [createElementVNode("path", {
4206
+ "fill-rule": "evenodd",
4207
+ d: "M0 15V3a3 3 0 0 1 3-3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a3.04 3.04 0 0 1-3-3M2 3a1 1 0 0 1 1-1h2v14H3a1 1 0 0 1-1-1z",
4208
+ "clip-rule": "evenodd"
4209
+ }, null, -1), createElementVNode("path", { d: "M16 15V3a1 1 0 0 0-1-1h-5a1 1 0 0 1 0-2h5c1.63.04 3 1.33 3 3v12a3.07 3.07 0 0 1-3 3h-5a1 1 0 1 1 0-2h5a1 1 0 0 0 1-1" }, null, -1)])], 2))]),
4210
+ _: 1
4211
+ }, 8, ["class"]);
4212
+ };
4213
+ }
4214
+ });
4215
+ var ApplicationSection_module_default = {
4216
+ applicationSection: `application-section`,
4217
+ applicationSectionHeader: `application-section-header`,
4218
+ applicationSectionInfo: `application-section-info`,
4219
+ applicationSectionContent: `application-section-content`,
4220
+ gridColumn: `grid-column`
4221
+ };
4222
+ //#endregion
4223
+ //#region src/component/FluxApplicationSection.vue?vue&type=script&setup=true&lang.ts
4224
+ var _hoisted_1$1 = { key: 0 };
4225
+ //#endregion
4226
+ //#region src/component/FluxApplicationSection.vue
4227
+ var FluxApplicationSection_default = /* @__PURE__ */ defineComponent({
4228
+ __name: "FluxApplicationSection",
4229
+ props: {
4230
+ title: {},
4231
+ info: {}
4232
+ },
4233
+ setup(__props) {
4234
+ const slots = useSlots();
4235
+ return (_ctx, _cache) => {
4236
+ return openBlock(), createElementBlock("section", { class: normalizeClass(unref(ApplicationSection_module_default).applicationSection) }, [__props.title || __props.info || slots.end ? (openBlock(), createElementBlock("header", {
4237
+ key: 0,
4238
+ class: normalizeClass(unref(ApplicationSection_module_default).applicationSectionHeader)
4239
+ }, [
4240
+ __props.title ? (openBlock(), createElementBlock("h2", _hoisted_1$1, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
4241
+ renderSlot(_ctx.$slots, "end"),
4242
+ __props.info ? (openBlock(), createElementBlock("span", {
4243
+ key: 1,
4244
+ class: normalizeClass(unref(ApplicationSection_module_default).applicationSectionInfo)
4245
+ }, toDisplayString(__props.info), 3)) : createCommentVNode("", true)
4246
+ ], 2)) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(unref(ApplicationSection_module_default).applicationSectionContent) }, [renderSlot(_ctx.$slots, "default")], 2)], 2);
4247
+ };
4248
+ }
4249
+ });
4250
+ var ApplicationSide_module_default = { applicationSide: `application-side` };
4251
+ //#endregion
4252
+ //#region src/component/FluxApplicationSide.vue
4253
+ var FluxApplicationSide_default = /* @__PURE__ */ defineComponent({
4254
+ __name: "FluxApplicationSide",
4255
+ setup(__props) {
4256
+ return (_ctx, _cache) => {
4257
+ return openBlock(), createElementBlock("aside", { class: normalizeClass(unref(ApplicationSide_module_default).applicationSide) }, [renderSlot(_ctx.$slots, "default")], 2);
4258
+ };
4259
+ }
4260
+ });
4261
+ var ApplicationTop_module_default = {
4262
+ applicationTop: `application-top`,
4263
+ applicationTopScrolled: `application-top-scrolled application-top`,
4264
+ applicationTopBar: `application-top-bar`,
4265
+ applicationTopBarTitle: `application-top-bar-title`,
4266
+ separator: `separator`,
4267
+ applicationTopMenuToggleHidden: `application-top-menu-toggle-hidden`,
4268
+ applicationTopTabs: `application-top-tabs`,
4269
+ tabBar: `tab-bar`,
4270
+ applicationTopTabsDefault: `application-top-tabs-default application-top-tabs`,
4271
+ applicationTopTabsDashboard: `application-top-tabs-dashboard application-top-tabs`,
4272
+ applicationTopTabsFull: `application-top-tabs-full application-top-tabs`,
4273
+ applicationTopTabsMedium: `application-top-tabs-medium application-top-tabs`,
4274
+ applicationTopTabsNarrow: `application-top-tabs-narrow application-top-tabs`,
4275
+ icon: `icon`,
4276
+ applicationMenuToggle: `application-menu-toggle`,
4277
+ applicationContentFull: `application-content-full`,
4278
+ table: `table`
4279
+ };
4280
+ //#endregion
4281
+ //#region src/component/FluxApplicationTop.vue?vue&type=script&setup=true&lang.ts
4282
+ var _hoisted_1 = { key: 1 };
4283
+ //#endregion
4284
+ //#region src/component/FluxApplicationTop.vue
4285
+ var FluxApplicationTop_default = /* @__PURE__ */ defineComponent({
4286
+ __name: "FluxApplicationTop",
4287
+ props: {
4288
+ icon: {},
4289
+ title: {}
4290
+ },
4291
+ setup(__props) {
4292
+ const slots = useSlots();
4293
+ const { layout, showDesktopMenuToggle } = useApplicationInjection_default();
4294
+ const { y } = C();
4295
+ return (_ctx, _cache) => {
4296
+ return openBlock(), createElementBlock("header", { class: normalizeClass(unref(y) > 1 ? unref(ApplicationTop_module_default).applicationTopScrolled : unref(ApplicationTop_module_default).applicationTop) }, [createElementVNode("div", { class: normalizeClass(unref(ApplicationTop_module_default).applicationTopBar) }, [
4297
+ createVNode(FluxApplicationMenuToggle_default, { class: normalizeClass(!unref(showDesktopMenuToggle) && unref(ApplicationTop_module_default).applicationTopMenuToggleHidden) }, null, 8, ["class"]),
4298
+ renderSlot(_ctx.$slots, "start"),
4299
+ createVNode(unref(FluxFadeTransition), null, {
4300
+ default: withCtx(() => [__props.icon ? (openBlock(), createBlock(unref(FluxIcon), {
4301
+ key: __props.icon,
4302
+ name: __props.icon
4303
+ }, null, 8, ["name"])) : createCommentVNode("", true)]),
4304
+ _: 1
4305
+ }),
4306
+ createVNode(unref(FluxFadeTransition), null, {
4307
+ default: withCtx(() => [__props.title ? (openBlock(), createElementBlock("span", {
4308
+ key: __props.title,
4309
+ class: normalizeClass(unref(ApplicationTop_module_default).applicationTopBarTitle)
4310
+ }, toDisplayString(__props.title), 3)) : createCommentVNode("", true)]),
4311
+ _: 1
4312
+ }),
4313
+ createVNode(unref(FluxSpacer)),
4314
+ renderSlot(_ctx.$slots, "end")
4315
+ ], 2), createVNode(unref(FluxRouteTransition), null, {
4316
+ default: withCtx(() => [slots.tabs ? (openBlock(), createElementBlock("div", {
4317
+ key: 0,
4318
+ class: normalizeClass(unref(clsx)(unref(layout) === "default" && unref(ApplicationTop_module_default).applicationTopTabsDefault, unref(layout) === "dashboard" && unref(ApplicationTop_module_default).applicationTopTabsDashboard, unref(layout) === "full" && unref(ApplicationTop_module_default).applicationTopTabsFull, unref(layout) === "medium" && unref(ApplicationTop_module_default).applicationTopTabsMedium, unref(layout) === "narrow" && unref(ApplicationTop_module_default).applicationTopTabsNarrow))
4319
+ }, [createVNode(unref(FluxTabBar), null, {
4320
+ default: withCtx(() => [renderSlot(_ctx.$slots, "tabs")]),
4321
+ _: 3
4322
+ })], 2)) : (openBlock(), createElementBlock("div", _hoisted_1))]),
4323
+ _: 3
4324
+ })], 2);
4325
+ };
4326
+ }
4327
+ });
4328
+ //#endregion
4329
+ export { FluxApplication_default as FluxApplication, FluxApplicationContent_default as FluxApplicationContent, FluxApplicationHero_default as FluxApplicationHero, FluxApplicationInjectionKey, FluxApplicationMenu_default as FluxApplicationMenu, FluxApplicationMenuAccount_default as FluxApplicationMenuAccount, FluxApplicationMenuContext_default as FluxApplicationMenuContext, FluxApplicationMenuContextStack_default as FluxApplicationMenuContextStack, FluxApplicationMenuPromo_default as FluxApplicationMenuPromo, FluxApplicationMenuToggle_default as FluxApplicationMenuToggle, FluxApplicationSection_default as FluxApplicationSection, FluxApplicationSide_default as FluxApplicationSide, FluxApplicationTop_default as FluxApplicationTop, useApplicationContextMenu_default as useApplicationContextMenu, useApplicationInjection_default as useApplicationInjection, useApplicationMenu_default as useApplicationMenu };
4330
+
4331
+ //# sourceMappingURL=index.js.map