import { _ as T, bo as dt, bn as q, c5 as ie, cs as Ce, p as X, aW as Me, ct as oe, a7 as P, cu as H, cv as Ge, O as y, ay as se, cw as Le, o as Re, an as nt, cx as De, cy as At, cz as bt, cA as Pe, aZ as Ee, aj as yt, cB as lt, cC as wt, cD as Fe, cE as Oe, ai as le, ad as A, i as ue, R as Z, F as J, G, cF as Ie, cG as Ve, d as j, cH as ke, cI as ze, bd as ut, cJ as Tt, cK as Ct, bp as ce, bC as Ye, b9 as Ne, D as k, b8 as Xe, cL as Mt, cl as fe, bh as He, W as B, aN as U, cM as Ze, cN as je, Z as Ue, ap as pe, at as he, cO as Je, a9 as Be, cP as We, Q as $e, bT as Ke, cQ as Gt, cR as qe, cS as Qe, cT as tr, cU as ge, ah as er, cV as rr, cW as nr, cX as ar, bx as ir, u as or, cY as sr, aU as Lt, b3 as ve, aC as lr, f as ur, g as cr, h as ct, bz as fr, t as pr, cZ as hr, c_ as W, aw as N, c$ as gr, d0 as vr, $ as Rt, aX as dr, d1 as yr, cb as mr, ae as _r, d2 as Sr, d3 as xr, av as Ar, aQ as br, aL as Dt, C as wr, bR as Tr } from "./index-Cf4hNI3Z.js";
function Tn(a, e) {
  return a.type === e;
}
var Cr = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      return a !== null && a.apply(this, arguments) || this;
    }
    return e.type = "grid", e.dependencies = ["xAxis", "yAxis"], e.layoutMode = "box", e.defaultOption = {
      show: !1,
      // zlevel: 0,
      z: 0,
      left: "10%",
      top: 60,
      right: "10%",
      bottom: 70,
      // If grid size contain label
      containLabel: !1,
      // width: {totalWidth} - left - right,
      // height: {totalHeight} - top - bottom,
      backgroundColor: "rgba(0,0,0,0)",
      borderWidth: 1,
      borderColor: "#ccc"
    }, e;
  }(dt)
), ft = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      return a !== null && a.apply(this, arguments) || this;
    }
    return e.prototype.getCoordSysModel = function() {
      return this.getReferringComponents("grid", q).models[0];
    }, e.type = "cartesian2dAxis", e;
  }(dt)
);
ie(ft, Ce);
var Mr = (
  /** @class */
  function() {
    function a(e) {
      this.type = "cartesian", this._dimList = [], this._axes = {}, this.name = e || "";
    }
    return a.prototype.getAxis = function(e) {
      return this._axes[e];
    }, a.prototype.getAxes = function() {
      return X(this._dimList, function(e) {
        return this._axes[e];
      }, this);
    }, a.prototype.getAxesByScale = function(e) {
      return e = e.toLowerCase(), Me(this.getAxes(), function(t) {
        return t.scale.type === e;
      });
    }, a.prototype.addAxis = function(e) {
      var t = e.dim;
      this._axes[t] = e, this._dimList.push(t);
    }, a;
  }()
), pt = ["x", "y"];
function Pt(a) {
  return a.type === "interval" || a.type === "time";
}
var Gr = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = "cartesian2d", t.dimensions = pt, t;
    }
    return e.prototype.calcAffineTransform = function() {
      this._transform = this._invTransform = null;
      var t = this.getAxis("x").scale, r = this.getAxis("y").scale;
      if (!(!Pt(t) || !Pt(r))) {
        var n = t.getExtent(), i = r.getExtent(), o = this.dataToPoint([n[0], i[0]]), s = this.dataToPoint([n[1], i[1]]), l = n[1] - n[0], u = i[1] - i[0];
        if (!(!l || !u)) {
          var c = (s[0] - o[0]) / l, f = (s[1] - o[1]) / u, g = o[0] - n[0] * c, p = o[1] - i[0] * f, h = this._transform = [c, 0, 0, f, g, p];
          this._invTransform = oe([], h);
        }
      }
    }, e.prototype.getBaseAxis = function() {
      return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
    }, e.prototype.containPoint = function(t) {
      var r = this.getAxis("x"), n = this.getAxis("y");
      return r.contain(r.toLocalCoord(t[0])) && n.contain(n.toLocalCoord(t[1]));
    }, e.prototype.containData = function(t) {
      return this.getAxis("x").containData(t[0]) && this.getAxis("y").containData(t[1]);
    }, e.prototype.containZone = function(t, r) {
      var n = this.dataToPoint(t), i = this.dataToPoint(r), o = this.getArea(), s = new P(n[0], n[1], i[0] - n[0], i[1] - n[1]);
      return o.intersect(s);
    }, e.prototype.dataToPoint = function(t, r, n) {
      n = n || [];
      var i = t[0], o = t[1];
      if (this._transform && i != null && isFinite(i) && o != null && isFinite(o))
        return H(n, t, this._transform);
      var s = this.getAxis("x"), l = this.getAxis("y");
      return n[0] = s.toGlobalCoord(s.dataToCoord(i, r)), n[1] = l.toGlobalCoord(l.dataToCoord(o, r)), n;
    }, e.prototype.clampData = function(t, r) {
      var n = this.getAxis("x").scale, i = this.getAxis("y").scale, o = n.getExtent(), s = i.getExtent(), l = n.parse(t[0]), u = i.parse(t[1]);
      return r = r || [], r[0] = Math.min(Math.max(Math.min(o[0], o[1]), l), Math.max(o[0], o[1])), r[1] = Math.min(Math.max(Math.min(s[0], s[1]), u), Math.max(s[0], s[1])), r;
    }, e.prototype.pointToData = function(t, r) {
      var n = [];
      if (this._invTransform)
        return H(n, t, this._invTransform);
      var i = this.getAxis("x"), o = this.getAxis("y");
      return n[0] = i.coordToData(i.toLocalCoord(t[0]), r), n[1] = o.coordToData(o.toLocalCoord(t[1]), r), n;
    }, e.prototype.getOtherAxis = function(t) {
      return this.getAxis(t.dim === "x" ? "y" : "x");
    }, e.prototype.getArea = function(t) {
      t = t || 0;
      var r = this.getAxis("x").getGlobalExtent(), n = this.getAxis("y").getGlobalExtent(), i = Math.min(r[0], r[1]) - t, o = Math.min(n[0], n[1]) - t, s = Math.max(r[0], r[1]) - i + t, l = Math.max(n[0], n[1]) - o + t;
      return new P(i, o, s, l);
    }, e;
  }(Mr)
), Lr = (
  /** @class */
  function(a) {
    T(e, a);
    function e(t, r, n, i, o) {
      var s = a.call(this, t, r, n) || this;
      return s.index = 0, s.type = i || "value", s.position = o || "bottom", s;
    }
    return e.prototype.isHorizontal = function() {
      var t = this.position;
      return t === "top" || t === "bottom";
    }, e.prototype.getGlobalExtent = function(t) {
      var r = this.getExtent();
      return r[0] = this.toGlobalCoord(r[0]), r[1] = this.toGlobalCoord(r[1]), t && r[0] > r[1] && r.reverse(), r;
    }, e.prototype.pointToData = function(t, r) {
      return this.coordToData(this.toLocalCoord(t[this.dim === "x" ? 0 : 1]), r);
    }, e.prototype.setCategorySortInfo = function(t) {
      if (this.type !== "category")
        return !1;
      this.model.option.categorySortInfo = t, this.scale.setSortInfo(t);
    }, e;
  }(Ge)
), Rr = (
  /** @class */
  function() {
    function a(e, t, r) {
      this.type = "grid", this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this.axisPointerEnabled = !0, this.dimensions = pt, this._initCartesian(e, t, r), this.model = e;
    }
    return a.prototype.getRect = function() {
      return this._rect;
    }, a.prototype.update = function(e, t) {
      var r = this._axesMap;
      this._updateScale(e, this.model);
      function n(o) {
        var s, l = yt(o), u = l.length;
        if (u) {
          for (var c = [], f = u - 1; f >= 0; f--) {
            var g = +l[f], p = o[g], h = p.model, v = p.scale;
            // Only value and log axis without interval support alignTicks.
            lt(v) && h.get("alignTicks") && h.get("interval") == null ? c.push(p) : (wt(v, h), lt(v) && (s = p));
          }
          c.length && (s || (s = c.pop(), wt(s.scale, s.model)), y(c, function(d) {
            Fe(d.scale, d.model, s.scale);
          }));
        }
      }
      n(r.x), n(r.y);
      var i = {};
      y(r.x, function(o) {
        Et(r, "y", o, i);
      }), y(r.y, function(o) {
        Et(r, "x", o, i);
      }), this.resize(this.model, t);
    }, a.prototype.resize = function(e, t, r) {
      var n = e.getBoxLayoutParams(), i = !r && e.get("containLabel"), o = se(n, {
        width: t.getWidth(),
        height: t.getHeight()
      });
      this._rect = o;
      var s = this._axesList;
      l(), i && (y(s, function(u) {
        if (!u.model.get(["axisLabel", "inside"])) {
          var c = Le(u);
          if (c) {
            var f = u.isHorizontal() ? "height" : "width", g = u.model.get(["axisLabel", "margin"]);
            o[f] -= c[f] + g, u.position === "top" ? o.y += c.height + g : u.position === "left" && (o.x += c.width + g);
          }
        }
      }), l()), y(this._coordsList, function(u) {
        u.calcAffineTransform();
      });
      function l() {
        y(s, function(u) {
          var c = u.isHorizontal(), f = c ? [0, o.width] : [0, o.height], g = u.inverse ? 1 : 0;
          u.setExtent(f[g], f[1 - g]), Dr(u, c ? o.x : o.y);
        });
      }
    }, a.prototype.getAxis = function(e, t) {
      var r = this._axesMap[e];
      if (r != null)
        return r[t || 0];
    }, a.prototype.getAxes = function() {
      return this._axesList.slice();
    }, a.prototype.getCartesian = function(e, t) {
      if (e != null && t != null) {
        var r = "x" + e + "y" + t;
        return this._coordsMap[r];
      }
      Re(e) && (t = e.yAxisIndex, e = e.xAxisIndex);
      for (var n = 0, i = this._coordsList; n < i.length; n++)
        if (i[n].getAxis("x").index === e || i[n].getAxis("y").index === t)
          return i[n];
    }, a.prototype.getCartesians = function() {
      return this._coordsList.slice();
    }, a.prototype.convertToPixel = function(e, t, r) {
      var n = this._findConvertTarget(t);
      return n.cartesian ? n.cartesian.dataToPoint(r) : n.axis ? n.axis.toGlobalCoord(n.axis.dataToCoord(r)) : null;
    }, a.prototype.convertFromPixel = function(e, t, r) {
      var n = this._findConvertTarget(t);
      return n.cartesian ? n.cartesian.pointToData(r) : n.axis ? n.axis.coordToData(n.axis.toLocalCoord(r)) : null;
    }, a.prototype._findConvertTarget = function(e) {
      var t = e.seriesModel, r = e.xAxisModel || t && t.getReferringComponents("xAxis", q).models[0], n = e.yAxisModel || t && t.getReferringComponents("yAxis", q).models[0], i = e.gridModel, o = this._coordsList, s, l;
      if (t)
        s = t.coordinateSystem, nt(o, s) < 0 && (s = null);
      else if (r && n)
        s = this.getCartesian(r.componentIndex, n.componentIndex);
      else if (r)
        l = this.getAxis("x", r.componentIndex);
      else if (n)
        l = this.getAxis("y", n.componentIndex);
      else if (i) {
        var u = i.coordinateSystem;
        u === this && (s = this._coordsList[0]);
      }
      return {
        cartesian: s,
        axis: l
      };
    }, a.prototype.containPoint = function(e) {
      var t = this._coordsList[0];
      if (t)
        return t.containPoint(e);
    }, a.prototype._initCartesian = function(e, t, r) {
      var n = this, i = this, o = {
        left: !1,
        right: !1,
        top: !1,
        bottom: !1
      }, s = {
        x: {},
        y: {}
      }, l = {
        x: 0,
        y: 0
      };
      if (t.eachComponent("xAxis", u("x"), this), t.eachComponent("yAxis", u("y"), this), !l.x || !l.y) {
        this._axesMap = {}, this._axesList = [];
        return;
      }
      this._axesMap = s, y(s.x, function(c, f) {
        y(s.y, function(g, p) {
          var h = "x" + f + "y" + p, v = new Gr(h);
          v.master = n, v.model = e, n._coordsMap[h] = v, n._coordsList.push(v), v.addAxis(c), v.addAxis(g);
        });
      });
      function u(c) {
        return function(f, g) {
          if (at(f, e)) {
            var p = f.get("position");
            c === "x" ? p !== "top" && p !== "bottom" && (p = o.bottom ? "top" : "bottom") : p !== "left" && p !== "right" && (p = o.left ? "right" : "left"), o[p] = !0;
            var h = new Lr(c, De(f), [0, 0], f.get("type"), p), v = h.type === "category";
            h.onBand = v && f.get("boundaryGap"), h.inverse = f.get("inverse"), f.axis = h, h.model = f, h.grid = i, h.index = g, i._axesList.push(h), s[c][g] = h, l[c]++;
          }
        };
      }
    }, a.prototype._updateScale = function(e, t) {
      y(this._axesList, function(n) {
        if (n.scale.setExtent(1 / 0, -1 / 0), n.type === "category") {
          var i = n.model.get("categorySortInfo");
          n.scale.setSortInfo(i);
        }
      }), e.eachSeries(function(n) {
        if (At(n)) {
          var i = bt(n), o = i.xAxisModel, s = i.yAxisModel;
          if (!at(o, t) || !at(s, t))
            return;
          var l = this.getCartesian(o.componentIndex, s.componentIndex), u = n.getData(), c = l.getAxis("x"), f = l.getAxis("y");
          r(u, c), r(u, f);
        }
      }, this);
      function r(n, i) {
        y(Pe(n, i.dim), function(o) {
          i.scale.unionExtentFromData(n, o);
        });
      }
    }, a.prototype.getTooltipAxes = function(e) {
      var t = [], r = [];
      return y(this.getCartesians(), function(n) {
        var i = e != null && e !== "auto" ? n.getAxis(e) : n.getBaseAxis(), o = n.getOtherAxis(i);
        nt(t, i) < 0 && t.push(i), nt(r, o) < 0 && r.push(o);
      }), {
        baseAxes: t,
        otherAxes: r
      };
    }, a.create = function(e, t) {
      var r = [];
      return e.eachComponent("grid", function(n, i) {
        var o = new a(n, e, t);
        o.name = "grid_" + i, o.resize(n, t, !0), n.coordinateSystem = o, r.push(o);
      }), e.eachSeries(function(n) {
        if (At(n)) {
          var i = bt(n), o = i.xAxisModel, s = i.yAxisModel, l = o.getCoordSysModel();
          if (process.env.NODE_ENV !== "production") {
            if (!l)
              throw new Error('Grid "' + Ee(o.get("gridIndex"), o.get("gridId"), 0) + '" not found');
            if (o.getCoordSysModel() !== s.getCoordSysModel())
              throw new Error("xAxis and yAxis must use the same grid");
          }
          var u = l.coordinateSystem;
          n.coordinateSystem = u.getCartesian(o.componentIndex, s.componentIndex);
        }
      }), r;
    }, a.dimensions = pt, a;
  }()
);
function at(a, e) {
  return a.getCoordSysModel() === e;
}
function Et(a, e, t, r) {
  t.getAxesOnZeroOf = function() {
    return i ? [i] : [];
  };
  var n = a[e], i, o = t.model, s = o.get(["axisLine", "onZero"]), l = o.get(["axisLine", "onZeroAxisIndex"]);
  if (!s)
    return;
  if (l != null)
    Ft(n[l]) && (i = n[l]);
  else
    for (var u in n)
      if (n.hasOwnProperty(u) && Ft(n[u]) && !r[c(n[u])]) {
        i = n[u];
        break;
      }
  i && (r[c(i)] = !0);
  function c(f) {
    return f.dim + "_" + f.index;
  }
}
function Ft(a) {
  return a && a.type !== "category" && a.type !== "time" && Oe(a);
}
function Dr(a, e) {
  var t = a.getExtent(), r = t[0] + t[1];
  a.toGlobalCoord = a.dim === "x" ? function(n) {
    return n + e;
  } : function(n) {
    return r - n + e;
  }, a.toLocalCoord = a.dim === "x" ? function(n) {
    return n - e;
  } : function(n) {
    return r - n + e;
  };
}
var ht = le();
function Pr(a, e, t, r) {
  var n = t.axis;
  if (!n.scale.isBlank()) {
    var i = t.getModel("splitArea"), o = i.getModel("areaStyle"), s = o.get("color"), l = r.coordinateSystem.getRect(), u = n.getTicksCoords({
      tickModel: i,
      clamp: !0
    });
    if (u.length) {
      var c = s.length, f = ht(a).splitAreaColors, g = A(), p = 0;
      if (f)
        for (var h = 0; h < u.length; h++) {
          var v = f.get(u[h].tickValue);
          if (v != null) {
            p = (v + (c - 1) * h) % c;
            break;
          }
        }
      var d = n.toGlobalCoord(u[0].coord), m = o.getAreaStyle();
      s = ue(s) ? s : [s];
      for (var h = 1; h < u.length; h++) {
        var S = n.toGlobalCoord(u[h].coord), x = void 0, _ = void 0, b = void 0, R = void 0;
        n.isHorizontal() ? (x = d, _ = l.y, b = S - x, R = l.height, d = x + b) : (x = l.x, _ = d, b = l.width, R = S - _, d = _ + R);
        var L = u[h - 1].tickValue;
        L != null && g.set(L, p), e.add(new Z({
          anid: L != null ? "area_" + L : null,
          shape: {
            x,
            y: _,
            width: b,
            height: R
          },
          style: J({
            fill: s[p]
          }, m),
          autoBatch: !0,
          silent: !0
        })), p = (p + 1) % c;
      }
      ht(a).splitAreaColors = g;
    }
  }
}
function Er(a) {
  ht(a).splitAreaColors = null;
}
var Fr = ["axisLine", "axisTickLabel", "axisName"], Or = ["splitArea", "splitLine", "minorSplitLine"], de = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = e.type, t.axisPointerClass = "CartesianAxisPointer", t;
    }
    return e.prototype.render = function(t, r, n, i) {
      this.group.removeAll();
      var o = this._axisGroup;
      if (this._axisGroup = new G(), this.group.add(this._axisGroup), !!t.get("show")) {
        var s = t.getCoordSysModel(), l = Ie(s, t), u = new Ve(t, j({
          handleAutoShown: function(f) {
            for (var g = s.coordinateSystem.getCartesians(), p = 0; p < g.length; p++)
              if (lt(g[p].getOtherAxis(t.axis).scale))
                return !0;
            return !1;
          }
        }, l));
        y(Fr, u.add, u), this._axisGroup.add(u.getGroup()), y(Or, function(f) {
          t.get([f, "show"]) && Ir[f](this, this._axisGroup, t, s);
        }, this);
        var c = i && i.type === "changeAxisOrder" && i.isInitSort;
        c || ke(o, this._axisGroup, t), a.prototype.render.call(this, t, r, n, i);
      }
    }, e.prototype.remove = function() {
      Er(this);
    }, e.type = "cartesianAxis", e;
  }(ze)
), Ir = {
  splitLine: function(a, e, t, r) {
    var n = t.axis;
    if (!n.scale.isBlank()) {
      var i = t.getModel("splitLine"), o = i.getModel("lineStyle"), s = o.get("color"), l = i.get("showMinLine") !== !1, u = i.get("showMaxLine") !== !1;
      s = ue(s) ? s : [s];
      for (var c = r.coordinateSystem.getRect(), f = n.isHorizontal(), g = 0, p = n.getTicksCoords({
        tickModel: i
      }), h = [], v = [], d = o.getLineStyle(), m = 0; m < p.length; m++) {
        var S = n.toGlobalCoord(p[m].coord);
        if (!(m === 0 && !l || m === p.length - 1 && !u)) {
          var x = p[m].tickValue;
          f ? (h[0] = S, h[1] = c.y, v[0] = S, v[1] = c.y + c.height) : (h[0] = c.x, h[1] = S, v[0] = c.x + c.width, v[1] = S);
          var _ = g++ % s.length, b = new ut({
            anid: x != null ? "line_" + x : null,
            autoBatch: !0,
            shape: {
              x1: h[0],
              y1: h[1],
              x2: v[0],
              y2: v[1]
            },
            style: J({
              stroke: s[_]
            }, d),
            silent: !0
          });
          Tt(b.shape, d.lineWidth), e.add(b);
        }
      }
    }
  },
  minorSplitLine: function(a, e, t, r) {
    var n = t.axis, i = t.getModel("minorSplitLine"), o = i.getModel("lineStyle"), s = r.coordinateSystem.getRect(), l = n.isHorizontal(), u = n.getMinorTicksCoords();
    if (u.length)
      for (var c = [], f = [], g = o.getLineStyle(), p = 0; p < u.length; p++)
        for (var h = 0; h < u[p].length; h++) {
          var v = n.toGlobalCoord(u[p][h].coord);
          l ? (c[0] = v, c[1] = s.y, f[0] = v, f[1] = s.y + s.height) : (c[0] = s.x, c[1] = v, f[0] = s.x + s.width, f[1] = v);
          var d = new ut({
            anid: "minor_line_" + u[p][h].tickValue,
            autoBatch: !0,
            shape: {
              x1: c[0],
              y1: c[1],
              x2: f[0],
              y2: f[1]
            },
            style: g,
            silent: !0
          });
          Tt(d.shape, g.lineWidth), e.add(d);
        }
  },
  splitArea: function(a, e, t, r) {
    Pr(a, e, t, r);
  }
}, ye = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = e.type, t;
    }
    return e.type = "xAxis", e;
  }(de)
), Vr = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = ye.type, t;
    }
    return e.type = "yAxis", e;
  }(de)
), kr = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = "grid", t;
    }
    return e.prototype.render = function(t, r) {
      this.group.removeAll(), t.get("show") && this.group.add(new Z({
        shape: t.coordinateSystem.getRect(),
        style: J({
          fill: t.get("backgroundColor")
        }, t.getItemStyle()),
        silent: !0,
        z2: -1
      }));
    }, e.type = "grid", e;
  }(ce)
), Ot = {
  // gridIndex: 0,
  // gridId: '',
  offset: 0
};
function Cn(a) {
  a.registerComponentView(kr), a.registerComponentModel(Cr), a.registerCoordinateSystem("cartesian2d", Rr), Ct(a, "x", ft, Ot), Ct(a, "y", ft, Ot), a.registerComponentView(ye), a.registerComponentView(Vr), a.registerPreprocessor(function(e) {
    e.xAxis && e.yAxis && !e.grid && (e.grid = {});
  });
}
var It = "\0_ec_interaction_mutex";
function Mn(a, e, t) {
  var r = mt(a);
  r[e] = t;
}
function Gn(a, e, t) {
  var r = mt(a), n = r[e];
  n === t && (r[e] = null);
}
function Vt(a, e) {
  return !!mt(a)[e];
}
function mt(a) {
  return a[It] || (a[It] = {});
}
Ye({
  type: "takeGlobalCursor",
  event: "globalCursorTaken",
  update: "update"
}, Ne);
var zr = (
  /** @class */
  function(a) {
    T(e, a);
    function e(t) {
      var r = a.call(this) || this;
      r._zr = t;
      var n = k(r._mousedownHandler, r), i = k(r._mousemoveHandler, r), o = k(r._mouseupHandler, r), s = k(r._mousewheelHandler, r), l = k(r._pinchHandler, r);
      return r.enable = function(u, c) {
        this.disable(), this._opt = J(Xe(c) || {}, {
          zoomOnMouseWheel: !0,
          moveOnMouseMove: !0,
          // By default, wheel do not trigger move.
          moveOnMouseWheel: !1,
          preventDefaultMouseMove: !0
        }), u == null && (u = !0), (u === !0 || u === "move" || u === "pan") && (t.on("mousedown", n), t.on("mousemove", i), t.on("mouseup", o)), (u === !0 || u === "scale" || u === "zoom") && (t.on("mousewheel", s), t.on("pinch", l));
      }, r.disable = function() {
        t.off("mousedown", n), t.off("mousemove", i), t.off("mouseup", o), t.off("mousewheel", s), t.off("pinch", l);
      }, r;
    }
    return e.prototype.isDragging = function() {
      return this._dragging;
    }, e.prototype.isPinching = function() {
      return this._pinching;
    }, e.prototype.setPointerChecker = function(t) {
      this.pointerChecker = t;
    }, e.prototype.dispose = function() {
      this.disable();
    }, e.prototype._mousedownHandler = function(t) {
      if (!Mt(t)) {
        for (var r = t.target; r; ) {
          if (r.draggable)
            return;
          r = r.__hostTarget || r.parent;
        }
        var n = t.offsetX, i = t.offsetY;
        this.pointerChecker && this.pointerChecker(t, n, i) && (this._x = n, this._y = i, this._dragging = !0);
      }
    }, e.prototype._mousemoveHandler = function(t) {
      if (!(!this._dragging || !K("moveOnMouseMove", t, this._opt) || t.gestureEvent === "pinch" || Vt(this._zr, "globalPan"))) {
        var r = t.offsetX, n = t.offsetY, i = this._x, o = this._y, s = r - i, l = n - o;
        this._x = r, this._y = n, this._opt.preventDefaultMouseMove && fe(t.event), me(this, "pan", "moveOnMouseMove", t, {
          dx: s,
          dy: l,
          oldX: i,
          oldY: o,
          newX: r,
          newY: n,
          isAvailableBehavior: null
        });
      }
    }, e.prototype._mouseupHandler = function(t) {
      Mt(t) || (this._dragging = !1);
    }, e.prototype._mousewheelHandler = function(t) {
      var r = K("zoomOnMouseWheel", t, this._opt), n = K("moveOnMouseWheel", t, this._opt), i = t.wheelDelta, o = Math.abs(i), s = t.offsetX, l = t.offsetY;
      if (!(i === 0 || !r && !n)) {
        if (r) {
          var u = o > 3 ? 1.4 : o > 1 ? 1.2 : 1.1, c = i > 0 ? u : 1 / u;
          it(this, "zoom", "zoomOnMouseWheel", t, {
            scale: c,
            originX: s,
            originY: l,
            isAvailableBehavior: null
          });
        }
        if (n) {
          var f = Math.abs(i), g = (i > 0 ? 1 : -1) * (f > 3 ? 0.4 : f > 1 ? 0.15 : 0.05);
          it(this, "scrollMove", "moveOnMouseWheel", t, {
            scrollDelta: g,
            originX: s,
            originY: l,
            isAvailableBehavior: null
          });
        }
      }
    }, e.prototype._pinchHandler = function(t) {
      if (!Vt(this._zr, "globalPan")) {
        var r = t.pinchScale > 1 ? 1.1 : 1 / 1.1;
        it(this, "zoom", null, t, {
          scale: r,
          originX: t.pinchX,
          originY: t.pinchY,
          isAvailableBehavior: null
        });
      }
    }, e;
  }(He)
);
function it(a, e, t, r, n) {
  a.pointerChecker && a.pointerChecker(r, n.originX, n.originY) && (fe(r.event), me(a, e, t, r, n));
}
function me(a, e, t, r, n) {
  n.isAvailableBehavior = k(K, null, t, r), a.trigger(e, n);
}
function K(a, e, t) {
  var r = t[a];
  return !a || r && (!B(r) || e.event[r + "Key"]);
}
function Yr(a, e, t) {
  var r = a.target;
  r.x += e, r.y += t, r.dirty();
}
function Nr(a, e, t, r) {
  var n = a.target, i = a.zoomLimit, o = a.zoom = a.zoom || 1;
  if (o *= e, i) {
    var s = i.min || 0, l = i.max || 1 / 0;
    o = Math.max(Math.min(l, o), s);
  }
  var u = o / a.zoom;
  a.zoom = o, n.x -= (t - n.x) * (u - 1), n.y -= (r - n.y) * (u - 1), n.scaleX *= u, n.scaleY *= u, n.dirty();
}
var Xr = {
  axisPointer: 1,
  tooltip: 1,
  brush: 1
};
function Hr(a, e, t) {
  var r = e.getComponentByElement(a.topTarget), n = r && r.coordinateSystem;
  return r && r !== t && !Xr.hasOwnProperty(r.mainType) && n && n.model !== t;
}
function _e(a) {
  if (B(a)) {
    var e = new DOMParser();
    a = e.parseFromString(a, "text/xml");
  }
  var t = a;
  for (t.nodeType === 9 && (t = t.firstChild); t.nodeName.toLowerCase() !== "svg" || t.nodeType !== 1; )
    t = t.nextSibling;
  return t;
}
var ot, Q = {
  fill: "fill",
  stroke: "stroke",
  "stroke-width": "lineWidth",
  opacity: "opacity",
  "fill-opacity": "fillOpacity",
  "stroke-opacity": "strokeOpacity",
  "stroke-dasharray": "lineDash",
  "stroke-dashoffset": "lineDashOffset",
  "stroke-linecap": "lineCap",
  "stroke-linejoin": "lineJoin",
  "stroke-miterlimit": "miterLimit",
  "font-family": "fontFamily",
  "font-size": "fontSize",
  "font-style": "fontStyle",
  "font-weight": "fontWeight",
  "text-anchor": "textAlign",
  visibility: "visibility",
  display: "display"
}, kt = yt(Q), tt = {
  "alignment-baseline": "textBaseline",
  "stop-color": "stopColor"
}, zt = yt(tt), Zr = function() {
  function a() {
    this._defs = {}, this._root = null;
  }
  return a.prototype.parse = function(e, t) {
    t = t || {};
    var r = _e(e);
    if (process.env.NODE_ENV !== "production" && !r)
      throw new Error("Illegal svg");
    this._defsUsePending = [];
    var n = new G();
    this._root = n;
    var i = [], o = r.getAttribute("viewBox") || "", s = parseFloat(r.getAttribute("width") || t.width), l = parseFloat(r.getAttribute("height") || t.height);
    isNaN(s) && (s = null), isNaN(l) && (l = null), w(r, n, null, !0, !1);
    for (var u = r.firstChild; u; )
      this._parseNode(u, n, i, null, !1, !1), u = u.nextSibling;
    Jr(this._defs, this._defsUsePending), this._defsUsePending = [];
    var c, f;
    if (o) {
      var g = et(o);
      g.length >= 4 && (c = {
        x: parseFloat(g[0] || 0),
        y: parseFloat(g[1] || 0),
        width: parseFloat(g[2]),
        height: parseFloat(g[3])
      });
    }
    if (c && s != null && l != null && (f = xe(c, { x: 0, y: 0, width: s, height: l }), !t.ignoreViewBox)) {
      var p = n;
      n = new G(), n.add(p), p.scaleX = p.scaleY = f.scale, p.x = f.x, p.y = f.y;
    }
    return !t.ignoreRootClip && s != null && l != null && n.setClipPath(new Z({
      shape: { x: 0, y: 0, width: s, height: l }
    })), {
      root: n,
      width: s,
      height: l,
      viewBoxRect: c,
      viewBoxTransform: f,
      named: i
    };
  }, a.prototype._parseNode = function(e, t, r, n, i, o) {
    var s = e.nodeName.toLowerCase(), l, u = n;
    if (s === "defs" && (i = !0), s === "text" && (o = !0), s === "defs" || s === "switch")
      l = t;
    else {
      if (!i) {
        var c = ot[s];
        if (c && U(ot, s)) {
          l = c.call(this, e, t);
          var f = e.getAttribute("name");
          if (f) {
            var g = {
              name: f,
              namedFrom: null,
              svgNodeTagLower: s,
              el: l
            };
            r.push(g), s === "g" && (u = g);
          } else n && r.push({
            name: n.name,
            namedFrom: n,
            svgNodeTagLower: s,
            el: l
          });
          t.add(l);
        }
      }
      var p = Yt[s];
      if (p && U(Yt, s)) {
        var h = p.call(this, e), v = e.getAttribute("id");
        v && (this._defs[v] = h);
      }
    }
    if (l && l.isGroup)
      for (var d = e.firstChild; d; )
        d.nodeType === 1 ? this._parseNode(d, l, r, u, i, o) : d.nodeType === 3 && o && this._parseText(d, l), d = d.nextSibling;
  }, a.prototype._parseText = function(e, t) {
    var r = new Ze({
      style: {
        text: e.textContent
      },
      silent: !0,
      x: this._textX || 0,
      y: this._textY || 0
    });
    C(t, r), w(e, r, this._defsUsePending, !1, !1), jr(r, t);
    var n = r.style, i = n.fontSize;
    i && i < 9 && (n.fontSize = 9, r.scaleX *= i / 9, r.scaleY *= i / 9);
    var o = (n.fontSize || n.fontFamily) && [
      n.fontStyle,
      n.fontWeight,
      (n.fontSize || 12) + "px",
      n.fontFamily || "sans-serif"
    ].join(" ");
    n.font = o;
    var s = r.getBoundingRect();
    return this._textX += s.width, t.add(r), r;
  }, a.internalField = function() {
    ot = {
      g: function(e, t) {
        var r = new G();
        return C(t, r), w(e, r, this._defsUsePending, !1, !1), r;
      },
      rect: function(e, t) {
        var r = new Z();
        return C(t, r), w(e, r, this._defsUsePending, !1, !1), r.setShape({
          x: parseFloat(e.getAttribute("x") || "0"),
          y: parseFloat(e.getAttribute("y") || "0"),
          width: parseFloat(e.getAttribute("width") || "0"),
          height: parseFloat(e.getAttribute("height") || "0")
        }), r.silent = !0, r;
      },
      circle: function(e, t) {
        var r = new Be();
        return C(t, r), w(e, r, this._defsUsePending, !1, !1), r.setShape({
          cx: parseFloat(e.getAttribute("cx") || "0"),
          cy: parseFloat(e.getAttribute("cy") || "0"),
          r: parseFloat(e.getAttribute("r") || "0")
        }), r.silent = !0, r;
      },
      line: function(e, t) {
        var r = new ut();
        return C(t, r), w(e, r, this._defsUsePending, !1, !1), r.setShape({
          x1: parseFloat(e.getAttribute("x1") || "0"),
          y1: parseFloat(e.getAttribute("y1") || "0"),
          x2: parseFloat(e.getAttribute("x2") || "0"),
          y2: parseFloat(e.getAttribute("y2") || "0")
        }), r.silent = !0, r;
      },
      ellipse: function(e, t) {
        var r = new Je();
        return C(t, r), w(e, r, this._defsUsePending, !1, !1), r.setShape({
          cx: parseFloat(e.getAttribute("cx") || "0"),
          cy: parseFloat(e.getAttribute("cy") || "0"),
          rx: parseFloat(e.getAttribute("rx") || "0"),
          ry: parseFloat(e.getAttribute("ry") || "0")
        }), r.silent = !0, r;
      },
      polygon: function(e, t) {
        var r = e.getAttribute("points"), n;
        r && (n = Ht(r));
        var i = new he({
          shape: {
            points: n || []
          },
          silent: !0
        });
        return C(t, i), w(e, i, this._defsUsePending, !1, !1), i;
      },
      polyline: function(e, t) {
        var r = e.getAttribute("points"), n;
        r && (n = Ht(r));
        var i = new pe({
          shape: {
            points: n || []
          },
          silent: !0
        });
        return C(t, i), w(e, i, this._defsUsePending, !1, !1), i;
      },
      image: function(e, t) {
        var r = new Ue();
        return C(t, r), w(e, r, this._defsUsePending, !1, !1), r.setStyle({
          image: e.getAttribute("xlink:href") || e.getAttribute("href"),
          x: +e.getAttribute("x"),
          y: +e.getAttribute("y"),
          width: +e.getAttribute("width"),
          height: +e.getAttribute("height")
        }), r.silent = !0, r;
      },
      text: function(e, t) {
        var r = e.getAttribute("x") || "0", n = e.getAttribute("y") || "0", i = e.getAttribute("dx") || "0", o = e.getAttribute("dy") || "0";
        this._textX = parseFloat(r) + parseFloat(i), this._textY = parseFloat(n) + parseFloat(o);
        var s = new G();
        return C(t, s), w(e, s, this._defsUsePending, !1, !0), s;
      },
      tspan: function(e, t) {
        var r = e.getAttribute("x"), n = e.getAttribute("y");
        r != null && (this._textX = parseFloat(r)), n != null && (this._textY = parseFloat(n));
        var i = e.getAttribute("dx") || "0", o = e.getAttribute("dy") || "0", s = new G();
        return C(t, s), w(e, s, this._defsUsePending, !1, !0), this._textX += parseFloat(i), this._textY += parseFloat(o), s;
      },
      path: function(e, t) {
        var r = e.getAttribute("d") || "", n = je(r);
        return C(t, n), w(e, n, this._defsUsePending, !1, !1), n.silent = !0, n;
      }
    };
  }(), a;
}(), Yt = {
  lineargradient: function(a) {
    var e = parseInt(a.getAttribute("x1") || "0", 10), t = parseInt(a.getAttribute("y1") || "0", 10), r = parseInt(a.getAttribute("x2") || "10", 10), n = parseInt(a.getAttribute("y2") || "0", 10), i = new $e(e, t, r, n);
    return Nt(a, i), Xt(a, i), i;
  },
  radialgradient: function(a) {
    var e = parseInt(a.getAttribute("cx") || "0", 10), t = parseInt(a.getAttribute("cy") || "0", 10), r = parseInt(a.getAttribute("r") || "0", 10), n = new We(e, t, r);
    return Nt(a, n), Xt(a, n), n;
  }
};
function Nt(a, e) {
  var t = a.getAttribute("gradientUnits");
  t === "userSpaceOnUse" && (e.global = !0);
}
function Xt(a, e) {
  for (var t = a.firstChild; t; ) {
    if (t.nodeType === 1 && t.nodeName.toLocaleLowerCase() === "stop") {
      var r = t.getAttribute("offset"), n = void 0;
      r && r.indexOf("%") > 0 ? n = parseInt(r, 10) / 100 : r ? n = parseFloat(r) : n = 0;
      var i = {};
      Se(t, i, i);
      var o = i.stopColor || t.getAttribute("stop-color") || "#000000";
      e.colorStops.push({
        offset: n,
        color: o
      });
    }
    t = t.nextSibling;
  }
}
function C(a, e) {
  a && a.__inheritedStyle && (e.__inheritedStyle || (e.__inheritedStyle = {}), J(e.__inheritedStyle, a.__inheritedStyle));
}
function Ht(a) {
  for (var e = et(a), t = [], r = 0; r < e.length; r += 2) {
    var n = parseFloat(e[r]), i = parseFloat(e[r + 1]);
    t.push([n, i]);
  }
  return t;
}
function w(a, e, t, r, n) {
  var i = e, o = i.__inheritedStyle = i.__inheritedStyle || {}, s = {};
  a.nodeType === 1 && ($r(a, e), Se(a, o, s), r || Kr(a, o, s)), i.style = i.style || {}, o.fill != null && (i.style.fill = Zt(i, "fill", o.fill, t)), o.stroke != null && (i.style.stroke = Zt(i, "stroke", o.stroke, t)), y([
    "lineWidth",
    "opacity",
    "fillOpacity",
    "strokeOpacity",
    "miterLimit",
    "fontSize"
  ], function(l) {
    o[l] != null && (i.style[l] = parseFloat(o[l]));
  }), y([
    "lineDashOffset",
    "lineCap",
    "lineJoin",
    "fontWeight",
    "fontFamily",
    "fontStyle",
    "textAlign"
  ], function(l) {
    o[l] != null && (i.style[l] = o[l]);
  }), n && (i.__selfStyle = s), o.lineDash && (i.style.lineDash = X(et(o.lineDash), function(l) {
    return parseFloat(l);
  })), (o.visibility === "hidden" || o.visibility === "collapse") && (i.invisible = !0), o.display === "none" && (i.ignore = !0);
}
function jr(a, e) {
  var t = e.__selfStyle;
  if (t) {
    var r = t.textBaseline, n = r;
    !r || r === "auto" || r === "baseline" ? n = "alphabetic" : r === "before-edge" || r === "text-before-edge" ? n = "top" : r === "after-edge" || r === "text-after-edge" ? n = "bottom" : (r === "central" || r === "mathematical") && (n = "middle"), a.style.textBaseline = n;
  }
  var i = e.__inheritedStyle;
  if (i) {
    var o = i.textAlign, s = o;
    o && (o === "middle" && (s = "center"), a.style.textAlign = s);
  }
}
var Ur = /^url\(\s*#(.*?)\)/;
function Zt(a, e, t, r) {
  var n = t && t.match(Ur);
  if (n) {
    var i = Ke(n[1]);
    r.push([a, e, i]);
    return;
  }
  return t === "none" && (t = null), t;
}
function Jr(a, e) {
  for (var t = 0; t < e.length; t++) {
    var r = e[t];
    r[0].style[r[1]] = a[r[2]];
  }
}
var Br = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function et(a) {
  return a.match(Br) || [];
}
var Wr = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g, st = Math.PI / 180;
function $r(a, e) {
  var t = a.getAttribute("transform");
  if (t) {
    t = t.replace(/,/g, " ");
    var r = [], n = null;
    t.replace(Wr, function(f, g, p) {
      return r.push(g, p), "";
    });
    for (var i = r.length - 1; i > 0; i -= 2) {
      var o = r[i], s = r[i - 1], l = et(o);
      switch (n = n || ge(), s) {
        case "translate":
          tr(n, n, [parseFloat(l[0]), parseFloat(l[1] || "0")]);
          break;
        case "scale":
          Qe(n, n, [parseFloat(l[0]), parseFloat(l[1] || l[0])]);
          break;
        case "rotate":
          qe(n, n, -parseFloat(l[0]) * st, [
            parseFloat(l[1] || "0"),
            parseFloat(l[2] || "0")
          ]);
          break;
        case "skewX":
          var u = Math.tan(parseFloat(l[0]) * st);
          Gt(n, [1, 0, u, 1, 0, 0], n);
          break;
        case "skewY":
          var c = Math.tan(parseFloat(l[0]) * st);
          Gt(n, [1, c, 0, 1, 0, 0], n);
          break;
        case "matrix":
          n[0] = parseFloat(l[0]), n[1] = parseFloat(l[1]), n[2] = parseFloat(l[2]), n[3] = parseFloat(l[3]), n[4] = parseFloat(l[4]), n[5] = parseFloat(l[5]);
          break;
      }
    }
    e.setLocalTransform(n);
  }
}
var jt = /([^\s:;]+)\s*:\s*([^:;]+)/g;
function Se(a, e, t) {
  var r = a.getAttribute("style");
  if (r) {
    jt.lastIndex = 0;
    for (var n; (n = jt.exec(r)) != null; ) {
      var i = n[1], o = U(Q, i) ? Q[i] : null;
      o && (e[o] = n[2]);
      var s = U(tt, i) ? tt[i] : null;
      s && (t[s] = n[2]);
    }
  }
}
function Kr(a, e, t) {
  for (var r = 0; r < kt.length; r++) {
    var n = kt[r], i = a.getAttribute(n);
    i != null && (e[Q[n]] = i);
  }
  for (var r = 0; r < zt.length; r++) {
    var n = zt[r], i = a.getAttribute(n);
    i != null && (t[tt[n]] = i);
  }
}
function xe(a, e) {
  var t = e.width / a.width, r = e.height / a.height, n = Math.min(t, r);
  return {
    scale: n,
    x: -(a.x + a.width / 2) * n + (e.x + e.width / 2),
    y: -(a.y + a.height / 2) * n + (e.y + e.height / 2)
  };
}
function qr(a, e) {
  var t = new Zr();
  return t.parse(a, e);
}
var Qr = A([
  "rect",
  "circle",
  "line",
  "ellipse",
  "polygon",
  "polyline",
  "path",
  // <text> <tspan> are also enabled because some SVG might paint text itself,
  // but still need to trigger events or tooltip.
  "text",
  "tspan",
  // <g> is also enabled because this case: if multiple tags share one name
  // and need label displayed, every tags will display the name, which is not
  // expected. So we can put them into a <g name="xxx">. Thereby only one label
  // displayed and located based on the bounding rect of the <g>.
  "g"
]), tn = (
  /** @class */
  function() {
    function a(e, t) {
      this.type = "geoSVG", this._usedGraphicMap = A(), this._freedGraphics = [], this._mapName = e, this._parsedXML = _e(t);
    }
    return a.prototype.load = function() {
      var e = this._firstGraphic;
      if (!e) {
        e = this._firstGraphic = this._buildGraphic(this._parsedXML), this._freedGraphics.push(e), this._boundingRect = this._firstGraphic.boundingRect.clone();
        var t = rn(e.named), r = t.regions, n = t.regionsMap;
        this._regions = r, this._regionsMap = n;
      }
      return {
        boundingRect: this._boundingRect,
        regions: this._regions,
        regionsMap: this._regionsMap
      };
    }, a.prototype._buildGraphic = function(e) {
      var t, r;
      try {
        t = e && qr(e, {
          ignoreViewBox: !0,
          ignoreRootClip: !0
        }) || {}, r = t.root, er(r != null);
      } catch (d) {
        throw new Error(`Invalid svg format
` + d.message);
      }
      var n = new G();
      n.add(r), n.isGeoSVGGraphicRoot = !0;
      var i = t.width, o = t.height, s = t.viewBoxRect, l = this._boundingRect;
      if (!l) {
        var u = void 0, c = void 0, f = void 0, g = void 0;
        if (i != null ? (u = 0, f = i) : s && (u = s.x, f = s.width), o != null ? (c = 0, g = o) : s && (c = s.y, g = s.height), u == null || c == null) {
          var p = r.getBoundingRect();
          u == null && (u = p.x, f = p.width), c == null && (c = p.y, g = p.height);
        }
        l = this._boundingRect = new P(u, c, f, g);
      }
      if (s) {
        var h = xe(s, l);
        r.scaleX = r.scaleY = h.scale, r.x = h.x, r.y = h.y;
      }
      n.setClipPath(new Z({
        shape: l.plain()
      }));
      var v = [];
      return y(t.named, function(d) {
        Qr.get(d.svgNodeTagLower) != null && (v.push(d), en(d.el));
      }), {
        root: n,
        boundingRect: l,
        named: v
      };
    }, a.prototype.useGraphic = function(e) {
      var t = this._usedGraphicMap, r = t.get(e);
      return r || (r = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML), t.set(e, r), r);
    }, a.prototype.freeGraphic = function(e) {
      var t = this._usedGraphicMap, r = t.get(e);
      r && (t.removeKey(e), this._freedGraphics.push(r));
    }, a;
  }()
);
function en(a) {
  a.silent = !1, a.isGroup && a.traverse(function(e) {
    e.silent = !1;
  });
}
function rn(a) {
  var e = [], t = A();
  return y(a, function(r) {
    if (r.namedFrom == null) {
      var n = new rr(r.name, r.el);
      e.push(n), t.set(r.name, n);
    }
  }), {
    regions: e,
    regionsMap: t
  };
}
var gt = [126, 25], Ut = "南海诸岛", I = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];
for (var O = 0; O < I.length; O++)
  for (var V = 0; V < I[O].length; V++)
    I[O][V][0] /= 10.5, I[O][V][1] /= -10.5 / 0.75, I[O][V][0] += gt[0], I[O][V][1] += gt[1];
