1import{c as e}from"./Qm0ddB7n.js";import{H as t,R as n,pt as r}from"./CRgX44Gi.js";import{f as i}from"./BgEeVIoz.js";import{t as a}from"./BV746ga8.js";var o=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,s=!1,c=null;function l(){return s?Promise.resolve():c||(c=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=o,n.defer=!0,n.onload=()=>{s=!0,e()},n.onerror=()=>t(Error(`Failed to load Turnstile script`)),document.head.appendChild(n)}),c)}var u=(i,a={})=>{let o=e(),s=r(null),c=r(null),u=r(!1),d=null,f=async()=>{await l(),!(!window.turnstile||!document.getElementById(i))&&(d=window.turnstile.render(`#${i}`,{sitekey:o.public.turnstileSiteKey,theme:`auto`,size:`flexible`,language:`fr`,appearance:a.appearance||`interaction-only`,action:a.action||void 0,callback:e=>{s.value=e,c.value=null},"expired-callback":()=>{s.value=null},"error-callback":e=>{c.value=e,s.value=null}}),u.value=!0)},p=()=>{s.value=null,c.value=null,d!==null&&window.turnstile&&window.turnstile.reset(d)},m=()=>{d!==null&&window.turnstile&&(window.turnstile.remove(d),d=null,u.value=!1,s.value=null)};return a.manual||t(f),n(m),{token:s,error:c,isReady:u,reset:p,render:f,destroy:m}},d=()=>{let t=e(),n=i(),o=r(!1),s=r(!1),c=r(null),l=r({});return{submit:async(e,r)=>{o.value=!0,s.value=!1,c.value=null,l.value={};try{await a(`/api/v1/contacts`,{method:`POST`,baseURL:t.public.apiBaseUrl,body:{...e,origin:n.path,turnstileToken:r}}),s.value=!0}catch(e){let t=e?.data;t?.errors?(l.value=t.errors,c.value=t.errors.global||`Veuillez corriger les erreurs ci-dessous`):c.value=`Une erreur est survenue, veuillez réessayer`}finally{o.value=!1}},isLoading:o,isSuccess:s,errorMessage:c,errors:l,reset:()=>{o.value=!1,s.value=!1,c.value=null,l.value={}}}};export{u as n,d 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.