Liferay.Loader.define("account-admin-web@2.0.78/account_users_admin/js/AccountUsersAdminManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{portletNamespace:t}=e,o=function _objectWithoutProperties(e,t){if(null==e)return{};var o,n,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var o,n,r={},c=Object.keys(e);for(n=0;n<c.length;n++)o=c[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)o=c[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,["portletNamespace"]);return _objectSpread(_objectSpread({},o),{},{onActionButtonClick:(e,{item:o})=>{const r=null==o?void 0:o.data,c=null==r?void 0:r.action;var a;"activateAccountUsers"===c?updateAccountUsers(t,null==(a=r)?void 0:a.activateAccountUsersURL):"deactivateAccountUsers"===c?(e=>{(0,n.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-deactivate-the-selected-users"),onConfirm:o=>{o&&updateAccountUsers(t,null==e?void 0:e.deactivateAccountUsersURL)}})})(r):"deleteAccountUsers"===c&&(e=>{(0,n.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-delete-the-selected-users"),onConfirm:o=>{o&&updateAccountUsers(t,null==e?void 0:e.deleteAccountUsersURL)}})})(r)},onCreateButtonClick:(e,{item:o})=>{const r=null==o?void 0:o.data;(0,n.openSelectionModal)({id:"".concat(t,"addAccountUser"),onSelect:e=>{const t=(0,n.createPortletURL)(null==r?void 0:r.addAccountUserURL,{accountEntryId:e.accountentryid});(0,n.navigate)(t)},selectEventName:"".concat(t,"selectAccountEntry"),title:null==r?void 0:r.dialogTitle,url:null==r?void 0:r.accountEntrySelectorURL})},onFilterDropdownItemClick(e,{item:t}){var o,r;"selectAccountEntries"===(null==t||null===(o=t.data)||void 0===o?void 0:o.action)&&(r=null==t?void 0:t.data,(0,n.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),containerProps:{className:""},iframeBodyCssClass:"",multiple:!0,onSelect:e=>{if(!(null==e?void 0:e.length))return;const t=e.map((e=>e.value)),o=(0,n.createPortletURL)(null==r?void 0:r.redirectURL,{accountEntriesNavigation:"selected-accounts",accountEntryIds:t.join(",")});(0,n.navigate)(o)},title:null==r?void 0:r.dialogTitle,url:null==r?void 0:r.accountEntriesSelectorURL}))}})};var n=o("frontend-js-web");function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){_defineProperty(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const updateAccountUsers=(e,t)=>{const o=document.getElementById("".concat(e,"fm"));o&&(0,n.postForm)(o,{data:{accountUserIds:(0,n.getCheckedCheckboxes)(o,"".concat(e,"allRowIds"))},url:t})}}}));
//# sourceMappingURL=AccountUsersAdminManagementToolbarPropsTransformer.js.map