!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@c7747fb"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0456549d-2701-45ce-a349-9c34888ecf04",e._sentryDebugIdIdentifier="sentry-dbid-0456549d-2701-45ce-a349-9c34888ecf04")}catch(e){}}();"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["90643"],{3223:function(e,t,n){n.d(t,{A:()=>i});let i={mention:"mention-pnpTE1",mentionStatic:"mentionStatic-liMklk"}},65259:function(){},66874:function(e,t,n){n.d(t,{A:()=>i});let i={dismissButton:"dismissButton-R_gyXq"}},22857:function(e,t,n){n.d(t,{q:()=>r});var i=n(4006),a=n(10996);let r=e=>{let{children:t,disable:n}=e;return n?(0,i.Y)(i.FK,{children:t}):(0,i.Y)(a.NP,{theme:"light-theme",children:t})}},84297:function(e,t,n){n.d(t,{a:()=>i});let i=e=>e.video_upload_id?"Watch":"podcast"===e.type?"Listen":"Read"},80520:function(e,t,n){n.d(t,{N:()=>Y});var i=n(4006),a=n(46110),r=n(17402),o=n(22857),l=n(84605),s=n(27749),c=n(2675),d=n(75840),u=n(35369),h=n(76977),p=n(16993),m=n(63136),g=n(504),f=n(44307);function Y(e){let{item:t,pub:n,post:o}=e,[s,c]=(0,r.useState)(!1),{iString:d}=(0,l.GO)();return(0,i.FD)(i.FK,{children:[(0,i.Y)(u.K0,{priority:"quaternary",size:"sm",className:f.A.moreButton,onClick:()=>c(!0),children:(0,i.Y)(a.A,{size:16})}),(0,i.FD)(p.aF,{isOpen:s,onClose:()=>c(!1),width:440,children:[(0,i.Y)(p.rQ,{icon:(0,i.Y)(a.A,{size:20}),title:d("Auto-generated clip"),onClose:()=>c(!1)}),(0,i.Y)(p.cw,{children:(0,i.Y)(h.I1,{gap:16,children:(0,i.Y)(m.EY.B3,{children:d("Substack automatically selected this clip for you from the full video below.")})})}),(0,i.Y)(p.jl,{primaryButton:(0,i.Y)(y,{item:t,pub:n,post:o,onClose:()=>c(!1)}),secondaryButton:(0,i.Y)(u.$n,{priority:"secondary",onClick:()=>c(!1),children:d("Done")})})]})]})}let y=e=>{let{item:t,pub:n,post:a,onClose:h}=e,{iString:p}=(0,l.GO)(),m=(0,c.vZ)({post:a,publication:n}),f=(0,s.PK)(),Y=(0,r.useContext)(d.P);return(0,i.Y)(o.q,{children:(0,i.Y)(u.$n,{priority:"primary",onClick:e=>{(0,g.Qb)(t,f,"watch_full_episode",{tabId:Y}),m(e),h()},children:p("View Full Episode")})})}},75051:function(e,t,n){n.d(t,{Y:()=>A});var i=n(69277),a=n(70408),r=n(4006),o=n(32485),l=n.n(o),s=n(45773),c=n(78834),d=n(70511),u=n(17402),h=n(78649),p=n(33764),m=n(93355),g=n(86500),f=n(12501),Y=n(17028),y=n(62870),w=n(93812),v=n(92563),_=n(29682),b=n(39318),k=n(49807),C=n(98949);let S={header:"header-LkrdOr",footer:"footer-EnTWMp",swatchContainer:"swatchContainer-aa9QGg",checkIconContainer:"checkIconContainer-OhnBup"};function T(e){var t,n,i,a,o,l;let{comment:s,imageShareAsset:c,aspectRatio:d}=e,{width:u,height:h}=(0,v.S8)(d),{img:p,imgDownload:f,shareData:Y,useNativeShare:w}=(0,m.Y)({shareTitle:"A note from ".concat(s.name),shareText:s.body,shareUrl:(0,k.M$q)("c-".concat(s.id)),imageUrl:null!=(t=null==c?void 0:c.composed_url)?t:"",imageDownloadUrl:null!=(o=null!=(a=(0,b.tbS)({noteId:"c-".concat(s.id),variant:null!=(n=null==c?void 0:c.variant)?n:"orange",type:"composed",aspectRatio:null!=(i=null==c?void 0:c.aspectRatio)?i:"stories"}))?a:null==c?void 0:c.composed_url)?o:"",imageUrlSameOrigin:null!=(l=null==c?void 0:c.composed_url)?l:""});async function _(){if((0,g.u4)(g.qY.NOTE_IMAGE_ASSET_DOWNLOADED,{comment_id:s.id,aspect_ratio:null==c?void 0:c.aspectRatio,source:"note-image-asset",interaction:"click"}),Y)try{await navigator.share(Y)}catch(e){}}return(0,r.Y)(y.Cs,{onClick:_,href:w?void 0:f,children:(0,r.FD)(y.OK,{size:h,aspectRatio:u/h,children:[!(0,C.Fr)()&&p&&(0,r.Y)(y.lh,{onClick:_,width:u}),(0,r.Y)(y.BB,{img:p})]})})}function A(e){var t,n,i;let{comment:a}=e,[o,l]=(0,u.useState)("stories"),[s,c]=(0,u.useState)("orange"),d=((e,t)=>{let{result:n,error:i}=(0,f.st)({pathname:"/api/v1/note/assets/c-".concat(e.id),query:{aspectRatio:t},deps:[e.id,t],auto:!0});return(0,u.useMemo)(()=>i?[]:n,[n,i])})(a,o),p=null==d?void 0:d.find(e=>e.aspectRatio===o&&e.variant===s),m=null!=(i=null==(n=a.attachments)||null==(t=n.find(e=>"image"===e.type))?void 0:t.imageUrl)?i:a.photo_url;return(0,r.Y)(h.Q,{children:(0,r.FD)(E,{children:[(0,r.Y)(Y.az,{className:S.header,children:(0,r.Y)(F,{aspectRatio:o,setAspectRatio:l})}),(0,r.Y)(Y.Ye,{justifyContent:"center",padding:12,children:(0,r.Y)(T,{aspectRatio:o,comment:a,imageShareAsset:p})}),(0,r.Y)(I,{selectedVariant:s,setSelectedVariant:c,photoUrl:m})]})})}function I(e){let{selectedVariant:t,setSelectedVariant:n,photoUrl:i}=e;return(0,r.Y)(Y.fI,{gap:8,justifyContent:"center",children:_.ix.map(e=>(0,r.Y)(D,{variant:e,setSelectedVariant:n,isSelected:t===e,photoUrl:i},e))})}function D(e){let{variant:t,setSelectedVariant:n,isSelected:o,photoUrl:c}=e,d=(0,w.kE)({variant:t,width:32,height:32,backgroundImageSrc:c});return(0,r.FD)(Y.az,{width:32,height:32,radius:"sm",cursor:"pointer",overflow:"hidden",sizing:"border-box",position:"relative",onClick:function(){n(t)},className:l()(S.swatchContainer,o&&S.selected),children:[(0,r.Y)(Y.az,{className:S.checkIconContainer,children:o&&(0,r.Y)(s.A,{size:24})}),"css"===d.type?(0,r.Y)(Y.az,{height:32,width:32,sizing:"border-box",style:d.style}):(0,r.Y)(p.o,{src:d.src,maxWidth:32,imageProps:(0,a._)((0,i._)({},d.imgProps),{height:32})})]})}let E=(0,Y.I4)({display:"flex",direction:"column",alignItems:"center",overflow:"hidden",paddingBottom:20});function F(e){let{aspectRatio:t,setAspectRatio:n}=e;return(0,r.Y)(Y.fI,{gap:8,borderBottom:"detail",padding:16,justifyContent:"center",children:_.yo.map(e=>(0,r.Y)(Y.$n,{size:"sm",priority:t===e?"primary-mono":"secondary",onClick:()=>n(e),leading:"grid"===e?(0,r.Y)(c.A,{size:20}):(0,r.Y)(d.A,{size:20}),children:"grid"===e?"Grid":"Stories"},e))})}},90136:function(e,t,n){n.d(t,{P:()=>k,$:()=>C});var i=n(4006),a=n(91378),r=n(94140),o=n(11749),l=n(17402),s=n(84605),c=n(27749),d=n(75840),u=n(86500),h=n(12501),p=n(35369),m=n(76977),g=n(45859),f=n(16993),Y=n(63136),y=n(11587),w=n(36372),v=n(504),_=n(49807);let b="translateButton-IHtTNI";function k(e){let{comment:t,onToggleTranslation:n,isShowingTranslation:r,item:o}=e,{iString:u}=(0,s.GO)(),f=(0,c.PK)(),y=(0,d.T)(),k=(0,w.d)(),[C,S]=(0,l.useState)(!1),{isLoading:A,refetch:I}=(0,h.st)({pathname:"/api/v1/note/".concat((0,_.Vvu)(t.id,"comment"),"/translate")}),D=async e=>{if(e.stopPropagation(),A)return;if(o&&(0,v.Qb)(o,f,"translate",{tabId:y,extraEventProps:{is_translated:!1}}),t.translation)return void n(t);let a=await I();a instanceof Error?k.popToast(()=>(0,i.Y)(w.y,{text:u("Translation failed. Please try again.")})):n(a.item.comment)};if(r)return(0,i.FD)(i.FK,{children:[(0,i.FD)(g.W1,{trigger:(0,i.Y)(p.Nm,{resetCss:!0,className:b,children:(0,i.FD)(m.Ye,{gap:4,alignItems:"center",children:[(0,i.Y)(a.A,{size:12}),(0,i.Y)(Y.EY.B4,{as:"span",children:u("Translated")})]})}),align:"start",children:[(0,i.Y)(g.Dr,{href:"/settings?section=translations",children:u("Translation settings")}),(0,i.Y)(g.Dr,{onClick:()=>S(!0),children:u("Translation feedback")}),(0,i.Y)(g.Dr,{onClick:()=>{o&&(0,v.Qb)(o,f,"show_original",{tabId:y,extraEventProps:{is_translated:!0}}),n()},children:u("Show original")})]}),(0,i.Y)(T,{isOpen:C,onClose:()=>S(!1),item:o})]});let E=A?u("Translating..."):u("Translate");return(0,i.Y)(Y.EY.B4,{as:"span",onClick:D,className:b,children:(0,i.FD)(m.Ye,{gap:4,alignItems:"center",children:[(0,i.Y)(a.A,{size:12}),E]})})}function C(e,t){var n;return!!(e&&(null!=e.language&&e.language!==t||(null==(n=e.attachments)?void 0:n.some(e=>"comment"===e.type&&null!=e.comment.language&&e.comment.language!==t))))}let S=["unintended_meaning","awkward_or_incoherent","too_formal_or_casual","inappropriate_or_offensive","other"];function T(e){let{isOpen:t,onClose:n,item:a}=e,{iString:d}=(0,s.GO)(),h=(0,c.PK)(),g={unintended_meaning:d("Unintended meaning"),awkward_or_incoherent:d("Awkward or incoherent"),too_formal_or_casual:d("Too formal or casual"),inappropriate_or_offensive:d("Inappropriate or offensive"),other:d("Other")},[w,v]=(0,l.useState)(!1),[_,b]=(0,l.useState)(new Set),[k,C]=(0,l.useState)(""),T=()=>{v(!1),b(new Set),C(""),n()},A=e=>{a&&"comment"===a.type&&(0,u.u4)(u.qY.NOTE_TRANSLATION_FEEDBACK_SUBMITTED,{noteId:a.entity_key,surface:h,feedback:e,feedback_reason:Array.from(_),other:k.trim()}),T()};return(0,i.FD)(f.aF,{isOpen:t,onClose:T,width:360,children:[(0,i.Y)(f.rQ,{title:d("Rate this translation"),description:d("Your feedback will be used to help improve translations"),alignItems:"center",onClose:T}),(0,i.Y)(f.cw,{padding:0,children:(0,i.FD)(m.I1,{gap:16,children:[(0,i.FD)(m.Ye,{gap:16,paddingX:20,paddingTop:28,paddingBottom:w?28:48,justifyContent:"center",children:[(0,i.Y)(p.K0,{priority:"secondary-outline",size:"lg",width:64,height:64,rounded:!0,"aria-label":d("Good translation"),onClick:()=>A("up"),children:(0,i.Y)(r.A,{size:20})}),(0,i.Y)(p.K0,{height:64,width:64,priority:w?"primary":"secondary-outline",size:"lg",rounded:!0,"aria-label":d("Bad translation"),onClick:()=>v(!0),children:(0,i.Y)(o.A,{size:20})})]}),w&&(0,i.FD)(m.I1,{gap:16,borderTop:"detail",paddingX:20,paddingBottom:20,paddingTop:16,children:[(0,i.Y)(Y.EY.B3,{weight:"semibold",children:d("Tell us more")}),(0,i.Y)(m.Ye,{gap:8,style:{flexWrap:"wrap"},children:S.map(e=>(0,i.Y)(p.$n,{priority:_.has(e)?"primary":"secondary-outline",size:"sm",onClick:()=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},children:g[e]},e))}),_.has("other")&&(0,i.Y)(y.T,{value:k,onChange:e=>C(e.currentTarget.value),placeholder:d("Tell us more..."),rows:4,maxlength:500}),(0,i.Y)(p.$n,{priority:"primary",onClick:()=>A("down"),children:d("Submit")})]})]})})]})}},93355:function(e,t,n){n.d(t,{Y:()=>l});var i=n(17402),a=n(95641),r=n(68349),o=n(98949);function l(e){let[t,n]=(0,i.useState)(""),[l,s]=(0,i.useState)(""),[c,d]=(0,i.useState)({}),[u,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(0,o.Fr)()&&navigator.share&&navigator.canShare(c)&&h(!0)},[c]),(0,i.useEffect)(()=>{!async function(){n("");let t=e.imageUrl;if((0,r.NN)(e.imageUrl,()=>{n(t),s(e.imageDownloadUrl)}),(0,o.Fr)()){var i,a;let n=await fetch(e.imageUrlSameOrigin||t),r=["instagram","instagram-stories"].includes(null!=(i=e.shareApp)?i:"");d({title:r?void 0:e.shareTitle,text:r?void 0:null!=(a=e.shareText)?a:void 0,files:[new File([await n.blob()],"image.png",{type:"image/png"})],url:r?void 0:e.shareUrl})}}()},[e.imageDownloadUrl,e.imageUrl,e.shareApp,e.shareText,e.shareTitle,e.shareUrl]);let{refetch:p}=(0,a.E)({method:"post",pathname:"/api/v1/press_kit/notification",body:{title:e.shareText,imageUrl:e.imageUrl,shareApp:e.shareApp},deps:[e.shareText,e.imageUrl,e.shareApp]});return{img:t,imgDownload:l,sendPushNotification:(0,i.useCallback)(async()=>{let e=await p();return!(e instanceof Error)&&e.success},[p]),shareData:c,useNativeShare:u}}},38093:function(e,t,n){n.d(t,{Q:()=>y,Z:()=>Y});var i=n(69277),a=n(4006),r=n(32485),o=n.n(r),l=n(42216),s=n(17402),c=n(84605),d=n(94729),u=n(89490),h=n(8149),p=n(76977),m=n(20500),g=n(63136),f=n(24311);function Y(e){let{email:t,redirect:n,forPub:r,islandMagicSignin:o,onIsAttemptingLoginChange:c}=e,[u,p]=(0,s.useState)(""),[m,g]=(0,s.useState)(!1),[f,Y]=(0,s.useState)(!1),[y,k]=(0,s.useState)(!1),C=async()=>{g(!0),c&&c(!0);try{let[e]=await Promise.all([(0,d.x6)("/api/v1/email-otp-login/complete",{method:"POST",json:{code:u,email:t,redirect:n,for_pub:r,island_magic_signin:o}}),new Promise(e=>setTimeout(e,250))]);window.location.href=e.redirect}catch(e){e instanceof d.fk&&"login_guard_challenge"===e.body.type&&k(!0),g(!1),c&&c(!1),Y(!0),p("")}};return t?(0,a.FD)(_,{children:[(0,a.Y)(l.wE,{autoFocus:!0,maxLength:6,pattern:l.UO,onChange:e=>{p(e),e.length&&Y(!1)},onComplete:C,value:u,render:e=>{let{slots:t}=e;return(0,a.Y)(b,{children:t.map((e,t)=>(0,a.Y)(w,(0,i._)({disabled:m},e),t))})}}),(0,a.Y)(h.N,{open:!!f,children:(0,a.Y)(v,{suspiciousLogin:y})})]}):null}function y(e){let{onComplete:t,error:n,isLoading:r}=e,[o,d]=(0,s.useState)(""),{iString:u}=(0,c.GO)();return(0,a.FD)(_,{children:[(0,a.Y)(l.wE,{autoFocus:!0,maxLength:6,pattern:l.UO,onChange:e=>{d(e)},onComplete:e=>{r||t(e)},value:o,disabled:r,render:e=>{let{slots:t}=e;return(0,a.Y)(b,{children:t.map((e,t)=>(0,a.Y)(w,(0,i._)({disabled:r},e),t))})}}),n&&(0,a.Y)(m.yn,{style:{textAlign:"center"},children:u("You entered an incorrect code. Please try again.")})]})}function w(e){let{char:t,isActive:n,disabled:i}=e;return(0,a.Y)(p.fI,{justifyContent:"center",alignItems:"center",width:36,height:40,className:o()(f.A.input,n&&f.A.focus,i&&f.A.disabled),children:(0,a.Y)(g.EY.B2,{textAlign:"center",children:t||""})})}function v(e){let{suspiciousLogin:t}=e,{iString:n}=(0,c.GO)(),i=n(t?"Please check your email for instructions to complete signing in.":"You entered an incorrect code. Please try again.");return(0,a.Y)(m.yn,{style:{textAlign:"center"},children:i})}let _=(0,u.I4)({display:"flex",direction:"column",alignItems:"center",gap:8}),b=(0,u.I4)({display:"flex",direction:"row",justifyContent:"center",alignItems:"center",gap:8})}}]);