/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import { a as w } from "./utils.js";
import { g as j, W, c as F, d as I } from "./series-length.js";
import "@arcgis/toolkit/intl";
import "lodash-es";
import "luxon";
import "d3-array";
import "@arcgis/toolkit/type";
import "./series-types.js";
import { aP as p, bI as c, aN as f, dc as L, o as N } from "./index.js";
import "@arcgis/core/Graphic.js";
import "@arcgis/core/renderers/support/jsonUtils.js";
import "@arcgis/core/symbols/support/symbolUtils.js";
import "@esri/arcgis-html-sanitizer";
import "@arcgis/core/intl.js";
import "@arcgis/core/layers/support/FeatureFilter.js";
import "@arcgis/core/smartMapping/statistics/histogram.js";
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
import "simple-statistics";
import "@arcgis/core/request.js";
import "@arcgis/core/core/sql.js";
import "@arcgis/core/AttributeBinsGraphic.js";
import "@arcgis/core/geometry/support/jsonUtils.js";
import "@arcgis/core/rest/support/AttributeBinsQuery.js";
import "@arcgis/core/rest/support/StatisticDefinition.js";
import "@arcgis/core/time/TimeExtent.js";
import "@arcgis/core/core/promiseUtils.js";
import "./runtime.js";
import "@arcgis/toolkit/dom";
import { m as a, C as n } from "./model-setter.js";
var R = Object.defineProperty, M = Object.getOwnPropertyDescriptor, U = (e, t, r, l) => {
  for (var i = M(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && R(t, r, i), i;
};
const B = (e) => e.title?.content, E = (e, t) => {
  if (e) {
    const r = j(t);
    t.title === void 0 && (t.title = p({
      text: "",
      visible: !0,
      font: f(c.ChartTitle),
      type: c.ChartTitle
    })), t.title.content = e, t.title.content.text = r;
  }
};
class u extends n {
  /**
   * The title text symbol. Contains styling information such as font, color, and symbol style.
   */
  get titleSymbol() {
    return B(this._config);
  }
  set titleSymbol(t) {
    E(t, this._config);
  }
}
U([
  a
], u.prototype, "titleSymbol");
var q = Object.defineProperty, z = Object.getOwnPropertyDescriptor, A = (e, t, r, l) => {
  for (var i = z(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && q(t, r, i), i;
};
class h extends n {
  /**
   * The current chart configuration object.
   */
  get config() {
    return this._config;
  }
  set config(t) {
    this._config = t;
  }
}
A([
  a
], h.prototype, "config");
class G extends n {
  /**
   * The chart model's layer.
   */
  get layer() {
    return this.layerInfo?.layer;
  }
}
const H = (e) => e.id, J = (e, t) => {
  t.id = e;
};
class K extends n {
  /**
   * The chart ID.
   */
  get chartId() {
    return H(this._config);
  }
  set chartId(t) {
    J(t, this._config);
  }
}
const Q = (e) => e.version;
class X extends n {
  /**
   * The version of the chart configuration.
   */
  get version() {
    return Q(this._config);
  }
}
var Y = Object.defineProperty, Z = Object.getOwnPropertyDescriptor, k = (e, t, r, l) => {
  for (var i = Z(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && Y(t, r, i), i;
};
const b = (e) => e.subtitle?.content.text ?? "", tt = (e, t) => {
  t.subtitle !== void 0 ? t.subtitle.content.text = e : e !== void 0 && (t.subtitle = p({
    text: e,
    visible: !0,
    font: f(c.ChartSubtitle)
  }));
};
class _ extends n {
  /**
   * The chart subtitle text.
   */
  get subtitleText() {
    return b(this._config);
  }
  set subtitleText(t) {
    tt(t, this._config);
  }
}
k([
  a
], _.prototype, "subtitleText");
var et = Object.defineProperty, it = Object.getOwnPropertyDescriptor, rt = (e, t, r, l) => {
  for (var i = it(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && et(t, r, i), i;
};
const st = (e) => e.subtitle?.content, ot = (e, t) => {
  if (e) {
    const r = b(t);
    t.subtitle === void 0 && (t.subtitle = p({
      text: "",
      visible: !0,
      font: f(c.ChartSubtitle),
      type: c.ChartSubtitle
    })), t.subtitle.content = e, t.subtitle.content.text = r;
  }
};
class d extends n {
  /**
   * The subtitle text symbol. Contains styling information such as font, color, and symbol style.
   */
  get subtitleSymbol() {
    return st(this._config);
  }
  set subtitleSymbol(t) {
    ot(t, this._config);
  }
}
rt([
  a
], d.prototype, "subtitleSymbol");
var nt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, at = (e, t, r, l) => {
  for (var i = lt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && nt(t, r, i), i;
};
const v = (e) => e.footer?.content.text ?? "", ct = (e, t) => {
  t.footer !== void 0 ? t.footer.content.text = e : e !== void 0 && (t.footer = p({
    text: e,
    visible: !0,
    font: f(c.DescriptionText)
  }));
};
class g extends n {
  get descriptionText() {
    return v(this._config);
  }
  set descriptionText(t) {
    ct(t, this._config);
  }
}
at([
  a
], g.prototype, "descriptionText");
var pt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, ut = (e, t, r, l) => {
  for (var i = ft(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && pt(t, r, i), i;
};
const ht = (e) => e.footer?.content, bt = (e, t) => {
  if (e) {
    const r = v(t);
    t.footer === void 0 && (t.footer = p({
      text: "",
      visible: !0,
      font: f(c.DescriptionText),
      type: c.DescriptionText
    })), t.footer.content = e, t.footer.content.text = r;
  }
};
class y extends n {
  /**
   * The description text symbol. Contains styling information such as font, color, and symbol style.
   */
  get descriptionSymbol() {
    return ht(this._config);
  }
  set descriptionSymbol(t) {
    bt(t, this._config);
  }
}
ut([
  a
], y.prototype, "descriptionSymbol");
var _t = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, vt = (e, t, r, l) => {
  for (var i = dt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && _t(t, r, i), i;
};
const gt = (e) => e.title ? e.title.visible ?? !0 : !1, yt = (e, t) => {
  t.title !== void 0 ? t.title.visible = e : t.title = p({
    text: "",
    visible: e,
    font: f(c.ChartTitle)
  });
};
class m extends n {
  /**
   * Whether or not the chart title is visible.
   *
   * **Note:** Even if the title is visible, it may not be displayed if the title text is empty.
   */
  get chartTitleVisibility() {
    return gt(this._config);
  }
  set chartTitleVisibility(t) {
    yt(t, this._config);
  }
}
vt([
  a
], m.prototype, "chartTitleVisibility");
var mt = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, xt = (e, t, r, l) => {
  for (var i = Pt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && mt(t, r, i), i;
};
const Ot = (e) => e.subtitle ? e.subtitle.visible ?? !0 : !1, Dt = (e, t) => {
  t.subtitle !== void 0 ? t.subtitle.visible = e : t.subtitle = p({
    text: "",
    visible: e,
    font: f(c.ChartSubtitle)
  });
};
class P extends n {
  /**
   * Whether or not the chart subtitle is visible.
   *
   * **Note:** Even if the subtitle is visible, it may not be displayed if the subtitle text is empty.
   */
  get chartSubtitleVisibility() {
    return Ot(this._config);
  }
  set chartSubtitleVisibility(t) {
    Dt(t, this._config);
  }
}
xt([
  a
], P.prototype, "chartSubtitleVisibility");
var St = Object.defineProperty, Ct = Object.getOwnPropertyDescriptor, Tt = (e, t, r, l) => {
  for (var i = Ct(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && St(t, r, i), i;
};
const x = (e) => e.footer?.visible ?? !1, Vt = (e, t) => {
  t.footer !== void 0 ? t.footer.visible = e : e !== x(t) && (t.footer = p({
    text: "",
    visible: !0,
    font: f(c.DescriptionText)
  }));
};
class O extends n {
  /**
   * Whether or not the chart description is visible.
   *
   * **Note:** Even if the description is visible, it may not be displayed if the description text is empty.
   */
  get descriptionVisibility() {
    return x(this._config);
  }
  set descriptionVisibility(t) {
    Vt(t, this._config);
  }
}
Tt([
  a
], O.prototype, "descriptionVisibility");
var $t = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, jt = (e, t, r, l) => {
  for (var i = wt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && $t(t, r, i), i;
};
const Wt = (e) => e.chartRenderer, Ft = (e, t) => {
  t.chartRenderer = e;
};
class D extends n {
  /**
   * The chart renderer.
   *
   * @example
   * In this example, we set the chartRenderer for a class-break heat chart.
   * ```ts
   * heatChartModel.chartRenderer = {
   *    "type": "classBreaks",
   *    "field": "arcgis_charts_heat_chart_value",
   *    "classBreakInfos": [
   *        {
   *          "label": "70 - 145",
   *          "classMinValue": 70,
   *          "classMaxValue": 145,
   *          "symbol": {
   *            "type": "esriSFS",
   *            "color": [
   *              212,
   *              227,
   *              255,
   *              255
   *            ],
   *            "style": "esriSFSSolid"
   *          }
   *        },
   *        {
   *          "label": "146 - 250",
   *          "classMinValue": 146,
   *          "classMaxValue": 250,
   *          "symbol": {
   *            "type": "esriSFS",
   *            "color": [
   *              43,
   *              108,
   *              240,
   *              255
   *            ],
   *            "style": "esriSFSSolid"
   *          }
   *        }
   *    ]
   *  };
   * ```
   *
   */
  get chartRenderer() {
    return Wt(this._config);
  }
  set chartRenderer(t) {
    Ft(t, this._config);
  }
}
jt([
  a
], D.prototype, "chartRenderer");
var It = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, Nt = (e, t, r, l) => {
  for (var i = Lt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && It(t, r, i), i;
};
const Rt = (e) => e.background, Mt = (e, t) => {
  t.background = e;
};
class S extends n {
  /**
   * The background color of the chart.
   */
  get backgroundColor() {
    return Rt(this._config);
  }
  set backgroundColor(t) {
    Mt(t, this._config);
  }
}
Nt([
  a
], S.prototype, "backgroundColor");
var Ut = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Et = (e, t, r, l) => {
  for (var i = Bt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && Ut(t, r, i), i;
};
const qt = (e, t) => t.series[e].visible ?? !0, zt = (e, t) => {
  L({ detail: e }, t);
};
class C extends n {
  /**
   * Gets the visibility of a series.
   *
   * @param seriesIndex The series index
   */
  getSeriesVisibility(t) {
    return qt(t, this._config);
  }
  setSeriesVisibility(t) {
    zt(t, this._config);
  }
}
Et([
  a
], C.prototype, "setSeriesVisibility");
const At = (e, t) => t.series[e]?.id;
class Gt extends n {
  /**
   * Gets the series ID for a given series index.
   * If the series index is out of bounds, this function will return `undefined`.
   *
   * @param seriesIndex - The index of the series.
   */
  getSeriesId(t) {
    return At(t, this._config);
  }
}
const Ht = (e, t) => t.series.findIndex((r) => r.id === e);
class Jt extends n {
  /**
   * Gets the series index for a given series ID.
   * If the series ID is not found, this function will return `undefined`.
   *
   * @param seriesId - The ID of the series.
   */
  getSeriesIndex(t) {
    return Ht(t, this._config);
  }
}
const Kt = (e) => N(e.series);
class Qt extends n {
  /**
   * The chart sub type of the series.
   */
  get chartSubType() {
    return Kt(this._config);
  }
}
var Xt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, Zt = (e, t, r, l) => {
  for (var i = Yt(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && Xt(t, r, i), i;
};
const kt = (e, t) => {
  let r;
  return e.length !== 0 && t < e.length && (r = e[t].dataTooltipValueFormat), r;
}, te = (e) => {
  const { series: t, seriesIndex: r, valueFormat: l } = e;
  t.length !== 0 && r < t.length && (t[r].dataTooltipValueFormat = l);
};
class T extends n {
  /**
   * Gets the data tooltip value format for a series.
   *
   * If the series index is out of bounds or the series list is empty, this function will return `undefined`.
   *
   * @param seriesIndex - The index of the series to retrieve the value format for.
   */
  getDataTooltipValueFormat(t) {
    return kt(this._config.series, t);
  }
  setDataTooltipValueFormat(t, r) {
    te({
      series: this._config.series,
      seriesIndex: t,
      valueFormat: r
    });
  }
}
Zt([
  a
], T.prototype, "setDataTooltipValueFormat");
var ee = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, re = (e, t, r, l) => {
  for (var i = ie(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && ee(t, r, i), i;
};
const se = (e, t) => {
  t.series.forEach((r) => {
    r.query && (r.query.fetchNullValues = e);
  });
}, oe = (e) => e.series.some((t) => t.query?.fetchNullValues);
class V extends n {
  /**
   * Whether to fetch `null` values for them to be counted or displayed as categories on the chart.
   */
  get fetchNULLValues() {
    return oe(this._config);
  }
  set fetchNULLValues(t) {
    se(t, this._config);
  }
}
re([
  a
], V.prototype, "fetchNULLValues");
var ne = Object.defineProperty, le = Object.getOwnPropertyDescriptor, ae = (e, t, r, l) => {
  for (var i = le(t, r), s = e.length - 1, o; s >= 0; s--)
    (o = e[s]) && (i = o(t, r, i) || i);
  return i && ne(t, r, i), i;
};
const ce = (e) => e.dataFilters, pe = (e, t) => {
  e !== void 0 ? t.dataFilters = e : delete t.dataFilters;
};
class $ extends n {
  /**
   * Gets the data filter for the bar chart.
   */
  getDataFilters() {
    return ce(this._config);
  }
  async setDataFilters(t) {
    pe(t, this._config), this.dispatchEvent(new CustomEvent("arcgisChartsModelDataChange"));
  }
}
ae([
  a
], $.prototype, "setDataFilters");
class fe extends n {
}
const ue = [
  h,
  G,
  K,
  W,
  u,
  X,
  _,
  d,
  g,
  y,
  m,
  P,
  O,
  D,
  S,
  C,
  Gt,
  Jt,
  F,
  Qt,
  T,
  V,
  I,
  $
];
w(fe, ue);
export {
  fe as C
};
