@eightshift/ui-components 7.1.0 → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/{ListBox-B21SgugS.js → ListBox-BHUJxpwh.js} +1 -2
  2. package/dist/{SearchField-DR_I4_yn.js → SearchField-Cm1i5mLj.js} +1 -2
  3. package/dist/assets/fonts/geist-latin-400-normal.woff2 +0 -0
  4. package/dist/assets/fonts/geist-latin-500-normal.woff2 +0 -0
  5. package/dist/assets/fonts/geist-latin-700-normal.woff2 +0 -0
  6. package/dist/assets/fonts/geist-latin-ext-400-normal.woff2 +0 -0
  7. package/dist/assets/fonts/geist-latin-ext-500-normal.woff2 +0 -0
  8. package/dist/assets/fonts/geist-latin-ext-700-normal.woff2 +0 -0
  9. package/dist/assets/fonts/geist-mono-latin-400-normal.woff2 +0 -0
  10. package/dist/assets/fonts/geist-mono-latin-500-normal.woff2 +0 -0
  11. package/dist/assets/fonts/geist-mono-latin-700-normal.woff2 +0 -0
  12. package/dist/assets/fonts/geist-mono-latin-ext-400-normal.woff2 +0 -0
  13. package/dist/assets/fonts/geist-mono-latin-ext-500-normal.woff2 +0 -0
  14. package/dist/assets/fonts/geist-mono-latin-ext-700-normal.woff2 +0 -0
  15. package/dist/assets/fonts/google-sans-flex-latin-ext-full-normal.woff2 +0 -0
  16. package/dist/assets/fonts/google-sans-flex-latin-full-normal.woff2 +0 -0
  17. package/dist/assets/fonts/google-sans-flex-symbols-full-normal.woff2 +0 -0
  18. package/dist/assets/style-admin.css +3 -12528
  19. package/dist/assets/style-editor.css +3 -12492
  20. package/dist/assets/style.css +3 -12498
  21. package/dist/assets/wp-overrides/allow-full-width-blocks.css +1 -5
  22. package/dist/assets/wp-overrides/fix-label-text-case.css +1 -28
  23. package/dist/assets/wp-overrides/increase-sidebar-width.css +1 -3
  24. package/dist/assets/wp-overrides/make-block-messages-nicer.css +1 -154
  25. package/dist/assets/wp-overrides/replace-fonts.css +1 -7
  26. package/dist/assets/wp-overrides/restyle-tooltips.css +1 -193
  27. package/dist/assets/wp-overrides/round-corners.css +1 -199
  28. package/dist/assets/wp-overrides/unify-button-sizes.css +1 -4
  29. package/dist/{button-COTeluL8.js → button-D9cbyHeZ.js} +2 -2
  30. package/dist/{checkbox-D0AWkLhp.js → checkbox-BO5RZmO8.js} +1 -1
  31. package/dist/{color-swatch-CBYsO_Zs.js → color-swatch-D2ZBkuTt.js} +1 -1
  32. package/dist/components/base-control/container.js +1 -1
  33. package/dist/components/button/button.js +1 -2
  34. package/dist/components/checkbox/checkbox.js +1 -1
  35. package/dist/components/color-pickers/color-picker.js +2 -2
  36. package/dist/components/color-pickers/color-swatch.js +1 -2
  37. package/dist/components/color-pickers/gradient-editor.js +1 -3
  38. package/dist/components/color-pickers/solid-color-picker.js +1 -2
  39. package/dist/components/component-toggle/component-toggle.js +4 -4
  40. package/dist/components/container-panel/container-panel.js +2 -3
  41. package/dist/components/draggable/draggable-handle.js +1 -1
  42. package/dist/components/draggable/draggable.js +1 -2
  43. package/dist/components/draggable-list/draggable-list-item.js +1 -1
  44. package/dist/components/draggable-list/draggable-list.js +2 -2
  45. package/dist/components/expandable/expandable.js +2 -2
  46. package/dist/components/index.js +14 -16
  47. package/dist/components/input-field/input-field.js +1 -1
  48. package/dist/components/item-collection/item-collection.js +1 -1
  49. package/dist/components/link-input/link-input.js +1 -2
  50. package/dist/components/matrix-align/matrix-align.js +1 -1
  51. package/dist/components/menu/menu.js +2 -2
  52. package/dist/components/modal/modal.js +1 -2
  53. package/dist/components/number-picker/number-picker.js +1 -2
  54. package/dist/components/option-select/option-select.js +3 -3
  55. package/dist/components/placeholders/file-picker-shell.js +1 -2
  56. package/dist/components/placeholders/file-placeholder.js +1 -1
  57. package/dist/components/popover/popover.js +2 -2
  58. package/dist/components/radio/radio.js +1 -1
  59. package/dist/components/repeater/repeater-item.js +2 -2
  60. package/dist/components/repeater/repeater.js +3 -3
  61. package/dist/components/responsive/mini-responsive.js +2 -2
  62. package/dist/components/responsive/responsive-legacy.js +3 -3
  63. package/dist/components/responsive/responsive.js +3 -3
  64. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  65. package/dist/components/select/async-multi-select.js +4 -4
  66. package/dist/components/select/async-select.js +4 -4
  67. package/dist/components/select/multi-select.js +4 -4
  68. package/dist/components/select/shared.js +1 -2
  69. package/dist/components/select/single-select.js +4 -4
  70. package/dist/components/select/styles.js +1 -1
  71. package/dist/components/slider/column-config-slider.js +1 -1
  72. package/dist/components/slider/slider.js +1 -2
  73. package/dist/components/slider/utils.js +1 -1
  74. package/dist/components/smart-image/smart-image.js +1 -2
  75. package/dist/components/tabs/tabs.js +1 -2
  76. package/dist/components/toggle/switch.js +1 -1
  77. package/dist/components/toggle/toggle.js +1 -1
  78. package/dist/components/toggle-button/toggle-button.js +1 -1
  79. package/dist/{draggable-CYQyD9gG.js → draggable-CTDVJ4zd.js} +1 -1
  80. package/dist/gradient-editor-CD5Sho6A.js +1578 -0
  81. package/dist/icons/index.js +1 -1
  82. package/dist/icons/jsx-svg.js +1 -1
  83. package/dist/index.js +14 -16
  84. package/dist/{input-field-UCZL5bqv.js → input-field-_OCWbftf.js} +1 -1
  85. package/dist/{jsx-svg-OBADs_Qs.js → jsx-svg-DgKbriN1.js} +6 -12
  86. package/dist/{link-input-D7iDRpOM.js → link-input-BnjtzMbF.js} +3 -3
  87. package/dist/{modal-DbVLYMkH.js → modal-snrElwty.js} +2 -2
  88. package/dist/{number-picker-CkA1iJNZ.js → number-picker-Dhtx4409.js} +3 -2
  89. package/dist/{shared-D_OXizRt.js → shared-BpAYSi3F.js} +2 -2
  90. package/dist/{smart-image-CbSsEASF.js → smart-image-CBNbxJ57.js} +1 -1
  91. package/dist/{solid-color-picker-DbT-aoVx.js → solid-color-picker-DukArNH-.js} +2 -2
  92. package/dist/{switch-L8dFSQWQ.js → switch-DmsvyQPa.js} +1 -1
  93. package/dist/{tabs-BrdyBER5.js → tabs-Cy6gB0RL.js} +7 -6
  94. package/dist/{toggle-button-DJ8jNQ-9.js → toggle-button-BlzUGfGy.js} +1 -1
  95. package/dist/utilities/general.js +25 -2
  96. package/dist/utilities/index.js +3 -3
  97. package/package.json +11 -14
  98. package/dist/general-BKOvs-AO.js +0 -4276
  99. package/dist/gradient-editor-BAd_Gzx4.js +0 -604
  100. package/dist/workers/image-analysis.worker.js +0 -60
  101. /package/dist/{List-CMK5qsNF.js → List-DWlgW2Ex.js} +0 -0
  102. /package/dist/{build-module-sxK3nxOK.js → build-module-Bsx62nlm.js} +0 -0
  103. /package/dist/{dist-DIK9pFxO.js → dist-2gkv7_1U.js} +0 -0
  104. /package/dist/{utilities-CPFDXC3B.js → utilities-lwX686oD.js} +0 -0
