1import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./vendor-react-dom-Dhbt-8De.js";import{t as n}from"./compiler-runtime-BoX-B_G_.js";import{t as r}from"./jsx-runtime-DREnUpxT.js";import{o as i}from"./vendor-state-B9z2shp7.js";import{t as a}from"./store-l4sk3yXz.js";import{it as o,o as s}from"./auth-CyS1kZvR.js";import{t as c}from"./ui-DdDz6J-4.js";import{t as l}from"./Icon-DuuOujFl.js";import{t as u}from"./vendor-i18n-C4qFix9B.js";import{n as d}from"./gtmService-4_mi7dtE.js";import{t as f}from"./merge-props-BYWeYXIM.js";import{t as p}from"./Text-Cnw7bDvR.js";import{t as m}from"./date-utils-NsFSE4q7.js";import{r as h}from"./comments-CTDksQ5S.js";import{u as g}from"./posts-DoXCVLoq.js";import{i as _}from"./content-DJEnfMPT.js";import{a as v,r as y,t as b}from"./posts-BbKzK4xu.js";import{a as x,n as S,r as C}from"./reactions-VWGiJuQ4.js";var w=n(),T=e=>{let t=(0,w.c)(15),{postId:n,imageType:r}=e,a=r===void 0?`featured`:r,o;t[0]===n?o=t[1]:(o=g(n),t[0]=n,t[1]=o);let s=i(o),c;t[2]!==a||t[3]!==s?(c=s&&b(s,a),t[2]=a,t[3]=s,t[4]=c):c=t[4];let l=c,u;t[5]!==l||t[6]!==s?(u=s&&y(s,l),t[5]=l,t[6]=s,t[7]=u):u=t[7];let d=u,f;t[8]!==l||t[9]!==s?(f=s&&l?v(s,l):void 0,t[8]=l,t[9]=s,t[10]=f):f=t[10];let p=f,m=s?s[`${l}ImageMetadata`]:void 0,h;return t[11]!==m||t[12]!==d||t[13]!==p?(h={url:d,imageMetadata:m,smartFrame:p},t[11]=m,t[12]=d,t[13]=p,t[14]=h):h=t[14],h},E=e(t(),1),D=r(),O=(0,E.memo)(e=>{let t=(0,w.c)(24),{isActive:n,isDisabled:r,className:i,"data-testid":a,"data-test-id":o}=e,s=i===void 0?``:i,u;t[0]!==s||t[1]!==n||t[2]!==r?(u=function(){let e=`transition cursor-pointer space-x-1 flex items-center`;return n&&(e=`transition cursor-pointer space-x-1 flex items-center text-primary-500 dark:text-primary-500 hover:text-primary-500 dark:hover:text-primary-500`),r&&(e+=` opacity-50 cursor-not-allowed`),c(e,s)},t[0]=s,t[1]=n,t[2]=r,t[3]=u):u=t[3];let d=u,m;t[4]!==r||t[5]!==e?(m=function(t){!r&&e.onClick&&e.onClick(t)},t[4]=r,t[5]=e,t[6]=m):m=t[6];let h=m,g;t[7]===e?g=t[8]:(g=function(){let{labelProps:t,label:n}=e,r=t===void 0?{}:t;if(!n)return null;let i=f({className:`select-none`},r);return(0,D.jsx)(p,{...i,children:n})},t[7]=e,t[8]=g);let _=g,v;t[9]===e?v=t[10]:(v=function(){let{iconProps:t,iconName:n}=e,r=t===void 0?{}:t;if(!n)return null;let i=f({className:``},r);return(0,D.jsx)(l,{...i,name:n})},t[9]=e,t[10]=v);let y=v,b;t[11]===d?b=t[12]:(b=d(),t[11]=d,t[12]=b);let x;t[13]===y?x=t[14]:(x=y(),t[13]=y,t[14]=x);let S;t[15]===_?S=t[16]:(S=_(),t[15]=_,t[16]=S);let C;return t[17]!==o||t[18]!==h||t[19]!==b||t[20]!==x||t[21]!==S||t[22]!==a?(C=(0,D.jsxs)(`div`,{className:b,onClick:h,"data-testid":a,"data-test-id":o,children:[x,S]}),t[17]=o,t[18]=h,t[19]=b,t[20]=x,t[21]=S,t[22]=a,t[23]=C):C=t[23],C});function k(e){let t=(0,w.c)(9),{entityId:n,entityType:r}=e,a=s(),o;bb0:{if(!a){o=void 0;break bb0}let e;t[0]!==n||t[1]!==r||t[2]!==a?(e=x(a,r,n),t[0]=n,t[1]=r,t[2]=a,t[3]=e):e=t[3],o=e}let c=o,l;t[4]===c?l=t[5]:(l=C(c),t[4]=c,t[5]=l);let u=i(l),d=u?.reactionName||``,f;return t[6]!==u||t[7]!==d?(f={myReaction:u,myReactionName:d},t[6]=u,t[7]=d,t[8]=f):f=t[8],f}function A(e){return a().get(h)[e]}function j(e){let t=A(e);return t?[o.DELETED_BY_CATEGORY_ADMIN,o.DELETED_BY_PUBLISHER,o.DELETED_BY_DOMAIN_ADMIN,o.DELETED_BY_TOKEN_ADMIN].includes(t?.status):!1}var M=e=>{let t=A(e);if(!t)throw Error(`[comments/analytics] comment with id ${e} not found`);let{postId:n,publisherName:r,publisherProfileName:i,createdAt:a,tokenName:o}=t;return{postId:n,tokenName:o,commenterId:r,commenter:i||r,originalPublishDate:m(a).toISOString()}},N=e=>{let t=_(e);if(!t)throw Error(`[posts/analytics] post with id ${e} not found`);return{postId:e,primaryAuthorId:t.publisherName,primaryAuthor:t.publisherProfileName||t.publisherName,originalPublishDate:m(t.createdAt).toISOString()}};function P(e){let t=(0,w.c)(14),{entityId:n,entityType:r}=e,{t:i}=u(),[a,o]=(0,E.useState)(!1),c=s(),l;t[0]===i?l=t[1]:(l=function(e){if(e.message.includes(`banned`))return alert(i(`errors.bannedFromCommunity`))},t[0]=i,t[1]=l);let f=l,p;t[2]!==n||t[3]!==r?(p=function(e){let t={event:`reaction`,reactionName:e,entityType:r,entityId:n};r===`Post`?Object.assign(t,N(n)):Object.assign(t,M(n)),d(t)},t[2]=n,t[3]=r,t[4]=p):p=t[4];let m=p,h;t[5]!==n||t[6]!==r||t[7]!==f||t[8]!==c||t[9]!==m?(h=async function(e){o(!0);
1try{await S({userId:c,entityId:n,entityType:r,reactionName:e}),m(e)}catch(e){let t=e;f(t),console.error(t)}o(!1)},t[5]=n,t[6]=r,t[7]=f,t[8]=c,t[9]=m,t[10]=h):h=t[10];let g=h,_;return t[11]!==a||t[12]!==g?(_={isReacting:a,react:g},t[11]=a,t[12]=g,t[13]=_):_=t[13],_}export{O as a,k as i,N as n,T as o,j as r,P as t};
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.