Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.174/page_editor/plugins/browser/components/page_structure/components/item_configuration_panels/collection_general_panel/PaginationOptions",["module","exports","require","@frontend-taglib-clay$clayui/form","@liferay/layout-js-components-web","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../../app/config/constants/paginationErrorMessages","../../../../../../../app/config/index","../../../../../../../common/components/WarningMessage","../../../../../../../common/hooks/useId"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.PaginationOptions=function PaginationOptions({displayAllPages:e,handleConfigurationChanged:a,initialNumberOfItemsPerPage:t,initialNumberOfPages:d}){const g=(0,f.useId)(),p=(0,f.useId)(),[m,b]=(0,r.useControlledState)(t),[y,_]=(0,i.useState)(null),[h,P]=(0,i.useState)(d),O=t>s.config.searchContainerPageMaxDelta;return(0,i.useEffect)((()=>{let e=null;O?e=(0,o.sub)(u.PAGINATION_ERROR_MESSAGES.maximumItemsPerPage,s.config.searchContainerPageMaxDelta):t<1&&(e=u.PAGINATION_ERROR_MESSAGES.neededItem),_(e)}),[O,t]),i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"mb-2 pt-1"},i.default.createElement(n.ClayCheckbox,{checked:e,label:Liferay.Language.get("display-all-pages"),onChange:e=>a({displayAllPages:e.target.checked})})),!e&&i.default.createElement(n.default.Group,{small:!0},i.default.createElement("label",{htmlFor:p},Liferay.Language.get("maximum-number-of-pages-to-display")),i.default.createElement(n.ClayInput,{id:p,min:"1",onBlur:e=>{const t=Math.abs(Number(e.target.value))||1;(!h||h<0)&&P(t),t!==d&&a({numberOfPages:t})},onChange:e=>P(Number(e.target.value)),type:"number",value:h||""})),i.default.createElement(n.default.Group,{className:(0,l.default)({"has-warning":y}),small:!0},i.default.createElement("label",{htmlFor:g},Liferay.Language.get("maximum-number-of-items-per-page")),i.default.createElement(n.ClayInput,{id:g,min:"1",onBlur:e=>{const n=Math.abs(Number(e.target.value))||1;(!m||m<0)&&b(n),n!==t&&a({numberOfItemsPerPage:n})},onChange:e=>b(Number(e.target.value)),type:"number",value:m||""}),y&&i.default.createElement(c.WarningMessage,{message:y})))};var n=_interopRequireWildcard(t("@frontend-taglib-clay$clayui/form")),r=t("@liferay/layout-js-components-web"),l=_interopRequireDefault(t("liferay!frontend-js-react-web$classnames")),o=t("frontend-js-web"),i=(_interopRequireDefault(t("liferay!frontend-js-react-web$prop-types")),_interopRequireWildcard(t("liferay!frontend-js-react-web$react"))),u=t("../../../../../../../app/config/constants/paginationErrorMessages"),s=t("../../../../../../../app/config/index"),c=t("../../../../../../../common/components/WarningMessage"),f=t("../../../../../../../common/hooks/useId");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_getRequireWildcardCache();if(a&&a.has(e))return a.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(t,r,l):t[r]=e[r]}return t.default=e,a&&a.set(e,t),t}}}));
//# sourceMappingURL=PaginationOptions.js.map