aiware-js 1.0.0-master.1421 → 1.0.0-master.1423
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js-core.esm118.js +1 -1
- package/js-core.esm118.js.gz +0 -0
- package/js-core.esm127.js +1 -1
- package/js-core.esm127.js.gz +0 -0
- package/js-core.esm17.js +1 -1
- package/js-core.esm17.js.gz +0 -0
- package/locales/en.json +1 -1
- package/locales/es.json +1 -1
- package/locales/fr.json +1 -1
- package/package.json +1 -1
package/js-core.esm118.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bA as _baseGetTag,bB as isObjectLike_1,bC as _nodeUtilExports,bD as _baseUnary,ac as getDefaultExportFromCjs,a0 as createSlice,bE as md5,ad as combineReducers,av as AvailableComponents,j as jsxRuntimeExports,b as AIWareThemeProvider,A as AIWareCacheProvider,u as useSelector,ap as selectIsFullscreenEnabled,r as reactExports,B as Box,v as mountPanel,as as useIntl,aG as img$J,ar as selectIsSuperAdmin,p as hidePanel,_ as all,e as userSelector,a6 as selectApiConfigs,bF as EUserStatus,aD as AvailablePanels,aH as EPanelSize,bG as impersonateUserStart,q as unmountAllPanel,bH as requestPasswordResetStart,J as takeEvery$1,am as takeLatest$1,N as put,K as select,a2 as call,aj as showMessage,ak as MessageSeverity,a9 as isEqual,al as AIWareFormatMessage,ah as preferredLanguageSelector,aA as selectOrgId,a8 as baseGraphQLApiWithError}from"./js-core.esm4.js";import{bo as _baseToString,bp as _castSlice,bq as _hasUnicode,br as _isIterateeCall,bs as _stringToArray,bt as toString_1,m as makeStyles,D as DynamicModuleLoader,A as AIWareIntlProvider,T as Typography,M as MemoizedFormattedMessage,B as Button,bu as AddUser,ar as Filter,X as NullState,S as Select,e as MenuItem,am as Tabs,an as Tab,p as Divider,d as TabPanel,h as _isNil,t as Popover,v as MenuList,G as Grid,Y as startCase,L as List,bv as RemoveOne}from"./js-core.esm7.js";import{o as organizationInvites_selector,b as actions$2,s as scimIds_api}from"./js-core.esm26.js";import{B as tableInfiniteScroll,aJ as ContextMenu,aL as VisibilityOutlined,G as debounce,A as Avatar,w as CopyText,aM as TCopyIconPosition,K as index,T as Tooltip,I as IconButton,F as panelComponents,N as tableSearchComponents,C as ConfirmDialog,S as Stack,aI as VirtualFixedSizeList,e as Skeleton}from"./js-core.esm9.js";import{d as selectAdminCenterOrgId,q as selectAdminCenterOrgGuid,r as EUserTableContextActions,f as selectAdminCenterOrgIdString,e as contextMenuStyles,L as ListItem,b as ListItemAvatar,c as ListItemText,i as ListItemSecondaryAction,k as selectAdminCenterOrgParameter}from"./js-core.esm8.js";import{useOrganizationPermissions,EAuthSubResourceType,EPermissionAction}from"./js-core.esm13.js";import{g as groupBy,u as upperCase}from"./js-core.esm79.js";import{w as getInstanceAdminCenterOrgsModule,O as OrgTableSearchButton,x as OrgsTable}from"./js-core.esm86.js";import{_ as _uniqBy}from"./js-core.esm42.js";import{V as VisibilityOffOutlined}from"./js-core.esm53.js";import{M as MoreVert}from"./js-core.esm30.js";import{u as useDispatch}from"./js-core.esm14.js";import"./js-core.esm43.js";import"./js-core.esm46.js";var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1,regexpTag="[object RegExp]";function baseIsRegExp$1(e){return isObjectLike(e)&&baseGetTag(e)==regexpTag}var _baseIsRegExp=baseIsRegExp$1,baseIsRegExp=baseIsRegExp$1,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsRegExp=_nodeUtilExports&&_nodeUtilExports.isRegExp,isRegExp$1=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isRegExp_1=isRegExp$1,baseToString=_baseToString,castSlice=_castSlice,hasUnicode=_hasUnicode,isIterateeCall=_isIterateeCall,isRegExp=isRegExp$1,stringToArray=_stringToArray,toString=toString_1,MAX_ARRAY_LENGTH=4294967295;function split(e,t,r){return r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=void 0),(r=void 0===r?MAX_ARRAY_LENGTH:r>>>0)?(e=toString(e))&&("string"==typeof t||null!=t&&!isRegExp(t))&&!(t=baseToString(t))&&hasUnicode(e)?castSlice(stringToArray(e),0,r):e.split(t,r):[]}var split_1=split,split$1=getDefaultExportFromCjs(split),useStyles$3=makeStyles()(function(){return{badge:{fontSize:"9px",lineHeight:"18px",borderRadius:"30px",height:"18px",width:"fit-content",padding:"0px 10px",fontWeight:800},active:{background:"rgba(209, 223, 210, 1)",color:"rgba(56, 142, 60, 1)"},suspended:{background:"rgba(254, 238, 211, 1)",color:"rgba(245, 124, 0, 1)"},deactivated:{background:"rgba(241, 210, 210, 1)",color:"rgba(183, 28, 28, 1)"},inactive:{background:"rgba(241, 210, 210, 1)",color:"rgba(183, 28, 28, 1)"},deleted:{background:"rgba(233, 233, 233, 1)",color:"rgba(33, 33, 33, 1)"}}}),UserStatusBadge=function(e){var e=e.status,t=useStyles$3().classes;return jsxRuntimeExports.jsx(Box,{className:"".concat(t.badge," ").concat(t[e]),"data-testid":"admin-center.users.user-status-badge","data-test":"admin-center.users.user-status-badge",children:null==e?void 0:e.toUpperCase()})},SLICE_NAME="adminCenterUsers",PAGE_LIMIT=30;function _array_like_to_array$8(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_without_holes$4(e){if(Array.isArray(e))return _array_like_to_array$8(e)}function _define_property$4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$4(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$4(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$2(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},s=Object.keys(r);(s="function"==typeof Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):s).forEach(function(e){_define_property$4(t,e,r[e])})}return t}function ownKeys$2(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$2(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _to_consumable_array$4(e){return _array_without_holes$4(e)||_iterable_to_array$4(e)||_unsupported_iterable_to_array$8(e)||_non_iterable_spread$4()}function _unsupported_iterable_to_array$8(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$8(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$8(e,t):void 0}var namespace$1="adminCenterUsers",avatarColors=["#f94144ff","#f3722cff","#f8961eff","#f9844aff","#f9c74fff","#90be6dff","#43aa8bff","#4d908eff","#577590ff","#277da1ff"],prevIndex=0,initialState$1={status:"idle",users:[],offset:0,hasMore:!0,userDetailPanel:{userId:null,orgId:null,userData:null,loadingStatus:"idle"},activeSwitcherOrgId:null,userOrgs:[],userOrgsStatus:"idle",userRoles:[],initialUserRoles:[],userOrgRoles:[],userRolesUpdateStatus:"idle",userRolesStatus:"idle",searchTerm:"",showDeletedUsers:!1,isSearching:!1},adminCenterSlice=createSlice({name:"".concat(SLICE_NAME,"/").concat(namespace$1),initialState:initialState$1,reducers:{fetchOrgUsersStart:function(e){e.status="loading"},fetchOrgUsersSuccess:function(e,t){e.status="success";var r=[],s=!(e.isSearching=!1),a=!1,n=void 0;try{for(var o,i=t.payload.records[Symbol.iterator]();!(s=(o=i.next()).done);s=!0){var l=o.value,u=md5((l.id||"")+(l.name||l.email||"")+l.lastLoginDateTime+(l.firstName||"")),c=parseInt(u,16)%avatarColors.length;c===prevIndex&&(c+1>avatarColors.length-1?--c:c+=1),prevIndex=c,r.push(_object_spread_props$2(_object_spread$2({},l),{avatarColor:avatarColors[c]}))}}catch(e){a=!0,n=e}finally{try{s||null==i.return||i.return()}finally{if(a)throw n}}a=_to_consumable_array$4(e.users).concat(_to_consumable_array$4(r));e.users=a.filter(function(t,e,r){return e===r.findIndex(function(e){return e.id===t.id})}),e.hasMore=t.payload.hasMore,e.offset=t.payload.nextOffset},fetchOrgUsersFailure:function(e){e.status="failure",e.isSearching=!1},removeUserFromOrgStart:function(e,t){e.status="loading"},removeUserFromOrgSuccess:function(e,t){e.status="success",e.users=_to_consumable_array$4(e.users).filter(function(e){return e.id!==t.payload.userId}),e.userOrgs=_to_consumable_array$4(e.userOrgs).filter(function(e){return e.guid!==t.payload.orgGuid}),e.offset=e.offset-1},removeUserFromOrgFailure:function(e){e.status="failure"},updateUserStatusStart:function(e,t){e.status="loading"},updateUserStatusSuccess:function(e,t){e.status="success";var r,s=e.users.findIndex(function(e){return e.id===t.payload.id});-1!==s&&((r=_to_consumable_array$4(e.users))[s]=_object_spread_props$2(_object_spread$2({},r[s]),{status:t.payload.status}),e.users=r),e.userDetailPanel.userId===t.payload.id&&(e.userDetailPanel.userData=_object_spread_props$2(_object_spread$2({},e.userDetailPanel.userData),{status:t.payload.status}))},updateUserStatusFailure:function(e){e.status="failure"},fetchUserStart:function(e,t){e.userDetailPanel.userId=t.payload.userId,e.userDetailPanel.orgId=t.payload.orgId||null,e.userDetailPanel.loadingStatus="loading"},fetchUserSuccess:function(e,t){var r=t.payload.user,s=avatarColors[5],a=e.users.find(function(e){return e.id===r.id});a&&a.avatarColor&&(s=a.avatarColor),e.userDetailPanel.userData=_object_spread_props$2(_object_spread$2({},t.payload.user),{avatarColor:s}),e.userDetailPanel.loadingStatus="success"},fetchUserFailure:function(e){e.userDetailPanel.loadingStatus="failure"},fetchUserOrganizationsStart:function(e,t){e.userOrgsStatus="loading"},fetchUserOrganizationsSuccess:function(e,t){e.userOrgs=t.payload.orgs,e.userOrgsStatus="success"},fetchUserOrganizationsFailure:function(e){e.userOrgsStatus="failure"},getUserApplicationRolesStart:function(e,t){e.userRolesStatus="loading"},getUserApplicationRolesSuccess:function(e,t){e.userRolesStatus="success",e.userRoles=t.payload.userRoles,e.initialUserRoles=t.payload.userRoles,e.userOrgRoles=t.payload.orgRoles},getUserApplicationRolesFailure:function(e){e.userRolesStatus="failure"},resetUserDetailState:function(e){e.userDetailPanel={userId:null,orgId:null,userData:null,loadingStatus:"idle"},e.userOrgs=[],e.userOrgsStatus="idle",e.userRoles=[],e.initialUserRoles=[],e.userOrgRoles=[],e.userRolesStatus="idle"},updateUserRoles:function(e,t){e.userRoles=t.payload.roles,e.userRolesUpdateStatus="pending"},updateUserRolesSuccess:function(e){e.userRolesUpdateStatus="success",e.initialUserRoles=e.userRoles},updateUserRolesFailure:function(e){e.userRolesUpdateStatus="failure",e.userRoles=e.initialUserRoles},setSearchTerm:function(e,t){e.searchTerm=t.payload,e.users=[],e.status="loading"},setIsSearching:function(e,t){e.isSearching=t.payload},setShowDeletedUsers:function(e,t){e.showDeletedUsers=t.payload,e.offset=0,e.users=[],e.hasMore=!0,e.status="loading"},setActiveSwitcherOrgId:function(e,t){e.activeSwitcherOrgId=t.payload}}}),actions$1=adminCenterSlice.actions,adminCenterUsers_state=adminCenterSlice.reducer;function _define_property$3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var namespace=SLICE_NAME,initialState=_define_property$3({},namespace$1,initialState$1),actions=_define_property$3({},namespace$1,actions$1),rootReducer=combineReducers(_define_property$3({},namespace$1,adminCenterUsers_state));function asyncGeneratorStep$1(e,t,r,s,a,n,o){try{var i=e[n](o),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(s,a)}function _async_to_generator$1(i){return function(){var e=this,o=arguments;return new Promise(function(t,r){var s=i.apply(e,o);function a(e){asyncGeneratorStep$1(s,t,r,a,n,"next",e)}function n(e){asyncGeneratorStep$1(s,t,r,a,n,"throw",e)}a(void 0)})}}function _define_property$2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$1(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},s=Object.keys(r);(s="function"==typeof Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):s).forEach(function(e){_define_property$2(t,e,r[e])})}return t}function ownKeys$1(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$1(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _ts_generator$4(s,a){var n,o,i,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,(t=i?[2&t[0],i.value]:t)[0]){case 0:case 1:i=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,o=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(i=0<(i=l.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))l.label=t[1];else if(6===t[0]&&l.label<i[1])l.label=i[1],i=t;else{if(!(i&&l.label<i[2])){i[2]&&l.ops.pop(),l.trys.pop();continue}l.label=i[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],o=0}finally{n=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var parseFilter=function(e){var t=[];return null!=e&&e.name&&t.push('name: "'.concat(e.name,'"')),null!=e&&e.orgId&&t.push('organizationIds: ["'.concat(e.orgId,'"]')),null!=e&&e.statuses&&t.push("statuses: [".concat(e.statuses.join(","),"]")),t.join(" ")};function fetchOrgUsers(e,t,r,s){return _fetchOrgUsers.apply(this,arguments)}function _fetchOrgUsers(){return(_fetchOrgUsers=_async_to_generator$1(function(t,r,s,a){var n,o,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n="fetchOrgUsers",o="users",i=parseFilter(a),i="\n query ".concat(n," {\n ").concat(o," (offset: ").concat(r,", limit: ").concat(s," ").concat(i,") {\n records {\n id\n imageUrl\n name\n firstName\n lastName\n email\n lastLoginDateTime\n status\n organizationGuids\n organizationId\n organization {\n guid\n }\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:i,operationName:n},t))];case 1:return[2,e.sent()[o]]}})})).apply(this,arguments)}function removeUserFromOrg(e,t,r){return _removeUserFromOrg.apply(this,arguments)}function _removeUserFromOrg(){return(_removeUserFromOrg=_async_to_generator$1(function(t,r,s){var a,n,o;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n=a="removeUserFromOrganization",o="\n mutation ".concat(a," {\n ").concat(n,' (userId: "').concat(r,'", organizationGuid: "').concat(s,'") {\n id\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:o,operationName:a},t))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function updateUserStatus(e,t,r){return _updateUserStatus.apply(this,arguments)}function _updateUserStatus(){return(_updateUserStatus=_async_to_generator$1(function(t,r,s){var a,n,o;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n=a="updateUserStatus",o="\n mutation ".concat(a," {\n ").concat(n,' (input: {id: "').concat(r,'" status: ').concat(s,"}) {\n id\n status\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:o,operationName:a},t))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function fetchUserOrganizations(e,t){return _fetchUserOrganizations.apply(this,arguments)}function _fetchUserOrganizations(){return(_fetchUserOrganizations=_async_to_generator$1(function(t,r){var s,a,n;return _ts_generator$4(this,function(e){switch(e.label){case 0:return a="organizations",n="\n query ".concat(s="fetchUserOrganizations"," {\n ").concat(a,' (id: "').concat(r,'") {\n records {\n id\n name\n imageUrl\n guid\n status\n }\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:n,operationName:s},t))];case 1:return[2,e.sent()[a]]}})})).apply(this,arguments)}function updateUserApplicationRolesCall(e,t){return _updateUserApplicationRolesCall.apply(this,arguments)}function _updateUserApplicationRolesCall(){return(_updateUserApplicationRolesCall=_async_to_generator$1(function(t,r){var s,a,n,o,i,l;return _ts_generator$4(this,function(e){switch(e.label){case 0:return s=r.userId,a=r.orgId,n=r.roleIds,i=o="updateUser",l="\n mutation ".concat(o," ($input: UpdateUser!) {\n ").concat(i," (input: $input) {\n roles {\n id\n name\n appName\n description\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:l,operationName:o,variables:{input:{id:s,roleIds:n,organizationId:a}}},t))];case 1:return[2,e.sent()[i]]}})})).apply(this,arguments)}function getUserApplicationRoles(e,t,r){return _getUserApplicationRoles.apply(this,arguments)}function _getUserApplicationRoles(){return(_getUserApplicationRoles=_async_to_generator$1(function(t,r,s){var a,n;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n="\n query ".concat(a="getUserApplicationRoles"," {\n ").concat("organization",' (id: "').concat(s,'") {\n roles (isAppEventRole: false) {\n id\n name\n appName\n description\n }\n }\n ').concat("user",' (id: "').concat(r,'", organizationIds: ["').concat(s,'"]) {\n roles {\n id\n name\n appName\n description\n }\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:n,operationName:a},t))];case 1:return[2,e.sent()]}})})).apply(this,arguments)}function fetchOrgUserById(e,t,r){return _fetchOrgUserById.apply(this,arguments)}function _fetchOrgUserById(){return(_fetchOrgUserById=_async_to_generator$1(function(t,r,s){var a,n,o;return _ts_generator$4(this,function(e){switch(e.label){case 0:return o=s?', organizationIds: ["'.concat(s,'"]'):"",n="users",o="\n query ".concat(a="fetchUserById"," {\n ").concat(n,' (id: "').concat(r,'", includeAllOrgUsers: true ').concat(o," ) {\n records {\n id\n imageUrl\n name\n firstName\n lastName\n email\n lastLoginDateTime\n status\n organizationGuids\n organizationId\n acls {\n applicationId\n organizationId\n organization {\n id\n name\n }\n objectType\n objectId\n userId\n access {\n owner\n }\n }\n organization {\n id\n guid\n name\n applications{\n records{\n id\n name\n description\n }\n }\n }\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:o,operationName:a},t))];case 1:return[2,e.sent()[n].records[0]]}})})).apply(this,arguments)}function updateUserAcls(e,t,r){return _updateUserAcls.apply(this,arguments)}function _updateUserAcls(){return(_updateUserAcls=_async_to_generator$1(function(t,r,s){var a,n,o,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n=a="updateUser",o="\n mutation ".concat(a," ($userId : ID!, $acls: [UserACLInput!]) {\n ").concat(n," (input: {id: $userId , acls: $acls} ) {\n id\n acls {\n applicationId\n organizationId\n organization {\n id\n name\n }\n objectType\n objectId\n userId\n access {\n owner\n }\n }\n }\n }\n "),i={userId:r,acls:s},[4,baseGraphQLApiWithError(_object_spread_props$1(_object_spread$1({query:o,operationName:a},t),{variables:i}))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}var selectOrgUsers=function(e){e=(null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1])||{};return{users:e.users,hasMore:e.hasMore,offset:e.offset}},selectDetailPanelUserId=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userDetailPanel.userId},selectStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].status},selectUserOrgs=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userOrgs},selectUserOrgRoles=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userOrgRoles},selectUserApplicationRoles=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userRoles},selectUserApplicationRolesStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userRolesStatus},selectUserDetailPanelUserData=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userDetailPanel.userData},selectUserDetailPanelLoadingStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userDetailPanel.loadingStatus},selectSearchTerm=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].searchTerm},selectShowDeletedUsers=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].showDeletedUsers},selectIsSearching=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].isSearching},selectActiveSwitcherOrgId=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].activeSwitcherOrgId};function _ts_generator$3(s,a){var n,o,i,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,(t=i?[2&t[0],i.value]:t)[0]){case 0:case 1:i=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,o=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(i=0<(i=l.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))l.label=t[1];else if(6===t[0]&&l.label<i[1])l.label=i[1],i=t;else{if(!(i&&l.label<i[2])){i[2]&&l.ops.pop(),l.trys.pop();continue}l.label=i[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],o=0}finally{n=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function fetchUserByIdSaga(t){var r,s,a,n,o,i,l;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,11,,13]),[4,select(selectApiConfigs)];case 1:return r=e.sent(),[4,select(selectAdminCenterOrgIdString)];case 2:return s=e.sent(),[4,select(selectAdminCenterOrgParameter)];case 3:return a=e.sent(),[4,select(selectIsSuperAdmin)];case 4:return n=e.sent(),o=t.payload.userId,[4,fetchOrgUserById(r,o,s||a)];case 5:if(i=e.sent())return null!=i&&i.id&&null!=(o=i.organization)&&o.id?[4,put(actions.adminCenterUsers.getUserApplicationRolesStart({userId:i.id,orgId:"".concat(i.organization.id)}))]:[3,7];throw new Error("User not found");case 6:e.sent(),e.label=7;case 7:return n&&null!=i&&i.organizationGuids?[4,put(actions.adminCenterUsers.fetchUserOrganizationsStart({orgGuids:i.organizationGuids}))]:[3,9];case 8:e.sent(),e.label=9;case 9:return[4,put(actions.adminCenterUsers.fetchUserSuccess({user:i}))];case 10:return e.sent(),[3,13];case 11:return l=e.sent(),console.log(l),[4,put(actions.adminCenterUsers.fetchUserFailure())];case 12:return e.sent(),[3,13];case 13:return[2]}})}function fetchUsers(t,r,s){var a,n,o;return _ts_generator$3(this,function(e){switch(e.label){case 0:return[4,select(selectApiConfigs)];case 1:return a=e.sent(),[4,select(selectAdminCenterOrgParameter)];case 2:return n=e.sent(),[4,select(selectOrgId)];case 3:return o=e.sent(),[4,fetchOrgUsers(a,s,PAGE_LIMIT,{name:t,orgId:null!=n?n:o,statuses:r})];case 4:return[2,e.sent().records]}})}function fetchUsersSaga(e){var t,r,s,a,n;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,7,,9]),[4,select(selectSearchTerm)];case 1:return t=e.sent(),[4,select(selectShowDeletedUsers)];case 2:return r=e.sent(),[4,select(selectOrgUsers)];case 3:return(a=e.sent(),s=a.offset,a=a.hasMore,n=Object.values(EUserStatus).filter(function(e){return r||e!==EUserStatus.deleted}),a)?[4,call(fetchUsers,t,n,s)]:[3,6];case 4:return a=e.sent(),[4,put(actions.adminCenterUsers.fetchOrgUsersSuccess({records:a,hasMore:PAGE_LIMIT===a.length,nextOffset:s+PAGE_LIMIT}))];case 5:e.sent(),e.label=6;case 6:return[3,9];case 7:return n=e.sent(),console.log(n),[4,put(actions.adminCenterUsers.fetchOrgUsersFailure())];case 8:return e.sent(),[3,9];case 9:return[2]}})}function searchUsersSaga(t){var r,s,a;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,6]),[4,select(selectShowDeletedUsers)];case 1:return r=e.sent(),s=Object.values(EUserStatus).filter(function(e){return r||e!==EUserStatus.deleted}),[4,call(fetchUsers,t.payload,s,0)];case 2:return s=e.sent(),[4,put(actions.adminCenterUsers.fetchOrgUsersSuccess({records:s,hasMore:PAGE_LIMIT===s.length,nextOffset:PAGE_LIMIT}))];case 3:return e.sent(),[3,6];case 4:return a=e.sent(),console.log(a),[4,put(actions.adminCenterUsers.fetchOrgUsersFailure())];case 5:return e.sent(),[3,6];case 6:return[2]}})}function removeUserFromOrgSaga(t){var r,s,a,n,o;return _ts_generator$3(this,function(e){switch(e.label){case 0:return s=t.payload,r=s.userId,s=s.orgGuid,[4,select(preferredLanguageSelector)];case 1:a=e.sent(),a=AIWareFormatMessage(a),e.label=2;case 2:return e.trys.push([2,8,,11]),[4,select(selectApiConfigs)];case 3:return[4,removeUserFromOrg(e.sent(),r,s)];case 4:return(n=e.sent().id)?[4,put(actions.adminCenterUsers.removeUserFromOrgSuccess({userId:n,orgGuid:s}))]:[3,7];case 5:return e.sent(),n={severity:MessageSeverity.Success,content:isEqual("production","development")?"This user has been successfully removed from the organization":a({id:"adminCenterUsers.removeUserFromOrgSuccess",defaultMessage:"This user has been successfully removed from the organization",description:"Remove from org success message"})},[4,put(showMessage(n))];case 6:e.sent(),e.label=7;case 7:return[3,11];case 8:return o=e.sent(),console.log(o),[4,put(showMessage({severity:MessageSeverity.Error,content:isEqual("production","development")?"Something went wrong while removing the user from the organization":a({id:"adminCenterUsers.removeUserFromOrgError",defaultMessage:"Something went wrong while removing the user from the organization",description:"Remove from org error message"})}))];case 9:return e.sent(),[4,put(actions.adminCenterUsers.removeUserFromOrgFailure())];case 10:return e.sent(),[3,11];case 11:return[2]}})}function updateUserStatusSaga(t){var r,s,a,n,o,i;return _ts_generator$3(this,function(e){switch(e.label){case 0:return s=t.payload,r=s.userId,s=s.status,[4,select(preferredLanguageSelector)];case 1:a=e.sent(),a=AIWareFormatMessage(a),e.label=2;case 2:return e.trys.push([2,8,,11]),[4,select(selectApiConfigs)];case 3:return[4,updateUserStatus(e.sent(),r,s)];case 4:return(n=e.sent(),o=n.id,n=n.status,o&&n)?[4,put(actions.adminCenterUsers.updateUserStatusSuccess({id:o,status:n}))]:[3,7];case 5:return e.sent(),o={severity:MessageSeverity.Success,content:isEqual("production","development")?"This user status successfully updated to ".concat(n):a({id:"adminCenterUsers.updateUserStatusSuccess",defaultMessage:"This user status has been successfully updated to {status}",description:"Update user status success message"},{status:n})},[4,put(showMessage(o))];case 6:e.sent(),e.label=7;case 7:return[3,11];case 8:return i=e.sent(),console.error(i),[4,put(actions.adminCenterUsers.updateUserStatusFailure())];case 9:return e.sent(),i={severity:MessageSeverity.Error,content:isEqual("production","development")?"This user status update failed":a({id:"adminCenterUsers.updateUserStatusFailure",defaultMessage:"This user status update failed",description:"Update user status failure message"})},[4,put(showMessage(i))];case 10:return e.sent(),[3,11];case 11:return[2]}})}function fetchUserOrganizationsSaga(t){var r,s,a;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,6]),r=t.payload.orgGuids,[4,select(selectApiConfigs)];case 1:return s=e.sent(),[4,Promise.all(r.map(function(e){return fetchUserOrganizations(s,e)}))];case 2:return a=e.sent(),a=a.map(function(e){return e.records}).flat(),[4,put(actions.adminCenterUsers.fetchUserOrganizationsSuccess({orgs:a}))];case 3:return e.sent(),[3,6];case 4:return a=e.sent(),console.log(a),[4,put(actions.adminCenterUsers.fetchUserOrganizationsFailure())];case 5:return e.sent(),[3,6];case 6:return[2]}})}function getUserApplicationRolesSaga(t){var r,s,a,n,o;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,5,,7]),[4,select(selectApiConfigs)];case 1:return r=e.sent(),o=t.payload,s=o.userId,[4,call(getUserApplicationRoles,r,s,r=o.orgId)];case 2:return s=e.sent(),a=s.user,n=s.organization,[4,put(actions.adminCenterUsers.setActiveSwitcherOrgId(r))];case 3:return e.sent(),[4,put(actions.adminCenterUsers.getUserApplicationRolesSuccess({userRoles:a.roles,orgRoles:n.roles}))];case 4:return e.sent(),[3,7];case 5:return o=e.sent(),console.log(o),[4,put(actions.adminCenterUsers.getUserApplicationRolesFailure())];case 6:return e.sent(),[3,7];case 7:return[2]}})}function updateUserApplicationRolesSaga(t){var r,s,a,n,o,i;return _ts_generator$3(this,function(e){switch(e.label){case 0:return[4,select(preferredLanguageSelector)];case 1:r=e.sent(),r=AIWareFormatMessage(r),e.label=2;case 2:return e.trys.push([2,9,,12]),s=t.payload.roles,[4,select(selectApiConfigs)];case 3:return a=e.sent(),[4,select(selectDetailPanelUserId)];case 4:return n=e.sent(),[4,select(selectActiveSwitcherOrgId)];case 5:return o=e.sent(),[4,call(updateUserApplicationRolesCall,a,{roleIds:s.map(function(e){return e.id}),orgId:o,userId:n})];case 6:return e.sent(),[4,put(actions.adminCenterUsers.updateUserRolesSuccess())];case 7:return e.sent(),o={severity:MessageSeverity.Success,content:isEqual("production","development")?"Updated user application role":r({id:"adminCenterUsers.updateUserRolesSuccess",defaultMessage:"Updated user application role",description:"Updated user application role"})},[4,put(showMessage(o))];case 8:return e.sent(),[3,12];case 9:return i=e.sent(),console.log(i),[4,put(actions.adminCenterUsers.updateUserRolesFailure())];case 10:return e.sent(),i={severity:MessageSeverity.Error,content:isEqual("production","development")?"Updating the user role failed":r({id:"adminCenterUsers.updateUserRolesFailure",defaultMessage:"Updating user role failed",description:"Update user roles failure message"})},[4,put(showMessage(i))];case 11:return e.sent(),[3,12];case 12:return[2]}})}function _ts_generator$2(s,a){var n,o,i,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,(t=i?[2&t[0],i.value]:t)[0]){case 0:case 1:i=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,o=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(i=0<(i=l.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))l.label=t[1];else if(6===t[0]&&l.label<i[1])l.label=i[1],i=t;else{if(!(i&&l.label<i[2])){i[2]&&l.ops.pop(),l.trys.pop();continue}l.label=i[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],o=0}finally{n=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function fetchUsersWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeEvery$1(actions.adminCenterUsers.fetchOrgUsersStart.type,fetchUsersSaga)];case 1:return e.sent(),[2]}})}function fetchUsersOnShowDeletedFilter(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.setShowDeletedUsers.type,fetchUsersSaga)];case 1:return e.sent(),[2]}})}function fetchUserByIdWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.fetchUserStart.type,fetchUserByIdSaga)];case 1:return e.sent(),[2]}})}function removeUserFromOrgWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.removeUserFromOrgStart.type,removeUserFromOrgSaga)];case 1:return e.sent(),[2]}})}function updateUserStatusWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.updateUserStatusStart.type,updateUserStatusSaga)];case 1:return e.sent(),[2]}})}function fetchUserOrganizationsWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.fetchUserOrganizationsStart.type,fetchUserOrganizationsSaga)];case 1:return e.sent(),[2]}})}function getUserApplicationRolesSagaWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.getUserApplicationRolesStart.type,getUserApplicationRolesSaga)];case 1:return e.sent(),[2]}})}function updateUserApplicationRolesSagaWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.updateUserRoles.type,updateUserApplicationRolesSaga)];case 1:return e.sent(),[2]}})}function searchUsersWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.setSearchTerm.type,searchUsersSaga)];case 1:return e.sent(),[2]}})}function _ts_generator$1(s,a){var n,o,i,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,(t=i?[2&t[0],i.value]:t)[0]){case 0:case 1:i=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,o=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(i=0<(i=l.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))l.label=t[1];else if(6===t[0]&&l.label<i[1])l.label=i[1],i=t;else{if(!(i&&l.label<i[2])){i[2]&&l.ops.pop(),l.trys.pop();continue}l.label=i[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],o=0}finally{n=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function rootSaga(){return _ts_generator$1(this,function(e){switch(e.label){case 0:return[4,all([fetchUsersWatcher(),removeUserFromOrgWatcher(),updateUserStatusWatcher(),fetchUserOrganizationsWatcher(),getUserApplicationRolesSagaWatcher(),updateUserApplicationRolesSagaWatcher(),fetchUserByIdWatcher(),searchUsersWatcher(),fetchUsersOnShowDeletedFilter()])];case 1:return e.sent(),[2]}})}function _define_property$1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function getAdminCenterUsersModule(){return{id:SLICE_NAME,reducerMap:_define_property$1({},SLICE_NAME,rootReducer),sagas:[rootSaga],initialActions:[]}}function _array_like_to_array$7(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$6(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$6(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest$6(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$6(e,t){return _array_with_holes$6(e)||_iterable_to_array_limit$6(e,t)||_unsupported_iterable_to_array$7(e,t)||_non_iterable_rest$6()}function _unsupported_iterable_to_array$7(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$7(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$7(e,t):void 0}var openUserDetailsPanel=function(e,t,r){e={name:AvailableComponents.USER_DETAILS_PANEL,config:{name:"User Table Settings",id:e}},r={type:AvailablePanels.APP_BAR_PANEL_TEMPLATE,marginTop:r?0:55,marginStart:r?0:80,size:EPanelSize.medium,parentPanelId:AvailableComponents.ADMIN_CENTER,dimmed:0,dimmedStatus:"dimParent",borderBottom:!0};t(mountPanel({panelId:AvailableComponents.USER_DETAILS_PANEL,microFrontend:e,panelConfig:r}))},UserContextMenu=function(e){var t=e.anchorEl,r=e.id,s=e.open,a=e.onClose,n=e.onClickDetails,o=e.onClickStatusChange,i=e.onClickRemoveFromOrg,l=e.userId,u=e.orgGuid,c=e.status,d=e.hasMultipleOrgs,p=e.isUserDetailsPanelOpen,m=void 0!==p&&p,p=e.firstName,x=void 0===p?"":p,p=e.lastName,f=void 0===p?"":p,p=e.email,g=void 0===p?"":p,e=contextMenuStyles({width:44}).classes,h=useDispatch(),p=useOrganizationPermissions(EAuthSubResourceType.User),_=p.hasPermission(EPermissionAction.Create),p=p.hasPermission(EPermissionAction.Delete),y=null==(y=useSelector(userSelector))?void 0:y.userId,b=useSelector(selectIsFullscreenEnabled),j=useSelector(selectIsSuperAdmin),v=useSelector(selectApiConfigs),_=l!==y&&(c===EUserStatus.deactivated?_:p),S=c===EUserStatus.deleted,y=!(l===y)&&!S&&d&&p,p=!S&&!d&&_,S=m&&j,d=_sliced_to_array$6(reactExports.useState(!1),2),_=d[0],E=d[1],j=_sliced_to_array$6(reactExports.useState(!1),2),d=j[0],R=j[1],j=_sliced_to_array$6(reactExports.useState(!1),2),U=j[0],w=j[1],j=_sliced_to_array$6(reactExports.useState(),2),I=j[0],A=j[1],j=m&&!_isNil(I)&&!I;reactExports.useEffect(function(){m&&s&&scimIds_api.fetchScimIds(v,l).then(function(e){return A(!!e.length)}).catch(function(){return A(!1)})},[v,l,m,s]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ConfirmDialog,{isOpen:_,testId:"ac-user-context.deactivate",title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-confirm-title",defaultMessage:"Deactivate User",description:"User Detail delete user confirm title"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-confirm-description",defaultMessage:"Are you sure you want to deactivate this user?",description:"User Detail deativate user confirm description"}),cancelLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-cancel",defaultMessage:"Cancel",description:"User Detail deactivate user confirm cancel"}),confirmLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-confirm",defaultMessage:"Confirm",description:"User Detail deactivate confirm btn"}),onClose:function(){return E(!1)},onConfirm:function(){h(actions.adminCenterUsers.updateUserStatusStart({userId:l,status:EUserStatus.deactivated})),E(!1)}}),jsxRuntimeExports.jsx(ConfirmDialog,{isOpen:d,testId:"impersonate-user-confirm",title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-title",defaultMessage:"Impersonate User",description:"User Detail impersonate user confirm title"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-description",defaultMessage:"Are you sure you want to impersonate this user?",description:"User Detail impersonate user confirm description"}),cancelLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-cancel",defaultMessage:"Cancel",description:"User Detail impersonate user confirm cancel"}),confirmLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-btn",defaultMessage:"Impersonate",description:"User Detail impersonate user confirm btn"}),onClose:function(){return R(!1)},onConfirm:function(){h(impersonateUserStart({userId:l,firstName:x,lastName:f,orgGuid:u})),R(!1),setTimeout(function(){h(unmountAllPanel(null))},600)}}),jsxRuntimeExports.jsx(ConfirmDialog,{isOpen:U,testId:"request-password-reset-confirm",title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-title",defaultMessage:"Request Password Change",description:"User Detail request password reset confirm title"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-description",defaultMessage:"Are you sure you want to request password change for user {userName}? The user must change password the next time he/she logs in.",values:{userName:"".concat(x," ").concat(f)},description:"User Detail request password reset confirm description"}),cancelLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-cancel",defaultMessage:"Cancel",description:"User Detail request password reset confirm cancel"}),confirmLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-btn",defaultMessage:"Yes",description:"User Detail request password reset confirm btn"}),onClose:function(){return w(!1)},onConfirm:function(){h(requestPasswordResetStart({userId:l,email:g})),w(!1)}}),jsxRuntimeExports.jsx(Popover,{anchorEl:t,id:r,open:s,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:jsxRuntimeExports.jsxs(MenuList,{role:"menu",className:e.menuList,"data-testid":"admin-center-user.menu","data-test":"admin-center-user.menu",sx:{padding:"7.5px"},children:[S&&jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user-context.menu-item.impersonate-user","data-test":"context-menu-item",onClick:function(){a(),R(!0)},className:e.menuItem,sx:{cursor:"pointer"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-btn",defaultMessage:"Impersonate User",description:"User Detail row context menu impersonate user"})}),!m&&jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user-context.menu-item.user-details","data-test":"context-menu-item",onClick:function(e){null!=n&&n(),openUserDetailsPanel(l,h,b)},className:e.menuItem,sx:{cursor:"pointer"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.open-user-details-panel-btn",defaultMessage:"User Details",description:"User Detail row context menu"})}),jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user.menu-item.status-update","data-test":"context-menu-item",onClick:function(){a(),c===EUserStatus.active?E(!0):h(actions.adminCenterUsers.updateUserStatusStart({userId:l,status:EUserStatus.active})),null!=o&&o()},sx:{cursor:"pointer"},className:e.menuItem,disabled:!p,children:c===EUserStatus.deactivated?jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users.user-row.activate-btn",defaultMessage:"Activate",description:"Activate button in the user row context menu"}):jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users.user-row.deactivate-btn",defaultMessage:"Deactivate",description:"Deactivate button in the user row context menu"})}),jsxRuntimeExports.jsx(MenuItem,{onClick:function(){null!=i&&i()},className:e.menuItem,"data-test":"context-menu-item",disabled:!y,sx:{cursor:y?"pointer":"not-allowed"},"data-testid":"admin-center-user.menu-item.remove-from-org",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users.user-row.remove-from-org-btn",defaultMessage:"Remove from Org",description:"Remove from Org button in the user row context menu"})}),j&&jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user-context.menu-item.request-password-change","data-test":"context-menu-item",onClick:function(){a(),w(!0)},className:e.menuItem,sx:{cursor:"pointer"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-change-btn",defaultMessage:"Request Password Change",description:"User Detail row context menu request password change"})})]})})]})};function _array_like_to_array$6(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$5(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$5(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest$5(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$5(e,t){return _array_with_holes$5(e)||_iterable_to_array_limit$5(e,t)||_unsupported_iterable_to_array$6(e,t)||_non_iterable_rest$5()}function _unsupported_iterable_to_array$6(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$6(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$6(e,t):void 0}var useStyles$2=makeStyles()(function(e,t){return t.status,{userAvatar:{border:"2px solid #FFFFFF",height:"40px",width:"40px",marginRight:"14px",fontSize:"14px",color:"white"},row:{padding:"13px",height:"100%",overflow:"hidden",boxSizing:"border-box","&:hover":{backgroundColor:"#f2f5f9",cursor:"pointer"}},userName:{alignSelf:"center"},truncate:{paddingRight:"20px","& p":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}}),UserRow=function(e){var e=e.user,t=e.id,r=e.imageUrl,s=e.name,a=e.firstName,n=e.lastName,o=e.email,i=e.lastLoginDateTime,l=e.status,u=e.organizationGuids,u=void 0===u?[]:u,c=e.organization,e=e.avatarColor,d=useStyles$2({status:l}).classes,p=_sliced_to_array$5(reactExports.useState(null),2),m=p[0],x=p[1],p=m?"contextMenuId-".concat(t):void 0,f=useDispatch(),g=useSelector(selectIsFullscreenEnabled);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{direction:"row",justifyContent:"space-between",alignItems:"center",container:!0,"data-testid":"admin-center-org-user-row-".concat(t),"data-test":"admin-center-org-user-row-".concat(t),className:d.row,children:[jsxRuntimeExports.jsxs(Grid,{container:!0,item:!0,xs:11,alignItems:"center",onClick:function(e){m||openUserDetailsPanel(t,f,g)},children:[jsxRuntimeExports.jsxs(Grid,{sx:{display:"flex"},xs:4,item:!0,className:d.truncate,"data-testid":"admin-center-org-user.avatar-name-col","data-test":"admin-center-org-user.avatar-name-col",children:[r?jsxRuntimeExports.jsx(Avatar,{alt:a+" "+n,src:r,className:d.userAvatar}):jsxRuntimeExports.jsx(Avatar,{className:d.userAvatar,sx:{background:e},children:(r=n||"","".concat(null==(e=a||"")||null==(e=e.charAt(0))?void 0:e.toUpperCase()).concat(null==r||null==(e=r.charAt(0))?void 0:e.toUpperCase()))}),jsxRuntimeExports.jsx(Tooltip,{title:a+" "+n,arrow:!0,children:jsxRuntimeExports.jsx(Typography,{className:d.userName,variant:"body2",sx:{fontWeight:400},"data-testid":"admin-center-org-user.user-name","data-test":"admin-center-org-user.user-name",children:a+" "+n})})]}),jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,className:d.truncate,"data-testid":"admin-center-org-user.email-col","data-test":"admin-center-org-user.email-col",children:o&&jsxRuntimeExports.jsx(CopyText,{id:"admin-center-org-user.email",value:s||o,variant:"body2",iconPosition:TCopyIconPosition.Right,sx:{fontWeight:400}})}),jsxRuntimeExports.jsx(Grid,{xs:3,item:!0,"data-testid":"admin-center-org-user.last-login-col","data-test":"admin-center-org-user.last-login-col",children:i&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:"-6px",fontWeight:400},children:new Date(i).toLocaleDateString()}),jsxRuntimeExports.jsx(Typography,{variant:"caption",children:index.formatTime(new Date(i))})]})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0,"data-testid":"admin-center-org-user.status-col","data-test":"admin-center-org-user.status-col",children:jsxRuntimeExports.jsx(UserStatusBadge,{status:l})})]}),jsxRuntimeExports.jsxs(Grid,{item:!0,xs:1,sx:{textAlign:"end"},"data-testid":"admin-center-org-user.menu-col","data-test":"admin-center-org-user.menu-col",children:[jsxRuntimeExports.jsx(IconButton,{"data-testid":"user-row-menu-button-".concat(t),"data-test":"user-row-menu-button-".concat(t),onClick:function(e){e.stopPropagation(),x(e.currentTarget)},size:"small",children:jsxRuntimeExports.jsx(MoreVert,{fontSize:"small"})}),jsxRuntimeExports.jsx(UserContextMenu,{firstName:a,lastName:n,anchorEl:m,id:p,open:!!m,onClickDetails:function(){x(null)},onClickStatusChange:function(){x(null)},onClickRemoveFromOrg:function(){x(null)},onClose:function(){x(null)},userId:t||"",orgGuid:(null==c?void 0:c.guid)||"",hasMultipleOrgs:1<u.length,status:l,"data-testid":"admin-center-org-user.menu-icon","data-test":"admin-center-org-user.menu-icon",email:o})]})]}),jsxRuntimeExports.jsx(Divider,{})]})},TableInfiniteScroll=tableInfiniteScroll.jsx.TableInfiniteScroll,TableHeader=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{direction:"row",justifyContent:"space-between",alignItems:"center",item:!0,container:!0,xs:12,"data-testid":"admin-center-org-user-table-header","data-test":"admin-center-org-user-table-header",sx:{pl:"13px",pr:"13px"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:11,children:[jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,"data-test":"os-admin-center.org-user-table-header.name",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.name-col",defaultMessage:"Name",description:"Name column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,"data-test":"os-admin-center.org-user-table-header.email",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.email-col",defaultMessage:"Email",description:"Email column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:3,item:!0,"data-test":"os-admin-center.org-user-table-header.last-login",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.last-login-col",defaultMessage:"Last Login",description:"Last Login column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0,"data-test":"os-admin-center.org-user-table-header.status",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.status-col",defaultMessage:"Status",description:"Status column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Divider,{})]})},UserTableContent=reactExports.memo(function(e){var t=e.users,r=e.status;return jsxRuntimeExports.jsx(TableInfiniteScroll,{hasMore:!!e.hasMore,fetchMore:e.onLoadMore,fetchOnMount:"idle"===r,offset:e.offset||0,items:t,itemHeight:68,isLoading:"loading"===r||"idle"===r,error:"failure"===r,TableRowComponent:function(e){var t=e.item;return jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"68px"},"data-test":"users-table-row",children:jsxRuntimeExports.jsx(UserRow,{user:t})},e.index)},TableHeaderComponent:jsxRuntimeExports.jsx(TableHeader,{}),adjustTableHeight:-40,TableEmptyStateComponent:jsxRuntimeExports.jsx(NullState,{header:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users-table.empty.header",defaultMessage:"No Search Results Found",description:"Header text for empty search results"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users-table.empty.description",defaultMessage:"There are no users that match your search",description:"No search results description"}),image:img$J})})}),UserTable=function(){var e=useSelector(selectOrgUsers),t=e.users,t=void 0===t?[]:t,r=e.hasMore,e=e.offset,s=useSelector(selectStatus),a=useDispatch(),n=reactExports.useCallback(function(){a(actions$1.fetchOrgUsersStart())},[a]);return jsxRuntimeExports.jsx(UserTableContent,{users:t,hasMore:r,offset:e,status:s,onLoadMore:n})},inviteUsersPanel="INVITE_USERS_PANEL",inviteRequestsPanel="INVITE_REQUESTS_PANEL",handleClickInviteUsers=function(e,t,r,s){e(mountPanel({panelId:inviteUsersPanel,microFrontend:{name:inviteUsersPanel,config:{name:"Invite Users",organizationId:r||void 0,organizationGuid:s||void 0}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:t?0:55,marginStart:t?0:80,size:"medium",parentPanelId:"ADMIN_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))},handleViewRequests=function(e,t){e(mountPanel({panelId:inviteRequestsPanel,microFrontend:{name:inviteRequestsPanel,config:{name:"Invite Requests"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:t?0:55,marginStart:t?0:80,size:"medium",parentPanelId:"ADMIN_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0,header:{title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center.users.button.invite-requests",defaultMessage:"Invite Requests",description:"Invite Requests header title"})}}}))},userLabels=function(e){return{panelHeader:e.formatMessage({id:"ac-user-details-header-title",defaultMessage:"USER DETAILS",description:"User details label"}),panelCloseTitle:e.formatMessage({id:"ac-user-details-header-close-btn",defaultMessage:"Close Panel",description:"Close Panel label"}),menuItemLabel:e.formatMessage({id:"ac-user-details-header-edit-btn",defaultMessage:"Menu",description:"User details menu label"}),logoAltTitle:e.formatMessage({id:"ac-user-detail-header-image-alt",defaultMessage:"User Avatar",description:"Alt image for User Avatar"}),lastLoginLabel:e.formatMessage({id:"ac-user-detail-header-last-login.label",defaultMessage:"Last Login",description:"Last Login label"}),activeUserLabel:e.formatMessage({id:"ac-users.user-row.activate-user-btn",defaultMessage:"Activate User",description:"Activate button in the user row context menu"}),deactivateUserLabel:e.formatMessage({id:"ac-users.user-row.deactivate-user-btn",defaultMessage:"Deactivate User",description:"Deactivate button in the user row context menu"}),removeOrgLabel:e.formatMessage({id:"ac-users.user-row.remove-user-from-org-btn",defaultMessage:"Remove from Org",description:"Remove from Org button in the user row context menu"})}},PANEL_ID=AvailableComponents.USER_DETAILS_PANEL,useStyles$1=makeStyles()(function(e){return{root:{display:"flex",flexDirection:"column"},header:{display:"flex",justifyContent:"space-between",padding:e.spacing(4),borderBottom:"0.5px solid ".concat(e.palette.divider),"& button":{height:"28px"}},tableWrapper:{height:"calc(100vh - 55px - 64px - 69px - 20px)",overflow:"hidden"},toolbar:{alignItems:"baseline","& button svg":{marginRight:"5px"},display:"flex",justifyContent:"center"},addUserBtn:{"& svg":{marginRight:"10px",height:"14px",width:"14px"}},searchBox:{display:"flex",flexGrow:1,alignItems:"center",justifyContent:"flex-end",padding:"0 16px"},headerButtons:{display:"flex",alignItems:"center"}}}),useStyles=makeStyles()(function(e){return{root:{display:"flex",flexDirection:"column",height:"calc(100vh - 55px - 5px)",alignItems:"stretch",justifyContent:"space-between"},panelRoot:{width:"100%"},panelContainer:{display:"flex",flexDirection:"column",width:"100%"},panelBody:{display:"flex",flexGrow:1},panelLoading:{height:300},panelContent:{width:"100%",padding:"0"},tabsContainer:{"& .Sdk-Mui-selected":{color:"black"},"& .Sdk-MuiTabs-indicator":{backgroundColor:"#000"}},tabsParent:{paddingLeft:e.spacing(4),"& div":{borderBottom:"none"},"& div button":{fontFamily:"Nunito",fontWeight:400,flex:"0 1 auto !important",minWidth:"unset"}},divider:{opacity:.9},secondBox:{display:"flex",flexDirection:"column",flexGrow:1},orgAvatar:{border:"2px solid #FFFFFF",height:"40px",width:"40px",marginRight:"14px",fontSize:"14px",color:"white",fontWeight:400,lineHeight:"20px"},appContainer:{display:"flex",width:"100%",padding:"20px 0",flexDirection:"row",alignItems:"center"},roleBox:{width:"30%",display:"flex",alignItems:"center",justifyContent:"flex-start"},searchContainer:{display:"flex",alignItems:"center",width:"360px",border:"2px solid #E1E6ED",borderRadius:"28px",padding:"8px",justifyContent:"space-between",backgroundColor:"#FAFAFA",marginTop:"40px"},searchInput:{border:"0",fontFamily:"'Nunito'",display:"flex",alignItems:"center",width:"88%",justifyContent:"center",textAlign:"left",backgroundColor:"#FAFAFA",outline:"none"}}}),headerUseStyles=makeStyles()(function(e){return{headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end",paddingRight:"10px"},header:{alignItems:"center",display:"flex",justifyContent:"space-between",height:"55px",margin:"10px 10px 10px 30px"},title:{color:"#5C6269"},cardContainer:{display:"flex",padding:"20px 10px 20px 10px"},cardImgContainer:{position:"relative",marginLeft:"20px"},email:{color:"#5C6269",fontWeight:"400"},login:{color:"#2A323C",fontWeight:"400"},userAvatar:{border:"2px solid #FFFFFF",height:"90px",width:"90px",fontSize:"35px",color:"white"},statusLabel:{position:"absolute",bottom:"2px",left:"50%",right:"50%",display:"flex",justifyContent:"center"},divider:{opacity:.9},orgsName:{color:"black",fontWeight:400,fontSize:"12px",maxHeight:"26px",paddingTop:"1px",transform:"translateY(1px)",marginRight:"14px",maxWidth:"130px",minWidth:"130px","& fieldset":{border:"1px solid #D5DFE9"}}}}),UserDetailCard=function(e){var e=e.userData,t=useIntl(),r=headerUseStyles().classes,t=userLabels(t),s=t.logoAltTitle,t=t.lastLoginLabel,a=e.imageUrl,n=e.avatarColor,o=e.firstName,i=e.lastName,l=e.lastLoginDateTime,u=e.status,c=e.email,d=e.id,e=e.name;return jsxRuntimeExports.jsxs(Box,{className:r.cardContainer,children:[jsxRuntimeExports.jsxs(Box,{className:r.cardImgContainer,children:[a?jsxRuntimeExports.jsx(Avatar,{alt:s,src:a,className:r.userAvatar,sx:{border:"2px solid rgb(255, 255, 255)",height:"90px",width:"90px",fontSize:"35px",color:"white"},"data-testid":"ac-user-details-header-avatar","data-test":"ac-user-details-header-avatar"}):jsxRuntimeExports.jsx(Avatar,{className:r.userAvatar,sx:{background:n,border:"2px solid rgb(255, 255, 255)",height:"90px",width:"90px",fontSize:"35px",color:"white"},"data-testid":"ac-user-details-header-avatar-fallback","data-test":"ac-user-details-header-avatar-fallback",children:(s=i||"","".concat(null==(a=o||"")||null==(a=a.charAt(0))?void 0:a.toUpperCase()).concat(null==s||null==(a=s.charAt(0))?void 0:a.toUpperCase()))}),jsxRuntimeExports.jsx("div",{className:r.statusLabel,"data-testid":"ac-user-details-status-badge-wrapper","data-test":"ac-user-details-status-badge-wrapper",children:jsxRuntimeExports.jsx(UserStatusBadge,{status:u})})]}),jsxRuntimeExports.jsxs(Box,{sx:{pl:2},children:[jsxRuntimeExports.jsx(Box,{sx:{mb:1},children:jsxRuntimeExports.jsx(Typography,{variant:"h1","data-testid":"ac-user-detail-first-and-last-name","data-test":"ac-user-detail-first-and-last-name",children:"".concat(o," ").concat(i)})}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(CopyText,{id:"ac-user-detail-email-address",value:e||c||"",iconPosition:TCopyIconPosition.Right})}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(CopyText,{id:"ac-user-detail-id",value:d||"",variant:"caption",iconPosition:TCopyIconPosition.Right})}),l&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",className:r.email,children:t}),jsxRuntimeExports.jsx(Typography,{variant:"body2",className:r.login,"data-testid":"ac-user-detail-last-login","data-test":"ac-user-detail-last-login",children:new Date(l).toLocaleDateString("en-us",{day:"numeric",year:"numeric",month:"long"})})]})]})]})};function _array_like_to_array$5(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$4(e){if(Array.isArray(e))return e}function _array_without_holes$3(e){if(Array.isArray(e))return _array_like_to_array$5(e)}function _iterable_to_array$3(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit$4(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest$4(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread$3(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$4(e,t){return _array_with_holes$4(e)||_iterable_to_array_limit$4(e,t)||_unsupported_iterable_to_array$5(e,t)||_non_iterable_rest$4()}function _to_consumable_array$3(e){return _array_without_holes$3(e)||_iterable_to_array$3(e)||_unsupported_iterable_to_array$5(e)||_non_iterable_spread$3()}function _unsupported_iterable_to_array$5(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$5(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$5(e,t):void 0}var UserDetailHeaderActions=function(e){var e=e.userData,t=useIntl(),r=useDispatch(),s=reactExports.useRef(!0),a=headerUseStyles().classes,t=userLabels(t).menuItemLabel,n=e.id,o=e.status,i=(e.organizationGuids,e.organization),l=_sliced_to_array$4(reactExports.useState(null),2),u=l[0],c=l[1],l=u?"contextMenuId-".concat(n):void 0,d=useSelector(selectIsSuperAdmin),p=useSelector(selectUserOrgs),m=useSelector(selectAdminCenterOrgIdString),x=_sliced_to_array$4(reactExports.useState(i),2),f=x[0],g=x[1],x=Boolean(d&&1<p.length&&(null==i?void 0:i.id));reactExports.useEffect(function(){var t,e;0!==p.length&&(t=m&&"0"!==m&&m||(null==i?void 0:i.id),e=p.find(function(e){return"".concat(e.id)===t}),g(e||p[0]))},[p]);return reactExports.useEffect(function(){0===p.length||(null==i?void 0:i.id)===(null==f?void 0:f.id)&&s.current||n&&null!=f&&f.id&&r(actions.adminCenterUsers.getUserApplicationRolesStart({userId:"".concat(n),orgId:"".concat(f.id)}))},[f,p]),reactExports.useEffect(function(){s.current&&(s.current=!1)},[]),jsxRuntimeExports.jsxs("div",{className:a.headerActionContainer,children:[x&&jsxRuntimeExports.jsx(Select,{name:"orgs-select",className:a.orgsName,sx:{fontSize:"12px"},value:null==f||null==(d=f.id)?void 0:d.toString(),onChange:function(e){var t=e.target.value,e=p.find(function(e){return e.id===t});e&&g(e)},inputProps:{"data-testid":"ac-user-detail-select-org-name"},MenuProps:{PaperProps:{style:{maxHeight:300}}},children:_to_consumable_array$3(p).filter(function(e){return"deleted"!==e.status}).sort(function(e,t){return e&&t&&e.name&&t.name?e.name.localeCompare(t.name):0}).map(function(e,t){return jsxRuntimeExports.jsx(MenuItem,{value:null==e?void 0:e.id,disabled:"deleted"===e.status,"data-testid":"ac-user-detail-select-option","data-test":"ac-user-detail-select-option",children:(null==e?void 0:e.name)&&index.truncatedString(e.name,22)},"".concat(e.guid,"+").concat(t))})}),jsxRuntimeExports.jsx(Tooltip,{title:t,"data-testid":"ac-user-details-header.user-menu-button","data-test":"ac-user-details-header.user-menu-button",children:jsxRuntimeExports.jsx(IconButton,{"aria-labelledby":"ac-user-details-header.user-menu-button","data-testid":"ac-user-details-header.user-menu-button","data-test":"ac-user-details-header.user-menu-button",size:"medium",onClick:function(e){return c(e.currentTarget)},children:jsxRuntimeExports.jsx(MoreVert,{})})}),jsxRuntimeExports.jsx(UserContextMenu,{anchorEl:u,id:l,open:!!u,onClickRemoveFromOrg:function(){var e;n&&null!=f&&f.guid&&(r(actions.adminCenterUsers.removeUserFromOrgStart({userId:n,orgGuid:f.guid})),e=p.find(function(e){return e.guid!==f.guid}),g(e),c(null))},onClose:function(){return c(null)},hasMultipleOrgs:1<p.length,userId:n||"",orgGuid:(null==f?void 0:f.guid)||(null==i?void 0:i.guid)||"",status:o,"data-testid":"admin-center-org-user.menu-icon","data-test":"admin-center-org-user.menu-icon",isUserDetailsPanelOpen:!0,firstName:e.firstName,lastName:e.lastName,email:e.email})]})},LoaderSkeletonItem=function(){return jsxRuntimeExports.jsxs(ListItem,{alignItems:"center",sx:{height:"80px"},children:[jsxRuntimeExports.jsx(ListItemAvatar,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"circular",width:40,height:40})}),jsxRuntimeExports.jsx(ListItemText,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:150,height:30})}),jsxRuntimeExports.jsx(ListItemSecondaryAction,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:87,height:35})})]})},LoaderSkeleton=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:250,height:20}),jsxRuntimeExports.jsxs(List,{children:[jsxRuntimeExports.jsx(LoaderSkeletonItem,{}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(LoaderSkeletonItem,{}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(LoaderSkeletonItem,{}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(LoaderSkeletonItem,{})]})]})};function _array_like_to_array$4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_without_holes$2(e){if(Array.isArray(e))return _array_like_to_array$4(e)}function _iterable_to_array$2(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array$2(e){return _array_without_holes$2(e)||_iterable_to_array$2(e)||_unsupported_iterable_to_array$4(e)||_non_iterable_spread$2()}function _unsupported_iterable_to_array$4(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$4(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$4(e,t):void 0}var avatarColorCache={},getAvatarColor$1=function(e){var t;return avatarColorCache[e]||(t=Math.floor(Math.random()*avatarColors.length),avatarColorCache[e]=avatarColors[t]),avatarColorCache[e]};function noRole(e){return{id:"no-role",appName:e,name:"No Role",description:"The user will not be able to access this application."}}var ApplicationsEmpty=function(){return useSelector(selectUserApplicationRoles)?jsxRuntimeExports.jsx(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",mb:2,children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-applications-tab-description",defaultMessage:"View the Applications this user has access to.",description:"User details applications tab description"})})}):jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C",mb:1},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-applications-tab-no-applications",defaultMessage:"No applications assigned to this user.",description:"User details applications tab no applications"})})},ApplicationRoleSelect=function(e){var a=e.app,n=useDispatch(),o=useSelector(selectUserApplicationRoles),e=groupBy(o,"appName"),t=reactExports.useMemo(function(){var e;return null==(e=a.roles)?void 0:e.filter(function(e){var t;return"super admin for the service account"!==(null==e||null==(e=e.name)||null==(t=e.toLowerCase)?void 0:t.call(e))})},[a]);return jsxRuntimeExports.jsx(Select,{size:"small",value:null!=(e=null==(e=e[a.appName])||null==(e=e[0])?void 0:e.id)?e:noRole(a.appName).id,onChange:function(e){var t,r=[],s=e.target.value;"no-role"===s?r=o.filter(function(e){return e.appName!==a.appName}):(t=a.roles.find(function(e){return e.id===s}),e=o.find(function(e){return e.appName===a.appName}),t&&e?r=o.map(function(e){return e.appName===a.appName?t:e}):t&&!e&&(r=_to_consumable_array$2(o).concat([t]))),n(actions$1.updateUserRoles({roles:r}))},sx:{width:"100%",height:"100%",color:"black",fontSize:"12px"},"data-testid":"os-ac-user-details-applications-role-select","data-test":"os-ac-user-details-applications-role-select",children:t.map(function(e){return jsxRuntimeExports.jsx(MenuItem,{value:e.id,children:e.name},e.id)})})},Applications=function(){var s=useStyles().classes,e=useSelector(selectUserOrgRoles),t=useSelector(selectUserApplicationRolesStatus),r=groupBy(e,"appName"),e=reactExports.useMemo(function(){return Object.keys(r).map(function(e){return{appName:e,label:upperCase(startCase(e)),roles:[noRole(e)].concat(_to_consumable_array$2(r[e]))}})},[r]);return"loading"===t?jsxRuntimeExports.jsx(LoaderSkeleton,{}):jsxRuntimeExports.jsxs(Stack,{height:"100%",children:[jsxRuntimeExports.jsx(ApplicationsEmpty,{}),jsxRuntimeExports.jsx("div",{style:{flex:"1 1 auto"},children:jsxRuntimeExports.jsx(VirtualFixedSizeList,{testId:"os-ac-user-details-applications-list",items:e,itemSize:80,memoized:!0,divider:!0,children:function(e){var t,r=e.item,e=e.index;return jsxRuntimeExports.jsxs(Box,{className:s.appContainer,children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",width:"70%"},children:[jsxRuntimeExports.jsx(Avatar,{className:s.orgAvatar,sx:{backgroundColor:getAvatarColor$1(r.label)},"data-testid":"os-ac-user-details-applications-avatar","data-test":"os-ac-user-details-applications-avatar",children:null!=r&&r.appName?"".concat(null==r||null==(t=r.appName)||null==(t=t.charAt(0))?void 0:t.toUpperCase()).concat(String(e)[0]):"--"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",component:"span",sx:{fontWeight:400,display:"flex",alignItems:"center",fontSize:"12px"},"data-testid":"ac-user-details-application-name","data-test":"ac-user-details-application-name",children:index.truncatedString(r.label,32)})]}),jsxRuntimeExports.jsx(Box,{className:s.roleBox,children:jsxRuntimeExports.jsx(ApplicationRoleSelect,{app:r})})]})}})})]})},usedColors=[],getAvatarColor=function(){var e=Math.floor(Math.random()*avatarColors.length);return usedColors.includes(e)?getAvatarColor():((usedColors=usedColors.length>=avatarColors.length/2?[]:usedColors).push(e),avatarColors[e])},Organizations=function(e){var s=e.userId,a=useStyles().classes,n=useDispatch(),e=useSelector(selectUserOrgs),t=null==(t=useSelector(userSelector))?void 0:t.userId,o=!(s===t)&&1<e.length;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C",mb:1},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-org-tab-description",defaultMessage:"View the Organizations that this user is currently a part of.",description:"User details org tab description"})}),e&&0<(null==e?void 0:e.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e.map(function(t,e){var r;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",py:4},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[null!=t&&t.imageUrl?jsxRuntimeExports.jsx(Avatar,{alt:"".concat(null==t||null==(r=t.name)||null==(r=r.charAt(0))?void 0:r.toUpperCase()).concat(String(e+1)[0]),src:null==t?void 0:t.imageUrl,className:a.orgAvatar,"data-testid":"ac-user-details-organization-image","data-test":"ac-user-details-organization-image"}):jsxRuntimeExports.jsx(Avatar,{className:a.orgAvatar,sx:{background:"".concat(getAvatarColor())},"data-testid":"ac-user-details-organization-fallback-image","data-test":"ac-user-details-organization-fallback-image",children:null!=t&&t.name?"".concat(null==t||null==(r=t.name)||null==(r=r.charAt(0))?void 0:r.toUpperCase()).concat(String(e)[0]):"--"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{fontWeight:400},"data-testid":"ac-user-details-organization-tab-org-name","data-test":"ac-user-details-organization-tab-org-name",children:null!=t&&t.name?t.name:""})]}),o&&jsxRuntimeExports.jsx(Button,{onClick:function(){var e;(e=t.guid||"")&&n(actions$1.removeUserFromOrgStart({userId:s,orgGuid:e}))},variant:"outlined",color:"primary",children:"Remove From Org"})]}),jsxRuntimeExports.jsx(Divider,{})]},"os-admin-center-org-row-".concat(t.id))})}):null]})};function _array_like_to_array$3(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$3(e){if(Array.isArray(e))return e}function _array_without_holes$1(e){if(Array.isArray(e))return _array_like_to_array$3(e)}function asyncGeneratorStep(e,t,r,s,a,n,o){try{var i=e[n](o),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(s,a)}function _async_to_generator(i){return function(){var e=this,o=arguments;return new Promise(function(t,r){var s=i.apply(e,o);function a(e){asyncGeneratorStep(s,t,r,a,n,"next",e)}function n(e){asyncGeneratorStep(s,t,r,a,n,"throw",e)}a(void 0)})}}function _iterable_to_array$1(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit$3(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest$3(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_without_properties(e,t){if(null==e)return{};var r,s=_object_without_properties_loose(e,t);if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r]);return s}function _object_without_properties_loose(e,t){if(null==e)return{};for(var r,s={},a=Object.keys(e),n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||(s[r]=e[r]);return s}function _sliced_to_array$3(e,t){return _array_with_holes$3(e)||_iterable_to_array_limit$3(e,t)||_unsupported_iterable_to_array$3(e,t)||_non_iterable_rest$3()}function _to_consumable_array$1(e){return _array_without_holes$1(e)||_iterable_to_array$1(e)||_unsupported_iterable_to_array$3(e)||_non_iterable_spread$1()}function _unsupported_iterable_to_array$3(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$3(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$3(e,t):void 0}function _ts_generator(s,a){var n,o,i,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,(t=i?[2&t[0],i.value]:t)[0]){case 0:case 1:i=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,o=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(i=0<(i=l.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))l.label=t[1];else if(6===t[0]&&l.label<i[1])l.label=i[1],i=t;else{if(!(i&&l.label<i[2])){i[2]&&l.ops.pop(),l.trys.pop();continue}l.label=i[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],o=0}finally{n=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var AclTab=function(){function e(){return t.apply(this,arguments)}var t,r=useDispatch(),s=useSelector(selectUserDetailPanelUserData)||{},a=s.acls,a=void 0===a?[]:a,n=s.id,o=void 0===n?"":n,n=s.organization,s=void 0===n?{}:n,n=s.guid,i=void 0===n?"":n,l=s.id,u=a.filter(function(e){return"organization"===(null==(e=split$1(null==e?void 0:e.objectId,"/"))?void 0:e[0])}),n=_sliced_to_array$3(reactExports.useState(u),2),c=n[0],d=n[1],s=_sliced_to_array$3(reactExports.useState(_uniqBy(u,function(e){return null==e||null==(e=e.organization)?void 0:e.id})),2),p=s[0],m=s[1],a=_sliced_to_array$3(reactExports.useState(p.length),2),x=a[0],f=a[1],n=_sliced_to_array$3(reactExports.useState(!1),2),s=n[0],g=n[1],h=reactExports.useRef(null),_=useSelector(selectApiConfigs);reactExports.useEffect(function(){p.length>x&&h.current&&(h.current.scrollTop=h.current.scrollHeight),f(p.length)},[p,x]),t=_async_to_generator(function(){var t;return _ts_generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=c.map(function(e){return e.organization,_object_without_properties(e,["organization"])}),[4,updateUserAcls(_,o,t)];case 1:return e.sent().id?(g(!1),r(showMessage({content:"User's ACLs have been updated successfully.",severity:MessageSeverity.Success}))):r(showMessage({content:"Error updating user ACLs",severity:MessageSeverity.Error})),[3,3];case 2:return t=e.sent(),console.error("Error updating user ACLs",t),r(showMessage({content:"Error updating user ACLs",severity:MessageSeverity.Error})),[3,3];case 3:return[2]}})});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C",mb:5},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-acl-tab-description",defaultMessage:"ACLs grant organizations and users access to content that lives outside of their account. This is ideal for multi-market accounts and reporting needs.",description:"User details org acl description"})}),jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{fontWeight:600,fontSize:"14px",mb:3},"data-testid":"os-admin-center-user-details-acl-tab-org-name-label",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-acl-tab-org-name",defaultMessage:"Organization Name",description:"User details org acl org name lable"})}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Box,{ref:h,sx:{height:"150px",overflowY:"auto"},children:[" ",p&&0<p.length?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:p.map(function(e,s){var t;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",py:1,justifyContent:"space-between"},"data-testid":"ac-user-details-acl-tab-org-acl-list-row",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{fontWeight:400,fontSize:"14px"},"data-testid":"ac-user-details-acl-tab-org-name","data-test":"ac-user-details-acl-tab-org-name",children:null!=e&&null!=(t=e.organization)&&t.name?e.organization.name:""}),jsxRuntimeExports.jsx(Box,{sx:{height:"40px"},children:!((null==(t=e)||null==(t=t.organization)?void 0:t.id)===(null==l?void 0:l.toString()))&&jsxRuntimeExports.jsx(IconButton,{onClick:function(){return r=s,e=p.filter(function(e,t){return t!==r}),t=p[r],m(e),d(c.filter(function(e){return(null==e||null==(e=e.organization)?void 0:e.id)!==(null==t||null==(e=t.organization)?void 0:e.id)})),void g(!0);var r,e,t},children:jsxRuntimeExports.jsx(RemoveOne,{})})})]}),jsxRuntimeExports.jsx(Divider,{})]},"os-admin-center-org-row-".concat(e.objectId))})}):null]}),jsxRuntimeExports.jsx(Box,{sx:{mt:5},children:jsxRuntimeExports.jsx(OrgTableSearchButton,{isUserDetailView:!0})}),jsxRuntimeExports.jsx(Box,{sx:{height:"260px"},children:jsxRuntimeExports.jsx(OrgsTable,{onAddOrg:function(e){e&&e.id&&(e={applicationId:i,objectType:"obj-access-grant",objectId:"organization/".concat(e.id),organizationId:e.id.toString(),organization:{id:e.id.toString(),name:e.name||""},userId:o,access:{owner:!1}},d(_uniqBy(_to_consumable_array$1(c).concat([e]),function(e){return"".concat(e.applicationId).concat(e.objectId)})),m(_uniqBy(_to_consumable_array$1(c).concat([e]),function(e){return null==e||null==(e=e.organization)?void 0:e.id})),g(!0))},isUserDetailView:!0})}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",justifyContent:"flex-end",mt:5},children:[jsxRuntimeExports.jsx(Button,{onClick:function(){d(u),m(_uniqBy(u,function(e){return null==e||null==(e=e.organization)?void 0:e.id})),g(!1)},variant:"text",size:"large",sx:{marginRight:"10px"},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:e,variant:"contained",color:"primary",disabled:!s,"data-testid":"ac-user-details-acl-tab-save-button",children:"Save"})]})]})};function _array_like_to_array$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$2(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array$2(e)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit$2(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest$2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},s=Object.keys(r);(s="function"==typeof Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):s).forEach(function(e){_define_property(t,e,r[e])})}return t}function ownKeys(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _sliced_to_array$2(e,t){return _array_with_holes$2(e)||_iterable_to_array_limit$2(e,t)||_unsupported_iterable_to_array$2(e,t)||_non_iterable_rest$2()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array$2(e)||_non_iterable_spread()}function _unsupported_iterable_to_array$2(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$2(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$2(e,t):void 0}var muiTabA11yProps=function(e){return{id:"user-details-tab-".concat(e),"aria-controls":"user-details-tabpanel-".concat(e)}},UserDetailTabs=function(e){var e=e.userId,r=useStyles().classes,t=_sliced_to_array$2(reactExports.useState(0),2),s=t[0],a=t[1],t=useSelector(selectIsSuperAdmin),t=[{label:"Applications",disabled:!1,id:"applications",component:jsxRuntimeExports.jsx(Box,{sx:{p:4,height:"calc(100vh - 310px)"},children:jsxRuntimeExports.jsx(Applications,{})})}].concat(_to_consumable_array(t?[{label:"Organizations",disabled:!1,id:"organizations",component:jsxRuntimeExports.jsx(Box,{sx:{p:4,height:"calc(100vh - 325px)",overflow:"auto"},children:jsxRuntimeExports.jsx(Organizations,{userId:e})})},{label:"ACL",disabled:!1,id:"acl",component:jsxRuntimeExports.jsx(Box,{sx:{p:6},children:jsxRuntimeExports.jsx(AclTab,{})})}]:[]));return jsxRuntimeExports.jsxs("div",{className:r.tabsContainer,"data-testid":"ac-user-details-panel-tabs","data-test":"ac-user-details-panel-tabs",children:[jsxRuntimeExports.jsx("div",{className:r.tabsParent,children:jsxRuntimeExports.jsx(Tabs,{sx:{"& .Sdk-MuiTab-root.Sdk-Mui-selected":{color:"#000000!important"}},onChange:function(e,t){a(t)},value:s,children:t.map(function(e,t){return jsxRuntimeExports.jsx(Tab,_object_spread_props(_object_spread({label:e.label,disabled:e.disabled},muiTabA11yProps(t)),{"data-testid":"".concat(e.id,"-tab"),"data-test":"".concat(e.id,"-tab")}),e.id)})})}),jsxRuntimeExports.jsx(Divider,{className:r.divider}),t.map(function(e,t){return jsxRuntimeExports.jsx("div",{className:r.secondBox,children:jsxRuntimeExports.jsx(TabPanel,{value:s,index:t,children:e.component})},e.id)})]})},PanelHeader=panelComponents.header,PanelContainer=panelComponents.container,PanelContent=panelComponents.content,MainLayout=function(e){var t=e.id,e=useIntl(),r=useDispatch(),e=userLabels(e).panelHeader,s=useSelector(selectUserDetailPanelUserData),a=useSelector(selectUserDetailPanelLoadingStatus),n=useSelector(selectIsFullscreenEnabled),o="loading"===a,a="failure"===a;return reactExports.useEffect(function(){t&&r(actions$1.fetchUserStart({userId:t}))},[r,t]),jsxRuntimeExports.jsxs(PanelContainer,{panelId:PANEL_ID,isFullScreen:n,children:[jsxRuntimeExports.jsx(PanelHeader,{title:e,testId:"ac-user-details.header-title",PanelActions:s&&jsxRuntimeExports.jsx(UserDetailHeaderActions,{userData:s}),onPanelClose:function(){r(hidePanel(PANEL_ID)),r(actions$1.resetUserDetailState())}}),jsxRuntimeExports.jsxs(PanelContent,{isLoading:o,isErrored:a,onRetry:function(){t&&r(actions$1.fetchUserStart({userId:t}))},children:[s&&jsxRuntimeExports.jsx(UserDetailCard,{userData:s}),jsxRuntimeExports.jsx(UserDetailTabs,{userId:t})]})]})},UserDetailsPanel=function(e){return jsxRuntimeExports.jsx(AIWareThemeProvider,{children:jsxRuntimeExports.jsx(DynamicModuleLoader,{modules:[getAdminCenterUsersModule(),getInstanceAdminCenterOrgsModule()],children:jsxRuntimeExports.jsx(AIWareIntlProvider,{children:jsxRuntimeExports.jsx(AIWareCacheProvider,{children:jsxRuntimeExports.jsx(MainLayout,{id:e.id,orgId:e.orgId})})})})})};function _array_like_to_array$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$1(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$1(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest$1(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$1(e,t){return _array_with_holes$1(e)||_iterable_to_array_limit$1(e,t)||_unsupported_iterable_to_array$1(e,t)||_non_iterable_rest$1()}function _unsupported_iterable_to_array$1(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$1(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$1(e,t):void 0}var TableSearchInputButton=tableSearchComponents.TableSearchInputButton,UserTableSearchButton=function(){var e=_sliced_to_array$1(reactExports.useState(""),2),t=e[0],r=e[1],e=_sliced_to_array$1(reactExports.useState(!1),2),s=e[0],a=e[1],e=useSelector(selectSearchTerm),n=useSelector(selectIsSearching),o=useDispatch(),i=reactExports.useRef(debounce(function(e){o(actions$1.setSearchTerm(e))},1e3)).current;return jsxRuntimeExports.jsx(TableSearchInputButton,{onChange:function(e){r(e.target.value),e.target.value?(o(actions$1.setIsSearching(!0)),i(e.target.value)):i("")},onClear:function(){r(""),o(actions$1.setSearchTerm(""))},onToggleSearch:function(){a(function(e){return!e})},testId:"admin-center-org-user-table-search",placeholderText:"Search by name",searchValue:e,inputValue:t,isSearchVisible:s,isSearching:n,searchItemTooltipText:"Users"})};function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes(e){if(Array.isArray(e))return e}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return n}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _unsupported_iterable_to_array(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}var UsersPanel=function(){var e=useStyles$1().classes,r=useDispatch(),t=useSelector(organizationInvites_selector.selectPendingOrgInvites),s=useSelector(selectAdminCenterOrgId),a=useSelector(selectAdminCenterOrgGuid),n=useSelector(selectIsFullscreenEnabled),o=useSelector(selectShowDeletedUsers),i=_sliced_to_array(reactExports.useState(null),2),i=(i[0],reactExports.useEffect(function(){r(actions$2.organizationInvitesState.fetchPendingInvitesStart(s))},[r,s]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("section",{className:e.root,children:jsxRuntimeExports.jsxs("header",{className:e.header,children:[jsxRuntimeExports.jsx(Box,{sx:{mr:2,display:"flex",alignItems:"center","& h5":{lineHeight:"28px"}},children:jsxRuntimeExports.jsx(Typography,{variant:"h5","data-testid":"os-admin-center-panel.users.table.header","data-test":"os-admin-center-panel.users.table.header",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.table.header",defaultMessage:"Users",description:"Users Header"})})}),jsxRuntimeExports.jsx(Box,{className:e.searchBox,sx:{maxWidth:n?"100%":"440px"},children:jsxRuntimeExports.jsx(UserTableSearchButton,{})}),jsxRuntimeExports.jsxs(Box,{className:e.headerButtons,children:[jsxRuntimeExports.jsxs(Button,{variant:"outlined",onClick:function(){return handleViewRequests(r,n)},"data-test":"os-admin-center-panel.users.table.requests-button",children:[jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.user-requests.btn",defaultMessage:"User Requests",description:"User Requests tab button"})," ","(",t.length,")"]}),jsxRuntimeExports.jsxs(Button,{variant:"contained",sx:{ml:"13px"},className:e.addUserBtn,onClick:function(){return handleClickInviteUsers(r,n,s,a)},"data-test":"os-admin-center-panel.users.table.invite-button",children:[jsxRuntimeExports.jsx(AddUser,{}),jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.invite-user.btn",defaultMessage:"Invite User",description:"Invite User tab button"})]})]}),jsxRuntimeExports.jsx(Box,{className:e.headerButtons,sx:{ml:2},children:jsxRuntimeExports.jsx(ContextMenu,{testId:"os-admin-center-panel.users.filters",Icon:jsxRuntimeExports.jsx(Filter,{}),menuItems:[{testId:"os-admin-center-panel.users.context.visbility-item",label:o?jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.context.hide-deleted",defaultMessage:"Hide Deleted Users",description:"Hide Deleted Users context menu"}):jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.context.show-deleted",defaultMessage:"Show Deleted Users",description:"Show Deleted Users context menu"}),icon:o?jsxRuntimeExports.jsx(VisibilityOffOutlined,{}):jsxRuntimeExports.jsx(VisibilityOutlined,{}),onClick:function(){var e,t;e=EUserTableContextActions.showDeleted,t=!o,e===EUserTableContextActions.showDeleted&&r(actions.adminCenterUsers.setShowDeletedUsers(t))}}]})})]})}),jsxRuntimeExports.jsx("div",{className:e.tableWrapper,children:jsxRuntimeExports.jsx(UserTable,{})})]}));return n?jsxRuntimeExports.jsx(AIWareThemeProvider,{children:i}):i};export{UserDetailsPanel,UsersPanel,actions,getAdminCenterUsersModule,initialState,namespace,rootReducer};
|
|
1
|
+
import{bA as _baseGetTag,bB as isObjectLike_1,bC as _nodeUtilExports,bD as _baseUnary,ac as getDefaultExportFromCjs,a0 as createSlice,bE as md5,ad as combineReducers,av as AvailableComponents,j as jsxRuntimeExports,b as AIWareThemeProvider,A as AIWareCacheProvider,u as useSelector,ar as selectIsSuperAdmin,ap as selectIsFullscreenEnabled,r as reactExports,B as Box,v as mountPanel,as as useIntl,p as hidePanel,_ as all,e as userSelector,a6 as selectApiConfigs,bF as EUserStatus,aG as img$J,aD as AvailablePanels,aH as EPanelSize,bG as impersonateUserStart,q as unmountAllPanel,bH as requestPasswordResetStart,J as takeEvery$1,am as takeLatest$1,N as put,K as select,a2 as call,aj as showMessage,ak as MessageSeverity,a9 as isEqual,al as AIWareFormatMessage,ah as preferredLanguageSelector,aA as selectOrgId,a8 as baseGraphQLApiWithError}from"./js-core.esm4.js";import{bo as _baseToString,bp as _castSlice,bq as _hasUnicode,br as _isIterateeCall,bs as _stringToArray,bt as toString_1,m as makeStyles,D as DynamicModuleLoader,A as AIWareIntlProvider,T as Typography,M as MemoizedFormattedMessage,B as Button,bu as AddUser,ar as Filter,Q as CustomTabs,p as Divider,d as TabPanel,S as Select,e as MenuItem,am as Tabs,an as Tab,h as _isNil,t as Popover,v as MenuList,Y as startCase,X as NullState,L as List,G as Grid,bv as RemoveOne}from"./js-core.esm7.js";import{o as organizationInvites_selector,b as actions$2,s as scimIds_api}from"./js-core.esm26.js";import{d as selectAdminCenterOrgId,q as selectAdminCenterOrgGuid,r as EUserTableContextActions,f as selectAdminCenterOrgIdString,e as contextMenuStyles,L as ListItem,b as ListItemAvatar,c as ListItemText,i as ListItemSecondaryAction,k as selectAdminCenterOrgParameter}from"./js-core.esm8.js";import{B as tableInfiniteScroll,S as Stack,aJ as ContextMenu,aL as VisibilityOutlined,G as debounce,A as Avatar,w as CopyText,aM as TCopyIconPosition,K as index,T as Tooltip,I as IconButton,F as panelComponents,N as tableSearchComponents,C as ConfirmDialog,aI as VirtualFixedSizeList,e as Skeleton}from"./js-core.esm9.js";import{useOrganizationPermissions,EAuthSubResourceType,EPermissionAction}from"./js-core.esm13.js";import{g as groupBy,u as upperCase}from"./js-core.esm79.js";import{w as getInstanceAdminCenterOrgsModule,O as OrgTableSearchButton,x as OrgsTable}from"./js-core.esm86.js";import{_ as _uniqBy}from"./js-core.esm42.js";import{V as VisibilityOffOutlined}from"./js-core.esm53.js";import{M as MoreVert}from"./js-core.esm30.js";import{u as useDispatch}from"./js-core.esm14.js";import"./js-core.esm43.js";import"./js-core.esm46.js";var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1,regexpTag="[object RegExp]";function baseIsRegExp$1(e){return isObjectLike(e)&&baseGetTag(e)==regexpTag}var _baseIsRegExp=baseIsRegExp$1,baseIsRegExp=baseIsRegExp$1,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsRegExp=_nodeUtilExports&&_nodeUtilExports.isRegExp,isRegExp$1=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isRegExp_1=isRegExp$1,baseToString=_baseToString,castSlice=_castSlice,hasUnicode=_hasUnicode,isIterateeCall=_isIterateeCall,isRegExp=isRegExp$1,stringToArray=_stringToArray,toString=toString_1,MAX_ARRAY_LENGTH=4294967295;function split(e,t,r){return r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=void 0),(r=void 0===r?MAX_ARRAY_LENGTH:r>>>0)?(e=toString(e))&&("string"==typeof t||null!=t&&!isRegExp(t))&&!(t=baseToString(t))&&hasUnicode(e)?castSlice(stringToArray(e),0,r):e.split(t,r):[]}var EInviteStatus,split_1=split,split$1=getDefaultExportFromCjs(split),inviteUsersPanel="INVITE_USERS_PANEL",inviteRequestsPanel="INVITE_REQUESTS_PANEL",handleClickInviteUsers=function(e,t,r,s){e(mountPanel({panelId:inviteUsersPanel,microFrontend:{name:inviteUsersPanel,config:{name:"Invite Users",organizationId:r||void 0,organizationGuid:s||void 0}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:t?0:55,marginStart:t?0:80,size:"medium",parentPanelId:"ADMIN_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))},handleViewRequests=function(e,t){e(mountPanel({panelId:inviteRequestsPanel,microFrontend:{name:inviteRequestsPanel,config:{name:"Invite Requests"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:t?0:55,marginStart:t?0:80,size:"medium",parentPanelId:"ADMIN_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0,header:{title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center.users.button.invite-requests",defaultMessage:"Invite Requests",description:"Invite Requests header title"})}}}))},SLICE_NAME="adminCenterUsers",PAGE_LIMIT=30;function _array_like_to_array$8(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_without_holes$5(e){if(Array.isArray(e))return _array_like_to_array$8(e)}function _define_property$4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$5(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$5(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread$2(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},s=Object.keys(r);(s="function"==typeof Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):s).forEach(function(e){_define_property$4(t,e,r[e])})}return t}function ownKeys$2(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$2(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _to_consumable_array$5(e){return _array_without_holes$5(e)||_iterable_to_array$5(e)||_unsupported_iterable_to_array$8(e)||_non_iterable_spread$5()}function _unsupported_iterable_to_array$8(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$8(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$8(e,t):void 0}(e=>{e.expired="expired",e.completed="completed"})(EInviteStatus=EInviteStatus||{});var namespace$1="adminCenterUsers",avatarColors=["#f94144ff","#f3722cff","#f8961eff","#f9844aff","#f9c74fff","#90be6dff","#43aa8bff","#4d908eff","#577590ff","#277da1ff"],prevIndex=0,initialState$1={status:"idle",users:[],offset:0,hasMore:!0,userDetailPanel:{userId:null,orgId:null,userData:null,loadingStatus:"idle"},activeSwitcherOrgId:null,userOrgs:[],userOrgsStatus:"idle",userRoles:[],initialUserRoles:[],userOrgRoles:[],userRolesUpdateStatus:"idle",userRolesStatus:"idle",searchTerm:"",showDeletedUsers:!1,isSearching:!1,isSearchInputVisible:!1,invites:[],invitesStatus:"idle",invitesHasMore:!0,invitesOffset:0},adminCenterSlice=createSlice({name:"".concat(SLICE_NAME,"/").concat(namespace$1),initialState:initialState$1,reducers:{fetchOrgUsersStart:function(e){e.status="loading"},fetchOrgUsersSuccess:function(e,t){e.status="success";var r=[],s=!(e.isSearching=!1),a=!1,n=void 0;try{for(var i,o=t.payload.records[Symbol.iterator]();!(s=(i=o.next()).done);s=!0){var l=i.value,u=md5((l.id||"")+(l.name||l.email||"")+l.lastLoginDateTime+(l.firstName||"")),c=parseInt(u,16)%avatarColors.length;c===prevIndex&&(c+1>avatarColors.length-1?--c:c+=1),prevIndex=c,r.push(_object_spread_props$2(_object_spread$2({},l),{avatarColor:avatarColors[c]}))}}catch(e){a=!0,n=e}finally{try{s||null==o.return||o.return()}finally{if(a)throw n}}a=_to_consumable_array$5(e.users).concat(_to_consumable_array$5(r));e.users=a.filter(function(t,e,r){return e===r.findIndex(function(e){return e.id===t.id})}),e.hasMore=t.payload.hasMore,e.offset=t.payload.nextOffset},fetchOrgUsersFailure:function(e){e.status="failure",e.isSearching=!1},removeUserFromOrgStart:function(e,t){e.status="loading"},removeUserFromOrgSuccess:function(e,t){e.status="success",e.users=_to_consumable_array$5(e.users).filter(function(e){return e.id!==t.payload.userId}),e.userOrgs=_to_consumable_array$5(e.userOrgs).filter(function(e){return e.guid!==t.payload.orgGuid}),e.offset=e.offset-1},removeUserFromOrgFailure:function(e){e.status="failure"},updateUserStatusStart:function(e,t){e.status="loading"},updateUserStatusSuccess:function(e,t){e.status="success";var r,s=e.users.findIndex(function(e){return e.id===t.payload.id});-1!==s&&((r=_to_consumable_array$5(e.users))[s]=_object_spread_props$2(_object_spread$2({},r[s]),{status:t.payload.status}),e.users=r),e.userDetailPanel.userId===t.payload.id&&(e.userDetailPanel.userData=_object_spread_props$2(_object_spread$2({},e.userDetailPanel.userData),{status:t.payload.status}))},updateUserStatusFailure:function(e){e.status="failure"},fetchUserStart:function(e,t){e.userDetailPanel.userId=t.payload.userId,e.userDetailPanel.orgId=t.payload.orgId||null,e.userDetailPanel.loadingStatus="loading"},fetchUserSuccess:function(e,t){var r=t.payload.user,s=avatarColors[5],a=e.users.find(function(e){return e.id===r.id});a&&a.avatarColor&&(s=a.avatarColor),e.userDetailPanel.userData=_object_spread_props$2(_object_spread$2({},t.payload.user),{avatarColor:s}),e.userDetailPanel.loadingStatus="success"},fetchUserFailure:function(e){e.userDetailPanel.loadingStatus="failure"},fetchUserOrganizationsStart:function(e,t){e.userOrgsStatus="loading"},fetchUserOrganizationsSuccess:function(e,t){e.userOrgs=t.payload.orgs,e.userOrgsStatus="success"},fetchUserOrganizationsFailure:function(e){e.userOrgsStatus="failure"},getUserApplicationRolesStart:function(e,t){e.userRolesStatus="loading"},getUserApplicationRolesSuccess:function(e,t){e.userRolesStatus="success",e.userRoles=t.payload.userRoles,e.initialUserRoles=t.payload.userRoles,e.userOrgRoles=t.payload.orgRoles},getUserApplicationRolesFailure:function(e){e.userRolesStatus="failure"},resetUserDetailState:function(e){e.userDetailPanel={userId:null,orgId:null,userData:null,loadingStatus:"idle"},e.userOrgs=[],e.userOrgsStatus="idle",e.userRoles=[],e.initialUserRoles=[],e.userOrgRoles=[],e.userRolesStatus="idle"},updateUserRoles:function(e,t){e.userRoles=t.payload.roles,e.userRolesUpdateStatus="pending"},updateUserRolesSuccess:function(e){e.userRolesUpdateStatus="success",e.initialUserRoles=e.userRoles},updateUserRolesFailure:function(e){e.userRolesUpdateStatus="failure",e.userRoles=e.initialUserRoles},setSearchTerm:function(e,t){e.searchTerm=t.payload,e.users=[],e.status="loading"},setIsSearching:function(e,t){e.isSearching=t.payload},setIsSearchInputVisible:function(e,t){e.isSearchInputVisible=t.payload},setShowDeletedUsers:function(e,t){e.showDeletedUsers=t.payload,e.offset=0,e.users=[],e.hasMore=!0,e.status="loading"},setActiveSwitcherOrgId:function(e,t){e.activeSwitcherOrgId=t.payload},fetchInvitesStart:function(e){e.invitesStatus="loading"},fetchInvitesSuccess:function(e,t){e.invitesStatus="success",e.invites=_to_consumable_array$5(e.invites).concat(_to_consumable_array$5(t.payload.invites)),e.invitesHasMore=t.payload.hasMore,e.invitesOffset=t.payload.nextOffset},fetchInvitesFailure:function(e){e.invitesStatus="failure"},resetInvitesState:function(e){e.invites=[],e.invitesStatus="idle",e.invitesHasMore=!0,e.invitesOffset=0}}}),actions$1=adminCenterSlice.actions,adminCenterUsers_state=adminCenterSlice.reducer;function _define_property$3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var namespace=SLICE_NAME,initialState=_define_property$3({},namespace$1,initialState$1),actions=_define_property$3({},namespace$1,actions$1),rootReducer=combineReducers(_define_property$3({},namespace$1,adminCenterUsers_state));function asyncGeneratorStep$1(e,t,r,s,a,n,i){try{var o=e[n](i),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(s,a)}function _async_to_generator$1(o){return function(){var e=this,i=arguments;return new Promise(function(t,r){var s=o.apply(e,i);function a(e){asyncGeneratorStep$1(s,t,r,a,n,"next",e)}function n(e){asyncGeneratorStep$1(s,t,r,a,n,"throw",e)}a(void 0)})}}function _define_property$2(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _object_spread$1(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},s=Object.keys(r);(s="function"==typeof Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):s).forEach(function(e){_define_property$2(t,e,r[e])})}return t}function ownKeys$1(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props$1(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _ts_generator$4(s,a){var n,i,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(o=2&t[0]?i.return:t[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,t[1])).done)return o;switch(i=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],i=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var parseFilter=function(e){var t=[];return null!=e&&e.name&&t.push('name: "'.concat(e.name,'"')),null!=e&&e.orgId&&t.push('organizationIds: ["'.concat(e.orgId,'"]')),null!=e&&e.statuses&&t.push("statuses: [".concat(e.statuses.join(","),"]")),t.join(" ")};function fetchOrgUsers(e,t,r,s){return _fetchOrgUsers.apply(this,arguments)}function _fetchOrgUsers(){return(_fetchOrgUsers=_async_to_generator$1(function(t,r,s,a){var n,i,o;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n="fetchOrgUsers",i="users",o=parseFilter(a),o="\n query ".concat(n," {\n ").concat(i," (offset: ").concat(r,", limit: ").concat(s," ").concat(o,") {\n records {\n id\n imageUrl\n name\n firstName\n lastName\n email\n lastLoginDateTime\n status\n organizationGuids\n organizationId\n organization {\n guid\n }\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:o,operationName:n},t))];case 1:return[2,e.sent()[i]]}})})).apply(this,arguments)}function removeUserFromOrg(e,t,r){return _removeUserFromOrg.apply(this,arguments)}function _removeUserFromOrg(){return(_removeUserFromOrg=_async_to_generator$1(function(t,r,s){var a,n,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n=a="removeUserFromOrganization",i="\n mutation ".concat(a," {\n ").concat(n,' (userId: "').concat(r,'", organizationGuid: "').concat(s,'") {\n id\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:i,operationName:a},t))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function updateUserStatus(e,t,r){return _updateUserStatus.apply(this,arguments)}function _updateUserStatus(){return(_updateUserStatus=_async_to_generator$1(function(t,r,s){var a,n,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n=a="updateUserStatus",i="\n mutation ".concat(a," {\n ").concat(n,' (input: {id: "').concat(r,'" status: ').concat(s,"}) {\n id\n status\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:i,operationName:a},t))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function fetchUserOrganizations(e,t){return _fetchUserOrganizations.apply(this,arguments)}function _fetchUserOrganizations(){return(_fetchUserOrganizations=_async_to_generator$1(function(t,r){var s,a,n;return _ts_generator$4(this,function(e){switch(e.label){case 0:return a="organizations",n="\n query ".concat(s="fetchUserOrganizations"," {\n ").concat(a,' (id: "').concat(r,'") {\n records {\n id\n name\n imageUrl\n guid\n status\n }\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:n,operationName:s},t))];case 1:return[2,e.sent()[a]]}})})).apply(this,arguments)}function updateUserApplicationRolesCall(e,t){return _updateUserApplicationRolesCall.apply(this,arguments)}function _updateUserApplicationRolesCall(){return(_updateUserApplicationRolesCall=_async_to_generator$1(function(t,r){var s,a,n,i,o,l;return _ts_generator$4(this,function(e){switch(e.label){case 0:return s=r.userId,a=r.orgId,n=r.roleIds,o=i="updateUser",l="\n mutation ".concat(i," ($input: UpdateUser!) {\n ").concat(o," (input: $input) {\n roles {\n id\n name\n appName\n description\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:l,operationName:i,variables:{input:{id:s,roleIds:n,organizationId:a}}},t))];case 1:return[2,e.sent()[o]]}})})).apply(this,arguments)}function getUserApplicationRoles(e,t,r){return _getUserApplicationRoles.apply(this,arguments)}function _getUserApplicationRoles(){return(_getUserApplicationRoles=_async_to_generator$1(function(t,r,s){var a,n;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n="\n query ".concat(a="getUserApplicationRoles"," {\n ").concat("organization",' (id: "').concat(s,'") {\n roles (isAppEventRole: false) {\n id\n name\n appName\n description\n }\n }\n ').concat("user",' (id: "').concat(r,'", organizationIds: ["').concat(s,'"]) {\n roles {\n id\n name\n appName\n description\n }\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:n,operationName:a},t))];case 1:return[2,e.sent()]}})})).apply(this,arguments)}function fetchOrgUserById(e,t,r){return _fetchOrgUserById.apply(this,arguments)}function _fetchOrgUserById(){return(_fetchOrgUserById=_async_to_generator$1(function(t,r,s){var a,n,i;return _ts_generator$4(this,function(e){switch(e.label){case 0:return i=s?', organizationIds: ["'.concat(s,'"]'):"",n="users",i="\n query ".concat(a="fetchUserById"," {\n ").concat(n,' (id: "').concat(r,'", includeAllOrgUsers: true ').concat(i," ) {\n records {\n id\n imageUrl\n name\n firstName\n lastName\n email\n lastLoginDateTime\n status\n organizationGuids\n organizationId\n acls {\n applicationId\n organizationId\n organization {\n id\n name\n }\n objectType\n objectId\n userId\n access {\n owner\n }\n }\n organization {\n id\n guid\n name\n applications{\n records{\n id\n name\n description\n }\n }\n }\n }\n }\n }\n "),[4,baseGraphQLApiWithError(_object_spread$1({query:i,operationName:a},t))];case 1:return[2,e.sent()[n].records[0]]}})})).apply(this,arguments)}function updateUserAcls(e,t,r){return _updateUserAcls.apply(this,arguments)}function _updateUserAcls(){return(_updateUserAcls=_async_to_generator$1(function(t,r,s){var a,n,i,o;return _ts_generator$4(this,function(e){switch(e.label){case 0:return n=a="updateUser",i="\n mutation ".concat(a," ($userId : ID!, $acls: [UserACLInput!]) {\n ").concat(n," (input: {id: $userId , acls: $acls} ) {\n id\n acls {\n applicationId\n organizationId\n organization {\n id\n name\n }\n objectType\n objectId\n userId\n access {\n owner\n }\n }\n }\n }\n "),o={userId:r,acls:s},[4,baseGraphQLApiWithError(_object_spread_props$1(_object_spread$1({query:i,operationName:a},t),{variables:o}))];case 1:return[2,e.sent()[n]]}})})).apply(this,arguments)}function fetchOrgInvites(e,t){return _fetchOrgInvites.apply(this,arguments)}function _fetchOrgInvites(){return(_fetchOrgInvites=_async_to_generator$1(function(t,r){var s,a,n;return _ts_generator$4(this,function(e){switch(e.label){case 0:return a="organization",n="\n query ".concat(s="fetchOrgInvites"," {\n ").concat(a,' (id: "').concat(r,'") {\n organizationInvites (inviteType : userInvite) {\n id\n status\n email\n userDetails\n passwordResetToken\n }\n }\n }\n '),[4,baseGraphQLApiWithError(_object_spread$1({query:n,operationName:s},t))];case 1:return[2,e.sent()[a].organizationInvites]}})})).apply(this,arguments)}var selectOrgUsers=function(e){e=(null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1])||{};return{users:e.users,hasMore:e.hasMore,offset:e.offset}},selectDetailPanelUserId=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userDetailPanel.userId},selectStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].status},selectUserOrgs=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userOrgs},selectUserOrgRoles=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userOrgRoles},selectUserApplicationRoles=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userRoles},selectUserApplicationRolesStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userRolesStatus},selectUserDetailPanelUserData=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userDetailPanel.userData},selectUserDetailPanelLoadingStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].userDetailPanel.loadingStatus},selectSearchTerm=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].searchTerm},selectShowDeletedUsers=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].showDeletedUsers},selectIsSearching=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].isSearching},selectIsSearchInputVisible=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].isSearchInputVisible},selectActiveSwitcherOrgId=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].activeSwitcherOrgId},selectInvitesData=function(e){e=(null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1])||{};return{invites:e.invites,hasMore:e.invitesHasMore,offset:e.invitesOffset}},selectInvitesStatus=function(e){return null==e||null==(e=e[SLICE_NAME])?void 0:e[namespace$1].invitesStatus};function _ts_generator$3(s,a){var n,i,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(o=2&t[0]?i.return:t[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,t[1])).done)return o;switch(i=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],i=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function fetchUserByIdSaga(t){var r,s,a,n,i,o,l;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,11,,13]),[4,select(selectApiConfigs)];case 1:return r=e.sent(),[4,select(selectAdminCenterOrgIdString)];case 2:return s=e.sent(),[4,select(selectAdminCenterOrgParameter)];case 3:return a=e.sent(),[4,select(selectIsSuperAdmin)];case 4:return n=e.sent(),i=t.payload.userId,[4,fetchOrgUserById(r,i,s||a)];case 5:if(o=e.sent())return null!=o&&o.id&&null!=(i=o.organization)&&i.id?[4,put(actions.adminCenterUsers.getUserApplicationRolesStart({userId:o.id,orgId:"".concat(o.organization.id)}))]:[3,7];throw new Error("User not found");case 6:e.sent(),e.label=7;case 7:return n&&null!=o&&o.organizationGuids?[4,put(actions.adminCenterUsers.fetchUserOrganizationsStart({orgGuids:o.organizationGuids}))]:[3,9];case 8:e.sent(),e.label=9;case 9:return[4,put(actions.adminCenterUsers.fetchUserSuccess({user:o}))];case 10:return e.sent(),[3,13];case 11:return l=e.sent(),console.log(l),[4,put(actions.adminCenterUsers.fetchUserFailure())];case 12:return e.sent(),[3,13];case 13:return[2]}})}function fetchUsers(t,r,s){var a,n,i;return _ts_generator$3(this,function(e){switch(e.label){case 0:return[4,select(selectApiConfigs)];case 1:return a=e.sent(),[4,select(selectAdminCenterOrgParameter)];case 2:return n=e.sent(),[4,select(selectOrgId)];case 3:return i=e.sent(),[4,fetchOrgUsers(a,s,PAGE_LIMIT,{name:t,orgId:null!=n?n:i,statuses:r})];case 4:return[2,e.sent().records]}})}function fetchUsersSaga(e){var t,r,s,a,n;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,7,,9]),[4,select(selectSearchTerm)];case 1:return t=e.sent(),[4,select(selectShowDeletedUsers)];case 2:return r=e.sent(),[4,select(selectOrgUsers)];case 3:return(a=e.sent(),s=a.offset,a=a.hasMore,n=Object.values(EUserStatus).filter(function(e){return r||e!==EUserStatus.deleted}),a)?[4,call(fetchUsers,t,n,s)]:[3,6];case 4:return a=e.sent(),[4,put(actions.adminCenterUsers.fetchOrgUsersSuccess({records:a,hasMore:PAGE_LIMIT===a.length,nextOffset:s+PAGE_LIMIT}))];case 5:e.sent(),e.label=6;case 6:return[3,9];case 7:return n=e.sent(),console.log(n),[4,put(actions.adminCenterUsers.fetchOrgUsersFailure())];case 8:return e.sent(),[3,9];case 9:return[2]}})}function searchUsersSaga(t){var r,s,a;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,6]),[4,select(selectShowDeletedUsers)];case 1:return r=e.sent(),s=Object.values(EUserStatus).filter(function(e){return r||e!==EUserStatus.deleted}),[4,call(fetchUsers,t.payload,s,0)];case 2:return s=e.sent(),[4,put(actions.adminCenterUsers.fetchOrgUsersSuccess({records:s,hasMore:PAGE_LIMIT===s.length,nextOffset:PAGE_LIMIT}))];case 3:return e.sent(),[3,6];case 4:return a=e.sent(),console.log(a),[4,put(actions.adminCenterUsers.fetchOrgUsersFailure())];case 5:return e.sent(),[3,6];case 6:return[2]}})}function removeUserFromOrgSaga(t){var r,s,a,n,i;return _ts_generator$3(this,function(e){switch(e.label){case 0:return s=t.payload,r=s.userId,s=s.orgGuid,[4,select(preferredLanguageSelector)];case 1:a=e.sent(),a=AIWareFormatMessage(a),e.label=2;case 2:return e.trys.push([2,8,,11]),[4,select(selectApiConfigs)];case 3:return[4,removeUserFromOrg(e.sent(),r,s)];case 4:return(n=e.sent().id)?[4,put(actions.adminCenterUsers.removeUserFromOrgSuccess({userId:n,orgGuid:s}))]:[3,7];case 5:return e.sent(),n={severity:MessageSeverity.Success,content:isEqual("production","development")?"This user has been successfully removed from the organization":a({id:"adminCenterUsers.removeUserFromOrgSuccess",defaultMessage:"This user has been successfully removed from the organization",description:"Remove from org success message"})},[4,put(showMessage(n))];case 6:e.sent(),e.label=7;case 7:return[3,11];case 8:return i=e.sent(),console.log(i),[4,put(showMessage({severity:MessageSeverity.Error,content:isEqual("production","development")?"Something went wrong while removing the user from the organization":a({id:"adminCenterUsers.removeUserFromOrgError",defaultMessage:"Something went wrong while removing the user from the organization",description:"Remove from org error message"})}))];case 9:return e.sent(),[4,put(actions.adminCenterUsers.removeUserFromOrgFailure())];case 10:return e.sent(),[3,11];case 11:return[2]}})}function updateUserStatusSaga(t){var r,s,a,n,i,o;return _ts_generator$3(this,function(e){switch(e.label){case 0:return s=t.payload,r=s.userId,s=s.status,[4,select(preferredLanguageSelector)];case 1:a=e.sent(),a=AIWareFormatMessage(a),e.label=2;case 2:return e.trys.push([2,8,,11]),[4,select(selectApiConfigs)];case 3:return[4,updateUserStatus(e.sent(),r,s)];case 4:return(n=e.sent(),i=n.id,n=n.status,i&&n)?[4,put(actions.adminCenterUsers.updateUserStatusSuccess({id:i,status:n}))]:[3,7];case 5:return e.sent(),i={severity:MessageSeverity.Success,content:isEqual("production","development")?"This user status successfully updated to ".concat(n):a({id:"adminCenterUsers.updateUserStatusSuccess",defaultMessage:"This user status has been successfully updated to {status}",description:"Update user status success message"},{status:n})},[4,put(showMessage(i))];case 6:e.sent(),e.label=7;case 7:return[3,11];case 8:return o=e.sent(),console.error(o),[4,put(actions.adminCenterUsers.updateUserStatusFailure())];case 9:return e.sent(),o={severity:MessageSeverity.Error,content:isEqual("production","development")?"This user status update failed":a({id:"adminCenterUsers.updateUserStatusFailure",defaultMessage:"This user status update failed",description:"Update user status failure message"})},[4,put(showMessage(o))];case 10:return e.sent(),[3,11];case 11:return[2]}})}function fetchUserOrganizationsSaga(t){var r,s,a;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,6]),r=t.payload.orgGuids,[4,select(selectApiConfigs)];case 1:return s=e.sent(),[4,Promise.all(r.map(function(e){return fetchUserOrganizations(s,e)}))];case 2:return a=e.sent(),a=a.map(function(e){return e.records}).flat(),[4,put(actions.adminCenterUsers.fetchUserOrganizationsSuccess({orgs:a}))];case 3:return e.sent(),[3,6];case 4:return a=e.sent(),console.log(a),[4,put(actions.adminCenterUsers.fetchUserOrganizationsFailure())];case 5:return e.sent(),[3,6];case 6:return[2]}})}function getUserApplicationRolesSaga(t){var r,s,a,n,i;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,5,,7]),[4,select(selectApiConfigs)];case 1:return r=e.sent(),i=t.payload,s=i.userId,[4,call(getUserApplicationRoles,r,s,r=i.orgId)];case 2:return s=e.sent(),a=s.user,n=s.organization,[4,put(actions.adminCenterUsers.setActiveSwitcherOrgId(r))];case 3:return e.sent(),[4,put(actions.adminCenterUsers.getUserApplicationRolesSuccess({userRoles:a.roles,orgRoles:n.roles}))];case 4:return e.sent(),[3,7];case 5:return i=e.sent(),console.log(i),[4,put(actions.adminCenterUsers.getUserApplicationRolesFailure())];case 6:return e.sent(),[3,7];case 7:return[2]}})}function updateUserApplicationRolesSaga(t){var r,s,a,n,i,o;return _ts_generator$3(this,function(e){switch(e.label){case 0:return[4,select(preferredLanguageSelector)];case 1:r=e.sent(),r=AIWareFormatMessage(r),e.label=2;case 2:return e.trys.push([2,9,,12]),s=t.payload.roles,[4,select(selectApiConfigs)];case 3:return a=e.sent(),[4,select(selectDetailPanelUserId)];case 4:return n=e.sent(),[4,select(selectActiveSwitcherOrgId)];case 5:return i=e.sent(),[4,call(updateUserApplicationRolesCall,a,{roleIds:s.map(function(e){return e.id}),orgId:i,userId:n})];case 6:return e.sent(),[4,put(actions.adminCenterUsers.updateUserRolesSuccess())];case 7:return e.sent(),i={severity:MessageSeverity.Success,content:isEqual("production","development")?"Updated user application role":r({id:"adminCenterUsers.updateUserRolesSuccess",defaultMessage:"Updated user application role",description:"Updated user application role"})},[4,put(showMessage(i))];case 8:return e.sent(),[3,12];case 9:return o=e.sent(),console.log(o),[4,put(actions.adminCenterUsers.updateUserRolesFailure())];case 10:return e.sent(),o={severity:MessageSeverity.Error,content:isEqual("production","development")?"Updating the user role failed":r({id:"adminCenterUsers.updateUserRolesFailure",defaultMessage:"Updating user role failed",description:"Update user roles failure message"})},[4,put(showMessage(o))];case 11:return e.sent(),[3,12];case 12:return[2]}})}function fetchInvitesSaga(e){var t,r,s;return _ts_generator$3(this,function(e){switch(e.label){case 0:return e.trys.push([0,5,,7]),[4,select(selectApiConfigs)];case 1:return t=e.sent(),[4,select(selectAdminCenterOrgIdString)];case 2:if(r=e.sent())return[4,call(fetchOrgInvites,t,r)];throw new Error("Organization id not found");case 3:return r=e.sent(),[4,put(actions.adminCenterUsers.fetchInvitesSuccess({invites:r,hasMore:!1,nextOffset:r.length}))];case 4:return e.sent(),[3,7];case 5:return s=e.sent(),console.log(s),[4,put(actions.adminCenterUsers.fetchInvitesFailure())];case 6:return e.sent(),[3,7];case 7:return[2]}})}function _ts_generator$2(s,a){var n,i,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(o=2&t[0]?i.return:t[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,t[1])).done)return o;switch(i=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],i=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function fetchUsersWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeEvery$1(actions.adminCenterUsers.fetchOrgUsersStart.type,fetchUsersSaga)];case 1:return e.sent(),[2]}})}function fetchUsersOnShowDeletedFilter(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.setShowDeletedUsers.type,fetchUsersSaga)];case 1:return e.sent(),[2]}})}function fetchUserByIdWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.fetchUserStart.type,fetchUserByIdSaga)];case 1:return e.sent(),[2]}})}function removeUserFromOrgWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.removeUserFromOrgStart.type,removeUserFromOrgSaga)];case 1:return e.sent(),[2]}})}function updateUserStatusWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.updateUserStatusStart.type,updateUserStatusSaga)];case 1:return e.sent(),[2]}})}function fetchUserOrganizationsWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.fetchUserOrganizationsStart.type,fetchUserOrganizationsSaga)];case 1:return e.sent(),[2]}})}function getUserApplicationRolesSagaWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.getUserApplicationRolesStart.type,getUserApplicationRolesSaga)];case 1:return e.sent(),[2]}})}function updateUserApplicationRolesSagaWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.updateUserRoles.type,updateUserApplicationRolesSaga)];case 1:return e.sent(),[2]}})}function searchUsersWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.setSearchTerm.type,searchUsersSaga)];case 1:return e.sent(),[2]}})}function fetchInvitesWatcher(){return _ts_generator$2(this,function(e){switch(e.label){case 0:return[4,takeLatest$1(actions.adminCenterUsers.fetchInvitesStart.type,fetchInvitesSaga)];case 1:return e.sent(),[2]}})}function _ts_generator$1(s,a){var n,i,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(o=2&t[0]?i.return:t[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,t[1])).done)return o;switch(i=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],i=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function rootSaga(){return _ts_generator$1(this,function(e){switch(e.label){case 0:return[4,all([fetchUsersWatcher(),removeUserFromOrgWatcher(),updateUserStatusWatcher(),fetchUserOrganizationsWatcher(),getUserApplicationRolesSagaWatcher(),updateUserApplicationRolesSagaWatcher(),fetchUserByIdWatcher(),searchUsersWatcher(),fetchUsersOnShowDeletedFilter(),fetchInvitesWatcher()])];case 1:return e.sent(),[2]}})}function _define_property$1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function getAdminCenterUsersModule(){return{id:SLICE_NAME,reducerMap:_define_property$1({},SLICE_NAME,rootReducer),sagas:[rootSaga],initialActions:[]}}var userLabels=function(e){return{panelHeader:e.formatMessage({id:"ac-user-details-header-title",defaultMessage:"USER DETAILS",description:"User details label"}),panelCloseTitle:e.formatMessage({id:"ac-user-details-header-close-btn",defaultMessage:"Close Panel",description:"Close Panel label"}),menuItemLabel:e.formatMessage({id:"ac-user-details-header-edit-btn",defaultMessage:"Menu",description:"User details menu label"}),logoAltTitle:e.formatMessage({id:"ac-user-detail-header-image-alt",defaultMessage:"User Avatar",description:"Alt image for User Avatar"}),lastLoginLabel:e.formatMessage({id:"ac-user-detail-header-last-login.label",defaultMessage:"Last Login",description:"Last Login label"}),activeUserLabel:e.formatMessage({id:"ac-users.user-row.activate-user-btn",defaultMessage:"Activate User",description:"Activate button in the user row context menu"}),deactivateUserLabel:e.formatMessage({id:"ac-users.user-row.deactivate-user-btn",defaultMessage:"Deactivate User",description:"Deactivate button in the user row context menu"}),removeOrgLabel:e.formatMessage({id:"ac-users.user-row.remove-user-from-org-btn",defaultMessage:"Remove from Org",description:"Remove from Org button in the user row context menu"})}},PANEL_ID=AvailableComponents.USER_DETAILS_PANEL,useStyles$4=makeStyles()(function(e){return{root:{display:"flex",flexDirection:"column"},header:{display:"flex",justifyContent:"space-between",padding:e.spacing(4),borderBottom:"0.5px solid ".concat(e.palette.divider),"& button":{height:"28px"}},tableWrapper:{height:"calc(100vh - 55px - 64px - 69px - 20px)",overflow:"hidden"},toolbar:{alignItems:"baseline","& button svg":{marginRight:"5px"},display:"flex",justifyContent:"center"},addUserBtn:{"& svg":{marginRight:"10px",height:"14px",width:"14px"}},searchBox:{display:"flex",flexGrow:1,alignItems:"center",justifyContent:"flex-end",padding:"0 16px"},headerButtons:{display:"flex",alignItems:"center"},startToolbar:{display:"flex",alignItems:"center"}}}),useStyles$3=makeStyles()(function(){return{badge:{fontSize:"9px",lineHeight:"18px",borderRadius:"30px",height:"18px",width:"fit-content",padding:"0px 10px",fontWeight:800},active:{background:"rgba(209, 223, 210, 1)",color:"rgba(56, 142, 60, 1)"},suspended:{background:"rgba(254, 238, 211, 1)",color:"rgba(245, 124, 0, 1)"},deactivated:{background:"rgba(241, 210, 210, 1)",color:"rgba(183, 28, 28, 1)"},inactive:{background:"rgba(241, 210, 210, 1)",color:"rgba(183, 28, 28, 1)"},deleted:{background:"rgba(233, 233, 233, 1)",color:"rgba(33, 33, 33, 1)"}}}),UserStatusBadge=function(e){var e=e.status,t=useStyles$3().classes;return jsxRuntimeExports.jsx(Box,{className:"".concat(t.badge," ").concat(t[e]),"data-testid":"admin-center.users.user-status-badge","data-test":"admin-center.users.user-status-badge",children:null==e?void 0:e.toUpperCase()})},useStyles$2=makeStyles()(function(e){return{root:{display:"flex",flexDirection:"column",height:"calc(100vh - 55px - 5px)",alignItems:"stretch",justifyContent:"space-between"},panelRoot:{width:"100%"},panelContainer:{display:"flex",flexDirection:"column",width:"100%"},panelBody:{display:"flex",flexGrow:1},panelLoading:{height:300},panelContent:{width:"100%",padding:"0"},tabsContainer:{"& .Sdk-Mui-selected":{color:"black"},"& .Sdk-MuiTabs-indicator":{backgroundColor:"#000"}},tabsParent:{paddingLeft:e.spacing(4),"& div":{borderBottom:"none"},"& div button":{fontFamily:"Nunito",fontWeight:400,flex:"0 1 auto !important",minWidth:"unset"}},divider:{opacity:.9},secondBox:{display:"flex",flexDirection:"column",flexGrow:1},orgAvatar:{border:"2px solid #FFFFFF",height:"40px",width:"40px",marginRight:"14px",fontSize:"14px",color:"white",fontWeight:400,lineHeight:"20px"},appContainer:{display:"flex",width:"100%",padding:"20px 0",flexDirection:"row",alignItems:"center"},roleBox:{width:"30%",display:"flex",alignItems:"center",justifyContent:"flex-start"},searchContainer:{display:"flex",alignItems:"center",width:"360px",border:"2px solid #E1E6ED",borderRadius:"28px",padding:"8px",justifyContent:"space-between",backgroundColor:"#FAFAFA",marginTop:"40px"},searchInput:{border:"0",fontFamily:"'Nunito'",display:"flex",alignItems:"center",width:"88%",justifyContent:"center",textAlign:"left",backgroundColor:"#FAFAFA",outline:"none"}}}),headerUseStyles=makeStyles()(function(e){return{headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end",paddingRight:"10px"},header:{alignItems:"center",display:"flex",justifyContent:"space-between",height:"55px",margin:"10px 10px 10px 30px"},title:{color:"#5C6269"},cardContainer:{display:"flex",padding:"20px 10px 20px 10px"},cardImgContainer:{position:"relative",marginLeft:"20px"},email:{color:"#5C6269",fontWeight:"400"},login:{color:"#2A323C",fontWeight:"400"},userAvatar:{border:"2px solid #FFFFFF",height:"90px",width:"90px",fontSize:"35px",color:"white"},statusLabel:{position:"absolute",bottom:"2px",left:"50%",right:"50%",display:"flex",justifyContent:"center"},divider:{opacity:.9},orgsName:{color:"black",fontWeight:400,fontSize:"12px",maxHeight:"26px",paddingTop:"1px",transform:"translateY(1px)",marginRight:"14px",maxWidth:"130px",minWidth:"130px","& fieldset":{border:"1px solid #D5DFE9"}}}}),UserDetailCard=function(e){var e=e.userData,t=useIntl(),r=headerUseStyles().classes,t=userLabels(t),s=t.logoAltTitle,t=t.lastLoginLabel,a=e.imageUrl,n=e.avatarColor,i=e.firstName,o=e.lastName,l=e.lastLoginDateTime,u=e.status,c=e.email,d=e.id,e=e.name;return jsxRuntimeExports.jsxs(Box,{className:r.cardContainer,children:[jsxRuntimeExports.jsxs(Box,{className:r.cardImgContainer,children:[a?jsxRuntimeExports.jsx(Avatar,{alt:s,src:a,className:r.userAvatar,sx:{border:"2px solid rgb(255, 255, 255)",height:"90px",width:"90px",fontSize:"35px",color:"white"},"data-testid":"ac-user-details-header-avatar","data-test":"ac-user-details-header-avatar"}):jsxRuntimeExports.jsx(Avatar,{className:r.userAvatar,sx:{background:n,border:"2px solid rgb(255, 255, 255)",height:"90px",width:"90px",fontSize:"35px",color:"white"},"data-testid":"ac-user-details-header-avatar-fallback","data-test":"ac-user-details-header-avatar-fallback",children:(s=o||"","".concat(null==(a=i||"")||null==(a=a.charAt(0))?void 0:a.toUpperCase()).concat(null==s||null==(a=s.charAt(0))?void 0:a.toUpperCase()))}),jsxRuntimeExports.jsx("div",{className:r.statusLabel,"data-testid":"ac-user-details-status-badge-wrapper","data-test":"ac-user-details-status-badge-wrapper",children:jsxRuntimeExports.jsx(UserStatusBadge,{status:u})})]}),jsxRuntimeExports.jsxs(Box,{sx:{pl:2},children:[jsxRuntimeExports.jsx(Box,{sx:{mb:1},children:jsxRuntimeExports.jsx(Typography,{variant:"h1","data-testid":"ac-user-detail-first-and-last-name","data-test":"ac-user-detail-first-and-last-name",children:"".concat(i," ").concat(o)})}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(CopyText,{id:"ac-user-detail-email-address",value:e||c||"",iconPosition:TCopyIconPosition.Right})}),jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(CopyText,{id:"ac-user-detail-id",value:d||"",variant:"caption",iconPosition:TCopyIconPosition.Right})}),l&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",className:r.email,children:t}),jsxRuntimeExports.jsx(Typography,{variant:"body2",className:r.login,"data-testid":"ac-user-detail-last-login","data-test":"ac-user-detail-last-login",children:new Date(l).toLocaleDateString("en-us",{day:"numeric",year:"numeric",month:"long"})})]})]})]})};function _array_like_to_array$7(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$6(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$6(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest$6(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$6(e,t){return _array_with_holes$6(e)||_iterable_to_array_limit$6(e,t)||_unsupported_iterable_to_array$7(e,t)||_non_iterable_rest$6()}function _unsupported_iterable_to_array$7(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$7(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$7(e,t):void 0}var openUserDetailsPanel=function(e,t,r){e={name:AvailableComponents.USER_DETAILS_PANEL,config:{name:"User Table Settings",id:e}},r={type:AvailablePanels.APP_BAR_PANEL_TEMPLATE,marginTop:r?0:55,marginStart:r?0:80,size:EPanelSize.medium,parentPanelId:AvailableComponents.ADMIN_CENTER,dimmed:0,dimmedStatus:"dimParent",borderBottom:!0};t(mountPanel({panelId:AvailableComponents.USER_DETAILS_PANEL,microFrontend:e,panelConfig:r}))},UserContextMenu=function(e){var t=e.anchorEl,r=e.id,s=e.open,a=e.onClose,n=e.onClickDetails,i=e.onClickStatusChange,o=e.onClickRemoveFromOrg,l=e.userId,u=e.orgGuid,c=e.status,d=e.hasMultipleOrgs,p=e.isUserDetailsPanelOpen,m=void 0!==p&&p,p=e.firstName,x=void 0===p?"":p,p=e.lastName,f=void 0===p?"":p,p=e.email,g=void 0===p?"":p,e=contextMenuStyles({width:44}).classes,h=useDispatch(),p=useOrganizationPermissions(EAuthSubResourceType.User),_=p.hasPermission(EPermissionAction.Create),p=p.hasPermission(EPermissionAction.Delete),b=null==(b=useSelector(userSelector))?void 0:b.userId,y=useSelector(selectIsFullscreenEnabled),j=useSelector(selectIsSuperAdmin),v=useSelector(selectApiConfigs),_=l!==b&&(c===EUserStatus.deactivated?_:p),S=c===EUserStatus.deleted,b=!(l===b)&&!S&&d&&p,p=!S&&!d&&_,S=m&&j,d=_sliced_to_array$6(reactExports.useState(!1),2),_=d[0],E=d[1],j=_sliced_to_array$6(reactExports.useState(!1),2),d=j[0],R=j[1],j=_sliced_to_array$6(reactExports.useState(!1),2),U=j[0],I=j[1],j=_sliced_to_array$6(reactExports.useState(),2),w=j[0],C=j[1],j=m&&!_isNil(w)&&!w;reactExports.useEffect(function(){m&&s&&scimIds_api.fetchScimIds(v,l).then(function(e){return C(!!e.length)}).catch(function(){return C(!1)})},[v,l,m,s]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ConfirmDialog,{isOpen:_,testId:"ac-user-context.deactivate",title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-confirm-title",defaultMessage:"Deactivate User",description:"User Detail delete user confirm title"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-confirm-description",defaultMessage:"Are you sure you want to deactivate this user?",description:"User Detail deativate user confirm description"}),cancelLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-cancel",defaultMessage:"Cancel",description:"User Detail deactivate user confirm cancel"}),confirmLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-context.deactivate-user-confirm",defaultMessage:"Confirm",description:"User Detail deactivate confirm btn"}),onClose:function(){return E(!1)},onConfirm:function(){h(actions.adminCenterUsers.updateUserStatusStart({userId:l,status:EUserStatus.deactivated})),E(!1)}}),jsxRuntimeExports.jsx(ConfirmDialog,{isOpen:d,testId:"impersonate-user-confirm",title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-title",defaultMessage:"Impersonate User",description:"User Detail impersonate user confirm title"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-description",defaultMessage:"Are you sure you want to impersonate this user?",description:"User Detail impersonate user confirm description"}),cancelLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-cancel",defaultMessage:"Cancel",description:"User Detail impersonate user confirm cancel"}),confirmLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-confirm-btn",defaultMessage:"Impersonate",description:"User Detail impersonate user confirm btn"}),onClose:function(){return R(!1)},onConfirm:function(){h(impersonateUserStart({userId:l,firstName:x,lastName:f,orgGuid:u})),R(!1),setTimeout(function(){h(unmountAllPanel(null))},600)}}),jsxRuntimeExports.jsx(ConfirmDialog,{isOpen:U,testId:"request-password-reset-confirm",title:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-title",defaultMessage:"Request Password Change",description:"User Detail request password reset confirm title"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-description",defaultMessage:"Are you sure you want to request password change for user {userName}? The user must change password the next time he/she logs in.",values:{userName:"".concat(x," ").concat(f)},description:"User Detail request password reset confirm description"}),cancelLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-cancel",defaultMessage:"Cancel",description:"User Detail request password reset confirm cancel"}),confirmLabel:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-reset-confirm-btn",defaultMessage:"Yes",description:"User Detail request password reset confirm btn"}),onClose:function(){return I(!1)},onConfirm:function(){h(requestPasswordResetStart({userId:l,email:g})),I(!1)}}),jsxRuntimeExports.jsx(Popover,{anchorEl:t,id:r,open:s,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:jsxRuntimeExports.jsxs(MenuList,{role:"menu",className:e.menuList,"data-testid":"admin-center-user.menu","data-test":"admin-center-user.menu",sx:{padding:"7.5px"},children:[S&&jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user-context.menu-item.impersonate-user","data-test":"context-menu-item",onClick:function(){a(),R(!0)},className:e.menuItem,sx:{cursor:"pointer"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.impersonate-user-btn",defaultMessage:"Impersonate User",description:"User Detail row context menu impersonate user"})}),!m&&jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user-context.menu-item.user-details","data-test":"context-menu-item",onClick:function(e){null!=n&&n(),openUserDetailsPanel(l,h,y)},className:e.menuItem,sx:{cursor:"pointer"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.open-user-details-panel-btn",defaultMessage:"User Details",description:"User Detail row context menu"})}),jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user.menu-item.status-update","data-test":"context-menu-item",onClick:function(){a(),c===EUserStatus.active?E(!0):h(actions.adminCenterUsers.updateUserStatusStart({userId:l,status:EUserStatus.active})),null!=i&&i()},sx:{cursor:"pointer"},className:e.menuItem,disabled:!p,children:c===EUserStatus.deactivated?jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users.user-row.activate-btn",defaultMessage:"Activate",description:"Activate button in the user row context menu"}):jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users.user-row.deactivate-btn",defaultMessage:"Deactivate",description:"Deactivate button in the user row context menu"})}),jsxRuntimeExports.jsx(MenuItem,{onClick:function(){null!=o&&o()},className:e.menuItem,"data-test":"context-menu-item",disabled:!b,sx:{cursor:b?"pointer":"not-allowed"},"data-testid":"admin-center-user.menu-item.remove-from-org",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users.user-row.remove-from-org-btn",defaultMessage:"Remove from Org",description:"Remove from Org button in the user row context menu"})}),j&&jsxRuntimeExports.jsx(MenuItem,{"data-testid":"ac-user-context.menu-item.request-password-change","data-test":"context-menu-item",onClick:function(){a(),I(!0)},className:e.menuItem,sx:{cursor:"pointer"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"admin-center-user-row.request-password-change-btn",defaultMessage:"Request Password Change",description:"User Detail row context menu request password change"})})]})})]})};function _array_like_to_array$6(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$5(e){if(Array.isArray(e))return e}function _array_without_holes$4(e){if(Array.isArray(e))return _array_like_to_array$6(e)}function _iterable_to_array$4(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit$5(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest$5(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread$4(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$5(e,t){return _array_with_holes$5(e)||_iterable_to_array_limit$5(e,t)||_unsupported_iterable_to_array$6(e,t)||_non_iterable_rest$5()}function _to_consumable_array$4(e){return _array_without_holes$4(e)||_iterable_to_array$4(e)||_unsupported_iterable_to_array$6(e)||_non_iterable_spread$4()}function _unsupported_iterable_to_array$6(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$6(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$6(e,t):void 0}var UserDetailHeaderActions=function(e){var e=e.userData,t=useIntl(),r=useDispatch(),s=reactExports.useRef(!0),a=headerUseStyles().classes,t=userLabels(t).menuItemLabel,n=e.id,i=e.status,o=(e.organizationGuids,e.organization),l=_sliced_to_array$5(reactExports.useState(null),2),u=l[0],c=l[1],l=u?"contextMenuId-".concat(n):void 0,d=useSelector(selectIsSuperAdmin),p=useSelector(selectUserOrgs),m=useSelector(selectAdminCenterOrgIdString),x=_sliced_to_array$5(reactExports.useState(o),2),f=x[0],g=x[1],x=Boolean(d&&1<p.length&&(null==o?void 0:o.id));reactExports.useEffect(function(){var t,e;0!==p.length&&(t=m&&"0"!==m&&m||(null==o?void 0:o.id),e=p.find(function(e){return"".concat(e.id)===t}),g(e||p[0]))},[p]);return reactExports.useEffect(function(){0===p.length||(null==o?void 0:o.id)===(null==f?void 0:f.id)&&s.current||n&&null!=f&&f.id&&r(actions.adminCenterUsers.getUserApplicationRolesStart({userId:"".concat(n),orgId:"".concat(f.id)}))},[f,p]),reactExports.useEffect(function(){s.current&&(s.current=!1)},[]),jsxRuntimeExports.jsxs("div",{className:a.headerActionContainer,children:[x&&jsxRuntimeExports.jsx(Select,{name:"orgs-select",className:a.orgsName,sx:{fontSize:"12px"},value:null==f||null==(d=f.id)?void 0:d.toString(),onChange:function(e){var t=e.target.value,e=p.find(function(e){return e.id===t});e&&g(e)},inputProps:{"data-testid":"ac-user-detail-select-org-name"},MenuProps:{PaperProps:{style:{maxHeight:300}}},children:_to_consumable_array$4(p).filter(function(e){return"deleted"!==e.status}).sort(function(e,t){return e&&t&&e.name&&t.name?e.name.localeCompare(t.name):0}).map(function(e,t){return jsxRuntimeExports.jsx(MenuItem,{value:null==e?void 0:e.id,disabled:"deleted"===e.status,"data-testid":"ac-user-detail-select-option","data-test":"ac-user-detail-select-option",children:(null==e?void 0:e.name)&&index.truncatedString(e.name,22)},"".concat(e.guid,"+").concat(t))})}),jsxRuntimeExports.jsx(Tooltip,{title:t,"data-testid":"ac-user-details-header.user-menu-button","data-test":"ac-user-details-header.user-menu-button",children:jsxRuntimeExports.jsx(IconButton,{"aria-labelledby":"ac-user-details-header.user-menu-button","data-testid":"ac-user-details-header.user-menu-button","data-test":"ac-user-details-header.user-menu-button",size:"medium",onClick:function(e){return c(e.currentTarget)},children:jsxRuntimeExports.jsx(MoreVert,{})})}),jsxRuntimeExports.jsx(UserContextMenu,{anchorEl:u,id:l,open:!!u,onClickRemoveFromOrg:function(){var e;n&&null!=f&&f.guid&&(r(actions.adminCenterUsers.removeUserFromOrgStart({userId:n,orgGuid:f.guid})),e=p.find(function(e){return e.guid!==f.guid}),g(e),c(null))},onClose:function(){return c(null)},hasMultipleOrgs:1<p.length,userId:n||"",orgGuid:(null==f?void 0:f.guid)||(null==o?void 0:o.guid)||"",status:i,"data-testid":"admin-center-org-user.menu-icon","data-test":"admin-center-org-user.menu-icon",isUserDetailsPanelOpen:!0,firstName:e.firstName,lastName:e.lastName,email:e.email})]})},LoaderSkeletonItem=function(){return jsxRuntimeExports.jsxs(ListItem,{alignItems:"center",sx:{height:"80px"},children:[jsxRuntimeExports.jsx(ListItemAvatar,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"circular",width:40,height:40})}),jsxRuntimeExports.jsx(ListItemText,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:150,height:30})}),jsxRuntimeExports.jsx(ListItemSecondaryAction,{children:jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:87,height:35})})]})},LoaderSkeleton=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:250,height:20}),jsxRuntimeExports.jsxs(List,{children:[jsxRuntimeExports.jsx(LoaderSkeletonItem,{}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(LoaderSkeletonItem,{}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(LoaderSkeletonItem,{}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(LoaderSkeletonItem,{})]})]})};function _array_like_to_array$5(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_without_holes$3(e){if(Array.isArray(e))return _array_like_to_array$5(e)}function _iterable_to_array$3(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _non_iterable_spread$3(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array$3(e){return _array_without_holes$3(e)||_iterable_to_array$3(e)||_unsupported_iterable_to_array$5(e)||_non_iterable_spread$3()}function _unsupported_iterable_to_array$5(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$5(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$5(e,t):void 0}var avatarColorCache={},getAvatarColor$1=function(e){var t;return avatarColorCache[e]||(t=Math.floor(Math.random()*avatarColors.length),avatarColorCache[e]=avatarColors[t]),avatarColorCache[e]};function noRole(e){return{id:"no-role",appName:e,name:"No Role",description:"The user will not be able to access this application."}}var ApplicationsEmpty=function(){return useSelector(selectUserApplicationRoles)?jsxRuntimeExports.jsx(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",mb:2,children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C"},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-applications-tab-description",defaultMessage:"View the Applications this user has access to.",description:"User details applications tab description"})})}):jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C",mb:1},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-applications-tab-no-applications",defaultMessage:"No applications assigned to this user.",description:"User details applications tab no applications"})})},ApplicationRoleSelect=function(e){var a=e.app,n=useDispatch(),i=useSelector(selectUserApplicationRoles),e=groupBy(i,"appName"),t=reactExports.useMemo(function(){var e;return null==(e=a.roles)?void 0:e.filter(function(e){var t;return"super admin for the service account"!==(null==e||null==(e=e.name)||null==(t=e.toLowerCase)?void 0:t.call(e))})},[a]);return jsxRuntimeExports.jsx(Select,{size:"small",value:null!=(e=null==(e=e[a.appName])||null==(e=e[0])?void 0:e.id)?e:noRole(a.appName).id,onChange:function(e){var t,r=[],s=e.target.value;"no-role"===s?r=i.filter(function(e){return e.appName!==a.appName}):(t=a.roles.find(function(e){return e.id===s}),e=i.find(function(e){return e.appName===a.appName}),t&&e?r=i.map(function(e){return e.appName===a.appName?t:e}):t&&!e&&(r=_to_consumable_array$3(i).concat([t]))),n(actions$1.updateUserRoles({roles:r}))},sx:{width:"100%",height:"100%",color:"black",fontSize:"12px"},"data-testid":"os-ac-user-details-applications-role-select","data-test":"os-ac-user-details-applications-role-select",children:t.map(function(e){return jsxRuntimeExports.jsx(MenuItem,{value:e.id,children:e.name},e.id)})})},Applications=function(){var s=useStyles$2().classes,e=useSelector(selectUserOrgRoles),t=useSelector(selectUserApplicationRolesStatus),r=groupBy(e,"appName"),e=reactExports.useMemo(function(){return Object.keys(r).map(function(e){return{appName:e,label:upperCase(startCase(e)),roles:[noRole(e)].concat(_to_consumable_array$3(r[e]))}})},[r]);return"loading"===t?jsxRuntimeExports.jsx(LoaderSkeleton,{}):jsxRuntimeExports.jsxs(Stack,{height:"100%",children:[jsxRuntimeExports.jsx(ApplicationsEmpty,{}),jsxRuntimeExports.jsx("div",{style:{flex:"1 1 auto"},children:jsxRuntimeExports.jsx(VirtualFixedSizeList,{testId:"os-ac-user-details-applications-list",items:e,itemSize:80,memoized:!0,divider:!0,children:function(e){var t,r=e.item,e=e.index;return jsxRuntimeExports.jsxs(Box,{className:s.appContainer,children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",width:"70%"},children:[jsxRuntimeExports.jsx(Avatar,{className:s.orgAvatar,sx:{backgroundColor:getAvatarColor$1(r.label)},"data-testid":"os-ac-user-details-applications-avatar","data-test":"os-ac-user-details-applications-avatar",children:null!=r&&r.appName?"".concat(null==r||null==(t=r.appName)||null==(t=t.charAt(0))?void 0:t.toUpperCase()).concat(String(e)[0]):"--"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",component:"span",sx:{fontWeight:400,display:"flex",alignItems:"center",fontSize:"12px"},"data-testid":"ac-user-details-application-name","data-test":"ac-user-details-application-name",children:index.truncatedString(r.label,32)})]}),jsxRuntimeExports.jsx(Box,{className:s.roleBox,children:jsxRuntimeExports.jsx(ApplicationRoleSelect,{app:r})})]})}})})]})},usedColors=[],getAvatarColor=function(){var e=Math.floor(Math.random()*avatarColors.length);return usedColors.includes(e)?getAvatarColor():((usedColors=usedColors.length>=avatarColors.length/2?[]:usedColors).push(e),avatarColors[e])},Organizations=function(e){var s=e.userId,a=useStyles$2().classes,n=useDispatch(),e=useSelector(selectUserOrgs),t=null==(t=useSelector(userSelector))?void 0:t.userId,i=!(s===t)&&1<e.length;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C",mb:1},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-org-tab-description",defaultMessage:"View the Organizations that this user is currently a part of.",description:"User details org tab description"})}),e&&0<(null==e?void 0:e.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e.map(function(t,e){var r;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",py:4},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[null!=t&&t.imageUrl?jsxRuntimeExports.jsx(Avatar,{alt:"".concat(null==t||null==(r=t.name)||null==(r=r.charAt(0))?void 0:r.toUpperCase()).concat(String(e+1)[0]),src:null==t?void 0:t.imageUrl,className:a.orgAvatar,"data-testid":"ac-user-details-organization-image","data-test":"ac-user-details-organization-image"}):jsxRuntimeExports.jsx(Avatar,{className:a.orgAvatar,sx:{background:"".concat(getAvatarColor())},"data-testid":"ac-user-details-organization-fallback-image","data-test":"ac-user-details-organization-fallback-image",children:null!=t&&t.name?"".concat(null==t||null==(r=t.name)||null==(r=r.charAt(0))?void 0:r.toUpperCase()).concat(String(e)[0]):"--"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{fontWeight:400},"data-testid":"ac-user-details-organization-tab-org-name","data-test":"ac-user-details-organization-tab-org-name",children:null!=t&&t.name?t.name:""})]}),i&&jsxRuntimeExports.jsx(Button,{onClick:function(){var e;(e=t.guid||"")&&n(actions$1.removeUserFromOrgStart({userId:s,orgGuid:e}))},variant:"outlined",color:"primary",children:"Remove From Org"})]}),jsxRuntimeExports.jsx(Divider,{})]},"os-admin-center-org-row-".concat(t.id))})}):null]})};function _array_like_to_array$4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$4(e){if(Array.isArray(e))return e}function _array_without_holes$2(e){if(Array.isArray(e))return _array_like_to_array$4(e)}function asyncGeneratorStep(e,t,r,s,a,n,i){try{var o=e[n](i),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(s,a)}function _async_to_generator(o){return function(){var e=this,i=arguments;return new Promise(function(t,r){var s=o.apply(e,i);function a(e){asyncGeneratorStep(s,t,r,a,n,"next",e)}function n(e){asyncGeneratorStep(s,t,r,a,n,"throw",e)}a(void 0)})}}function _iterable_to_array$2(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit$4(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest$4(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread$2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_without_properties(e,t){if(null==e)return{};var r,s=_object_without_properties_loose(e,t);if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r]);return s}function _object_without_properties_loose(e,t){if(null==e)return{};for(var r,s={},a=Object.keys(e),n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||(s[r]=e[r]);return s}function _sliced_to_array$4(e,t){return _array_with_holes$4(e)||_iterable_to_array_limit$4(e,t)||_unsupported_iterable_to_array$4(e,t)||_non_iterable_rest$4()}function _to_consumable_array$2(e){return _array_without_holes$2(e)||_iterable_to_array$2(e)||_unsupported_iterable_to_array$4(e)||_non_iterable_spread$2()}function _unsupported_iterable_to_array$4(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$4(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$4(e,t):void 0}function _ts_generator(s,a){var n,i,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(o=2&t[0]?i.return:t[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,t[1])).done)return o;switch(i=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=a.call(s,l)}catch(e){t=[6,e],i=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}var AclTab=function(){function e(){return t.apply(this,arguments)}var t,r=useDispatch(),s=useSelector(selectUserDetailPanelUserData)||{},a=s.acls,a=void 0===a?[]:a,n=s.id,i=void 0===n?"":n,n=s.organization,s=void 0===n?{}:n,n=s.guid,o=void 0===n?"":n,l=s.id,u=a.filter(function(e){return"organization"===(null==(e=split$1(null==e?void 0:e.objectId,"/"))?void 0:e[0])}),n=_sliced_to_array$4(reactExports.useState(u),2),c=n[0],d=n[1],s=_sliced_to_array$4(reactExports.useState(_uniqBy(u,function(e){return null==e||null==(e=e.organization)?void 0:e.id})),2),p=s[0],m=s[1],a=_sliced_to_array$4(reactExports.useState(p.length),2),x=a[0],f=a[1],n=_sliced_to_array$4(reactExports.useState(!1),2),s=n[0],g=n[1],h=reactExports.useRef(null),_=useSelector(selectApiConfigs);reactExports.useEffect(function(){p.length>x&&h.current&&(h.current.scrollTop=h.current.scrollHeight),f(p.length)},[p,x]),t=_async_to_generator(function(){var t;return _ts_generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=c.map(function(e){return e.organization,_object_without_properties(e,["organization"])}),[4,updateUserAcls(_,i,t)];case 1:return e.sent().id?(g(!1),r(showMessage({content:"User's ACLs have been updated successfully.",severity:MessageSeverity.Success}))):r(showMessage({content:"Error updating user ACLs",severity:MessageSeverity.Error})),[3,3];case 2:return t=e.sent(),console.error("Error updating user ACLs",t),r(showMessage({content:"Error updating user ACLs",severity:MessageSeverity.Error})),[3,3];case 3:return[2]}})});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"#2A323C",mb:5},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-acl-tab-description",defaultMessage:"ACLs grant organizations and users access to content that lives outside of their account. This is ideal for multi-market accounts and reporting needs.",description:"User details org acl description"})}),jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{fontWeight:600,fontSize:"14px",mb:3},"data-testid":"os-admin-center-user-details-acl-tab-org-name-label",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-user-details-acl-tab-org-name",defaultMessage:"Organization Name",description:"User details org acl org name lable"})}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Box,{ref:h,sx:{height:"150px",overflowY:"auto"},children:[" ",p&&0<p.length?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:p.map(function(e,s){var t;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",py:1,justifyContent:"space-between"},"data-testid":"ac-user-details-acl-tab-org-acl-list-row",children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{fontWeight:400,fontSize:"14px"},"data-testid":"ac-user-details-acl-tab-org-name","data-test":"ac-user-details-acl-tab-org-name",children:null!=e&&null!=(t=e.organization)&&t.name?e.organization.name:""}),jsxRuntimeExports.jsx(Box,{sx:{height:"40px"},children:!((null==(t=e)||null==(t=t.organization)?void 0:t.id)===(null==l?void 0:l.toString()))&&jsxRuntimeExports.jsx(IconButton,{onClick:function(){return r=s,e=p.filter(function(e,t){return t!==r}),t=p[r],m(e),d(c.filter(function(e){return(null==e||null==(e=e.organization)?void 0:e.id)!==(null==t||null==(e=t.organization)?void 0:e.id)})),void g(!0);var r,e,t},children:jsxRuntimeExports.jsx(RemoveOne,{})})})]}),jsxRuntimeExports.jsx(Divider,{})]},"os-admin-center-org-row-".concat(e.objectId))})}):null]}),jsxRuntimeExports.jsx(Box,{sx:{mt:5},children:jsxRuntimeExports.jsx(OrgTableSearchButton,{isUserDetailView:!0})}),jsxRuntimeExports.jsx(Box,{sx:{height:"260px"},children:jsxRuntimeExports.jsx(OrgsTable,{onAddOrg:function(e){e&&e.id&&(e={applicationId:o,objectType:"obj-access-grant",objectId:"organization/".concat(e.id),organizationId:e.id.toString(),organization:{id:e.id.toString(),name:e.name||""},userId:i,access:{owner:!1}},d(_uniqBy(_to_consumable_array$2(c).concat([e]),function(e){return"".concat(e.applicationId).concat(e.objectId)})),m(_uniqBy(_to_consumable_array$2(c).concat([e]),function(e){return null==e||null==(e=e.organization)?void 0:e.id})),g(!0))},isUserDetailView:!0})}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",justifyContent:"flex-end",mt:5},children:[jsxRuntimeExports.jsx(Button,{onClick:function(){d(u),m(_uniqBy(u,function(e){return null==e||null==(e=e.organization)?void 0:e.id})),g(!1)},variant:"text",size:"large",sx:{marginRight:"10px"},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:e,variant:"contained",color:"primary",disabled:!s,"data-testid":"ac-user-details-acl-tab-save-button",children:"Save"})]})]})};function _array_like_to_array$3(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$3(e){if(Array.isArray(e))return e}function _array_without_holes$1(e){if(Array.isArray(e))return _array_like_to_array$3(e)}function _define_property(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _iterable_to_array$1(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit$3(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest$3(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},s=Object.keys(r);(s="function"==typeof Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})):s).forEach(function(e){_define_property(t,e,r[e])})}return t}function ownKeys(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(e),r.push.apply(r,e)),r}function _object_spread_props(t,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}function _sliced_to_array$3(e,t){return _array_with_holes$3(e)||_iterable_to_array_limit$3(e,t)||_unsupported_iterable_to_array$3(e,t)||_non_iterable_rest$3()}function _to_consumable_array$1(e){return _array_without_holes$1(e)||_iterable_to_array$1(e)||_unsupported_iterable_to_array$3(e)||_non_iterable_spread$1()}function _unsupported_iterable_to_array$3(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$3(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$3(e,t):void 0}var muiTabA11yProps=function(e){return{id:"user-details-tab-".concat(e),"aria-controls":"user-details-tabpanel-".concat(e)}},UserDetailTabs=function(e){var e=e.userId,r=useStyles$2().classes,t=_sliced_to_array$3(reactExports.useState(0),2),s=t[0],a=t[1],t=useSelector(selectIsSuperAdmin),t=[{label:"Applications",disabled:!1,id:"applications",component:jsxRuntimeExports.jsx(Box,{sx:{p:4,height:"calc(100vh - 310px)"},children:jsxRuntimeExports.jsx(Applications,{})})}].concat(_to_consumable_array$1(t?[{label:"Organizations",disabled:!1,id:"organizations",component:jsxRuntimeExports.jsx(Box,{sx:{p:4,height:"calc(100vh - 325px)",overflow:"auto"},children:jsxRuntimeExports.jsx(Organizations,{userId:e})})},{label:"ACL",disabled:!1,id:"acl",component:jsxRuntimeExports.jsx(Box,{sx:{p:6},children:jsxRuntimeExports.jsx(AclTab,{})})}]:[]));return jsxRuntimeExports.jsxs("div",{className:r.tabsContainer,"data-testid":"ac-user-details-panel-tabs","data-test":"ac-user-details-panel-tabs",children:[jsxRuntimeExports.jsx("div",{className:r.tabsParent,children:jsxRuntimeExports.jsx(Tabs,{sx:{"& .Sdk-MuiTab-root.Sdk-Mui-selected":{color:"#000000!important"}},onChange:function(e,t){a(t)},value:s,children:t.map(function(e,t){return jsxRuntimeExports.jsx(Tab,_object_spread_props(_object_spread({label:e.label,disabled:e.disabled},muiTabA11yProps(t)),{"data-testid":"".concat(e.id,"-tab"),"data-test":"".concat(e.id,"-tab")}),e.id)})})}),jsxRuntimeExports.jsx(Divider,{className:r.divider}),t.map(function(e,t){return jsxRuntimeExports.jsx("div",{className:r.secondBox,children:jsxRuntimeExports.jsx(TabPanel,{value:s,index:t,children:e.component})},e.id)})]})},PanelHeader=panelComponents.header,PanelContainer=panelComponents.container,PanelContent=panelComponents.content,MainLayout=function(e){var t=e.id,e=useIntl(),r=useDispatch(),e=userLabels(e).panelHeader,s=useSelector(selectUserDetailPanelUserData),a=useSelector(selectUserDetailPanelLoadingStatus),n=useSelector(selectIsFullscreenEnabled),i="loading"===a,a="failure"===a;return reactExports.useEffect(function(){t&&r(actions$1.fetchUserStart({userId:t}))},[r,t]),jsxRuntimeExports.jsxs(PanelContainer,{panelId:PANEL_ID,isFullScreen:n,children:[jsxRuntimeExports.jsx(PanelHeader,{title:e,testId:"ac-user-details.header-title",PanelActions:s&&jsxRuntimeExports.jsx(UserDetailHeaderActions,{userData:s}),onPanelClose:function(){r(hidePanel(PANEL_ID)),r(actions$1.resetUserDetailState())}}),jsxRuntimeExports.jsxs(PanelContent,{isLoading:i,isErrored:a,onRetry:function(){t&&r(actions$1.fetchUserStart({userId:t}))},children:[s&&jsxRuntimeExports.jsx(UserDetailCard,{userData:s}),jsxRuntimeExports.jsx(UserDetailTabs,{userId:t})]})]})},UserDetailsPanel=function(e){return jsxRuntimeExports.jsx(AIWareThemeProvider,{children:jsxRuntimeExports.jsx(DynamicModuleLoader,{modules:[getAdminCenterUsersModule(),getInstanceAdminCenterOrgsModule()],children:jsxRuntimeExports.jsx(AIWareIntlProvider,{children:jsxRuntimeExports.jsx(AIWareCacheProvider,{children:jsxRuntimeExports.jsx(MainLayout,{id:e.id,orgId:e.orgId})})})})})};function _array_like_to_array$2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$2(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$2(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest$2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$2(e,t){return _array_with_holes$2(e)||_iterable_to_array_limit$2(e,t)||_unsupported_iterable_to_array$2(e,t)||_non_iterable_rest$2()}function _unsupported_iterable_to_array$2(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$2(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$2(e,t):void 0}var TableSearchInputButton=tableSearchComponents.TableSearchInputButton,UserTableSearchButton=function(){var e=_sliced_to_array$2(reactExports.useState(""),2),t=e[0],r=e[1],e=_sliced_to_array$2(reactExports.useState(!1),2),s=e[0],a=e[1],e=useSelector(selectSearchTerm),n=useSelector(selectIsSearching),i=useDispatch(),o=reactExports.useRef(debounce(function(e){i(actions$1.setSearchTerm(e))},1e3)).current;return jsxRuntimeExports.jsx(TableSearchInputButton,{onChange:function(e){r(e.target.value),e.target.value?(i(actions$1.setIsSearching(!0)),o(e.target.value)):o("")},onClear:function(){r(""),i(actions$1.setSearchTerm("")),i(actions$1.setIsSearching(!1))},onToggleSearch:function(){var e=!s;a(e),i(actions$1.setIsSearchInputVisible(e))},testId:"admin-center-org-user-table-search",placeholderText:"Search by name",searchValue:e,inputValue:t,isSearchVisible:s,isSearching:n,searchItemTooltipText:"Users"})};function _array_like_to_array$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes$1(e){if(Array.isArray(e))return e}function _iterable_to_array_limit$1(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest$1(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array$1(e,t){return _array_with_holes$1(e)||_iterable_to_array_limit$1(e,t)||_unsupported_iterable_to_array$1(e,t)||_non_iterable_rest$1()}function _unsupported_iterable_to_array$1(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array$1(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array$1(e,t):void 0}var useStyles$1=makeStyles()(function(e,t){return t.status,{userAvatar:{border:"2px solid #FFFFFF",height:"40px",width:"40px",marginRight:"14px",fontSize:"14px",color:"white"},row:{padding:"13px",height:"100%",overflow:"hidden",boxSizing:"border-box","&:hover":{backgroundColor:"#f2f5f9",cursor:"pointer"}},userName:{alignSelf:"center"},truncate:{paddingRight:"20px","& p":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}}),UserRow=function(e){var e=e.user,t=e.id,r=e.imageUrl,s=e.name,a=e.firstName,n=e.lastName,i=e.email,o=e.lastLoginDateTime,l=e.status,u=e.organizationGuids,u=void 0===u?[]:u,c=e.organization,e=e.avatarColor,d=useStyles$1({status:l}).classes,p=_sliced_to_array$1(reactExports.useState(null),2),m=p[0],x=p[1],p=m?"contextMenuId-".concat(t):void 0,f=useDispatch(),g=useSelector(selectIsFullscreenEnabled);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{direction:"row",justifyContent:"space-between",alignItems:"center",container:!0,"data-testid":"admin-center-org-user-row-".concat(t),"data-test":"admin-center-org-user-row-".concat(t),className:d.row,children:[jsxRuntimeExports.jsxs(Grid,{container:!0,item:!0,xs:11,alignItems:"center",onClick:function(e){m||openUserDetailsPanel(t,f,g)},children:[jsxRuntimeExports.jsxs(Grid,{sx:{display:"flex"},xs:4,item:!0,className:d.truncate,"data-testid":"admin-center-org-user.avatar-name-col","data-test":"admin-center-org-user.avatar-name-col",children:[r?jsxRuntimeExports.jsx(Avatar,{alt:a+" "+n,src:r,className:d.userAvatar}):jsxRuntimeExports.jsx(Avatar,{className:d.userAvatar,sx:{background:e},children:(r=n||"","".concat(null==(e=a||"")||null==(e=e.charAt(0))?void 0:e.toUpperCase()).concat(null==r||null==(e=r.charAt(0))?void 0:e.toUpperCase()))}),jsxRuntimeExports.jsx(Tooltip,{title:a+" "+n,arrow:!0,children:jsxRuntimeExports.jsx(Typography,{className:d.userName,variant:"body2",sx:{fontWeight:400},"data-testid":"admin-center-org-user.user-name","data-test":"admin-center-org-user.user-name",children:a+" "+n})})]}),jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,className:d.truncate,"data-testid":"admin-center-org-user.email-col","data-test":"admin-center-org-user.email-col",children:i&&jsxRuntimeExports.jsx(CopyText,{id:"admin-center-org-user.email",value:s||i,variant:"body2",iconPosition:TCopyIconPosition.Right,sx:{fontWeight:400}})}),jsxRuntimeExports.jsx(Grid,{xs:3,item:!0,"data-testid":"admin-center-org-user.last-login-col","data-test":"admin-center-org-user.last-login-col",children:o&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:"-6px",fontWeight:400},children:new Date(o).toLocaleDateString()}),jsxRuntimeExports.jsx(Typography,{variant:"caption",children:index.formatTime(new Date(o))})]})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0,"data-testid":"admin-center-org-user.status-col","data-test":"admin-center-org-user.status-col",children:jsxRuntimeExports.jsx(UserStatusBadge,{status:l})})]}),jsxRuntimeExports.jsxs(Grid,{item:!0,xs:1,sx:{textAlign:"end"},"data-testid":"admin-center-org-user.menu-col","data-test":"admin-center-org-user.menu-col",children:[jsxRuntimeExports.jsx(IconButton,{"data-testid":"user-row-menu-button-".concat(t),"data-test":"user-row-menu-button-".concat(t),onClick:function(e){e.stopPropagation(),x(e.currentTarget)},size:"small",children:jsxRuntimeExports.jsx(MoreVert,{fontSize:"small"})}),jsxRuntimeExports.jsx(UserContextMenu,{firstName:a,lastName:n,anchorEl:m,id:p,open:!!m,onClickDetails:function(){x(null)},onClickStatusChange:function(){x(null)},onClickRemoveFromOrg:function(){x(null)},onClose:function(){x(null)},userId:t||"",orgGuid:(null==c?void 0:c.guid)||"",hasMultipleOrgs:1<u.length,status:l,"data-testid":"admin-center-org-user.menu-icon","data-test":"admin-center-org-user.menu-icon",email:i})]})]}),jsxRuntimeExports.jsx(Divider,{})]})},TableInfiniteScroll$1=tableInfiniteScroll.jsx.TableInfiniteScroll,TableHeader$1=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{direction:"row",justifyContent:"space-between",alignItems:"center",item:!0,container:!0,xs:12,"data-testid":"admin-center-org-user-table-header","data-test":"admin-center-org-user-table-header",sx:{pl:"13px",pr:"13px"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:11,children:[jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,"data-test":"os-admin-center.org-user-table-header.name",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.name-col",defaultMessage:"Name",description:"Name column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,"data-test":"os-admin-center.org-user-table-header.email",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.email-col",defaultMessage:"Email",description:"Email column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:3,item:!0,"data-test":"os-admin-center.org-user-table-header.last-login",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.last-login-col",defaultMessage:"Last Login",description:"Last Login column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0,"data-test":"os-admin-center.org-user-table-header.status",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-user-table.header.status-col",defaultMessage:"Status",description:"Status column header"})})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Divider,{})]})},UserTableContent=reactExports.memo(function(e){var t=e.users,r=e.status;return jsxRuntimeExports.jsx(TableInfiniteScroll$1,{hasMore:!!e.hasMore,fetchMore:e.onLoadMore,fetchOnMount:"idle"===r,offset:e.offset||0,items:t,itemHeight:68,isLoading:"loading"===r||"idle"===r,error:"failure"===r,TableRowComponent:function(e){var t=e.item;return jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"68px"},"data-test":"users-table-row",children:jsxRuntimeExports.jsx(UserRow,{user:t})},e.index)},TableHeaderComponent:jsxRuntimeExports.jsx(TableHeader$1,{}),adjustTableHeight:-40,TableEmptyStateComponent:jsxRuntimeExports.jsx(NullState,{header:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users-table.empty.header",defaultMessage:"No Search Results Found",description:"Header text for empty search results"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-users-table.empty.description",defaultMessage:"There are no users that match your search",description:"No search results description"}),image:img$J})})}),UserTable=function(){var e=useSelector(selectOrgUsers),t=e.users,t=void 0===t?[]:t,r=e.hasMore,e=e.offset,s=useSelector(selectStatus),a=useDispatch(),n=reactExports.useCallback(function(){a(actions$1.fetchOrgUsersStart())},[a]);return jsxRuntimeExports.jsx(UserTableContent,{users:t,hasMore:r,offset:e,status:s,onLoadMore:n})},useStyles=makeStyles()(function(e,t){return t.status,{badge:{fontSize:"9px",lineHeight:"18px",borderRadius:"30px",height:"18px",width:"fit-content",padding:"0px 10px",fontWeight:800},expired:{background:"rgba(233, 233, 233, 1)",color:"rgba(33, 33, 33, 1)"},completed:{background:"rgba(209, 223, 210, 1)",color:"rgba(56, 142, 60, 1)"},cancelled:{background:"rgba(241, 210, 210, 1)",color:"rgba(183, 28, 28, 1)"},pending:{background:"rgba(249, 168, 37, 0.2)",color:"rgba(245, 124, 0, 1)"}}}),InviteStatusBadge=function(e){var e=e.status,t=useStyles({status:e}).classes,e=["expired","completed","cancelled"].includes(e)?e:"pending";return jsxRuntimeExports.jsx(Box,{className:"".concat(t.badge," ").concat(t[e]),"data-testid":"admin-center.users.user-status-badge","data-test":"admin-center.users.user-status-badge",children:e.toUpperCase()})},InviteRow=function(e){var t,e=e.invite;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{direction:"row",justifyContent:"space-between",alignItems:"center",container:!0,"data-testid":"admin-center-org-invite-row-".concat(e.id),"data-test":"admin-center-org-invite-row-".concat(e.id),sx:{padding:"13px",height:"100%"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:11,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:4,children:jsxRuntimeExports.jsx(Typography,{sx:{fontWeight:400},variant:"body2",children:(null==(t=e.userDetails)?void 0:t.name)||[null==(t=e.userDetails)?void 0:t.firstName,null==(t=e.userDetails)?void 0:t.lastName].filter(Boolean).join(" ")||""})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:6,children:jsxRuntimeExports.jsx(Typography,{sx:{fontWeight:400},variant:"body2",children:e.email})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1,children:jsxRuntimeExports.jsx(InviteStatusBadge,{status:e.status})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1})]}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Divider,{})]})},TableInfiniteScroll=tableInfiniteScroll.jsx.TableInfiniteScroll,TableHeader=function(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Grid,{direction:"row",justifyContent:"space-between",alignItems:"center",item:!0,container:!0,xs:12,"data-testid":"admin-center-invites-table-header",sx:{pl:"13px",pr:"13px",height:"22px"},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,xs:11,children:[jsxRuntimeExports.jsx(Grid,{xs:4,item:!0,"data-test":"os-admin-center.invites-table-header.name",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-invite-table.header.name-col",defaultMessage:"Name",description:"Name column header for invites table"})})}),jsxRuntimeExports.jsx(Grid,{xs:6,item:!0,"data-test":"os-admin-center.invites-table-header.email",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-invite-table.header.email-col",defaultMessage:"Email",description:"Email column header for invites table"})})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0,"data-test":"os-admin-center.invites-table-header.status",children:jsxRuntimeExports.jsx(Typography,{variant:"caption",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-invite-table.header.status-col",defaultMessage:"Status",description:"Status column header for invites table"})})}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Grid,{xs:1,item:!0})]}),jsxRuntimeExports.jsx(Divider,{})]})},InvitesTableContent=reactExports.memo(function(e){var t=e.invites,r=e.status;return jsxRuntimeExports.jsx(TableInfiniteScroll,{hasMore:!!e.hasMore,fetchMore:e.onLoadMore,fetchOnMount:0===t.length,offset:e.offset||0,items:t,itemHeight:68,isLoading:"loading"===r||"idle"===r,error:"failure"===r,TableRowComponent:function(e){var t=e.item;return jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"68px"},"data-test":"invites-table-row",children:jsxRuntimeExports.jsx(InviteRow,{invite:t})},t.id||t.email||e.index)},TableHeaderComponent:jsxRuntimeExports.jsx(TableHeader,{}),adjustTableHeight:-40,TableEmptyStateComponent:jsxRuntimeExports.jsx(NullState,{header:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-invites-table.empty.header",defaultMessage:"No Invites Found",description:"Header text for empty invites table"}),description:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"ac-invites-table.empty.description",defaultMessage:"There are no invites for this organization.",description:"Description for empty invites table"}),image:img$J})})}),InvitesTable=function(){var e=useDispatch(),t=useSelector(selectInvitesData),r=t.invites,r=void 0===r?[]:r,s=t.hasMore,t=t.offset,a=useSelector(selectInvitesStatus),n=reactExports.useCallback(function(){e(actions.adminCenterUsers.fetchInvitesStart())},[e]);return jsxRuntimeExports.jsx(InvitesTableContent,{invites:r,hasMore:s,offset:t,status:a,onLoadMore:n})};function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _iterable_to_array(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterable_to_array_limit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var s,a,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw a}}return n}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _unsupported_iterable_to_array(e,t){var r;if(e)return"string"==typeof e?_array_like_to_array(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(e,t):void 0}var tabUseStyles=makeStyles()(function(e){return{tabsContainer:{height:"100%",flexGrow:"1",display:"flex",flexDirection:"column","& .Sdk-Mui-selected":{color:"black"},"& .Sdk-MuiTabs-indicator":{backgroundColor:"#000"}},tabsParent:{padding:e.spacing(0,3,0,3),"& div":{borderBottom:"none"},"& div button":{fontFamily:"Nunito",fontWeight:400,flex:"0 1 auto !important",minWidth:"unset"}},tabPanels:{width:"100%",height:"100%"}}}),UsersTabsComponent=function(e){var t=e.onTabChange,r=e.isUserSuperAdmin,e=_sliced_to_array(reactExports.useState(0),2),s=e[0],a=e[1],e=tabUseStyles().classes,n=_sliced_to_array(reactExports.useState([{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-users-panel-users-tab-headers",defaultMessage:"Users",description:"Users tab title"}),disabled:!1,id:"os-admin-center-users-panel-users-tab-btn"}]),2),i=n[0],o=n[1],n=(reactExports.useEffect(function(){r&&o(_to_consumable_array(i).concat([{label:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-users-panel-invites-tab-headers",defaultMessage:"Invites",description:"Invites tab title"}),disabled:!1,id:"os-admin-center-users-panel-invites-tab-btn"}]))},[r]),{flex:"1",display:"flex",flexDirection:"column",height:"100%"});return jsxRuntimeExports.jsxs("div",{className:e.tabsContainer,"data-test":"os-admin-center-users-tabs",children:[r&&jsxRuntimeExports.jsx("div",{className:e.tabsParent,"data-test":"os-admin-center-users-tabs.container",children:jsxRuntimeExports.jsx(CustomTabs,{selectedId:s,onChangeTab:function(e){a(e),t(e)},tabsList:i})}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Box,{className:e.tabPanels,children:[jsxRuntimeExports.jsx(TabPanel,{value:s,index:0,children:jsxRuntimeExports.jsx(Stack,{sx:n,children:jsxRuntimeExports.jsx(UserTable,{})})}),jsxRuntimeExports.jsx(TabPanel,{value:s,index:1,children:jsxRuntimeExports.jsx(Stack,{sx:n,children:jsxRuntimeExports.jsx(InvitesTable,{})})})]})]})},UsersPanel=function(){var e=useStyles$4().classes,r=useDispatch(),t=useSelector(organizationInvites_selector.selectPendingOrgInvites),s=useSelector(selectIsSuperAdmin),a=useSelector(selectAdminCenterOrgId),n=useSelector(selectAdminCenterOrgGuid),i=useSelector(selectIsFullscreenEnabled),o=useSelector(selectShowDeletedUsers),l=useSelector(selectIsSearchInputVisible),u=_sliced_to_array(reactExports.useState(0),2),c=u[0],d=u[1],u=(reactExports.useEffect(function(){r(actions$2.organizationInvitesState.fetchPendingInvitesStart(a))},[r,a]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("section",{className:e.root,children:jsxRuntimeExports.jsx("header",{className:e.header,style:{flexDirection:"column",borderBottom:"none",paddingBottom:"10px"},children:jsxRuntimeExports.jsx(Box,{width:"100%",children:jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Box,{className:e.startToolbar,children:jsxRuntimeExports.jsx(Typography,{variant:"h5","data-testid":"os-admin-center-users-title","data-test":"os-admin-center-users-title",sx:{fontWeight:"600",mb:1},children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.table.header",defaultMessage:"Users",description:"Users Header"})})}),!l&&jsxRuntimeExports.jsx(Box,{className:e.startToolbar,children:jsxRuntimeExports.jsx(Typography,{variant:"caption","data-testid":"os-admin-center-users-sub-title","data-test":"os-admin-center-users-sub-title",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.table.description",defaultMessage:"Create and manage users of this Organization",description:"Users Panel Description"})})})]}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"flex-end",alignItems:"center",marginRight:"10px",gap:"10px",children:[!(1===c)&&jsxRuntimeExports.jsx(Box,{className:e.searchBox,sx:{maxWidth:i?"100%":"440px"},children:jsxRuntimeExports.jsx(UserTableSearchButton,{})}),jsxRuntimeExports.jsxs(Box,{className:e.headerButtons,children:[jsxRuntimeExports.jsxs(Button,{variant:"outlined",onClick:function(){return handleViewRequests(r,i)},"data-test":"os-admin-center-panel.users.table.requests-button",children:[jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.user-requests.btn",defaultMessage:"User Requests",description:"User Requests tab button"})," ","(",t.length,")"]}),jsxRuntimeExports.jsxs(Button,{variant:"contained",sx:{ml:"13px"},className:e.addUserBtn,onClick:function(){return handleClickInviteUsers(r,i,a,n)},"data-test":"os-admin-center-panel.users.table.invite-button",children:[jsxRuntimeExports.jsx(AddUser,{}),jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.invite-user.btn",defaultMessage:"Invite User",description:"Invite User tab button"})]})]}),jsxRuntimeExports.jsx(Box,{className:e.headerButtons,children:jsxRuntimeExports.jsx(ContextMenu,{testId:"os-admin-center-panel.users.filters",Icon:jsxRuntimeExports.jsx(Filter,{}),menuItems:[{testId:"os-admin-center-panel.users.context.visbility-item",label:o?jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.context.hide-deleted",defaultMessage:"Hide Deleted Users",description:"Hide Deleted Users context menu"}):jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"os-admin-center-panel.users.context.show-deleted",defaultMessage:"Show Deleted Users",description:"Show Deleted Users context menu"}),icon:o?jsxRuntimeExports.jsx(VisibilityOffOutlined,{}):jsxRuntimeExports.jsx(VisibilityOutlined,{}),onClick:function(){var e,t;e=EUserTableContextActions.showDeleted,t=!o,e===EUserTableContextActions.showDeleted&&r(actions.adminCenterUsers.setShowDeletedUsers(t))}}]})})]})]})})})}),jsxRuntimeExports.jsx("div",{className:e.tableWrapper,children:jsxRuntimeExports.jsx(UsersTabsComponent,{onTabChange:function(e){d(e)},isUserSuperAdmin:s})})]}));return i?jsxRuntimeExports.jsx(AIWareThemeProvider,{children:u}):u};export{UserDetailsPanel,UsersPanel,actions,getAdminCenterUsersModule,initialState,namespace,rootReducer,tabUseStyles};
|
package/js-core.esm118.js.gz
CHANGED
|
Binary file
|