!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"48d9eb4d3342ea0ac79a97ca2a631ad14571d487"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="618b7c45-2b36-454e-8b62-08d8b207b687",e._sentryDebugIdIdentifier="sentry-dbid-618b7c45-2b36-454e-8b62-08d8b207b687")}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(32977),d=r(19075),s=r(81685),o=r(42849),a=r(50100),i=r(71870),c=r(91721),u=r(12339),x=r(31787),h=r(24155),p=r(79748),b=r(6304),g=r(41514),j=r(3319),A=r(74848);const f=e=>{let{children:t,...r}=e;return(0,A.jsx)(n.Flex,{column:!0,gap:3,padding:[4,0],...r,children:t})},m=()=>(0,A.jsxs)(f,{children:[(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"})]}),k=e=>{let{id:t,createdAt:r}=e;const d=(0,o.A)({reportDate:new Date(r),dateOptions:{long:!0}}),{goToReport:s}=(0,a.A)(),{sendLog:i}=(0,j.A)(),c=(0,l.useCallback)(()=>{s(t),i({feature:"AlertDetailsModal",description:"View full report button click",reportId:t})},[t,s,i]);return(0,A.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,A.jsx)(n.TextBig,{strong:!0,color:"menuItem",children:d}),(0,A.jsx)(x.A,{id:t,limitCharacters:180}),(0,A.jsx)(n.Flex,{justifyContent:"end",children:(0,A.jsx)(p.A,{onClick:c,children:"View more"})})]})},I="alert-modal",w=()=>(0,A.jsxs)(n.Flex,{alignItems:"center",gap:2,children:[(0,A.jsx)(n.Icon,{name:"checkmark_s",color:"success"}),(0,A.jsx)(n.TextBig,{children:"Requested a report"})]}),y=e=>{let{alertId:t}=e;const[r,d,,s]=(0,b.A)(),[o,,a]=(0,b.A)(),c=(0,i.A)({onSuccess:a}),{sendLog:x}=(0,j.A)(),h=(0,l.useCallback)(()=>{c({alertId:t}),(0,g.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 o?(0,A.jsx)(w,{}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(p.A,{Component:n.TextBig,onClick:d,children:"Request a new report"}),r?(0,A.jsx)(u.A,{data:{id:t},handleAction:h,onClose:s}):null]})},T=e=>{let{alertId:t,...r}=e;const{fullyLoaded:l}=(0,d.JL)(t),{loaded:n,reports:o}=(0,s.nX)({alertId:t});return l?n?(0,A.jsxs)(f,{...r,children:[(0,A.jsx)(y,{alertId:t}),o.map(e=>(0,A.jsx)(k,{...e},e.id))]}):(0,A.jsx)(m,{}):(0,A.jsx)(c.A,{})}},31787(e,t,r){r.d(t,{A:()=>c});r(98992),r(72577);var l=r(96540),n=r(32977),d=r(81685),s=r(24155),o=r(83341),a=r(74848);const i=()=>(0,a.jsxs)(n.Flex,{column:!0,gap:2,children:[(0,a.jsx)(s.A,{}),(0,a.jsx)(s.A,{width:"75%"})]}),c=e=>{let{id:t,limitCharacters:r=70}=e;const{loaded:s,report:c,error:u}=(0,d.ef)({id:t}),x=(0,l.useMemo)(()=>s&&!u&&c.data?.blocks?.length?c.data.blocks.find(e=>{let{type:t}=e;return"TEXT"===t})?.data?.substring(0,r):"",[s,c,u]);return s?u?null:(0,a.jsx)(n.Flex,{"data-testid":"insights-report-preview-container",children:(0,a.jsx)(o.A,{children:`${x}...`})}):(0,a.jsx)(i,{})}}}]);