import{d as b,K as h,b as g,t as w,z as d,H as _}from"./registerWidgets.68572380.js";import{f as F,g as C,h as k}from"./icons.3acf9dc1.js";import{a as D}from"./asyncComputed.896b7bde.js";import{F as m}from"./forms.72f0b1a5.js";import{R as I}from"./RuntimeList.4dae376a.js";import"./activeRecord.15082700.js";import"./DropdownMenu.06bbb53d.js";import"./CircularLoading.30fd4d73.js";import"./lottie.e503152f.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="533a834f-a982-432a-8a5a-805ed0f6142b",a._sentryDebugIdIdentifier="sentry-dbid-533a834f-a982-432a-8a5a-805ed0f6142b")}catch{}})();const $=b({__name:"Forms",setup(a){const n=_(),{loading:i,result:r,refetch:c}=D(()=>m.list()),l=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),u=async({key:e})=>{var o,t;await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.duplicate()),c()},p=async()=>{const e=await m.create();l({key:e.path})},f=async({key:e})=>{var o,t;confirm("Are you sure you want to delete this form?")&&(await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.delete()),c())},y=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Form Actions"}],rows:(o=(e=r.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:F,label:"Delete",onClick:f,dangerous:!0},{icon:C,label:"Edit Form",onClick:l},{icon:k,label:"Duplicate",onClick:u}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(I,{loading:d(i),title:"Dynamic Python forms",description:"Create forms with advanced logic, easy integrations and custom branding.","create-button-text":"Create Form","empty-title":"No forms here yet","video-url":"https://www.youtube.com/embed/tN7SRGmVPwc",table:d(y),onCreate:p},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Forms.192325c4.js.map
