tg-map-vue3 3.8.1 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.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)}.element-overlay{position:absolute}.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(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(a,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(a=typeof globalThis<"u"?globalThis:a||self,v(a.TgMap={},a.Vue))})(this,function(a,v){"use strict";var Vn=Object.defineProperty;var jn=(a,v,D)=>v in a?Vn(a,v,{enumerable:!0,configurable:!0,writable:!0,value:D}):a[v]=D;var m=(a,v,D)=>(jn(a,typeof v!="symbol"?v+"":v,D),D);function D(r,t,e){Object.keys(r).forEach(i=>{i.startsWith("update:")||e!=null&&e.includes(i)||t.addEventListener(i,r[i])})}let gr=1;function mr(){return gr++}function $e(r,t){return t.__id__||(t.__id__=mr()),`${r}::${t.__id__}`}var It=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jt={exports:{}};(function(r){(function(t,e){r.exports?r.exports=e():t.coordtransform=e()})(It,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(f,c,y,O){this.west=Math.min(f,y),this.north=Math.max(c,O),this.east=Math.max(f,y),this.south=Math.min(c,O)}s.prototype.contain=function(f,c){return this.west<=f&&this.east>=f&&this.north>=c&&this.south<=c};var l=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],d=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297)];function o(f,c){for(var y=0;y<l.length;y++)if(l[y].contain(f,c)){for(var O=0;O<d.length;O++)if(d[O].contain(f,c))return!1;return!0}return!1}function h(f,c){var y=f-.0065,O=c-.006,C=Math.sqrt(y*y+O*O)-2e-5*Math.sin(O*t),E=Math.atan2(O,y)-3e-6*Math.cos(y*t),P=C*Math.cos(E),B=C*Math.sin(E);return[P,B]}function u(f,c){var y=Math.sqrt(f*f+c*c)+2e-5*Math.sin(c*t),O=Math.atan2(c,f)+3e-6*Math.cos(f*t),C=y*Math.cos(O)+.0065,E=y*Math.sin(O)+.006;return[C,E]}function p(f,c){return o(f,c)?_(f,c):[f,c]}function g(f,c){if(!o(f,c))return[f,c];var y=_(f,c);return[f*2-y[0],c*2-y[1]]}function _(f,c){var y=T(f-105,c-35),O=b(f-105,c-35),C=c/180*e,E=Math.sin(C);E=1-n*E*E;var P=Math.sqrt(E);y=y*180/(i*(1-n)/(E*P)*e),O=O*180/(i/P*Math.cos(C)*e);var B=c+y,G=f+O;return[G,B]}function T(f,c){var y=-100+2*f+3*c+.2*c*c+.1*f*c+.2*Math.sqrt(Math.abs(f));return y+=(20*Math.sin(6*f*e)+20*Math.sin(2*f*e))*2/3,y+=(20*Math.sin(c*e)+40*Math.sin(c/3*e))*2/3,y+=(160*Math.sin(c/12*e)+320*Math.sin(c*e/30))*2/3,y}function b(f,c){var y=300+f+2*c+.1*f*f+.1*f*c+.1*Math.sqrt(Math.abs(f));return y+=(20*Math.sin(6*f*e)+20*Math.sin(2*f*e))*2/3,y+=(20*Math.sin(f*e)+40*Math.sin(f/3*e))*2/3,y+=(150*Math.sin(f/12*e)+300*Math.sin(f/30*e))*2/3,y}return{bd09togcj02:h,gcj02tobd09:u,wgs84togcj02:p,gcj02towgs84:g,bd09ToGcj02:h,gcj02ToBd09:u,wgs84ToGcj02:p,gcj02ToWgs84:g,bd09ToWgs84:function(f,c){if(!o(f,c))return[f,c];var y=h(f,c);return g(y[0],y[1])},wgs84ToBd09:function(f,c){if(!o(f,c))return[f,c];var y=p(f,c);return u(y[0],y[1])}}})})(Jt);var fr=Jt.exports;const ae=ze(fr);a.Arrays=void 0,(r=>{function t(d,o){return d.length===o.length&&d.every((h,u)=>h===o[u])}r.equals=t;function e(d,o){const h=d.indexOf(o);if(h!==-1)return d.splice(h,1)[0]}r.remove=e;function i(d,o){for(const h of d)if(h instanceof o)return h}r.findByType=i;function n(d,o){return d.includes(o)}r.includesTyped=n;function s(d,o,h){const u=o>=0?o:d.length+o;if(h===void 0)return d[u];d[u]=h}r.at=s;function l(d){return d.length>0}r.isNotEmpty=l})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(r=>{function t(n,s){const l=n.getLength();for(let d=0;d<l;d++)if(n.getAt(d)===s)return d;return-1}r.indexOf=t;function e(n,s){const l=t(n,s);if(l!==-1)return n.removeAt(l)}r.remove=e;function i(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}r.listenChanged=i})(a.MVCArrays||(a.MVCArrays={}));function ne(r,t){if(!r)throw new Error(`AssertionError: ${t}`)}function Ge(r){throw new Error(`Unexpected object: ${r}`)}function yr(){}function Ne(r){return r}function vr(r,t){return r instanceof t}function _r(r,t){if(r instanceof t)return r}function Ze(r,t){return(r==null?void 0:r.$options.name)===t.name}function St(r,t){return Ze(r,t)?r:void 0}function We(r,t,e){let i=t;for(;i;){if(Ze(i,r))return i;if(e&&Ze(i,e))return;i=i.$parent}}function br(r){return r}function I(r){throw new Error(r)}function He(r){throw new Error(`Unsupported: ${r}`)}function Mr(r){throw new Error(`todo: ${r}`)}function Tr(r){return r}function le(...r){}function Cr(r){return r!=null}function Qt(r){return r[1]!=null}function ei(r){let t=null;return()=>t??(t=r().catch(e=>(t=null,Promise.reject(e))))}var R=(r=>(r.wgs84="wgs84",r.gcj02="gcj02",r.bd09="bd09",r))(R||{});const kt="wgs84",z=class z{constructor(t,e,i){this.lat=t,this.lng=e,this.coord=i}static _normalize(t,e){const i=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,i]}static fromBaidu(t,e){return new z(t.lat,t.lng,e)}static fromGoogle(t,e){return new z(t.lat(),t.lng(),e)}static fromHere(t,e){return new z(t.lat,t.lng,e)}static fromLiteral(t){return new z(t.lat,t.lng,t.coord||kt)}static fromLngLat(t,e,i=kt){return new z(e,t,i)}static create(t,e,i=kt){return new z(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new z(n,i,e)}toBaidu(t,e=!1){let i=this.lat,n=this.lng;return this.coord!==t&&([n,i]=this._convert(t)),e&&([n,i]=z._normalize(n,i)),new BMap.Point(n,i)}toGoogle(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new google.maps.LatLng(e,i)}toHere(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new H.geo.Point(e,i)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=z._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new z(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)}};m(z,"ZERO",z.create(0,0));let w=z;const re=class re{constructor(t,e){m(this,"coord");this.sw=t,this.ne=e,ne(t.coord===e.coord,"sw和ne的coord应该相同"),ne(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),ne(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,i){return t<=e?t<=i&&i<=e:t<=i||i<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let i=1;i<t.length;i++)e.include(t[i]);return e.build()}static from(...t){return this.fromArray(t)??I("positions中没有点")}static fromGoogle(t,e){return new re(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(w.fromBaidu(t.getSouthWest(),e),w.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:i}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,i)}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 w.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,w.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,w.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)]}};m(re,"EMPTY",new re(w.ZERO,w.ZERO));let V=re;(r=>{class t{constructor(i){m(this,"coord");m(this,"minLat");m(this,"minLng");m(this,"maxLat");m(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new r(w.create(this.minLat,this.minLng,this.coord),w.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:n,lng:s}=i.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),r.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(i,n){return(i-n+360)%360}}r.Builder=t})(V||(V={})),a.Location=void 0,(r=>{function t(i,n){if(i==null)return;if(typeof i=="string")return i;const s=i.to(n);return`${s.lat},${s.lng}`}r.toString=t;function e(i){return typeof i=="string"||i==null?void 0:i.coord}r.getCoordType=e})(a.Location||(a.Location={}));var xt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(xt||(xt={}));function ti(r,t,e){return r.addListener(t,e).remove}function Or(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}function wr(r,t,e,i){return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function ii(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}class ri{constructor(t,e){m(this,"eventMap",new Map);m(this,"target",void 0);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 Ve{constructor(t,e){m(this,"eventHub",new ni);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(a.Arrays.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(a.Arrays.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 Lt=class Lt extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=this.inner.addListener(Lt.EVENT_TYPE_MAP[t]||t,s=>{const l={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=w.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,l)});this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(n.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};m(Lt,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let he=Lt;const ke=class ke extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=s=>{const l={type:t,target:this.target,originalEvent:s};s.point&&(l.position=w.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,l)};this.inner.addEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(this.inner.removeEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};m(ke,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let _e=ke;class ni{constructor(){m(this,"typeMap",new Map)}addEventListener(t,e){let i=this.typeMap.get(t);i||(i=[],this.typeMap.set(t,i)),!i.includes(e)&&i.push(e)}removeEventListener(t,e){const i=this.typeMap.get(t);i&&a.Arrays.remove(i,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(i=>i.call(t.target,t))}}class At{constructor(t,e){m(this,"keyToValue",new Map);m(this,"valueToKey",new Map);ne(t.length===e.length);for(let i=t.length-1;i>=0;i--)this.keyToValue.set(t[i],e[i]),this.valueToKey.set(e[i],t[i])}toKey(t){return this.valueToKey.get(t)??I()}toValue(t){return this.keyToValue.get(t)??I()}}class si{constructor(t,e=10){m(this,"map",new Map);this.values=t,this.maxSize4Debug=e}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let i=this.values.length-1;i>=0;i--){const n=this.values[i];e.set(t.call(n),n)}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}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 ce{constructor(t){m(this,"value");this.creator=t}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(r=>(r.TOP_LEFT="top-left",r.TOP_CENTER="top-center",r.TOP_RIGHT="top-right",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_CENTER="bottom-center",r.BOTTOM_RIGHT="bottom-right",r.LEFT_TOP="left-top",r.LEFT_CENTER="left-center",r.LEFT_BOTTOM="left-bottom",r.RIGHT_TOP="right-top",r.RIGHT_CENTER="right-center",r.RIGHT_BOTTOM="right-bottom",r))(k||{});a.ControlPositionConverter=void 0,(r=>{let t,e;const i=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return t||(t=new At(i,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),t}r.getBaidu=n;function s(){return e||(e=new At(i,[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}r.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class oi{constructor(t){m(this,"inner");this.position=t}}class je{}class ai extends je{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 Fe extends je{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??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class be extends je{constructor(e,i){super();m(this,"visible",!1);m(this,"map");this._type=e,this.position=i}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:a.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var Rt=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))(Rt||{});class Z{constructor(t,e,i,n){this.id=t,this.baidu=e,this.google=i,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){He("google的内置地图没有对应的实例")}}class Er{constructor(t,e){m(this,"baiduLayerCached",new ce(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,i)=>{const n=Math.pow(2,i-1),s=e.x+n,l=n-1-e.y;return this.options.getTileUrl({x:s,y:l},i)},t}));m(this,"baiduMapTypeCached",new ce(()=>{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}));m(this,"googleCached",new ce(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,i)=>this.options.getTileUrl(e,i),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}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(){He("这个方法不会被调用")}}class li{constructor(){m(this,"baiduCache",new ce(()=>new BMap.TrafficLayer));m(this,"googleCache",new ce(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}a.MapType=void 0,(r=>{r.NORMAL=new Z("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new Z("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new Z("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new Z("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),r.BUILD_IN_MAP_TYPES=new si([r.NORMAL,r.SATELLITE,r.HYBRID,r.TERRAIN])})(a.MapType||(a.MapType={}));var Dt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(Dt||{});const hi=[a.MapType.NORMAL,a.MapType.SATELLITE,a.MapType.HYBRID];class Ue extends Fe{static create(t){const e=t.mapTypes??hi,i={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&i[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t.position)),new Ue(n,t.position)}}const oe=class oe extends be{constructor(t="default",e=k.TOP_LEFT,i=hi){super("mapType",e),this.type=t,this.mapTypes=i,oe.type2google||(oe.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new oe(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=oe.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof Z?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof Z||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};m(oe,"type2google");let Ye=oe;class qe extends Fe{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new qe(e,t.position)}}class Ke extends be{static create(t){return new Ke(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class Xe extends ai{static create(t){return new Xe(!0,t.position??k.RIGHT_BOTTOM)}}class Je extends be{static create(t){return new Je(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class Qe extends Fe{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Qe(e,t.position)}}class et extends be{static create(t){return new et(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}function Pr(r){let t,e,i;const n="The Google Maps JavaScript API",s="google",l="importLibrary",d="__ib__",o=document,h=window,u=h[s]||(h[s]={}),p=u.maps||(u.maps={}),g=new Set,_=new URLSearchParams,T=()=>t||(t=new Promise(async(b,f)=>{var c;await(e=o.createElement("script")),_.set("libraries",[...g]+"");for(i in r)_.set(i.replace(/[A-Z]/g,y=>"_"+y[0].toLowerCase()),r[i]);_.set("callback",s+".maps."+d),e.src=`https://maps.${s}apis.com/maps/api/js?`+_,p[d]=b,e.onerror=()=>t=f(Error(n+" could not load.")),e.nonce=((c=o.querySelector("script[nonce]"))==null?void 0:c.nonce)||"",o.head.append(e)}));p[l]?console.warn(n+" only loads once. Ignoring:",r):p[l]=(b,...f)=>g.add(b)&&T().then(()=>p[l](b,...f))}let Lr,Br;const ie={get LATLNG_ZERO(){return Lr??(Lr=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return Br??(Br=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function ci(r,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of r)for(const i of e.types)switch(i){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 di(r,t){var i;const e=r.address_components&&ci(r.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:r.place_id??"",address:r.formatted_address??"",position:w.fromGoogle(((i=r.geometry)==null?void 0:i.location)??ie.LATLNG_ZERO,t.coordType),title:r.name??""}}class $t{}class ui extends $t{constructor(e,i){super();m(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return ti(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),n={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&ci(i.address_components,n),e(n)})}}class pi extends $t{constructor(e,i){super();m(this,"inner");m(this,"input");m(this,"removeableArray",[]);if(this.map=e,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?e.innerMap:void 0}),i.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(ii(this.map,"center-changed",n)),this.removeableArray.push(ii(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let i=0;const n=Or(this.inner,"confirm",l=>{const d=l.item.value;i=Date.now(),e(Object.assign({title:d.business,country:""},d))}),s=wr(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-i>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var gi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},l=function(){var _=function(f){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=f.xField||f.defaultXField,this._yField=f.yField||f.defaultYField,this._valueField=f.valueField||f.defaultValueField,f.radius&&(this._cfgRadius=f.radius)},T=s.defaultRadius;return _.prototype={_organiseData:function(b,f){var c=b[this._xField],y=b[this._yField],O=this._radi,C=this._data,E=this._max,P=this._min,B=b[this._valueField]||1,G=b.radius||this._cfgRadius||T;return C[c]||(C[c]=[],O[c]=[]),C[c][y]?C[c][y]+=B:(C[c][y]=B,O[c][y]=G),C[c][y]>E?(f?this.setDataMax(C[c][y]):this._max=C[c][y],!1):{x:c,y,value:B,radius:G,min:P,max:E}},_unOrganizeData:function(){var b=[],f=this._data,c=this._radi;for(var y in f)for(var O in f[y])b.push({x:y,y:O,radius:c[y][O],value:f[y][O]});return{min:this._min,max:this._max,data:b}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var b=arguments[0],f=b.length;f--;)this.addData.call(this,b[f]);else{var c=this._organiseData(arguments[0],!0);c&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[c]})}return this},setData:function(b){var f=b.data,c=f.length;this._data=[],this._radi=[];for(var y=0;y<c;y++)this._organiseData(f[y],!1);return this._max=b.max,this._min=b.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(b){return this._max=b,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(b){return this._min=b,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(b){this._coordinator=b},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},_}(),d=function(){var _=function(c){var y=c.gradient||c.defaultGradient,O=document.createElement("canvas"),C=O.getContext("2d");O.width=256,O.height=1;var E=C.createLinearGradient(0,0,256,1);for(var P in y)E.addColorStop(P,y[P]);return C.fillStyle=E,C.fillRect(0,0,256,1),C.getImageData(0,0,256,1).data},T=function(c,y){var O=document.createElement("canvas"),C=O.getContext("2d"),E=c,P=c;if(O.width=O.height=c*2,y==1)C.beginPath(),C.arc(E,P,c,0,2*Math.PI,!1),C.fillStyle="rgba(0,0,0,1)",C.fill();else{var B=C.createRadialGradient(E,P,c*y,E,P,c);B.addColorStop(0,"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),C.fillStyle=B,C.fillRect(0,0,2*c,2*c)}return O},b=function(P){for(var y=[],O=P.min,C=P.max,E=P.radi,P=P.data,B=Object.keys(P),G=B.length;G--;)for(var Y=B[G],S=Object.keys(P[Y]),ee=S.length;ee--;){var A=S[ee],q=P[Y][A],te=E[Y][A];y.push({x:Y,y:A,value:q,radius:te})}return{min:O,max:C,data:y}};function f(c){var y=c.element,O=this.shadowCanvas=document.createElement("canvas"),C=this.canvas=c.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var E=getComputedStyle(c.element)||{};C.className="heatmap-canvas",this._width=C.width=O.width=+E.width.replace(/px/,""),this._height=C.height=O.height=+E.height.replace(/px/,""),this.shadowCtx=O.getContext("2d"),this.ctx=C.getContext("2d"),C.style.cssText=O.style.cssText="position:absolute;left:0;top:0;",y.style.position="relative",y.appendChild(C),this._palette=_(c),this._templates={},this._setStyles(c)}return f.prototype={renderPartial:function(c){this._drawAlpha(c),this._colorize()},renderAll:function(c){this._clear(),this._drawAlpha(b(c)),this._colorize()},_updateGradient:function(c){this._palette=_(c)},updateConfig:function(c,y){c.gradient!==y.gradient&&this._updateGradient(c),this._setStyles(c)},setDimensions:function(c,y){this._width=c,this._height=y,this.canvas.width=this.shadowCanvas.width=c,this.canvas.height=this.shadowCanvas.height=y},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(c){this._blur=c.blur==0?0:c.blur||c.defaultBlur,c.backgroundColor&&(this.canvas.style.backgroundColor=c.backgroundColor),this._opacity=(c.opacity||0)*255,this._maxOpacity=(c.maxOpacity||c.defaultMaxOpacity)*255,this._minOpacity=(c.minOpacity||c.defaultMinOpacity)*255,this._useGradientOpacity=!!c.useGradientOpacity},_drawAlpha:function(C){for(var y=this._min=C.min,O=this._max=C.max,C=C.data||[],E=C.length,P=1-this._blur;E--;){var B=C[E],G=B.x,Y=B.y,S=B.radius,ee=Math.min(B.value,O),A=G-S,q=Y-S,te=this.shadowCtx,K;this._templates[S]?K=this._templates[S]:this._templates[S]=K=T(S,P),te.globalAlpha=(ee-y)/(O-y),te.drawImage(K,A,q),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),q<this._renderBoundaries[1]&&(this._renderBoundaries[1]=q),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),q+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=q+2*S)}},_colorize:function(){var c=this._renderBoundaries[0],y=this._renderBoundaries[1],O=this._renderBoundaries[2]-c,C=this._renderBoundaries[3]-y,E=this._width,P=this._height,B=this._opacity,G=this._maxOpacity,Y=this._minOpacity,S=this._useGradientOpacity;c<0&&(c=0),y<0&&(y=0),c+O>E&&(O=E-c),y+C>P&&(C=P-y);for(var ee=this.shadowCtx.getImageData(c,y,O,C),A=ee.data,q=A.length,te=this._palette,K=3;K<q;K+=4){var Bt=A[K],Re=Bt*4;if(Re){var De;B>0?De=B:Bt<G?Bt<Y?De=Y:De=Bt:De=G,A[K-3]=te[Re],A[K-2]=te[Re+1],A[K-1]=te[Re+2],A[K]=S?te[Re+3]:De}}this.ctx.putImageData(ee,c,y),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(c){var y,O=this.shadowCtx,C=O.getImageData(c.x,c.y,1,1),E=C.data[3],P=this._max,B=this._min;return y=Math.abs(P-B)*(E/255)>>0,y},getDataURL:function(){return this.canvas.toDataURL()}},f}(),o=function(){var _=!1;return s.defaultRenderer==="canvas2d"&&(_=d),_}(),h={merge:function(){for(var g={},_=arguments.length,T=0;T<_;T++){var b=arguments[T];for(var f in b)g[f]=b[f]}return g}},u=function(){var _=function(){function c(){this.cStore={}}return c.prototype={on:function(y,O,C){var E=this.cStore;E[y]||(E[y]=[]),E[y].push(function(P){return O.call(C,P)})},emit:function(y,O){var C=this.cStore;if(C[y])for(var E=C[y].length,P=0;P<E;P++){var B=C[y][P];B(O)}}},c}(),T=function(f){var c=f._renderer,y=f._coordinator,O=f._store;y.on("renderpartial",c.renderPartial,c),y.on("renderall",c.renderAll,c),y.on("extremachange",function(C){f._config.onExtremaChange&&f._config.onExtremaChange({min:C.min,max:C.max,gradient:f._config.gradient||f._config.defaultGradient})}),O.setCoordinator(y)};function b(){var f=this._config=h.merge(s,arguments[0]||{});if(this._coordinator=new _,f.plugin){var c=f.plugin;if(s.plugins[c]){var y=s.plugins[c];this._renderer=new y.renderer(f),this._store=new y.store(f)}else throw new Error("Plugin '"+c+"' not found. Maybe it was not registered.")}else this._renderer=new o(f),this._store=new l(f);T(this)}return b.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(f){const c=this._config;return this._config=h.merge(this._config,f),this._renderer.updateConfig(this._config,c),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(f){return this._store.getValueAt?this._store.getValueAt(f):this._renderer.getValueAt?this._renderer.getValueAt(f):null}},b}(),p={create:function(g){return new u(g)},register:function(g,_){s.plugins[g]=_}};return p}();var i=function(s){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(s){this._map=s;var l=document.createElement("div");if(l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border=0,l.style.width=this._map.getSize().width+"px",l.style.height=this._map.getSize().height+"px",this.conf.element=l,!n())return l;s.getPanes().mapPane.appendChild(l),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var d=this;return s.addEventListener("resize",function(o){var h=o.size;l.style.width=h.width+"px",l.style.height=h.height+"px",d.heatmap._renderer.setDimensions(h.width,h.height),d.draw()}),this._div=l,l},i.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var l=this._map.pointToOverlayPixel(s.getNorthEast()),d=this._map.pointToOverlayPixel(s.getSouthWest()),o=l.y,h=d.x,u=d.y-l.y,p=l.x-d.x;if(this.conf.element.style.left=h+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=p+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var g=this.latlngs.length;const c={max:this.heatmap._store.getData().max,data:[]};for(;g--;){var _=this.latlngs[g].latlng;if(s.containsPoint(_)){var T=this._map.pointToOverlayPixel(_),h=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,b=new BMap.Pixel(T.x-h,T.y-o),f=this.pixelTransform(b);c.data.push({x:f.x,y:f.y,count:this.latlngs[g].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(c)}}}},i.prototype.pixelTransform=function(s){for(var l=this.heatmap.width,d=this.heatmap.height;s.x<0;)s.x+=l;for(;s.x>l;)s.x-=l;for(;s.y<0;)s.y+=d;for(;s.y>d;)s.y-=d;return s.x=s.x>>0,s.y=s.y>>0,s},i.prototype.setDataSet=function(s){if(this.data=s,!!n()){var l=this._map.getBounds(),d={max:s.max,data:[]},o=s.data,h=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));h--;){var u=new BMap.Point(o[h].lng,o[h].lat);if(this.latlngs.push({latlng:u,c:o[h].count}),!!l.containsPoint(u)){var p=this._map.pointToOverlayPixel(u),g=this._map.pointToOverlayPixel(l.getSouthWest()).x,_=this._map.pointToOverlayPixel(l.getNorthEast()).y,T=new BMap.Pixel(p.x-g,p.y-_),b=this.pixelTransform(T);d.data.push({x:b.x,y:b.y,count:o[h].count})}}this.heatmap.setData(d)}},i.prototype.addDataPoint=function(s,l,d){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:l,count:d});var o=new BMap.Point(s,l),h=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(h.x,h.y,d),this.latlngs.push({latlng:o,c:d})}},i.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(s){if(n()){for(var l in s)l=="radius"&&(this.heatmap._store._cfgRadius=s[l]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return i})})(gi);var Ir=gi.exports;const Sr=ze(Ir),mi=10,tt={toGoogle:(r,t)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient&&Object.entries(r.gradient).sort(([e],[i])=>+e-+i).map(([e,i])=>i),maxIntensity:r.maxIntensity,data:it.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient,data:it.toBaidu(r.data,t,e)})},it={toGoogle:(r,t)=>r.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(r,t,e)=>{let i=1;return{data:r.map(s=>{let l,d;return"weight"in s?(l=s.position.to(t),d=s.weight):(l=s.to(t),d=1),i<d&&(i=d),{lng:l.lng,lat:l.lat,count:d}}),max:e??i}}};class zt{}class fi extends zt{constructor(e,i){super();m(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(tt.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(it.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(tt.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class yi extends zt{constructor(e,i){super();m(this,"inner");this.map=e;const n=tt.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new Sr(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var i;((i=this.inner).data??(i.data={})).max=e}setData(e){this.inner.setDataSet(it.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=tt.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(i.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Gt{constructor(t){this.options=t}}function Me(r,t,e){const i=new URL(t,r),n=new URLSearchParams(Object.entries(e).filter(Qt));return i.search="?"+n.toString(),i}function Nt(){const r=window.location.hostname.split(".").filter(t=>!a.Strings.isInt(t));return r.length===3?r.join("."):[...r,"tg","map","urls"].slice(0,3).join(".")}const xe=class xe extends Gt{directions(t,e,i){return Me(xe.BASE_URL,"dir/",{api:"1",origin:a.Location.toString(t,R.gcj02),destination:a.Location.toString(e,R.gcj02),travelmode:i})}search(t){return Me(xe.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};m(xe,"BASE_URL","https://www.google.com/maps/");let rt=xe;const ve=class ve extends Gt{directions(t,e,i="driving"){const n=a.Location.getCoordType(e)??a.Location.getCoordType(t)??R.bd09,s=a.Location.toString(e,n);return Me(ve.BASE_URL,"direction",{origin:a.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:i,output:"html",region:"中国",src:Nt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,i){return Me(ve.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:i,output:"html",src:Nt()})}geocoderApi(t){return Me(ve.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:Nt()})}};m(ve,"BASE_URL","https://api.map.baidu.com/");let nt=ve,kr=class pr{constructor(t,e,i){this.extend(pr,google.maps.OverlayView),this.map_=t,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=i||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var l=s.map_.getZoom(),d=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);l=Math.min(Math.max(l,d),o),s.prevZoom_!=l&&(s.prevZoom_=l,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(i){for(var n in i.prototype)this.prototype[n]=i.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0,n;n=t[i];i++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var i=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:n,index:i}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let i=0,n;n=t[i];i++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let i in t)this.pushMarkerTo_(t[i]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i=0,n;n=this.markers_[i];i++)if(n==t){e=i;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var i=this.removeMarker_(t);return!e&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var i=t===this.getMarkers()?t.slice():t,n=!1,s=0,l;l=i[s];s++){var d=this.removeMarker_(l);n=n||d}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=e.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var d=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(l);return t.extend(d),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,i;i=this.clusters_[e];e++)i.remove();for(let e=0,i;i=this.markers_[e];e++)i.isAdded=!1,t&&i.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,i;i=t[e];e++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var i=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=i*d;return o}addToClosestCluster_(t){for(var e=4e4,i=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var d=this.distanceBetweenPoints_(l,t.getPosition());d<e&&(e=d,i=s)}}if(i&&i.isMarkerInClusterBounds(t))i.addMarker(t);else{var o=new xr(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),i=0,n;n=this.markers_[i];i++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},xr=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Zt(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,i;i=this.markers_[e];e++)if(i==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,i=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(i,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0,n;n=e[i];i++)t.extend(n.getPosition());return t}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var i=0,n;n=this.markers_[i];i++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,l=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(l),this.clusterIcon_.show()}};class Zt{constructor(t,e,i){t.getMarkerClusterer().extend(Zt,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var vi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){var e,i=e=i||{version:"1.3.8"},n={};i.guid="$BAIDU$",n[i.guid]=n[i.guid]||{},i.dom=i.dom||{},i.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},i.g=i.G=i.dom.g,i.dom.getDocument=function(o){return o=i.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},i.lang=i.lang||{},i.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(o){return i.lang.isString(o)?document.getElementById(o):o},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(o,h){o=i.dom._g(o);var u=i.dom.getDocument(o),p;return u.defaultView&&u.defaultView.getComputedStyle&&(p=u.defaultView.getComputedStyle(o,null),p)?p[h]||p.getPropertyValue(h):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,h,u){for(var p=0,g=i.dom._styleFilter,_;_=g[p];p++)(_=_[u])&&(h=_(o,h));return h},i.string=i.string||{},i.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(h){return h.charAt(1).toUpperCase()})},i.dom.getStyle=function(o,h){var u=i.dom;o=u.g(o),h=i.string.toCamelCase(h);var p=o.style[h]||(o.currentStyle?o.currentStyle[h]:"")||u.getComputedStyle(o,h);if(!p){var g=u._styleFixer[h];g&&(p=g.get?g.get(o):i.dom.getStyle(o,g))}return(g=u._styleFilter)&&(p=g.filter(h,p,"get")),p},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(o){o=i.dom.g(o);var h=i.dom.getDocument(o),u=i.browser,p=i.dom.getStyle;u.isGecko>0&&h.getBoxObjectFor&&p(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var g={left:0,top:0},_=u.ie&&!u.isStrict?h.body:h.documentElement,T,b;if(o==_)return g;if(o.getBoundingClientRect){b=o.getBoundingClientRect(),g.left=Math.floor(b.left)+Math.max(h.documentElement.scrollLeft,h.body.scrollLeft),g.top=Math.floor(b.top)+Math.max(h.documentElement.scrollTop,h.body.scrollTop),g.left-=h.documentElement.clientLeft,g.top-=h.documentElement.clientTop;var f=h.body,c=parseInt(p(f,"borderLeftWidth")),y=parseInt(p(f,"borderTopWidth"));u.ie&&!u.isStrict&&(g.left-=isNaN(c)?2:c,g.top-=isNaN(y)?2:y)}else{T=o;do{if(g.left+=T.offsetLeft,g.top+=T.offsetTop,u.isWebkit>0&&p(T,"position")=="fixed"){g.left+=h.body.scrollLeft,g.top+=h.body.scrollTop;break}T=T.offsetParent}while(T&&T!=o);for((u.opera>0||u.isWebkit>0&&p(o,"position")=="absolute")&&(g.top-=h.body.offsetTop),T=o.offsetParent;T&&T!=h.body;)g.left-=T.scrollLeft,(!u.opera||T.tagName!="TR")&&(g.top-=T.scrollTop),T=T.offsetParent}return g},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(o,h,u){h=h.replace(/^on/i,""),o=i.dom._g(o);var p=function(f){u.call(o,f)},g=i.event._listeners,_=i.event._eventFilter,T,b=h;return h=h.toLowerCase(),_&&_[h]&&(T=_[h](o,h,p),b=T.type,p=T.listener),o.addEventListener?o.addEventListener(b,p,!1):o.attachEvent&&o.attachEvent("on"+b,p),g[g.length]=[o,h,u,p,b],o},i.on=i.event.on,function(){var o=n[i.guid];i.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[i.guid]._instances=n[i.guid]._instances||{},i.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},i.lang.Class=function(o){this.guid=o||i.lang.guid(),n[i.guid]._instances[this.guid]=this},n[i.guid]._instances=n[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete n[i.guid]._instances[this.guid];for(var o in this)i.lang.isFunction(this[o])||delete this[o];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(o,h){this.type=o,this.returnValue=!0,this.target=h||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(o,h,u){if(i.lang.isFunction(h)){!this.__listeners&&(this.__listeners={});var p=this.__listeners,g;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;h.hashCode=u,g=u}o.indexOf("on")!=0&&(o="on"+o),typeof p[o]!="object"&&(p[o]={}),g=g||i.lang.guid(),h.hashCode=g,p[o][g]=h}},i.lang.Class.prototype.removeEventListener=function(o,h){if(!(typeof h<"u"&&(i.lang.isFunction(h)&&!(h=h.hashCode)||!i.lang.isString(h)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof h<"u")u[o][h]&&delete u[o][h];else for(var p in u[o])delete u[o][p]}},i.lang.Class.prototype.dispatchEvent=function(o,h){i.lang.isString(o)&&(o=new i.lang.Event(o)),!this.__listeners&&(this.__listeners={}),h=h||{};for(var u in h)o[u]=h[u];var u,p=this.__listeners,g=o.type;if(o.target=o.target||this,o.currentTarget=this,g.indexOf("on")!=0&&(g="on"+g),i.lang.isFunction(this[g])&&this[g].apply(this,arguments),typeof p[g]=="object")for(u in p[g])p[g][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,h,u){var p,g,_=o.prototype,T=new Function;T.prototype=h.prototype,g=o.prototype=new T;for(p in _)g[p]=_[p];o.prototype.constructor=o,o.superClass=h.prototype,typeof u=="string"&&(g._className=u)},i.inherits=i.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",d=function(o,h,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=h,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return d.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],h=0,u;u=o[h];h++)this._styles.push({url:s+h+"."+l,size:new BMap.Size(u,u)})},d.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},d.prototype.draw=function(){this._map&&this._updatePosition()},d.prototype.getText=function(){return this._text},d.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},d.prototype.getPosition=function(){return this._position},d.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},d.prototype.getStyleByText=function(o,h){var u=parseInt(o),p=parseInt(u/10);return p=Math.max(0,p),p=Math.min(p,h.length-1),h[p]},d.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},d.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},d.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,h=this._map.pointToOverlayPixel(this._position);h.x-=Math.ceil(parseInt(o.width)/2),h.y-=Math.ceil(parseInt(o.height)/2),o.left=h.x+"px",o.top=h.y+"px"}},d.prototype._buildCssText=function(o){var h=o.url,u=o.size,p=o.anchor,g=o.offset,_=o.textColor||"black",T=o.textSize||10,b=[];if(this._zIndex&&b.push("z-index:"+this._zIndex+";"),e.browser.ie<7)b.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+h+'");');else{b.push("background-image:url("+h+");");var f="0 0";g instanceof BMap.Size&&(f=g.width+"px "+g.height+"px"),b.push("background-position:"+f+";")}return u instanceof BMap.Size&&(p instanceof BMap.Size?(p.height>0&&p.height<u.height&&b.push("height:"+(u.height-p.height)+"px; padding-top:"+p.height+"px;"),p.width>0&&p.width<u.width&&b.push("width:"+(u.width-p.width)+"px; padding-left:"+p.width+"px;")):(b.push("height:"+u.height+"px; line-height:"+u.height+"px;"),b.push("width:"+u.width+"px; text-align:center;"))),b.push("cursor:pointer; color:"+_+"; position:absolute; font-size:"+T+"px; font-family:Arial,sans-serif; font-weight:bold"),b.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,h=this._map,u=e.lang.Event;function p(g,_){var T=g.srcElement||g.target,b=g.clientX||g.pageX,f=g.clientY||g.pageY;if(g&&_&&b&&f&&T){var c=e.dom.getPosition(h.getContainer());_.pixel=new BMap.Pixel(b-c.left,f-c.top),_.point=h.pixelToPoint(_.pixel)}return _}e.event.on(this._domElement,"mouseover",function(g){o.dispatchEvent(p(g,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(g){o.dispatchEvent(p(g,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(g){o.dispatchEvent(p(g,new u("onclick")))})},d})})(vi);var Ar=vi.exports;const _i=ze(Ar);var bi=function(r,t,e){t=Rr(t);var i=r.pointToPixel(t.getNorthEast()),n=r.pointToPixel(t.getSouthWest());i.x+=e,i.y-=e,n.x-=e,n.y+=e;var s=r.pixelToPoint(i),l=r.pixelToPoint(n);return new BMap.Bounds(l,s)},Rr=function(r){var t=st(r.getNorthEast().lng,-180,180),e=st(r.getSouthWest().lng,-180,180),i=st(r.getNorthEast().lat,-74,74),n=st(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},st=function(r,t,e){return t&&(r=Math.max(r,t)),e&&(r=Math.min(r,e)),r},Mi=function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ti=function(r,t){var e=-1;if(Mi(t)){if(t.indexOf)e=t.indexOf(r);else for(var i=0,n;n=t[i];i++)if(n===r){e=i;break}}return e},L=function(r,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(r){this._map=r,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var n=e.markers;Mi(n)&&this.addMarkers(n)}};L.prototype.addMarkers=function(r){if(r.length){for(var t=0,e=r.length;t<e;t++)this._pushMarkerTo(r[t]);this._createClusters()}},L.prototype._pushMarkerTo=function(r){var t=Ti(r,this._markers);t===-1&&(r.isInCluster=!1,this._markers.push(r))},L.prototype.addMarker=function(r){this._pushMarkerTo(r),this._createClusters()},L.prototype._createClusters=function(){var r=this._map.getBounds();if(r.getCenter()){for(var t=bi(this._map,r,this._gridSize),e=0,i;i=this._markers[e];e++)!i.isInCluster&&t.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}},L.prototype._addToClosestCluster=function(r){var t=4e6,e=null;r.getPosition();for(var i=0,n;n=this._clusters[i];i++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,r.getPosition());l<t&&(t=l,e=n)}}if(e&&e.isMarkerInClusterBounds(r))e.addMarker(r);else{var n=new j(this);n.addMarker(r),this._clusters.push(n)}},L.prototype._clearLastClusters=function(){for(var r=0,t;t=this._clusters[r];r++)t.remove();this._clusters=[],this._removeMarkersFromCluster()},L.prototype._removeMarkersFromCluster=function(){for(var r=0,t;t=this._markers[r];r++)t.isInCluster=!1},L.prototype._removeMarkersFromMap=function(){for(var r=0,t;t=this._markers[r];r++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}},L.prototype._removeMarker=function(r){var t=Ti(r,this._markers);return t===-1?!1:(this._map.removeOverlay(r),this._markers.splice(t,1),!0)},L.prototype.removeMarker=function(r){var t=this._removeMarker(r);return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.removeMarkers=function(r){for(var t=!1,e=0;e<r.length;e++){var i=this._removeMarker(r[e]);t=t||i}return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},L.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},L.prototype.getGridSize=function(){return this._gridSize},L.prototype.setGridSize=function(r){this._gridSize=r,this._redraw()},L.prototype.getMaxZoom=function(){return this._maxZoom},L.prototype.setMaxZoom=function(r){this._maxZoom=r,this._redraw()},L.prototype.getZIndex=function(){return this._zIndex},L.prototype.setZIndex=function(r){this._zIndex!=r&&(this.zIndex=r,this._redraw())},L.prototype.getStyles=function(){return this._styles},L.prototype.setStyles=function(r){this._styles=r,this._redraw()},L.prototype.getMinClusterSize=function(){return this._minClusterSize},L.prototype.setMinClusterSize=function(r){this._minClusterSize=r,this._redraw()},L.prototype.isAverageCenter=function(){return this._isAverageCenter},L.prototype.getMap=function(){return this._map},L.prototype.getMarkers=function(){return this._markers},L.prototype.getClustersCount=function(){for(var r=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&r++;return r},L.prototype._textCalculator=function(r){return r.length.toString()},L.prototype._stylesIndexCalculator=null,L.prototype.setTextCalculator=function(r){this._textCalculator=r},L.prototype.setStylesIndexCalculator=function(r){this._stylesIndexCalculator=r};function j(r){var t=this;this._markerClusterer=r,this._map=r.getMap(),this._minClusterSize=r.getMinClusterSize(),this._isAverageCenter=r.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new _i(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:r._zIndex}),this._clusterMarker.getStyleByText=function(e,i){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,i.length);return i[n]}return _i.prototype.getStyleByText.call(this,e,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}j.prototype.addMarker=function(r){if(this.isMarkerInCluster(r))return!1;if(!this._center)this._center=r.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+r.getPosition().lat)/t,i=(this._center.lng*(t-1)+r.getPosition().lng)/t;this._center=new BMap.Point(i,e),this.updateGridBounds()}return r.isInCluster=!0,this._markers.push(r),!0},j.prototype.render=function(){var r=this._markers.length;if(r<this._minClusterSize)for(var t=0;t<r;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},j.prototype.isMarkerInCluster=function(r){if(this._markers.indexOf)return this._markers.indexOf(r)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===r)return!0;return!1},j.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},j.prototype.isReal=function(r){return this._isReal},j.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=bi(this._map,r,this._markerClusterer.getGridSize())},j.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var r=0,t;t=this._markers[r];r++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},j.prototype.remove=function(){for(var r=0,t;t=this._markers[r];r++){var e=this._markers[r].getLabel();this._markers[r].getMap()&&this._map.removeOverlay(this._markers[r]),this._markers[r].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},j.prototype.getBounds=function(){for(var r=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)r.extend(e.getPosition());return r},j.prototype.getCenter=function(){return this._center};var ot;(r=>{function t(i){return{url:i.url,size:new BMap.Size(i.size.width,i.size.height),anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),offset:i.offset&&new BMap.Size(i.offset.x,i.offset.y),textColor:i.textColor,textSize:i.textSize}}r.toBaidu=t;function e(i){return{url:i.url,width:i.size.width,height:i.size.height,anchor:i.anchor&&[i.anchor.y,i.anchor.x],backgroundPosition:i.offset&&`${i.offset.x} ${i.offset.y}`,textColor:i.textColor,textSize:i.textSize}}r.toGoogle=e})(ot||(ot={}));class Wt{constructor(t){this.map=t}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Ci extends Wt{constructor(e,i){var s;super(e);m(this,"inner");this.inner=new L(e.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(l=>ot.toBaidu(l)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((l,d)=>n(l.length,d)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class Oi extends Wt{constructor(e,i){var s,l;super(e);m(this,"inner");this.inner=new kr(e.innerMap,(s=i.markers)==null?void 0:s.map(d=>d.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(l=i.styles)==null?void 0:l.map(d=>ot.toGoogle(d)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setCalculator((d,o)=>({text:d.length,index:n(d.length,o)+1}))}recreate(){this.inner.repaint()}}class Ht{constructor(){}}class wi extends Ht{constructor(e,i){super();m(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,i){return this.searchImpl(e,i instanceof w?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(e,i){return this.searchImpl(e,i.toGoogle(this.map.coordType))}searchNearBy(e,i,n){return this.searchImpl(e,{center:i.toGoogle(this.map.coordType),radius:n})}searchImpl(e,i){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(l,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(h=>di(h,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Ei extends Ht{constructor(e,i){super();m(this,"searchRequestMap",new Map);m(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,i){return this.newSearch(i instanceof w?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,i){return this.newSearch(void 0,n=>{n.searchInBounds(e,i.toBaidu(this.map.coordType))})}searchNearBy(e,i,n){return this.newSearch(void 0,s=>{s.searchNearby(e,i.toBaidu(this.map.coordType),n)})}newSearch(e,i){return new Promise((n,s)=>{const l=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&He("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const h=[];for(let u=0;u<d.getCurrentNumPois();u++){const p=d.getPoi(u);h.push({id:p.uid,city:p.city,country:"",position:w.fromBaidu(p.point,this.map.coordType),province:p.province,title:p.title,address:p.address})}n(h);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Vt{constructor(t,e){m(this,"onData");m(this,"onError");this.map=t,this.input=e}setSearchListener(t,e){return this.onData&&I("setSearchListener只能调用一次"),this.onData=t,this.onError=e,le}}class Pi extends Vt{constructor(e,i){super(e,i.input);m(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,i){return super.setSearchListener(e,i),ti(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>di(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Li extends Vt{constructor(e,i){super(e,i.input);m(this,"autocomplete");m(this,"placesService");this.autocomplete=e.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,i){return super.setSearchListener(e,i),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(e){this.placesService.search(e).then(this.onData,this.onError)}}var Bi=(r=>(r[r.WORLD=1]="WORLD",r[r.STATE=5]="STATE",r[r.CITY=10]="CITY",r[r.STREET=15]="STREET",r[r.BUILDING=20]="BUILDING",r))(Bi||{});class at{constructor(t){m(this,"latestInfoWindow");m(this,"delegate",void 0);this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Dr=function(t){return $r(t)&&!zr(t)};function $r(r){return!!r&&typeof r=="object"}function zr(r){var t=Object.prototype.toString.call(r);return t==="[object RegExp]"||t==="[object Date]"||Zr(r)}var Gr=typeof Symbol=="function"&&Symbol.for,Nr=Gr?Symbol.for("react.element"):60103;function Zr(r){return r.$$typeof===Nr}function Wr(r){return Array.isArray(r)?[]:{}}function Te(r,t){return t.clone!==!1&&t.isMergeableObject(r)?de(Wr(r),r,t):r}function Hr(r,t,e){return r.concat(t).map(function(i){return Te(i,e)})}function Vr(r,t){if(!t.customMerge)return de;var e=t.customMerge(r);return typeof e=="function"?e:de}function jr(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(t){return Object.propertyIsEnumerable.call(r,t)}):[]}function Ii(r){return Object.keys(r).concat(jr(r))}function Si(r,t){try{return t in r}catch{return!1}}function Fr(r,t){return Si(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))}function Ur(r,t,e){var i={};return e.isMergeableObject(r)&&Ii(r).forEach(function(n){i[n]=Te(r[n],e)}),Ii(t).forEach(function(n){Fr(r,n)||(Si(r,n)&&e.isMergeableObject(t[n])?i[n]=Vr(n,e)(r[n],t[n],e):i[n]=Te(t[n],e))}),i}function de(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Hr,e.isMergeableObject=e.isMergeableObject||Dr,e.cloneUnlessOtherwiseSpecified=Te;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Ur(r,t,e):Te(t,e)}de.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return de(i,n,e)},{})};var Yr=de,qr=Yr;const ki=ze(qr);/*!
2
+ (function(a,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(a=typeof globalThis<"u"?globalThis:a||self,v(a.TgMap={},a.Vue))})(this,function(a,v){"use strict";var Vn=Object.defineProperty;var jn=(a,v,D)=>v in a?Vn(a,v,{enumerable:!0,configurable:!0,writable:!0,value:D}):a[v]=D;var m=(a,v,D)=>(jn(a,typeof v!="symbol"?v+"":v,D),D);function D(r,t,e){Object.keys(r).forEach(i=>{i.startsWith("update:")||e!=null&&e.includes(i)||t.addEventListener(i,r[i])})}let gr=1;function mr(){return gr++}function $e(r,t){return t.__id__||(t.__id__=mr()),`${r}::${t.__id__}`}var It=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jt={exports:{}};(function(r){(function(t,e){r.exports?r.exports=e():t.coordtransform=e()})(It,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(f,c,y,O){this.west=Math.min(f,y),this.north=Math.max(c,O),this.east=Math.max(f,y),this.south=Math.min(c,O)}s.prototype.contain=function(f,c){return this.west<=f&&this.east>=f&&this.north>=c&&this.south<=c};var l=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],d=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297),new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function o(f,c){for(var y=0;y<l.length;y++)if(l[y].contain(f,c)){for(var O=0;O<d.length;O++)if(d[O].contain(f,c))return!1;return!0}return!1}function h(f,c){var y=f-.0065,O=c-.006,C=Math.sqrt(y*y+O*O)-2e-5*Math.sin(O*t),E=Math.atan2(O,y)-3e-6*Math.cos(y*t),P=C*Math.cos(E),B=C*Math.sin(E);return[P,B]}function u(f,c){var y=Math.sqrt(f*f+c*c)+2e-5*Math.sin(c*t),O=Math.atan2(c,f)+3e-6*Math.cos(f*t),C=y*Math.cos(O)+.0065,E=y*Math.sin(O)+.006;return[C,E]}function p(f,c){return o(f,c)?_(f,c):[f,c]}function g(f,c){if(!o(f,c))return[f,c];var y=_(f,c);return[f*2-y[0],c*2-y[1]]}function _(f,c){var y=T(f-105,c-35),O=b(f-105,c-35),C=c/180*e,E=Math.sin(C);E=1-n*E*E;var P=Math.sqrt(E);y=y*180/(i*(1-n)/(E*P)*e),O=O*180/(i/P*Math.cos(C)*e);var B=c+y,G=f+O;return[G,B]}function T(f,c){var y=-100+2*f+3*c+.2*c*c+.1*f*c+.2*Math.sqrt(Math.abs(f));return y+=(20*Math.sin(6*f*e)+20*Math.sin(2*f*e))*2/3,y+=(20*Math.sin(c*e)+40*Math.sin(c/3*e))*2/3,y+=(160*Math.sin(c/12*e)+320*Math.sin(c*e/30))*2/3,y}function b(f,c){var y=300+f+2*c+.1*f*f+.1*f*c+.1*Math.sqrt(Math.abs(f));return y+=(20*Math.sin(6*f*e)+20*Math.sin(2*f*e))*2/3,y+=(20*Math.sin(f*e)+40*Math.sin(f/3*e))*2/3,y+=(150*Math.sin(f/12*e)+300*Math.sin(f/30*e))*2/3,y}return{bd09togcj02:h,gcj02tobd09:u,wgs84togcj02:p,gcj02towgs84:g,bd09ToGcj02:h,gcj02ToBd09:u,wgs84ToGcj02:p,gcj02ToWgs84:g,bd09ToWgs84:function(f,c){if(!o(f,c))return[f,c];var y=h(f,c);return g(y[0],y[1])},wgs84ToBd09:function(f,c){if(!o(f,c))return[f,c];var y=p(f,c);return u(y[0],y[1])}}})})(Jt);var fr=Jt.exports;const ae=ze(fr);a.Arrays=void 0,(r=>{function t(d,o){return d.length===o.length&&d.every((h,u)=>h===o[u])}r.equals=t;function e(d,o){const h=d.indexOf(o);if(h!==-1)return d.splice(h,1)[0]}r.remove=e;function i(d,o){for(const h of d)if(h instanceof o)return h}r.findByType=i;function n(d,o){return d.includes(o)}r.includesTyped=n;function s(d,o,h){const u=o>=0?o:d.length+o;if(h===void 0)return d[u];d[u]=h}r.at=s;function l(d){return d.length>0}r.isNotEmpty=l})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(r=>{function t(n,s){const l=n.getLength();for(let d=0;d<l;d++)if(n.getAt(d)===s)return d;return-1}r.indexOf=t;function e(n,s){const l=t(n,s);if(l!==-1)return n.removeAt(l)}r.remove=e;function i(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}r.listenChanged=i})(a.MVCArrays||(a.MVCArrays={}));function ne(r,t){if(!r)throw new Error(`AssertionError: ${t}`)}function Ge(r){throw new Error(`Unexpected object: ${r}`)}function yr(){}function Ne(r){return r}function vr(r,t){return r instanceof t}function _r(r,t){if(r instanceof t)return r}function Ze(r,t){return(r==null?void 0:r.$options.name)===t.name}function St(r,t){return Ze(r,t)?r:void 0}function We(r,t,e){let i=t;for(;i;){if(Ze(i,r))return i;if(e&&Ze(i,e))return;i=i.$parent}}function br(r){return r}function I(r){throw new Error(r)}function He(r){throw new Error(`Unsupported: ${r}`)}function Mr(r){throw new Error(`todo: ${r}`)}function Tr(r){return r}function le(...r){}function Cr(r){return r!=null}function Qt(r){return r[1]!=null}function ei(r){let t=null;return()=>t??(t=r().catch(e=>(t=null,Promise.reject(e))))}var R=(r=>(r.wgs84="wgs84",r.gcj02="gcj02",r.bd09="bd09",r))(R||{});const kt="wgs84",z=class z{constructor(t,e,i){this.lat=t,this.lng=e,this.coord=i}static _normalize(t,e){const i=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,i]}static fromBaidu(t,e){return new z(t.lat,t.lng,e)}static fromGoogle(t,e){return new z(t.lat(),t.lng(),e)}static fromHere(t,e){return new z(t.lat,t.lng,e)}static fromLiteral(t){return new z(t.lat,t.lng,t.coord||kt)}static fromLngLat(t,e,i=kt){return new z(e,t,i)}static create(t,e,i=kt){return new z(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new z(n,i,e)}toBaidu(t,e=!1){let i=this.lat,n=this.lng;return this.coord!==t&&([n,i]=this._convert(t)),e&&([n,i]=z._normalize(n,i)),new BMap.Point(n,i)}toGoogle(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new google.maps.LatLng(e,i)}toHere(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new H.geo.Point(e,i)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=z._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new z(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)}};m(z,"ZERO",z.create(0,0));let w=z;const re=class re{constructor(t,e){m(this,"coord");this.sw=t,this.ne=e,ne(t.coord===e.coord,"sw和ne的coord应该相同"),ne(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),ne(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,i){return t<=e?t<=i&&i<=e:t<=i||i<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let i=1;i<t.length;i++)e.include(t[i]);return e.build()}static from(...t){return this.fromArray(t)??I("positions中没有点")}static fromGoogle(t,e){return new re(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(w.fromBaidu(t.getSouthWest(),e),w.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:i}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,i)}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 w.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,w.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,w.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)]}};m(re,"EMPTY",new re(w.ZERO,w.ZERO));let V=re;(r=>{class t{constructor(i){m(this,"coord");m(this,"minLat");m(this,"minLng");m(this,"maxLat");m(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new r(w.create(this.minLat,this.minLng,this.coord),w.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:n,lng:s}=i.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),r.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(i,n){return(i-n+360)%360}}r.Builder=t})(V||(V={})),a.Location=void 0,(r=>{function t(i,n){if(i==null)return;if(typeof i=="string")return i;const s=i.to(n);return`${s.lat},${s.lng}`}r.toString=t;function e(i){return typeof i=="string"||i==null?void 0:i.coord}r.getCoordType=e})(a.Location||(a.Location={}));var xt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(xt||(xt={}));function ti(r,t,e){return r.addListener(t,e).remove}function Or(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}function wr(r,t,e,i){return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function ii(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}class ri{constructor(t,e){m(this,"eventMap",new Map);m(this,"target",void 0);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 Ve{constructor(t,e){m(this,"eventHub",new ni);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(a.Arrays.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(a.Arrays.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 Lt=class Lt extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=this.inner.addListener(Lt.EVENT_TYPE_MAP[t]||t,s=>{const l={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=w.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,l)});this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(n.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};m(Lt,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let he=Lt;const ke=class ke extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=s=>{const l={type:t,target:this.target,originalEvent:s};s.point&&(l.position=w.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,l)};this.inner.addEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(this.inner.removeEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};m(ke,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let _e=ke;class ni{constructor(){m(this,"typeMap",new Map)}addEventListener(t,e){let i=this.typeMap.get(t);i||(i=[],this.typeMap.set(t,i)),!i.includes(e)&&i.push(e)}removeEventListener(t,e){const i=this.typeMap.get(t);i&&a.Arrays.remove(i,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(i=>i.call(t.target,t))}}class At{constructor(t,e){m(this,"keyToValue",new Map);m(this,"valueToKey",new Map);ne(t.length===e.length);for(let i=t.length-1;i>=0;i--)this.keyToValue.set(t[i],e[i]),this.valueToKey.set(e[i],t[i])}toKey(t){return this.valueToKey.get(t)??I()}toValue(t){return this.keyToValue.get(t)??I()}}class si{constructor(t,e=10){m(this,"map",new Map);this.values=t,this.maxSize4Debug=e}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let i=this.values.length-1;i>=0;i--){const n=this.values[i];e.set(t.call(n),n)}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}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 ce{constructor(t){m(this,"value");this.creator=t}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(r=>(r.TOP_LEFT="top-left",r.TOP_CENTER="top-center",r.TOP_RIGHT="top-right",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_CENTER="bottom-center",r.BOTTOM_RIGHT="bottom-right",r.LEFT_TOP="left-top",r.LEFT_CENTER="left-center",r.LEFT_BOTTOM="left-bottom",r.RIGHT_TOP="right-top",r.RIGHT_CENTER="right-center",r.RIGHT_BOTTOM="right-bottom",r))(k||{});a.ControlPositionConverter=void 0,(r=>{let t,e;const i=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return t||(t=new At(i,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),t}r.getBaidu=n;function s(){return e||(e=new At(i,[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}r.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class oi{constructor(t){m(this,"inner");this.position=t}}class je{}class ai extends je{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 Fe extends je{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??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class be extends je{constructor(e,i){super();m(this,"visible",!1);m(this,"map");this._type=e,this.position=i}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:a.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var Rt=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))(Rt||{});class Z{constructor(t,e,i,n){this.id=t,this.baidu=e,this.google=i,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){He("google的内置地图没有对应的实例")}}class Er{constructor(t,e){m(this,"baiduLayerCached",new ce(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,i)=>{const n=Math.pow(2,i-1),s=e.x+n,l=n-1-e.y;return this.options.getTileUrl({x:s,y:l},i)},t}));m(this,"baiduMapTypeCached",new ce(()=>{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}));m(this,"googleCached",new ce(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,i)=>this.options.getTileUrl(e,i),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}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(){He("这个方法不会被调用")}}class li{constructor(){m(this,"baiduCache",new ce(()=>new BMap.TrafficLayer));m(this,"googleCache",new ce(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}a.MapType=void 0,(r=>{r.NORMAL=new Z("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new Z("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new Z("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new Z("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),r.BUILD_IN_MAP_TYPES=new si([r.NORMAL,r.SATELLITE,r.HYBRID,r.TERRAIN])})(a.MapType||(a.MapType={}));var Dt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(Dt||{});const hi=[a.MapType.NORMAL,a.MapType.SATELLITE,a.MapType.HYBRID];class Ue extends Fe{static create(t){const e=t.mapTypes??hi,i={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&i[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t.position)),new Ue(n,t.position)}}const oe=class oe extends be{constructor(t="default",e=k.TOP_LEFT,i=hi){super("mapType",e),this.type=t,this.mapTypes=i,oe.type2google||(oe.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new oe(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=oe.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof Z?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof Z||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};m(oe,"type2google");let Ye=oe;class qe extends Fe{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new qe(e,t.position)}}class Ke extends be{static create(t){return new Ke(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class Xe extends ai{static create(t){return new Xe(!0,t.position??k.RIGHT_BOTTOM)}}class Je extends be{static create(t){return new Je(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class Qe extends Fe{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Qe(e,t.position)}}class et extends be{static create(t){return new et(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}function Pr(r){let t,e,i;const n="The Google Maps JavaScript API",s="google",l="importLibrary",d="__ib__",o=document,h=window,u=h[s]||(h[s]={}),p=u.maps||(u.maps={}),g=new Set,_=new URLSearchParams,T=()=>t||(t=new Promise(async(b,f)=>{var c;await(e=o.createElement("script")),_.set("libraries",[...g]+"");for(i in r)_.set(i.replace(/[A-Z]/g,y=>"_"+y[0].toLowerCase()),r[i]);_.set("callback",s+".maps."+d),e.src=`https://maps.${s}apis.com/maps/api/js?`+_,p[d]=b,e.onerror=()=>t=f(Error(n+" could not load.")),e.nonce=((c=o.querySelector("script[nonce]"))==null?void 0:c.nonce)||"",o.head.append(e)}));p[l]?console.warn(n+" only loads once. Ignoring:",r):p[l]=(b,...f)=>g.add(b)&&T().then(()=>p[l](b,...f))}let Lr,Br;const ie={get LATLNG_ZERO(){return Lr??(Lr=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return Br??(Br=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function ci(r,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of r)for(const i of e.types)switch(i){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 di(r,t){var i;const e=r.address_components&&ci(r.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:r.place_id??"",address:r.formatted_address??"",position:w.fromGoogle(((i=r.geometry)==null?void 0:i.location)??ie.LATLNG_ZERO,t.coordType),title:r.name??""}}class $t{}class ui extends $t{constructor(e,i){super();m(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return ti(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),n={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&ci(i.address_components,n),e(n)})}}class pi extends $t{constructor(e,i){super();m(this,"inner");m(this,"input");m(this,"removeableArray",[]);if(this.map=e,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?e.innerMap:void 0}),i.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(ii(this.map,"center-changed",n)),this.removeableArray.push(ii(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let i=0;const n=Or(this.inner,"confirm",l=>{const d=l.item.value;i=Date.now(),e(Object.assign({title:d.business,country:""},d))}),s=wr(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-i>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var gi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},l=function(){var _=function(f){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=f.xField||f.defaultXField,this._yField=f.yField||f.defaultYField,this._valueField=f.valueField||f.defaultValueField,f.radius&&(this._cfgRadius=f.radius)},T=s.defaultRadius;return _.prototype={_organiseData:function(b,f){var c=b[this._xField],y=b[this._yField],O=this._radi,C=this._data,E=this._max,P=this._min,B=b[this._valueField]||1,G=b.radius||this._cfgRadius||T;return C[c]||(C[c]=[],O[c]=[]),C[c][y]?C[c][y]+=B:(C[c][y]=B,O[c][y]=G),C[c][y]>E?(f?this.setDataMax(C[c][y]):this._max=C[c][y],!1):{x:c,y,value:B,radius:G,min:P,max:E}},_unOrganizeData:function(){var b=[],f=this._data,c=this._radi;for(var y in f)for(var O in f[y])b.push({x:y,y:O,radius:c[y][O],value:f[y][O]});return{min:this._min,max:this._max,data:b}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var b=arguments[0],f=b.length;f--;)this.addData.call(this,b[f]);else{var c=this._organiseData(arguments[0],!0);c&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[c]})}return this},setData:function(b){var f=b.data,c=f.length;this._data=[],this._radi=[];for(var y=0;y<c;y++)this._organiseData(f[y],!1);return this._max=b.max,this._min=b.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(b){return this._max=b,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(b){return this._min=b,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(b){this._coordinator=b},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},_}(),d=function(){var _=function(c){var y=c.gradient||c.defaultGradient,O=document.createElement("canvas"),C=O.getContext("2d");O.width=256,O.height=1;var E=C.createLinearGradient(0,0,256,1);for(var P in y)E.addColorStop(P,y[P]);return C.fillStyle=E,C.fillRect(0,0,256,1),C.getImageData(0,0,256,1).data},T=function(c,y){var O=document.createElement("canvas"),C=O.getContext("2d"),E=c,P=c;if(O.width=O.height=c*2,y==1)C.beginPath(),C.arc(E,P,c,0,2*Math.PI,!1),C.fillStyle="rgba(0,0,0,1)",C.fill();else{var B=C.createRadialGradient(E,P,c*y,E,P,c);B.addColorStop(0,"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),C.fillStyle=B,C.fillRect(0,0,2*c,2*c)}return O},b=function(P){for(var y=[],O=P.min,C=P.max,E=P.radi,P=P.data,B=Object.keys(P),G=B.length;G--;)for(var Y=B[G],S=Object.keys(P[Y]),ee=S.length;ee--;){var A=S[ee],q=P[Y][A],te=E[Y][A];y.push({x:Y,y:A,value:q,radius:te})}return{min:O,max:C,data:y}};function f(c){var y=c.element,O=this.shadowCanvas=document.createElement("canvas"),C=this.canvas=c.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var E=getComputedStyle(c.element)||{};C.className="heatmap-canvas",this._width=C.width=O.width=+E.width.replace(/px/,""),this._height=C.height=O.height=+E.height.replace(/px/,""),this.shadowCtx=O.getContext("2d"),this.ctx=C.getContext("2d"),C.style.cssText=O.style.cssText="position:absolute;left:0;top:0;",y.style.position="relative",y.appendChild(C),this._palette=_(c),this._templates={},this._setStyles(c)}return f.prototype={renderPartial:function(c){this._drawAlpha(c),this._colorize()},renderAll:function(c){this._clear(),this._drawAlpha(b(c)),this._colorize()},_updateGradient:function(c){this._palette=_(c)},updateConfig:function(c,y){c.gradient!==y.gradient&&this._updateGradient(c),this._setStyles(c)},setDimensions:function(c,y){this._width=c,this._height=y,this.canvas.width=this.shadowCanvas.width=c,this.canvas.height=this.shadowCanvas.height=y},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(c){this._blur=c.blur==0?0:c.blur||c.defaultBlur,c.backgroundColor&&(this.canvas.style.backgroundColor=c.backgroundColor),this._opacity=(c.opacity||0)*255,this._maxOpacity=(c.maxOpacity||c.defaultMaxOpacity)*255,this._minOpacity=(c.minOpacity||c.defaultMinOpacity)*255,this._useGradientOpacity=!!c.useGradientOpacity},_drawAlpha:function(C){for(var y=this._min=C.min,O=this._max=C.max,C=C.data||[],E=C.length,P=1-this._blur;E--;){var B=C[E],G=B.x,Y=B.y,S=B.radius,ee=Math.min(B.value,O),A=G-S,q=Y-S,te=this.shadowCtx,K;this._templates[S]?K=this._templates[S]:this._templates[S]=K=T(S,P),te.globalAlpha=(ee-y)/(O-y),te.drawImage(K,A,q),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),q<this._renderBoundaries[1]&&(this._renderBoundaries[1]=q),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),q+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=q+2*S)}},_colorize:function(){var c=this._renderBoundaries[0],y=this._renderBoundaries[1],O=this._renderBoundaries[2]-c,C=this._renderBoundaries[3]-y,E=this._width,P=this._height,B=this._opacity,G=this._maxOpacity,Y=this._minOpacity,S=this._useGradientOpacity;c<0&&(c=0),y<0&&(y=0),c+O>E&&(O=E-c),y+C>P&&(C=P-y);for(var ee=this.shadowCtx.getImageData(c,y,O,C),A=ee.data,q=A.length,te=this._palette,K=3;K<q;K+=4){var Bt=A[K],Re=Bt*4;if(Re){var De;B>0?De=B:Bt<G?Bt<Y?De=Y:De=Bt:De=G,A[K-3]=te[Re],A[K-2]=te[Re+1],A[K-1]=te[Re+2],A[K]=S?te[Re+3]:De}}this.ctx.putImageData(ee,c,y),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(c){var y,O=this.shadowCtx,C=O.getImageData(c.x,c.y,1,1),E=C.data[3],P=this._max,B=this._min;return y=Math.abs(P-B)*(E/255)>>0,y},getDataURL:function(){return this.canvas.toDataURL()}},f}(),o=function(){var _=!1;return s.defaultRenderer==="canvas2d"&&(_=d),_}(),h={merge:function(){for(var g={},_=arguments.length,T=0;T<_;T++){var b=arguments[T];for(var f in b)g[f]=b[f]}return g}},u=function(){var _=function(){function c(){this.cStore={}}return c.prototype={on:function(y,O,C){var E=this.cStore;E[y]||(E[y]=[]),E[y].push(function(P){return O.call(C,P)})},emit:function(y,O){var C=this.cStore;if(C[y])for(var E=C[y].length,P=0;P<E;P++){var B=C[y][P];B(O)}}},c}(),T=function(f){var c=f._renderer,y=f._coordinator,O=f._store;y.on("renderpartial",c.renderPartial,c),y.on("renderall",c.renderAll,c),y.on("extremachange",function(C){f._config.onExtremaChange&&f._config.onExtremaChange({min:C.min,max:C.max,gradient:f._config.gradient||f._config.defaultGradient})}),O.setCoordinator(y)};function b(){var f=this._config=h.merge(s,arguments[0]||{});if(this._coordinator=new _,f.plugin){var c=f.plugin;if(s.plugins[c]){var y=s.plugins[c];this._renderer=new y.renderer(f),this._store=new y.store(f)}else throw new Error("Plugin '"+c+"' not found. Maybe it was not registered.")}else this._renderer=new o(f),this._store=new l(f);T(this)}return b.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(f){const c=this._config;return this._config=h.merge(this._config,f),this._renderer.updateConfig(this._config,c),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(f){return this._store.getValueAt?this._store.getValueAt(f):this._renderer.getValueAt?this._renderer.getValueAt(f):null}},b}(),p={create:function(g){return new u(g)},register:function(g,_){s.plugins[g]=_}};return p}();var i=function(s){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(s){this._map=s;var l=document.createElement("div");if(l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border=0,l.style.width=this._map.getSize().width+"px",l.style.height=this._map.getSize().height+"px",this.conf.element=l,!n())return l;s.getPanes().mapPane.appendChild(l),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var d=this;return s.addEventListener("resize",function(o){var h=o.size;l.style.width=h.width+"px",l.style.height=h.height+"px",d.heatmap._renderer.setDimensions(h.width,h.height),d.draw()}),this._div=l,l},i.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var l=this._map.pointToOverlayPixel(s.getNorthEast()),d=this._map.pointToOverlayPixel(s.getSouthWest()),o=l.y,h=d.x,u=d.y-l.y,p=l.x-d.x;if(this.conf.element.style.left=h+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=p+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var g=this.latlngs.length;const c={max:this.heatmap._store.getData().max,data:[]};for(;g--;){var _=this.latlngs[g].latlng;if(s.containsPoint(_)){var T=this._map.pointToOverlayPixel(_),h=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,b=new BMap.Pixel(T.x-h,T.y-o),f=this.pixelTransform(b);c.data.push({x:f.x,y:f.y,count:this.latlngs[g].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(c)}}}},i.prototype.pixelTransform=function(s){for(var l=this.heatmap.width,d=this.heatmap.height;s.x<0;)s.x+=l;for(;s.x>l;)s.x-=l;for(;s.y<0;)s.y+=d;for(;s.y>d;)s.y-=d;return s.x=s.x>>0,s.y=s.y>>0,s},i.prototype.setDataSet=function(s){if(this.data=s,!!n()){var l=this._map.getBounds(),d={max:s.max,data:[]},o=s.data,h=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));h--;){var u=new BMap.Point(o[h].lng,o[h].lat);if(this.latlngs.push({latlng:u,c:o[h].count}),!!l.containsPoint(u)){var p=this._map.pointToOverlayPixel(u),g=this._map.pointToOverlayPixel(l.getSouthWest()).x,_=this._map.pointToOverlayPixel(l.getNorthEast()).y,T=new BMap.Pixel(p.x-g,p.y-_),b=this.pixelTransform(T);d.data.push({x:b.x,y:b.y,count:o[h].count})}}this.heatmap.setData(d)}},i.prototype.addDataPoint=function(s,l,d){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:l,count:d});var o=new BMap.Point(s,l),h=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(h.x,h.y,d),this.latlngs.push({latlng:o,c:d})}},i.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(s){if(n()){for(var l in s)l=="radius"&&(this.heatmap._store._cfgRadius=s[l]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return i})})(gi);var Ir=gi.exports;const Sr=ze(Ir),mi=10,tt={toGoogle:(r,t)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient&&Object.entries(r.gradient).sort(([e],[i])=>+e-+i).map(([e,i])=>i),maxIntensity:r.maxIntensity,data:it.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient,data:it.toBaidu(r.data,t,e)})},it={toGoogle:(r,t)=>r.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(r,t,e)=>{let i=1;return{data:r.map(s=>{let l,d;return"weight"in s?(l=s.position.to(t),d=s.weight):(l=s.to(t),d=1),i<d&&(i=d),{lng:l.lng,lat:l.lat,count:d}}),max:e??i}}};class zt{}class fi extends zt{constructor(e,i){super();m(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(tt.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(it.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(tt.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class yi extends zt{constructor(e,i){super();m(this,"inner");this.map=e;const n=tt.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new Sr(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var i;((i=this.inner).data??(i.data={})).max=e}setData(e){this.inner.setDataSet(it.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=tt.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(i.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Gt{constructor(t){this.options=t}}function Me(r,t,e){const i=new URL(t,r),n=new URLSearchParams(Object.entries(e).filter(Qt));return i.search="?"+n.toString(),i}function Nt(){const r=window.location.hostname.split(".").filter(t=>!a.Strings.isInt(t));return r.length===3?r.join("."):[...r,"tg","map","urls"].slice(0,3).join(".")}const xe=class xe extends Gt{directions(t,e,i){return Me(xe.BASE_URL,"dir/",{api:"1",origin:a.Location.toString(t,R.gcj02),destination:a.Location.toString(e,R.gcj02),travelmode:i})}search(t){return Me(xe.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};m(xe,"BASE_URL","https://www.google.com/maps/");let rt=xe;const ve=class ve extends Gt{directions(t,e,i="driving"){const n=a.Location.getCoordType(e)??a.Location.getCoordType(t)??R.bd09,s=a.Location.toString(e,n);return Me(ve.BASE_URL,"direction",{origin:a.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:i,output:"html",region:"中国",src:Nt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,i){return Me(ve.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:i,output:"html",src:Nt()})}geocoderApi(t){return Me(ve.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:Nt()})}};m(ve,"BASE_URL","https://api.map.baidu.com/");let nt=ve,kr=class pr{constructor(t,e,i){this.extend(pr,google.maps.OverlayView),this.map_=t,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=i||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var l=s.map_.getZoom(),d=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);l=Math.min(Math.max(l,d),o),s.prevZoom_!=l&&(s.prevZoom_=l,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(i){for(var n in i.prototype)this.prototype[n]=i.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0,n;n=t[i];i++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var i=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:n,index:i}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let i=0,n;n=t[i];i++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let i in t)this.pushMarkerTo_(t[i]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i=0,n;n=this.markers_[i];i++)if(n==t){e=i;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var i=this.removeMarker_(t);return!e&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var i=t===this.getMarkers()?t.slice():t,n=!1,s=0,l;l=i[s];s++){var d=this.removeMarker_(l);n=n||d}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=e.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var d=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(l);return t.extend(d),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,i;i=this.clusters_[e];e++)i.remove();for(let e=0,i;i=this.markers_[e];e++)i.isAdded=!1,t&&i.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,i;i=t[e];e++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var i=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=i*d;return o}addToClosestCluster_(t){for(var e=4e4,i=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var d=this.distanceBetweenPoints_(l,t.getPosition());d<e&&(e=d,i=s)}}if(i&&i.isMarkerInClusterBounds(t))i.addMarker(t);else{var o=new xr(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),i=0,n;n=this.markers_[i];i++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},xr=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Zt(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,i;i=this.markers_[e];e++)if(i==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,i=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(i,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0,n;n=e[i];i++)t.extend(n.getPosition());return t}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var i=0,n;n=this.markers_[i];i++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,l=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(l),this.clusterIcon_.show()}};class Zt{constructor(t,e,i){t.getMarkerClusterer().extend(Zt,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var vi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){var e,i=e=i||{version:"1.3.8"},n={};i.guid="$BAIDU$",n[i.guid]=n[i.guid]||{},i.dom=i.dom||{},i.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},i.g=i.G=i.dom.g,i.dom.getDocument=function(o){return o=i.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},i.lang=i.lang||{},i.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(o){return i.lang.isString(o)?document.getElementById(o):o},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(o,h){o=i.dom._g(o);var u=i.dom.getDocument(o),p;return u.defaultView&&u.defaultView.getComputedStyle&&(p=u.defaultView.getComputedStyle(o,null),p)?p[h]||p.getPropertyValue(h):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,h,u){for(var p=0,g=i.dom._styleFilter,_;_=g[p];p++)(_=_[u])&&(h=_(o,h));return h},i.string=i.string||{},i.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(h){return h.charAt(1).toUpperCase()})},i.dom.getStyle=function(o,h){var u=i.dom;o=u.g(o),h=i.string.toCamelCase(h);var p=o.style[h]||(o.currentStyle?o.currentStyle[h]:"")||u.getComputedStyle(o,h);if(!p){var g=u._styleFixer[h];g&&(p=g.get?g.get(o):i.dom.getStyle(o,g))}return(g=u._styleFilter)&&(p=g.filter(h,p,"get")),p},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(o){o=i.dom.g(o);var h=i.dom.getDocument(o),u=i.browser,p=i.dom.getStyle;u.isGecko>0&&h.getBoxObjectFor&&p(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var g={left:0,top:0},_=u.ie&&!u.isStrict?h.body:h.documentElement,T,b;if(o==_)return g;if(o.getBoundingClientRect){b=o.getBoundingClientRect(),g.left=Math.floor(b.left)+Math.max(h.documentElement.scrollLeft,h.body.scrollLeft),g.top=Math.floor(b.top)+Math.max(h.documentElement.scrollTop,h.body.scrollTop),g.left-=h.documentElement.clientLeft,g.top-=h.documentElement.clientTop;var f=h.body,c=parseInt(p(f,"borderLeftWidth")),y=parseInt(p(f,"borderTopWidth"));u.ie&&!u.isStrict&&(g.left-=isNaN(c)?2:c,g.top-=isNaN(y)?2:y)}else{T=o;do{if(g.left+=T.offsetLeft,g.top+=T.offsetTop,u.isWebkit>0&&p(T,"position")=="fixed"){g.left+=h.body.scrollLeft,g.top+=h.body.scrollTop;break}T=T.offsetParent}while(T&&T!=o);for((u.opera>0||u.isWebkit>0&&p(o,"position")=="absolute")&&(g.top-=h.body.offsetTop),T=o.offsetParent;T&&T!=h.body;)g.left-=T.scrollLeft,(!u.opera||T.tagName!="TR")&&(g.top-=T.scrollTop),T=T.offsetParent}return g},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(o,h,u){h=h.replace(/^on/i,""),o=i.dom._g(o);var p=function(f){u.call(o,f)},g=i.event._listeners,_=i.event._eventFilter,T,b=h;return h=h.toLowerCase(),_&&_[h]&&(T=_[h](o,h,p),b=T.type,p=T.listener),o.addEventListener?o.addEventListener(b,p,!1):o.attachEvent&&o.attachEvent("on"+b,p),g[g.length]=[o,h,u,p,b],o},i.on=i.event.on,function(){var o=n[i.guid];i.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[i.guid]._instances=n[i.guid]._instances||{},i.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},i.lang.Class=function(o){this.guid=o||i.lang.guid(),n[i.guid]._instances[this.guid]=this},n[i.guid]._instances=n[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete n[i.guid]._instances[this.guid];for(var o in this)i.lang.isFunction(this[o])||delete this[o];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(o,h){this.type=o,this.returnValue=!0,this.target=h||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(o,h,u){if(i.lang.isFunction(h)){!this.__listeners&&(this.__listeners={});var p=this.__listeners,g;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;h.hashCode=u,g=u}o.indexOf("on")!=0&&(o="on"+o),typeof p[o]!="object"&&(p[o]={}),g=g||i.lang.guid(),h.hashCode=g,p[o][g]=h}},i.lang.Class.prototype.removeEventListener=function(o,h){if(!(typeof h<"u"&&(i.lang.isFunction(h)&&!(h=h.hashCode)||!i.lang.isString(h)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof h<"u")u[o][h]&&delete u[o][h];else for(var p in u[o])delete u[o][p]}},i.lang.Class.prototype.dispatchEvent=function(o,h){i.lang.isString(o)&&(o=new i.lang.Event(o)),!this.__listeners&&(this.__listeners={}),h=h||{};for(var u in h)o[u]=h[u];var u,p=this.__listeners,g=o.type;if(o.target=o.target||this,o.currentTarget=this,g.indexOf("on")!=0&&(g="on"+g),i.lang.isFunction(this[g])&&this[g].apply(this,arguments),typeof p[g]=="object")for(u in p[g])p[g][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,h,u){var p,g,_=o.prototype,T=new Function;T.prototype=h.prototype,g=o.prototype=new T;for(p in _)g[p]=_[p];o.prototype.constructor=o,o.superClass=h.prototype,typeof u=="string"&&(g._className=u)},i.inherits=i.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",d=function(o,h,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=h,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return d.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],h=0,u;u=o[h];h++)this._styles.push({url:s+h+"."+l,size:new BMap.Size(u,u)})},d.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},d.prototype.draw=function(){this._map&&this._updatePosition()},d.prototype.getText=function(){return this._text},d.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},d.prototype.getPosition=function(){return this._position},d.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},d.prototype.getStyleByText=function(o,h){var u=parseInt(o),p=parseInt(u/10);return p=Math.max(0,p),p=Math.min(p,h.length-1),h[p]},d.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},d.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},d.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,h=this._map.pointToOverlayPixel(this._position);h.x-=Math.ceil(parseInt(o.width)/2),h.y-=Math.ceil(parseInt(o.height)/2),o.left=h.x+"px",o.top=h.y+"px"}},d.prototype._buildCssText=function(o){var h=o.url,u=o.size,p=o.anchor,g=o.offset,_=o.textColor||"black",T=o.textSize||10,b=[];if(this._zIndex&&b.push("z-index:"+this._zIndex+";"),e.browser.ie<7)b.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+h+'");');else{b.push("background-image:url("+h+");");var f="0 0";g instanceof BMap.Size&&(f=g.width+"px "+g.height+"px"),b.push("background-position:"+f+";")}return u instanceof BMap.Size&&(p instanceof BMap.Size?(p.height>0&&p.height<u.height&&b.push("height:"+(u.height-p.height)+"px; padding-top:"+p.height+"px;"),p.width>0&&p.width<u.width&&b.push("width:"+(u.width-p.width)+"px; padding-left:"+p.width+"px;")):(b.push("height:"+u.height+"px; line-height:"+u.height+"px;"),b.push("width:"+u.width+"px; text-align:center;"))),b.push("cursor:pointer; color:"+_+"; position:absolute; font-size:"+T+"px; font-family:Arial,sans-serif; font-weight:bold"),b.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,h=this._map,u=e.lang.Event;function p(g,_){var T=g.srcElement||g.target,b=g.clientX||g.pageX,f=g.clientY||g.pageY;if(g&&_&&b&&f&&T){var c=e.dom.getPosition(h.getContainer());_.pixel=new BMap.Pixel(b-c.left,f-c.top),_.point=h.pixelToPoint(_.pixel)}return _}e.event.on(this._domElement,"mouseover",function(g){o.dispatchEvent(p(g,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(g){o.dispatchEvent(p(g,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(g){o.dispatchEvent(p(g,new u("onclick")))})},d})})(vi);var Ar=vi.exports;const _i=ze(Ar);var bi=function(r,t,e){t=Rr(t);var i=r.pointToPixel(t.getNorthEast()),n=r.pointToPixel(t.getSouthWest());i.x+=e,i.y-=e,n.x-=e,n.y+=e;var s=r.pixelToPoint(i),l=r.pixelToPoint(n);return new BMap.Bounds(l,s)},Rr=function(r){var t=st(r.getNorthEast().lng,-180,180),e=st(r.getSouthWest().lng,-180,180),i=st(r.getNorthEast().lat,-74,74),n=st(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},st=function(r,t,e){return t&&(r=Math.max(r,t)),e&&(r=Math.min(r,e)),r},Mi=function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ti=function(r,t){var e=-1;if(Mi(t)){if(t.indexOf)e=t.indexOf(r);else for(var i=0,n;n=t[i];i++)if(n===r){e=i;break}}return e},L=function(r,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(r){this._map=r,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var n=e.markers;Mi(n)&&this.addMarkers(n)}};L.prototype.addMarkers=function(r){if(r.length){for(var t=0,e=r.length;t<e;t++)this._pushMarkerTo(r[t]);this._createClusters()}},L.prototype._pushMarkerTo=function(r){var t=Ti(r,this._markers);t===-1&&(r.isInCluster=!1,this._markers.push(r))},L.prototype.addMarker=function(r){this._pushMarkerTo(r),this._createClusters()},L.prototype._createClusters=function(){var r=this._map.getBounds();if(r.getCenter()){for(var t=bi(this._map,r,this._gridSize),e=0,i;i=this._markers[e];e++)!i.isInCluster&&t.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}},L.prototype._addToClosestCluster=function(r){var t=4e6,e=null;r.getPosition();for(var i=0,n;n=this._clusters[i];i++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,r.getPosition());l<t&&(t=l,e=n)}}if(e&&e.isMarkerInClusterBounds(r))e.addMarker(r);else{var n=new j(this);n.addMarker(r),this._clusters.push(n)}},L.prototype._clearLastClusters=function(){for(var r=0,t;t=this._clusters[r];r++)t.remove();this._clusters=[],this._removeMarkersFromCluster()},L.prototype._removeMarkersFromCluster=function(){for(var r=0,t;t=this._markers[r];r++)t.isInCluster=!1},L.prototype._removeMarkersFromMap=function(){for(var r=0,t;t=this._markers[r];r++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}},L.prototype._removeMarker=function(r){var t=Ti(r,this._markers);return t===-1?!1:(this._map.removeOverlay(r),this._markers.splice(t,1),!0)},L.prototype.removeMarker=function(r){var t=this._removeMarker(r);return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.removeMarkers=function(r){for(var t=!1,e=0;e<r.length;e++){var i=this._removeMarker(r[e]);t=t||i}return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},L.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},L.prototype.getGridSize=function(){return this._gridSize},L.prototype.setGridSize=function(r){this._gridSize=r,this._redraw()},L.prototype.getMaxZoom=function(){return this._maxZoom},L.prototype.setMaxZoom=function(r){this._maxZoom=r,this._redraw()},L.prototype.getZIndex=function(){return this._zIndex},L.prototype.setZIndex=function(r){this._zIndex!=r&&(this.zIndex=r,this._redraw())},L.prototype.getStyles=function(){return this._styles},L.prototype.setStyles=function(r){this._styles=r,this._redraw()},L.prototype.getMinClusterSize=function(){return this._minClusterSize},L.prototype.setMinClusterSize=function(r){this._minClusterSize=r,this._redraw()},L.prototype.isAverageCenter=function(){return this._isAverageCenter},L.prototype.getMap=function(){return this._map},L.prototype.getMarkers=function(){return this._markers},L.prototype.getClustersCount=function(){for(var r=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&r++;return r},L.prototype._textCalculator=function(r){return r.length.toString()},L.prototype._stylesIndexCalculator=null,L.prototype.setTextCalculator=function(r){this._textCalculator=r},L.prototype.setStylesIndexCalculator=function(r){this._stylesIndexCalculator=r};function j(r){var t=this;this._markerClusterer=r,this._map=r.getMap(),this._minClusterSize=r.getMinClusterSize(),this._isAverageCenter=r.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new _i(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:r._zIndex}),this._clusterMarker.getStyleByText=function(e,i){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,i.length);return i[n]}return _i.prototype.getStyleByText.call(this,e,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}j.prototype.addMarker=function(r){if(this.isMarkerInCluster(r))return!1;if(!this._center)this._center=r.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+r.getPosition().lat)/t,i=(this._center.lng*(t-1)+r.getPosition().lng)/t;this._center=new BMap.Point(i,e),this.updateGridBounds()}return r.isInCluster=!0,this._markers.push(r),!0},j.prototype.render=function(){var r=this._markers.length;if(r<this._minClusterSize)for(var t=0;t<r;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},j.prototype.isMarkerInCluster=function(r){if(this._markers.indexOf)return this._markers.indexOf(r)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===r)return!0;return!1},j.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},j.prototype.isReal=function(r){return this._isReal},j.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=bi(this._map,r,this._markerClusterer.getGridSize())},j.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var r=0,t;t=this._markers[r];r++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},j.prototype.remove=function(){for(var r=0,t;t=this._markers[r];r++){var e=this._markers[r].getLabel();this._markers[r].getMap()&&this._map.removeOverlay(this._markers[r]),this._markers[r].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},j.prototype.getBounds=function(){for(var r=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)r.extend(e.getPosition());return r},j.prototype.getCenter=function(){return this._center};var ot;(r=>{function t(i){return{url:i.url,size:new BMap.Size(i.size.width,i.size.height),anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),offset:i.offset&&new BMap.Size(i.offset.x,i.offset.y),textColor:i.textColor,textSize:i.textSize}}r.toBaidu=t;function e(i){return{url:i.url,width:i.size.width,height:i.size.height,anchor:i.anchor&&[i.anchor.y,i.anchor.x],backgroundPosition:i.offset&&`${i.offset.x} ${i.offset.y}`,textColor:i.textColor,textSize:i.textSize}}r.toGoogle=e})(ot||(ot={}));class Wt{constructor(t){this.map=t}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Ci extends Wt{constructor(e,i){var s;super(e);m(this,"inner");this.inner=new L(e.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(l=>ot.toBaidu(l)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((l,d)=>n(l.length,d)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class Oi extends Wt{constructor(e,i){var s,l;super(e);m(this,"inner");this.inner=new kr(e.innerMap,(s=i.markers)==null?void 0:s.map(d=>d.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(l=i.styles)==null?void 0:l.map(d=>ot.toGoogle(d)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setCalculator((d,o)=>({text:d.length,index:n(d.length,o)+1}))}recreate(){this.inner.repaint()}}class Ht{constructor(){}}class wi extends Ht{constructor(e,i){super();m(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,i){return this.searchImpl(e,i instanceof w?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(e,i){return this.searchImpl(e,i.toGoogle(this.map.coordType))}searchNearBy(e,i,n){return this.searchImpl(e,{center:i.toGoogle(this.map.coordType),radius:n})}searchImpl(e,i){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(l,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(h=>di(h,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Ei extends Ht{constructor(e,i){super();m(this,"searchRequestMap",new Map);m(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,i){return this.newSearch(i instanceof w?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,i){return this.newSearch(void 0,n=>{n.searchInBounds(e,i.toBaidu(this.map.coordType))})}searchNearBy(e,i,n){return this.newSearch(void 0,s=>{s.searchNearby(e,i.toBaidu(this.map.coordType),n)})}newSearch(e,i){return new Promise((n,s)=>{const l=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&He("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const h=[];for(let u=0;u<d.getCurrentNumPois();u++){const p=d.getPoi(u);h.push({id:p.uid,city:p.city,country:"",position:w.fromBaidu(p.point,this.map.coordType),province:p.province,title:p.title,address:p.address})}n(h);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Vt{constructor(t,e){m(this,"onData");m(this,"onError");this.map=t,this.input=e}setSearchListener(t,e){return this.onData&&I("setSearchListener只能调用一次"),this.onData=t,this.onError=e,le}}class Pi extends Vt{constructor(e,i){super(e,i.input);m(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,i){return super.setSearchListener(e,i),ti(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>di(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Li extends Vt{constructor(e,i){super(e,i.input);m(this,"autocomplete");m(this,"placesService");this.autocomplete=e.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,i){return super.setSearchListener(e,i),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(e){this.placesService.search(e).then(this.onData,this.onError)}}var Bi=(r=>(r[r.WORLD=1]="WORLD",r[r.STATE=5]="STATE",r[r.CITY=10]="CITY",r[r.STREET=15]="STREET",r[r.BUILDING=20]="BUILDING",r))(Bi||{});class at{constructor(t){m(this,"latestInfoWindow");m(this,"delegate",void 0);this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Dr=function(t){return $r(t)&&!zr(t)};function $r(r){return!!r&&typeof r=="object"}function zr(r){var t=Object.prototype.toString.call(r);return t==="[object RegExp]"||t==="[object Date]"||Zr(r)}var Gr=typeof Symbol=="function"&&Symbol.for,Nr=Gr?Symbol.for("react.element"):60103;function Zr(r){return r.$$typeof===Nr}function Wr(r){return Array.isArray(r)?[]:{}}function Te(r,t){return t.clone!==!1&&t.isMergeableObject(r)?de(Wr(r),r,t):r}function Hr(r,t,e){return r.concat(t).map(function(i){return Te(i,e)})}function Vr(r,t){if(!t.customMerge)return de;var e=t.customMerge(r);return typeof e=="function"?e:de}function jr(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(t){return Object.propertyIsEnumerable.call(r,t)}):[]}function Ii(r){return Object.keys(r).concat(jr(r))}function Si(r,t){try{return t in r}catch{return!1}}function Fr(r,t){return Si(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))}function Ur(r,t,e){var i={};return e.isMergeableObject(r)&&Ii(r).forEach(function(n){i[n]=Te(r[n],e)}),Ii(t).forEach(function(n){Fr(r,n)||(Si(r,n)&&e.isMergeableObject(t[n])?i[n]=Vr(n,e)(r[n],t[n],e):i[n]=Te(t[n],e))}),i}function de(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Hr,e.isMergeableObject=e.isMergeableObject||Dr,e.cloneUnlessOtherwiseSpecified=Te;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Ur(r,t,e):Te(t,e)}de.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return de(i,n,e)},{})};var Yr=de,qr=Yr;const ki=ze(qr);/*!
3
3
  * isobject <https://github.com/jonschlinkert/isobject>
4
4
  *
5
5
  * Copyright (c) 2014-2017, Jon Schlinkert.