@cccsaurora/clue-ui 1.2.3-dev.266 → 1.2.3

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 (183) hide show
  1. package/ActionForm-DlOXqMUx.js +4460 -0
  2. package/AnnotationDetails-Bk-p0F6h.js +160 -0
  3. package/AnnotationPreview-jzZvkCxJ.js +140 -0
  4. package/ClueEnrichContext-KqRuuWNS.js +418 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_MapCache-BiTi0iqu.js +180 -0
  7. package/_Uint8Array-BQNOM9Rr.js +101 -0
  8. package/_baseAssignValue-CNMLQZco.js +20 -0
  9. package/_baseClone-BnT-6pyM.js +207 -0
  10. package/_baseExtremum-Ca2EHgy2.js +16 -0
  11. package/_baseFlatten-Bfr_Molw.js +72 -0
  12. package/_baseGet-DSZygzyq.js +79 -0
  13. package/_baseIsEqual-VgvaAFZG.js +147 -0
  14. package/_baseIteratee-Dbfsw5z8.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-BJcj69PL.js +79 -0
  18. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  19. package/_createAggregator-k3TuAnxT.js +53 -0
  20. package/_getPrototype-Cr1Mk7BC.js +5 -0
  21. package/_getTag-CK2Sffaq.js +90 -0
  22. package/_isIterateeCall-DkJP7Rbx.js +13 -0
  23. package/_setToArray-C7yMOeww.js +29 -0
  24. package/cloneDeep-CF8TtLHr.js +8 -0
  25. package/components/AnnotationBody.js +35 -49
  26. package/components/AnnotationDetailPopover.js +30 -36
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +23 -44
  31. package/components/CountBadge.js +26 -31
  32. package/components/EnrichedCard.js +97 -110
  33. package/components/EnrichedChip.js +105 -130
  34. package/components/EnrichedTypography.js +107 -133
  35. package/components/ErrorBoundary.js +24 -28
  36. package/components/RetryFailedEnrichments.js +9 -10
  37. package/components/SourcePicker.js +49 -57
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +59 -75
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +23 -39
  42. package/components/actions/formats/FileResult.js +59 -86
  43. package/components/actions/formats/index.js +10 -21
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +91 -111
  46. package/components/display/graph/elements/NodeTag.js +13 -15
  47. package/components/display/graph/index.js +202 -261
  48. package/components/display/graph/visualizations/Leaf.js +69 -88
  49. package/components/display/graph/visualizations/cloud/index.js +81 -98
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +13 -14
  57. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  58. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +306 -408
  61. package/components/display/icons/Iconified.js +12 -27
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +5770 -8678
  64. package/components/enrichment/EnrichPopover.js +46 -54
  65. package/components/fetchers/Fetcher.js +119 -158
  66. package/components/fetchers/PreviewModal.js +17 -20
  67. package/components/fetchers/StatusChip.js +17 -21
  68. package/components/group/Entry.js +11 -13
  69. package/components/group/Group.js +10 -13
  70. package/components/group/GroupControl.js +65 -76
  71. package/components/stats/QueryStatus.js +33 -43
  72. package/countBy-CdYegFSu.js +8 -0
  73. package/data/event.js +4 -6
  74. package/database/index.js +2 -2
  75. package/debounce-DryYcbJ4.js +56 -0
  76. package/get-CH7kz5Ix.js +8 -0
  77. package/groupBy-br8xmD2R.js +8 -0
  78. package/hooks/ClueActionContext.js +6 -6
  79. package/hooks/ClueComponentContext.js +23 -29
  80. package/hooks/ClueConfigProvider.js +12 -14
  81. package/hooks/ClueDatabaseContext.js +13 -19
  82. package/hooks/ClueEnrichContext.js +8 -8
  83. package/hooks/ClueFetcherContext.js +56 -83
  84. package/hooks/ClueGroupContext.js +14 -17
  85. package/hooks/CluePopupContext.js +5 -5
  86. package/hooks/ClueProvider.js +10 -12
  87. package/hooks/selectors.js +7 -7
  88. package/hooks/useActionResult.js +2 -2
  89. package/hooks/useAnnotations.js +31 -47
  90. package/hooks/useClue.js +4 -6
  91. package/hooks/useClueActions.js +3 -3
  92. package/hooks/useClueConfig.js +4 -6
  93. package/hooks/useClueTypeConfig.js +3 -3
  94. package/hooks/useComparator.js +435 -722
  95. package/hooks/useErrors.js +18 -22
  96. package/hooks/useFetcherResult.js +24 -33
  97. package/hooks/useMyHighlights.js +36 -66
  98. package/hooks/useMyLocalStorage.js +37 -66
  99. package/iconify-BBckr5AQ.js +1263 -0
  100. package/icons/Action.js +49 -66
  101. package/icons/Assessment.js +69 -85
  102. package/icons/Context.js +63 -77
  103. package/icons/Opinion.js +60 -76
  104. package/icons/iconMap.js +2 -2
  105. package/identity-ByMq8VxU.js +6 -0
  106. package/index-BHAe_V9n.js +12768 -0
  107. package/index-BK-zfYhR.js +358 -0
  108. package/index-CA5CUNZO.js +975 -0
  109. package/index-Dj5C04IX.js +568 -0
  110. package/index-p5_wX7q1.js +11729 -0
  111. package/isNil-CjWwlQS3.js +6 -0
  112. package/isObject-B53jY8Qg.js +7 -0
  113. package/isObjectLike-BatpeCIi.js +29 -0
  114. package/isSymbol-C3_SC0Qp.js +8 -0
  115. package/last-7CdUxN0r.js +7 -0
  116. package/main.js +60 -60
  117. package/maxBy-Bc0dYHcO.js +8 -0
  118. package/package.json +1 -1
  119. package/sortBy-DY2JBf9n.js +75 -0
  120. package/sumBy-DuMASLPd.js +8 -0
  121. package/text/Frequency.js +23 -42
  122. package/toFinite-BMy6GObD.js +14 -0
  123. package/toNumber-YVhnnJv4.js +31 -0
  124. package/useClueTypeConfig-Ct9Ygter.js +2292 -0
  125. package/utils/chain.js +65 -92
  126. package/utils/classificationParser.js +256 -519
  127. package/utils/constants.js +10 -35
  128. package/utils/graph.js +45 -72
  129. package/utils/hashUtil.js +7 -7
  130. package/utils/line.js +81 -131
  131. package/utils/loggerUtil.js +3 -5
  132. package/utils/sessionStorage.js +27 -41
  133. package/utils/time.js +423 -423
  134. package/utils/utils.js +9 -9
  135. package/utils/window.js +10 -21
  136. package/utils-DmwSUrum.js +129 -0
  137. package/ActionForm-uDp92tN2.js +0 -5941
  138. package/AnnotationDetails-DGYfOiWm.js +0 -175
  139. package/AnnotationPreview-bHObsb3P.js +0 -188
  140. package/ClueEnrichContext-CJEJxrgs.js +0 -541
  141. package/FlexOne-BSYAhhtG.js +0 -9
  142. package/_MapCache-WmuDdwuH.js +0 -222
  143. package/_Uint8Array-B7JqpgFX.js +0 -128
  144. package/_baseAssignValue-CGTuELqU.js +0 -25
  145. package/_baseClone-CkNrTyhm.js +0 -283
  146. package/_baseExtremum-kob8QXyt.js +0 -18
  147. package/_baseFlatten-jIR_sN_-.js +0 -92
  148. package/_baseGet-Bx3A4Qfp.js +0 -108
  149. package/_baseIsEqual-C5OTWzTk.js +0 -208
  150. package/_baseIteratee-avi7MX2o.js +0 -126
  151. package/_baseSlice-GAv_YFTT.js +0 -20
  152. package/_baseSum-D0WC1dN0.js +0 -13
  153. package/_baseUniq-BI9GIHMF.js +0 -115
  154. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  155. package/_createAggregator-QD8MzKwe.js +0 -63
  156. package/_getPrototype-CU0j_POw.js +0 -5
  157. package/_getTag-Ckxxfr88.js +0 -126
  158. package/_isIterateeCall-Ds3sw2SF.js +0 -17
  159. package/_setToArray-CaPKQhcz.js +0 -33
  160. package/cloneDeep-DJrLSw8W.js +0 -8
  161. package/countBy-c6S3dvSW.js +0 -14
  162. package/debounce-bV0h5FC5.js +0 -92
  163. package/get-DSsNkRQs.js +0 -8
  164. package/groupBy-xqz-n0Vd.js +0 -14
  165. package/iconify-CXMreGTg.js +0 -1782
  166. package/identity-CPGTqrE4.js +0 -6
  167. package/index-AMfoEg_6.js +0 -696
  168. package/index-B6C2a_Lg.js +0 -1172
  169. package/index-C12gPw2W.js +0 -17698
  170. package/index-DCKkHTvx.js +0 -15750
  171. package/index-JcKyZeoY.js +0 -465
  172. package/isNil-CIubwp4T.js +0 -6
  173. package/isObject-FTY-5JQX.js +0 -7
  174. package/isObjectLike-OAgjjZye.js +0 -48
  175. package/isSymbol-Xd2FsJyp.js +0 -8
  176. package/last-CUCl67Im.js +0 -7
  177. package/maxBy-IKHzFrCS.js +0 -8
  178. package/sortBy-DfSj8IoJ.js +0 -96
  179. package/sumBy-D-hb_NY-.js +0 -8
  180. package/toFinite-Bc55msYj.js +0 -16
  181. package/toNumber-DPxy1FBy.js +0 -39
  182. package/useClueTypeConfig-Z1LFp01b.js +0 -3289
  183. package/utils-HmNPuoDB.js +0 -199
