Liferay.Loader.define("@liferay/object-js-components-web@1.0.33/components/CodeEditor/CodeEditorLocalized",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/label","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/loading-indicator","liferay!frontend-js-react-web$react","./index","./CodeEditorLocalized.scss"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditorLocalized=function CodeEditorLocalized({CustomSidebarContent:e,ariaLabels:t={default:Liferay.Language.get("default"),openLocalizations:Liferay.Language.get("open-localizations"),translated:Liferay.Language.get("translated"),untranslated:Liferay.Language.get("untranslated")},mode:a,onSelectedLocaleChange:s,onTranslationsChange:y,placeholder:p,selectedLocale:b,sidebarElements:g,translations:m}){var E;const[_,C]=(0,u.useState)(!1),[j,O]=(0,u.useState)(!0),L=f[0];return(0,u.useEffect)((()=>{setTimeout((()=>{O(!0)}),500)}),[j]),u.default.createElement("div",{className:"lfr-object__code-editor-localized"},j?u.default.createElement(d.default,{CustomSidebarContent:e,mode:a,onChange:e=>{y(_objectSpread(_objectSpread({},m),{},{[b]:e}))},placeholder:p,sidebarElements:g,value:null!==(E=m[b])&&void 0!==E?E:""}):u.default.createElement(c.default,{displayType:"secondary",size:"sm"}),u.default.createElement(l.default,{active:_,className:"lfr-notification__rich-text-localized-flag",onActiveChange:C,trigger:u.default.createElement(n.default,{displayType:"secondary",monospaced:!0,onClick:()=>C(!_),title:t.openLocalizations},u.default.createElement("span",{className:"inline-item"},u.default.createElement(r.default,{symbol:b.replace("_","-").toLowerCase()})),u.default.createElement("span",{className:"btn-section"},b))},u.default.createElement(l.default.ItemList,null,f.map((e=>{const a=m[e.label];return u.default.createElement(l.default.Item,{key:e.label,onClick:()=>{s(e),C(!1),O(!1)}},u.default.createElement(i.default.ContentRow,{containerElement:"span"},u.default.createElement(i.default.ContentCol,{containerElement:"span",expand:!0},u.default.createElement(i.default.ContentSection,null,u.default.createElement(r.default,{className:"inline-item inline-item-before",symbol:e.symbol}),e.label)),u.default.createElement(i.default.ContentCol,{containerElement:"span"},u.default.createElement(i.default.ContentSection,null,u.default.createElement(o.default,{displayType:e.label===L.label?"info":a?"success":"warning"},e.label===L.label?t.default:a?t.translated:t.untranslated)))))})))))};var n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/drop-down")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),o=_interopRequireDefault(a("@frontend-taglib-clay$clayui/label")),i=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),c=_interopRequireDefault(a("@frontend-taglib-clay$clayui/loading-indicator")),u=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 a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=_interopRequireDefault(a("./index"));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 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 _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach((function(t){_defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}a("./CodeEditorLocalized.scss");const e=Liferay.ThemeDisplay.getDefaultLanguageId(),f=Object.keys(Liferay.Language.available).sort((t=>t===e?-1:1)).map((e=>({label:e,symbol:e.replace("_","-").toLowerCase()})))}}));
//# sourceMappingURL=CodeEditorLocalized.js.map