"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["222"],{19548:function(e,t,r){if(r.d(t,{CH:()=>w,Jv:()=>_,KG:()=>b,Y_:()=>v,Yq:()=>N,fQ:()=>x,gc:()=>y}),/^(2[79]87|3154|4716|6909)$/.test(r.j))var n=r(7409);if(/^(2[79]87|3154|4716|6909)$/.test(r.j))var i=r(99282);var a=r(16584),o=r(6400),l=r(30396);if(/^(2[79]87|3154|4716|6909)$/.test(r.j))var s=r(10844);if(/^(2[79]87|3154|4716|6909)$/.test(r.j))var c=r(88812);var d=r(60807),u=r(48980),h=r(7882),f=r(98914),m=r(44424),p=r(70379);let Z={mutes:[],blocks:[],blocked:[]},g=(0,o.createContext)({result:Z,refetch:async()=>null,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1});function v(e){let{user:t,children:r}=e,n=(0,h.ib)({pathname:"/api/v1/blocks/ids",deps:[t],auto:!!t}),i=(0,l.Ye)(()=>{let{result:e,refetch:t}=n;if(e){let{blocked:r,mutes:n,blocks:i}=e,a=new Set(r),o=new Set(n),l=new Set(i);return{result:e,refetch:t,isBlockingUser:e=>a.has(e),isMutedByUser:e=>o.has(e),isBlockedByUser:e=>l.has(e)}}return{result:Z,refetch:t,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1}},[n.result]);return(0,a.tZ)(g.Provider,{value:i,children:r})}function _(){return(0,l.qp)(g)}function b(e){let{isBlockingUser:t,isBlockedByUser:r}=(0,l.qp)(g);return e?r(e)?"blocking":t(e)?"blocked":null:null}function y(e){let{isBlockingUser:t,isBlockedByUser:r,isMutedByUser:n}=(0,l.qp)(g);return e?n(e)?"muting":r(e)?"blocking":t(e)?"blocked":null:null}function w(e,t){let{surface:r,noteId:o,onClick:l}=t,h=(0,d.aF)(),Z=!!(h&&e&&h.id!==e.id),g=_(),v=y(null==e?void 0:e.id),b=(0,p.pm)(),w=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"mute",surface:r,noteId:o}})}catch(e){b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:(0,f.zx)(e)})));return}g.refetch(),b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:"".concat(e.name||"User"," muted"),Icon:s.Z}))),null==l||l("mute")}},k=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:r,noteId:o}})}catch(e){b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:(0,f.zx)(e)})));return}g.refetch(),b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:"".concat(e.name||"User"," unmuted"),Icon:s.Z}))),null==l||l("unmute")}},x=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"POST",json:{type:"block",surface:r,noteId:o}})}catch(e){b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:(0,f.zx)(e)})));return}g.refetch(),b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:"".concat(e.name||"User"," blocked"),Icon:c.Z}))),null==l||l("block")}},N=async()=>{if(e){try{await (0,u.rd)("/api/v1/blocks/".concat(e.id),{method:"DELETE",query:{surface:r,noteId:o}})}catch(e){b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:(0,f.zx)(e)})));return}g.refetch(),b.popToast(t=>(0,a.tZ)(p.FN,(0,i._)((0,n._)({},t),{text:"".concat(e.name||"User"," unblocked"),Icon:c.Z}))),null==l||l("unblock")}},B=[];return Z&&("blocking"!==v&&B.push((0,a.tZ)(m.sN,{leading:(0,a.tZ)(s.Z,{}),priority:"destructive",onClick:"muting"===v?k:w,children:"muting"===v?"Unmute":"Mute"})),B.push((0,a.tZ)(m.sN,{leading:(0,a.tZ)(c.Z,{}),priority:"destructive",onClick:"blocking"===v?N:x,children:"blocking"===v?"Unblock":"Block"}))),B}g.displayName="UserBlockContext";let k=(0,o.createContext)(!1);function x(e){let{muteFree:t=!0,children:r}=e;return(0,a.tZ)(k.Provider,{value:t,children:r})}function N(){return(0,l.qp)(k)}k.displayName="MuteFreeZone"},87077:function(e,t,r){r.d(t,{k:()=>b,u:()=>y});var n=r(7409),i=r(99282),a=r(98848),o=r(16584),l=r(19425),s=r(94184),c=r.n(s),d=r(98661),u=r(62372),h=r(29032),f=r(20888),m=r(71068),p=r(19081),Z=r(58175),g=r(165);let v=["top-start","top-center","top-end","bottom-start","bottom-center","bottom-end"],_=["left-start","left-center","left-end","right-start","right-center","right-end"],b=/^(298|743)7$/.test(r.j)?{size:16,color:"var(--color-utility-white)"}:null,y=e=>{var{children:t,text:r,title:l,imageUrl:s,as:h="span",leading:f,trailing:m,preferPlacement:p="top-center",layerOptions:Z,disabled:b,hoverOptions:y={}}=e,k=(0,a._)(e,["children","text","title","imageUrl","as","leading","trailing","preferPlacement","layerOptions","disabled","hoverOptions"]);let{layerProps:x,triggerProps:N,hoverProps:B,transitionProps:L,renderLayer:C,shouldShow:S}=function(){var e;let{hoverOptions:t,layerOptions:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[i,a]=(0,d.useState)(!1),[o,l]=(0,u.XI)((0,n._)({},t)),{triggerProps:s,layerProps:h,renderLayer:f}=(0,u.sJ)((0,n._)({isOpen:o,auto:!0,triggerOffset:8},r)),m=null!==(e=null==r?void 0:r.placement)&&void 0!==e?e:"top-center",p="",Z="";switch(m){case"top-start":case"top-center":case"top-end":default:p=c()(g.Z.hide,g.Z.fromBelow),Z=c()(g.Z.hide,g.Z.fromBelow);break;case"bottom-start":case"bottom-center":case"bottom-end":p=c()(g.Z.hide,g.Z.fromAbove),Z=c()(g.Z.hide,g.Z.fromAbove);break;case"left-start":case"left-center":case"left-end":p=c()(g.Z.hide,g.Z.fromRight),Z=c()(g.Z.hide,g.Z.fromRight);break;case"right-start":case"right-center":case"right-end":p=c()(g.Z.hide,g.Z.fromLeft),Z=c()(g.Z.hide,g.Z.fromLeft)}return{layerProps:h,triggerProps:s,hoverProps:l,transitionProps:{show:o,beforeEnter:()=>a(!0),afterLeave:()=>a(!1),enterFrom:p,leaveTo:Z},renderLayer:f,shouldShow:o||i}}({layerOptions:(0,n._)({placement:p,possiblePlacements:_.includes(p)?_:v},Z),hoverOptions:(0,n._)({delayLeave:50},y)}),{style:T}=x,E=(0,a._)(x,["style"]);return b?(0,o.tZ)(o.HY,{children:t}):(0,o.BX)(o.HY,{children:[(0,o.tZ)(h,(0,i._)((0,n._)({},N,B,k),{children:t})),S&&C((0,o.tZ)(w,{transitionProps:L,tooltipProps:(0,i._)((0,n._)({},E,B),{style:(0,i._)((0,n._)({},T),{maxWidth:320,zIndex:Number.MAX_SAFE_INTEGER})}),text:r,title:l,imageUrl:s,leading:f,trailing:m}))]})};function w(e){let{transitionProps:t,tooltipProps:r,leading:a,trailing:l,text:s,title:c,imageUrl:u}=e,m=s&&!c&&!u;return(0,o.tZ)("div",(0,i._)((0,n._)({},r),{children:(0,o.tZ)(C,(0,i._)((0,n._)({},t),{children:(0,o.tZ)(h.C,{children:(0,o.BX)(L,{textOnly:m,children:[u&&(0,o.tZ)(B,{children:(0,o.tZ)(f.e,{src:u,maxWidth:296,useRetinaSizing:!0,imageIsFixedWidth:!0})}),(0,o.BX)(N,{hasTitle:!!c,children:[a&&(0,o.tZ)(x,{children:a}),(0,o.BX)(k,{children:[c&&(0,o.tZ)(Z.xv.B4,{weight:"medium",color:"primary",className:g.Z.title,children:c}),(0,o.tZ)(Z.xv.B4,{color:"primary",opacity:80,lineHeight:16,children:"string"==typeof s?s.split("\n").map((e,t)=>(0,o.BX)(d.Fragment,{children:[t>0&&(0,o.tZ)("br",{}),e]},t)):s})]}),l&&(0,o.tZ)(x,{children:l})]})]})})}))}))}let k=(0,m.zo)({display:"flex",direction:"column",gap:2});function x(e){let{children:t}=e;return(0,o.tZ)(p.X2,{alignItems:"center",justifyContent:"center",className:g.Z.endcapContainer,flex:"auto",gap:8,children:t})}function N(e){let{hasTitle:t,children:r}=e;return(0,o.tZ)(p.X2,{alignItems:t?"start":"center",gap:8,children:r})}function B(e){let{children:t}=e;return(0,o.tZ)(p.sg,{border:"detail",radius:"sm",className:g.Z.imageContainer,overflow:"hidden",children:t})}function L(e){let{textOnly:t,children:r}=e;return(0,o.tZ)(p.sg,{alignItems:"center",paddingY:t?6:12,paddingX:t?8:12,gap:8,radius:"md",shadow:"md",border:"detail",bg:"secondary",children:r})}function C(e){return(0,o.tZ)(l.u,(0,n._)({appear:!0,unmount:!1,className:g.Z.animate,enterTo:g.Z.show,leaveFrom:g.Z.show},e))}},45783:function(e,t,r){if(r.d(t,{De:()=>p,R3:()=>_,eK:()=>m,nD:()=>g,rQ:()=>Z}),!/^(1588|1691|2536|4457)$/.test(r.j))var n=r(7409);if(!/^(1588|1691|2536|4457)$/.test(r.j))var i=r(99282);if(/^(2987|3270)$/.test(r.j))var a=r(98848);var o=r(16584),l=r(94184),s=r.n(l);if(/^(2987|3154|4716|6909|7437)$/.test(r.j))var c=r(56743);if(/^(2987|3154|4716|6909|7437)$/.test(r.j))var d=r(2564);var u=r(98661),h=r(80026),f=r(68857);let m=function(e){let{inset:t=0,pageSizeAdjust:r=0,initialState:a,scrollFullPage:o=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[l,s]=(0,u.useState)(a||{showLeft:!1,showRight:!1});return(0,u.useEffect)(()=>{let{current:r}=e;if(r){let e=()=>{s(e=>{let a=e;!a.showLeft&&r.scrollLeft>t?a=(0,i._)((0,n._)({},e),{showLeft:!0}):a.showLeft&&r.scrollLeft<=t&&(a=(0,i._)((0,n._)({},e),{showLeft:!1}));let o=r.scrollWidth-r.offsetWidth-4-t;return!a.showRight&&r.scrollLeft=o&&(a=(0,i._)((0,n._)({},e),{showRight:!1})),a})};return r.addEventListener("scroll",e),setTimeout(()=>{e()},50),()=>{r.removeEventListener("scroll",e)}}},[]),{state:l,handleArrowClick:t=>()=>{let{current:n}=e;n&&n.scrollBy({left:t*(o?n.offsetWidth:n.offsetWidth/2-r),behavior:"smooth"})}}};function p(e){var{className:t,scrollRef:r}=e,l=(0,a._)(e,["className","scrollRef"]);return(0,o.tZ)(h.hs,(0,i._)((0,n._)({},l),{className:s()(f.Z.scrollBox,t),ref:r,overflowX:"auto",scrollBar:"hidden",minWidth:0,onTouchStart:e=>{let{pageX:t}=e;void 0!==t&&(!(t>10)||!(tu,m:()=>f});var n=r(27412),i=r(16584),a=r(20042),o=r(98661),l=r(20888),s=r(9682),c=r(19081),d=r(58175);class u extends o.Component{static getDerivedStateFromError(e){return{error:e}}componentDidMount(){Promise.all([r.e("7152"),r.e("6993")]).then(r.bind(r,91985)).then(e=>{this.Sentry=e.Sentry})}componentDidCatch(e){console.error(e),this.Sentry&&this.Sentry.captureException(e)}render(){let{error:e}=this.state;return(0,i.tZ)(h,{onReset:()=>this.setState({error:null}),error:e,children:e?(0,i.tZ)(f,{}):this.props.children})}constructor(e){super(e),(0,n._)(this,"Sentry",null),this.state={error:null}}}function h(e){let{onReset:t,error:r,children:n}=e,l=(0,o.useRef)((0,a.getCurrentUrl)());return(0,s.js)(e=>{r&&l.current!==e&&t(),l.current=e},[]),r?(0,i.tZ)(f,{}):n}function f(){return(0,i.BX)(c.tu,{flex:"grow",justifyContent:"center",alignItems:"center",gap:32,padding:20,children:[(0,i.tZ)(l.e,{src:"/img/reader/toad.png",maxWidth:200}),(0,i.BX)(c.tu,{gap:8,children:[(0,i.tZ)(d.xv.H3,{weight:"semibold",align:"center",children:"Oh no—this page croaked."}),(0,i.tZ)(d.xv.B3,{color:"secondary",align:"center",children:"Try again, or hop to another page."})]})]})}},65575:function(e,t,r){r.d(t,{$l:()=>I,CQ:()=>z,ET:()=>D,EU:()=>et,Ex:()=>R,Hd:()=>V,Hn:()=>U,II:()=>F,K_:()=>O,NP:()=>N,NZ:()=>B,P2:()=>Q,QE:()=>J,SC:()=>K,T3:()=>X,Uj:()=>L,V1:()=>x,Vm:()=>k.V,Wo:()=>P,Xq:()=>G,YE:()=>q,Z0:()=>ee,Zh:()=>M,_Y:()=>S,eK:()=>p.eK,fG:()=>C,gq:()=>f.gq,mE:()=>A,mb:()=>W,nv:()=>T,nw:()=>j,ox:()=>E,pe:()=>$,t5:()=>w.t,tu:()=>f.tu,xV:()=>Y,zr:()=>er});var n=r(7409),i=r(99282),a=r(98848),o=r(16584),l=r(98661),s=r(94184),c=r.n(s),d=r(1852),u=r(80878),h=r(98914),f=r(19081),m=r(58175),p=r(45783),Z=r(66611),g=r(76566),v=r(91400),_=r(63651),b=r(47929),y=r(28840),w=r(38202),k=r(36889);function x(e){let{children:t}=e,r=(0,v.XA)();return(0,o.tZ)(H,{children:r?(0,o.tZ)(m.xv.H2,{children:t}):(0,o.tZ)(m.xv.H1,{children:t})})}function N(e){let{className:t,children:r,title:n,hasTitle:i}=e;return(0,o.BX)("div",{className:c()("reader2-page-section",(n||i)&&"withTitle",t),children:[n&&(0,o.tZ)(B,{children:n}),r]})}function B(e){let{children:t,className:r,actions:n}=e;return(0,o.BX)("div",{className:c()("reader2-section-title",r),children:[(0,o.tZ)("span",{className:"reader2-text-h3 reader2-section-title",children:t}),n&&(0,o.tZ)("div",{className:"reader2-header-actions",children:n})]})}let L=(0,l.forwardRef)((e,t)=>{var{isPadded:r=!0,className:l,linkClassName:s}=e,d=(0,a._)(e,["isPadded","className","linkClassName"]);return(0,o.tZ)("div",{ref:t,className:c()(y.Z.linkRow,r&&y.Z.isPadded,l),children:(0,o.tZ)(C,(0,i._)((0,n._)({},d),{className:s}))})});function C(e){var{children:t,className:r,href:l,newTab:s,onClick:d,noAnchor:h,native:m,utmCampaign:p,utmSource:Z,isSelected:g}=e,v=(0,a._)(e,["children","className","href","newTab","onClick","noAnchor","native","utmCampaign","utmSource","isSelected"]);let w="undefined"!=typeof location?location.pathname:"",k=h||null==l?"div":"a",x=l&&(0,_.n1t)(l,{utm_source:Z||w,utm_medium:b.lP.reader2,utm_campaign:p});return(0,o.tZ)(f.hs,(0,i._)((0,n._)({as:k,className:c()(y.Z.linkRowA,r,(x||d)&&null==g&&y.Z.isClickable,g&&y.Z.isSelected,null!=g&&y.Z.isSelectable),"data-selected":g,href:x,target:s?"_blank":void 0,onClick:e=>{d&&d(e),!e.defaultPrevented&&h&&x&&(0,u.Q)(e,x,{native:m,newTab:s})},showFocus:!0,animate:!0},v),{children:t}))}function S(e){let{icon:t,title:r,text:n,action:i,className:a}=e;return(0,o.BX)(f.tu,{gap:16,alignItems:"center",justifyContent:"center",flex:"grow",className:c()(y.Z.zero,a),children:[t,(0,o.BX)(f.tu,{gap:4,children:[(0,o.tZ)(m.xv.B4,{weight:"semibold",color:"primary",children:r}),(0,o.tZ)(m.xv.B4,{color:"secondary",children:n})]}),i]})}function T(e){var{className:t,variant:r,size:i,serif:l,isConstrained:s,maxLines:d=3}=e,u=(0,a._)(e,["className","variant","size","serif","isConstrained","maxLines"]);return(0,o.tZ)("div",(0,n._)({className:c()("reader2-paragraph",r&&"reader2-".concat(r),i&&"reader2-font-".concat(i),l&&"reader2-font-serif",s&&"reader2-clamp-lines reader2-".concat(d,"-lines"),t)},u))}function E(e){let{className:t,children:r}=e;return(0,o.tZ)("div",{className:c()("reader-nav-center",t),children:(0,o.tZ)("div",{className:"reader2-page reader2-font-base",children:r})})}function X(e){let{className:t,scrollRef:r,children:n}=e;return(0,o.tZ)(P,{ref:r,children:(0,o.tZ)(E,{className:t,children:n})})}function U(e){var{scrollRef:t}=e,r=(0,a._)(e,["scrollRef"]);return(0,o.tZ)(P,{ref:t,children:(0,o.tZ)(f.hs,(0,i._)((0,n._)({},r),{flex:"grow",paddingX:{mobile:0,desktop:20},minWidth:0}))})}function j(e){return(0,d.useMediaQuery)({minWidth:1100})?(0,o.tZ)(f.tu,(0,n._)({className:"reader2-inbox-sidebar",paddingTop:20},e)):null}function I(e){return(0,o.tZ)(f.hs,(0,n._)({alignItems:"center",justifyContent:"space-between",paddingX:8},e))}function R(e){return(0,o.tZ)(f.tu,(0,n._)({gap:8},e))}let P=(0,l.forwardRef)((e,t)=>(0,o.tZ)(g.S,{children:(0,o.tZ)("div",(0,n._)({id:"reader-nav-page-scroll",className:c()("reader-nav-page-scroll",e.className),ref:t},e))})),F=(0,l.forwardRef)((e,t)=>{var{className:r,hasError:l}=e,s=(0,a._)(e,["className","hasError"]);return(0,o.tZ)("input",(0,i._)((0,n._)({className:c()(y.Z.input,l&&y.Z.error,r)},s),{ref:t}))});function z(e){let{error:t}=e;return(0,o.tZ)(G,{children:(0,h.zx)(t)})}let O=e=>{let{header:t,icon:r,title:n,text:i,action:a}=e;return(0,o.tZ)(N,{title:t,children:(0,o.tZ)(W,{icon:r,title:n,text:i,action:a})})};function W(e){return(0,o.tZ)(f.tu,{bg:"secondary",border:"detail",radius:"md",paddingX:20,paddingY:64,justifyContent:"center",alignItems:"center",flex:"grow",children:(0,o.tZ)(S,(0,n._)({},e))})}function q(e){let{children:t}=e;return(0,o.tZ)(f.tu,{className:"reader2-inbox-sidebar-fixed",children:t})}function $(e){var{gap:t=16}=e,r=(0,a._)(e,["gap"]);return(0,o.tZ)(f.tu,(0,i._)((0,n._)({},r),{className:c()(y.Z.pageStack,y.Z["gap_".concat(t)])}))}let H=(0,Z.L)("reader2-page-top");(0,Z.L)(y.Z.pageTopFixed);let Y=(0,Z.L)("reader2-page-body"),A=(0,Z.L)(y.Z.pageStack),D=(0,Z.L)("reader2-page-center");(0,Z.L)("reader2-modal-title-text"),(0,Z.L)("reader2-column");let M=(0,Z.L)("reader2-text-h3"),V=(0,Z.L)("reader2-text-h3 reader2-section-title"),Q=(0,Z.L)("reader2-text-h4");(0,Z.L)("reader2-item-title");let K=(0,Z.L)("reader2-item-meta");(0,Z.L)("reader2-text-b4");let G=(0,Z.L)("reader2-form-error"),J=(0,Z.L)("reader2-subtitle"),ee=(0,Z.L)("reader2-separator","hr");(0,Z.L)("reader2-page-section withTitle"),(0,Z.L)("reader2-row reader2-split-row"),(0,Z.L)("reader2-emphasis-box");let et=(0,Z.L)(c()(y.Z.hoverLink,"pencraft"),"a");function er(e){return(0,o.tZ)(et,(0,n._)({target:"_blank"},e))}},65958:function(e,t,r){r.d(t,{s:()=>m,z:()=>p});var n=r(7409),i=r(99282),a=r(16584),o=r(48980),l=r(80878),s=r(7882),c=r(70379),d=r(97842),u=r(95551),h=r(62515),f=r(36186);function m(e){let{source:t}=e,r=p({source:t}),s=(0,u.d)(),d=(0,c.pm)(),m=async e=>{var t;let u=await r.handleStart(e);return u instanceof Error?(u instanceof o.kp&&(null===(t=u.body)||void 0===t?void 0:t.type)==="profile_not_set_up"?d.popToast(e=>(0,a.tZ)(c.FN,(0,i._)((0,n._)({},e),{text:"Please set up your profile before sending a message.",cta:"Set up profile",href:(0,f.Nh)({utm_source:"substack",utm_campaign:"chat_dm_button",redirect:window.location}),localNavigation:!1}))):s(u,"Could not start conversation."),!1):((0,l._)((0,h.Rm)(u.thread.id)),!0)};return(0,i._)((0,n._)({},r),{handleStart:m})}function p(e){let{source:t}=e,r=(0,d.I0)(),a=(0,s.ib)({pathname:"/api/v1/messages/dm/start",method:"POST"}),o=async e=>{let n=await a.refetch({json:{user_ids:e,source:t}});return n instanceof Error||r({type:"conversation-load_more",payload:{edge:"before",cursor:null,page:n}}),n};return(0,i._)((0,n._)({},a),{handleStart:o})}}}]);