var S=Object.defineProperty;var L=(a,e,t)=>e in a?S(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var _=(a,e,t)=>L(a,typeof e!="symbol"?e+"":e,t);import"../chunks/CWj6FrbW.js";import{t as y,c as d,r as g,s as D,p as k,R as c,f as C,a as T,F as u}from"../chunks/CioMtalE.js";import{t as m,a as p}from"../chunks/8I6xAQmg.js";import{a as M,d as $}from"../chunks/i2x3WpvN.js";import{s as w}from"../chunks/DCQgh7ZV.js";import{i as R}from"../chunks/CTeLhLzh.js";import{p as x}from"../chunks/BUS_Djoz.js";import{E as H}from"../chunks/COKIHc89.js";import{B as O,i as P,f as j}from"../chunks/BQFB9udT.js";const B={name:"ClearDebugLog",kind:"HoudiniMutation",hash:"f9ed171b7931ec8be12901b7bfc04088f4f9809a247ee215b7a9cceac2aa163b",raw:`mutation ClearDebugLog($agentId: String!) {
  clearLog(agentId: $agentId) {
    agentId
  }
}
`,rootType:"Mutation",stripVariables:[],selection:{fields:{clearLog:{type:"DebugTrace",keyRaw:"clearLog(agentId: $agentId)",selection:{fields:{agentId:{type:"String",keyRaw:"agentId",visible:!0}}},visible:!0}}},pluginData:{"houdini-svelte":{}},input:{fields:{agentId:"String"},types:{},defaults:{},runtimeScalars:{}}};class E extends O{constructor(){super(...arguments);_(this,"kind","HoudiniMutation")}async mutate(t,{metadata:r,fetch:n,event:i,abortController:l,...o}={}){await P();const{context:s}=await j(this.artifact,this.artifact.name,{fetch:n,metadata:r,event:i});return await this.observer.send({variables:t,fetch:s.fetch,metadata:r,session:s.session,abortController:l,stuff:{...o}})}}class q extends E{constructor(){super({artifact:B})}}const ee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var z=m('<p class="text-sm text-muted-foreground"> </p>'),A=m('<div class="space-y-1"><h2 class="text-2xl font-semibold tracking-tight"> </h2> <!></div>');function F(a,e){var t=A(),r=d(t),n=d(r,!0);g(r);var i=D(r,2);{var l=o=>{var s=z(),f=d(s,!0);g(s),y(()=>w(f,e.subtitle)),p(o,s)};R(i,o=>{e.subtitle&&o(l)})}g(t),y(()=>w(n,e.title)),p(a,t)}var N=m('<!> <div class="flex h-full w-full flex-col pr-4 pl-4 overflow-auto"><!></div>',1);function te(a,e){k(e,!0);const[t,r]=M(),n=()=>$(u(i),"$DebugTrace",t);c(()=>e.data.AgentConfig);let i=c(()=>e.data.DebugTrace),l=c(()=>n().data),o=c(()=>u(l).debugLog),s=new q;async function f(){confirm("Do you really want to clear the log?")&&(await s.mutate({agentId:x.params.id}),await u(i).fetch({policy:"NetworkOnly"}))}var v=N(),b=C(v);F(b,{get title(){return x.params.id}});var h=D(b,2),I=d(h);H(I,{get events(){return u(o).events},onClear:f}),g(h),p(a,v),T(),r()}export{te as component,ee as universal};
