Loading
function(e,t,n){n(801541);var s=n(889137),i=n(744593),a=n(775602),r=n(121681),l=n(7584),o=n(229527),c=n(316031),d=n(734057),u=n(696451),m=n(596344),h=n(287809),x=n(486020),w=n(690521),p=n(723702),g=n(862780),A=n(969632),f=n(438437),y=n(842901),j=n(589590),b=n(708676),v=n(652215),S=n(818348),C=n(792996);let N={channelId:"",selectedAnswerIds:new Set,submitting:!1,editing:!1,showResults:!1};function E(e,t){for(let n of e)if(("number"==typeof n.emoji.id?`${n.emoji.id}`:n.emoji.id)===t)return n}function I(e){return null==e.poll||m.A.getMessage(e.channel_id,e.id)===e}function T(e,t){let{formattedExpirationLabel:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{poll:s}=e;if(null==s)return;let i=e.state===v.cmJ.SENT,a=i?n??(0,b.J)(s.expiry):"",r=null==a&&i,{selectedAnswerIds:l,submitting:h,editing:x,showResults:w}=t??(0,g.xt)(e.getChannelId(),e.id)??N,p=e.reactions,A=!0;if(!I(e)){let t=m.A.getMessage(e.channel_id,e.id);A=!e.isSearchHit&&null!=t,p=t?.reactions??p}let f=l.size>0,y=p.some(e=>!0===e.me_vote),j=!x&&y,S=j||r||w,C=i&&A&&(!y||x||S),E=d.A.getChannel(e.getChannelId())?.getGuildId?.(),T=null!=E?u.Ay.getSelfMember(E):null,_=(0,o.TR)(T),V=(0,c.Z)(T),k=!h&&f&&!j&&i&&!_&&!V;return{poll:s,canTapAnswers:C,canRemoveVote:j&&i&&!r,canShowVoteCounts:S,canSubmitVote:k,expirationLabel:a,hasSelectedAnswer:f,hasVoted:j,hasVoteRecorded:y,isEditingVote:x,isExpired:r,isInteractive:A,isSent:i,reactions:p,selectedAnswerIds:l,submitting:h,tapShouldOpenVotersModal:S,showResults:w}}n.d(t,{},{Ay:function(e,t){let{animateEmoji:n=!1,theme:o=S.NJ.DARK,formattedExpirationLabel:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{poll:u}=e;if(null==u)return;let m=h.default.getCurrentUser();if(null==m)return;let g=a.Ay.useReducedMotion,b=d.A.getChannel(e.getChannelId())?.getGuildId?.(),v=(0,y.T)(m,b),N=u.answers,I=u.layout_type,_=T(e,t,{formattedExpirationLabel:c});if(null==_)return;let{canTapAnswers:V,canRemoveVote:k,canShowVoteCounts:M,canSubmitVote:L,expirationLabel:R=C.intl.string(C.t["e+J3JZ"]),hasSelectedAnswer:F,hasVoted:U,isEditingVote:B,isExpired:O,isInteractive:D,reactions:P,selectedAnswerIds:W,submitting:Q,tapShouldOpenVotersModal:K,showResults:Y}=_,z=(0,A.aw)(P),G=C.intl.formatToPlainString(C.t.XRkuof,{count:z}),H=Math.max(...N.map(e=>{let t=E(P,`${e.answer_id}`);return t?.count_details?.vote??0})),J=N.map(e=>{let t,a=`${e.answer_id}`,o=E(P,a),c=o?.count_details?.vote??0,d=0===z?0:c/z,u=W.has(a),m=c>=H&&0!==c,h=U&&(o?.me_vote??!1),p=(t={didSelfVote:h,hasVoted:U,isExpired:O,isSelected:u,isLeader:m,showResults:Y},(0,s.YW)(t).with({isExpired:!0,isLeader:!0,didSelfVote:!0},()=>"victorSelected").with({isExpired:!0,isLeader:!0,didSelfVote:!1},()=>"victorNotSelected").with({isExpired:!0,didSelfVote:!0},()=>"loserSelected").with({isExpired:!0},()=>"notVoted").with({didSelfVote:!0,isExpired:!1},()=>"voted").with({hasVoted:!0,isExpired:!1},()=>"notVoted").with({isSelected:!0},()=>"selected").with({isExpired:!1,showResults:!0},()=>"notVoted").otherwise(()=>"normalVote"));return{answerId:a,pollMedia:{text:e.poll_media.text,emoji:function(e){let{animateEmoji:t=!1,size:n=48}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return;let s=e.animated;null==s&&null!=e.id&&(s=r.Ay.getCustomEmojiById(e.id)?.animated??!1);let i=t&&(s??!1);return{id:null==e.id?null:`${e.id}`,name:e.name,displayName:null==e.id?l.Ay.convertSurrogateToName(e.name):e.name,src:null==e.id?w.Ay.getURL(e.name):x.Ay.getEmojiURL({id:e.id,animated:i,size:n}),animated:i}}(e.poll_media.emoji,{animateEmoji:n}),stickerId:e.poll_media.sticker_id,attachmentIds:e.poll_media.attachment_ids},isSelected:u,isVictor:O&&m,didSelfVote:h,style:p,shouldAnimateTransition:Q&&!g,votesPercentage:Math.round(100*d),votes:(0,s.YW)(I).with(i.Z.IMAGE_ONLY_ANSWERS,()=>`(${c.toLocaleString()})`).otherwise(()=>C.intl.formatToPlainString(C.t.XRkuof,{count:c}))}}),Z=(0,s.YW)({isExpired:O,canSubmitVote:L,hasVoted:U,isEditingVote:B,canRemoveVote:k,isInteractive:D,showResults:Y}).with({isInteractive:!1},()=>void 0).with({isExpired:!0},()=>void 0).with({isEditingVote:!0},()=>({label:C.intl.string(C.t.JwkNU4),presentation:"button",enabled:F,type:"submit"})).with({canRemoveVote:!0},()=>({label:C.intl.string(C.t.XhQEh8),presentation:"secondaryButton",enabled:!0,type:"remove"})).with({hasVoted:!1,showResults:!0},()=>({label:C.intl.string(C.t.gNj6In),presentation:"secondaryButton",enabled:!0,type:"showVotes"})).otherwise(()=>({label:C.intl.string(C.t.JwkNU4),presentation:"button",enabled:L,type:"submit"})),$=(0,p.un)()?C.intl.string(C.t["PVATM/"]):C.intl.string(C.t.cHfFql),X=(0,s.YW)({isExpired:O,isInteractive:D,isEditingVote:B}).with({isInteractive:!1,isExpired:!1},()=>({label:C.intl.string(C.t.trrip0),presentation:"text",enabled:!1})).with({isEditingVote:!0},()=>({label:C.intl.string(C.t["ETE/oC"]),presentation:"textButton",enabled:!0,type:"cancel"})).otherwise(()=>({label:G,secondaryLabel:R,accessibilityHint:$,presentation:"text",enabled:!0,type:"showVoterDetails"})),q=!D||O||U||Y?void 0:{label:C.intl.string(C.t["/KHAUF"]),presentation:"textButton",enabled:!0,type:"showVotes"},ee=u.allow_multiselect,et=(0,s.YW)({isInteractive:D,isExpired:O,canSelectMultipleAnswers:ee}).with({isInteractive:!1},()=>void 0).with({isExpired:!0},()=>void 0).with({canSelectMultipleAnswers:!0},()=>C.intl.string(C.t.yCXvxa)).otherwise(()=>C.intl.string(C.t["9Y2wKO"]));return{question:u.question,promptLabel:et,answers:J,answersInteraction:(0,s.YW)({tapShouldOpenVotersModal:K,canTapAnswers:V,canSelectMultipleAnswers:ee}).with({tapShouldOpenVotersModal:!0},()=>f.CQ.LIST).with({canTapAnswers:!1},()=>f.CQ.LIST).with({canSelectMultipleAnswers:!1},()=>f.CQ.RADIO_BUTTONS).with({canSelectMultipleAnswers:!0},()=>f.CQ.CHECKBOXES).exhaustive(),answerTapAccessibilityLabel:K?$:void 0,layoutType:I,resources:(0,j.A)({theme:o,layoutType:I}),containerStyle:"normal",primaryAction:Z,isInteractive:D,canTapAnswers:V,canSelectMultipleAnswers:ee,hasSelectedAnswer:F,canShowVoteCounts:M,hasVoted:U,isExpired:O,myAvatarUrl:v,secondaryAction:X,tertiaryAction:q}},Ej:E,Ls:I,j8:T})}