!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@538433c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fab6b907-022f-497f-8fa3-41e6ed901ea7",e._sentryDebugIdIdentifier="sentry-dbid-fab6b907-022f-497f-8fa3-41e6ed901ea7")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["71898"],{39333:function(e,t,n){n.d(t,{$:()=>p});var r=n(69277),i=n(4006),l=n(87677),a=n(18993),o=n(41873),s=n(6049);n(89490);var d=n(63136);n(39318);var c=n(49807),u=n(82776);function p(e){var t,n,r;let{communityPost:c,author:p,cta:f,withAttribution:Y,attributionText:y,hideReply:_,truncateBodyAt:v}=e,w=!c,S=null==c||null==(n=c.threadMediaUploads)||null==(t=n[0])?void 0:t.mediaUpload,E=null;return!w&&c.body&&(E=v?(0,u.truncateText)(c.body,v):c.body),(0,i.FD)(s.ZB,{gap:12,verticalAlign:"top",children:[(0,i.Y)(s.Kb,{src:null!=(r=null==p?void 0:p.photo_url)?r:"",size:40}),(0,i.FD)(s.jJ,{gap:4,style:{lineHeight:0},children:[Y&&(0,i.Y)(a.mj,{isStatic:!0,text:y||"From ".concat((null==p?void 0:p.name)?(0,u.possessive)(p.name):"Substack user"," subscriber chat")}),w?(0,i.Y)(m,{}):["media"===c.type&&c.media_assets?c.media_assets.slice(0,1).map(e=>(0,i.Y)(b,{asset:e},e.url)):"link"===c.type&&(0,i.Y)(g,{communityPost:c}),S&&(0,i.Y)(o.b,{mediaUpload:S}),E&&(0,i.Y)(h,{children:(0,i.FD)("span",{children:[(0,i.Y)(d.EY,{as:"span",weight:"bold",children:p?p.name:"Substack writer"})," ",E]})})],!_&&(0,i.Y)(h,{children:(0,i.Y)(s.h2,{children:(0,i.FD)("tr",{children:[(0,i.Y)("td",{align:"left",children:(0,i.Y)(d.EY,{as:"span",color:"secondary",children:"Reply..."})}),(0,i.Y)("td",{align:"right",children:(0,i.Y)(l.A,{size:20,stroke:"var(--color-secondary}"})})]})})}),f&&(0,i.Y)(s.KJ,{fullWidth:!0,href:f.url,children:f.text}),f&&f.blurb&&(0,i.Y)("div",{children:(0,i.Y)(d.EY,{color:"secondary",align:"center",size:14,lineHeight:20,children:f.blurb})})]})]})}function h(e){return(0,i.Y)("div",(0,r._)({className:"bubble-ufWvfM"},e))}function m(){return(0,i.Y)("div",{className:"paywallBubble-VDFuNU bubble-ufWvfM",style:{backgroundImage:"url(".concat((0,c.dJ9)("/img/community/paywall-pixels-light.png"),")")},children:(0,i.Y)(d.EY.Meta,{children:"SUBSCRIBERS ONLY"})})}function b(e){var t;let{asset:n}=e;return(0,i.Y)("img",{className:"img-cbG6oW",width:400,src:(0,c.dJ9)(null!=(t=n.url)?t:"",800,{crop:"limit",height:800})})}function g(e){var t,n;let r,{communityPost:l}=e,{link_metadata:a,link_url:o}=l,u=null!=(n=null!=(t=null==a?void 0:a.url)?t:o)?n:"";try{let e=new URL(u);r="".concat(e.host).concat(e.pathname).concat(e.search).concat(e.hash)}catch(e){r=u}return(0,i.Y)(h,{children:(0,i.Y)(s.h2,{style:{width:"400px"},children:(0,i.FD)("tr",{children:[(0,i.FD)("td",{align:"left",style:{verticalAlign:"top"},children:[(null==a?void 0:a.title)&&(0,i.Y)(d.EY,{font:"serif",lineHeight:24,children:a.title}),(0,i.Y)(d.EY.Meta,{color:"secondary",children:r})]}),(0,i.Y)("td",{width:"16"}),(0,i.Y)("td",{align:"right",children:(null==a?void 0:a.image)&&(0,i.Y)("img",{className:"linkImg-_n19TI",src:(0,c.dJ9)(a.image,144,{height:144,smartCrop:!0})})})]})})})}},49639:function(e,t,n){n.d(t,{y$:()=>P});var r=n(69277),i=n(70408),l=n(79785),a=n(4006),o=n(17402),s=n(47963),d=n(85048),c=n(58050),u=n(84605),p=n(46271),h=n(86500),m=n(94729),b=n(17186),g=n(68349),f=n(24078),Y=n(35369),y=n(76977),_=n(28911),v=n(63136),w=n(65842),S=n(36372),E=n(11510),F=n(16291),I=n(39318),A=n(41086),k=n(50963),x=n(57324),N=n(24258),C=n(60710);function B(){let e=(0,l._)(["Already following ",""]);return B=function(){return e},e}function D(){let e=(0,l._)(["",", a paid subscriber of ",", shared this with you."]);return D=function(){return e},e}function O(){let e=(0,l._)(["",", a subscriber of ",", shared this with you."]);return O=function(){return e},e}function R(){let e=(0,l._)([""," shared this with you."]);return R=function(){return e},e}function T(){let e=(0,l._)(["Follow "," and continue reading"]);return T=function(){return e},e}function L(){let e=(0,l._)(["Sign up and follow ",""]);return L=function(){return e},e}let P=e=>{let{pub:t,post:n,referringUser:l,freeSignupEmail:s,forceFollowPrompt:d,surface:f}=e,[Y,v]=(0,o.useState)(!1),[w,E]=(0,o.useState)(!1),[x,N]=(0,o.useState)(0),[C,D]=(0,o.useState)(s),[O,R]=(0,o.useState)(!1),{iString:T,iTemplate:L}=(0,u.GO)(),P=(0,S.d)(),H=(0,p.Jd)(),W=!!H||!!s,$=(0,c.cC)(l,null!=f?f:"follow-referrer-prompt",void 0,{auto:W}),q=(0,o.useMemo)(()=>({free_signup_email:s,post_id:null==n?void 0:n.id,referring_user_id:l.id}),[s,null==n?void 0:n.id,l.id]);(0,o.useEffect)(()=>{if(W&&!$.isLoaded||$.isFollowing){d&&$.isFollowing&&P.popToast(()=>(0,a.Y)(S.y,{text:L(B(),(0,k.$k)(l.name))}));return}try{let e=new URL(document.referrer);if(/(\b|\.)google\./.test(e.hostname)||["news.ycombinator.com","hckrnews.com"].includes(e.hostname))return}catch(e){}if(H&&(0,A.y)("follow-referrer-on-load")){(0,g.qm)("follow-referrer-on-load"),(0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_REDIRECTED,q),G({fromRedirect:!0}).then(()=>v(!0));return}let e="follow-prompt-for-post-".concat(null==n?void 0:n.id,"-and-referrer-").concat(l.id,"-shown-at"),t=(0,b.xm)(e);!d&&t&&(0,F.A)().subtract(7,"days").isBefore(t)||((0,b.X3)(e,Date.now()),v(!0),(0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_SHOWN,q))},[H,$.isLoaded]);let j=(0,o.useCallback)(()=>{(0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_DISMISSED,(0,i._)((0,r._)({},q),{step:x})),v(!1)},[q,v,x]),K=(0,o.useCallback)(function(){let{email:e,reason:n="sign-in-click"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_SIGN_IN_INITIATED,(0,i._)((0,r._)({},q),{reason:n}));let a=(0,I.oRR)({"follow-referrer-on-load":l.id});(0,g.V2)((0,I.a7q)({email:e,for_pub:null==t?void 0:t.subdomain,redirect:a}))},[q,null==t?void 0:t.subdomain,l.id]),V=(0,o.useCallback)(async function(){let e,t,n,{email:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{({user:e,userExists:t}=await (0,m.x6)("/api/v1/reader/signup/just_email",{method:"POST",json:{email:l}}))}catch(e){e instanceof m.fk&&(n=e.getMessage())}return e?(D(l),0):t?((0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_EXISTING_EMAIL_ENTERED,(0,i._)((0,r._)({},q),{email:l})),D(l),2):((0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_SIGNUP_FAILED,(0,i._)((0,r._)({},q),{email:l,error:n})),P.popToast(()=>(0,a.Y)(S.y,{text:n||T("Something went wrong. Please try again later.")})),1)},[q,P,T]),G=(0,o.useCallback)(async function(){let e,{email:t,fromRedirect:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!w){if(E(!0),n||(0,h.u4)(h.qY.FOLLOW_REFERRER_PROMPT_CTA_CLICKED,(0,i._)((0,r._)({},q),{email:t})),!W){if(!t){N(1),E(!1);return}if(1===(e=await V({email:t})))return void E(!1)}$.isFollowing||void 0!==e&&0!==e||(await $.toggle(),R(!0)),!H||n?N(2):v(!1),E(!1)}},[H,W,$,q,w,E,N,V]);return(0,a.Y)(_.aF,{fullscreenMobile:0!==x,isOpen:Y,onClose:j,children:(0,a.FD)(y.I1,{style:{height:"100%"},children:[(0,a.Y)(_.rQ,{onClose:j}),(0,a.FD)(y.I1,{flex:"grow",gap:48,paddingX:32,paddingBottom:32,paddingTop:12,children:[0===x&&(0,a.Y)(M,{pub:t,referringUser:l,loading:w,onFollowClick:G,onDismiss:j}),1===x&&(0,a.Y)(J,{referringUser:l,loading:w,onFollowWithEmail:G,onSignInClick:K}),2===x&&(0,a.Y)(U,{email:C,referringUser:l,followed:O,onDismiss:j})]})]})})},M=e=>{var t,n,r,i,l;let o,{pub:s,referringUser:d,loading:c,onFollowClick:p,onDismiss:h}=e,{iTemplate:m,iString:b}=(0,u.GO)(),g=null!=(l=null!=(i=null!=(r=d.photo_url)?r:null==s?void 0:s.logo_url)?i:null==s?void 0:s.author_photo_url)?l:(0,I.Ji1)(d.id),_=(0,k.$k)(d.name),w=null==(n=d.subscriptions)||null==(t=n.find(e=>e.publication_id==(null==s?void 0:s.id)))?void 0:t.membership_state;return o=s&&"subscribed"===w?m(D(),d.name,s.name):s&&"free_signup"===w?m(O(),d.name,s.name):m(R(),d.name),(0,a.FD)(y.I1,{alignItems:"center",gap:8,children:[(0,a.FD)(y.I1,{alignItems:"center",gap:16,paddingBottom:16,children:[(0,a.Y)("div",{className:C.A.avatarContainer,children:(0,a.Y)(f.eu,{className:C.A.avatar,user:{photo_url:g},size:64})}),(0,a.Y)(v.EY.H3,{align:"center",weight:"heavy",children:o})]}),(0,a.Y)(Y.$n,{priority:"primary",disabled:c,onClick:p,children:m(T(),_)}),(0,a.Y)(Y.$n,{priority:"secondary",onClick:h,children:b("Skip")})]})},J=e=>{let{referringUser:t,loading:n,onFollowWithEmail:r,onSignInClick:i}=e,[l,s]=(0,o.useState)(""),{iTemplate:c}=(0,u.GO)(),p=(0,o.useRef)(null);(0,o.useEffect)(()=>{var e;null==(e=p.current)||e.focus()},[]);let h=(0,o.useCallback)(e=>{e.preventDefault(),""!==l&&r({email:l})},[r,l]),m=(0,k.$k)(t.name);return(0,a.FD)(a.FK,{children:[(0,a.FD)(y.I1,{alignItems:"center",gap:8,children:[(0,a.FD)(v.EY.H3,{translated:!0,align:"center",weight:"heavy",children:["Sign up to follow ",I18N.p(m)]}),(0,a.Y)(v.EY.B4,{translated:!0,align:"center",color:"secondary",children:"Discover great writing and follow your friends on Substack"})]}),(0,a.FD)(y.I1,{gap:12,children:[(0,a.Y)(v.EY.B4,{translated:!0,weight:"semibold",children:"Your email address"}),(0,a.Y)("form",{onSubmit:h,children:(0,a.Y)(w.ks,{ref:p,placeholder:"bob@gmail.com",value:l,onChange:e=>s(e.currentTarget.value)})})]}),(0,a.FD)(y.I1,{alignItems:"center",gap:16,justifyContent:"center",children:[(0,a.Y)(Y.$n,{disabled:n||""===l,onClick:h,children:c(L(),m)}),(0,a.FD)(v.EY.B4,{translated:!0,align:"center",color:"secondary",children:["Already have a Substack account?"," ",(0,a.Y)(v.EY.B4,{translated:!0,color:"secondary",decoration:"underline",as:"a",href:"#",onClick:i,children:"Sign in"})]})]}),(0,a.Y)(y.I1,{flex:"grow",justifyContent:"end",children:(0,a.Y)(v.EY.B4,{align:"center",children:(0,a.Y)(d.qd,{className:C.A.termsFooter,publication:N.A})})})]})},U=e=>{let{onDismiss:t,email:n,referringUser:l,followed:o}=e,{iString:d}=(0,u.GO)(),c=(0,E.Iu)(),p={utm_medium:x.Jn.web,utm_campaign:x._9.postFollowReferrerPrompt,utm_source:x.VU.post};return(0,a.FD)(a.FK,{children:[o?(0,a.FD)(y.I1,{alignItems:"center",gap:4,children:[(0,a.Y)(v.EY.H3,{translated:!0,align:"center",weight:"heavy",children:"Read and follow in the app"}),(0,a.FD)(v.EY.B4,{translated:!0,align:"center",color:"secondary",children:["See who else ",I18N.p((0,k.$k)(l.name))," reads in the Substack app"]})]}):(0,a.FD)(y.I1,{alignItems:"center",gap:4,children:[(0,a.FD)(v.EY.H3,{translated:!0,align:"center",weight:"heavy",children:["Finish following ",I18N.p((0,k.$k)(l.name))," in the app"]}),(0,a.FD)(v.EY.B4,{translated:!0,align:"center",color:"secondary",children:["See who else ",I18N.p((0,k.$k)(l.name))," reads on Substack"]})]}),c?(0,a.FD)(a.FK,{children:[(0,a.Y)(y.Ye,{alignSelf:"center",children:(0,a.Y)("img",{src:(0,I.dJ9)("/img/app-preview-card.png"),height:265})}),(0,a.Y)(y.Ye,{flex:"grow",children:(0,a.FD)(y.I1,{alignItems:"center",flex:"grow",gap:8,children:[(0,a.Y)(Y.$n,{href:(0,I.wHz)(p),children:d("Get the Substack app")}),(0,a.Y)(Y.$n,{priority:"tertiary",onClick:t,children:d("Skip")})]})})]}):(0,a.FD)(y.I1,{alignItems:"center",gap:24,children:[(0,a.Y)("div",{style:{minHeight:231},children:(0,a.Y)(s.gF,(0,i._)((0,r._)({},p),{suggestedEmail:n,size:180,padding:0}))}),(0,a.Y)(Y.$n,{priority:"secondary",onClick:t,children:d("Continue reading")})]})]})}},49897:function(e,t,n){n.d(t,{M:()=>y});var r=n(4006),i=n(32485),l=n.n(i),a=n(17402),o=n(84605),s=n(35369),d=n(76977),c=n(37598),u=n(75303),p=n(63136),h=n(58278),m=n(98949),b=n(15974);let g=e=>e?/^H[1-5]$/i.test(e.tagName)?e:g(e.parentElement):null,f=e=>{let{toc:t,minLevel:n,activeItem:i}=e;return(0,r.Y)(d.I1,{gap:12,paddingY:12,paddingX:8,alignItems:"end",children:t.map((e,t)=>{let a=e.level-n,o="indent-".concat(Math.min(a,3)),s=(0,h.uB)(e.text.toLowerCase(),!0);return(0,r.Y)("div",{className:l()(b.A.line,b.A[o],i===s&&b.A.active)},t)})})},Y=e=>{let{toc:t,minLevel:n,activeItem:i,onItemClick:a}=e,{iString:s}=(0,o.GO)();return(0,r.FD)(d.I1,{gap:4,padding:8,className:b.A.menu,children:[(0,r.Y)(p.EY.Meta,{padding:4,color:"primary",children:s("Contents")}),t.map((e,t)=>{let o=(0,h.uB)(e.text.toLowerCase(),!0),s=e.level-n,c="indent-".concat(Math.min(s,3));return(0,r.Y)(u.AE,{href:"#\xa7".concat(o),onClick:e=>{e.preventDefault(),a(o)},children:(0,r.Y)(d.Ye,{padding:4,className:l()(b.A.row),children:(0,r.Y)(p.EY.B3,{className:l()(b.A.label,b.A[c],i===o&&b.A.active),ellipsis:!0,children:e.text})})},t)})]})},y=e=>{let{toc:t,position:n="fixed"}=e,{iString:i}=(0,o.GO)(),d=Math.min(...t.map(e=>e.level)),[u,p]=(0,a.useState)(null),y=(e=>{let[t,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let t=[];return e.forEach(e=>{let r=(0,h.uB)(e.text.toLowerCase(),!0),i=document.getElementById("\xa7".concat(r));if(i){let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.8&&n(r)})},{threshold:.5,rootMargin:"0px 0px -90% 0px"});e.observe(i),t.push(e)}}),()=>t.forEach(e=>e.disconnect())},[e]),t})(t);return t.length<2||(0,m.Fr)()?null:(0,r.Y)(c.A,{trigger:(0,r.Y)(s.Nm,{className:l()(b.A.trigger,b.A[n]),"aria-label":i("Table of Contents"),position:n,showFocus:!0,children:(0,r.Y)(f,{toc:t,minLevel:d,activeItem:y})}),side:"right",children:(0,r.Y)(Y,{toc:t,minLevel:d,activeItem:y,onItemClick:e=>{let t=document.getElementById("\xa7".concat(e));if(t){let n=g(t);if(n){if(u){let e=document.getElementById("\xa7".concat(u)),t=e?g(e):null;null==t||t.classList.remove("highlight")}n.classList.add("highlight"),p(e),t.scrollIntoView({behavior:"smooth",block:"start"})}}}})})}},80707:function(e,t,n){let r;n.d(t,{Rv:()=>W,bs:()=>H});var i,l=n(69277),a=n(70408),o=n(4006),s=n(31386),d=n(32485),c=n.n(d),u=n(17402),p=n(9751),h=n(83427),m=n(38893),b=n(48246),g=n(98107),f=n(12153),Y=n(64998),y=n(64099),_=n(93038),v=n(81209),w=n(84605),S=n(47970),E=n(79313),F=n(68349),I=n(51131),A=n(89490),k=n(76977),x=n(30192),N=n(90292),C=n(65942),B=n(98111),D=n(39318),O=n(41086),R=n(98949),T=n(50170),L=n(8283);let P=(e,t)=>(0,o.Y)(w.Pz,{language:t,children:e}),M=function(e,t){var n,r,i,a,d,c;let{shallow:y}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("A"!==e.nodeName||e.getAttribute("rel")||e.setAttribute("rel","pub"in t&&(null==(r=t.pub)?void 0:r.no_follow)?"nofollow ugc noopener":""),(0,F.nB)(e,"image2")&&e.classList.add("can-restack"),"pub"in t&&t.pub&&"P"===e.nodeName&&(0,F.nB)(e,"button-wrapper")){let n=((e,t)=>{try{let n=JSON.parse((0,C.A)(e.getAttribute("data-attrs")));if(["".concat(t.pub.base_url,"/subscribe?"),"".concat(t.pub.base_url,"/subscribe?plan=founding"),B.T.CHECKOUT_URL,B.T.FOUNDING_CHECKOUT_URL].includes(n.url)){let n=JSON.parse((0,C.A)(e.getAttribute("data-attrs")));return(0,o.Y)(v.A,(0,l._)({pub:t.pub,subscribeButtonAttrs:n},t.props))}}catch(e){console.error("Failed to parse button:",e)}return null})(e,t);if(n)return n}let w="pub"in t&&(null==(n=t.pub)?void 0:n.language)||"en";return(0,F.nB)(e,"subscription-widget-wrap-editor")||(0,F.nB)(e,"subscription-widget-wrap")?P((0,o.Y)("div",{className:"subscription-widget-wrap",children:(0,o.FD)("div",{className:"subscription-widget show-subscribe",children:[(0,o.Y)("div",{className:"preamble",children:(0,o.Y)("p",{dangerouslySetInnerHTML:{__html:null!=(c=null==(d=e.children[0])||null==(a=d.children[0])||null==(i=a.children[0])?void 0:i.innerHTML)?c:""}})}),(0,o.Y)(v.A,(0,l._)({pub:t.pub,subscribeButtonAttrs:null,source:"subscribe-widget-preamble"},t.props))]})}),w):(0,F.nB)(e,"cashtag-wrap")?P((e=>{try{let t=JSON.parse(e.dataset.attrs).symbol;if(t)return(0,o.Y)(g.A,{symbol:t,prependSymbol:JSON.parse(e.dataset.attrs).prependSymbol,isStatic:JSON.parse(e.dataset.attrs).isStatic});return(0,o.Y)(o.FK,{})}catch(e){return console.error("failed to parse cashtag"),(0,o.Y)(o.FK,{})}})(e),w):(0,F.nB)(e,"mention-wrap")?P((e=>{try{let{name:t,id:n,type:r,url:i,photo_url:l,uuid:a,isStatic:s}=JSON.parse(e.dataset.attrs);if(t)return(0,o.Y)(_.Ay,{name:t,id:n,type:r,url:i,photo_url:l,uuid:a,isStatic:s});return(0,o.Y)(o.FK,{})}catch(e){return(0,o.Y)(o.FK,{})}})(e),w):"pub"in t&&t.pub&&(0,F.nB)(e,"native-audio-url-embed")?P(((e,t)=>{let{pub:n,props:{isStatic:r,post:i}}=t;try{let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse((0,C.A)(t));return r?(0,o.Y)(b.x,{label:e.label,pub:n,post:i,duration:e.duration}):(0,o.Y)(m.$g,{label:e.label,pub:n,post:i,src:e.url,duration:e.duration,downloadable:e.downloadable,autoPlay:!1})}}catch(e){console.error("Failed to parse audio:",e)}return null})(e,t),w):"pub"in t&&t.pub&&(0,F.nB)(e,"native-audio-embed")?P(((e,t)=>{let{pub:n,props:{isStatic:r,post:i}}=t;try{let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse((0,C.A)(t));return r?(0,o.Y)(b.x,{label:e.label,pub:n,post:i,duration:e.duration}):(0,o.Y)(m.$g,{label:e.label,pub:n,post:i,src:"/api/v1/audio/upload/".concat(e.mediaUploadId,"/src"),duration:e.duration,downloadable:e.downloadable,autoPlay:!1,mediaUpload:{id:e.mediaUploadId}})}}catch(e){console.error("Failed to parse audio:",e)}return null})(e,t),w):"pub"in t&&t.pub&&(0,F.nB)(e,"native-video-embed")?P((0,f.nu)(e,t),w):"pub"in t&&t.pub&&(0,F.nB)(e,"meeting-embed")?P(((e,t)=>{let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs");if(t){let{name:e,avatarUrl:r,url:i}=JSON.parse((0,C.A)(t));return n?(0,o.Y)(I.D,{name:e,avatarUrl:r,url:i}):(0,o.Y)(I.l,{name:e,avatarUrl:r,url:i})}}catch(e){console.error("Failed to parse audio:",e)}return null})(e,t),w):(0,F.nB)(e,"poll-embed")?P(((e,t)=>{try{let i=JSON.parse((0,C.A)(e.getAttribute("data-attrs")));if(null==i?void 0:i.isEmail){var n,r;return(0,o.Y)("table",{className:"poll-embed poll-email",cellSpacing:"16px",width:"100%",children:(0,o.Y)("tbody",{children:(0,o.Y)("tr",{children:(0,o.Y)("td",{align:"center",children:(0,o.Y)(Y.a1,{id:i.id,embeddedPolls:null!=(r=null==(n=t.props.dataForEmailRender)?void 0:n.embeddedPolls)?r:[],pub:t.pub})})})})})}return(0,o.Y)("div",{className:"poll-embed",dataAttrs:e.getAttribute("data-attrs"),children:(0,o.Y)(Y.sP,{id:i.id,isEditor:!1,post:t.props.post,isVersionView:!!t.props.isVersionView})})}catch(e){return console.error("Failed to parse poll:",e),(0,o.Y)(o.FK,{})}})(e,t),w):(0,F.nB)(e,"recipe-embed")?P((0,f.hA)(e,t),w):(0,F.nB)(e,"twitter-embed")?P((0,f.Ev)(e),w):(0,F.nB)(e,T._1)?P((0,f.Im)(e,t),w):(0,F.nB)(e,"pinterest-embed")?P((0,f.H0)(e),w):(0,F.nB)(e,"polymarket-embed")?P((0,f.Ri)(e,t),w):(0,F.nB)(e,"sponsorship-campaign-embed")?P((0,f.tT)(e,t),w):(0,F.nB)(e,"fp-recirc-block")?P((0,f.E9)(e,t),w):(0,F.nB)(e,"image-gallery-embed")?P((0,f.mN)(e,t),w):(0,F.nB)(e,"image3")?P((0,f.Nq)(e,t),w):(0,F.nB)(e,"directMessage")?P((0,f.Jo)(e,t),w):(0,F.nB)(e,"latex-rendered")?P(((e,t)=>{let{pub:n,props:{isStatic:r}}=t,{iString:i}=I18N.i({pub:n});try{if(r){let t=e.getAttribute("data-attrs");if(t){let e=JSON.parse((0,C.A)(t)),n=null==e?void 0:e.persistentExpression;return n?(0,o.Y)("img",{src:(0,D.Ojn)(n),style:{transform:"scale(0.5)"},"data-component-name":"LatexImg"}):(0,o.Y)("p",{children:i("Failed to render LaTeX expression — no expression found in email")})}return(0,o.Y)("p",{children:i("Failed to render LaTeX expression — data attributes not found")})}let t=e.getAttribute("data-attrs"),n=JSON.parse((0,C.A)(t)),l=null==n?void 0:n.persistentExpression;return l?(0,o.Y)(k.Ye,{className:"latex-rendered",justifyContent:"center",flex:"grow",paddingBottom:"4px",paddingTop:"4px","data-component-name":"Latex",children:(0,o.Y)(k.I1,{justifyContent:"center",children:(0,o.Y)(s.A,{inline:!1,children:"\\(".concat(l,"\\)")})})}):(0,o.Y)("p",{children:i("Failed to render LaTeX expression — no expression found")})}catch(e){return console.error("failed to render mathjax",e),(0,o.Y)("p",{children:i("Failed to render LaTeX expression — error")})}})(e,t),w):(0,F.nB)(e,"latex-inline")?P(((e,t)=>{let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs");if(!t)return null;let r=JSON.parse((0,C.A)(t)),i=null==r?void 0:r.persistentExpression;if(!i)return null;if(n)return(0,o.Y)("img",{src:(0,D.Ojn)(i),alt:"LaTeX: ".concat(i),style:{height:"1.2em",verticalAlign:"middle",display:"inline"},"data-component-name":"InlineLatexImg"});return(0,o.Y)(N.q,{children:(0,o.Y)("span",{className:"latex-inline","data-component-name":"InlineLatex",children:(0,o.Y)(s.A,{inline:!0,children:"\\(".concat(i,"\\)")})})})}catch(e){return console.error("failed to render inline mathjax",e),null}})(e,t),w):(0,F.nB)(e,"community-chat")?P(function(e,t){let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs"),r=JSON.parse((0,C.A)(t));if(!r.pub||!r.subdomain)return console.error("could not deepPrepare communityChat, subdomain or pub missing from node"),(0,o.Y)(u.Fragment,{});return(0,o.Y)("div",{className:"community-chat",dataAttrs:t,children:n?(0,o.Y)(p.$,(0,l._)({},r)):(0,o.Y)(p.b,{pub:r.pub,subdomain:r.subdomain})})}catch(e){return console.error("Failed to parse chat embed:",e),(0,o.Y)(u.Fragment,{})}}(e,t),w):(0,F.nB)(e,"community-post")?P(function(e,t){let{props:{isStatic:n,is_freemail:r}}=t;try{let t=e.getAttribute("data-attrs"),i=JSON.parse((0,C.A)(t));return n?(0,o.Y)(h.T,(0,l._)({is_freemail:r},i)):(0,o.Y)(h.B,(0,l._)({},i))}catch(e){return console.error("Failed to parse chat post embed:",e),(0,o.Y)(u.Fragment,{})}}(e,t),w):(0,F.nB)(e,"digest-post-embed")?P((0,f.mt)(e,t),w):(0,F.nB)(e,"comment")&&!(0,F.nB)(e,"template-comment")?P(function(e,t){let{props:{isStatic:n}}=t;try{let t=e.getAttribute("data-attrs"),r=JSON.parse((0,C.A)(t));return n?(0,o.Y)(E.pK,(0,l._)({},r)):(0,o.Y)(S.H,(0,l._)({},r))}catch(e){return console.error("Failed to parse chat post embed:",e),(0,o.Y)(u.Fragment,{})}}(e,t),w):(0,F.nB)(e,"referrals-tier-card")?P((0,f.h)(e,t),w):("undefined"!=typeof window&&(0,F.nB)(e,"file-embed-button")&&"href"in e&&e.href&&!(0,O.y)(e.href,"token")&&(e.href=(0,D.yRP)(e.href,{token:(0,O.y)(window._preloads.original_url,"token")})),"props"in t&&t.props&&"post"in t.props&&t.props.post&&"object"==typeof t.props.post&&"id"in t.props.post&&t.props.post.id&&(0,F.nB)(e,"footnote")&&(e.id&&(e.id+="-".concat(t.props.post.id)),"href"in e&&e.href&&(e.href+="-".concat(t.props.post.id))),(0,F.nB)(e,"footnote-anchor"))?P(((e,t,n)=>{var r;let[i,,l]=e.id.split("-"),a=null==(r=n.wrapper.querySelector("#".concat(i,"-").concat(l)))?void 0:r.nextElementSibling;return a?((0,R.Fr)()&&(e.href="proxy.php?url=#_"),(0,o.Y)(x.j,{trigger:U(e,t,n),children:(0,o.Y)(A.az,{padding:12,maxWidth:360,sizing:"border-box",className:"markup typography footnote-hovercard",children:U(a,t,n)})})):U(e,t,n)})(e,M,t),w):y?null:U(e,M,t)},J=function(e){let t={};for(let{name:n,value:r}of Array.prototype.slice.call(e))t[n]=r;return t},U=(i=(e,t,n,r)=>{var i,s,d,p,h;if(!e)throw Error("Empty node, cannot preactify!");let m=3===e.nodeType?"span":8===e.nodeType?"x_preact_compatible_html_comment_x":e.tagName.toLowerCase(),b=1!==e.nodeType?{}:J(e.attributes),g=e.children&&e.children.length>0?null:e.textContent;if(r||"script"===m&&e.innerHTML===L.I)return(0,u.createElement)(m,(0,a._)((0,l._)({},b),{dangerouslySetInnerHTML:{__html:e.innerHTML}}));let f=!!(null==(i=e.parentElement)?void 0:i.getAttribute("data-prose-mirror-wrapper"));if(n&&"pub"in n&&f&&["h1","h2","h3","h4"].includes(m)&&!e.className){let t,r;return t=c()("header-anchor-post",b.className),r=e.children.length?Array.prototype.map.call(e.childNodes,e=>M(e,n)):[e.textContent],(0,u.createElement)(m,(0,a._)((0,l._)({},b),{className:t}),...r,(0,o.Y)(y.A,{text:null!=(p=e.textContent)?p:"",pub:null==n?void 0:n.pub,post:null==n||null==(s=n.props)?void 0:s.post,offsetTop:!0,isAboutPage:null!=(h=null==n||null==(d=n.props)?void 0:d.isAboutPage)&&h}))}if(g)return(0,u.createElement)(m,b,g);let Y=t(e,n,{shallow:!0});return Y||(0,u.createElement)(m,b,...Array.prototype.map.call(e.childNodes,e=>t(e,n)))},r=0,function(){let e=[].slice.call(arguments,0),t=++r>2500;if(t){var n,l,a;console.error("Too many post nodes to recurse",{postId:null==(a=e[2])||null==(l=a.props)||null==(n=l.post)?void 0:n.id,depth:r})}let o=i.apply(null,[...e,...t?[!0]:[]]);return r--,o});function H(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.createElement("div");return r.setAttribute("data-prose-mirror-wrapper","1"),r.innerHTML=e,Array.prototype.map.call(r.childNodes,e=>U(e,M,{wrapper:r,pub:t,props:n}))}function W(e,t){if("undefined"==typeof window)return[];let n=document.createElement("div");n.innerHTML=e;let r=[];for(let e of n.querySelectorAll(null!=t?t:"h1, h2, h3, h4")){var i,l;let t=e.tagName[1],n=t?parseInt(t):NaN;r.push({level:null!=n?n:0,text:null!=(i=e.textContent)?i:"",id:null!=(l=e.id)?l:""})}return r}},81209:function(e,t,n){n.d(t,{A:()=>x,n:()=>k});var r=n(99851),i=n(69277),l=n(70408),a=n(4006),o=n(32485),s=n.n(o),d=n(45773),c=n(17402),u=n(97432),p=n(78943),h=n(1250),m=n(84605),b=n(53989),g=n(8609),f=n(21076),Y=n(89490),y=n(35369),_=n(76977),v=n(98111),w=n(39318),S=n(41086),E=n(82776),F=n(57324);let I=["Subscribe","Subscribe now","Sign up","Sign up now"];function A(e){let{isStatic:t,pub:n,user:r,freeSignup:i,children:l,pledgesEnabled:o}=e;if(t)return(0,a.Y)(g.a.Consumer,{children:e=>{let{isFreemail:t,isFreeSubscribed:r,isPledged:i}=e;return l({isFreeSubscribed:r,isSubscribed:!t,isFullySubscribed:n.plans?!t:!o||i,isForPaidSubscription:!!n.plans&&t,isPledged:i})}});let s=i||(null==r?void 0:r.is_free_subscribed),d=null==r?void 0:r.is_subscribed,c=(null==r?void 0:r.is_subscribed)&&(null==r?void 0:r.is_founding),u=null==r?void 0:r.is_pledged;return l({isFreeSubscribed:s,isSubscribed:d,isFullySubscribed:n.plans?d:s&&(!o||u),isForPaidSubscription:!!n.plans&&s&&!d,isPledged:u,isFoundingSubscribed:c})}function k(e){let{pub:t,user:n,now:r,isStatic:i}=e,{language:l}=(0,m.GO)();return(0,a.Y)(b.l9.Consumer,{children:e=>{let{getSettingFor:o}=e,s="disabled"===t.payments_state&&!t.invite_only&&!!o("payment_pledges_enabled");return(0,a.Y)(A,{isStatic:i,user:n,pub:t,pledgesEnabled:s,children:e=>{let{isFreeSubscribed:n,isPledged:i}=e;return(0,a.Y)(a.FK,{children:(0,E.getSubscribeText)(t,{now:r,isFreeSubscribed:n,isPledged:i,pledgesEnabled:s,language:l})})}})}})}class x extends c.Component{onSignup(e,t){let{pledgesEnabled:n}=t;this.setState({loading:!0}),this.props.onSignup?this.props.onSignup(e):!this.props.forceEmailInput&&(this.props.pub.plans||this.props.pub.has_recommendations||n)?document.location.href=(0,w.eV6)(this.props.pub,(0,i._)((0,l._)((0,i._)({addBase:!0,utm_medium:F.Jn.web,utm_source:this.props.source||F.VU.subscribeWidget,utm_content:this.props.post&&this.props.post.id,just_signed_up:!0,requires_confirmation:e.body.requires_confirmation?"true":""},e.body.subscription_id&&{subscription_id:e.body.subscription_id},e.body.referral_token&&{referral_token:e.body.referral_token}),{next:this.props.next||document.location.href}),this.props.foundingUpsell&&{plan:"founding"})):(window.history.replaceState({},"",(0,w.yRP)(document.location.href,{just_subscribed:!0})),document.location.reload())}getHref(e,t){let{pub:n,subscribeButtonAttrs:r,isStatic:l,source:a,post:o,next:s,foundingUpsell:d}=this.props,c=(0,i._)({utm_medium:l?F.Jn.email:F.Jn.web,utm_source:a||F.VU.subscribeWidget,utm_content:o&&o.id,next:l?s:s||document.location.href,referring_pub_ids:l?void 0:(0,S.y)("referring_pub_ids")},d&&{plan:"founding"});return e?l?v.T.ACCOUNT_URL:(0,w.FCy)(n,{params:c,addBase:t.isSubstack}):(0,w.eV6)(n,(0,i._)({addBase:!0,root:r?r.url:l?v.T.CHECKOUT_URL:void 0},c))}getButtonLabel(e,t,n){let{isPledged:r,pledgesEnabled:i,foundingUpsell:l,isFoundingSubscribed:a}=n,{pub:o,subscribeButtonAttrs:s}=this.props,{iString:d}=I18N.i({pub:o});if(e||r)return d("Subscribed");let c=s&&s.text;return c&&!I.includes(c)?c:(0,E.getSubscribeText)(o,{now:!t,isFreeSubscribed:t,isPledged:r,pledgesEnabled:i,language:this.context.language,foundingUpsell:l,isFoundingSubscribed:a})}render(){var e;let{additionalPubIds:t,align:n="center",className:r,expectTruncation:i,forceEmailInput:l,foundingUpsell:o,freeSignup:c,freeSignupEmail:m,isStatic:g,noMargin:v,pub:w,source:S,user:I,onConfirmationRequired:k,onError:x,onPrepareData:N}=this.props,{loading:C}=null!=(e=this.state)?e:{};return(0,a.Y)(b.l9.Consumer,{children:e=>{let{getSettingFor:b}=e;return(0,a.Y)(h.oB.Consumer,{children:e=>{let h=!e.isSubstack&&"undefined"!=typeof window&&w.hostname!==window.location.hostname.replace(/[.]localhost$/,"");return(0,a.Y)(A,{pub:w,user:I,isStatic:g,freeSignup:c,pledgesEnabled:"disabled"===w.payments_state&&!w.invite_only&&!!b("payment_pledges_enabled"),children:A=>{var B;let{isFreeSubscribed:D,isSubscribed:O,isFullySubscribed:R,isPledged:T,isFoundingSubscribed:L}=A,P=this.getButtonLabel(R,D,{isPledged:T,pledgesEnabled:"disabled"===w.payments_state&&!w.invite_only&&!!b("payment_pledges_enabled"),isFoundingSubscribed:L,foundingUpsell:o}),M=D||O;return(0,a.Y)("div",{className:s()("subscribe-widget",{"is-signed-up":M,"is-fully-subscribed":R,"no-margin":v},r),"data-component-name":"SubscribeWidget",children:!l&&(M||g)?(0,a.Y)(Y.az,{className:"button-wrapper",children:g?(0,a.FD)("a",{className:s()("button subscribe-btn",R?"outline":"primary"),href:this.getHref(R,e),"data-native":g?void 0:"",children:[R&&(0,a.Y)(p.A,{stroke:(null==w||null==(B=w.theme)?void 0:B.background_pop_color)||(null==w?void 0:w.theme_var_background_pop)||f.vW,fill:"transparent",isStatic:!0,className:"check-icon static",height:20}),(0,a.Y)("span",{children:P})]}):(0,a.Y)(_.Ye,{justifyContent:"left"===n?"start":"center",children:(0,a.Y)(y.$n,{href:this.getHref(R,e),localNavigation:!1,priority:R&&(L||!o)?"secondary-accent":"primary",leading:R&&(L||!o)?(0,a.Y)(d.A,{size:20}):null,children:(0,a.Y)("span",{children:P})})})}):(0,a.Y)(_.Ye,{justifyContent:"left"===n?"start":"center",children:(0,a.Y)(u.A,{disabled:M||C,freeSignup:c,freeSignupEmail:m,expectTruncation:i,next:h?window.location.href:null,pub:w,source:S||"subscribe-widget",submitButtonText:M?"✓":(0,E.getSubscribeText)(w,{language:this.context.language}),useSubscribeLink:h,useGenericEndpoint:null==e?void 0:e.isSubstack,additionalPubIds:t,user:I,utm_campaign:(null==e?void 0:e.isSubstack)?F._9.reader2:h?F._9.crossPost:null,onConfirmationRequired:k||((null==w?void 0:w.payments_state)==="enabled"?()=>null:void 0),onError:x,onPrepareData:N,onSuccess:e=>this.onSignup(e,{pledgesEnabled:"disabled"===w.payments_state&&!w.invite_only&&!!b("payment_pledges_enabled")})})})})}})}})}})}}(0,r._)(x,"contextType",m.OW)},73484:function(e,t,n){n.d(t,{gJ:()=>l}),n(4006),n(32485);var r=n(17402);n(89490),n(10996),n(36372),n(50587);let i=(0,r.createContext)({initialTab:"settings",isDrawerOpen:()=>!1,openDrawerId:null,setInitialTab:()=>void 0,setIsDrawerOpen:()=>void 0,setPreventChange:()=>void 0});function l(){return(0,r.useContext)(i)}},42509:function(e,t,n){n.d(t,{i:()=>b});var r=n(4006),i=n(32485),l=n.n(i),a=n(82853),o=n(78649),s=n(33764),d=n(64632),c=n(76977),u=n(63136),p=n(11510),h=n(69706),m=n(44307);function b(e){let{image:t,title:n,description:i,url:b,host:g,readOnly:f,isExplicit:Y,onClick:y}=e,_=(0,p.Iu)(),{isHidden:v,onShow:w}=(0,d.k_)(!!Y);return(0,r.Y)(o.Q,{children:(0,r.FD)(c.pT,{"data-testid":"feed-attachment-link",className:l()(m.A.postAttachment,f&&m.A.readOnly),position:"relative",bg:"primary",radius:"md",minWidth:0,padding:12,gap:12,alignItems:"center",onClick:y,as:f?"div":"a",href:f?void 0:b,rel:"nofollow noopener ugc",target:"_blank",pressable:"lg",draggable:!1,showFocus:!0,children:[(0,r.FD)(c.I1,{gap:2,flex:"grow",minWidth:0,children:[g&&(0,r.Y)(u.EY.B4,{as:"p",color:"secondary",clamp:_?1:2,children:g}),(0,r.Y)(u.EY.B3,{clamp:_?1:2,color:"primary",weight:"medium",children:n}),i&&(0,r.Y)(u.EY.B4,{as:"p",color:"secondary",clamp:_?1:2,children:i})]}),t?(0,r.Y)(s.o,{className:l()(m.A.linkImage),src:null!=t?t:"",useRetinaSizing:!0,imageIsFixedWidth:!0,maxWidth:64,imageProps:{smartCrop:!0,aspect:h.Zi}}):(0,r.Y)(c.pT,{width:64,height:64,bg:"secondary",radius:"md",alignItems:"center",justifyContent:"center",children:(0,r.Y)(a.A,{stroke:"var(--color-fg-secondary)"})}),v&&(0,r.Y)(d.Np,{onShow:w})]})})}},58418:function(e,t,n){n.d(t,{A:()=>s});var r=n(17402),i=n(86500),l=n(17186),a=n(16291);let o=()=>{};function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,[s,c]=(0,r.useState)(!!e&&d(e,t,a));return((0,r.useEffect)(()=>{e&&c(d(e,t,a));let n=()=>{c(!0)};if(e){document.addEventListener("dismiss: ".concat(e),n,!1);let t=(0,l.xm)("".concat(e,"-seen-count"))||0;(!a||t{document.removeEventListener("dismiss: ".concat(e),n)}},[e]),e)?[s,()=>{n(),(0,i.u4)(i.qY.DASHBOARD_ACTION_BOX_DISMISSED,{key:e});let t=new Date;(0,l.X3)(e,t.toString()),c(!0);let r=new Event("dismiss: ".concat(e));document.dispatchEvent(r)}]:[!0,o]}function d(e,t,n){let r="undefined"==typeof window?new Date().toString():(0,l.xm)(e),i="undefined"==typeof window?0:(0,l.xm)("".concat(e,"-seen-count")),o=r||n&&i>=n;return o&&t?(0,a.A)(r).add(t,"second").isAfterNow():!!(r||o)}},66238:function(e,t,n){n.d(t,{C:()=>l});var r=n(9740),i=n(82776);function l(e,t){var n,l,o,s;let d,c,u=null==(n=e.name)?void 0:n.trim(),p=u;(0,i.endsWithPunctuation)(u)&&(p='"'.concat(u,'"'));let h=(0,r.MV)(e.contributors);return(e.invite_only?(d=null,c=null):(d=(null==(o=e.rankingDetailFreeIncluded)?void 0:o.toLowerCase().includes("subscribers"))?e.rankingDetailFreeIncluded.toLowerCase():null,c=e.rankingDetailFreeIncluded||e.rankingDetail),"profile"===e.homepage_type&&e.author_name)?a({name:e.author_name,bio:e.author_bio,primaryDescriptionOverride:t,readerCount:d,rankingDetail:c}):(0,r.w4)(null!=(s=null!=t?t:null==(l=e.hero_text)?void 0:l.trim())?s:"",h,d,p,c)}let a=e=>{let{name:t,bio:n,primaryDescriptionOverride:i,readerCount:l,rankingDetail:a}=e,o="";if(i||n){var s;o="".concat((0,r.pH)(null!=(s=null!=i?i:n)?s:"")," ")}return o+(l?"Click to read ".concat(t,", a Substack with ").concat(l,"."):a?"Click to read ".concat(t," on Substack. ").concat(a,"."):"Click to read ".concat(t," on Substack."))}},52585:function(e,t,n){n.d(t,{h:()=>h});var r=n(4006),i=n(35426),l=n(38390),a=n(23623),o=n(90460),s=n(8012),d=n(85205),c=n(35843),u=n(80988),p=n(45346);function h(e){let{isOpen:t,onClose:n=()=>void 0,children:h}=e;return(0,o.h)(t),(0,r.Y)(l.bL,{open:t,onOpenChange:e=>{e||n()},children:(0,r.Y)(l.ZL,{forceMount:!0,children:(0,r.Y)(i.e.Root,{show:t,children:(0,r.FD)(u.k,{children:[(0,r.Y)(p.B,{children:(0,r.Y)(s.p,{onClose:n})}),(0,r.Y)(a.a,{children:(0,r.Y)(c.O,{children:(0,r.Y)(d.D,{children:h})})})]})})})})}},17762:function(e,t,n){n.d(t,{u:()=>f});var r=n(4006),i=n(17402),l=n(58398),a=n(46271),o=n(68767),s=n(68923),d=n(52347),c=n(99978),u=n(98722),p=n(40306),h=n(13064),m=n(49807),b=n(82776),g=n(57324);function f(e){let{isLoading:t=!1,publication:n,post:f,onLike:Y}=e,y=(0,a.Jd)(),[_,v]=(0,i.useState)(!1),{isLiked:w,likeCount:S,handleLike:E}=(0,u.V)(f,Y),{handleRestack:F,postWithRestackState:I}=(0,p.T)(f);if(t)return(0,r.Y)(h.M,{});if(!n||!f)return null;let A=!y||!n.community_enabled,k=(0,b.showCommentsOnPost)({publication:n,post:f}),x="profile"===n.homepage_type?(0,m.q$n)(n,f):(0,m.wu9)(n,f,{comments:!0,urlParams:{utm_source:g.VU.substack,utm_medium:g.Jn.web,utm_campaign:g._9.postViewer}});return(0,r.FD)(r.FK,{children:[(0,r.Y)(s.c,{onClick:E,count:S,active:w,disabled:A,priority:"primary"}),(0,r.Y)(o.k,{href:x,count:f.comment_count,newTab:"profile"!==n.homepage_type,disabled:A||!k,priority:"primary"}),(0,r.Y)(d.H,{pub:n,post:I,priority:"primary",onRestack:F}),(0,r.Y)(c.w,{priority:"primary",onClick:()=>{v(!0)}}),(0,r.Y)(l.Z,{isOpen:_,onClose:()=>v(!1),medium:"post viewer",utm_campaign:"post-expanded-share",user:y,post:f,pub:n})]})}},7963:function(e,t,n){n.d(t,{t:()=>a});var r=n(4006),i=n(76977),l=n(6606);function a(e){let{children:t}=e;return(0,r.Y)(i.fI,{justifyContent:"space-between",alignItems:"center",sizing:"border-box",gap:32,className:l.A.layout,children:t})}},51683:function(e,t,n){n.d(t,{lp:()=>l}),n(4006),n(45994),n(32485),n(17159),n(96790),n(78895),n(66443),n(89607),n(95282);var r=n(2675);n(78479),n(58292),n(24078),n(89490),n(16074),n(76977),n(63136),n(35276);var i=n(70568);function l(e){let{linkAttachment:t,imageAttachments:n,videoAttachments:l,quoteAttachments:a}=(0,i.B)(e);return!!t&&("comment"===t.type||"post"===t.type&&null!==(0,r.VA)({post:t.post,compact:!1,readOnly:!0}))||n.length>0||l.length>0||a.length>0}n(16291),n(39318),n(49807),n(11993),n(44307)},70568:function(e,t,n){function r(e){var t,n,r,i,l,a,o,s,d;let c=null==(t=e.attachments)?void 0:t.find(e=>["post","comment","link","publication"].includes(e.type)),u=null!=(a=null==(n=e.attachments)?void 0:n.filter(e=>"image"===e.type))?a:[],p=null!=(o=null==(r=e.attachments)?void 0:r.filter(e=>"video"===e.type))?o:[];return{linkAttachment:c,imageAttachments:u,videoAttachments:p,quoteAttachments:null!=(s=null==(i=e.attachments)?void 0:i.filter(e=>"post"===e.type&&!!e.postSelection))?s:[],imageRestackAttachments:null!=(d=null==(l=e.attachments)?void 0:l.filter(e=>"post"===e.type&&!!e.postImageSelection))?d:[]}}n.d(t,{B:()=>r}),n(4006),n(10278),n(42686),n(2675),n(8103),n(22858),n(78479),n(89490),n(93812),n(39318)},92967:function(e,t,n){n.d(t,{P6:()=>l,i:()=>a,kq:()=>i,lL:()=>r,wG:()=>o});let r=e=>{let t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))};function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e<0)return"0:00";let n=Math.floor(e),r=Math.floor(n/60),i=n%60;if(t){let t=Math.round((e-n)*10);return"".concat(r,":").concat(String(i).padStart(2,"0"),".").concat(t)}return"".concat(r,":").concat(String(i).padStart(2,"0"))}let l=e=>/^[0-9.:]*$/.test(e),a=e=>/^(?:(?:[0-9]{1,3}):)?(?:[0-5][0-9]|[0-9]{1,2})(?:\.[0-9]{1,3})?$/.test(e),o=e=>{let[t="",n=""]=e.split("."),r=t.split(":").reverse().map(e=>parseInt(e)),i=r[0]||0,l=r[1]||0;return 3600*(r[2]||0)+60*l+i+parseInt(n.padEnd(3,"0"))/1e3}}}]);