"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4492,4650],{2803:(y,f,t)=>{t.r(f),t.d(f,{default:()=>o});var _=t(74848),u=t(4213),E=t.n(u),i=t(96540),m=t(71468),A=t(54148),g=t(8392),B=t(47286),L=t(60590),K=t(88090),R=t(32370),W=t(95382),h=t(28982),S=t(50384);const v=e=>({dashboard:e.dashboard.getModel()}),I={initDashboard:S.v},o=(0,m.connect)(v,I)(({initDashboard:e,route:n,queryParams:a,dashboard:s})=>{const{keybindings:r}=(0,W.Il)(),[d,D]=(0,i.useState)(null),[C,T]=(0,i.useState)(!1),{slug:c,uid:M,type:U}=(0,A.g)();(0,i.useEffect)(()=>{e({urlSlug:c,urlUid:M,urlType:U,routeName:n.routeName,fixUrl:!1,keybindingSrv:r})},[c,M,U,n.routeName,r,e]);const l=()=>parseInt(a.panelId??"0",10);return(0,i.useEffect)(()=>{if(s){const z=P=>{if(!P||P.state!==g.Gu.Done&&P.state!==g.Gu.Streaming)return;const F=P.series,N=a.timezone||s?.timezone;let j={defaults:{},overrides:[]};const V=(0,B.we)({data:F,theme:R.$.theme2,fieldConfig:O?.fieldConfig||j,replaceVariables:Q=>Q,timeZone:N}),G=(0,L._O)([V[0]],{}),$=new Blob(["\uFEFF",G],{type:"text/csv;charset=utf-8"}),X=`${O?.getDisplayTitle()}-data-${(0,K.LE)(new Date)}.csv`;(0,u.saveAs)($,X)},O=s.getPanelByUrlId(a.panelId);if(!O){T(!0);return}D(O),O.getQueryRunner().getData({withTransforms:!0,withFieldConfig:!0}).subscribe({next:P=>z(P)})}},[s,a.panelId,a.timezone]),(0,_.jsx)(h.SoloPanel,{dashboard:s,notFound:C,panel:d,panelId:l(),timezone:a.timezone})})},28982:(y,f,t)=>{t.r(f),t.d(f,{SoloPanel:()=>I,SoloPanelPage:()=>v,default:()=>x});var _=t(74848),u=t(22803),E=t(96540),i=t(71468),m=t(54148),A=t(70713),g=t(29675),B=t(37e3),L=t(95382),K=t(59051),R=t(50384);const W=o=>({dashboard:o.dashboard.getModel()}),h={initDashboard:R.v},S=(0,i.connect)(W,h),v=({route:o,queryParams:e,dashboard:n,initDashboard:a})=>{const[s,r]=(0,E.useState)(null),[d,D]=(0,E.useState)(!1),{keybindings:C}=(0,L.Il)(),{slug:T,uid:c,type:M}=(0,m.g)();(0,E.useEffect)(()=>{a({urlSlug:T,urlUid:c,urlType:M,routeName:o.routeName,fixUrl:!1,keybindingSrv:C})},[T,c,M,o.routeName,a,C]);const U=(0,E.useCallback)(()=>parseInt(e.panelId??"0",10),[e.panelId]);return(0,E.useEffect)(()=>{if(n){const l=n.getPanelByUrlId(e.panelId);if(!l){D(!0);return}l&&n.exitViewPanel(l),r(l),n.initViewPanel(l)}},[n,e.panelId]),(0,_.jsx)(I,{dashboard:n,notFound:d,panel:s,panelId:U(),timezone:e.timezone})},I=({dashboard:o,notFound:e,panel:n,panelId:a,timezone:s})=>{const r=(0,g.of)(p);return e?(0,_.jsx)(B.F,{severity:"error",title:`Panel with id ${a} not found`}):!n||!o?(0,_.jsx)("div",{children:"Loading & initializing dashboard"}):(0,_.jsx)("div",{className:r.container,children:(0,_.jsx)(A.default,{children:({width:d,height:D})=>d===0?null:(0,_.jsx)(K.L,{stateKey:n.key,width:d,height:D,dashboard:o,panel:n,isEditing:!1,isViewing:!0,lazy:!1,timezone:s,hideMenu:!0})})})},x=S(v),p=o=>({container:(0,u.css)({position:"fixed",bottom:0,right:0,margin:0,left:0,top:0,width:"100%",height:"100%"})})}}]);

//# sourceMappingURL=CSVExportPage.de550f2794f44c9d1355.js.map