{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nconst round = Math.round;\n\n/**\n * Support format, alpha unit will check the % mark:\n * - rgba(102, 204, 255, .5)      -> [102, 204, 255, 0.5]\n * - rgb(102 204 255 / .5)        -> [102, 204, 255, 0.5]\n * - rgb(100%, 50%, 0% / 50%)     -> [255, 128, 0, 0.5]\n * - hsl(270, 60, 40, .5)         -> [270, 60, 40, 0.5]\n * - hsl(270deg 60% 40% / 50%)   -> [270, 60, 40, 0.5]\n *\n * When `base` is provided, the percentage value will be divided by `base`.\n */\nfunction splitColorStr(str, parseNum) {\n  const match = str\n  // Remove str before `(`\n  .replace(/^[^(]*\\((.*)/, '$1')\n  // Remove str after `)`\n  .replace(/\\).*/, '').match(/\\d*\\.?\\d+%?/g) || [];\n  const numList = match.map(item => parseFloat(item));\n  for (let i = 0; i < 3; i += 1) {\n    numList[i] = parseNum(numList[i] || 0, match[i] || '', i);\n  }\n\n  // For alpha. 50% should be 0.5\n  if (match[3]) {\n    numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];\n  } else {\n    // By default, alpha is 1\n    numList[3] = 1;\n  }\n  return numList;\n}\nconst parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;\n\n/** round and limit number to integer between 0-255 */\nfunction limitRange(value, max) {\n  const mergedMax = max || 255;\n  if (value > mergedMax) {\n    return mergedMax;\n  }\n  if (value < 0) {\n    return 0;\n  }\n  return value;\n}\nexport class FastColor {\n  constructor(input) {\n    /**\n     * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.\n     */\n    _defineProperty(this, \"isValid\", true);\n    /**\n     * Red, R in RGB\n     */\n    _defineProperty(this, \"r\", 0);\n    /**\n     * Green, G in RGB\n     */\n    _defineProperty(this, \"g\", 0);\n    /**\n     * Blue, B in RGB\n     */\n    _defineProperty(this, \"b\", 0);\n    /**\n     * Alpha/Opacity, A in RGBA/HSLA\n     */\n    _defineProperty(this, \"a\", 1);\n    // HSV privates\n    _defineProperty(this, \"_h\", void 0);\n    _defineProperty(this, \"_s\", void 0);\n    _defineProperty(this, \"_l\", void 0);\n    _defineProperty(this, \"_v\", void 0);\n    // intermediate variables to calculate HSL/HSV\n    _defineProperty(this, \"_max\", void 0);\n    _defineProperty(this, \"_min\", void 0);\n    _defineProperty(this, \"_brightness\", void 0);\n    /**\n     * Always check 3 char in the object to determine the format.\n     * We not use function in check to save bundle size.\n     * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.\n     */\n    function matchFormat(str) {\n      return str[0] in input && str[1] in input && str[2] in input;\n    }\n    if (!input) {\n      // Do nothing since already initialized\n    } else if (typeof input === 'string') {\n      const trimStr = input.trim();\n      function matchPrefix(prefix) {\n        return trimStr.startsWith(prefix);\n      }\n      if (/^#?[A-F\\d]{3,8}$/i.test(trimStr)) {\n        this.fromHexString(trimStr);\n      } else if (matchPrefix('rgb')) {\n        this.fromRgbString(trimStr);\n      } else if (matchPrefix('hsl')) {\n        this.fromHslString(trimStr);\n      } else if (matchPrefix('hsv') || matchPrefix('hsb')) {\n        this.fromHsvString(trimStr);\n      }\n    } else if (input instanceof FastColor) {\n      this.r = input.r;\n      this.g = input.g;\n      this.b = input.b;\n      this.a = input.a;\n      this._h = input._h;\n      this._s = input._s;\n      this._l = input._l;\n      this._v = input._v;\n    } else if (matchFormat('rgb')) {\n      this.r = limitRange(input.r);\n      this.g = limitRange(input.g);\n      this.b = limitRange(input.b);\n      this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;\n    } else if (matchFormat('hsl')) {\n      this.fromHsl(input);\n    } else if (matchFormat('hsv')) {\n      this.fromHsv(input);\n    } else {\n      throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));\n    }\n  }\n\n  // ======================= Setter =======================\n\n  setR(value) {\n    return this._sc('r', value);\n  }\n  setG(value) {\n    return this._sc('g', value);\n  }\n  setB(value) {\n    return this._sc('b', value);\n  }\n  setA(value) {\n    return this._sc('a', value, 1);\n  }\n  setHue(value) {\n    const hsv = this.toHsv();\n    hsv.h = value;\n    return this._c(hsv);\n  }\n\n  // ======================= Getter =======================\n  /**\n   * Returns the perceived luminance of a color, from 0-1.\n   * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n   */\n  getLuminance() {\n    function adjustGamma(raw) {\n      const val = raw / 255;\n      return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n    }\n    const R = adjustGamma(this.r);\n    const G = adjustGamma(this.g);\n    const B = adjustGamma(this.b);\n    return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n  }\n  getHue() {\n    if (typeof this._h === 'undefined') {\n      const delta = this.getMax() - this.getMin();\n      if (delta === 0) {\n        this._h = 0;\n      } else {\n        this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));\n      }\n    }\n    return this._h;\n  }\n  getSaturation() {\n    if (typeof this._s === 'undefined') {\n      const delta = this.getMax() - this.getMin();\n      if (delta === 0) {\n        this._s = 0;\n      } else {\n        this._s = delta / this.getMax();\n      }\n    }\n    return this._s;\n  }\n  getLightness() {\n    if (typeof this._l === 'undefined') {\n      this._l = (this.getMax() + this.getMin()) / 510;\n    }\n    return this._l;\n  }\n  getValue() {\n    if (typeof this._v === 'undefined') {\n      this._v = this.getMax() / 255;\n    }\n    return this._v;\n  }\n\n  /**\n   * Returns the perceived brightness of the color, from 0-255.\n   * Note: this is not the b of HSB\n   * @see http://www.w3.org/TR/AERT#color-contrast\n   */\n  getBrightness() {\n    if (typeof this._brightness === 'undefined') {\n      this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;\n    }\n    return this._brightness;\n  }\n\n  // ======================== Func ========================\n\n  darken(amount = 10) {\n    const h = this.getHue();\n    const s = this.getSaturation();\n    let l = this.getLightness() - amount / 100;\n    if (l < 0) {\n      l = 0;\n    }\n    return this._c({\n      h,\n      s,\n      l,\n      a: this.a\n    });\n  }\n  lighten(amount = 10) {\n    const h = this.getHue();\n    const s = this.getSaturation();\n    let l = this.getLightness() + amount / 100;\n    if (l > 1) {\n      l = 1;\n    }\n    return this._c({\n      h,\n      s,\n      l,\n      a: this.a\n    });\n  }\n\n  /**\n   * Mix the current color a given amount with another color, from 0 to 100.\n   * 0 means no mixing (return current color).\n   */\n  mix(input, amount = 50) {\n    const color = this._c(input);\n    const p = amount / 100;\n    const calc = key => (color[key] - this[key]) * p + this[key];\n    const rgba = {\n      r: round(calc('r')),\n      g: round(calc('g')),\n      b: round(calc('b')),\n      a: round(calc('a') * 100) / 100\n    };\n    return this._c(rgba);\n  }\n\n  /**\n   * Mix the color with pure white, from 0 to 100.\n   * Providing 0 will do nothing, providing 100 will always return white.\n   */\n  tint(amount = 10) {\n    return this.mix({\n      r: 255,\n      g: 255,\n      b: 255,\n      a: 1\n    }, amount);\n  }\n\n  /**\n   * Mix the color with pure black, from 0 to 100.\n   * Providing 0 will do nothing, providing 100 will always return black.\n   */\n  shade(amount = 10) {\n    return this.mix({\n      r: 0,\n      g: 0,\n      b: 0,\n      a: 1\n    }, amount);\n  }\n  onBackground(background) {\n    const bg = this._c(background);\n    const alpha = this.a + bg.a * (1 - this.a);\n    const calc = key => {\n      return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);\n    };\n    return this._c({\n      r: calc('r'),\n      g: calc('g'),\n      b: calc('b'),\n      a: alpha\n    });\n  }\n\n  // ======================= Status =======================\n  isDark() {\n    return this.getBrightness() < 128;\n  }\n  isLight() {\n    return this.getBrightness() >= 128;\n  }\n\n  // ======================== MISC ========================\n  equals(other) {\n    return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;\n  }\n  clone() {\n    return this._c(this);\n  }\n\n  // ======================= Format =======================\n  toHexString() {\n    let hex = '#';\n    const rHex = (this.r || 0).toString(16);\n    hex += rHex.length === 2 ? rHex : '0' + rHex;\n    const gHex = (this.g || 0).toString(16);\n    hex += gHex.length === 2 ? gHex : '0' + gHex;\n    const bHex = (this.b || 0).toString(16);\n    hex += bHex.length === 2 ? bHex : '0' + bHex;\n    if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {\n      const aHex = round(this.a * 255).toString(16);\n      hex += aHex.length === 2 ? aHex : '0' + aHex;\n    }\n    return hex;\n  }\n\n  /** CSS support color pattern */\n  toHsl() {\n    return {\n      h: this.getHue(),\n      s: this.getSaturation(),\n      l: this.getLightness(),\n      a: this.a\n    };\n  }\n\n  /** CSS support color pattern */\n  toHslString() {\n    const h = this.getHue();\n    const s = round(this.getSaturation() * 100);\n    const l = round(this.getLightness() * 100);\n    return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;\n  }\n\n  /** Same as toHsb */\n  toHsv() {\n    return {\n      h: this.getHue(),\n      s: this.getSaturation(),\n      v: this.getValue(),\n      a: this.a\n    };\n  }\n  toRgb() {\n    return {\n      r: this.r,\n      g: this.g,\n      b: this.b,\n      a: this.a\n    };\n  }\n  toRgbString() {\n    return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;\n  }\n  toString() {\n    return this.toRgbString();\n  }\n\n  // ====================== Privates ======================\n  /** Return a new FastColor object with one channel changed */\n  _sc(rgb, value, max) {\n    const clone = this.clone();\n    clone[rgb] = limitRange(value, max);\n    return clone;\n  }\n  _c(input) {\n    return new this.constructor(input);\n  }\n  getMax() {\n    if (typeof this._max === 'undefined') {\n      this._max = Math.max(this.r, this.g, this.b);\n    }\n    return this._max;\n  }\n  getMin() {\n    if (typeof this._min === 'undefined') {\n      this._min = Math.min(this.r, this.g, this.b);\n    }\n    return this._min;\n  }\n  fromHexString(trimStr) {\n    const withoutPrefix = trimStr.replace('#', '');\n    function connectNum(index1, index2) {\n      return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);\n    }\n    if (withoutPrefix.length < 6) {\n      // #rgb or #rgba\n      this.r = connectNum(0);\n      this.g = connectNum(1);\n      this.b = connectNum(2);\n      this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;\n    } else {\n      // #rrggbb or #rrggbbaa\n      this.r = connectNum(0, 1);\n      this.g = connectNum(2, 3);\n      this.b = connectNum(4, 5);\n      this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;\n    }\n  }\n  fromHsl({\n    h,\n    s,\n    l,\n    a\n  }) {\n    this._h = h % 360;\n    this._s = s;\n    this._l = l;\n    this.a = typeof a === 'number' ? a : 1;\n    if (s <= 0) {\n      const rgb = round(l * 255);\n      this.r = rgb;\n      this.g = rgb;\n      this.b = rgb;\n    }\n    let r = 0,\n      g = 0,\n      b = 0;\n    const huePrime = h / 60;\n    const chroma = (1 - Math.abs(2 * l - 1)) * s;\n    const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n    if (huePrime >= 0 && huePrime < 1) {\n      r = chroma;\n      g = secondComponent;\n    } else if (huePrime >= 1 && huePrime < 2) {\n      r = secondComponent;\n      g = chroma;\n    } else if (huePrime >= 2 && huePrime < 3) {\n      g = chroma;\n      b = secondComponent;\n    } else if (huePrime >= 3 && huePrime < 4) {\n      g = secondComponent;\n      b = chroma;\n    } else if (huePrime >= 4 && huePrime < 5) {\n      r = secondComponent;\n      b = chroma;\n    } else if (huePrime >= 5 && huePrime < 6) {\n      r = chroma;\n      b = secondComponent;\n    }\n    const lightnessModification = l - chroma / 2;\n    this.r = round((r + lightnessModification) * 255);\n    this.g = round((g + lightnessModification) * 255);\n    this.b = round((b + lightnessModification) * 255);\n  }\n  fromHsv({\n    h,\n    s,\n    v,\n    a\n  }) {\n    this._h = h % 360;\n    this._s = s;\n    this._v = v;\n    this.a = typeof a === 'number' ? a : 1;\n    const vv = round(v * 255);\n    this.r = vv;\n    this.g = vv;\n    this.b = vv;\n    if (s <= 0) {\n      return;\n    }\n    const hh = h / 60;\n    const i = Math.floor(hh);\n    const ff = hh - i;\n    const p = round(v * (1.0 - s) * 255);\n    const q = round(v * (1.0 - s * ff) * 255);\n    const t = round(v * (1.0 - s * (1.0 - ff)) * 255);\n    switch (i) {\n      case 0:\n        this.g = t;\n        this.b = p;\n        break;\n      case 1:\n        this.r = q;\n        this.b = p;\n        break;\n      case 2:\n        this.r = p;\n        this.b = t;\n        break;\n      case 3:\n        this.r = p;\n        this.g = q;\n        break;\n      case 4:\n        this.r = t;\n        this.g = p;\n        break;\n      case 5:\n      default:\n        this.g = p;\n        this.b = q;\n        break;\n    }\n  }\n  fromHsvString(trimStr) {\n    const cells = splitColorStr(trimStr, parseHSVorHSL);\n    this.fromHsv({\n      h: cells[0],\n      s: cells[1],\n      v: cells[2],\n      a: cells[3]\n    });\n  }\n  fromHslString(trimStr) {\n    const cells = splitColorStr(trimStr, parseHSVorHSL);\n    this.fromHsl({\n      h: cells[0],\n      s: cells[1],\n      l: cells[2],\n      a: cells[3]\n    });\n  }\n  fromRgbString(trimStr) {\n    const cells = splitColorStr(trimStr, (num, txt) =>\n    // Convert percentage to number. e.g. 50% -> 128\n    txt.includes('%') ? round(num / 100 * 255) : num);\n    this.r = cells[0];\n    this.g = cells[1];\n    this.b = cells[2];\n    this.a = cells[3];\n  }\n}","map":{"version":3,"names":["_defineProperty","round","Math","splitColorStr","str","parseNum","match","replace","numList","map","item","parseFloat","i","includes","parseHSVorHSL","num","_","index","limitRange","value","max","mergedMax","FastColor","constructor","input","matchFormat","trimStr","trim","matchPrefix","prefix","startsWith","test","fromHexString","fromRgbString","fromHslString","fromHsvString","r","g","b","a","_h","_s","_l","_v","fromHsl","fromHsv","Error","JSON","stringify","setR","_sc","setG","setB","setA","setHue","hsv","toHsv","h","_c","getLuminance","adjustGamma","raw","val","pow","R","G","B","getHue","delta","getMax","getMin","getSaturation","getLightness","getValue","getBrightness","_brightness","darken","amount","s","l","lighten","mix","color","p","calc","key","rgba","tint","shade","onBackground","background","bg","alpha","isDark","isLight","equals","other","clone","toHexString","hex","rHex","toString","length","gHex","bHex","aHex","toHsl","toHslString","v","toRgb","toRgbString","rgb","_max","_min","min","withoutPrefix","connectNum","index1","index2","parseInt","huePrime","chroma","abs","secondComponent","lightnessModification","vv","hh","floor","ff","q","t","cells","txt"],"sources":["/Users/nili/Documents/trae_projects/client/node_modules/@ant-design/fast-color/es/FastColor.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nconst round = Math.round;\n\n/**\n * Support format, alpha unit will check the % mark:\n * - rgba(102, 204, 255, .5)      -> [102, 204, 255, 0.5]\n * - rgb(102 204 255 / .5)        -> [102, 204, 255, 0.5]\n * - rgb(100%, 50%, 0% / 50%)     -> [255, 128, 0, 0.5]\n * - hsl(270, 60, 40, .5)         -> [270, 60, 40, 0.5]\n * - hsl(270deg 60% 40% / 50%)   -> [270, 60, 40, 0.5]\n *\n * When `base` is provided, the percentage value will be divided by `base`.\n */\nfunction splitColorStr(str, parseNum) {\n  const match = str\n  // Remove str before `(`\n  .replace(/^[^(]*\\((.*)/, '$1')\n  // Remove str after `)`\n  .replace(/\\).*/, '').match(/\\d*\\.?\\d+%?/g) || [];\n  const numList = match.map(item => parseFloat(item));\n  for (let i = 0; i < 3; i += 1) {\n    numList[i] = parseNum(numList[i] || 0, match[i] || '', i);\n  }\n\n  // For alpha. 50% should be 0.5\n  if (match[3]) {\n    numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];\n  } else {\n    // By default, alpha is 1\n    numList[3] = 1;\n  }\n  return numList;\n}\nconst parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;\n\n/** round and limit number to integer between 0-255 */\nfunction limitRange(value, max) {\n  const mergedMax = max || 255;\n  if (value > mergedMax) {\n    return mergedMax;\n  }\n  if (value < 0) {\n    return 0;\n  }\n  return value;\n}\nexport class FastColor {\n  constructor(input) {\n    /**\n     * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.\n     */\n    _defineProperty(this, \"isValid\", true);\n    /**\n     * Red, R in RGB\n     */\n    _defineProperty(this, \"r\", 0);\n    /**\n     * Green, G in RGB\n     */\n    _defineProperty(this, \"g\", 0);\n    /**\n     * Blue, B in RGB\n     */\n    _defineProperty(this, \"b\", 0);\n    /**\n     * Alpha/Opacity, A in RGBA/HSLA\n     */\n    _defineProperty(this, \"a\", 1);\n    // HSV privates\n    _defineProperty(this, \"_h\", void 0);\n    _defineProperty(this, \"_s\", void 0);\n    _defineProperty(this, \"_l\", void 0);\n    _defineProperty(this, \"_v\", void 0);\n    // intermediate variables to calculate HSL/HSV\n    _defineProperty(this, \"_max\", void 0);\n    _defineProperty(this, \"_min\", void 0);\n    _defineProperty(this, \"_brightness\", void 0);\n    /**\n     * Always check 3 char in the object to determine the format.\n     * We not use function in check to save bundle size.\n     * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.\n     */\n    function matchFormat(str) {\n      return str[0] in input && str[1] in input && str[2] in input;\n    }\n    if (!input) {\n      // Do nothing since already initialized\n    } else if (typeof input === 'string') {\n      const trimStr = input.trim();\n      function matchPrefix(prefix) {\n        return trimStr.startsWith(prefix);\n      }\n      if (/^#?[A-F\\d]{3,8}$/i.test(trimStr)) {\n        this.fromHexString(trimStr);\n      } else if (matchPrefix('rgb')) {\n        this.fromRgbString(trimStr);\n      } else if (matchPrefix('hsl')) {\n        this.fromHslString(trimStr);\n      } else if (matchPrefix('hsv') || matchPrefix('hsb')) {\n        this.fromHsvString(trimStr);\n      }\n    } else if (input instanceof FastColor) {\n      this.r = input.r;\n      this.g = input.g;\n      this.b = input.b;\n      this.a = input.a;\n      this._h = input._h;\n      this._s = input._s;\n      this._l = input._l;\n      this._v = input._v;\n    } else if (matchFormat('rgb')) {\n      this.r = limitRange(input.r);\n      this.g = limitRange(input.g);\n      this.b = limitRange(input.b);\n      this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;\n    } else if (matchFormat('hsl')) {\n      this.fromHsl(input);\n    } else if (matchFormat('hsv')) {\n      this.fromHsv(input);\n    } else {\n      throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));\n    }\n  }\n\n  // ======================= Setter =======================\n\n  setR(value) {\n    return this._sc('r', value);\n  }\n  setG(value) {\n    return this._sc('g', value);\n  }\n  setB(value) {\n    return this._sc('b', value);\n  }\n  setA(value) {\n    return this._sc('a', value, 1);\n  }\n  setHue(value) {\n    const hsv = this.toHsv();\n    hsv.h = value;\n    return this._c(hsv);\n  }\n\n  // ======================= Getter =======================\n  /**\n   * Returns the perceived luminance of a color, from 0-1.\n   * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n   */\n  getLuminance() {\n    function adjustGamma(raw) {\n      const val = raw / 255;\n      return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n    }\n    const R = adjustGamma(this.r);\n    const G = adjustGamma(this.g);\n    const B = adjustGamma(this.b);\n    return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n  }\n  getHue() {\n    if (typeof this._h === 'undefined') {\n      const delta = this.getMax() - this.getMin();\n      if (delta === 0) {\n        this._h = 0;\n      } else {\n        this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));\n      }\n    }\n    return this._h;\n  }\n  getSaturation() {\n    if (typeof this._s === 'undefined') {\n      const delta = this.getMax() - this.getMin();\n      if (delta === 0) {\n        this._s = 0;\n      } else {\n        this._s = delta / this.getMax();\n      }\n    }\n    return this._s;\n  }\n  getLightness() {\n    if (typeof this._l === 'undefined') {\n      this._l = (this.getMax() + this.getMin()) / 510;\n    }\n    return this._l;\n  }\n  getValue() {\n    if (typeof this._v === 'undefined') {\n      this._v = this.getMax() / 255;\n    }\n    return this._v;\n  }\n\n  /**\n   * Returns the perceived brightness of the color, from 0-255.\n   * Note: this is not the b of HSB\n   * @see http://www.w3.org/TR/AERT#color-contrast\n   */\n  getBrightness() {\n    if (typeof this._brightness === 'undefined') {\n      this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;\n    }\n    return this._brightness;\n  }\n\n  // ======================== Func ========================\n\n  darken(amount = 10) {\n    const h = this.getHue();\n    const s = this.getSaturation();\n    let l = this.getLightness() - amount / 100;\n    if (l < 0) {\n      l = 0;\n    }\n    return this._c({\n      h,\n      s,\n      l,\n      a: this.a\n    });\n  }\n  lighten(amount = 10) {\n    const h = this.getHue();\n    const s = this.getSaturation();\n    let l = this.getLightness() + amount / 100;\n    if (l > 1) {\n      l = 1;\n    }\n    return this._c({\n      h,\n      s,\n      l,\n      a: this.a\n    });\n  }\n\n  /**\n   * Mix the current color a given amount with another color, from 0 to 100.\n   * 0 means no mixing (return current color).\n   */\n  mix(input, amount = 50) {\n    const color = this._c(input);\n    const p = amount / 100;\n    const calc = key => (color[key] - this[key]) * p + this[key];\n    const rgba = {\n      r: round(calc('r')),\n      g: round(calc('g')),\n      b: round(calc('b')),\n      a: round(calc('a') * 100) / 100\n    };\n    return this._c(rgba);\n  }\n\n  /**\n   * Mix the color with pure white, from 0 to 100.\n   * Providing 0 will do nothing, providing 100 will always return white.\n   */\n  tint(amount = 10) {\n    return this.mix({\n      r: 255,\n      g: 255,\n      b: 255,\n      a: 1\n    }, amount);\n  }\n\n  /**\n   * Mix the color with pure black, from 0 to 100.\n   * Providing 0 will do nothing, providing 100 will always return black.\n   */\n  shade(amount = 10) {\n    return this.mix({\n      r: 0,\n      g: 0,\n      b: 0,\n      a: 1\n    }, amount);\n  }\n  onBackground(background) {\n    const bg = this._c(background);\n    const alpha = this.a + bg.a * (1 - this.a);\n    const calc = key => {\n      return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);\n    };\n    return this._c({\n      r: calc('r'),\n      g: calc('g'),\n      b: calc('b'),\n      a: alpha\n    });\n  }\n\n  // ======================= Status =======================\n  isDark() {\n    return this.getBrightness() < 128;\n  }\n  isLight() {\n    return this.getBrightness() >= 128;\n  }\n\n  // ======================== MISC ========================\n  equals(other) {\n    return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;\n  }\n  clone() {\n    return this._c(this);\n  }\n\n  // ======================= Format =======================\n  toHexString() {\n    let hex = '#';\n    const rHex = (this.r || 0).toString(16);\n    hex += rHex.length === 2 ? rHex : '0' + rHex;\n    const gHex = (this.g || 0).toString(16);\n    hex += gHex.length === 2 ? gHex : '0' + gHex;\n    const bHex = (this.b || 0).toString(16);\n    hex += bHex.length === 2 ? bHex : '0' + bHex;\n    if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {\n      const aHex = round(this.a * 255).toString(16);\n      hex += aHex.length === 2 ? aHex : '0' + aHex;\n    }\n    return hex;\n  }\n\n  /** CSS support color pattern */\n  toHsl() {\n    return {\n      h: this.getHue(),\n      s: this.getSaturation(),\n      l: this.getLightness(),\n      a: this.a\n    };\n  }\n\n  /** CSS support color pattern */\n  toHslString() {\n    const h = this.getHue();\n    const s = round(this.getSaturation() * 100);\n    const l = round(this.getLightness() * 100);\n    return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;\n  }\n\n  /** Same as toHsb */\n  toHsv() {\n    return {\n      h: this.getHue(),\n      s: this.getSaturation(),\n      v: this.getValue(),\n      a: this.a\n    };\n  }\n  toRgb() {\n    return {\n      r: this.r,\n      g: this.g,\n      b: this.b,\n      a: this.a\n    };\n  }\n  toRgbString() {\n    return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;\n  }\n  toString() {\n    return this.toRgbString();\n  }\n\n  // ====================== Privates ======================\n  /** Return a new FastColor object with one channel changed */\n  _sc(rgb, value, max) {\n    const clone = this.clone();\n    clone[rgb] = limitRange(value, max);\n    return clone;\n  }\n  _c(input) {\n    return new this.constructor(input);\n  }\n  getMax() {\n    if (typeof this._max === 'undefined') {\n      this._max = Math.max(this.r, this.g, this.b);\n    }\n    return this._max;\n  }\n  getMin() {\n    if (typeof this._min === 'undefined') {\n      this._min = Math.min(this.r, this.g, this.b);\n    }\n    return this._min;\n  }\n  fromHexString(trimStr) {\n    const withoutPrefix = trimStr.replace('#', '');\n    function connectNum(index1, index2) {\n      return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);\n    }\n    if (withoutPrefix.length < 6) {\n      // #rgb or #rgba\n      this.r = connectNum(0);\n      this.g = connectNum(1);\n      this.b = connectNum(2);\n      this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;\n    } else {\n      // #rrggbb or #rrggbbaa\n      this.r = connectNum(0, 1);\n      this.g = connectNum(2, 3);\n      this.b = connectNum(4, 5);\n      this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;\n    }\n  }\n  fromHsl({\n    h,\n    s,\n    l,\n    a\n  }) {\n    this._h = h % 360;\n    this._s = s;\n    this._l = l;\n    this.a = typeof a === 'number' ? a : 1;\n    if (s <= 0) {\n      const rgb = round(l * 255);\n      this.r = rgb;\n      this.g = rgb;\n      this.b = rgb;\n    }\n    let r = 0,\n      g = 0,\n      b = 0;\n    const huePrime = h / 60;\n    const chroma = (1 - Math.abs(2 * l - 1)) * s;\n    const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n    if (huePrime >= 0 && huePrime < 1) {\n      r = chroma;\n      g = secondComponent;\n    } else if (huePrime >= 1 && huePrime < 2) {\n      r = secondComponent;\n      g = chroma;\n    } else if (huePrime >= 2 && huePrime < 3) {\n      g = chroma;\n      b = secondComponent;\n    } else if (huePrime >= 3 && huePrime < 4) {\n      g = secondComponent;\n      b = chroma;\n    } else if (huePrime >= 4 && huePrime < 5) {\n      r = secondComponent;\n      b = chroma;\n    } else if (huePrime >= 5 && huePrime < 6) {\n      r = chroma;\n      b = secondComponent;\n    }\n    const lightnessModification = l - chroma / 2;\n    this.r = round((r + lightnessModification) * 255);\n    this.g = round((g + lightnessModification) * 255);\n    this.b = round((b + lightnessModification) * 255);\n  }\n  fromHsv({\n    h,\n    s,\n    v,\n    a\n  }) {\n    this._h = h % 360;\n    this._s = s;\n    this._v = v;\n    this.a = typeof a === 'number' ? a : 1;\n    const vv = round(v * 255);\n    this.r = vv;\n    this.g = vv;\n    this.b = vv;\n    if (s <= 0) {\n      return;\n    }\n    const hh = h / 60;\n    const i = Math.floor(hh);\n    const ff = hh - i;\n    const p = round(v * (1.0 - s) * 255);\n    const q = round(v * (1.0 - s * ff) * 255);\n    const t = round(v * (1.0 - s * (1.0 - ff)) * 255);\n    switch (i) {\n      case 0:\n        this.g = t;\n        this.b = p;\n        break;\n      case 1:\n        this.r = q;\n        this.b = p;\n        break;\n      case 2:\n        this.r = p;\n        this.b = t;\n        break;\n      case 3:\n        this.r = p;\n        this.g = q;\n        break;\n      case 4:\n        this.r = t;\n        this.g = p;\n        break;\n      case 5:\n      default:\n        this.g = p;\n        this.b = q;\n        break;\n    }\n  }\n  fromHsvString(trimStr) {\n    const cells = splitColorStr(trimStr, parseHSVorHSL);\n    this.fromHsv({\n      h: cells[0],\n      s: cells[1],\n      v: cells[2],\n      a: cells[3]\n    });\n  }\n  fromHslString(trimStr) {\n    const cells = splitColorStr(trimStr, parseHSVorHSL);\n    this.fromHsl({\n      h: cells[0],\n      s: cells[1],\n      l: cells[2],\n      a: cells[3]\n    });\n  }\n  fromRgbString(trimStr) {\n    const cells = splitColorStr(trimStr, (num, txt) =>\n    // Convert percentage to number. e.g. 50% -> 128\n    txt.includes('%') ? round(num / 100 * 255) : num);\n    this.r = cells[0];\n    this.g = cells[1];\n    this.b = cells[2];\n    this.a = cells[3];\n  }\n}"],"mappings":"AAAA,OAAOA,eAAe,MAAM,2CAA2C;AACvE,MAAMC,KAAK,GAAGC,IAAI,CAACD,KAAK;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,aAAaA,CAACC,GAAG,EAAEC,QAAQ,EAAE;EACpC,MAAMC,KAAK,GAAGF;EACd;EAAA,CACCG,OAAO,CAAC,cAAc,EAAE,IAAI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