UNPKG

tg-map-vue3

Version:

封装 百度地图, Google地图, Here地图(未完成) 的Vue3组件库

1,417 lines (1,414 loc) 224 kB
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw;cursor:auto;-webkit-user-select:auto!important;user-select:auto!important}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);background-color:#000}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0;top:0;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.gm-style-iw-c .gm-style-iw-chr{display:block}.gm-style-iw-c .gm-style-iw-chr .gm-style-iw-ch{padding-top:12px}.gm-style-iw-c .gm-style-iw-chr button.gm-ui-hover-effect{position:absolute!important;right:-6px;top:-6px;width:14px!important;height:14px!important;margin:8px!important}.gm-style-iw-c .gm-style-iw-chr button.gm-ui-hover-effect span{width:14px!important;height:14px!important;margin:0!important}.gm-style-iw-c .gm-style-iw-d::-webkit-scrollbar{width:12px;height:12px}.element-overlay{position:absolute}.baidu-marker-label{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(>div>img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); var Kr = Object.defineProperty; var Xr = (i, t, e) => t in i ? Kr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e; var g = (i, t, e) => Xr(i, typeof t != "symbol" ? t + "" : t, e); import { noop as z, assert as ve, throwError as I, lateinit as L, Arrays as Or, throwUnsupported as Pt, assertNever as _t, typed as qe, path as Jr, deepEqual as Qr } from "tg-commons"; import { createCommentVNode as bt, computed as Tr, defineComponent as P, markRaw as ei, watch as Ae, createElementBlock as de, openBlock as ue, mergeProps as Ze, createElementVNode as ti, renderSlot as J, normalizeClass as nt, normalizeStyle as ri, getCurrentInstance as ii, inject as si, onBeforeUnmount as ni, onMounted as oi, toRaw as ot, withDirectives as ai, vShow as li } from "vue"; function se(i, t, e) { Object.keys(i).forEach((r) => { r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]); }); } let hi = 1; function ci() { return hi++; } function Ye(i, t) { return t.__id__ || (t.__id__ = ci()), `${i}::${t.__id__}`; } function at(i) { return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i; } var Ve = { exports: {} }, di = Ve.exports, hr; function ui() { return hr || (hr = 1, function(i) { (function(t, e) { i.exports ? i.exports = e() : t.coordtransform = e(); })(di, function() { var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943; function n(l, h, f, v) { this.west = Math.min(l, f), this.north = Math.max(h, v), this.east = Math.max(l, f), this.south = Math.min(h, v); } n.prototype.contain = function(l, h) { return this.west <= l && this.east >= l && this.north >= h && this.south <= h; }; var a = [ new n(79.4462, 49.2204, 96.33, 42.8899), new n(109.6872, 54.1415, 135.0002, 39.3742), new n(73.1246, 42.8899, 124.143255, 29.5297), new n(82.9684, 29.5297, 97.0352, 26.7186), new n(97.0253, 29.5297, 124.367395, 20.414096), new n(107.975793, 20.414096, 111.744104, 17.871542) ], d = [ new n(119.921265, 25.398623, 122.497559, 21.785006), new n(101.8652, 22.284, 106.665, 20.0988), new n(106.4525, 21.5422, 108.051, 20.4878), new n(109.0323, 55.8175, 119.127, 50.3257), new n(127.4568, 55.8175, 137.0227, 49.5574), new n(131.2662, 44.8922, 137.0227, 42.5692), new n(73.1246, 35.398637, 77.948114, 29.5297) ], o = [ new n(114.505238, 22.138258, 113.845, 22.428903), new n(113.97, 22.507833, 114.45, 22.428903) ]; function c(l, h, f = !0) { for (var v = 0; v < a.length; v++) if (a[v].contain(l, h)) { for (var T = 0; T < d.length; T++) if (d[T].contain(l, h)) return !1; if (f) { for (var T = 0; T < o.length; T++) if (o[T].contain(l, h)) return !1; } return !0; } return !1; } function u(l, h) { var f = l - 65e-4, v = h - 6e-3, T = Math.sqrt(f * f + v * v) - 2e-5 * Math.sin(v * t), w = Math.atan2(v, f) - 3e-6 * Math.cos(f * t), E = T * Math.cos(w), S = T * Math.sin(w); return [E, S]; } function m(l, h) { var f = Math.sqrt(l * l + h * h) + 2e-5 * Math.sin(h * t), v = Math.atan2(h, l) + 3e-6 * Math.cos(l * t), T = f * Math.cos(v) + 65e-4, w = f * Math.sin(v) + 6e-3; return [T, w]; } function p(l, h) { return M(l, h); } function y(l, h) { var f = M(l, h); return [l * 2 - f[0], h * 2 - f[1]]; } function M(l, h) { var f = _(l - 105, h - 35), v = O(l - 105, h - 35), T = h / 180 * e, w = Math.sin(T); w = 1 - s * w * w; var E = Math.sqrt(w); f = f * 180 / (r * (1 - s) / (w * E) * e), v = v * 180 / (r / E * Math.cos(T) * e); var S = h + f, G = l + v; return [G, S]; } function _(l, h) { var f = -100 + 2 * l + 3 * h + 0.2 * h * h + 0.1 * l * h + 0.2 * Math.sqrt(Math.abs(l)); return f += (20 * Math.sin(6 * l * e) + 20 * Math.sin(2 * l * e)) * 2 / 3, f += (20 * Math.sin(h * e) + 40 * Math.sin(h / 3 * e)) * 2 / 3, f += (160 * Math.sin(h / 12 * e) + 320 * Math.sin(h * e / 30)) * 2 / 3, f; } function O(l, h) { var f = 300 + l + 2 * h + 0.1 * l * l + 0.1 * l * h + 0.1 * Math.sqrt(Math.abs(l)); return f += (20 * Math.sin(6 * l * e) + 20 * Math.sin(2 * l * e)) * 2 / 3, f += (20 * Math.sin(l * e) + 40 * Math.sin(l / 3 * e)) * 2 / 3, f += (150 * Math.sin(l / 12 * e) + 300 * Math.sin(l / 30 * e)) * 2 / 3, f; } return { // 原始的转换方法 rawBd09ToGcj02: u, rawGcj02ToBd09: m, rawWgs84ToGcj02: p, rawGcj02ToWgs84: y, // 判断了中国范围的转换方法 bd09ToGcj02: u, gcj02ToBd09: m, wgs84ToGcj02: function(l, h) { return c(l, h) ? p(l, h) : [l, h]; }, gcj02ToWgs84: function(l, h) { return c(l, h) ? y(l, h) : [l, h]; }, bd09ToWgs84: function(l, h) { if (!c(l, h, !1)) return [l, h]; var f = u(l, h); return y(f[0], f[1]); }, wgs84ToBd09: function(l, h) { if (!c(l, h, !1)) return [l, h]; var f = p(l, h); return m(f[0], f[1]); } }; }); }(Ve)), Ve.exports; } var pi = ui(); const me = /* @__PURE__ */ at(pi); function Ws(i, t) { return i instanceof t; } function Hs(i, t) { if (i instanceof t) return i; } function Mt(i, t) { return (i == null ? void 0 : i.$options.name) === t.name; } function Cr(i, t) { return Mt(i, t) ? i : void 0; } function Bt(i, t, e) { let r = t; for (; r; ) { if (Mt(r, i)) return r; if (e && Mt(r, e)) return; r = r.$parent; } } function js(i) { return i; } var D = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(D || {}); const gt = "wgs84", $ = class $ { constructor(t, e, r) { this.lat = t, this.lng = e, this.coord = r, z(); } /** * {@template latlng_normalize} * * 对经纬度进行标准化, 参考google的实现 * * ## 行为不一致 * - google: google.maps.LatLng的构造器会对经纬度进行标准化, 所有点都能正常显示 * - baidu: BMap.Point的构造器不会对经纬度进行标准化, 超出范围的点显示到(0, 0)位置 * * {@endtemplate} */ /* private */ static _normalize(t, e) { const r = e > 90 ? 90 : e < -90 ? -90 : e; return [t > 180 ? (t + 180) % 360 - 180 : t < -180 ? (t - 180) % 360 + 180 : t, r]; } /** @param coord Baidu Map的坐标一般都是bd09 */ static fromBaidu(t, e) { return new $(t.lat, t.lng, e); } /** @param coord Google Map的坐标依据地图类型不同是不一样的 */ static fromGoogle(t, e) { return new $(t.lat(), t.lng(), e); } static fromHere(t, e) { return new $(t.lat, t.lng, e); } static fromLiteral(t) { return new $(t.lat, t.lng, t.coord || gt); } static fromLngLat(t, e, r = gt) { return new $(e, t, r); } static create(t, e, r = gt) { return new $(t, e, r); } /** 转换坐标到指定坐标系 */ to(t) { const e = t; if (this.coord === e) return this; const [r, s] = this._convert(e); return new $(s, r, e); } /** * TODO: normalize要不要默认设为true, 和google的行为保持一致? * 转换成baidu的经纬度 * @param normalize 转换时是否进行标准化, 默认false * @see _normalize {@macro latlng_normalize} */ toBaidu(t, e = !1) { let r = this.lat, s = this.lng; return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] = $._normalize(s, r)), new BMap.Point(s, r); } /** * 转换成google的经纬度, 内部会自动进行标准化 * @see _normalize {@macro latlng_normalize} */ toGoogle(t) { let e = this.lat, r = this.lng; return this.coord !== t && ([r, e] = this._convert(t)), new google.maps.LatLng(e, r); } toHere(t) { let e = this.lat, r = this.lng; return this.coord !== t && ([r, e] = this._convert(t)), new H.geo.Point(e, r); } /** * 该方法之所以设计的这么不友好, 是为了防止不必要的开销(大概有点影响😅) * * 私有方法, 外部需要转换坐标系, 请使用{@link to}/toBaidu/Google/Here, 之所以不添加private关键字, 是因为设成私有后, 有的地方会报类型错误... * * @returns `[lng, lat]` 注意不要取错顺序 * @throws 若当前coord和targetCoord相同, 会抛异常, 故请在外部判断 */ /* private */ _convert(t) { switch (this.coord) { case "bd09": return t === "gcj02" ? me.bd09ToGcj02(this.lng, this.lat) : me.bd09ToWgs84(this.lng, this.lat); case "gcj02": return t === "wgs84" ? me.gcj02ToWgs84(this.lng, this.lat) : me.gcj02ToBd09(this.lng, this.lat); case "wgs84": return t === "bd09" ? me.wgs84ToBd09(this.lng, this.lat) : me.wgs84ToGcj02(this.lng, this.lat); } throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`); } /** * 标准化, 返回合法的坐标点 * @see _normalize {@macro latlng_normalize} */ normalize() { const [t, e] = $._normalize(this.lng, this.lat); return e === this.lat && t === this.lng ? this : new $(e, t, this.coord); } equals(t) { return this === t ? !0 : this.lat === t.lat && this.lng === t.lng && this.coord === t.coord; } toString() { return JSON.stringify(this); } }; g($, "ZERO", $.create(0, 0)); let C = $; const ae = class ae { /** * 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建 * @param sw 西南, lat/lng更小 * @param ne 东北, lat/lng更大 */ constructor(t, e) { g(this, "coord"); this.sw = t, this.ne = e, ve(t.coord === e.coord, "sw和ne的coord应该相同"), ve(Number.isFinite(t.lat) && Number.isFinite(t.lng) && Number.isFinite(e.lat) && Number.isFinite(e.lng), `sw(${t})和ne(${e})不能包含NaN或Infinite`), ve(t.lat <= e.lat, `sw.lat(${t.lat})应该比ne.lat(${e.lat})小`), this.coord = t.coord; } static isBetweenLng(t, e, r) { return t <= e ? t <= r && r <= e : t <= r || r <= e; } static fromArray(t) { if (t.length === 0) return; const e = new ae.Builder(t[0]); for (let r = 1; r < t.length; r++) e.include(t[r]); return e.build(); } static from(...t) { return this.fromArray(t) ?? I("positions中没有点"); } static fromGoogle(t, e) { return new ae( C.fromGoogle(t.getSouthWest(), e), C.fromGoogle(t.getNorthEast(), e) ); } static fromBaidu(t, e) { return new ae( C.fromBaidu(t.getSouthWest(), e), C.fromBaidu(t.getNorthEast(), e) ); } static create(t, e) { return this.from(t, e); } isEmpty() { return this.sw.equals(this.ne); } contains(t) { const { lat: e, lng: r } = t.to(this.coord); return this.sw.lat <= e && e <= this.ne.lat && ae.isBetweenLng(this.sw.lng, this.ne.lng, r); } getCenter() { if (this.sw.equals(this.ne)) return this.sw; const t = (this.sw.lat + this.ne.lat) / 2, e = (this.sw.lng + this.ne.lng + (this.sw.lng < this.ne.lng ? 0 : 360)) / 2; return C.create(t, e, this.coord); } toString() { return JSON.stringify(this); } equals(t) { return this.sw.equals(t.sw) && this.ne.equals(t.ne); } /** * 矩形的四个点数组 * 顺时针: sw(西南) -> nw(西北) -> ne(东北) -> se(东南) * */ toRectArray() { const t = this.sw.coord; return [ this.sw, C.fromLngLat(this.sw.lng, this.ne.lat, t), this.ne, C.fromLngLat(this.ne.lng, this.sw.lat, t) ]; } toGoogle(t) { return new google.maps.LatLngBounds(this.sw.toGoogle(t), this.ne.toGoogle(t)); } toBaidu(t) { return new BMap.Bounds(this.sw.toBaidu(t), this.ne.toBaidu(t)); } toBaiduArray(t) { return [this.sw.toBaidu(t), this.ne.toBaidu(t)]; } }; g(ae, "EMPTY", new ae(C.ZERO, C.ZERO)); let Q = ae; ((i) => { class t { constructor(r) { g(this, "coord"); g(this, "minLat"); g(this, "minLng"); g(this, "maxLat"); g(this, "maxLng"); this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng; } build() { return new i( // sw对应min C.create(this.minLat, this.minLng, this.coord), // ne对应max C.create(this.maxLat, this.maxLng, this.coord) ); } include(r) { const { lat: s, lng: n } = r.to(this.coord); return this.minLat = Math.min(this.minLat, s), this.maxLat = Math.max(this.maxLat, s), i.isBetweenLng(this.minLng, this.maxLng, n) || (this.delta(this.minLng, n) < this.delta(n, this.maxLng) ? this.minLng = n : this.maxLng = n), this; } delta(r, s) { return (r - s + 360) % 360; } } i.Builder = t; })(Q || (Q = {})); var ie; ((i) => { function t(r, s) { if (r == null) return; if (typeof r == "string") return r; const n = r.to(s); return `${n.lat},${n.lng}`; } i.toString = t; function e(r) { return typeof r == "string" || r == null ? void 0 : r.coord; } i.getCoordType = e; })(ie || (ie = {})); function wr() { BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay); } function gi() { const i = window.$BAIDU$; "kT" in i || Object.defineProperty(i, "kT", { get: () => i._instances, enumerable: !0, configurable: !0 }); } const cr = { /** {@link BMap.Point.equals} 无效, 故需要自己写一个 */ equals(i, t) { return i.lat === t.lat && i.lng === t.lng; } }; var Ot; ((i) => { function t(e) { return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight; } i.isScrollable = t; })(Ot || (Ot = {})); var Ke; ((i) => { function t(s, n) { for (const a of s) if (a instanceof n) return a; } i.findByType = t; function e(s, n) { return s.includes(n); } i.includesTyped = e; function r(s, n, a) { const d = n >= 0 ? n : s.length + n; if (a === void 0) return s[d]; s[d] = a; } i.at = r; })(Ke || (Ke = {})); var ye; ((i) => { function t(s, n) { const a = s.getLength(); for (let d = 0; d < a; d++) if (s.getAt(d) === n) return d; return -1; } i.indexOf = t; function e(s, n) { const a = t(s, n); if (a !== -1) return s.removeAt(a); } i.remove = e; function r(s, n) { return [ s.addListener("insert_at", n), s.addListener("remove_at", n), s.addListener("set_at", n) ]; } i.listenChanged = r; })(ye || (ye = {})); function xr(i, t, e) { return i.addListener(t, e).remove; } function mi(i, t, e) { return i.addEventListener(t, e), () => i.removeEventListener(t, e); } function fi(i, t, e, r) { return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r); } function dr(i, t, e) { return i.addEventListener(t, e), () => i.removeEventListener(t, e); } class Er { constructor(t, e) { g(this, "eventMap", /* @__PURE__ */ new Map()); g(this, "target", L()); this.inner = t, this.coordTypeSupplier = e, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this); } setTarget(t) { return this.target = t, this; } } class lt { constructor(t, e) { g(this, "eventHub", new Lr()); this.delegate = t, this.options = e; } notify(t) { this.eventHub.notify(t); } hasListener(t) { return this.eventHub.hasListener(t); } setTarget(t) { return this.delegate.setTarget(t), this; } addEventListener(t, e) { if (Ke.includesTyped(this.options.types, t)) { this.eventHub.hasListener(t) || this.options.onListen(t), this.eventHub.addEventListener(t, e); return; } this.delegate.addEventListener(t, e); } removeEventListener(t, e) { if (Ke.includesTyped(this.options.types, t)) { this.eventHub.removeEventListener(t, e), this.eventHub.hasListener(t) || this.options.onCancel(t); return; } this.delegate.removeEventListener(t, e); } } const st = class st extends Er { addEventListener(t, e) { const r = Ye(t, e); if (this.eventMap.get(r)) { console.warn("listener已经添加过了", r, e); return; } const s = this.inner.addListener(st.EVENT_TYPE_MAP[t] || t, (n) => { const a = { type: t, target: this.target, originalEvent: n }; n != null && n.latLng && (a.position = C.fromGoogle(n.latLng, this.coordTypeSupplier.coordType)), e.call(this.target, a); }); this.eventMap.set(r, s); } removeEventListener(t, e) { const r = Ye(t, e), s = this.eventMap.get(r); s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e); } }; // 事件类型映射: tg => google g(st, "EVENT_TYPE_MAP", { "center-changed": "center_changed", "zoom-changed": "zoom_changed", "radius-changed": "radius_changed", "bounds-changed": "bounds_changed", "map-type-changed": "maptypeid_changed", // google地图的overlay会拦截地图的事件, 导致在map上设置的监听缺少一部分事件, baidu地图没有这个问题 // 规避方式一: // 在map监听事件的同时, 在overlay上使用`map-*`监听相同的事件..., 具体使用方式参考主项目中的`SearchInRectTool2` // 规避方式二: (推荐) // 给overlay设置`clickable="false"`, 不让它接收事件 "map-mousedown": "mousedown", "map-mousemove": "mousemove", "map-mouseup": "mouseup", "map-dblclick": "dblclick" }); let _e = st; const Ie = class Ie extends Er { addEventListener(t, e) { const r = Ye(t, e); if (this.eventMap.get(r)) { console.warn("listener已经添加过了", r, e); return; } const s = (n) => { const a = { type: t, target: this.target, originalEvent: n }; n.point && (a.position = C.fromBaidu(n.point, this.coordTypeSupplier.coordType)), e.call(this.target, a); }; this.inner.addEventListener(Ie.EVENT_TYPE_MAP[t] || t, s), this.eventMap.set(r, s); } removeEventListener(t, e) { const r = Ye(t, e), s = this.eventMap.get(r); s ? (this.inner.removeEventListener(Ie.EVENT_TYPE_MAP[t] || t, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e); } }; // cSpell:words clickclose // 事件类型映射, tg => baidu g(Ie, "EVENT_TYPE_MAP", { drag: "dragging", closeclick: "clickclose", // baidu不支持contextmenu事件, 将其映射为rightclick contextmenu: "rightclick", "zoom-changed": "zoomend", "map-type-changed": "maptypechange" }); let Re = Ie; class Lr { constructor() { g(this, "typeMap", /* @__PURE__ */ new Map()); } addEventListener(t, e) { let r = this.typeMap.get(t); r || (r = [], this.typeMap.set(t, r)), !r.includes(e) && r.push(e); } removeEventListener(t, e) { const r = this.typeMap.get(t); r && Or.remove(r, e); } hasListener(t) { const e = this.typeMap.get(t); return e != null && e.length > 0; } notify(t) { const e = this.typeMap.get(t.type); e && e.forEach((r) => r.call(t.target, t)); } } class ur { /** * `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高 */ constructor(t, e) { g(this, "keyToValue", /* @__PURE__ */ new Map()); g(this, "valueToKey", /* @__PURE__ */ new Map()); ve(t.length === e.length); for (let r = t.length - 1; r >= 0; r--) this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]); } toKey(t) { return this.valueToKey.get(t) ?? I(); } toValue(t) { return this.keyToValue.get(t) ?? I(); } } class vi { constructor(t, e = 10) { g(this, "map", /* @__PURE__ */ new Map()); this.values = t, this.maxSize4Debug = e, z(); } /** 获取保存key-value映射的Map */ getValueMap(t) { let e = this.map.get(t); if (!e) { e = /* @__PURE__ */ new Map(); for (let r = this.values.length - 1; r >= 0; r--) { const s = this.values[r]; e.set(t.call(s), s); } this.map.set(t, e), process.env.NODE_ENV !== "production" && this.map.size > this.maxSize4Debug && console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`); } return e; } /** * 直接用key获取value * @param keySelector 从T中读取key的方法, 会用它当key, 缓存结果, 故多次调用需要使用相同的keySelector对象, 不要每次创建新的, 推荐直接使用T.prototype.getXxx作为keySelector */ getOrNull(t, e) { return this.getValueMap(t).get(e); } get(t, e) { return this.getOrNull(t, e) ?? I(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`); } } class Le { constructor(t) { g(this, "value"); this.creator = t, z(); } get() { return this.value === void 0 && (this.value = this.creator()), this.value; } } var R = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(R || {}), Y; ((i) => { let t, e; const r = [ "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right", "left-top", "left-center", "left-bottom", "right-top", "right-center", "right-bottom" /* RIGHT_BOTTOM */ ]; function s() { return t || (t = new ur(r, [ /* | @tg/map |名字相同| baidu | */ /* TOP_LEFT = */ BMAP_ANCHOR_TOP_LEFT, /* TOP_CENTER */ BMAP_ANCHOR_TOP_LEFT, /* TOP_RIGHT = */ BMAP_ANCHOR_TOP_RIGHT, /* BOTTOM_LEFT = */ BMAP_ANCHOR_BOTTOM_LEFT, /* BOTTOM_CENTER */ BMAP_ANCHOR_BOTTOM_LEFT, /* BOTTOM_RIGHT = */ BMAP_ANCHOR_BOTTOM_RIGHT, /* LEFT_TOP */ BMAP_ANCHOR_TOP_LEFT, /* LEFT_CENTER */ BMAP_ANCHOR_BOTTOM_LEFT, /* LEFT_BOTTOM */ BMAP_ANCHOR_BOTTOM_LEFT, /* RIGHT_TOP */ BMAP_ANCHOR_TOP_RIGHT, /* RIGHT_CENTER */ BMAP_ANCHOR_BOTTOM_RIGHT, /* RIGHT_BOTTOM */ BMAP_ANCHOR_BOTTOM_RIGHT ])), t; } i.getBaidu = s; function n() { return e || (e = new ur(r, [ google.maps.ControlPosition.TOP_LEFT, google.maps.ControlPosition.TOP_CENTER, google.maps.ControlPosition.TOP_RIGHT, google.maps.ControlPosition.BOTTOM_LEFT, google.maps.ControlPosition.BOTTOM_CENTER, google.maps.ControlPosition.BOTTOM_RIGHT, google.maps.ControlPosition.LEFT_TOP, google.maps.ControlPosition.LEFT_CENTER, google.maps.ControlPosition.LEFT_BOTTOM, google.maps.ControlPosition.RIGHT_TOP, google.maps.ControlPosition.RIGHT_CENTER, google.maps.ControlPosition.RIGHT_BOTTOM ])), e; } i.getGoogle = n; })(Y || (Y = {})); class yi { constructor(t) { /** 实际添加到地图中的control对象 */ g(this, "inner"); this.position = t, z(); } } class It { } class _i extends It { constructor(t, e) { super(), this.visible = t, this.position = e; } isVisible() { return this.visible; } setVisible(t) { this.visible = t; } getPosition() { return this.position; } setPosition(t) { this.position = t; } addTo(t) { } removeFrom(t) { } } class kt extends It { constructor(t, e) { super(), this.inner = t, this.position = e; } isVisible() { return this.inner.isVisible(); } setVisible(t) { t ? this.inner.show() : this.inner.hide(); } getPosition() { return this.position ?? Y.getBaidu().toKey(this.inner.getAnchor()); } setPosition(t) { this.position = t, this.inner.setAnchor(Y.getBaidu().toValue(t)); } addTo(t) { t.innerMap.addControl(this.inner); } removeFrom(t) { t.innerMap.removeControl(this.inner); } } class ht extends It { constructor(e, r) { super(); g(this, "visible", !1); g(this, "map"); this._type = e, this.position = r; } isVisible() { return this.visible; } setVisible(e) { this.visible = e, this.tryUpdateOptions(); } getPosition() { return this.position; } setPosition(e) { this.position = e, this.tryUpdateOptions(); } addTo(e) { this.map || (this.map = e, this.setVisible(!0)); } removeFrom() { this.map && (this.setVisible(!1), this.map = void 0); } onCreateOptions() { return { position: Y.getGoogle().toValue(this.position) }; } tryUpdateOptions() { this.map && this.map.innerMap.setOptions({ [`${this._type}Control`]: this.visible, [`${this._type}ControlOptions`]: this.onCreateOptions() }); } } var Pr = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(Pr || {}); class V { constructor(t, e, r, s) { this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s, z(); } getId() { return this.id; } getBaiduCoordType() { return D.bd09; } asBaiduMapType() { return this.baidu(); } getGoogleCoordType() { return this.googleCoordType; } /** 内置地图的id和google的id是不一样的 */ getGoogleMapTypeId() { return this.google(); } asGoogleMapType() { Pt("google的内置地图没有对应的实例"); } } class Vs { constructor(t, e) { g(this, "baiduLayerCached", new Le(() => { const t = new BMap.TileLayer({}); return t.getTilesUrl = (e, r) => { const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y; return this.options.getTileUrl({ x: n, y: a }, r); }, t; })); g(this, "baiduMapTypeCached", new Le(() => { const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), { maxZoom: this.options.maxZoom, minZoom: this.options.minZoom, tips: this.options.describe }); return t.__baidu_map_type__ = this, t; })); g(this, "googleCached", new Le(() => { const t = new google.maps.ImageMapType({ getTileUrl: (e, r) => this.options.getTileUrl(e, r), tileSize: new google.maps.Size(256, 256), name: this.options.name, alt: this.options.describe, maxZoom: this.options.maxZoom, minZoom: this.options.minZoom }); return t.__google_map_type__ = this, t; })); this.coordType = t, this.options = e, z(); } get id() { return this.options.id; } getBaiduCoordType() { return this.coordType; } asBaiduMapType() { return this.baiduMapTypeCached.get(); } asBaiduLayer() { return this.baiduLayerCached.get(); } getGoogleCoordType() { return this.coordType; } asGoogleMapType() { return this.googleCached.get(); } asGoogleLayer() { Pt("这个方法不会被调用"); } } class bi { constructor() { g(this, "baiduCache", new Le(() => new BMap.TrafficLayer())); g(this, "googleCache", new Le(() => new google.maps.TrafficLayer())); } asBaiduLayer() { return this.baiduCache.get(); } asGoogleLayer() { return this.googleCache.get(); } } var F; ((i) => { i.NORMAL = new V("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, D.gcj02), i.SATELLITE = new V("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, D.wgs84), i.HYBRID = new V("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, D.gcj02), i.TERRAIN = new V("terrain", () => ( /* 三维 */ BMAP_PERSPECTIVE_MAP ), () => ( /* 地形 */ google.maps.MapTypeId.TERRAIN ), D.wgs84), i.BUILD_IN_MAP_TYPES = new vi([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]); })(F || (F = {})); var Br = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Br || {}); const Ir = [F.NORMAL, F.SATELLITE, F.HYBRID]; class St extends kt { static create(t) { const e = t.mapTypes ?? Ir, r = { default: BMAP_MAPTYPE_CONTROL_HORIZONTAL, horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL, dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN }, s = new BMap.MapTypeControl({ type: t.type && r[t.type], mapTypes: e.map((n) => n.asBaiduMapType()) }); return t.position && s.setAnchor(Y.getBaidu().toValue(t.position)), new St(s, t.position); } } const ge = class ge extends ht { constructor(t = "default", e = R.TOP_LEFT, r = Ir) { super("mapType", e), this.type = t, this.mapTypes = r, ge.type2google || (ge.type2google = { default: google.maps.MapTypeControlStyle.DEFAULT, horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, dropdown: google.maps.MapTypeControlStyle.DROPDOWN_MENU }); } static create(t) { return new ge(t.type, t.position, t.mapTypes); } onCreateOptions() { const t = super.onCreateOptions(); return t.style = ge.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof V ? e.getGoogleMapTypeId() : e.id), t; } addTo(t) { super.addTo(t), this.mapTypes.forEach((e) => { e instanceof V || t.innerMap.mapTypes.set(e.id, e.asGoogleMapType()); }); } }; g(ge, "type2google"); let Tt = ge; class At extends kt { static create(t) { const e = new BMap.ScaleControl({ anchor: t.position && Y.getBaidu().toValue(t.position) }); return new At(e, t.position); } } class Rt extends ht { static create(t) { return new Rt(t.position); } constructor(t = R.BOTTOM_RIGHT) { super("scale", t); } } class Dt extends _i { static create(t) { return new Dt(!0, t.position ?? R.RIGHT_BOTTOM); } } class $t extends ht { static create(t) { return new $t(t.position); } constructor(t = R.RIGHT_BOTTOM) { super("streetView", t); } } class zt extends kt { static create(t) { const e = new BMap.NavigationControl({ type: BMAP_NAVIGATION_CONTROL_ZOOM, // enableGeolocation: true, anchor: t.position && Y.getBaidu().toValue(t.position) }); return new zt(e, t.position); } } class Nt extends ht { static create(t) { return new Nt(t.position); } constructor(t = R.RIGHT_BOTTOM) { super("zoom", t); } } let Mi, Oi; const he = { /** Google的坐标0点 */ get LATLNG_ZERO() { return Mi ?? (Mi = new google.maps.LatLng({ lat: 0, lng: 0 })); }, get BOUNDS_ZERO() { return Oi ?? (Oi = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO)); } }; function kr(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) { for (const e of i) for (const r of e.types) switch (r) { case "street_number": t.streetNumber = e.long_name; break; case "route": t.street = e.long_name; break; case "locality": t.city = e.long_name; break; case "sublocality": t.district = e.long_name; break; case "administrative_area_level_1": t.province = e.long_name; break; case "country": t.country = e.long_name; break; } return t; } function Sr(i, t) { var r; const e = i.address_components && kr(i.address_components); return { country: (e == null ? void 0 : e.country) ?? "", province: (e == null ? void 0 : e.province) ?? "", city: (e == null ? void 0 : e.city) ?? "", id: i.place_id ?? "", address: i.formatted_address ?? "", position: C.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? he.LATLNG_ZERO, t.coordType), title: i.name ?? "" }; } class Ar { } class Ti extends Ar { constructor(e, r) { super(); g(this, "inner"); this.map = e, this.inner = new google.maps.places.Autocomplete(r.input, { fields: [ "address_components", // 'formatted_address', "name" ] }), r.bindToMap && this.inner.bindTo("bounds", e.innerMap); } setBounds(e) { this.inner.setBounds(e.toGoogle(this.map.coordType)); } addResultListener(e) { return xr(this.inner, "place_changed", () => { const r = this.inner.getPlace(), s = { title: r.name ?? "", province: "", city: "", district: "", street: "", streetNumber: "", country: "" }; r.address_components && kr(r.address_components, s), e(s); }); } } class Ci extends Ar { constructor(e, r) { super(); g(this, "inner"); g(this, "input"); // TODO: 要不要添加个移除监听的方法? g(this, "removeableArray", []); if (this.map = e, this.input = r.input, this.inner = new BMap.Autocomplete({ input: r.input, location: r.bindToMap ? e.innerMap : void 0 }), r.bindToMap) { const s = () => { this.inner.setLocation(this.map.innerMap); }; this.removeableArray.push(dr(this.map, "center-changed", s)), this.removeableArray.push(dr(this.map, "zoom-changed", s)); } } setBounds(e) { this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType)); } addResultListener(e) { let r = 0; const s = mi(this.inner, "confirm", (a) => { const d = a.item.value; r = Date.now(), e(Object.assign({ title: d.business, country: "" // Baidu的自动完成只支持中国 }, d)); }), n = fi(this.input, "keyup", (a) => { a.key === "Enter" && Date.now() - r > 100 && e({ title: this.input.value, country: "", city: "", district: "", province: "", street: "", streetNumber: "" }); }); return () => { n(), s(); }; } } var Fe = { exports: {} }, wi = Fe.exports, pr; function xi() { return pr || (pr = 1, function(i, t) { (function(e, r) { i.exports = r(); })(wi, function() { const e = function() { var n = { defaultRadius: 40, defaultRenderer: "canvas2d", defaultGradient: { 0.45: "rgb(0,0,255)", 0.55: "rgb(0,255,255)", 0.65: "rgb(0,255,0)", 0.95: "yellow", 1: "rgb(255,0,0)" }, defaultMaxOpacity: 1, defaultMinOpacity: 0, defaultBlur: 0.85, defaultXField: "x", defaultYField: "y", defaultValueField: "value", plugins: {} }, a = function() { var y = function(O) { this._coordinator = {}, this._data = [], this._radi = [], this._min = 0, this._max = 1, this._xField = O.xField || O.defaultXField, this._yField = O.yField || O.defaultYField, this._valueField = O.valueField || O.defaultValueField, O.radius && (this._cfgRadius = O.radius); }, M = n.defaultRadius; return y.prototype = { // when forceRender = false -> called from setData, omits renderall event _organiseData: function(_, O) { var l = _[this._xField], h = _[this._yField], f = this._radi, v = this._data, T = this._max, w = this._min, E = _[this._valueField] || 1, S = _.radius || this._cfgRadius || M; return v[l] || (v[l] = [], f[l] = []), v[l][h] ? v[l][h] += E : (v[l][h] = E, f[l][h] = S), v[l][h] > T ? (O ? this.setDataMax(v[l][h]) : this._max = v[l][h], !1) : { x: l, y: h, value: E, radius: S, min: w, max: T }; }, _unOrganizeData: function() { var _ = [], O = this._data, l = this._radi; for (var h in O) for (var f in O[h]) _.push({ x: h, y: f, radius: l[h][f], value: O[h][f] }); return { min: this._min, max: this._max, data: _ }; }, _onExtremaChange: function() { this._coordinator.emit("extremachange", { min: this._min, max: this._max }); }, addData: function() { if (arguments[0].length > 0) for (var _ = arguments[0], O = _.length; O--; ) this.addData.call(this, _[O]); else { var l = this._organiseData(arguments[0], !0); l && this._coordinator.emit("renderpartial", { min: this._min, max: this._max, data: [l] }); } return this; }, setData: function(_) { var O = _.data, l = O.length; this._data = [], this._radi = []; for (var h = 0; h < l; h++) this._organiseData(O[h], !1); return this._max = _.max, this._min = _.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this; }, removeData: function() { }, setDataMax: function(_) { return this._max = _, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this; }, setDataMin: function(_) { return this._min = _, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this; }, setCoordinator: function(_) { this._coordinator = _; }, _getInternalData: function() { return { max: this._max, min: this._min, data: this._data, radi: this._radi }; }, getData: function() { return this._unOrganizeData(); } /*, // TODO: rethink. getValueAt: function (point) { var value; var radius = 100; var x = point.x; var y = point.y; var data = this._data; if (data[x] && data[x][y]) { return data[x][y]; } else { var values = []; // radial search for datapoints based on default radius for (var distance = 1; distance < radius; distance++) { var neighbors = distance * 2 + 1; var startX = x - distance; var startY = y - distance; for (var i = 0; i < neighbors; i++) { for (var o = 0; o < neighbors; o++) { if ((i == 0 || i == neighbors - 1) || (o == 0 || o == neighbors - 1)) { if (data[startY + i] && data[startY + i][startX + o]) { values.push(data[startY + i][startX + o]); } } else { continue; } } } } if (values.length > 0) { return Math.max.apply(Math, values); } } return false; }*/ }, y; }(), d = function() { var y = function(l) { var h = l.gradient || l.defaultGradient, f = document.createElement("canvas"), v = f.getContext("2d"); f.width = 256, f.height = 1; var T = v.createLinearGradient(0, 0, 256, 1); for (var w in h) T.addColorStop(w, h[w]); return v.fillStyle = T, v.fillRect(0, 0, 256, 1), v.getImageData(0, 0, 256, 1).data; }, M = function(l, h) { var f = document.createElement("canvas"), v = f.getContext("2d"), T = l, w = l; if (f.width = f.height = l * 2, h == 1) v.beginPath(), v.arc(T, w, l, 0, 2 * Math.PI, !1), v.fillStyle = "rgba(0,0,0,1)", v.fill(); else { var E = v.createRadialGradient(T, w, l * h, T, w, l); E.addColorStop(0, "rgba(0,0,0,1)"), E.addColorStop(1, "rgba(0,0,0,0)"), v.fillStyle = E, v.fillRect(0, 0, 2 * l, 2 * l); } return f; }, _ = function(w) { for (var h = [], f = w.min, v = w.max, T = w.radi, w = w.data, E = Object.keys(w), S = E.length; S--; ) for (var G = E[S], B = Object.keys(w[G]), ee = B.length; ee--; ) { var k = B[ee], W = w[G][k], te = T[G][k]; h.push({ x: G, y: k, value: W, radius: te }); } return { min: f, max: v, data: h }; }; function O(l) { var h = l.element, f = this.shadowCanvas = document.createElement("canvas"), v = this.canvas = l.canvas || document.createElement("canvas"); this._renderBoundaries = [1e4, 1e4, 0, 0]; var T = getComputedStyle(l.element) || {}; v.className = "heatmap-canvas", this._width = v.width = f.width = +T.width.replace(/px/, ""), this._height = v.height = f.height = +T.height.replace(/px/, ""), this.shadowCtx = f.getContext("2d"), this.ctx = v.getContext("2d"), v.style.cssText = f.style.cssText = "position:absolute;left:0;top:0;", h.style.position = "relative", h.appendChild(v), this._palette = y(l), this._templates = {}, this._setStyles(l); } return O.prototype = { renderPartial: function(l) { this._drawAlpha(l), this._colorize(); }, renderAll: function(l) { this._clear(), this._drawAlpha(_(l)), this._colorize(); }, _updateGradient: function(l) { this._palette = y(l); }, updateConfig: function(l, h) { l.gradient !== h.gradient && this._updateGradient(l), this._setStyles(l); }, setDimensions: function(l, h) { this._width = l, this._height = h, this.canvas.width = this.shadowCanvas.width = l, this.canvas.height = this.shadowCanvas.height = h; }, _clear: function() { this.shadowCtx.clearRect(0, 0, this._width, this._height), this.ctx.clearRect(0, 0, this._width, this._height); }, _setStyles: function(l) { this._blur = l.blur == 0 ? 0 : l.blur || l.defaultBlur, l.backgroundColor && (this.canvas.style.backgroundColor = l.backgroundColor), this._opacity = (l.opacity || 0) * 255, this._maxOpacity = (l.maxOpacity || l.defaultMaxOpacity) * 255, this._minOpacity = (l.minOpacity || l.defaultMinOpacity) * 255, this._useGradientOpacity = !!l.useGradientOpacity; }, _drawAlpha: function(v) { for (var h = this._min = v.min, f = this._max = v.max, v = v.data || [], T = v.length, w = 1 - this._blur; T--; ) { var E = v[T], S = E.x, G = E.y, B = E.radius, ee = Math.min(E.value, f), k = S - B, W = G - B, te = this.shadowCtx, j; this._templates[B] ? j = this._templates[B] : this._templates[B] = j = M(B, w), te.globalAlpha = (ee - h) / (f - h), te.drawImage(j, k, W), k < this._renderBoundaries[0] && (this._renderBoundaries[0] = k), W < this._renderBoundaries[1] && (this._renderBoundaries[1] = W), k + 2 * B > this._renderBoundaries[2] && (this._renderBoundaries[2] = k + 2 * B), W + 2 * B > this._renderBoundaries[3] && (this._renderBoundaries[3] = W + 2 * B); } }, _colorize: function() { var l = this._renderBoundaries[0], h = this._renderBoundaries[1], f = this._renderBoundaries[2] - l, v = this._renderBoundaries[3] - h, T = this._width, w = this._height, E = this._opacity, S = this._maxOpacity, G = this._minOpacity, B = this._useGradientOpacity; l < 0 && (l = 0), h < 0 && (h = 0), l + f > T && (f = T - l), h + v > w && (v = w - h); for (var ee = this.shadowCtx.getImageData(l, h, f, v), k = ee.data, W = k.length, te = this._palette, j = 3; j < W; j += 4) { var We = k[j], Te = We * 4; if (Te) { var Ce; E > 0 ? Ce = E : We < S ? We < G ? Ce = G : Ce = We : Ce = S, k[j - 3] = te[Te], k[j - 2] = te[Te + 1], k[j - 1] = te[Te + 2], k[j] = B ? te[Te + 3] : Ce; } } this.ctx.putImageData(ee, l, h), this._renderBoundaries = [1e3, 1e3, 0, 0]; }, getValueAt: function(l) { var h, f = this.shadowCtx, v = f.getImageData(l.x, l.y, 1, 1), T = v.data[3], w = this._max, E = this._min; return h = Math.abs(w - E) * (T / 255) >> 0, h; }, getDataURL: function() { return this.canvas.toDataURL(); } }, O; }(), o = function() { var y = !1; return n.defaultRenderer === "canvas2d" && (y = d), y; }(), c = { merge: function() { for (var p = {}, y = arguments.length, M = 0; M < y; M++) { var _ = arguments[M]; for (var O in _) p[O] = _[O]; } return p; } }, u = function() { var y = function() { function l() { this.cStore = {}; } return l.prototype = { on: function(h, f, v) { var T = this.cStore; T[h] || (T[h] = []), T[h].push(function(w) { return f.call(v, w); }); }, emit: function(h, f) { var v = this.cStore; if (v[h]) for (var T = v[h].length, w = 0; w < T; w++) { var E = v[h][w]; E(f); } } }, l; }(), M = function(O) { var l = O._renderer, h = O._coordinator, f = O._store; h.on("renderpartial", l.renderPartial, l), h.on("renderall", l.renderAll, l), h.on("extremachange", function(v) { O._config.onExtremaChange && O._config.onExtremaChange({ min: v.min, max: v.max, gradient: O._config.gradient || O._config.defaultGradient }); }), f.setCoordinator(h); }; function _() { var O = this._config = c.merge(n, arguments[0] || {}); if (this._coordinator = new y(), O.plugin) { var l = O.plugin; if (n.plugins[l]) { var h = n.plugins[l]; this._renderer = new h.renderer(O), this._store = new h.store(O); } else throw new Error("Plugin '" + l + "' not found. Maybe it was not registered."); } else this._renderer = new o(O), this._store = new a(O); M(this); } return _.prototype = { addData: function() { return this._store.addData.apply(this._store, arguments), this; }, removeData: function() { return this._store.removeData && this._store.removeData.apply(this._store, argu