!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]="a22fed48-fd07-42c3-8494-2cbadb597bc7",e._sentryDebugIdIdentifier="sentry-dbid-a22fed48-fd07-42c3-8494-2cbadb597bc7")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"9f78cb71b1214f3614f54218a7cc427d43a08b22"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3350],{92155:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(58168),l=a(96540),r=a(50876);const o=e=>(0,l.forwardRef)(((t,a)=>{let{callback:o,feature:c,isStart:d,isSuccess:u,isFailure:i,eventReason:s,payload:f={},...b}=t;const{sendLog:g,isReady:m}=(0,r.A)(),y=(0,l.useCallback)((()=>{const e=b[o],t={feature:c,isStart:d,isSuccess:u,isFailure:i,eventReason:s,...f,...b["data-ga"]?{dataGa:b["data-ga"]}:{},...b.dataGa?{dataGa:b.dataGa}:{},...b["data-track"]?{dataTrack:b["data-track"]}:{},...b.label?{label:b.label}:{}};"function"==typeof e&&e(),g(t,!0)}),[o,g,m,f,b]),p=(0,l.useMemo)((()=>({...b,[o]:y})),[b,o,y]);return l.createElement(e,(0,n.A)({ref:a},p))}));var c=a(67276);const d=e=>(0,l.forwardRef)(((t,a)=>{let{payload:r={},...d}=t;const u=o(e);return l.createElement(u,(0,n.A)({},d,{ref:a,callback:"onClick",payload:{...r,action:c.o1.buttonClicked}}))}))},73350:(e,t,a)=>{a.r(t),a.d(t,{Trust:()=>f,default:()=>b});a(3064),a(98992),a(72577);var n=a(96540),l=a(86663),r=a(8573),o=a(14096),c=a(28738),d=a(92155),u=a(50876),i=a(63314);const s=(0,d.A)(r.Button),f=()=>{const[e,t]=(0,n.useMemo)((()=>{const{search:e}=window.location,{redirect_uri:t,agent_uri:a}=l.parse(e);return[t,a]})),[a,d]=(0,n.useState)(),[f,b,g]=(0,o.LC)(),[m,y]=(0,o.Yr)({},[f]),{sendLog:p,isReady:w}=(0,u.A)();return(0,n.useEffect)((()=>{let a=!0,n=null;const l=m.find((e=>e.url===t));return l?p({feature:"TrustUrl",description:"Redirect due to trusted url"}).finally((()=>{location.replace(`/api/v1/auth/account/origins/${l.id}/redirect?redirect_uri=${encodeURIComponent(e)}&agent_uri=${encodeURIComponent(t)}`)})):n=setTimeout((()=>{a&&d(!0)}),1e3),()=>{a=!1,n&&(clearTimeout(n),n=null)}}),[e,t,m,w]),a?n.createElement(i.Ay,{feature:"TrustUrl"},n.createElement(r.Layer,{full:!0},n.createElement(r.Flex,{"data-testid":"trust",alignItems:"center",justifyContent:"center",column:!0,width:"100%",height:"100%",background:"mainBackground",gap:4},n.createElement(c.m,{animate:g}),n.createElement(r.Text,{textAlign:"center"},"Do you trust ",n.createElement(r.Text,{strong:!0},t),"?"),n.createElement(r.Flex,{column:!0,gap:2,alignItems:"center"},n.createElement(r.TextBig,null,"Authorizing this URL will allow it to request your Netdata data."),n.createElement(r.Flex,{gap:2},n.createElement(s,{flavour:"borderless",onClick:()=>window.location.replace(decodeURIComponent(e)),disabled:y||g,"data-ga":"url-authorization::click-cancel-button",feature:"TrustUrl",payload:{label:"Cancel"}},"Cancel"),n.createElement(s,{onClick:()=>b(t),disabled:y||g,isLoading:y||g,"data-ga":"url-authorization::click-yes-button",feature:"TrustUrl",payload:{label:"Yes"}},"Yes")))))):n.createElement(c.A,null)},b=f}}]);