Liferay.Loader.define("@liferay/object-web@1.0.108/js/components/Layout/LayoutScreen/HeaderDropdown",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","liferay!frontend-js-react-web$react","../objectLayoutContext"],(function(e,t,a){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a("@frontend-taglib-clay$clayui/button"),r=(n=a("@frontend-taglib-clay$clayui/drop-down"))&&n.__esModule?n:{default:n},l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var r=n?Object.getOwnPropertyDescriptor(e,o):null;r&&(r.get||r.set)?Object.defineProperty(a,o,r):a[o]=e[o]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),i=a("../objectLayoutContext");function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}var d=({addCategorization:e,addComments:t,deleteElement:a,disabled:n})=>{const[u,d]=(0,l.useState)(!1),[{isViewOnly:c,objectDefinition:f,objectLayout:{objectLayoutTabs:y}}]=(0,i.useLayoutContext)(),s=e=>{e(),d(!1)},b=e=>{for(const t of y)if(t.objectLayoutBoxes.some((t=>t.type===e)))return!0;return!1};return l.default.createElement(r.default,{active:u,onActiveChange:d,trigger:l.default.createElement(o.ClayButtonWithIcon,{disabled:n,displayType:"unstyled",symbol:"ellipsis-v"})},l.default.createElement(r.default.ItemList,null,e&&l.default.createElement(r.default.Item,{disabled:b("categorization")||Liferay.FeatureFlags["LPS-158672"]&&!f.enabledCategorization,onClick:()=>s(e)},Liferay.Language.get("add-categorization")),Liferay.FeatureFlags["LPS-158672"]&&t&&l.default.createElement(r.default.Item,{disabled:b("comments")||!f.enabledComments,onClick:()=>s(t)},Liferay.Language.get("add-comments")),l.default.createElement(r.default.Item,{disabled:c,onClick:()=>s(a)},Liferay.Language.get("delete"))))};t.default=d}}));
//# sourceMappingURL=HeaderDropdown.js.map