import{d as f,eA as k,G as y,b,c as g,u as h}from"./outputWidgets.df68f70a.js";import{e as _,d as w}from"./icons.6f0b428b.js";import{a as H}from"./asyncComputed.c4f3fa7a.js";import{H as d}from"./hooks.e1a887ca.js";import{C}from"./CrudView.8169c4b4.js";import{a as x}from"./ant-design.4f24b7fc.js";import"./record.493f7d84.js";import"./pubsub.26abae80.js";import"./Text.5293eafa.js";import"./Base.8da1f136.js";import"./transButton.b32cb3fc.js";import"./router.d34810ba.js";import"./Title.d7a9606c.js";import"./index.a1698b08.js";import"./url.e14018a7.js";import"./index.4c2136c4.js";import"./index.f12da0b9.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="7bc609be-faf0-4df8-a768-d28a7e118988",a._sentryDebugIdIdentifier="sentry-dbid-7bc609be-faf0-4df8-a768-d28a7e118988")}catch{}})();const $=f({__name:"Hooks",setup(a){const r=k(),{loading:i,result:n,refetch:l}=H(()=>d.list()),s=({key:e})=>r.push({name:"hookEditor",params:{id:e}}),c=async()=>{const e=await d.create();s({key:e.id})},m=async({key:e})=>{var o,t;await x("Are you sure you want to delete this hook?")&&(await((t=(o=n.value)==null?void 0:o.find(u=>u.id===e))==null?void 0:t.delete()),l())},p=y(()=>{var e,o;return{columns:[{name:"Hook Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/hook/${encodeURIComponent(t.id)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Hook",onClick:s},{icon:w,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(b(),g(C,{loading:h(i),title:"Hooks",description:"Trigger your Python scripts with a request.","create-button-text":"Create Hook","empty-title":"No hooks here yet",table:p.value,"entity-name":"Hook",onCreate:c},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Hooks.3ea88757.js.map
