Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/plugins/browser/components/page_structure/components/item_configuration_panels/FragmentGeneralPanel",["module","exports","require","@frontend-taglib-clay$clayui/alert","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../app/config/constants/commonStylesRoles","../../../../../../app/config/constants/fragmentEntryTypes","../../../../../../app/config/constants/viewportSizes","../../../../../../app/contexts/StoreContext","../../../../../../app/selectors/selectLanguageId","../../../../../../app/utils/getFragmentConfigurationValues","../../../../../../app/utils/getResponsiveConfig","../../../../../../app/utils/updateConfigurationValue","../../../../../../prop_types/index","./CommonStyles","./FieldSet"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.FragmentGeneralPanel=function FragmentGeneralPanel({item:e}){var t,r,y;const m=(0,s.useDispatch)(),b=(0,s.useSelector)((e=>e.restrictedItemIds)),S=(0,s.useSelector)((e=>e.selectedViewportSize)),_=(0,s.useSelectorCallback)((t=>t.fragmentEntryLinks[e.config.fragmentEntryLinkId]),[e.config.fragmentEntryLinkId]),O=(0,s.useSelector)(u.default),j=(0,s.useSelectorRef)((e=>e.fragmentEntryLinks));let w=null!==(t=null===(r=_.configuration)||void 0===r||null===(y=r.fieldSets)||void 0===y?void 0:y.filter((({configurationRole:e,label:t})=>!(e||_.fragmentEntryType===i.FRAGMENT_ENTRY_TYPES.input&&!t))))&&void 0!==t?t:[];Liferay.FeatureFlags["LPS-169992"]||"BASIC_COMPONENT-button"!==_.fragmentEntryKey||(w=w.map((e=>_objectSpread(_objectSpread({},e),{},{fields:e.fields.filter((e=>"type"!==e.name))}))));const v=(0,p.getResponsiveConfig)(e.config,S),E=(0,a.useCallback)(((e,t)=>{(0,f.default)({configuration:_.configuration,dispatch:m,fragmentEntryLink:_,languageId:O,name:e,value:t})}),[m,_,O]);if(Liferay.FeatureFlags["LPS-169923"]&&b.has(e.itemId))return a.default.createElement(n.default,{displayType:"secondary",role:null},Liferay.Language.get("this-content-cannot-be-displayed-due-to-permission-restrictions"));return a.default.createElement(a.default.Fragment,null,S===l.VIEWPORT_SIZES.desktop&&w.map(((e,t)=>a.default.createElement("div",{className:"mb-1",key:t},a.default.createElement(g.FieldSet,{description:e.description,fields:e.fields,fragmentEntryLinks:j.current,isCustomStylesFieldSet:!0,label:e.label,languageId:O,onValueSelect:E,selectedViewportSize:S,values:(0,c.default)(_)})))),a.default.createElement(d.CommonStyles,{commonStylesValues:v.styles,item:e,role:o.COMMON_STYLES_ROLES.general}))};var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/alert")),a=(_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 a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),o=r("../../../../../../app/config/constants/commonStylesRoles"),i=r("../../../../../../app/config/constants/fragmentEntryTypes"),l=r("../../../../../../app/config/constants/viewportSizes"),s=r("../../../../../../app/contexts/StoreContext"),u=_interopRequireDefault(r("../../../../../../app/selectors/selectLanguageId")),c=_interopRequireDefault(r("../../../../../../app/utils/getFragmentConfigurationValues")),p=r("../../../../../../app/utils/getResponsiveConfig"),f=_interopRequireDefault(r("../../../../../../app/utils/updateConfigurationValue")),d=(r("../../../../../../prop_types/index"),r("./CommonStyles")),g=r("./FieldSet");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=FragmentGeneralPanel.js.map