"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["1621"],{3258:function(t,e,l){l.d(e,{ZP:()=>b,wg:()=>_});var n=l(7409),a=l(99282),i=l(16584),o=l(94184),r=l.n(o),s=l(80569),c=l.n(s),u=l(85685),d=l(85095),p=l(33017),m=l(63651),h=l(51885);let b=t=>{let{id:e,type:l,name:n,url:a,photo_url:o,uuid:s,mentionText:c,isStatic:b=!1,isEditorContext:f=!1}=t;return b?(0,i.tZ)("span",{className:r()(h.Z.mention,h.Z.mentionStatic),"data-component-name":"MentionStatic",children:(0,i.tZ)("a",{href:(0,m.gpq)(l,e,n,a),children:n||"Substack user"})}):"user"===l?(0,i.tZ)(d.am,{children:(0,i.tZ)(u.ProfileHoverCard,{subject:{id:e,name:n||"Substack user",photo_url:o},utmSource:"mention",children:(0,i.tZ)("a",{className:h.Z.mention,href:f?void 0:(0,m.gpq)(l,e,n,a),target:"_blank",rel:"noopener","data-attrs":JSON.stringify({name:n,id:e,type:l,url:a,photo_url:o,uuid:s}),onClick:t=>t.stopPropagation(),"data-component-name":"MentionUser",children:null!=c?c:n})})}):"pub"===l?(0,i.tZ)(p.Sm,{publication_id:e,utmSource:"mention",children:(0,i.tZ)("a",{className:h.Z.mention,href:a,target:"_blank",rel:"noopener","data-attrs":JSON.stringify({name:n,id:e,type:l,url:f?void 0:(0,m.gpq)(l,e,n,a),uuid:s}),onClick:t=>t.stopPropagation(),"data-component-name":"MentionPub",children:null!=c?c:n})}):(0,i.tZ)("a",{className:h.Z.mention,target:"_blank",rel:"noopener",href:(0,m.gpq)(l,e,n,a),"data-attrs":JSON.stringify({name:n,id:e,type:l,url:a,photo_url:o,uuid:s}),"data-component-name":"Mention",children:null!=c?c:n})},f={},_=async function(t){let{pathname:e="/api/v1/posts/mention"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(f[t])return f[t];let{profiles:l,publications:i}=(await c().get(e).query({query:t,include_unmentionables:!0})).body,o=new Map;return l&&l.length&&o.set("Writers",l.map(t=>(0,a._)((0,n._)({},t),{type:"user",disabledReason:t.is_mentionable?void 0:"unmentionable"}))),i&&i.length&&o.set("Publications",null==i?void 0:i.map(t=>(0,a._)((0,n._)({},t),{type:"pub",url:(0,m.HQ5)({subdomain:t.subdomain}),photo_url:t.logo_url}))),f[t]=o,o}},18787:function(t,e,l){if(l.d(e,{f1:()=>F,qV:()=>J,sF:()=>D}),l(27412),!/^(2787|4716)$/.test(l.j))var n=l(7409);if(!/^(2787|4716)$/.test(l.j))var a=l(98848);var i=l(58865),o=l(16584),r=l(30396),s=l(94184),c=l.n(s),u=l(80569),d=l.n(u),p=l(60826),m=l(83034),h=l(12620),b=l(75021),f=l(93666),_=l(33665),v=l(12281),y=l(95441),g=l(68833),w=l(98914),Z=l(94874),k=l(15771),S=l(19081),N=l(58175),C=l(24791),P=l(60308),U=l(26111),X=l(23945),x=l(81821),B=l(47929),A=l(71004);function E(){let t=(0,i._)(["Available now for iOS and Android"]);return E=function(){return t},t}function O(){let t=(0,i._)([""," gifted you this paid post. Unlock it in the free Substack app"]);return O=function(){return t},t}function T(){let t=(0,i._)(["Upgrade to ",""]);return T=function(){return t},t}function I(){let t=(0,i._)(["Upgrade to ",""]);return I=function(){return t},t}function L(){let t=(0,i._)(["Already in the "," plan?"]);return L=function(){return t},t}function q(){let t=(0,i._)(["Already in the Founding Member plan?"]);return q=function(){return t},t}let F=t=>{var e,l,n;let a,{className:i=null,title:s,subtitle:u=null,reauthenticationTitle:p,publication:f,post:v,user:k,freeSignup:C=null,freeSignupEmail:A=null,email_form:T=!1,autoFocus:I=!1,isStatic:L=!1,coupon:q=null,showPostUnlockPrompt:F=!1,magicToken:K=null,onPostUnlockError:M=null,giftingUser:W=null,treatmentVariantForGiftPostPaywall:$=null}=t,D=null==k?void 0:k.reader_installed_at,{iString:R,iTemplate:V}=(0,y.M1)(),[z,Y]=(0,r.eJ)(!1),[Q,tt]=(0,r.eJ)(!1),{modal:te,open:tl}=(0,m.useAppModal)({utm_campaign:B.VX.paywallPostUnlockPrompt,utm_source:B.b3.substack,overrideCTA:D?R("Open in app"):void 0,overrideTitle:R(D?"Unlock your free post in the Substack app":"Get the free Substack app to unlock this post"),subTitle:V(E()),openUrl:null!==(e=D&&(0,P.K8_)(f.subdomain,v.slug))&&void 0!==e?e:void 0}),tn=k&&k.email||A||null,ta=!!((null==k?void 0:k.is_subscribed)&&(null==k?void 0:k.is_magic)),ti=(null==v?void 0:v.audience)==="founding",to=!!((null==k?void 0:k.is_free_subscribed)||C),tr=(0,P.uRy)(f,v),ts=(0,x.tq)({checkFirst4:!0}),tc=(0,r.I4)(async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,g.j)(g.FP.PAYWALL_UNLOCK_CTA_CLICKED,{post_id:v.id,publication_id:f.id,from_email:t});try{await d().post("/api/v1/post_unlock_token").send({post_id:v.id,token:K}),ts?window.location.href=D?(0,P.K8_)(f.subdomain,v.slug,{redirect:"app-store",params:{utm_campaign:B.VX.paywallPostUnlockPrompt,utm_source:B.b3.paywall}}):(0,P.D4e)({utm_campaign:B.VX.paywallPostUnlockPrompt,utm_source:B.b3.paywall}):tl()}catch(t){null==M||M()}},[v.id,v.slug,f.id,f.subdomain,K,D,tl,M,ts]);(0,r.d4)(()=>{F&&(0,g.j)(g.FP.PAYWALL_UNLOCK_CTA_VIEWED,{publication_id:f.id,post_id:v.id})},[v.id,f.id,F]),(0,r.d4)(()=>{(0,U.x)("launch_post_unlock_offer")&&(tc(!0),window.history.replaceState({},document.title,(0,P.rhs)({launch_post_unlock_offer:null})))},[tc]);let tu=!!q&&!!q.id&&!ti&&!F;a=tu?R((null==v?void 0:v.type)==="podcast"?"Listen to this episode with a 7-day free trial":(null==v?void 0:v.type)==="video"?"Watch with a 7-day free trial":"Keep reading with a 7-day free trial"):ta?p:s;let td=async()=>{if(!W){console.warn("tried to claim gift post, but no gifting user");return}if((0,g.j)(g.FP.GIFT_POST_CLAIM_CTA_CLICKED,{post_id:v.id,pub_id:f.id,referring_user_id:W.id,user_id:null==k?void 0:k.id,variant:$,source:"paywall"}),!k){tt(!0);return}Y(!0);try{await d().post("/api/v1/post_unlock_token").send({post_id:v.id,gifting_user_id:W.id,email:tn}),(0,w.uX)((0,P.K8_)(f.subdomain,v.slug,{redirect:"app-store",source:B.b3.paywall}))}catch(t){null==M||M()}finally{Y(!1)}};return W&&$&&F?(0,o.BX)("div",{role:"region","aria-label":R("Gift post paywall"),children:[Q&&(0,o.tZ)(b.f,{user:k,post:v,pub:f,referringUser:W,freeSignupEmail:null!=A?A:void 0,variant:$,startOnEmailCollection:!0}),(0,o.BX)("div",{className:c()("paywall",i),"data-testid":"paywall","data-component-name":"Paywall",children:[(0,o.tZ)(Z.qE,{photoUrl:null!==(l=W.photo_url)&&void 0!==l?l:void 0,size:64,className:L?"paywall-unlock-avatar-static":"paywall-unlock-avatar"}),(0,o.tZ)(b.E,{style:{position:"absolute",left:"calc(50% + 5px)",top:"5px"},size:24}),(0,o.tZ)(N.xv,{weight:"light",className:c()("paywall-title","unlock-treatment-new"),children:V(O(),(0,X.Q1)(W.name))}),(0,o.tZ)(G,{isStatic:L,onClick:()=>td(),btnClassName:c()(F&&"paywall-cta-icon"),disabled:z,children:R("Claim my free post")}),to?(0,o.BX)(j,{isStatic:L,publication:f,post:v,postUrl:tr,coupon:q,useCoupon:tu,children:[R("Or upgrade your subscription.")," ",(0,o.tZ)("b",{children:(0,o.tZ)(_.n,{pub:f,user:k,isStatic:!0})})]}):(0,o.tZ)("div",{className:"paywall-login",children:(0,o.BX)("a",{href:(0,P.uXE)({for_pub:f.subdomain,change_user:!!tn}),native:!0,children:[J({post:v,publication:f,isPaid:!T})," ",(0,o.tZ)("b",{children:R(tn?"Switch accounts":"Sign in")})]})})]})]}):(0,o.BX)("div",{className:c()("paywall",i),"data-testid":"paywall","data-component-name":"Paywall",role:"region","aria-label":R("Paywall"),children:[F&&(0,o.tZ)(Z.qE,{photoUrl:null!==(n=f.author_photo_url)&&void 0!==n?n:void 0,size:64,className:L?"paywall-unlock-avatar-static":"paywall-unlock-avatar"}),tn&&!F&&(0,o.BX)(N.xv,{translated:!0,as:"div",className:"paywall-intro",paddingBottom:8*!!F,children:["Hi ",(0,o.tZ)("b",{children:I18N.p(tn)})]}),(0,o.tZ)("h2",{className:c()("paywall-title",F&&"unlock-treatment-new"),children:a}),u&&!tu&&(0,o.tZ)("p",{className:"paywall-subtitle",children:u}),tu&&(0,o.BX)("div",{className:"paywall-free-trial-subtitle",children:[(null==v?void 0:v.type)==="podcast"&&(0,o.BX)(N.xv,{translated:!0,as:"p",className:"paywall-subtitle",children:["Subscribe to"," ",(0,o.tZ)(N.xv,{as:"span",weight:"bold",fontStyle:"italic",children:I18N.p(f.name)})," ","to listen to this post and get 7 days of free access to the full post archives."]}),(null==v?void 0:v.type)==="video"&&(0,o.BX)(N.xv,{translated:!0,as:"p",className:"paywall-subtitle",children:["Subscribe to"," ",(0,o.tZ)(N.xv,{as:"span",weight:"bold",fontStyle:"italic",children:I18N.p(f.name)})," ","to watch this video and get 7 days of free access to the full post archives."]}),(null==v?void 0:v.type)==="newsletter"&&(0,o.BX)(N.xv,{translated:!0,as:"p",className:"paywall-subtitle",children:["Subscribe to"," ",(0,o.tZ)(N.xv,{as:"span",weight:"bold",fontStyle:"italic",children:I18N.p(f.name)})," ","to keep reading this post and get 7 days of free access to the full post archives."]}),(null==v?void 0:v.type)==="adhoc_email"&&(0,o.BX)(N.xv,{translated:!0,as:"p",className:"paywall-subtitle",children:["Subscribe to"," ",(0,o.tZ)(N.xv,{weight:"bold",fontStyle:"italic",children:I18N.p(f.name)})," ","to keep reading this email and get 7 days of free access to the full post archives."]})]}),T?!to&&(0,o.tZ)(S.gq,{paddingTop:24,justifyContent:"center",children:(0,o.tZ)(h.Z,{autoFocus:null==I||I,email:tn,freeSignup:C,freeSignupEmail:A,onAccentBackground:!0,pub:f,source:"post-unlock",submitButtonText:R((null==v?void 0:v.type)==="podcast"?"Start listening":(null==v?void 0:v.type)==="video"?"Start watching":"Start reading"),user:k,onSuccess:()=>document.location.reload()})}):F?(0,o.BX)(o.HY,{children:[te,(0,o.tZ)(G,{isStatic:L,onClick:()=>tc(!1),btnClassName:c()(F&&"paywall-cta-icon"),children:R("Claim my free post")})]}):(0,o.tZ)(H,{coupon:q,email:tn,isStatic:L,post:v,postUrl:tr,publication:f,useCoupon:tu,user:k}),F&&(0,o.BX)(j,{isStatic:L,publication:f,post:v,postUrl:tr,coupon:q,useCoupon:tu,children:[R("Or upgrade your subscription.")," ",(0,o.tZ)("b",{children:(0,o.tZ)(_.n,{pub:f,user:k,isStatic:!0})})]}),!ta&&!L&&!F&&(0,o.tZ)("div",{className:"paywall-login",children:(0,o.BX)("a",{href:(0,P.uXE)({for_pub:f.subdomain,change_user:!!tn}),native:!0,children:[J({post:v,publication:f,isPaid:!T})," ",(0,o.tZ)("b",{children:R(tn?"Switch accounts":"Sign in")})]})})]})},H=t=>{var e,l;let{coupon:n,email:a,isStatic:i,post:r,postUrl:s,publication:c,useCoupon:u,user:d}=t,m=!!(null==d?void 0:d.is_founding),h=!!(null==d?void 0:d.is_subscribed),b=!!((null==d?void 0:d.is_subscribed)&&(null==d?void 0:d.is_magic)),f=(null==r?void 0:r.audience)==="founding",{iString:v,iTemplate:g}=(0,y.M1)();if(i){if(!c.plans)return null;let t=f?p.W.FOUNDING_CHECKOUT_URL:p.W.CHECKOUT_URL,l=u?"&coupon=".concat(null==n?void 0:n.id):"",a=f?g(T(),null!==(e=(0,C.H$)(c))&&void 0!==e?e:""):u?v("Start trial"):(0,o.tZ)(_.n,{pub:c,user:d,isStatic:i});return(0,o.tZ)(K,{href:"".concat(t,"simple=true&utm_source=").concat(B.b3.paywall,"&utm_medium=").concat(B.lP.email,"&utm_content=").concat(r.id,"&next=").concat(s).concat(l),children:a})}return!m&&f?c.plans?(0,o.tZ)(M,{href:(0,P.Zs0)(c,{simple:!0,next:document.location.href,utm_source:B.b3.paywall,utm_medium:B.lP.web,utm_content:r?r.id:null,plan:"founding"}),children:g(I(),null!==(l=(0,C.H$)(c))&&void 0!==l?l:"")}):null:h?b?(0,o.tZ)(M,{href:(0,P.uXE)({for_pub:c.subdomain,email:a}),children:v("Click here to sign in")}):null:c.plans?(0,o.tZ)(M,{href:(0,P.Zs0)(c,{simple:!0,next:document.location.href,utm_source:u?B.b3.paywallFreeTrial:B.b3.paywall,utm_medium:i?B.b3.email:B.b3.web,utm_content:r?r.id:null,coupon:u?null==n?void 0:n.id:null}),children:u?v("Start trial"):(0,o.tZ)(_.n,{pub:c,user:d,isStatic:i})}):null},K=t=>{let{children:e,href:l}=t;return(0,o.tZ)("div",{className:"paywall-cta",children:(0,o.tZ)("a",{className:"button primary subscribe-btn",href:l,children:(0,o.tZ)("span",{children:e})})})},M=t=>{let{children:e,href:l}=t;return(0,o.tZ)("div",{className:"paywall-cta",children:(0,o.tZ)("a",{href:l,native:!0,children:(0,o.tZ)(k.kG,{resetCss:!0,className:c()("subscribe-btn",A.Z.subscribeButton),children:e})})})},j=t=>{let{post:e,isStatic:l,publication:n,onClick:a,children:i,postUrl:r,coupon:s,useCoupon:c}=t,u=(0,P.Zs0)(n,{simple:!0,next:document.location.href,utm_source:B.b3.paywall,utm_medium:l?B.lP.email:B.lP.web,utm_content:e?e.id:null,just_signed_up:!1});a=async()=>{window.location.href=u};let d=c?"&coupon=".concat(null==s?void 0:s.id):"",p="".concat(u,"simple=true&utm_source=").concat(B.b3.paywall,"&utm_medium=").concat(B.lP.email,"&utm_content=").concat(e.id,"&next=").concat(r).concat(d);return l?(0,o.tZ)(W,{href:p,children:i}):(0,o.tZ)($,{onClick:a,href:p,children:i})},W=t=>{let{children:e,href:l}=t;return(0,o.tZ)("div",{className:"paywall-secondary-cta",children:(0,o.tZ)("a",{href:l,children:e})})},$=t=>{let{children:e,href:l,onClick:n}=t;return(0,o.tZ)("div",{className:"paywall-secondary-cta",children:(0,o.tZ)("a",{onClick:n,href:l,native:!0,children:e})})},G=t=>{let{isStatic:e,onClick:l,children:n,btnClassName:a,disabled:i}=t;return e?(0,o.tZ)("div",{className:"paywall-cta",children:(0,o.tZ)("a",{className:c()("button","primary",a),href:"".concat(p.W.POST_URL,"&launch_post_unlock_offer=true"),children:n})}):(0,o.tZ)("div",{className:"paywall-cta",children:(0,o.tZ)("a",{onClick:l,native:!0,children:(0,o.tZ)(k.kG,{resetCss:!0,className:c()("subscribe-btn",a),disabled:i,children:n})})})};class D extends(/^(2787|4716)$/.test(l.j)?null:f.p){renderChildren(){let t=this.props,{ref:e}=t,l=(0,a._)(t,["ref"]);return(0,o.tZ)(F,(0,n._)({className:"modal-paywall"},l))}}function J(){let{post:t,publication:e,isPaid:l=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{iString:n,iTemplate:a}=I18N.i(e?{pub:e}:"en");if(!l)return n("Already a subscriber?");if((null==t?void 0:t.audience)==="founding"){var i;return(0,C.H$)(e)?a(L(),null!==(i=(0,C.H$)(e))&&void 0!==i?i:""):a(q())}return n("Already a paid subscriber?")}v.Z},4953:function(t,e,l){l.d(e,{w:()=>n});function*n(t,e){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;for(let n=t;n