!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"95b7c22eb8a2502481fe65c08f3bb8d7c317f943"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c942a4da-ccda-4f03-b9a4-e3a75f540580",e._sentryDebugIdIdentifier="sentry-dbid-c942a4da-ccda-4f03-b9a4-e3a75f540580")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[5178],{5178(e,t,r){r.r(t),r.d(t,{default:()=>T});r(98992),r(81454);var l=r(96540),n=r(11759),s=r(19075),d=r(81685),a=r(42849),o=r(50100),i=r(71870),c=r(91721),u=r(12339),x=r(31787),h=r(24155),p=r(79748),g=r(6304),b=r(41514),j=r(3319),f=r(74848);const A=e=>{let{children:t,...r}=e;return(0,f.jsx)(n.Flex,{column:!0,gap:3,padding:[4,0],...r,children:t})},m=()=>(0,f.jsxs)(A,{children:[(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"})]}),k=e=>{let{id:t,createdAt:r}=e;const s=(0,a.A)({reportDate:new Date(r),dateOptions:{long:!0}}),{goToReport:d}=(0,o.A)(),{sendLog:i}=(0,j.A)(),c=(0,l.useCallback)(()=>{d(t),i({feature:"AlertDetailsModal",description:"View full report button click",reportId:t})},[t,d,i]);return(0,f.jsxs)(n.Flex,{"data-testid":"alert-details-modal-tab-reports",column:!0,gap:2,background:"panelBg",round:!0,border:{side:"all",color:"border"},padding:[3,4],children:[(0,f.jsx)(n.TextBig,{strong:!0,color:"menuItem",children:s}),(0,f.jsx)(x.A,{id:t,limitCharacters:180}),(0,f.jsx)(n.Flex,{justifyContent:"end",children:(0,f.jsx)(p.A,{onClick:c,children:"View more"})})]})},I="alert-modal",w=()=>(0,f.jsxs)(n.Flex,{alignItems:"center",gap:2,children:[(0,f.jsx)(n.Icon,{name:"checkmark_s",color:"success"}),(0,f.jsx)(n.TextBig,{children:"Requested a report"})]}),y=e=>{let{alertId:t}=e;const[r,s,,d]=(0,g.A)(),[a,,o]=(0,g.A)(),c=(0,i.A)({onSuccess:o}),{sendLog:x}=(0,j.A)(),h=(0,l.useCallback)(()=>{c({alertId:t}),(0,b.H)("alert-troubleshooter","click-alert-troubleshooter-action-confirmation",I,{action:"request-report-alert",alertId:t},"user-clicked-cta"),x({feature:"AlertTroubleshooter",alertId:t,ui:I,description:"request-report-alert"})},[t,c,x]);return a?(0,f.jsx)(w,{}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.A,{Component:n.TextBig,onClick:s,children:"Request a new report"}),r?(0,f.jsx)(u.A,{data:{id:t},handleAction:h,onClose:d}):null]})},T=e=>{let{alertId:t,...r}=e;const{fullyLoaded:l}=(0,s.JL)(t),{loaded:n,reports:a}=(0,d.nX)({alertId:t});return l?n?(0,f.jsxs)(A,{...r,children:[(0,f.jsx)(y,{alertId:t}),a.map(e=>(0,f.jsx)(k,{...e},e.id))]}):(0,f.jsx)(m,{}):(0,f.jsx)(c.A,{})}},31787(e,t,r){r.d(t,{A:()=>c});r(98992),r(72577);var l=r(96540),n=r(11759),s=r(81685),d=r(24155),a=r(83341),o=r(74848);const i=()=>(0,o.jsxs)(n.Flex,{column:!0,gap:2,children:[(0,o.jsx)(d.A,{}),(0,o.jsx)(d.A,{width:"75%"})]}),c=e=>{let{id:t,limitCharacters:r=70}=e;const{loaded:d,report:c,error:u}=(0,s.ef)({id:t}),x=(0,l.useMemo)(()=>d&&!u&&c.data?.blocks?.length?c.data.blocks.find(e=>{let{type:t}=e;return"TEXT"===t})?.data?.substring(0,r):"",[d,c,u]);return d?u?null:(0,o.jsx)(n.Flex,{"data-testid":"insights-report-preview-container",children:(0,o.jsx)(a.A,{children:`${x}...`})}):(0,o.jsx)(i,{})}}}]);