1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95019],{27483:(e,r,t)=>{t.d(r,{N:()=>i,Q:()=>n});var a=t(95155);t(12115);var l=t(1213),o=t(85472);function n(e){var r;let{children:t,fallback:n=null,redirectToLogin:i=!0}=e,c=(0,l.d4)(e=>{var r;return null==(r=e.auth)?void 0:r.isAuthenticated});(0,o.Zp)();let s=null==(r=window.location)?void 0:r.pathname;if(c)return(0,a.jsx)(a.Fragment,{children:t});if(n)return(0,a.jsx)(a.Fragment,{children:n});if(i){let e=encodeURIComponent(s||"/");return(0,a.jsxs)("div",{className:"rounded-xl bg-gray-100 dark:bg-white/10 p-6 text-center",children:[(0,a.jsx)("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:"Sign in to continue."}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)(o.N_,{to:"/login?returnUrl=".concat(e),className:"px-4 py-2 rounded-lg bg-primary text-white font-medium hover:bg-primary-dark",children:"Log in"}),(0,a.jsx)(o.N_,{to:"/register?returnUrl=".concat(e),className:"px-4 py-2 rounded-lg border border-gray-300 dark:border-white/20 text-gray-700 dark:text-gray-200 font-medium hover:bg-gray-100 dark:hover:bg-white/10",children:"Sign up"})]})]})}return null}function i(){let e=(0,l.d4)(e=>{var r;return null==(r=e.auth)?void 0:r.isAuthenticated}),r=(0,o.Zp)();return{requireAuth:function(){var t;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0],e)return!0;let a=encodeURIComponent((null==(t=window.location)?void 0:t.pathname)||"/");return r("/login?returnUrl=".concat(a)),!1},isAuthenticated:e}}},95019:(e,r,t)=>{t.d(r,{Ay:()=>h,nM:()=>p,x1:()=>g});var a=t(95155),l=t(12115),o=t(1213),n=t(25276),i=t(24033),c=t(65229),s=t(6191),u=t(98589),d=t(27483),y=t(75662);let p=[{type:"like",emoji:"\uD83D\uDC4D",label:"Like",labelKey:"like",colour:"text-primary"},{type:"love",emoji:"â¤ï¸",label:"Love",labelKey:"love",colour:"text-rose-500"},{type:"haha",emoji:"\uD83D\uDE06",label:"Haha",labelKey:"haha",colour:"text-yellow-500"},{type:"wow",emoji:"\uD83D\uDE2E",label:"Wow",labelKey:"wow",colour:"text-yellow-500"},{type:"sad",emoji:"\uD83D\uDE22",label:"Sad",labelKey:"sad",colour:"text-yellow-500"},{type:"angry",emoji:"\uD83D\uDE21",label:"Angry",labelKey:"angry",colour:"text-orange-500"},{type:"care",emoji:"\uD83E\uDD70",label:"Care",labelKey:"care",colour:"text-rose-400"},{type:"heart_eyes",emoji:"\uD83D\uDE0D",label:"Adore",labelKey:"adore",colour:"text-rose-500"},{type:"starstruck",emoji:"\uD83E\uDD29",label:"Star-struck",labelKey:"starstruck",colour:"text-yellow-500"},{type:"kiss",emoji:"\uD83D\uDE18",label:"Kiss",labelKey:"kiss",colour:"text-pink-500"},{type:"joy",emoji:"\uD83D\uDE02",label:"Joy",labelKey:"joy",colour:"text-yellow-500"},{type:"rofl",emoji:"\uD83E\uDD23",label:"ROFL",labelKey:"rofl",colour:"text-yellow-500"},{type:"fire",emoji:"\uD83D\uDD25",label:"Fire",labelKey:"fire",colour:"text-orange-500"},{type:"hundred",emoji:"\uD83D\uDCAF",label:"Hundred",labelKey:"hundred",colour:"text-red-500"},{type:"party",emoji:"\uD83C\uDF89",label:"Party",labelKey:"party",colour:"text-pink-500"},{type:"clap",emoji:"\uD83D\uDC4F",label:"Clap",labelKey:"clap",colour:"text-amber-500"},{type:"praise",emoji:"\uD83D\uDE4C",label:"Praise",labelKey:"praise",colour:"text-amber-500"},{type:"muscle",emoji:"\uD83D\uDCAA",label:"Strong",labelKey:"strong",colour:"text-amber-600"},{type:"cool",emoji:"\uD83D\uDE0E",label:"Cool",labelKey:"cool",colour:"text-primary"},{type:"thinking",emoji:"\uD83E\uDD14",label:"Hmm",labelKey:"hmm",colour:"text-yellow-600"},{type:"eye_roll",emoji:"\uD83D\uDE44",label:"Eye-roll",labelKey:"eyeRoll",colour:"text-gray-500"},{type:"mind_blown",emoji:"\uD83E\uDD2F",label:"Mind blown",labelKey:"mindBlown",colour:"text-yellow-500"},{type:"pleading",emoji:"\uD83E\uDD7A",label:"Pleading",labelKey:"pleading",colour:"text-rose-400"},{type:"handshake",emoji:"\uD83E\uDD1D",label:"Agree",labelKey:"agree",colour:"text-amber-700"}],m=p.slice(0,6),b=p.slice(6),g=Object.fromEntries(p.map(e=>[e.type,e])),h=e=>{let{targetType:r="post",targetId:t,postId:p,isLiked:h=!1,userReactionType:x=null,variant:k="bar",count:f=null}=e,j=(0,o.wA)(),{t:w}=(0,y.Bd)(),{user:v}=(0,o.d4)(e=>e.auth),{requireAuth:K}=(0,d.N)(),N=r||"post",C=t||p,T=(0,o.d4)(e=>{let r=(0,u.yO)(e,N,C,null==v?void 0:v.id);return r||("post"===N?(0,u.rP)(e,C,null==v?void 0:v.id):null)})||x||(h?"like":null),A=!!T,S=g[T]||g.like,[I,M]=(0,l.useState)(!1),[R,_]=(0,l.useState)(!1),E=(0,l.useRef)(null),P=(0,l.useRef)(null),L=(0,l.useRef)(!1),B=(0,l.useRef)(!1);(0,l.useEffect)(()=>()=>{E.current&&clearTimeout(E.current),P.current&&clearTimeout(P.current),z.current&&clearTimeout(z.current)},[]);let F=(0,l.useCallback)(()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),U=(0,l.useCallback)(()=>{F(),E.current=setTimeout(()=>{M(!1),_(!1)},200)},[F]),Q=(0,l.useCallback)(async e=>{if(!K()||!C||B.current)return;B.current=!0;let r=(null==v?void 0:v.id)||"guest";T===e?j((0,u.S9)({postId:C,targetType:N,targetId:C,userId:r})):j((0,u.mQ)({postId:C,targetType:N,targetId:C,userId:r,type:e})),M(!1),_(!1);try{await j((0,u.Qw)({postId:"post"===N?C:void 0,targetType:N,targetId:C,reactionType:e})).unwrap()}catch(e){T?j((0,u.mQ)({postId:C,targetType:N,targetId:C,userId:r,type:T})):j((0,u.S9)({postId:C,targetType:N,targetId:C,userId:r}))}finally{B.current=!1}},[T,j,K,C,N,null==v?void 0:v.id]),H=(0,l.useCallback)(()=>
1{if(L.current){L.current=!1;return}A?Q(T):Q("like")},[Q,T,A]),O=(0,l.useCallback)(()=>{L.current=!1,P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{L.current=!0,M(!0)},350)},[]),Z=(0,l.useCallback)(()=>{P.current&&(clearTimeout(P.current),P.current=null)},[]),q=(0,l.useCallback)(()=>{F(),M(e=>!e)},[F]),z=(0,l.useRef)(null),J=(0,l.useCallback)(()=>{F(),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>M(!0),350)},[F]),W=(0,l.useCallback)(()=>{z.current&&(clearTimeout(z.current),z.current=null),U()},[U]),D="icon"===k,G="count"===k,V=D||G;return(0,a.jsxs)("div",{className:"relative flex items-center ".concat(V?"":"flex-1"),onMouseEnter:J,onMouseLeave:W,children:[(0,a.jsxs)("button",{type:"button",onClick:H,onTouchStart:O,onTouchEnd:Z,onTouchCancel:Z,className:D?"w-9 h-9 grid place-items-center rounded-full transition-colors ".concat(A?"bg-primary text-white":"bg-gray-100 dark:bg-white/10 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/20"):G?"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-colors hover:bg-gray-100 dark:hover:bg-white/10 ".concat(A?S.colour:"text-[#65676B] dark:text-[#B0B3B8]"):"flex-1 flex items-center justify-center gap-1.5 py-1.5 pl-2 pr-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-l-md transition-colors ".concat(A?S.colour:"text-gray-600 dark:text-gray-300"),"aria-pressed":A,"aria-label":A?w("post.reactions.reactedAria","{{label}} â tap to remove",{label:w("post.reactions.".concat(S.labelKey),S.label)}):w("common.like"),children:[A?(0,a.jsx)("span",{className:G?"text-[19px] leading-none":"text-lg leading-none","aria-hidden":"true",children:S.emoji}):(0,a.jsx)(n.A,{className:V?"w-5 h-5":"w-5 h-5 text-gray-600 dark:text-gray-300"}),G&&(0,a.jsx)("span",{className:"text-[15px] font-medium tabular-nums",children:null!=f?f:0}),!V&&(0,a.jsx)("span",{className:"font-medium",children:A?w("post.reactions.".concat(S.labelKey),S.label):w("common.like")})]}),!V&&(0,a.jsx)("button",{type:"button",onClick:q,className:"px-1.5 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-r-md transition-colors text-gray-500 dark:text-gray-400 ".concat(I?"bg-gray-100 dark:bg-gray-800":""),"aria-label":w("post.reactions.more","More reactions"),"aria-haspopup":"menu","aria-expanded":I,title:w("post.reactions.more","More reactions"),children:(0,a.jsx)(i.A,{className:"w-3.5 h-3.5"})}),I&&(0,a.jsxs)("div",{role:"menu","aria-label":w("post.reactions.pickAria","Pick a reaction"),onMouseEnter:F,onMouseLeave:U,className:"absolute bottom-full left-0 mb-2 z-30 px-2 py-1.5 bg-white dark:bg-gray-900 shadow-xl ring-1 ring-black/5 dark:ring-white/10 ".concat(R?"rounded-2xl":"rounded-full"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[m.map(e=>{let r=T===e.type,t=w("post.reactions.".concat(e.labelKey),e.label);return(0,a.jsx)("button",{type:"button",role:"menuitemradio",title:t,"aria-label":t,"aria-checked":r,onClick:r=>{r.stopPropagation(),Q(e.type)},className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center text-2xl transition-transform duration-150 hover:rotate-3 hover:-translate-y-0.5 hover:scale-110 focus:outline-none focus:ring-2 focus:ring-primary ".concat(r?"bg-primary/10 dark:bg-primary-dark/30":""),children:(0,a.jsx)("span",{"aria-hidden":"true",children:e.emoji})},e.type)}),(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),_(e=>!e)},"aria-label":R?w("post.reactions.showFewer","Show fewer reactions"):w("post.reactions.showMore","Show more reactions"),"aria-expanded":R,title:R?w("post.reactions.showFewerShort","Show fewer"):w("post.reactions.more","More reactions"),className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-primary ".concat(R?"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-200":"bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"),children:R?(0,a.jsx)(c.A,{className:"w-4 h-4"}):(0,a.jsx)(s.A,{className:"w-4 h-4"})})]}),R&&(0,a.jsx)("div",{className:"grid grid-cols-6 gap-1 mt-1.5 pt-1.5 border-t border-gray-100 dark:border-gray-700/50 w-full place-items-center",children:b.map(e=>{let r=T===e.type,t=w("post.reactions.".concat(e.labelKey),e.label);return(0,a.jsx)("button",{type:"button",role:"menuitemradio",title:t,"aria-label":t,"aria-checked":r,onClick:r=>{r.stopPropagation(),Q(e.type)},className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center text-2xl transition-transform duration-150 hover:rotate-3 hover:-translate-y-0.5 hover:scale-110 focus:outline-none focus:ring-2 focus:ring-primary ".concat(r?"bg-primary/10 dark:bg-primary-dark/30":""),children:(0,a.jsx)("span",{"aria-hidden":"true",children:e.emoji})},e.type)})})]})]})}}}]);
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.