import{d as b,ez as y,J as h,b as g,c as w,u as _}from"./outputWidgets.d94fff8c.js";import{e as C,a as F,b as k}from"./icons.fec42461.js";import{a as x}from"./asyncComputed.6da48dd7.js";import{F as l}from"./forms.6cfc05eb.js";import{C as v}from"./CrudView.e6c5592c.js";import{a as D}from"./ant-design.b0e50c8b.js";import"./activeRecord.4bb9e983.js";import"./pubsub.39314a92.js";import"./index.7d7e00b1.js";import"./Title.c70c7e79.js";import"./Form.57801503.js";import"./router.4a188c48.js";import"./index.3dad0da1.js";import"./url.596d80c9.js";import"./index.e7f021ad.js";import"./index.3709b59d.js";import"./index.0f14f01f.js";import"./index.209f6c1c.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]="bc67c453-752e-458a-a11b-bdb5493d2f7f",a._sentryDebugIdIdentifier="sentry-dbid-bc67c453-752e-458a-a11b-bdb5493d2f7f")}catch{}})();const q=b({__name:"Forms",setup(a){const r=y(),{loading:s,result:n,refetch:m}=x(()=>l.list()),c=({key:e})=>r.push({path:`/_editor/form/${encodeURIComponent(e)}`}),d=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.duplicate()),m()},p=async()=>{const e=await l.create();c({key:e.path})},u=async({key:e})=>{var o,t;await D("Are you sure you want to delete this form?")&&(await((t=(o=n.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.delete()),m())},f=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:C,label:"Edit Form",onClick:c},{icon:F,label:"Duplicate",onClick:d},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(v,{loading:_(s),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/p6xf8PxL2Yg",table:f.value,"entity-name":"Form",onCreate:p},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Forms.bc664eec.js.map
