!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fa61a169-74ef-40cf-9c5c-ac636b897eb4",e._sentryDebugIdIdentifier="sentry-dbid-fa61a169-74ef-40cf-9c5c-ac636b897eb4")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"9332d759e18bd663bd9f8bd6b7633616d12f17f2"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[8505],{8505:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var a=n(96540),r=n(84929),o=n(16074),l=n(63933),i=n(82526),d=n(29176),c=n(87991),s=n(31629),u=n(47444),f=n(8573),p=n(5396),g=n(4659),b=n(87659);const m=(0,u.gD)({key:"fetchLicense",get:()=>s.A.get("/api/v1/license").then((e=>e.data)).catch((()=>null))}),w=(0,u.eU)({key:"licenseAtom",default:m}),y=()=>{if(!window.envSettings.onprem)return null;const e=(0,u.xf)(w),[t,n]=(0,b.A)(),[s,m]=(0,a.useState)(),[y,E]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if("hasValue"!==e.state)return;const t=e.contents,a=(0,r.H)(t.exp);if(m(a),!(0,o.f)(a))return;const i=parseInt((a-new Date)/1e3/60/60/24);if(i>30)return;const d=localStorage.getItem("dismissLicenceWarning");d&&(0,o.f)((0,r.H)(d))&&!(0,l.R)((0,r.H)(d))&&i>0||(n(!0),i<0&&E(!0))}),[e]),t?y?a.createElement(f.Layer,{full:!0,backdropProps:{backdropBlur:"3px"}},a.createElement(p.A,{testId:"onprem-banner",width:"100%",background:"errorBackground",position:"absolute",top:"0",tooltipProps:{align:"top"},zIndex:20},a.createElement(f.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2},a.createElement(f.Text,null,"Your Netdata Enterprise On-prem License has expired on ",(0,c.GP)(s,"PPPP"),". Please contact your admin /"," ",a.createElement(g.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main"},"billing@netdata.cloud")," ","to renew your license.")))):a.createElement(p.A,{testId:"onprem-banner",width:"100%",background:"warningBackground",position:"absolute",top:"0",onClose:()=>{n(),localStorage.setItem("dismissLicenceWarning",(0,i.W)(new Date,{days:1}).toISOString())},tooltipProps:{align:"top"},zIndex:20},a.createElement(f.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2},a.createElement(f.Text,null,"Your Netdata Enterprise On-prem License will expire in ",(0,d.m)(s),". Please contact your admin /"," ",a.createElement(g.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main"},"billing@netdata.cloud")," ","to renew your license."))):null}}}]);