Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/app/components/fragment_configuration_fields/SpacingBoxField",["module","exports","require","@liferay/layout-js-components-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../common/components/InvisibleFieldset","../../../common/components/SpacingBox","../../../prop_types/index","../../contexts/StoreContext","../../selectors/selectCanDetachTokenValues","../../utils/getPreviousResponsiveStyle"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.SpacingBoxField=function SpacingBoxField({disabled:e,field:t,item:r,onValueSelect:s,value:p}){const[f,d]=(0,n.useControlledState)(p),y=(0,l.useSelector)(c.default),b=(0,l.useSelector)((e=>e.selectedViewportSize)),g=(0,o.useMemo)((()=>{const e={};return t.typeOptions.spacingFieldSets.forEach((t=>{t.styles.forEach((t=>{e[t.name]=t}))})),e}),[t.typeOptions.spacingFieldSets]);return o.default.createElement(o.default.Fragment,null,o.default.createElement(i.default,{disabled:e},t.label?o.default.createElement("div",{className:"sr-only"},t.label):null,o.default.createElement(a.default,{canSetCustomValue:y,fields:g,onChange:(e,t,{isReset:n=!1}={})=>{if(n){const t=(0,u.default)(e,r.config,b);d((r=>_objectSpread(_objectSpread({},r),{},{[e]:t})))}else d((r=>_objectSpread(_objectSpread({},r),{},{[e]:t})));s(e,t)},value:f})))};var n=r("@liferay/layout-js-components-web"),o=(_interopRequireDefault(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 o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),i=_interopRequireDefault(r("../../../common/components/InvisibleFieldset")),a=_interopRequireDefault(r("../../../common/components/SpacingBox")),l=(r("../../../prop_types/index"),r("../../contexts/StoreContext")),c=_interopRequireDefault(r("../../selectors/selectCanDetachTokenValues")),u=_interopRequireDefault(r("../../utils/getPreviousResponsiveStyle"));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 ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}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}}}));
//# sourceMappingURL=SpacingBoxField.js.map