@@ -1,116 +1,92 @@
1
- import { useTheme } from "@mui/material";
2
- import { g as get } from "../get-DSsNkRQs.js";
3
- import { i as isNil } from "../isNil-CIubwp4T.js";
4
- function _typeof(obj) {
1
+ import { useTheme as z } from "@mui/material";
2
+ import { g as w } from "../get-CH7kz5Ix.js";
3
+ import { i as B } from "../isNil-CjWwlQS3.js";
4
+ function x(t) {
5
5
  "@babel/helpers - typeof";
6
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
7
- return typeof obj2;
8
- } : function(obj2) {
9
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
10
- }, _typeof(obj);
11
- }
12
- var trimLeft = /^\s+/;
13
- var trimRight = /\s+$/;
14
- function tinycolor(color, opts) {
15
- color = color ? color : "";
16
- opts = opts || {};
17
- if (color instanceof tinycolor) {
18
- return color;
19
- }
20
- if (!(this instanceof tinycolor)) {
21
- return new tinycolor(color, opts);
22
- }
23
- var rgb = inputToRGB(color);
24
- this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
25
- this._gradientType = opts.gradientType;
26
- if (this._r < 1) this._r = Math.round(this._r);
27
- if (this._g < 1) this._g = Math.round(this._g);
28
- if (this._b < 1) this._b = Math.round(this._b);
29
- this._ok = rgb.ok;
30
- }
31
- tinycolor.prototype = {
32
- isDark: function isDark() {
6
+ return x = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
7
+ return typeof r;
8
+ } : function(r) {
9
+ return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
10
+ }, x(t);
11
+ }
12
+ var L = /^\s+/, G = /\s+$/;
13
+ function s(t, r) {
14
+ if (t = t || "", r = r || {}, t instanceof s)
15
+ return t;
16
+ if (!(this instanceof s))
17
+ return new s(t, r);
18
+ var e = O(t);
19
+ this._originalInput = t, this._r = e.r, this._g = e.g, this._b = e.b, this._a = e.a, this._roundA = Math.round(100 * this._a) / 100, this._format = r.format || e.format, this._gradientType = r.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = e.ok;
20
+ }
21
+ s.prototype = {
22
+ isDark: function() {
33
23
  return this.getBrightness() < 128;
34
24
  },
35
- isLight: function isLight() {
25
+ isLight: function() {
36
26
  return !this.isDark();
37
27
  },
38
- isValid: function isValid() {
28
+ isValid: function() {
39
29
  return this._ok;
40
30
  },
41
- getOriginalInput: function getOriginalInput() {
31
+ getOriginalInput: function() {
42
32
  return this._originalInput;
43
33
  },
44
- getFormat: function getFormat() {
34
+ getFormat: function() {
45
35
  return this._format;
46
36
  },
47
- getAlpha: function getAlpha() {
37
+ getAlpha: function() {
48
38
  return this._a;
49
39
  },
50
- getBrightness: function getBrightness() {
51
- var rgb = this.toRgb();
52
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
40
+ getBrightness: function() {
41
+ var r = this.toRgb();
42
+ return (r.r * 299 + r.g * 587 + r.b * 114) / 1e3;
53
43
  },
54
- getLuminance: function getLuminance() {
55
- var rgb = this.toRgb();
56
- var RsRGB, GsRGB, BsRGB, R, G, B;
57
- RsRGB = rgb.r / 255;
58
- GsRGB = rgb.g / 255;
59
- BsRGB = rgb.b / 255;
60
- if (RsRGB <= 0.03928) R = RsRGB / 12.92;
61
- else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
62
- if (GsRGB <= 0.03928) G = GsRGB / 12.92;
63
- else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
64
- if (BsRGB <= 0.03928) B = BsRGB / 12.92;
65
- else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
66
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
44
+ getLuminance: function() {
45
+ var r = this.toRgb(), e, n, i, a, f, u;
46
+ return e = r.r / 255, n = r.g / 255, i = r.b / 255, e <= 0.03928 ? a = e / 12.92 : a = Math.pow((e + 0.055) / 1.055, 2.4), n <= 0.03928 ? f = n / 12.92 : f = Math.pow((n + 0.055) / 1.055, 2.4), i <= 0.03928 ? u = i / 12.92 : u = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * f + 0.0722 * u;
67
47
  },
68
- setAlpha: function setAlpha(value) {
69
- this._a = boundAlpha(value);
70
- this._roundA = Math.round(100 * this._a) / 100;
71
- return this;
48
+ setAlpha: function(r) {
49
+ return this._a = N(r), this._roundA = Math.round(100 * this._a) / 100, this;
72
50
  },
73
- toHsv: function toHsv() {
74
- var hsv = rgbToHsv(this._r, this._g, this._b);
51
+ toHsv: function() {
52
+ var r = R(this._r, this._g, this._b);
75
53
  return {
76
- h: hsv.h * 360,
77
- s: hsv.s,
78
- v: hsv.v,
54
+ h: r.h * 360,
55
+ s: r.s,
56
+ v: r.v,
79
57
  a: this._a
80
58
  };
81
59
  },
82
- toHsvString: function toHsvString() {
83
- var hsv = rgbToHsv(this._r, this._g, this._b);
84
- var h = Math.round(hsv.h * 360), s = Math.round(hsv.s * 100), v = Math.round(hsv.v * 100);
85
- return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
60
+ toHsvString: function() {
61
+ var r = R(this._r, this._g, this._b), e = Math.round(r.h * 360), n = Math.round(r.s * 100), i = Math.round(r.v * 100);
62
+ return this._a == 1 ? "hsv(" + e + ", " + n + "%, " + i + "%)" : "hsva(" + e + ", " + n + "%, " + i + "%, " + this._roundA + ")";
86
63
  },
87
- toHsl: function toHsl() {
88
- var hsl = rgbToHsl(this._r, this._g, this._b);
64
+ toHsl: function() {
65
+ var r = H(this._r, this._g, this._b);
89
66
  return {
90
- h: hsl.h * 360,
91
- s: hsl.s,
92
- l: hsl.l,
67
+ h: r.h * 360,
68
+ s: r.s,
69
+ l: r.l,
93
70
  a: this._a
94
71
  };
95
72
  },
96
- toHslString: function toHslString() {
97
- var hsl = rgbToHsl(this._r, this._g, this._b);
98
- var h = Math.round(hsl.h * 360), s = Math.round(hsl.s * 100), l = Math.round(hsl.l * 100);
99
- return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
73
+ toHslString: function() {
74
+ var r = H(this._r, this._g, this._b), e = Math.round(r.h * 360), n = Math.round(r.s * 100), i = Math.round(r.l * 100);
75
+ return this._a == 1 ? "hsl(" + e + ", " + n + "%, " + i + "%)" : "hsla(" + e + ", " + n + "%, " + i + "%, " + this._roundA + ")";
100
76
  },
101
- toHex: function toHex(allow3Char) {
102
- return rgbToHex(this._r, this._g, this._b, allow3Char);
77
+ toHex: function(r) {
78
+ return F(this._r, this._g, this._b, r);
103
79
  },
104
- toHexString: function toHexString(allow3Char) {
105
- return "#" + this.toHex(allow3Char);
80
+ toHexString: function(r) {
81
+ return "#" + this.toHex(r);
106
82
  },
107
- toHex8: function toHex8(allow4Char) {
108
- return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
83
+ toHex8: function(r) {
84
+ return U(this._r, this._g, this._b, this._a, r);
109
85
  },
110
- toHex8String: function toHex8String(allow4Char) {
111
- return "#" + this.toHex8(allow4Char);
86
+ toHex8String: function(r) {
87
+ return "#" + this.toHex8(r);
112
88
  },
113
- toRgb: function toRgb() {
89
+ toRgb: function() {
114
90
  return {
115
91
  r: Math.round(this._r),
116
92
  g: Math.round(this._g),
@@ -118,507 +94,339 @@ tinycolor.prototype = {
118
94
  a: this._a
119
95
  };
120
96
  },
121
- toRgbString: function toRgbString() {
97
+ toRgbString: function() {
122
98
  return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
123
99
  },
124
- toPercentageRgb: function toPercentageRgb() {
100
+ toPercentageRgb: function() {
125
101
  return {
126
- r: Math.round(bound01(this._r, 255) * 100) + "%",
127
- g: Math.round(bound01(this._g, 255) * 100) + "%",
128
- b: Math.round(bound01(this._b, 255) * 100) + "%",
102
+ r: Math.round(g(this._r, 255) * 100) + "%",
103
+ g: Math.round(g(this._g, 255) * 100) + "%",
104
+ b: Math.round(g(this._b, 255) * 100) + "%",
129
105
  a: this._a
130
106
  };
131
107
  },
132
- toPercentageRgbString: function toPercentageRgbString() {
133
- return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
108
+ toPercentageRgbString: function() {
109
+ return this._a == 1 ? "rgb(" + Math.round(g(this._r, 255) * 100) + "%, " + Math.round(g(this._g, 255) * 100) + "%, " + Math.round(g(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(g(this._r, 255) * 100) + "%, " + Math.round(g(this._g, 255) * 100) + "%, " + Math.round(g(this._b, 255) * 100) + "%, " + this._roundA + ")";
134
110
  },
135
- toName: function toName() {
136
- if (this._a === 0) {
137
- return "transparent";
138
- }
139
- if (this._a < 1) {
140
- return false;
141
- }
142
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
111
+ toName: function() {
112
+ return this._a === 0 ? "transparent" : this._a < 1 ? !1 : rt[F(this._r, this._g, this._b, !0)] || !1;
143
113
  },
144
- toFilter: function toFilter(secondColor) {
145
- var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
146
- var secondHex8String = hex8String;
147
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
148
- if (secondColor) {
149
- var s = tinycolor(secondColor);
150
- secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
114
+ toFilter: function(r) {
115
+ var e = "#" + C(this._r, this._g, this._b, this._a), n = e, i = this._gradientType ? "GradientType = 1, " : "";
116
+ if (r) {
117
+ var a = s(r);
118
+ n = "#" + C(a._r, a._g, a._b, a._a);
151
119
  }
152
- return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
120
+ return "progid:DXImageTransform.Microsoft.gradient(" + i + "startColorstr=" + e + ",endColorstr=" + n + ")";
153
121
  },
154
- toString: function toString(format) {
155
- var formatSet = !!format;
156
- format = format || this._format;
157
- var formattedString = false;
158
- var hasAlpha = this._a < 1 && this._a >= 0;
159
- var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
160
- if (needsAlphaFormat) {
161
- if (format === "name" && this._a === 0) {
162
- return this.toName();
163
- }
164
- return this.toRgbString();
165
- }
166
- if (format === "rgb") {
167
- formattedString = this.toRgbString();
168
- }
169
- if (format === "prgb") {
170
- formattedString = this.toPercentageRgbString();
171
- }
172
- if (format === "hex" || format === "hex6") {
173
- formattedString = this.toHexString();
174
- }
175
- if (format === "hex3") {
176
- formattedString = this.toHexString(true);
177
- }
178
- if (format === "hex4") {
179
- formattedString = this.toHex8String(true);
180
- }
181
- if (format === "hex8") {
182
- formattedString = this.toHex8String();
183
- }
184
- if (format === "name") {
185
- formattedString = this.toName();
186
- }
187
- if (format === "hsl") {
188
- formattedString = this.toHslString();
189
- }
190
- if (format === "hsv") {
191
- formattedString = this.toHsvString();
192
- }
193
- return formattedString || this.toHexString();
122
+ toString: function(r) {
123
+ var e = !!r;
124
+ r = r || this._format;
125
+ var n = !1, i = this._a < 1 && this._a >= 0, a = !e && i && (r === "hex" || r === "hex6" || r === "hex3" || r === "hex4" || r === "hex8" || r === "name");
126
+ return a ? r === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (r === "rgb" && (n = this.toRgbString()), r === "prgb" && (n = this.toPercentageRgbString()), (r === "hex" || r === "hex6") && (n = this.toHexString()), r === "hex3" && (n = this.toHexString(!0)), r === "hex4" && (n = this.toHex8String(!0)), r === "hex8" && (n = this.toHex8String()), r === "name" && (n = this.toName()), r === "hsl" && (n = this.toHslString()), r === "hsv" && (n = this.toHsvString()), n || this.toHexString());
194
127
  },
195
- clone: function clone() {
196
- return tinycolor(this.toString());
128
+ clone: function() {
129
+ return s(this.toString());
197
130
  },
198
- _applyModification: function _applyModification(fn, args) {
199
- var color = fn.apply(null, [this].concat([].slice.call(args)));
200
- this._r = color._r;
201
- this._g = color._g;
202
- this._b = color._b;
203
- this.setAlpha(color._a);
204
- return this;
131
+ _applyModification: function(r, e) {
132
+ var n = r.apply(null, [this].concat([].slice.call(e)));
133
+ return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
205
134
  },
206
- lighten: function lighten() {
207
- return this._applyModification(_lighten, arguments);
135
+ lighten: function() {
136
+ return this._applyModification(X, arguments);
208
137
  },
209
- brighten: function brighten() {
210
- return this._applyModification(_brighten, arguments);
138
+ brighten: function() {
139
+ return this._applyModification(Z, arguments);
211
140
  },
212
- darken: function darken() {
213
- return this._applyModification(_darken, arguments);
141
+ darken: function() {
142
+ return this._applyModification(J, arguments);
214
143
  },
215
- desaturate: function desaturate() {
216
- return this._applyModification(_desaturate, arguments);
144
+ desaturate: function() {
145
+ return this._applyModification($, arguments);
217
146
  },
218
- saturate: function saturate() {
219
- return this._applyModification(_saturate, arguments);
147
+ saturate: function() {
148
+ return this._applyModification(j, arguments);
220
149
  },
221
- greyscale: function greyscale() {
222
- return this._applyModification(_greyscale, arguments);
150
+ greyscale: function() {
151
+ return this._applyModification(W, arguments);
223
152
  },
224
- spin: function spin() {
225
- return this._applyModification(_spin, arguments);
153
+ spin: function() {
154
+ return this._applyModification(K, arguments);
226
155
  },
227
- _applyCombination: function _applyCombination(fn, args) {
228
- return fn.apply(null, [this].concat([].slice.call(args)));
156
+ _applyCombination: function(r, e) {
157
+ return r.apply(null, [this].concat([].slice.call(e)));
229
158
  },
230
- analogous: function analogous() {
231
- return this._applyCombination(_analogous, arguments);
159
+ analogous: function() {
160
+ return this._applyCombination(tt, arguments);
232
161
  },
233
- complement: function complement() {
234
- return this._applyCombination(_complement, arguments);
162
+ complement: function() {
163
+ return this._applyCombination(Q, arguments);
235
164
  },
236
- monochromatic: function monochromatic() {
237
- return this._applyCombination(_monochromatic, arguments);
165
+ monochromatic: function() {
166
+ return this._applyCombination(et, arguments);
238
167
  },
239
- splitcomplement: function splitcomplement() {
240
- return this._applyCombination(_splitcomplement, arguments);
168
+ splitcomplement: function() {
169
+ return this._applyCombination(Y, arguments);
241
170
  },
242
171
  // Disabled until https://github.com/bgrins/TinyColor/issues/254
243
172
  // polyad: function (number) {
244
173
  // return this._applyCombination(polyad, [number]);
245
174
  // },
246
- triad: function triad() {
247
- return this._applyCombination(polyad, [3]);
175
+ triad: function() {
176
+ return this._applyCombination(T, [3]);
248
177
  },
249
- tetrad: function tetrad() {
250
- return this._applyCombination(polyad, [4]);
178
+ tetrad: function() {
179
+ return this._applyCombination(T, [4]);
251
180
  }
252
181
  };
253
- tinycolor.fromRatio = function(color, opts) {
254
- if (_typeof(color) == "object") {
255
- var newColor = {};
256
- for (var i in color) {
257
- if (color.hasOwnProperty(i)) {
258
- if (i === "a") {
259
- newColor[i] = color[i];
260
- } else {
261
- newColor[i] = convertToPercentage(color[i]);
262
- }
263
- }
264
- }
265
- color = newColor;
266
- }
267
- return tinycolor(color, opts);
182
+ s.fromRatio = function(t, r) {
183
+ if (x(t) == "object") {
184
+ var e = {};
185
+ for (var n in t)
186
+ t.hasOwnProperty(n) && (n === "a" ? e[n] = t[n] : e[n] = M(t[n]));
187
+ t = e;
188
+ }
189
+ return s(t, r);
268
190
  };
269
- function inputToRGB(color) {
270
- var rgb = {
191
+ function O(t) {
192
+ var r = {
271
193
  r: 0,
272
194
  g: 0,
273
195
  b: 0
274
- };
275
- var a = 1;
276
- var s = null;
277
- var v = null;
278
- var l = null;
279
- var ok = false;
280
- var format = false;
281
- if (typeof color == "string") {
282
- color = stringInputToObject(color);
283
- }
284
- if (_typeof(color) == "object") {
285
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
286
- rgb = rgbToRgb(color.r, color.g, color.b);
287
- ok = true;
288
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
289
- } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
290
- s = convertToPercentage(color.s);
291
- v = convertToPercentage(color.v);
292
- rgb = hsvToRgb(color.h, s, v);
293
- ok = true;
294
- format = "hsv";
295
- } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
296
- s = convertToPercentage(color.s);
297
- l = convertToPercentage(color.l);
298
- rgb = hslToRgb(color.h, s, l);
299
- ok = true;
300
- format = "hsl";
301
- }
302
- if (color.hasOwnProperty("a")) {
303
- a = color.a;
304
- }
305
- }
306
- a = boundAlpha(a);
307
- return {
308
- ok,
309
- format: color.format || format,
310
- r: Math.min(255, Math.max(rgb.r, 0)),
311
- g: Math.min(255, Math.max(rgb.g, 0)),
312
- b: Math.min(255, Math.max(rgb.b, 0)),
313
- a
196
+ }, e = 1, n = null, i = null, a = null, f = !1, u = !1;
197
+ return typeof t == "string" && (t = st(t)), x(t) == "object" && (_(t.r) && _(t.g) && _(t.b) ? (r = V(t.r, t.g, t.b), f = !0, u = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : _(t.h) && _(t.s) && _(t.v) ? (n = M(t.s), i = M(t.v), r = D(t.h, n, i), f = !0, u = "hsv") : _(t.h) && _(t.s) && _(t.l) && (n = M(t.s), a = M(t.l), r = q(t.h, n, a), f = !0, u = "hsl"), t.hasOwnProperty("a") && (e = t.a)), e = N(e), {
198
+ ok: f,
199
+ format: t.format || u,
200
+ r: Math.min(255, Math.max(r.r, 0)),
201
+ g: Math.min(255, Math.max(r.g, 0)),
202
+ b: Math.min(255, Math.max(r.b, 0)),
203
+ a: e
314
204
  };
315
205
  }
316
- function rgbToRgb(r, g, b) {
206
+ function V(t, r, e) {
317
207
  return {
318
- r: bound01(r, 255) * 255,
319
- g: bound01(g, 255) * 255,
320
- b: bound01(b, 255) * 255
208
+ r: g(t, 255) * 255,
209
+ g: g(r, 255) * 255,
210
+ b: g(e, 255) * 255
321
211
  };
322
212
  }
323
- function rgbToHsl(r, g, b) {
324
- r = bound01(r, 255);
325
- g = bound01(g, 255);
326
- b = bound01(b, 255);
327
- var max = Math.max(r, g, b), min = Math.min(r, g, b);
328
- var h, s, l = (max + min) / 2;
329
- if (max == min) {
330
- h = s = 0;
331
- } else {
332
- var d = max - min;
333
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
334
- switch (max) {
335
- case r:
336
- h = (g - b) / d + (g < b ? 6 : 0);
213
+ function H(t, r, e) {
214
+ t = g(t, 255), r = g(r, 255), e = g(e, 255);
215
+ var n = Math.max(t, r, e), i = Math.min(t, r, e), a, f, u = (n + i) / 2;
216
+ if (n == i)
217
+ a = f = 0;
218
+ else {
219
+ var l = n - i;
220
+ switch (f = u > 0.5 ? l / (2 - n - i) : l / (n + i), n) {
221
+ case t:
222
+ a = (r - e) / l + (r < e ? 6 : 0);
337
223
  break;
338
- case g:
339
- h = (b - r) / d + 2;
224
+ case r:
225
+ a = (e - t) / l + 2;
340
226
  break;
341
- case b:
342
- h = (r - g) / d + 4;
227
+ case e:
228
+ a = (t - r) / l + 4;
343
229
  break;
344
230
  }
345
- h /= 6;
231
+ a /= 6;
346
232
  }
347
233
  return {
348
- h,
349
- s,
350
- l
234
+ h: a,
235
+ s: f,
236
+ l: u
351
237
  };
352
238
  }
353
- function hslToRgb(h, s, l) {
354
- var r, g, b;
355
- h = bound01(h, 360);
356
- s = bound01(s, 100);
357
- l = bound01(l, 100);
358
- function hue2rgb(p2, q2, t) {
359
- if (t < 0) t += 1;
360
- if (t > 1) t -= 1;
361
- if (t < 1 / 6) return p2 + (q2 - p2) * 6 * t;
362
- if (t < 1 / 2) return q2;
363
- if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
364
- return p2;
239
+ function q(t, r, e) {
240
+ var n, i, a;
241
+ t = g(t, 360), r = g(r, 100), e = g(e, 100);
242
+ function f(h, c, o) {
243
+ return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? h + (c - h) * 6 * o : o < 1 / 2 ? c : o < 2 / 3 ? h + (c - h) * (2 / 3 - o) * 6 : h;
365
244
  }
366
- if (s === 0) {
367
- r = g = b = l;
368
- } else {
369
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
370
- var p = 2 * l - q;
371
- r = hue2rgb(p, q, h + 1 / 3);
372
- g = hue2rgb(p, q, h);
373
- b = hue2rgb(p, q, h - 1 / 3);
245
+ if (r === 0)
246
+ n = i = a = e;
247
+ else {
248
+ var u = e < 0.5 ? e * (1 + r) : e + r - e * r, l = 2 * e - u;
249
+ n = f(l, u, t + 1 / 3), i = f(l, u, t), a = f(l, u, t - 1 / 3);
374
250
  }
375
251
  return {
376
- r: r * 255,
377
- g: g * 255,
378
- b: b * 255
252
+ r: n * 255,
253
+ g: i * 255,
254
+ b: a * 255
379
255
  };
380
256
  }
381
- function rgbToHsv(r, g, b) {
382
- r = bound01(r, 255);
383
- g = bound01(g, 255);
384
- b = bound01(b, 255);
385
- var max = Math.max(r, g, b), min = Math.min(r, g, b);
386
- var h, s, v = max;
387
- var d = max - min;
388
- s = max === 0 ? 0 : d / max;
389
- if (max == min) {
390
- h = 0;
391
- } else {
392
- switch (max) {
393
- case r:
394
- h = (g - b) / d + (g < b ? 6 : 0);
257
+ function R(t, r, e) {
258
+ t = g(t, 255), r = g(r, 255), e = g(e, 255);
259
+ var n = Math.max(t, r, e), i = Math.min(t, r, e), a, f, u = n, l = n - i;
260
+ if (f = n === 0 ? 0 : l / n, n == i)
261
+ a = 0;
262
+ else {
263
+ switch (n) {
264
+ case t:
265
+ a = (r - e) / l + (r < e ? 6 : 0);
395
266
  break;
396
- case g:
397
- h = (b - r) / d + 2;
267
+ case r:
268
+ a = (e - t) / l + 2;
398
269
  break;
399
- case b:
400
- h = (r - g) / d + 4;
270
+ case e:
271
+ a = (t - r) / l + 4;
401
272
  break;
402
273
  }
403
- h /= 6;
274
+ a /= 6;
404
275
  }
405
276
  return {
406
- h,
407
- s,
408
- v
277
+ h: a,
278
+ s: f,
279
+ v: u
409
280
  };
410
281
  }
411
- function hsvToRgb(h, s, v) {
412
- h = bound01(h, 360) * 6;
413
- s = bound01(s, 100);
414
- v = bound01(v, 100);
415
- var i = Math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod];
282
+ function D(t, r, e) {
283
+ t = g(t, 360) * 6, r = g(r, 100), e = g(e, 100);
284
+ var n = Math.floor(t), i = t - n, a = e * (1 - r), f = e * (1 - i * r), u = e * (1 - (1 - i) * r), l = n % 6, h = [e, f, a, a, u, e][l], c = [u, e, e, f, a, a][l], o = [a, a, u, e, e, f][l];
416
285
  return {
417
- r: r * 255,
418
- g: g * 255,
419
- b: b * 255
286
+ r: h * 255,
287
+ g: c * 255,
288
+ b: o * 255
420
289
  };
421
290
  }
422
- function rgbToHex(r, g, b, allow3Char) {
423
- var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
424
- if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
425
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
426
- }
427
- return hex.join("");
291
+ function F(t, r, e, n) {
292
+ var i = [m(Math.round(t).toString(16)), m(Math.round(r).toString(16)), m(Math.round(e).toString(16))];
293
+ return n && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
428
294
  }
429
- function rgbaToHex(r, g, b, a, allow4Char) {
430
- var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
431
- if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
432
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
433
- }
434
- return hex.join("");
295
+ function U(t, r, e, n, i) {
296
+ var a = [m(Math.round(t).toString(16)), m(Math.round(r).toString(16)), m(Math.round(e).toString(16)), m(E(n))];
297
+ return i && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
435
298
  }
436
- function rgbaToArgbHex(r, g, b, a) {
437
- var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
438
- return hex.join("");
299
+ function C(t, r, e, n) {
300
+ var i = [m(E(n)), m(Math.round(t).toString(16)), m(Math.round(r).toString(16)), m(Math.round(e).toString(16))];
301
+ return i.join("");
439
302
  }
440
- tinycolor.equals = function(color1, color2) {
441
- if (!color1 || !color2) return false;
442
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
303
+ s.equals = function(t, r) {
304
+ return !t || !r ? !1 : s(t).toRgbString() == s(r).toRgbString();
443
305
  };
444
- tinycolor.random = function() {
445
- return tinycolor.fromRatio({
306
+ s.random = function() {
307
+ return s.fromRatio({
446
308
  r: Math.random(),
447
309
  g: Math.random(),
448
310
  b: Math.random()
449
311
  });
450
312
  };
451
- function _desaturate(color, amount) {
452
- amount = amount === 0 ? 0 : amount || 10;
453
- var hsl = tinycolor(color).toHsl();
454
- hsl.s -= amount / 100;
455
- hsl.s = clamp01(hsl.s);
456
- return tinycolor(hsl);
457
- }
458
- function _saturate(color, amount) {
459
- amount = amount === 0 ? 0 : amount || 10;
460
- var hsl = tinycolor(color).toHsl();
461
- hsl.s += amount / 100;
462
- hsl.s = clamp01(hsl.s);
463
- return tinycolor(hsl);
464
- }
465
- function _greyscale(color) {
466
- return tinycolor(color).desaturate(100);
467
- }
468
- function _lighten(color, amount) {
469
- amount = amount === 0 ? 0 : amount || 10;
470
- var hsl = tinycolor(color).toHsl();
471
- hsl.l += amount / 100;
472
- hsl.l = clamp01(hsl.l);
473
- return tinycolor(hsl);
474
- }
475
- function _brighten(color, amount) {
476
- amount = amount === 0 ? 0 : amount || 10;
477
- var rgb = tinycolor(color).toRgb();
478
- rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
479
- rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
480
- rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
481
- return tinycolor(rgb);
482
- }
483
- function _darken(color, amount) {
484
- amount = amount === 0 ? 0 : amount || 10;
485
- var hsl = tinycolor(color).toHsl();
486
- hsl.l -= amount / 100;
487
- hsl.l = clamp01(hsl.l);
488
- return tinycolor(hsl);
489
- }
490
- function _spin(color, amount) {
491
- var hsl = tinycolor(color).toHsl();
492
- var hue = (hsl.h + amount) % 360;
493
- hsl.h = hue < 0 ? 360 + hue : hue;
494
- return tinycolor(hsl);
495
- }
496
- function _complement(color) {
497
- var hsl = tinycolor(color).toHsl();
498
- hsl.h = (hsl.h + 180) % 360;
499
- return tinycolor(hsl);
500
- }
501
- function polyad(color, number) {
502
- if (isNaN(number) || number <= 0) {
313
+ function $(t, r) {
314
+ r = r === 0 ? 0 : r || 10;
315
+ var e = s(t).toHsl();
316
+ return e.s -= r / 100, e.s = A(e.s), s(e);
317
+ }
318
+ function j(t, r) {
319
+ r = r === 0 ? 0 : r || 10;
320
+ var e = s(t).toHsl();
321
+ return e.s += r / 100, e.s = A(e.s), s(e);
322
+ }
323
+ function W(t) {
324
+ return s(t).desaturate(100);
325
+ }
326
+ function X(t, r) {
327
+ r = r === 0 ? 0 : r || 10;
328
+ var e = s(t).toHsl();
329
+ return e.l += r / 100, e.l = A(e.l), s(e);
330
+ }
331
+ function Z(t, r) {
332
+ r = r === 0 ? 0 : r || 10;
333
+ var e = s(t).toRgb();
334
+ return e.r = Math.max(0, Math.min(255, e.r - Math.round(255 * -(r / 100)))), e.g = Math.max(0, Math.min(255, e.g - Math.round(255 * -(r / 100)))), e.b = Math.max(0, Math.min(255, e.b - Math.round(255 * -(r / 100)))), s(e);
335
+ }
336
+ function J(t, r) {
337
+ r = r === 0 ? 0 : r || 10;
338
+ var e = s(t).toHsl();
339
+ return e.l -= r / 100, e.l = A(e.l), s(e);
340
+ }
341
+ function K(t, r) {
342
+ var e = s(t).toHsl(), n = (e.h + r) % 360;
343
+ return e.h = n < 0 ? 360 + n : n, s(e);
344
+ }
345
+ function Q(t) {
346
+ var r = s(t).toHsl();
347
+ return r.h = (r.h + 180) % 360, s(r);
348
+ }
349
+ function T(t, r) {
350
+ if (isNaN(r) || r <= 0)
503
351
  throw new Error("Argument to polyad must be a positive number");
504
- }
505
- var hsl = tinycolor(color).toHsl();
506
- var result = [tinycolor(color)];
507
- var step = 360 / number;
508
- for (var i = 1; i < number; i++) {
509
- result.push(tinycolor({
510
- h: (hsl.h + i * step) % 360,
511
- s: hsl.s,
512
- l: hsl.l
352
+ for (var e = s(t).toHsl(), n = [s(t)], i = 360 / r, a = 1; a < r; a++)
353
+ n.push(s({
354
+ h: (e.h + a * i) % 360,
355
+ s: e.s,
356
+ l: e.l
513
357
  }));
514
- }
515
- return result;
358
+ return n;
516
359
  }
517
- function _splitcomplement(color) {
518
- var hsl = tinycolor(color).toHsl();
519
- var h = hsl.h;
520
- return [tinycolor(color), tinycolor({
521
- h: (h + 72) % 360,
522
- s: hsl.s,
523
- l: hsl.l
524
- }), tinycolor({
525
- h: (h + 216) % 360,
526
- s: hsl.s,
527
- l: hsl.l
360
+ function Y(t) {
361
+ var r = s(t).toHsl(), e = r.h;
362
+ return [s(t), s({
363
+ h: (e + 72) % 360,
364
+ s: r.s,
365
+ l: r.l
366
+ }), s({
367
+ h: (e + 216) % 360,
368
+ s: r.s,
369
+ l: r.l
528
370
  })];
529
371
  }
530
- function _analogous(color, results, slices) {
531
- results = results || 6;
532
- slices = slices || 30;
533
- var hsl = tinycolor(color).toHsl();
534
- var part = 360 / slices;
535
- var ret = [tinycolor(color)];
536
- for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
537
- hsl.h = (hsl.h + part) % 360;
538
- ret.push(tinycolor(hsl));
539
- }
540
- return ret;
541
- }
542
- function _monochromatic(color, results) {
543
- results = results || 6;
544
- var hsv = tinycolor(color).toHsv();
545
- var h = hsv.h, s = hsv.s, v = hsv.v;
546
- var ret = [];
547
- var modification = 1 / results;
548
- while (results--) {
549
- ret.push(tinycolor({
550
- h,
551
- s,
552
- v
553
- }));
554
- v = (v + modification) % 1;
555
- }
556
- return ret;
372
+ function tt(t, r, e) {
373
+ r = r || 6, e = e || 30;
374
+ var n = s(t).toHsl(), i = 360 / e, a = [s(t)];
375
+ for (n.h = (n.h - (i * r >> 1) + 720) % 360; --r; )
376
+ n.h = (n.h + i) % 360, a.push(s(n));
377
+ return a;
557
378
  }
558
- tinycolor.mix = function(color1, color2, amount) {
559
- amount = amount === 0 ? 0 : amount || 50;
560
- var rgb1 = tinycolor(color1).toRgb();
561
- var rgb2 = tinycolor(color2).toRgb();
562
- var p = amount / 100;
563
- var rgba = {
564
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
565
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
566
- b: (rgb2.b - rgb1.b) * p + rgb1.b,
567
- a: (rgb2.a - rgb1.a) * p + rgb1.a
379
+ function et(t, r) {
380
+ r = r || 6;
381
+ for (var e = s(t).toHsv(), n = e.h, i = e.s, a = e.v, f = [], u = 1 / r; r--; )
382
+ f.push(s({
383
+ h: n,
384
+ s: i,
385
+ v: a
386
+ })), a = (a + u) % 1;
387
+ return f;
388
+ }
389
+ s.mix = function(t, r, e) {
390
+ e = e === 0 ? 0 : e || 50;
391
+ var n = s(t).toRgb(), i = s(r).toRgb(), a = e / 100, f = {
392
+ r: (i.r - n.r) * a + n.r,
393
+ g: (i.g - n.g) * a + n.g,
394
+ b: (i.b - n.b) * a + n.b,
395
+ a: (i.a - n.a) * a + n.a
568
396
  };
569
- return tinycolor(rgba);
397
+ return s(f);
570
398
  };
571
- tinycolor.readability = function(color1, color2) {
572
- var c1 = tinycolor(color1);
573
- var c2 = tinycolor(color2);
574
- return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
399
+ s.readability = function(t, r) {
400
+ var e = s(t), n = s(r);
401
+ return (Math.max(e.getLuminance(), n.getLuminance()) + 0.05) / (Math.min(e.getLuminance(), n.getLuminance()) + 0.05);
575
402
  };
576
- tinycolor.isReadable = function(color1, color2, wcag2) {
577
- var readability = tinycolor.readability(color1, color2);
578
- var wcag2Parms, out;
579
- out = false;
580
- wcag2Parms = validateWCAG2Parms(wcag2);
581
- switch (wcag2Parms.level + wcag2Parms.size) {
403
+ s.isReadable = function(t, r, e) {
404
+ var n = s.readability(t, r), i, a;
405
+ switch (a = !1, i = ht(e), i.level + i.size) {
582
406
  case "AAsmall":
583
407
  case "AAAlarge":
584
- out = readability >= 4.5;
408
+ a = n >= 4.5;
585
409
  break;
586
410
  case "AAlarge":
587
- out = readability >= 3;
411
+ a = n >= 3;
588
412
  break;
589
413
  case "AAAsmall":
590
- out = readability >= 7;
414
+ a = n >= 7;
591
415
  break;
592
416
  }
593
- return out;
417
+ return a;
594
418
  };
595
- tinycolor.mostReadable = function(baseColor, colorList, args) {
596
- var bestColor = null;
597
- var bestScore = 0;
598
- var readability;
599
- var includeFallbackColors, level, size;
600
- args = args || {};
601
- includeFallbackColors = args.includeFallbackColors;
602
- level = args.level;
603
- size = args.size;
604
- for (var i = 0; i < colorList.length; i++) {
605
- readability = tinycolor.readability(baseColor, colorList[i]);
606
- if (readability > bestScore) {
607
- bestScore = readability;
608
- bestColor = tinycolor(colorList[i]);
609
- }
610
- }
611
- if (tinycolor.isReadable(baseColor, bestColor, {
612
- level,
613
- size
614
- }) || !includeFallbackColors) {
615
- return bestColor;
616
- } else {
617
- args.includeFallbackColors = false;
618
- return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
619
- }
419
+ s.mostReadable = function(t, r, e) {
420
+ var n = null, i = 0, a, f, u, l;
421
+ e = e || {}, f = e.includeFallbackColors, u = e.level, l = e.size;
422
+ for (var h = 0; h < r.length; h++)
423
+ a = s.readability(t, r[h]), a > i && (i = a, n = s(r[h]));
424
+ return s.isReadable(t, n, {
425
+ level: u,
426
+ size: l
427
+ }) || !f ? n : (e.includeFallbackColors = !1, s.mostReadable(t, ["#fff", "#000"], e));
620
428
  };
621
- var names = tinycolor.names = {
429
+ var S = s.names = {
622
430
  aliceblue: "f0f8ff",
623
431
  antiquewhite: "faebd7",
624
432
  aqua: "0ff",
@@ -768,93 +576,70 @@ var names = tinycolor.names = {
768
576
  whitesmoke: "f5f5f5",
769
577
  yellow: "ff0",
770
578
  yellowgreen: "9acd32"
771
- };
772
- var hexNames = tinycolor.hexNames = flip(names);
773
- function flip(o) {
774
- var flipped = {};
775
- for (var i in o) {
776
- if (o.hasOwnProperty(i)) {
777
- flipped[o[i]] = i;
778
- }
779
- }
780
- return flipped;
579
+ }, rt = s.hexNames = nt(S);
580
+ function nt(t) {
581
+ var r = {};
582
+ for (var e in t)
583
+ t.hasOwnProperty(e) && (r[t[e]] = e);
584
+ return r;
781
585
  }
782
- function boundAlpha(a) {
783
- a = parseFloat(a);
784
- if (isNaN(a) || a < 0 || a > 1) {
785
- a = 1;
786
- }
787
- return a;
586
+ function N(t) {
587
+ return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
788
588
  }
789
- function bound01(n, max) {
790
- if (isOnePointZero(n)) n = "100%";
791
- var processPercent = isPercentage(n);
792
- n = Math.min(max, Math.max(0, parseFloat(n)));
793
- if (processPercent) {
794
- n = parseInt(n * max, 10) / 100;
795
- }
796
- if (Math.abs(n - max) < 1e-6) {
797
- return 1;
798
- }
799
- return n % max / parseFloat(max);
589
+ function g(t, r) {
590
+ at(t) && (t = "100%");
591
+ var e = it(t);
592
+ return t = Math.min(r, Math.max(0, parseFloat(t))), e && (t = parseInt(t * r, 10) / 100), Math.abs(t - r) < 1e-6 ? 1 : t % r / parseFloat(r);
800
593
  }
801
- function clamp01(val) {
802
- return Math.min(1, Math.max(0, val));
594
+ function A(t) {
595
+ return Math.min(1, Math.max(0, t));
803
596
  }
804
- function parseIntFromHex(val) {
805
- return parseInt(val, 16);
597
+ function b(t) {
598
+ return parseInt(t, 16);
806
599
  }
807
- function isOnePointZero(n) {
808
- return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
600
+ function at(t) {
601
+ return typeof t == "string" && t.indexOf(".") != -1 && parseFloat(t) === 1;
809
602
  }
810
- function isPercentage(n) {
811
- return typeof n === "string" && n.indexOf("%") != -1;
603
+ function it(t) {
604
+ return typeof t == "string" && t.indexOf("%") != -1;
812
605
  }
813
- function pad2(c) {
814
- return c.length == 1 ? "0" + c : "" + c;
606
+ function m(t) {
607
+ return t.length == 1 ? "0" + t : "" + t;
815
608
  }
816
- function convertToPercentage(n) {
817
- if (n <= 1) {
818
- n = n * 100 + "%";
819
- }
820
- return n;
609
+ function M(t) {
610
+ return t <= 1 && (t = t * 100 + "%"), t;
821
611
  }
822
- function convertDecimalToHex(d) {
823
- return Math.round(parseFloat(d) * 255).toString(16);
612
+ function E(t) {
613
+ return Math.round(parseFloat(t) * 255).toString(16);
824
614
  }
825
- function convertHexToDecimal(h) {
826
- return parseIntFromHex(h) / 255;
615
+ function I(t) {
616
+ return b(t) / 255;
827
617
  }
828
- var matchers = function() {
829
- var CSS_INTEGER = "[-\\+]?\\d+%?";
830
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
831
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
832
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
833
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
618
+ var p = function() {
619
+ var t = "[-\\+]?\\d+%?", r = "[-\\+]?\\d*\\.\\d+%?", e = "(?:" + r + ")|(?:" + t + ")", n = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", i = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
834
620
  return {
835
- CSS_UNIT: new RegExp(CSS_UNIT),
836
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
837
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
838
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
839
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
840
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
841
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
621
+ CSS_UNIT: new RegExp(e),
622
+ rgb: new RegExp("rgb" + n),
623
+ rgba: new RegExp("rgba" + i),
624
+ hsl: new RegExp("hsl" + n),
625
+ hsla: new RegExp("hsla" + i),
626
+ hsv: new RegExp("hsv" + n),
627
+ hsva: new RegExp("hsva" + i),
842
628
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
843
629
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
844
630
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
845
631
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
846
632
  };
847
633
  }();
848
- function isValidCSSUnit(color) {
849
- return !!matchers.CSS_UNIT.exec(color);
850
- }
851
- function stringInputToObject(color) {
852
- color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
853
- var named = false;
854
- if (names[color]) {
855
- color = names[color];
856
- named = true;
857
- } else if (color == "transparent") {
634
+ function _(t) {
635
+ return !!p.CSS_UNIT.exec(t);
636
+ }
637
+ function st(t) {
638
+ t = t.replace(L, "").replace(G, "").toLowerCase();
639
+ var r = !1;
640
+ if (S[t])
641
+ t = S[t], r = !0;
642
+ else if (t == "transparent")
858
643
  return {
859
644
  r: 0,
860
645
  g: 0,
@@ -862,199 +647,127 @@ function stringInputToObject(color) {
862
647
  a: 0,
863
648
  format: "name"
864
649
  };
865
- }
866
- var match;
867
- if (match = matchers.rgb.exec(color)) {
868
- return {
869
- r: match[1],
870
- g: match[2],
871
- b: match[3]
872
- };
873
- }
874
- if (match = matchers.rgba.exec(color)) {
875
- return {
876
- r: match[1],
877
- g: match[2],
878
- b: match[3],
879
- a: match[4]
880
- };
881
- }
882
- if (match = matchers.hsl.exec(color)) {
883
- return {
884
- h: match[1],
885
- s: match[2],
886
- l: match[3]
887
- };
888
- }
889
- if (match = matchers.hsla.exec(color)) {
890
- return {
891
- h: match[1],
892
- s: match[2],
893
- l: match[3],
894
- a: match[4]
895
- };
896
- }
897
- if (match = matchers.hsv.exec(color)) {
898
- return {
899
- h: match[1],
900
- s: match[2],
901
- v: match[3]
902
- };
903
- }
904
- if (match = matchers.hsva.exec(color)) {
905
- return {
906
- h: match[1],
907
- s: match[2],
908
- v: match[3],
909
- a: match[4]
910
- };
911
- }
912
- if (match = matchers.hex8.exec(color)) {
913
- return {
914
- r: parseIntFromHex(match[1]),
915
- g: parseIntFromHex(match[2]),
916
- b: parseIntFromHex(match[3]),
917
- a: convertHexToDecimal(match[4]),
918
- format: named ? "name" : "hex8"
919
- };
920
- }
921
- if (match = matchers.hex6.exec(color)) {
922
- return {
923
- r: parseIntFromHex(match[1]),
924
- g: parseIntFromHex(match[2]),
925
- b: parseIntFromHex(match[3]),
926
- format: named ? "name" : "hex"
927
- };
928
- }
929
- if (match = matchers.hex4.exec(color)) {
930
- return {
931
- r: parseIntFromHex(match[1] + "" + match[1]),
932
- g: parseIntFromHex(match[2] + "" + match[2]),
933
- b: parseIntFromHex(match[3] + "" + match[3]),
934
- a: convertHexToDecimal(match[4] + "" + match[4]),
935
- format: named ? "name" : "hex8"
936
- };
937
- }
938
- if (match = matchers.hex3.exec(color)) {
939
- return {
940
- r: parseIntFromHex(match[1] + "" + match[1]),
941
- g: parseIntFromHex(match[2] + "" + match[2]),
942
- b: parseIntFromHex(match[3] + "" + match[3]),
943
- format: named ? "name" : "hex"
944
- };
945
- }
946
- return false;
947
- }
948
- function validateWCAG2Parms(parms) {
949
- var level, size;
950
- parms = parms || {
650
+ var e;
651
+ return (e = p.rgb.exec(t)) ? {
652
+ r: e[1],
653
+ g: e[2],
654
+ b: e[3]
655
+ } : (e = p.rgba.exec(t)) ? {
656
+ r: e[1],
657
+ g: e[2],
658
+ b: e[3],
659
+ a: e[4]
660
+ } : (e = p.hsl.exec(t)) ? {
661
+ h: e[1],
662
+ s: e[2],
663
+ l: e[3]
664
+ } : (e = p.hsla.exec(t)) ? {
665
+ h: e[1],
666
+ s: e[2],
667
+ l: e[3],
668
+ a: e[4]
669
+ } : (e = p.hsv.exec(t)) ? {
670
+ h: e[1],
671
+ s: e[2],
672
+ v: e[3]
673
+ } : (e = p.hsva.exec(t)) ? {
674
+ h: e[1],
675
+ s: e[2],
676
+ v: e[3],
677
+ a: e[4]
678
+ } : (e = p.hex8.exec(t)) ? {
679
+ r: b(e[1]),
680
+ g: b(e[2]),
681
+ b: b(e[3]),
682
+ a: I(e[4]),
683
+ format: r ? "name" : "hex8"
684
+ } : (e = p.hex6.exec(t)) ? {
685
+ r: b(e[1]),
686
+ g: b(e[2]),
687
+ b: b(e[3]),
688
+ format: r ? "name" : "hex"
689
+ } : (e = p.hex4.exec(t)) ? {
690
+ r: b(e[1] + "" + e[1]),
691
+ g: b(e[2] + "" + e[2]),
692
+ b: b(e[3] + "" + e[3]),
693
+ a: I(e[4] + "" + e[4]),
694
+ format: r ? "name" : "hex8"
695
+ } : (e = p.hex3.exec(t)) ? {
696
+ r: b(e[1] + "" + e[1]),
697
+ g: b(e[2] + "" + e[2]),
698
+ b: b(e[3] + "" + e[3]),
699
+ format: r ? "name" : "hex"
700
+ } : !1;
701
+ }
702
+ function ht(t) {
703
+ var r, e;
704
+ return t = t || {
951
705
  level: "AA",
952
706
  size: "small"
953
- };
954
- level = (parms.level || "AA").toUpperCase();
955
- size = (parms.size || "small").toLowerCase();
956
- if (level !== "AA" && level !== "AAA") {
957
- level = "AA";
958
- }
959
- if (size !== "small" && size !== "large") {
960
- size = "small";
961
- }
962
- return {
963
- level,
964
- size
707
+ }, r = (t.level || "AA").toUpperCase(), e = (t.size || "small").toLowerCase(), r !== "AA" && r !== "AAA" && (r = "AA"), e !== "small" && e !== "large" && (e = "small"), {
708
+ level: r,
709
+ size: e
965
710
  };
966
711
  }
967
- const useComparator = () => {
968
- const theme = useTheme();
969
- const isBaseComparator = (comparator) => {
970
- return !comparator.type;
971
- };
972
- const isNodeStyler = (comparator) => {
973
- return comparator.type === "node";
974
- };
975
- const runOperator = (value1, operator, value2) => {
976
- var _a, _b;
977
- if (!operator || !value2) {
978
- return true;
979
- }
980
- let result;
981
- switch (operator) {
712
+ const gt = () => {
713
+ const t = z(), r = (h) => !h.type, e = (h) => h.type === "node", n = (h, c, o) => {
714
+ var v, y;
715
+ if (!c || !o)
716
+ return !0;
717
+ let d;
718
+ switch (c) {
982
719
  case "=": {
983
- result = (isNil(value1) ? "" : value1).toString() == (value2 == null ? void 0 : value2.toString());
720
+ d = (B(h) ? "" : h).toString() == (o == null ? void 0 : o.toString());
984
721
  break;
985
722
  }
986
723
  case "<": {
987
- result = parseFloat(value1) < parseFloat(value2);
724
+ d = parseFloat(h) < parseFloat(o);
988
725
  break;
989
726
  }
990
727
  case ">": {
991
- result = parseFloat(value1) > parseFloat(value2);
728
+ d = parseFloat(h) > parseFloat(o);
992
729
  break;
993
730
  }
994
731
  case "!=": {
995
- result = (value1 == null ? void 0 : value1.toString()) != (value2 == null ? void 0 : value2.toString());
732
+ d = (h == null ? void 0 : h.toString()) != (o == null ? void 0 : o.toString());
996
733
  break;
997
734
  }
998
735
  case "<=": {
999
- result = parseInt(value1) <= parseInt(value2);
736
+ d = parseInt(h) <= parseInt(o);
1000
737
  break;
1001
738
  }
1002
739
  case ">=": {
1003
- result = parseInt(value1) >= parseInt(value2);
740
+ d = parseInt(h) >= parseInt(o);
1004
741
  break;
1005
742
  }
1006
743
  case "~": {
1007
- const strValue1 = ((_a = value1 == null ? void 0 : value1.toString) == null ? void 0 : _a.call(value1)) ?? "";
1008
- const strValue2 = ((_b = value2.toString) == null ? void 0 : _b.call(value2)) ?? "";
1009
- result = !!strValue1 && strValue1.toLowerCase().includes(strValue2.toLowerCase());
744
+ const k = ((v = h == null ? void 0 : h.toString) == null ? void 0 : v.call(h)) ?? "", P = ((y = o.toString) == null ? void 0 : y.call(o)) ?? "";
745
+ d = !!k && k.toLowerCase().includes(P.toLowerCase());
1010
746
  break;
1011
747
  }
1012
- default: {
1013
- result = false;
1014
- }
748
+ default:
749
+ d = !1;
1015
750
  }
1016
- return result;
1017
- };
1018
- const runBaseComparator = (comparator, node) => runOperator(get(node, comparator.field), comparator.operator, comparator.value);
1019
- const runNodeComparator = (comparator, node) => {
1020
- var _a;
1021
- const nodeValue = get(node, comparator.field);
1022
- if (!runOperator(nodeValue, comparator.operator, comparator.value)) {
751
+ return d;
752
+ }, i = (h, c) => n(w(c, h.field), h.operator, h.value), a = (h, c) => {
753
+ var v;
754
+ const o = w(c, h.field);
755
+ if (!n(o, h.operator, h.value))
1023
756
  return {};
1024
- }
1025
- const styles = {};
1026
- if (comparator.color) {
1027
- const color = ((_a = theme.palette[comparator.color]) == null ? void 0 : _a.main) ?? comparator.color;
1028
- styles.fill = color;
757
+ const d = {};
758
+ if (h.color) {
759
+ const y = ((v = t.palette[h.color]) == null ? void 0 : v.main) ?? h.color;
760
+ d.fill = y;
1029
761
  try {
1030
- styles.stroke = tinycolor(color).darken(10).toString();
762
+ d.stroke = s(y).darken(10).toString();
1031
763
  } catch {
1032
- styles.stroke = color;
764
+ d.stroke = y;
1033
765
  }
1034
766
  }
1035
- if (comparator.size) {
1036
- styles.strokeWidth = comparator.size;
1037
- styles.fontSize = comparator.size;
1038
- }
1039
- return styles;
1040
- };
1041
- const runEdgeComparator = (_comparator, _source, _target) => {
1042
- return {};
1043
- };
1044
- const runComparator = (comparator, nodeOrSource, target) => {
1045
- if (isBaseComparator(comparator)) {
1046
- return runBaseComparator(comparator, nodeOrSource);
1047
- }
1048
- if (isNodeStyler(comparator)) {
1049
- return runNodeComparator(comparator, nodeOrSource);
1050
- }
1051
- return runEdgeComparator();
1052
- };
1053
- const runComparators = (comparators, nodeOrSource, target) => {
1054
- return (comparators ?? []).map((comparator) => runComparator(comparator, nodeOrSource)).reduce((acc, val) => ({ ...acc, ...val }), {});
1055
- };
1056
- return { runComparators, runComparator };
767
+ return h.size && (d.strokeWidth = h.size, d.fontSize = h.size), d;
768
+ }, f = (h, c, o) => ({}), u = (h, c, o) => r(h) ? i(h, c) : e(h) ? a(h, c) : f();
769
+ return { runComparators: (h, c, o) => (h ?? []).map((d) => u(d, c)).reduce((d, v) => ({ ...d, ...v }), {}), runComparator: u };
1057
770
  };
1058
771
  export {
1059
- useComparator as default
772
+ gt as default
1060
773
  };