Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/plugins/browser/components/page-structure/components/item-configuration-panels/FragmentStylesPanel",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../app/config/constants/fragmentConfigurationRoles","../../../../../../app/config/constants/viewportSizes","../../../../../../app/config/index","../../../../../../app/contexts/StoreContext","../../../../../../app/selectors/selectLanguageId","../../../../../../app/utils/getFragmentConfigurationValues","../../../../../../app/utils/getResponsiveConfig","../../../../../../app/utils/updateConfigurationValue","../../../../../../prop-types/index","./CommonStyles","./FieldSet"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.FragmentStylesPanel=function({item:t}){var n,l;const u=(0,i.useDispatch)(),g=(0,i.useSelectorCallback)((e=>e.fragmentEntryLinks[t.config.fragmentEntryLinkId]),[t.config.fragmentEntryLinkId]),d=(0,i.useSelector)(s.default),m=(0,i.useSelector)((e=>e.selectedViewportSize)),y=(0,f.getResponsiveConfig)(t.config,m),S=(null===(n=g.configuration)||void 0===n||null===(l=n.fieldSets)||void 0===l?void 0:l.filter((e=>e.configurationRole===o.FRAGMENT_CONFIGURATION_ROLES.style)).length)&&m===r.VIEWPORT_SIZES.desktop,v=(0,a.useCallback)(((e,t)=>{(0,c.default)({configuration:g.configuration,dispatch:u,fragmentEntryLink:g,languageId:d,name:e,value:t})}),[u,g,d]);return a.default.createElement(a.default.Fragment,null,m===r.VIEWPORT_SIZES.desktop&&a.default.createElement(e,{fragmentEntryLink:g,onValueSelect:v}),a.default.createElement(p.CommonStyles,{className:S?"mt-3":null,commonStylesValues:y.styles,item:t}))};m(n("liferay!frontend-js-react-web$prop-types"));var a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var r=a?Object.getOwnPropertyDescriptor(e,o):null;r&&(r.get||r.set)?Object.defineProperty(n,o,r):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),o=n("../../../../../../app/config/constants/fragmentConfigurationRoles"),r=n("../../../../../../app/config/constants/viewportSizes"),l=n("../../../../../../app/config/index"),i=n("../../../../../../app/contexts/StoreContext"),s=m(n("../../../../../../app/selectors/selectLanguageId")),u=m(n("../../../../../../app/utils/getFragmentConfigurationValues")),f=n("../../../../../../app/utils/getResponsiveConfig"),c=m(n("../../../../../../app/utils/updateConfigurationValue")),p=(n("../../../../../../prop-types/index"),n("./CommonStyles")),g=n("./FieldSet");function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function m(e){return e&&e.__esModule?e:{default:e}}const e=({fragmentEntryLink:e,onValueSelect:t})=>{var n,r;const i=null===(n=e.configuration)||void 0===n||null===(r=n.fieldSets)||void 0===r?void 0:r.filter((e=>e.configurationRole===o.FRAGMENT_CONFIGURATION_ROLES.style));return(null==i?void 0:i.length)?a.default.createElement("div",{className:"page-editor__page-structure__section__custom-styles pb-0"},a.default.createElement("h1",{className:"sr-only"},Liferay.Language.get("custom-styles")),i.map(((n,o)=>a.default.createElement(g.FieldSet,{fields:n.fields,isCustomStylesFieldSet:!0,key:o,label:n.label,languageId:l.config.defaultLanguageId,onValueSelect:t,values:(0,u.default)(e)})))):null}}}));
//# sourceMappingURL=FragmentStylesPanel.js.map