"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkU7WJ43KOjs = require('./chunk-U7WJ43KO.js');var _chunkGZNRYBLLjs = require('./chunk-GZNRYBLL.js');var _chunkDMSSQ5DSjs = require('./chunk-DMSSQ5DS.js');var _chunkJEUQIVMMjs = require('./chunk-JEUQIVMM.js');var _react = require('react');var _displays = require('@baseapp-frontend/design-system/components/web/displays');var _material = require('@mui/material');var _reactvirtuoso = require('react-virtuoso');var _jsxruntime = require('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?_chunkU7WJ43KOjs.a:l,C=e.CommentItemProps,P=e.VirtuosoProps,c=_chunkDMSSQ5DSjs.b.call(void 0, n),i=c.data,h=c.loadNext,x=c.isLoadingNext,S=c.hasNext,d=_react.useMemo.call(void 0, function(){var m;return(i==null||(m=i.comments)===null||m===void 0?void 0:m.edges.filter(function(o){return _optionalChain([o, 'optionalAccess', _2 => _2.node])}).map(function(o){return _optionalChain([o, 'optionalAccess', _3 => _3.node])}))||[]},[i==null||(r=i.comments)===null||r===void 0?void 0:r.edges]),_=function(o){return o?_jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsx.call(void 0, "div",{className:"h-2"})},N=function(){return x?_jsxruntime.jsx.call(void 0, _displays.LoadingState,{sx:{paddingTop:3,paddingBottom:1},CircularProgressProps:{size:15},"aria-label":"loading more comments"}):_jsxruntime.jsx.call(void 0, _material.Box,{sx:{paddingTop:3}})};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[s&&_jsxruntime.jsx.call(void 0, _chunkGZNRYBLLjs.c,{targetObjectId:i.id}),_jsxruntime.jsx.call(void 0, "div",{className:"overflow-x-auto hide-scrollbar",children:_jsxruntime.jsx.call(void 0, _reactvirtuoso.Virtuoso,g({useWindowScroll:!0,data:d,itemContent:function(o,L){return _(L)},components:{Header:w,Footer:N},endReached:function(){S&&h(_chunkJEUQIVMMjs.a)}},P))})]})},X= exports.a =H;exports.a = X;
//# sourceMappingURL=chunk-2P4YLEFT.js.map