(()=>{var ne=Object.create;var N=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var le=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var de=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of ie(r))!ae.call(e,o)&&o!==t&&N(e,o,{get:()=>r[o],enumerable:!(n=oe(r,o))||n.enumerable});return e};var me=(e,r,t)=>(t=e!=null?ne(se(e)):{},de(r||!e||!e.__esModule?N(t,"default",{value:e,enumerable:!0}):t,e));var P=(e,r,t)=>new Promise((n,o)=>{var i=a=>{try{l(t.next(a))}catch(u){o(u)}},d=a=>{try{l(t.throw(a))}catch(u){o(u)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,d);l((t=t.apply(e,r)).next())});var H=le((Ue,U)=>{var w=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyNames,ce=Object.prototype.hasOwnProperty,Ee=(e,r)=>{for(var t in r)w(e,t,{get:r[t],enumerable:!0})},pe=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of fe(r))!ce.call(e,o)&&o!==t&&w(e,o,{get:()=>r[o],enumerable:!(n=ue(r,o))||n.enumerable});return e},Te=e=>pe(w({},"__esModule",{value:!0}),e),$=(e,r,t)=>new Promise((n,o)=>{var i=a=>{try{l(t.next(a))}catch(u){o(u)}},d=a=>{try{l(t.throw(a))}catch(u){o(u)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,d);l((t=t.apply(e,r)).next())}),j={};Ee(j,{SubmissionError:()=>y,appendExtraData:()=>x,createClient:()=>k,getDefaultClient:()=>$e,isSubmissionError:()=>Ie});U.exports=Te(j);var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ye=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function be(e){e=String(e);for(var r,t,n,o,i="",d=0,l=e.length%3;d<e.length;){if((t=e.charCodeAt(d++))>255||(n=e.charCodeAt(d++))>255||(o=e.charCodeAt(d++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");r=t<<16|n<<8|o,i+=p.charAt(r>>18&63)+p.charAt(r>>12&63)+p.charAt(r>>6&63)+p.charAt(r&63)}return l?i.slice(0,l-3)+"===".substring(l):i}function Fe(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!ye.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(e.length&3));for(var r,t="",n,o,i=0;i<e.length;)r=p.indexOf(e.charAt(i++))<<18|p.indexOf(e.charAt(i++))<<12|(n=p.indexOf(e.charAt(i++)))<<6|(o=p.indexOf(e.charAt(i++))),t+=n===64?String.fromCharCode(r>>16&255):o===64?String.fromCharCode(r>>16&255,r>>8&255):String.fromCharCode(r>>16&255,r>>8&255,r&255);return t}var ge=()=>navigator.webdriver||!!document.documentElement.getAttribute(Fe("d2ViZHJpdmVy"))||!!window.callPhantom||!!window._phantom,he=class{constructor(){this.loadedAt=Date.now(),this.webdriver=ge()}data(){return{loadedAt:this.loadedAt,webdriver:this.webdriver}}},xe=class{constructor(e){this.kind="success",this.next=e.next}};function Ce(e){return"next"in e&&typeof e.next=="string"}var Se=class{constructor(e,r){this.paymentIntentClientSecret=e,this.resubmitKey=r,this.kind="stripePluginPending"}};function ve(e){if("stripe"in e&&"resubmitKey"in e&&typeof e.resubmitKey=="string"){let{stripe:r}=e;return typeof r=="object"&&r!=null&&"paymentIntentClientSecret"in r&&typeof r.paymentIntentClientSecret=="string"}return!1}function Ie(e){return e.kind==="error"}var y=class{constructor(...e){this.kind="error",this.formErrors=[],this.fieldErrors=new Map;var r;for(let t of e){if(!t.field){this.formErrors.push({code:t.code&&Re(t.code)?t.code:"UNSPECIFIED",message:t.message});continue}let n=(r=this.fieldErrors.get(t.field))!=null?r:[];n.push({code:t.code&&Ae(t.code)?t.code:"UNSPECIFIED",message:t.message}),this.fieldErrors.set(t.field,n)}}getFormErrors(){return[...this.formErrors]}getFieldErrors(e){var r;return(r=this.fieldErrors.get(e))!=null?r:[]}getAllFieldErrors(){return Array.from(this.fieldErrors)}};function Re(e){return e in we}var we={BLOCKED:"BLOCKED",EMPTY:"EMPTY",FILES_TOO_BIG:"FILES_TOO_BIG",FORM_NOT_FOUND:"FORM_NOT_FOUND",INACTIVE:"INACTIVE",NO_FILE_UPLOADS:"NO_FILE_UPLOADS",PROJECT_NOT_FOUND:"PROJECT_NOT_FOUND",TOO_MANY_FILES:"TOO_MANY_FILES"};function Ae(e){return e in Oe}var Oe={REQUIRED_FIELD_EMPTY:"REQUIRED_FIELD_EMPTY",REQUIRED_FIELD_MISSING:"REQUIRED_FIELD_MISSING",STRIPE_CLIENT_ERROR:"STRIPE_CLIENT_ERROR",STRIPE_SCA_ERROR:"STRIPE_SCA_ERROR",TYPE_EMAIL:"TYPE_EMAIL",TYPE_NUMERIC:"TYPE_NUMERIC",TYPE_TEXT:"TYPE_TEXT"};function _e(e){return"errors"in e&&Array.isArray(e.errors)&&e.errors.every(r=>typeof r.message=="string")||"error"in e&&typeof e.error=="string"}var De="4.0.0",Le=e=>be(JSON.stringify(e)),Me=e=>{let r=`@formspree/core@${De}`;return e?`${e} ${r}`:r};function x(e,r,t){e instanceof FormData?e.append(r,t):e[r]=t}function Ne(e){return e!==null&&typeof e=="object"}var Pe=class{constructor(e={}){this.project=e.project,this.stripe=e.stripe,typeof window!="undefined"&&(this.session=new he)}submitForm(e,r){return $(this,arguments,function*(t,n,o={}){let i=o.endpoint||"https://formspree.io",d=this.project?`${i}/p/${this.project}/f/${t}`:`${i}/f/${t}`,l={Accept:"application/json","Formspree-Client":Me(o.clientName)};this.session&&(l["Formspree-Session-Data"]=Le(this.session.data())),n instanceof FormData||(l["Content-Type"]="application/json");function a(c){return $(this,null,function*(){try{let s=yield(yield fetch(d,{method:"POST",mode:"cors",body:c instanceof FormData?c:JSON.stringify(c),headers:l})).json();if(Ne(s)){if(_e(s))return Array.isArray(s.errors)?new y(...s.errors):new y({message:s.error});if(ve(s))return new Se(s.stripe.paymentIntentClientSecret,s.resubmitKey);if(Ce(s))return new xe({next:s.next})}return new y({message:"Unexpected response format"})}catch(s){let E=s instanceof Error?s.message:`Unknown error while posting to Formspree: ${JSON.stringify(s)}`;return new y({message:E})}})}if(this.stripe&&o.createPaymentMethod){let c=yield o.createPaymentMethod();if(c.error)return new y({code:"STRIPE_CLIENT_ERROR",field:"paymentMethod",message:"Error creating payment method"});x(n,"paymentMethod",c.paymentMethod.id);let s=yield a(n);if(s.kind==="error")return s;if(s.kind==="stripePluginPending"){let E=yield this.stripe.handleCardAction(s.paymentIntentClientSecret);if(E.error)return new y({code:"STRIPE_CLIENT_ERROR",field:"paymentMethod",message:"Stripe SCA error"});n instanceof FormData?n.delete("paymentMethod"):delete n.paymentMethod,x(n,"paymentIntent",E.paymentIntent.id),x(n,"resubmitKey",s.resubmitKey);let g=yield a(n);return V(g),g}return s}let u=yield a(n);return V(u),u})}};function V(e){let{kind:r}=e;if(r!=="success"&&r!=="error")throw new Error(`Unexpected submission result (kind: ${r})`)}var k=e=>new Pe(e),$e=()=>(R||(R=k()),R),R});var T=me(H());var m={ERROR:"data-fs-error",SUCCESS:"data-fs-success",FIELD:"data-fs-field",SUBMIT_BTN:"data-fs-submit-btn",ACTIVE:"data-fs-active"};var q="https://formspree.io",F=(e,r)=>{console.log(`[formspree-ajax] ${e}`,r!=null?r:"")},B=e=>{if(typeof e=="string"){let r=document.querySelector(e);if(!r)throw new Error(`Element "${e}" not found`);if(!(r instanceof HTMLFormElement))throw new Error(`Element "${e}" is not a form element`);return r}return e},A="data-fs-server-content",O=(e,r)=>{var t;r&&((t=e.textContent)==null?void 0:t.trim())===""&&(e.textContent=r,e.setAttribute(A,"")),e.setAttribute(m.ACTIVE,"")},b=e=>{e.removeAttribute(m.ACTIVE),e.hasAttribute(A)&&(e.textContent="",e.removeAttribute(A))},K=(e,r)=>{var o;let{form:t}=e,n=document.createElement("div");n.textContent="Thank you!",(o=t.parentNode)==null||o.replaceChild(n,t)},_=e=>{e.form.removeAttribute("aria-busy"),e.form.querySelectorAll(`[type='submit']:disabled, [${m.SUBMIT_BTN}]:disabled`).forEach(t=>{let n=t.dataset.fsOriginalText;n&&(t.textContent=n,delete t.dataset.fsOriginalText),t.disabled=!1})},z=e=>{e.form.setAttribute("aria-busy","true"),e.form.querySelectorAll(`[type='submit']:enabled, [${m.SUBMIT_BTN}]:enabled`).forEach(t=>{var n;t.dataset.fsOriginalText=(n=t.textContent)!=null?n:"",t.disabled=!0})},J=(e,r)=>{let{form:t}=e;t.querySelectorAll(`[${m.ERROR}]`).forEach(i=>{let d=i.dataset.fsError;if(!d)return;if(!r){b(i);return}let l=r.getFieldErrors(d);if(l.length===0){b(i);return}O(i,l[0].message)}),t.querySelectorAll(`[${m.FIELD}]`).forEach(i=>{let d=i.getAttribute("name");if(!d){i.removeAttribute("aria-invalid");return}if(!r){i.removeAttribute("aria-invalid");return}if(r.getFieldErrors(d).length===0){i.removeAttribute("aria-invalid");return}i.setAttribute("aria-invalid","true")})},G=(e,r)=>{var t,n,o;return(o=(n=e.querySelector(r))!=null?n:(t=e.parentElement)==null?void 0:t.querySelector(r))!=null?o:null},C=e=>G(e,`[${m.SUCCESS}]`),Q=e=>G(e,`[${m.ERROR}=""]`),Z=(e,r)=>{let t=C(e.form),n=Q(e.form);if(r===null){t&&b(t);return}n&&b(n),t&&O(t,r)},W=(e,r)=>{let t=C(e.form),n=Q(e.form);if(r===null){n&&b(n);return}t&&b(t),n&&O(n,r)},X=e=>e.getFormErrors().map(t=>t.message).join(", ")||"There was an error submitting the form.",Y=!1;var ee=()=>{if(Y||typeof document=="undefined")return;let e=document.createElement("style");e.setAttribute("data-formspree-styles",""),e.textContent=`
    [${m.ERROR}],
    [${m.SUCCESS}] {
      display: none;
    }

    [${m.ERROR}][${m.ACTIVE}] {
      display: block;
      color: #dc3545;
    }

    [${m.ERROR}=""][${m.ACTIVE}] {
      padding: 12px;
      border-radius: 8px;
      margin-bottom: 20px;
      font-size: 14px;
      background: #f8d7da;
      border: 1px solid #f5c6cb;
    }

    [${m.ERROR}]:not([${m.ERROR}=""])[${m.ACTIVE}] {
      font-size: 12px;
      margin-top: 4px;
    }

    [${m.SUCCESS}][${m.ACTIVE}] {
      display: block;
      padding: 12px;
      border-radius: 8px;
      margin-bottom: 20px;
      font-size: 14px;
      background: #d4edda;
      color: #155724;
      border: 1px solid #c3e6cb;
    }

    [${m.FIELD}][aria-invalid="true"] {
      border-color: #dc3545;
    }
  `,document.head.appendChild(e),Y=!0};var Ve=(e,r)=>P(void 0,null,function*(){if(r.submitting)return;r.submitting=!0;let{formKey:t,endpoint:n,client:o,config:i}=e,{debug:d,data:l,onSubmit:a,onSuccess:u,onError:c,onFailure:s,enable:E=_,disable:g=z,renderFieldErrors:L=J,renderSuccess:M=Z,renderFormError:S=W}=i;L(e,null),M(e,null),S(e,null),g(e),a==null||a(e);let v=new FormData(e.form);if(l)for(let[f,I]of Object.entries(l)){let h;typeof I=="function"?h=yield I():h=I,h!==void 0&&(0,T.appendExtraData)(v,f,h)}d&&F("Submitting form",{formKey:t,formData:v});try{let f=yield o.submitForm(t,v,{clientName:"@formspree/ajax",endpoint:n});(0,T.isSubmissionError)(f)?(d&&F("Submission error",f),f.getAllFieldErrors().length>0&&L(e,f),f.getFormErrors().length>0&&S(e,X(f)),c==null||c(e,f)):(d&&F("Submission success",f),M(e,"Thank you!"),u?u(e,f):C(e.form)?e.form.reset():K(e,f))}catch(f){d&&console.error("[formspree-ajax] Unexpected error",f),S(e,"An unexpected error occurred. Please try again."),s==null||s(e,f)}finally{r.submitting=!1,E(e)}}),re=e=>{var u,c,s;if(e.useDefaultStyles!==!1&&ee(),!e.formElement)throw new Error("You must provide a `formElement` in the config");if(!e.formId)throw new Error("You must provide a `formId` in the config");let r=B(e.formElement),t=e.formId,n=(u=e.origin)!=null?u:q,o=e.projectId?(0,T.createClient)({project:e.projectId}):(0,T.getDefaultClient)(),i={form:r,formKey:t,endpoint:n,client:o,config:e},d=(c=e.enable)!=null?c:_;e.debug&&F("Initializing form",i);let l={submitting:!1},a=E=>{E.preventDefault(),Ve(i,l)};return r.addEventListener("submit",a),d(i),(s=e.onInit)==null||s.call(e,i),{destroy:()=>{r.removeEventListener("submit",a)}}};var D=(e,r)=>{if(typeof e!="string"){console.warn("[formspree] First argument must be a command string.");return}if(e!=="initForm"){console.warn(`[formspree] Unknown command: "${e}". Expected "initForm".`);return}if(!r||typeof r!="object"){console.warn("[formspree] A config object is required.");return}let{formElement:t,formId:n}=r;if(!t){console.warn('[formspree] "formElement" is required in config.');return}if(!n){console.warn('[formspree] "formId" is required in config.');return}re(r)};var te=e=>{document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):setTimeout(e,0)};var je=window.formspree&&window.formspree.q||[];window.formspree=(...e)=>{D(e[0],e[1])};te(()=>{for(let e of je)try{D(e[0],e[1])}catch(r){console.error("[formspree] Failed to initialize form from queue:",r)}});})();
