import{Ir as e,Lt as t,Pt as n}from"./index-BKLG6eUi.js";import{t as r}from"./usePageAutoRefresh-DiikOfci.js";var i=8e3,a=3e4;function o(o,s){let{runningItems:c}=t();r(async()=>{s?.enabled&&!s.enabled()||await o(!0)},()=>c.value.length>0?i:a);let l=n(()=>{s?.enabled&&!s.enabled()||o(!1)});e(()=>{l()})}function s(e){return e.replace(/\b\d{1,3}(?:\.\d{1,3}){3}\b/g,`<ip>`).replace(/:\d{2,5}\b/g,`:<port>`).replace(/\/[^\s'"]+/g,`/<path>`).replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,`<uuid>`).replace(/\s+/g,` `).trim()}function c(e){let t=e.trim();return!t||t===`—`?`未知错误`:s(t.split(`
`)[0]?.trim()||t).slice(0,200)||`未知错误`}function l(e){let t=new Map;for(let n of e){if(!n.failed)continue;let e=c(n.summary),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.entries()].map(([e,t])=>({errorKey:e,rows:t.sort((e,t)=>e.serverName.localeCompare(t.serverName,`zh`)),count:t.length})).sort((e,t)=>t.count-e.count||e.errorKey.localeCompare(t.errorKey,`zh`))}export{o as n,l as t};