import{r as i,j as a}from"./main-pzSpmpV2.js";import{D as l}from"./layout-D23Ks5S8.js";import{C as h}from"./campaign-form-D0PJaJi2.js";import{S as g}from"./spinner-BwGdrg0I.js";import{F as f}from"./FetchWrapper-DtDh1OOQ.js";import"./dialog-CwPbkvSr.js";import"./form-BRsh_9c9.js";import"./label-DdsMBmyI.js";import"./index-C4bLmoCR.js";import"./checkbox-CIGiMGP9.js";import"./index-BtdXaa8D.js";import"./input-6kwZWIt9.js";import"./textarea-CBfr8Pun.js";import"./command-CpAAY9qL.js";import"./popover-CdzFhe13.js";import"./separator-C1IUkfHl.js";import"./chevrons-up-down-ZAOsMAOK.js";import"./copy-DtobOUsE.js";import"./loader-2-fAceJRLq.js";function W(){const[n,o]=i.useState(""),[s,m]=i.useState(null),[p,e]=i.useState(!0),c=new f(linkfiliate==null?void 0:linkfiliate.pluginApiUrl,linkfiliate==null?void 0:linkfiliate.nonce),t=window.location.hash.split("/").pop();i.useEffect(()=>{document.title="Edit Campaigns",o("edit"),t&&(async()=>{try{e(!0);const r=await c.get(`/campaign/get/${t}`);m(r.data)}catch(r){console.error("Error fetching campaign:",r)}finally{e(!1)}})()},[t]);const d=[{name:"Dashboard",href:"#/dashboard"},{name:"Campaigns",href:"#/campaign"},{name:`New ${t}`}];return a.jsx(l,{breadcrumb:d,children:a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"p-4 shadow rounded-sm",children:p?a.jsx("div",{className:"min-h-screen items-center",children:a.jsx(g,{children:"Loading..."})}):a.jsx(h,{initialData:s,type:n})})})})}export{W as default};
//# sourceMappingURL=index-CHzoEYcs.js.map
