import{h as v,A as i,m as y,aG as w,C as S,o as x,ag as A,b as F,e as C,c as T,d as n,t as E,F as c}from"./CSGWN0Ke.js";import{u as L}from"./00Wz9xmJ.js";const D={class:"fixed top-0 left-0 w-full h-screen z-50 ios-safe-area-bottom"},H={class:"w-full h-full overflow-y-scroll bg-red-300"},O={class:"lg:fixed top-0 left-0 w-full bg-red-300 z-10"},R={class:"w-full table md:flex md:justify-between z-10 md:border-b md:border-grey-300 md:py-5 md:px-1em1vw"},M={class:"ml-auto"},N={class:"pt-8 md:pt-20 px-4 md:px-8"},U=["id"],I=v({__name:"FormEmbedModal",async setup(k){let l,d;const{HUBSPOT_PORTAL_ID:m}=i().public,{DEFAULT_CONVERSION_VALUE:f}=i().public,p=([l,d]=y(()=>L()),l=await l,d(),l),a=w(),b=S(()=>new Date().toLocaleDateString("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}));x(()=>{document.body.style.overflow="hidden",_()}),A(()=>{document.body.style.overflow="auto"});function _(){setTimeout(()=>{var t;(t=window==null?void 0:window.hbspt)==null||t.forms.create({portalId:m,formId:a.value,target:"#modal-form-"+a.value,onFormSubmitted:function(){g()},onFormSubmit:function(){h()}})},1e3)}function g(){const t="No type set";window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"ga4_form_submitted",glCurrency:"EUR",glValue:f,glType:t,ga4FormName:"Form Embed Modal"})}function h(){const t=document.querySelectorAll('input[name="asp_channel"]');for(let e=0,s=t.length;e<s;e++)t[e].value===""&&(t[e].value="Web - Campaign");const o=document.querySelectorAll('input[name="asp_source"]');for(let e=0,s=o.length;e<s;e++)console.log(`asp_source:'${o[e].value}'`),o[e].value===""&&(o[e].value="Digital");const r=document.querySelectorAll('input[name="asp_subsource"]');for(let e=0,s=r.length;e<s;e++)r[e].value===""&&(r[e].value="Other Paid Online Advertising");const u=document.querySelectorAll('input[name="ga_ref"]');for(let e=0,s=u.length;e<s;e++)u[e].value===""&&(u[e].value=b.value.toString())}return F({script:[{hid:"hubspot"+a.value,src:"https://js.hsforms.net/forms/v2.js",defer:!1}]}),(t,o)=>(C(),T("div",D,[n("div",H,[n("header",O,[n("div",R,[n("div",M,[n("button",{class:"w-full uppercase tracking-wider text-sm border-b border-border-grey-300 md:border-0 focus:outline-gbl p-5 md:p-0",onClick:o[0]||(o[0]=r=>a.value=!1)},E(c(p).close||"Close"),1)])])]),n("section",N,[n("div",{id:"modal-form-"+c(a)},null,8,U)])])]))}});export{I as _};