import M from "./Colors.js";
const l = "#9F9F9F";
class b extends M {
  constructor(r, e, i, a, y, c, f, p, h, t) {
    super(i, a, y, c, f), this.colorMap = {}, this._colorBy = e == "line" ? "id" : i, this._indexBy && p && [...p].forEach((o) => {
      o && o.items && o.items.forEach((s) => {
        t && s.labels && s.labels[t.toUpperCase()] ? this.colorMap[s.labels[t.toUpperCase()]] = s.categoryStyle : this.colorMap[s.value] = s.categoryStyle;
      });
    }), h && [...h].forEach((o) => {
      o && o.styles && (t && o.labels && o.labels[t.toUpperCase()] ? this.colorMap[o.labels[t.toUpperCase()]] = o.styles : this.colorMap[o.label] = o.styles);
    });
  }
  getColor(r, e) {
    return this._colorBy === "index" ? this.colorMap[e[this._indexBy]] ? this.colorMap[e[this._indexBy]].color : l : this.colorMap[r] ? this.colorMap[r].color : l;
  }
  getColorByIndex(r) {
    return this.colorMap[r] ? this.colorMap[r].color : l;
  }
  getColorByKey(r) {
    return this.colorMap[r] ? this.colorMap[r].color : l;
  }
}
export {
  b as default
};
