"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[1034],{64134:(a,e,t)=>{t.r(e),t.d(e,{SoloPanel:()=>c,SoloPanelPage:()=>u,default:()=>b});var n,s=t(68404),r=t(18745),d=t(87723),o=t(26346),i=t(47074),l=t(45916);const h={initDashboard:i.mV},p=(0,r.connect)((a=>({dashboard:a.dashboard.getModel()})),h);class u extends s.Component{constructor(){var a,e,t;super(...arguments),t={panel:null,notFound:!1},(e="state")in(a=this)?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t}componentDidMount(){const{match:a,route:e}=this.props;this.props.initDashboard({urlSlug:a.params.slug,urlUid:a.params.uid,urlType:a.params.type,routeName:e.routeName,fixUrl:!1})}getPanelId(){var a;return parseInt(null!==(a=this.props.queryParams.panelId)&&void 0!==a?a:"0",10)}componentDidUpdate(a){const{dashboard:e}=this.props;if(e&&(!a.dashboard||a.dashboard.uid!==e.uid)){const a=e.getPanelByUrlId(this.props.queryParams.panelId);if(!a)return void this.setState({notFound:!0});this.setState({panel:a})}}render(){return(0,l.jsx)(c,{dashboard:this.props.dashboard,notFound:this.state.notFound,panel:this.state.panel,panelId:this.getPanelId()})}}const c=a=>{let{dashboard:e,notFound:t,panel:s,panelId:r}=a;return t?(0,l.jsxs)("div",{className:"alert alert-error",children:["Panel with id ",r," not found"]}):s&&e?(0,l.jsx)("div",{className:"panel-solo",children:(0,l.jsx)(d.Z,{children:a=>{let{width:t,height:n}=a;return 0===t?null:(0,l.jsx)(o.l,{stateKey:s.key,width:t,height:n,dashboard:e,panel:s,isEditing:!1,isViewing:!1,lazy:!1})}})}):n||(n=(0,l.jsx)("div",{children:"Loading & initializing dashboard"}))},b=p(u)}}]);
//# sourceMappingURL=SoloPanelPage.82df555c53512d696b1d.js.map