function nn(a, e) {
  if (a === "china") {
    for (var t = 0; t < e.length; t++)
      if (e[t].name === Ut)
        return;
    e.push(new nr(Ut, X(I, function(r) {
      return {
        type: "polygon",
        exterior: r
      };
    }), gt));
  }
}
var an = {
  南海诸岛: [32, 80],
  // 全国
  广东: [0, -10],
  香港: [10, 5],
  澳门: [-10, 10],
  // '北京': [-10, 0],
  天津: [5, 5]
};
function on(a, e) {
  if (a === "china") {
    var t = an[e.name];
    if (t) {
      var r = e.getCenter();
      r[0] += t[0] / 10.5, r[1] += -t[1] / (10.5 / 0.75), e.setCenter(r);
    }
  }
}
var sn = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
function ln(a, e) {
  a === "china" && e.name === "台湾" && e.geometries.push({
    type: "polygon",
    exterior: sn[0]
  });
}
var un = "name", cn = (
  /** @class */
  function() {
    function a(e, t, r) {
      this.type = "geoJSON", this._parsedMap = A(), this._mapName = e, this._specialAreas = r, this._geoJSON = pn(t);
    }
    return a.prototype.load = function(e, t) {
      t = t || un;
      var r = this._parsedMap.get(t);
      if (!r) {
        var n = this._parseToRegions(t);
        r = this._parsedMap.set(t, {
          regions: n,
          boundingRect: fn(n)
        });
      }
      var i = A(), o = [];
      return y(r.regions, function(s) {
        var l = s.name;
        e && U(e, l) && (s = s.cloneShallow(l = e[l])), o.push(s), i.set(l, s);
      }), {
        regions: o,
        boundingRect: r.boundingRect || new P(0, 0, 0, 0),
        regionsMap: i
      };
    }, a.prototype._parseToRegions = function(e) {
      var t = this._mapName, r = this._geoJSON, n;
      try {
        n = r ? ar(r, e) : [];
      } catch (i) {
        throw new Error(`Invalid geoJson format
` + i.message);
      }
      return nn(t, n), y(n, function(i) {
        var o = i.name;
        on(t, i), ln(t, i);
        var s = this._specialAreas && this._specialAreas[o];
        s && i.transformTo(s.left, s.top, s.width, s.height);
      }, this), n;
    }, a.prototype.getMapForUser = function() {
      return {
        // For backward compatibility, use geoJson
        // PENDING: it has been returning them without clone.
        // do we need to avoid outsite modification?
        geoJson: this._geoJSON,
        geoJSON: this._geoJSON,
        specialAreas: this._specialAreas
      };
    }, a;
  }()
);
function fn(a) {
  for (var e, t = 0; t < a.length; t++) {
    var r = a[t].getBoundingRect();
    e = e || r.clone(), e.union(r);
  }
  return e;
}
function pn(a) {
  return B(a) ? typeof JSON < "u" && JSON.parse ? JSON.parse(a) : new Function("return (" + a + ");")() : a;
}
var Y = A();
const E = {
  /**
   * Compatible with previous `echarts.registerMap`.
   *
   * @usage
   * ```js
   *
   * echarts.registerMap('USA', geoJson, specialAreas);
   *
   * echarts.registerMap('USA', {
   *     geoJson: geoJson,
   *     specialAreas: {...}
   * });
   * echarts.registerMap('USA', {
   *     geoJSON: geoJson,
   *     specialAreas: {...}
   * });
   *
   * echarts.registerMap('airport', {
   *     svg: svg
   * }
   * ```
   *
   * Note:
   * Do not support that register multiple geoJSON or SVG
   * one map name. Because different geoJSON and SVG have
   * different unit. It's not easy to make sure how those
   * units are mapping/normalize.
   * If intending to use multiple geoJSON or SVG, we can
   * use multiple geo coordinate system.
   */
  registerMap: function(a, e, t) {
    if (e.svg) {
      var r = new tn(a, e.svg);
      Y.set(a, r);
    } else {
      var n = e.geoJson || e.geoJSON;
      n && !e.features ? t = e.specialAreas : n = e;
      var r = new cn(a, n, t);
      Y.set(a, r);
    }
  },
  getGeoResource: function(a) {
    return Y.get(a);
  },
  /**
   * Only for exporting to users.
   * **MUST NOT** used internally.
   */
  getMapForUser: function(a) {
    var e = Y.get(a);
    return e && e.type === "geoJSON" && e.getMapForUser();
  },
  load: function(a, e, t) {
    var r = Y.get(a);
    if (!r) {
      process.env.NODE_ENV !== "production" && console.error("Map " + a + " not exists. The GeoJSON of the map must be provided.");
      return;
    }
    return r.load(e, t);
  }
};
var _t = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"], hn = A(_t), gn = A(_t.concat(["g"])), vn = A(_t.concat(["g"])), Ae = le();
function $(a) {
  var e = a.getItemStyle(), t = a.get("areaColor");
  return t != null && (e.fill = t), e;
}
function Jt(a) {
  var e = a.style;
  e && (e.stroke = e.stroke || e.fill, e.fill = null);
}
var dn = (
  /** @class */
  function() {
    function a(e) {
      var t = new G();
      this.uid = ir("ec_map_draw"), this._controller = new zr(e.getZr()), this._controllerHost = {
        target: t
      }, this.group = t, t.add(this._regionsGroup = new G()), t.add(this._svgGroup = new G());
    }
    return a.prototype.draw = function(e, t, r, n, i) {
      var o = e.mainType === "geo", s = e.getData && e.getData();
      o && t.eachComponent({
        mainType: "series",
        subType: "map"
      }, function(m) {
        !s && m.getHostGeoModel() === e && (s = m.getData());
      });
      var l = e.coordinateSystem, u = this._regionsGroup, c = this.group, f = l.getTransformInfo(), g = f.raw, p = f.roam, h = !u.childAt(0) || i;
      h ? (c.x = p.x, c.y = p.y, c.scaleX = p.scaleX, c.scaleY = p.scaleY, c.dirty()) : or(c, p, e);
      var v = s && s.getVisual("visualMeta") && s.getVisual("visualMeta").length > 0, d = {
        api: r,
        geo: l,
        mapOrGeoModel: e,
        data: s,
        isVisualEncodedByVisualMap: v,
        isGeo: o,
        transformInfoRaw: g
      };
      l.resourceType === "geoJSON" ? this._buildGeoJSON(d) : l.resourceType === "geoSVG" && this._buildSVG(d), this._updateController(e, t, r), this._updateMapSelectHandler(e, u, r, n);
    }, a.prototype._buildGeoJSON = function(e) {
      var t = this._regionsGroupByName = A(), r = A(), n = this._regionsGroup, i = e.transformInfoRaw, o = e.mapOrGeoModel, s = e.data, l = e.geo.projection, u = l && l.stream;
      function c(p, h) {
        return h && (p = h(p)), p && [p[0] * i.scaleX + i.x, p[1] * i.scaleY + i.y];
      }
      function f(p) {
        for (var h = [], v = !u && l && l.project, d = 0; d < p.length; ++d) {
          var m = c(p[d], v);
          m && h.push(m);
        }
        return h;
      }
      function g(p) {
        return {
          shape: {
            points: f(p)
          }
        };
      }
      n.removeAll(), y(e.geo.regions, function(p) {
        var h = p.name, v = t.get(h), d = r.get(h) || {}, m = d.dataIdx, S = d.regionModel;
        if (!v) {
          v = t.set(h, new G()), n.add(v), m = s ? s.indexOfName(h) : null, S = e.isGeo ? o.getRegionModel(h) : s ? s.getItemModel(m) : null;
          var x = S.get("silent", !0);
          x != null && (v.silent = x), r.set(h, {
            dataIdx: m,
            regionModel: S
          });
        }
        var _ = [], b = [];
        y(p.geometries, function(D) {
          if (D.type === "polygon") {
            var F = [D.exterior].concat(D.interiors || []);
            u && (F = Qt(F, u)), y(F, function(z) {
              _.push(new he(g(z)));
            });
          } else {
            var M = D.points;
            u && (M = Qt(M, u, !0)), y(M, function(z) {
              b.push(new pe(g(z)));
            });
          }
        });
        var R = c(p.getCenter(), l && l.project);
        function L(D, F) {
          if (D.length) {
            var M = new sr({
              culling: !0,
              segmentIgnoreThreshold: 1,
              shape: {
                paths: D
              }
            });
            v.add(M), Bt(e, M, m, S), Wt(e, M, h, S, o, m, R), F && (Jt(M), y(M.states, Jt));
          }
        }
        L(_), L(b, !0);
      }), t.each(function(p, h) {
        var v = r.get(h), d = v.dataIdx, m = v.regionModel;
        $t(e, p, h, m, o, d), Kt(e, p, h, m, o), qt(e, p, h, m, o);
      }, this);
    }, a.prototype._buildSVG = function(e) {
      var t = e.geo.map, r = e.transformInfoRaw;
      this._svgGroup.x = r.x, this._svgGroup.y = r.y, this._svgGroup.scaleX = r.scaleX, this._svgGroup.scaleY = r.scaleY, this._svgResourceChanged(t) && (this._freeSVG(), this._useSVG(t));
      var n = this._svgDispatcherMap = A(), i = !1;
      y(this._svgGraphicRecord.named, function(o) {
        var s = o.name, l = e.mapOrGeoModel, u = e.data, c = o.svgNodeTagLower, f = o.el, g = u ? u.indexOfName(s) : null, p = l.getRegionModel(s);
        hn.get(c) != null && f instanceof Lt && Bt(e, f, g, p), f instanceof Lt && (f.culling = !0);
        var h = p.get("silent", !0);
        if (h != null && (f.silent = h), f.z2EmphasisLift = 0, !o.namedFrom && (vn.get(c) != null && Wt(e, f, s, p, l, g, null), $t(e, f, s, p, l, g), Kt(e, f, s, p, l), gn.get(c) != null)) {
          var v = qt(e, f, s, p, l);
          v === "self" && (i = !0);
          var d = n.get(s) || n.set(s, []);
          d.push(f);
        }
      }, this), this._enableBlurEntireSVG(i, e);
    }, a.prototype._enableBlurEntireSVG = function(e, t) {
      if (e && t.isGeo) {
        var r = t.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle(), n = r.opacity;
        this._svgGraphicRecord.root.traverse(function(i) {
          if (!i.isGroup) {
            ve(i);
            var o = i.ensureState("blur").style || {};
            o.opacity == null && n != null && (o.opacity = n), i.ensureState("emphasis");
          }
        });
      }
    }, a.prototype.remove = function() {
      this._regionsGroup.removeAll(), this._regionsGroupByName = null, this._svgGroup.removeAll(), this._freeSVG(), this._controller.dispose(), this._controllerHost = null;
    }, a.prototype.findHighDownDispatchers = function(e, t) {
      if (e == null)
        return [];
      var r = t.coordinateSystem;
      if (r.resourceType === "geoJSON") {
        var n = this._regionsGroupByName;
        if (n) {
          var i = n.get(e);
          return i ? [i] : [];
        }
      } else if (r.resourceType === "geoSVG")
        return this._svgDispatcherMap && this._svgDispatcherMap.get(e) || [];
    }, a.prototype._svgResourceChanged = function(e) {
      return this._svgMapName !== e;
    }, a.prototype._useSVG = function(e) {
      var t = E.getGeoResource(e);
      if (t && t.type === "geoSVG") {
        var r = t.useGraphic(this.uid);
        this._svgGroup.add(r.root), this._svgGraphicRecord = r, this._svgMapName = e;
      }
    }, a.prototype._freeSVG = function() {
      var e = this._svgMapName;
      if (e != null) {
        var t = E.getGeoResource(e);
        t && t.type === "geoSVG" && t.freeGraphic(this.uid), this._svgGraphicRecord = null, this._svgDispatcherMap = null, this._svgGroup.removeAll(), this._svgMapName = null;
      }
    }, a.prototype._updateController = function(e, t, r) {
      var n = e.coordinateSystem, i = this._controller, o = this._controllerHost;
      o.zoomLimit = e.get("scaleLimit"), o.zoom = n.getZoom(), i.enable(e.get("roam") || !1);
      var s = e.mainType;
      function l() {
        var u = {
          type: "geoRoam",
          componentType: s
        };
        return u[s + "Id"] = e.id, u;
      }
      i.off("pan").on("pan", function(u) {
        this._mouseDownFlag = !1, Yr(o, u.dx, u.dy), r.dispatchAction(j(l(), {
          dx: u.dx,
          dy: u.dy,
          animation: {
            duration: 0
          }
        }));
      }, this), i.off("zoom").on("zoom", function(u) {
        this._mouseDownFlag = !1, Nr(o, u.scale, u.originX, u.originY), r.dispatchAction(j(l(), {
          totalZoom: o.zoom,
          zoom: u.scale,
          originX: u.originX,
          originY: u.originY,
          animation: {
            duration: 0
          }
        }));
      }, this), i.setPointerChecker(function(u, c, f) {
        return n.containPoint([c, f]) && !Hr(u, r, e);
      });
    }, a.prototype.resetForLabelLayout = function() {
      this.group.traverse(function(e) {
        var t = e.getTextContent();
        t && (t.ignore = Ae(t).ignore);
      });
    }, a.prototype._updateMapSelectHandler = function(e, t, r, n) {
      var i = this;
      t.off("mousedown"), t.off("click"), e.get("selectedMode") && (t.on("mousedown", function() {
        i._mouseDownFlag = !0;
      }), t.on("click", function(o) {
        i._mouseDownFlag && (i._mouseDownFlag = !1);
      }));
    }, a;
  }()
);
function Bt(a, e, t, r) {
  var n = r.getModel("itemStyle"), i = r.getModel(["emphasis", "itemStyle"]), o = r.getModel(["blur", "itemStyle"]), s = r.getModel(["select", "itemStyle"]), l = $(n), u = $(i), c = $(s), f = $(o), g = a.data;
  if (g) {
    var p = g.getItemVisual(t, "style"), h = g.getItemVisual(t, "decal");
    a.isVisualEncodedByVisualMap && p.fill && (l.fill = p.fill), h && (l.decal = lr(h, a.api));
  }
  e.setStyle(l), e.style.strokeNoScale = !0, e.ensureState("emphasis").style = u, e.ensureState("select").style = c, e.ensureState("blur").style = f, ve(e);
}
function Wt(a, e, t, r, n, i, o) {
  var s = a.data, l = a.isGeo, u = s && isNaN(s.get(s.mapDimension("value"), i)), c = s && s.getItemLayout(i);
  if (l || u || c && c.showLabel) {
    var f = l ? t : i, g = void 0;
    (!s || i >= 0) && (g = n);
    var p = o ? {
      normal: {
        align: "center",
        verticalAlign: "middle"
      }
    } : null;
    ur(e, cr(r), {
      labelFetcher: g,
      labelDataIndex: f,
      defaultText: t
    }, p);
    var h = e.getTextContent();
    if (h && (Ae(h).ignore = h.ignore, e.textConfig && o)) {
      var v = e.getBoundingRect().clone();
      e.textConfig.layoutRect = v, e.textConfig.position = [(o[0] - v.x) / v.width * 100 + "%", (o[1] - v.y) / v.height * 100 + "%"];
    }
    e.disableLabelAnimation = !0;
  } else
    e.removeTextContent(), e.removeTextConfig(), e.disableLabelAnimation = null;
}
function $t(a, e, t, r, n, i) {
  a.data ? a.data.setItemGraphicEl(i, e) : ct(e).eventData = {
    componentType: "geo",
    componentIndex: n.componentIndex,
    geoIndex: n.componentIndex,
    name: t,
    region: r && r.option || {}
  };
}
function Kt(a, e, t, r, n) {
  a.data || fr({
    el: e,
    componentModel: n,
    itemName: t,
    // @ts-ignore FIXME:TS fix the "compatible with each other"?
    itemTooltipOption: r.get("tooltip")
  });
}
function qt(a, e, t, r, n) {
  e.highDownSilentOnTouch = !!n.get("selectedMode");
  var i = r.getModel("emphasis"), o = i.get("focus");
  return pr(e, o, i.get("blurScope"), i.get("disabled")), a.isGeo && hr(e, n, t), o;
}
function Qt(a, e, t) {
  var r = [], n;
  function i() {
    n = [];
  }
  function o() {
    n.length && (r.push(n), n = []);
  }
  var s = e({
    polygonStart: i,
    polygonEnd: o,
    lineStart: i,
    lineEnd: o,
    point: function(l, u) {
      isFinite(l) && isFinite(u) && n.push([l, u]);
    },
    sphere: function() {
    }
  });
  return !t && s.polygonStart(), y(a, function(l) {
    s.lineStart();
    for (var u = 0; u < l.length; u++)
      s.point(l[u][0], l[u][1]);
    s.lineEnd();
  }), !t && s.polygonEnd(), r;
}
var te = H, be = (
  /** @class */
  function(a) {
    T(e, a);
    function e(t) {
      var r = a.call(this) || this;
      return r.type = "view", r.dimensions = ["x", "y"], r._roamTransformable = new W(), r._rawTransformable = new W(), r.name = t, r;
    }
    return e.prototype.setBoundingRect = function(t, r, n, i) {
      return this._rect = new P(t, r, n, i), this._rect;
    }, e.prototype.getBoundingRect = function() {
      return this._rect;
    }, e.prototype.setViewRect = function(t, r, n, i) {
      this._transformTo(t, r, n, i), this._viewRect = new P(t, r, n, i);
    }, e.prototype._transformTo = function(t, r, n, i) {
      var o = this.getBoundingRect(), s = this._rawTransformable;
      s.transform = o.calculateTransform(new P(t, r, n, i));
      var l = s.parent;
      s.parent = null, s.decomposeTransform(), s.parent = l, this._updateTransform();
    }, e.prototype.setCenter = function(t, r) {
      t && (this._center = [N(t[0], r.getWidth()), N(t[1], r.getHeight())], this._updateCenterAndZoom());
    }, e.prototype.setZoom = function(t) {
      t = t || 1;
      var r = this.zoomLimit;
      r && (r.max != null && (t = Math.min(r.max, t)), r.min != null && (t = Math.max(r.min, t))), this._zoom = t, this._updateCenterAndZoom();
    }, e.prototype.getDefaultCenter = function() {
      var t = this.getBoundingRect(), r = t.x + t.width / 2, n = t.y + t.height / 2;
      return [r, n];
    }, e.prototype.getCenter = function() {
      return this._center || this.getDefaultCenter();
    }, e.prototype.getZoom = function() {
      return this._zoom || 1;
    }, e.prototype.getRoamTransform = function() {
      return this._roamTransformable.getLocalTransform();
    }, e.prototype._updateCenterAndZoom = function() {
      var t = this._rawTransformable.getLocalTransform(), r = this._roamTransformable, n = this.getDefaultCenter(), i = this.getCenter(), o = this.getZoom();
      i = H([], i, t), n = H([], n, t), r.originX = i[0], r.originY = i[1], r.x = n[0] - i[0], r.y = n[1] - i[1], r.scaleX = r.scaleY = o, this._updateTransform();
    }, e.prototype._updateTransform = function() {
      var t = this._roamTransformable, r = this._rawTransformable;
      r.parent = t, t.updateTransform(), r.updateTransform(), gr(this.transform || (this.transform = []), r.transform || ge()), this._rawTransform = r.getLocalTransform(), this.invTransform = this.invTransform || [], oe(this.invTransform, this.transform), this.decomposeTransform();
    }, e.prototype.getTransformInfo = function() {
      var t = this._rawTransformable, r = this._roamTransformable, n = new W();
      return n.transform = r.transform, n.decomposeTransform(), {
        roam: {
          x: n.x,
          y: n.y,
          scaleX: n.scaleX,
          scaleY: n.scaleY
        },
        raw: {
          x: t.x,
          y: t.y,
          scaleX: t.scaleX,
          scaleY: t.scaleY
        }
      };
    }, e.prototype.getViewRect = function() {
      return this._viewRect;
    }, e.prototype.getViewRectAfterRoam = function() {
      var t = this.getBoundingRect().clone();
      return t.applyTransform(this.transform), t;
    }, e.prototype.dataToPoint = function(t, r, n) {
      var i = r ? this._rawTransform : this.transform;
      return n = n || [], i ? te(n, t, i) : vr(n, t);
    }, e.prototype.pointToData = function(t) {
      var r = this.invTransform;
      return r ? te([], t, r) : [t[0], t[1]];
    }, e.prototype.convertToPixel = function(t, r, n) {
      var i = ee(r);
      return i === this ? i.dataToPoint(n) : null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      var i = ee(r);
      return i === this ? i.pointToData(n) : null;
    }, e.prototype.containPoint = function(t) {
      return this.getViewRectAfterRoam().contain(t[0], t[1]);
    }, e.dimensions = ["x", "y"], e;
  }(W)
);
function ee(a) {
  var e = a.seriesModel;
  return e ? e.coordinateSystem : null;
}
var yn = {
  geoJSON: {
    aspectScale: 0.75,
    invertLongitute: !0
  },
  geoSVG: {
    aspectScale: 1,
    invertLongitute: !1
  }
}, we = ["lng", "lat"], vt = (
  /** @class */
  function(a) {
    T(e, a);
    function e(t, r, n) {
      var i = a.call(this, t) || this;
      i.dimensions = we, i.type = "geo", i._nameCoordMap = A(), i.map = r;
      var o = n.projection, s = E.load(r, n.nameMap, n.nameProperty), l = E.getGeoResource(r), u = i.resourceType = l ? l.type : null, c = i.regions = s.regions, f = yn[l.type];
      i._regionsMap = s.regionsMap, i.regions = s.regions, process.env.NODE_ENV !== "production" && o && (u === "geoSVG" && (process.env.NODE_ENV !== "production" && Rt("Map " + r + " with SVG source can't use projection. Only GeoJSON source supports projection."), o = null), o.project && o.unproject || (process.env.NODE_ENV !== "production" && Rt("project and unproject must be both provided in the projeciton."), o = null)), i.projection = o;
      var g;
      if (o)
        for (var p = 0; p < c.length; p++) {
          var h = c[p].getBoundingRect(o);
          g = g || h.clone(), g.union(h);
        }
      else
        g = s.boundingRect;
      return i.setBoundingRect(g.x, g.y, g.width, g.height), i.aspectScale = o ? 1 : dr(n.aspectScale, f.aspectScale), i._invertLongitute = o ? !1 : f.invertLongitute, i;
    }
    return e.prototype._transformTo = function(t, r, n, i) {
      var o = this.getBoundingRect(), s = this._invertLongitute;
      o = o.clone(), s && (o.y = -o.y - o.height);
      var l = this._rawTransformable;
      l.transform = o.calculateTransform(new P(t, r, n, i));
      var u = l.parent;
      l.parent = null, l.decomposeTransform(), l.parent = u, s && (l.scaleY = -l.scaleY), this._updateTransform();
    }, e.prototype.getRegion = function(t) {
      return this._regionsMap.get(t);
    }, e.prototype.getRegionByCoord = function(t) {
      for (var r = this.regions, n = 0; n < r.length; n++) {
        var i = r[n];
        if (i.type === "geoJSON" && i.contain(t))
          return r[n];
      }
    }, e.prototype.addGeoCoord = function(t, r) {
      this._nameCoordMap.set(t, r);
    }, e.prototype.getGeoCoord = function(t) {
      var r = this._regionsMap.get(t);
      return this._nameCoordMap.get(t) || r && r.getCenter();
    }, e.prototype.dataToPoint = function(t, r, n) {
      if (B(t) && (t = this.getGeoCoord(t)), t) {
        var i = this.projection;
        return i && (t = i.project(t)), t && this.projectedToPoint(t, r, n);
      }
    }, e.prototype.pointToData = function(t) {
      var r = this.projection;
      return r && (t = r.unproject(t)), t && this.pointToProjected(t);
    }, e.prototype.pointToProjected = function(t) {
      return a.prototype.pointToData.call(this, t);
    }, e.prototype.projectedToPoint = function(t, r, n) {
      return a.prototype.dataToPoint.call(this, t, r, n);
    }, e.prototype.convertToPixel = function(t, r, n) {
      var i = re(r);
      return i === this ? i.dataToPoint(n) : null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      var i = re(r);
      return i === this ? i.pointToData(n) : null;
    }, e;
  }(be)
);
ie(vt, be);
function re(a) {
  var e = a.geoModel, t = a.seriesModel;
  return e ? e.coordinateSystem : t ? t.coordinateSystem || (t.getReferringComponents("geo", q).models[0] || {}).coordinateSystem : null;
}
function ne(a, e) {
  var t = a.get("boundingCoords");
  if (t != null) {
    var r = t[0], n = t[1];
    if (!(isFinite(r[0]) && isFinite(r[1]) && isFinite(n[0]) && isFinite(n[1])))
      process.env.NODE_ENV !== "production" && console.error("Invalid boundingCoords");
    else {
      var i = this.projection;
      if (i) {
        var o = r[0], s = r[1], l = n[0], u = n[1];
        r = [1 / 0, 1 / 0], n = [-1 / 0, -1 / 0];
        var c = function(R, L, D, F) {
          for (var M = D - R, z = F - L, rt = 0; rt <= 100; rt++) {
            var St = rt / 100, xt = i.project([R + M * St, L + z * St]);
            Sr(r, r, xt), xr(n, n, xt);
          }
        };
        c(o, s, l, s), c(l, s, l, u), c(l, u, o, u), c(o, u, l, s);
      }
      this.setBoundingRect(r[0], r[1], n[0] - r[0], n[1] - r[1]);
    }
  }
  var f = this.getBoundingRect(), g = a.get("layoutCenter"), p = a.get("layoutSize"), h = e.getWidth(), v = e.getHeight(), d = f.width / f.height * this.aspectScale, m = !1, S, x;
  g && p && (S = [N(g[0], h), N(g[1], v)], x = N(p, Math.min(h, v)), !isNaN(S[0]) && !isNaN(S[1]) && !isNaN(x) ? m = !0 : process.env.NODE_ENV !== "production" && console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."));
  var _;
  if (m)
    _ = {}, d > 1 ? (_.width = x, _.height = x / d) : (_.height = x, _.width = x * d), _.y = S[1] - _.height / 2, _.x = S[0] - _.width / 2;
  else {
    var b = a.getBoxLayoutParams();
    b.aspect = d, _ = se(b, {
      width: h,
      height: v
    });
  }
  this.setViewRect(_.x, _.y, _.width, _.height), this.setCenter(a.get("center"), e), this.setZoom(a.get("zoom"));
}
function mn(a, e) {
  y(e.get("geoCoord"), function(t, r) {
    a.addGeoCoord(r, t);
  });
}
var _n = (
  /** @class */
  function() {
    function a() {
      this.dimensions = we;
    }
    return a.prototype.create = function(e, t) {
      var r = [];
      function n(o) {
        return {
          nameProperty: o.get("nameProperty"),
          aspectScale: o.get("aspectScale"),
          projection: o.get("projection")
        };
      }
      e.eachComponent("geo", function(o, s) {
        var l = o.get("map"), u = new vt(l + s, l, j({
          nameMap: o.get("nameMap")
        }, n(o)));
        u.zoomLimit = o.get("scaleLimit"), r.push(u), o.coordinateSystem = u, u.model = o, u.resize = ne, u.resize(o, t);
      }), e.eachSeries(function(o) {
        var s = o.get("coordinateSystem");
        if (s === "geo") {
          var l = o.get("geoIndex") || 0;
          o.coordinateSystem = r[l];
        }
      });
      var i = {};
      return e.eachSeriesByType("map", function(o) {
        if (!o.getHostGeoModel()) {
          var s = o.getMapType();
          i[s] = i[s] || [], i[s].push(o);
        }
      }), y(i, function(o, s) {
        var l = X(o, function(c) {
          return c.get("nameMap");
        }), u = new vt(s, s, j({
          nameMap: yr(l)
        }, n(o[0])));
        u.zoomLimit = mr.apply(null, X(o, function(c) {
          return c.get("scaleLimit");
        })), r.push(u), u.resize = ne, u.resize(o[0], t), y(o, function(c) {
          c.coordinateSystem = u, mn(u, c);
        });
      }), r;
    }, a.prototype.getFilledRegions = function(e, t, r, n) {
      for (var i = (e || []).slice(), o = A(), s = 0; s < i.length; s++)
        o.set(i[s].name, i[s]);
      var l = E.load(t, r, n);
      return y(l.regions, function(u) {
        var c = u.name, f = o.get(c), g = u.properties && u.properties.echartsStyle;
        f || (f = {
          name: c
        }, i.push(f)), g && _r(f, g);
      }), i;
    }, a;
  }()
), Te = new _n(), Sn = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = e.type, t;
    }
    return e.prototype.init = function(t, r, n) {
      var i = E.getGeoResource(t.map);
      if (i && i.type === "geoJSON") {
        var o = t.itemStyle = t.itemStyle || {};
        "color" in o || (o.color = "#eee");
      }
      this.mergeDefaultAndTheme(t, n), Ar(t, "label", ["show"]);
    }, e.prototype.optionUpdated = function() {
      var t = this, r = this.option;
      r.regions = Te.getFilledRegions(r.regions, r.map, r.nameMap, r.nameProperty);
      var n = {};
      this._optionModelMap = br(r.regions || [], function(i, o) {
        var s = o.name;
        return s && (i.set(s, new Dt(o, t, t.ecModel)), o.selected && (n[s] = !0)), i;
      }, A()), r.selectedMap || (r.selectedMap = n);
    }, e.prototype.getRegionModel = function(t) {
      return this._optionModelMap.get(t) || new Dt(null, this, this.ecModel);
    }, e.prototype.getFormattedLabel = function(t, r) {
      var n = this.getRegionModel(t), i = r === "normal" ? n.get(["label", "formatter"]) : n.get(["emphasis", "label", "formatter"]), o = {
        name: t
      };
      if (wr(i))
        return o.status = r, i(o);
      if (B(i))
        return i.replace("{a}", t ?? "");
    }, e.prototype.setZoom = function(t) {
      this.option.zoom = t;
    }, e.prototype.setCenter = function(t) {
      this.option.center = t;
    }, e.prototype.select = function(t) {
      var r = this.option, n = r.selectedMode;
      if (n) {
        n !== "multiple" && (r.selectedMap = null);
        var i = r.selectedMap || (r.selectedMap = {});
        i[t] = !0;
      }
    }, e.prototype.unSelect = function(t) {
      var r = this.option.selectedMap;
      r && (r[t] = !1);
    }, e.prototype.toggleSelected = function(t) {
      this[this.isSelected(t) ? "unSelect" : "select"](t);
    }, e.prototype.isSelected = function(t) {
      var r = this.option.selectedMap;
      return !!(r && r[t]);
    }, e.type = "geo", e.layoutMode = "box", e.defaultOption = {
      // zlevel: 0,
      z: 0,
      show: !0,
      left: "center",
      top: "center",
      // Default value:
      // for geoSVG source: 1,
      // for geoJSON source: 0.75.
      aspectScale: null,
      // /// Layout with center and size
      // If you want to put map in a fixed size box with right aspect ratio
      // This two properties may be more convenient
      // layoutCenter: [50%, 50%]
      // layoutSize: 100
      silent: !1,
      // Map type
      map: "",
      // Define left-top, right-bottom coords to control view
      // For example, [ [180, 90], [-180, -90] ]
      boundingCoords: null,
      // Default on center of map
      center: null,
      zoom: 1,
      scaleLimit: null,
      // selectedMode: false
      label: {
        show: !1,
        color: "#000"
      },
      itemStyle: {
        borderWidth: 0.5,
        borderColor: "#444"
        // Default color:
        // + geoJSON: #eee
        // + geoSVG: null (use SVG original `fill`)
        // color: '#eee'
      },
      emphasis: {
        label: {
          show: !0,
          color: "rgb(100,0,0)"
        },
        itemStyle: {
          color: "rgba(255,215,0,0.8)"
        }
      },
      select: {
        label: {
          show: !0,
          color: "rgb(100,0,0)"
        },
        itemStyle: {
          color: "rgba(255,215,0,0.8)"
        }
      },
      regions: []
      // tooltip: {
      //     show: false
      // }
    }, e;
  }(dt)
);
function ae(a, e) {
  return a.pointToProjected ? a.pointToProjected(e) : a.pointToData(e);
}
function xn(a, e, t, r) {
  var n = a.getZoom(), i = a.getCenter(), o = e.zoom, s = a.projectedToPoint ? a.projectedToPoint(i) : a.dataToPoint(i);
  if (e.dx != null && e.dy != null && (s[0] -= e.dx, s[1] -= e.dy, a.setCenter(ae(a, s), r)), o != null) {
    if (t) {
      var l = t.min || 0, u = t.max || 1 / 0;
      o = Math.max(Math.min(n * o, u), l) / n;
    }
    a.scaleX *= o, a.scaleY *= o;
    var c = (e.originX - a.x) * (o - 1), f = (e.originY - a.y) * (o - 1);
    a.x -= c, a.y -= f, a.updateTransform(), a.setCenter(ae(a, s), r), a.setZoom(o * n);
  }
  return {
    center: a.getCenter(),
    zoom: a.getZoom()
  };
}
var An = (
  /** @class */
  function(a) {
    T(e, a);
    function e() {
      var t = a !== null && a.apply(this, arguments) || this;
      return t.type = e.type, t.focusBlurEnabled = !0, t;
    }
    return e.prototype.init = function(t, r) {
      this._api = r;
    }, e.prototype.render = function(t, r, n, i) {
      if (this._model = t, !t.get("show")) {
        this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
        return;
      }
      this._mapDraw || (this._mapDraw = new dn(n));
      var o = this._mapDraw;
      o.draw(t, r, n, this, i), o.group.on("click", this._handleRegionClick, this), o.group.silent = t.get("silent"), this.group.add(o.group), this.updateSelectStatus(t, r, n);
    }, e.prototype._handleRegionClick = function(t) {
      var r;
      Tr(t.target, function(n) {
        return (r = ct(n).eventData) != null;
      }, !0), r && this._api.dispatchAction({
        type: "geoToggleSelect",
        geoId: this._model.id,
        name: r.name
      });
    }, e.prototype.updateSelectStatus = function(t, r, n) {
      var i = this;
      this._mapDraw.group.traverse(function(o) {
        var s = ct(o).eventData;
        if (s)
          return i._model.isSelected(s.name) ? n.enterSelect(o) : n.leaveSelect(o), !0;
      });
    }, e.prototype.findHighDownDispatchers = function(t) {
      return this._mapDraw && this._mapDraw.findHighDownDispatchers(t, this._model);
    }, e.prototype.dispose = function() {
      this._mapDraw && this._mapDraw.remove();
    }, e.type = "geo", e;
  }(ce)
);
function bn(a, e, t) {
  E.registerMap(a, e, t);
}
function Ln(a) {
  a.registerCoordinateSystem("geo", Te), a.registerComponentModel(Sn), a.registerComponentView(An), a.registerImpl("registerMap", bn), a.registerImpl("getMap", function(t) {
    return E.getMapForUser(t);
  });
  function e(t, r) {
    r.update = "geo:updateSelectStatus", a.registerAction(r, function(n, i) {
      var o = {}, s = [];
      return i.eachComponent({
        mainType: "geo",
        query: n
      }, function(l) {
        l[t](n.name);
        var u = l.coordinateSystem;
        y(u.regions, function(f) {
          o[f.name] = l.isSelected(f.name) || !1;
        });
        var c = [];
        y(o, function(f, g) {
          o[g] && c.push(g);
        }), s.push({
          geoIndex: l.componentIndex,
          // Use singular, the same naming convention as the event `selectchanged`.
          name: c
        });
      }), {
        selected: o,
        allSelected: s,
        name: n.name
      };
    });
  }
  e("toggleSelected", {
    type: "geoToggleSelect",
    event: "geoselectchanged"
  }), e("select", {
    type: "geoSelect",
    event: "geoselected"
  }), e("unSelect", {
    type: "geoUnSelect",
    event: "geounselected"
  }), a.registerAction({
    type: "geoRoam",
    event: "geoRoam",
    update: "updateTransform"
  }, function(t, r, n) {
    var i = t.componentType || "series";
    r.eachComponent({
      mainType: i,
      query: t
    }, function(o) {
      var s = o.coordinateSystem;
      if (s.type === "geo") {
        var l = xn(s, t, o.get("scaleLimit"), n);
        o.setCenter && o.setCenter(l.center), o.setZoom && o.setZoom(l.zoom), i === "series" && y(o.seriesGroup, function(u) {
          u.setCenter(l.center), u.setZoom(l.zoom);
        });
      }
    });
  });
}
export {
  dn as M,
  zr as R,
  Cn as a,
  Ln as b,
  E as g,
  Tn as i,
  Hr as o,
  Gn as r,
  Mn as t
};
