Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/layout-data-items/ContainerWithControls",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../../../core/hooks/useSetRef","../../../prop-types/index","../../config/constants/containerWidthTypes","../../contexts/ControlsContext","../../contexts/StoreContext","../../selectors/selectCanUpdateItemConfiguration","../../utils/getLayoutDataItemTopperUniqueClassName","../../utils/getResponsiveConfig","../topper/Topper","./Container","./isHovered"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=y(o("liferay!frontend-js-react-web$classnames")),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=v();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=r?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=e[n]}o.default=e,t&&t.set(e,o);return o}(o("liferay!frontend-js-react-web$react")),a=y(o("../../../core/hooks/useSetRef")),i=(o("../../../prop-types/index"),o("../../config/constants/containerWidthTypes")),s=o("../../contexts/ControlsContext"),l=o("../../contexts/StoreContext"),d=y(o("../../selectors/selectCanUpdateItemConfiguration")),u=y(o("../../utils/getLayoutDataItemTopperUniqueClassName")),f=o("../../utils/getResponsiveConfig"),c=y(o("../topper/Topper")),p=y(o("./Container")),m=y(o("./isHovered"));function v(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return v=function(){return e},e}function y(e){return e&&e.__esModule?e:{default:e}}var g=n.default.forwardRef((({children:t,item:o},s)=>{const m=(0,l.useSelector)(d.default),[v,y]=(0,n.useState)(!1),g=(0,l.useSelector)((e=>e.selectedViewportSize)),[C,I]=(0,a.default)(s),T=(0,f.getResponsiveConfig)(o.config,g),{widthType:_}=T;return n.default.createElement(n.default.Fragment,null,n.default.createElement(e,{hovered:v,item:o,setHovered:y}),n.default.createElement(c.default,{className:(0,r.default)((0,u.default)(o.itemId),{"container-fluid":_===i.CONTAINER_WIDTH_TYPES.fixed,"container-fluid-max-xl":_===i.CONTAINER_WIDTH_TYPES.fixed,"p-0":_===i.CONTAINER_WIDTH_TYPES.fixed,"page-editor__topper--hovered":v}),item:o,itemElement:I},n.default.createElement(p.default,{className:(0,r.default)({"page-editor__container":m}),item:o,ref:C},t)))}));t.default=g;const e=({hovered:e,item:t,setHovered:o})=>{const r=(0,s.useHoveredItemType)(),a=(0,s.useHoveredItemId)();return(0,n.useEffect)((()=>{var n,i;const s=null===(n=t.config)||void 0===n||null===(i=n.styles)||void 0===i?void 0:i.backgroundImage;if((null==s?void 0:s.classNameId)&&(null==s?void 0:s.classPK)){const t=(0,m.default)({editableValue:s,hoveredItemId:a,hoveredItemType:r});e!==t&&o(t)}}),[e,a,r,t,o]),null}}}));
//# sourceMappingURL=ContainerWithControls.js.map