1import"../chunks/Bg9kRutz.js";import{p as ge,aG as n,t as u,o as S,g as d,a as m,b as qe,$ as pe,s as t,c as i,d as r,r as l,n as c}from"../chunks/CY4UVdt7.js";import{h as ye,s as v}from"../chunks/DICAVeAA.js";import{i as w}from"../chunks/2QREhlLr.js";import{a as oe}from"../chunks/BxRDW12y.js";import{r as f,s as x}from"../chunks/QQRLOiMP.js";import{b as h}from"../chunks/BlDKoZcL.js";import{p as _}from"../chunks/Dgt6qkiC.js";import{e as de}from"../chunks/DMejp6ip.js";var be=u('<div class="alert error svelte-1gq4hs"> </div>'),Se=u('<div class="alert success svelte-1gq4hs">Settings saved.</div>'),we=u('<div class="alert error svelte-1gq4hs"> </div>'),xe=u('<div class="alert success svelte-1gq4hs"> </div>'),Ee=u(`<div class="page svelte-1gq4hs"><header class="page-header svelte-1gq4hs"><h1 class="svelte-1gq4hs">Settings</h1> <p class="subtitle svelte-1gq4hs">Manage email addresses used across the site.</p></header> <form method="POST" action="?/updateEmail"><section class="card svelte-1gq4hs"><div class="card-header svelte-1gq4hs"><h2 class="svelte-1gq4hs">Email Settings</h2> <p class="svelte-1gq4hs">These addresses control where transactional emails come from and where lead notifications 2 are delivered.</p></div> <div class="field svelte-1gq4hs"><label for="system_from_email" class="svelte-1gq4hs">System from-email</label> <input id="system_from_email" name="system_from_email" type="email" required class="svelte-1gq4hs"> <p class="hint svelte-1gq4hs">Used as the sender for internal notifications, booking alerts, and password reset emails. 3 Default: <code class="svelte-1gq4hs"> </code></p></div> <div class="field svelte-1gq4hs"><label for="disqualified_from_email" class="svelte-1gq4hs">Disqualified follow-up from-email</label> <input id="disqualified_from_email" name="disqualified_from_email" type="email" required class="svelte-1gq4hs"> <p class="hint svelte-1gq4hs">Used as the sender for the automated follow-up sent to leads whose budget sits below 4 standard packages. A personal address lifts reply rates.</p></div> <div class="field svelte-1gq4hs"><label for="notification_email" class="svelte-1gq4hs">New lead notification recipient</label> <input id="notification_email" name="notification_email" type="email" required class="svelte-1gq4hs"> <p class="hint svelte-1gq4hs">Every new lead submission and Cal.com booking is delivered here.</p></div> <div class="field svelte-1gq4hs"><label for="reply_to_email" class="svelte-1gq4hs">Reply-to address</label> <input id="reply_to_email" name="reply_to_email" type="email" required class="svelte-1gq4hs"> <p class="hint svelte-1gq4hs">When a lead replies to an automated email, the reply lands in this inbox.</p></div> <!> <!> <div class="actions svelte-1gq4hs"><button type="submit" class="btn-primary svelte-1gq4hs"> </button></div></section></form> <form method="POST" action="?/sendTest"><section class="card svelte-1gq4hs"><div class="card-header svelte-1gq4hs"><h2 class="svelte-1gq4hs">Test Email Delivery</h2> <p class="svelte-1gq4hs">Sends two test emails â one from the system address, one from the disqualified follow-up 5 address. Use this to verify Resend is connected and your domain is verified before relying 6 on automated lead notifications.</p></div> <div class="field svelte-1gq4hs"><label for="test_recipient" class="svelte-1gq4hs">Send test emails to</label> <input id="test_recipient" name="test_recipient" type="email" placeholder="[email protected]" required class="svelte-1gq4hs"> <p class="hint svelte-1gq4hs">Tip: use an inbox you actually check, not <code class="svelte-1gq4hs">[email protected]</code>, so 7 you can confirm delivery from an outside perspective.</p></div> <!> <!> <div class="actions svelte-1gq4hs"><button type="submit" class="btn-secondary svelte-1gq4hs"> </button></div></section></form> <section class="card info-card svelte-1gq4hs"><div class="card-header svelte-1gq4hs"><h2 class="svelte-1gq4hs">Resend API Key</h2> <p class="svelte-1gq4hs">The Resend API key lives in your deployment environment variables (<code>RESEND_API_KEY</code>) for security. Rotate it through Railway or your host, not here.</p></div></section></div>`);function Ke(ne,a){var $,ee,se,ae,te,ie,le,re;ge(a,!0);let g=n(!1),q=n(!1),p=n(!1),N=n(_(a.data.settings.notification_email)),O=n(_(((ee=($=a.form)==null?void 0:$.values)==null?void 0:ee.system_from_email)??a.data.settings.system_from_email)),j=n(_(((ae=(se=a.form)==null?void 0:se.values)==null?void 0:ae.disqualified_from_email)??a.data.settings.disqualified_from_email)),z=n(_(((ie=(te=a.form)==null?void 0:te.values)==null?void 0:ie.notification_email)??a.data.settings.notification_email)),G=n(_(((re=(le=a.form)==null?void 0:le.values)==null?void 0:re.reply_to_email)??a.data.settings.reply_to_email));var E=Ee();ye(e=>{pe.title="Settings â Admin"});var y=t(i(E),2),W=i(y),T=t(i(W),2),b=t(i(T),2);f(b);var Y=t(b,2),B=t(i(Y)),ve=i(B,!0);l(B),l(Y),l(T);var R=t(T,2),k=t(i(R),2);f(k),c(2),l(R);var A=t(R,2),P=t(i(A),2);f(P),c(2),l(A);var D=t(A,2),I=t(i(D),2);f(I),c(2),l(D);var F=t(D,2);{var me=e=>{var s=be(),o=i(s,!0);l(s),S(()=>v(o,a.form.error)),m(e,s)};w(F,e=>{var s;(s=a.form)!=null&&s.error&&e(me)})}var H=t(F,2);{var ce=e=>{var s=Se();m(e,s)};w(H,e=>{var s;d(q)&&((s=a.form)!=null&&s.success)&&e(ce)})}var J=t(H,2),U=i(J),fe=i(U,!0);l(U),l(J),l(W),l(y),oe(y,(e,s)=>{var o;return(o=de)==null?void 0:o(e,s)},()=>()=>(r(g,!0),r(q,!1),async({update:e})=>{await e({reset:!1}),r(g,!1),r(q,!0),setTimeout(()=>r(q,!1),2500)}));var C=t(y,2),L=i(C),K=t(i(L),2),Q=t(i(K),2);f(Q),c(2),l(K);var V=t(K,2);{var he=e=>{var s=we(),o=i(s,!0);l(s),S(()=>v(o,a.form.testError)),m(e,s)};w(V,e=>{var s;(s=a.form)!=null&&s.testError&&e(he)})}var X=t(V,2);{var _e=e=>{var s=xe(),o=i(s,!0);l(s),S(()=>v(o,a.form.testMessage)),m(e,s)};w(X,e=>{var s;(s=a.form)!=null&&s.testSuccess&&e(_e)})}var Z=t(X,2),M=i(Z),ue=i(M,!0);l(M),l(Z),l(L),l(C),oe(C,(e,s)=>{var o;return(o=de)==null?void 0:o(e,s)},()=>()=>(r(p,!0),async({update:e})=>{await e({reset:!1}),r(p,!1)})),c(2),l(E),S(()=>{x(b,"placeholder",a.data.defaults.system_from_email),v(ve,a.data.defaults.system_from_email),x(k,"placeholder",a.data.defaults.disqualified_from_email),x(P,"placeholder",a.data.defaults.notification_email),x(I,"placeholder",a.data.defaults.reply_to_email),U.disabled=d(g),v(fe,d(g)?"S
7aving...":"Save Changes"),M.disabled=d(p),v(ue,d(p)?"Sending...":"Send Test Emails")}),h(b,()=>d(O),e=>r(O,e)),h(k,()=>d(j),e=>r(j,e)),h(P,()=>d(z),e=>r(z,e)),h(I,()=>d(G),e=>r(G,e)),h(Q,()=>d(N),e=>r(N,e)),m(ne,E),qe()}export{Ke as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.