import { C as a } from "./base-PQGakkrl.js";
import { R as y } from "./Element_Event_resize-DqH_UT2k.js";
import { C as M } from "./Element_Event_resize-DqH_UT2k.js";
import { D as _ } from "./Element_Event_drag-DeZYlveu.js";
import { C as b } from "./Element_Event_drag-DeZYlveu.js";
import { C as g } from "./day-Dm_AnEZp.js";
import { a as P } from "./axios-DqkFEq4Y.js";
import { e as A } from "./echart-BtfUJ8lE.js";
import { C as N } from "./promise-CPiVqqqL.js";
import { T as Z } from "./tooltip-De0atcAJ.js";
import { Z as f } from "./i18n_zh_CN-COzQ8Los.js";
import { E as l } from "./i18n_en-BHhFEbi6.js";
const J = {
  Drag: _,
  Resize: y
};
class D {
  _type;
  _typeDef;
  _packageData;
  constructor() {
    this._type = "zh_cn", this._typeDef = "zh_cn", this._packageData = {
      zh_cn: f,
      en: l
    };
  }
  initMerge(e) {
    const t = a.isEmpty(e.type);
    return t || (this._type = e.type), a.isEmpty(e.packageData) || (t ? this._packageData[this._typeDef] = a.getJsonMergeDeep(this._packageData[this._typeDef], e.packageData) : this._packageData = a.getJsonMergeDeep(this._packageData, e.packageData)), {
      type: this._type,
      //typeDef: this._typeDef,
      packageData: this._packageData
    };
  }
  _getType() {
    let e = this._type;
    return a.isEmpty(e) && (e = this._typeDef), { type: e, def: this._typeDef };
  }
  _getData(e) {
    let t = {};
    const s = this._packageData;
    if (e)
      t = s[e];
    else {
      const o = this._getType();
      a.isExistJsonKey(s, o.type) && (t = s[o.type]), a.isEmpty(t) && (t = s[o.def]);
    }
    return t;
  }
  _getKeyValue(e, t) {
    let s;
    if (a.isExistValue(e, ".")) {
      const o = a.split(e, ".");
      let i = a.getJsonClone(t, !0);
      o.forEach((p, m) => {
        const n = i[p];
        m === o.length - 1 ? i = n : i = a.isEmpty(n) ? {} : n;
      }), s = i;
    } else
      s = t[e];
    return s;
  }
  _getKey(e, t) {
    let s;
    const o = t ? this._getData(t) : this._getData();
    return a.isEmpty(o) || (s = this._getKeyValue(e, o), a.isObject(s) && (s = a.getJsonClone(s, !0))), s;
  }
  getType() {
    return this._getType();
  }
  getAll() {
    return this._getData();
  }
  getCommon() {
    const e = this._getKey("common"), t = this._getKey("common", this._typeDef);
    return a.getJsonMergeDeep(t || {}, e || {});
  }
  getValue(e) {
    let t = this._getKey(e);
    return a.isEmpty(t) && (t = this._getKey(e, this._typeDef)), t;
  }
  getPage(e) {
    let t = {};
    const s = this.getCommon();
    if (e === "common")
      t = s;
    else {
      const o = this._getKey(e, this._typeDef), i = this._getKey(e), p = a.getJsonMergeDeep(o, i);
      let m = {};
      if (a.isExistValue(e, ".")) {
        const n = a.split(e, ".");
        n[n.length - 1] = "common";
        const r = n.join("."), c = this._getKey(r, this._typeDef), h = this._getKey(r);
        m = a.getJsonMergeDeep(c, h);
      }
      t = a.getJsonMerge(p, { common: s, pageCommon: m });
    }
    return t;
  }
  setType(e) {
    switch (this._type = e, e) {
      case "zh_cn":
        g.objDay.locale("zh-cn");
        break;
      case "en":
        g.objDay.locale("en");
        break;
    }
  }
}
const j = new D();
export {
  P as CommonAxios,
  a as CommonBase,
  g as CommonDay,
  A as CommonEchart,
  b as CommonElement,
  J as CommonElementEvent,
  j as CommonI18n,
  N as CommonPromise,
  M as CommonTools,
  Z as CommonTooltip
};
//# sourceMappingURL=index.js.map
