Liferay.Loader.define("account-admin-web@2.0.61/account_groups_admin/js/AccountGroupAccountEntriesManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{additionalProps:{accountGroupName:t,assignAccountGroupAccountEntriesURL:n,removeAccountGroupAccountEntriesURL:r,selectAccountGroupAccountEntriesURL:a},portletNamespace:u}=e;return c(c({},function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["additionalProps","portletNamespace"])),{},{onActionButtonClick:(e,{item:t})=>{var n;"removeAccountGroupAccountEntries"===(null==t||null===(n=t.data)||void 0===n?void 0:n.action)&&(0,o.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-remove-the-selected-accounts"),onConfirm:e=>{if(e){const e=document.getElementById("".concat(u,"fm"));e&&(0,o.postForm)(e,{data:{accountEntryIds:(0,o.getCheckedCheckboxes)(e,"".concat(u,"allRowIds"))},url:r})}}})},onCreateButtonClick:()=>{(0,o.openSelectionModal)({buttonAddLabel:Liferay.Language.get("assign"),containerProps:{className:""},iframeBodyCssClass:"",multiple:!0,onSelect:e=>{if(!(null==e?void 0:e.length))return;const t=document.getElementById("".concat(u,"fm"));if(t){const r=e.map((e=>e.value));(0,o.postForm)(t,{data:{accountEntryIds:r.join(",")},url:n})}},title:(0,o.sub)(Liferay.Language.get("assign-accounts-to-x"),t),url:a})}})};var o=n("frontend-js-web");function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=AccountGroupAccountEntriesManagementToolbarPropsTransformer.js.map