1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1927],{91927:function(e,t,n){n.r(t),n.d(t,{SubscriptionForm:function(){return T},formSubscriptionTypeFragment:function(){return S},subscriptionTypesQuery:function(){return x}});var i=n(73235),l=n(32744),o=n(2784),a=n(17473),r=n(50644),s=n(6875),d=n(21090),u=n(63769),m=n(29283),c=n(81312),f=n(38718),p=n(79798),v=n(67292),g=n(67502),b=n(1930),y=n(760),h=n(3557);function _templateObject(){let e=(0,i._)(["\n fragment FormSubscription_Type on FormSubscription {\n id\n organisationName\n prefix\n name\n displayName\n selected\n isVisible\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,i._)(["\n query SubscriptionTypesQuery($orgName: String, $subTypePrefix: String) {\n getSubscriptionTypes(orgName: $orgName, subTypePrefix: $subTypePrefix) {\n ...FormSubscription_Type\n }\n }\n ","\n"]);return _templateObject1=function(){return e},e}let S=(0,d.ZP)(_templateObject()),x=(0,d.ZP)(_templateObject1(),S),T=(0,o.forwardRef)((e,t)=>{var n,i,d,S,T,Z,C,_,k,F,z,O,A,N,j,E;let{appearance:P="hero",subscriptionList:I,termsAndConditionsLabel:R,showSubscriptionOptions:D=!1}=e,[M,W]=(0,o.useState)({Receive_HTML_Emails__c:!0,Receive_SMS__c:!0}),[w,J]=(0,o.useState)({}),B=(0,o.useRef)(null),[H,L]=(0,o.useState)({}),[$,G]=(0,o.useState)(!1),{colors:Q,spacing:U,headings:q,mq:V,typography:X}=(0,f.useTheme)(),{siteMeta:{siteTag:K,title:Y}}=(0,c.ND)(),{executeRecaptcha:ee}=(0,a.xX)(),[et,{data:en,loading:ei}]=(0,r.D)(y.WW),el=null==en?void 0:null===(n=en.submitForm)||void 0===n?void 0:n.success;el&&setTimeout(()=>{(0,v.tx)(B)},500);let eo=(0,s.aM)(x,{variables:{orgName:(0,y.nf)(K),subTypePrefix:(0,y.RA)(K)}});(0,o.useEffect)(()=>{if(!D){var e,t;let n={};null==eo||null===(t=eo.data)||void 0===t||null===(e=t.getSubscriptionTypes)||void 0===e||e.forEach(e=>{var t;n[null==e?void 0:e.id]=null!==(t=null==e?void 0:e.selected)&&void 0!==t&&t}),W(e=>({...e,...n}))}},[null==eo?void 0:null===(i=eo.data)||void 0===i?void 0:i.getSubscriptionTypes]);let verifyAllInputFields=()=>{let e=b.J.map(e=>{let{isVerified:t,message:{messageText:n,messageId:i,messageGeneric:l}}=(0,y.JW)(e,M[e.name],M,K);return J(i=>({...i,[e.name]:{isError:!t,message:n}})),t||L(e=>({...e,[i]:l})),t});return!(e.indexOf(!1)>-1)},handleOnSubmit=async e=>{if(null==e||e.preventDefault(),L({}),G(!0),verifyAllInputFields()&&!el){if(!ee){L({recaptcha:"Recaptcha Failed"}),console.error("Recaptcha Failed"),G(!1);return}let e=[];Object.keys(M).forEach(t=>{b.J.some(e=>e.name===t)||!0!==M[t]||e.push(t)});let t=await ee("formSubmit");(0,c.h4)("Button","Submit","Forms","Subscription",""),et({variables:{formData:JSON.stringify({...M,subscriptions:e,recaptcha:t}),type:"subscription"}})}else G(!1)},ea=(0,o.useMemo)(()=>{var e,t;return null==eo?void 0:null===(t=eo.data)||void 0===t?void 0:null===(e=t.getSubscriptionTypes)||void 0===e?void 0:e.find(e=>!(null==e?void 0:e.selected)&&(null==e?void 0:e.name)&&((null==e?void 0:e.name.indexOf("Offers and Promotions"))>=0||(null==e?void 0:e.name.indexOf("Partner Offers"))>=0))},[null==eo?void 0:null===(d=eo.data)||void 0===d?void 0:d.getSubscriptionTypes]),er=(0,o.useMemo)(()=>b.J.filter(e=>(0,h.S)(e,M,K)),[M,K]);return(0,l.tZ)(o.Fragment,null,el?(0,l.tZ)(p.Container,null,(0,l.tZ)("div",{css:{maxWidth:"100%",[V.md]:{marginTop:"-".concat(U["9xl"])},marginTop:"-".concat(U["9xl"]),marginLeft:"auto",marginRight:"auto",textAlign:"center",color:Q.neutralDark},ref:B},(0,l.tZ)("h3",{css:{marginBottom:U["3xl"],[V.md]:{paddingTop:U["9xl"],fontSize:X.fontSize["4xl"]},paddingTop:U["9xl"],fontSize:X.fontSize["2xl"],fontFamily:q[3].fontFamily,fontWeight:q[3].fontWeight,color:q[3].color}},"Thank you for subscribing!")),(0,l.tZ)("div",{css:{marginBottom:U.xl,textAlign:"center"}},(0,l.tZ)(m.g,{href:"/"},(0,l.tZ)(u.ButtonThemed,{appearance:P},(0,l.tZ)("span",null,"Home"))))):(0,l.tZ)("div",{css:{maxWidth:"100%",marginLeft:"auto",marginRight:"auto",a:{textDecoration:"underline",cursor:"pointer"}}},(0,l.tZ)("div",{css:{display:"grid",gridTemplateColumns:"1fr ",[V.md]:{gridTemplateColumns:"1fr 1fr"},gridGap:"1em",'[data-comp="checkbox-label"]':{justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}},er.map((e,t)=>{var n,i,o,a;return(0,l.tZ)("div",{key:"".concat(null!==(o=null==e?void 0:e.id)&&void 0!==o?o:"","-").concat(t)},(0,y.tm)({type:e.type,fieldData:e,isError:null!=w&&null!==(n=w[e.name])&&void 0!==n&&!!n.isError,error:null!==(a=null==w?void 0:null===(i=w[e.name])||void 0===i?void 0:i.message)&&void 0!==a?a:"",value:M[e.name],onChange:t=>{W(n=>({...n,[e.name]:t}))},labelStyles:{fontFamily:X.fontFamily.sans,alignItems:"flex-end",fontSize:X.fontSize.md,[V.md]:{fontSize:X.fontSize.lg}},inputValues:M,siteTag:K}))}
1)),(0,l.tZ)("div",{css:{margin:"".concat(U["2xl"]," 0")}},(0,l.tZ)("div",{css:{display:"grid",gridTemplateColumns:"1fr ",[V.md]:{gridTemplateColumns:"1fr"},gridGap:"1em",alignItems:"flex-start",'[data-comp="checkbox-label"]':{justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}},ea&&(0,l.tZ)(g.j,{key:null==ea?void 0:ea.id,label:"I want to receive exclusive offers and promotions from our partners",id:null!==(O=null==ea?void 0:ea.id)&&void 0!==O?O:"",name:null!==(A=null==ea?void 0:ea.id)&&void 0!==A?A:"",disabled:null!=ea&&!!ea.selected,isError:null!=w&&null!==(S=w[null==ea?void 0:ea.id])&&void 0!==S&&!!S.isError,error:null!==(N=null==w?void 0:null===(T=w[null==ea?void 0:ea.id])||void 0===T?void 0:T.message)&&void 0!==N?N:"",value:M[null==ea?void 0:ea.id],placeholder:"",status:M[null==ea?void 0:ea.id],onChange:e=>{W(t=>({...t,[null==ea?void 0:ea.id]:e.target.checked}))},type:"checkbox",labelStyles:{fontFamily:X.fontFamily.sans,alignItems:"flex-end",fontSize:X.fontSize.md,[V.md]:{fontSize:X.fontSize.lg}}}),D&&(null==eo?void 0:null===(C=eo.data)||void 0===C?void 0:null===(Z=C.getSubscriptionTypes)||void 0===Z?void 0:Z.map(e=>(0,l.tZ)(g.j,{key:null==e?void 0:e.id,label:(null==e?void 0:e.name)||"",id:(null==e?void 0:e.id)||"",name:(null==e?void 0:e.name)||"",value:M[null==e?void 0:e.id],placeholder:"",status:M[null==e?void 0:e.id],onChange:t=>{W(n=>({...n,[null==e?void 0:e.id]:t.target.checked}))},type:"checkbox",labelStyles:{fontFamily:X.fontFamily.sans,alignItems:"flex-end",fontSize:X.fontSize.md,[V.md]:{fontSize:X.fontSize.lg}}}))),(0,l.tZ)("br",null),(0,l.tZ)(g.j,{label:R&&""!==R?R:"I have read and accept Rugby AU's <a href='https://australia.rugby/terms-and-conditions' target='_blank'>Terms of Use</a> and <a href='https://australia.rugby/privacy' rel='noreferrer' target='_blank'>Privacy Policy</a>. *",name:"TermsAndConditions",id:"TermsAndConditions",disabled:!1,isError:null!=w&&null!==(_=w.TermsAndConditions)&&void 0!==_&&!!_.isError,error:null!==(j=null==w?void 0:null===(k=w.TermsAndConditions)||void 0===k?void 0:k.message)&&void 0!==j?j:"",value:M.TermsAndConditions,placeholder:"",status:M.TermsAndConditions,onChange:e=>{W(t=>({...t,TermsAndConditions:e.target.checked}))},type:"checkbox",labelStyles:{fontFamily:X.fontFamily.sans,alignItems:"flex-end",fontSize:X.fontSize.md,[V.md]:{fontSize:X.fontSize.lg}}}))),H&&Object.keys(H).length>0&&"{}"!==JSON.stringify(H)?(0,l.tZ)("div",{className:"py-5 text-red text-md"},(0,l.tZ)("div",{className:"pb-2"},(0,l.tZ)("strong",null,"The form you submitted contained the following errors")),(0,l.tZ)("ul",null,Object.keys(H).map(e=>H[e]&&""!==H[e]?(0,l.tZ)("li",{key:e,className:"pb-1"},H[e]):null))):null,!el&&(null==en?void 0:null===(F=en.submitForm)||void 0===F?void 0:F.message)&&(0,l.tZ)("div",{className:"py-5 text-red text-center col-span-2",dangerouslySetInnerHTML:{__html:null!==(E=null==en?void 0:null===(z=en.submitForm)||void 0===z?void 0:z.message)&&void 0!==E?E:""}}),(0,l.tZ)("div",{css:{padding:"".concat(U.xl," 0")}},(0,l.tZ)("div",{css:{padding:"".concat(U.xl," 0"),textAlign:"center"}},(0,l.tZ)(u.ButtonThemed,{appearance:P,disabled:el||ei||$,onClick:e=>{handleOnSubmit(e)}},(0,l.tZ)("span",null,"Submit"))),(0,l.tZ)("div",{css:{textAlign:"center",color:Q.neutral}},(0,l.tZ)("span",null,"This site is protected by reCAPTCHA and the Google ",(0,l.tZ)(m.g,{href:"https://policies.google.com/privacy"},"Privacy Policy")," and ",(0,l.tZ)(m.g,{href:"https://policies.google.com/terms"},"Terms of Service")," apply. ")))))})}}]);
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.