import{d as b,eA as w,G as g,b as h,c as F,u as _}from"./outputWidgets.91878a00.js";import{F as d}from"./forms.ca208da8.js";import{e as x,d as C}from"./icons.842bb077.js";import{a as k}from"./asyncComputed.6ced1d7b.js";import{a as l}from"./ant-design.815cb8e3.js";import{C as v}from"./CrudView.d6529c3b.js";import"./record.8ded570d.js";import"./pubsub.862a9619.js";import"./transButton.c9ea1045.js";import"./Text.24e27494.js";import"./Base.80d71c98.js";import"./router.77bfbaae.js";import"./Title.cb0c3b9b.js";import"./index.571df689.js";import"./url.dddb8fdb.js";import"./index.aed07cef.js";import"./index.43a9b125.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="74e7f75a-db8f-4503-970c-98b5357c5950",o._sentryDebugIdIdentifier="sentry-dbid-74e7f75a-db8f-4503-970c-98b5357c5950")}catch{}})();const j=b({__name:"Forms",setup(o){const a=w(),{loading:i,result:n,refetch:c}=k(()=>d.list()),s=({key:e})=>a.push({name:"formEditor",params:{id:e}}),u=async()=>{const e=await d.create();s({key:e.id})},p=async({key:e})=>{var t,m;const r=await l("Do you want to delete the .py file associated with this form?",{okText:"Yes",cancelText:"No"});await l("Are you sure you want to delete this form?")&&(await((m=(t=n.value)==null?void 0:t.find(y=>y.id===e))==null?void 0:m.delete(r)),c())},f=g(()=>{var e,r;return{columns:[{name:"Form Name"},{name:"Path"},{name:"File"},{name:"Actions",align:"right"}],rows:(r=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.id)}`},{text:t.path},{text:t.file},{text:"",actions:[{icon:x,label:"Edit Form",onClick:s},{icon:C,label:"Delete",onClick:p,dangerous:!0}]}]})))!=null?r:[]}});return(e,r)=>(h(),F(v,{loading:_(i),title:"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/p6xf8PxL2Yg",table:f.value,"entity-name":"Form",onCreate:u},null,8,["loading","table"]))}});export{j as default};
//# sourceMappingURL=Forms.2837c135.js.map
