!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"6c5c4a21a2e48a657cc46560f5c18b469ebbf32c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8a85ef11-c5e2-4c5c-91fb-98a627de7bc7",e._sentryDebugIdIdentifier="sentry-dbid-8a85ef11-c5e2-4c5c-91fb-98a627de7bc7")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[3439],{80590(e,t,a){a.d(t,{A:()=>r});var n=a(96540),o=a(3319),i=a(74848);const r=e=>t=>{let{callback:a,feature:r,isStart:l,isSuccess:d,isFailure:s,eventReason:c,payload:u={},...h}=t;const{sendLog:g,isReady:f}=(0,o.A)(),p=(0,n.useCallback)(e=>{const t=h[a],n={...r?{feature:r}:{},...void 0!==l?{isStart:l}:{},...void 0!==d?{isSuccess:d}:{},...void 0!==s?{isFailure:s}:{},...c?{eventReason:c}:{},...u,...h["data-ga"]?{dataGa:h["data-ga"]}:{},...h.dataGa?{dataGa:h.dataGa}:{},...h["data-track"]?{dataTrack:h["data-track"]}:{},...h.label?{label:h.label}:{}};"function"===typeof t&&t(e),g(n,!0)},[a,g,f,u,h]),b=(0,n.useMemo)(()=>({...h,[a]:p}),[h,a,p]);return(0,i.jsx)(e,{...b})}},94404(e,t,a){a.d(t,{A:()=>r});var n=a(80590),o=a(81691),i=a(74848);const r=e=>t=>{let{payload:a={},...r}=t;const l=(0,n.A)(e);return(0,i.jsx)(l,{...r,callback:"onClick",payload:{...a,action:o.o1.buttonClicked}})}},72060(e,t,a){a.d(t,{A:()=>n});const n=e=>{try{if(!e)return null;const t=document.createElement("a");return t.href=e,/https?/.test(t.protocol)?new URL(t.protocol+"//"+t.host+t.pathname+t.search+t.hash).toString():null}catch(t){return null}};a.dn(n)},55093(e,t,a){a.d(t,{A:()=>s,m:()=>d});var n=a(882),o=a(32977),i=a(74848);const r=(0,n.keyframes)(["from{opacity:0.4;}to{opacity:1;}"]),l=(0,n.default)(o.Icon).withConfig({displayName:"loader__StyledIcon",componentId:"sc-a76ek6-0"})(["width:",";height:",";animation:",";"],e=>e.width,e=>e.height,e=>{let{animate:t}=e;return t?(0,n.css)([""," 1.6s ease-in infinite"],r):""}),d=e=>{let{title:t="Loading",width:a="208px",height:n="177px",...o}=e;return(0,i.jsx)(l,{name:"netdata",color:"primary",title:t,"data-testid":"loading-logo",width:a,height:n,...o})},s=e=>{let{title:t,body:a,iconProps:n,animate:r=!0,testId:l="",...s}=e;return(0,i.jsxs)(o.Flex,{column:!0,height:"100vh",background:"mainBackground",width:"100%",justifyContent:"center",alignItems:"center","data-testid":`loader-container-${l}`,...s,children:[(0,i.jsx)(d,{...n,animate:r}),t&&(0,i.jsx)(o.H3,{color:"text",margin:[1,0,0],children:t}),a&&(0,i.jsx)(o.Text,{color:"text",margin:[4.5,0,0],children:a})]})}},33439(e,t,a){a.r(t),a.d(t,{Trust:()=>p,default:()=>b});a(98992),a(72577);var n=a(96540),o=a(43276),i=a(32977),r=a(72060),l=a(46587),d=a(23947),s=a(55093),c=a(60908),u=a(94404),h=a(3319),g=a(74848);const f=(0,u.A)(i.Button),p=()=>{const e=(()=>{const e=(0,l.uW)("id"),t=(0,l.uW)("email");return(0,n.useCallback)(()=>{e&&t&&(window.posthog?.__loaded&&(window.posthog.identify(e),window.posthog.people.set({email:t})),window.Reo&&window.Reo.identify({username:t,type:"email"}))},[e,t])})(),[t,a]=(0,n.useMemo)(()=>{const{search:e}=window.location,{redirect_uri:t,agent_uri:a}=o.A.parse(e);return[(0,r.A)(t),a]}),[u,p]=(0,n.useState)(),[b,m,y]=(0,d.LC)(),[x,w]=(0,d.Yr)({},[b]),{sendLog:k,isReady:j}=(0,h.A)();return(0,n.useEffect)(()=>{let n=!0,o=null;const i=x.find(e=>e.url===a);return i?k({feature:"TrustUrl",description:"Redirect due to trusted url"}).finally(()=>{e(),location.replace(`/api/v1/auth/account/origins/${i.id}/redirect?redirect_uri=${encodeURIComponent(t)}&agent_uri=${encodeURIComponent(a)}`)}):o=setTimeout(()=>{n&&p(!0)},1e3),()=>{n=!1,o&&(clearTimeout(o),o=null)}},[t,a,x,j]),u?(0,g.jsx)(c.Ay,{feature:"TrustUrl",children:(0,g.jsx)(i.Layer,{full:!0,children:(0,g.jsxs)(i.Flex,{"data-testid":"trust",alignItems:"center",justifyContent:"center",column:!0,width:"100%",height:"100%",background:"mainBackground",gap:4,children:[(0,g.jsx)(s.m,{animate:y}),(0,g.jsxs)(i.Text,{textAlign:"center",children:["Do you trust ",(0,g.jsx)(i.Text,{strong:!0,children:a}),"?"]}),(0,g.jsxs)(i.Flex,{column:!0,gap:2,alignItems:"center",children:[(0,g.jsx)(i.TextBig,{children:"Authorizing this URL will allow it to request your Netdata data."}),(0,g.jsxs)(i.Flex,{gap:2,children:[(0,g.jsx)(f,{flavour:"borderless",onClick:()=>window.location.replace(decodeURIComponent(t)),disabled:w||y,"data-ga":"url-authorization::click-cancel-button",feature:"TrustUrl",payload:{label:"Cancel"},children:"Cancel"}),(0,g.jsx)(f,{onClick:()=>m(a),disabled:w||y,isLoading:w||y,"data-ga":"url-authorization::click-yes-button",feature:"TrustUrl",payload:{label:"Yes"},children:"Yes"})]})]})]})})}):(0,g.jsx)(s.A,{})},b=p}}]);