!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:"9332d759e18bd663bd9f8bd6b7633616d12f17f2"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3350],{92155:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(58168),l=a(96540),r=a(50876);const o=e=>(0,l.forwardRef)(((t,a)=>{let{callback:o,feature:d,isStart:c,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:d,isStart:c,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 d=a(67276);const c=e=>(0,l.forwardRef)(((t,a)=>{let{payload:r={},...c}=t;const u=o(e);return l.createElement(u,(0,n.A)({},c,{ref:a,callback:"onClick",payload:{...r,action:d.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),d=a(28738),c=a(92155),u=a(50876),i=a(63314);const s=(0,c.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,c]=(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&&c(!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(d.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(d.A,null)},b=f}}]);