Liferay.Loader.define("frontend-taglib-clay@12.0.3/management_toolbar/ActionControls",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","frontend-js-components-web","liferay!frontend-js-react-web$react","../normalize_dropdown_items","./FeatureFlagContext","./LinkOrButton"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("@frontend-taglib-clay$clayui/button"),l=n("@frontend-taglib-clay$clayui/drop-down"),a=m(n("@frontend-taglib-clay$clayui/icon")),o=m(n("liferay!frontend-js-react-web$classnames")),i=n("frontend-js-components-web"),c=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var a=r?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),u=m(n("../normalize_dropdown_items")),d=m(n("./FeatureFlagContext")),f=m(n("./LinkOrButton"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function m(e){return e&&e.__esModule?e:{default:e}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n;if("group"===e.type)return y(y({},e),{},{items:null===(n=e.items)||void 0===n?void 0:n.map((e=>g(e,t)))});const r=y({onClick:n=>{t(n,{item:e})}},e);return delete r.quickAction,r}var O=({actionDropdownItems:e,disabled:t,onActionButtonClick:n})=>{const{showDesignImprovements:s}=(0,c.useContext)(d.default),m=(0,c.useMemo)((()=>(0,u.default)(null==e?void 0:e.map((e=>g(e,n))))||[]),[e,n]);return c.default.createElement(c.default.Fragment,null,e&&c.default.createElement(c.default.Fragment,null,e.flatMap((e=>"group"===e.type?e.items:[e])).filter((e=>e.quickAction&&e.icon)).map(((e,r)=>c.default.createElement(i.ManagementToolbar.Item,{className:"d-md-flex d-none",key:r},c.default.createElement(f.default,{className:(0,o.default)({"d-lg-none":s},"nav-link nav-link-monospaced"),disabled:t||e.disabled,displayType:"unstyled",href:e.href,onClick:t=>{n(t,{item:e})},symbol:e.icon,title:e.label}),s&&c.default.createElement(f.default,{className:"align-items-center d-lg-inline d-none mr-2 nav-link",disabled:t||e.disabled,displayType:"unstyled",href:e.href,onClick:t=>{n(t,{item:e})},title:e.label},c.default.createElement("span",{className:"inline-item inline-item-before"},c.default.createElement(a.default,{symbol:e.icon})),c.default.createElement("span",null,e.label))))),c.default.createElement(i.ManagementToolbar.Item,null,c.default.createElement(l.ClayDropDownWithItems,{items:m,trigger:c.default.createElement(r.ClayButtonWithIcon,{className:"nav-link nav-link-monospaced",disabled:t,displayType:"unstyled",symbol:"ellipsis-v"})}))))};t.default=O}}));
//# sourceMappingURL=ActionControls.js.map