"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunk4TNQMIAEjs = require('./chunk-4TNQMIAE.js');var _chunkR3SSZV2Djs = require('./chunk-R3SSZV2D.js');var _chunk62ERKONWjs = require('./chunk-62ERKONW.js');var _chunkWU2BEBARjs = require('./chunk-WU2BEBAR.js');var _chunkVYNCIM3Gjs = require('./chunk-VYNCIM3G.js');var _chunkUQGTFMMXjs = require('./chunk-UQGTFMMX.js');var _chunkCMMAL7DUjs = require('./chunk-CMMAL7DU.js');var _chunk74X4UOY6js = require('./chunk-74X4UOY6.js');var _react = require('react');var _authentication = require('@baseapp-frontend/authentication');var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');var _displays = require('@baseapp-frontend/design-system/components/web/displays');var _typographies = require('@baseapp-frontend/design-system/components/web/typographies');var _material = require('@mui/material');var _reactrelay = require('react-relay');var _reactvirtuoso = require('react-virtuoso');var _jsxruntime = require('react/jsx-runtime');function m(e){"@babel/helpers - typeof";return m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},m(e)}var pe=["onBackButtonClicked"];function fe(e,r){if(e==null)return{};var t,o,a=me(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o<l.length;o++)t=l[o],r.indexOf(t)===-1&&{}.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function me(e,r){if(e==null)return{};var t={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(r.indexOf(o)!==-1)continue;t[o]=e[o]}return t}function V(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,o)}return t}function j(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?V(Object(t),!0).forEach(function(o){ve(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):V(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function ve(e,r,t){return(r=ye(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ye(e){var r=be(e,"string");return m(r)=="symbol"?r:r+""}function be(e,r){if(m(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var o=t.call(e,r||"default");if(m(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ge(e,r){return Se(e)||Ce(e,r)||Pe(e,r)||he()}function he(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pe(e,r){if(e){if(typeof e=="string")return Q(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Q(e,r):void 0}}function Q(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,o=Array(r);t<r;t++)o[t]=e[t];return o}function Ce(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o,a,l,d,p=[],u=!0,v=!1;try{if(l=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(o=l.call(t)).done)&&(p.push(o.value),p.length!==r);u=!0);}catch(y){v=!0,a=y}finally{try{if(!u&&t.return!=null&&(d=t.return(),Object(d)!==d))return}finally{if(v)throw a}}return p}}function Se(e){if(Array.isArray(e))return e}var Te=function(r){var t,o=r.onBackButtonClicked,a=r.onEditButtonClicked,l=r.queryRef,d=r.ProfileCard,p=d===void 0?_chunkR3SSZV2Djs.a:d,u=r.ProfileCardProps,v=u===void 0?{}:u,y=r.VirtuosoProps,U=y===void 0?{}:y,J=_reactrelay.usePreloadedQuery.call(void 0, _chunkUQGTFMMXjs.a,l),i=J.chatRoom,X=_authentication.useCurrentProfile.call(void 0, ),C=X.currentProfile,x=_chunk74X4UOY6js.a.call(void 0, i),Y=x.avatar,Z=x.title,k=_material.useTheme.call(void 0, ),B=(t=_optionalChain([C, 'optionalAccess', _2 => _2.id]))!==null&&t!==void 0?t:"",ee=i!=null&&i.id?[_reactrelay.ConnectionHandler.getConnectionID(i.id,"ChatRoom_participants")]:[];_chunkVYNCIM3Gjs.b.call(void 0, {profileId:B,connections:ee,onRemoval:o});var b=_reactrelay.usePaginationFragment.call(void 0, _chunkCMMAL7DUjs.a,i),S=b.data,re=b.loadNext,te=b.isLoadingNext,oe=b.hasNext,g=_optionalChain([S, 'optionalAccess', _3 => _3.participants]),_=_chunk74X4UOY6js.e.call(void 0, g),A=_.isAdmin,ne=_.isSoleAdmin,ie=function(){return te?_jsxruntime.jsx.call(void 0, _displays.LoadingState,{sx:{paddingTop:3,paddingBottom:1},CircularProgressProps:{size:15},"aria-label":"loading more profiles"}):_jsxruntime.jsx.call(void 0, _material.Box,{sx:{paddingTop:3}})},ae=_react.useState.call(void 0, void 0),w=ge(ae,2),h=w[0],I=w[1],R=_react.useRef.call(void 0, void 0),le=function(s,D){I(s),R.current=D},ue=function(){I(void 0),R.current=void 0},de=function(s){return s.node?_jsxruntime.jsx.call(void 0, p,j({groupMember:s.node,initiateRemoval:le,hasAdminPermissions:A},v)):null},se=function(){return _jsxruntime.jsx.call(void 0, _reactvirtuoso.Virtuoso,j({data:_optionalChain([g, 'optionalAccess', _4 => _4.edges]),itemContent:function(D,ce){return de(ce)},style:{scrollbarWidth:"none"},components:{Footer:ie},endReached:function(){oe&&re(5)}},U))};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkWU2BEBARjs.a,{profileId:B,roomId:_optionalChain([i, 'optionalAccess', _5 => _5.id]),open:!!h,removingParticipantId:_nullishCoalesce(h, () => ("")),onClose:ue,isSoleAdmin:ne}),_jsxruntime.jsx.call(void 0, _chunk4TNQMIAEjs.a,{onBackButtonClicked:o,onEditButtonClicked:a,shouldDisplayEditButton:A}),_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"grid",gridTemplateRows:"auto 1fr"},children:[_jsxruntime.jsxs.call(void 0, _chunk62ERKONWjs.a,{children:[_jsxruntime.jsx.call(void 0, _avatars.CircledAvatar,{src:Y,width:144,height:144,hasError:!1}),_jsxruntime.jsxs.call(void 0, _chunk62ERKONWjs.b,{children:[_jsxruntime.jsx.call(void 0, _typographies.TypographyWithEllipsis,{variant:"subtitle1",color:"text.primary",children:Z}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"body2",color:"text.secondary",children:_chunk74X4UOY6js.c.call(void 0, _optionalChain([i, 'optionalAccess', _6 => _6.participantsCount]))})]})]}),_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"grid",gridTemplateRows:"auto 1fr"},children:[_jsxruntime.jsx.call(void 0, _material.Box,{role:"list","aria-label":"group members",children:_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"subtitle2",color:"text.primary",sx:{padding:k.spacing(2),borderBottom:"1px solid ".concat(k.palette.divider)},children:"Members"})}),_jsxruntime.jsx.call(void 0, _material.Box,{height:"100%",width:"100%",children:se()})]})]})]})},Ee=function(r){var t=r.onBackButtonClicked,o=fe(r,pe);return _jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunk4TNQMIAEjs.a,{onBackButtonClicked:t,shouldDisplayEditButton:!1}),_jsxruntime.jsx.call(void 0, _displays.LoadingState,{})]}),children:_jsxruntime.jsx.call(void 0, Te,j({onBackButtonClicked:t},o))})},Je= exports.a =Ee;exports.a = Je;
//# sourceMappingURL=chunk-FP4NEPM6.js.map