1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8487],{31075:(e,a,t)=>{t.r(a),t.d(a,{RatingThumbs:()=>d});var l=t(6029),i=t(75828),n=t.n(i),r=t(5700),c=t(80523),o=t(95502),s=t(86013);let d=({articleId:e,disabled:a=!1,compact:t=!1,initialCounts:i=null})=>{let n=(0,r.c)("common"),{selectedReaction:s,likeCount:d,showLoginOverlay:m,setShowLoginOverlay:p,toggleReaction:x,signIn:g}=(0,o.A)(e,i),b=[{id:"dislike",label:n("RATING_THUMBS_DISLIKE"),iconName:"thumbDown",apiValue:"dislike"},{id:"like",label:n("RATING_THUMBS_LIKE"),iconName:"thumbUp",apiValue:"like"}];return e?t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex flex-col items-center gap-3",children:b.slice().reverse().map(e=>(0,l.jsx)(u,{option:e,isSelected:s===e.apiValue,onClick:()=>x(e.apiValue,{disabled:a}),disabled:a,count:"like"===e.apiValue?d:null,compact:!0},e.id))}),(0,l.jsx)(c.LoginConfirmationOverlay,{title:n("LOGIN_OVERLAY_TITLE_RATE"),message:n("LOGIN_MESSAGE_RATE_ARTICLE"),visible:m,onCancel:()=>p(!1),onProceed:()=>{p(!1),g()}})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mb-4 md:mb-8",children:(0,l.jsxs)("div",{className:"flex w-full flex-col items-center gap-4 bg-skin-primary-ultralight/50 p-4",children:[(0,l.jsx)("div",{className:"text-base font-bold md:text-xl",children:n("RATING_THUMBS_HEADLINE")}),(0,l.jsx)("div",{className:"flex justify-center gap-4",children:b.map(e=>(0,l.jsx)(u,{option:e,isSelected:s===e.apiValue,onClick:()=>x(e.apiValue,{disabled:a}),disabled:a},e.id))})]})}),(0,l.jsx)(c.LoginConfirmationOverlay,{title:n("LOGIN_OVERLAY_TITLE_RATE"),message:n("LOGIN_MESSAGE_RATE_ARTICLE"),visible:m,onCancel:()=>p(!1),onProceed:()=>{p(!1),g()}})]}):null},u=({option:e,isSelected:a,onClick:t,disabled:i,compact:r=!1,count:c=null})=>{let o=a&&"like"===e.apiValue;return r?(0,l.jsxs)("button",{type:"button",onClick:t,disabled:i,className:n()({"flex flex-col items-center gap-0.5 cursor-pointer text-skin-primary-dark":!0,"cursor-not-allowed opacity-50":i}),"aria-label":`Bewertung: ${e.label}`,children:[(0,l.jsx)(s.I,{iconName:e.iconName,iconType:a?"fill":"outline",className:n()("size-6 md:size-7",{"text-green-600":o})}),null!==c&&(0,l.jsx)("span",{className:"text-xs font-bold",children:c})]}):(0,l.jsxs)("button",{type:"button",onClick:t,disabled:i,className:n()({"flex flex-col items-center gap-2 cursor-pointer w-24 text-skin-primary-ultradark":!0,"cursor-not-allowed opacity-50":i}),"aria-label":`Bewertung: ${e.label}`,children:[(0,l.jsx)(s.I,{iconName:e.iconName,iconType:a?"fill":"outline",className:n()("size-8",{"text-green-600":o})}),(0,l.jsx)("span",{className:"text-sm font-medium",children:e.label})]})}},95502:(e,a,t)=>{t.d(a,{A:()=>u});var l=t(683),i=t(55729),n=t(26898),r=t(7597),c=t(67756),o=t(89557),s=t(66677);let d=e=>e?(e.like||0)+(e.amazing||0):null,u=(e,a=null)=>{let[t,u]=(0,i.useState)(null),[m,p]=(0,i.useState)(d(a)),[x,g]=(0,i.useState)(!1),[b,f]=(0,i.useState)(!1),[k,N,E]=(0,r.A)(`users-reaction-${e}`,null),[h,y]=(0,r.A)(`reaction-cache:${e}`,null),{isReady:T,isAuthorized:v,signIn:A}=(0,n.A)(),_=async()=>{let a=(0,l.getActive)()?.id;if(a&&e)try{let t=await fetch(`/api/articleReaction/getReaction/?articleId=${encodeURIComponent(e)}&portal=${a}`),l=await t.json();t.ok&&(p(d(l.counts)),l.reaction&&u(l.reaction),y({r:l.reaction||null}))}catch(e){console.error("Error loading reaction data:",e)}},I=async a=>{let t=(0,l.getActive)()?.id;return t&&e?await fetch("/api/articleReaction/setReaction",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({articleId:e,reaction:a,portal:t})}):null};(0,i.useEffect)(()=>{e&&(h&&void 0!==h.r?u(h.r||null):_(),v&&k&&k.articleId===e&&k.reaction&&(async()=>{let e=await I(k.reaction);e?.ok&&(u(k.reaction),(0,c.trackPiwikEvent)("Engagement",k.reaction||"remove","rating"),(0,o.Qd)("rating"),(0,o.Mx)("reactionType",k.reaction||"remove"),_()),E()})())},[e,v]);let j=(a,t)=>{let l,i,n=(l="like"===a,i="like"===t,l&&!i?-1:!l&&i?1:0);p(e=>null===e?e:Math.max(0,e+n)),0!==n&&(0,s.C)(e,n)},R=async(a,{disabled:i=!1}={})=>{if(i||x||!e||!(0,l.getActive)()?.id)return;let n=t===a?null:a;if(T){g(!0),u(n),j(t,n);try{let e=await I(n);e?.ok?((0,c.trackPiwikEvent)("Engagement",n||"remove","rating"),(0,o.Qd)("rating"),(0,o.Mx)("reactionType",n||"remove"),y({r:n||null})):(u(t),j(n,t))}catch(e){u(t),j(n,t),console.error("Error setting reaction:",e)}finally{g(!1)}}};return{selectedReaction:t,likeCount:m,loading:x,showLoginOverlay:b,setShowLoginOverlay:f,toggleReaction:R,sign
1In:A,isReady:T,isAuthorized:v}}}}]);
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.