text: (self.webpackChunklite=self.webpackChunklite||[]).push([[7209],{62182:(e,t,n)=>{"use strict";n.r(t),n.d(t,{PostSidebarContent:()=>z,PostSidebar:()=>M,PostSidebar_customStyleSheet:()=>Q,PostSidebar_collection:()=>J,PostSidebar_post:()=>Z});var r=n(28655),o=n.n(r),i=n(50008),l=n.n(i),a=n(63038),s=n.n(a),c=n(59713),u=n.n(c),d=n(71439),p=n(67294),m=n(28859),f=n(84783),v=n(22669),x=n(43689),g=n(86156),E=n(50493),h=n(86753),b=n(47713),S=n(99046),y=n(97297),w=n(78886),P=n(49925),_=n(34793),C=n(93125),I=n(33819),R=n(76532),O=n(51684),k=n(83021),D=n(31001),B=n(42933),T=n(82318),A=n(98024),F=n(18579),j=n(51512),L=n(6688),N=n(67297),H=n(89349),U=n(21146),X=n(27952);function G(){var e=o()(["\n  fragment PostSidebar_post on Post {\n    id\n    clapCount\n    collection {\n      ...auroraHooks_publisher\n      ...PostSidebar_collection\n    }\n    creator {\n      bio\n      name\n      ...UserFollowButton_user\n      ...auroraHooks_publisher\n      ...userUrl_user\n      ...PublisherSidebarFollows_user\n      ...SidebarProfilePic_user\n      ...PublisherFollowingCount_publisher\n    }\n    isShortform\n    ...BookmarkButton_post\n    ...CollectionFollowButton_post\n    ...MultiVote_post\n    ...ResponsesIconButton_post\n    ...UserFollowButton_post\n    ...TableOfContents_post\n  }\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n  ","\n"]);return G=function(){return e},e}function V(){var e=o()(["\n  fragment PostSidebar_collection on Collection {\n    id\n    description\n    tagline\n    ...CollectionFollowButton_collection\n    ...collectionUrl_collection\n  }\n  ","\n  ","\n"]);return V=function(){return e},e}function W(){var e=o()(["\n  fragment PostSidebar_customStyleSheet on CustomStyleSheet {\n    ...PublisherSidebarFollows_customStyleSheet\n  }\n  ","\n"]);return W=function(){return e},e}var z=function(e){var t,n=e.customStyleSheet,r=e.maxHeight,o=void 0===r?0:r,i=e.post,l=e.showProfilePic,a=e.visible,s=p.useContext(g.f).openSidebar,c=p.useRef(null),u=(0,L.I)(),d=(0,N.v9)((function(e){return e.navigation.currentLocation})),m=(0,P.GT)(i.collection||i.creator)?p.createElement(p.Fragment,null,l&&!!i.creator&&p.createElement(_.$,{user:i.creator}),p.createElement(q,{post:i,customStyleSheet:n,isVisible:a})):i.collection&&p.createElement(K,{post:i,currentLocation:d}),f={maxHeight:"".concat(o,"px"),overflowY:"scroll",scrollbarWidth:"none","-ms-overflow-style":"none","::-webkit-scrollbar":{display:"none"}};return p.createElement(p.Fragment,null,i.isShortform?m:p.createElement(p.Fragment,null,p.createElement("div",{ref:c},o?p.createElement("div",{className:u(f)},m):m,p.createElement(B.x,{display:"flex",flexDirection:"row",borderTop:"BASE_LIGHTER",paddingTop:"32px",justifyContent:"flex-start",alignItems:"center"},p.createElement(B.x,{display:"flex",marginRight:"20px"},p.createElement(S.S,{post:i,buttonStyle:"SUBTLE_PADDED",susiEntry:"clap_sidebar",hasDialog:!0})),p.createElement(j.cW,{source:{postId:i.id},extendSource:!0},p.createElement(B.x,{marginRight:"20px",marginTop:"2px"},p.createElement(I.h,{postId:i.id,responsesCount:null===(t=i.postResponses)||void 0===t?void 0:t.count,handleClick:s||function(){},allowResponses:i.allowResponses,isLimitedState:i.isLimitedState,svgSize:"S",countStylesOverride:{paddingLeft:"6px"}})),p.createElement(B.x,{marginTop:"1px"},p.createElement(b.o,{post:i,susiEntry:"bookmark_sidebar"}))))),p.createElement(E.o5,{post:i,mode:"SIDEBAR",heightRef:c})))},Y={wordBreak:"break-word"},$=function(e){var t;return t={opacity:e?1:0,pointerEvents:e?"auto":"none",willChange:"opacity",position:"fixed",width:"188px",left:"50%",transform:"translateX(406px)",top:"calc(".concat(x.Je,"px + 54px + 14px)")},u()(t,(0,H.nk)("no-preference"),{transition:"opacity 200ms"}),u()(t,"@media all and (max-width: 1230px)",{display:"none"}),t},M=p.forwardRef((function(e,t){var n=e.isClearOfBounds,r=e.isOnPage,o=e.customStyleSheet,i=e.post,a=e.extraWide,c=(0,L.I)(),u=p.useContext(m.u6).watchedBounds,d=p.useState(r||!1),f=s()(d,2),v=f[0],x=f[1],g=p.useState(0),E=s()(g,2),h=E[0],b=E[1],S=p.useState(n||!1),y=s()(S,2),w=y[0],P=y[1],_=p.useRef(null),I=p.useRef(null),R=function(e,t){var n,r,o,i,l=null===(n=e.get("byline"))||void 0===n||null===(r=n.ref)||void 0===r?void 0:r.current,a=null===(o=e.get("ghost-track"))||void 0===o||null===(i=o.ref)||void 0===i?void 0:i.current,s=a&&(0,U.L6)(a).top+window.scrollY-window.innerHeight||0;if(l&&a){var c=l.offsetTop+l.offsetHeight+10;return c-s}}(u);p.useEffect((0,k.T)(u,x),[u]);var D=p.useCallback((function(){var e,t;if(function(e,t,n,r,o){if(e.current){var i=t.current,l=["image","bgimage","footer","byline","title","header"],a=(0,O.b2)(e,n,l,o),s=!i||(0,O.b2)(t,n,l,o);r(a&&s)}}(_,I,u,P,{threshold:10}),null!=_&&null!==(e=_.current)&&void 0!==e&&e.clientHeight&&null!==(t=window)&&void 0!==t&&t.innerHeight&&R){var n,r,o=window.innerHeight-R-80;h&&(null==_||null===(n=_.current)||void 0===n?void 0:n.clientHeight)<=o?b(0):o<=(null==_||null===(r=_.current)||void 0===r?void 0:r.clientHeight)&&b(Math.max(o,150))}}),[u,P,h]);p.useEffect((function(){D()}),[]);var B="object"===l()(t)?t:null;p.useEffect((0,O.hE)(D,null==B?void 0:B.current),[D,null==B?void 0:B.current]);var T=w&&v;return p.createElement(j.cW,{source:{susiEntry:"post_sidebar",name:"post_sidebar"}},p.createElement(O.HX,{testId:"post-sidebar",isFixed:!0,scrollableRef:t,sidebarRef:_,topOffset:R,visible:T,extraWide:a},p.createElement(z,{customStyleSheet:o,maxHeight:h,post:i,visible:T})),p.createElement("div",{className:c($(T)),ref:I},p.createElement(C._U,{postId:i.id,isVisible:T})))})),K=function(e){var t=e.post,n=e.currentLocation,r=(0,L.I)(),o=(0,F.n)({name:"heading",scale:"XS"}),i=(0,N.v9)((function(e){return e.config.authDomain})),l=t.collection;return l?p.createElement(B.x,{marginBottom:"32px"},(null==l?void 0:l.name)&&p.createElement(T.r,{href:(0,X.WGd)(l,n,i)},p.createElement("h2",{className:r([o,Y])},l.name)),(l.tagline||l.description)&&p.createElement(B.x,{paddingTop:"2px",paddingBottom:"20px"},p.createElement(A.F,{scale:"M",clamp:6},l.tagline||l.description)),p.createElement(f.Fp,{buttonSize:"REGULAR",collection:l,post:t,susiEntry:"follow_sidebar"})):null},q=function(e){var t=e.post,n=e.customStyleSheet,r=e.isVisible,o=(0,R.H)().value,i=(0,N.v9)((function(e){return e.config.authDomain})),l=(0,L.I)(),a=(0,F.n)({name:"heading",scale:"XS"}),s=t.creator;if(!s||!s.name)return null;var c=p.createElement("h2",{className:l([a,Y])},s.name),u=s?p.createElement(T.r,{href:(0,X.AWr)(s,i)},c):c;return p.createElement(p.Fragment,null,p.createElement(B.x,{marginBottom:"32px"},p.createElement(B.x,{paddingBottom:"5px"},u),s.bio&&p.createElement(B.x,{paddingTop:"2px"},p.createElement(A.F,{scale:"M"},p.createElement(v.P,{wrapLinks:!0},s.bio))),(null==o?void 0:o.id)!==s.id&&p.createElement(B.x,{paddingTop:"14px"},p.createElement(D.Bv,{buttonSize:"REGULAR",post:t,user:s,susiEntry:"follow_card"}))),p.createElement(w.Lk.Provider,{value:{postId:t.id}},p.createElement(w.eB,{withBottomBorder:!0,publisher:s,customStyleSheet:n,isVisible:r})))},Q=(0,d.Ps)(W(),w.qy),J=(0,d.Ps)(V(),f.Iq,X.nfI),Z=(0,d.Ps)(G(),P.C5,J,D.sj,h.z,f.b3,S.x,I.K,D.S$,E.tA,X.$mN,w.FB,_.G,y.b5)},93125:(e,t,n)=>{"use strict";n.d(t,{_U:()=>j,Dk:()=>L});var r=n(28655),o=n.n(r),i=n(59713),l=n.n(i),a=n(63038),s=n.n(a),c=n(46829),u=n(71439),d=n(67294),p=n(12291),m=n(27721),f=n(42933),v=n(98462),x=n(98024),g=n(86021),E=n(6688),h=n(90038),b=n(27952);function S(){var e=o()(["\n  fragment ReadNextPostCard_post on Post {\n    id\n    title\n    mediumUrl\n    primaryTopic {\n      name\n      slug\n    }\n    collection {\n      id\n      name\n    }\n    previewImage {\n      id\n      alt\n      focusPercentX\n      focusPercentY\n    }\n  }\n"]);return S=function(){return e},e}var y=(0,u.Ps)(S()),w=(0,p.$j)((function(e){return{mediumOwnedAndOperatedCollectionIds:e.config.mediumOwnedAndOperatedCollectionIds,isCustomDomain:e.client.isCustomDomain}}))((function(e){var t=e.isCustomDomain,n=e.mediumOwnedAndOperatedCollectionIds,r=e.post,o=r&&r.previewImage||{},i=o.focusPercentX,l=o.focusPercentY,a=o.id,s=o.alt,c=r.collection||{},u=c.name,p=c.id,S=r.primaryTopic&&r.primaryTopic.name,y=p&&(n.includes(p)?u:S)||"",w=r&&r.title||"",P=(0,b.jVf)(r,t),_=(0,E.I)(),C=d.createElement(f.x,{marginBottom:"4px"},d.createElement(g.Lh,{tag:"span"},d.createElement(x.F,{scale:"S",color:"DARKER"},d.createElement("div",{className:_({whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"})},y))));return d.createElement(v.P,{href:P},d.createElement(f.x,{display:"flex",flexDirection:"column",justifyContent:"center",marginTop:"20px"},C,d.createElement(f.x,{display:"flex",flexDirection:"row"},d.createElement(m.UV,{miroId:a||"",alt:s||"",height:50,width:50,freezeGifs:!0,strategy:h._S.Crop,rules:{marginRight:"9px",marginTop:"4px"},focusPercentX:i||50,focusPercentY:l||50}),d.createElement(f.x,{display:"flex",flexDirection:"column",width:"130px"},d.createElement(x.F,{scale:"S",color:"DARKER",clamp:3},w)))))})),P=n(76532),_=n(3149),C=n(17614),I=n(95760),R=n(51512),O=n(11348),k=n(6522);function D(){var e=o()(["\n  query ReadNextQuery($postId: ID!) {\n    post(id: $postId) {\n      id\n      readNext {\n        ... on ReadNextItem {\n          reason\n          post {\n            ... on Post {\n              ...ReadNextPostCard_post\n            }\n          }\n        }\n      }\n    }\n  }\n  ","\n"]);return D=function(){return e},e}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A={display:"none"},F={":last-of-type":{xs:A,sm:A,md:A,lg:A,xl:{display:"block"}}},j=function(e){var t=e.isVisible,n=void 0===t||t,r=e.postId,o=d.useState(!1),i=s()(o,2),l=i[0],a=i[1],u=(0,P.H)().value,p=(0,c.useLazyQuery)(N),m=s()(p,2),v=m[0],x=m[1],g=x.called,h=x.loading,b=x.error,S=x.data,y=(S=void 0===S?{post:void 0}:S).post,k=u&&L(u)&&!((0,O.yd)()||l),D=(0,I.Av)(),B=(0,E.I)(),A=(0,R.Lk)(),j=y&&y.readNext;return d.useEffect((function(){h||!b||j&&j.length||D.event("readNextError",{post:y,postId:r,error:b,readNextLength:j&&j.length||0})}),[h]),d.useEffect((function(){n&&j&&(D.event("readNext.viewed",{position:"sidebar"}),j.slice(0,4).map((function(e,t){var n=e.post,r=e.reason;return D.event("post.clientPresented",{source:(0,R.f0)(T(T({},A),{},{index:t,postFeedReason:r||void 0})),location:"post/".concat(n&&n.id)}),!0})))}),[n,j]),!g&&k&&v({variables:{postId:r||""}}),g&&!h&&!b&&y&&j&&j.length&&k?d.createElement(R.cW,{source:{name:"read_next",sectionType:R.bA.READ_NEXT_SIDEBAR},extendSource:!0},d.createElement(f.x,{width:"188px"},d.createElement(f.x,{md:{display:"none"},lg:{width:"780px",margin:"0 24px"},position:"relative",backgroundColor:"BACKGROUND",paddingBottom:"24px",paddingTop:"24px",width:"100%"},d.createElement(f.x,{position:"absolute",right:"0",top:"-4px"},d.createElement(_.P,{onClick:function(){(0,O.Ph)(),a(!0)},size:"SMALL",isPositionAbsolute:!1})),d.createElement(f.x,{width:"200px"},d.createElement(C.F1,{scale:"XS"},"Your journey starts here.")),d.createElement(f.x,{display:"flex",flexDirection:"column",justifyContent:"space-between"},y.readNext.slice(0,4).map((function(e,t){var n=e.post;return n?d.createElement("div",{className:B(F),key:t},d.createElement(w,{key:t,post:n})):null})))))):null};function L(e){return e&&e.createdAt+k.pU>Date.now()}var N=(0,u.Ps)(D(),y)},83021:(e,t,n)=>{"use strict";n.d(t,{T:()=>r});var r=function(e,t){return function(){var n=new IntersectionObserver((function(n){var r=e.get("ghost-track");if(r){var o=n.find((function(e){return e.target===r.ref.current}));o&&t(o.isIntersecting)}else t(!1)}));return e.forEach((function(e){e.ref.current&&n.observe(e.ref.current)})),function(){n.disconnect()}}}}}]);
  //# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/PostSidebar.a9cf96fb.chunk.js.map