1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[23156],{25608:(e,i,t)=>{t.r(i),t.d(i,{VideoRatingThumbs:()=>h,default:()=>m});var a=t(6029),n=t(75828),s=t.n(n),l=t(5700),r=t(55729),o=t(683),c=t(26898),d=t(86013),u=t(80523);let h=({videoId:e,darkMode:i=!0,className:t=""})=>{let n=(0,l.c)("common"),[h,m]=(0,r.useState)(null),[b,f]=(0,r.useState)(!1),[p,k]=(0,r.useState)(!1),{isReady:g,isAuthorized:y,signIn:N}=(0,c.A)();if((0,r.useEffect)(()=>{if(!e||!y)return;let i=(0,o.getActive)()?.id;i&&(async()=>{try{let t=await fetch(`/api/videoReaction/getReaction?videoId=${encodeURIComponent(e)}&portal=${i}`),a=await t.json();t.ok&&a.reaction&&m(a.reaction)}catch(e){console.error("[VideoRatingThumbs] load failed:",e)}})()},[e,y]),!e)return null;let T=async i=>{if(b)return;if(!g||!y)return void k(!0);let t=(0,o.getActive)()?.id;if(!t)return;let a=h===i?null:i;f(!0),m(a);try{let i=await fetch("/api/videoReaction/setReaction",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videoId:e,reaction:a,portal:t})});if(!i.ok){m(h);let e=await i.json().catch(()=>({}));console.error("[VideoRatingThumbs] set failed:",e.message||i.status)}}catch(e){m(h),console.error("[VideoRatingThumbs] set failed:",e)}finally{f(!1)}},v=e=>s()("inline-flex size-11 items-center justify-center rounded border transition-colors",i?"border-white/30 text-white hover:bg-white/10":"border-skin-primary-light text-skin-primary-ultradark hover:bg-skin-primary-ultralight",{"opacity-50":b},e&&(i?"bg-white/15":"bg-skin-primary-ultralight"));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:s()("flex items-center gap-3",t),children:[(0,a.jsx)("button",{type:"button","aria-label":n("RATING_THUMBS_LIKE"),"aria-pressed":"like"===h,onClick:()=>T("like"),disabled:b,className:v("like"===h),children:(0,a.jsx)(d.I,{iconName:"thumbUp",iconType:"like"===h?"fill":"outline",className:"size-5"})}),(0,a.jsx)("button",{type:"button","aria-label":n("RATING_THUMBS_DISLIKE"),"aria-pressed":"dislike"===h,onClick:()=>T("dislike"),disabled:b,className:v("dislike"===h),children:(0,a.jsx)(d.I,{iconName:"thumbDown",iconType:"dislike"===h?"fill":"outline",className:"size-5"})})]}),(0,a.jsx)(u.LoginConfirmationOverlay,{message:n("LOGIN_MESSAGE_RATE_VIDEO"),visible:p,onCancel:()=>k(!1),onProceed:()=>{k(!1),N()}})]})},m=h}}]);
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.