1import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{h as n}from"./index-CbLRyjzL.js";import{t as r}from"./utils-DXalBF5w.js";var i=e(n(),1),a=t(),o=`9422135`,s=18943262;function c({buttonLabel:e=`Send me the questions â`,placeholder:t=`Your email`,successMsg:n=`Your guide is on its way. Give it a few minutes to land, and do check your junk folder just in case.`,formId:c=o,tagId:l=s,stacked:u=!1,captureUtm:d=!1,formName:f=`lead_form`,successClassName:p}){let[m,h]=(0,i.useState)(``),[g,_]=(0,i.useState)(``),[v,y]=(0,i.useState)(`idle`),b=async e=>{if(e.preventDefault(),!g||!m.trim())return;y(`sending`);let t;if(d&&typeof window<`u`){let e=new URLSearchParams(window.location.search),n={};for(let t of[`utm_source`,`utm_medium`,`utm_campaign`]){let r=e.get(t);r&&(n[t]=r)}Object.keys(n).length&&(t=n)}try{if(!(await fetch(`https://api.convertkit.com/v3/forms/${c}/subscribe`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({api_key:`B3XN-f0MES55I5uBZqSbZg`,email:g,first_name:m.trim(),tags:[l],...t?{fields:t}:{}})})).ok){y(`error`);return}if(typeof window<`u`){let e=window.gtag;e?.(`event`,`generate_lead`,{...t??{},form_id:c,form_name:f,page_path:window.location.pathname})}y(`sent`)}catch{y(`error`)}};if(v===`sent`)return(0,a.jsx)(`p`,{className:r(`font-medium`,p??`text-[color:var(--color-charcoal)]`),children:n});let x=`w-full rounded-full border border-[color:var(--color-palestone)] bg-[color:var(--color-offwhite)] px-5 py-3 text-[color:var(--color-charcoal)] focus:outline-none focus:ring-2 focus:ring-[color:var(--color-blush)]`;return(0,a.jsxs)(`form`,{onSubmit:b,className:r(`flex flex-col gap-3`,u?`max-w-none`:`max-w-xl`),children:[(0,a.jsxs)(`div`,{className:r(`flex flex-col gap-3`,!u&&`sm:flex-row`),children:[(0,a.jsx)(`label`,{className:`sr-only`,htmlFor:`lead-first-name`,children:`First name`}),(0,a.jsx)(`input`,{id:`lead-first-name`,type:`text`,required:!0,maxLength:80,value:m,onChange:e=>h(e.target.value),placeholder:`First name`,className:x}),(0,a.jsx)(`label`,{className:`sr-only`,htmlFor:`lead-email`,children:`Email`}),(0,a.jsx)(`input`,{id:`lead-email`,type:`email`,required:!0,value:g,onChange:e=>_(e.target.value),placeholder:t,className:x})]}),(0,a.jsx)(`button`,{type:`submit`,disabled:v===`sending`||!m.trim()||!g.trim(),className:r(`btn-primary whitespace-nowrap`,u?`w-full`:`sm:self-start`),children:v===`sending`?`Sendingâ¦`:e}),v===`error`&&(0,a.jsx)(`p`,{role:`alert`,className:`text-sm text-[color:var(--color-coral-rose)]`,children:`Something went wrong â try again, or email [email protected]`})]})}export{c 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.