Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/common/components/MappingFieldSelector",["module","exports","require","@frontend-taglib-clay$clayui/form","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$react","../../app/config/constants/editableTypes","../../app/utils/getSelectedField","../../core/hooks/useId"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({fieldType:t,fields:a,onValueSelect:i,value:d}){const s=(0,c.useId)(),p=a&&!a.length,y=(0,f.default)({fields:a,value:d});return u.default.createElement(l.default.Group,{className:(0,n.default)("mb-2 mt-3",{"has-warning":p}),small:!0},u.default.createElement("label",{htmlFor:s},Liferay.Language.get("field")),u.default.createElement(l.ClaySelect,{disabled:!(a&&a.length),id:s,onChange:i,value:null==y?void 0:y.key},a&&!!a.length&&u.default.createElement(u.default.Fragment,null,u.default.createElement(l.ClaySelect.Option,{label:e.label,value:e.value}),a.map(((e,t)=>{const a="".concat(e.label||"").concat(t);return u.default.createElement((t=>{let{children:n}=t,r=function(e,t){if(null==e)return{};var a,l,n=function(e,t){if(null==e)return{};var a,l,n={},r=Object.keys(e);for(l=0;l<r.length;l++)a=r[l],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l<r.length;l++)a=r[l],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(t,["children"]);return e.label?u.default.createElement(l.ClaySelect.OptGroup,r,n):u.default.createElement(u.default.Fragment,{key:a},n)}),{key:a,label:e.label},e.fields.map((e=>u.default.createElement(l.ClaySelect.Option,{key:e.key,label:e.label,value:e.key}))))})))),p&&u.default.createElement(l.default.FeedbackGroup,null,u.default.createElement(l.default.FeedbackItem,null,(0,r.sub)(Liferay.Language.get("no-fields-are-available-for-x-editable"),[o.EDITABLE_TYPES.backgroundImage,o.EDITABLE_TYPES.image].includes(t)?Liferay.Language.get("image"):Liferay.Language.get("text")))))};var l=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 a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),n=i(a("liferay!frontend-js-react-web$classnames")),r=a("frontend-js-web"),u=i(a("liferay!frontend-js-react-web$react")),o=a("../../app/config/constants/editableTypes"),f=i(a("../../app/utils/getSelectedField")),c=a("../../core/hooks/useId");function i(e){return e&&e.__esModule?e:{default:e}}function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}const e={label:"-- ".concat(Liferay.Language.get("unmapped")," --"),value:"unmapped"}}}));
//# sourceMappingURL=MappingFieldSelector.js.map