try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff3d62a0-4cfd-405e-a54f-88eb5f826165",e._sentryDebugIdIdentifier="sentry-dbid-ff3d62a0-4cfd-405e-a54f-88eb5f826165")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"bbf0f036d26e8d5cdf711f08d224a9283a4dee0b"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[5030],{75030:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var a=n(96540),r=n(52035),o=n(34843),i=n(84929),s=n(41394),d=n(32370),c=n(45710),l=n(42539),f=n(52365),u=n(75156),h=n(92516),p=n(1108),m=n(5305),b=n(96054),g=n(61501),w=n(10911),x=n(91349);function D(e,t,n){const a=(0,h.q)(),r=n?.locale??a.locale??u.c,o=(0,b.z)(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const i=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[s,d]=(0,m.x)(n?.in,...o>0?[t,e]:[e,t]),c=(0,x.O)(d,s),l=((0,p.G)(d)-(0,p.G)(s))/1e3,f=Math.round((c-l)/60);let D;if(f<2)return n?.includeSeconds?c<5?r.formatDistance("lessThanXSeconds",5,i):c<10?r.formatDistance("lessThanXSeconds",10,i):c<20?r.formatDistance("lessThanXSeconds",20,i):c<40?r.formatDistance("halfAMinute",0,i):c<60?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",1,i):0===f?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",f,i);if(f<45)return r.formatDistance("xMinutes",f,i);if(f<90)return r.formatDistance("aboutXHours",1,i);if(f<g.F6){const e=Math.round(f/60);return r.formatDistance("aboutXHours",e,i)}if(f<2520)return r.formatDistance("xDays",1,i);if(f<g.Nw){const e=Math.round(f/g.F6);return r.formatDistance("xDays",e,i)}if(f<2*g.Nw)return D=Math.round(f/g.Nw),r.formatDistance("aboutXMonths",D,i);if(D=(0,w.W)(d,s),D<12){const e=Math.round(f/g.Nw);return r.formatDistance("xMonths",e,i)}{const e=D%12,t=Math.trunc(D/12);return e<3?r.formatDistance("aboutXYears",t,i):e<9?r.formatDistance("overXYears",t,i):r.formatDistance("almostXYears",t+1,i)}}function y(e,t){return D(e,(0,f.A)(e),t)}var I=n(85577),S=n(91130),M=n(63766),j=n(56171),T=n(79748),k=n(6304),X=n(74848);const P=(0,r.eU)((()=>S.A.get("/api/v1/license").then((e=>e.data)).catch((()=>null)))),A=()=>{const e=(0,o.md)((0,i.Rq)(P)),[t,n]=(0,k.A)(),[r,f]=(0,a.useState)(),[u,h]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if("hasValue"!==e.state)return;const t=e.data?.data;if(!t)return;const a=(0,s.H)(t.exp);if(f(a),!(0,d.f)(a))return;const r=parseInt((a-new Date)/1e3/60/60/24);if(r>30)return;const o=localStorage.getItem("dismissLicenceWarning");o&&(0,d.f)((0,s.H)(o))&&!(0,c.R)((0,s.H)(o))&&r>0||(n(!0),r<0&&h(!0))}),[e]),window.envSettings.onprem&&t?u?(0,X.jsx)(M.Layer,{full:!0,backdropProps:{backdropBlur:"3px"},children:(0,X.jsx)(j.A,{testId:"onprem-banner",width:"100%",background:"errorBackground",position:"absolute",top:"0",tooltipProps:{align:"top"},zIndex:20,children:(0,X.jsx)(M.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2,children:(0,X.jsxs)(M.Text,{children:["Your Netdata Enterprise On-prem License has expired on ",(0,I.GP)(r,"PPPP"),". Please contact your admin /"," ",(0,X.jsx)(T.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main",children:"billing@netdata.cloud"})," ","to renew your license."]})})})}):(0,X.jsx)(j.A,{testId:"onprem-banner",width:"100%",background:"warningBackground",position:"absolute",top:"0",onClose:()=>{n(),localStorage.setItem("dismissLicenceWarning",(0,l.W)(new Date,{days:1}).toISOString())},tooltipProps:{align:"top"},zIndex:20,children:(0,X.jsx)(M.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2,children:(0,X.jsxs)(M.Text,{children:["Your Netdata Enterprise On-prem License will expire in ",y(r),". Please contact your admin /"," ",(0,X.jsx)(T.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main",children:"billing@netdata.cloud"})," ","to renew your license."]})})}):null}}}]);