import{d as y,eA as b,G as g,b as h,c as w,u as _}from"./outputWidgets.0ed3a637.js";import{e as C,d as F,a as k}from"./icons.8d5441dc.js";import{a as x}from"./asyncComputed.054ae312.js";import{F as d}from"./forms.be0cb2e7.js";import{C as v}from"./CrudView.931c84f7.js";import{a as I}from"./ant-design.b8da9ea1.js";import"./activeRecord.e0ef2424.js";import"./pubsub.5dd4605f.js";import"./Text.e89a9af1.js";import"./Base.69739fb7.js";import"./transButton.3ca23b61.js";import"./router.d8af0f7d.js";import"./Title.53f943d2.js";import"./index.230ffe19.js";import"./url.4f7be002.js";import"./index.0f5ee3e7.js";import"./index.feaa4503.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]="59369c3d-7c90-4119-b016-61d2a28ce674",a._sentryDebugIdIdentifier="sentry-dbid-59369c3d-7c90-4119-b016-61d2a28ce674")}catch{}})();const q=y({__name:"Forms",setup(a){const r=b(),{loading:s,result:n,refetch:c}=x(()=>d.list()),m=({key:e})=>r.push({path:`/_editor/form/${encodeURIComponent(e)}`}),l=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()),c()},p=async()=>{const e=await d.create();m({key:e.path})},u=async({key:e})=>{var o,t;await I("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()),c())},f=g(()=>{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:m},{icon:F,label:"Duplicate",onClick:l},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(v,{loading:_(s),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:p},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Forms.facdc79a.js.map
