1import{_ as U}from"./CmUA0a6R.js";import{k as q,b as u,C as D,a6 as O,D as V,U as k,E as x,G as l,O as s,u as g,V as $,P as n,W as C,_ as N,I as A,N as M}from"./DabT6nDF.js";import{p as j,q as W,u as G,B as L,a as R,bA as z,b as J}from"./Ba3RUHVi.js";import{u as Y}from"./CxdU1XaL.js";import{_ as H,a as K,c as Q}from"./CTRVvA3F.js";import{_ as X}from"./YG-rrgyW.js";import"./B-jE-hx6.js";import"./DO6JZEKH.js";import"./B4cg5wM0.js";import"./BHQv6571.js";import"./yJzvz9ez.js";import"./DL7WBgvb.js";const Z={class:"content-wrapper"},ee={key:0,class:"overlay"},te={class:"email-form"},ae={class:"head textContent"},se={class:"name-fields"},oe=q({__name:"wp-[slug]",async setup(le){let m,y;const b=j(),{getThumbnail:S}=Y(),r=u(""),d=u(""),v=u(""),p=u(!1),i=u(!0);D(()=>{p.value=!!localStorage.getItem("user_email")});const B=async()=>{if(!r.value.includes("@")){alert("Please enter a valid email address.");return}try{const t=await(await fetch("/api/whitepaper",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r.value,first_name:d.value,last_name:v.value,receive_marketing_emails:i.value})})).json();if(t.status==="success")localStorage.setItem("user_email",r.value),p.value=!0;else throw new Error(t.message||"Form submission failed.")}catch(e){alert(`An error occurred: ${e.message}`)}},{data:o,error:E}=([m,y]=O(()=>R(`wp-${b.params.slug}`,()=>z({slug:b.params.slug}),{transform:e=>e==null?void 0:e.white_papers[0]})),m=await m,y(),m);if(E.value||!o.value)throw W({statusCode:404,statusMessage:"This white paper could not be found",fatal:!0});return G({title:()=>{var e;return`${(e=o.value)==null?void 0:e.page_title} | White Papers | Oyster Sunday Benefits`},description:()=>{var e;return(e=o.value)==null?void 0:e.page_description},ogTitle:()=>{var e;return`${(e=o.value)==null?void 0:e.page_title}`},ogDescription:()=>{var e;return(e=o.value)==null?void 0:e.page_description},ogImage:()=>{var e,t,_;return(e=o.value)!=null&&e.cover_image?S((_=(t=o.value)==null?void 0:t.cover_image)==null?void 0:_.id,{width:1200,format:"jpg"}):""}}),(e,t)=>{var w;const _=U,T=V("Balancer"),f=H,c=K,F=X,I=L,P=Q;return k(),x("section",Z,[l("div",{class:$({blurred:!p.value})},[s(_,{body:(w=g(o))==null?void 0:w.body},null,8,["body"])],2),p.value?M("",!0):(k(),x("div",ee,[l("div",te,[l("div",ae,[s(T,null,{default:n(()=>{var a,h;return[l("h1",null,C((a=g(o))==null?void 0:a.title),1),l("h2",null,C((h=g(o))==null?void 0:h.subtitle),1)]}),_:1}),t[5]||(t[5]=l("div",{class:"text01"},"Enter your details to unlock the full content.",-1))]),l("template",null,[s(P,{class:"wp_form",ref:"formRef",onSubmit:A(B,["prevent"])},{default:n(()=>[s(c,{label:"Email*"},{default:n(()=>[s(f,{value:r.value,"onUpdate:value":t[0]||(t[0]=a=>r.value=a),type:"email",placeholder:"Enter your email*",required:""},null,8,["value"])]),_:1}),l("div",se,[s(c,{label:"First Name"},{default:n(()=>[s(f,{value:d.value,"onUpdate:value":t[1]||(t[1]=a=>d.value=a),type:"text",placeholder:"First name",required:""},null,8,["value"])]),_:1}),s(c,{label:"Last Name"},{default:n(()=>[s(f,{value:v.value,"onUpdate:value":t[2]||(t[2]=a=>v.value=a),type:"text",placeholder:"Last name",required:""},null,8,["value"])]),_:1})]),s(c,{label:""},{default:n(()=>[s(F,{id:"receive_marketing_emails",value:i.value,"onUpdate:value":t[3]||(t[3]=a=>i.value=a),checked:i.value,"onUpdate:checked":t[4]||(t[4]=a=>i.value=a)},null,8,["value","checked"]),t[6]||(t[6]=N("Â Yes, I would like to receive marketing emails from OS BENEFiTS "))]),_:1}),s(I,{type:"primary","attr-type":"submit",block:""},{default:n(()=>t[7]||(t[7]=[N("Submit")])),_:1})]),_:1},512)])])]))])}}}),ye=J(oe,[["__scopeId","data-v-7bdf1158"]]);export{ye as default};
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.