"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["2536"],{55474:function(e,t,n){n.d(t,{Z:()=>r});let r={shimmer:"shimmer-DF054A",shimmerAnimation:"shimmerAnimation-dmgPXN",icon:"icon-kVFYHC",errorIcon:"errorIcon-yltUsD"}},75983:function(e,t,n){n.d(t,{Z:()=>r});let r={avatarButton:"avatarButton-lZBlGB",dropdownBadge:"dropdownBadge-CARUw5",dropdown:"dropdown-caGYVq"}},30351:function(e,t,n){n.d(t,{Z:()=>r});let r={signInAppUpsell:"signInAppUpsell-u9SVL0",isDesktop:"isDesktop-_mI6rc",appDownloadButton:"appDownloadButton-Lbsixg",qrContainer:"qrContainer-ApUIIX",qrCode:"qrCode-f8T8_u"}},7083:function(e,t,n){n.d(t,{Z:()=>r});let r={avatarLink:"avatarLink-M6ZJnW",inlineComposer:"inlineComposer-v8PLSi",disabled:"disabled-YAsoUi",mobileInlineComposer:"mobileInlineComposer-jKgh_1",isDragging:"isDragging-TcoucF",floatingComposer:"floatingComposer-np5rUF",inputSpacer:"inputSpacer-x19EDg",wordCountIndicator:"wordCountIndicator-KkYqEv",exceded:"exceded-x1z6ce",composerModal:"composerModal-q2ZgZt",setupProfileModalContent:"setupProfileModalContent-IhiQBI",modalColumn:"modalColumn-qiWdAx",editorContainer:"editorContainer-Lfneza",dropdownIcon:"dropdownIcon-HzL2Jt",dropdownMenu:"dropdownMenu-RAjGgB",pubRow:"pubRow-ZqkbZG",pubName:"pubName-DndaDy",linkImage:"linkImage-VNRJEM",imageContainer:"imageContainer-sSgwnk",imageActions:"imageActions-J_pVYc",removeAttachment:"removeAttachment-lybT5W",shareImageButton:"shareImageButton-O3Fvsx",notifyConformModalPubRow:"notifyConformModalPubRow-929y7D"}},14942:function(e,t,n){n.d(t,{Z:()=>r});let r={modalBody:"modalBody-yrSvJm",captcha:"captcha-awCBm5"}},45582:function(e,t,n){n.d(t,{Gi:()=>x,Pp:()=>_});var r=n(16584),i=n(6400);n(98661);var o=n(30396),l=n(19425),a=n(94184),d=n.n(a),c=n(25380),s=n(71375),u=n(57560),p=n(23254),h=n(20888),m=n(95441),g=n(68833),Z=n(15771),f=n(19081),v=n(58175),y=n(75419),w=n(60308),b=n(9799),C=n(55474);let k=()=>(0,r.tZ)(f.gq,{radius:"full",className:C.Z.shimmer,style:{height:"var(--size-6)",width:"100%"}}),B=(0,i.createContext)({addMediaUpload:e=>{let{}=e;throw Error("Adding a download requires a DownloadProvider.")},markAsDownloaded:()=>{throw Error("Marking as downloaded requires a DownloadProvider.")},hasBeenDownloaded:()=>{throw Error("Checking download status requires a DownloadProvider.")}}),I=e=>{var t;let{context:n,download:{mediaUpload:i,title:l,thumbnailUrl:a,source:B},pub:I,onRemoveItem:_}=e,{markAsDownloaded:P,hasBeenDownloaded:D}=x(),{iString:L}=(0,m.M1)(),{mediaUpload:M,downloadUrl:A}=(0,p.f8)(i.id),X=(0,y.i3)(),N=(null==M?void 0:M.state)==="error";(0,o.d4)(()=>{A&&M&&!D(i.id)&&((0,b.I)(M,l),P(i.id),(0,g.j)(g.FP.MEDIA_CLIP_DOWNLOAD_COMPLETED,{video_upload_id:i.id,is_post_editor:!1,type:B}))},[i.id,A,M,D,P,B,l]);let S=(0,o.I4)(e=>{e.preventDefault(),(0,g.j)(g.FP.MEDIA_CLIP_BUTTON_CLICKED,{button:"share_to_notes",source:"download_toast"});let t="publisher"===n?"".concat(L("Subscribe to get the full video when it's released."),"\n"):"";X.open({initialText:"".concat(t),videoUploadId:i.id,onCompose:e=>{(0,g.j)(g.FP.MEDIA_CLIP_SHARED,{destination:"notes",note_id:e.id,video_upload_id:i.id,is_post_editor:"publisher"===n})}})},[X,n,L,i.id,I]);return(0,r.BX)(f.gq,{gap:16,children:[(0,r.tZ)("div",{children:(0,r.BX)(f.gq,{position:"relative",children:[(0,r.tZ)(h.e,{src:null!==(t=null!=a?a:(0,w.kOB)(i))&&void 0!==t?t:"",maxWidth:40,radius:"xs",imageProps:{height:Math.round(40),smartCrop:!0}}),A&&(0,r.tZ)(f.hs,{bg:"white",radius:"full",width:20,height:20,position:"absolute",alignItems:"center",justifyContent:"center",className:C.Z.icon,children:(0,r.tZ)(c.Z,{color:"black",strokeWidth:2,size:14})}),N&&(0,r.tZ)(f.hs,{radius:"full",width:20,height:20,position:"absolute",alignItems:"center",justifyContent:"center",className:d()(C.Z.icon,C.Z.errorIcon),children:(0,r.tZ)(s.Z,{color:"white",strokeWidth:2,size:14})})]})}),(0,r.BX)(f.tu,{gap:8,children:[(0,r.BX)(f.gq,{gap:12,children:[(0,r.BX)(f.gq,{style:{width:"250px"},alignItems:"center",gap:8,children:[(0,r.BX)(f.tu,{flex:"grow",children:[(0,r.tZ)(v.xv.B4,{color:"white",weight:"semibold",style:{overflowWrap:"anywhere"},children:l}),A?(0,r.tZ)(v.xv.B4,{color:"white",children:L("Complete")}):(0,r.BX)(v.xv.B4,{color:"white",children:[L("Downloading clip"),"…"]}),N&&(0,r.tZ)(v.xv.B4,{color:"accent-red",weight:"semibold",style:{overflowWrap:"anywhere"},children:L("Download failed")})]}),A&&(0,r.tZ)(Z.zx,{leading:(0,r.tZ)(u.Z,{size:16}),priority:"primary",size:"sm",onClick:S,children:L("Share")})]}),(0,r.tZ)(f.gq,{cursor:"pointer",onClick:e=>{e.stopPropagation(),_()},children:(0,r.tZ)(s.Z,{color:"gray"})})]}),A||N?null:(0,r.tZ)(k,{})]})]})};function _(e){let{children:t,pub:n,context:i}=e,[a,d]=(0,o.eJ)([]),[c,s]=(0,o.eJ)(new Set);return(0,r.BX)(B.Provider,{value:{addMediaUpload:e=>{d(t=>[...t,e])},markAsDownloaded:e=>{s(t=>{let n=new Set(t);return n.add(e),n})},hasBeenDownloaded:e=>c.has(e)},children:[t,!!a.length&&(0,r.tZ)("div",{style:{position:"fixed",right:"var(--size-24)",bottom:"var(--size-24)",zIndex:20},children:(0,r.tZ)(l.u,{show:!0,appear:!0,enter:"tw-transition-all tw-duration-fast transform-gpu",enterFrom:"tw-opacity-0 tw-translate-y-4",enterTo:"tw-opacity-100 tw-translate-y-0",leave:"tw-transition-all tw-duration-fast transform-gpu",leaveFrom:"tw-opacity-100 tw-translate-y-0",leaveTo:"tw-opacity-0 tw-translate-y-4",children:(0,r.tZ)(f.tu,{style:{backgroundColor:"#232525"},radius:"md",padding:16,gap:8,children:a.map((e,t)=>(0,r.tZ)(I,{context:i,download:e,pub:n,onRemoveItem:()=>d(a.filter(t=>{let{mediaUpload:n}=t;return n.id!==e.mediaUpload.id}))},"".concat(t,"_").concat(e.mediaUpload.id)))})})})]})}function x(){return(0,o.qp)(B)}},10605:function(e,t,n){n.d(t,{Z:()=>P});var r=n(16584);n(65205);var i=n(45582),o=n(96726),l=n(57391),a=n(37168),d=n(98585),c=n(95441),s=n(99259),u=n(36848),p=n(93155),h=n(36518),m=n(30372),g=n(85095),Z=n(14952),f=n(39648),v=n(56629),y=n(44471),w=n(40647),b=n(45261),C=n(60807),k=n(70379),B=n(97434),I=n(75419),_=n(64172),x=n(25479);function P(e){let{user:t=null,pub:n=null,children:P,siteConfigs:D={},hasThemedBackground:L=!1,language:M="en",preferredLanguage:A=null,country:X,experimentInfo:N={variantOverrides:{},experimentFeatures:{},experimentExposures:{}},portalRoot:S,shouldLoad:q,shouldPollNotifications:E=!1,publicationSettings:T={},userSettings:z,publicationUserSettings:j={},activityToken:F,loadPubClientSearch:Y,enablePubClientSearchShortcuts:U=!0,loadGlobalSearch:O,includePodcasts:J=!1,context:R="reader",isMarketingPage:W=!1}=e;void 0===q&&(q=!!t);let H=(0,_.lV)({isLoggedIn:!!t,includePodcasts:J});return(0,r.tZ)(u.Qu,{country:X||"US",children:(0,r.tZ)(c._7,{language:M||"en",preferredLanguage:A,children:(0,r.tZ)(b.ze,{value:{hasThemedBackground:L},children:(0,r.tZ)(w.vC,{siteConfigs:D,children:(0,r.tZ)(l.Vt,{siteConfigs:D,experimentInfo:N,children:(0,r.tZ)(a.ZN,{siteConfigs:D,experimentInfo:N,children:(0,r.tZ)(v.Iz,{settings:T,children:(0,r.tZ)(y.m$,{preloadPubUserSettings:j,children:(0,r.tZ)(h.N$,{shouldLoad:q,shouldPoll:E,activityToken:F,children:(0,r.tZ)(o.X,{root:S,children:(0,r.tZ)(C.dr,{defaultValue:t,userSettings:z,children:(0,r.tZ)(g.am,{children:(0,r.tZ)(s.Nj,{children:(0,r.tZ)(k.VW,{children:(0,r.tZ)(p.DY,{children:(0,r.tZ)(I.Au,{children:(0,r.tZ)(i.Pp,{context:R,pub:n,children:(0,r.tZ)(_.e.Provider,{value:H,children:(0,r.tZ)(B.c,{children:(0,r.tZ)(Z.G5.Provider,{value:n,children:(0,r.tZ)(x.yk,{user:t,children:(0,r.tZ)(d.Ml,{load:O,useLocalNavigation:!W,children:(0,r.tZ)(f.Nx,{load:Y,pub:n,enableShortcuts:U,children:(0,r.tZ)(m.Pi,{children:P})})})})})})})})})})})})})})})})})})})})})})})})}},29493:function(e,t,n){n.d(t,{Z:()=>a});var r=n(27412),i=n(16584),o=n(6400);let l=!1;"undefined"!=typeof window&&(window.__captchaOnloadCallback=function(){if(l&&Array.isArray(l)){let e=l;for(let t of(l=!0,e))t()}});class a extends o.Component{async componentDidMount(){await new Promise(e=>{!0===l?e():!1===l?(l=[e],function(){var e;let t=document.getElementsByTagName("script")[0],n=document.createElement("script");n.type="text/javascript",n.async=!0,n.defer=!0,n.src="https://www.google.com/recaptcha/api.js?render=explicit&onload=__captchaOnloadCallback",null==t||null===(e=t.parentNode)||void 0===e||e.insertBefore(n,t)}()):l.push(e)}),this.captchaId=window.grecaptcha.render(this.base,{sitekey:window._preloads.captcha_site_key,size:"compact"})}getResponse(){var e;return null===(e=window.grecaptcha)||void 0===e?void 0:e.getResponse(this.captchaId)}render(e){let{className:t}=e;return(0,i.tZ)("div",{className:t})}constructor(...e){super(...e),(0,r._)(this,"captchaId",void 0)}}},77338:function(e,t,n){n.d(t,{h:()=>g,x:()=>Z});var r=n(7409),i=n(99282),o=n(16584),l=n(74691),a=n.n(l),d=n(39693),c=n.n(d),s=n(67348),u=n(93252),p=n(58175),h=n(23398),m=n(5749);function g(e){let{content:t,isHidden:n,hiddenText:r,attachedLinks:i}=e;return t?(0,o.BX)(p.xv.B4,{className:m.Z.feedCommentBodyInner,children:[n&&r,t&&(0,o.tZ)(Z,{content:t,attachedLinks:i})]}):null}function Z(e){var t,n,l,d,p,m,g;let{content:f,onLinkClicked:v,attachedLinks:y,isFirstElement:w=!0,isLastElement:b=!1}=e;if("text"===f.type){let e=null===(t=f.marks)||void 0===t?void 0:t.find(e=>"link"===e.type),a=null==e?void 0:null===(n=e.attrs)||void 0===n?void 0:n.href,d=f.text;if(a){let e=(0,h.u)(a),t=w||b?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return e;for(let n of t){let t=(0,h.u)(n);if(e.includes(t))return null}return e}(e,y):e;d=null!=t?t:void 0}if(!d)return null;let c=(0,o.tZ)(o.HY,{children:d});if(f.marks)for(let e of f.marks)"link"===e.type?c=(0,o.tZ)("a",(0,i._)((0,r._)({className:"note-link"},e.attrs),{target:(0,u.P)()?"_blank":null===(l=e.attrs)||void 0===l?void 0:l.target,onClick:()=>v&&v(),children:c})):"bold"===e.type?c=(0,o.tZ)("strong",{children:c}):"italic"===e.type?c=(0,o.tZ)("em",{children:c}):"strike"===e.type?c=(0,o.tZ)("s",{children:c}):"code"===e.type?c=(0,o.tZ)("code",{children:c}):"mark"===e.type&&(c=(0,o.tZ)("mark",{className:"note-highlight",children:c}));return c}if("substack_mention"===f.type){let{id:e,label:t,mentionType:n,url:r}=null!==(d=f.attrs)&&void 0!==d?d:{};return e&&t?(0,o.tZ)(s.p,{id:e,label:t,type:n,url:r}):null}let C=c()(null!==(p=f.content)&&void 0!==p?p:[]).map((e,t,n)=>(0,o.tZ)(Z,{content:e,onLinkClicked:v,attachedLinks:y,isFirstElement:0===t,isLastElement:t===n.length-1}));if("doc"===f.type)return(0,o.tZ)("div",{className:"ProseMirror FeedProseMirror",children:C});if("paragraph"===f.type)return(0,o.tZ)("p",{children:C});if("heading"===f.type){let e="h".concat(a()((null!==(g=null===(m=f.attrs)||void 0===m?void 0:m.level)&&void 0!==g?g:1)+1,2,6));return(0,o.tZ)(e,{children:C})}return"blockquote"===f.type?(0,o.tZ)("blockquote",{children:C}):"codeBlock"===f.type?(0,o.tZ)("pre",{children:(0,o.tZ)("code",{children:C})}):"orderedList"===f.type?(0,o.tZ)("ol",{children:C}):"bulletList"===f.type?(0,o.tZ)("ul",{children:C}):"listItem"===f.type?(0,o.tZ)("li",{children:C}):null}},76721:function(e,t,n){n.d(t,{Z:()=>l});var r=n(30396),i=n(49091),o=n(81821);function l(e){let{truncationProfile:t="medium"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.Ye)(()=>(0,i.X)(e,{truncationProfile:t,isMobile:(0,o.tq)()}),[null==e?void 0:e.body,null==e?void 0:e.body_json])}},33668:function(e,t,n){n.d(t,{e:()=>i});var r=n(30396);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(0,r.sO)(e);return(0,r.d4)(()=>{var e;null===(e=t.current)||void 0===e||e.focus()},[]),t}},8635:function(e,t,n){n.d(t,{Z:()=>i});var r=n(30396);let i=(e,t)=>{let n=(0,r.sO)();(0,r.d4)(()=>{n.current=e},[e]),(0,r.d4)(()=>{if(null!==t){let e=setInterval(function(){var e;null===(e=n.current)||void 0===e||e.call(n)},t);return()=>clearInterval(e)}},[t])}},17625:function(e,t,n){n.d(t,{o$:()=>f});var r=n(16584),i=n(94184),o=n.n(i);n(20042);var l=n(83034);n(62956),n(28161),n(32351),n(57391),n(40647);var a=n(68833),d=n(80878);n(59480),n(91700),n(99027);var c=n(19081),s=n(58175);n(91400),n(6070);var u=n(60308),p=n(81821),h=n(47929),m=n(30351);let g=h.VX.appMarketing,Z=h.fZ.signInPage;function f(e){let{abTestingId:t}=e,n=(0,p.s)()?"ios":(0,p.Dt)()?"android":"desktop",i="desktop"===n?180:120;return(0,r.tZ)(c.hs,{padding:20,paddingTop:32,alignItems:"center",justifyContent:"center",children:(0,r.BX)(c.gq,{radius:"lg",border:"detail",className:o()(m.Z.signInAppUpsell,{[m.Z.isDesktop]:"desktop"===n}),paddingX:20,paddingTop:20,gap:20,shadow:"lg",cursor:"pointer",onClick:e=>{(0,a.j)(a.FP.SIGN_IN_APP_UPSELL_CLICKED,{position:"sign-in-page"}),(0,d.Q)(e,(0,u.D4e)({utm_campaign:g,utm_content:Z,utm_source:h.b3.upsell}),{native:!0,newTab:!0})},children:[(0,r.BX)(c.tu,{justifyContent:"space-between",flex:"grow",paddingBottom:20,gap:8,children:[(0,r.BX)(c.tu,{gap:8,children:[(0,r.tZ)(s.xv.H3,{weight:"heavy",children:"Stay signed in"}),(0,r.tZ)(s.xv.B4,{color:"secondary",children:"Download the Substack app for ".concat("ios"===n?"iOS":"android"===n?"Android":"Android or iOS")})]}),"desktop"===n?(0,r.tZ)(v,{abTestingId:t}):(0,r.tZ)(w,{type:n})]}),(0,r.tZ)(c.hs,{alignItems:"end",children:(0,r.tZ)("img",{style:{maxWidth:i},src:(0,u.zF4)("/img/app_page/highlight-6-ios-v2.png",2*i)})})]})})}function v(e){let{abTestingId:t}=e;return(0,r.BX)(c.tu,{gap:16,alignItems:"center",children:[(0,r.tZ)(y,{abTestingId:t}),(0,r.BX)(c.gq,{gap:8,children:[(0,r.tZ)(w,{type:"ios"}),(0,r.tZ)(w,{type:"android"})]})]})}function y(e){let{abTestingId:t}=e;return(0,r.tZ)(c.hs,{border:"detail",radius:"lg",className:m.Z.qrContainer,children:(0,r.tZ)(c.hs,{className:m.Z.qrCode,padding:8,children:(0,r.tZ)(l.AppStoreQrCode,{abTestingId:t,width:160,height:160,utm_campaign:g,utm_content:Z,utm_source:h.b3.qr})})})}function w(e){let{type:t}=e;return(0,r.tZ)(c.hs,{style:{minWidth:135},radius:"sm",overflowX:"hidden",overflowY:"hidden",className:m.Z.appDownloadButton,as:"a",href:(0,u.D4e)({utm_campaign:g,utm_content:Z,utm_source:h.b3.badge,force:"android"===t?"android":"ios"}),onClick:e=>e.stopPropagation(),children:(0,r.tZ)("img",{className:"app-upsell",src:(0,u.zF4)("android"===t?"/img/app_page/google-play.png":"/img/app_page/app-store.png",320),height:40})})}},52513:function(e,t,n){n.d(t,{E:()=>f,R:()=>v});var r=n(7409),i=n(16584),o=n(30396),l=n(94184),a=n.n(l),d=n(70871),c=n(95441),s=n(48980),u=n(12900),p=n(71068),h=n(19081),m=n(1844),g=n(58175),Z=n(68686);function f(e){let{email:t,redirect:n,forPub:l}=e,[a,c]=(0,o.eJ)(""),[p,h]=(0,o.eJ)(!1),[m,g]=(0,o.eJ)(!1),[Z,f]=(0,o.eJ)(!1),v=async()=>{h(!0);try{let[e]=await Promise.all([(0,s.rd)("/api/v1/email-otp-login/complete",{method:"POST",json:{code:a,email:t,redirect:n,for_pub:l}}),new Promise(e=>setTimeout(e,250))]);window.location.href=e.redirect}catch(e){e instanceof s.kp&&"login_guard_challenge"===e.body.type&&f(!0),h(!1),g(!0),c("")}};return t?(0,i.BX)(b,{children:[(0,i.tZ)(d.uZ,{autoFocus:!0,maxLength:6,pattern:d.Ww,onChange:e=>{c(e),e.length&&g(!1)},onComplete:v,value:a,render:e=>{let{slots:t}=e;return(0,i.tZ)(C,{children:t.map((e,t)=>(0,i.tZ)(y,(0,r._)({disabled:p},e),t))})}}),(0,i.tZ)(u.H,{expanded:!!m,children:(0,i.tZ)(w,{suspiciousLogin:Z})})]}):null}function v(e){let{onComplete:t,error:n,isLoading:l}=e,[a,s]=(0,o.eJ)(""),{iString:u}=(0,c.M1)();return(0,i.BX)(b,{children:[(0,i.tZ)(d.uZ,{autoFocus:!0,maxLength:6,pattern:d.Ww,onChange:e=>{s(e)},onComplete:e=>{l||t(e)},value:a,disabled:l,render:e=>{let{slots:t}=e;return(0,i.tZ)(C,{children:t.map((e,t)=>(0,i.tZ)(y,(0,r._)({disabled:l},e),t))})}}),n&&(0,i.tZ)(m.y,{style:{textAlign:"center"},children:u("You entered an incorrect code. Please try again.")})]})}function y(e){let{char:t,isActive:n,disabled:r}=e;return(0,i.tZ)(h.X2,{justifyContent:"center",alignItems:"center",width:36,height:40,className:a()(Z.Z.input,n&&Z.Z.focus,r&&Z.Z.disabled),children:(0,i.tZ)(g.xv.B2,{textAlign:"center",children:t||""})})}function w(e){let{suspiciousLogin:t}=e,{iString:n}=(0,c.M1)(),r=n(t?"Please check your email for instructions to complete signing in.":"You entered an incorrect code. Please try again.");return(0,i.tZ)(m.y,{style:{textAlign:"center"},children:r})}let b=(0,p.zo)({display:"flex",direction:"column",alignItems:"center",gap:8}),C=(0,p.zo)({display:"flex",direction:"row",justifyContent:"center",alignItems:"center",gap:8})},10704:function(e,t,n){n.d(t,{ex:()=>y,fe:()=>v,u_:()=>f});var r=n(16584),i=n(19425),o=n(12048),l=n(94184),a=n.n(l),d=n(50308),c=n.n(d),s=n(98661),u=n(71068),p=n(19081),h=n(63124),m=n(88e3),g=n(91400),Z=n(40484);let f=e=>{var t;let{isOpen:n,onClose:l=()=>void 0,children:d,position:u="default",testId:p="modal",className:f,fullscreenMobile:v,maxFullscreenMobile:y,overflow:b,width:C=440,disableCloseOnBackdropClick:k=!1,initialFocus:B,renderOverReactLaagPortal:I=!1,zIndex:_}=e,x=(0,g.XA)();return t=n&&x&&v,(0,s.useEffect)(()=>{if(t){if(w.current++,1===w.current){let e=document.getElementById("entry");e&&(e.style.visibility="hidden")}return()=>{if(1===w.current){w.current--;let e=document.getElementById("entry");e&&(e.style.visibility="")}}}},[t]),(0,r.tZ)(i.u,{show:n,as:s.Fragment,children:(0,r.tZ)(o.V,{onMouseDown:e=>e.stopPropagation(),onMouseUp:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),"data-testid":p,as:"div",className:a()(I&&Z.Z.renderOverReactLaagPortal,Z.Z.modal),onClose:k?c():l,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),null==l||l())},initialFocus:B,style:"number"==typeof _?{zIndex:_}:void 0,children:(0,r.BX)(h.Uv,{children:[(0,r.tZ)(h.sc,{children:(0,r.tZ)(h._n,{})}),(0,r.tZ)(m.Q,{children:(0,r.tZ)(m.l,{className:f,position:u,fullscreenMobile:v,maxFullscreenMobile:y,width:C,overflow:b,children:d})})]})})})};function v(e){let{children:t,className:n}=e;return(0,r.tZ)(p.sg,{overflow:"auto",className:a()(Z.Z.modalBody,n),padding:20,children:t})}let y=()=>(0,r.tZ)(u.xu,{height:20}),w={current:0}},54278:function(e,t,n){n.d(t,{g:()=>u});var r=n(16584),i=n(98661),o=n(94184),l=n.n(o),a=n(18949),d=n(19081),c=n(56649),s=n(58175);let u=(0,i.forwardRef)((e,t)=>{let{action:n,children:i,className:o,errors:u,helpText:p,details:h,label:m,paddingBottom:g,paddingTop:Z,flex:f,wrapWithLabel:v,disabled:y,compact:w}=e,b=w?2:8;return(0,r.BX)(d.tu,{ref:t,alignItems:"stretch",className:o,gap:b,paddingBottom:g,paddingTop:Z,disabled:y,flex:f,children:[(0,r.BX)(d.tu,{alignItems:"stretch",gap:b,as:v?"label":"div",children:[m&&(0,r.BX)(d.gq,{gap:b,alignItems:"center",children:[(0,r.tZ)(s.xv.B4,{weight:"semibold",as:v?"div":"label",color:"primary",children:m}),p&&(0,r.tZ)(a.k,{content:p}),n&&(0,r.tZ)(d.gq,{flex:"grow",justifyContent:"end",children:n})]}),i&&(0,r.tZ)("div",{className:l()({"has-error":u}),children:i})]}),h&&!Array.isArray(h)&&(0,r.tZ)(s.xv.B5,{color:"secondary",children:h}),h&&Array.isArray(h)&&h.length>0&&(0,r.tZ)(d.tu,{gap:4,children:h.map(e=>(0,r.tZ)(s.xv.B5,{color:"secondary",children:e}))}),(0,r.tZ)(c.D,{errors:u})]})})},45705:function(e,t,n){n.d(t,{g:()=>u});var r=n(7409),i=n(99282),o=n(16584),l=n(30396),a=n(19081),d=n(54278),c=n(57640),s=n(58175);let u=e=>{let t,{horizontal:n,label:u,labelProps:p,rowProps:h,name:m,options:g,paddingBottom:Z,paddingTop:f,size:v="medium",value:y,variant:w,onChange:b}=e,C=(0,l.I4)(e=>{b(e.target.value)},[b]);return t="boxed"===w?(0,o.tZ)(a.tu,{gap:8,children:g.map(e=>{let{value:t,label:n,disabled:l,track:d,testid:u}=e,p=t===y;return(0,o.BX)(a.gq,(0,i._)((0,r._)({alignItems:"center",as:"label",border:p?"accent-themed":"detail-themed",gap:8,padding:16,radius:"sm"},h),{children:[(0,o.tZ)(c.Y,{checked:p,"data-testid":u,"data-track-input":d,disabled:l,name:m,value:t,onClick:C}),(0,o.tZ)(s.xv.B4,{as:"span",weight:p?"semibold":"regular",children:n})]}))})}):(0,o.tZ)(a.gq,{gap:"medium"===v?12:16,direction:n?"row":"column",children:g.map(e=>{let{value:t,label:n,disabled:l,track:d,testid:u}=e;return(0,o.BX)(a.gq,(0,i._)((0,r._)({as:"label",gap:8,alignItems:"center",paddingLeft:4},h),{children:[(0,o.tZ)(c.Y,{checked:t===y,"data-testid":u,"data-track-input":d,disabled:l,name:m,value:t,onClick:C}),"medium"===v?(0,o.tZ)(s.xv.B4,(0,i._)((0,r._)({as:"span"},p),{children:n})):(0,o.tZ)(s.xv.B3,(0,i._)((0,r._)({},p),{children:n}))]}))})}),(0,o.tZ)(d.g,{label:u,paddingBottom:Z,paddingTop:f,children:t})}},4354:function(e,t,n){n.d(t,{I:()=>d,t:()=>a});var r=n(16584),i=n(6400),o=n(30396);let l=(0,i.createContext)(null);function a(e){let{children:t}=e,[n,i]=(0,o.eJ)("email"),[a,d]=(0,o.eJ)(""),[c,s]=(0,o.eJ)(!1),[u,p]=(0,o.eJ)(null);return(0,r.tZ)(l.Provider,{value:{mode:n,email:a,verificationCodeEnabled:c,onboardingRedirect:u,setMode:e=>{"magic-link"!==e&&s(!1),i(e)},setEmail:d,setVerificationCodeEnabled:s,setOnboardingRedirect:p},children:t})}function d(){let e=(0,o.qp)(l);if(!e)throw Error("useSignIn must be used within an SignInProvider");return e}},65942:function(e,t,n){n.d(t,{v:()=>Z});var r=n(58865),i=n(16584),o=n(67358),l=n(95441),a=n(8635),d=n(52513),c=n(80026),s=n(6490),u=n(65523),p=n(4354),h=n(41233);function m(){let e=(0,r._)(["We've sent an email to ",". Click the magic link or enter the code below:"]);return m=function(){return e},e}function g(){let e=(0,r._)(["We've sent an email to ",". Click the magic link inside to continue."]);return g=function(){return e},e}let Z=e=>{let{noCloseButton:t,noExit:n,onCancel:r,onSuccess:o}=e;return(0,i.BX)(i.HY,{children:[(0,i.tZ)(f,{noCloseButton:!t||n,onCancel:r}),(0,i.tZ)(v,{onSuccess:o}),(0,i.tZ)(y,{})]})},f=e=>{let{noCloseButton:t,onCancel:n}=e,{iString:r,iTemplate:a}=(0,l.M1)(),{verificationCodeEnabled:d,email:c}=(0,p.I)();return(0,i.tZ)(u.xB,{title:r("Check your email to continue"),showClose:!t,onClose:n,icon:(0,i.tZ)(u.AM,{icon:(0,i.tZ)(o.Z,{size:20})}),alignItems:"center",description:a(d?m():g(),null!=c?c:"your email address")})};function v(e){let{onSuccess:t}=e,{verificationCodeEnabled:n,email:r,onboardingRedirect:o}=(0,p.I)();return(0,a.Z)(()=>{fetch("/api/v1/am_i_logged_in").then(async e=>{(await e.json()).loggedIn&&t()})},5e3),n?(0,i.tZ)(s.fe,{children:(0,i.tZ)(d.E,{email:r,redirect:o||document.location.href})}):(0,i.tZ)(s.ex,{})}let y=()=>{let{iString:e}=(0,l.M1)(),{setMode:t}=(0,p.I)();return(0,i.tZ)(h.et,{children:(0,i.BX)(i.HY,{children:[e("Didn't get the email? "),(0,i.tZ)(c.hh,{color:"substack",decoration:"hover-underline",onClick:()=>t("email"),cursor:"pointer",children:e("Try again")})]})})}},23276:function(e,t,n){n.d(t,{j:()=>Z});var r=n(16584),i=n(95441),o=n(33668),l=n(48980),a=n(7882),d=n(98914),c=n(80026),s=n(1844),u=n(6490),p=n(51776),h=n(4354),m=n(41233),g=n(14942);let Z=e=>{let{overrideTitle:t,noCloseButton:n,onCancel:i,onSignup:o,onUserCreated:l,redirectOverride:a}=e;return(0,r.BX)(r.HY,{children:[(0,r.tZ)(m.LZ,{overrideTitle:t,noCloseButton:n,onCancel:i,onSignup:o}),(0,r.tZ)(f,{onUserCreated:l,redirectOverride:a})]})};function f(e){let{onUserCreated:t,redirectOverride:n}=e,{iString:m}=(0,i.M1)(),{setMode:Z,setEmail:f,setVerificationCodeEnabled:v,setOnboardingRedirect:y,email:w}=(0,h.I)(),b=(0,o.e)(),C=(0,a.ib)({pathname:"/api/v1/email-login",method:"POST"});return(0,r.BX)("form",{onSubmit:e=>{if(e.preventDefault(),C.isLoading)return;let r=e.currentTarget.email.value;C.refetch({json:{email:r,redirect:n||location.pathname,can_create_user:!0}}).then(e=>{if(!(e instanceof l.kp)){if(!(e instanceof Error)&&"optional"===e.verification_code){v(!0),f(r),y(e.onboarding_redirect||null),Z("magic-link");return}if(!(e instanceof Error)&&e.user){if(t){t(e.user);return}window.location.reload()}f(r),Z("magic-link")}})},children:[(0,r.tZ)(u.fe,{className:g.Z.modalBody,children:(0,r.BX)(c.sg,{gap:16,children:[(0,r.tZ)(p.oi,{type:"email",name:"email",placeholder:m("Your email"),autoComplete:"email",ref:b,autoFocus:!0,defaultValue:w}),C.error&&(0,r.tZ)(s.y,{children:(0,d.zx)(C.error)})]})}),(0,r.tZ)(u.mz,{direction:"column",primaryButton:(0,r.tZ)(c.zx,{priority:"primary",type:"submit",loading:C.isLoading,children:m("Continue")}),secondaryButton:(0,r.tZ)(c.zx,{priority:"secondary-outline",onClick:()=>{var e;f((null===(e=b.current)||void 0===e?void 0:e.value)||""),Z("password")},children:m("Sign in with password")}),buttonDivider:(0,r.tZ)(c.ZC,{})})]})}},9003:function(e,t,n){n.d(t,{n:()=>m});var r=n(16584),i=n(13639),o=n(95441),l=n(48980),a=n(7882),d=n(52513),c=n(80026),s=n(6490),u=n(65523),p=n(4354),h=n(41233);let m=e=>{let{onSuccess:t}=e;return(0,r.BX)(r.HY,{children:[(0,r.tZ)(g,{}),(0,r.tZ)(Z,{onSuccess:t}),(0,r.tZ)(f,{})]})},g=()=>{let{iString:e}=(0,o.M1)();return(0,r.tZ)(u.xB,{title:e("Enter the code from your authenticator app"),description:e("This helps us make sure it's really you."),showClose:!1,icon:(0,r.tZ)(u.AM,{icon:(0,r.tZ)(i.Z,{size:20})}),alignItems:"center"})};function Z(e){let{onSuccess:t}=e,n=(0,a.ib)({pathname:"/api/v1/mfa-login",method:"Post"});return(0,r.tZ)(s.fe,{children:(0,r.tZ)(c.sg,{gap:16,children:(0,r.tZ)(d.R,{onComplete:e=>{!n.isLoading&&n.refetch({json:{code:e}}).then(e=>{e instanceof l.kp||t()})},error:n.error,isLoading:n.isLoading})})})}let f=()=>{let{iString:e}=(0,o.M1)(),{setMode:t}=(0,p.I)();return(0,r.tZ)(h.et,{children:(0,r.BX)(r.HY,{children:[e("Made a mistake? "),(0,r.tZ)(c.hh,{color:"substack",decoration:"hover-underline",onClick:()=>t("email"),cursor:"pointer",children:e("Start over")})]})})}},24142:function(e,t,n){n.d(t,{L:()=>v});var r=n(16584),i=n(30396),o=n(29493),l=n(95441),a=n(33668),d=n(48980),c=n(7882),s=n(98914),u=n(80026),p=n(1844),h=n(6490),m=n(51776),g=n(4354),Z=n(41233),f=n(14942);let v=e=>{let{overrideTitle:t,noCloseButton:n,noExit:i,onCancel:o,onSignup:l,onSuccess:a}=e;return(0,r.BX)(r.HY,{children:[(0,r.tZ)(Z.LZ,{overrideTitle:t,noCloseButton:n||i,onCancel:o,onSignup:l}),(0,r.tZ)(y,{onSuccess:a})]})};function y(e){let{onSuccess:t}=e,{iString:n}=(0,l.M1)(),{email:Z,setEmail:v,setMode:y}=(0,g.I)(),w=(0,c.ib)({pathname:"/api/v1/login",method:"post"}),b=(0,i.sO)(),C=(0,a.e)(),k=(0,a.e)(),B=async e=>{if(e.preventDefault(),w.isLoading)return;let n=Object.fromEntries(Array.from(e.currentTarget.elements).filter(e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement).map(e=>[e.name,e.value]));b.current&&(n.captcha_response=b.current.getResponse());let r=await w.refetch({json:n});r instanceof Error||(r.mfa_required?y("mfa"):t())};return(0,r.BX)(r.HY,{children:[w.error instanceof d.kp&&401===w.error.response.status&&(0,r.tZ)(o.Z,{ref:b}),(0,r.BX)("form",{onSubmit:B,children:[(0,r.tZ)(h.fe,{className:f.Z.modalBody,children:(0,r.BX)(u.sg,{gap:8,children:[(0,r.tZ)(m.oi,{type:"email",name:"email",placeholder:n("Your email"),autoComplete:"email",ref:k,defaultValue:Z,autoFocus:!0}),(0,r.tZ)(m.oi,{type:"password",name:"password",placeholder:n("Your password"),ref:C}),w.error&&(0,r.tZ)(p.y,{children:(0,s.zx)(w.error)})]})}),(0,r.tZ)(h.mz,{direction:"column",primaryButton:(0,r.tZ)(u.zx,{priority:"primary",type:"submit",loading:w.isLoading,children:n("Continue")}),secondaryButton:(0,r.tZ)(u.zx,{priority:"secondary-outline",onClick:()=>{var e;v((null===(e=k.current)||void 0===e?void 0:e.value)||""),y("email")},children:n("Sign in with email")}),buttonDivider:(0,r.tZ)(u.ZC,{})})]})]})}},26042:function(e,t,n){n.d(t,{Z:()=>function* e(t){if(yield t,t.content)for(let n of t.content)yield*e(n)}})}}]);