(self.webpackChunklite=self.webpackChunklite||[]).push([[8121],{68427:(e,n,i)=>{"use strict";i.d(n,{B:()=>d,R:()=>c});var t=i(8575),a=i(67294),o=i(43487),l=i(78870),d=function(){var e=(0,o.v9)((function(e){return e.navigation.currentLocation})),n=(0,o.v9)((function(e){return e.config.authDomain})),i=(0,l.rp)();return(0,a.useCallback)((function(a){var o=a.id,l=a.domain,d=function(e){var n=e.id,i=e.slug;return i?"/".concat(i):"/c/".concat(n)}({id:o,domain:l,slug:a.slug});if(i)return"https://".concat(n).concat(d);var c=(0,t.parse)(e).port;return l?"https://".concat(l).concat(c?":".concat(c):""):"https://".concat(n).concat(d)}),[i])},c=function(e){return d()(e)}},78757:(e,n,i)=>{"use strict";i.d(n,{P:()=>o});var t=i(68427),a=i(84739),o=function(e){var n=(0,t.B)(),i=(0,a.I)();return"Collection"===e.__typename?n(e):"User"===e.__typename?i(e):""}},84683:(e,n,i)=>{"use strict";i.d(n,{d:()=>o});var t=i(87329),a=i(68216),o={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CollectionAvatar_collection"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Collection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"avatar"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"FragmentSpread",name:{kind:"Name",value:"collectionUrl_collection"}}]}}].concat((0,t.Z)(a.nf.definitions))}},71652:(e,n,i)=>{"use strict";i.d(n,{v:()=>m});var t=i(67294),a=i(68427),o=i(14818),l=i(4381),d=i(27323),c=i(29746),r=i(46696),u=function(e){return function(n){return{borderRadius:(0,c.a)(n.borderRadius.regular),width:(0,c.a)(e),height:(0,c.a)(e)}}},m=function(e){var n=e.circular,i=e.collection,c=e.size,m=void 0===c?60:c,s=e.link,k=e.showHoverState,v=(0,a.R)(i);if(!i||!i.avatar||!i.avatar.id)return null;var f=i.avatar.id,S=i.name||"Publication avatar",p=n?t.createElement(o.z,{miroId:f,alt:S,diameter:m,freezeGifs:!1,showHoverState:k}):t.createElement(l.UV,{rules:[u(m)],miroId:f,alt:S,width:m,height:m,strategy:r._S.Crop});return s?t.createElement(d.P,{href:v},p):p}},19308:(e,n,i)=>{"use strict";i.d(n,{b:()=>l,I:()=>d});var t=i(87329),a=i(68216),o=i(98007),l={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CollectionFollowButton_post"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Post"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"id"}}]}}]},d={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CollectionFollowButton_collection"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Collection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"FragmentSpread",name:{kind:"Name",value:"collectionUrl_collection"}},{kind:"FragmentSpread",name:{kind:"Name",value:"SusiClickable_collection"}}]}}].concat((0,t.Z)(a.nf.definitions),(0,t.Z)(o.Os.definitions))}},82405:(e,n,i)=>{"use strict";i.d(n,{F:()=>w});var t=i(34699),a=i(21919),o=i(67294),l=i(51615),d=i(77520),c=i(20297),r=i(25550),u=i(25267),m=i(39727),s=i(26350),k=i(50563),v=i(93310),f=i(77355),S=i(47230),p=i(18627),N=i(66411),g=i(92661),C=i(43487),F=i(50458),w=function(e){var n,i=e.buttonSize,F=e.buttonStyleFn,w=e.collection,b=e.post,_=e.simpleLink,D=e.susiEntry,E=void 0===D?"follow_card":D,h=e.preventParentClick,T=e.width,I=(0,C.v9)((function(e){return e.config.authDomain})),Z=(0,r.r)().viewerId,U=(0,p.A)(),V=(0,N.pK)(),B=(0,l.TH)(),z=(0,g.$B)(B.pathname),O=null==z||null===(n=z.route)||void 0===n?void 0:n.name,P=(0,m.g)(w),R=P.viewerEdge,H=P.loading,q=function(e,n){var i=(0,a.D)(c.e),l=(0,t.Z)(i,1)[0];return o.useCallback((function(){return l({variables:{id:e.id},optimisticResponse:{followCollection:{__typename:"Collection",id:e.id,name:e.name,viewerEdge:{__typename:"CollectionViewerEdge",id:"collectionId:".concat(e.id,"-viewerId:").concat(n),isFollowing:!0}}},update:function(i){i.modify({id:"User:".concat(n),fields:{missionControl:(0,k.im)("followedCollections",!0),followingCollectionConnection:(0,k.Hc)(e.id)}})}})}),[e.id])}(w,Z),x=function(e,n){var i=(0,a.D)(c.X),l=(0,t.Z)(i,1)[0];return o.useCallback((function(){return l({variables:{id:e.id},optimisticResponse:{unfollowCollection:{__typename:"Collection",id:e.id,name:e.name,viewerEdge:{__typename:"CollectionViewerEdge",id:"collectionId:".concat(e.id,"-viewerId:").concat(n),isFollowing:!1}}},update:function(e){e.modify({id:"User:".concat(n),fields:{missionControl:(0,k.im)("followedCollections",!1)}})}})}),[e.id])}(w,Z),A=o.useCallback((function(e){h&&e.preventDefault(),U.event("collection.followed",{collectionId:w.id,followSource:V}),q()}),[w,h,V,U]),L=o.useCallback((function(e){h&&e.preventDefault(),U.event("collection.unfollowed",{collectionId:w.id,followSource:V}),x()}),[h,V,U]),G=!(null==R||!R.isFollowing),M=F?F(!!G):G?"OBVIOUS":"STRONG";return _?o.createElement(v.r,{onClick:G?L:A},o.createElement(f.x,{display:"flex",flexDirection:"row"},G?"Unfollow publication":"Follow publication")):o.createElement(u.I,null,(function(e){return e?o.createElement(S.zx,{size:i,onClick:G?L:A,buttonStyle:M,loading:H,width:T},G?"Following":"Follow"):o.createElement(s.R,{collection:w,buttonStyle:M,isButton:!0,buttonSize:i,operation:"register",actionUrl:y(I,w,b)||"",susiEntry:E,pageSource:(0,d.x)(O,"register"),buttonWidth:T},G?"Following":"Follow")}))},y=function(e,n,i){return n.slug&&(i&&i.id?(0,F.TA)(e,n.slug,i.id):(0,F.Ll)(e,n.slug))}},39727:(e,n,i)=>{"use strict";i.d(n,{g:()=>l});var t=i(64718),a=i(87329),o={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CollectionViewerEdge"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"collection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Collection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"viewerEdge"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Collection_viewerEdge"}}]}}]}}]}}]}}].concat((0,a.Z)([{kind:"FragmentDefinition",name:{kind:"Name",value:"Collection_viewerEdge"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionViewerEdge"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"canEditOwnPosts"}},{kind:"Field",name:{kind:"Name",value:"canEditPosts"}},{kind:"Field",name:{kind:"Name",value:"isEditor"}},{kind:"Field",name:{kind:"Name",value:"isFollowing"}},{kind:"Field",name:{kind:"Name",value:"isMuting"}},{kind:"Field",name:{kind:"Name",value:"isSubscribedToLetters"}},{kind:"Field",name:{kind:"Name",value:"isSubscribedToMediumNewsletter"}},{kind:"Field",name:{kind:"Name",value:"isSubscribedToEmails"}},{kind:"Field",name:{kind:"Name",value:"isWriter"}}]}}]))},l=function(e){var n,i,a=(0,t.a)(o,{variables:{collectionId:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:""},ssr:!1,skip:!(null!=e&&e.id)}),l=a.loading,d=a.error,c=a.data;return l?{loading:l}:d?{error:d}:{viewerEdge:null==c||null===(i=c.collection)||void 0===i?void 0:i.viewerEdge}}},25267:(e,n,i)=>{"use strict";i.d(n,{I:()=>a});var t=i(6443),a=function(e){var n=e.children,i=e.nonBlocking,a=(0,t.H)(),o=a.error,l=a.loading,d=a.value;return i&&(o||l)?n(null):l?null:n(d)}},98007:(e,n,i)=>{"use strict";i.d(n,{Os:()=>o,qU:()=>l,Vm:()=>d,GB:()=>c});var t=i(87329),a=i(20121),o={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"SusiClickable_collection"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Collection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SusiContainer_collection"}}]}}].concat((0,t.Z)(a.Hr.definitions))},l={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"SusiClickable_post"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Post"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"mediumUrl"}},{kind:"FragmentSpread",name:{kind:"Name",value:"SusiContainer_post"}}]}}].concat((0,t.Z)(a.qt.definitions))},d=([{kind:"FragmentDefinition",name:{kind:"Name",value:"SusiClickable_topic"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Topic"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SusiContainer_topic"}}]}}].concat((0,t.Z)(a.Uh.definitions)),{kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"SusiClickable_user"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SusiContainer_user"}}]}}].concat((0,t.Z)(a.Zd.definitions))}),c={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"SusiClickable_newsletterV3"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"NewsletterV3"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SusiContainer_newsletterV3"}}]}}].concat((0,t.Z)(a.gs.definitions))};[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SusiClickableAccountTokenQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"SusiContainer_query"}}]}}].concat((0,t.Z)(a.Zz.definitions))}}]); //# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/8121.a8bdf1bb.chunk.js.map