Liferay.Loader.define("site-membership-web@5.0.57/js/UserGroupsDefaultPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=function propsTransformer(r){let{actions:t,items:o,portletNamespace:n}=r,a=function _objectWithoutProperties(e,r){if(null==e)return{};var t,o,n=function _objectWithoutPropertiesLoose(e,r){if(null==e)return{};var t,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(r,["actions","items","portletNamespace"]);const updateItem=r=>{const t=_objectSpread(_objectSpread({},r),{},{onClick(t){var o;const a=null===(o=r.data)||void 0===o?void 0:o.action;var s;a&&(t.preventDefault(),null===(s=e[a])||void 0===s||s.call(e,r.data,n))}});return Array.isArray(r.items)&&(t.items=r.items.map(updateItem)),t};return _objectSpread(_objectSpread({},a),{},{actions:null==t?void 0:t.map(updateItem),items:null==o?void 0:o.map(updateItem)})};var o=t("frontend-js-web");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const e={assignUserGroupRole(e,r){const t=document["".concat(r,"addUserGroupGroupRoleFm")];t&&((0,o.setFormValues)(t,{userGroupId:e.userGroupId}),(0,o.openSelectionModal)({buttonAddLabel:Liferay.Language.get("done"),multiple:!0,onSelect(e){if(!e)return;const o=document.createElement("input");o.name="".concat(r,"rowIds");const n=Array.prototype.map.call(e,(e=>e.value));o.value=n.join(),t.appendChild(o),submitForm(t)},title:Liferay.Language.get("assign-roles"),url:e.assignUserGroupRoleURL}))},deleteGroupUserGroups(e){(0,o.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-delete-this"),onConfirm:r=>r&&submitForm(document.hrefFm,e.deleteGroupUserGroupsURL)})},unassignUserGroupRole(e,r){const t=document["".concat(r,"unassignUserGroupGroupRoleFm")];t&&((0,o.setFormValues)(t,{userGroupId:e.userGroupId}),(0,o.openSelectionModal)({buttonAddLabel:Liferay.Language.get("done"),multiple:!0,onSelect(e){if(!e)return;const o=document.createElement("input");o.name="".concat(r,"rowIds");const n=Array.prototype.map.call(e,(e=>e.value));o.value=n.join(),t.appendChild(o),submitForm(t)},title:Liferay.Language.get("unassign-roles"),url:e.unassignUserGroupRoleURL}))}}}}));
//# sourceMappingURL=UserGroupsDefaultPropsTransformer.js.map