"use strict";(self.webpackChunklite=self.webpackChunklite||[]).push([[7975],{57975:(e,t,n)=>{n.d(t,{W:()=>W});var i=n(64467),a=n(96540),o=n(69733),l=n(74346),r=n(26557),s=n(22213),u=n(69650),d=n(12600),c=n(72541),p=n(11828),m=n(80182),v=n(80074),f=n(27721),b=n(1722),k=n(19228),g=n(43634),h=n(72130),C=n(49287),S=n(56743),y=n(39160),w=n(51771),O=n(46879),E=n(1491),N=n(32318),F=n(80045),P=n(65364),j=n(14281),D=n(1037),I=n(22541),V=n(54654),x=n(45458),L=n(52897),T=n(68037),A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PostVotersDialogQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"postId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pagingOptions"}},type:{kind:"NamedType",name:{kind:"Name",value:"PagingOptions"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"post"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"postId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"clapCount"}},{kind:"Field",name:{kind:"Name",value:"voterCount"}},{kind:"Field",name:{kind:"Name",value:"voters"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paging"},value:{kind:"Variable",name:{kind:"Name",value:"pagingOptions"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"FragmentSpread",name:{kind:"Name",value:"UserFollowButton_user"}},{kind:"FragmentSpread",name:{kind:"Name",value:"UserInListDialog_user"}}]}},{kind:"Field",name:{kind:"Name",value:"clapCount"}}]}},{kind:"Field",name:{kind:"Name",value:"pagingInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"next"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page"}}]}}]}}]}},{kind:"FragmentSpread",name:{kind:"Name",value:"UserFollowButton_post"}}]}}]}}].concat((0,x.A)(L.l.definitions),(0,x.A)(T.x.definitions),(0,x.A)(L.c.definitions))},H=["__typename"];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function B(e){for(var t=1;t0||k))return null;var h=function(e){var n=e.showVoters;return a.createElement(N.q,{showVoters:n,hasLabel:i,showFullNumber:l,shouldShowResponsiveLabelText:c,shouldHideClapsText:m,clapCount:t,countColor:v,countScale:f,isLoading:k})};return u&&g&&!k?a.createElement(X.B,null,(function(e){var t=e.isVisible,n=e.show,i=e.hide;return a.createElement(a.Fragment,null,a.createElement(q.G,{tooltipText:"View Claps",targetDistance:15},a.createElement(h,{showVoters:n})),t&&a.createElement(M,{isVisible:!0,hide:i,postId:g}))})):a.createElement(h,null)}var Y=n(11517);function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function K(e){for(var t=1;t=m.et)return"Viewer exceeded authorized claps limit.";var e;e={postId:n.id,clapCount:ae+1,viewerClapCount:oe+1,viewerHasClappedSinceFetch:!0},ee((0,S.K7)(e))}),[oe,n.id,ae]),se=(0,a.useCallback)((function(e){q(M,W,e,$),te.event("post.clientUpvote",{postId:n.id,postIds:[n.id],voteCount:e,source:ne})}),[n.id,W,$,ne]),ue=(0,v.s)({onIncrementClaps:re,onSubmitClapsAccumulated:se}),de=ue.clappedAt,ce=ue.onFloatEnd,pe=ue.removeBurst,me=ue.clap,ve=ue.isPopping,fe=ue.isShowingViewerClapCount,be=ue.burstOffsets,ke=ue.onPopEnd;(0,a.useEffect)((function(){return function(){var e;e={postId:n.id},ee((0,S.dy)(e))}}),[]);var ge,he=n.collection,Ce=n.creator,Se=n.id,ye=n.isPublished,we=n.isLimitedState,Oe=(ge=!(!Ce||Ce.id!==W),we?"This feature is temporarily disabled":ye?ge?"You cannot applaud your own story":void 0:"You cannot applaud a draft"),Ee=(0,m.vP)(i,P),Ne=Ee.alwaysShowClapsLabel,Fe=Ee.hasClapsLabel,Pe=Ee.buttonScale,je=!!(oe&&oe>0),De=!!(ae&&ae>0),Ie=he&&he.slug?(0,O.jXU)(J,he.slug,Se):(0,O.A4e)(J,Se);return a.createElement(s.R,{verticalClapsText:T},a.createElement(d.O,{buttonStyle:i,hasClaps:De||U},W||Oe?a.createElement(a.Fragment,null,fe&&a.createElement(k.Cq,null,a.createElement(u.u,{count:oe,clappedAt:de,onFloatEnd:ce})),a.createElement(p.s,{isPopping:ve,onPopEnd:ke},a.createElement(r.g,{buttonColor:A,disableReason:Oe,isFilled:je,isLoading:Q||U,onClickAndHold:me,scale:Pe,shouldHideClapsText:D,testId:_})),be.map((function(e){return a.createElement(l.S,{key:e,offset:e,onBurstEnd:pe})}))):a.createElement(g.r,{operation:"register",post:n,user:n.creator||void 0,actionUrl:Ie,susiEntry:x,testId:_},a.createElement(r.g,{scale:Pe,buttonColor:A,shouldHideClapsText:D,testId:_}))),(De||U)&&!V&&(!fe||Ne)&&a.createElement(c.T,{buttonStyle:i},a.createElement(z,{post:n,clapCount:ae,showFullNumber:le,hasLabel:Fe,hasDialog:N,shouldShowResponsiveLabelText:P,shouldHideClapsText:D,countColor:A,countScale:H,isLoading:U})))},W=function(e){var t;return a.createElement(C.Ne,{source:{postId:null===(t=e.post)||void 0===t?void 0:t.id},extendSource:!0},a.createElement(Q,e))}}}]); //# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/7975.d195c6f1.chunk.js.map