tg-map-vue3 3.7.11 → 3.7.12

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,4 +1,4 @@
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}.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}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;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)}})();
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}.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;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:0px;top:0px;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
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 Wn=Object.defineProperty;var Hn=(a,v,D)=>v in a?Wn(a,v,{enumerable:!0,configurable:!0,writable:!0,value:D}):a[v]=D;var p=(a,v,D)=>(Hn(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 Bt=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()})(Bt,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(g,c,y,O){this.west=Math.min(g,y),this.north=Math.max(c,O),this.east=Math.max(g,y),this.south=Math.min(c,O)}s.prototype.contain=function(g,c){return this.west<=g&&this.east>=g&&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(g,c){for(var y=0;y<l.length;y++)if(l[y].contain(g,c)){for(var O=0;O<d.length;O++)if(d[O].contain(g,c))return!1;return!0}return!1}function h(g,c){var y=g-.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(g,c){var y=Math.sqrt(g*g+c*c)+2e-5*Math.sin(c*t),O=Math.atan2(c,g)+3e-6*Math.cos(g*t),C=y*Math.cos(O)+.0065,E=y*Math.sin(O)+.006;return[C,E]}function f(g,c){return o(g,c)?_(g,c):[g,c]}function m(g,c){if(!o(g,c))return[g,c];var y=_(g,c);return[g*2-y[0],c*2-y[1]]}function _(g,c){var y=T(g-105,c-35),O=b(g-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,z=g+O;return[z,B]}function T(g,c){var y=-100+2*g+3*c+.2*c*c+.1*g*c+.2*Math.sqrt(Math.abs(g));return y+=(20*Math.sin(6*g*e)+20*Math.sin(2*g*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(g,c){var y=300+g+2*c+.1*g*g+.1*g*c+.1*Math.sqrt(Math.abs(g));return y+=(20*Math.sin(6*g*e)+20*Math.sin(2*g*e))*2/3,y+=(20*Math.sin(g*e)+40*Math.sin(g/3*e))*2/3,y+=(150*Math.sin(g/12*e)+300*Math.sin(g/30*e))*2/3,y}return{bd09togcj02:h,gcj02tobd09:u,wgs84togcj02:f,gcj02towgs84:m,bd09ToGcj02:h,gcj02ToBd09:u,wgs84ToGcj02:f,gcj02ToWgs84:m,bd09ToWgs84:function(g,c){if(!o(g,c))return[g,c];var y=h(g,c);return m(y[0],y[1])},wgs84ToBd09:function(g,c){if(!o(g,c))return[g,c];var y=f(g,c);return u(y[0],y[1])}}})})(Jt);var fr=Jt.exports;const ae=ze(fr);function re(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 It(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 St="wgs84",N=class{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 N(t.lat,t.lng,e)}static fromGoogle(t,e){return new N(t.lat(),t.lng(),e)}static fromHere(t,e){return new N(t.lat,t.lng,e)}static fromLiteral(t){return new N(t.lat,t.lng,t.coord||St)}static fromLngLat(t,e,i=St){return new N(e,t,i)}static create(t,e,i=St){return new N(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new N(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]=N._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]=N._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new N(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)}};let w=N;p(w,"ZERO",N.create(0,0));const oe=class{constructor(t,e){p(this,"coord");this.sw=t,this.ne=e,re(t.coord===e.coord,"sw和ne的coord应该相同"),re(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),re(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 oe.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 oe(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new oe(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&&oe.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)]}};let Z=oe;p(Z,"EMPTY",new oe(w.ZERO,w.ZERO)),(r=>{class t{constructor(i){p(this,"coord");p(this,"minLat");p(this,"minLng");p(this,"maxLat");p(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})(Z||(Z={})),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 kt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(kt||(kt={})),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 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){p(this,"eventMap",new Map);p(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){p(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 Xt=class 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(Xt.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)}};let ne=Xt;p(ne,"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"});const wt=class 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(wt.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(wt.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};let he=wt;p(he,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});class ni{constructor(){p(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 xt{constructor(t,e){p(this,"keyToValue",new Map);p(this,"valueToKey",new Map);re(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){p(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){p(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 xt(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 xt(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){p(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 _e extends je{constructor(e,i){super();p(this,"visible",!1);p(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 At=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))(At||{});class W{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){p(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}));p(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}));p(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(){p(this,"baiduCache",new ce(()=>new BMap.TrafficLayer));p(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 W("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new W("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new W("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new W("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 Rt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(Rt||{});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 ve=class extends _e{constructor(t="default",e=k.TOP_LEFT,i=hi){super("mapType",e),this.type=t,this.mapTypes=i,ve.type2google||(ve.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new ve(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=ve.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof W?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof W||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};let be=ve;p(be,"type2google");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 Ye extends _e{static create(t){return new Ye(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class Ke extends ai{static create(t){return new Ke(!0,t.position??k.RIGHT_BOTTOM)}}class Xe extends _e{static create(t){return new Xe(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class Je 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 Je(e,t.position)}}class Qe extends _e{static create(t){return new Qe(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]={}),f=u.maps||(u.maps={}),m=new Set,_=new URLSearchParams,T=()=>t||(t=new Promise(async(b,g)=>{var c;await(e=o.createElement("script")),_.set("libraries",[...m]+"");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?`+_,f[d]=b,e.onerror=()=>t=g(Error(n+" could not load.")),e.nonce=((c=o.querySelector("script[nonce]"))==null?void 0:c.nonce)||"",o.head.append(e)}));f[l]?console.warn(n+" only loads once. Ignoring:",r):f[l]=(b,...g)=>m.add(b)&&T().then(()=>f[l](b,...g))}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 Dt{}class ui extends Dt{constructor(e,i){super();p(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 Dt{constructor(e,i){super();p(this,"inner");p(this,"input");p(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()})(Bt,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(g){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=g.xField||g.defaultXField,this._yField=g.yField||g.defaultYField,this._valueField=g.valueField||g.defaultValueField,g.radius&&(this._cfgRadius=g.radius)},T=s.defaultRadius;return _.prototype={_organiseData:function(b,g){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,z=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]=z),C[c][y]>E?(g?this.setDataMax(C[c][y]):this._max=C[c][y],!1):{x:c,y,value:B,radius:z,min:P,max:E}},_unOrganizeData:function(){var b=[],g=this._data,c=this._radi;for(var y in g)for(var O in g[y])b.push({x:y,y:O,radius:c[y][O],value:g[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],g=b.length;g--;)this.addData.call(this,b[g]);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 g=b.data,c=g.length;this._data=[],this._radi=[];for(var y=0;y<c;y++)this._organiseData(g[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),z=B.length;z--;)for(var q=B[z],S=Object.keys(P[q]),ee=S.length;ee--;){var A=S[ee],Y=P[q][A],te=E[q][A];y.push({x:q,y:A,value:Y,radius:te})}return{min:O,max:C,data:y}};function g(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 g.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],z=B.x,q=B.y,S=B.radius,ee=Math.min(B.value,O),A=z-S,Y=q-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,Y),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),Y<this._renderBoundaries[1]&&(this._renderBoundaries[1]=Y),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),Y+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=Y+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,z=this._maxOpacity,q=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,Y=A.length,te=this._palette,K=3;K<Y;K+=4){var Lt=A[K],Re=Lt*4;if(Re){var De;B>0?De=B:Lt<z?Lt<q?De=q:De=Lt:De=z,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()}},g}(),o=function(){var _=!1;return s.defaultRenderer==="canvas2d"&&(_=d),_}(),h={merge:function(){for(var m={},_=arguments.length,T=0;T<_;T++){var b=arguments[T];for(var g in b)m[g]=b[g]}return m}},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(g){var c=g._renderer,y=g._coordinator,O=g._store;y.on("renderpartial",c.renderPartial,c),y.on("renderall",c.renderAll,c),y.on("extremachange",function(C){g._config.onExtremaChange&&g._config.onExtremaChange({min:C.min,max:C.max,gradient:g._config.gradient||g._config.defaultGradient})}),O.setCoordinator(y)};function b(){var g=this._config=h.merge(s,arguments[0]||{});if(this._coordinator=new _,g.plugin){var c=g.plugin;if(s.plugins[c]){var y=s.plugins[c];this._renderer=new y.renderer(g),this._store=new y.store(g)}else throw new Error("Plugin '"+c+"' not found. Maybe it was not registered.")}else this._renderer=new o(g),this._store=new l(g);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(g){const c=this._config;return this._config=h.merge(this._config,g),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(g){return this._store.getValueAt?this._store.getValueAt(g):this._renderer.getValueAt?this._renderer.getValueAt(g):null}},b}(),f={create:function(m){return new u(m)},register:function(m,_){s.plugins[m]=_}};return f}();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,f=l.x-d.x;if(this.conf.element.style.left=h+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=f+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var m=this.latlngs.length;const c={max:this.heatmap._store.getData().max,data:[]};for(;m--;){var _=this.latlngs[m].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),g=this.pixelTransform(b);c.data.push({x:g.x,y:g.y,count:this.latlngs[m].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 f=this._map.pointToOverlayPixel(u),m=this._map.pointToOverlayPixel(l.getSouthWest()).x,_=this._map.pointToOverlayPixel(l.getNorthEast()).y,T=new BMap.Pixel(f.x-m,f.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,et={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:tt.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient,data:tt.toBaidu(r.data,t,e)})},tt={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 $t{}class fi extends $t{constructor(e,i){super();p(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(et.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(tt.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(et.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class yi extends $t{constructor(e,i){super();p(this,"inner");this.map=e;const n=et.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(tt.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=et.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 zt{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 Gt(){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 Et=class extends zt{directions(t,e,i){return Me(Et.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(Et.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};let Te=Et;p(Te,"BASE_URL","https://www.google.com/maps/");const Ae=class extends zt{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(Ae.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:Gt()})}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(Ae.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:Gt()})}geocoderApi(t){return Me(Ae.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:Gt()})}};let Ce=Ae;p(Ce,"BASE_URL","https://api.map.baidu.com/");let 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 Nt(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 Nt{constructor(t,e,i){t.getMarkerClusterer().extend(Nt,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()})(Bt,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),f;return u.defaultView&&u.defaultView.getComputedStyle&&(f=u.defaultView.getComputedStyle(o,null),f)?f[h]||f.getPropertyValue(h):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,h,u){for(var f=0,m=i.dom._styleFilter,_;_=m[f];f++)(_=_[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 f=o.style[h]||(o.currentStyle?o.currentStyle[h]:"")||u.getComputedStyle(o,h);if(!f){var m=u._styleFixer[h];m&&(f=m.get?m.get(o):i.dom.getStyle(o,m))}return(m=u._styleFilter)&&(f=m.filter(h,f,"get")),f},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,f=i.dom.getStyle;u.isGecko>0&&h.getBoxObjectFor&&f(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var m={left:0,top:0},_=u.ie&&!u.isStrict?h.body:h.documentElement,T,b;if(o==_)return m;if(o.getBoundingClientRect){b=o.getBoundingClientRect(),m.left=Math.floor(b.left)+Math.max(h.documentElement.scrollLeft,h.body.scrollLeft),m.top=Math.floor(b.top)+Math.max(h.documentElement.scrollTop,h.body.scrollTop),m.left-=h.documentElement.clientLeft,m.top-=h.documentElement.clientTop;var g=h.body,c=parseInt(f(g,"borderLeftWidth")),y=parseInt(f(g,"borderTopWidth"));u.ie&&!u.isStrict&&(m.left-=isNaN(c)?2:c,m.top-=isNaN(y)?2:y)}else{T=o;do{if(m.left+=T.offsetLeft,m.top+=T.offsetTop,u.isWebkit>0&&f(T,"position")=="fixed"){m.left+=h.body.scrollLeft,m.top+=h.body.scrollTop;break}T=T.offsetParent}while(T&&T!=o);for((u.opera>0||u.isWebkit>0&&f(o,"position")=="absolute")&&(m.top-=h.body.offsetTop),T=o.offsetParent;T&&T!=h.body;)m.left-=T.scrollLeft,(!u.opera||T.tagName!="TR")&&(m.top-=T.scrollTop),T=T.offsetParent}return m},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 f=function(g){u.call(o,g)},m=i.event._listeners,_=i.event._eventFilter,T,b=h;return h=h.toLowerCase(),_&&_[h]&&(T=_[h](o,h,f),b=T.type,f=T.listener),o.addEventListener?o.addEventListener(b,f,!1):o.attachEvent&&o.attachEvent("on"+b,f),m[m.length]=[o,h,u,f,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 f=this.__listeners,m;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;h.hashCode=u,m=u}o.indexOf("on")!=0&&(o="on"+o),typeof f[o]!="object"&&(f[o]={}),m=m||i.lang.guid(),h.hashCode=m,f[o][m]=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 f in u[o])delete u[o][f]}},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,f=this.__listeners,m=o.type;if(o.target=o.target||this,o.currentTarget=this,m.indexOf("on")!=0&&(m="on"+m),i.lang.isFunction(this[m])&&this[m].apply(this,arguments),typeof f[m]=="object")for(u in f[m])f[m][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,h,u){var f,m,_=o.prototype,T=new Function;T.prototype=h.prototype,m=o.prototype=new T;for(f in _)m[f]=_[f];o.prototype.constructor=o,o.superClass=h.prototype,typeof u=="string"&&(m._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),f=parseInt(u/10);return f=Math.max(0,f),f=Math.min(f,h.length-1),h[f]},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,f=o.anchor,m=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 g="0 0";m instanceof BMap.Size&&(g=m.width+"px "+m.height+"px"),b.push("background-position:"+g+";")}return u instanceof BMap.Size&&(f instanceof BMap.Size?(f.height>0&&f.height<u.height&&b.push("height:"+(u.height-f.height)+"px; padding-top:"+f.height+"px;"),f.width>0&&f.width<u.width&&b.push("width:"+(u.width-f.width)+"px; padding-left:"+f.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 f(m,_){var T=m.srcElement||m.target,b=m.clientX||m.pageX,g=m.clientY||m.pageY;if(m&&_&&b&&g&&T){var c=e.dom.getPosition(h.getContainer());_.pixel=new BMap.Pixel(b-c.left,g-c.top),_.point=h.pixelToPoint(_.pixel)}return _}e.event.on(this._domElement,"mouseover",function(m){o.dispatchEvent(f(m,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(m){o.dispatchEvent(f(m,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(m){o.dispatchEvent(f(m,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=it(r.getNorthEast().lng,-180,180),e=it(r.getSouthWest().lng,-180,180),i=it(r.getNorthEast().lat,-74,74),n=it(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},it=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 F(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 F(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())})}F.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},F.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()},F.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},F.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},F.prototype.isReal=function(r){return this._isReal},F.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=bi(this._map,r,this._markerClusterer.getGridSize())},F.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))},F.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},F.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},F.prototype.getCenter=function(){return this._center};var rt;(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})(rt||(rt={}));class Zt{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 Zt{constructor(e,i){var s;super(e);p(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=>rt.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 Zt{constructor(e,i){var s,l;super(e);p(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=>rt.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 Wt{constructor(){}}class wi extends Wt{constructor(e,i){super();p(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 Wt{constructor(e,i){super();p(this,"searchRequestMap",new Map);p(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 f=d.getPoi(u);h.push({id:f.uid,city:f.city,country:"",position:w.fromBaidu(f.point,this.map.coordType),province:f.province,title:f.title,address:f.address})}n(h);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Ht{constructor(t,e){p(this,"onData");p(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 Ht{constructor(e,i){super(e,i.input);p(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 Ht{constructor(e,i){super(e,i.input);p(this,"autocomplete");p(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 nt{constructor(t){p(this,"latestInfoWindow");p(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 Oe(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 Oe(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]=Oe(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]=Oe(t[n],e))}),i}function de(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Hr,e.isMergeableObject=e.isMergeableObject||Dr,e.cloneUnlessOtherwiseSpecified=Oe;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Ur(r,t,e):Oe(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 qr=de,Yr=qr;const ki=ze(Yr);/*!
3
3
  * isobject <https://github.com/jonschlinkert/isobject>
4
4
  *
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Copyright (c) 2014-2017, Jon Schlinkert.
11
11
  * Released under the MIT License.
12
- */function xi(r){return Kr(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}function Ai(r){var t,e;return!(xi(r)===!1||(t=r.constructor,typeof t!="function")||(e=t.prototype,xi(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}a.Objects=void 0,(r=>{function t(u,f){return u.reduce((m,_)=>(m[f(_)]=_,m),{})}r.fromArray=t;function e(u){return u.reduce((f,m)=>(f[m[0]]=m[1],f),{})}r.fromEntries=e;function i(u){return JSON.stringify(u,(f,m)=>typeof m=="object"&&Object.getPrototypeOf(m)!==Object.prototype?m.toString!==Object.prototype.toString?m.toString():`[object ${Object.getPrototypeOf(m).constructor.name}]`:m)}r.toJsonSafely=i;function n(u){Ai(u)&&Object.keys(u).forEach(f=>{u[f]===void 0?delete u[f]:n(u[f])})}r.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,f,m){let _=u[f];return _===void 0&&(_=m(),u[f]=_),_}r.putIfAbsent=s;function l(u,...f){const m=Ri(f),_={};for(const T in u)m(T)||(_[T]=u[T]);return _}r.omit=l;function d(u,...f){const m=Ri(f),_={};for(const T in u)m(T)&&(_[T]=u[T]);return _}r.pick=d;function o(u,f){const m=typeof f=="string"?f.split("."):f;let _=u;for(const T of m){if(_==null)return;_=_[T]}return _}r.get=o;function h(u,f){const m=typeof f=="string"?f.split("."):f,_=o(u,m.slice(0,-1)),T=m[m.length-1];_!=null&&delete _[T]}r.del=h})(a.Objects||(a.Objects={}));function Ri(r){if(r.length<=4)return r.includes.bind(r);{const t=new Set(r);return t.has.bind(t)}}a.Objects.toJsonSafely;const Di=["single","multi"];var X=(r=>(r.auto="auto",r.none="none",r.greedy="greedy",r.cooperative="cooperative",r))(X||{});a.MapOptions=void 0,(r=>{function t(e){a.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const i={center:w.ZERO,zoom:5};return ki(i,e||{},{isMergeableObject:Ai})}r.create=t})(a.MapOptions||(a.MapOptions={}));class Vt{constructor(t,e){p(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class st extends Vt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new ne(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class we extends Vt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new he(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Pt=class extends we{constructor(t,e,i,n){super(t,e,i),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Pt.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Pt.OPACITY_DELTA)}};let V=Pt;p(V,"OPACITY_DELTA",.001);class ot extends st{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class at extends V{constructor(){super(...arguments);p(this,"prevCenter");p(this,"prevRadius");p(this,"isDoingSetCenter",!1);p(this,"isDoingSetRadius",!1);p(this,"eventHubDelegate");p(this,"onRadiusChanged",()=>{var i;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=e)});p(this,"onCenterChanged",()=>{var i;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=e)});p(this,"resetEditableTimeoutId")}static create(e){const i=this.coordType,n=new BMap.Circle(e.center.toBaidu(i),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+V.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+V.OPACITY_DELTA:void 0}),s=new at(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return w.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class lt extends ot{static create(t){const e=this.coordType,i=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new lt(i,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return w.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}function $i(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}const zi={equals(r,t){return r.lat===t.lat&&r.lng===t.lng}};a.Point=void 0,(r=>{r.ZERO={x:0,y:0}})(a.Point||(a.Point={}));const Vn="";let jt;function Xr(r,t,e,i,n,s){return jt||(jt=Jr()),new jt(r,t,e,i,n,s)}function Jr(){$i();const r=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,n=r,s=a.Point.ZERO,l,d=654,o=""){super();p(this,"container");p(this,"border");p(this,"inner");p(this,"map");p(this,"marker");this.content=i,this.position=n,this.offset=s;const h="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=h,this.container.style.position="absolute",this.border=document.createElement("div"),this.border.className=`${h}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=h+"__inner";const u=document.createElement("img");u.className=h+"__close",u.src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%23000000%22%3E%0A%20%20%20%20%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%2F%3E%0A%20%20%20%20%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%0A%3C%2Fsvg%3E%0A",u.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(i),this.border.appendChild(this.inner),this.border.appendChild(u),this.container.appendChild(this.border),l&&this.setZIndex(l),this.setMaxWidth(d),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(i),s=n.x+this.offset.x,l=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${l}px`}open(i,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.container.style.zIndex=`${i}`}setMaxWidth(i){this.border.style.maxWidth=`${i}px`}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class ht{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class ct extends ht{constructor(t,e,i){super(new he(t,e)),this.inner=t,this.map=e,this.state=i}static create(t){const e=t.position||w.ZERO,i=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new ct(i,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||w.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&w.fromBaidu(t,this.map.coordType)||this.state.position||w.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class dt extends ht{constructor(e,i){super(new ne(e,i));p(this,"eventHub",new ni);p(this,"isOpened",!1);this.inner=e,this.map=i,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const i=e.position||w.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new dt(n,this)}isOpen(){return this.isOpened}addEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,i);return}super.removeEventListener(e,i)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class ut extends we{constructor(t,e,i){super(t,e,i),this.baiduMap=i}static create(t){var n;const e=this.coordType,i=Xr(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new ut(i,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class pt extends ht{constructor(t,e,i){super(new ne(t,i)),this.inner=t,this.coordType=e,this.map=i}static create(t){var s;const e=this.coordType,i=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&i.addListener("domready",()=>{var d;const l=(d=t.content.parentElement)==null?void 0:d.parentElement;l&&l.className.includes("gm-style-iw-c")&&!l.className.includes(n)&&(l.className+=` ${n}`)}),new pt(i,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),i=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,i)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}a.Strings=void 0,(r=>{function t(s,l){if(s!==void 0)return Object.values(l).includes(s)?s:void 0}r.toEnumOrNull=t;function e(s){return s.split(`
12
+ */function xi(r){return Kr(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}function Ai(r){var t,e;return!(xi(r)===!1||(t=r.constructor,typeof t!="function")||(e=t.prototype,xi(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}a.Objects=void 0,(r=>{function t(u,f){return u.reduce((m,_)=>(m[f(_)]=_,m),{})}r.fromArray=t;function e(u){return u.reduce((f,m)=>(f[m[0]]=m[1],f),{})}r.fromEntries=e;function i(u){return JSON.stringify(u,(f,m)=>typeof m=="object"&&Object.getPrototypeOf(m)!==Object.prototype?m.toString!==Object.prototype.toString?m.toString():`[object ${Object.getPrototypeOf(m).constructor.name}]`:m)}r.toJsonSafely=i;function n(u){Ai(u)&&Object.keys(u).forEach(f=>{u[f]===void 0?delete u[f]:n(u[f])})}r.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,f,m){let _=u[f];return _===void 0&&(_=m(),u[f]=_),_}r.putIfAbsent=s;function l(u,...f){const m=Ri(f),_={};for(const T in u)m(T)||(_[T]=u[T]);return _}r.omit=l;function d(u,...f){const m=Ri(f),_={};for(const T in u)m(T)&&(_[T]=u[T]);return _}r.pick=d;function o(u,f){const m=typeof f=="string"?f.split("."):f;let _=u;for(const T of m){if(_==null)return;_=_[T]}return _}r.get=o;function h(u,f){const m=typeof f=="string"?f.split("."):f,_=o(u,m.slice(0,-1)),T=m[m.length-1];_!=null&&delete _[T]}r.del=h})(a.Objects||(a.Objects={}));function Ri(r){if(r.length<=4)return r.includes.bind(r);{const t=new Set(r);return t.has.bind(t)}}a.Objects.toJsonSafely;const Di=["single","multi"];var X=(r=>(r.auto="auto",r.none="none",r.greedy="greedy",r.cooperative="cooperative",r))(X||{});a.MapOptions=void 0,(r=>{function t(e){a.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const i={center:w.ZERO,zoom:5};return ki(i,e||{},{isMergeableObject:Ai})}r.create=t})(a.MapOptions||(a.MapOptions={}));class Vt{constructor(t,e){p(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class st extends Vt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new ne(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class we extends Vt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new he(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Pt=class extends we{constructor(t,e,i,n){super(t,e,i),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Pt.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Pt.OPACITY_DELTA)}};let V=Pt;p(V,"OPACITY_DELTA",.001);class ot extends st{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class at extends V{constructor(){super(...arguments);p(this,"prevCenter");p(this,"prevRadius");p(this,"isDoingSetCenter",!1);p(this,"isDoingSetRadius",!1);p(this,"eventHubDelegate");p(this,"onRadiusChanged",()=>{var i;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=e)});p(this,"onCenterChanged",()=>{var i;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=e)});p(this,"resetEditableTimeoutId")}static create(e){const i=this.coordType,n=new BMap.Circle(e.center.toBaidu(i),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+V.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+V.OPACITY_DELTA:void 0}),s=new at(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return w.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class lt extends ot{static create(t){const e=this.coordType,i=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new lt(i,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return w.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}function $i(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}const zi={equals(r,t){return r.lat===t.lat&&r.lng===t.lng}};a.Point=void 0,(r=>{r.ZERO={x:0,y:0}})(a.Point||(a.Point={}));const Vn="";let jt;function Xr(r,t,e,i,n,s){return jt||(jt=Jr()),new jt(r,t,e,i,n,s)}function Jr(){$i();const r=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,n=r,s=a.Point.ZERO,l,d=654,o=""){super();p(this,"container");p(this,"border");p(this,"inner");p(this,"map");p(this,"marker");this.content=i,this.position=n,this.offset=s;const h="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=h,this.container.style.position="absolute",this.border=document.createElement("div"),this.border.className=`${h}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=h+"__inner";const u=document.createElement("span");u.className=h+"__close",u.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(i),this.border.appendChild(this.inner),this.border.appendChild(u),this.container.appendChild(this.border),l&&this.setZIndex(l),this.setMaxWidth(d),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(i),s=n.x+this.offset.x,l=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${l}px`}open(i,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.container.style.zIndex=`${i}`}setMaxWidth(i){this.border.style.maxWidth=`${i}px`}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class ht{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class ct extends ht{constructor(t,e,i){super(new he(t,e)),this.inner=t,this.map=e,this.state=i}static create(t){const e=t.position||w.ZERO,i=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new ct(i,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||w.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&w.fromBaidu(t,this.map.coordType)||this.state.position||w.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class dt extends ht{constructor(e,i){super(new ne(e,i));p(this,"eventHub",new ni);p(this,"isOpened",!1);this.inner=e,this.map=i,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const i=e.position||w.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new dt(n,this)}isOpen(){return this.isOpened}addEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,i);return}super.removeEventListener(e,i)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class ut extends we{constructor(t,e,i){super(t,e,i),this.baiduMap=i}static create(t){var n;const e=this.coordType,i=Xr(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new ut(i,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class pt extends ht{constructor(t,e,i){super(new ne(t,i)),this.inner=t,this.coordType=e,this.map=i}static create(t){var s;const e=this.coordType,i=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&i.addListener("domready",()=>{var d;const l=(d=t.content.parentElement)==null?void 0:d.parentElement;l&&l.className.includes("gm-style-iw-c")&&!l.className.includes(n)&&(l.className+=` ${n}`)}),new pt(i,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),i=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,i)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}a.Strings=void 0,(r=>{function t(s,l){if(s!==void 0)return Object.values(l).includes(s)?s:void 0}r.toEnumOrNull=t;function e(s){return s.split(`
13
13
  `).map(l=>l.trim()).join(`
14
14
  `)}r.trimIndent=e;function i(s){return s.replace(/([^A-Z]?)([A-Z])/g,(l,d,o)=>d?`${d}-${o.toLowerCase()}`:o.toLowerCase())}r.pascal2kebab=i;function n(s){return/^-?\d+$/.test(s)}r.isInt=n})(a.Strings||(a.Strings={}));const Gi={basename(r,t){const e=r.endsWith("/")?r.slice(0,-1):r,i=e.lastIndexOf("/"),n=i>=0?e.substring(i+1):e;return t&&n.endsWith(t)?n.slice(0,-t.length):n}},jn="";var ue=(r=>(r.map="map",r.overlay="overlay",r.overlayMouseTarget="overlayMouseTarget",r.float="float",r))(ue||{});a.MapPanes=void 0,(r=>{function t(i,n){switch(i){case"float":return n.floatPane;case"overlayMouseTarget":return n.overlayMouseTarget;case"overlay":return n.overlayLayer;case"map":return n.mapPane;default:Ge(i)}}r.toGoogle=t;function e(i,n){switch(i){case"float":return n.floatPane;case"overlayMouseTarget":return n.markerMouseTarget;case"overlay":return n.markerPane;case"map":return n.mapPane;default:Ge(i)}}r.toBaidu=e})(a.MapPanes||(a.MapPanes={}));class Ni{constructor(t,e){p(this,"baidu");p(this,"google");p(this,"projection");p(this,"element",void 0);p(this,"mapPane");this.map=t,this.mapPane=e.mapPane}create(){return this.element=this.onCreate(),this.element.className+=" element-overlay",this.element}draw(){this.projection&&this.onDraw(this.projection)}getProjection(){return this.projection}asBaidu(){if(!this.baidu){const t=this;$i();class e extends BMap.OverlayV3{initialize(s){var o;const l=t.create(),d=s.getPanes();return(o=a.MapPanes.toBaidu(t.mapPane,d))==null||o.appendChild(l),l}draw(){t.draw()}}this.baidu=new e;const i=t.map.innerMap;this.projection={fromLatLngToOverlayPoint(n){return i.pointToOverlayPixel(n.toBaidu(t.map.coordType))},fromOverlayPointToLatLng(n){return w.fromBaidu(i.overlayPixelToPoint(new BMap.Pixel(n.x,n.y)),t.map.coordType)}}}return this.baidu}asGoogle(){if(!this.google){const t=this;class e extends google.maps.OverlayView{onAdd(){const n=t.create(),s=this.getPanes()??I("onAdd回调中一定会有panes");a.MapPanes.toGoogle(t.mapPane,s).appendChild(n)}draw(){t.draw()}onRemove(){var n;(n=t.element.parentNode)==null||n.removeChild(t.element)}}this.google=new e,this.projection={fromLatLngToOverlayPoint(i){return t.google.getProjection().fromLatLngToDivPixel(i.toGoogle(t.map.coordType))??a.Point.ZERO},fromOverlayPointToLatLng(i){return w.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x,i.y))??ie.LATLNG_ZERO,t.map.coordType)}}}return this.google}}let Ft;function Qr(r,t,e,i,n){return Ft||(Ft=en()),new Ft(r,t,e,i,n)}function en(){return class extends google.maps.OverlayView{constructor(e,i,n,s=ue.overlayMouseTarget,l){super();p(this,"container");this.position=i,this.offset=n,this._mapPane=s,this.container=document.createElement("div"),this.container.className="label-container",this.container.style.position="absolute",l&&this.setZIndex(l),this.container.addEventListener("click",()=>{google.maps.event.trigger(this,"click")}),this.setElement(e)}setZIndex(e){this.container.style.zIndex=`${e}`}setElement(e){const i=this.container.firstChild;i!==e&&(i?this.container.replaceChild(i,e):this.container.appendChild(e))}onAdd(){const e=this.getPanes()??I("onAdd回调中一定能够获取panes");a.MapPanes.toGoogle(this._mapPane,e).appendChild(this.container)}draw(){var e,i;if(this.container.style.display=this.position?"block":"none",this.position){const n=this.getProjection();if(n){const s=n.fromLatLngToDivPixel(this.position);s&&(this.container.style.left=`${s.x+(((e=this.offset)==null?void 0:e.x)??0)}px`,this.container.style.top=`${s.y+(((i=this.offset)==null?void 0:i.y)??0)}px`)}}}onRemove(){var e;(e=this.container.parentNode)==null||e.removeChild(this.container)}setPosition(e){this.position=e,this.draw()}getPosition(){return this.position}setOffset(e){this.offset=e,this.draw()}getOffset(){return this.offset}getVisible(){return this.container.style.visibility!=="hidden"}setVisible(e){this.container.style.visibility=e?"visible":"hidden"}}}var pe;(r=>{function t(i){return typeof i=="string"?i:i.outerHTML}r.toString=t;function e(i){if(typeof i=="string"){const n=document.createElement("div");return n.innerHTML=i,n}return i}r.toElement=e})(pe||(pe={}));class Ut extends we{constructor(e,i,n,s){super(e,i,n);p(this,"icon");p(this,"iconAnchor");p(this,"content",void 0);p(this,"contentObserver");this.setContentInternal(s,!0)}static create(e){var l;const i=this.coordType,n=new BMap.Label(pe.toString(e.content),{position:(l=e.position)==null?void 0:l.toBaidu(i),offset:e.offset&&new BMap.Size(e.offset.x,e.offset.y)});e.zIndex&&n.setZIndex(e.zIndex),n.setStyle({border:"0px",padding:"0px",backgroundColor:"unset"});const s=new Ut(n,i,this,e.content);return n.__label__=s,s}setContentInternal(e,i=!1){this.content!==e&&(this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),typeof e!="string"&&(this.contentObserver=new MutationObserver(()=>{this.innerOverlay.setContent(e.outerHTML)}),this.contentObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),i||this.innerOverlay.setContent(pe.toString(e)),this.content=e)}setZIndex(e){this.innerOverlay.setZIndex(e)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toBaidu(this.coordType))}getOffset(){const e=this.innerOverlay.getOffset();let i=0,n=0;return this.iconAnchor&&(i=this.iconAnchor.width,n=this.iconAnchor.height),{x:e.width-i,y:e.height-n}}setOffset(e){let i=0,n=0;this.iconAnchor&&(i=this.iconAnchor.width,n=this.iconAnchor.height),this.innerOverlay.setOffset(new BMap.Size(e.x+i,e.y+n))}setContent(e){this.setContentInternal(e)}attachIcon(e){var d;let i;if(e instanceof BMap.Icon)i=e.anchor;else if(e)if(e.anchor)i=e.anchor;else{const o=((d=e.__icon__)==null?void 0:d.baiduLabelOffset)??{x:0,y:0};i={width:e.style.anchor.width+o.x,height:e.style.anchor.height+o.y},process.env.NODE_ENV!=="production"&&setTimeout(()=>{var f,m;if(re(e.__icon__,`${e}必须是由'SymbolIcon.toBaidu()'创建的`),!e.anchor){console.log("BaiduLabelOverlay.attachIcon","Bmap.Symbol.anchor尚未计算完成");return}const h=e.anchor.width-e.style.anchor.width,u=e.anchor.height-e.style.anchor.height;if(o.x!==h||o.y!==u){const _=[(f=e.__icon__.anchor)==null?void 0:f.x,(m=e.__icon__.anchor)==null?void 0:m.y,e.__icon__.rotation,e.__icon__.scale,e.__icon__.strokeWeight].map(T=>T??"").join(",");console.warn("BaiduLabelOverlay.attachIcon",e.__icon__,a.Strings.trimIndent(`
15
15
  为了保证Label的位置正确, 请将SymbolIcon(${_})中baiduLabelOffset的值改写成: