PageSourceSearch

https://sapibonfoundation.org/assets/InquiryForm-CMevUlNw.js

js sapibonfoundation.org collected 2026-10-09 22:04:14 UTC 6,797 bytes, 1 lines download raw bytes

1import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{n as r}from"./createServerFn-OXpgmMCA.js";import{t as i}from"./createLucideIcon-CLdWFMku.js";import{t as a}from"./loader-circle-NEOay2w5.js";import{t as o}from"./button-fI08qKoD.js";import{t as s}from"./input-Njx7yl6V.js";import{t as c}from"./label-DzutuUnp.js";import{r as l,t as u}from"./forms.functions-D0i5DzkY.js";import{l as d}from"./forms-vTM6FFQN.js";import{l as f,s as p}from"./analytics-C0RLPQBc.js";import{t as m}from"./textarea-BYGvtQeg.js";var h=i(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),g=i(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_=e(t(),1),v=n();function y({formType:e,title:t,description:n,consentLabel:i=`I agree to be contacted by SapiBon Foundation about this request and I have read the Privacy Policy.`,submitLabel:y=`Submit`,showOrganization:x=!1,showSubject:S=!1,messageLabel:C=`How can we help?`,extraFields:w=[],successTitle:T=`Thank you — we received your submission`}){let E=r(u),D=(0,_.useMemo)(()=>Date.now(),[]),O=(0,_.useRef)(!1),[k,A]=(0,_.useState)(`idle`),[j,M]=(0,_.useState)(``),[N,P]=(0,_.useState)({});async function F(t){if(t.preventDefault(),O.current)return;let n=t.currentTarget,r=new FormData(n),i={};for(let e of w)i[e.name]=String(r.get(e.name)??``);let a={formType:e,fullName:String(r.get(`fullName`)??``),email:String(r.get(`email`)??``),phone:String(r.get(`phone`)??``),organization:String(r.get(`organization`)??``),subject:String(r.get(`subject`)??``),message:String(r.get(`message`)??``),consent:r.get(`consent`)===`on`,extra:i,website:String(r.get(`website`)??``),elapsedMs:Date.now()-D,...f()},o={};for(let e of w)e.required&&!i[e.name]&&(o[e.name]=`This field is required`);let s=d.safeParse(a);if(!s.success)for(let e of s.error.issues)o[String(e.path[0])]=e.message;if(Object.keys(o).length>0){P(o),A(`error`),M(`Please correct the highlighted fields and try again.`);return}P({}),O.current=!0,A(`sending`);try{if(!s.success)return;let t=await E({data:s.data});if(t.ok){if(A(`success`),M(t.message),t.conversionEvent){let n=t.conversionEvent===`volunteer_application_completed`?{value:1,currency:`USD`}:{};p(t.conversionEvent,{form_type:e,...n},t.recordId)}}else A(`error`),M(t.message),O.current=!1}catch{A(`error`),M(`Something went wrong sending your submission. Please try again.`),O.current=!1}}return k===`success`?(0,v.jsxs)(`div`,{className:`surface-card p-8`,role:`status`,"aria-live":`polite`,children:[(0,v.jsx)(g,{"aria-hidden":`true`,className:`size-8 text-success`}),(0,v.jsx)(`h3`,{className:`mt-4 text-xl`,children:T}),(0,v.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:j}),(0,v.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`A team member will follow up by email. Please do not send sensitive personal, financial or medical documents through this form.`})]}):(0,v.jsxs)(`form`,{onSubmit:F,noValidate:!0,className:`surface-card p-6 sm:p-8`,children:[(0,v.jsx)(`h3`,{className:`text-xl`,children:t}),n?(0,v.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:n}):null,k===`error`?(0,v.jsxs)(`div`,{role:`alert`,className:`mt-5 flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:[(0,v.jsx)(h,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),(0,v.jsx)(`span`,{children:j})]}):null,(0,v.jsxs)(`div`,{className:`mt-6 grid gap-5 sm:grid-cols-2`,children:[(0,v.jsx)(b,{id:`fullName`,label:`Full name`,error:N.fullName,required:!0,children:(0,v.jsx)(s,{id:`fullName`,name:`fullName`,autoComplete:`name`,required:!0,maxLength:120})}),(0,v.jsx)(b,{id:`email`,label:`Email address`,error:N.email,required:!0,children:(0,v.jsx)(s,{id:`email`,name:`email`,type:`email`,autoComplete:`email`,required:!0,maxLength:255})}),(0,v.jsx)(b,{id:`phone`,label:`Phone (optional)`,error:N.phone,children:(0,v.jsx)(s,{id:`phone`,name:`phone`,type:`tel`,autoComplete:`tel`,maxLength:40})}),x?(0,v.jsx)(b,{id:`organization`,label:`Church, business or organization`,error:N.organization,children:(0,v.jsx)(s,{id:`organization`,name:`organization`,maxLength:160})}):null,S?(0,v.jsx)(b,{id:`subject`,label:`Subject`,error:N.subject,className:`sm:col-span-2`,children:(0,v.jsx)(s,{id:`subject`,name:`subject`,maxLength:160})}):null,w.map(e=>(0,v.jsx)(b,{id:e.name,label:e.label,error:N[e.name],required:e.required,help:e.help,className:e.type===`textarea`?`sm:col-span-2`:void 0,children:e.type===`textarea`?(0,v.jsx)(m,{id:e.name,name:e.name,rows:3,maxLength:500}):e.type===`select`?(0,v.jsxs)(`select`,{id:e.name,name:e.name,defaultValue:``,className:`h-10 w-full rounded-md border border-input bg-background px-3 text-sm`,children:[(0,v.jsx)(`option`,{value:``,children:`Please select…`}),e.options?.map(e=>(0,v.jsx)(`option`,{value:e,children:e},e))]}):(0,v.jsx)(s,{id:e.name,name:e.name,maxLength:500})},e.name)),(0,v.jsx)(b,{id:`message`,label:C,error:N.message,className:`sm:col-span-2`,children:(0,v.jsx)(m,{id:`message`,name:`message`,rows:5,maxLength:2e3})})]}),(0,v.jsxs)(`div`,{"aria-hidden":`true`,className:`absolute left-[-9999px] h-0 w-0 overflow-hidden`,children:[(0,v.jsx)(`label`,{htmlFor:`website-${e}`,children:`Leave this field empty`}),(0,v.jsx)(`input`,{id:`website-${e}`,name:`website`,tabIndex:-1,autoComplete:`off`})]}),(0,v.jsxs)(`div`,{className:`mt-6 flex items-start gap-3`,children:[(0,v.jsx)(l,{id:`consent-${e}`,name:`consent`,className:`mt-0.5`}),(0,v.jsx)(c,{htmlFor:`consent-${e}`,className:`text-sm font-normal leading-relaxed text-muted-foreground`,children:i})]}),N.consent?(0,v.jsx)(`p`,{className:`mt-1 text-sm text-destructive`,children:N.consent}):null,(0,v.jsxs)(o,{type:`submit`,variant:`hero`,size:`lg`,className:`mt-6 w-full sm:w-auto`,disabled:k===`sending`,children:[k===`sending`?(0,v.jsx)(a,{"aria-hidden":`true`,className:`animate-spin`}):null,k===`sending`?`Sending…`:y]}),(0,v.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Please do not submit medical records, financial account details or other sensitive documentation through this form.`})]})}function b({id:e,label:t,children:n,error:r,required:i,help:a,className:o}){return(0,v.jsxs)(`div`,{className:o,children:[(0,v.jsxs)(c,{htmlFor:e,className:`text-sm font-semibold`,children:[t,i?(0,v.jsx)(`span`,{className:`text-destructive`,children:` *`}):null]}),(0,v.jsx)(`div`,{className:`mt-1.5`,children:n}),a?(0,v.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:a}):null,r?(0,v.jsx)(`p`,{className:`mt-1 text-sm text-destructive`,role:`alert`,children:r}):null]})}export{y as t};

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.