1"use strict";(self.webpackChunksocialUX=self.webpackChunksocialUX||[]).push([[5604],{6864:function(t,n,e){e.d(n,{U5:function(){return c},Vy:function(){return u},h1:function(){return i}});var o=e(298);function s(t){return t?`?voter_id=${t}`:""}function i(t,n,e){return(0,o.mQ)(function(t,n,e){return`/core/v1.1/sites/${t}/posts/${n}/poll${e=s(e)}`}(t,n,e))}function u(t,n,e,i){return(0,o.af)(function(t,n,e){return`/core/v1.1/sites/${t}/posts/${n}/poll/votes${e=s(e)}`}(t,n,e),"POST",i)}function c(t){return(0,o.mQ)(`/core/v1/polls/post:${t}:comments:reviews`)}},5604:function(t,n,e){e.r(n),e.d(n,{default:function(){return B}});var o=e(3964),s=e(6864);const i={down:'<path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/>',up:'<path d="M7 14l5-5 5 5z"/><path d="M0 0h24v24H0z" fill="none"/>'};function u(t){return`<button class="vote-${t}">\n <div class="vote-container">\n <svg class="icon-arrow_drop_${t}" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n ${i[t]}\n </svg>\n <div class="number-container">\n <div class="number"></div>\n <div class="votes">Votes</div>\n </div>\n </div>\n</button>`}const c="updownvoting::results",r="RM-poll",d={positive:1,negative:0},a={positive:0,negative:1};function l(){const t=localStorage.getItem(r);return t?JSON.parse(t).voter_id:null}function p(t){t.classList.add("disabled"),t.disabled=!0}function v(t){t.classList.remove("disabled"),t.disabled=!1}const f=(0,o.A)((function(t,n){const{poll:e,vote:o}=n.detail;t.vote=o,function({reactions:t},{particleId:n,upNumbers:e,downNumbers:o}){const{positive:s={total:0,count:0},negative:i={total:0,count:0}}=t[n]||{};e.textContent=`${s.total}`,o.textContent=`${i.total}`}(e,t),function({reactions:t},{particleId:n,upButton:e,downButton:o}){const{positive:s=0,negative:i=0}=t[n]||{};(s||i)&&(p(e),p(o),(s?e:o).classList.add("voted"))}(o,t)})),w=(0,o.A)((function({upButton:t,downButton:n,postContextElement:e},o){var s;s=o.vote.voter_id,localStorage.setItem(r,JSON.stringify({voter_id:s})),e.dispatchEvent(new CustomEvent(c,{detail:o}))})),m=(0,o.A)((function({upButton:t,downButton:n},e){v(t),v(n)})),h=(0,o.A)((function(t,n,e){const o={reactions:{...t.vote.reactions,[t.particleId]:n},payload:{}};p(t.upButton),p(t.downButton),(0,s.Vy)(t.siteId,t.postId,l(),o).then(w(t)).catch(m(t))})),I={},b=(0,o.A)((function({postId:t,postContextElement:n},e){I[t]=!1,n.dispatchEvent(new CustomEvent(c,{detail:e}))})),g=(0,o.A)((function({postId:t},n){I[t]=!1})),$=".up_down_voting--wrp";function B(t,n){const e=n.querySelector($);if(!e)return;e.innerHTML=`<div class="vote--up_down">\n ${u("down")}\n ${u("up")}\n</div>`;const o=function(t,n){const e=n.querySelector(".vote-up"),o=n.querySelector(".vote-down"),s=n.dataset.postId;return{particle:n,upButton:e,downButton:o,postId:s,vote:{},siteId:t.settings.site.id,particleId:n.dataset.id,postContextElement:document.querySelector(`#post-context-${s}`),upNumbers:e.querySelector(".number"),downNumbers:o.querySelector(".number")}}(t,n);o.postContextElement.addEventListener(c,f(o)),o.upButton.addEventListener("click",h(o,d)),o.downButton.addEventListener("click",h(o,a)),function(t){I[t.postId]||(I[t.postId]=!0,(0,s.h1)(t.siteId,t.postId,l()).then(b(t)).catch(g(t)))}(o)}}}]); 2//# sourceMappingURL=5604.8020a58be1cc7b373ec9.bundle.mjs.map
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.