You are on page 1of 3

(window.webpackJsonp=window.webpackJsonp||[]).

push([[8],{"/t/b":function(e,t,n)
{},"87DN":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",
{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var
a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!
0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return
n&&e(t.prototype,n),a&&e(t,a),t}}
(),i=h(n("q1tI")),o=h(n("jKim")),r=h(n("TSYQ")),s=(h(n("jklw")),h(n("2vwu"))),l=h(n
("fmDt")),u=n("HLYg"),_=h(n("zL4Z")),d=h(n("LELw")),c=h(n("wcQl")),p=h(n("//g3"));f
unction h(e){return e&&e.__esModule?e:{default:e}}n("/t/b");var f=function(e)
{function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call
a class as a function")}(this,t);var n=function(e,t){if(!e)throw new
ReferenceError("this hasn't been initialised - super() hasn't been called");return!
t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||
Object.getPrototypeOf(t)).call(this,e));return
n.TYPE="join",n.enclosing_class("auto__shared_modals_login_join"),n.state={errors:
[],hidden_error:"",loading:!1},n}return function(e,t){if("function"!=typeof
t&&null!==t)throw new TypeError("Super expression must either be null or a
function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:
{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?
Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_.default),a(t,
[{key:"validate",value:function(){if(!this.state.loading){var
e=[],t=this.name_input.value.trim();t.length?u.name_regex.test(t)||
e.push({input:"word_user[name]",message:o.default.t("shared.login.join_lightbox.inv
alid_character_in_name_please_remove")}):e.push({input:"word_user[name]",message:o.
default.t("shared.login.join_lightbox.please_enter_a_name")});var
n=this.email_input.value.trim();return n.length?u.email_regex.test(n)||
e.push({input:"email_address[email]",message:o.default.t("shared.login.join_lightbo
x.that_doesn_t_appear_to_be_a")}):e.push({input:"email_address[email]",message:o.de
fault.t("shared.login.join_lightbox.please_enter_a_valid_email")}),this.password_in
put.value.trim().length<6&&e.push({input:"word_user[password]",message:o.default.t(
"shared.login.join_lightbox.please_enter_a_password_that_is")}),this.setState({erro
rs:e,loading:!1}),!e.length}}},{key:"handle_error",value:function(e){var
t=this,a=e.msg||
o.default.t("shared.login.join_lightbox.we_couldn_t_complete_your_request"),i=e.inp
ut_name,r=[{input:i,message:a}];if("email_taken"==a){var s=e.data&&e.data.email?
e.data.email:this.container.querySelector("[name='email_address[email]']").value;th
is.props.create_modal({component_loader:function(){return new Promise(function(e)
{n.e(26).then(function(t)
{e(n("r11G"))}.bind(null,n)).catch(n.oe)})},props_loader:function(){return
Promise.resolve(Object.assign({},t.props,
{email:s}))},handle_load_complete:function(){return
t.close()},focus_target:this.props.focus_target}),this.track_rats("signup_lightbox:
error:view",
{error_type:"existing_email"})}this.track_rats("signup_lightbox:error:view",
{error_type:"invalid_"+i}),this.setState({errors:r,loading:!1})}},
{key:"handle_success",value:function(){var
e=this;this.track_rats("signup_lightbox:successful_submission:view"),this.props.cre
ate_modal({component_loader:function(){return new Promise(function(e)
{n.e(0).then(function(t)
{e(n("W5So"))}.bind(null,n)).catch(n.oe)})},redirect_method:function()
{e.close();var
t=e.props.subscribe_url;e.props.next_url&&(t=e.props.next_url),"download"===e.props
.login_params.source&&(window.location.hash="#download",t=window.location.href),win
dow.setTimeout(function(){window.location=t,e.props.next_url||
window.location.reload()},50)},sub_title:o.default.t("shared.login.loading_lightbox
.now_bringing_you_back"),title:o.default.t("shared.login.loading_lightbox.sign_up_s
uccessful"),user_dismiss:!1}),this.close()}},
{key:"handle_show_login_click",value:function(e){var
t=this;e.preventDefault(),this.props.create_login_modal({props_loader:function()
{return Promise.resolve(t.props)},handle_load_complete:function(){return
t.close()}})}},{key:"send_scaled_inference_event",value:function(e){var
t=this;return function(){var
n=t.props.scaled_inference_context,a=n.primary_use_case_event,i=n.main_ancestor_cat
egory,o=n.language;p.default.observe_location(p.default.PROJECT_KEYS.customized_pla
ns),p.default.observe(p.default.PROJECT_KEYS.customized_plans,"doc_signup_click",
{doc_use_case:a,main_ancestor_category:i,doc_language:o,method:e}),p.default.observ
e(p.default.PROJECT_KEYS.download_modal,"doc_signup_click",
{doc_use_case:a,main_ancestor_category:i,doc_language:o,method:e})}}},
{key:"render_facebook_button",value:function(){var
e=this.props,t=e.account_settings_path,n=e.facebook_permissions,a=e.facebook_sessio
n_path,r=e.id,s=e.login_params;return i.default.createElement(d.default,
{account_settings_path:t,facebook_permissions:n,facebook_session_path:a,handle_succ
ess:this.handle_success,label:o.default.t("shared.login.base_lightbox.sign_up_with_
facebook"),login_params:s,modal_id:r,optin:this.optin_input?
this.optin_input.value:null,type:"join",handle_click:this.send_scaled_inference_eve
nt("facebook")})}},{key:"render_google_button",value:function(){var
e=this.props,t=e.account_settings_path,n=e.google_client_id,a=e.google_session_path
,r=e.id,s=e.login_params;return i.default.createElement(c.default,
{account_settings_path:t,google_client_id:n,google_session_path:a,handle_success:th
is.handle_success,label:o.default.t("shared.login.base_lightbox.sign_up_with_google
"),login_params:s,modal_id:r,optin:this.optin_input?
this.optin_input.value:null,type:"join",handle_click:this.send_scaled_inference_eve
nt("google")})}},{key:"render_header",value:function(){return
i.default.createElement("div",null,this.render_modal_title(this.props.title||
o.default.t("shared.login.join_lightbox.join_today_and_read_free_for")))}},
{key:"render_disclaimer",value:function(){var
e=this.props.static_terms_path,t=this.props.static_privacy_path,n=o.default.t("shar
ed.login.base_lightbox.by_registering_a_scribd_account_you",
{terms_href:e,privacy_href:t});return i.default.createElement("div",
{className:"join_disclaimer",dangerouslySetInnerHTML:{__html:n}})}},
{key:"render_form",value:function(){var e=this;return
i.default.createElement("form",
{action:this.props.login_signup_path,method:"post",onSubmit:this.handle_submit.bind
(this),ref:function(t){return
e.form=t}},i.default.createElement("fieldset",null,i.default.createElement("legend"
,
{className:"visually_hidden"},o.default.t("shared.login.join_lightbox.sign_up_with_
email")),i.default.createElement("div",
{className:"inputs"},i.default.createElement(l.default,
{className:"input",errors:this.state.errors,hide_required:!
0,label:o.default.t("shared.login.join_lightbox.name"),maxLength:50,name:"word_user
[name]",input_ref:function(t){return e.name_input=t},required:!
0,type:"text"}),i.default.createElement(l.default,
{className:"input",errors:this.state.errors,hide_required:!
0,label:o.default.t("shared.login.join_lightbox.email"),name:"email_address[email]"
,input_ref:function(t){return e.email_input=t},required:!
0,type:"text"}),i.default.createElement(l.default,
{className:"input",errors:this.state.errors,help_text:o.default.t("shared.login.joi
n_lightbox.at_least_6_characters"),hide_required:!
0,label:o.default.t("shared.login.join_lightbox.password"),name:"word_user[password
]",input_ref:function(t){return e.password_input=t},required:!
0,type:"password"})),i.default.createElement("label",
{className:"join_option"},i.default.createElement("input",
{type:"checkbox",defaultChecked:!this.props.in_eu,name:"optin",ref:function(t)
{return
e.optin_input=t},value:"y"}),i.default.createElement("span",null,o.default.t("share
d.login.join_lightbox.send_me_updates_from_scribd"))),i.default.createElement("div"
,{className:"button_container"},i.default.createElement(s.default,
{type:"submit",className:(0,r.default)("submit_btn",
{loading:this.state.loading}),text:o.default.t("shared.login.join_lightbox.sign_up"
),disabled:this.state.loading,onClick:this.send_scaled_inference_event("standard")}
)),this.render_disclaimer(),i.default.createElement("div",
{className:"login_alt"},i.default.createElement("div",null,o.default.t("shared.logi
n.join_lightbox.already_have_an_account")+" ",i.default.createElement("a",
{href:"#",className:"last_lb_item",onClick:this.handle_show_login_click},o.default.
t("shared.login.join_lightbox.sign_in"))))))}}]),t}
();t.default=f},HLYg:function(e,t,n){"use
strict";Object.defineProperty(t,"__esModule",{value:!0});t.name_regex=/^[^\!\#\$\
%\&\*\+\<\=\>\?\@\\\^\_\`\{\}\|\~]+$/,t.email_regex=/^(([^<>()\[\]\\.,;:\s@"]+(\.
[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]
{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/},YECk:function(e,t,n){"use
strict";Object.defineProperty(t,"__esModule",{value:!
0});t.mapStateToProps=function(e)
{return{scaled_inference_context:e.scaled_inference_context}}},inV7:function(e,t,n)
{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e)
{return e&&e.__esModule?e:{default:e}}
(n("87DN")),i=n("/MKj"),o=n("YECk");t.default=(0,i.connect)(o.mapStateToProps,null)
(a.default)}}]);