"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["6299"],{31190:function(e,t,i){i.d(t,{Z:()=>r});let r={closeWelcomeModal:"closeWelcomeModal-KVUfKQ",maybeLater:"maybeLater-PlK9NK",publicationCoverPhotoLeft:"publicationCoverPhotoLeft-txdH2G",publicationCoverPhotoRight:"publicationCoverPhotoRight-RHPl8T",largePublicationCoverPhotoRight:"largePublicationCoverPhotoRight-A77S35",column:"column-_rp_8U",largeColumn:"largeColumn-bqn6Me",centeredColumn:"centeredColumn-M8Fujf",largeCenteredColumn:"largeCenteredColumn-AfeswM",hideColumnSmallScreens:"hideColumnSmallScreens-rlLOgZ",hideLargeColumnSmallScreens:"hideLargeColumnSmallScreens-LQBTX8",publicationCoverPhotoCenter:"publicationCoverPhotoCenter-rMU5R1",publicationLogo:"publicationLogo-EWjoMq",coverPrimary:"coverPrimary-cGRhhL",coverSecondary:"coverSecondary-pfbfwO",blurbImage:"blurbImage-bS0Pkx",containerClassName:"containerClassName-iHFmrN",promptClassName:"promptClassName-fM9VHe",inputClassName:"inputClassName-v5NZvy",subscribeButtonClassName:"subscribeButtonClassName-wpxkEl",largeHeading:"largeHeading-ZEJJF0",largeSubHeading:"largeSubHeading-lGmUwg",largePromptClassName:"largePromptClassName-Uexj1F",largeInputWrapperClassName:"largeInputWrapperClassName-VqAUAb",largeInputClassName:"largeInputClassName-zCK22A",largeSubscribeButtonClassName:"largeSubscribeButtonClassName-gTO6Dt",postContainer:"postContainer-iqizM2",postTitle:"postTitle-uVmG1_",postSubtitle:"postSubtitle-sIac6Y",postImage:"postImage-nsvz_r",faces:"faces-igzFCe",face:"face-G_PpVO",first:"first-bCHdQ8",last:"last-GRcjMY",bigSubtitle:"bigSubtitle-o28Z4u",balancedText:"balancedText-oQ__Kv",tosLink:"tosLink-n6HoHl",blurbText:"blurbText-isJ4mY",tosText:"tosText-yAQHNw"}},91925:function(e,t,i){i.d(t,{s:()=>n});var r=i(16584),l=i(4615);function n(e){let{children:t}=e;return(0,r.tZ)(l.f6,{theme:"coverTheme-PJLqY5",children:t})}},27836:function(e,t,i){i.d(t,{b:()=>s,j:()=>o});var r=i(16584),l=i(95441),n=i(80026),a=i(60308);function o(e){let{publisherTerms:t,utm_source:i}=e,{iString:o}=(0,l.M1)();return(0,r.BX)(r.HY,{children:[o("By registering you agree to")," ",t&&(0,r.BX)(r.HY,{children:[t,", "]}),(0,r.BX)(n.xv,{as:"span",translated:!0,children:["Substack's ",(0,r.tZ)(s,{href:(0,a._QN)({utm_source:i}),children:"Terms of Service"})]}),(0,r.BX)(n.xv,{as:"span",translated:!0,children:[", our ",(0,r.tZ)(s,{href:(0,a.Zzu)({utm_source:i}),children:"Privacy Policy"})]}),(0,r.BX)(n.xv,{as:"span",translated:!0,children:[", and our ",(0,r.tZ)(s,{href:(0,a.WFt)({utm_source:i}),children:"Information Collection Notice"})]}),"."]})}function s(e){let{href:t,children:i}=e;return(0,r.tZ)("a",{className:(0,n.oB)({decoration:"underline"}),href:t,target:"_blank",rel:"noopener",children:i})}},75744:function(e,t,i){i.d(t,{Ug:()=>m,fJ:()=>c,nO:()=>d});var r=i(16584),l=i(27836),n=i(95441),a=i(58175),o=i(60308);function s(e,t){return[...Array(2*e.length-1)].map((i,r)=>r%2?t:e[r/2])}let c=e=>{let{publication:t,className:i,themed:l=!1,utm_source:n}=e,a=l?"pub-tertiary-text":"tertiary";switch(null==t?void 0:t.subdomain){case"activisionblizzard":return(0,r.tZ)(h,{className:i,color:a,utm_source:n});case"demographyunplugged":return(0,r.tZ)(p,{className:i,color:a,utm_source:n});default:return(0,r.tZ)(u,{pub:t,className:i,color:a,utm_source:n})}},d=e=>{let{publication:t}=e,{iString:i}=(0,n.M1)();if((null==t?void 0:t.subdomain)==="demographyunplugged")return(0,r.BX)(r.HY,{children:[(0,r.BX)(a.xv,{translated:!0,size:14,className:"tos",children:["Substack's ",(0,r.tZ)(l.b,{href:(0,o.Zzu)(),children:"Privacy"}),","," ",(0,r.tZ)(l.b,{href:(0,o._QN)(),children:"Terms"})," and"," ",(0,r.tZ)(l.b,{href:(0,o.WFt)(),children:"Information Collection Notice"})]}),(0,r.BX)(a.xv,{translated:!0,size:14,className:"tos",children:["Demography Unplugged's"," ",(0,r.tZ)(l.b,{href:"https://www.demographyunplugged.com/p/privacy-policy",children:"Privacy"})," and"," ",(0,r.tZ)(l.b,{href:"https://www.demographyunplugged.com/p/terms-of-service",children:"Terms"})]})]});let c=[(0,r.tZ)(l.b,{href:(0,o.Zzu)(),children:i("Privacy")}),(0,r.tZ)(l.b,{href:(0,o._QN)(),children:i("Terms")}),(0,r.tZ)(l.b,{href:(0,o.WFt)(),children:i("Collection notice")})];return(null==t?void 0:t.subdomain)==="activisionblizzard"&&c.push((0,r.BX)(r.HY,{children:["Activision's"," ",(0,r.tZ)(l.b,{href:"https://www.activisionblizzard.com/legal/privacy-policy",children:"Privacy Policy"})]})),(null==t?void 0:t.subdomain)==="demographyunplugged"&&(c.push((0,r.BX)(r.HY,{children:["Demography Unplugged's"," ",(0,r.tZ)(l.b,{href:"https://www.demographyunplugged.com/p/privacy-policy",children:"Privacy Policy"})]})),c.push((0,r.BX)(r.HY,{children:["Demography Unplugged's"," ",(0,r.tZ)(l.b,{href:"https://www.demographyunplugged.com/p/terms-of-service",children:"Terms"})]}))),(0,r.tZ)(r.HY,{children:s(c,(0,r.tZ)("span",{children:" ∙ "}))})},u=e=>{let{pub:t,className:i,color:n,utm_source:s}=e,c=null;return t.has_custom_tos&&t.has_custom_privacy?c=(0,r.BX)(a.xv,{as:"span",translated:!0,children:["the publisher's ",(0,r.tZ)(l.b,{href:(0,o.P8A)({pub:t,utm_source:s}),children:"Terms of Service"})," and"," ",(0,r.tZ)(l.b,{href:(0,o.RF2)({pub:t,utm_source:s}),children:"Privacy Policy"})]}):t.has_custom_tos?c=(0,r.BX)(a.xv,{as:"span",translated:!0,children:["the publisher's ",(0,r.tZ)(l.b,{href:(0,o.P8A)({pub:t,utm_source:s}),children:"Terms of Service"})]}):t.has_custom_privacy&&(c=(0,r.BX)(a.xv,{as:"span",translated:!0,children:["the publisher's ",(0,r.tZ)(l.b,{href:(0,o.RF2)({pub:t,utm_source:s}),children:"Privacy Policy"})]})),(0,r.tZ)(a.xv.B3,{size:14,color:n,className:null!=i?i:"tos",children:(0,r.tZ)(l.j,{publisherTerms:c,utm_source:s})})},h=e=>{let{className:t,color:i,utm_source:n}=e;return(0,r.BX)(a.xv.B3,{translated:!0,size:14,color:i,className:null!=t?t:"tos",children:["By registering you agree to Substack's"," ",(0,r.tZ)(l.b,{href:(0,o._QN)({utm_source:n}),children:"Terms of Service"}),", our"," ",(0,r.tZ)(l.b,{href:(0,o.Zzu)({utm_source:n}),children:"Privacy Policy"}),", our"," ",(0,r.tZ)(l.b,{href:(0,o.WFt)({utm_source:n}),children:"Information Collection Notice"}),", and Activision's"," ",(0,r.tZ)(l.b,{href:"https://www.activisionblizzard.com/legal/privacy-policy",children:"Privacy Policy"})]})},p=e=>{let{className:t,color:i,utm_source:n}=e;return(0,r.BX)("div",{className:null!=t?t:"tos",children:[(0,r.BX)(a.xv.B3,{translated:!0,size:14,color:i,children:["By registering you agree to Substack's"," ",(0,r.tZ)(l.b,{href:(0,o._QN)({utm_source:n}),children:"Terms of Service"}),", our"," ",(0,r.tZ)(l.b,{href:(0,o.Zzu)({utm_source:n}),children:"Privacy Policy"}),", our"," ",(0,r.tZ)(l.b,{href:(0,o.WFt)({utm_source:n}),children:"Information Collection Notice"}),"."]}),(0,r.BX)(a.xv.B3,{translated:!0,size:14,color:i,children:["You also agree to receive marketing emails from Hedgeye Risk Management, LLC pursuant to its"," ",(0,r.tZ)(l.b,{href:"https://www.demographyunplugged.com/p/privacy-policy",children:"Privacy Policy"})," and"," ",(0,r.tZ)(l.b,{href:"https://www.demographyunplugged.com/p/terms-of-service",children:"Terms of Service"}),"."]}),(0,r.tZ)(a.xv.B3,{translated:!0,size:14,color:i,children:"You may unsubscribe at any time by clicking the unsubscribe link in one of the emails."})]})},m=e=>{let{pub:t}=e,i=[];return t.has_custom_privacy&&i.push((0,r.tZ)(l.b,{href:(0,o.RF2)({pub:t}),children:"Publisher Privacy"})),t.has_custom_tos&&i.push((0,r.tZ)(l.b,{href:(0,o.P8A)({pub:t}),children:"Publisher Terms"})),(0,r.tZ)("div",{children:(0,r.tZ)(a.xv.B3,{size:14,color:"tertiary",children:s(i,(0,r.tZ)("span",{children:" ∙ "}))})})}},64343:function(e,t,i){i.d(t,{Z:()=>o});var r=i(7409),l=i(99282),n=i(16584),a=i(64515);let o=e=>(0,n.tZ)(a.l,(0,l._)((0,r._)({},e),{name:"RightArrowIcon",svgParams:{height:20,width:20},children:(0,n.tZ)("path",{d:"M7.5 15L12.5 10L7.5 5","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}))},51214:function(e,t,i){i.d(t,{Z:()=>o});var r=i(7409),l=i(99282),n=i(16584),a=i(64515);let o=e=>(0,n.BX)(a.l,(0,l._)((0,r._)({},e),{name:"SimpleCheckmarkIcon",svgParams:{height:100,width:100},children:[(0,n.tZ)("path",{d:"m40.9 70c-.5 0-1-.2-1.4-.6-.8-.8-.8-2 0-2.8l36.8-36.8c.8-.8 2-.8 2.8 0s.8 2 0 2.8l-36.8 36.8c-.4.4-.9.6-1.4.6z"}),(0,n.tZ)("path",{d:"m40.9 70c-.5 0-1-.2-1.4-.6l-16.5-16.5c-.8-.8-.8-2 0-2.8s2-.8 2.8 0l16.5 16.5c.8.8.8 2 0 2.8-.4.4-.9.6-1.4.6z"})]}))},21312:function(e,t,i){i.d(t,{Z:()=>n});var r=i(16584),l=i(30396);function n(e){let{text:t,maxLines:i,ellipsesText:n="..."}=e,a=(0,l.sO)(null),[o,s]=(0,l.eJ)(t);return(0,l.d4)(()=>{(()=>{if(!a.current)return;a.current.innerText="-";let e=(a.current.clientHeight+1)*i+1,r=0,l=0,o=t.length;for(;r<=o;){if(l=Math.floor((r+o)/2),a.current.innerText=t.slice(0,l),l===t.length&&a.current.clientHeight<=e){a.current.innerText="",s(t);return}a.current.clientHeight<=e?r=l+1:o=l-1}let c=t.slice(0,l-n.length-2);a.current.innerText="",s(c+n)})()},[a,t,i,n]),(0,r.BX)("div",{style:{position:"relative"},children:[(0,r.tZ)("div",{children:o}),(0,r.tZ)("div",{ref:a,style:{visibility:"hidden",position:"absolute",width:"100%"}})]})}},52384:function(e,t,i){i.d(t,{Q:()=>s});var r=i(7409),l=i(98848),n=i(80569),a=i.n(n),o=i(7882);function s(e){var{auto:t,initialResult:i,deps:n}=e,s=(0,l._)(e,["auto","initialResult","deps"]);return(0,o.Wf)(async e=>{var{signal:t}=e,i=(0,l._)(e,["signal"]);let{pathname:n="",query:o,body:c,method:d="get"}=(0,r._)({},s,i),u=a()(d.toUpperCase(),n);o&&u.query(o),c&&u.send(c),t.addEventListener("abort",()=>{u.abort()});let h=await u;if(t.aborted)return;let p=h.error;if(p)throw p;return h.body},n||[],{auto:t,initialResult:i})}},55722:function(e,t,i){i.d(t,{o:()=>u});var r=i(7409),l=i(99282),n=i(16584),a=i(47907),o=i(30302);let s={sm:16,md:20,lg:24},c={100:o.Z,1e3:a.Z,1e4:a.Z},d={1e4:{fill:"var(--color-accent-fg-purple)"}},u=e=>{let{tier:t,size:i="sm"}=e;if(!t)return null;let a=c[t.toString()],o=d[t.toString()],u=s[i];return(0,n.tZ)(a,(0,l._)((0,r._)({},o),{height:u}))}},30378:function(e,t,i){i.d(t,{Z:()=>N,j:()=>_});var r=i(58865),l=i(16584),n=i(30396),a=i(82569),o=i.n(a),s=i(80569),c=i.n(s),d=i(20160),u=i(57391),h=i(95441),p=i(68833),m=i(52384),g=i(15771),v=i(307),b=i(94827),f=i(76560),y=i(54093);function Z(){let e=(0,r._)(["Select "," more to continue"]);return Z=function(){return e},e}let _=(e,t,i,r)=>{var l,n;let a=Object.entries(e).filter(e=>{let[t]=e;return"promoted"!==t&&"suggested"!==t}).map(e=>{let[t,i]=e;return i}),s=new Set,c=Math.max(...a.map(e=>e.length)),d=[];for(let e=0;e{let{onCategoriesFinalized:t=null,setStep:i,handleError:r,categories:a,pub:o=null,entry:s,user:y,setPreviousStepData:N,recommendationsSource:C=null,canBeSkipped:B=!1,suggestPubIds:P}=e,[w,S]=(0,n.eJ)([]),[k,R]=(0,n.eJ)({}),[I,x]=(0,n.eJ)(null),[E,X]=(0,n.eJ)(!1),[T,A]=(0,n.eJ)([]),[z,D]=(0,n.eJ)(!1),{getExperimentVariant:L,exposeExperiment:F,refreshExperimentVariants:O}=(0,u.jc)(),H=L("web_reader_onboarding_min_3_categories"),{iString:j,iTemplate:U}=(0,h.M1)();F("web_reader_onboarding_min_3_categories");let M=L("reader_onboarding_model_recs_categories_skipped");(0,n.d4)(()=>{O({ignoreDownsampling:!0})},[]),(0,n.d4)(()=>{let e=async()=>{if(!C)return;let e=await c().get(C);R({personalized:e.body}),x("personalized"),A(_({personalized:e.body},[null==o?void 0:o.id],[],"control").map(e=>{let{id:t}=e;return t})),X(!0)};C&&e()},[C,s,null==o?void 0:o.id]);let G=(0,m.Q)({pathname:"/api/v1/categories",auto:!a,initialResult:a,deps:[]}).result||[],Y=async()=>{let e;try{let t=w.length?w:G.slice(0,3).map(e=>e.id),i={categoryIds:JSON.stringify(t),userDidSelectCategories:!!w.length};P&&(i.suggestedPubIds=P);let r=await c().get("/api/v1/category/public/multiple").query(i);R(r.body),x("leaderboard"),e=_(r.body,[null==o?void 0:o.id],w,M).map(e=>{let{id:t}=e;return t})}catch(e){r(e,{ignore:!0}),i(f.c.PROFILE);return}for(let e of((0,p.j)(p.FP.READER_ONBOARDING_CATEGORIES_FINALIZED,{entry:s,numberOfCategories:w.length}),w))(0,p.j)(p.FP.READER_ONBOARDING_CATEGORY_REQUESTED,{entry:s,categoryId:e});(null==w?void 0:w.length)?(F("reader_onboarding_model_recs_categories_selected",{ignoreDownsampling:!0}),A(e)):(F("reader_onboarding_model_recs_categories_skipped",{ignoreDownsampling:!0}),A((null==M?void 0:M.includes("treatment"))?[e[0]]:e)),X(!0),null==t||t()},J=async()=>{let e=y?y.profile_set_up_at?y.has_publication?f.c.APP_UPSELL:f.c.START_WRITING:f.c.PROFILE:f.c.SIGNUP;if(T.length>0)try{D(!0),(0,p.j)(p.FP.READER_ONBOARDING_BULK_SUBSCRIBE_SELECTED_IN_UI,{entry:s,numberOfSubscriptions:T.length,recommendationsFrom:"categories"}),y?(await c().post("/api/v1/bulk_signup").send({publications:T,source:"".concat("reader2-profile"===s?"reader2":s,"-reader-onboarding")}),(0,p.j)(p.FP.READER_ONBOARDING_BULK_SUBSCRIBED,{entry:s,numberOfSubscriptions:T.length,recommendationsFrom:"categories"})):N(f.c.CATEGORIES,{publications:T,selectedCategoryIds:w}),i(e)}catch(e){r(e,{ignore:!1})}else y?(0,p.j)(p.FP.READER_ONBOARDING_BULK_SUBSCRIBE_SKIPPED,{entry:s,recommendationsFrom:"categories"}):N(f.c.CATEGORIES,{publications:[],selectedCategoryIds:w}),i(e)},K="treatment"===H&&w.length<3;return E||C?(0,l.BX)("div",{className:"categories-step",children:[(0,l.BX)("div",{className:"categories-header",children:[(0,l.tZ)("h3",{children:"Creators you may like"}),(0,l.tZ)("p",{children:C?"We found some writers based on your interests.":w.length>0?"Based on your interests, here are some writers you might enjoy.":"Here are some writers you might enjoy."})]}),(0,l.tZ)(v.Z,{publications:_(k,[null==o?void 0:o.id],w,M),selected:T,setSelected:A,onRecommendationFirstVisible:(e,t)=>{(0,p.j)(p.FP.READER_ONBOARDING_PUB_RECOMMENDED,{entry:s,publication_id:e.id,recommendationFrom:I,suggestion_rank:t})}}),(0,l.BX)("div",{className:"modal-ctas",children:[B&&(0,l.tZ)("p",{className:"skip",children:(0,l.tZ)("a",{className:"small",onClick:e=>{if(z){e.preventDefault();return}(0,p.j)(p.FP.READER_ONBOARDING_BULK_SUBSCRIBE_SKIPPED,{entry:s,recommendationsFrom:"categories"}),i(f.c.APP_UPSELL)},children:"Skip for now"})}),(0,l.BX)(g.zx,{priority:"primary",type:"submit",onClick:J,disabled:z,children:[T.length>0&&"Subscribe to ".concat(T.length," and continue"),0===T.length&&"Continue without subscribing"]})]})]}):(0,l.BX)("div",{className:"categories-step",children:[(0,l.BX)("div",{style:{overflowY:"auto",height:"100%",position:"relative"},children:[(0,l.BX)("div",{className:"categories-header",children:[(0,l.BX)("h3",{children:[o?(0,l.BX)(l.HY,{children:["You're subscribed!",(0,l.tZ)("br",{}),"Now dive"]}):"Dive"," ","into your interests"]}),(0,l.tZ)("p",{children:"We'll recommend top publications based on the topics you select."})]}),(0,l.tZ)(d.W,{children:(0,l.tZ)(b.Rj,{hasFeatured:!1,categories:G,categoryIds:w,onCategoryClicked:e=>{let{categoryId:t}=e;if(w.includes(t)){var i;let e=null===(i=G.find(e=>e.id===t))||void 0===i?void 0:i.subcategories;S(w.filter(i=>i!==t&&!(null==e?void 0:e.some(e=>e.id===i))))}else S([...w,t])},ranking:"all",defaultExpanded:!0})})]}),(0,l.tZ)("div",{className:"spacer"}),(0,l.tZ)("div",{className:"modal-ctas",children:(0,l.tZ)(g.zx,{disabled:K,priority:"primary",onClick:Y,children:"treatment"!==H?j("Continue"):w.length<3?U(Z(),3-w.length):j("Continue")})})]})}},94827:function(e,t,i){if(i.d(t,{Bk:()=>S,Rj:()=>w,xI:()=>I}),3270==i.j)var r=i(7409);if(3270==i.j)var l=i(98848);var n=i(16584),a=i(6400),o=i(30396),s=i(94184),c=i.n(s),d=i(32224),u=i(1852),h=i(16104),p=i(35047),m=i(94499),g=i(32582),v=i(95441),b=i(62514),f=i(68833),y=i(98914),Z=i(15771),_=i(10510);if(3270==i.j)var N=i(22419);var C=i(60308);if(3270==i.j)var B=i(47929);let P={desktop:15,mobile:6},w=e=>{let{className:t,hasFeatured:i,categories:r,categoryId:l,categoryIds:a,loadingCategoryId:s,ranking:h,onCategoryClicked:p,defaultExpanded:m}=e,[g,b]=(0,o.eJ)(m||!1),[f,y]=(0,o.eJ)(new Set),_=P[(0,u.useMediaQuery)({query:"only screen and (max-width: 650px)"})?"mobile":"desktop"],{iString:N}=(0,v.M1)(),C=r?g?r:r.slice(0,_):[],B=e=>e.id===l||(null==a?void 0:a.includes(e.id)),w=e=>{y(t=>{let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i})};return(0,n.BX)("div",{className:c()("categories",t),children:[i&&(0,n.tZ)(Z.zx,{priority:"featured"!==l||s&&"featured"!==s?"secondary":"primary-mono",loading:"featured"===s&&"featured"!==l,onClick:()=>{p({categoryId:"featured",ranking:"all",categories:r})},children:N("Featured")}),C.map(e=>{var t;let i=f.has(e.id),a=e.subcategories&&e.subcategories.length>0,o=B(e)&&(!s||s===e.id),c=s===e.id&&l!==e.id;return(0,n.BX)(n.HY,{children:[(0,n.tZ)(Z.zx,{priority:o?"primary-mono":"secondary-outline",loading:c,onClick:()=>{p({categoryId:e.id,ranking:h,categories:r}),a&&w(e.id)},className:o?"test-active":"test-inactive",children:N(e.name||"")}),i&&a&&(null==e?void 0:null===(t=e.subcategories)||void 0===t?void 0:t.map(e=>{let t=B(e)&&(!s||s===e.id),i=s===e.id&&l!==e.id;return(0,n.tZ)(Z.zx,{priority:t?"primary-mono":"secondary",loading:i,onClick:()=>p({categoryId:e.id,ranking:h,categories:r}),children:N(e.name)},e.id)}))]})}),r&&r.length>_&&!g&&(0,n.tZ)(Z.hU,{priority:"secondary-outline",onClick:()=>b(!0),children:(0,n.tZ)(d.Z,{size:20})})]})},S=e=>{let{publications:t,explanations:i,ranking:r,openInNew:l,startRankAt:a=0,source:o,onPublicationVisited:s=null,user:c,categoryId:d}=e,{language:u}=(0,v.M1)();return(0,n.tZ)(n.HY,{children:(0,n.tZ)("div",{className:"publications",children:t.map((e,t)=>{var h,m,g,v,b,y,Z;let N;let P=i&&i[t];if(!e)return;P||(P=[]);let w=P.filter(e=>["posts.title","posts.subtitle"].includes(e.type)),S=!!(null===(v=w[0])||void 0===v?void 0:null===(g=v.posts)||void 0===g?void 0:null===(m=g[0])||void 0===m?void 0:null===(h=m[0])||void 0===h?void 0:h.slug);S&&(N=null===(Z=w[0])||void 0===Z?void 0:null===(y=Z.posts)||void 0===y?void 0:null===(b=y[0])||void 0===b?void 0:b[0]);let R=P.filter(e=>"description"===e.type)[0],I=P.filter(e=>["name","subdomain","hero_text","custom_domain","author_name"].includes(e.type)).length>0||!R&&!N,x=P.filter(e=>"description"===e.type).map(e=>e.keyword),E=P.filter(e=>["posts.title","posts.subtitle"].includes(e.type)).map(e=>e.keyword),X=(0,C.TJI)(e,{params:{utm_source:o||B.b3.discover},signedIn:!!c});return(0,n.BX)("a",{className:"publication",href:X,native:!0,target:l?"_blank":void 0,onClick:()=>{(0,f.x6)(e,o||"leaderboards",{position:t+1,category:d}),s&&s(e)},rel:"noopener",children:["paid"===r?(0,n.tZ)("div",{className:"publication-rank",children:t+1+a}):null,(0,n.BX)("div",{className:"publication-content",children:[(0,n.tZ)(_.wk,{pub:e,belowTheFold:!0}),(0,n.BX)("div",{className:"publication-text-area",children:[(0,n.tZ)("div",{className:"publication-title",children:e.name}),(I||N)&&(0,n.tZ)("div",{className:"publication-description",children:e.editorial_bio||k(e.hero_text,x)}),!I&&R&&!N&&(0,n.tZ)("div",{className:"publication-description",children:k(R.sentence,x)}),!I&&N&&(0,n.tZ)("div",{className:"publication-explanation-box",children:S&&(0,n.tZ)("a",{className:"title",href:(0,C.uRy)(e,N),children:(0,n.BX)("div",{className:"post-preview-content",children:[(0,n.BX)("div",{className:"left-flex",children:[(0,n.tZ)("p",{className:"title",children:k(N.title,E)}),(0,n.tZ)("p",{className:"subtitle",children:k(N.subtitle,E)})]}),(0,n.tZ)("div",{className:"right-flex",children:(0,n.tZ)("img",{src:N.cover_image,className:N.cover_image?"":"no-preview"})})]})})}),(0,n.tZ)("div",{className:"publication-author",children:(0,p.sv)(e,{language:u})})]})]})]},e.id)})})})};function k(e,t){if(!e)return"";let i=RegExp(t.join("|"),"ig"),r=e.split(i),l=[...e.matchAll(i)];return(0,n.tZ)("span",{children:r.map((e,t)=>(0,n.BX)(n.HY,{children:[e,t!==r.length-1&&(0,n.tZ)("b",{children:l[t]})]}))})}let R=e=>{let{onCategoryClicked:t,categoryId:i,ranking:r,loadingRanking:l,categories:a}=e;return"string"==typeof i&&["featured","twitter"].includes(i)?null:(0,n.BX)("div",{className:"ranking-toggle",children:[(0,n.tZ)(m.Z,{className:c()({active:"paid"===r&&!l||"paid"===l,loading:"paid"===l&&"paid"!==r}),onClick:()=>t({categoryId:i,ranking:"paid",categories:a}),children:"Top paid"})," \xb7 ",(0,n.tZ)(m.Z,{className:c()({active:"all"===r&&!l||"all"===l,loading:"all"===l&&"all"!==r}),onClick:()=>t({categoryId:i,ranking:"all",categories:a}),children:"All"})]})},I=e=>{var{Component:t=x}=e,i=(0,l._)(e,["Component"]);let a=(0,b.z)(i);return a.categories?(0,n.tZ)(t,(0,r._)({},a)):null};class x extends(3270==i.j?a.Component:null){componentDidUpdate(e){if(this.props.categorySlug===e.categorySlug&&this.props.rankingSlug===e.rankingSlug)return;let t=(0,N.Wq)(this.props.categorySlug,this.props.categories),i=this.props.rankingSlug||"paid";this.props.loadPublications({categoryId:t,ranking:i})}startReading(e){window.sessionStorage.setItem("initialJoinSubstack","true"),(0,f.j)(f.FP.HOMEPAGE_READER_LINK_CLICKED,{url:(0,C.HMK)()}),(0,y.uX)((0,C.HMK)(),{event:e})}render(e){let{categories:t,publications:i,categoryId:r,loadingCategoryId:l,ranking:a,loadingRanking:o,onCategoryClicked:s,hasMore:d,viewMore:u,featuredPublications:p,maxPublications:m,showTwitterBanner:v,user:b}=e,f="featured"===r,y="twitter"===r,_=t.find(e=>e.id===r);return(0,n.tZ)("div",{className:c()("new-landing-page reader-landing-page page",{"category-featured":f}),children:(0,n.BX)("div",{className:"container",children:[(0,n.BX)("div",{className:"landing-content",children:[(0,n.BX)("div",{className:"landing-section landing-publications",children:[(0,n.tZ)("div",{className:"publications-header not-mobile",children:(0,n.tZ)(R,{categories:t,categoryId:r,ranking:a,onCategoryClicked:s})}),(0,n.tZ)(S,{publications:i,ranking:f?"all":a,categoryId:r}),"all"===a&&!f&&!y&&!m&&d&&(0,n.tZ)("div",{className:"view-more",children:(0,n.tZ)(Z.zx,{priority:"secondary-outline",onClick:u,children:"View more"})}),m&&"featured"!==r&&(0,n.tZ)("div",{className:"see-all",style:{paddingLeft:"all"===a?"108px":"146px"},children:(0,n.BX)("a",{href:f?(0,C._P8)():(0,C._P8)(_,a),native:!0,children:["See all"," ",(0,n.tZ)(h.Z,{width:7,height:11,color:"var(--color-primary-themed)",style:{marginLeft:"3px"}})]})})]}),(0,n.BX)("div",{className:"landing-section landing-categories",children:[(0,n.tZ)("div",{className:"only-mobile",children:(0,n.tZ)("div",{className:"mobile-toggle",children:(0,n.tZ)(R,{categories:t,categoryId:r,ranking:a,onCategoryClicked:s})})}),(0,n.tZ)(w,{hasFeatured:p&&p.length>0,categories:t,categoryId:r,loadingCategoryId:l,onCategoryClicked:s,ranking:a,loadingRanking:o})]})]}),!v||"featured"!==r||(null==b?void 0:b.has_linked_twitter)?null:(0,n.tZ)(g.PH,{})]})})}}}}]);