1import{s as e}from"./Dum39MoK.js";import{D as t,Nt as n,On as r,Pt as i,Yt as a,Zn as o,_ as s,b as c,et as l,g as u,k as d,mt as f,tr as p,un as m,vn as h,y as g}from"./B4b-2GOK.js";import{S as _,x as v}from"./C_cSr8y_.js";import{t as y}from"./d1IteUlt.js";import{t as b}from"./CIaNfLJ4.js";import{n as x,t as S}from"./BE9Hl2ji2.js";var C=`Please provide a valid email address.`,w=`Something went wrong. Please try again.`,T=`You're on the list. Watch your inbox.`,E=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;function D(e){return E.test(e.trim())}function O(){let t=e();return{action:u(()=>t.public.newsletterFormAction??`/newsletter/`)}}function k(e){let t=h(``),n=h(``),r=h(``),i=h(``),a=h(null),o=h(!1),s=h(!1);function c(){a.value=null}function l(){return D(t.value)?(c(),!0):(a.value=C,!1)}async function d(e){if(e.preventDefault(),!(o.value||s.value)&&l()){if(i.value.trim()){s.value=!0;return}o.value=!0;try{await y(`/api/newsletter-subscribe`,{method:`POST`,body:{secret101:t.value.trim(),first_name:n.value.trim(),last_name:r.value.trim()}}),s.value=!0,S({form_id:`newsletter`,park_slug:null})}catch{a.value=w}finally{o.value=!1}}}return{email:t,firstName:n,lastName:r,hpGotcha:i,error:a,pending:o,success:s,clearError:c,onSubmit:d,submitLabel:u(()=>o.value?`Please waitâ¦`:`Subscribe`)}}var A=[`id`,`action`,`aria-describedby`],j={key:1,type:`hidden`,name:`enewsSubmit`,value:`Subscribe`},M={class:`FormNewsletterSubscribe__card bg-default border-muted flex flex-col gap-2 rounded-3xl border px-2 py-2`},N={class:`FormNewsletterSubscribe__names flex flex-col gap-2 tablet:flex-row`},P={class:`FormNewsletterSubscribe__email-row relative flex w-full min-w-0 flex-col gap-2 tablet:block`},F=[`id`],I=Object.assign(d({inheritAttrs:!1,__name:`FormNewsletterSubscribe`,props:{layout:{default:`stack`}},setup(e){let d=n(),y=i(),S=i(),C=i(),w=i(),E=i(),D=e,{action:I}=O(),L=h(null),{email:R,firstName:z,lastName:B,hpGotcha:V,error:H,pending:U,success:W,clearError:G,onSubmit:K,submitLabel:q}=k({formEl:L}),J={base:`h-14 rounded-2xl pl-4`},Y={base:`h-14 rounded-2xl pl-4 tablet:pr-36`},X=u(()=>D.layout===`horizontal`);return(e,n)=>{let i=x,u=b;return f(),c(`div`,l({class:`FormNewsletterSubscribe`},r(d)),[s(`form`,{class:`FormNewsletterSubscribe__form relative block`,ref_key:`formEl`,ref:L,id:`subscribeForm-${r(y)}`,name:`subscribeForm`,method:`post`,action:r(I),novalidate:``,"aria-describedby":r(H)?r(E):void 0,onSubmit:n[4]||=(...e)=>r(K)&&r(K)(...e)},[r(W)?(f(),c(`p`,{key:0,class:o([`FormNewsletterSubscribe__success text-p7 px-2 py-3`,r(X)?`text-inverted`:`text-primary`]),role:`status`},p(r(T)),3)):g(``,!0),r(W)?g(``,!0):(f(),c(`input`,j)),a(s(`div`,M,[s(`div`,N,[t(i,{class:`FormNewsletterSubscribe__name w-full tablet:min-w-0 tablet:flex-1`,id:r(C),modelValue:r(z),"onUpdate:modelValue":n[0]||=e=>m(z)?z.value=e:null,type:`text`,name:`first_name`,autocomplete:`given-name`,placeholder:`First name`,"aria-label":`First name`,size:`xl`,ui:J,variant:`ghost`,disabled:r(U)},null,8,[`id`,`modelValue`,`disabled`]),t(i,{class:`FormNewsletterSubscribe__name w-full tablet:min-w-0 tablet:flex-1`,id:r(w),modelValue:r(B),"onUpdate:modelValue":n[1]||=e=>m(B)?B.value=e:null,type:`text`,name:`last_name`,autocomplete:`family-name`,placeholder:`Last name`,"aria-label":`Last name`,size:`xl`,ui:J,variant:`ghost`,disabled:r(U)},null,8,[`id`,`modelValue`,`disabled`])]),s(`div`,P,[t(i,{class:`FormNewsletterSubscribe__email w-full min-w-0`,id:r(S),modelValue:r(R),"onUpdate:modelValue":n[2]||=e=>m(R)?R.value=e:null,type:`email`,name:`secret101`,autocomplete:`email`,required:``,"aria-required":!0,"aria-invalid":!!r(H),"aria-describedby":r(H)?r(E):void 0,"aria-label":`Email address`,placeholder:`Enter your email`,size:`xl`,ui:Y,variant:`ghost`,color:r(H)?`error`:void 0,disabled:r(U),onInput:r(G)},null,8,[`id`,`modelValue`,`aria-invalid`,`aria-describedby`,`color`,`disabled`,`onInput`]),a(s(`input`,{class:`sr-only`,type:`text`,name:`hp_gotcha`,"onUpdate:modelValue":n[3]||=e=>m(V)?V.value=e:null,autocomplete:`off`,tabindex:`-1`,"aria-hidden":`true`},null,512),[[v,r(V)]]),t(u,{class:`FormNewsletterSubscribe__submit w-full tablet:absolute tablet:inset-y-1.5 tablet:right-1.5 tablet:h-auto tablet:w-auto tablet:translate-y-0`,type:`submit`,size:`lg`,color:`primary`,label:r(q),disabled:r(U),loading:r(U),ui:{base:`rounded-2xl h-14`}},null,8,[`label`,`disabled`,`loading`])]),r(H)?(f(),c(`p`,{key:0,class:`FormNewsletterSubscribe__error text-p8 text-error px-2`,id:r(E),role:`alert`},p(r(H)),9,F)):g(``,!0)],512),[[_,!r(W)]])],40,A)],16)}}}),{__name:`FormNewsletterSubscribe`});export{I 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.