Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/layout-data-items/Container",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../core/hooks/useId","../../../prop-types/index","../../config/constants/containerWidthTypes","../../config/constants/contentDisplayOptions","../../contexts/CollectionItemContext","../../contexts/StoreContext","../../selectors/selectLanguageId","../../utils/editable-value/resolveEditableValue","../../utils/getEditableLinkValue","../../utils/getLayoutDataItemClassName","../../utils/getLayoutDataItemCssClasses","../../utils/getLayoutDataItemUniqueClassName","../../utils/getResponsiveConfig","../../utils/useBackgroundImageValue"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=j(n("liferay!frontend-js-react-web$classnames")),a=(j(n("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=O();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"))),o=n("../../../core/hooks/useId"),l=(n("../../../prop-types/index"),n("../../config/constants/containerWidthTypes")),i=n("../../config/constants/contentDisplayOptions"),s=n("../../contexts/CollectionItemContext"),u=n("../../contexts/StoreContext"),c=j(n("../../selectors/selectLanguageId")),f=j(n("../../utils/editable-value/resolveEditableValue")),d=n("../../utils/getEditableLinkValue"),p=j(n("../../utils/getLayoutDataItemClassName")),y=j(n("../../utils/getLayoutDataItemCssClasses")),g=j(n("../../utils/getLayoutDataItemUniqueClassName")),b=n("../../utils/getResponsiveConfig"),m=j(n("../../utils/useBackgroundImageValue"));function O(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return O=function(){return e},e}function j(e){return e&&e.__esModule?e:{default:e}}function I(){return(I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const e=a.default.memo(a.default.forwardRef((({children:e,className:t,data:n,item:O},j)=>{const v=(0,o.useId)(),w=(0,s.useGetFieldValue)(),C=(0,u.useSelector)(c.default),[x,P]=(0,a.useState)(null),D=(0,u.useSelector)((e=>e.selectedViewportSize)),E=(0,b.getResponsiveConfig)(O.config,D),{backgroundImage:N,height:k}=E.styles,{align:T,contentDisplay:L,contentVisibility:_,flexWrap:S,justify:V,widthType:R}=E,W=(0,m.default)(v,N,w);(0,a.useEffect)((()=>{if(!E.link)return;const e=(0,d.getEditableLinkValue)(E.link,C);(0,f.default)(e,C,w).then((t=>{"string"==typeof t?P(h(h({},e),{},{href:t})):t&&P(h(h({},e),t))}))}),[E.link,C,w]);const $={};W.url&&($["--lfr-background-image-".concat(O.itemId)]="url(".concat(W.url,")"),(null==N?void 0:N.fileEntryId)&&($["--background-image-file-entry-id"]=N.fileEntryId)),_&&($.contentVisibility=_);const M=E.htmlTag||"div",A=a.default.createElement(M,I({},x?{}:n,{className:(0,r.default)(t,(0,p.default)(O.type),(0,y.default)(O),(0,g.default)(O.itemId),{[T]:!!T,"container-fluid":R===l.CONTAINER_WIDTH_TYPES.fixed,"container-fluid-max-xl":R===l.CONTAINER_WIDTH_TYPES.fixed,"d-flex flex-column":L===i.CONTENT_DISPLAY_OPTIONS.flexColumn,"d-flex flex-row":L===i.CONTENT_DISPLAY_OPTIONS.flexRow,empty:!O.children.length&&!k,[S]:Boolean(S),[V]:Boolean(V)}),id:v,ref:j,style:$}),W.mediaQueries?a.default.createElement("style",null,W.mediaQueries):null,e);return(null==x?void 0:x.href)?a.default.createElement("a",I({},n,{href:x.href,style:{color:"inherit",textDecoration:"none"},target:x.target}),A):A})));e.displayName="Container";var C=e;t.default=C}}));
//# sourceMappingURL=Container.js.map