69e0d627f0c931ce2afef2f4975e7fbac0df1556dba69fb12cc9808a2726b0fd

Source Code:

(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{694:function(t,e,s){"use strict";s.r(e);var a=s(8),n=s.n(a),i=s(3),o=s.n(i),l=s(2),r=s.n(l),c=s(5),h=s.n(c),u=s(4),p=s.n(u),m=s(9),d=s.n(m),w=s(6),S=s.n(w),v=s(0),f=s.n(v),b=s(19),y=s(16),g=s(764),k=s.n(g),E=s(10),N=s(7),O=s.n(N),C=s(15),L=s.n(C),I=s(316),R=s(1),A=s.n(R),F=s(43),T=s(321),H=s(691),x=function(t){function e(t){var s;return o()(this,e),(s=h()(this,p()(e).call(this,t))).state={showRecaptcha:A()(s.props,"showSubmit"),showSubmit:A()(s.props,"showSubmit"),recaptchaResponse:null,sailthruSub:"",email:"",showInput:!0,list:A()(s.props,"params.lists.0"),hasSubmitted:!1,showNewsletterOverlay:!1,forceNewsletterOverlay:!0},s.handleEmail=s.handleEmail.bind(d()(s)),s.handleList=s.handleList.bind(d()(s)),s}return S()(e,t),r()(e,[{key:"shouldComponentUpdate",value:function(t,e){return O()(this,t,e)}},{key:"componentWillReceiveProps",value:function(t){var e=A()(this.props,"info.id");A()(t,"newsletter.".concat(e))&&("loading"==A()(t,"newsletter.".concat(e,".status"))?this.setState({showRecaptcha:!1}):A()(t,"newsletter.".concat(e,".data"))&&(A()(t,"newsletter.".concat(e,".data.error"))?this.setState({showRecaptcha:!0}):A()(t,"newsletter.".concat(e,".data.success"))&&(this.setState({showInput:!1}),this.setState({showRecaptcha:!1}),this.setState({showSubmit:!1}))))}},{key:"componentWillUnmount",value:function(){this.state.hasSubmitted||"social overlay"!==this.props.location||this.props.eventFn(this.props.location,"closed","")}},{key:"onClick",value:function(t,e){this.setState({showRecaptcha:!0})}},{key:"handleEmail",value:function(t){this.setState({sailthruSub:t.target.value})}},{key:"handleHoneypot",value:function(t){this.setState({email:t.target.value})}},{key:"handleList",value:function(t){this.setState({list:t})}},{key:"handleSailthru",value:function(t){var e=this.props,s=e.fetchSailthru,a=e.params,n=e.stSource,i=A()(this.props,"info.id",""),o=""===this.state.list?a.lists[0]:this.state.list;null===t||this.props.showSubmit?this.props.showSubmit&&"click"==t.type&&(t.preventDefault(),this.setState({recaptchaResponse:window.grecaptcha.getResponse()}),this.setState({hasSubmitted:!0}),s(i,this.state.email,this.state.sailthruSub,window.grecaptcha.getResponse(),o,n)):(this.setState({recaptchaResponse:t}),this.setState({hasSubmitted:!0}),s(i,this.state.email,this.state.sailthruSub,this.state.recaptchaResponse,o,n))}},{key:"launchSocialOverlay",value:function(){this.setState({showNewsletterOverlay:!0,forceNewsletterOverlay:!0})}},{key:"collapseSocialOverlay",value:function(){this.setState({showNewsletterOverlay:!1})}},{key:"render",value:function(){var t=this,e=this.props,s=e.params,a=e.newsletter,i=e.options,o=A()(this.props,"info.id",""),l=L()({recaptcha:!0}),r=A()(a,o,!1),c=L()("newsletter-frame clearfix",{submitted:this.state.hasSubmitted,"recaptcha-visible":this.state.showRecaptcha,"newsletter-processing":r&&r.status&&"loading"===r.status});if(!s.lists||!s.lists.length)return f.a.createElement("div",{className:"widget error","data-error":"missing list"});var h=[],u=!this.props.isMaintop,p=(1===s.lists.length?f.a.createElement("input",{type:"hidden",name:"list",value:this.state.list}):f.a.createElement(k.a,{name:"list",data:s.lists,placeholder:"Select a Mailing List",value:this.state.list,onChange:function(e){return t.handleList(e)}}),[]);return r&&(r.status&&"loading"==r.status&&(p=f.a.createElement(F.default,{width:"30px",color:"#000",strokeWidth:"4"})),r.data&&(r.data.error?h=f.a.createElement("span",{className:"error"},r.data.error):r.data.success&&("social-overlay"==o&&this.props.onSignupClick?(h=f.a.createElement("span",{dangerouslySetInnerHTML:E.a.createInnerHtmlFromText(r.data.success),onClick:function(e){return t.props.onSignupClick(e)}}),this.props.eventFn(this.props.location,"newsletter submission","")):(h=f.a.createElement("span",{dangerouslySetInnerHTML:E.a.createInnerHtmlFromText(r.data.success)}),this.props.eventFn(this.props.location,"newsletter submission","")),[]))),f.a.createElement("div",null,f.a.createElement("form",{method:"post",className:c},f.a.createElement("div",{className:"content clearfix"},!this.props.hasSponsor&&this.props.showTitle&&s.title&&f.a.createElement("p",{className:"title"},s.title),this.props.showDescription&&f.a.createElement("section",{className:"sub-title"},f.a.createElement("h2",{className:"description"},s.description)),f.a.createElement("div",{className:"newsletter-fields vertical-center"},f.a.createElement("div",{className:"vertical-centered"},f.a.createElement("input",{type:"text",name:"email",value:this.state.email,className:"sailthru-email",autoComplete:"off",onChange:function(e){return t.handleHoneypot(e)}}),this.state.showInput&&f.a.createElement("input",{type:"email",name:"sailthru-sub",placeholder:this.props.isMaintop&&this.props.isSkin?"Sign up for our Newsletter":"Email Address",onClick:function(e){return t.onClick(e,o)},value:this.state.sailthruSub,onChange:function(e){return t.handleEmail(e)}}),this.props.hasSocialOverlayLaunchButton&&f.a.createElement("div",{className:"social-overlay-launcher cto",title:s.buttonLabel||"Subscribe to our Newsletter",onClick:function(){return t.launchSocialOverlay()}},s.buttonLabel||"Subscribe to our Newsletter"),p,h,this.state.showRecaptcha&&f.a.createElement(T.a,{className:l,ref:function(e){t.refID=e},sitekey:"6LcJiB4TAAAAAECLVme8vQvvFHGESasoeSFJqTAn",onChange:function(e){return t.handleSailthru(e)}}),this.state.showSubmit&&f.a.createElement("button",{type:"submit",value:"Sign Up Now",onClick:function(e){return t.handleSailthru(e)}},"Subscribe Now"))))),this.props.hasSocialOverlayLaunchButton&&f.a.createElement(H.default,n()({options:i,checkOnLoad:u},{forceNewsletterOverlay:this.state.forceNewsletterOverlay,socialInfo:this.props.getSocialInfo(i),socialOverlayInfo:this.props.getSocialOverlayInfo(i),socialOverlayId:"maintop-newsletter-overlay",logos:this.props.getLogos(i),blogInfo:this.props.getBlogInfo(i),pageUrl:A()(i,"unfriendlyRequestUrl","").split("?")[0],showOverlay:this.state.showNewsletterOverlay,collapseCallback:function(){return t.collapseSocialOverlay()}})))}}]),e}(f.a.Component);x.defaultProps={showSubmit:!1,showDescription:!1,showTitle:!0,hasSponsor:!1,hasSubmitted:!1,location:"standard",eventFn:function(){},hasSocialOverlayLaunchButton:!1},e.default=Object(y.connect)(function(t){return{newsletter:t.newsletter,isSkin:A()(t,"ads.adsOOP.isSkin",!1),options:t.json.response.options}},function(t){return Object(b.bindActionCreators)({fetchSailthru:I.c},t)})(x)}}]);