import{_ as A,a as F}from"./DR96n_VU.js";import{_ as I}from"./gQe2oyAA.js";import{_ as M}from"./CS_MeOS_.js";import{_ as v}from"./CcwPPakA.js";import{_ as B}from"./C9KnTrrC.js";import{_ as T}from"./DWMTOSv8.js";import{_ as j}from"./DvpWg0hF.js";import{d as q,M as K,a2 as L,k as O,N as P,a3 as V,f as u,b as o,q as a,a as l,c as _,w as d,u as r,F as k,g as U,s as W}from"./B2UyoCas.js";import"./8cAMPTBV.js";import"./BGYJXalu.js";import"./CsNNGtvO.js";import"./DeNTsafF.js";import"./BhXuhlb7.js";import"./Bw4qhTdR.js";import"./88opOQSr.js";import"./CVosDfjh.js";import"./B-TjZPEJ.js";import"./ABctaOB9.js";import"./CB3BcoM2.js";import"./DaLgO_IH.js";import"./Cy--ZdFw.js";import"./NkNhW2e0.js";const z={key:0,class:"flex flex-col o_gap-6 @container/simpleresult"},G="insecureElements",ye=q({__name:"elements-[pid]-[sid]",setup(J){const{kapi:b}=K(),{setCachedData:C,addTimeToProcessedData:f}=L(),h=O(),{sid:c,pid:E}=h.params;if(!c)throw new Error("sid is required");const{trackFirstSeen:D}=P(),{data:i,error:g,refresh:x}=V(`metrics-elements${c||0}`,async()=>await b("CheckInsecureContent").then(e=>e.getInsecureElements(Number(c))),{transform:e=>{if(Object.keys(e.results).length===0)return f({results:[]},0);D(Number(E),Number(c),h.name);const p={results:Object.values(e.results).map(t=>{var m;return{component:t.component,elements:((m=t.insecure_elements)==null?void 0:m.map(s=>typeof s=="string"?s:{content:s.url,status:{text:s.status,color:"error"}}))||[],error:t.error||""}})};return f(p)},getCachedData:(e,p,t)=>{if(!(t.cause==="refresh:manual"||t.cause==="refresh:hook"))return C(e)}});return(e,p)=>{var y;const t=A,m=I,s=F,S=M,$=v,R=B,H=T,N=j;return o(),u("div",null,[a(m,{"page-key":"pMonitoringSecurityElements"},{title:d(()=>[a(t,{title:"pMonitoringSecurityElements","info-type":G})]),_:1}),(y=r(i))!=null&&y.results?(o(),u(k,{key:0},[a(s,{"data-count":r(i).results.length,class:"o_mb-6"},null,8,["data-count"]),r(i).results.length?(o(),u("div",z,[(o(!0),u(k,null,U(r(i).results,(n,w)=>(o(),_(H,{key:w,"component-info":n.component},{default:d(()=>[a(S,{status:n.elements.length?"danger":"success",title:n.elements.length?e.$t("insecureResults.errorHeadline",{n:n.elements.length}):e.$t("insecureResults.noErrorHeadline"),description:n.elements.length?e.$t("insecureResults.errorSubline"):e.$t("insecureResults.noErrorSubline"),class:"o_mb-2"},null,8,["status","title","description"]),n.elements.length?(o(),_(R,{key:0,title:e.$t("insecureResults.errorList"),color:"error",variant:"subtle",icon:r(W).icoError,class:"o_mt-6"},{description:d(()=>[a($,{entries:n.elements,class:"font-medium"},null,8,["entries"])]),_:2},1032,["title","icon"])):l("",!0)]),_:2},1032,["component-info"]))),128))])):l("",!0)],64)):l("",!0),r(g)?(o(),_(N,{key:1,error:r(g),refresh:r(x)},null,8,["error","refresh"])):l("",!0)])}}});export{ye as default};
