import { cF as Be, _ as A, cG as cr, cH as _e, cI as Ge, cJ as k, e as y, aj as P, cK as Ot, cL as Ft, g as X, b5 as It, ct as fr, cu as Ne, t as R, bz as Le, S as K, ch as Vt, cM as pr, cN as hr, aH as Bt, aI as Pe, cO as vr, J as gr, ay as ie, cP as dr, cQ as yr, cR as ke, cS as mr, cT as Nt, aw as Ee, cU as ze, cV as Ye, cW as _r, cX as $, cY as Sr, cZ as xr, au as kt, c_ as Ar, c$ as br, d0 as wr, d1 as zt, d2 as Y, d3 as oe, d4 as Ue, d5 as Xe, d6 as Ze, q as se, d7 as Cr, d8 as Tr, d9 as De, da as Mr, db as Gr, b8 as Lr, aN as Pr, av as fe, c as x, j as Yt, U as Z, X as ee, G, dc as Er, dd as Dr, bp as Se, de as He, df as Je, bA as Ut, bN as Rr, bl as Or, cm as xe, V as U, A as H, dg as je, cy as We, bt as Fr, a9 as te, aZ as Q, dh as Ir, di as Vr, Z as Br, aA as Xt, aE as Zt, dj as Nr, al as kr, dk as zr, a5 as Yr, bm as Ur, dl as Xr, bi as Zr, c3 as Hr, dm as Jr, dn as jr, dp as Wr, dq as Ht, bG as qr, v as Kr, be as $r, b3 as qe, bf as Jt, aO as Qr, B as en, y as tn, E as Ae, bI as rn, D as nn, dr as an, ds as re, aJ as N, bk as on, dt as sn, du as ln, ac as Ke, dv as un, r as cn, ap as fn, dw as pn, aG as hn, a$ as vn, aX as $e, i as gn, c1 as dn } from "./index-BlBz2EJH.js";
var yn = 1e-8;
function Qe(i, t) {
  return Math.abs(i - t) < yn;
}
function et(i, t, e) {
  var r = 0, n = i[0];
  if (!n)
    return !1;
  for (var a = 1; a < i.length; a++) {
    var o = i[a];
    r += Be(n[0], n[1], o[0], o[1], t, e), n = o;
  }
  var s = i[0];
  return (!Qe(n[0], s[0]) || !Qe(n[1], s[1])) && (r += Be(n[0], n[1], s[0], s[1], t, e)), r !== 0;
}
var mn = [];
function ve(i, t) {
  for (var e = 0; e < i.length; e++)
    k(i[e], i[e], t);
}
function tt(i, t, e, r) {
  for (var n = 0; n < i.length; n++) {
    var a = i[n];
    r && (a = r.project(a)), a && isFinite(a[0]) && isFinite(a[1]) && (Ot(t, t, a), Ft(e, e, a));
  }
}
function _n(i) {
  for (var t = 0, e = 0, r = 0, n = i.length, a = i[n - 1][0], o = i[n - 1][1], s = 0; s < n; s++) {
    var l = i[s][0], u = i[s][1], c = a * u - l * o;
    t += c, e += (a + l) * c, r += (o + u) * c, a = l, o = u;
  }
  return t ? [e / t / 3, r / t / 3, t] : [i[0][0] || 0, i[0][1] || 0];
}
var jt = (
  /** @class */
  (function() {
    function i(t) {
      this.name = t;
    }
    return i.prototype.setCenter = function(t) {
      this._center = t;
    }, i.prototype.getCenter = function() {
      var t = this._center;
      return t || (t = this._center = this.calcCenter()), t;
    }, i;
  })()
), rt = (
  /** @class */
  /* @__PURE__ */ (function() {
    function i(t, e) {
      this.type = "polygon", this.exterior = t, this.interiors = e;
    }
    return i;
  })()
), nt = (
  /** @class */
  /* @__PURE__ */ (function() {
    function i(t) {
      this.type = "linestring", this.points = t;
    }
    return i;
  })()
), Wt = (
  /** @class */
  (function(i) {
    A(t, i);
    function t(e, r, n) {
      var a = i.call(this, e) || this;
      return a.type = "geoJSON", a.geometries = r, a._center = n && [n[0], n[1]], a;
    }
    return t.prototype.calcCenter = function() {
      for (var e = this.geometries, r, n = 0, a = 0; a < e.length; a++) {
        var o = e[a], s = o.exterior, l = s && s.length;
        l > n && (r = o, n = l);
      }
      if (r)
        return _n(r.exterior);
      var u = this.getBoundingRect();
      return [u.x + u.width / 2, u.y + u.height / 2];
    }, t.prototype.getBoundingRect = function(e) {
      var r = this._rect;
      if (r && !e)
        return r;
      var n = [1 / 0, 1 / 0], a = [-1 / 0, -1 / 0], o = this.geometries;
      return y(o, function(s) {
        s.type === "polygon" ? tt(s.exterior, n, a, e) : y(s.points, function(l) {
          tt(l, n, a, e);
        });
      }), isFinite(n[0]) && isFinite(n[1]) && isFinite(a[0]) && isFinite(a[1]) || (n[0] = n[1] = a[0] = a[1] = 0), r = new P(n[0], n[1], a[0] - n[0], a[1] - n[1]), e || (this._rect = r), r;
    }, t.prototype.contain = function(e) {
      var r = this.getBoundingRect(), n = this.geometries;
      if (!r.contain(e[0], e[1]))
        return !1;
      e: for (var a = 0, o = n.length; a < o; a++) {
        var s = n[a];
        if (s.type === "polygon") {
          var l = s.exterior, u = s.interiors;
          if (et(l, e[0], e[1])) {
            for (var c = 0; c < (u ? u.length : 0); c++)
              if (et(u[c], e[0], e[1]))
                continue e;
            return !0;
          }
        }
      }
      return !1;
    }, t.prototype.transformTo = function(e, r, n, a) {
      var o = this.getBoundingRect(), s = o.width / o.height;
      n ? a || (a = n / s) : n = s * a;
      for (var l = new P(e, r, n, a), u = o.calculateTransform(l), c = this.geometries, f = 0; f < c.length; f++) {
        var h = c[f];
        h.type === "polygon" ? (ve(h.exterior, u), y(h.interiors, function(p) {
          ve(p, u);
        })) : y(h.points, function(p) {
          ve(p, u);
        });
      }
      o = this._rect, o.copy(l), this._center = [o.x + o.width / 2, o.y + o.height / 2];
    }, t.prototype.cloneShallow = function(e) {
      e == null && (e = this.name);
      var r = new t(e, this.geometries, this._center);
      return r._rect = this._rect, r.transformTo = null, r;
    }, t;
  })(jt)
), Sn = (
  /** @class */
  (function(i) {
    A(t, i);
    function t(e, r) {
      var n = i.call(this, e) || this;
      return n.type = "geoSVG", n._elOnlyForCalculate = r, n;
    }
    return t.prototype.calcCenter = function() {
      for (var e = this._elOnlyForCalculate, r = e.getBoundingRect(), n = [r.x + r.width / 2, r.y + r.height / 2], a = cr(mn), o = e; o && !o.isGeoSVGGraphicRoot; )
        _e(a, o.getLocalTransform(), a), o = o.parent;
      return Ge(a, a), k(n, n, a), n;
    }, t;
  })(jt)
);
function xn(i) {
  if (!i.UTF8Encoding)
    return i;
  var t = i, e = t.UTF8Scale;
  e == null && (e = 1024);
  var r = t.features;
  return y(r, function(n) {
    var a = n.geometry, o = a.encodeOffsets, s = a.coordinates;
    if (o)
      switch (a.type) {
        case "LineString":
          a.coordinates = qt(s, o, e);
          break;
        case "Polygon":
          ge(s, o, e);
          break;
        case "MultiLineString":
          ge(s, o, e);
          break;
        case "MultiPolygon":
          y(s, function(l, u) {
            return ge(l, o[u], e);
          });
      }
  }), t.UTF8Encoding = !1, t;
}
function ge(i, t, e) {
  for (var r = 0; r < i.length; r++)
    i[r] = qt(i[r], t[r], e);
}
function qt(i, t, e) {
  for (var r = [], n = t[0], a = t[1], o = 0; o < i.length; o += 2) {
    var s = i.charCodeAt(o) - 64, l = i.charCodeAt(o + 1) - 64;
    s = s >> 1 ^ -(s & 1), l = l >> 1 ^ -(l & 1), s += n, l += a, n = s, a = l, r.push([s / e, l / e]);
  }
  return r;
}
function An(i, t) {
  return i = xn(i), X(It(i.features, function(e) {
    return e.geometry && e.properties && e.geometry.coordinates.length > 0;
  }), function(e) {
    var r = e.properties, n = e.geometry, a = [];
    switch (n.type) {
      case "Polygon":
        var o = n.coordinates;
        a.push(new rt(o[0], o.slice(1)));
        break;
      case "MultiPolygon":
        y(n.coordinates, function(l) {
          l[0] && a.push(new rt(l[0], l.slice(1)));
        });
        break;
      case "LineString":
        a.push(new nt([n.coordinates]));
        break;
      case "MultiLineString":
        a.push(new nt(n.coordinates));
    }
    var s = new Wt(r[t || "name"], a, r.cp);
    return s.properties = r, s;
  });
}
function Ti(i, t) {
  return i.type === t;
}
var Kt = {
  left: 0,
  right: 0,
  top: 0,
  bottom: 0
}, le = ["25%", "25%"], bn = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      return i !== null && i.apply(this, arguments) || this;
    }
    return t.prototype.mergeDefaultAndTheme = function(e, r) {
      var n = fr(e.outerBounds);
      i.prototype.mergeDefaultAndTheme.apply(this, arguments), n && e.outerBounds && Ne(e.outerBounds, n);
    }, t.prototype.mergeOption = function(e, r) {
      i.prototype.mergeOption.apply(this, arguments), this.option.outerBounds && e.outerBounds && Ne(this.option.outerBounds, e.outerBounds);
    }, t.type = "grid", t.dependencies = ["xAxis", "yAxis"], t.layoutMode = "box", t.defaultOption = {
      show: !1,
      // zlevel: 0,
      z: 0,
      left: "15%",
      top: 65,
      right: "10%",
      bottom: 80,
      // If grid size contain label
      containLabel: !1,
      outerBoundsMode: "auto",
      outerBounds: Kt,
      outerBoundsContain: "all",
      outerBoundsClampWidth: le[0],
      outerBoundsClampHeight: le[1],
      // width: {totalWidth} - left - right,
      // height: {totalHeight} - top - bottom,
      backgroundColor: R.color.transparent,
      borderWidth: 1,
      borderColor: R.color.neutral30
    }, t;
  })(Le)
), be = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      return i !== null && i.apply(this, arguments) || this;
    }
    return t.prototype.getCoordSysModel = function() {
      return this.getReferringComponents("grid", K).models[0];
    }, t.type = "cartesian2dAxis", t;
  })(Le)
);
Vt(be, pr);
var wn = (
  /** @class */
  (function() {
    function i(t) {
      this.type = "cartesian", this._dimList = [], this._axes = {}, this.name = t || "";
    }
    return i.prototype.getAxis = function(t) {
      return this._axes[t];
    }, i.prototype.getAxes = function() {
      return X(this._dimList, function(t) {
        return this._axes[t];
      }, this);
    }, i.prototype.getAxesByScale = function(t) {
      return t = t.toLowerCase(), It(this.getAxes(), function(e) {
        return e.scale.type === t;
      });
    }, i.prototype.addAxis = function(t) {
      var e = t.dim;
      this._axes[e] = t, this._dimList.push(e);
    }, i;
  })()
), we = ["x", "y"];
function it(i) {
  return (i.type === "interval" || i.type === "time") && !i.hasBreaks();
}
var Cn = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = "cartesian2d", e.dimensions = we, e;
    }
    return t.prototype.calcAffineTransform = function() {
      this._transform = this._invTransform = null;
      var e = this.getAxis("x").scale, r = this.getAxis("y").scale;
      if (!(!it(e) || !it(r))) {
        var n = e.getExtent(), a = r.getExtent(), o = this.dataToPoint([n[0], a[0]]), s = this.dataToPoint([n[1], a[1]]), l = n[1] - n[0], u = a[1] - a[0];
        if (!(!l || !u)) {
          var c = (s[0] - o[0]) / l, f = (s[1] - o[1]) / u, h = o[0] - n[0] * c, p = o[1] - a[0] * f, v = this._transform = [c, 0, 0, f, h, p];
          this._invTransform = Ge([], v);
        }
      }
    }, t.prototype.getBaseAxis = function() {
      return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
    }, t.prototype.containPoint = function(e) {
      var r = this.getAxis("x"), n = this.getAxis("y");
      return r.contain(r.toLocalCoord(e[0])) && n.contain(n.toLocalCoord(e[1]));
    }, t.prototype.containData = function(e) {
      return this.getAxis("x").containData(e[0]) && this.getAxis("y").containData(e[1]);
    }, t.prototype.containZone = function(e, r) {
      var n = this.dataToPoint(e), a = this.dataToPoint(r), o = this.getArea(), s = new P(n[0], n[1], a[0] - n[0], a[1] - n[1]);
      return o.intersect(s);
    }, t.prototype.dataToPoint = function(e, r, n) {
      n = n || [];
      var a = e[0], o = e[1];
      if (this._transform && a != null && isFinite(a) && o != null && isFinite(o))
        return k(n, e, this._transform);
      var s = this.getAxis("x"), l = this.getAxis("y");
      return n[0] = s.toGlobalCoord(s.dataToCoord(a, r)), n[1] = l.toGlobalCoord(l.dataToCoord(o, r)), n;
    }, t.prototype.clampData = function(e, r) {
      var n = this.getAxis("x").scale, a = this.getAxis("y").scale, o = n.getExtent(), s = a.getExtent(), l = n.parse(e[0]), u = a.parse(e[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;
    }, t.prototype.pointToData = function(e, r, n) {
      if (n = n || [], this._invTransform)
        return k(n, e, this._invTransform);
      var a = this.getAxis("x"), o = this.getAxis("y");
      return n[0] = a.coordToData(a.toLocalCoord(e[0]), r), n[1] = o.coordToData(o.toLocalCoord(e[1]), r), n;
    }, t.prototype.getOtherAxis = function(e) {
      return this.getAxis(e.dim === "x" ? "y" : "x");
    }, t.prototype.getArea = function(e) {
      e = e || 0;
      var r = this.getAxis("x").getGlobalExtent(), n = this.getAxis("y").getGlobalExtent(), a = Math.min(r[0], r[1]) - e, o = Math.min(n[0], n[1]) - e, s = Math.max(r[0], r[1]) - a + e, l = Math.max(n[0], n[1]) - o + e;
      return new P(a, o, s, l);
    }, t;
  })(wn)
), Tn = (
  /** @class */
  (function(i) {
    A(t, i);
    function t(e, r, n, a, o) {
      var s = i.call(this, e, r, n) || this;
      return s.index = 0, s.type = a || "value", s.position = o || "bottom", s;
    }
    return t.prototype.isHorizontal = function() {
      var e = this.position;
      return e === "top" || e === "bottom";
    }, t.prototype.getGlobalExtent = function(e) {
      var r = this.getExtent();
      return r[0] = this.toGlobalCoord(r[0]), r[1] = this.toGlobalCoord(r[1]), e && r[0] > r[1] && r.reverse(), r;
    }, t.prototype.pointToData = function(e, r) {
      return this.coordToData(this.toLocalCoord(e[this.dim === "x" ? 0 : 1]), r);
    }, t.prototype.setCategorySortInfo = function(e) {
      if (this.type !== "category")
        return !1;
      this.model.option.categorySortInfo = e, this.scale.setSortInfo(e);
    }, t;
  })(hr)
), at = [
  [3, 1],
  [0, 2]
  // xyIdx 1 => 'y'
], Mn = (
  /** @class */
  (function() {
    function i(t, e, r) {
      this.type = "grid", this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this.axisPointerEnabled = !0, this.dimensions = we, this._initCartesian(t, e, r), this.model = t;
    }
    return i.prototype.getRect = function() {
      return this._rect;
    }, i.prototype.update = function(t, e) {
      var r = this._axesMap;
      this._updateScale(t, this.model);
      function n(o) {
        var s, l = Ee(o), u = l.length;
        if (u) {
          for (var c = [], f = u - 1; f >= 0; f--) {
            var h = +l[f], p = o[h], v = p.model, g = p.scale;
            // Only value and log axis without interval support alignTicks.
            ze(g) && v.get("alignTicks") && v.get("interval") == null ? c.push(p) : (Ye(g, v), ze(g) && (s = p));
          }
          c.length && (s || (s = c.pop(), Ye(s.scale, s.model)), y(c, function(d) {
            _r(d.scale, d.model, s.scale);
          }));
        }
      }
      n(r.x), n(r.y);
      var a = {};
      y(r.x, function(o) {
        ot(r, "y", o, a);
      }), y(r.y, function(o) {
        ot(r, "x", o, a);
      }), this.resize(this.model, e);
    }, i.prototype.resize = function(t, e, r) {
      var n = Bt(t, e), a = this._rect = Pe(t.getBoxLayoutParams(), n.refContainer), o = this._axesMap, s = this._coordsList, l = t.get("containLabel");
      if ($t(o, a), !r) {
        var u = Ln(a, s, o, l, e), c = void 0;
        if (l)
          process.env.NODE_ENV !== "production" && vr("Specified `grid.containLabel` but no `use(LegacyGridContainLabel)`;use `grid.outerBounds` instead.", !0), c = ut(a.clone(), "axisLabel", null, a, o, u, n);
        else {
          var f = Pn(t, a, n), h = f.outerBoundsRect, p = f.parsedOuterBoundsContain, v = f.outerBoundsClamp;
          h && (c = ut(h, p, v, a, o, u, n));
        }
        Qt(a, o, De.determine, null, c, n);
      }
      y(this._coordsList, function(g) {
        g.calcAffineTransform();
      });
    }, i.prototype.getAxis = function(t, e) {
      var r = this._axesMap[t];
      if (r != null)
        return r[e || 0];
    }, i.prototype.getAxes = function() {
      return this._axesList.slice();
    }, i.prototype.getCartesian = function(t, e) {
      if (t != null && e != null) {
        var r = "x" + t + "y" + e;
        return this._coordsMap[r];
      }
      gr(t) && (e = t.yAxisIndex, t = t.xAxisIndex);
      for (var n = 0, a = this._coordsList; n < a.length; n++)
        if (a[n].getAxis("x").index === t || a[n].getAxis("y").index === e)
          return a[n];
    }, i.prototype.getCartesians = function() {
      return this._coordsList.slice();
    }, i.prototype.convertToPixel = function(t, e, r) {
      var n = this._findConvertTarget(e);
      return n.cartesian ? n.cartesian.dataToPoint(r) : n.axis ? n.axis.toGlobalCoord(n.axis.dataToCoord(r)) : null;
    }, i.prototype.convertFromPixel = function(t, e, r) {
      var n = this._findConvertTarget(e);
      return n.cartesian ? n.cartesian.pointToData(r) : n.axis ? n.axis.coordToData(n.axis.toLocalCoord(r)) : null;
    }, i.prototype._findConvertTarget = function(t) {
      var e = t.seriesModel, r = t.xAxisModel || e && e.getReferringComponents("xAxis", K).models[0], n = t.yAxisModel || e && e.getReferringComponents("yAxis", K).models[0], a = t.gridModel, o = this._coordsList, s, l;
      if (e)
        s = e.coordinateSystem, ie(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 (a) {
        var u = a.coordinateSystem;
        u === this && (s = this._coordsList[0]);
      }
      return {
        cartesian: s,
        axis: l
      };
    }, i.prototype.containPoint = function(t) {
      var e = this._coordsList[0];
      if (e)
        return e.containPoint(t);
    }, i.prototype._initCartesian = function(t, e, r) {
      var n = this, a = this, o = {
        left: !1,
        right: !1,
        top: !1,
        bottom: !1
      }, s = {
        x: {},
        y: {}
      }, l = {
        x: 0,
        y: 0
      };
      if (e.eachComponent("xAxis", u("x"), this), e.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(h, p) {
          var v = "x" + f + "y" + p, g = new Cn(v);
          g.master = n, g.model = t, n._coordsMap[v] = g, n._coordsList.push(g), g.addAxis(c), g.addAxis(h);
        });
      });
      function u(c) {
        return function(f, h) {
          if (de(f, t)) {
            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 v = new Tn(c, dr(f), [0, 0], f.get("type"), p), g = v.type === "category";
            v.onBand = g && f.get("boundaryGap"), v.inverse = f.get("inverse"), f.axis = v, v.model = f, v.grid = a, v.index = h, a._axesList.push(v), s[c][h] = v, l[c]++;
          }
        };
      }
    }, i.prototype._updateScale = function(t, e) {
      y(this._axesList, function(n) {
        if (n.scale.setExtent(1 / 0, -1 / 0), n.type === "category") {
          var a = n.model.get("categorySortInfo");
          n.scale.setSortInfo(a);
        }
      }), t.eachSeries(function(n) {
        if (yr(n)) {
          var a = ke(n), o = a.xAxisModel, s = a.yAxisModel;
          if (!de(o, e) || !de(s, e))
            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, a) {
        y(mr(n, a.dim), function(o) {
          a.scale.unionExtentFromData(n, o);
        });
      }
    }, i.prototype.getTooltipAxes = function(t) {
      var e = [], r = [];
      return y(this.getCartesians(), function(n) {
        var a = t != null && t !== "auto" ? n.getAxis(t) : n.getBaseAxis(), o = n.getOtherAxis(a);
        ie(e, a) < 0 && e.push(a), ie(r, o) < 0 && r.push(o);
      }), {
        baseAxes: e,
        otherAxes: r
      };
    }, i.create = function(t, e) {
      var r = [];
      return t.eachComponent("grid", function(n, a) {
        var o = new i(n, t, e);
        o.name = "grid_" + a, o.resize(n, e, !0), n.coordinateSystem = o, r.push(o);
      }), t.eachSeries(function(n) {
        Nt({
          targetModel: n,
          coordSysType: "cartesian2d",
          coordSysProvider: a
        });
        function a() {
          var o = ke(n), s = o.xAxisModel, l = o.yAxisModel, u = s.getCoordSysModel();
          if (process.env.NODE_ENV !== "production") {
            if (!u)
              throw new Error('Grid "' + Lr(s.get("gridIndex"), s.get("gridId"), 0) + '" not found');
            if (s.getCoordSysModel() !== l.getCoordSysModel())
              throw new Error("xAxis and yAxis must use the same grid");
          }
          var c = u.coordinateSystem;
          return c.getCartesian(s.componentIndex, l.componentIndex);
        }
      }), r;
    }, i.dimensions = we, i;
  })()
);
function de(i, t) {
  return i.getCoordSysModel() === t;
}
function ot(i, t, e, r) {
  e.getAxesOnZeroOf = function() {
    return a ? [a] : [];
  };
  var n = i[t], a, o = e.model, s = o.get(["axisLine", "onZero"]), l = o.get(["axisLine", "onZeroAxisIndex"]);
  if (!s)
    return;
  if (l != null)
    st(n[l]) && (a = n[l]);
  else
    for (var u in n)
      if (n.hasOwnProperty(u) && st(n[u]) && !r[c(n[u])]) {
        a = n[u];
        break;
      }
  a && (r[c(a)] = !0);
  function c(f) {
    return f.dim + "_" + f.index;
  }
}
function st(i) {
  return i && i.type !== "category" && i.type !== "time" && Tr(i);
}
function Gn(i, t) {
  var e = i.getExtent(), r = e[0] + e[1];
  i.toGlobalCoord = i.dim === "x" ? function(n) {
    return n + t;
  } : function(n) {
    return r - n + t;
  }, i.toLocalCoord = i.dim === "x" ? function(n) {
    return n - t;
  } : function(n) {
    return r - n + t;
  };
}
function $t(i, t) {
  y(i.x, function(e) {
    return lt(e, t.x, t.width);
  }), y(i.y, function(e) {
    return lt(e, t.y, t.height);
  });
}
function lt(i, t, e) {
  var r = [0, e], n = i.inverse ? 1 : 0;
  i.setExtent(r[n], r[1 - n]), Gn(i, t);
}
function ut(i, t, e, r, n, a, o) {
  process.env.NODE_ENV !== "production" && kt(t === "all" || t === "axisLabel"), Qt(r, n, De.estimate, t, !1, o);
  var s = [0, 0, 0, 0];
  u(0), u(1), c(r, 0, NaN), c(r, 1, NaN);
  var l = Ar(s, function(h) {
    return h > 0;
  }) == null;
  return br(r, s, !0, !0, e), $t(n, r), l;
  function u(h) {
    y(n[Y[h]], function(p) {
      if ($(p.model)) {
        var v = a.ensureRecord(p.model), g = v.labelInfoList;
        if (g)
          for (var d = 0; d < g.length; d++) {
            var _ = g[d], S = p.scale.normalize(wr(_.label).tickValue);
            S = h === 1 ? 1 - S : S, c(_.rect, h, S), c(_.rect, 1 - h, NaN);
          }
        var m = v.nameLayout;
        if (m) {
          var S = zt(v.nameLocation) ? 0.5 : NaN;
          c(m.rect, h, S), c(m.rect, 1 - h, NaN);
        }
      }
    });
  }
  function c(h, p, v) {
    var g = i[Y[p]] - h[Y[p]], d = h[oe[p]] + h[Y[p]] - (i[oe[p]] + i[Y[p]]);
    g = f(g, 1 - v), d = f(d, v);
    var _ = at[p][0], S = at[p][1];
    s[_] = Ue(s[_], g), s[S] = Ue(s[S], d);
  }
  function f(h, p) {
    return h > 0 && !Pr(p) && p > 1e-4 && (h /= p), h;
  }
}
function Ln(i, t, e, r, n) {
  var a = new xr(En);
  return y(e, function(o) {
    return y(o, function(s) {
      if ($(s.model)) {
        var l = !r;
        s.axisBuilder = Sr(i, t, s.model, n, a, l);
      }
    });
  }), a;
}
function Qt(i, t, e, r, n, a) {
  var o = e === De.determine;
  y(t, function(u) {
    return y(u, function(c) {
      $(c.model) && (Cr(c.axisBuilder, i, c.model), c.axisBuilder.build(o ? {
        axisTickLabelDetermine: !0
      } : {
        axisTickLabelEstimate: !0
      }, {
        noPxChange: n
      }));
    });
  });
  var s = {
    x: 0,
    y: 0
  };
  l(0), l(1);
  function l(u) {
    s[Y[1 - u]] = i[oe[u]] <= a.refContainer[oe[u]] * 0.5 ? 0 : 1 - u === 1 ? 2 : 1;
  }
  y(t, function(u, c) {
    return y(u, function(f) {
      $(f.model) && ((r === "all" || o) && f.axisBuilder.build({
        axisName: !0
      }, {
        nameMarginLevel: s[c]
      }), o && f.axisBuilder.build({
        axisLine: !0
      }));
    });
  });
}
function Pn(i, t, e) {
  var r, n = i.get("outerBoundsMode", !0);
  n === "same" ? r = t.clone() : n == null || n === "auto" ? r = Pe(i.get("outerBounds", !0) || Kt, e.refContainer) : n !== "none" && process.env.NODE_ENV !== "production" && Xe("Invalid grid[" + i.componentIndex + "].outerBoundsMode.");
  var a = i.get("outerBoundsContain", !0), o;
  a == null || a === "auto" ? o = "all" : ie(["all", "axisLabel"], a) < 0 ? (process.env.NODE_ENV !== "production" && Xe("Invalid grid[" + i.componentIndex + "].outerBoundsContain."), o = "all") : o = a;
  var s = [Ze(se(i.get("outerBoundsClampWidth", !0), le[0]), t.width), Ze(se(i.get("outerBoundsClampHeight", !0), le[1]), t.height)];
  return {
    outerBoundsRect: r,
    parsedOuterBoundsContain: o,
    outerBoundsClamp: s
  };
}
var En = function(i, t, e, r, n, a) {
  var o = e.axis.dim === "x" ? "y" : "x";
  Mr(i, t, e, r, n, a), zt(i.nameLocation) || y(t.recordMap[o], function(s) {
    s && s.labelInfoList && s.dirVec && Gr(s.labelInfoList, s.dirVec, r, n);
  });
}, Ce = fe();
function Dn(i, t, e, r) {
  var n = e.axis;
  if (!n.scale.isBlank()) {
    var a = e.getModel("splitArea"), o = a.getModel("areaStyle"), s = o.get("color"), l = r.coordinateSystem.getRect(), u = n.getTicksCoords({
      tickModel: a,
      clamp: !0,
      breakTicks: "none",
      pruneByBreak: "preserve_extent_bound"
    });
    if (u.length) {
      var c = s.length, f = Ce(i).splitAreaColors, h = x(), p = 0;
      if (f)
        for (var v = 0; v < u.length; v++) {
          var g = f.get(u[v].tickValue);
          if (g != null) {
            p = (g + (c - 1) * v) % c;
            break;
          }
        }
      var d = n.toGlobalCoord(u[0].coord), _ = o.getAreaStyle();
      s = Yt(s) ? s : [s];
      for (var v = 1; v < u.length; v++) {
        var S = n.toGlobalCoord(u[v].coord), m = void 0, b = void 0, C = void 0, T = void 0;
        n.isHorizontal() ? (m = d, b = l.y, C = S - m, T = l.height, d = m + C) : (m = l.x, b = d, C = l.width, T = S - b, d = b + T);
        var E = u[v - 1].tickValue;
        E != null && h.set(E, p), t.add(new Z({
          anid: E != null ? "area_" + E : null,
          shape: {
            x: m,
            y: b,
            width: C,
            height: T
          },
          style: ee({
            fill: s[p]
          }, _),
          autoBatch: !0,
          silent: !0
        })), p = (p + 1) % c;
      }
      Ce(i).splitAreaColors = h;
    }
  }
}
function Rn(i) {
  Ce(i).splitAreaColors = null;
}
var On = ["splitArea", "splitLine", "minorSplitLine", "breakArea"], er = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = t.type, e.axisPointerClass = "CartesianAxisPointer", e;
    }
    return t.prototype.render = function(e, r, n, a) {
      this.group.removeAll();
      var o = this._axisGroup;
      if (this._axisGroup = new G(), this.group.add(this._axisGroup), !!$(e)) {
        this._axisGroup.add(e.axis.axisBuilder.group), y(On, function(l) {
          e.get([l, "show"]) && Fn[l](this, this._axisGroup, e, e.getCoordSysModel(), n);
        }, this);
        var s = a && a.type === "changeAxisOrder" && a.isInitSort;
        s || Er(o, this._axisGroup, e), i.prototype.render.call(this, e, r, n, a);
      }
    }, t.prototype.remove = function() {
      Rn(this);
    }, t.type = "cartesianAxis", t;
  })(Dr)
), Fn = {
  splitLine: function(i, t, e, r, n) {
    var a = e.axis;
    if (!a.scale.isBlank()) {
      var o = e.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = o.get("showMinLine") !== !1, c = o.get("showMaxLine") !== !1;
      l = Yt(l) ? l : [l];
      for (var f = r.coordinateSystem.getRect(), h = a.isHorizontal(), p = 0, v = a.getTicksCoords({
        tickModel: o,
        breakTicks: "none",
        pruneByBreak: "preserve_extent_bound"
      }), g = [], d = [], _ = s.getLineStyle(), S = 0; S < v.length; S++) {
        var m = a.toGlobalCoord(v[S].coord);
        if (!(S === 0 && !u || S === v.length - 1 && !c)) {
          var b = v[S].tickValue;
          h ? (g[0] = m, g[1] = f.y, d[0] = m, d[1] = f.y + f.height) : (g[0] = f.x, g[1] = m, d[0] = f.x + f.width, d[1] = m);
          var C = p++ % l.length, T = new Se({
            anid: b != null ? "line_" + b : null,
            autoBatch: !0,
            shape: {
              x1: g[0],
              y1: g[1],
              x2: d[0],
              y2: d[1]
            },
            style: ee({
              stroke: l[C]
            }, _),
            silent: !0
          });
          He(T.shape, _.lineWidth), t.add(T);
        }
      }
    }
  },
  minorSplitLine: function(i, t, e, r, n) {
    var a = e.axis, o = e.getModel("minorSplitLine"), s = o.getModel("lineStyle"), l = r.coordinateSystem.getRect(), u = a.isHorizontal(), c = a.getMinorTicksCoords();
    if (c.length)
      for (var f = [], h = [], p = s.getLineStyle(), v = 0; v < c.length; v++)
        for (var g = 0; g < c[v].length; g++) {
          var d = a.toGlobalCoord(c[v][g].coord);
          u ? (f[0] = d, f[1] = l.y, h[0] = d, h[1] = l.y + l.height) : (f[0] = l.x, f[1] = d, h[0] = l.x + l.width, h[1] = d);
          var _ = new Se({
            anid: "minor_line_" + c[v][g].tickValue,
            autoBatch: !0,
            shape: {
              x1: f[0],
              y1: f[1],
              x2: h[0],
              y2: h[1]
            },
            style: p,
            silent: !0
          });
          He(_.shape, p.lineWidth), t.add(_);
        }
  },
  splitArea: function(i, t, e, r, n) {
    Dn(i, t, e, r);
  },
  breakArea: function(i, t, e, r, n) {
    e.axis.scale;
  }
}, tr = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.type = "xAxis", t;
  })(er)
), In = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = tr.type, e;
    }
    return t.type = "yAxis", t;
  })(er)
), Vn = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = "grid", e;
    }
    return t.prototype.render = function(e, r) {
      this.group.removeAll(), e.get("show") && this.group.add(new Z({
        shape: e.coordinateSystem.getRect(),
        style: ee({
          fill: e.get("backgroundColor")
        }, e.getItemStyle()),
        silent: !0,
        z2: -1
      }));
    }, t.type = "grid", t;
  })(Ut)
), ct = {
  // gridIndex: 0,
  // gridId: '',
  offset: 0
};
function Mi(i) {
  i.registerComponentView(Vn), i.registerComponentModel(bn), i.registerCoordinateSystem("cartesian2d", Mn), Je(i, "x", be, ct), Je(i, "y", be, ct), i.registerComponentView(tr), i.registerComponentView(In), i.registerPreprocessor(function(t) {
    t.xAxis && t.yAxis && !t.grid && (t.grid = {});
  });
}
var Re = fe();
function Gi(i, t, e) {
  Re(i)[t] = e;
}
function Li(i, t, e) {
  var r = Re(i), n = r[t];
  n === e && (r[t] = null);
}
function ft(i, t) {
  return !!Re(i)[t];
}
Rr({
  type: "takeGlobalCursor",
  event: "globalCursorTaken",
  update: "update"
}, Or);
var Bn = {
  axisPointer: 1,
  tooltip: 1,
  brush: 1
};
function Nn(i, t, e) {
  var r = t.getComponentByElement(i.topTarget);
  if (!r || r === e || Bn.hasOwnProperty(r.mainType))
    return !1;
  var n = r.coordinateSystem;
  if (!n || n.model === e)
    return !1;
  var a = xe(r), o = xe(e);
  return !((a.zlevel - o.zlevel || a.z - o.z) <= 0);
}
var kn = (
  /** @class */
  (function(i) {
    A(t, i);
    function t(e) {
      var r = i.call(this) || this;
      r._zr = e;
      var n = U(r._mousedownHandler, r), a = U(r._mousemoveHandler, r), o = U(r._mouseupHandler, r), s = U(r._mousewheelHandler, r), l = U(r._pinchHandler, r);
      return r.enable = function(u, c) {
        var f = c.zInfo, h = xe(f.component), p = h.z, v = h.zlevel, g = {
          component: f.component,
          z: p,
          zlevel: v,
          // By default roam controller is the lowest z2 comparing to other elememts in a component.
          z2: se(f.z2, -1 / 0)
        }, d = H({}, c.triggerInfo);
        this._opt = ee(H({}, c), {
          zoomOnMouseWheel: !0,
          moveOnMouseMove: !0,
          // By default, wheel do not trigger move.
          moveOnMouseWheel: !1,
          preventDefaultMouseMove: !0,
          zInfoParsed: g,
          triggerInfo: d
        }), u == null && (u = !0), (!this._enabled || this._controlType !== u) && (this._enabled = !0, this.disable(), (u === !0 || u === "move" || u === "pan") && (j(e, "mousedown", n, g), j(e, "mousemove", a, g), j(e, "mouseup", o, g)), (u === !0 || u === "scale" || u === "zoom") && (j(e, "mousewheel", s, g), j(e, "pinch", l, g)));
      }, r.disable = function() {
        this._enabled = !1, W(e, "mousedown", n), W(e, "mousemove", a), W(e, "mouseup", o), W(e, "mousewheel", s), W(e, "pinch", l);
      }, r;
    }
    return t.prototype.isDragging = function() {
      return this._dragging;
    }, t.prototype.isPinching = function() {
      return this._pinching;
    }, t.prototype._checkPointer = function(e, r, n) {
      var a = this._opt, o = a.zInfoParsed;
      if (Nn(e, a.api, o.component))
        return !1;
      var s = a.triggerInfo, l = s.roamTrigger, u = !1;
      return l === "global" && (u = !0), u || (u = s.isInSelf(e, r, n)), u && s.isInClip && !s.isInClip(e, r, n) && (u = !1), u;
    }, t.prototype._decideCursorStyle = function(e, r, n, a) {
      var o = e.target;
      if (!o && this._checkPointer(e, r, n))
        return "grab";
      if (a)
        return o && o.cursor || "default";
    }, t.prototype.dispose = function() {
      this.disable();
    }, t.prototype._mousedownHandler = function(e) {
      if (!(je(e) || J(e))) {
        for (var r = e.target; r; ) {
          if (r.draggable)
            return;
          r = r.__hostTarget || r.parent;
        }
        var n = e.offsetX, a = e.offsetY;
        this._checkPointer(e, n, a) && (this._x = n, this._y = a, this._dragging = !0);
      }
    }, t.prototype._mousemoveHandler = function(e) {
      var r = this._zr;
      if (!(e.gestureEvent === "pinch" || ft(r, "globalPan") || J(e))) {
        var n = e.offsetX, a = e.offsetY;
        if (!this._dragging || !ae("moveOnMouseMove", e, this._opt)) {
          var o = this._decideCursorStyle(e, n, a, !1);
          o && r.setCursorStyle(o);
          return;
        }
        r.setCursorStyle("grabbing");
        var s = this._x, l = this._y, u = n - s, c = a - l;
        this._x = n, this._y = a, this._opt.preventDefaultMouseMove && We(e.event), e.__ecRoamConsumed = !0, pt(this, "pan", "moveOnMouseMove", e, {
          dx: u,
          dy: c,
          oldX: s,
          oldY: l,
          newX: n,
          newY: a,
          isAvailableBehavior: null
        });
      }
    }, t.prototype._mouseupHandler = function(e) {
      if (!J(e)) {
        var r = this._zr;
        if (!je(e)) {
          this._dragging = !1;
          var n = this._decideCursorStyle(e, e.offsetX, e.offsetY, !0);
          n && r.setCursorStyle(n);
        }
      }
    }, t.prototype._mousewheelHandler = function(e) {
      if (!J(e)) {
        var r = ae("zoomOnMouseWheel", e, this._opt), n = ae("moveOnMouseWheel", e, this._opt), a = e.wheelDelta, o = Math.abs(a), s = e.offsetX, l = e.offsetY;
        if (!(a === 0 || !r && !n)) {
          if (r) {
            var u = o > 3 ? 1.4 : o > 1 ? 1.2 : 1.1, c = a > 0 ? u : 1 / u;
            this._checkTriggerMoveZoom(this, "zoom", "zoomOnMouseWheel", e, {
              scale: c,
              originX: s,
              originY: l,
              isAvailableBehavior: null
            });
          }
          if (n) {
            var f = Math.abs(a), h = (a > 0 ? 1 : -1) * (f > 3 ? 0.4 : f > 1 ? 0.15 : 0.05);
            this._checkTriggerMoveZoom(this, "scrollMove", "moveOnMouseWheel", e, {
              scrollDelta: h,
              originX: s,
              originY: l,
              isAvailableBehavior: null
            });
          }
        }
      }
    }, t.prototype._pinchHandler = function(e) {
      if (!(ft(this._zr, "globalPan") || J(e))) {
        var r = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
        this._checkTriggerMoveZoom(this, "zoom", null, e, {
          scale: r,
          originX: e.pinchX,
          originY: e.pinchY,
          isAvailableBehavior: null
        });
      }
    }, t.prototype._checkTriggerMoveZoom = function(e, r, n, a, o) {
      e._checkPointer(a, o.originX, o.originY) && (We(a.event), a.__ecRoamConsumed = !0, pt(e, r, n, a, o));
    }, t;
  })(Fr)
);
function J(i) {
  return i.__ecRoamConsumed;
}
var zn = fe();
function pe(i) {
  var t = zn(i);
  return t.roam = t.roam || {}, t.uniform = t.uniform || {}, t;
}
function j(i, t, e, r) {
  for (var n = pe(i), a = n.roam, o = a[t] = a[t] || [], s = 0; s < o.length; s++) {
    var l = o[s].zInfoParsed;
    if ((l.zlevel - r.zlevel || l.z - r.z || l.z2 - r.z2) <= 0)
      break;
  }
  o.splice(s, 0, {
    listener: e,
    zInfoParsed: r
  }), Yn(i, t);
}
function W(i, t, e) {
  for (var r = pe(i), n = r.roam[t] || [], a = 0; a < n.length; a++)
    if (n[a].listener === e) {
      n.splice(a, 1), n.length || Un(i, t);
      return;
    }
}
function Yn(i, t) {
  var e = pe(i);
  e.uniform[t] || i.on(t, e.uniform[t] = function(r) {
    var n = e.roam[t];
    if (n)
      for (var a = 0; a < n.length; a++)
        n[a].listener(r);
  });
}
function Un(i, t) {
  var e = pe(i), r = e.uniform;
  r[t] && (i.off(t, r[t]), r[t] = null);
}
function pt(i, t, e, r, n) {
  n.isAvailableBehavior = U(ae, null, e, r), i.trigger(t, n);
}
function ae(i, t, e) {
  var r = e[i];
  return !i || r && (!te(r) || t.event[r + "Key"]);
}
function Xn(i, t, e) {
  var r = i.target;
  r.x += t, r.y += e, r.dirty();
}
function Zn(i, t, e, r) {
  var n = i.target, a = i.zoomLimit, o = i.zoom = i.zoom || 1;
  o *= t, o = Oe(o, a);
  var s = o / i.zoom;
  i.zoom = o, rr(n, e, r, s), n.dirty();
}
function ht(i, t) {
  return i.pointToProjected ? i.pointToProjected(t) : i.pointToData(t);
}
function Hn(i, t, e) {
  var r = i.getZoom(), n = i.getCenter(), a = t.zoom, o = i.projectedToPoint ? i.projectedToPoint(n) : i.dataToPoint(n);
  return t.dx != null && t.dy != null && (o[0] -= t.dx, o[1] -= t.dy, i.setCenter(ht(i, o))), a != null && (a = Oe(r * a, e) / r, rr(i, t.originX, t.originY, a), i.updateTransform(), i.setCenter(ht(i, o)), i.setZoom(a * r)), {
    center: i.getCenter(),
    zoom: i.getZoom()
  };
}
function rr(i, t, e, r) {
  i.x -= (t - i.x) * (r - 1), i.y -= (e - i.y) * (r - 1), i.scaleX *= r, i.scaleY *= r;
}
function Oe(i, t) {
  if (t) {
    var e = t.min || 0, r = t.max || 1 / 0;
    i = Math.max(Math.min(r, i), e);
  }
  return i;
}
function nr(i) {
  if (te(i)) {
    var t = new DOMParser();
    i = t.parseFromString(i, "text/xml");
  }
  var e = i;
  for (e.nodeType === 9 && (e = e.firstChild); e.nodeName.toLowerCase() !== "svg" || e.nodeType !== 1; )
    e = e.nextSibling;
  return e;
}
var ye, ue = {
  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"
}, vt = Ee(ue), ce = {
  "alignment-baseline": "textBaseline",
  "stop-color": "stopColor"
}, gt = Ee(ce), Jn = (function() {
  function i() {
    this._defs = {}, this._root = null;
  }
  return i.prototype.parse = function(t, e) {
    e = e || {};
    var r = nr(t);
    if (process.env.NODE_ENV !== "production" && !r)
      throw new Error("Illegal svg");
    this._defsUsePending = [];
    var n = new G();
    this._root = n;
    var a = [], o = r.getAttribute("viewBox") || "", s = parseFloat(r.getAttribute("width") || e.width), l = parseFloat(r.getAttribute("height") || e.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, a, null, !1, !1), u = u.nextSibling;
    qn(this._defs, this._defsUsePending), this._defsUsePending = [];
    var c, f;
    if (o) {
      var h = he(o);
      h.length >= 4 && (c = {
        x: parseFloat(h[0] || 0),
        y: parseFloat(h[1] || 0),
        width: parseFloat(h[2]),
        height: parseFloat(h[3])
      });
    }
    if (c && s != null && l != null && (f = ar(c, { x: 0, y: 0, width: s, height: l }), !e.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 !e.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: a
    };
  }, i.prototype._parseNode = function(t, e, r, n, a, o) {
    var s = t.nodeName.toLowerCase(), l, u = n;
    if (s === "defs" && (a = !0), s === "text" && (o = !0), s === "defs" || s === "switch")
      l = e;
    else {
      if (!a) {
        var c = ye[s];
        if (c && Q(ye, s)) {
          l = c.call(this, t, e);
          var f = t.getAttribute("name");
          if (f) {
            var h = {
              name: f,
              namedFrom: null,
              svgNodeTagLower: s,
              el: l
            };
            r.push(h), s === "g" && (u = h);
          } else n && r.push({
            name: n.name,
            namedFrom: n,
            svgNodeTagLower: s,
            el: l
          });
          e.add(l);
        }
      }
      var p = dt[s];
      if (p && Q(dt, s)) {
        var v = p.call(this, t), g = t.getAttribute("id");
        g && (this._defs[g] = v);
      }
    }
    if (l && l.isGroup)
      for (var d = t.firstChild; d; )
        d.nodeType === 1 ? this._parseNode(d, l, r, u, a, o) : d.nodeType === 3 && o && this._parseText(d, l), d = d.nextSibling;
  }, i.prototype._parseText = function(t, e) {
    var r = new Ir({
      style: {
        text: t.textContent
      },
      silent: !0,
      x: this._textX || 0,
      y: this._textY || 0
    });
    M(e, r), w(t, r, this._defsUsePending, !1, !1), jn(r, e);
    var n = r.style, a = n.fontSize;
    a && a < 9 && (n.fontSize = 9, r.scaleX *= a / 9, r.scaleY *= a / 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, e.add(r), r;
  }, i.internalField = (function() {
    ye = {
      g: function(t, e) {
        var r = new G();
        return M(e, r), w(t, r, this._defsUsePending, !1, !1), r;
      },
      rect: function(t, e) {
        var r = new Z();
        return M(e, r), w(t, r, this._defsUsePending, !1, !1), r.setShape({
          x: parseFloat(t.getAttribute("x") || "0"),
          y: parseFloat(t.getAttribute("y") || "0"),
          width: parseFloat(t.getAttribute("width") || "0"),
          height: parseFloat(t.getAttribute("height") || "0")
        }), r.silent = !0, r;
      },
      circle: function(t, e) {
        var r = new kr();
        return M(e, r), w(t, r, this._defsUsePending, !1, !1), r.setShape({
          cx: parseFloat(t.getAttribute("cx") || "0"),
          cy: parseFloat(t.getAttribute("cy") || "0"),
          r: parseFloat(t.getAttribute("r") || "0")
        }), r.silent = !0, r;
      },
      line: function(t, e) {
        var r = new Se();
        return M(e, r), w(t, r, this._defsUsePending, !1, !1), r.setShape({
          x1: parseFloat(t.getAttribute("x1") || "0"),
          y1: parseFloat(t.getAttribute("y1") || "0"),
          x2: parseFloat(t.getAttribute("x2") || "0"),
          y2: parseFloat(t.getAttribute("y2") || "0")
        }), r.silent = !0, r;
      },
      ellipse: function(t, e) {
        var r = new Nr();
        return M(e, r), w(t, r, this._defsUsePending, !1, !1), r.setShape({
          cx: parseFloat(t.getAttribute("cx") || "0"),
          cy: parseFloat(t.getAttribute("cy") || "0"),
          rx: parseFloat(t.getAttribute("rx") || "0"),
          ry: parseFloat(t.getAttribute("ry") || "0")
        }), r.silent = !0, r;
      },
      polygon: function(t, e) {
        var r = t.getAttribute("points"), n;
        r && (n = _t(r));
        var a = new Zt({
          shape: {
            points: n || []
          },
          silent: !0
        });
        return M(e, a), w(t, a, this._defsUsePending, !1, !1), a;
      },
      polyline: function(t, e) {
        var r = t.getAttribute("points"), n;
        r && (n = _t(r));
        var a = new Xt({
          shape: {
            points: n || []
          },
          silent: !0
        });
        return M(e, a), w(t, a, this._defsUsePending, !1, !1), a;
      },
      image: function(t, e) {
        var r = new Br();
        return M(e, r), w(t, r, this._defsUsePending, !1, !1), r.setStyle({
          image: t.getAttribute("xlink:href") || t.getAttribute("href"),
          x: +t.getAttribute("x"),
          y: +t.getAttribute("y"),
          width: +t.getAttribute("width"),
          height: +t.getAttribute("height")
        }), r.silent = !0, r;
      },
      text: function(t, e) {
        var r = t.getAttribute("x") || "0", n = t.getAttribute("y") || "0", a = t.getAttribute("dx") || "0", o = t.getAttribute("dy") || "0";
        this._textX = parseFloat(r) + parseFloat(a), this._textY = parseFloat(n) + parseFloat(o);
        var s = new G();
        return M(e, s), w(t, s, this._defsUsePending, !1, !0), s;
      },
      tspan: function(t, e) {
        var r = t.getAttribute("x"), n = t.getAttribute("y");
        r != null && (this._textX = parseFloat(r)), n != null && (this._textY = parseFloat(n));
        var a = t.getAttribute("dx") || "0", o = t.getAttribute("dy") || "0", s = new G();
        return M(e, s), w(t, s, this._defsUsePending, !1, !0), this._textX += parseFloat(a), this._textY += parseFloat(o), s;
      },
      path: function(t, e) {
        var r = t.getAttribute("d") || "", n = Vr(r);
        return M(e, n), w(t, n, this._defsUsePending, !1, !1), n.silent = !0, n;
      }
    };
  })(), i;
})(), dt = {
  lineargradient: function(i) {
    var t = parseInt(i.getAttribute("x1") || "0", 10), e = parseInt(i.getAttribute("y1") || "0", 10), r = parseInt(i.getAttribute("x2") || "10", 10), n = parseInt(i.getAttribute("y2") || "0", 10), a = new Yr(t, e, r, n);
    return yt(i, a), mt(i, a), a;
  },
  radialgradient: function(i) {
    var t = parseInt(i.getAttribute("cx") || "0", 10), e = parseInt(i.getAttribute("cy") || "0", 10), r = parseInt(i.getAttribute("r") || "0", 10), n = new zr(t, e, r);
    return yt(i, n), mt(i, n), n;
  }
};
function yt(i, t) {
  var e = i.getAttribute("gradientUnits");
  e === "userSpaceOnUse" && (t.global = !0);
}
function mt(i, t) {
  for (var e = i.firstChild; e; ) {
    if (e.nodeType === 1 && e.nodeName.toLocaleLowerCase() === "stop") {
      var r = e.getAttribute("offset"), n = void 0;
      r && r.indexOf("%") > 0 ? n = parseInt(r, 10) / 100 : r ? n = parseFloat(r) : n = 0;
      var a = {};
      ir(e, a, a);
      var o = a.stopColor || e.getAttribute("stop-color") || "#000000", s = a.stopOpacity || e.getAttribute("stop-opacity");
      if (s) {
        var l = Ur(o), u = l && l[3];
        u && (l[3] *= Xr(s), o = Zr(l, "rgba"));
      }
      t.colorStops.push({
        offset: n,
        color: o
      });
    }
    e = e.nextSibling;
  }
}
function M(i, t) {
  i && i.__inheritedStyle && (t.__inheritedStyle || (t.__inheritedStyle = {}), ee(t.__inheritedStyle, i.__inheritedStyle));
}
function _t(i) {
  for (var t = he(i), e = [], r = 0; r < t.length; r += 2) {
    var n = parseFloat(t[r]), a = parseFloat(t[r + 1]);
    e.push([n, a]);
  }
  return e;
}
function w(i, t, e, r, n) {
  var a = t, o = a.__inheritedStyle = a.__inheritedStyle || {}, s = {};
  i.nodeType === 1 && (Qn(i, t), ir(i, o, s), r || ei(i, o, s)), a.style = a.style || {}, o.fill != null && (a.style.fill = St(a, "fill", o.fill, e)), o.stroke != null && (a.style.stroke = St(a, "stroke", o.stroke, e)), y([
    "lineWidth",
    "opacity",
    "fillOpacity",
    "strokeOpacity",
    "miterLimit",
    "fontSize"
  ], function(l) {
    o[l] != null && (a.style[l] = parseFloat(o[l]));
  }), y([
    "lineDashOffset",
    "lineCap",
    "lineJoin",
    "fontWeight",
    "fontFamily",
    "fontStyle",
    "textAlign"
  ], function(l) {
    o[l] != null && (a.style[l] = o[l]);
  }), n && (a.__selfStyle = s), o.lineDash && (a.style.lineDash = X(he(o.lineDash), function(l) {
    return parseFloat(l);
  })), (o.visibility === "hidden" || o.visibility === "collapse") && (a.invisible = !0), o.display === "none" && (a.ignore = !0);
}
function jn(i, t) {
  var e = t.__selfStyle;
  if (e) {
    var r = e.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"), i.style.textBaseline = n;
  }
  var a = t.__inheritedStyle;
  if (a) {
    var o = a.textAlign, s = o;
    o && (o === "middle" && (s = "center"), i.style.textAlign = s);
  }
}
var Wn = /^url\(\s*#(.*?)\)/;
function St(i, t, e, r) {
  var n = e && e.match(Wn);
  if (n) {
    var a = Hr(n[1]);
    r.push([i, t, a]);
    return;
  }
  return e === "none" && (e = null), e;
}
function qn(i, t) {
  for (var e = 0; e < t.length; e++) {
    var r = t[e];
    r[0].style[r[1]] = i[r[2]];
  }
}
var Kn = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function he(i) {
  return i.match(Kn) || [];
}
var $n = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g, me = Math.PI / 180;
function Qn(i, t) {
  var e = i.getAttribute("transform");
  if (e) {
    e = e.replace(/,/g, " ");
    var r = [], n = null;
    e.replace($n, function(f, h, p) {
      return r.push(h, p), "";
    });
    for (var a = r.length - 1; a > 0; a -= 2) {
      var o = r[a], s = r[a - 1], l = he(o);
      switch (n = n || Ht(), s) {
        case "translate":
          Wr(n, n, [parseFloat(l[0]), parseFloat(l[1] || "0")]);
          break;
        case "scale":
          jr(n, n, [parseFloat(l[0]), parseFloat(l[1] || l[0])]);
          break;
        case "rotate":
          Jr(n, n, -parseFloat(l[0]) * me, [
            parseFloat(l[1] || "0"),
            parseFloat(l[2] || "0")
          ]);
          break;
        case "skewX":
          var u = Math.tan(parseFloat(l[0]) * me);
          _e(n, [1, 0, u, 1, 0, 0], n);
          break;
        case "skewY":
          var c = Math.tan(parseFloat(l[0]) * me);
          _e(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;
      }
    }
    t.setLocalTransform(n);
  }
}
var xt = /([^\s:;]+)\s*:\s*([^:;]+)/g;
function ir(i, t, e) {
  var r = i.getAttribute("style");
  if (r) {
    xt.lastIndex = 0;
    for (var n; (n = xt.exec(r)) != null; ) {
      var a = n[1], o = Q(ue, a) ? ue[a] : null;
      o && (t[o] = n[2]);
      var s = Q(ce, a) ? ce[a] : null;
      s && (e[s] = n[2]);
    }
  }
}
function ei(i, t, e) {
  for (var r = 0; r < vt.length; r++) {
    var n = vt[r], a = i.getAttribute(n);
    a != null && (t[ue[n]] = a);
  }
  for (var r = 0; r < gt.length; r++) {
    var n = gt[r], a = i.getAttribute(n);
    a != null && (e[ce[n]] = a);
  }
}
function ar(i, t) {
  var e = t.width / i.width, r = t.height / i.height, n = Math.min(e, r);
  return {
    scale: n,
    x: -(i.x + i.width / 2) * n + (t.x + t.width / 2),
    y: -(i.y + i.height / 2) * n + (t.y + t.height / 2)
  };
}
function ti(i, t) {
  var e = new Jn();
  return e.parse(i, t);
}
var ri = x([
  "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"
]), ni = (
  /** @class */
  (function() {
    function i(t, e) {
      this.type = "geoSVG", this._usedGraphicMap = x(), this._freedGraphics = [], this._mapName = t, this._parsedXML = nr(e);
    }
    return i.prototype.load = function() {
      var t = this._firstGraphic;
      if (!t) {
        t = this._firstGraphic = this._buildGraphic(this._parsedXML), this._freedGraphics.push(t), this._boundingRect = this._firstGraphic.boundingRect.clone();
        var e = ai(t.named), r = e.regions, n = e.regionsMap;
        this._regions = r, this._regionsMap = n;
      }
      return {
        boundingRect: this._boundingRect,
        regions: this._regions,
        regionsMap: this._regionsMap
      };
    }, i.prototype._buildGraphic = function(t) {
      var e, r;
      try {
        e = t && ti(t, {
          ignoreViewBox: !0,
          ignoreRootClip: !0
        }) || {}, r = e.root, kt(r != null);
      } catch (d) {
        throw new Error(`Invalid svg format
` + d.message);
      }
      var n = new G();
      n.add(r), n.isGeoSVGGraphicRoot = !0;
      var a = e.width, o = e.height, s = e.viewBoxRect, l = this._boundingRect;
      if (!l) {
        var u = void 0, c = void 0, f = void 0, h = void 0;
        if (a != null ? (u = 0, f = a) : s && (u = s.x, f = s.width), o != null ? (c = 0, h = o) : s && (c = s.y, h = s.height), u == null || c == null) {
          var p = r.getBoundingRect();
          u == null && (u = p.x, f = p.width), c == null && (c = p.y, h = p.height);
        }
        l = this._boundingRect = new P(u, c, f, h);
      }
      if (s) {
        var v = ar(s, l);
        r.scaleX = r.scaleY = v.scale, r.x = v.x, r.y = v.y;
      }
      n.setClipPath(new Z({
        shape: l.plain()
      }));
      var g = [];
      return y(e.named, function(d) {
        ri.get(d.svgNodeTagLower) != null && (g.push(d), ii(d.el));
      }), {
        root: n,
        boundingRect: l,
        named: g
      };
    }, i.prototype.useGraphic = function(t) {
      var e = this._usedGraphicMap, r = e.get(t);
      return r || (r = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML), e.set(t, r), r);
    }, i.prototype.freeGraphic = function(t) {
      var e = this._usedGraphicMap, r = e.get(t);
      r && (e.removeKey(t), this._freedGraphics.push(r));
    }, i;
  })()
);
function ii(i) {
  i.silent = !1, i.isGroup && i.traverse(function(t) {
    t.silent = !1;
  });
}
function ai(i) {
  var t = [], e = x();
  return y(i, function(r) {
    if (r.namedFrom == null) {
      var n = new Sn(r.name, r.el);
      t.push(n), e.set(r.name, n);
    }
  }), {
    regions: t,
    regionsMap: e
  };
}
var Te = [126, 25], At = "南海诸岛", B = [[[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 V = 0; V < B.length; V++)
  for (var z = 0; z < B[V].length; z++)
    B[V][z][0] /= 10.5, B[V][z][1] /= -10.5 / 0.75, B[V][z][0] += Te[0], B[V][z][1] += Te[1];
function oi(i, t) {
  if (i === "china") {
    for (var e = 0; e < t.length; e++)
      if (t[e].name === At)
        return;
    t.push(new Wt(At, X(B, function(r) {
      return {
        type: "polygon",
        exterior: r
      };
    }), Te));
  }
}
var si = {
  南海诸岛: [32, 80],
  // 全国
  广东: [0, -10],
  香港: [10, 5],
  澳门: [-10, 10],
  // '北京': [-10, 0],
  天津: [5, 5]
};
function li(i, t) {
  if (i === "china") {
    var e = si[t.name];
    if (e) {
      var r = t.getCenter();
      r[0] += e[0] / 10.5, r[1] += -e[1] / (10.5 / 0.75), t.setCenter(r);
    }
  }
}
var ui = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
function ci(i, t) {
  i === "china" && t.name === "台湾" && t.geometries.push({
    type: "polygon",
    exterior: ui[0]
  });
}
var fi = "name", pi = (
  /** @class */
  (function() {
    function i(t, e, r) {
      this.type = "geoJSON", this._parsedMap = x(), this._mapName = t, this._specialAreas = r, this._geoJSON = vi(e);
    }
    return i.prototype.load = function(t, e) {
      e = e || fi;
      var r = this._parsedMap.get(e);
      if (!r) {
        var n = this._parseToRegions(e);
        r = this._parsedMap.set(e, {
          regions: n,
          boundingRect: hi(n)
        });
      }
      var a = x(), o = [];
      return y(r.regions, function(s) {
        var l = s.name;
        t && Q(t, l) && (s = s.cloneShallow(l = t[l])), o.push(s), a.set(l, s);
      }), {
        regions: o,
        boundingRect: r.boundingRect || new P(0, 0, 0, 0),
        regionsMap: a
      };
    }, i.prototype._parseToRegions = function(t) {
      var e = this._mapName, r = this._geoJSON, n;
      try {
        n = r ? An(r, t) : [];
      } catch (a) {
        throw new Error(`Invalid geoJson format
` + a.message);
      }
      return oi(e, n), y(n, function(a) {
        var o = a.name;
        li(e, a), ci(e, a);
        var s = this._specialAreas && this._specialAreas[o];
        s && a.transformTo(s.left, s.top, s.width, s.height);
      }, this), n;
    }, i.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
      };
    }, i;
  })()
);
function hi(i) {
  for (var t, e = 0; e < i.length; e++) {
    var r = i[e].getBoundingRect();
    t = t || r.clone(), t.union(r);
  }
  return t;
}
function vi(i) {
  return te(i) ? typeof JSON < "u" && JSON.parse ? JSON.parse(i) : new Function("return (" + i + ");")() : i;
}
var q = x();
const O = {
  /**
   * 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(i, t, e) {
    if (t.svg) {
      var r = new ni(i, t.svg);
      q.set(i, r);
    } else {
      var n = t.geoJson || t.geoJSON;
      n && !t.features ? e = t.specialAreas : n = t;
      var r = new pi(i, n, e);
      q.set(i, r);
    }
  },
  getGeoResource: function(i) {
    return q.get(i);
  },
  /**
   * Only for exporting to users.
   * **MUST NOT** used internally.
   */
  getMapForUser: function(i) {
    var t = q.get(i);
    return t && t.type === "geoJSON" && t.getMapForUser();
  },
  load: function(i, t, e) {
    var r = q.get(i);
    if (!r) {
      process.env.NODE_ENV !== "production" && console.error("Map " + i + " not exists. The GeoJSON of the map must be provided.");
      return;
    }
    return r.load(t, e);
  }
};
var Fe = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"], gi = x(Fe), di = x(Fe.concat(["g"])), yi = x(Fe.concat(["g"])), or = fe();
function ne(i) {
  var t = i.getItemStyle(), e = i.get("areaColor");
  return e != null && (t.fill = e), t;
}
function bt(i) {
  var t = i.style;
  t && (t.stroke = t.stroke || t.fill, t.fill = null);
}
var mi = (
  /** @class */
  (function() {
    function i(t) {
      var e = this.group = new G(), r = this._transformGroup = new G();
      e.add(r), this.uid = qr("ec_map_draw"), this._controller = new kn(t.getZr()), this._controllerHost = {
        target: r
      }, r.add(this._regionsGroup = new G()), r.add(this._svgGroup = new G());
    }
    return i.prototype.draw = function(t, e, r, n, a) {
      var o = t.mainType === "geo", s = t.getData && t.getData();
      o && e.eachComponent({
        mainType: "series",
        subType: "map"
      }, function(m) {
        !s && m.getHostGeoModel() === t && (s = m.getData());
      });
      var l = t.coordinateSystem, u = this._regionsGroup, c = this._transformGroup, f = l.getTransformInfo(), h = f.raw, p = f.roam, v = !u.childAt(0) || a, g = t.getShallow("clip", !0), d;
      g ? (d = l.getViewRect().clone(), this.group.setClipPath(new Z({
        shape: d.clone()
      }))) : this.group.removeClipPath(), v ? (c.x = p.x, c.y = p.y, c.scaleX = p.scaleX, c.scaleY = p.scaleY, c.dirty()) : Kr(c, p, t);
      var _ = s && s.getVisual("visualMeta") && s.getVisual("visualMeta").length > 0, S = {
        api: r,
        geo: l,
        mapOrGeoModel: t,
        data: s,
        isVisualEncodedByVisualMap: _,
        isGeo: o,
        transformInfoRaw: h
      };
      l.resourceType === "geoJSON" ? this._buildGeoJSON(S) : l.resourceType === "geoSVG" && this._buildSVG(S), this._updateController(t, d, e, r), this._updateMapSelectHandler(t, u, r, n);
    }, i.prototype._buildGeoJSON = function(t) {
      var e = this._regionsGroupByName = x(), r = x(), n = this._regionsGroup, a = t.transformInfoRaw, o = t.mapOrGeoModel, s = t.data, l = t.geo.projection, u = l && l.stream;
      function c(p, v) {
        return v && (p = v(p)), p && [p[0] * a.scaleX + a.x, p[1] * a.scaleY + a.y];
      }
      function f(p) {
        for (var v = [], g = !u && l && l.project, d = 0; d < p.length; ++d) {
          var _ = c(p[d], g);
          _ && v.push(_);
        }
        return v;
      }
      function h(p) {
        return {
          shape: {
            points: f(p)
          }
        };
      }
      n.removeAll(), y(t.geo.regions, function(p) {
        var v = p.name, g = e.get(v), d = r.get(v) || {}, _ = d.dataIdx, S = d.regionModel;
        if (!g) {
          g = e.set(v, new G()), n.add(g), _ = s ? s.indexOfName(v) : null, S = t.isGeo ? o.getRegionModel(v) : s ? s.getItemModel(_) : null;
          var m = S.get("silent", !0);
          m != null && (g.silent = m), r.set(v, {
            dataIdx: _,
            regionModel: S
          });
        }
        var b = [], C = [];
        y(p.geometries, function(D) {
          if (D.type === "polygon") {
            var F = [D.exterior].concat(D.interiors || []);
            u && (F = Lt(F, u)), y(F, function(I) {
              b.push(new Zt(h(I)));
            });
          } else {
            var L = D.points;
            u && (L = Lt(L, u, !0)), y(L, function(I) {
              C.push(new Xt(h(I)));
            });
          }
        });
        var T = c(p.getCenter(), l && l.project);
        function E(D, F) {
          if (D.length) {
            var L = new $r({
              culling: !0,
              segmentIgnoreThreshold: 1,
              shape: {
                paths: D
              }
            });
            g.add(L), wt(t, L, _, S), Ct(t, L, v, S, o, _, T), F && (bt(L), y(L.states, bt));
          }
        }
        E(b), E(C, !0);
      }), e.each(function(p, v) {
        var g = r.get(v), d = g.dataIdx, _ = g.regionModel;
        Tt(t, p, v, _, o, d), Mt(t, p, v, _, o), Gt(t, p, v, _, o);
      }, this);
    }, i.prototype._buildSVG = function(t) {
      var e = t.geo.map, r = t.transformInfoRaw;
      this._svgGroup.x = r.x, this._svgGroup.y = r.y, this._svgGroup.scaleX = r.scaleX, this._svgGroup.scaleY = r.scaleY, this._svgResourceChanged(e) && (this._freeSVG(), this._useSVG(e));
      var n = this._svgDispatcherMap = x(), a = !1;
      y(this._svgGraphicRecord.named, function(o) {
        var s = o.name, l = t.mapOrGeoModel, u = t.data, c = o.svgNodeTagLower, f = o.el, h = u ? u.indexOfName(s) : null, p = l.getRegionModel(s);
        gi.get(c) != null && f instanceof qe && wt(t, f, h, p), f instanceof qe && (f.culling = !0);
        var v = p.get("silent", !0);
        if (v != null && (f.silent = v), f.z2EmphasisLift = 0, !o.namedFrom && (yi.get(c) != null && Ct(t, f, s, p, l, h, null), Tt(t, f, s, p, l, h), Mt(t, f, s, p, l), di.get(c) != null)) {
          var g = Gt(t, f, s, p, l);
          g === "self" && (a = !0);
          var d = n.get(s) || n.set(s, []);
          d.push(f);
        }
      }, this), this._enableBlurEntireSVG(a, t);
    }, i.prototype._enableBlurEntireSVG = function(t, e) {
      if (t && e.isGeo) {
        var r = e.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle(), n = r.opacity;
        this._svgGraphicRecord.root.traverse(function(a) {
          if (!a.isGroup) {
            Jt(a);
            var o = a.ensureState("blur").style || {};
            o.opacity == null && n != null && (o.opacity = n), a.ensureState("emphasis");
          }
        });
      }
    }, i.prototype.remove = function() {
      this._regionsGroup.removeAll(), this._regionsGroupByName = null, this._svgGroup.removeAll(), this._freeSVG(), this._controller.dispose(), this._controllerHost = null;
    }, i.prototype.findHighDownDispatchers = function(t, e) {
      if (t == null)
        return [];
      var r = e.coordinateSystem;
      if (r.resourceType === "geoJSON") {
        var n = this._regionsGroupByName;
        if (n) {
          var a = n.get(t);
          return a ? [a] : [];
        }
      } else if (r.resourceType === "geoSVG")
        return this._svgDispatcherMap && this._svgDispatcherMap.get(t) || [];
    }, i.prototype._svgResourceChanged = function(t) {
      return this._svgMapName !== t;
    }, i.prototype._useSVG = function(t) {
      var e = O.getGeoResource(t);
      if (e && e.type === "geoSVG") {
        var r = e.useGraphic(this.uid);
        this._svgGroup.add(r.root), this._svgGraphicRecord = r, this._svgMapName = t;
      }
    }, i.prototype._freeSVG = function() {
      var t = this._svgMapName;
      if (t != null) {
        var e = O.getGeoResource(t);
        e && e.type === "geoSVG" && e.freeGraphic(this.uid), this._svgGraphicRecord = null, this._svgDispatcherMap = null, this._svgGroup.removeAll(), this._svgMapName = null;
      }
    }, i.prototype._updateController = function(t, e, r, n) {
      var a = t.coordinateSystem, o = this._controller, s = this._controllerHost;
      s.zoomLimit = t.get("scaleLimit"), s.zoom = a.getZoom(), o.enable(t.get("roam") || !1, {
        api: n,
        zInfo: {
          component: t
        },
        triggerInfo: {
          roamTrigger: t.get("roamTrigger"),
          isInSelf: function(c, f, h) {
            return a.containPoint([f, h]);
          },
          isInClip: function(c, f, h) {
            return !e || e.contain(f, h);
          }
        }
      });
      var l = t.mainType;
      function u() {
        var c = {
          type: "geoRoam",
          componentType: l
        };
        return c[l + "Id"] = t.id, c;
      }
      o.off("pan").on("pan", function(c) {
        this._mouseDownFlag = !1, Xn(s, c.dx, c.dy), n.dispatchAction(H(u(), {
          dx: c.dx,
          dy: c.dy,
          animation: {
            duration: 0
          }
        }));
      }, this), o.off("zoom").on("zoom", function(c) {
        this._mouseDownFlag = !1, Zn(s, c.scale, c.originX, c.originY), n.dispatchAction(H(u(), {
          totalZoom: s.zoom,
          zoom: c.scale,
          originX: c.originX,
          originY: c.originY,
          animation: {
            duration: 0
          }
        }));
      }, this);
    }, i.prototype.resetForLabelLayout = function() {
      this.group.traverse(function(t) {
        var e = t.getTextContent();
        e && (e.ignore = or(e).ignore);
      });
    }, i.prototype._updateMapSelectHandler = function(t, e, r, n) {
      var a = this;
      e.off("mousedown"), e.off("click"), t.get("selectedMode") && (e.on("mousedown", function() {
        a._mouseDownFlag = !0;
      }), e.on("click", function(o) {
        a._mouseDownFlag && (a._mouseDownFlag = !1);
      }));
    }, i;
  })()
);
function wt(i, t, e, r) {
  var n = r.getModel("itemStyle"), a = r.getModel(["emphasis", "itemStyle"]), o = r.getModel(["blur", "itemStyle"]), s = r.getModel(["select", "itemStyle"]), l = ne(n), u = ne(a), c = ne(s), f = ne(o), h = i.data;
  if (h) {
    var p = h.getItemVisual(e, "style"), v = h.getItemVisual(e, "decal");
    i.isVisualEncodedByVisualMap && p.fill && (l.fill = p.fill), v && (l.decal = Qr(v, i.api));
  }
  t.setStyle(l), t.style.strokeNoScale = !0, t.ensureState("emphasis").style = u, t.ensureState("select").style = c, t.ensureState("blur").style = f, Jt(t);
}
function Ct(i, t, e, r, n, a, o) {
  var s = i.data, l = i.isGeo, u = s && isNaN(s.get(s.mapDimension("value"), a)), c = s && s.getItemLayout(a);
  if (l || u || c && c.showLabel) {
    var f = l ? e : a, h = void 0;
    (!s || a >= 0) && (h = n);
    var p = o ? {
      normal: {
        align: "center",
        verticalAlign: "middle"
      }
    } : null;
    en(t, tn(r), {
      labelFetcher: h,
      labelDataIndex: f,
      defaultText: e
    }, p);
    var v = t.getTextContent();
    if (v && (or(v).ignore = v.ignore, t.textConfig && o)) {
      var g = t.getBoundingRect().clone();
      t.textConfig.layoutRect = g, t.textConfig.position = [(o[0] - g.x) / g.width * 100 + "%", (o[1] - g.y) / g.height * 100 + "%"];
    }
    t.disableLabelAnimation = !0;
  } else
    t.removeTextContent(), t.removeTextConfig(), t.disableLabelAnimation = null;
}
function Tt(i, t, e, r, n, a) {
  i.data ? i.data.setItemGraphicEl(a, t) : Ae(t).eventData = {
    componentType: "geo",
    componentIndex: n.componentIndex,
    geoIndex: n.componentIndex,
    name: e,
    region: r && r.option || {}
  };
}
function Mt(i, t, e, r, n) {
  i.data || rn({
    el: t,
    componentModel: n,
    itemName: e,
    // @ts-ignore FIXME:TS fix the "compatible with each other"?
    itemTooltipOption: r.get("tooltip")
  });
}
function Gt(i, t, e, r, n) {
  t.highDownSilentOnTouch = !!n.get("selectedMode");
  var a = r.getModel("emphasis"), o = a.get("focus");
  return nn(t, o, a.get("blurScope"), a.get("disabled")), i.isGeo && an(t, n, e), o;
}
function Lt(i, t, e) {
  var r = [], n;
  function a() {
    n = [];
  }
  function o() {
    n.length && (r.push(n), n = []);
  }
  var s = t({
    polygonStart: a,
    polygonEnd: o,
    lineStart: a,
    lineEnd: o,
    point: function(l, u) {
      isFinite(l) && isFinite(u) && n.push([l, u]);
    },
    sphere: function() {
    }
  });
  return !e && s.polygonStart(), y(i, function(l) {
    s.lineStart();
    for (var u = 0; u < l.length; u++)
      s.point(l[u][0], l[u][1]);
    s.lineEnd();
  }), !e && s.polygonEnd(), r;
}
var Pt = k, sr = (
  /** @class */
  (function(i) {
    A(t, i);
    function t(e, r) {
      var n = i.call(this) || this;
      return n.type = "view", n.dimensions = ["x", "y"], n._roamTransformable = new re(), n._rawTransformable = new re(), n.name = e, n._opt = r, n;
    }
    return t.prototype.setBoundingRect = function(e, r, n, a) {
      return this._rect = new P(e, r, n, a), this._updateCenterAndZoom(), this._rect;
    }, t.prototype.getBoundingRect = function() {
      return this._rect;
    }, t.prototype.setViewRect = function(e, r, n, a) {
      this._transformTo(e, r, n, a), this._viewRect = new P(e, r, n, a);
    }, t.prototype._transformTo = function(e, r, n, a) {
      var o = this.getBoundingRect(), s = this._rawTransformable;
      s.transform = o.calculateTransform(new P(e, r, n, a));
      var l = s.parent;
      s.parent = null, s.decomposeTransform(), s.parent = l, this._updateTransform();
    }, t.prototype.setCenter = function(e) {
      var r = this._opt;
      r && r.api && r.ecModel && r.ecModel.getShallow("legacyViewCoordSysCenterBase") && e && (e = [N(e[0], r.api.getWidth()), N(e[1], r.api.getWidth())]), this._centerOption = on(e), this._updateCenterAndZoom();
    }, t.prototype.setZoom = function(e) {
      this._zoom = Oe(e || 1, this.zoomLimit), this._updateCenterAndZoom();
    }, t.prototype.getDefaultCenter = function() {
      var e = this.getBoundingRect(), r = e.x + e.width / 2, n = e.y + e.height / 2;
      return [r, n];
    }, t.prototype.getCenter = function() {
      return this._center || this.getDefaultCenter();
    }, t.prototype.getZoom = function() {
      return this._zoom || 1;
    }, t.prototype.getRoamTransform = function() {
      return this._roamTransformable.getLocalTransform();
    }, t.prototype._updateCenterAndZoom = function() {
      var e = this._centerOption, r = this._rect;
      e && r && (this._center = [N(e[0], r.width, r.x), N(e[1], r.height, r.y)]);
      var n = this._rawTransformable.getLocalTransform(), a = this._roamTransformable, o = this.getDefaultCenter(), s = this.getCenter(), l = this.getZoom();
      s = k([], s, n), o = k([], o, n), a.originX = s[0], a.originY = s[1], a.x = o[0] - s[0], a.y = o[1] - s[1], a.scaleX = a.scaleY = l, this._updateTransform();
    }, t.prototype._updateTransform = function() {
      var e = this._roamTransformable, r = this._rawTransformable;
      r.parent = e, e.updateTransform(), r.updateTransform(), sn(this.transform || (this.transform = []), r.transform || Ht()), this._rawTransform = r.getLocalTransform(), this.invTransform = this.invTransform || [], Ge(this.invTransform, this.transform), this.decomposeTransform();
    }, t.prototype.getTransformInfo = function() {
      var e = this._rawTransformable, r = this._roamTransformable, n = new re();
      return n.transform = r.transform, n.decomposeTransform(), {
        roam: {
          x: n.x,
          y: n.y,
          scaleX: n.scaleX,
          scaleY: n.scaleY
        },
        raw: {
          x: e.x,
          y: e.y,
          scaleX: e.scaleX,
          scaleY: e.scaleY
        }
      };
    }, t.prototype.getViewRect = function() {
      return this._viewRect;
    }, t.prototype.getViewRectAfterRoam = function() {
      var e = this.getBoundingRect().clone();
      return e.applyTransform(this.transform), e;
    }, t.prototype.dataToPoint = function(e, r, n) {
      var a = r ? this._rawTransform : this.transform;
      return n = n || [], a ? Pt(n, e, a) : ln(n, e);
    }, t.prototype.pointToData = function(e, r, n) {
      n = n || [];
      var a = this.invTransform;
      return a ? Pt(n, e, a) : (n[0] = e[0], n[1] = e[1], n);
    }, t.prototype.convertToPixel = function(e, r, n) {
      var a = Et(r);
      return a === this ? a.dataToPoint(n) : null;
    }, t.prototype.convertFromPixel = function(e, r, n) {
      var a = Et(r);
      return a === this ? a.pointToData(n) : null;
    }, t.prototype.containPoint = function(e) {
      return this.getViewRectAfterRoam().contain(e[0], e[1]);
    }, t.dimensions = ["x", "y"], t;
  })(re)
);
function Et(i) {
  var t = i.seriesModel;
  return t ? t.coordinateSystem : null;
}
var _i = {
  geoJSON: {
    aspectScale: 0.75,
    invertLongitute: !0
  },
  geoSVG: {
    aspectScale: 1,
    invertLongitute: !1
  }
}, lr = ["lng", "lat"], Me = (
  /** @class */
  (function(i) {
    A(t, i);
    function t(e, r, n) {
      var a = i.call(this, e, {
        api: n.api,
        ecModel: n.ecModel
      }) || this;
      a.dimensions = lr, a.type = "geo", a._nameCoordMap = x(), a.map = r;
      var o = n.projection, s = O.load(r, n.nameMap, n.nameProperty), l = O.getGeoResource(r), u = a.resourceType = l ? l.type : null, c = a.regions = s.regions, f = _i[l.type];
      a._regionsMap = s.regionsMap, a.regions = s.regions, process.env.NODE_ENV !== "production" && o && (u === "geoSVG" && (process.env.NODE_ENV !== "production" && Ke("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" && Ke("project and unproject must be both provided in the projeciton."), o = null)), a.projection = o;
      var h;
      if (o)
        for (var p = 0; p < c.length; p++) {
          var v = c[p].getBoundingRect(o);
          h = h || v.clone(), h.union(v);
        }
      else
        h = s.boundingRect;
      return a.setBoundingRect(h.x, h.y, h.width, h.height), a.aspectScale = o ? 1 : se(n.aspectScale, f.aspectScale), a._invertLongitute = o ? !1 : f.invertLongitute, a;
    }
    return t.prototype._transformTo = function(e, r, n, a) {
      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(e, r, n, a));
      var u = l.parent;
      l.parent = null, l.decomposeTransform(), l.parent = u, s && (l.scaleY = -l.scaleY), this._updateTransform();
    }, t.prototype.getRegion = function(e) {
      return this._regionsMap.get(e);
    }, t.prototype.getRegionByCoord = function(e) {
      for (var r = this.regions, n = 0; n < r.length; n++) {
        var a = r[n];
        if (a.type === "geoJSON" && a.contain(e))
          return r[n];
      }
    }, t.prototype.addGeoCoord = function(e, r) {
      this._nameCoordMap.set(e, r);
    }, t.prototype.getGeoCoord = function(e) {
      var r = this._regionsMap.get(e);
      return this._nameCoordMap.get(e) || r && r.getCenter();
    }, t.prototype.dataToPoint = function(e, r, n) {
      if (te(e) && (e = this.getGeoCoord(e)), e) {
        var a = this.projection;
        return a && (e = a.project(e)), e && this.projectedToPoint(e, r, n);
      }
    }, t.prototype.pointToData = function(e, r, n) {
      var a = this.projection;
      return a && (e = a.unproject(e)), e && this.pointToProjected(e, n);
    }, t.prototype.pointToProjected = function(e, r) {
      return i.prototype.pointToData.call(this, e, 0, r);
    }, t.prototype.projectedToPoint = function(e, r, n) {
      return i.prototype.dataToPoint.call(this, e, r, n);
    }, t.prototype.convertToPixel = function(e, r, n) {
      var a = Dt(r);
      return a === this ? a.dataToPoint(n) : null;
    }, t.prototype.convertFromPixel = function(e, r, n) {
      var a = Dt(r);
      return a === this ? a.pointToData(n) : null;
    }, t;
  })(sr)
);
Vt(Me, sr);
function Dt(i) {
  var t = i.geoModel, e = i.seriesModel;
  return t ? t.coordinateSystem : e ? e.coordinateSystem || (e.getReferringComponents("geo", K).models[0] || {}).coordinateSystem : null;
}
function Rt(i, t) {
  var e = i.get("boundingCoords");
  if (e != null) {
    var r = e[0], n = e[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 a = this.projection;
      if (a) {
        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(C, T, E, D) {
          for (var F = E - C, L = D - T, I = 0; I <= 100; I++) {
            var Ie = I / 100, Ve = a.project([C + F * Ie, T + L * Ie]);
            Ot(r, r, Ve), Ft(n, n, Ve);
          }
        };
        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(), h = i.get("layoutCenter"), p = i.get("layoutSize"), v = Bt(i, t).refContainer, g = f.width / f.height * this.aspectScale, d = !1, _, S;
  h && p && (_ = [N(h[0], v.width) + v.x, N(h[1], v.height) + v.y], S = N(p, Math.min(v.width, v.height)), !isNaN(_[0]) && !isNaN(_[1]) && !isNaN(S) ? d = !0 : process.env.NODE_ENV !== "production" && console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."));
  var m;
  if (d)
    m = {}, g > 1 ? (m.width = S, m.height = S / g) : (m.height = S, m.width = S * g), m.y = _[1] - m.height / 2, m.x = _[0] - m.width / 2;
  else {
    var b = i.getBoxLayoutParams();
    b.aspect = g, m = Pe(b, v), m = pn(i, m, g);
  }
  this.setViewRect(m.x, m.y, m.width, m.height), this.setCenter(i.get("center")), this.setZoom(i.get("zoom"));
}
function Si(i, t) {
  y(t.get("geoCoord"), function(e, r) {
    i.addGeoCoord(r, e);
  });
}
var xi = (
  /** @class */
  (function() {
    function i() {
      this.dimensions = lr;
    }
    return i.prototype.create = function(t, e) {
      var r = [];
      function n(o) {
        return {
          nameProperty: o.get("nameProperty"),
          aspectScale: o.get("aspectScale"),
          projection: o.get("projection")
        };
      }
      t.eachComponent("geo", function(o, s) {
        var l = o.get("map"), u = new Me(l + s, l, H({
          nameMap: o.get("nameMap"),
          api: e,
          ecModel: t
        }, n(o)));
        u.zoomLimit = o.get("scaleLimit"), r.push(u), o.coordinateSystem = u, u.model = o, u.resize = Rt, u.resize(o, e);
      }), t.eachSeries(function(o) {
        Nt({
          targetModel: o,
          coordSysType: "geo",
          coordSysProvider: function() {
            var s = o.subType === "map" ? o.getHostGeoModel() : o.getReferringComponents("geo", K).models[0];
            return s && s.coordinateSystem;
          },
          allowNotFound: !0
        });
      });
      var a = {};
      return t.eachSeriesByType("map", function(o) {
        if (!o.getHostGeoModel()) {
          var s = o.getMapType();
          a[s] = a[s] || [], a[s].push(o);
        }
      }), y(a, function(o, s) {
        var l = X(o, function(c) {
          return c.get("nameMap");
        }), u = new Me(s, s, H({
          nameMap: un(l),
          api: e,
          ecModel: t
        }, n(o[0])));
        u.zoomLimit = cn.apply(null, X(o, function(c) {
          return c.get("scaleLimit");
        })), r.push(u), u.resize = Rt, u.resize(o[0], e), y(o, function(c) {
          c.coordinateSystem = u, Si(u, c);
        });
      }), r;
    }, i.prototype.getFilledRegions = function(t, e, r, n) {
      for (var a = (t || []).slice(), o = x(), s = 0; s < a.length; s++)
        o.set(a[s].name, a[s]);
      var l = O.load(e, r, n);
      return y(l.regions, function(u) {
        var c = u.name, f = o.get(c), h = u.properties && u.properties.echartsStyle;
        f || (f = {
          name: c
        }, a.push(f)), h && fn(f, h);
      }), a;
    }, i;
  })()
), ur = new xi(), Ai = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = t.type, e;
    }
    return t.prototype.init = function(e, r, n) {
      this.mergeDefaultAndTheme(e, n);
      var a = O.getGeoResource(e.map);
      if (a && a.type === "geoJSON") {
        var o = e.itemStyle = e.itemStyle || {};
        "color" in o || (o.color = e.defaultItemStyleColor || R.color.backgroundTint);
      }
      hn(e, "label", ["show"]);
    }, t.prototype.optionUpdated = function() {
      var e = this, r = this.option;
      r.regions = ur.getFilledRegions(r.regions, r.map, r.nameMap, r.nameProperty);
      var n = {};
      this._optionModelMap = vn(r.regions || [], function(a, o) {
        var s = o.name;
        return s && (a.set(s, new $e(o, e, e.ecModel)), o.selected && (n[s] = !0)), a;
      }, x()), r.selectedMap || (r.selectedMap = n);
    }, t.prototype.getRegionModel = function(e) {
      return this._optionModelMap.get(e) || new $e(null, this, this.ecModel);
    }, t.prototype.getFormattedLabel = function(e, r) {
      var n = this.getRegionModel(e), a = r === "normal" ? n.get(["label", "formatter"]) : n.get(["emphasis", "label", "formatter"]), o = {
        name: e
      };
      if (gn(a))
        return o.status = r, a(o);
      if (te(a))
        return a.replace("{a}", e ?? "");
    }, t.prototype.setZoom = function(e) {
      this.option.zoom = e;
    }, t.prototype.setCenter = function(e) {
      this.option.center = e;
    }, t.prototype.select = function(e) {
      var r = this.option, n = r.selectedMode;
      if (n) {
        n !== "multiple" && (r.selectedMap = null);
        var a = r.selectedMap || (r.selectedMap = {});
        a[e] = !0;
      }
    }, t.prototype.unSelect = function(e) {
      var r = this.option.selectedMap;
      r && (r[e] = !1);
    }, t.prototype.toggleSelected = function(e) {
      this[this.isSelected(e) ? "unSelect" : "select"](e);
    }, t.prototype.isSelected = function(e) {
      var r = this.option.selectedMap;
      return !!(r && r[e]);
    }, t.type = "geo", t.layoutMode = "box", t.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: R.color.tertiary
      },
      itemStyle: {
        borderWidth: 0.5,
        borderColor: R.color.border
      },
      emphasis: {
        label: {
          show: !0,
          color: R.color.primary
        },
        itemStyle: {
          color: R.color.highlight
        }
      },
      select: {
        label: {
          show: !0,
          color: R.color.primary
        },
        itemStyle: {
          color: R.color.highlight
        }
      },
      regions: []
      // tooltip: {
      //     show: false
      // }
    }, t;
  })(Le)
), bi = (
  /** @class */
  (function(i) {
    A(t, i);
    function t() {
      var e = i !== null && i.apply(this, arguments) || this;
      return e.type = t.type, e.focusBlurEnabled = !0, e;
    }
    return t.prototype.init = function(e, r) {
      this._api = r;
    }, t.prototype.render = function(e, r, n, a) {
      if (this._model = e, !e.get("show")) {
        this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
        return;
      }
      this._mapDraw || (this._mapDraw = new mi(n));
      var o = this._mapDraw;
      o.draw(e, r, n, this, a), o.group.on("click", this._handleRegionClick, this), o.group.silent = e.get("silent"), this.group.add(o.group), this.updateSelectStatus(e, r, n);
    }, t.prototype._handleRegionClick = function(e) {
      var r;
      dn(e.target, function(n) {
        return (r = Ae(n).eventData) != null;
      }, !0), r && this._api.dispatchAction({
        type: "geoToggleSelect",
        geoId: this._model.id,
        name: r.name
      });
    }, t.prototype.updateSelectStatus = function(e, r, n) {
      var a = this;
      this._mapDraw.group.traverse(function(o) {
        var s = Ae(o).eventData;
        if (s)
          return a._model.isSelected(s.name) ? n.enterSelect(o) : n.leaveSelect(o), !0;
      });
    }, t.prototype.findHighDownDispatchers = function(e) {
      return this._mapDraw && this._mapDraw.findHighDownDispatchers(e, this._model);
    }, t.prototype.dispose = function() {
      this._mapDraw && this._mapDraw.remove();
    }, t.type = "geo", t;
  })(Ut)
);
function wi(i, t, e) {
  O.registerMap(i, t, e);
}
function Pi(i) {
  i.registerCoordinateSystem("geo", ur), i.registerComponentModel(Ai), i.registerComponentView(bi), i.registerImpl("registerMap", wi), i.registerImpl("getMap", function(e) {
    return O.getMapForUser(e);
  });
  function t(e, r) {
    r.update = "geo:updateSelectStatus", i.registerAction(r, function(n, a) {
      var o = {}, s = [];
      return a.eachComponent({
        mainType: "geo",
        query: n
      }, function(l) {
        l[e](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, h) {
          o[h] && c.push(h);
        }), s.push({
          geoIndex: l.componentIndex,
          // Use singular, the same naming convention as the event `selectchanged`.
          name: c
        });
      }), {
        selected: o,
        allSelected: s,
        name: n.name
      };
    });
  }
  t("toggleSelected", {
    type: "geoToggleSelect",
    event: "geoselectchanged"
  }), t("select", {
    type: "geoSelect",
    event: "geoselected"
  }), t("unSelect", {
    type: "geoUnSelect",
    event: "geounselected"
  }), i.registerAction({
    type: "geoRoam",
    event: "geoRoam",
    update: "updateTransform"
  }, function(e, r, n) {
    var a = e.componentType;
    a || (e.geoId != null ? a = "geo" : e.seriesId != null && (a = "series")), a || (a = "series"), r.eachComponent({
      mainType: a,
      query: e
    }, function(o) {
      var s = o.coordinateSystem;
      if (s.type === "geo") {
        var l = Hn(s, e, o.get("scaleLimit"));
        o.setCenter && o.setCenter(l.center), o.setZoom && o.setZoom(l.zoom), a === "series" && y(o.seriesGroup, function(u) {
          u.setCenter(l.center), u.setZoom(l.zoom);
        });
      }
    });
  });
}
export {
  mi as M,
  kn as R,
  Mi as a,
  Pi as b,
  O as g,
  Ti as i,
  Nn as o,
  Li as r,
  Gi as t
};
