Liferay.Loader.define("commerce-organization-web@5.0.37/js/menu/UserMenuContent",["module","exports","require","@frontend-taglib-clay$clayui/drop-down","frontend-js-web","liferay!frontend-js-react-web$react","../ChartContext","../data/users","../utils/constants","../utils/index"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({closeMenu:e,data:t,parentData:n}){const{chartInstanceRef:f}=(0,o.useContext)(i.default);const d=[];(0,l.hasPermission)(t,s.ACTION_KEYS.user.REMOVE)&&d.push(o.default.createElement(r.default.Item,{key:"remove",onClick:function(){(0,a.openConfirmModal)({message:(0,a.sub)(Liferay.Language.get("x-will-be-removed-from-x"),t.name,n.name),onConfirm:r=>{r&&("organization"===n.type?u.removeUserFromOrganization:u.removeUserFromAccount)(t.emailAddress,n.id).then((()=>{f.current.deleteNodes([t],!1),e()}))}})}},Liferay.Language.get("remove")));(0,l.hasPermission)(t,s.ACTION_KEYS.user.DELETE)&&d.push(o.default.createElement(r.default.Item,{key:"delete",onClick:function(){(0,a.openConfirmModal)({message:(0,a.sub)(Liferay.Language.get("x-will-be-deleted"),t.name),onConfirm:n=>{n&&(0,u.deleteUser)(t.id).then((()=>{f.current.deleteNodes([t],!0),e()}))}})}},Liferay.Language.get("delete")));return d};var r=d(n("@frontend-taglib-clay$clayui/drop-down")),a=n("frontend-js-web"),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),i=d(n("../ChartContext")),u=n("../data/users"),s=n("../utils/constants"),l=n("../utils/index");function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function d(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=UserMenuContent.js.map