import{j as o,r}from"./router.chunk.YsRm4bSN.js";import{n as a,aK as s,o as e,r as n,C as t,E as l,aJ as i,J as u}from"./main.chunk.N-eZ2ybB.js";import{u as d,d as c,f as m,k as f}from"./forms.chunk.Bz8aaTWe.js";import{T as g,a as p,c as h,d as w}from"./template.chunk.DPZ5D-on.js";import{O as j}from"./option-keys.chunk.CTqS8AT8.js";import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{P as x}from"./pro-color-picker-input.chunk.c0Q1A8Ua.js";import{P as k}from"./pro-badge.chunk.PstHsVdU.js";import{E as b}from"./editor-field.chunk.851uyGBn.js";import{E as v,a as y,b as _,c as N,d as T,e as E,f as C,g as L}from"./email-preview.chunk.RUDpqLU_.js";import{u as O}from"./template-layout-context.chunk.B1U8ZWnY.js";import{a as S}from"./use-update-dirty-state.chunk.Bh3v76yr.js";import"./react-jsx-runtime.chunk.ATkk6v2S.js";import"./react.js";import"./react-dom-client.chunk.BMQ1litG.js";import"./react-dom.js";import"./pdf-core.chunk.D33I_Wdh.js";import"./ui-radix.chunk.Xzokq_Gv.js";import"./utils.chunk.C1IATKsN.js";import"./icons.chunk.BwnSC3zE.js";import"./date-utils.chunk.DWRtWTmT.js";import"./radio-group.chunk.BTBtVnZk.js";import"./separator.chunk.3HcpyIlz.js";import"./media-field.chunk.B--jhwMa.js";import"./media.chunk.BUcAGRSV.js";import"./charts.chunk.BbweDdoQ.js";import"./range-slider-field.chunk.lLx6oBQy.js";const I=()=>o.jsxs(a,{className:"growfund-p-4",children:[o.jsxs(s,{children:[__("Colors","growfund")," ",o.jsx(k,{})]}),o.jsx("p",{className:"growfund-typo-small growfund-text-fg-secondary growfund-mt-1",children:__("Style how the emails will look","growfund")}),o.jsx(e,{className:"growfund-p-0 growfund-mt-4 growfund-space-y-4",children:[__("Background","growfund"),__("Text","growfund"),__("Link","growfund"),__("Label","growfund"),__("Button Color","growfund"),__("Button BG","growfund")].map((r,a)=>o.jsx(x,{label:r},a))})]}),A=()=>{const r=d();return o.jsxs("div",{className:"growfund-w-full growfund-space-y-4",children:[o.jsx(b,{control:r.control,name:"content.additional",label:__("Additional Description","growfund"),description:__("This will be displayed after the message.","growfund"),placeholder:__("Thank You For Your Donation!","growfund"),rows:2,shortCodes:[{label:__("Site Name","growfund"),value:"{site_name}"},{label:__("Site URL","growfund"),value:"{site_url}"},{label:__("Support Email","growfund"),value:"{support_email}"},{label:__("Organization Name","growfund"),value:"{organization_name}"}]}),o.jsx(b,{control:r.control,name:"content.footer",label:__("Footer","growfund"),rows:4,shortCodes:[{label:__("Year","growfund"),value:"{year}"},{label:__("Site Name","growfund"),value:"{site_name}"},{label:__("Site URL","growfund"),value:"{site_url}"},{label:__("Support Email","growfund"),value:"{support_email}"},{label:__("Terms and Conditions","growfund"),value:"{terms_and_conditions}"},{label:__("Privacy Policy","growfund"),value:"{privacy_policy}"},{label:__("Organization Name","growfund"),value:"{organization_name}"},{label:__("Organization Location","growfund"),value:"{organization_location}"}]})]})},P=()=>{const r=d(),a=r.watch(),s=n.get("EmailTemplateSettingsColors");return o.jsx(t,{className:"growfund-mt-6",children:o.jsxs("div",{className:"growfund-grid growfund-grid-cols-10 growfund-gap-4",children:[o.jsx("div",{className:"growfund-col-span-4",children:o.jsxs("div",{className:"growfund-space-y-4",children:[o.jsx(g,{namePrefix:"media",control:r.control,header:__("Logo","growfund"),description:__("Update the logo & style your way","growfund")}),o.jsx(l,{fallback:o.jsx(I,{}),children:s&&o.jsx(s,{})}),o.jsx(p,{header:__("Content","growfund"),description:__("Manage your email default contents.","growfund"),children:o.jsx(A,{})})]})}),o.jsx("div",{className:"growfund-col-span-6 growfund-sticky growfund-top-[calc(var(--growfund-topbar-height)+var(--growfund-spacing)_*_1.5)] growfund-h-screen",children:o.jsxs(v,{emailTemplate:a,children:[o.jsx(y,{}),o.jsxs(_,{children:[o.jsx(N,{heading:"Updated Campaign Status"}),o.jsxs(T,{children:[o.jsx("p",{children:__("Dear Jhon!","growfund")}),o.jsx("p",{children:__("The status of a campaign you supported has been updated.","growfund")}),o.jsx(E,{className:"growfund-mt-4"})]}),o.jsx(C,{})]}),o.jsx(L,{})]})})]})})},z=c({background:m().nullish(),text:m().nullish(),link:m().nullish(),label:m().nullish(),button:m().nullish(),button_background:m().nullish()}),M=c({additional:m().nullish(),footer:m()}),F=c({media:h.nullish(),content:M.nullish(),colors:z.nullish()}),U=()=>{const a=r.useRef(null),s=i(j.EMAIL_NOTIFICATION_TEMPLATE),e=r.useMemo(()=>s.data?s.data:{},[s.data]),n=f({resolver:u(F)});r.useEffect(()=>{0!==Object.keys(e).length&&n.reset.call(null,e)},[e,n.reset]);const{registerForm:t}=O();return r.useEffect(()=>{const o=t(j.EMAIL_NOTIFICATION_TEMPLATE,n);return()=>{o()}},[t]),S(n),o.jsx(w,{form:n,ref:a,children:o.jsx(P,{})})};export{U as default};
