Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/browser/components/page-structure/components/item-configuration-panels/FieldSet",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../app/components/fragment-configuration-fields/index","../../../../../../app/config/constants/containerWidthTypes","../../../../../../app/config/constants/fragmentEntryTypes","../../../../../../app/config/constants/layoutDataItemTypes","../../../../../../app/config/constants/viewportSizes","../../../../../../app/contexts/StoreContext","../../../../../../app/utils/getEditableLocalizedValue","../../../../../../app/utils/isNullOrUndefined","../../../../../../common/components/Collapse","../../../../../../common/components/CurrentLanguageFlag","../../../../../../prop-types/index"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.fieldIsDisabled=S,t.FieldSet=function({isCustomStylesFieldSet:e=!1,fields:t,item:a={},label:n,languageId:r,onValueSelect:i,values:d}){const p=(0,u.useSelector)((e=>e)),{fragmentEntryLinks:m,selectedViewportSize:g}=p,y=function(e,t,a,n){let l=t;n!==c.VIEWPORT_SIZES.desktop&&(l=t.filter((e=>e.responsive||"backgroundImage"===e.name)));if(e.type!==s.LAYOUT_DATA_ITEM_TYPES.fragment)return l;a[e.config.fragmentEntryLinkId].fragmentEntryType===o.FRAGMENT_ENTRY_TYPES.input&&(l=l.filter((e=>"display"!==e.name)));return l}(a,t,m,g);return y.length&&n?l.default.createElement(f.default,{label:n,open:!0},l.default.createElement(E,{fields:y,isCustomStylesFieldSet:e,item:a,languageId:r,onValueSelect:i,values:d})):l.default.createElement(E,{fields:y,isCustomStylesFieldSet:e,item:a,languageId:r,onValueSelect:i,values:d})};var n=g(a("liferay!frontend-js-react-web$classnames")),l=(g(a("liferay!frontend-js-react-web$prop-types")),g(a("liferay!frontend-js-react-web$react"))),r=a("../../../../../../app/components/fragment-configuration-fields/index"),i=a("../../../../../../app/config/constants/containerWidthTypes"),o=a("../../../../../../app/config/constants/fragmentEntryTypes"),s=a("../../../../../../app/config/constants/layoutDataItemTypes"),c=a("../../../../../../app/config/constants/viewportSizes"),u=a("../../../../../../app/contexts/StoreContext"),d=a("../../../../../../app/utils/getEditableLocalizedValue"),p=g(a("../../../../../../app/utils/isNullOrUndefined")),f=g(a("../../../../../../common/components/Collapse")),m=g(a("../../../../../../common/components/CurrentLanguageFlag"));a("../../../../../../prop-types/index");function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?y(Object(a),!0).forEach((function(t){_(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):y(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e={small:"small"},T={borderRadius:"",borderWidth:0,opacity:"",shadow:""};function S(e,t){var a;return!!t.disabled||e.type===s.LAYOUT_DATA_ITEM_TYPES.container&&(null===(a=e.config)||void 0===a?void 0:a.widthType)===i.CONTAINER_WIDTH_TYPES.fixed&&("marginRight"===t.name||"marginLeft"===t.name)}function E({fields:t,isCustomStylesFieldSet:a,item:i,languageId:o,onValueSelect:s,values:c}){const u=Liferay.FeatureFlags["LPS-163362"]?t:t.map((e=>b(b({},e),{},{defaultValue:(0,p.default)(T[e.name])?e.defaultValue:T[e.name]})));return l.default.createElement("div",{className:"page-editor__sidebar__fieldset"},u.map(((t,u)=>{let d=t.type&&r.FRAGMENT_CONFIGURATION_FIELDS[t.type];return Liferay.FeatureFlags["LPS-163362"]||"opacity"!==t.name||(d=r.FRAGMENT_CONFIGURATION_FIELDS.text),l.default.createElement("div",{className:(0,n.default)(t.cssClass,"autofit-row page-editor__sidebar__fieldset__field align-items-end",{"page-editor__sidebar__fieldset__field-small":t.displaySize===e.small}),key:u},l.default.createElement("div",{className:"autofit-col autofit-col-expand"},l.default.createElement(d,{disabled:S(i,t),field:t,isCustomStyle:a,item:i,onValueSelect:s,value:O({field:t,languageId:o,values:c})})),t.localizable&&l.default.createElement(m.default,{className:"ml-2"}))})))}function O({field:e,languageId:t,values:a}){if(""===e.name)return a;const n=a[e.name];return(0,p.default)(n)?e.defaultValue:e.localizable&&"object"==typeof n?(0,d.getEditableLocalizedValue)(n,t,e.defaultValue):n}}}));
//# sourceMappingURL=FieldSet.js.map