(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{cUSr:function(e,t,a){"use strict";a.r(t),a.d(t,"query",(function(){return h}));var n=a("ERkP"),i=a.n(n),l=(a("Wbzz"),a("j/s1")),r=a("ztYB"),o=a("5IRb"),c=a("AiFK"),u=a("Fzi1"),d=a("nlQg"),s=a("Q/Mu"),m=a("NM4f"),g=a("j1Vk"),f=a("rOcY"),b=a.n(f),v=a("YJ8y");t.default=function(e){var t,a,f,h=e.data,p=e.pageContext,x=Object(d.j)().auth,E=function(e){var t=e.queryStringKey,a=void 0===t?"key":t,i=e.queryStringTargetValueArray,l=void 0===i?["value"]:i,r=e.queryStringDefaultValue,o=void 0===r?"":r,c=Object(n.useState)(o),u=c[0],d=c[1],s=Object(n.useState)(!1),g=s[0],f=s[1];return Object(n.useEffect)((function(){if("undefined"!=typeof window){var e=Object(m.h)(a);d(e),l.includes(e)&&f(!0)}}),[d,f]),[u,d,g]}({queryStringKey:"passcode",queryStringTargetValueArray:null===(t="xboxseriesjournalistpass1,xboxseriesjournalistpass2,xboxseriesjournalistpass3,xbox188939,xbox277848,xbox322329,xbox454232,xbox577232")?void 0:t.split(",")}),y=E[0],j=(E[1],E[2]),S=x.production,w=p.preview,O=p.locale,k=null==h||null===(a=h.login)||void 0===a||null===(f=a.nodes)||void 0===f?void 0:f[0],V="en-US"===O?"":"/"+O,T=w?V+"/preview/?t=xbox&id=4c4o2bt9cRrhdKVqGZlnlO":""+(V||"/");return i.a.createElement(l.b,{theme:c.a},i.a.createElement(d.a,{locale:O},i.a.createElement(v.a,{config:b.a,lang:null==p?void 0:p.locale,metaTitle:null==k?void 0:k.metaTitle,metaDescription:null==k?void 0:k.metaDescription}),i.a.createElement(r.a,null),S&&i.a.createElement(s.a,{preview:w,homeSlug:T,loginPage:!0}),i.a.createElement("div",{style:{height:"61px"}}),i.a.createElement(o.a,null,i.a.createElement(g.a,Object.assign({},k,{autoLogin:j,accessCode:y}))),S&&i.a.createElement(u.a,{preview:w,homeSlug:T})))};var h="441044355"},j1Vk:function(e,t,a){"use strict";var n=a("+wNj"),i=a("ERkP"),l=a.n(i),r=a("yOvl"),o=a("NM4f"),c=a("nlQg"),u=a("/YxM"),d=a("VxqT"),s=a("IYf8"),m=a("wZuh"),g=a("ljKo"),f=a("Qwor"),b=a("3ZKo"),v=function(){var e=Object(g.e)(),t=e.errors,a=e.isSubmitting,n=e.isValidating;return Object(i.useEffect)((function(){if(a&&!n){var e=Object.keys(t);if(e.length>0){var i=e.map((function(e){return"[name="+e+"]"}));document.querySelector(i[0])&&i.forEach((function(e){document.querySelector(e).style.border="1px solid red"}))}}}),[t,a,n]),null},h=function(e){var t=e.children,a=e.success,n=e.id;return l.a.createElement(f.g,{color:a?"green":"red",role:"status",fontSize:[12],id:a?0:n+"-error",m:[1]},t)},p=function(e){var t=e.title,a=e.formValues,n=void 0===a?{}:a,i=e.handleSubmit,r=e.ctaText,o=e.placeholderText,c=e.validate,u=e.alignItems,d=n.initVals,s=n.formValueArr;return l.a.createElement(f.b,{width:[1],my:"40px"},l.a.createElement(g.d,{initialValues:d.initValues,validateOnChange:!1,validateOnBlur:!1,validate:c,onSubmit:i,enableReinitialize:!0},(function(e){var a=e.isSubmitting,n=e.errors,i=e.values,c=(e.initialValues,e.handleBlur),m=e.handleChange,p=e.touched;return l.a.createElement(f.f,{width:[1],role:"form","aria-label":t},l.a.createElement(f.b,{display:"flex",justifyContent:"space-between",flexWrap:"wrap"},l.a.createElement(f.b,{width:[.8,.6],pr:[3]},null==s?void 0:s.map((function(e){var t,a,r;return l.a.createElement(f.b,{key:e,width:[1],height:"80px"},l.a.createElement("label",{htmlFor:e},l.a.createElement(f.e,{mb:[2],letterSpacing:"1px",fontWeight:"bold",height:"46px",color:"white",fontSize:"15px",padding:"13px 20px",bg:"black",fontFamily:"headings",border:"1px solid #ffffff80","aria-label":null==d||null===(t=d.type)||void 0===t?void 0:t[e],type:null==d||null===(a=d.type)||void 0===a?void 0:a[e],name:e,placeholder:!d.initValues[e]&&(null==d||null===(r=d.placeholder)||void 0===r?void 0:r[e])||o,onChange:m,onBlur:c,value:i[e],width:[1],"aria-invalid":!(!n[e]||!p[e])||null,"aria-describedby":n[e]&&p[e]?"login-error":null,style:{opacity:"50%"}})),l.a.createElement(g.a,{name:e},(function(t){return l.a.createElement(h,{id:e},t)})))}))),l.a.createElement(f.a,{display:"flex",alignItems:u,mt:[3,0],width:[1,.4],height:["auto","126px"]},l.a.createElement(b.b,{type:"submit",role:"button",height:"46px"},a?"Loading...":r)),l.a.createElement(v,null)))})))},x=a("j/s1"),E=a("GkOb"),y=(x.e.div.withConfig({componentId:"sc-17s4snz-0"})(["display:flex;"," "," "," "," "," "," "," ",""],E.i,E.h,E.c,E.d,E.e,E.i,E.f,E.b),x.e.div.withConfig({componentId:"sc-17s4snz-1"})([""," "," "," "," "," "," "," ",""],E.i,E.h,E.c,E.d,E.e,E.i,E.f,E.b),x.e.button.withConfig({componentId:"sc-17s4snz-2"})(["border:none;cursor:pointer;font-size:16px;"," "," "," "," "," "," "," ",""],E.i,E.h,E.c,E.d,E.e,E.i,E.f,E.b),function(e){var t=e.children,a=Object(n.a)(e,["children"]);return t?l.a.createElement(s.c,a,t):null}),j=function(e){var t,a=e.eyebrow,n=e.title,i=e.subtitle;return l.a.createElement(l.a.Fragment,null,l.a.createElement(y,{fontSize:7,lineHeight:1.25,letterSpacing:"0.2rem",color:"dark.text.secondary",fontWeight:"light",marginBottom:2},a),l.a.createElement(s.e,{fontSize:2,lineHeight:1.2,fontWeight:900,color:"dark.text.primary",paddingBottom:"15px",fontFamily:"headings",marginBottom:2,dangerouslySetInnerHTML:{__html:(t=n,t?t=t.split(" | ").join('
'):null)}}),l.a.createElement(y,{fontSize:3,lineHeight:1.25,letterSpacing:"0.2rem",color:"dark.text.secondary",fontWeight:"light"},i))},S=function(e){var t=e.slug,a=e.formValues,i=e.validate,r=Object(n.a)(e,["slug","formValues","validate"]);return l.a.createElement(s.b,{textAlign:"left",width:[1,1,1,.5]},l.a.createElement(j,r),l.a.createElement(p,Object.assign({formValues:a,validate:i,slug:t},r)))},w=function(e){var t=e.bg,a=e.ctaLink,i=e.columns,r=void 0===i?[]:i,o=Object(n.a)(e,["bg","ctaLink","columns"]);return l.a.createElement(d.a,t,l.a.createElement(s.b,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:[1],fontFamily:"headings"},l.a.createElement(S,Object.assign({slug:a},o)),l.a.createElement(s.b,{textAlign:"left",width:[1,1,1,.5]},l.a.createElement(m.a,{columns:r,horizontalAlignment:"center",maxWidth:"100%"}))))},O=function(e){var t=e.ctaLink,a=(e.ctaText,e.placeholderText,Object(n.a)(e,["ctaLink","ctaText","placeholderText"]));return l.a.createElement(s.b,{display:"flex",flexWrap:"wrap",minHeight:"75vh",alignItems:"center"},l.a.createElement(s.b,{width:[1,1,1,3/4],px:[4,4,6]},l.a.createElement(s.e,{fontSize:2,lineHeight:1.2,fontWeight:900,color:"dark.text.primary",paddingBottom:"15px",fontFamily:"headings"},"WELCOME"),l.a.createElement(p,Object.assign({slug:t,ctaText:"ACCESS SITE",placeholderText:null,alignItems:"flex-end"},a))))},k=a("Wbzz");t.a=function(e){var t,a,i,d,s,m,g=e.ctaLink,f=e.heroImage,b=e.errorMessage,v=e.background,h=e.autoLogin,p=void 0!==h&&h,x=e.accessCode,E=void 0===x?"":x,y=Object(n.a)(e,["ctaLink","heroImage","errorMessage","background","autoLogin","accessCode"]),j=Object(c.h)().locale,S=Object(c.j)().auth,V=S.setIsAuthenticated,T=S.isAuthenticated,z=S.production,C=S.setProd,I=Object(r.b)(v),L=Object(o.b)(z,b,p,E),W=function(e){var t={};return L.formValueArr.forEach((function(a){e[a]?Object(o.i)(e[a],L.initVals.validSchema[a],z,L.initVals.valType[a])&&(t[a]=Object(o.i)(e[a],L.initVals.validSchema[a],z,L.initVals.valType[a])):t[a]="Required"})),t},q=function(e,t){setTimeout((function(){var e;T?(Object(k.navigate)(null==g||null===(e=g[0])||void 0===e?void 0:e.slug),t.setSubmitting(!1)):z?V(!0):(C(!0),t.setSubmitting(!1))}),500)},A=f&&[{layout:"Transparent Background",mainContent:[Object.assign({},null==f?void 0:f[0],{src:null==f||null===(t=f[0])||void 0===t||null===(a=t.source)||void 0===a?void 0:a.fluid})],width:100}],B="en-US"===j?null==g||null===(i=g[0])||void 0===i?void 0:i.slug:"/"+j+"/"+(null==g||null===(d=g[0])||void 0===d?void 0:d.slug);return T?l.a.createElement(u.a,{to:B}):z?l.a.createElement(w,Object.assign({handleSubmit:q,columns:A,validate:W,bg:I,formValues:L,ctaLink:null==g||null===(m=g[0])||void 0===m?void 0:m.slug},y)):l.a.createElement(O,Object.assign({handleSubmit:q,validate:W,formValues:L,ctaLink:null==g||null===(s=g[0])||void 0===s?void 0:s.slug},y))}}}]); //# sourceMappingURL=component---src-templates-login-js-a060b3a6ccf86a5d3bca.js.map