1import{_ as v,c_ as x,cW as N,ab as s,u as w,t as B,i as S,E as V}from"./index.12fd6615.js";import{D as p,E as d,S as b,f as t,U as m,R as i,a0 as y,Q as g,H as E,N as a}from"./vue.e6b86939.js";import{V as R,N as _}from"./index.481e9100.js";import{c as T,a as D,b as P}from"./sentry.09480738.js";const A={name:"PageBlockNewsletterSubscribe",components:{TmlFont:x},mixins:[N],data(){return{firstName:"",email:"",loading:!1}},computed:{buttonColor(){return this.block.property("primaryActions","boolean",!0)?void 0:this.block.property("textColor","string")},inputBgColor(){if(!this.bgColourTransparent)return this.block.property("backgroundColor","string");if(!this.fullBgColourTransparent)return this.block.property("fullBackgroundColor","string")}},methods:{async submit(){if(!await this.$refs.form.validateAll()){s.error("Looks like you're missing some details...");return}this.loading=!0,w().trackEvent({event:"onTeemailSubscribe"}),B.event("teemail-subscribe");try{const{MailingList:o}=await S(()=>import("./index.191addbe.js").then(n=>n.i),["assets/index.191addbe.js","assets/index.44fa88b4.css","assets/teemail-mailing-list.ad038638.js","assets/index.12fd6615.js","assets/index.fb750671.css","assets/vue.e6b86939.js","assets/sentry.09480738.js","assets/index.481e9100.js","assets/store.647ab566.js","assets/faPaperPlane.4d97a08a.js","assets/faSlidersH.577e42de.js","assets/faCog.82441dfc.js","assets/faGear.f880d016.js","assets/faClock.f8ce5824.js","assets/faSync.1b808c6f.js","assets/faLink.d6ac6dc2.js","assets/debounce.11f64b4a.js","assets/copyToClipboard.dd6c45c7.js","assets/startCase.127cd34e.js"]);await o.subscribe(this.$store.state.subdomain.division,this.block.property("mailingList","number",void 0),{email:this.email,firstName:this.firstName}),s("We've sent you an email to verify your subscription")}catch(o){switch(V.Log.tag("teemail").red(`Provider - ${o.constructor.name}`).space().error(o),T(n=>{n.setExtras({campaign:this.campaign})}),o.constructor){case _:P("404'ed attempting to subscribe a user to a mailing list"),s.error("Sorry, looks like the mailing list you're trying to subscribe to no longer exists");break;case R:s.error(o.message);break;default:D(o),s.error("Sorry, something went wrong subscribing you to that list, we've made our team aware of the issue");break}}finally{this.loading=!1}}}},L={class:"flex-1 justify-center mb-4"},F={class:"flex-1"};function M(r,o,n,U,l,e){const f=a("tml-font"),u=a("tml-input"),k=a("tml-button"),C=a("tml-anchor"),h=a("tml-form");return p(),d("div",{style:i({borderRadius:r.block.property("borderRadius","string")})},[b("div",{class:E(["flex wrapper",{stacked:r.block.property("stacked","boolean",!1),"px-4":r.shouldApplyPadding}]),style:i({backgroundColor:r.block.property("backgroundColor","string","#0000"),paddingTop:r.block.property("spacing","string","3rem"),paddingBottom:r.block.property("spacing","string","3rem"),borderRadius:r.block.property("borderRadius","string")})},[b("div",L,[t(f,{font:r.block.property("font")},{default:m(()=>[r.block.property("title")?(p(),d("h2",{key:0,class:"title mb-4",style:i({color:r.block.property("textColor")})},y(r.block.property("title","string",null,r.bindingData)),5)):g("",!0)]),_:1},8,["font"]),r.block.property("copy")?(p(),d("p",{key:0,class:"copy",style:i({color:r.block.property("textColor")})},y(r.block.property("copy","string",null,r.bindingData)),5)):g("",!0)]),b("div",F,[t(h,{ref:"form",class:"form items-start flex flex-col","form-name":`newsletter-subscribe-${r.block.id}`},{default:m(()=>[t(u,{modelValue:l.firstName,"onUpdate:modelValue":o[0]||(o[0]=c=>l.firstName=c),"field-name":"firstName",placeholder:"First name","auto-complete":"given-name",class:"mb-2","background-color":e.inputBgColor,"text-primary-color":r.block.property("textColor","string","#000"),"text-secondary-color":r.block.property("textColor","string","#000"),"text-error-color":r.block.property("textColor","string","#000"),"border-color":r.block.property("textColor","string","#000"),"border-focused-color":r.block.property("textColor","string","#000"),"border-error-color":r.block.property("textColor","string","#000"),"border-radius":r.block.property("formBorderRadius","string"),"validation-rules":{required:!0}},null,8,["modelValue","background-color","text-primary-color","text-secondary-color","text-error-color","border-color","border-focused-color","border-error-color","border-radius"]),t(u,{modelValue:l.email,"onUpdate:modelValue":o[1]||(o[1]=c=>l.email=c),placeholder:"Email","field-name":"email","auto-complete":"email","background-color":e.inputBgColor,"text-primary-color":r.block.property("textColor","string","#000"),"text-secondary-color":r.block.property("textColor","string","#000"),"text-error-color":r.block.property("textColor","string","#000"),"border-color":r.block.property("textColor","string","#000"),"border-focused-color":r.block.property("textColor","string","#000"),"border-error-color":r.block.property("textColor","string","#000"),"border-radius":r.block.property("formBorderRadius","string"),"validation-rules":{required:!0,email:!0},onSubmit:e.submit},null,8,["modelValue","background-color","text-primary-color","text-secondary-color","text-error-color","border-color","border-focused-color","border-error-color","border-radius","onSubmit"]),t(k,{text:r.block.property("buttonText","string","Subscribe",r.bindingData),primary:!!r.block.property("primaryActions","boolean",!1),"text-color":e.buttonColor,"border-color":e.buttonColor,"border-radius":r.block.property("buttonBorderRadius","string"),fill:!1,loading:l.loading,onClick:e.submit},null,8,["text","primary","text-color","border-color","border-radius","loading","onClick"]),t(C,{class:"privacy-policy text-base mt-6",text:"Privacy policy",href:"/privacy-policy",style:i({color:r.block.property("textColor","string","#000")})},null,8,["style"])]),_:1},8,["form-name"])])],6)],4)}const j=v(A,[["render",M],["__scopeId","data-v-05b31e62"]]);export{j as default}; 2//# sourceMappingURL=NewsletterSubscribe.b190650a.js.map
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.