Liferay.Loader.define("portal-search-ranking-web@3.0.58/js/components/list/ItemDropdown.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utils/language.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/drop-down")),i=_interopRequireDefault(r("@frontend-taglib-clay$clayui/icon")),o=(r("liferay!frontend-js-react-web$prop-types"),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),l=r("../../utils/language.es");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,a=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ItemDropdown extends o.Component{constructor(...e){super(...e),_defineProperty(this,"state",{show:!1}),_defineProperty(this,"_handleDropdownAction",(e=>t=>{t.preventDefault(),e(t),this.setState({show:!1})})),_defineProperty(this,"_handleSetShow",(e=>{this.setState({show:e})}))}render(){const e=this.props,{hidden:t,itemCount:r,onClickHide:u,onClickPin:s,pinned:d}=e,f=_objectWithoutProperties(e,["hidden","itemCount","onClickHide","onClickPin","pinned"]),{show:c}=this.state;return o.default.createElement(a.default,_extends({active:c,hasLeftSymbols:!0,onActiveChange:this._handleSetShow,trigger:o.default.createElement(n.default,{"aria-expanded":"false","aria-haspopup":"true","aria-label":Liferay.Language.get("actions"),className:"btn-outline-borderless component-action",title:Liferay.Language.get("actions")},o.default.createElement(i.default,{symbol:"ellipsis-v"}))},f),o.default.createElement(a.default.ItemList,null,s&&o.default.createElement(a.default.Item,{key:d?"UNPIN":"PIN",onClick:this._handleDropdownAction(s),symbolLeft:d?"unpin":"pin"},d?(0,l.getPluralMessage)(Liferay.Language.get("unpin-result"),Liferay.Language.get("unpin-results"),r):(0,l.getPluralMessage)(Liferay.Language.get("pin-result"),Liferay.Language.get("pin-results"),r)),u&&o.default.createElement(a.default.Item,{onClick:this._handleDropdownAction(u),symbolLeft:t?"view":"hidden"},t?(0,l.getPluralMessage)(Liferay.Language.get("show-result"),Liferay.Language.get("show-results"),r):(0,l.getPluralMessage)(Liferay.Language.get("hide-result"),Liferay.Language.get("hide-results"),r))))}}_defineProperty(ItemDropdown,"defaultProps",{itemCount:1});var u=ItemDropdown;t.default=u}}));
//# sourceMappingURL=ItemDropdown.es.js.map