import{d as b,ex as y,F as h,b as g,u as w,bu as _}from"./registerWidgets.6f5be576.js";import{e as F,f as C,g as k}from"./icons.b2622455.js";import{a as v}from"./asyncComputed.ea0bb8a8.js";import{F as d}from"./forms.10b6c538.js";import{R as x}from"./RuntimeList.b1e20eb7.js";import"./activeRecord.eb203c6f.js";import"./pubsub.1dc45978.js";import"./DropdownMenu.ecdd2e52.js";import"./CircularLoading.63d0a6e6.js";import"./lottie.df73e4a1.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]="c4edc5ae-be2d-4b17-95ff-478627e73241",a._sentryDebugIdIdentifier="sentry-dbid-c4edc5ae-be2d-4b17-95ff-478627e73241")}catch{}})();const G=b({__name:"Forms",setup(a){const n=y(),{loading:i,result:r,refetch:c}=v(()=>d.list()),l=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),m=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()},u=async()=>{const e=await d.create();l({key:e.path})},p=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())},f=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:p,dangerous:!0},{icon:C,label:"Edit Form",onClick:l},{icon:k,label:"Duplicate",onClick:m}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(x,{loading:_(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:f.value,onCreate:u},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Forms.55012057.js.map
