import{a as v}from"./chunk-4X2GOTSI.mjs";import{c as b}from"./chunk-DYIP5QQG.mjs";import{b as f}from"./chunk-YNI7VQAW.mjs";import{a as p}from"./chunk-LOEFWLPN.mjs";import{useMemo as R}from"react";import{LoadingState as T}from"@baseapp-frontend/design-system/components/web/displays";import{Box as k}from"@mui/material";import{Virtuoso as F}from"react-virtuoso";import{jsx as a,Fragment as M,jsxs as B}from"react/jsx-runtime";function u(t){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(t)}function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?y(Object(r),!0).forEach(function(n){E(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function E(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I(t){var e=D(t,"string");return u(e)=="symbol"?e:e+""}function D(t,e){if(u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var H=function(e){var r,n=e.target,s=e.subscriptionsEnabled,O=e.onReplyClick,l=e.CommentItem,j=l===void 0?v:l,C=e.CommentItemProps,P=e.VirtuosoProps,c=f(n),i=c.data,h=c.loadNext,x=c.isLoadingNext,S=c.hasNext,d=R(function(){var m;return(i==null||(m=i.comments)===null||m===void 0?void 0:m.edges.filter(function(o){return o?.node}).map(function(o){return o?.node}))||[]},[i==null||(r=i.comments)===null||r===void 0?void 0:r.edges]),_=function(o){return o?a(j,g({target:i,comment:o,currentThreadDepth:1,subscriptionsEnabled:s,onReplyClick:O,enableDelete:!0},C),"comment-".concat(o.id)):null},w=function(){return d.length===0?null:a("div",{className:"h-2"})},N=function(){return x?a(T,{sx:{paddingTop:3,paddingBottom:1},CircularProgressProps:{size:15},"aria-label":"loading more comments"}):a(k,{sx:{paddingTop:3}})};return B(M,{children:[s&&a(b,{targetObjectId:i.id}),a("div",{className:"overflow-x-auto hide-scrollbar",children:a(F,g({useWindowScroll:!0,data:d,itemContent:function(o,L){return _(L)},components:{Header:w,Footer:N},endReached:function(){S&&h(p)}},P))})]})},X=H;export{X as a};
//# sourceMappingURL=chunk-6RRU5S4N.mjs.map