PageSourceSearch

https://sided.co/_next/static/chunks/6320-58bf7e745c16fed3.js

js sided.co collected 2026-09-24 19:33:57 UTC 11,227 bytes, 1 lines download raw bytes

1(self.webpackChunkwebapp=self.webpackChunkwebapp||[]).push([[6320],{364:function(e,t,l){"use strict";l.d(t,{A:function(){return r}});var s=l(1995),n=l(4335),o=l(3732),i=l(3950),d=l(1613),a=l(1243);function r(e){let{item:t,debatePath:l="",onHideItem:r,entityType:c,onRefresh:m}=e,{displayAlert:u,triggerReportItem:p,currentUserId:x,setSharedComment:k}=(0,o.useContext)(i.F);return(0,s.jsx)(a.A,{options:[{text:"Share",icon:(0,s.jsx)(d.li,{}),onClick:()=>{k({debatePath:l,...t})}},{text:"Hide",icon:(0,s.jsx)(d.WK,{}),onClick:()=>{r&&r(t.id),n.A.post("/".concat(c,"/hide"),{argumentId:t.id}).then(e=>{u(e.data.message)})}},{text:"Report",icon:(0,s.jsx)(d.cQ,{}),onClick:()=>p(t,c)},{text:"Delete",icon:(0,s.jsx)(d.US,{}),skip:!(parseInt(x)===parseInt(t.userId)||t.user&&parseInt(x)===t.user.id),onClick:()=>{confirm("Are you sure?")&&n.A.delete(void 0!==t.comments?"/argument/destroy?argumentId=".concat(t.id):"/comment/destroy?commentId=".concat(t.id)).then(e=>{let{data:t}=e;u(t.message),m&&m()})}}]})}},4962:function(e){e.exports={pollFeed:"poll-feed_pollFeed__VylTw",isContained:"poll-feed_isContained__hArXX",pollMessage:"poll-feed_pollMessage__Lqtah",pollFeedTitle:"poll-feed_pollFeedTitle__G_5G8",pollFeedItem:"poll-feed_pollFeedItem__aNjFQ",noPadding:"poll-feed_noPadding__SAj6U",noMargin:"poll-feed_noMargin__iVKNs",pollFeedLine:"poll-feed_pollFeedLine__oeyKW",pollFeedSorter:"poll-feed_pollFeedSorter__SRyAO",pollFeedItemTop:"poll-feed_pollFeedItemTop__nwsgE",pollFeedItemTitle:"poll-feed_pollFeedItemTitle__cnm_x",pollFeedItemText:"poll-feed_pollFeedItemText__pppTe",pollFeedItemBottom:"poll-feed_pollFeedItemBottom__8RLdc",pollFeedItemLike:"poll-feed_pollFeedItemLike__Sb_D0",pollFeedItemDislike:"poll-feed_pollFeedItemDislike__OBGhD",pollFeedItemReply:"poll-feed_pollFeedItemReply__MVm51",pollFeedForm:"poll-feed_pollFeedForm__r6bFl",pollFeedFormButton:"poll-feed_pollFeedFormButton__6X3xq"}},5216:function(e,t,l){"use strict";l.d(t,{A:function(){return F}});var s=l(1995),n=l(4335),o=l(3732),i=l(3950),d=l(3218),a=l(1613),r=l(8908),c=l(7042),m=l(9677),u=l.n(m),p=l(865),x=l(76),k=l(364),h=l(4962),f=l.n(h),g=l(7626);function j(e){let{item:t,comments:l=[],mainPollObject:d=null,initialReplies:a}=e,{mutate:r}=(0,g.iX)(),[c,m]=(0,o.useState)(a?[...a].reverse():[]),[u,p]=(0,o.useState)(1),{data:k}=(0,g.Ay)("/comment?argumentId=".concat(t.id,"&perPage=100&pageNumber=1"),x.GO,{fallbackData:(null==a?void 0:a.length)?{data:a}:void 0}),{trackEvent:h}=(0,o.useContext)(i.F);(0,o.useEffect)(()=>{(null==k?void 0:k.data)&&m([...k.data].reverse())},[k]);let f=(e,t)=>{"like"===e?(t.isLiked=!t.isLiked,t.isLiked?t.likesCount=t.likesCount+1:t.likesCount=t.likesCount-1,t.isDisliked&&(t.isDisliked=!1,t.dislikesCount=t.dislikesCount-1)):(t.isDisliked=!t.isDisliked,t.isDisliked?t.dislikesCount=t.dislikesCount+1:t.dislikesCount=t.dislikesCount-1,t.isLiked&&(t.isLiked=!1,t.likesCount=t.likesCount-1)),c[c.findIndex(e=>{let{id:l}=e;return t.id===l})]=t,m(c),p(2*u),n.A.post("/comment/like",{type:e,debateId:t.debateId,commentId:t.id}),h("like_comment",{debateId:t.debateId,commentId:t.id})};return(0,s.jsx)(_,{items:c,comments:l,feedVersion:u,mainPollObject:d,onLike:e=>f("like",e),onDislike:e=>f("dislike",e),onRefresh:()=>r("/comment?argumentId=".concat(t.id,"&perPage=100&pageNumber=1"))})}function _(e){let{items:t=[],comments:l=[],mainPollObject:m=null,initialReplies:h={},onLike:g,onDislike:_,onRefresh:F}=e,I=(0,p.useRouter)(),[b,C]=(0,o.useState)(""),[v,y]=(0,o.useState)(!1),[S,N]=(0,o.useState)([]),[A,T]=(0,o.useState)(0),[L,D]=(0,o.useState)(!1),[R,w]=(0,o.useState)([]),[M,O]=(0,o.useState)([]),[P,E]=(0,o.useState)(1),{currentUser:q,setShowAuthModal:B,trackEvent:z}=(0,o.useContext)(i.F);return(0,o.useEffect)(()=>{if(I.query.comment){let e=document.querySelector('[data-commentid="'.concat(I.query.comment,'"]'));e&&(window.scrollTo(0,e.offsetTop-90),e.setAttribute("data-highlighted","yes"))}},[t,I.query]),(0,s.jsx)(s.Fragment,{children:t.filter(e=>-1===M.indexOf(e.id)&&(!e.deletedAt||e.deletedAt&&e.comments&&e.comments.length)).map(e=>{var t,o,i,p;let I=e.side,M=void 0!==e.commentsCount;if(!I){let t=l.find(t=>{let{userId:l}=t;return l===e.userId});t&&(I=t.side)}return(0,s.jsxs)("div",{className:"".concat(f().pollFeedItem," ").concat(M?"argument":"comment","-item"),"data-commentid":e.id,children:[(0,s.jsx)("div",{className:f().pollFeedLine,onClick:()=>
1w([e.id].concat(R))}),(0,s.jsx)(c.A,{user:e.user,size:d.Sp.S}),(0,s.jsxs)("div",{className:f().pollFeedItemTop,children:[e.debate?(0,s.jsx)("div",{className:f().pollFeedItemTitle,children:(0,s.jsx)(u(),{href:"/".concat(null===(t=e.debate.user)||void 0===t?void 0:t.username,"/").concat(e.debate.slug,"?comment=").concat(e.id),children:e.debate.thesis})}):null,e.user?(0,s.jsx)("strong",{children:(0,s.jsx)(u(),{href:"/".concat(e.user.username),children:e.user.username})}):(0,s.jsx)("strong",{children:"[deleted user]"}),I?(0,s.jsxs)(s.Fragment,{children:["\xa0voted\xa0",(0,s.jsxs)("strong",{children:[(0,s.jsx)(a.cf,{color:I.sideColor}),I.text]})]}):null,"\xa0•\xa0",(0,x.PK)(e.createdAt)]}),-1!==R.indexOf(e.id)?(0,s.jsx)("button",{className:"action-button size-xxs fw-normal bordered",onClick:()=>w(R.filter(t=>t!==e.id)),children:"Expand"}):(0,s.jsxs)(s.Fragment,{children:[e.debate?(0,s.jsx)(u(),{href:"/".concat(null===(o=e.debate.user)||void 0===o?void 0:o.username,"/").concat(e.debate.slug,"?comment=").concat(e.id),className:f().pollFeedItemText,dangerouslySetInnerHTML:{__html:e.deletedAt?'<span style="opacity: 0.5;">[comment deleted]</span>':(e.text||"").replaceAll("\n","<br/>")}}):(0,s.jsx)("div",{className:f().pollFeedItemText,dangerouslySetInnerHTML:{__html:e.deletedAt?'<span style="opacity: 0.5;">[comment deleted]</span>':(e.text||"").replaceAll("\n","<br/>")}}),(0,s.jsxs)("div",{className:f().pollFeedItemBottom,children:[(0,s.jsxs)("span",{className:f().pollFeedItemLike,onClick:()=>{q?g(e):B(!0)},children:[e.isLiked?(0,s.jsx)(a.Rx,{}):(0,s.jsx)(a.$U,{}),e.likesCount?(0,s.jsx)("span",{children:e.likesCount}):null]}),(0,s.jsxs)("span",{className:f().pollFeedItemDislike,onClick:()=>{q?_(e):B(!0)},children:[e.isDisliked?(0,s.jsx)(a.Rx,{}):(0,s.jsx)(a.$U,{}),e.dislikesCount?(0,s.jsx)("span",{children:e.dislikesCount}):null]}),(0,s.jsxs)("span",{className:"".concat(f().pollFeedItemReply," ").concat(M?"argument":"comment","-reply"),onClick:t=>{M?(T(A?0:e.id),q||B(!0)):t.target.closest(".argument-item").querySelector(".argument-reply").click()},children:[(0,s.jsx)(a.Tw,{}),"Reply"]}),(0,s.jsx)(k.A,{item:e,debatePath:e.debate?"".concat(null===(i=e.debate.user)||void 0===i?void 0:i.username,"/").concat(e.debate.slug):m?"".concat(m.user.username,"/").concat(m.slug):"",onHideItem:e=>O([e]),onRefresh:()=>{F&&F()},entityType:e.comments?d.nP.ARGUMENT:d.nP.COMMENT})]}),e.comments&&e.comments.length||L||(null===(p=h[e.id])||void 0===p?void 0:p.length)?(0,s.jsx)(j,{item:e,comments:l,initialReplies:h[e.id]},P):null,e.comments&&q&&e.id===A?(0,s.jsxs)("div",{className:"".concat(f().pollFeedItem," ").concat(f().pollFeedForm),children:[(0,s.jsx)(c.A,{user:q,size:d.Sp.S}),(0,s.jsxs)("form",{onSubmit:t=>{t.preventDefault(),y(!0),N([]),n.A.post("/comment/create",{comment:b,argumentId:A}).then(()=>{C(""),y(!1),T(0),E(2*P),D(!0),z("create_comment",{debateId:e.debateId}),r.A.trackEvent("create_comment")}).catch(e=>{let t=e.response;y(!1),t&&N(t.data.message)})},children:[(0,s.jsx)("textarea",{placeholder:"Write a comment...",value:b,onChange:e=>{let t=e.target;C(t.value)}}),(0,s.jsxs)("div",{className:f().pollFeedFormButton,children:[(0,s.jsx)("button",{type:"button",className:"action-button bordered grayed fw-normal size-xxs",onClick:()=>T(0),children:"Cancel"}),(0,s.jsx)("button",{className:"action-button fw-normal size-xxs",disabled:v,children:"Post"})]}),S.map((e,t)=>(0,s.jsx)("div",{className:"form-error",children:Object.values(e)[0]},"".concat(e,"_").concat(t)))]})]}):null]})]},e.id)})})}function F(e){let{poll:t,items:l=[],onlyListing:m=!1,mainPollObject:u=null,showCommentBox:p=!0,initialReplies:x={},onUpdateItems:k,onRefresh:h}=e,[g,j]=(0,o.useState)(""),[F,I]=(0,o.useState)([]),[b,C]=(0,o.useState)(!1),[v,y]=(0,o.useState)(1),{currentUser:S,setShowAuthModal:N,trackEvent:A}=(0,o.useContext)(i.F),T=()=>t&&t.votedSideId?t.sides.find(e=>e.id===t.votedSideId):null,L=()=>{let e=T();return e?e.id:0},D=(e,t)=>{"like"===e?(t.isLiked=!t.isLiked,t.isLiked?t.likesCount=t.likesCount+1:t.likesCount=t.likesCount-1,t.isDisliked&&(t.isDisliked=!1,t.dislikesCount=t.dislikesCount-1)):(t.isDisliked=!t.isDisliked,t.isDisliked?t.dislikesCount=t.dislikesCount+1:t.dislikesCount=t.dislikesCount-1,t.isLiked&&(t.isLiked=!1,t.likesCount=t.likesCount-1)),l[l.findIndex(e=>{let{id:l}=e;return t.id===l})]=t,k(l),y(2*v),n.A.post("/argument/like",{type:e,debateId:t.debateId,argumentId:t.id}),A("like_argument",{debateId:t.debateId,argumentId:t.id})};return(0,s.jsxs)("div",{className:f().pollFeed,children:[m?null:(0,s.jsx)("div",{className:f().pollFeedTitle,children:(()=>{let e=t?t.comments+t.arguments:0;return"".concat(e," comment").concat(1===e?"":"s")})()}),!m&&t?(0,s.jsx)(s.Fragment,{children:t.isClosed?(0,s.jsx)("div",{className:f().pollMessage,children:"This poll has closed"}):(0,s.jsxs)("div",{className:"".concat(f().pollFeedItem," ").concat(f().pollFeedForm),children:[(0,s.jsx)(c.A,{user:S,size:d.Sp.S}),T()?(0,s.jsxs)("div",{className:f().pollFeedItemTop,children:[(0,s.jsx)("strong",{children:"you"}),"\xa0voted\xa0",(0,s.jsxs)("strong",{children:[(0,s.jsx)(a.cf,{color:(()=>{let e=T();return e?e.sideColor:""})()}),(()=>{let e=T();return e?e.text:""})()]})]}):null,p?(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g.trim().length&&(S?(C(!0),I([]),n.A.post("/argument/create",{argument:g,debateId:t?t.id:0,side:L()}).then(e=>{j(""),C(!1),h&&h(),A("create_argument",{debateId:t.id}),r.A.trackEvent("create_argument")}).catch(e=>{let t=e.response;C(!1),t&&I(t.data.message)})):N(!0))},children:[(0,s.jsx)("textarea",{placeholder:"Leave a comment",value:g,onChange:e=>{let t=e.target;j(t.value)}}),(0,s.jsx)("div",{className:f().pollFeedFormButton,children:(0,s.jsx)("button",{className:"action-button fw-normal ".concat(g.trim().length?"":"bordered grayed"),disabled:b,children:"Comment"})}),F.map((e,t)=>(0,s.jsx)("div",{className:"form-error",children:Object.values(e)[0].replace("You can only leave one reason per debate","You can only leave one comment per poll. Feel free to reply to other comments")},"".concat(e,"_").concat(t)))]}):(0,s.jsx)(s.Fragment,{})]})}):null,null,(0,s.jsx)(_,{items:l,comments:l,feedVersion:v,mainPollObject:u,initialReplies:x,onLike:e=>D("like",e),onDislike:e=>D("dislike",e),onRefresh:()=>{h&&h()}})]})}},9905:function(e,t,l){"use strict";l.d(t,{A:function(){return o}});var s=l(1995),n=l(3732);function o(e){let{pages:t,setNewPages:l}=e,o=(0,n.useRef)(null);return(0,n.useEffect)(()=>
1{if(o){let e=new IntersectionObserver(e=>{if(e[0].isIntersecting&&o&&o.current){let e=o.current.querySelector("span");e&&e.click()}},{threshold:1,rootMargin:"1000px"});e.observe(o.current)}},[o]),(0,s.jsx)("div",{ref:o,className:"load-more-trigger",children:(0,s.jsx)("span",{onClick:()=>{if(t.length){let e=Object.assign([],t);e.push(Math.max(...e)+1),l(e)}else l([1])}})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.