@nebula.js/stardust 4.6.1 → 4.7.0

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v4.6.1
2
+ * @nebula.js/stardust v4.7.0
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -2363,7 +2363,7 @@
2363
2363
  return prototype;
2364
2364
  }
2365
2365
 
2366
- function Color() {}
2366
+ function Color$1() {}
2367
2367
 
2368
2368
  var darker = 0.7;
2369
2369
  var brighter = 1 / darker;
@@ -2530,7 +2530,7 @@
2530
2530
  yellowgreen: 0x9acd32
2531
2531
  };
2532
2532
 
2533
- define(Color, color$3, {
2533
+ define(Color$1, color$3, {
2534
2534
  copy(channels) {
2535
2535
  return Object.assign(new this.constructor, this, channels);
2536
2536
  },
@@ -2566,15 +2566,15 @@
2566
2566
  format = (format + "").trim().toLowerCase();
2567
2567
  return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
2568
2568
  : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
2569
- : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
2570
- : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
2569
+ : l === 8 ? rgba$1(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
2570
+ : l === 4 ? rgba$1((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
2571
2571
  : null) // invalid hex
2572
2572
  : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
2573
2573
  : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
2574
- : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
2575
- : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
2576
- : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
2577
- : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
2574
+ : (m = reRgbaInteger.exec(format)) ? rgba$1(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
2575
+ : (m = reRgbaPercent.exec(format)) ? rgba$1(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
2576
+ : (m = reHslPercent.exec(format)) ? hsla$1(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
2577
+ : (m = reHslaPercent.exec(format)) ? hsla$1(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
2578
2578
  : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
2579
2579
  : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
2580
2580
  : null;
@@ -2584,19 +2584,19 @@
2584
2584
  return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
2585
2585
  }
2586
2586
 
2587
- function rgba(r, g, b, a) {
2587
+ function rgba$1(r, g, b, a) {
2588
2588
  if (a <= 0) r = g = b = NaN;
2589
2589
  return new Rgb(r, g, b, a);
2590
2590
  }
2591
2591
 
2592
2592
  function rgbConvert(o) {
2593
- if (!(o instanceof Color)) o = color$3(o);
2593
+ if (!(o instanceof Color$1)) o = color$3(o);
2594
2594
  if (!o) return new Rgb;
2595
2595
  o = o.rgb();
2596
2596
  return new Rgb(o.r, o.g, o.b, o.opacity);
2597
2597
  }
2598
2598
 
2599
- function rgb(r, g, b, opacity) {
2599
+ function rgb$1(r, g, b, opacity) {
2600
2600
  return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
2601
2601
  }
2602
2602
 
@@ -2607,7 +2607,7 @@
2607
2607
  this.opacity = +opacity;
2608
2608
  }
2609
2609
 
2610
- define(Rgb, rgb, extend$3(Color, {
2610
+ define(Rgb, rgb$1, extend$3(Color$1, {
2611
2611
  brighter(k) {
2612
2612
  k = k == null ? brighter : Math.pow(brighter, k);
2613
2613
  return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
@@ -2636,11 +2636,11 @@
2636
2636
  }));
2637
2637
 
2638
2638
  function rgb_formatHex() {
2639
- return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
2639
+ return `#${hex$1(this.r)}${hex$1(this.g)}${hex$1(this.b)}`;
2640
2640
  }
2641
2641
 
2642
2642
  function rgb_formatHex8() {
2643
- return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
2643
+ return `#${hex$1(this.r)}${hex$1(this.g)}${hex$1(this.b)}${hex$1((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
2644
2644
  }
2645
2645
 
2646
2646
  function rgb_formatRgb() {
@@ -2656,12 +2656,12 @@
2656
2656
  return Math.max(0, Math.min(255, Math.round(value) || 0));
2657
2657
  }
2658
2658
 
2659
- function hex(value) {
2659
+ function hex$1(value) {
2660
2660
  value = clampi(value);
2661
2661
  return (value < 16 ? "0" : "") + value.toString(16);
2662
2662
  }
2663
2663
 
2664
- function hsla(h, s, l, a) {
2664
+ function hsla$1(h, s, l, a) {
2665
2665
  if (a <= 0) h = s = l = NaN;
2666
2666
  else if (l <= 0 || l >= 1) h = s = NaN;
2667
2667
  else if (s <= 0) h = NaN;
@@ -2670,7 +2670,7 @@
2670
2670
 
2671
2671
  function hslConvert(o) {
2672
2672
  if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
2673
- if (!(o instanceof Color)) o = color$3(o);
2673
+ if (!(o instanceof Color$1)) o = color$3(o);
2674
2674
  if (!o) return new Hsl;
2675
2675
  if (o instanceof Hsl) return o;
2676
2676
  o = o.rgb();
@@ -2694,7 +2694,7 @@
2694
2694
  return new Hsl(h, s, l, o.opacity);
2695
2695
  }
2696
2696
 
2697
- function hsl(h, s, l, opacity) {
2697
+ function hsl$1(h, s, l, opacity) {
2698
2698
  return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
2699
2699
  }
2700
2700
 
@@ -2705,7 +2705,7 @@
2705
2705
  this.opacity = +opacity;
2706
2706
  }
2707
2707
 
2708
- define(Hsl, hsl, extend$3(Color, {
2708
+ define(Hsl, hsl$1, extend$3(Color$1, {
2709
2709
  brighter(k) {
2710
2710
  k = k == null ? brighter : Math.pow(brighter, k);
2711
2711
  return new Hsl(this.h, this.s, this.l * k, this.opacity);
@@ -3298,7 +3298,7 @@
3298
3298
  const g = Math.floor(c1.g + (c2.g - c1.g) * t);
3299
3299
  const b = Math.floor(c1.b + (c2.b - c1.b) * t);
3300
3300
  const a = Math.floor(c1.opacity + (c2.opacity - c1.opacity) * t);
3301
- return rgb(r, g, b, a);
3301
+ return rgb$1(r, g, b, a);
3302
3302
  }
3303
3303
  class ColorScale {
3304
3304
  constructor(nanColor) {
@@ -4540,10 +4540,10 @@
4540
4540
  useEnhancedEffect$1(() => {
4541
4541
  ref.current = fn;
4542
4542
  });
4543
- return reactExports.useCallback((...args) =>
4543
+ return reactExports.useRef((...args) =>
4544
4544
  // @ts-expect-error hide `this`
4545
4545
  // tslint:disable-next-line:ban-comma-operator
4546
- (0, ref.current)(...args), []);
4546
+ (0, ref.current)(...args)).current;
4547
4547
  }
4548
4548
 
4549
4549
  function useForkRef(...refs) {
@@ -6952,7 +6952,7 @@
6952
6952
  }
6953
6953
 
6954
6954
  /**
6955
- * @mui/styled-engine v5.14.13
6955
+ * @mui/styled-engine v5.14.17
6956
6956
  *
6957
6957
  * @license MIT
6958
6958
  * This source code is licensed under the MIT license found in the
@@ -9533,7 +9533,7 @@
9533
9533
  }
9534
9534
 
9535
9535
  const _excluded$I = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
9536
- function round$2(value) {
9536
+ function round$3(value) {
9537
9537
  return Math.round(value * 1e5) / 1e5;
9538
9538
  }
9539
9539
  const caseAllCaps = {
@@ -9573,7 +9573,7 @@
9573
9573
  // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
9574
9574
  lineHeight
9575
9575
  }, fontFamily === defaultFontFamily ? {
9576
- letterSpacing: `${round$2(letterSpacing / size)}em`
9576
+ letterSpacing: `${round$3(letterSpacing / size)}em`
9577
9577
  } : {}, casing, allVariants);
9578
9578
  const variants = {
9579
9579
  h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
@@ -11599,6 +11599,7 @@
11599
11599
  excluded: '#BEBEBE',
11600
11600
  selectedExcluded: '#BEBEBE',
11601
11601
  possible: colors.grey100,
11602
+ selectedContrastText: colors.grey100,
11602
11603
  mainContrastText: colors.grey100,
11603
11604
  alternativeContrastText: colors.grey25,
11604
11605
  excludedContrastText: colors.grey25,
@@ -11666,6 +11667,7 @@
11666
11667
  excluded: colors.grey10,
11667
11668
  selectedExcluded: colors.grey10,
11668
11669
  possible: colors.grey80,
11670
+ selectedContrastText: colors.grey100,
11669
11671
  mainContrastText: colors.grey100,
11670
11672
  alternativeContrastText: colors.grey100,
11671
11673
  excludedContrastText: colors.grey100,
@@ -11818,7 +11820,7 @@
11818
11820
  return cache[key];
11819
11821
  }
11820
11822
 
11821
- const NEBULA_VERSION_HASH = "2504" ;
11823
+ const NEBULA_VERSION_HASH = "d794" ;
11822
11824
  ClassNameGenerator$1.configure(componentName => {
11823
11825
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
11824
11826
  });
@@ -12079,7 +12081,7 @@
12079
12081
  const appRef = React.createRef();
12080
12082
  const element = document.createElement('div');
12081
12083
  element.style.display = 'none';
12082
- element.setAttribute('data-nebulajs-version', "4.6.1" );
12084
+ element.setAttribute('data-nebulajs-version', "4.7.0" );
12083
12085
  element.setAttribute('data-app-id', app.id);
12084
12086
  document.body.appendChild(element);
12085
12087
  if (context) {
@@ -12147,246 +12149,6 @@
12147
12149
  }, appRef, rendered];
12148
12150
  }
12149
12151
 
12150
- const pink = {
12151
- 50: '#fce4ec',
12152
- 100: '#f8bbd0',
12153
- 200: '#f48fb1',
12154
- 300: '#f06292',
12155
- 400: '#ec407a',
12156
- 500: '#e91e63',
12157
- 600: '#d81b60',
12158
- 700: '#c2185b',
12159
- 800: '#ad1457',
12160
- 900: '#880e4f',
12161
- A100: '#ff80ab',
12162
- A200: '#ff4081',
12163
- A400: '#f50057',
12164
- A700: '#c51162'
12165
- };
12166
- var pink$1 = pink;
12167
-
12168
- const deepPurple = {
12169
- 50: '#ede7f6',
12170
- 100: '#d1c4e9',
12171
- 200: '#b39ddb',
12172
- 300: '#9575cd',
12173
- 400: '#7e57c2',
12174
- 500: '#673ab7',
12175
- 600: '#5e35b1',
12176
- 700: '#512da8',
12177
- 800: '#4527a0',
12178
- 900: '#311b92',
12179
- A100: '#b388ff',
12180
- A200: '#7c4dff',
12181
- A400: '#651fff',
12182
- A700: '#6200ea'
12183
- };
12184
- var deepPurple$1 = deepPurple;
12185
-
12186
- const indigo = {
12187
- 50: '#e8eaf6',
12188
- 100: '#c5cae9',
12189
- 200: '#9fa8da',
12190
- 300: '#7986cb',
12191
- 400: '#5c6bc0',
12192
- 500: '#3f51b5',
12193
- 600: '#3949ab',
12194
- 700: '#303f9f',
12195
- 800: '#283593',
12196
- 900: '#1a237e',
12197
- A100: '#8c9eff',
12198
- A200: '#536dfe',
12199
- A400: '#3d5afe',
12200
- A700: '#304ffe'
12201
- };
12202
- var indigo$1 = indigo;
12203
-
12204
- const cyan = {
12205
- 50: '#e0f7fa',
12206
- 100: '#b2ebf2',
12207
- 200: '#80deea',
12208
- 300: '#4dd0e1',
12209
- 400: '#26c6da',
12210
- 500: '#00bcd4',
12211
- 600: '#00acc1',
12212
- 700: '#0097a7',
12213
- 800: '#00838f',
12214
- 900: '#006064',
12215
- A100: '#84ffff',
12216
- A200: '#18ffff',
12217
- A400: '#00e5ff',
12218
- A700: '#00b8d4'
12219
- };
12220
- var cyan$1 = cyan;
12221
-
12222
- const teal = {
12223
- 50: '#e0f2f1',
12224
- 100: '#b2dfdb',
12225
- 200: '#80cbc4',
12226
- 300: '#4db6ac',
12227
- 400: '#26a69a',
12228
- 500: '#009688',
12229
- 600: '#00897b',
12230
- 700: '#00796b',
12231
- 800: '#00695c',
12232
- 900: '#004d40',
12233
- A100: '#a7ffeb',
12234
- A200: '#64ffda',
12235
- A400: '#1de9b6',
12236
- A700: '#00bfa5'
12237
- };
12238
- var teal$1 = teal;
12239
-
12240
- const lightGreen = {
12241
- 50: '#f1f8e9',
12242
- 100: '#dcedc8',
12243
- 200: '#c5e1a5',
12244
- 300: '#aed581',
12245
- 400: '#9ccc65',
12246
- 500: '#8bc34a',
12247
- 600: '#7cb342',
12248
- 700: '#689f38',
12249
- 800: '#558b2f',
12250
- 900: '#33691e',
12251
- A100: '#ccff90',
12252
- A200: '#b2ff59',
12253
- A400: '#76ff03',
12254
- A700: '#64dd17'
12255
- };
12256
- var lightGreen$1 = lightGreen;
12257
-
12258
- const lime = {
12259
- 50: '#f9fbe7',
12260
- 100: '#f0f4c3',
12261
- 200: '#e6ee9c',
12262
- 300: '#dce775',
12263
- 400: '#d4e157',
12264
- 500: '#cddc39',
12265
- 600: '#c0ca33',
12266
- 700: '#afb42b',
12267
- 800: '#9e9d24',
12268
- 900: '#827717',
12269
- A100: '#f4ff81',
12270
- A200: '#eeff41',
12271
- A400: '#c6ff00',
12272
- A700: '#aeea00'
12273
- };
12274
- var lime$1 = lime;
12275
-
12276
- const yellow = {
12277
- 50: '#fffde7',
12278
- 100: '#fff9c4',
12279
- 200: '#fff59d',
12280
- 300: '#fff176',
12281
- 400: '#ffee58',
12282
- 500: '#ffeb3b',
12283
- 600: '#fdd835',
12284
- 700: '#fbc02d',
12285
- 800: '#f9a825',
12286
- 900: '#f57f17',
12287
- A100: '#ffff8d',
12288
- A200: '#ffff00',
12289
- A400: '#ffea00',
12290
- A700: '#ffd600'
12291
- };
12292
- var yellow$1 = yellow;
12293
-
12294
- const amber = {
12295
- 50: '#fff8e1',
12296
- 100: '#ffecb3',
12297
- 200: '#ffe082',
12298
- 300: '#ffd54f',
12299
- 400: '#ffca28',
12300
- 500: '#ffc107',
12301
- 600: '#ffb300',
12302
- 700: '#ffa000',
12303
- 800: '#ff8f00',
12304
- 900: '#ff6f00',
12305
- A100: '#ffe57f',
12306
- A200: '#ffd740',
12307
- A400: '#ffc400',
12308
- A700: '#ffab00'
12309
- };
12310
- var amber$1 = amber;
12311
-
12312
- const deepOrange = {
12313
- 50: '#fbe9e7',
12314
- 100: '#ffccbc',
12315
- 200: '#ffab91',
12316
- 300: '#ff8a65',
12317
- 400: '#ff7043',
12318
- 500: '#ff5722',
12319
- 600: '#f4511e',
12320
- 700: '#e64a19',
12321
- 800: '#d84315',
12322
- 900: '#bf360c',
12323
- A100: '#ff9e80',
12324
- A200: '#ff6e40',
12325
- A400: '#ff3d00',
12326
- A700: '#dd2c00'
12327
- };
12328
- var deepOrange$1 = deepOrange;
12329
-
12330
- const brown = {
12331
- 50: '#efebe9',
12332
- 100: '#d7ccc8',
12333
- 200: '#bcaaa4',
12334
- 300: '#a1887f',
12335
- 400: '#8d6e63',
12336
- 500: '#795548',
12337
- 600: '#6d4c41',
12338
- 700: '#5d4037',
12339
- 800: '#4e342e',
12340
- 900: '#3e2723',
12341
- A100: '#d7ccc8',
12342
- A200: '#bcaaa4',
12343
- A400: '#8d6e63',
12344
- A700: '#5d4037'
12345
- };
12346
- var brown$1 = brown;
12347
-
12348
- const blueGrey = {
12349
- 50: '#eceff1',
12350
- 100: '#cfd8dc',
12351
- 200: '#b0bec5',
12352
- 300: '#90a4ae',
12353
- 400: '#78909c',
12354
- 500: '#607d8b',
12355
- 600: '#546e7a',
12356
- 700: '#455a64',
12357
- 800: '#37474f',
12358
- 900: '#263238',
12359
- A100: '#cfd8dc',
12360
- A200: '#b0bec5',
12361
- A400: '#78909c',
12362
- A700: '#455a64'
12363
- };
12364
- var blueGrey$1 = blueGrey;
12365
-
12366
- var namedColors = /*#__PURE__*/Object.freeze({
12367
- __proto__: null,
12368
- amber: amber$1,
12369
- blue: blue$1,
12370
- blueGrey: blueGrey$1,
12371
- brown: brown$1,
12372
- common: common$1,
12373
- cyan: cyan$1,
12374
- deepOrange: deepOrange$1,
12375
- deepPurple: deepPurple$1,
12376
- green: green$1,
12377
- grey: grey$1,
12378
- indigo: indigo$1,
12379
- lightBlue: lightBlue$1,
12380
- lightGreen: lightGreen$1,
12381
- lime: lime$1,
12382
- orange: orange$1,
12383
- pink: pink$1,
12384
- purple: purple$1,
12385
- red: red$1,
12386
- teal: teal$1,
12387
- yellow: yellow$1
12388
- });
12389
-
12390
12152
  function getSvgIconUtilityClass(slot) {
12391
12153
  return generateUtilityClass('MuiSvgIcon', slot);
12392
12154
  }
@@ -13025,7 +12787,7 @@
13025
12787
  if (!getSlotProps) {
13026
12788
  // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
13027
12789
  // so we can simply merge all the props without having to worry about extracting event handlers.
13028
- const joinedClasses = clsx(externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className, className, additionalProps == null ? void 0 : additionalProps.className);
12790
+ const joinedClasses = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
13029
12791
  const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
13030
12792
  const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);
13031
12793
  if (joinedClasses.length > 0) {
@@ -13566,7 +13328,7 @@
13566
13328
 
13567
13329
  var max = Math.max;
13568
13330
  var min = Math.min;
13569
- var round$1 = Math.round;
13331
+ var round$2 = Math.round;
13570
13332
 
13571
13333
  function getUAString() {
13572
13334
  var uaData = navigator.userAgentData;
@@ -13598,8 +13360,8 @@
13598
13360
  var scaleY = 1;
13599
13361
 
13600
13362
  if (includeScale && isHTMLElement$1(element)) {
13601
- scaleX = element.offsetWidth > 0 ? round$1(clientRect.width) / element.offsetWidth || 1 : 1;
13602
- scaleY = element.offsetHeight > 0 ? round$1(clientRect.height) / element.offsetHeight || 1 : 1;
13363
+ scaleX = element.offsetWidth > 0 ? round$2(clientRect.width) / element.offsetWidth || 1 : 1;
13364
+ scaleY = element.offsetHeight > 0 ? round$2(clientRect.height) / element.offsetHeight || 1 : 1;
13603
13365
  }
13604
13366
 
13605
13367
  var _ref = isElement(element) ? getWindow(element) : window,
@@ -13894,8 +13656,8 @@
13894
13656
  y = _ref.y;
13895
13657
  var dpr = win.devicePixelRatio || 1;
13896
13658
  return {
13897
- x: round$1(x * dpr) / dpr || 0,
13898
- y: round$1(y * dpr) / dpr || 0
13659
+ x: round$2(x * dpr) / dpr || 0,
13660
+ y: round$2(y * dpr) / dpr || 0
13899
13661
  };
13900
13662
  }
13901
13663
 
@@ -14884,8 +14646,8 @@
14884
14646
 
14885
14647
  function isElementScaled(element) {
14886
14648
  var rect = element.getBoundingClientRect();
14887
- var scaleX = round$1(rect.width) / element.offsetWidth || 1;
14888
- var scaleY = round$1(rect.height) / element.offsetHeight || 1;
14649
+ var scaleX = round$2(rect.width) / element.offsetWidth || 1;
14650
+ var scaleY = round$2(rect.height) / element.offsetHeight || 1;
14889
14651
  return scaleX !== 1 || scaleY !== 1;
14890
14652
  } // Returns the composite rect of an element relative to its offsetParent.
14891
14653
  // Composite means it takes into account transforms as well as layout.
@@ -15813,7 +15575,9 @@
15813
15575
  // clicking a checkbox to check it, hitting a button to submit a form,
15814
15576
  // and hitting left arrow to move the cursor in a text input etc.
15815
15577
  // Only special HTML elements have these default behaviors.
15816
- if (event.key !== 'Escape' || !isTopModal()) {
15578
+ if (event.key !== 'Escape' || event.which === 229 ||
15579
+ // Wait until IME is settled.
15580
+ !isTopModal()) {
15817
15581
  return;
15818
15582
  }
15819
15583
  if (!disableEscapeKeyDown) {
@@ -17162,7 +16926,9 @@
17162
16926
  }, ownerState.edge === 'end' && {
17163
16927
  marginRight: ownerState.size === 'small' ? -3 : -12
17164
16928
  }));
17165
- const SwitchBaseInput = styled$1('input')({
16929
+ const SwitchBaseInput = styled$1('input', {
16930
+ shouldForwardProp: rootShouldForwardProp
16931
+ })({
17166
16932
  cursor: 'inherit',
17167
16933
  position: 'absolute',
17168
16934
  opacity: 0,
@@ -17327,7 +17093,7 @@
17327
17093
  const {
17328
17094
  ownerState
17329
17095
  } = props;
17330
- return [styles.root, ownerState.indeterminate && styles.indeterminate, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];
17096
+ return [styles.root, ownerState.indeterminate && styles.indeterminate, styles[`size${capitalize(ownerState.size)}`], ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];
17331
17097
  }
17332
17098
  })(({
17333
17099
  theme,
@@ -20088,7 +19854,9 @@
20088
19854
 
20089
19855
  var _span;
20090
19856
  const _excluded$8 = ["children", "classes", "className", "label", "notched"];
20091
- const NotchedOutlineRoot$1 = styled$1('fieldset')({
19857
+ const NotchedOutlineRoot$1 = styled$1('fieldset', {
19858
+ shouldForwardProp: rootShouldForwardProp
19859
+ })({
20092
19860
  textAlign: 'left',
20093
19861
  position: 'absolute',
20094
19862
  bottom: 0,
@@ -20104,7 +19872,9 @@
20104
19872
  overflow: 'hidden',
20105
19873
  minWidth: '0%'
20106
19874
  });
20107
- const NotchedOutlineLegend = styled$1('legend')(({
19875
+ const NotchedOutlineLegend = styled$1('legend', {
19876
+ shouldForwardProp: rootShouldForwardProp
19877
+ })(({
20108
19878
  ownerState,
20109
19879
  theme
20110
19880
  }) => _extends$5({
@@ -20360,7 +20130,9 @@
20360
20130
  d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
20361
20131
  }), 'RadioButtonChecked');
20362
20132
 
20363
- const RadioButtonIconRoot = styled$1('span')({
20133
+ const RadioButtonIconRoot = styled$1('span', {
20134
+ shouldForwardProp: rootShouldForwardProp
20135
+ })({
20364
20136
  position: 'relative',
20365
20137
  display: 'flex'
20366
20138
  });
@@ -20450,7 +20222,7 @@
20450
20222
  const {
20451
20223
  ownerState
20452
20224
  } = props;
20453
- return [styles.root, styles[`color${capitalize(ownerState.color)}`]];
20225
+ return [styles.root, ownerState.size !== 'medium' && styles[`size${capitalize(ownerState.size)}`], styles[`color${capitalize(ownerState.color)}`]];
20454
20226
  }
20455
20227
  })(({
20456
20228
  theme,
@@ -20546,7 +20318,7 @@
20546
20318
  var tooltipClasses$1 = tooltipClasses;
20547
20319
 
20548
20320
  const _excluded$5 = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
20549
- function round(value) {
20321
+ function round$1(value) {
20550
20322
  return Math.round(value * 1e5) / 1e5;
20551
20323
  }
20552
20324
  const useUtilityClasses = ownerState => {
@@ -20655,7 +20427,7 @@
20655
20427
  }, ownerState.touch && {
20656
20428
  padding: '8px 16px',
20657
20429
  fontSize: theme.typography.pxToRem(14),
20658
- lineHeight: `${round(16 / 14)}em`,
20430
+ lineHeight: `${round$1(16 / 14)}em`,
20659
20431
  fontWeight: theme.typography.fontWeightRegular
20660
20432
  }, {
20661
20433
  [`.${tooltipClasses$1.popper}[data-popper-placement*="left"] &`]: _extends$5({
@@ -22513,7 +22285,6 @@
22513
22285
  shouldForwardProp: p => p !== 'styles'
22514
22286
  })(_ref => {
22515
22287
  let {
22516
- theme,
22517
22288
  styles
22518
22289
  } = _ref;
22519
22290
  return {
@@ -22544,13 +22315,13 @@
22544
22315
  borderRadius: borderRadius - 1,
22545
22316
  width: 12,
22546
22317
  height: 12,
22547
- backgroundColor: theme.palette.selected.excluded
22318
+ backgroundColor: styles.selections.excluded
22548
22319
  },
22549
22320
  ["& .".concat(classes$b.cbIconAlternative)]: {
22550
22321
  borderRadius: borderRadius - 1,
22551
22322
  width: 12,
22552
22323
  height: 12,
22553
- backgroundColor: theme.palette.selected.alternative
22324
+ backgroundColor: styles.selections.alternative
22554
22325
  },
22555
22326
  ["&.".concat(classes$b.checkbox)]: {
22556
22327
  margin: 0,
@@ -26959,7 +26730,7 @@
26959
26730
  styles
26960
26731
  } = _ref;
26961
26732
  return {
26962
- color: styles.content.color
26733
+ color: styles.search.color
26963
26734
  };
26964
26735
  });
26965
26736
  const StyledOutlinedInput = styled$1(OutlinedInput$1, {
@@ -26969,8 +26740,10 @@
26969
26740
  styles
26970
26741
  } = _ref2;
26971
26742
  return {
26972
- color: styles.content.color,
26973
- display: 'flex'
26743
+ display: 'flex',
26744
+ '& .MuiInputBase-root': {
26745
+ color: styles.search.color
26746
+ }
26974
26747
  };
26975
26748
  });
26976
26749
  function ListBoxSearch(_ref3) {
@@ -27589,57 +27362,1614 @@
27589
27362
  return totalCounts > 0;
27590
27363
  }
27591
27364
 
27592
- const LIGHT = '#FFF';
27593
- const DARK = '#000';
27594
- const TRANSPARENT = 'rgba(255, 255, 255, 0)';
27365
+ const colorStruct = {
27366
+ aliceblue: {
27367
+ r: 240,
27368
+ g: 248,
27369
+ b: 255
27370
+ },
27371
+ antiquewhite: {
27372
+ r: 250,
27373
+ g: 235,
27374
+ b: 215
27375
+ },
27376
+ aqua: {
27377
+ r: 0,
27378
+ g: 255,
27379
+ b: 255
27380
+ },
27381
+ aquamarine: {
27382
+ r: 127,
27383
+ g: 255,
27384
+ b: 212
27385
+ },
27386
+ azure: {
27387
+ r: 240,
27388
+ g: 255,
27389
+ b: 255
27390
+ },
27391
+ beige: {
27392
+ r: 245,
27393
+ g: 245,
27394
+ b: 220
27395
+ },
27396
+ bisque: {
27397
+ r: 255,
27398
+ g: 228,
27399
+ b: 196
27400
+ },
27401
+ black: {
27402
+ r: 0,
27403
+ g: 0,
27404
+ b: 0
27405
+ },
27406
+ blanchedalmond: {
27407
+ r: 255,
27408
+ g: 235,
27409
+ b: 205
27410
+ },
27411
+ blue: {
27412
+ r: 0,
27413
+ g: 0,
27414
+ b: 255
27415
+ },
27416
+ blueviolet: {
27417
+ r: 138,
27418
+ g: 43,
27419
+ b: 226
27420
+ },
27421
+ brown: {
27422
+ r: 165,
27423
+ g: 42,
27424
+ b: 42
27425
+ },
27426
+ burlywood: {
27427
+ r: 222,
27428
+ g: 184,
27429
+ b: 135
27430
+ },
27431
+ cadetblue: {
27432
+ r: 95,
27433
+ g: 158,
27434
+ b: 160
27435
+ },
27436
+ chartreuse: {
27437
+ r: 127,
27438
+ g: 255,
27439
+ b: 0
27440
+ },
27441
+ chocolate: {
27442
+ r: 210,
27443
+ g: 105,
27444
+ b: 30
27445
+ },
27446
+ coral: {
27447
+ r: 255,
27448
+ g: 127,
27449
+ b: 80
27450
+ },
27451
+ cornflowerblue: {
27452
+ r: 100,
27453
+ g: 149,
27454
+ b: 237
27455
+ },
27456
+ cornsilk: {
27457
+ r: 255,
27458
+ g: 248,
27459
+ b: 220
27460
+ },
27461
+ crimson: {
27462
+ r: 220,
27463
+ g: 20,
27464
+ b: 60
27465
+ },
27466
+ cyan: {
27467
+ r: 0,
27468
+ g: 255,
27469
+ b: 255
27470
+ },
27471
+ darkblue: {
27472
+ r: 0,
27473
+ g: 0,
27474
+ b: 139
27475
+ },
27476
+ darkcyan: {
27477
+ r: 0,
27478
+ g: 139,
27479
+ b: 139
27480
+ },
27481
+ darkgoldenrod: {
27482
+ r: 184,
27483
+ g: 134,
27484
+ b: 11
27485
+ },
27486
+ darkgray: {
27487
+ r: 169,
27488
+ g: 169,
27489
+ b: 169
27490
+ },
27491
+ darkgreen: {
27492
+ r: 0,
27493
+ g: 100,
27494
+ b: 0
27495
+ },
27496
+ darkgrey: {
27497
+ r: 169,
27498
+ g: 169,
27499
+ b: 169
27500
+ },
27501
+ darkkhaki: {
27502
+ r: 189,
27503
+ g: 183,
27504
+ b: 107
27505
+ },
27506
+ darkmagenta: {
27507
+ r: 139,
27508
+ g: 0,
27509
+ b: 139
27510
+ },
27511
+ darkolivegreen: {
27512
+ r: 85,
27513
+ g: 107,
27514
+ b: 47
27515
+ },
27516
+ darkorange: {
27517
+ r: 255,
27518
+ g: 140,
27519
+ b: 0
27520
+ },
27521
+ darkorchid: {
27522
+ r: 153,
27523
+ g: 50,
27524
+ b: 204
27525
+ },
27526
+ darkred: {
27527
+ r: 139,
27528
+ g: 0,
27529
+ b: 0
27530
+ },
27531
+ darksalmon: {
27532
+ r: 233,
27533
+ g: 150,
27534
+ b: 122
27535
+ },
27536
+ darkseagreen: {
27537
+ r: 143,
27538
+ g: 188,
27539
+ b: 143
27540
+ },
27541
+ darkslateblue: {
27542
+ r: 72,
27543
+ g: 61,
27544
+ b: 139
27545
+ },
27546
+ darkslategray: {
27547
+ r: 47,
27548
+ g: 79,
27549
+ b: 79
27550
+ },
27551
+ darkslategrey: {
27552
+ r: 47,
27553
+ g: 79,
27554
+ b: 79
27555
+ },
27556
+ darkturquoise: {
27557
+ r: 0,
27558
+ g: 206,
27559
+ b: 209
27560
+ },
27561
+ darkviolet: {
27562
+ r: 148,
27563
+ g: 0,
27564
+ b: 211
27565
+ },
27566
+ deeppink: {
27567
+ r: 255,
27568
+ g: 20,
27569
+ b: 147
27570
+ },
27571
+ deepskyblue: {
27572
+ r: 0,
27573
+ g: 191,
27574
+ b: 255
27575
+ },
27576
+ dimgray: {
27577
+ r: 105,
27578
+ g: 105,
27579
+ b: 105
27580
+ },
27581
+ dimgrey: {
27582
+ r: 105,
27583
+ g: 105,
27584
+ b: 105
27585
+ },
27586
+ dodgerblue: {
27587
+ r: 30,
27588
+ g: 144,
27589
+ b: 255
27590
+ },
27591
+ firebrick: {
27592
+ r: 178,
27593
+ g: 34,
27594
+ b: 34
27595
+ },
27596
+ floralwhite: {
27597
+ r: 255,
27598
+ g: 250,
27599
+ b: 240
27600
+ },
27601
+ forestgreen: {
27602
+ r: 34,
27603
+ g: 139,
27604
+ b: 34
27605
+ },
27606
+ fuchsia: {
27607
+ r: 255,
27608
+ g: 0,
27609
+ b: 255
27610
+ },
27611
+ gainsboro: {
27612
+ r: 220,
27613
+ g: 220,
27614
+ b: 220
27615
+ },
27616
+ ghostwhite: {
27617
+ r: 248,
27618
+ g: 248,
27619
+ b: 255
27620
+ },
27621
+ gold: {
27622
+ r: 255,
27623
+ g: 215,
27624
+ b: 0
27625
+ },
27626
+ goldenrod: {
27627
+ r: 218,
27628
+ g: 165,
27629
+ b: 32
27630
+ },
27631
+ gray: {
27632
+ r: 128,
27633
+ g: 128,
27634
+ b: 128
27635
+ },
27636
+ green: {
27637
+ r: 0,
27638
+ g: 128,
27639
+ b: 0
27640
+ },
27641
+ greenyellow: {
27642
+ r: 173,
27643
+ g: 255,
27644
+ b: 47
27645
+ },
27646
+ grey: {
27647
+ r: 128,
27648
+ g: 128,
27649
+ b: 128
27650
+ },
27651
+ honeydew: {
27652
+ r: 240,
27653
+ g: 255,
27654
+ b: 240
27655
+ },
27656
+ hotpink: {
27657
+ r: 255,
27658
+ g: 105,
27659
+ b: 180
27660
+ },
27661
+ indianred: {
27662
+ r: 205,
27663
+ g: 92,
27664
+ b: 92
27665
+ },
27666
+ indigo: {
27667
+ r: 75,
27668
+ g: 0,
27669
+ b: 130
27670
+ },
27671
+ ivory: {
27672
+ r: 255,
27673
+ g: 255,
27674
+ b: 240
27675
+ },
27676
+ khaki: {
27677
+ r: 240,
27678
+ g: 230,
27679
+ b: 140
27680
+ },
27681
+ lavender: {
27682
+ r: 230,
27683
+ g: 230,
27684
+ b: 250
27685
+ },
27686
+ lavenderblush: {
27687
+ r: 255,
27688
+ g: 240,
27689
+ b: 245
27690
+ },
27691
+ lawngreen: {
27692
+ r: 124,
27693
+ g: 252,
27694
+ b: 0
27695
+ },
27696
+ lemonchiffon: {
27697
+ r: 255,
27698
+ g: 250,
27699
+ b: 205
27700
+ },
27701
+ lightblue: {
27702
+ r: 173,
27703
+ g: 216,
27704
+ b: 230
27705
+ },
27706
+ lightcoral: {
27707
+ r: 240,
27708
+ g: 128,
27709
+ b: 128
27710
+ },
27711
+ lightcyan: {
27712
+ r: 224,
27713
+ g: 255,
27714
+ b: 255
27715
+ },
27716
+ lightgoldenrodyellow: {
27717
+ r: 250,
27718
+ g: 250,
27719
+ b: 210
27720
+ },
27721
+ lightgray: {
27722
+ r: 211,
27723
+ g: 211,
27724
+ b: 211
27725
+ },
27726
+ lightgreen: {
27727
+ r: 144,
27728
+ g: 238,
27729
+ b: 144
27730
+ },
27731
+ lightgrey: {
27732
+ r: 211,
27733
+ g: 211,
27734
+ b: 211
27735
+ },
27736
+ lightpink: {
27737
+ r: 255,
27738
+ g: 182,
27739
+ b: 193
27740
+ },
27741
+ lightsalmon: {
27742
+ r: 255,
27743
+ g: 160,
27744
+ b: 122
27745
+ },
27746
+ lightseagreen: {
27747
+ r: 32,
27748
+ g: 178,
27749
+ b: 170
27750
+ },
27751
+ lightskyblue: {
27752
+ r: 135,
27753
+ g: 206,
27754
+ b: 250
27755
+ },
27756
+ lightslategray: {
27757
+ r: 119,
27758
+ g: 136,
27759
+ b: 153
27760
+ },
27761
+ lightslategrey: {
27762
+ r: 119,
27763
+ g: 136,
27764
+ b: 153
27765
+ },
27766
+ lightsteelblue: {
27767
+ r: 176,
27768
+ g: 196,
27769
+ b: 222
27770
+ },
27771
+ lightyellow: {
27772
+ r: 255,
27773
+ g: 255,
27774
+ b: 224
27775
+ },
27776
+ lime: {
27777
+ r: 0,
27778
+ g: 255,
27779
+ b: 0
27780
+ },
27781
+ limegreen: {
27782
+ r: 50,
27783
+ g: 205,
27784
+ b: 50
27785
+ },
27786
+ linen: {
27787
+ r: 250,
27788
+ g: 240,
27789
+ b: 230
27790
+ },
27791
+ magenta: {
27792
+ r: 255,
27793
+ g: 0,
27794
+ b: 255
27795
+ },
27796
+ maroon: {
27797
+ r: 128,
27798
+ g: 0,
27799
+ b: 0
27800
+ },
27801
+ mediumaquamarine: {
27802
+ r: 102,
27803
+ g: 205,
27804
+ b: 170
27805
+ },
27806
+ mediumblue: {
27807
+ r: 0,
27808
+ g: 0,
27809
+ b: 205
27810
+ },
27811
+ mediumorchid: {
27812
+ r: 186,
27813
+ g: 85,
27814
+ b: 211
27815
+ },
27816
+ mediumpurple: {
27817
+ r: 147,
27818
+ g: 112,
27819
+ b: 219
27820
+ },
27821
+ mediumseagreen: {
27822
+ r: 60,
27823
+ g: 179,
27824
+ b: 113
27825
+ },
27826
+ mediumslateblue: {
27827
+ r: 123,
27828
+ g: 104,
27829
+ b: 238
27830
+ },
27831
+ mediumspringgreen: {
27832
+ r: 0,
27833
+ g: 250,
27834
+ b: 154
27835
+ },
27836
+ mediumturquoise: {
27837
+ r: 72,
27838
+ g: 209,
27839
+ b: 204
27840
+ },
27841
+ mediumvioletred: {
27842
+ r: 199,
27843
+ g: 21,
27844
+ b: 133
27845
+ },
27846
+ midnightblue: {
27847
+ r: 25,
27848
+ g: 25,
27849
+ b: 112
27850
+ },
27851
+ mintcream: {
27852
+ r: 245,
27853
+ g: 255,
27854
+ b: 250
27855
+ },
27856
+ mistyrose: {
27857
+ r: 255,
27858
+ g: 228,
27859
+ b: 225
27860
+ },
27861
+ moccasin: {
27862
+ r: 255,
27863
+ g: 228,
27864
+ b: 181
27865
+ },
27866
+ navajowhite: {
27867
+ r: 255,
27868
+ g: 222,
27869
+ b: 173
27870
+ },
27871
+ navy: {
27872
+ r: 0,
27873
+ g: 0,
27874
+ b: 128
27875
+ },
27876
+ oldlace: {
27877
+ r: 253,
27878
+ g: 245,
27879
+ b: 230
27880
+ },
27881
+ olive: {
27882
+ r: 128,
27883
+ g: 128,
27884
+ b: 0
27885
+ },
27886
+ olivedrab: {
27887
+ r: 107,
27888
+ g: 142,
27889
+ b: 35
27890
+ },
27891
+ orange: {
27892
+ r: 255,
27893
+ g: 165,
27894
+ b: 0
27895
+ },
27896
+ orangered: {
27897
+ r: 255,
27898
+ g: 69,
27899
+ b: 0
27900
+ },
27901
+ orchid: {
27902
+ r: 218,
27903
+ g: 112,
27904
+ b: 214
27905
+ },
27906
+ palegoldenrod: {
27907
+ r: 238,
27908
+ g: 232,
27909
+ b: 170
27910
+ },
27911
+ palegreen: {
27912
+ r: 152,
27913
+ g: 251,
27914
+ b: 152
27915
+ },
27916
+ paleturquoise: {
27917
+ r: 175,
27918
+ g: 238,
27919
+ b: 238
27920
+ },
27921
+ palevioletred: {
27922
+ r: 219,
27923
+ g: 112,
27924
+ b: 147
27925
+ },
27926
+ papayawhip: {
27927
+ r: 255,
27928
+ g: 239,
27929
+ b: 213
27930
+ },
27931
+ peachpuff: {
27932
+ r: 255,
27933
+ g: 218,
27934
+ b: 185
27935
+ },
27936
+ peru: {
27937
+ r: 205,
27938
+ g: 133,
27939
+ b: 63
27940
+ },
27941
+ pink: {
27942
+ r: 255,
27943
+ g: 192,
27944
+ b: 203
27945
+ },
27946
+ plum: {
27947
+ r: 221,
27948
+ g: 160,
27949
+ b: 221
27950
+ },
27951
+ powderblue: {
27952
+ r: 176,
27953
+ g: 224,
27954
+ b: 230
27955
+ },
27956
+ purple: {
27957
+ r: 128,
27958
+ g: 0,
27959
+ b: 128
27960
+ },
27961
+ red: {
27962
+ r: 255,
27963
+ g: 0,
27964
+ b: 0
27965
+ },
27966
+ rosybrown: {
27967
+ r: 188,
27968
+ g: 143,
27969
+ b: 143
27970
+ },
27971
+ royalblue: {
27972
+ r: 65,
27973
+ g: 105,
27974
+ b: 225
27975
+ },
27976
+ saddlebrown: {
27977
+ r: 139,
27978
+ g: 69,
27979
+ b: 19
27980
+ },
27981
+ salmon: {
27982
+ r: 250,
27983
+ g: 128,
27984
+ b: 114
27985
+ },
27986
+ sandybrown: {
27987
+ r: 244,
27988
+ g: 164,
27989
+ b: 96
27990
+ },
27991
+ seagreen: {
27992
+ r: 46,
27993
+ g: 139,
27994
+ b: 87
27995
+ },
27996
+ seashell: {
27997
+ r: 255,
27998
+ g: 245,
27999
+ b: 238
28000
+ },
28001
+ sienna: {
28002
+ r: 160,
28003
+ g: 82,
28004
+ b: 45
28005
+ },
28006
+ silver: {
28007
+ r: 192,
28008
+ g: 192,
28009
+ b: 192
28010
+ },
28011
+ skyblue: {
28012
+ r: 135,
28013
+ g: 206,
28014
+ b: 235
28015
+ },
28016
+ slateblue: {
28017
+ r: 106,
28018
+ g: 90,
28019
+ b: 205
28020
+ },
28021
+ slategray: {
28022
+ r: 112,
28023
+ g: 128,
28024
+ b: 144
28025
+ },
28026
+ slategrey: {
28027
+ r: 112,
28028
+ g: 128,
28029
+ b: 144
28030
+ },
28031
+ snow: {
28032
+ r: 255,
28033
+ g: 250,
28034
+ b: 250
28035
+ },
28036
+ springgreen: {
28037
+ r: 0,
28038
+ g: 255,
28039
+ b: 127
28040
+ },
28041
+ steelblue: {
28042
+ r: 70,
28043
+ g: 130,
28044
+ b: 180
28045
+ },
28046
+ tan: {
28047
+ r: 210,
28048
+ g: 180,
28049
+ b: 140
28050
+ },
28051
+ teal: {
28052
+ r: 0,
28053
+ g: 128,
28054
+ b: 128
28055
+ },
28056
+ thistle: {
28057
+ r: 216,
28058
+ g: 191,
28059
+ b: 216
28060
+ },
28061
+ tomato: {
28062
+ r: 255,
28063
+ g: 99,
28064
+ b: 71
28065
+ },
28066
+ transparent: {
28067
+ r: 255,
28068
+ g: 255,
28069
+ b: 255,
28070
+ a: 0
28071
+ },
28072
+ turquoise: {
28073
+ r: 64,
28074
+ g: 224,
28075
+ b: 208
28076
+ },
28077
+ violet: {
28078
+ r: 238,
28079
+ g: 130,
28080
+ b: 238
28081
+ },
28082
+ wheat: {
28083
+ r: 245,
28084
+ g: 222,
28085
+ b: 179
28086
+ },
28087
+ white: {
28088
+ r: 255,
28089
+ g: 255,
28090
+ b: 255
28091
+ },
28092
+ whitesmoke: {
28093
+ r: 245,
28094
+ g: 245,
28095
+ b: 245
28096
+ },
28097
+ yellow: {
28098
+ r: 255,
28099
+ g: 255,
28100
+ b: 0
28101
+ },
28102
+ yellowgreen: {
28103
+ r: 154,
28104
+ g: 205,
28105
+ b: 50
28106
+ }
28107
+ };
28108
+
28109
+ /* eslint-disable no-param-reassign */
28110
+ /* eslint-disable camelcase */
28111
+ /* eslint-disable no-nested-ternary */
28112
+ /* eslint-disable no-cond-assign */
28113
+ /* eslint-disable prefer-destructuring */
28114
+ /* eslint-disable no-underscore-dangle */
28115
+
27595
28116
 
27596
28117
  /**
27597
- * If needed, converts a named color to a more reliable CSS color format.
27598
- *
27599
- * @param {string} c The CSS color.
27600
- * @returns {string} Converted color or same color as before.
28118
+ * Module which defines a color object
27601
28119
  * @private
28120
+ * @exports objects.views/charts/representation/color
28121
+ * @expose module:objects.views/charts/representation/color~Color
28122
+ */
28123
+
28124
+ // color formats
28125
+ const rgb = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i;
28126
+ const rgba = /^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i;
28127
+ const hex = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i;
28128
+ const hexShort = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/i;
28129
+ const hsl = /^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i;
28130
+ const hsla = /^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i;
28131
+ const {
28132
+ floor
28133
+ } = Math;
28134
+ const {
28135
+ round
28136
+ } = Math;
28137
+
28138
+ /**
28139
+ * @class
28140
+ * @classdesc Class which provides color transformation functionality
28141
+ * @description This is a constructor.
28142
+ * @private This is a constructor.
28143
+ * @param {object} - Parameters to create a color from different notations
27602
28144
  * @example
27603
- * convertNamedColor('red') => '#FF0000'
28145
+ * // a few ways of instantiating a red color
28146
+ * var red;
28147
+ * red = new Color(255, 0, 0, 1); // rgba as parameters
28148
+ * red = new Color('#ff0000'); // hex
28149
+ * red = new Color('rgb(255,0,0)');//rgb as string
28150
+ * red = new Color('hsl(0, 100, 50)');// hsl as string
28151
+ * red = new Color(16711680);// uint
27604
28152
  */
27605
- function convertNamedColor(c) {
27606
- let out = c;
27607
- try {
27608
- if (c in namedColors) {
27609
- ({
27610
- 500: out
27611
- } = namedColors[c]); // 500 exposes the standard color
27612
- } else if (c === 'transparent') {
27613
- out = TRANSPARENT;
28153
+ class Color {
28154
+ constructor() {
28155
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28156
+ args[_key] = arguments[_key];
27614
28157
  }
27615
- } catch (err) {
27616
- out = c;
28158
+ let r = 0;
28159
+ let g = 0;
28160
+ let b = 0;
28161
+ let a = 1;
28162
+ let h;
28163
+ let s;
28164
+ let lcs;
28165
+ let l;
28166
+ let v;
28167
+ let c;
28168
+ let h_;
28169
+ let x;
28170
+ let rgb_;
28171
+ let m;
28172
+ let matches;
28173
+ let colorString;
28174
+ this._invalid = false;
28175
+ if (args[0] instanceof Color) {
28176
+ r = args[0]._r;
28177
+ g = args[0]._g;
28178
+ b = args[0]._b;
28179
+ a = args[0]._a;
28180
+ this._invalid = args[0]._invalid;
28181
+ } else if (args.length < 3) {
28182
+ if (typeof args[0] === 'string') {
28183
+ colorString = args[0];
28184
+ if (matches = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(colorString)) {
28185
+ r = parseInt(matches[1], 10);
28186
+ g = parseInt(matches[2], 10);
28187
+ b = parseInt(matches[3], 10);
28188
+ } else if (matches = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(colorString)) {
28189
+ // rgba(1, 2, 3, 0.4)
28190
+ r = parseInt(matches[1], 10);
28191
+ g = parseInt(matches[2], 10);
28192
+ b = parseInt(matches[3], 10);
28193
+ a = parseFloat(matches[4]);
28194
+ } else if (matches = /^ARGB\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(colorString)) {
28195
+ // ARGB(255,255,255,255)
28196
+ a = parseInt(matches[1], 10) / 255;
28197
+ r = parseInt(matches[2], 10);
28198
+ g = parseInt(matches[3], 10);
28199
+ b = parseInt(matches[4], 10);
28200
+ } else if (matches = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(colorString)) {
28201
+ // #aBc123
28202
+ r = parseInt(matches[1], 16);
28203
+ g = parseInt(matches[2], 16);
28204
+ b = parseInt(matches[3], 16);
28205
+ a = 1;
28206
+ } else if (matches = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(colorString)) {
28207
+ // #a5F
28208
+ r = parseInt(matches[1] + matches[1], 16);
28209
+ g = parseInt(matches[2] + matches[2], 16);
28210
+ b = parseInt(matches[3] + matches[3], 16);
28211
+ a = 1;
28212
+ } else if (matches = /^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(colorString)) {
28213
+ // hsl(1, 2, 3)
28214
+ h = parseFloat(matches[1]);
28215
+ s = parseFloat(matches[3]);
28216
+ l = parseFloat(matches[5]);
28217
+ h %= 360;
28218
+ s /= 100;
28219
+ l /= 100;
28220
+ h = h < 0 ? 0 : h > 360 ? 360 : h;
28221
+ s = s < 0 ? 0 : s > 1 ? 1 : s;
28222
+ l = l < 0 ? 0 : l > 1 ? 1 : l;
28223
+ c = l <= 0.5 ? 2 * l * s : (2 - 2 * l) * s;
28224
+ h_ = h / 60;
28225
+ x = c * (1 - Math.abs(h_ % 2 - 1));
28226
+ rgb_ = [];
28227
+ h_ = Math.floor(h_);
28228
+ switch (h_) {
28229
+ case 0:
28230
+ rgb_ = [c, x, 0];
28231
+ break;
28232
+ case 1:
28233
+ rgb_ = [x, c, 0];
28234
+ break;
28235
+ case 2:
28236
+ rgb_ = [0, c, x];
28237
+ break;
28238
+ case 3:
28239
+ rgb_ = [0, x, c];
28240
+ break;
28241
+ case 4:
28242
+ rgb_ = [x, 0, c];
28243
+ break;
28244
+ case 5:
28245
+ rgb_ = [c, 0, x];
28246
+ break;
28247
+ default:
28248
+ rgb_ = [0, 0, 0];
28249
+ }
28250
+ m = l - 0.5 * c;
28251
+ r = rgb_[0] + m;
28252
+ g = rgb_[1] + m;
28253
+ b = rgb_[2] + m;
28254
+ r = round(255 * r);
28255
+ g = round(255 * g);
28256
+ b = round(255 * b);
28257
+ a = 1.0;
28258
+ } else if (matches = /^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(colorString)) {
28259
+ // hsla(1,2,3,0.4)
28260
+ h = parseFloat(matches[1]);
28261
+ s = parseFloat(matches[3]);
28262
+ l = parseFloat(matches[5]);
28263
+ a = parseFloat(matches[7]);
28264
+ h %= 360;
28265
+ s /= 100;
28266
+ l /= 100;
28267
+ h = h < 0 ? 0 : h > 360 ? 360 : h;
28268
+ s = s < 0 ? 0 : s > 1 ? 1 : s;
28269
+ l = l < 0 ? 0 : l > 1 ? 1 : l;
28270
+ c = l <= 0.5 ? 2 * l * s : (2 - 2 * l) * s;
28271
+ h_ = h / 60;
28272
+ x = c * (1 - Math.abs(h_ % 2 - 1));
28273
+ rgb_ = [];
28274
+ h_ = Math.floor(h_);
28275
+ switch (h_) {
28276
+ case 0:
28277
+ rgb_ = [c, x, 0];
28278
+ break;
28279
+ case 1:
28280
+ rgb_ = [x, c, 0];
28281
+ break;
28282
+ case 2:
28283
+ rgb_ = [0, c, x];
28284
+ break;
28285
+ case 3:
28286
+ rgb_ = [0, x, c];
28287
+ break;
28288
+ case 4:
28289
+ rgb_ = [x, 0, c];
28290
+ break;
28291
+ case 5:
28292
+ rgb_ = [c, 0, x];
28293
+ break;
28294
+ default:
28295
+ rgb_ = [0, 0, 0];
28296
+ }
28297
+ m = l - 0.5 * c;
28298
+ r = rgb_[0] + m;
28299
+ g = rgb_[1] + m;
28300
+ b = rgb_[2] + m;
28301
+ r = round(255 * r);
28302
+ g = round(255 * g);
28303
+ b = round(255 * b);
28304
+ } else if (matches = /^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(colorString)) {
28305
+ // hsv(1, 2, 3) {
28306
+ h = parseFloat(matches[1]);
28307
+ s = parseFloat(matches[3]);
28308
+ v = parseFloat(matches[5]);
28309
+ h %= 360;
28310
+ s /= 100;
28311
+ v /= 100;
28312
+ h = h < 0 ? 0 : h > 360 ? 360 : h;
28313
+ s = s < 0 ? 0 : s > 1 ? 1 : s;
28314
+ v = v < 0 ? 0 : v > 1 ? 1 : v;
28315
+ c = v * s;
28316
+ h_ = h / 60;
28317
+ x = c * (1 - Math.abs(h_ % 2 - 1));
28318
+ rgb_ = [];
28319
+ h_ = Math.floor(h_);
28320
+ switch (h_) {
28321
+ case 0:
28322
+ rgb_ = [c, x, 0];
28323
+ break;
28324
+ case 1:
28325
+ rgb_ = [x, c, 0];
28326
+ break;
28327
+ case 2:
28328
+ rgb_ = [0, c, x];
28329
+ break;
28330
+ case 3:
28331
+ rgb_ = [0, x, c];
28332
+ break;
28333
+ case 4:
28334
+ rgb_ = [x, 0, c];
28335
+ break;
28336
+ case 5:
28337
+ rgb_ = [c, 0, x];
28338
+ break;
28339
+ default:
28340
+ rgb_ = [0, 0, 0];
28341
+ }
28342
+ m = v - c;
28343
+ r = rgb_[0] + m;
28344
+ g = rgb_[1] + m;
28345
+ b = rgb_[2] + m;
28346
+ r = round(255 * r);
28347
+ g = round(255 * g);
28348
+ b = round(255 * b);
28349
+ a = 1.0;
28350
+ } else if (colorStruct[colorString.toLowerCase()]) {
28351
+ lcs = colorString.toLowerCase();
28352
+ r = colorStruct[lcs].r;
28353
+ g = colorStruct[lcs].g;
28354
+ b = colorStruct[lcs].b;
28355
+ a = typeof colorStruct[lcs].a === 'number' ? colorStruct[lcs].a : 1.0;
28356
+ } else {
28357
+ this._invalid = true;
28358
+ }
28359
+ } else if (typeof args[0] === 'number' && args[0] >= 0 && args[1] === 'argb') {
28360
+ a = (0xff000000 & args[0]) >>> 24;
28361
+ a /= 255;
28362
+ r = (0xff0000 & args[0]) >> 16;
28363
+ g = (0x00ff00 & args[0]) >> 8;
28364
+ b = 0x0000ff & args[0];
28365
+ } else if (typeof args[0] === 'number' && args[0] >= 0) {
28366
+ r = (0xff0000 & args[0]) >> 16;
28367
+ g = (0x00ff00 & args[0]) >> 8;
28368
+ b = 0x0000ff & args[0];
28369
+ } else {
28370
+ this._invalid = true;
28371
+ }
28372
+ } else if (args.length >= 3) {
28373
+ r = args[0];
28374
+ g = args[1];
28375
+ b = args[2];
28376
+ a = arguments.length >= 4 ? args[3] : 1;
28377
+ } else {
28378
+ this._invalid = true;
28379
+ }
28380
+ if (Number.isNaN(+r + g + b + a)) {
28381
+ this._invalid = true;
28382
+ }
28383
+ this._r = floor(r);
28384
+ this._g = floor(g);
28385
+ this._b = floor(b);
28386
+ this._a = a;
28387
+
28388
+ // object to cache string representations in various color spaces
28389
+ this._spaces = {};
28390
+ }
28391
+ isInvalid() {
28392
+ return this._invalid;
28393
+ }
28394
+
28395
+ /**
28396
+ * Sets alpha value of color
28397
+ * @private
28398
+ * @param {number} a - Alpha value of the color
28399
+ */
28400
+ setAlpha(a) {
28401
+ this._a = a;
28402
+ this._spaces = {};
28403
+ }
28404
+
28405
+ /**
28406
+ * Gets the alpha value of this color
28407
+ * @private
28408
+ * @returns {number}
28409
+ */
28410
+ getAlpha() {
28411
+ return this._a;
28412
+ }
28413
+
28414
+ /**
28415
+ * Returns an rgb string representation of this color.
28416
+ * @private
28417
+ * @return {string} An rgb string representation of this color
28418
+ */
28419
+ toRGB() {
28420
+ if (!this._spaces.rgb) {
28421
+ this._spaces.rgb = Color.toRGB(this);
28422
+ }
28423
+ return this._spaces.rgb;
28424
+ }
28425
+
28426
+ /**
28427
+ * Returns an rgba string representation of this color.
28428
+ * @private
28429
+ * @return {string} An rgba string representation of this color.
28430
+ */
28431
+ toRGBA() {
28432
+ if (!this._spaces.rgba) {
28433
+ this._spaces.rgba = Color.toRGBA(this);
28434
+ }
28435
+ return this._spaces.rgba;
28436
+ }
28437
+ toString() {
28438
+ if (!this._spaces.rgb) {
28439
+ this._spaces.rgb = Color.toRGB(this);
28440
+ }
28441
+ return this._spaces.rgb;
28442
+ }
28443
+
28444
+ /**
28445
+ * Returns a hex string representation of this color.
28446
+ * @private
28447
+ * @return {string}
28448
+ */
28449
+ toHex() {
28450
+ if (!this._spaces.hex) {
28451
+ this._spaces.hex = Color.toHex(this);
28452
+ }
28453
+ return this._spaces.hex;
28454
+ }
28455
+
28456
+ /**
28457
+ * Returns a hsl string representation of this color using "bi-hexcone" model for lightness
28458
+ * @private
28459
+ * @param {boolean} luma - Whether to use luma calculation
28460
+ * @return {string} In format hsl(0,0,0)
28461
+ */
28462
+ toHSL(luma) {
28463
+ if (!this._spaces.hsl) {
28464
+ this._spaces.hsl = Color.toHSL(this, luma);
28465
+ }
28466
+ return this._spaces.hsl;
28467
+ }
28468
+
28469
+ /**
28470
+ * Returns a hsla string representation of this color using "bi-hexcone" model for lightness
28471
+ * @private
28472
+ * @param {boolean} luma - Whether to use luma calculation
28473
+ * @return {string} In format hsla(0,0,0,0)
28474
+ */
28475
+ toHSLA(luma) {
28476
+ if (!this._spaces.hsla) {
28477
+ this._spaces.hsla = Color.toHSLA(this, luma);
28478
+ }
28479
+ return this._spaces.hsla;
28480
+ }
28481
+
28482
+ /**
28483
+ * Return the color components in hsv space using "hexcone" model for value (lightness)
28484
+ * @private
28485
+ * @param {Color|string} c
28486
+ * @returns {object} The color components in hsv space {h:0-360, s:0-100, v:0-100}
28487
+ */
28488
+ toHSV() {
28489
+ const hsvComp = this.toHSVComponents();
28490
+ return "hsv(".concat(hsvComp.h, ",").concat(hsvComp.s, ",").concat(hsvComp.v, ")");
28491
+ }
28492
+
28493
+ /**
28494
+ * Return the color components in hsv space using "hexcone" model for value (lightness)
28495
+ * @private
28496
+ * @param {Color|string} c
28497
+ * @returns {object} The color components in hsv space {h:0-360, s:0-100, v:0-100}
28498
+ */
28499
+ toHSVComponents() {
28500
+ if (!this._spaces.hsvComp) {
28501
+ this._spaces.hsvComp = Color.toHSVComponents(this);
28502
+ }
28503
+ return this._spaces.hsvComp;
28504
+ }
28505
+
28506
+ /**
28507
+ * Returns a uint representation of this color
28508
+ * @private
28509
+ * @return {number}
28510
+ */
28511
+ toNumber() {
28512
+ if (!this._spaces.num) {
28513
+ this._spaces.num = Color.toNumber(this);
28514
+ }
28515
+ return this._spaces.num;
28516
+ }
28517
+
28518
+ /**
28519
+ * Checks if this color is perceived as dark.
28520
+ * @private
28521
+ * @return {string} True if the luminance is below 160, false otherwise.
28522
+ */
28523
+ isDark() {
28524
+ return this.isInvalid() || this.getLuminance() < 125; // luminace calc option #2
28525
+ // return this.getLuminance() < 160; //luminace calc option #3
28526
+ }
28527
+
28528
+ /**
28529
+ * Calculates the perceived luminance of the color.
28530
+ * @private
28531
+ * @return {number} A value in the range 0-255 where a low value is considered dark and vice versa.
28532
+ */
28533
+ getLuminance() {
28534
+ // alpha channel is not considered
28535
+ if (typeof this._lumi === 'undefined') {
28536
+ // calculate luminance
28537
+ // this._lumi = 0.2126 * this._r + 0.7152 * this._g + 0.0722 * this._b; // option 1
28538
+ this._lumi = 0.299 * this._r + 0.587 * this._g + 0.114 * this._b; // option 2
28539
+ // this._lumi = Math.sqrt( 0.241 * this._r * this._r + 0.691 * this._g * this._g + 0.068 * this._b * this._b ); // option 3
28540
+ }
28541
+
28542
+ return this._lumi;
28543
+ }
28544
+
28545
+ /**
28546
+ * Shifts the color towards a lighter or darker shade
28547
+ * @private
28548
+ * @param {number} value - A value in the range -100-100 to shift the color with along the HSL lightness.
28549
+ * @return {string} The shifted color as hsla string.
28550
+ */
28551
+ shiftLuminance(value) {
28552
+ const chsla = this.toHSLA();
28553
+ const matches = /^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(chsla);
28554
+ const h = parseFloat(matches[1]);
28555
+ const s = parseFloat(matches[3]);
28556
+ let l = parseFloat(matches[5]);
28557
+ const a = parseFloat(matches[7]);
28558
+ // l *= 1 + value / 100;
28559
+ // l = Math.max( 0, l % 100 );
28560
+ l += value;
28561
+ l = Math.max(0, Math.min(l, 100));
28562
+
28563
+ // if( value > 0 ){
28564
+ // s = s*0.2; //removing saturation to avoid the border from being too light
28565
+ // }
28566
+
28567
+ return "hsla(".concat(h, ",").concat(s, ",").concat(l, ",").concat(a, ")");
28568
+ }
28569
+
28570
+ /**
28571
+ * Compares two colors.
28572
+ * @private
28573
+ * @param {Color} c The color to compare with.
28574
+ * @return {boolean} True if the rgba channels are the same, false otherwise
28575
+ */
28576
+ isEqual(c) {
28577
+ if (c instanceof Color) {
28578
+ return this._r === c._r && this._g === c._g && this._b === c._b && this._a === c._a;
28579
+ }
28580
+ c = new Color(c);
28581
+ return this._r === c._r && this._g === c._g && this._b === c._b && this._a === c._a;
28582
+ }
28583
+
28584
+ /**
28585
+ * Linearly interpolates each channel of two colors.
28586
+ * @private
28587
+ * @param {Color} c2 The other color.
28588
+ * @param {number} t The interpolation value in the range (0-1).
28589
+ * @return {string} The blend as an rgb string.
28590
+ */
28591
+ blend(c2, t) {
28592
+ const r = floor(this._r + (c2._r - this._r) * t);
28593
+ const g = floor(this._g + (c2._g - this._g) * t);
28594
+ const b = floor(this._b + (c2._b - this._b) * t);
28595
+ const a = floor(this._a + (c2._a - this._a) * t);
28596
+ return "rgba(".concat([r, g, b, a].join(','), ")");
28597
+ }
28598
+ createShiftedColor(v) {
28599
+ if (v === undefined || Number.isNaN(+v)) {
28600
+ v = 1;
28601
+ }
28602
+ const lumi = this.getLuminance();
28603
+ const greenMultiplier = this._g < 126 ? 1 : 1 + this._g / 512;
28604
+ const hsla_string = this.shiftLuminance((lumi * greenMultiplier < 220 ? 0.8 + 4 * (1 / (lumi + 1)) : -(0.8 + 1 * (lumi / 255))) * 20 * v);
28605
+ return new Color(hsla_string);
28606
+ }
28607
+
28608
+ /**
28609
+ * Returns an rgb string representation of this color
28610
+ * @private
28611
+ * @param {Color|string} c
28612
+ * @returns {string} An rgb string with channel values within range 0-255.
28613
+ */
28614
+ static toRGB(c) {
28615
+ if (c instanceof Color) {
28616
+ return "rgb(".concat([c._r, c._g, c._b].join(','), ")");
28617
+ }
28618
+ if (typeof c === 'string') {
28619
+ c = Color.toNumber(c);
28620
+ }
28621
+ const r = (c & 0xff0000) >> 16;
28622
+ const g = (c & 0x00ff00) >> 8;
28623
+ const b = c & 0x0000ff;
28624
+ return "rgb(".concat(r, ",").concat(g, ",").concat(b, ")");
28625
+ }
28626
+
28627
+ /**
28628
+ *
28629
+ * @private
28630
+ * @param c
28631
+ * @param a
28632
+ * @returns {string} The color rgb format.
28633
+ */
28634
+ static toRGBA(c, a) {
28635
+ if (c instanceof Color) {
28636
+ return "rgba(".concat([c._r, c._g, c._b, typeof a !== 'undefined' ? a : c._a].join(','), ")");
28637
+ }
28638
+ if (typeof c === 'string') {
28639
+ c = Color.toNumber(c);
28640
+ }
28641
+ const r = (c & 0xff0000) >> 16;
28642
+ const g = (c & 0x00ff00) >> 8;
28643
+ const b = c & 0x0000ff;
28644
+ return "rgba(".concat(r, ",").concat(g, ",").concat(b, ",").concat(typeof a !== 'undefined' ? a : c._a, ")");
28645
+ }
28646
+
28647
+ /**
28648
+ *
28649
+ * @private
28650
+ * @param {Color|string} c
28651
+ * @returns {string} The color in hexadecimal space.
28652
+ */
28653
+ static toHex(c) {
28654
+ let r;
28655
+ let g;
28656
+ let b;
28657
+ if (c instanceof Color) {
28658
+ r = c._r.toString(16);
28659
+ g = c._g.toString(16);
28660
+ b = c._b.toString(16);
28661
+ if (r.length === 1) {
28662
+ r = "0".concat(r);
28663
+ }
28664
+ if (g.length === 1) {
28665
+ g = "0".concat(g);
28666
+ }
28667
+ if (b.length === 1) {
28668
+ b = "0".concat(b);
28669
+ }
28670
+ return "#".concat([r, g, b].join(''));
28671
+ }
28672
+ if (typeof c === 'string') {
28673
+ c = Color.toNumber(c);
28674
+ }
28675
+ r = ((c & 0xff0000) >> 16).toString(16);
28676
+ g = ((c & 0x00ff00) >> 8).toString(16);
28677
+ b = (c & 0x0000ff).toString(16);
28678
+ if (r.length === 1) {
28679
+ r = "0".concat(r);
28680
+ }
28681
+ if (g.length === 1) {
28682
+ g = "0".concat(g);
28683
+ }
28684
+ if (b.length === 1) {
28685
+ b = "0".concat(b);
28686
+ }
28687
+ return "#".concat(r).concat(g).concat(b);
28688
+ }
28689
+
28690
+ /**
28691
+ * Return the color in hsl space using "bi-hexcone" model for lightness
28692
+ * @private
28693
+ * @param {Color|string} c
28694
+ * @param {boolean} luma - Whether to use luma calculation
28695
+ * @returns {string} The color in hsl space.
28696
+ */
28697
+ static toHSL(c, luma) {
28698
+ let h = 0;
28699
+ let s;
28700
+ let l;
28701
+ let ch;
28702
+ if (typeof c === 'string') {
28703
+ c = new Color(c);
28704
+ }
28705
+
28706
+ // red, green, blue, hue, saturation, lightness/luma, max, min, chroma
28707
+ const r = c._r / 255;
28708
+ const g = c._g / 255;
28709
+ const b = c._b / 255;
28710
+ const max = Math.max(r, g, b);
28711
+ const min = Math.min(r, g, b);
28712
+ if (luma) {
28713
+ // Y'709 http://en.wikipedia.org/wiki/Rec._709
28714
+ // Y′709 = 0.21R + 0.72G + 0.07B
28715
+ l = 0.21 * r + 0.72 * g + 0.07 * b;
28716
+ } else {
28717
+ l = (max + min) / 2;
28718
+ }
28719
+ if (max === min) {
28720
+ // greyscale
28721
+ s = 0;
28722
+ h = 0;
28723
+ } else {
28724
+ ch = max - min;
28725
+ s = l > 0.5 ? ch / (2 - max - min) : ch / (max + min);
28726
+ switch (max) {
28727
+ case r:
28728
+ h = (g - b) / ch + (g < b ? 6 : 0);
28729
+ break;
28730
+ case g:
28731
+ h = (b - r) / ch + 2;
28732
+ break;
28733
+ case b:
28734
+ h = (r - g) / ch + 4;
28735
+ break;
28736
+ }
28737
+ h /= 6;
28738
+ }
28739
+ return "hsl(".concat(h * 360, ",").concat(s * 100, ",").concat(l * 100, ")");
28740
+ }
28741
+
28742
+ /**
28743
+ * Return the color in hsla space using "bi-hexcone" model for lightness
28744
+ * @private
28745
+ * @param {Color|string} c
28746
+ * @param {boolean} luma - Whether to use luma calculation
28747
+ * @returns {string} The color in hsla space.
28748
+ */
28749
+ static toHSLA(c, luma) {
28750
+ let h = 0;
28751
+ let s;
28752
+ let l;
28753
+ let ch;
28754
+ if (typeof c === 'string') {
28755
+ c = new Color(c);
28756
+ }
28757
+
28758
+ // red, green, blue, hue, saturation, lightness/luma, max, min, chroma
28759
+ const r = c._r / 255;
28760
+ const g = c._g / 255;
28761
+ const b = c._b / 255;
28762
+ const a = c._a;
28763
+ const max = Math.max(r, g, b);
28764
+ const min = Math.min(r, g, b);
28765
+ if (luma) {
28766
+ // Y'709 http://en.wikipedia.org/wiki/Rec._709
28767
+ // Y′709 = 0.21R + 0.72G + 0.07B
28768
+ l = 0.21 * r + 0.72 * g + 0.07 * b;
28769
+ } else {
28770
+ l = (max + min) / 2;
28771
+ }
28772
+ if (max === min) {
28773
+ // greyscale
28774
+ s = 0;
28775
+ h = 0;
28776
+ } else {
28777
+ ch = max - min;
28778
+ s = l > 0.5 ? ch / (2 - max - min) : ch / (max + min);
28779
+ switch (max) {
28780
+ case r:
28781
+ h = (g - b) / ch + (g < b ? 6 : 0);
28782
+ break;
28783
+ case g:
28784
+ h = (b - r) / ch + 2;
28785
+ break;
28786
+ case b:
28787
+ h = (r - g) / ch + 4;
28788
+ break;
28789
+ }
28790
+ h /= 6;
28791
+ }
28792
+ return "hsla(".concat(h * 360, ",").concat(s * 100, ",").concat(l * 100, ",").concat(a, ")");
28793
+ }
28794
+
28795
+ /**
28796
+ * Return the color components in hsv space using "hexcone" model for value (lightness)
28797
+ * @private
28798
+ * @param {Color|string} c
28799
+ * @returns {object} The color components in hsv space {h:0-360, s:0-100, v:0-100}
28800
+ */
28801
+ static toHSVComponents(c) {
28802
+ let h = 0;
28803
+ let s;
28804
+ let ch;
28805
+ if (typeof c === 'string') {
28806
+ c = new Color(c);
28807
+ }
28808
+
28809
+ // red, green, blue, hue, saturation, value/luma, max, min, chroma
28810
+ const r = c._r / 255;
28811
+ const g = c._g / 255;
28812
+ const b = c._b / 255;
28813
+ const max = Math.max(r, g, b);
28814
+ const min = Math.min(r, g, b);
28815
+ const v = max;
28816
+ if (max === min) {
28817
+ // greyscale
28818
+ s = 0;
28819
+ h = 0;
28820
+ } else {
28821
+ ch = max - min;
28822
+ s = ch === 0 ? 0 : ch / v;
28823
+ switch (max) {
28824
+ case r:
28825
+ h = (g - b) / ch + (g < b ? 6 : 0);
28826
+ break;
28827
+ case g:
28828
+ h = (b - r) / ch + 2;
28829
+ break;
28830
+ case b:
28831
+ h = (r - g) / ch + 4;
28832
+ break;
28833
+ }
28834
+ h /= 6;
28835
+ }
28836
+ return {
28837
+ h: h * 360 % 360,
28838
+ s: s * 100,
28839
+ v: v * 100
28840
+ };
28841
+ }
28842
+
28843
+ /**
28844
+ * Returns an number representation of the color
28845
+ * @private
28846
+ * @param {Color|string} c
28847
+ * @returns {Number} Unsigned integer in the range 0-16 777 216
28848
+ */
28849
+ static toNumber() {
28850
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
28851
+ args[_key2] = arguments[_key2];
28852
+ }
28853
+ if (args.length === 1 && args[0] instanceof Color) {
28854
+ return (args[0]._r << 16) + (args[0]._g << 8) + args[0]._b;
28855
+ }
28856
+ let r = 0;
28857
+ let g = 0;
28858
+ let b = 0;
28859
+ let matches;
28860
+ let colorString;
28861
+ if (args.length === 1) {
28862
+ if (typeof args[0] === 'string') {
28863
+ colorString = args[0];
28864
+ if (matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(colorString)) {
28865
+ r = parseInt(matches[1], 10);
28866
+ g = parseInt(matches[2], 10);
28867
+ b = parseInt(matches[3], 10);
28868
+ } else if (matches = /^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(colorString)) {
28869
+ r = parseInt(matches[1], 16);
28870
+ g = parseInt(matches[2], 16);
28871
+ b = parseInt(matches[3], 16);
28872
+ } else if (matches = /^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(colorString)) {
28873
+ r = parseInt(matches[1] + matches[1], 16);
28874
+ g = parseInt(matches[2] + matches[2], 16);
28875
+ b = parseInt(matches[3] + matches[3], 16);
28876
+ }
28877
+ }
28878
+ }
28879
+ return (r << 16) + (g << 8) + b;
28880
+ }
28881
+ static blend(c1, c2, t) {
28882
+ c1 = Color.toNumber(c1);
28883
+ c2 = Color.toNumber(c2);
28884
+ const r1 = (c1 & 0xff0000) >> 16;
28885
+ const g1 = (c1 & 0x00ff00) >> 8;
28886
+ const b1 = c1 & 0x0000ff;
28887
+ const r2 = (c2 & 0xff0000) >> 16;
28888
+ const g2 = (c2 & 0x00ff00) >> 8;
28889
+ const b2 = c2 & 0x0000ff;
28890
+ const r = r1 + (r2 - r1) * t;
28891
+ const g = g1 + (g2 - g1) * t;
28892
+ const b = b1 + (b2 - b1) * t;
28893
+ return (r << 16) + (g << 8) + b;
28894
+ }
28895
+ static getBlend(c1, c2, t) {
28896
+ const r = c1._r + (c2._r - c1._r) * t;
28897
+ const g = c1._g + (c2._g - c1._g) * t;
28898
+ const b = c1._b + (c2._b - c1._b) * t;
28899
+ const a = c1._a + (c2._a - c1._a) * t;
28900
+ return new Color(r, g, b, a);
28901
+ }
28902
+ static isCSSColor(color) {
28903
+ if (arguments.length > 1 || typeof color !== 'string') {
28904
+ return false;
28905
+ }
28906
+ return rgb.test(color) || rgba.test(color) || hex.test(color) || hexShort.test(color) || hsl.test(color) || hsla.test(color) || colorStruct[color.toLowerCase()];
28907
+ }
28908
+ static getBestContrast(color, cl, cd) {
28909
+ const lum = color.getLuminance();
28910
+ return Math.abs(lum - cl.getLuminance()) > Math.abs(lum - cd.getLuminance()) ? cl : cd;
28911
+ }
28912
+ static getContrast(color1, color2) {
28913
+ if (!color1 || !color2) {
28914
+ return undefined;
28915
+ }
28916
+ const l1 = color1.getLuminance() / 100;
28917
+ const l2 = color2.getLuminance() / 100;
28918
+ if (l1 > l2) {
28919
+ return (l1 + 0.05) / (l2 + 0.05);
28920
+ }
28921
+ return (l2 + 0.05) / (l1 + 0.05);
28922
+ }
28923
+ static isDark() {
28924
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
28925
+ args[_key3] = arguments[_key3];
28926
+ }
28927
+ const C = new Color(...args);
28928
+ return C.isDark(...args);
28929
+ }
28930
+ static useDarkLabel(areaColor, bgIsDark) {
28931
+ return areaColor._a > 0.5 ? !areaColor.isDark() : !bgIsDark;
27617
28932
  }
27618
- return out;
27619
28933
  }
27620
- const hasEnoughContrast = (desiredTextColor, backgroundColor) => {
27621
- const desired = convertNamedColor(desiredTextColor);
27622
- const background = convertNamedColor(backgroundColor);
27623
- const CONTRAST_THRESHOLD = 3.0;
27624
- let isContrastingEnough;
28934
+
28935
+ const LIGHT = '#FFF';
28936
+ const DARK = '#000';
28937
+ const CONTRAST_THRESHOLD = 1.5;
28938
+ const LIGHT_PREFERRED_THRESHOLD = 3;
28939
+ const getContrast = (desired, background) => {
28940
+ let contrast = false;
28941
+ const des = new Color(desired);
28942
+ const bg = new Color(background);
28943
+ if (bg.isInvalid() || des.isInvalid() || bg.getAlpha() < 1 || des.getAlpha() < 1) {
28944
+ return undefined;
28945
+ }
27625
28946
  try {
27626
- isContrastingEnough = getContrastRatio(desired, background) > CONTRAST_THRESHOLD;
28947
+ contrast = Color.getContrast(des, bg);
27627
28948
  } catch (err) {
27628
- // The function throws on unsupported or misspelled colors.
27629
- // In these cases, simply return true.
27630
- isContrastingEnough = true;
28949
+ contrast = undefined;
27631
28950
  }
27632
- return isContrastingEnough;
28951
+ return contrast;
27633
28952
  };
27634
28953
  function getContrastingColor(backgroundColor) {
27635
28954
  let desiredTextColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
27636
28955
  let dark = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DARK;
27637
28956
  let light = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : LIGHT;
28957
+ const lightColor = new Color(light);
28958
+ const bg = new Color(backgroundColor);
28959
+ const des = new Color(desiredTextColor);
28960
+ if (bg.isInvalid() || des.isInvalid() || bg.getAlpha() < 1 || des.getAlpha() < 1) {
28961
+ return desiredTextColor;
28962
+ }
28963
+
28964
+ // Always prioritise light color if it gives better contrast than desired color's.
28965
+ const lightColorContrast = getContrast(lightColor, bg);
28966
+ const desiredColorContrast = getContrast(des, bg);
28967
+ const useLightColor = lightColorContrast > desiredColorContrast || lightColorContrast > LIGHT_PREFERRED_THRESHOLD;
27638
28968
  let contrastingColor;
27639
- if (desiredTextColor && hasEnoughContrast(desiredTextColor, backgroundColor)) {
28969
+ if (desiredTextColor && desiredColorContrast > CONTRAST_THRESHOLD && !useLightColor) {
27640
28970
  contrastingColor = desiredTextColor;
27641
28971
  } else {
27642
- contrastingColor = hasEnoughContrast(light, backgroundColor) ? light : dark;
28972
+ contrastingColor = useLightColor ? light : dark;
27643
28973
  }
27644
28974
  return contrastingColor;
27645
28975
  }
@@ -27656,10 +28986,17 @@
27656
28986
  });
27657
28987
  return overrides;
27658
28988
  }
27659
- function getSelectionColors(theme, getListboxStyle, overrides) {
28989
+ function getSelectionColors(_ref) {
27660
28990
  var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections, _selectionColors$sele, _theme$palette2, _selectionColors$alte, _theme$palette3, _selectionColors$excl, _theme$palette4, _selectionColors$sele2, _theme$palette5, _selectionColors$poss, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10, _theme$palette11;
27661
- const desiredTextColor = ((_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.fontColor) === null || _overrides$theme === void 0 ? void 0 : _overrides$theme.color) || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
27662
- const useContrastTextColor = (_overrides$theme$cont = (_overrides$theme2 = overrides.theme) === null || _overrides$theme2 === void 0 || (_overrides$theme2 = _overrides$theme2.content) === null || _overrides$theme2 === void 0 ? void 0 : _overrides$theme2.useContrastColor) !== null && _overrides$theme$cont !== void 0 ? _overrides$theme$cont : true;
28991
+ let {
28992
+ theme,
28993
+ getListboxStyle,
28994
+ overrides,
28995
+ checkboxes
28996
+ } = _ref;
28997
+ const componentContentTextColor = (_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.fontColor) === null || _overrides$theme === void 0 ? void 0 : _overrides$theme.color;
28998
+ const desiredTextColor = componentContentTextColor || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
28999
+ const useContrastTextColor = !checkboxes && ((_overrides$theme$cont = (_overrides$theme2 = overrides.theme) === null || _overrides$theme2 === void 0 || (_overrides$theme2 = _overrides$theme2.content) === null || _overrides$theme2 === void 0 ? void 0 : _overrides$theme2.useContrastColor) !== null && _overrides$theme$cont !== void 0 ? _overrides$theme$cont : true);
27663
29000
 
27664
29001
  // Background colors
27665
29002
  const selectionColors = ((_overrides$selections = overrides.selections) === null || _overrides$selections === void 0 ? void 0 : _overrides$selections.colors) || {};
@@ -27670,7 +29007,7 @@
27670
29007
  const possible = ((_selectionColors$poss = selectionColors.possible) === null || _selectionColors$poss === void 0 ? void 0 : _selectionColors$poss.color) || getListboxStyle('', 'backgroundColor') || ((_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.selected.possible) || '#FFFFFF';
27671
29008
 
27672
29009
  // Font colors
27673
- let selectedContrast = desiredTextColor || ((_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.selected.main);
29010
+ let selectedContrast = desiredTextColor || ((_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.selected.selectedContrastText);
27674
29011
  let alternativeContrast = desiredTextColor || ((_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.selected.alternativeContrastText);
27675
29012
  let excludedContrast = desiredTextColor || ((_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.selected.excludedContrastText);
27676
29013
  let selectedExcludedContrast = desiredTextColor || ((_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.selected.selectedExcludedContrastText);
@@ -27696,17 +29033,22 @@
27696
29033
  possibleContrast
27697
29034
  };
27698
29035
  }
27699
- function getStyles(_ref) {
29036
+ function getStyles(_ref2) {
27700
29037
  var _themeOverrides$heade, _themeOverrides$heade2, _themeOverrides$conte;
27701
29038
  let {
27702
29039
  themeApi,
27703
29040
  theme,
27704
29041
  components = [],
27705
29042
  checkboxes = false
27706
- } = _ref;
29043
+ } = _ref2;
27707
29044
  const overrides = getOverridesAsObject(components);
27708
29045
  const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
27709
- const selections = getSelectionColors(theme, getListboxStyle, overrides);
29046
+ const selections = getSelectionColors({
29047
+ theme,
29048
+ getListboxStyle,
29049
+ overrides,
29050
+ checkboxes
29051
+ });
27710
29052
  const themeOverrides = overrides.theme || {};
27711
29053
  return {
27712
29054
  backgroundColor: getListboxStyle('', 'backgroundColor') || theme.palette.background.default,
@@ -27722,6 +29064,9 @@
27722
29064
  fontSize: ((_themeOverrides$conte = themeOverrides.content) === null || _themeOverrides$conte === void 0 ? void 0 : _themeOverrides$conte.fontSize) || getListboxStyle('content', 'fontSize'),
27723
29065
  fontFamily: getListboxStyle('content', 'fontFamily')
27724
29066
  },
29067
+ search: {
29068
+ color: getListboxStyle('content', 'color')
29069
+ },
27725
29070
  selections
27726
29071
  };
27727
29072
  }
@@ -32267,6 +33612,85 @@
32267
33612
  }));
32268
33613
  }
32269
33614
 
33615
+ const MULTI_REG = /,(?![^(]*\))/;
33616
+ const SINGLE_REG = /\s(?![^(]*\))/;
33617
+ const LENGTH_REG = /^[0-9]+[a-zA-Z%]+?$/;
33618
+ const PREDEFINED_STRINGS = ['none', 'inset', 'initial', 'inherit'];
33619
+ const isLength = v => v === '0' || LENGTH_REG.test(v);
33620
+ const getColor = singleShadowString => {
33621
+ if (!singleShadowString) return undefined;
33622
+ const parts = singleShadowString.split(SINGLE_REG).filter(part => !PREDEFINED_STRINGS.includes(part.toLowerCase()));
33623
+ const last = parts.at(-1);
33624
+ const color = last && !isLength(last) && !PREDEFINED_STRINGS.includes(last.toLowerCase()) ? last : undefined;
33625
+ return color;
33626
+ };
33627
+ const getShadows = shadowString => {
33628
+ if (!shadowString) return [];
33629
+ return shadowString.split(MULTI_REG).map(s => s.trim());
33630
+ };
33631
+
33632
+ /**
33633
+ * Combine box shadow with box shadow color.
33634
+ * @param {string} boxShadow - Box shadow which may include color
33635
+ * @param {string} themeBoxShadow - Box shadow from theme which may include color
33636
+ * @param {string | undefined} boxShadowColor - Box shadow color
33637
+ * @returns {string} Returns the combined box shadow and box shadow color
33638
+ *
33639
+ * If boxShadow is a single shadow and has a color then this color will be replaced by boxShadowColor and then
33640
+ * returned as the result,otherwise boxShadowColor will be added to boxShadow and then returned as the result.
33641
+ * If boxShadow is multiple shadows or an empty string then it will be returned as the result.
33642
+ *
33643
+ * @example getFullBoxShadow('none', '', 'red') returns 'none'
33644
+ *
33645
+ * @example getFullBoxShadow('initial', '', 'red') returns 'initial'
33646
+ *
33647
+ * @example getFullBoxShadow('inherit', '', 'red') returns 'inherit'
33648
+ *
33649
+ * @example getFullBoxShadow('', '', 'red') returns ''
33650
+ *
33651
+ * @example getFullBoxShadow('1px 2px blue, 3px 6px green', '', 'red') returns '1px 2px blue, 3px 6px green'
33652
+ *
33653
+ * @example getFullBoxShadow('1px 2px blue', '', 'red') returns '1px 2px red'
33654
+ *
33655
+ * @example getFullBoxShadow('1px 2px', '', 'red') returns '1px 2px red'
33656
+ *
33657
+ * @example getFullBoxShadow('1px 2px', '2px 5px green', undefined) returns '1px 2px green'
33658
+ *
33659
+ * @example getFullBoxShadow('1px 2px', '2px 5px', undefined) returns '1px 2px'
33660
+ */
33661
+ const getFullBoxShadow = (boxShadow, themeBoxShadow, boxShadowColor) => {
33662
+ if (boxShadow && PREDEFINED_STRINGS.includes(boxShadow.toLowerCase())) return boxShadow.toLowerCase();
33663
+ const shadowArray = getShadows(boxShadow);
33664
+ if (shadowArray.length !== 1) return boxShadow;
33665
+ let shadowColor = boxShadowColor;
33666
+ if (!shadowColor) {
33667
+ const themeShadowArray = getShadows(themeBoxShadow);
33668
+ if (themeShadowArray.length !== 1) return boxShadow;
33669
+ shadowColor = getColor(themeShadowArray[0]);
33670
+ }
33671
+ if (!shadowColor) return boxShadow;
33672
+ const color = getColor(shadowArray[0]);
33673
+ if (color) return boxShadow.replace(color, shadowColor);
33674
+ return "".concat(boxShadow, " ").concat(shadowColor);
33675
+ };
33676
+
33677
+ function resolveProperty(path, attribute, theme, objectType) {
33678
+ if (theme && objectType) {
33679
+ return theme.getStyle("object.".concat(objectType), path, attribute);
33680
+ }
33681
+ if (theme) {
33682
+ return theme.getStyle('', path, attribute);
33683
+ }
33684
+ return undefined;
33685
+ }
33686
+
33687
+ function resolveColor(colorObj, path, attribute, theme, objectType) {
33688
+ if (colorObj && theme) {
33689
+ return colorObj.color !== 'none' ? theme.getColorPickerColor(colorObj, true) : undefined;
33690
+ }
33691
+ return resolveProperty(path, attribute, theme, objectType);
33692
+ }
33693
+
32270
33694
  const imageSizingToCssProperty = {
32271
33695
  originalSize: 'auto auto',
32272
33696
  alwaysFit: 'contain',
@@ -32344,21 +33768,29 @@
32344
33768
  }
32345
33769
  return undefined;
32346
33770
  }
32347
- function resolveBgColor(bgComp, theme, objectType) {
32348
- const bgColor = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgColor;
33771
+ function resolveBgColor(comp, theme, objectType) {
33772
+ const bgColor = comp === null || comp === void 0 ? void 0 : comp.bgColor;
32349
33773
  if (bgColor && theme) {
32350
33774
  if (bgColor.useExpression) {
32351
33775
  return theme.validateColor(bgColor.colorExpression);
32352
33776
  }
32353
- return bgColor.color && bgColor.color.color !== 'none' ? theme.getColorPickerColor(bgColor.color, true) : undefined;
32354
- }
32355
- if (theme && objectType) {
32356
- return theme.getStyle("object.".concat(objectType), '', 'backgroundColor');
32357
33777
  }
32358
- if (theme) {
32359
- return theme.getStyle('', '', 'backgroundColor');
32360
- }
32361
- return undefined;
33778
+ return resolveColor(bgColor === null || bgColor === void 0 ? void 0 : bgColor.color, '', 'backgroundColor', theme, objectType);
33779
+ }
33780
+ function resolveBorder(comp, theme, objectType) {
33781
+ const borderColor = resolveColor(comp === null || comp === void 0 ? void 0 : comp.borderColor, '', 'borderColor', theme, objectType);
33782
+ const borderWidth = (comp === null || comp === void 0 ? void 0 : comp.borderWidth) || resolveProperty('', 'borderWidth', theme, objectType);
33783
+ return borderWidth && borderColor ? "".concat(borderWidth, " solid ").concat(borderColor) : undefined;
33784
+ }
33785
+ function resolveBorderRadius(comp, theme, objectType) {
33786
+ return (comp === null || comp === void 0 ? void 0 : comp.borderRadius) || resolveProperty('', 'borderRadius', theme, objectType);
33787
+ }
33788
+ function resolveBoxShadow(comp, theme, objectType) {
33789
+ var _comp$shadow, _comp$shadow2;
33790
+ const themeBoxShadow = resolveProperty('shadow', 'boxShadow', theme, objectType);
33791
+ const boxShadow = (comp === null || comp === void 0 || (_comp$shadow = comp.shadow) === null || _comp$shadow === void 0 ? void 0 : _comp$shadow.boxShadow) || themeBoxShadow;
33792
+ const boxShadowColor = resolveColor(comp === null || comp === void 0 || (_comp$shadow2 = comp.shadow) === null || _comp$shadow2 === void 0 ? void 0 : _comp$shadow2.boxShadowColor, 'shadow', 'boxShadowColor', theme, objectType);
33793
+ return getFullBoxShadow(boxShadow, themeBoxShadow, boxShadowColor);
32362
33794
  }
32363
33795
  function unfurlFontStyle(fontStyle, target) {
32364
33796
  if (fontStyle && Array.isArray(fontStyle)) {
@@ -32379,6 +33811,34 @@
32379
33811
  };
32380
33812
  }
32381
33813
 
33814
+ const useStyling = (layout, theme, app, themeName) => {
33815
+ const styling = reactExports.useMemo(() => {
33816
+ if (layout && theme) {
33817
+ const generalComp = layout.components ? layout.components.find(comp => comp.key === 'general') : null;
33818
+ const titleStyles = {
33819
+ main: resolveTextStyle(generalComp, 'main', theme, layout.visualization),
33820
+ footer: resolveTextStyle(generalComp, 'footer', theme, layout.visualization),
33821
+ subTitle: resolveTextStyle(generalComp, 'subTitle', theme, layout.visualization)
33822
+ };
33823
+ const bgColor = resolveBgColor(generalComp, theme, layout.visualization);
33824
+ const bgImage = resolveBgImage(generalComp, app);
33825
+ const border = resolveBorder(generalComp, theme, layout.visualization);
33826
+ const borderRadius = resolveBorderRadius(generalComp, theme, layout.visualization);
33827
+ const boxShadow = resolveBoxShadow(generalComp, theme, layout.visualization);
33828
+ return {
33829
+ titleStyles,
33830
+ bgColor,
33831
+ bgImage,
33832
+ border,
33833
+ borderRadius,
33834
+ boxShadow
33835
+ };
33836
+ }
33837
+ return {};
33838
+ }, [layout, theme, app, themeName]);
33839
+ return styling;
33840
+ };
33841
+
32382
33842
  /**
32383
33843
  * @interface
32384
33844
  * @extends HTMLElement
@@ -32708,9 +34168,14 @@
32708
34168
  enter: null,
32709
34169
  leave: null
32710
34170
  });
32711
- const [bgColor, setBgColor] = reactExports.useState(undefined);
32712
- const [bgImage, setBgImage] = reactExports.useState(undefined); // {url: "", size: "", pos: ""}
32713
- const [titleStyles, setTitleStyles] = reactExports.useState(undefined);
34171
+ const {
34172
+ titleStyles,
34173
+ bgColor,
34174
+ bgImage,
34175
+ border,
34176
+ borderRadius,
34177
+ boxShadow
34178
+ } = useStyling(layout, halo.public.theme, halo.app, themeName);
32714
34179
  const focusHandler = reactExports.useRef({
32715
34180
  focusToolbarButton(last) {
32716
34181
  // eslint-disable-next-line react/no-this-in-sfc
@@ -32720,18 +34185,6 @@
32720
34185
  reactExports.useEffect(() => {
32721
34186
  eventmixin(focusHandler.current);
32722
34187
  }, []);
32723
- reactExports.useEffect(() => {
32724
- if (layout && halo.public.theme) {
32725
- const bgComp = layout.components ? layout.components.find(comp => comp.key === 'general') : null;
32726
- setTitleStyles({
32727
- main: resolveTextStyle(bgComp, 'main', halo.public.theme, layout.visualization),
32728
- footer: resolveTextStyle(bgComp, 'footer', halo.public.theme, layout.visualization),
32729
- subTitle: resolveTextStyle(bgComp, 'subTitle', halo.public.theme, layout.visualization)
32730
- });
32731
- setBgColor(resolveBgColor(bgComp, halo.public.theme, layout.visualization));
32732
- setBgImage(resolveBgImage(bgComp, halo.app));
32733
- }
32734
- }, [layout, halo.public.theme, halo.app, themeName]);
32735
34188
  focusHandler.current.blurCallback = resetFocus => {
32736
34189
  halo.root.toggleFocusOfCells();
32737
34190
  if (resetFocus && contentNode) {
@@ -32922,7 +34375,11 @@
32922
34375
  backgroundImage: bgImage && bgImage.url ? "url(".concat(bgImage.url, ")") : undefined,
32923
34376
  backgroundRepeat: 'no-repeat',
32924
34377
  backgroundSize: bgImage && bgImage.size,
32925
- backgroundPosition: bgImage && bgImage.pos
34378
+ backgroundPosition: bgImage && bgImage.pos,
34379
+ border,
34380
+ borderRadius,
34381
+ boxShadow,
34382
+ boxSizing: 'border-box'
32926
34383
  },
32927
34384
  elevation: 0,
32928
34385
  square: true,