Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/app/components/fragment_configuration_fields/CheckboxField",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@liferay/layout-js-components-web","liferay!frontend-js-react-web$classnames","frontend-js-components-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../prop_types/index","../../config/constants/viewportSizes","../../contexts/StoreContext"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxField=function CheckboxField({className:e,disabled:t,field:a,onValueSelect:u,title:f,value:p}){var y,b;const g=(0,i.useId)(),[m,_]=(0,o.useControlledState)(p||!1),w=(0,d.useSelector)((e=>e.selectedViewportSize)),h=null===(y=a.typeOptions)||void 0===y?void 0:y.customValues,j=h?m===h.checked:m,handleChange=e=>{let t=e;h&&(t=t?h.checked:h.unchecked),_(t),u(a.name,t)},v=c.default.createElement("span",{className:"font-weight-normal text-3"},a.label);return c.default.createElement(n.default.Group,{className:(0,l.default)(e,"h-100")},c.default.createElement("div",{className:"align-items-center d-flex justify-content-between page-editor__sidebar__fieldset__field-checkbox","data-tooltip-align":"bottom",title:f},"toggle"===(null===(b=a.typeOptions)||void 0===b?void 0:b.displayType)?c.default.createElement(n.ClayToggle,{"aria-describedby":a.description?g:null,containerProps:{className:"mb-0"},disabled:t,label:v,onToggle:e=>handleChange(e),toggled:j}):c.default.createElement(n.ClayCheckbox,{"aria-describedby":a.description?g:null,checked:j,containerProps:{className:"mb-0"},disabled:t,label:v,onChange:e=>handleChange(e.target.checked)}),a.responsive&&w!==s.VIEWPORT_SIZES.desktop&&c.default.createElement(r.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("restore-default"),"data-tooltip-align":"bottom",displayType:"secondary",onClick:()=>{u(a.name,null)},size:"sm",symbol:"restore",title:Liferay.Language.get("restore-default")})),a.description?c.default.createElement("p",{className:"m-0 mt-1 small text-secondary",id:g},a.description):null)};var r=a("@frontend-taglib-clay$clayui/button"),n=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 a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(a,n,o):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),o=a("@liferay/layout-js-components-web"),l=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),i=a("frontend-js-components-web"),c=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(a("liferay!frontend-js-react-web$react"))),s=(a("../../../prop_types/index"),a("../../config/constants/viewportSizes")),d=a("../../contexts/StoreContext");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}}}));
//# sourceMappingURL=CheckboxField.js.map