1"use strict";(self.webpackChunksocialUX=self.webpackChunksocialUX||[]).push([[8482],{1759:function(t,e,n){const i=(0,n(3964).A)(((t,e)=>{if("object"==typeof e)return(Array.isArray(t)?t:[t]).reduce(((t,e)=>t&&t[e]?t[e]:void 0),e)}));e.A=i},1364:function(t,e,n){n.d(e,{A:function(){return s}});var i=n(298),o=n(1443);function c(t){return{message:"Success! Look out for an email to confirm your subscription.",response:t}}function s(t,e,n){const s=(0,o.p)({email:e},{email:{validation:o.x,message:"Please enter a valid email address"}});if(s.length>0)return async function(t){for(const e of t)await Promise.reject({error:e});return Promise.resolve()}(s);const r={email:e,fields:n||{},site_id:t};return(0,i.af)("/core/users/subscribe_site/","POST",r).then(c)}},6864:function(t,e,n){n.d(e,{U5:function(){return r},Vy:function(){return s},h1:function(){return c}});var i=n(298);function o(t){return t?`?voter_id=${t}`:""}function c(t,e,n){return(0,i.mQ)(function(t,e,n){return`/core/v1.1/sites/${t}/posts/${e}/poll${n=o(n)}`}(t,e,n))}function s(t,e,n,c){return(0,i.af)(function(t,e,n){return`/core/v1.1/sites/${t}/posts/${e}/poll/votes${n=o(n)}`}(t,e,n),"POST",c)}function r(t){return(0,i.mQ)(`/core/v1/polls/post:${t}:comments:reviews`)}},1443:function(t,e,n){n.d(e,{p:function(){return o},x:function(){return s}});var i=n(1759);function o(t,e,n=!0){const o=[];return Object.keys(e).forEach((s=>{const r=t[s],l=(0,i.A)("message")(e[s])||e[s];((0,i.A)("validation")(e[s])||c(n))(r)||o.push(l)})),o}const c=t=>e=>!(t&&!e||null==e),s=t=>t&&/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())},8482:function(t,e,n){n.r(e),n.d(e,{default:function(){return nt}});var i={};n.r(i),n.d(i,{subscribe_email:function(){return w}});var o=n(367),c=n(3964),s=n(6864);const r="voting::vote-error",l="voting::vote-success",a="voting::clear-feedback",u="voting::display-results",d="voting::vote-again",f=(0,c.A)((function(t,e){const n=new CustomEvent(r,{detail:e});t.dispatchEvent(n)}));function v(t){t.dispatchEvent(new CustomEvent(a))}function p(t,e){return`listicle-voting-choice-${t}-${e}`}function m([t,e]){return` ${t}="${e}" `}function h(t){return Object.entries(t).map(m).join("")}function g(t){return`<input ${h(t)}/>`}function A({title:t,value:e}){return`<option value="${e}">${t}</option>`}function y({options:t,...e}){return`<select ${h(e)}>\n ${t.map(A).join("")}\n</select>`}function b(t){return{title:t,value:t}}const E={boolean:function(t,e){return delete e.type,g({...e,name:t,type:"checkbox"})},string:function(t,{format:e="text",...n}){const i=n.enum;return delete n.enum,Array.isArray(i)?y({name:t,options:i.map(b),...n}):g({...n,name:t,type:e})},array:function(t,{items:e,...n}){return y({...n,name:t,options:e.enum.map(b),multiple:!0})}};var S=n(4465);function x(t,e){return`post::${t}::poll::${e}`}function $(t){return function(t){if((0,S.x3)()){let e=localStorage.getItem(x(t,!0));if(e)return e}return localStorage.getItem(x(t,!1))}(t.dataset.postId)}var L=n(48),q=n(1364);function k(t){(0,L.A)(t.message,"success")}function O({error:t}){(0,L.A)(t,"error")}function w(t,e,n){const i=n.value;if(!i)return;const o=t.dataset.postId,c=e.settings.site.id,s=function(t){const e=document.querySelector(`span[data-elid="${t}"]`),{headline:n}=e.dataset;return{subscription_source:"polls",subscription_source_name:n}}(o);(0,q.A)(c,i,s).then(k).catch(O)}const C=(0,c.A)((function(t,[e,{description:n,...i}]){const o=E[i.type];return t.includes(e)&&(i.required=!0),i.placeholder=n,i.class="listicle-voting-extra-field-input",`<label class="listicle-voting-extra-field-label listicle-voting-extra-field-${e}">\n <div class="listicle-voting-extra-field-label-wrapper">\n <span class="listicle-voting-extra-field-caption">${n||""}</span>\n ${o(e,i)}\n </div>\n <span class="listicle-voting-input-error hidden"></span>\n</label>`}));function j(t,e){switch(e.type){case"radio":e.checked&&(t[e.name]=e.value);break;case"chechbox":t[e.name]=e.checked;break;default:t[e.name]=e.value}return t}function T(t){return t.value}function _(t,e){return t[e]={},t}function I(t,e){const n=Array.from(e.querySelectorAll("input.listicle-voting-input[type=radio]")).map(T).reduce(_,{});return n[t].positive=1,n}const P=(0,c.A)((function(t,e,n){const o=n.getAttribute("action");o in i&&i[o](t,e,n)}
1)),B=(0,c.A)((function(t,e,n,i,o){n.disabled=!1,i.querySelectorAll("input[action],select[action]").forEach(P(t,e)),t.dispatchEvent(new CustomEvent(l,{detail:{message:"Thank you for taking the time to complete this survey."}})),function(t,e){const n=t.dataset.postId;localStorage.setItem(x(n,(0,S.x3)()),e)}(t,o.vote.voter_id),i.classList.add("hidden"),t.dispatchEvent(new CustomEvent(u,{detail:o}))})),U=(0,c.A)((function(t,e,n){t.disabled=!1,e(n)}));function V(t){t.classList.add("hidden")}const M=(0,c.A)((function(t,e,n,i,o,c){if(c.preventDefault(),v(t),n.querySelectorAll(".listicle-voting-input-error").forEach(V),!n.checkValidity())return void o({message:"Please correct any required fields and submit again"});i.disabled=!0;const{listicleVotingChoice:r,...l}=function(t){return Array.from(t.querySelectorAll("input,select")).reduce(j,{})}(t),a={payload:l,reactions:I(r,t)},u=$(t);(0,s.Vy)(window.REBELMOUSE_BOOTSTRAP_DATA.runner.id,t.dataset.postId,u,a).then(B(t,e,i,c.target)).catch(U(i,o))})),R=(0,c.A)((function(t,e){t.classList.remove("hidden")}));function D(t){const e=(n=this).classList.contains("listicle-voting-extra-field-input")?n.closest(".listicle-voting-extra-field-label").querySelector(".listicle-voting-input-error"):n.closest("form.listicle-voting-form").querySelector(".listicle-voting-question-error-holder .listicle-voting-input-error");var n;e.classList.remove("hidden"),e.textContent="This question is required"}function z(t){t.addEventListener("invalid",D)}const H=(0,c.A)((function(t,[e,n]){const i=p(t,e);return`<div class="listicle-voting-choice-result">\n <label for="${i}">\n <span class="listicle-voting-choice-caption">${n||""}</span> -\n <span class="listicle-voting-choice-caption-total"></span> votes\n </label>\n <progress id="${i}"></progress>\n</div>`}));function J(t,[e,{positive:n}]){return t.total+=n.total,t.choices[e]=n.count,t}const N=(0,c.A)((function(t,e,[n,i]){const o=p(t,n),c=document.getElementById(o);c&&(c.setAttribute("max",e),c.setAttribute("value",i),c.textContent=i,c.closest(".listicle-voting-choice-result").querySelector(".listicle-voting-choice-caption-total").textContent=`(${i})`)})),Q=(0,c.A)((function(t,[e,n]){const i=p(t,e),o=document.getElementById(i);o&&o.classList.toggle("listicle-voting-choice-selected","positive"in n)}));function X(t,e,{poll:n,vote:i}){const{total:o,choices:c}=Object.entries(n.reactions).reduce(J,{total:0,choices:{}});Object.entries(c).forEach(N(t,o)),e.classList.remove("hidden"),i&&Object.entries(i.reactions).forEach(Q(t))}const Z=(0,c.A)(X),F=(0,c.A)((function(t,e,n){X(t,e,n.detail)})),G=(0,c.A)((function(t,e,n){e.classList.add("hidden"),t.dispatchEvent(new CustomEvent(d))})),K=(0,c.A)((function(t,e){e.classList.remove("hidden"),e.textContent=t})),W=(0,c.A)((function(t,e){t.forEach(K(e.detail.message||e.detail.error))}));function Y(t){t.classList.add("hidden")}const tt=(0,c.A)((function(t,e){t.forEach(Y)})),et=(0,o.A)((function({listicle:t,context:e}){const n=t.querySelector("form"),i=n.querySelector("button.listicle-item-voting-action-submit");return n.noValidate=!0,function(t){const e=t.querySelector(".listicle-item-voting-extrafields"),n=e.dataset.extraFields;try{!function(t,e){if(!("properties"in e))return;const n=e.required||[],i=Object.entries(e.properties).map(C(n)).join("");t.innerHTML=i}(e,JSON.parse(unescape(n)))}catch(t){console.log(t)}}(n),n.querySelectorAll("input,select").forEach(z),n.addEventListener("submit",M(t,e,n,i,f(t)),{capture:!0}),t.addEventListener(d,R(n)),$(t)&&(n.classList.add("hidden"),i.textContent="Update vote"),{listicle:t,context:e}}),(function({listicle:t,context:e}){const n=t.dataset.postId,i=t.querySelector(".listicle-item-voting-results-container"),o=t.querySelector(".listicle-item-voting-action-change");(function(t,e){const n=t.querySelector(".listicle-item-voting-results"),i=n.dataset.choices;try{!function(t,e,n){e.innerHTML=Object.entries(n).map(H(t)).join("")}(e,n,JSON.parse(unescape(i)))}catch(t){console.log(t)}})(t,n),t.addEventListener(u,F(n,i)),o.addEventListener("click",G(t,i));const c=$(t);return c&&(v(t),(0,s.h1)(window.REBELMOUSE_BOOTSTRAP_DATA.runner.id,n,c).then(
1Z(n,i)).catch(f(t))),{listicle:t,context:e}}),(function({listicle:t,context:e}){const n=t.querySelectorAll(".listicle-item-voting-feedback-error"),i=t.querySelectorAll(".listicle-item-voting-feedback-success");return t.addEventListener(r,W(n)),t.addEventListener(l,W(i)),t.addEventListener(a,tt([...n,...i])),{listicle:t,context:e}}));function nt(t,e){et({listicle:e,context:t})}}}]); 2//# sourceMappingURL=8482.a3a8fb9b326b9b6a6907.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.