Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.141/page_editor/app/components/fragment-configuration-fields/CheckboxField",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../core/hooks/useControlledState","../../../core/hooks/useId","../../../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,c.useId)(),[m,h]=(0,i.default)(p||!1),_=(0,s.useSelector)((e=>e.selectedViewportSize)),k=null===(y=a.typeOptions)||void 0===y?void 0:y.customValues,w=k?m===k.checked:m,handleChange=e=>{let t=e;k&&(t=t?k.checked:k.unchecked),h(t),u(a.name,t)},v=n.default.createElement("span",{className:"font-weight-normal text-3"},a.label);return n.default.createElement(o.default.Group,{className:(0,l.default)(e,"h-100")},n.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)?n.default.createElement(o.ClayToggle,{"aria-describedby":a.description?g:null,containerProps:{className:"mb-0"},disabled:t,label:v,onToggle:e=>handleChange(e),toggled:w}):n.default.createElement(o.ClayCheckbox,{"aria-describedby":a.description?g:null,checked:w,containerProps:{className:"mb-0"},disabled:t,label:v,onChange:e=>handleChange(e.target.checked)}),a.responsive&&_!==d.VIEWPORT_SIZES.desktop&&n.default.createElement(r.ClayButtonWithIcon,{"data-tooltip-align":"bottom",displayType:"secondary",onClick:()=>{u(a.name,null)},small:!0,symbol:"restore",title:Liferay.Language.get("restore-default")})),a.description?n.default.createElement("p",{className:"m-0 mt-1 small text-secondary",id:g},a.description):null)};var r=a("@frontend-taglib-clay$clayui/button"),o=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 o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var l=r?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(a,o,l):a[o]=e[o]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),l=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),n=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(a("liferay!frontend-js-react-web$react"))),i=_interopRequireDefault(a("../../../core/hooks/useControlledState")),c=a("../../../core/hooks/useId"),d=(a("../../../prop-types/index"),a("../../config/constants/viewportSizes")),s=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