"use strict";(self.webpackChunk_mlflow_mlflow=self.webpackChunk_mlflow_mlflow||[]).push([[682],{5428:function(t,e,i){i.r(e),i.d(e,{default:function(){return u}});var r=i(91604),s=i(50115),o=i(86987),a=(i(68319),i(20813)),p=i.n(a),n=i(37093),c=i(6431),d=i(68858),l=i(65069);function h(t,e){if(t.properties&&t.properties.popupContent){const{popupContent:i}=t.properties;e.bindPopup(i)}}class f extends r.Component{constructor(t){super(t),this.leafletMap=void 0,this.mapDivId=void 0,this.state={loading:!0,error:void 0,features:void 0},this.fetchArtifacts=this.fetchArtifacts.bind(this),this.leafletMap=void 0,this.mapDivId="map"}componentDidMount(){this.fetchArtifacts()}componentDidUpdate(t){if(this.props.path===t.path&&this.props.runUuid===t.runUuid||this.fetchArtifacts(),void 0!==this.leafletMap&&this.leafletMap.hasOwnProperty("_layers")){this.leafletMap.off(),this.leafletMap.remove();const t="<div id='"+this.mapDivId+"'></div>";document.getElementsByClassName("map-container")[0].innerHTML=t,this.leafletMap=void 0}if(void 0!==this.state.features){const t=p().map(this.mapDivId),e="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",i='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors';p().tileLayer(e,{attribution:i}).addTo(t);const r=p().geoJSON(this.state.features,{style(t){return t.properties&&t.properties.style},pointToLayer(t,e){return t.properties&&t.properties.style?p().circleMarker(e,t.properties&&t.properties.style):t.properties&&t.properties.icon?p().marker(e,{icon:p().icon(t.properties&&t.properties.icon)}):p().marker(e,{icon:p().icon({iconRetinaUrl:c,iconUrl:n,shadowUrl:d,iconSize:[24,36],iconAnchor:[12,36]})})},onEachFeature:h}).addTo(t);t.fitBounds(r.getBounds()),this.leafletMap=t}}render(){return this.state.loading?(0,l.tZ)("div",{className:"artifact-map-view-loading",children:"Loading..."}):this.state.error?(0,l.tZ)("div",{className:"artifact-map-view-error",children:"Oops, we couldn't load your file because of an error."}):(0,l.tZ)("div",{className:"map-container",children:(0,l.tZ)("div",{id:this.mapDivId})})}fetchArtifacts(){const t=(0,s.d)(this.props.path,this.props.runUuid);this.props.getArtifact(t).then((t=>{const e=JSON.parse(t);this.setState({features:e,loading:!1})})).catch((t=>{this.setState({error:t,loading:!1,features:void 0})}))}}f.defaultProps={getArtifact:o.dh};var u=f}}]);
//# sourceMappingURL=682.b16eb0ae.chunk.js.map