Liferay.Loader.define("@liferay/commerce-product-definitions-web@7.0.105/js/ProductOptionCheckboxMultiple",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$react","./Asterisk"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=_interopRequireWildcard(t("@frontend-taglib-clay$clayui/form")),o=_interopRequireWildcard(t("liferay!frontend-js-react-web$react")),a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(t("./Asterisk"));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 r=_getRequireWildcardCache();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var _default=({label:e,onChange:r,productOptionValues:t,required:c})=>{const[i,l]=(0,o.useState)(t.reduce(((e,r)=>(e[r.id]=r,e)),{}));return o.default.createElement(n.default.Group,null,o.default.createElement("label",null,e,o.default.createElement(a.default,{required:c})),Object.values(i).map((({id:e,key:t,label:a,name:c,selected:u})=>o.default.createElement(n.ClayCheckbox,{checked:u,key:t,label:a,name:c,onChange:t=>(({target:{checked:e}},t)=>{const n=_objectSpread(_objectSpread({},i),{},{[t]:_objectSpread(_objectSpread({},i[t]),{},{selected:e})});l(n),r(n)})(t,e)}))))};r.default=_default}}));
//# sourceMappingURL=ProductOptionCheckboxMultiple.js.map