!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@aef81dd"};var a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="8451aad0-e3a9-42fc-99b1-a597d476022b",e._sentryDebugIdIdentifier="sentry-dbid-8451aad0-e3a9-42fc-99b1-a597d476022b")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["89211"],{56335:function(e,a,t){t.d(a,{A:()=>n});let n={placeholder:"placeholder-ICMYsF",pulse:"pulse-_o4ZmV"}},97432:function(e,a,t){t.d(a,{A:()=>w});var n=t(99851),i=t(69277),r=t(70408),l=t(79785),s=t(4006),o=t(32485),c=t.n(o),d=t(17402),u=t(34206),h=t(84605),g=t(34835),f=t(86500),p=t(1683),m=t(68349),y=t(35369),b=t(85329),_=t(63136),Y=t(21398),k=t(40659),E=t(39318),v=t(41086),S=t(80856),P=t(82776),I=t(57324),C=t(27569);function B(){let e=(0,l._)(["Confirmation required: we sent an email to ",". Click the link there to finish subscribing."]);return B=function(){return e},e}class w extends d.Component{getSavedEmail(){return this.props.user&&this.props.user.email||null}getPrefilledEmail(){return this.props.email||this.props.freeSignupEmail||this.getSavedEmail()}async componentDidMount(){let{autoFocus:e,disabled:a}=this.props;if(this.getPrefilledEmail())this.emailInput.value=this.getPrefilledEmail();else if(e&&!(this.getPrefilledEmail()||a)&&!(0,m.rr)()){var n;null==(n=this.emailInput)||n.focus()}t.e("40837").then(t.bind(t,24548)).then(e=>{this.setState({fetchSuggestion:e.fetchSuggestion})})}onLoadingState(e){this.setState({loading:e,requires_confirmation:!1})}onError(e){var a;(null==(a=e.response)?void 0:a.status)===425&&this.setState({requires_confirmation:!0}),this.props.onError&&this.props.onError(e)}render(){var e,a,n,r,l,o,d;let{children:h,className:g,disabled:f,allowEmptyInput:B,expectTruncation:w,isWelcomePageColor:N,loginRedirect:T,next:F,onAccentBackground:A,pub:D,referralCode:R,showLogin:x,showTerms:Q,source:U,submitButtonText:O,useSubscribeLink:q,useGenericEndpoint:V,additionalPubIds:j,user:L,utm_campaign:M,onPrepareData:W,promptClassName:H,inputWrapperClassName:J,inputClassName:K,subscribeButtonClassName:z,subscribeToSpecificSectionIds:G,endpointOverride:X,separateInputAndSubmitButton:Z,placeholder:$}=this.props,{loading:ee,requires_confirmation:ea,currentEmail:et}=null!=(d=this.state)?d:{},en="treatment_bold_fade"===U,ei=(null==(n=(0,v.y)("referring_pub_ids"))||null==(a=n.split)||null==(e=a.call(n,","))?void 0:e[0])||void 0,er=(null==(o=(0,v.y)("referring_pub_ids"))||null==(l=o.split)||null==(r=l.call(o,","))?void 0:r.slice(1))||void 0,el=this.getPrefilledEmail(),{iString:es,language:eo}=this.context;if(G&&(j||V))throw Error("Specific section subscriptions only supported on /api/v1/free");let ec=!X&&!j;return(0,s.FD)("div",{className:c()(g,C.A.container),children:[(0,s.Y)(k.HM.Consumer,{children:e=>{var a,t,n,r,l,o,d;let{getSessionAttribution:g}=e;return(0,s.FD)(u.Ay,{ref:this.assignForm,className:C.A.form,noInlineErrors:!0,action:X||(j?(0,E.yRP)("/api/v1/bulk_signup"):V?(0,E.yRP)("/api/v1/reader/signup/pub"):(0,E.yRP)("/api/v1/free")),noJsAction:X||(j?(0,E.yRP)("/api/v1/bulk_signup",{nojs:!0}):V?(0,E.yRP)("/api/v1/reader/signup/pub",{nojs:!0}):(0,E.yRP)("/api/v1/free",{nojs:!0})),prepareData:async e=>{if(ea&&(e.resend_confirmation=!0),"string"==typeof e.publications&&(e.publications=JSON.parse(e.publications)),"undefined"!=typeof window&&ec){let a=await g();e=(0,i._)({},a,e)}return W&&await W(e),e},onChangeLoadingState:this.onLoadingState.bind(this),onError:e=>this.onError(e),onSuccess:e=>this.onSuccess(e),typoFound:e=>this.setState({emailSuggestion:e}),disableSubmit:q,analyticsName:"Free Email Form",children:[(0,s.Y)("input",{type:"hidden",name:"first_url",value:p.R9}),(0,s.Y)("input",{type:"hidden",name:"first_referrer",value:p.b7}),(0,s.Y)("input",{type:"hidden",name:"current_url",value:p.AT}),(0,s.Y)("input",{type:"hidden",name:"current_referrer",value:p.uC}),(0,s.Y)("input",{type:"hidden",name:"first_session_url",value:p.K0}),(0,s.Y)("input",{type:"hidden",name:"first_session_referrer",value:p.OG}),(0,s.Y)("input",{type:"hidden",name:"referral_code",value:R}),(0,s.Y)("input",{type:"hidden",name:"source",value:U}),(0,s.Y)("input",{type:"hidden",name:"referring_pub_id",value:ei}),(0,s.Y)("input",{type:"hidden",name:"additional_referring_pub_ids",value:null==er?void 0:er.join(",")}),F&&(0,s.Y)("input",{type:"hidden",name:"redirect",value:F}),G&&(0,s.Y)("input",{type:"hidden",name:"specific_section_ids",value:G}),G&&(0,s.Y)("input",{type:"hidden",name:"section_and_root",value:"true"}),!j&&V&&(0,s.Y)("input",{type:"hidden",name:"publication_id",value:D.id}),j&&(0,s.Y)("input",{type:"hidden",name:"publications",value:JSON.stringify(j.concat(D.id))}),(0,s.FD)("div",{className:c()(H,{[C.A.sideBySideWrap]:!Z}),children:[!!el&&(0,m.o7)(),(0,s.Y)("div",{className:c()(J,C.A.emailInputWrapper,{[null!=(n=C.A.emailInputWrapperExpectTruncation)?n:"undefined"]:w}),children:(0,s.Y)(b.j,{className:c()(K,"pencraft",C.A.emailInput,{[null!=(r=C.A.emailInputOnAccentBackground)?r:"undefined"]:A,[null!=(l=C.A.emailInputExpectTruncation)?l:"undefined"]:w,[null!=(o=C.A.emailInputOnWelcomePage)?o:"undefined"]:N}),onChange:this.handleEmailChange,onInput:this.handleEmailChange,ref:this.assignEmailInput,name:en?"email-pop":"email",readOnly:!!(this.getSavedEmail()||ee||f),disabled:!!(ee||f),placeholder:null!=$?$:es("Type your email..."),value:et||el||null})}),(0,s.Y)(y.Nm,{resetCss:!0,className:c()(z,"rightButton primary subscribe-btn",C.A.button,{pop:en,[null!=(d=C.A.buttonOnAccentBackground)?d:"undefined"]:A}),type:"submit",disabled:!!(ee||f||!B&&!(null==(t=this.emailInput)||null==(a=t.value)?void 0:a.trim())),onClick:()=>{q&&(location.href=(0,E.eV6)(D,(0,i._)({addBase:!0,user:L,utm_source:I.VU.substack,utm_medium:I.Jn.web,utm_campaign:M,next:F},(et||el)&&{email:et||el})))},children:(0,s.Y)("span",{className:"button-text ".concat(en?"pop":""),children:O||(0,P.getSubscribeText)(D,{language:eo})})})]}),ea?(0,s.Y)("div",{children:(0,s.FD)(_.EY,{translated:!0,className:"error other-error",children:["This email address is not confirmed yet.",(0,s.Y)("br",{}),(0,s.Y)("a",{href:"javascript:void(0)",onClick:()=>{if(this.form)return this.form.handleSubmit()},children:"Click here"})," ","to resend the confirmation email."]})}):(0,s.Y)("div",{id:"error-container"}),x||Q||h?(0,s.FD)("div",{className:c()("subtle-help-text below-input",C.A.links),children:[x&&(this.getSavedEmail()?(0,s.Y)("a",{className:"login-button",href:(0,E.bgT)({for_pub:D.subdomain}),"data-native":!0,children:es("Not you?")}):(0,s.Y)("a",{className:"login-button",href:(0,E.a7q)({for_pub:D.subdomain,redirect:T}),"data-native":!0,children:es("Login")})),Q&&[(0,s.Y)("a",{className:"legal",href:(0,S._)({pub:D}),target:"_blank","data-native":!0,children:es("Privacy")}),(0,s.Y)("a",{className:"legal",href:(0,S.Ru)({pub:D}),target:"_blank","data-native":!0,children:es("Terms")}),(0,s.Y)("a",{className:"legal",href:(0,S.iQ)(),target:"_blank","data-native":!0,children:es("Information collection notice")})],h]}):null]})}}),(0,s.Y)(Y.Ic,{onRequest:()=>t.e("58911").then(t.bind(t,56130)),resolve:e=>e.EmailTypoHandler,module:"@/frontend/login/typo_handler/EmailTypoHandler",emailSuggestions:this.state.emailSuggestions,currentEmail:this.state.currentEmail,onAccept:this.onAcceptSuggestion})]})}constructor(e){super(e),(0,n._)(this,"emailInput",void 0),(0,n._)(this,"form",void 0),(0,n._)(this,"assignEmailInput",e=>{this.emailInput=e}),(0,n._)(this,"assignForm",e=>{this.form=e}),(0,n._)(this,"handleEmailChange",()=>{var e,a,t;let n=null==(e=this.emailInput)?void 0:e.value;!n||(this.setState({currentEmail:n}),this.state.emailSuggestions&&this.state.emailSuggestions.hasOwnProperty(n)||null==(a=(t=this.state).fetchSuggestion)||a.call(t,n).then(e=>{let[a,t]=e;this.setState({emailSuggestions:(0,r._)((0,i._)({},this.state.emailSuggestions),{[null!=a?a:"undefined"]:null!=t?t:""})})}))}),(0,n._)(this,"_onSuccess",async e=>{let{iTemplate:a}=this.context;(!0===e.body.is_new_subscriber||!1===e.body.prompt_to_login&&!0===e.body.didSignup)&&f.$5(),(Array.isArray(e.body)&&e.body.every(e=>e.requires_confirmation)||e.body.requires_confirmation)&&(this.props.onConfirmationRequired?await this.props.onConfirmationRequired(e):alert(a(B(),e.body.email))),this.props.freeSignupEmail&&this.props.freeSignupEmail!==e.body.email&&(0,g.E)({freeSignupEmail:e.body.email}),this.props.onSuccess&&await this.props.onSuccess(e)}),(0,n._)(this,"onSuccess",async e=>{"undefined"!=typeof window&&window.campaign&&(0,v.y)("referralCode")?window.campaign.identify({email:e.body.email},()=>this._onSuccess(e)):await this._onSuccess(e)}),(0,n._)(this,"onAcceptSuggestion",e=>{this.emailInput&&(this.emailInput.value=null!=e?e:"",this.form.handleSubmit(null,!0))}),this.state={emailSuggestions:{}}}}(0,n._)(w,"contextType",h.OW)},11510:function(e,a,t){t.d(a,{Iu:()=>l});var n=t(17402),i=t(17988);t(68349);var r=t(98949);function l(){let e=(0,i.useMediaQuery)({maxWidth:650}),[a,t]=(0,n.useState)(!1);return(0,n.useLayoutEffect)(()=>{t((0,r.Fr)())},[]),a||e}},61554:function(e,a,t){t.d(a,{U:()=>p});var n=t(69277),i=t(70408),r=t(4006),l=t(56778),s=t(86500),o=t(60322),c=t(76977),d=t(63136),u=t(18189),h=t(80856),g=t(84479);let f={textDecoration:"underline"},p=e=>{let{includeCheckbox:a=!0,onCheckboxChange:t=()=>{},checked:i=!1,addSubscribePreamble:d=!1,addSignupPreamble:h=!1,addPublisherPreamble:f=!1,fontWeight:p="regular",size:y="regular",color:b="primary",textAlign:_="left",style:Y,pub:k}=e;return(0,r.FD)(r.FK,{children:[(0,r.Y)(l.A,{onVisible:()=>{(0,s.u4)(u.q.TERMS_OF_SERVICE_SEEN,{withCheckbox:a,initialCheckboxValue:i})}}),(0,r.FD)(c.Ye,{as:"label",alignItems:"center",justifyContent:"center",gap:12,style:Y,className:g.A.tosCheckbox,children:[a&&(0,r.Y)(o.S,{checked:i,onChange:e=>{(0,s.u4)(u.q.TERMS_OF_SERVICE_CHECKBOX_CLICKED,{checkboxValue:e}),t(e)},size:"sm"}),(0,r.Y)(m,(0,n._)({addPublisherPreamble:f,addSubscribePreamble:d,addSignupPreamble:h,includeCheckbox:a,pub:k},{color:b,textAlign:_,fontWeight:p,size:y}))]})]})};function m(e){let{addPublisherPreamble:a,addSubscribePreamble:t,addSignupPreamble:l,includeCheckbox:s,pub:o,color:c,textAlign:u,fontWeight:g,size:p}=e,m=(0,n._)({color:c,textAlign:u,fontWeight:g},"small"===p?{size:11,lineHeight:16}:{}),y=null==o?void 0:o.has_custom_tos,b=null==o?void 0:o.has_custom_privacy;if(a)return(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By creating a publication, I agree Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h._4)(),target:"_blank",style:f,children:"Publisher Agreement"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]}));if(t)return y&&b?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By subscribing, you agree the publisher's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.Ru)({pub:o}),target:"_blank",style:f,children:"Terms of Service"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h._)({pub:o}),target:"_blank",style:f,children:"Privacy Policy"}),", Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):y?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By subscribing, you agree the publisher's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.Ru)({pub:o}),target:"_blank",style:f,children:"Terms of Service"}),", Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):b?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By subscribing, you agree the publisher's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h._)({pub:o}),target:"_blank",style:f,children:"Privacy Policy"}),", Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By subscribing, you agree Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]}));if(l)return s?y&&b?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By creating an account, I agree the publisher's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.Ru)({pub:o}),target:"_blank",style:f,children:"Terms of Service"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h._)({pub:o}),target:"_blank",style:f,children:"Privacy Policy"}),", Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):y?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By creating an account, I agree the publisher's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.Ru)({pub:o}),target:"_blank",style:f,children:"Terms of Service"}),", Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):b?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By creating an account, I agree the publisher's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h._)({pub:o}),target:"_blank",style:f,children:"Privacy Policy"}),", Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By creating an account, I agree Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["By creating an account, you agree Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]}));return s?(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["I agree Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]})):(0,r.FD)(d.EY.B4,(0,i._)((0,n._)({},m),{translated:!0,children:["you agree Substack's"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.lk)(),target:"_blank",style:f,children:"Terms of Use"}),", and acknowledge its"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.iQ)(),target:"_blank",style:f,children:"Information Collection Notice"})," ","and"," ",(0,r.Y)(d.EY,{as:"a",href:(0,h.gB)(),target:"_blank",style:f,children:"Privacy Policy"}),"."]}))}}}]);