"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkRIMTUSWQjs = require('./chunk-RIMTUSWQ.js');var _chunkL4PBARWDjs = require('./chunk-L4PBARWD.js');var _dialogs = require('@baseapp-frontend/design-system/components/web/dialogs');var _utils = require('@baseapp-frontend/utils');var _lab = require('@mui/lab');var _reactrelay = require('react-relay');var _jsxruntime = require('react/jsx-runtime');function S(o,r){return N(o)||M(o,r)||P(o,r)||D()}function D(){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 P(o,r){if(o){if(typeof o=="string")return g(o,r);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?g(o,r):void 0}}function g(o,r){(r==null||r>o.length)&&(r=o.length);for(var t=0,e=Array(r);t<r;t++)e[t]=o[t];return e}function M(o,r){var t=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(t!=null){var e,l,s,n,i=[],a=!0,u=!1;try{if(s=(t=t.call(o)).next,r===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(e=s.call(t)).done)&&(i.push(e.value),i.length!==r);a=!0);}catch(v){u=!0,l=v}finally{try{if(!a&&t.return!=null&&(n=t.return(),Object(n)!==n))return}finally{if(u)throw l}}return i}}function N(o){if(Array.isArray(o))return o}var x=function(r){var t=r.customTitle,e=r.customContent,l=r.onClose,s=r.open,n=r.profileId,i=r.removingParticipantId,a=r.roomId,u=r.isSoleAdmin,v=u===void 0?!1:u,O=_chunkL4PBARWDjs.b.call(void 0, ),E=S(O,2),h=E[0],A=E[1],R=_utils.useNotification.call(void 0, ),C=R.sendToast,T=function(m){return n===i?v?_chunkRIMTUSWQjs.d[_chunkRIMTUSWQjs.a.IS_LEAVING][_chunkRIMTUSWQjs.b.ADMIN][m]:_chunkRIMTUSWQjs.d[_chunkRIMTUSWQjs.a.IS_LEAVING][_chunkRIMTUSWQjs.b.MEMBER][m]:_chunkRIMTUSWQjs.d[_chunkRIMTUSWQjs.a.IS_REMOVING][_chunkRIMTUSWQjs.b.ADMIN][m]},b=function(){!a||!n||h({variables:{input:{roomId:a,profileId:n,removeParticipants:[i]},connections:[_reactrelay.ConnectionHandler.getConnectionID(a,"ChatRoom_participants")]},onCompleted:function(c){var _;i&&i!==n&&!(c!=null&&(_=c.chatRoomUpdate)!==null&&_!==void 0&&_.errors)&&C("Member was successfully removed"),l()},onError:function(c){C(c.message,{type:"error"})}})};return _jsxruntime.jsx.call(void 0, _dialogs.ConfirmDialog,{title:_nullishCoalesce(t, () => (T(_chunkRIMTUSWQjs.c.TITLE))),content:_nullishCoalesce(e, () => (T(_chunkRIMTUSWQjs.c.CONTENT))),action:_jsxruntime.jsx.call(void 0, _lab.LoadingButton,{color:"error",onClick:b,disabled:A,loading:A,children:i===n?"Leave group":"Remove"}),onClose:l,open:s})},F= exports.a =x;exports.a = F;
//# sourceMappingURL=chunk-WU2BEBAR.js.map