"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2613],{12602:(Q,v,t)=>{t.r(v),t.d(v,{default:()=>Z});var s=t(42844),a=t(27702),E=t(24077),x=t(38192),b=t(74639),D=t(58456),c=t(66310),N=t(44644),T=t(26473),C=t(83341),m=t(18771),S=t(57082),F=t(64611),$=t(65036);const L=function(){const e=(0,c.wW)(B),n=p();return n.hide?null:a.createElement("div",{className:e.footer},a.createElement("a",{className:e.link,href:n.link,target:"_blank",rel:"noreferrer noopener"},n.text," ",a.createElement("img",{className:e.logoImg,alt:"",src:n.logo})))};function V(e){p=e}let p=()=>({hide:!1,text:"powered by Grafana",logo:"public/img/grafana_icon.svg",link:"https://grafana.com/"});const B=e=>({footer:(0,s.css)`
    display: flex;
    justify-content: end;
    height: 30px;
    padding: ${e.spacing(0,2,0,1)};
  `,link:(0,s.css)`
    display: flex;
    gap: 4px;
    justify-content: end;
    align-items: center;
  `,logoImg:(0,s.css)`
    height: 100%;
    padding: ${e.spacing(.25,0,.5,0)};
  `});var h=t(76404),A=t(8874);const u=b.wl.pages.PublicDashboard.NotAvailable,y=({paused:e})=>{const n=(0,c.wW)(z),i=(0,c.wW)(A.pJ),r=h.c.LoginBoxBackground();return a.createElement(h.c.LoginBackground,{className:n.container,"data-testid":u.container},a.createElement("div",{className:(0,s.cx)(n.box,r)},a.createElement(h.c.LoginLogo,{className:i.loginLogo}),a.createElement("p",{className:n.title,"data-testid":u.title},e?"This dashboard has been paused by the administrator":"The dashboard your are trying to access does not exist"),e&&a.createElement("p",{className:n.description,"data-testid":u.pausedDescription},"Try again later")))},z=e=>({container:(0,s.css)`
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;

    :before {
      opacity: 1;
    }
  `,box:(0,s.css)`
    width: 608px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: ${e.spacing(4)};
    z-index: 1;
    border-radius: ${e.shape.borderRadius(4)};
    padding: ${e.spacing(6,8)};
    opacity: 1;
  `,title:(0,s.css)`
    font-size: ${e.typography.h3.fontSize};
    text-align: center;
    margin: 0;
  `,description:(0,s.css)`
    font-size: ${e.typography.h5.fontSize};
    margin: 0;
  `});var R=t(83350),P=t(26858),U=t(54195);const W=b.wl.pages.PublicDashboard,j=({dashboard:e})=>{const n=(0,m.useDispatch)(),i=r=>{n((0,C.YT)(r))};return a.createElement(D.X,{title:e.title,buttonOverflowAlignment:"right"},!e.timepicker.hidden&&a.createElement(S.C,{dashboard:e,onChangeTimeZone:i}))},G=e=>{const{match:n,route:i,location:r}=e,I=(0,m.useDispatch)(),J=(0,T.p)(),f=(0,E.Z)(e),O=(0,c.wW)(M),d=(0,m.useSelector)(l=>l.dashboard),o=d.getModel();return(0,a.useEffect)(()=>{I((0,U.mV)({routeName:i.routeName,fixUrl:!1,accessToken:n.params.accessToken,keybindingSrv:J.keybindings}))},[]),(0,a.useEffect)(()=>{if(f?.location.search!==r.search){const l=f?.queryParams,g=e.queryParams;(g?.from!==l?.from||g?.to!==l?.to)&&!o?.timepicker.hidden&&(0,P.$t)().updateTimeRangeFromUrl(),!l?.refresh&&g?.refresh&&(0,P.$t)().setAutoRefresh(g.refresh)}},[f,r.search,e.queryParams,o?.timepicker.hidden]),o?o.meta.publicDashboardEnabled===!1?a.createElement(y,{paused:!0}):o.meta.dashboardNotFound?a.createElement(y,null):a.createElement(N.T,{pageNav:{text:o.title},layout:x.Q.Custom,"data-testid":W.page},a.createElement(j,{dashboard:o}),d.initError&&a.createElement(F.u,{initError:d.initError}),a.createElement("div",{className:O.gridContainer},a.createElement(R.Z,{dashboard:o,isEditable:!1,viewPanel:null,editPanel:null,hidePanelMenus:!0})),a.createElement(L,null)):a.createElement($.B,{initPhase:d.initPhase})},M=e=>({gridContainer:(0,s.css)({flex:1,padding:e.spacing(2,2,2,2),overflow:"auto"})}),Z=G}}]);

//# sourceMappingURL=PublicDashboardPage.7e7e6082bbb5f4f3b7a9.js.map