import{d as b,J as y,L as h,b as g,u as w,A as _}from"./registerWidgets.2f354556.js";import{e as F,f as C,g as k}from"./icons.1cdfa11b.js";import{a as v}from"./asyncComputed.7c1b85ba.js";import{F as m}from"./forms.1fbdd547.js";import{R as D}from"./RuntimeList.d806a58a.js";import"./activeRecord.931023a0.js";import"./pubsub.cb65003c.js";import"./DropdownMenu.f3f9574e.js";import"./CircularLoading.f70f248e.js";import"./lottie.61602e49.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]="b5f36589-0f20-45e1-baf0-690e394b92c3",a._sentryDebugIdIdentifier="sentry-dbid-b5f36589-0f20-45e1-baf0-690e394b92c3")}catch{}})();const $=b({__name:"Forms",setup(a){const n=y(),{loading:i,result:r,refetch:c}=v(()=>m.list()),l=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),d=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 m.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:d}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(D,{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{$ as default};
//# sourceMappingURL=Forms.f5db3f3e.js.map
