2 lines
44 KiB
JavaScript
2 lines
44 KiB
JavaScript
(self.webpackChunkgms_ui=self.webpackChunkgms_ui||[]).push([[986],{75550:function(ne){"use strict";ne.exports=H;function H(s,f){this.x=s,this.y=f}H.prototype={clone:function(){return new H(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,f){return this.clone()._rotateAround(s,f)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var f=s.x-this.x,A=s.y-this.y;return f*f+A*A},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,f){return Math.atan2(this.x*f-this.y*s,this.x*s+this.y*f)},_matMult:function(s){var f=s[0]*this.x+s[1]*this.y,A=s[2]*this.x+s[3]*this.y;return this.x=f,this.y=A,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var f=Math.cos(s),A=Math.sin(s),u=f*this.x-A*this.y,T=A*this.x+f*this.y;return this.x=u,this.y=T,this},_rotateAround:function(s,f){var A=Math.cos(s),u=Math.sin(s),T=f.x+A*(this.x-f.x)-u*(this.y-f.y),O=f.y+u*(this.x-f.x)+A*(this.y-f.y);return this.x=T,this.y=O,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},H.convert=function(s){return s instanceof H?s:Array.isArray(s)?new H(s[0],s[1]):s}},26729:function(ne){"use strict";var H=Object.prototype.hasOwnProperty,s="~";function f(){}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(s=!1));function A(L,y,v){this.fn=L,this.context=y,this.once=v||!1}function u(L,y,v,_,x){if(typeof v!="function")throw new TypeError("The listener must be a function");var k=new A(v,_||L,x),C=s?s+y:y;return L._events[C]?L._events[C].fn?L._events[C]=[L._events[C],k]:L._events[C].push(k):(L._events[C]=k,L._eventsCount++),L}function T(L,y){--L._eventsCount==0?L._events=new f:delete L._events[y]}function O(){this._events=new f,this._eventsCount=0}O.prototype.eventNames=function(){var y=[],v,_;if(this._eventsCount===0)return y;for(_ in v=this._events)H.call(v,_)&&y.push(s?_.slice(1):_);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(v)):y},O.prototype.listeners=function(y){var v=s?s+y:y,_=this._events[v];if(!_)return[];if(_.fn)return[_.fn];for(var x=0,k=_.length,C=new Array(k);x<k;x++)C[x]=_[x].fn;return C},O.prototype.listenerCount=function(y){var v=s?s+y:y,_=this._events[v];return _?_.fn?1:_.length:0},O.prototype.emit=function(y,v,_,x,k,C){var M=s?s+y:y;if(!this._events[M])return!1;var g=this._events[M],N=arguments.length,B,D;if(g.fn){switch(g.once&&this.removeListener(y,g.fn,void 0,!0),N){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,v),!0;case 3:return g.fn.call(g.context,v,_),!0;case 4:return g.fn.call(g.context,v,_,x),!0;case 5:return g.fn.call(g.context,v,_,x,k),!0;case 6:return g.fn.call(g.context,v,_,x,k,C),!0}for(D=1,B=new Array(N-1);D<N;D++)B[D-1]=arguments[D];g.fn.apply(g.context,B)}else{var ue=g.length,Z;for(D=0;D<ue;D++)switch(g[D].once&&this.removeListener(y,g[D].fn,void 0,!0),N){case 1:g[D].fn.call(g[D].context);break;case 2:g[D].fn.call(g[D].context,v);break;case 3:g[D].fn.call(g[D].context,v,_);break;case 4:g[D].fn.call(g[D].context,v,_,x);break;default:if(!B)for(Z=1,B=new Array(N-1);Z<N;Z++)B[Z-1]=arguments[Z];g[D].fn.apply(g[D].context,B)}}return!0},O.prototype.on=function(y,v,_){return u(this,y,v,_,!1)},O.prototype.once=function(y,v,_){return u(this,y,v,_,!0)},O.prototype.removeListener=function(y,v,_,x){var k=s?s+y:y;if(!this._events[k])return this;if(!v)return T(this,k),this;var C=this._events[k];if(C.fn)C.fn===v&&(!x||C.once)&&(!_||C.context===_)&&T(this,k);else{for(var M=0,g=[],N=C.length;M<N;M++)(C[M].fn!==v||x&&!C[M].once||_&&C[M].context!==_)&&g.push(C[M]);g.length?this._events[k]=g.length===1?g[0]:g:T(this,k)}return this},O.prototype.removeAllListeners=function(y){var v;return y?(v=s?s+y:y,this._events[v]&&T(this,v)):(this._events=new f,this._eventsCount=0),this},O.prototype.off=O.prototype.removeListener,O.prototype.addListener=O.prototype.on,O.prefixed=s,O.EventEmitter=O,ne.exports=O},98986:function(ne,H,s){"use strict";s.d(H,{ZP:function(){return Qe}});var f=s(67294),A=s(45697),u=s.n(A),T=s(73935),O=s(26729),L=s.n(O),y=function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var t,e,a;if(Array.isArray(n)){if(t=n.length,t!=o.length)return!1;for(e=t;e--!=0;)if(!r(n[e],o[e]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(a=Object.keys(n),t=a.length,t!==Object.keys(o).length)return!1;for(e=t;e--!=0;)if(!Object.prototype.hasOwnProperty.call(o,a[e]))return!1;for(e=t;e--!=0;){var i=a[e];if(!r(n[i],o[i]))return!1}return!0}return n!==n&&o!==o};const v="__googleMapsScriptId";var _;(function(r){r[r.INITIALIZED=0]="INITIALIZED",r[r.LOADING=1]="LOADING",r[r.SUCCESS=2]="SUCCESS",r[r.FAILURE=3]="FAILURE"})(_||(_={}));class x{constructor({apiKey:n,authReferrerPolicy:o,channel:t,client:e,id:a=v,language:i,libraries:c=[],mapIds:l,nonce:d,region:m,retries:h=3,url:S="https://maps.googleapis.com/maps/api/js",version:b}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=n,this.authReferrerPolicy=o,this.channel=t,this.client=e,this.id=a||v,this.language=i,this.libraries=c,this.mapIds=l,this.nonce=d,this.region=m,this.retries=h,this.url=S,this.version=b,x.instance){if(!y(this.options,x.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(x.instance.options)}`);return x.instance}x.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?_.FAILURE:this.done?_.SUCCESS:this.loading?_.LOADING:_.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let n=this.url;return n+=`?callback=${this.CALLBACK}`,this.apiKey&&(n+=`&key=${this.apiKey}`),this.channel&&(n+=`&channel=${this.channel}`),this.client&&(n+=`&client=${this.client}`),this.libraries.length>0&&(n+=`&libraries=${this.libraries.join(",")}`),this.language&&(n+=`&language=${this.language}`),this.region&&(n+=`®ion=${this.region}`),this.version&&(n+=`&v=${this.version}`),this.mapIds&&(n+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(n+=`&auth_referrer_policy=${this.authReferrerPolicy}`),n}deleteScript(){const n=document.getElementById(this.id);n&&n.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((n,o)=>{this.loadCallback(t=>{t?o(t.error):n(window.google)})})}loadCallback(n){this.callbacks.push(n),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const n=this.createUrl(),o=document.createElement("script");o.id=this.id,o.type="text/javascript",o.src=n,o.onerror=this.loadErrorCallback.bind(this),o.defer=!0,o.async=!0,this.nonce&&(o.nonce=this.nonce),document.head.appendChild(o)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(n){if(this.errors.push(n),this.errors.length<=this.retries){const o=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${o} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},o)}else this.onerrorEvent=n,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(n=>{n(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}var k=s(75550),C=s.n(k);function M(){return(M=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r}).apply(this,arguments)}function g(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n}function N(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var B={width:"100%",height:"100%",left:0,top:0,margin:0,padding:0,position:"absolute"},D=function(r){function n(){return r.apply(this,arguments)||this}g(n,r);var o=n.prototype;return o.shouldComponentUpdate=function(){return!1},o.render=function(){return f.createElement("div",{ref:this.props.registerChild,style:B})},n}(f.Component),ue=function(r){function n(t){var e;return(e=r.call(this)||this).gmapInstance=t,e}g(n,r);var o=n.prototype;return o.getChildren=function(){return this.gmapInstance.props.children},o.getMousePosition=function(){return this.gmapInstance.mouse_},o.getUpdateCounter=function(){return this.gmapInstance.updateCounter_},o.dispose=function(){this.gmapInstance=null,this.removeAllListeners()},n}(L()),Z=function(r,n){for(var o=M({},r),t=0;t<n.length;t++){var e=n[t];e in o&&delete o[e]}return o},je=Object.prototype.hasOwnProperty;function Le(r,n){return r===n?r!==0||n!==0||1/r==1/n:r!=r&&n!=n}function j(r,n){if(Le(r,n))return!0;if(typeof r!="object"||r===null||typeof n!="object"||n===null)return!1;var o=Object.keys(r),t=Object.keys(n);if(o.length!==t.length)return!1;for(var e=0;e<o.length;e++)if(!je.call(n,o[e])||!Le(r[o[e]],n[o[e]]))return!1;return!0}var Ze={width:"100%",height:"100%",left:0,top:0,margin:0,padding:0,position:"absolute"},Ue={width:0,height:0,left:0,top:0,backgroundColor:"transparent",position:"absolute"},oe=function(r){function n(t){var e;return(e=r.call(this,t)||this)._getState=function(){return{children:e.props.dispatcher.getChildren(),updateCounter:e.props.dispatcher.getUpdateCounter()}},e._onChangeHandler=function(){if(e.dimensionsCache_){var a=(e.state.children||[]).length,i=e._getState();e.setState(i,function(){return(i.children||[]).length!==a&&e._onMouseChangeHandler()})}},e._onChildClick=function(){e.props.onChildClick&&e.hoverChildProps_&&e.props.onChildClick(e.hoverKey_,e.hoverChildProps_)},e._onChildMouseDown=function(){e.props.onChildMouseDown&&e.hoverChildProps_&&e.props.onChildMouseDown(e.hoverKey_,e.hoverChildProps_)},e._onChildMouseEnter=function(a,i){e.dimensionsCache_&&(e.props.onChildMouseEnter&&e.props.onChildMouseEnter(a,i),e.hoverChildProps_=i,e.hoverKey_=a,e.setState({hoverKey:a}))},e._onChildMouseLeave=function(){if(e.dimensionsCache_){var a=e.hoverKey_;a!=null&&(e.props.onChildMouseLeave&&e.props.onChildMouseLeave(a,e.hoverChildProps_),e.hoverKey_=null,e.hoverChildProps_=null,e.setState({hoverKey:null}))}},e._onMouseAllow=function(a){a||e._onChildMouseLeave(),e.allowMouse_=a},e._onMouseChangeHandler=function(){e.allowMouse_&&e._onMouseChangeHandlerRaf()},e._onMouseChangeHandlerRaf=function(){if(e.dimensionsCache_){var a=e.props.dispatcher.getMousePosition();if(a){var i=[],c=e.props.getHoverDistance();if(f.Children.forEach(e.state.children,function(m,h){if(m&&(m.props.latLng!==void 0||m.props.lat!==void 0||m.props.lng!==void 0)){var S=m.key!=null?m.key:h,b=e.props.distanceToMouse(e.dimensionsCache_[S],a,m.props);b<c&&i.push({key:S,dist:b,props:m.props})}}),i.length){i.sort(function(m,h){return m.dist-h.dist});var l=i[0].key,d=i[0].props;e.hoverKey_!==l&&(e._onChildMouseLeave(),e._onChildMouseEnter(l,d))}else e._onChildMouseLeave()}else e._onChildMouseLeave()}},e._getDimensions=function(a){return e.dimensionsCache_[a]},e.dimensionsCache_={},e.hoverKey_=null,e.hoverChildProps_=null,e.allowMouse_=!0,e.state=M({},e._getState(),{hoverKey:null}),e}g(n,r);var o=n.prototype;return o.componentDidMount=function(){this.props.dispatcher.on("kON_CHANGE",this._onChangeHandler),this.props.dispatcher.on("kON_MOUSE_POSITION_CHANGE",this._onMouseChangeHandler),this.props.dispatcher.on("kON_CLICK",this._onChildClick),this.props.dispatcher.on("kON_MDOWN",this._onChildMouseDown)},o.shouldComponentUpdate=function(t,e){return this.props.experimental===!0?!j(this.props,t)||!j(Z(this.state,["hoverKey"]),Z(e,["hoverKey"])):!j(this.props,t)||!j(this.state,e)},o.componentWillUnmount=function(){this.props.dispatcher.removeListener("kON_CHANGE",this._onChangeHandler),this.props.dispatcher.removeListener("kON_MOUSE_POSITION_CHANGE",this._onMouseChangeHandler),this.props.dispatcher.removeListener("kON_CLICK",this._onChildClick),this.props.dispatcher.removeListener("kON_MDOWN",this._onChildMouseDown),this.dimensionsCache_=null},o.render=function(){var t=this,e=this.props.style||Ze;this.dimensionsCache_={};var a=f.Children.map(this.state.children,function(i,c){if(i){if(i.props.latLng===void 0&&i.props.lat===void 0&&i.props.lng===void 0)return f.cloneElement(i,{$geoService:t.props.geoService,$onMouseAllow:t._onMouseAllow,$prerender:t.props.prerender});var l=i.props.latLng!==void 0?i.props.latLng:{lat:i.props.lat,lng:i.props.lng},d=t.props.insideMapPanes?t.props.geoService.fromLatLngToDivPixel(l):t.props.geoService.fromLatLngToCenterPixel(l),m={left:d.x,top:d.y};if(i.props.seLatLng!==void 0||i.props.seLat!==void 0&&i.props.seLng!==void 0){var h=i.props.seLatLng!==void 0?i.props.seLatLng:{lat:i.props.seLat,lng:i.props.seLng},S=t.props.insideMapPanes?t.props.geoService.fromLatLngToDivPixel(h):t.props.geoService.fromLatLngToCenterPixel(h);m.width=S.x-d.x,m.height=S.y-d.y}var b=t.props.geoService.fromLatLngToContainerPixel(l),E=i.key!=null?i.key:c;return t.dimensionsCache_[E]=M({x:b.x,y:b.y},l),f.createElement("div",{key:E,style:M({},Ue,m),className:i.props.$markerHolderClassName},f.cloneElement(i,{$hover:E===t.state.hoverKey,$getDimensions:t._getDimensions,$dimensionKey:E,$geoService:t.props.geoService,$onMouseAllow:t._onMouseAllow,$prerender:t.props.prerender}))}});return f.createElement("div",{style:e},a)},n}(f.Component);oe.propTypes={geoService:u().any,style:u().any,distanceToMouse:u().func,dispatcher:u().any,onChildClick:u().func,onChildMouseDown:u().func,onChildMouseLeave:u().func,onChildMouseEnter:u().func,getHoverDistance:u().func,insideMapPanes:u().bool,prerender:u().bool},oe.defaultProps={insideMapPanes:!1,prerender:!1};var He={width:"50%",height:"50%",left:"50%",top:"50%",margin:0,padding:0,position:"absolute"};function Re(r){return f.createElement("div",{style:He},f.createElement(oe,M({},r,{prerender:!0})))}var he,q,pe,Be=new Promise(function(r){pe=r}),be=function(r,n){if(!r)return Be;if(q)return q;r.libraries||(r.libraries=[]);var o=[].concat(r.libraries);if(n&&(o.length!==0&&o.includes("visualization")||o.push("visualization"),console.warn("heatmapLibrary will be deprecated in the future. Please use { libraries: ['visualization'] } in bootstrapURLKeys property instead")),!1)var t;if(typeof window=="undefined")throw new Error("google map cannot be loaded outside browser env");var e=r.key,a=function(i,c){if(i==null)return{};var l,d,m={},h=Object.keys(i);for(d=0;d<h.length;d++)c.indexOf(l=h[d])>=0||(m[l]=i[l]);return m}(r,["key"]);return he||(he=new x(M({apiKey:e||""},a,{libraries:o}))),q=he.load().then(function(){return pe(window.google.maps),window.google.maps}),pe(q),q};function xe(r,n,o){var t=o-n;return r===o?r:((r-n)%t+t)%t+n}var W=function(){function r(n,o){if(isNaN(n)||isNaN(o))throw new Error("Invalid LatLng object: ("+n+", "+o+")");this.lat=+n,this.lng=+o}return r.prototype.wrap=function(){return new r(this.lat,xe(this.lng,-180,180))},r}();W.convert=function(r){return r instanceof W?r:Array.isArray(r)?new W(r[0],r[1]):"lng"in r&&"lat"in r?new W(r.lat,r.lng):r};var Ke=function(){function r(t,e,a){this.tileSize=t||512,this._minZoom=e||0,this._maxZoom=a||52,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new W(0,0),this.angle=0}var n,o=r.prototype;return o.zoomScale=function(t){return Math.pow(2,t)},o.scaleZoom=function(t){return Math.log(t)/Math.LN2},o.project=function(t,e){return new(C())(this.lngX(t.lng,e),this.latY(t.lat,e))},o.unproject=function(t,e){return new W(this.yLat(t.y,e),this.xLng(t.x,e))},o.lngX=function(t,e){return(180+t)*(e||this.worldSize)/360},o.latY=function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},o.xLng=function(t,e){return 360*t/(e||this.worldSize)-180},o.yLat=function(t,e){return 360/Math.PI*Math.atan(Math.exp((180-360*t/(e||this.worldSize))*Math.PI/180))-90},o.locationPoint=function(t){var e=this.project(t);return this.centerPoint._sub(this.point._sub(e)._rotate(this.angle))},o.pointLocation=function(t){var e=this.centerPoint._sub(t)._rotate(-this.angle);return this.unproject(this.point.sub(e))},(n=[{key:"minZoom",get:function(){return this._minZoom},set:function(t){this._minZoom=t,this.zoom=Math.max(this.zoom,t)}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(t){this._maxZoom=t,this.zoom=Math.min(this.zoom,t)}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerPoint",get:function(){return new(C())(0,0)}},{key:"size",get:function(){return new(C())(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(t){this.angle=-xe(t,-180,180)*Math.PI/180}},{key:"zoom",get:function(){return this._zoom},set:function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}},{key:"x",get:function(){return this.lngX(this.center.lng)}},{key:"y",get:function(){return this.latY(this.center.lat)}},{key:"point",get:function(){return new(C())(this.x,this.y)}}])&&function(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(r.prototype,n),r}(),We=function(){function r(o){this.hasSize_=!1,this.hasView_=!1,this.transform_=new Ke(o||512)}var n=r.prototype;return n.setView=function(o,t,e){this.transform_.center=W.convert(o),this.transform_.zoom=+t,this.transform_.bearing=+e,this.hasView_=!0},n.setViewSize=function(o,t){this.transform_.width=o,this.transform_.height=t,this.hasSize_=!0},n.setMapCanvasProjection=function(o,t){this.maps_=o,this.mapCanvasProjection_=t},n.canProject=function(){return this.hasSize_&&this.hasView_},n.hasSize=function(){return this.hasSize_},n.fromLatLngToCenterPixel=function(o){return this.transform_.locationPoint(W.convert(o))},n.fromLatLngToDivPixel=function(o){if(this.mapCanvasProjection_){var t=new this.maps_.LatLng(o.lat,o.lng);return this.mapCanvasProjection_.fromLatLngToDivPixel(t)}return this.fromLatLngToCenterPixel(o)},n.fromLatLngToContainerPixel=function(o){if(this.mapCanvasProjection_){var t=new this.maps_.LatLng(o.lat,o.lng);return this.mapCanvasProjection_.fromLatLngToContainerPixel(t)}var e=this.fromLatLngToCenterPixel(o);return e.x-=this.transform_.worldSize*Math.round(e.x/this.transform_.worldSize),e.x+=this.transform_.width/2,e.y+=this.transform_.height/2,e},n.fromContainerPixelToLatLng=function(o){if(this.mapCanvasProjection_){var t=this.mapCanvasProjection_.fromContainerPixelToLatLng(o);return{lat:t.lat(),lng:t.lng()}}var e=M({},o);e.x-=this.transform_.width/2,e.y-=this.transform_.height/2;var a=this.transform_.pointLocation(C().convert(e));return a.lng-=360*Math.round(a.lng/360),a},n.getWidth=function(){return this.transform_.width},n.getHeight=function(){return this.transform_.height},n.getZoom=function(){return this.transform_.zoom},n.getCenter=function(){return this.transform_.pointLocation({x:0,y:0})},n.getBounds=function(o,t){var e=o&&o[0]||0,a=o&&o[1]||0,i=o&&o[2]||0,c=o&&o[3]||0;if(this.getWidth()-a-c>0&&this.getHeight()-e-i>0){var l=this.transform_.pointLocation(C().convert({x:c-this.getWidth()/2,y:e-this.getHeight()/2})),d=this.transform_.pointLocation(C().convert({x:this.getWidth()/2-a,y:this.getHeight()/2-i})),m=[l.lat,l.lng,d.lat,d.lng,d.lat,l.lng,l.lat,d.lng];return t&&(m=m.map(function(h){return Math.round(h*t)/t})),m}return[0,0,0,0]},r}();function De(r){if(window.requestAnimationFrame)return window.requestAnimationFrame(r);var n=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return n?n(r):window.setTimeout(r,1e3/60)}var ce=Math.log2?Math.log2:function(r){return Math.log(r)/Math.LN2};function Oe(r,n){return Object.keys(r).reduce(function(o,t){return n(r[t])&&(o[t]=r[t]),o},{})}var G=function(r){if(r!==null&&typeof r=="object"){if(Object.keys(r).length===0)return!0}else if(r==null||r==="")return!0;return!1},Fe=Object.prototype.toString;function ie(r){return typeof r=="number"||function(n){return!!n&&typeof n=="object"}(r)&&Fe.call(r)==="[object Number]"}var re=null;function Se(){if(re)return re;if(typeof navigator!="undefined"){var r=navigator.userAgent.indexOf("MSIE")>-1,n=navigator.userAgent.indexOf("Firefox")>-1,o=navigator.userAgent.toLowerCase().indexOf("op")>-1,t=navigator.userAgent.indexOf("Chrome")>-1,e=navigator.userAgent.indexOf("Safari")>-1;return t&&e&&(e=!1),t&&o&&(t=!1),re={isExplorer:r,isFirefox:n,isOpera:o,isChrome:t,isSafari:e}}return re={isChrome:!0,isExplorer:!1,isFirefox:!1,isOpera:!1,isSafari:!1}}var ke=function(r){return Function.prototype.toString.call(r)};function Y(r){if(!r||typeof r!="object")return!1;var n=typeof r.constructor=="function"?Object.getPrototypeOf(r):Object.prototype;if(n===null)return!0;var o=n.constructor;return typeof o=="function"&&o instanceof o&&ke(o)===ke(Object)}function X(r,n,o,t){r.addEventListener(n,o,function(){var e=!1;try{var a=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",a,a),window.removeEventListener("test",a,a)}catch(i){e=!1}return e}()?{capture:t,passive:!0}:t)}var K,de=!(typeof window=="undefined"||!window.document||!window.document.createElement);K=de?window:typeof self!="undefined"?self:void 0;var Ee,fe=typeof document!="undefined"&&document.attachEvent,ze=!1;if(de&&!fe){var Ge=function(){var r=K.requestAnimationFrame||K.mozRequestAnimationFrame||K.webkitRequestAnimationFrame||function(n){return K.setTimeout(n,20)};return function(n){return r(n)}}(),$e=(Ee=K.cancelAnimationFrame||K.mozCancelAnimationFrame||K.webkitCancelAnimationFrame||K.clearTimeout,function(r){return Ee(r)}),ge=function(r){var n=r.__resizeTriggers__,o=n.firstElementChild,t=n.lastElementChild,e=o.firstElementChild;t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight,e.style.width=o.offsetWidth+1+"px",e.style.height=o.offsetHeight+1+"px",o.scrollLeft=o.scrollWidth,o.scrollTop=o.scrollHeight},Te=function(r){var n=this;ge(this),this.__resizeRAF__&&$e(this.__resizeRAF__),this.__resizeRAF__=Ge(function(){(function(o){return o.offsetWidth!=o.__resizeLast__.width||o.offsetHeight!=o.__resizeLast__.height})(n)&&(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(o){o.call(n,r)}))})},me=!1,_e="",ve="animationstart",ye="Webkit Moz O ms".split(" "),Ve="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");if(de){var Pe=document.createElement("fakeelement");if(Pe.style.animationName!==void 0&&(me=!0),me===!1){for(var J=0;J<ye.length;J++)if(Pe.style[ye[J]+"AnimationName"]!==void 0){_e="-"+ye[J].toLowerCase()+"-",ve=Ve[J],me=!0;break}}}var Me="resizeanim",qe="@"+_e+"keyframes "+Me+" { from { opacity: 0; } to { opacity: 0; } } ",Ye=_e+"animation: 1ms "+Me+"; "}var se=T.createPortal!==void 0,Ae=se?T.createPortal:T.unstable_renderSubtreeIntoContainer,ae=function(r){return Y(r)?r:{lat:r[0],lng:r[1]}},Ie=function(r,n){return n<r?r:n},le=function(r){function n(t){var e;if((e=r.call(this,t)||this)._getMinZoom=function(){if(e.geoService_.getWidth()>0||e.geoService_.getHeight()>0){var i=Math.ceil(e.geoService_.getWidth()/256)+2,c=Math.ceil(e.geoService_.getHeight()/256)+2,l=Math.max(i,c);return Math.ceil(ce(l))}return 3},e._computeMinZoom=function(i){return G(i)?e._getMinZoom():i},e._mapDomResizeCallback=function(){if(e.resetSizeOnIdle_=!0,e.maps_){var i=e.props.center||e.props.defaultCenter,c=e.map_.getCenter();e.maps_.event.trigger(e.map_,"resize"),e.map_.setCenter(e.props.resetBoundsOnResize?i:c)}},e._setLayers=function(i){i.forEach(function(c){e.layers_[c]=new e.maps_[c],e.layers_[c].setMap(e.map_)})},e._renderPortal=function(){return f.createElement(oe,{experimental:e.props.experimental,onChildClick:e._onChildClick,onChildMouseDown:e._onChildMouseDown,onChildMouseEnter:e._onChildMouseEnter,onChildMouseLeave:e._onChildMouseLeave,geoService:e.geoService_,insideMapPanes:!0,distanceToMouse:e.props.distanceToMouse,getHoverDistance:e._getHoverDistance,dispatcher:e.markersDispatcher_})},e._initMap=function(){if(!e.initialized_){e.initialized_=!0;var i=ae(e.props.center||e.props.defaultCenter);e.geoService_.setView(i,e.props.zoom||e.props.defaultZoom,0),e._onBoundsChanged();var c=M({},e.props.apiKey&&{key:e.props.apiKey},e.props.bootstrapURLKeys);e.props.googleMapLoader(c,e.props.heatmapLibrary).then(function(l){if(e.mounted_){var d,m,h=e.geoService_.getCenter(),S={zoom:e.props.zoom||e.props.defaultZoom,center:new l.LatLng(h.lat,h.lng)};e.props.heatmap.positions&&(Object.assign(N(e),{heatmap:(d=l,m=e.props.heatmap,new d.visualization.HeatmapLayer({data:m.positions.reduce(function(z,$){var P=$.weight,F=P===void 0?1:P;return z.push({location:new d.LatLng($.lat,$.lng),weight:F}),z},[])}))}),function(z,$){var P=$.options,F=P===void 0?{}:P;Object.keys(F).map(function(te){return z.set(te,F[te])})}(e.heatmap,e.props.heatmap));var b=Oe(l,Y),E=typeof e.props.options=="function"?e.props.options(b):e.props.options,I=!G(e.props.draggable)&&{draggable:e.props.draggable},R=e._computeMinZoom(E.minZoom);e.minZoom_=R;var U=M({},{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}],minZoom:3},{minZoom:R},E,S);e.defaultDraggableOption_=G(U.draggable)?e.defaultDraggableOption_:U.draggable;var V=M({},U,I);V.minZoom=Ie(V.minZoom,R);var w=new l.Map(T.findDOMNode(e.googleMapDom_),V);e.map_=w,e.maps_=l,e._setLayers(e.props.layerTypes);var ee=l.version.match(/^3\.(\d+)\./),et=ee&&Number(ee[1]),p=N(e),we=Object.assign(new l.OverlayView,{onAdd:function(){var z=typeof screen!="undefined"?screen.width+"px":"2000px",$=typeof screen!="undefined"?screen.height+"px":"2000px",P=document.createElement("div");if(P.style.backgroundColor="transparent",P.style.position="absolute",P.style.left="0px",P.style.top="0px",P.style.width=z,P.style.height=$,p.props.overlayViewDivStyle){var F=p.props.overlayViewDivStyle;typeof F=="object"&&Object.keys(F).forEach(function(te){P.style[te]=F[te]})}this.getPanes().overlayMouseTarget.appendChild(P),p.geoService_.setMapCanvasProjection(l,we.getProjection()),se?p.setState({overlay:P}):Ae(p,p._renderPortal(),P,function(){return p.setState({overlay:P})})},onRemove:function(){var z=p.state.overlay;z&&!se&&T.unmountComponentAtNode(z),p.setState({overlay:null})},draw:function(){if(p.updateCounter_++,p._onBoundsChanged(w,l,!p.props.debounced),p.googleApiLoadedCalled_||(p._onGoogleApiLoaded({map:w,maps:l,ref:p.googleMapDom_}),p.googleApiLoadedCalled_=!0),p.mouse_){var z=p.geoService_.fromContainerPixelToLatLng(p.mouse_);p.mouse_.lat=z.lat,p.mouse_.lng=z.lng}p._onChildMouseMove(),p.markersDispatcher_&&(p.markersDispatcher_.emit("kON_CHANGE"),p.fireMouseEventOnIdle_&&p.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE"))}});e.overlay_=we,we.setMap(w),e.props.heatmap.positions&&e.heatmap.setMap(w),e.props.onTilesLoaded&&l.event.addListener(w,"tilesloaded",function(){p._onTilesLoaded()}),l.event.addListener(w,"zoom_changed",function(){p.geoService_.getZoom()!==w.getZoom()&&(p.zoomAnimationInProgress_||(p.zoomAnimationInProgress_=!0,p._onZoomAnimationStart(w.zoom)),et<32)&&(new Date().getTime()-e.zoomControlClickTime_<300?De(function(){return De(function(){p.updateCounter_++,p._onBoundsChanged(w,l)})}):(p.updateCounter_++,p._onBoundsChanged(w,l)))}),l.event.addListener(w,"idle",function(){if(e.resetSizeOnIdle_){e._setViewSize();var z=e._computeMinZoom(E.minZoom);z!==e.minZoom_&&(e.minZoom_=z,w.setOptions({minZoom:z})),e.resetSizeOnIdle_=!1}p.zoomAnimationInProgress_&&(p.zoomAnimationInProgress_=!1,p._onZoomAnimationEnd(w.zoom)),p.updateCounter_++,p._onBoundsChanged(w,l),p.dragTime_=0,p.markersDispatcher_&&p.markersDispatcher_.emit("kON_CHANGE")}),l.event.addListener(w,"mouseover",function(){p.mouseInMap_=!0}),l.event.addListener(w,"click",function(){p.mouseInMap_=!0}),l.event.addListener(w,"mouseout",function(){p.mouseInMap_=!1,p.mouse_=null,p.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE")}),l.event.addListener(w,"drag",function(){p.dragTime_=new Date().getTime(),p._onDrag(w)}),l.event.addListener(w,"dragend",function(){var z=l.event.addListener(w,"idle",function(){l.event.removeListener(z),p._onDragEnd(w)})}),l.event.addListener(w,"maptypeid_changed",function(){p._onMapTypeIdChange(w.getMapTypeId())})}}).catch(function(l){throw e._onGoogleApiLoaded({map:null,maps:null,ref:e.googleMapDom_}),console.error(l),l})}},e._onGoogleApiLoaded=function(){var i;e.props.onGoogleApiLoaded&&(i=e.props).onGoogleApiLoaded.apply(i,arguments)},e._getHoverDistance=function(){return e.props.hoverDistance},e._onDrag=function(){var i;return e.props.onDrag&&(i=e.props).onDrag.apply(i,arguments)},e._onDragEnd=function(){var i;return e.props.onDragEnd&&(i=e.props).onDragEnd.apply(i,arguments)},e._onMapTypeIdChange=function(){var i;return e.props.onMapTypeIdChange&&(i=e.props).onMapTypeIdChange.apply(i,arguments)},e._onZoomAnimationStart=function(){var i;return e.props.onZoomAnimationStart&&(i=e.props).onZoomAnimationStart.apply(i,arguments)},e._onZoomAnimationEnd=function(){var i;return e.props.onZoomAnimationEnd&&(i=e.props).onZoomAnimationEnd.apply(i,arguments)},e._onTilesLoaded=function(){return e.props.onTilesLoaded&&e.props.onTilesLoaded()},e._onChildClick=function(){var i;if(e.props.onChildClick)return(i=e.props).onChildClick.apply(i,arguments)},e._onChildMouseDown=function(i,c){e.childMouseDownArgs_=[i,c],e.props.onChildMouseDown&&e.props.onChildMouseDown(i,c,M({},e.mouse_))},e._onChildMouseUp=function(){var i;e.childMouseDownArgs_&&(e.props.onChildMouseUp&&(i=e.props).onChildMouseUp.apply(i,e.childMouseDownArgs_.concat([M({},e.mouse_)])),e.childMouseDownArgs_=null,e.childMouseUpTime_=new Date().getTime())},e._onChildMouseMove=function(){var i;e.childMouseDownArgs_&&e.props.onChildMouseMove&&(i=e.props).onChildMouseMove.apply(i,e.childMouseDownArgs_.concat([M({},e.mouse_)]))},e._onChildMouseEnter=function(){var i;if(e.props.onChildMouseEnter)return(i=e.props).onChildMouseEnter.apply(i,arguments)},e._onChildMouseLeave=function(){var i;if(e.props.onChildMouseLeave)return(i=e.props).onChildMouseLeave.apply(i,arguments)},e._setViewSize=function(){if(e.mounted_){if(document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)e.geoService_.setViewSize(window.innerWidth,window.innerHeight);else{var i=T.findDOMNode(e.googleMapDom_);e.geoService_.setViewSize(i.clientWidth,i.clientHeight)}e._onBoundsChanged()}},e._onWindowResize=function(){e.resetSizeOnIdle_=!0},e._onMapMouseMove=function(i){if(e.mouseInMap_){var c=new Date().getTime();c-e.mouseMoveTime_>50&&(e.boundingRect_=i.currentTarget.getBoundingClientRect()),e.mouseMoveTime_=c;var l=i.clientX-e.boundingRect_.left,d=i.clientY-e.boundingRect_.top;e.mouse_||(e.mouse_={x:0,y:0,lat:0,lng:0}),e.mouse_.x=l,e.mouse_.y=d;var m=e.geoService_.fromContainerPixelToLatLng(e.mouse_);e.mouse_.lat=m.lat,e.mouse_.lng=m.lng,e._onChildMouseMove(),c-e.dragTime_<100?e.fireMouseEventOnIdle_=!0:(e.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE"),e.fireMouseEventOnIdle_=!1)}},e._onClick=function(){var i;return e.props.onClick&&!e.childMouseDownArgs_&&new Date().getTime()-e.childMouseUpTime_>300&&e.dragTime_===0&&(i=e.props).onClick.apply(i,arguments)},e._onMapClick=function(i){e.markersDispatcher_&&(e._onMapMouseMove(i),new Date().getTime()-e.dragTime_>100&&(e.mouse_&&e._onClick(M({},e.mouse_,{event:i})),e.markersDispatcher_.emit("kON_CLICK",i)))},e._onMapMouseDownNative=function(i){e.mouseInMap_&&e._onMapMouseDown(i)},e._onMapMouseDown=function(i){e.markersDispatcher_&&new Date().getTime()-e.dragTime_>100&&(e._onMapMouseMove(i),e.markersDispatcher_.emit("kON_MDOWN",i))},e._onMapMouseDownCapture=function(){Se().isChrome&&(e.zoomControlClickTime_=new Date().getTime())},e._onKeyDownCapture=function(){Se().isChrome&&(e.zoomControlClickTime_=new Date().getTime())},e._isCenterDefined=function(i){return i&&(Y(i)&&ie(i.lat)&&ie(i.lng)||i.length===2&&ie(i[0])&&ie(i[1]))},e._onBoundsChanged=function(i,c,l){if(i){var d=i.getCenter();e.geoService_.setView([d.lat(),d.lng()],i.getZoom(),0)}if((e.props.onChange||e.props.onBoundsChange)&&e.geoService_.canProject()){var m=e.geoService_.getZoom(),h=e.geoService_.getBounds(),S=e.geoService_.getCenter();if(!function(E,I,R){if(E&&I){for(var U=0;U!==E.length;++U)if(Math.abs(E[U]-I[U])>1e-5)return!1;return!0}return!1}(h,e.prevBounds_)&&l!==!1){var b=e.geoService_.getBounds(e.props.margin);e.props.onBoundsChange&&e.props.onBoundsChange(e.centerIsObject_?M({},S):[S.lat,S.lng],m,h,b),e.props.onChange&&e.props.onChange({center:M({},S),zoom:m,bounds:{nw:{lat:h[0],lng:h[1]},se:{lat:h[2],lng:h[3]},sw:{lat:h[4],lng:h[5]},ne:{lat:h[6],lng:h[7]}},marginBounds:{nw:{lat:b[0],lng:b[1]},se:{lat:b[2],lng:b[3]},sw:{lat:b[4],lng:b[5]},ne:{lat:b[6],lng:b[7]}},size:e.geoService_.hasSize()?{width:e.geoService_.getWidth(),height:e.geoService_.getHeight()}:{width:0,height:0}}),e.prevBounds_=h}}},e._registerChild=function(i){e.googleMapDom_=i},e.mounted_=!1,e.initialized_=!1,e.googleApiLoadedCalled_=!1,e.map_=null,e.maps_=null,e.prevBounds_=null,e.heatmap=null,e.layers_={},e.mouse_=null,e.mouseMoveTime_=0,e.boundingRect_=null,e.mouseInMap_=!0,e.dragTime_=0,e.fireMouseEventOnIdle_=!1,e.updateCounter_=0,e.markersDispatcher_=new ue(N(e)),e.geoService_=new We(256),e.centerIsObject_=Y(e.props.center),e.minZoom_=3,e.defaultDraggableOption_=!0,e.zoomControlClickTime_=0,e.childMouseDownArgs_=null,e.childMouseUpTime_=0,e.googleMapDom_=null,e._isCenterDefined(e.props.center||e.props.defaultCenter)){var a=ae(e.props.center||e.props.defaultCenter);e.geoService_.setView(a,e.props.zoom||e.props.defaultZoom,0)}return e.zoomAnimationInProgress_=!1,e.state={overlay:null},e}g(n,r);var o=n.prototype;return o.componentDidMount=function(){var t=this;this.mounted_=!0,X(window,"resize",this._onWindowResize,!1),X(window,"keydown",this._onKeyDownCapture,!0);var e=T.findDOMNode(this.googleMapDom_);e&&X(e,"mousedown",this._onMapMouseDownNative,!0),X(window,"mouseup",this._onChildMouseUp,!1);var a=M({},this.props.apiKey&&{key:this.props.apiKey},this.props.bootstrapURLKeys);this.props.googleMapLoader(a,this.props.heatmapLibrary),setTimeout(function(){t._setViewSize(),t._isCenterDefined(t.props.center||t.props.defaultCenter)&&t._initMap()},0,this),this.props.resetBoundsOnResize&&function(i,c){if(i.parentNode===void 0){var l=document.createElement("div");i.parentNode=l}i=i.parentNode,fe?i.attachEvent("onresize",c):(i.__resizeTriggers__||(getComputedStyle(i).position=="static"&&(i.style.position="relative"),function(){if(!ze){var d=(qe||"")+".resize-triggers { "+(Ye||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',m=document.head||document.getElementsByTagName("head")[0],h=document.createElement("style");h.type="text/css",h.styleSheet?h.styleSheet.cssText=d:h.appendChild(document.createTextNode(d)),m.appendChild(h),ze=!0}}(),i.__resizeLast__={},i.__resizeListeners__=[],(i.__resizeTriggers__=document.createElement("div")).className="resize-triggers",i.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',i.appendChild(i.__resizeTriggers__),ge(i),X(i,"scroll",Te,!0),ve&&i.__resizeTriggers__.addEventListener(ve,function(d){d.animationName==Me&&ge(i)})),i.__resizeListeners__.push(c))}(e,this._mapDomResizeCallback)},o.shouldComponentUpdate=function(t,e){return!j(Z(this.props,["draggable"]),Z(t,["draggable"]))||!j(this.state,e)},o.componentDidUpdate=function(t){var e=this;if(!this._isCenterDefined(t.center)&&this._isCenterDefined(this.props.center)&&setTimeout(function(){return e._initMap()},0),this.map_){var a=this.geoService_.getCenter();if(this._isCenterDefined(this.props.center)){var i=ae(this.props.center),c=this._isCenterDefined(t.center)?ae(t.center):null;(!c||Math.abs(i.lat-c.lat)+Math.abs(i.lng-c.lng)>1e-5)&&Math.abs(i.lat-a.lat)+Math.abs(i.lng-a.lng)>1e-5&&this.map_.panTo({lat:i.lat,lng:i.lng})}if(G(this.props.zoom)||Math.abs(this.props.zoom-t.zoom)>0&&this.map_.setZoom(this.props.zoom),!G(t.draggable)&&G(this.props.draggable)?this.map_.setOptions({draggable:this.defaultDraggableOption_}):j(t.draggable,this.props.draggable)||this.map_.setOptions({draggable:this.props.draggable}),!G(this.props.options)&&!j(t.options,this.props.options)){var l=Oe(this.maps_,Y),d=typeof this.props.options=="function"?this.props.options(l):this.props.options;if("minZoom"in(d=Z(d,["zoom","center","draggable"]))){var m=this._computeMinZoom(d.minZoom);d.minZoom=Ie(d.minZoom,m)}this.map_.setOptions(d)}j(this.props.layerTypes,t.layerTypes)||(Object.keys(this.layers_).forEach(function(h){e.layers_[h].setMap(null),delete e.layers_[h]}),this._setLayers(this.props.layerTypes)),this.heatmap&&!j(this.props.heatmap.positions,t.heatmap.positions)&&this.heatmap.setData(this.props.heatmap.positions.map(function(h){return{location:new e.maps_.LatLng(h.lat,h.lng),weight:h.weight}})),this.heatmap&&!j(this.props.heatmap.options,t.heatmap.options)&&Object.keys(this.props.heatmap.options).forEach(function(h){e.heatmap.set(h,e.props.heatmap.options[h])})}this.markersDispatcher_.emit("kON_CHANGE"),j(this.props.hoverDistance,t.hoverDistance)||this.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE")},o.componentWillUnmount=function(){this.mounted_=!1;var t,e,a=T.findDOMNode(this.googleMapDom_);a&&a.removeEventListener("mousedown",this._onMapMouseDownNative,!0),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("keydown",this._onKeyDownCapture),window.removeEventListener("mouseup",this._onChildMouseUp,!1),this.props.resetBoundsOnResize&&(e=this._mapDomResizeCallback,t=(t=a).parentNode,fe?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",Te),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))),this.overlay_&&this.overlay_.setMap(null),this.maps_&&this.map_&&this.props.shouldUnregisterMapOnUnmount&&(this.map_.setOptions({scrollwheel:!1}),this.maps_.event.clearInstanceListeners(this.map_)),this.props.shouldUnregisterMapOnUnmount&&(this.map_=null,this.maps_=null),this.markersDispatcher_.dispose(),this.resetSizeOnIdle_=!1,this.props.shouldUnregisterMapOnUnmount&&(delete this.map_,delete this.markersDispatcher_)},o.render=function(){var t=this.state.overlay,e=t?null:f.createElement(Re,{experimental:this.props.experimental,onChildClick:this._onChildClick,onChildMouseDown:this._onChildMouseDown,onChildMouseEnter:this._onChildMouseEnter,onChildMouseLeave:this._onChildMouseLeave,geoService:this.geoService_,insideMapPanes:!1,distanceToMouse:this.props.distanceToMouse,getHoverDistance:this._getHoverDistance,dispatcher:this.markersDispatcher_});return f.createElement("div",{style:this.props.style,onMouseMove:this._onMapMouseMove,onMouseDownCapture:this._onMapMouseDownCapture,onClick:this._onMapClick},f.createElement(D,{registerChild:this._registerChild}),se&&t&&Ae(this._renderPortal(),t),e)},n}(f.Component);function Q(r){var n=r.lng,o=Math.sin(r.lat*Math.PI/180),t=n/360+.5,e=.5-.25*Math.log((1+o)/(1-o))/Math.PI;return{x:t,y:e=e<0?0:e>1?1:e}}function Ce(r){var n=r.x,o=Math.PI-2*Math.PI*r.y;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o))),lng:360*n-180}}function Ne(r,n,o,t){var e=Q(r),a=Q(n),i=e.x<a.x?a.x-e.x:1-e.x+a.x,c=a.y-e.y;if(i<=0&&c<=0)return null;var l=ce(o/256/Math.abs(i)),d=ce(t/256/Math.abs(c)),m=Math.floor(1e-9+Math.min(l,d)),h={x:e.x<a.x?.5*(e.x+a.x):e.x+a.x-1>0?.5*(e.x+a.x-1):.5*(1+e.x+a.x),y:.5*(e.y+a.y)},S=Math.pow(2,m),b=o/S/256/2,E=t/S/256/2,I=Ce({x:h.x-b,y:h.y-E}),R=Ce({x:h.x+b,y:h.y+E});return{center:Ce(h),zoom:m,newBounds:{nw:I,se:R}}}function Xe(r){var n=r.ne,o=r.sw;return{nw:{lat:n.lat,lng:o.lng},se:{lat:o.lat,lng:n.lng}}}function Je(r){var n=r.nw,o=r.se;return{ne:{lat:n.lat,lng:o.lng},sw:{lat:o.lat,lng:n.lng}}}function tt(r,n){var o,t=r.nw,e=r.se,a=r.ne,i=r.sw,c=n.width,l=n.height;if(t&&e)o=Ne(t,e,c,l);else{var d=Xe({ne:a,sw:i});o=Ne(d.nw,d.se,c,l)}return M({},o,{newBounds:M({},o.newBounds,Je(o.newBounds))})}function nt(r,n,o){var t=function(c,l){var d=function(b,E){var I,R=E.lat,U=E.lng,V=(I=R*Math.PI/180,{metersPerLatDegree:111132.92-559.82*Math.cos(2*I)+1.175*Math.cos(4*I)-.0023*Math.cos(6*I),metersPerLngDegree:111412.84*Math.cos(I)-93.5*Math.cos(3*I)+.118*Math.cos(5*I)}),w=.5*b/V.metersPerLatDegree,ee=.5*b/V.metersPerLngDegree;return{nw:{lat:R-w,lng:U-ee},se:{lat:R+w,lng:U+ee}}}(c,{lat:l.lat,lng:l.lng}),m=d.se,h=Q(d.nw),S=Q(m);return{w:Math.abs(S.x-h.x),h:Math.abs(S.y-h.y)}}(r,{lat:n.lat,lng:n.lng}),e=t.w,a=t.h,i=Math.pow(2,o);return{w:e*i*256,h:a*i*256}}function ot(r,n){var o=r.x,t=Math.PI-2*Math.PI*r.y/Math.pow(2,n);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(t)-Math.exp(-t))),lng:o/Math.pow(2,n)*360-180}}function it(r,n){var o=Q({lat:r.lat,lng:r.lng}),t=Math.pow(2,n);return{x:Math.floor(o.x*t),y:Math.floor(o.y*t)}}function rt(r,n){for(var o=r.from,t=r.to,e=Math.pow(2,n),a=[],i=o.x;i!==(t.x+1)%e;i=(i+1)%e)for(var c=o.y;c!==(t.y+1)%e;c=(c+1)%e)a.push([n,i,c]);return a}le.propTypes={apiKey:u().string,bootstrapURLKeys:u().any,defaultCenter:u().oneOfType([u().array,u().shape({lat:u().number,lng:u().number})]),center:u().oneOfType([u().array,u().shape({lat:u().number,lng:u().number})]),defaultZoom:u().number,zoom:u().number,onBoundsChange:u().func,onChange:u().func,onClick:u().func,onChildClick:u().func,onChildMouseDown:u().func,onChildMouseUp:u().func,onChildMouseMove:u().func,onChildMouseEnter:u().func,onChildMouseLeave:u().func,onZoomAnimationStart:u().func,onZoomAnimationEnd:u().func,onDrag:u().func,onDragEnd:u().func,onMapTypeIdChange:u().func,onTilesLoaded:u().func,options:u().any,distanceToMouse:u().func,hoverDistance:u().number,debounced:u().bool,margin:u().array,googleMapLoader:u().any,onGoogleApiLoaded:u().func,yesIWantToUseGoogleMapApiInternals:u().bool,draggable:u().bool,style:u().any,resetBoundsOnResize:u().bool,layerTypes:u().arrayOf(u().string),shouldUnregisterMapOnUnmount:u().bool},le.defaultProps={distanceToMouse:function(r,n){return Math.sqrt((r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y))},hoverDistance:30,debounced:!0,options:function(){return{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}],minZoom:3}},googleMapLoader:be,yesIWantToUseGoogleMapApiInternals:!1,style:{width:"100%",height:"100%",margin:0,padding:0,position:"relative"},layerTypes:[],heatmap:{},heatmapLibrary:!1,shouldUnregisterMapOnUnmount:!0},le.googleMapLoader=be;var Qe=le}}]);
|