@@ -0,0 +1,1578 @@
1
+ import { t as clsx } from "./clsx-BUU5J41u.js";
2
+ import { n as ButtonGroup, t as Button } from "./button-D9cbyHeZ.js";
3
+ import { n as $251c695a52d94a8d$export$cae13e90592f246a } from "./color-swatch-D2ZBkuTt.js";
4
+ import { t as SolidColorPicker } from "./solid-color-picker-DukArNH-.js";
5
+ import { t as NumberPicker } from "./number-picker-Dhtx4409.js";
6
+ import { BaseControl } from "./components/base-control/base-control.js";
7
+ import { isColorDark } from "./utilities/general.js";
8
+ import { r as sprintf, t as __ } from "./build-module-Bsx62nlm.js";
9
+ import { add } from "./icons/ui-icons/add.js";
10
+ import { angle } from "./icons/ui-icons/angle.js";
11
+ import { centerPoint } from "./icons/ui-icons/center-point.js";
12
+ import { genericShapesAlt } from "./icons/ui-icons/generic-shapes-alt.js";
13
+ import { gradientRepeat } from "./icons/ui-icons/gradient-repeat.js";
14
+ import { gradientStop } from "./icons/ui-icons/gradient-stop.js";
15
+ import { sliders } from "./icons/ui-icons/sliders.js";
16
+ import { trash } from "./icons/ui-icons/trash.js";
17
+ import { TriggeredPopover } from "./components/popover/popover.js";
18
+ import { Menu, MenuItem } from "./components/menu/menu.js";
19
+ import { Container, ContainerGroup } from "./components/base-control/container.js";
20
+ import { DraggableList } from "./components/draggable-list/draggable-list.js";
21
+ import { DraggableListItem } from "./components/draggable-list/draggable-list-item.js";
22
+ import { Slider } from "./components/slider/slider.js";
23
+ import { MatrixAlign } from "./components/matrix-align/matrix-align.js";
24
+ import { Toggle } from "./components/toggle/toggle.js";
25
+ import { OptionSelect } from "./components/option-select/option-select.js";
26
+ import { useMemo, useState } from "react";
27
+ import { jsx, jsxs } from "react/jsx-runtime";
28
+ //#region node_modules/css-gradient-parser/dist/index.js
29
+ function c$1(e, o = ",") {
30
+ let t = [], n = 0, i = 0;
31
+ o = new RegExp(o);
32
+ for (let r = 0; r < e.length; r++) e[r] === "(" ? i++ : e[r] === ")" && i--, i === 0 && o.test(e[r]) && (t.push(e.slice(n, r).trim()), n = r + 1);
33
+ return t.push(e.slice(n).trim()), t;
34
+ }
35
+ function g(e) {
36
+ let o = [];
37
+ for (let t = 0, n = e.length; t < n;) {
38
+ let [i, r] = c$1(e[t], /\s+/);
39
+ m(e[t + 1]) ? (o.push({
40
+ color: i,
41
+ offset: l(r),
42
+ hint: l(e[t + 1])
43
+ }), t += 2) : (o.push({
44
+ color: i,
45
+ offset: l(r)
46
+ }), t++);
47
+ }
48
+ return o;
49
+ }
50
+ var u = /^(-?\d+\.?\d*)(%|vw|vh|px|em|rem|deg|rad|grad|turn|ch|vmin|vmax)?$/;
51
+ function m(e) {
52
+ return u.test(e);
53
+ }
54
+ function l(e) {
55
+ if (!e) return;
56
+ let [, o, t] = e.trim().match(u) || [];
57
+ return {
58
+ value: o,
59
+ unit: t ?? "px"
60
+ };
61
+ }
62
+ function P(e) {
63
+ if (!/^(repeating-)?linear-gradient/.test(e)) throw new SyntaxError(`could not find syntax for this item: ${e}`);
64
+ let [, o, t] = e.match(/(repeating-)?linear-gradient\((.+)\)/), n = {
65
+ orientation: {
66
+ type: "directional",
67
+ value: "bottom"
68
+ },
69
+ repeating: !!o,
70
+ stops: []
71
+ }, i = c$1(t), r = x(i[0]);
72
+ return r && (n.orientation = r, i.shift()), {
73
+ ...n,
74
+ stops: g(i)
75
+ };
76
+ }
77
+ function x(e) {
78
+ return e.startsWith("to ") ? {
79
+ type: "directional",
80
+ value: e.replace("to ", "")
81
+ } : [
82
+ "turn",
83
+ "deg",
84
+ "grad",
85
+ "rad"
86
+ ].some((o) => e.endsWith(o)) ? {
87
+ type: "angular",
88
+ value: l(e)
89
+ } : null;
90
+ }
91
+ var v = new Set([
92
+ "closest-corner",
93
+ "closest-side",
94
+ "farthest-corner",
95
+ "farthest-side"
96
+ ]), w = new Set([
97
+ "center",
98
+ "left",
99
+ "top",
100
+ "right",
101
+ "bottom"
102
+ ]);
103
+ function d$1(e) {
104
+ return v.has(e);
105
+ }
106
+ function h(e) {
107
+ return w.has(e);
108
+ }
109
+ function R(e) {
110
+ let o = Array(2).fill("");
111
+ for (let t = 0; t < 2; t++) e[t] ? o[t] = e[t] : o[t] = "center";
112
+ return o;
113
+ }
114
+ function K(e) {
115
+ if (!/(repeating-)?radial-gradient/.test(e)) throw new SyntaxError(`could not find syntax for this item: ${e}`);
116
+ let [, o, t] = e.match(/(repeating-)?radial-gradient\((.+)\)/), n = {
117
+ shape: "ellipse",
118
+ repeating: !!o,
119
+ size: [{
120
+ type: "keyword",
121
+ value: "farthest-corner"
122
+ }],
123
+ position: {
124
+ x: {
125
+ type: "keyword",
126
+ value: "center"
127
+ },
128
+ y: {
129
+ type: "keyword",
130
+ value: "center"
131
+ }
132
+ },
133
+ stops: []
134
+ }, i = c$1(t);
135
+ if (S(i[0])) return {
136
+ ...n,
137
+ stops: g(i)
138
+ };
139
+ let r = i[0].split("at").map((f) => f.trim()), p = ((r[0] || "").match(/(circle|ellipse)/) || [])[1], a = (r[0] || "").match(/(-?\d+\.?\d*(vw|vh|px|em|rem|%|rad|grad|turn|deg)?|closest-corner|closest-side|farthest-corner|farthest-side)/g) || [], s = R((r[1] || "").split(" "));
140
+ return p ? n.shape = p : a.length === 1 && !d$1(a[0]) ? n.shape = "circle" : n.shape = "ellipse", a.length === 0 && a.push("farthest-corner"), n.size = a.map((f) => d$1(f) ? {
141
+ type: "keyword",
142
+ value: f
143
+ } : {
144
+ type: "length",
145
+ value: l(f)
146
+ }), n.position.x = h(s[0]) ? {
147
+ type: "keyword",
148
+ value: s[0]
149
+ } : {
150
+ type: "length",
151
+ value: l(s[0])
152
+ }, n.position.y = h(s[1]) ? {
153
+ type: "keyword",
154
+ value: s[1]
155
+ } : {
156
+ type: "length",
157
+ value: l(s[1])
158
+ }, (p || a.length > 0 || r[1]) && i.shift(), {
159
+ ...n,
160
+ stops: g(i)
161
+ };
162
+ }
163
+ function S(e) {
164
+ return /(circle|ellipse|at)/.test(e) ? !1 : /^(rgba?|hwb|hsla?|lab|lch|oklab|color|#|[a-zA-Z]+)/.test(e);
165
+ }
166
+ var C = new Set([
167
+ "from",
168
+ "in",
169
+ "at"
170
+ ]);
171
+ function j(e) {
172
+ if (!/(repeating-)?conic-gradient/.test(e)) throw new SyntaxError(`could not find syntax for this item: ${e}`);
173
+ let [, o, t] = e.match(/(repeating-)?conic-gradient\((.+)\)/), n = {
174
+ angle: "0deg",
175
+ repeating: !!o,
176
+ position: "center",
177
+ stops: []
178
+ }, i = c$1(t).map((s) => s.trim()), r = c$1(i[0], /\s+/), p = "", a = 0;
179
+ for (let s = 0, f = r.length; s < f; s++) C.has(r[s]) && (s > 0 && Object.assign(n, y(p, r, a, s)), p = r[s], a = s + 1);
180
+ return p && (Object.assign(n, y(p, r, a, r.length)), i.shift()), {
181
+ ...n,
182
+ stops: g(i)
183
+ };
184
+ }
185
+ function y(e, o, t, n) {
186
+ switch (e) {
187
+ case "from": return { angle: o.slice(t, n).join(" ") };
188
+ case "at": return { position: o.slice(t, n).join(" ") };
189
+ case "in": {
190
+ let [i, ...r] = o.slice(t, n);
191
+ return { color: {
192
+ space: i,
193
+ method: r.length > 0 ? r.join(" ") : void 0
194
+ } };
195
+ }
196
+ }
197
+ }
198
+ //#endregion
199
+ //#region node_modules/@thi.ng/color/api.js
200
+ var ParsedColor = class {
201
+ constructor(mode, value) {
202
+ this.mode = mode;
203
+ this.value = value;
204
+ }
205
+ deref() {
206
+ return this.value;
207
+ }
208
+ };
209
+ //#endregion
210
+ //#region node_modules/@thi.ng/memoize/memoizej.js
211
+ function memoizeJ(fn, cache = Object.create(null)) {
212
+ return (...args) => {
213
+ const key = JSON.stringify(args);
214
+ if (key !== void 0) return key in cache ? cache[key] : cache[key] = fn.apply(null, args);
215
+ return fn.apply(null, args);
216
+ };
217
+ }
218
+ //#endregion
219
+ //#region node_modules/@thi.ng/memoize/memoizeo.js
220
+ function memoizeO(fn, cache = Object.create(null)) {
221
+ return (...xs) => {
222
+ const key = xs.join("-");
223
+ return key in cache ? cache[key] : cache[key] = fn(...xs);
224
+ };
225
+ }
226
+ //#endregion
227
+ //#region node_modules/@thi.ng/strings/repeat.js
228
+ var repeat = memoizeO((ch, n) => ch.repeat(n));
229
+ //#endregion
230
+ //#region node_modules/@thi.ng/strings/pad-left.js
231
+ var padLeft = memoizeO((n, ch = " ") => {
232
+ const buf = repeat(String(ch), n);
233
+ return (x, len) => {
234
+ if (x == null) return buf;
235
+ x = x.toString();
236
+ len = len !== void 0 ? len : x.length;
237
+ return len < n ? buf.substring(len) + x : x;
238
+ };
239
+ });
240
+ var Z2 = padLeft(2, "0");
241
+ var Z3 = padLeft(3, "0");
242
+ var Z4 = padLeft(4, "0");
243
+ //#endregion
244
+ //#region node_modules/@thi.ng/strings/float.js
245
+ var float = memoizeJ((prec, special = false) => special ? (x) => __nanOrInf(x) || x.toFixed(prec) : (x) => x.toFixed(prec));
246
+ var floatFixedWidth = memoizeJ((width, prec = 3) => {
247
+ const l = width - prec - 1;
248
+ const pl = Math.pow(10, l);
249
+ const pln = -Math.pow(10, l - 1);
250
+ const pr = Math.pow(10, -(prec - 1));
251
+ const pad = padLeft(width);
252
+ return (x) => {
253
+ const ax = Math.abs(x);
254
+ return pad(__nanOrInf(x) || (x === 0 ? "0" : ax < pr || ax >= pl ? __exp(x, width) : x.toFixed(prec - (x < pln ? 1 : 0))));
255
+ };
256
+ });
257
+ var __exp = (x, w) => x.toExponential(Math.max(w - 4 - (Math.log(Math.abs(x)) / Math.LN10 >= 10 ? 2 : 1) - (x < 0 ? 1 : 0), 0));
258
+ var __nanOrInf = (x) => isNaN(x) ? "NaN" : x === Infinity ? "+∞" : x === -Infinity ? "-∞" : void 0;
259
+ //#endregion
260
+ //#region node_modules/@thi.ng/strings/percent.js
261
+ var percent = (prec = 0) => (x) => (x * 100).toFixed(prec) + "%";
262
+ //#endregion
263
+ //#region node_modules/@thi.ng/color/api/constants.js
264
+ var BLACK = Object.freeze([
265
+ 0,
266
+ 0,
267
+ 0,
268
+ 1
269
+ ]);
270
+ var WHITE = Object.freeze([
271
+ 1,
272
+ 1,
273
+ 1,
274
+ 1
275
+ ]);
276
+ var RED = Object.freeze([
277
+ 1,
278
+ 0,
279
+ 0,
280
+ 1
281
+ ]);
282
+ var GREEN = Object.freeze([
283
+ 0,
284
+ 1,
285
+ 0,
286
+ 1
287
+ ]);
288
+ var BLUE = Object.freeze([
289
+ 0,
290
+ 0,
291
+ 1,
292
+ 1
293
+ ]);
294
+ var CYAN = Object.freeze([
295
+ 0,
296
+ 1,
297
+ 1,
298
+ 1
299
+ ]);
300
+ var MAGENTA = Object.freeze([
301
+ 1,
302
+ 0,
303
+ 1,
304
+ 1
305
+ ]);
306
+ var YELLOW = Object.freeze([
307
+ 1,
308
+ 1,
309
+ 0,
310
+ 1
311
+ ]);
312
+ var RGB_LUMINANCE_REC709 = [
313
+ .2126,
314
+ .7152,
315
+ .0722
316
+ ];
317
+ var FF = float(3);
318
+ var PC = percent(3);
319
+ var INV8BIT = 1 / 255;
320
+ //#endregion
321
+ //#region node_modules/@thi.ng/color/api/names.js
322
+ var CSS_NAMES = {
323
+ aliceblue: "f0f8ff",
324
+ antiquewhite: "faebd7",
325
+ aqua: "0ff",
326
+ aquamarine: "7fffd4",
327
+ azure: "f0ffff",
328
+ beige: "f5f5dc",
329
+ bisque: "ffe4c4",
330
+ black: "000",
331
+ blanchedalmond: "ffebcd",
332
+ blue: "00f",
333
+ blueviolet: "8a2be2",
334
+ brown: "a52a2a",
335
+ burlywood: "deb887",
336
+ cadetblue: "5f9ea0",
337
+ chartreuse: "7fff00",
338
+ chocolate: "d2691e",
339
+ coral: "ff7f50",
340
+ cornflowerblue: "6495ed",
341
+ cornsilk: "fff8dc",
342
+ crimson: "dc143c",
343
+ cyan: "0ff",
344
+ darkblue: "00008b",
345
+ darkcyan: "008b8b",
346
+ darkgoldenrod: "b8860b",
347
+ darkgray: "a9a9a9",
348
+ darkgreen: "006400",
349
+ darkgrey: "a9a9a9",
350
+ darkkhaki: "bdb76b",
351
+ darkmagenta: "8b008b",
352
+ darkolivegreen: "556b2f",
353
+ darkorange: "ff8c00",
354
+ darkorchid: "9932cc",
355
+ darkred: "8b0000",
356
+ darksalmon: "e9967a",
357
+ darkseagreen: "8fbc8f",
358
+ darkslateblue: "483d8b",
359
+ darkslategray: "2f4f4f",
360
+ darkslategrey: "2f4f4f",
361
+ darkturquoise: "00ced1",
362
+ darkviolet: "9400d3",
363
+ deeppink: "ff1493",
364
+ deepskyblue: "00bfff",
365
+ dimgray: "696969",
366
+ dimgrey: "696969",
367
+ dodgerblue: "1e90ff",
368
+ firebrick: "b22222",
369
+ floralwhite: "fffaf0",
370
+ forestgreen: "228b22",
371
+ fuchsia: "f0f",
372
+ gainsboro: "dcdcdc",
373
+ ghostwhite: "f8f8ff",
374
+ gold: "ffd700",
375
+ goldenrod: "daa520",
376
+ gray: "808080",
377
+ grey: "808080",
378
+ green: "008000",
379
+ greenyellow: "adff2f",
380
+ honeydew: "f0fff0",
381
+ hotpink: "ff69b4",
382
+ indianred: "cd5c5c",
383
+ indigo: "4b0082",
384
+ ivory: "fffff0",
385
+ khaki: "f0e68c",
386
+ lavender: "e6e6fa",
387
+ lavenderblush: "fff0f5",
388
+ lawngreen: "7cfc00",
389
+ lemonchiffon: "fffacd",
390
+ lightblue: "add8e6",
391
+ lightcoral: "f08080",
392
+ lightcyan: "e0ffff",
393
+ lightgoldenrodyellow: "fafad2",
394
+ lightgray: "d3d3d3",
395
+ lightgreen: "90ee90",
396
+ lightgrey: "d3d3d3",
397
+ lightpink: "ffb6c1",
398
+ lightsalmon: "ffa07a",
399
+ lightseagreen: "20b2aa",
400
+ lightskyblue: "87cefa",
401
+ lightslategray: "789",
402
+ lightslategrey: "789",
403
+ lightsteelblue: "b0c4de",
404
+ lightyellow: "ffffe0",
405
+ lime: "0f0",
406
+ limegreen: "32cd32",
407
+ linen: "faf0e6",
408
+ magenta: "f0f",
409
+ maroon: "800000",
410
+ mediumaquamarine: "66cdaa",
411
+ mediumblue: "0000cd",
412
+ mediumorchid: "ba55d3",
413
+ mediumpurple: "9370db",
414
+ mediumseagreen: "3cb371",
415
+ mediumslateblue: "7b68ee",
416
+ mediumspringgreen: "00fa9a",
417
+ mediumturquoise: "48d1cc",
418
+ mediumvioletred: "c71585",
419
+ midnightblue: "191970",
420
+ mintcream: "f5fffa",
421
+ mistyrose: "ffe4e1",
422
+ moccasin: "ffe4b5",
423
+ navajowhite: "ffdead",
424
+ navy: "000080",
425
+ oldlace: "fdf5e6",
426
+ olive: "808000",
427
+ olivedrab: "6b8e23",
428
+ orange: "ffa500",
429
+ orangered: "ff4500",
430
+ orchid: "da70d6",
431
+ palegoldenrod: "eee8aa",
432
+ palegreen: "98fb98",
433
+ paleturquoise: "afeeee",
434
+ palevioletred: "db7093",
435
+ papayawhip: "ffefd5",
436
+ peachpuff: "ffdab9",
437
+ peru: "cd853f",
438
+ pink: "ffc0cb",
439
+ plum: "dda0dd",
440
+ powderblue: "b0e0e6",
441
+ purple: "800080",
442
+ red: "f00",
443
+ rosybrown: "bc8f8f",
444
+ royalblue: "4169e1",
445
+ saddlebrown: "8b4513",
446
+ salmon: "fa8072",
447
+ sandybrown: "f4a460",
448
+ seagreen: "2e8b57",
449
+ seashell: "fff5ee",
450
+ sienna: "a0522d",
451
+ silver: "c0c0c0",
452
+ skyblue: "87ceeb",
453
+ slateblue: "6a5acd",
454
+ slategray: "708090",
455
+ slategrey: "708090",
456
+ snow: "fffafa",
457
+ springgreen: "00ff7f",
458
+ steelblue: "4682b4",
459
+ tan: "d2b48c",
460
+ teal: "008080",
461
+ thistle: "d8bfd8",
462
+ tomato: "ff6347",
463
+ turquoise: "40e0d0",
464
+ violet: "ee82ee",
465
+ wheat: "f5deb3",
466
+ white: "fff",
467
+ whitesmoke: "f5f5f5",
468
+ yellow: "ff0",
469
+ yellowgreen: "9acd32",
470
+ transparent: "0000",
471
+ rebeccapurple: "639"
472
+ };
473
+ //#endregion
474
+ //#region node_modules/@thi.ng/color/api/system.js
475
+ var CSS_SYSTEM_COLORS = {
476
+ canvas: "fff",
477
+ canvastext: "000",
478
+ linktext: "001ee4",
479
+ visitedtext: "4e2386",
480
+ activetext: "eb3323",
481
+ buttonface: "ddd",
482
+ buttontext: "000",
483
+ buttonborder: "000",
484
+ field: "fff",
485
+ fieldtext: "000",
486
+ highlight: "bbd5fb",
487
+ highlighttext: "000",
488
+ mark: "000",
489
+ marktext: "fff",
490
+ graytext: "808080"
491
+ };
492
+ //#endregion
493
+ //#region node_modules/@thi.ng/vectors/setc.js
494
+ var setC3 = (out, x, y, z) => {
495
+ !out && (out = []);
496
+ out[0] = x;
497
+ out[1] = y;
498
+ out[2] = z;
499
+ return out;
500
+ };
501
+ var setC4 = (out, x, y, z, w) => {
502
+ !out && (out = []);
503
+ out[0] = x;
504
+ out[1] = y;
505
+ out[2] = z;
506
+ out[3] = w;
507
+ return out;
508
+ };
509
+ //#endregion
510
+ //#region node_modules/@thi.ng/errors/deferror.js
511
+ var defError = (prefix, suffix = (msg) => msg !== void 0 ? ": " + msg : "") => class extends Error {
512
+ origMessage;
513
+ constructor(msg) {
514
+ super(prefix(msg) + suffix(msg));
515
+ this.origMessage = msg !== void 0 ? String(msg) : "";
516
+ }
517
+ };
518
+ //#endregion
519
+ //#region node_modules/@thi.ng/errors/unsupported.js
520
+ var UnsupportedOperationError = defError(() => "unsupported operation");
521
+ var unsupportedOp = (msg) => {
522
+ throw new UnsupportedOperationError(msg);
523
+ };
524
+ var UnsupportedFeatureError = defError(() => "unsupported feature");
525
+ //#endregion
526
+ //#region node_modules/@thi.ng/math/interval.js
527
+ var clamp = (x, min, max) => x < min ? min : x > max ? max : x;
528
+ var clamp01 = (x) => x < 0 ? 0 : x > 1 ? 1 : x;
529
+ //#endregion
530
+ //#region node_modules/@thi.ng/math/api.js
531
+ var PI = Math.PI;
532
+ var TAU = PI * 2;
533
+ var HALF_PI = PI / 2;
534
+ var THIRD_PI = PI / 3;
535
+ var QUARTER_PI = PI / 4;
536
+ var SIXTH_PI = PI / 6;
537
+ var INV_PI = 1 / PI;
538
+ var INV_TAU = 1 / TAU;
539
+ var INV_HALF_PI = 1 / HALF_PI;
540
+ var DEG2RAD = PI / 180;
541
+ var RAD2DEG = 180 / PI;
542
+ var PHI = (1 + Math.sqrt(5)) / 2;
543
+ var SQRT2 = Math.SQRT2;
544
+ var SQRT3 = Math.sqrt(3);
545
+ var SQRT2_2 = SQRT2 / 2;
546
+ var SQRT3_2 = SQRT3 / 2;
547
+ var EPS = 1e-6;
548
+ //#endregion
549
+ //#region node_modules/@thi.ng/math/prec.js
550
+ var fract = (x) => x - Math.floor(x);
551
+ //#endregion
552
+ //#region node_modules/@thi.ng/random/arandom.js
553
+ var INV_MAX = 1 / 2 ** 32;
554
+ var ARandom = class {
555
+ float(norm = 1) {
556
+ return this.int() * INV_MAX * norm;
557
+ }
558
+ probability(p) {
559
+ return this.float() < p;
560
+ }
561
+ norm(norm = 1) {
562
+ return (this.int() * INV_MAX - .5) * 2 * norm;
563
+ }
564
+ normMinMax(min, max) {
565
+ const x = this.minmax(min, max);
566
+ return this.float() < .5 ? x : -x;
567
+ }
568
+ minmax(min, max) {
569
+ return this.float() * (max - min) + min;
570
+ }
571
+ minmaxInt(min, max) {
572
+ min |= 0;
573
+ const range = (max | 0) - min;
574
+ return range ? min + this.int() % range : min;
575
+ }
576
+ minmaxUint(min, max) {
577
+ min >>>= 0;
578
+ const range = (max >>> 0) - min;
579
+ return range ? min + this.int() % range : min;
580
+ }
581
+ };
582
+ //#endregion
583
+ //#region node_modules/@thi.ng/random/wrapped.js
584
+ var WrappedRandom = class extends ARandom {
585
+ constructor(rnd) {
586
+ super();
587
+ this.rnd = rnd;
588
+ }
589
+ float(norm = 1) {
590
+ return this.rnd() * norm;
591
+ }
592
+ norm(norm = 1) {
593
+ return (this.rnd() - .5) * 2 * norm;
594
+ }
595
+ int() {
596
+ return this.rnd() * 4294967296 >>> 0;
597
+ }
598
+ };
599
+ //#endregion
600
+ //#region node_modules/@thi.ng/random/system.js
601
+ var SYSTEM = new WrappedRandom(Math.random);
602
+ //#endregion
603
+ //#region node_modules/@thi.ng/color/internal/ensure.js
604
+ var __ensureAlpha = (x, def = 1) => x != void 0 ? clamp01(x) : def;
605
+ var __ensureArgs = (args) => {
606
+ if (typeof args[0] === "number") switch (args.length) {
607
+ case 1: return args.push(0, 0, 1), [args];
608
+ case 2: return args.push(0, 1), [args];
609
+ case 3: return args.push(1), [args];
610
+ default: return [args];
611
+ }
612
+ return args;
613
+ };
614
+ //#endregion
615
+ //#region node_modules/@thi.ng/color/clamp.js
616
+ var clampH = (out, src, alpha = 1) => setC4(out || src, fract(src[0]), clamp01(src[1]), clamp01(src[2]), __ensureAlpha(src[3], alpha));
617
+ //#endregion
618
+ //#region node_modules/@thi.ng/checks/is-array.js
619
+ var isArray = Array.isArray;
620
+ //#endregion
621
+ //#region node_modules/@thi.ng/checks/is-number.js
622
+ var isNumber = (x) => typeof x === "number";
623
+ //#endregion
624
+ //#region node_modules/@thi.ng/checks/is-string.js
625
+ var isString = (x) => typeof x === "string";
626
+ //#endregion
627
+ //#region node_modules/@thi.ng/errors/illegal-arguments.js
628
+ var IllegalArgumentError = defError(() => "illegal argument(s)");
629
+ var illegalArgs = (msg) => {
630
+ throw new IllegalArgumentError(msg);
631
+ };
632
+ //#endregion
633
+ //#region node_modules/@thi.ng/errors/assert.js
634
+ var AssertionError = defError(() => "Assertion failed");
635
+ var assert = (typeof process !== "undefined" && process.env !== void 0 ? process.env.NODE_ENV !== "production" || !!process.env.UMBRELLA_ASSERTS : false) ? (test, msg) => {
636
+ if (typeof test === "function" && !test() || !test) throw new AssertionError(typeof msg === "function" ? msg() : msg);
637
+ } : () => {};
638
+ //#endregion
639
+ //#region node_modules/@thi.ng/binary/rotate.js
640
+ var rotateRight = (x, n) => (x >>> n | x << 32 - n) >>> 0;
641
+ //#endregion
642
+ //#region node_modules/@thi.ng/binary/splat.js
643
+ var interleave4_12_24 = (x) => (x & 3840) * 4352 | (x & 240) * 272 | (x & 15) * 17;
644
+ var interleave4_16_32 = (x) => ((x & 61440) * 69632 | (x & 3840) * 4352 | (x & 240) * 272 | (x & 15) * 17) >>> 0;
645
+ //#endregion
646
+ //#region node_modules/@thi.ng/color/int/int-srgb.js
647
+ var intArgb32Srgb = (out, src) => setC4(out || [], (src >>> 16 & 255) * INV8BIT, (src >>> 8 & 255) * INV8BIT, (src & 255) * INV8BIT, (src >>> 24) * INV8BIT);
648
+ var intAbgr32Srgb = (out, src) => setC4(out || [], (src & 255) * INV8BIT, (src >>> 8 & 255) * INV8BIT, (src >>> 16 & 255) * INV8BIT, (src >>> 24) * INV8BIT);
649
+ //#endregion
650
+ //#region node_modules/@thi.ng/color/css/parse-css.js
651
+ var parseCss = (src) => {
652
+ src = (isString(src) ? src : src.deref()).toLowerCase();
653
+ const named = CSS_NAMES[src] || CSS_SYSTEM_COLORS[src];
654
+ if (named || src[0] === "#") return new ParsedColor("srgb", intArgb32Srgb([], parseHex(named || src)));
655
+ const parts = src.split(/[(),/ ]+/);
656
+ const [mode, a, b, c, d] = parts;
657
+ assert(parts.length === 5 || parts.length === 6, `invalid color: ${src}`);
658
+ switch (mode) {
659
+ case "rgb":
660
+ case "rgba": return new ParsedColor("srgb", [
661
+ __numOrPercent(a, 1, INV8BIT, true),
662
+ __numOrPercent(b, 1, INV8BIT, true),
663
+ __numOrPercent(c, 1, INV8BIT, true),
664
+ __alpha(d)
665
+ ]);
666
+ case "hsl":
667
+ case "hsla": return new ParsedColor("hsl", [
668
+ __hue(a),
669
+ __percent(b),
670
+ __percent(c),
671
+ __alpha(d)
672
+ ]);
673
+ case "lab": return new ParsedColor("lab50", [
674
+ __numOrPercent(a),
675
+ __numOrPercent(b, 1.25),
676
+ __numOrPercent(c, 1.25),
677
+ __alpha(d)
678
+ ]);
679
+ case "lch": return new ParsedColor(mode, [
680
+ __numOrPercent(a),
681
+ __numOrPercent(b, 1.5),
682
+ __hue(c),
683
+ __alpha(d)
684
+ ]);
685
+ case "oklab": return new ParsedColor(mode, [
686
+ __numOrPercent(a, 1, 1),
687
+ __numOrPercent(b, .4, 1),
688
+ __numOrPercent(c, .4, 1),
689
+ __alpha(d)
690
+ ]);
691
+ case "oklch": return new ParsedColor(mode, [
692
+ __numOrPercent(a, 1, 1),
693
+ __numOrPercent(b, .4, 1),
694
+ __hue(c),
695
+ __alpha(d)
696
+ ]);
697
+ default: unsupportedOp(`color mode: ${mode}`);
698
+ }
699
+ };
700
+ var HUE_NORMS = {
701
+ rad: TAU,
702
+ grad: 400,
703
+ turn: 1,
704
+ deg: 360
705
+ };
706
+ var __hue = (x) => {
707
+ const match = /^(-?[0-9.]+)(deg|rad|grad|turn)?$/.exec(x);
708
+ assert(!!match, `expected hue, got: ${x}`);
709
+ return fract(parseFloat(match[1]) / (HUE_NORMS[match[2]] || 360));
710
+ };
711
+ var __alpha = (x) => x ? __numOrPercent(x, 1, 1, true) : 1;
712
+ var __percent = (x, clamp = true) => {
713
+ assert(/^([0-9.]+)%$/.test(x), `expected percentage, got: ${x}`);
714
+ const res = parseFloat(x) / 100;
715
+ return clamp ? clamp01(res) : res;
716
+ };
717
+ var __numOrPercent = (x, scalePerc = 1, scale = .01, clamp = false) => {
718
+ assert(/^-?[0-9.]+%?$/.test(x), `expected number or percentage, got: ${x}`);
719
+ const res = parseFloat(x) * (x.endsWith("%") ? .01 * scalePerc : scale);
720
+ return clamp ? clamp01(res) : res;
721
+ };
722
+ var parseHex = (src) => {
723
+ const match = /^#?([0-9a-f]{3,8})$/i.exec(src);
724
+ if (match) {
725
+ const hex = match[1];
726
+ const val = parseInt(hex, 16);
727
+ switch (hex.length) {
728
+ case 3: return (interleave4_12_24(val) | 4278190080) >>> 0;
729
+ case 4: return rotateRight(interleave4_16_32(val), 8);
730
+ case 6: return (val | 4278190080) >>> 0;
731
+ case 8: return rotateRight(val, 8);
732
+ default:
733
+ }
734
+ }
735
+ return illegalArgs(`invalid hex color: "${src}"`);
736
+ };
737
+ //#endregion
738
+ //#region node_modules/@thi.ng/vectors/vop.js
739
+ var vop = (dispatch = 1, fallback, ...optimized) => {
740
+ const impls = [, ,].concat(optimized);
741
+ const fn = (...args) => {
742
+ const g = impls[args[dispatch].length] || fallback;
743
+ return g ? g(...args) : unsupportedOp(`no impl for vec size ${args[dispatch].length}`);
744
+ };
745
+ fn.add = (dim, fn2) => impls[dim] = fn2;
746
+ fn.default = (fn2) => fallback = fn2;
747
+ fn.impl = (dim) => dim != null ? impls[dim] || fallback : fallback;
748
+ return fn;
749
+ };
750
+ //#endregion
751
+ //#region node_modules/@thi.ng/vectors/set.js
752
+ var set2 = (o, a) => {
753
+ !o && (o = []);
754
+ o[0] = a[0];
755
+ o[1] = a[1];
756
+ return o;
757
+ };
758
+ var set3 = (o, a) => {
759
+ !o && (o = []);
760
+ o[0] = a[0];
761
+ o[1] = a[1];
762
+ o[2] = a[2];
763
+ return o;
764
+ };
765
+ var set4 = (o, a) => {
766
+ !o && (o = []);
767
+ o[0] = a[0];
768
+ o[1] = a[1];
769
+ o[2] = a[2];
770
+ o[3] = a[3];
771
+ return o;
772
+ };
773
+ var set = vop(1, (o, a) => {
774
+ !o && (o = []);
775
+ for (let i = a.length; i-- > 0;) o[i] = a[i];
776
+ return o;
777
+ }, set2, set3, set4);
778
+ //#endregion
779
+ //#region node_modules/@thi.ng/checks/implements-function.js
780
+ var implementsFunction = (x, fn) => typeof x?.[fn] === "function";
781
+ //#endregion
782
+ //#region node_modules/@thi.ng/checks/is-arraylike.js
783
+ var isArrayLike = (x) => x != null && typeof x !== "function" && x.length !== void 0;
784
+ //#endregion
785
+ //#region node_modules/@thi.ng/strings/vector.js
786
+ var vector = memoizeJ((size, prec = 3, d = ",", pre = "[", post = "]") => {
787
+ const f = typeof prec === "number" ? float(prec) : prec;
788
+ switch (size) {
789
+ case 1: return (v) => `${pre}${f(v[0])}${post}`;
790
+ case 2: return (v) => `${pre}${f(v[0])}${d}${f(v[1])}${post}`;
791
+ case 3: return (v) => `${pre}${f(v[0])}${d}${f(v[1])}${d}${f(v[2])}${post}`;
792
+ case 4: return (v) => `${pre}${f(v[0])}${d}${f(v[1])}${d}${f(v[2])}${d}${f(v[3])}${post}`;
793
+ default: return (v) => {
794
+ const res = [];
795
+ for (let i = 0; i < v.length; i++) res.push(f(v[i]));
796
+ return `${pre}${res.join(d)}${post}`;
797
+ };
798
+ }
799
+ });
800
+ //#endregion
801
+ //#region node_modules/@thi.ng/vectors/buffer.js
802
+ var mapStridedBuffer = (ctor, buf, num, start, cstride, estride) => {
803
+ const res = [];
804
+ while (num-- > 0) {
805
+ res.push(new ctor(buf, start, cstride));
806
+ start += estride;
807
+ }
808
+ return res;
809
+ };
810
+ //#endregion
811
+ //#region node_modules/@thi.ng/vectors/defopvvv.js
812
+ var defOpVVV = (op, dispatch = 1, outA = true) => {
813
+ const a = outA ? (o, a2, b2, c2) => {
814
+ !o && (o = a2);
815
+ for (let i = a2.length; i-- > 0;) o[i] = op(a2[i], b2[i], c2[i]);
816
+ return o;
817
+ } : (o, a2, b2, c2) => {
818
+ !o && (o = c2);
819
+ for (let i = a2.length; i-- > 0;) o[i] = op(a2[i], b2[i], c2[i]);
820
+ return o;
821
+ };
822
+ const b = outA ? (o, a2, b2, c2) => {
823
+ !o && (o = a2);
824
+ o[0] = op(a2[0], b2[0], c2[0]);
825
+ o[1] = op(a2[1], b2[1], c2[1]);
826
+ return o;
827
+ } : (o, a2, b2, c2) => {
828
+ !o && (o = c2);
829
+ o[0] = op(a2[0], b2[0], c2[0]);
830
+ o[1] = op(a2[1], b2[1], c2[1]);
831
+ return o;
832
+ };
833
+ const c = outA ? (o, a2, b2, c2) => {
834
+ !o && (o = a2);
835
+ o[0] = op(a2[0], b2[0], c2[0]);
836
+ o[1] = op(a2[1], b2[1], c2[1]);
837
+ o[2] = op(a2[2], b2[2], c2[2]);
838
+ return o;
839
+ } : (o, a2, b2, c2) => {
840
+ !o && (o = c2);
841
+ o[0] = op(a2[0], b2[0], c2[0]);
842
+ o[1] = op(a2[1], b2[1], c2[1]);
843
+ o[2] = op(a2[2], b2[2], c2[2]);
844
+ return o;
845
+ };
846
+ const d = outA ? (o, a2, b2, c2) => {
847
+ !o && (o = a2);
848
+ o[0] = op(a2[0], b2[0], c2[0]);
849
+ o[1] = op(a2[1], b2[1], c2[1]);
850
+ o[2] = op(a2[2], b2[2], c2[2]);
851
+ o[3] = op(a2[3], b2[3], c2[3]);
852
+ return o;
853
+ } : (o, a2, b2, c2) => {
854
+ !o && (o = c2);
855
+ o[0] = op(a2[0], b2[0], c2[0]);
856
+ o[1] = op(a2[1], b2[1], c2[1]);
857
+ o[2] = op(a2[2], b2[2], c2[2]);
858
+ o[3] = op(a2[3], b2[3], c2[3]);
859
+ return o;
860
+ };
861
+ return [
862
+ vop(dispatch, a, b, c, d),
863
+ b,
864
+ c,
865
+ d
866
+ ];
867
+ };
868
+ //#endregion
869
+ //#region node_modules/@thi.ng/vectors/clamp.js
870
+ var [a, b, c, d] = defOpVVV(clamp);
871
+ var clamp4 = d;
872
+ //#endregion
873
+ //#region node_modules/@thi.ng/vectors/accessors.js
874
+ var declareIndex = (proto, id, idx, strided = true, defNumeric = true) => {
875
+ const get = idx > 0 ? strided ? function() {
876
+ return this.buf[this.offset + idx * this.stride];
877
+ } : function() {
878
+ return this.buf[this.offset + idx];
879
+ } : function() {
880
+ return this.buf[this.offset];
881
+ };
882
+ const set = idx > 0 ? strided ? function(n) {
883
+ this.buf[this.offset + idx * this.stride] = n;
884
+ } : function(n) {
885
+ this.buf[this.offset + idx] = n;
886
+ } : function(n) {
887
+ this.buf[this.offset] = n;
888
+ };
889
+ defNumeric && Object.defineProperty(proto, idx, {
890
+ get,
891
+ set,
892
+ enumerable: true
893
+ });
894
+ Object.defineProperty(proto, id, {
895
+ get,
896
+ set,
897
+ enumerable: true
898
+ });
899
+ };
900
+ var declareIndices = (proto, props, strided, defNumeric) => props.forEach((id, i) => declareIndex(proto, id, i, strided, defNumeric));
901
+ //#endregion
902
+ //#region node_modules/@thi.ng/math/eqdelta.js
903
+ var abs = Math.abs;
904
+ var eqDelta$1 = (a, b, eps = EPS) => abs(a - b) <= eps;
905
+ //#endregion
906
+ //#region node_modules/@thi.ng/vectors/eqdelta.js
907
+ var eqDelta2 = (a, b, eps = EPS) => {
908
+ return a.length === b.length && eqDelta$1(a[0], b[0], eps) && eqDelta$1(a[1], b[1], eps);
909
+ };
910
+ var eqDelta3 = (a, b, eps = EPS) => {
911
+ return a.length === b.length && eqDelta$1(a[0], b[0], eps) && eqDelta$1(a[1], b[1], eps) && eqDelta$1(a[2], b[2], eps);
912
+ };
913
+ var eqDelta4 = (a, b, eps = EPS) => {
914
+ return a.length === b.length && eqDelta$1(a[0], b[0], eps) && eqDelta$1(a[1], b[1], eps) && eqDelta$1(a[2], b[2], eps) && eqDelta$1(a[3], b[3], eps);
915
+ };
916
+ var eqDelta = vop(0, (v1, v2, eps = EPS) => {
917
+ if (implementsFunction(v1, "eqDelta")) return v1.eqDelta(v2, eps);
918
+ if (implementsFunction(v2, "eqDelta")) return v2.eqDelta(v1, eps);
919
+ return eqDeltaS(v1, v2, v1.length, eps);
920
+ }, eqDelta2, eqDelta3, eqDelta4);
921
+ var eqDeltaS = (a, b, n, eps = EPS, ia = 0, ib = 0, sa = 1, sb = 1) => {
922
+ for (; n > 0; n--, ia += sa, ib += sb) if (!eqDelta$1(a[ia], b[ib], eps)) return false;
923
+ return true;
924
+ };
925
+ //#endregion
926
+ //#region node_modules/@thi.ng/vectors/iterator.js
927
+ function* stridedValues(buf, num, start, stride) {
928
+ while (num-- > 0) {
929
+ yield buf[start];
930
+ start += stride;
931
+ }
932
+ }
933
+ //#endregion
934
+ //#region node_modules/@thi.ng/vectors/rand-minmax.js
935
+ var randMinMax = vop(1, (o, a, b, rnd = SYSTEM) => {
936
+ !o && (o = a);
937
+ for (let i = a.length; i-- > 0;) o[i] = rnd.minmax(a[i], b[i]);
938
+ return o;
939
+ });
940
+ //#endregion
941
+ //#region node_modules/@thi.ng/color/convert.js
942
+ var CONVERSIONS = {};
943
+ var defConversions = (mode, spec) => {
944
+ for (const id in spec) {
945
+ const val = spec[id];
946
+ if (isArray(val)) {
947
+ const [a, b, c, d] = val;
948
+ spec[id] = val.length === 2 ? (out, src) => b(out, a(out, src)) : val.length === 3 ? (out, src) => c(out, b(out, a(out, src))) : (out, src) => d(out, c(out, b(out, a(out, src))));
949
+ }
950
+ }
951
+ CONVERSIONS[mode] = {
952
+ ...CONVERSIONS[mode],
953
+ ...spec
954
+ };
955
+ };
956
+ var convert = (res, src, destMode, srcMode) => {
957
+ const spec = CONVERSIONS[destMode];
958
+ assert(!!spec, `no conversions available for ${destMode}`);
959
+ let $convert = spec[srcMode];
960
+ return $convert ? $convert(res, src) : CONVERSIONS.rgb[srcMode] ? spec.rgb(res, CONVERSIONS.rgb[srcMode]([], src)) : unsupportedOp(`can't convert: ${srcMode} -> ${destMode}`);
961
+ };
962
+ //#endregion
963
+ //#region node_modules/@thi.ng/color/defcolor.js
964
+ var defColor = (spec) => {
965
+ const channels = spec.channels || {};
966
+ const order = spec.order;
967
+ const numChannels = order.length;
968
+ order.reduce((acc, id) => {
969
+ acc[id] = {
970
+ range: [0, 1],
971
+ ...channels[id]
972
+ };
973
+ return acc;
974
+ }, channels);
975
+ const min = Object.freeze(order.map((id) => channels[id].range[0]));
976
+ const max = Object.freeze(order.map((id) => channels[id].range[1]));
977
+ const minR = set4([], min);
978
+ const maxR = set4([], max);
979
+ minR[numChannels - 1] = 1;
980
+ const hueChanID = order.findIndex((id) => !!channels[id].hue);
981
+ const $Color = class {
982
+ constructor(buf, offset = 0, stride = 1) {
983
+ this.offset = offset;
984
+ this.stride = stride;
985
+ this.buf = buf || [
986
+ 0,
987
+ 0,
988
+ 0,
989
+ 0
990
+ ];
991
+ this.offset = offset;
992
+ this.stride = stride;
993
+ }
994
+ buf;
995
+ get mode() {
996
+ return spec.mode;
997
+ }
998
+ get length() {
999
+ return numChannels;
1000
+ }
1001
+ get range() {
1002
+ return [min, max];
1003
+ }
1004
+ get [Symbol.toStringTag]() {
1005
+ return spec.mode;
1006
+ }
1007
+ get xyz() {
1008
+ return [
1009
+ this[0],
1010
+ this[1],
1011
+ this[2]
1012
+ ];
1013
+ }
1014
+ [Symbol.iterator]() {
1015
+ return stridedValues(this.buf, this.length, this.offset, this.stride);
1016
+ }
1017
+ copy() {
1018
+ return new $Color(this.deref());
1019
+ }
1020
+ copyView() {
1021
+ return new $Color(this.buf, this.offset, this.stride);
1022
+ }
1023
+ empty() {
1024
+ return new $Color();
1025
+ }
1026
+ deref() {
1027
+ return [
1028
+ this[0],
1029
+ this[1],
1030
+ this[2],
1031
+ this[3]
1032
+ ];
1033
+ }
1034
+ set(src) {
1035
+ return set4(this, src);
1036
+ }
1037
+ clamp() {
1038
+ hueChanID >= 0 && (this[hueChanID] = fract(this[hueChanID]));
1039
+ clamp4(null, this, min, max);
1040
+ return this;
1041
+ }
1042
+ eqDelta(o, eps = EPS) {
1043
+ return eqDelta4(this, o, eps);
1044
+ }
1045
+ randomize(rnd) {
1046
+ return randMinMax(this, minR, maxR, rnd);
1047
+ }
1048
+ toJSON() {
1049
+ return this.deref();
1050
+ }
1051
+ toString() {
1052
+ return vector(4, 4)(this);
1053
+ }
1054
+ };
1055
+ declareIndices($Color.prototype, order);
1056
+ defConversions(spec.mode, spec.from);
1057
+ defConversions("rgb", { [spec.mode]: spec.toRgb });
1058
+ const fromColor = (src, mode, args) => {
1059
+ const res = new $Color(...args);
1060
+ return mode !== spec.mode ? convert(res, src, spec.mode, mode) : res.set(src);
1061
+ };
1062
+ const factory = (src, ...args) => src == null ? new $Color() : isString(src) ? factory(parseCss(src), ...args) : isArrayLike(src) ? isString(src.mode) ? fromColor(src, src.mode, args) : new $Color(src, ...args) : implementsFunction(src, "deref") ? fromColor(src.deref(), src.mode, args) : isNumber(src) ? args.length && args.every(isNumber) ? new $Color(...__ensureArgs([src, ...args])) : fromColor(intArgb32Srgb([], src), "srgb", args) : illegalArgs(`can't create a ${spec.mode} color from: ${src}`);
1063
+ factory.class = $Color;
1064
+ factory.range = [min, max];
1065
+ factory.random = (rnd, buf, idx, stride) => new $Color(buf, idx, stride).randomize(rnd);
1066
+ factory.mapBuffer = (buf, num = buf.length / numChannels | 0, start = 0, cstride = 1, estride = numChannels) => mapStridedBuffer($Color, buf, num, start, cstride, estride);
1067
+ return factory;
1068
+ };
1069
+ //#endregion
1070
+ //#region node_modules/@thi.ng/vectors/dot.js
1071
+ var dot2 = (a, b) => a[0] * b[0] + a[1] * b[1];
1072
+ var dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
1073
+ var dot4 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
1074
+ var dot = vop(0, (a, b) => {
1075
+ let sum = 0;
1076
+ for (let i = a.length; i-- > 0;) sum += a[i] * b[i];
1077
+ return sum;
1078
+ }, dot2, dot3, dot4);
1079
+ //#endregion
1080
+ //#region node_modules/@thi.ng/color/luminance-rgb.js
1081
+ var luminanceRgb = (rgb, weights = RGB_LUMINANCE_REC709) => dot3(rgb, weights);
1082
+ //#endregion
1083
+ //#region node_modules/@thi.ng/color/rgb/hue-rgb.js
1084
+ var hueRgb = (out, hue, alpha = 1) => {
1085
+ hue = fract(hue) * 6;
1086
+ return setC4(out || [], clamp01(Math.abs(hue - 3) - 1), clamp01(2 - Math.abs(hue - 2)), clamp01(2 - Math.abs(hue - 4)), alpha);
1087
+ };
1088
+ //#endregion
1089
+ //#region node_modules/@thi.ng/color/hcy/hcy-rgb.js
1090
+ var hcyRgb = (out, src) => {
1091
+ const h = src[0];
1092
+ let c = src[1];
1093
+ const y = src[2];
1094
+ const rgb = hueRgb(out || src, h, __ensureAlpha(src[3]));
1095
+ const lum = luminanceRgb(rgb);
1096
+ if (y < lum) c *= y / lum;
1097
+ else if (lum < 1) c *= (1 - y) / (1 - lum);
1098
+ return setC3(rgb, clamp01((rgb[0] - lum) * c + y), clamp01((rgb[1] - lum) * c + y), clamp01((rgb[2] - lum) * c + y));
1099
+ };
1100
+ //#endregion
1101
+ //#region node_modules/@thi.ng/color/hsi/hsi-rgb.js
1102
+ var hsiRgb = (out, src) => {
1103
+ out = clampH(out || src, src);
1104
+ const s = out[1];
1105
+ const i = out[2];
1106
+ if (s < 1e-6) return setC3(out, i, i, i);
1107
+ const h = out[0] * 6 % 6;
1108
+ const m = i * (1 - s);
1109
+ const z = 1 - Math.abs(h % 2 - 1);
1110
+ let c = 3 * i * s / (1 + z);
1111
+ const x = c * z + m;
1112
+ c += m;
1113
+ switch (h | 0) {
1114
+ case 0: return setC3(out, c, x, m);
1115
+ case 1: return setC3(out, x, c, m);
1116
+ case 2: return setC3(out, m, c, x);
1117
+ case 3: return setC3(out, m, x, c);
1118
+ case 4: return setC3(out, x, m, c);
1119
+ case 5: return setC3(out, c, m, x);
1120
+ default: return setC3(out, m, m, m);
1121
+ }
1122
+ };
1123
+ //#endregion
1124
+ //#region node_modules/@thi.ng/color/hsl/hsl-rgb.js
1125
+ var hslRgb = (out, src) => {
1126
+ const s = clamp01(src[1]);
1127
+ const l = clamp01(src[2]);
1128
+ out = hueRgb(out || src, src[0], __ensureAlpha(src[3]));
1129
+ const c = (1 - Math.abs(2 * l - 1)) * s;
1130
+ return setC3(out, (out[0] - .5) * c + l, (out[1] - .5) * c + l, (out[2] - .5) * c + l);
1131
+ };
1132
+ //#endregion
1133
+ //#region node_modules/@thi.ng/color/hsv/hsv-rgb.js
1134
+ var hsvRgb = (out, src) => {
1135
+ out = clampH(out || src, src);
1136
+ const s = out[1];
1137
+ const v = out[2];
1138
+ hueRgb(out, src[0], out[3]);
1139
+ return setC3(out, ((out[0] - 1) * s + 1) * v, ((out[1] - 1) * s + 1) * v, ((out[2] - 1) * s + 1) * v);
1140
+ };
1141
+ //#endregion
1142
+ //#region node_modules/@thi.ng/color/linear.js
1143
+ var linearSrgb = (x) => x <= .0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - .055;
1144
+ var srgbLinear = (x) => x <= .04045 ? x / 12.92 : Math.pow((x + .055) / 1.055, 2.4);
1145
+ //#endregion
1146
+ //#region node_modules/@thi.ng/color/srgb/srgb-rgb.js
1147
+ var srgbRgb = (out, src) => setC4(out || src, srgbLinear(src[0]), srgbLinear(src[1]), srgbLinear(src[2]), __ensureAlpha(src[3]));
1148
+ //#endregion
1149
+ //#region node_modules/@thi.ng/color/rgb/rgb-srgb.js
1150
+ var rgbSrgb = (out, src) => setC4(out || src, linearSrgb(src[0]), linearSrgb(src[1]), linearSrgb(src[2]), __ensureAlpha(src[3]));
1151
+ //#endregion
1152
+ //#region node_modules/@thi.ng/color/srgb/srgb.js
1153
+ var srgb = defColor({
1154
+ mode: "srgb",
1155
+ order: [
1156
+ "r",
1157
+ "g",
1158
+ "b",
1159
+ "alpha"
1160
+ ],
1161
+ from: {
1162
+ abgr32: (out, src) => intAbgr32Srgb(out, src[0]),
1163
+ argb32: (out, src) => intArgb32Srgb(out, src[0]),
1164
+ hcy: hcyRgb,
1165
+ hsi: hsiRgb,
1166
+ hsl: hslRgb,
1167
+ hsv: hsvRgb,
1168
+ rgb: rgbSrgb
1169
+ },
1170
+ toRgb: srgbRgb
1171
+ });
1172
+ //#endregion
1173
+ //#region lib/components/color-pickers/gradient-editor.jsx
1174
+ var getGradientResult = (input, type) => {
1175
+ if (!input || !type) return "";
1176
+ if (typeof input === "string" || !input?.stops) return "";
1177
+ let output = "";
1178
+ const { repeating } = input;
1179
+ if (repeating) output += "repeating-";
1180
+ output += `${type}-gradient(`;
1181
+ if (type === "linear") {
1182
+ const { orientation } = input;
1183
+ if (orientation?.type === "angular") output += `${orientation.value.value}${orientation.value.unit}, `;
1184
+ else if (orientation?.type === "directional") output += `to ${orientation.value}, `;
1185
+ }
1186
+ if (type === "radial") {
1187
+ const { shape, position } = input;
1188
+ output += `${shape ?? "circle"} at ${position?.x?.value ?? "center"} ${position?.y?.value ?? "center"}, `;
1189
+ }
1190
+ if (type === "conic") {
1191
+ const { angle, position } = input;
1192
+ output += `from ${angle ?? "0deg"} at ${position ?? "center"}, `;
1193
+ }
1194
+ output += input.stops.map((stop) => {
1195
+ return `${stop.color} ${stop.offset?.value ?? ""}${stop.offset?.unit ?? ""}`.trim();
1196
+ }).join(", ");
1197
+ output += ")";
1198
+ return output;
1199
+ };
1200
+ var gradientTypes = [
1201
+ {
1202
+ label: __("Linear"),
1203
+ value: "linear",
1204
+ icon: jsx("div", { className: "es:transparent es:size-4 es:rounded-full es:bg-linear-to-br es:from-current" })
1205
+ },
1206
+ {
1207
+ label: __("Radial"),
1208
+ value: "radial",
1209
+ icon: jsx("div", { className: "es:transparent es:size-4 es:rounded-full es:bg-radial es:from-current/75 es:to-current/10" })
1210
+ },
1211
+ {
1212
+ label: __("Conic"),
1213
+ value: "conic",
1214
+ icon: jsx("div", { className: "es:transparent es:size-4 es:rounded-full es:bg-conic es:from-current" })
1215
+ }
1216
+ ];
1217
+ var linearDirections = [
1218
+ {
1219
+ label: __("Right"),
1220
+ value: "right",
1221
+ iconClass: "es:bg-linear-to-r",
1222
+ valueDegrees: 90
1223
+ },
1224
+ {
1225
+ label: __("Left"),
1226
+ value: "left",
1227
+ iconClass: "es:bg-linear-to-l",
1228
+ valueDegrees: 180
1229
+ },
1230
+ {
1231
+ label: __("Top"),
1232
+ value: "top",
1233
+ iconClass: "es:bg-linear-to-t",
1234
+ valueDegrees: 270
1235
+ },
1236
+ {
1237
+ label: __("Bottom"),
1238
+ value: "bottom",
1239
+ iconClass: "es:bg-linear-to-b",
1240
+ valueDegrees: 90
1241
+ },
1242
+ {
1243
+ label: __("Top-right"),
1244
+ value: "top right",
1245
+ iconClass: "es:bg-linear-to-tr",
1246
+ valueDegrees: 45
1247
+ },
1248
+ {
1249
+ label: __("Top-left"),
1250
+ value: "top left",
1251
+ iconClass: "es:bg-linear-to-tl",
1252
+ valueDegrees: 315
1253
+ },
1254
+ {
1255
+ label: __("Bottom-right"),
1256
+ value: "bottom right",
1257
+ iconClass: "es:bg-linear-to-br",
1258
+ valueDegrees: 135
1259
+ },
1260
+ {
1261
+ label: __("Bottom-left"),
1262
+ value: "bottom left",
1263
+ iconClass: "es:bg-linear-to-bl",
1264
+ valueDegrees: 225
1265
+ }
1266
+ ];
1267
+ /**
1268
+ * A simple gradient editor.
1269
+ * Allows editing linear, radial, and conic gradients.
1270
+ *
1271
+ * @component
1272
+ * @param {Object} props - Component props.
1273
+ * @param {string} props.value - The gradient definition.
1274
+ * @param {Function} props.onChange - Function to run when the gradient changes.
1275
+ * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
1276
+ *
1277
+ * @returns {JSX.Element} The GradientEditor component.
1278
+ *
1279
+ * @example
1280
+ * <GradientEditor
1281
+ * value='linear-gradient(90deg, #000000 0%, #ffffff 100%)'
1282
+ * onChange={setGradient}
1283
+ * />
1284
+ */
1285
+ var GradientEditor = (props) => {
1286
+ const { value, onChange, hidden } = props;
1287
+ const gradientData = useMemo(() => {
1288
+ if (value?.startsWith("radial-gradient") || value?.startsWith("repeating-radial-gradient")) return K(value ?? "");
1289
+ if (value?.startsWith("conic-gradient") || value?.startsWith("repeating-conic-gradient")) return j(value ?? "");
1290
+ return P(value ?? "");
1291
+ }, [value]);
1292
+ const gradientType = useMemo(() => {
1293
+ if (typeof value === "string" && value?.startsWith("radial-gradient") || value?.startsWith("repeating-radial-gradient")) return "radial";
1294
+ if (typeof value === "string" && value?.startsWith("conic-gradient") || value?.startsWith("repeating-conic-gradient")) return "conic";
1295
+ return "linear";
1296
+ }, [value]);
1297
+ const setGradientData = (data) => {
1298
+ onChange(getGradientResult(data, gradientType));
1299
+ };
1300
+ const outputGradient = useMemo(() => getGradientResult(gradientData, gradientType), [gradientData, gradientType]);
1301
+ const [squarePreview, setSquarePreview] = useState(false);
1302
+ if (hidden) return null;
1303
+ return jsxs("div", {
1304
+ className: "es:w-full es:space-y-2.5",
1305
+ children: [
1306
+ jsx(ContainerGroup, { children: jsxs(Container, { children: [jsx("button", {
1307
+ className: clsx("es:shadow-sm, es:mx-auto es:block es:h-40 es:rounded-lg es:border es:border-secondary-300 es:transition-[width] es:duration-300 es:ease-spring-snappy", "es:mb-2", squarePreview ? "es:w-40" : "es:w-full"),
1308
+ style: { backgroundImage: outputGradient },
1309
+ onClick: () => setSquarePreview((prev) => !prev),
1310
+ "aria-label": __("Toggle preview size", "eightshift-ui-components")
1311
+ }), jsx(Slider, {
1312
+ className: "es:mb-5",
1313
+ "aria-label": __("Stop positions", "eightshift-ui-components"),
1314
+ min: 0,
1315
+ max: 100,
1316
+ step: 1,
1317
+ value: gradientData?.stops?.map(({ offset }, i) => {
1318
+ if (!offset) return i * 100 / (gradientData.stops.length - 1);
1319
+ return parseInt(offset?.value);
1320
+ }),
1321
+ onChange: (value) => {
1322
+ setGradientData({
1323
+ ...gradientData,
1324
+ stops: gradientData.stops.map((stop, i) => {
1325
+ return {
1326
+ ...stop,
1327
+ offset: {
1328
+ value: value[i],
1329
+ unit: "%"
1330
+ }
1331
+ };
1332
+ })
1333
+ });
1334
+ },
1335
+ thumbContent: (index) => {
1336
+ const colorData = srgb(gradientData.stops[index]?.color);
1337
+ let foregroundColor = "black";
1338
+ if (colorData.alpha >= .5 && isColorDark(colorData.r, colorData.g, colorData.b)) foregroundColor = "white";
1339
+ return jsx("div", {
1340
+ className: "es:pointer-events-none es:absolute es:-bottom-4.5 es:-translate-x-1/3 es:flex es:w-3 es:items-center es:justify-center es:text-center es:text-12 es:leading-none es:py-px es:rounded-sm es:font-semibold es:tabular-nums es:font-mono es:ring es:ring-accent-600",
1341
+ style: {
1342
+ backgroundColor: gradientData.stops[index]?.color,
1343
+ color: foregroundColor
1344
+ },
1345
+ children: index + 1
1346
+ });
1347
+ },
1348
+ noActiveHighlight: true,
1349
+ tooltipContent: (value) => `${Math.round(value)}%`
1350
+ })] }) }),
1351
+ jsxs(ContainerGroup, { children: [
1352
+ jsx(Container, { children: jsx(OptionSelect, {
1353
+ label: __("Type", "eightshift-ui-components"),
1354
+ value: gradientType,
1355
+ onChange: (value) => onChange(getGradientResult({ stops: gradientData.stops }, value)),
1356
+ options: gradientTypes,
1357
+ type: "toggleButtons",
1358
+ inline: true
1359
+ }) }),
1360
+ jsx(Container, {
1361
+ hidden: gradientType !== "linear",
1362
+ children: jsx(NumberPicker, {
1363
+ inline: true,
1364
+ icon: angle,
1365
+ label: __("Angle", "eightshift-ui-components"),
1366
+ min: 0,
1367
+ max: 360,
1368
+ step: 1,
1369
+ value: gradientData?.orientation?.type === "angular" ? gradientData?.orientation?.value?.value : null,
1370
+ onChange: (angle) => {
1371
+ setGradientData({
1372
+ ...gradientData,
1373
+ orientation: {
1374
+ type: "angular",
1375
+ value: {
1376
+ value: angle,
1377
+ unit: "deg"
1378
+ }
1379
+ }
1380
+ });
1381
+ },
1382
+ suffix: "°",
1383
+ size: "medium",
1384
+ className: "es:grow",
1385
+ placeholder: linearDirections.find(({ value }) => value === gradientData?.orientation?.value)?.valueDegrees ?? "",
1386
+ children: jsx(Menu, {
1387
+ triggerIcon: sliders,
1388
+ triggerProps: {
1389
+ tooltip: __("Presets", "eightshift-ui-components"),
1390
+ slot: null
1391
+ },
1392
+ keepOpen: true,
1393
+ children: linearDirections.map(({ label, value, iconClass }) => {
1394
+ return jsx(MenuItem, {
1395
+ icon: jsx("div", { className: clsx("es:size-5 es:rounded-sm es:from-secondary-700 es:to-secondary-200", iconClass) }),
1396
+ onClick: () => {
1397
+ setGradientData({
1398
+ ...gradientData,
1399
+ orientation: {
1400
+ type: "directional",
1401
+ value
1402
+ }
1403
+ });
1404
+ },
1405
+ children: label
1406
+ }, value);
1407
+ })
1408
+ })
1409
+ })
1410
+ }),
1411
+ jsx(Container, {
1412
+ hidden: gradientType !== "radial",
1413
+ children: jsx(OptionSelect, {
1414
+ label: __("Shape", "eightshift-ui-components"),
1415
+ icon: genericShapesAlt,
1416
+ inline: true,
1417
+ options: [{
1418
+ label: __("Circle", "eightshift-ui-components"),
1419
+ value: "circle"
1420
+ }, {
1421
+ label: __("Ellipse", "eightshift-ui-components"),
1422
+ value: "ellipse"
1423
+ }],
1424
+ value: gradientData.shape,
1425
+ onChange: (value) => {
1426
+ setGradientData({
1427
+ ...gradientData,
1428
+ shape: value
1429
+ });
1430
+ }
1431
+ })
1432
+ }),
1433
+ jsx(Container, {
1434
+ hidden: gradientType !== "radial",
1435
+ children: jsx(MatrixAlign, {
1436
+ icon: centerPoint,
1437
+ label: __("Center point", "eightshift-ui-components"),
1438
+ value: `${gradientData?.position?.y?.value ?? "center"} ${gradientData?.position?.x?.value ?? "center"}`,
1439
+ onChange: (position) => {
1440
+ const [x, y] = position.split(" ");
1441
+ setGradientData({
1442
+ ...gradientData,
1443
+ position: {
1444
+ x: {
1445
+ type: "keyword",
1446
+ value: x
1447
+ },
1448
+ y: {
1449
+ type: "keyword",
1450
+ value: y
1451
+ }
1452
+ }
1453
+ });
1454
+ }
1455
+ })
1456
+ }),
1457
+ jsx(Container, {
1458
+ hidden: gradientType !== "conic",
1459
+ children: jsx(NumberPicker, {
1460
+ inline: true,
1461
+ icon: angle,
1462
+ label: __("Angle", "eightshift-ui-components"),
1463
+ min: 0,
1464
+ max: 360,
1465
+ step: 1,
1466
+ value: parseInt(gradientData?.angle?.replace("deg", "")),
1467
+ onChange: (value) => {
1468
+ setGradientData({
1469
+ ...gradientData,
1470
+ angle: `${value}deg`
1471
+ });
1472
+ },
1473
+ size: "medium",
1474
+ suffix: "°"
1475
+ })
1476
+ }),
1477
+ jsx(Container, {
1478
+ hidden: gradientType !== "conic",
1479
+ children: jsx(MatrixAlign, {
1480
+ icon: centerPoint,
1481
+ label: __("Center point", "eightshift-ui-components"),
1482
+ value: `${gradientData?.position?.y?.value ?? "center"} ${gradientData?.position?.x?.value ?? "center"}`,
1483
+ onChange: (value) => {
1484
+ setGradientData({
1485
+ ...gradientData,
1486
+ position: value
1487
+ });
1488
+ }
1489
+ })
1490
+ }),
1491
+ jsx(Container, { children: jsx(Toggle, {
1492
+ checked: gradientData.repeating,
1493
+ onChange: (value) => {
1494
+ setGradientData({
1495
+ ...gradientData,
1496
+ repeating: value
1497
+ });
1498
+ },
1499
+ label: __("Repeating", "eightshift-ui-components"),
1500
+ icon: gradientRepeat
1501
+ }) })
1502
+ ] }),
1503
+ jsx(BaseControl, {
1504
+ icon: gradientStop,
1505
+ label: __("Gradient stops", "eightshift-ui-components"),
1506
+ inline: true,
1507
+ children: jsx(Button, {
1508
+ icon: add,
1509
+ size: "small",
1510
+ onPress: () => {
1511
+ setGradientData({
1512
+ ...gradientData,
1513
+ stops: [...gradientData.stops, { color: "#000000FF" }]
1514
+ });
1515
+ },
1516
+ type: "simple",
1517
+ "aria-label": __("Add stop", "eightshift-ui-components")
1518
+ })
1519
+ }),
1520
+ jsx(ContainerGroup, { children: jsx(DraggableList, {
1521
+ items: gradientData?.stops,
1522
+ onChange: (items) => {
1523
+ setGradientData({
1524
+ ...gradientData,
1525
+ stops: items.map(({ color }, i) => ({
1526
+ ...gradientData.stops[i] ?? {},
1527
+ color
1528
+ }))
1529
+ });
1530
+ },
1531
+ orientation: "vertical",
1532
+ className: "es:contents",
1533
+ children: (item) => {
1534
+ const { color, updateData, itemIndex } = item;
1535
+ return jsx(DraggableListItem, {
1536
+ label: sprintf(__("Stop %s", "eightshift-ui-components"), itemIndex + 1),
1537
+ subtitle: color,
1538
+ icon: jsx(TriggeredPopover, {
1539
+ triggerButtonIcon: jsx($251c695a52d94a8d$export$cae13e90592f246a, {
1540
+ className: "es:size-5.5 es:rounded-full es:border es:border-white es:ring-1 es:ring-black",
1541
+ color
1542
+ }),
1543
+ triggerButtonProps: {
1544
+ size: "small",
1545
+ type: "ghost",
1546
+ className: "es:p-0!"
1547
+ },
1548
+ className: "es:p-2.5",
1549
+ children: jsx(SolidColorPicker, {
1550
+ value: color,
1551
+ onChange: (color) => {
1552
+ updateData({ color });
1553
+ },
1554
+ allowTransparency: true,
1555
+ outputFormat: "rgba"
1556
+ })
1557
+ }),
1558
+ children: jsx(ButtonGroup, { children: jsx(Button, {
1559
+ onPress: () => {
1560
+ setGradientData({
1561
+ ...gradientData,
1562
+ stops: gradientData.stops.filter((_, i) => i !== itemIndex)
1563
+ });
1564
+ },
1565
+ icon: trash,
1566
+ size: "small",
1567
+ "aria-label": __("Delete stop", "eightshift-ui-components"),
1568
+ disabled: gradientData.stops.length <= 2,
1569
+ type: "dangerGhost"
1570
+ }) })
1571
+ });
1572
+ }
1573
+ }) })
1574
+ ]
1575
+ });
1576
+ };
1577
+ //#endregion
1578
+ export { GradientEditor as t };