Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/components/ModalObjectRestrictionsBody",["module","exports","require","@frontend-taglib-clay$clayui/panel","data-engine-js-components-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/panel")),n=a("data-engine-js-components-web"),i=_interopRequireDefault(a("liferay!frontend-js-react-web$react"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const ModalObjectRestrictionsSection=({children:e,description:t,title:a})=>i.default.createElement(i.default.Fragment,null,i.default.createElement("p",null,a),i.default.createElement(l.default,{displayTitle:t,displayType:"secondary"},i.default.createElement(l.default.Body,null,e))),UnmappedRequiredObjectFields=({fields:e})=>{const t=[Liferay.Language.get("checkbox-multiple-field-type-label"),Liferay.Language.get("color-field-type-label"),Liferay.Language.get("grid-field-type-label"),Liferay.Language.get("radio-field-type-label"),Liferay.Language.get("rich-text-field-type-label"),Liferay.Language.get("select-field-type-label"),Liferay.Language.get("text-field-type-label")],a=Liferay.Language.get("decimal-number"),l=Liferay.Language.get("image-field-type-label"),r=Liferay.Language.get("integer-number"),d={bigdecimal:a,blob:l,double:a,integer:r,long:r,string:t},u=(0,n.getFieldsGroupedByTypes)(e);return i.default.createElement(ModalObjectRestrictionsSection,{description:Liferay.Language.get("unmapped-object-required-fields"),title:Liferay.Language.get("to-save-this-form-all-required-fields-of-the-selected-object-need-to-be-mapped")},u.map((({fields:e,type:t})=>{const a=d[t.toLowerCase()];return i.default.createElement("div",{key:t},i.default.createElement("strong",{className:"text-capitalize"},t),a&&i.default.createElement("span",{className:"text-muted"}," (".concat(Array.isArray(a)?a.join(", "):a,")")),i.default.createElement("ol",null,e.map((({label:e,name:t})=>i.default.createElement("li",{key:t},e[themeDisplay.getDefaultLanguageId()])))))})))},UnmappedFormFields=({fields:e})=>{const t=(0,n.getFieldsGroupedByTypes)(e);return i.default.createElement(ModalObjectRestrictionsSection,{description:Liferay.Language.get("unmapped-form-fields"),title:Liferay.Language.get("all-fields-in-this-form-must-be-mapped-to-a-field-in-the-object")},t.map((({fields:e,type:t})=>i.default.createElement("div",{key:t},i.default.createElement("strong",{className:"text-capitalize"},t),i.default.createElement("ol",null,e.map((({fieldName:e,label:t})=>i.default.createElement("li",{key:e},t))))))))};var _default=({unmappedFormFields:e,unmappedRequiredObjectFields:t})=>i.default.createElement(i.default.Fragment,null,!!t.length&&i.default.createElement(UnmappedRequiredObjectFields,{fields:t}),!!e.length&&i.default.createElement(UnmappedFormFields,{fields:e}));t.default=_default}}));
//# sourceMappingURL=ModalObjectRestrictionsBody.js.map