"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4492],{28982:(S,d,t)=>{t.r(d),t.d(d,{SoloPanel:()=>c,SoloPanelPage:()=>u,default:()=>x});var o=t(74848),O=t(22803),s=t(96540),I=t(71468),v=t(54148),C=t(70713),T=t(29675),U=t(37e3),h=t(95382),L=t(59051),A=t(50384);const B=e=>({dashboard:e.dashboard.getModel()}),K={initDashboard:A.v},m=(0,I.connect)(B,K),u=({route:e,queryParams:a,dashboard:n,initDashboard:i})=>{const[r,E]=(0,s.useState)(null),[_,P]=(0,s.useState)(!1),{keybindings:f}=(0,h.Il)(),{slug:D,uid:M,type:g}=(0,v.g)();(0,s.useEffect)(()=>{i({urlSlug:D,urlUid:M,urlType:g,routeName:e.routeName,fixUrl:!1,keybindingSrv:f})},[D,M,g,e.routeName,i,f]);const W=(0,s.useCallback)(()=>parseInt(a.panelId??"0",10),[a.panelId]);return(0,s.useEffect)(()=>{if(n){const l=n.getPanelByUrlId(a.panelId);if(!l){P(!0);return}l&&n.exitViewPanel(l),E(l),n.initViewPanel(l)}},[n,a.panelId]),(0,o.jsx)(c,{dashboard:n,notFound:_,panel:r,panelId:W(),timezone:a.timezone})},c=({dashboard:e,notFound:a,panel:n,panelId:i,timezone:r})=>{const E=(0,T.of)(R);return a?(0,o.jsx)(U.F,{severity:"error",title:`Panel with id ${i} not found`}):!n||!e?(0,o.jsx)("div",{children:"Loading & initializing dashboard"}):(0,o.jsx)("div",{className:E.container,children:(0,o.jsx)(C.default,{children:({width:_,height:P})=>_===0?null:(0,o.jsx)(L.L,{stateKey:n.key,width:_,height:P,dashboard:e,panel:n,isEditing:!1,isViewing:!0,lazy:!1,timezone:r,hideMenu:!0})})})},x=m(u),R=e=>({container:(0,O.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=SoloPanelPageOld.4d260bf5d95186041c1b.js.map