"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7849],{24880:(U,v,n)=>{n.r(v),n.d(v,{SoloPanelPage:()=>g,SoloPanelRenderer:()=>P,default:()=>N});var o=n(74848),h=n(32196),c=n(96540),m=n(54148),S=n(17388),y=n(40845),x=n(42418),j=n(62930),E=n(39419),L=n(7392),R=n(31678),p=n(72255),C=n(30195),f=n(74730);function M(t,e){const[s,a]=(0,c.useState)(),[r,l]=(0,c.useState)();return(0,c.useEffect)(()=>{new S.g5().initSync(t);const T=t.activate();let i=null;try{i=(0,f.vL)(t,e)}catch{}return i?(A(i),a(i)):(0,f.SN)(e)?D(t,e).then(u=>{u?a(u):l("Panel not found")}):l("Panel not found"),T},[t,e]),[s,r]}function A(t){let e=t.parent;for(;e&&!e.isActive;)e.activate(),e=e.parent}function D(t,e){return new Promise(s=>{t.subscribeToEvent(C.d,()=>{const a=(0,f.vL)(t,e);a?s(a):t.state.body.activateRepeaters?.()}),t.state.body.activateRepeaters?.()})}function g({queryParams:t}){const e=(0,p.sP)(),{dashboard:s}=e.useState(),{uid:a="",type:r,slug:l}=(0,m.g)();return(0,c.useEffect)(()=>(e.loadDashboard({uid:a,type:r,slug:l,route:R.DashboardRoutes.Embedded}),()=>e.clearState()),[e,t,a,r,l]),t.panelId?s?(0,o.jsx)(S.$L,{scene:s,children:(0,o.jsx)(P,{dashboard:s,panelId:t.panelId})}):(0,o.jsx)(E.A,{}):(0,o.jsx)(L.L,{entity:"Panel"})}const N=g;function P({dashboard:t,panelId:e}){const[s,a]=M(t,e),{controls:r}=t.useState(),l=r?.useState()?.refreshPicker,d=(0,y.of)(F);return(0,c.useEffect)(()=>l?.activate(),[l]),a?(0,o.jsx)(x.F,{title:a}):s?(0,o.jsx)("div",{className:d.container,children:(0,o.jsx)(s.Component,{model:s})}):(0,o.jsxs)("span",{children:["Loading ",(0,o.jsx)(j.y,{})]})}const F=t=>({container:(0,h.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=SoloPanelPage.31fb4bd8f87aab83e8b6.js.map