!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]="bbdaff83-c8a5-4b1b-9af2-1e837fb51d8d",e._sentryDebugIdIdentifier="sentry-dbid-bbdaff83-c8a5-4b1b-9af2-1e837fb51d8d")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8a739758aeaa9703d317afd549bb0f90035c314e"},(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),s=n(87991),c=n(31629),u=n(47444),f=n(65336),p=n(5396),b=n(4659),g=n(87659);const m=(0,u.gD)({key:"fetchLicense",get:()=>c.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,g.A)(),[c,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,s.GP)(c,"PPPP"),". Please contact your admin /"," ",a.createElement(b.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)(c),". Please contact your admin /"," ",a.createElement(b.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}}}]);