Liferay.Loader.define("@liferay/frontend-taglib@8.0.4/translation_manager/index",["module","exports","require","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","./components/DeleteLocaleModal","./components/LocaleSelector","./components/LocalesContainer","./components/LocalesList","./hooks/useRegistry"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){const a=new Map(t.availableLocales.map((e=>[e.id,e])));return l.default.createElement(e,f({},t,{availableLocales:a}))};var n=a("@frontend-taglib-clay$clayui/modal"),l=(d(a("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();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 o=n?Object.getOwnPropertyDescriptor(e,l):null;o&&(o.get||o.set)?Object.defineProperty(a,l,o):a[l]=e[l]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),o=d(a("./components/DeleteLocaleModal")),r=d(a("./components/LocaleSelector")),c=d(a("./components/LocalesContainer")),u=d(a("./components/LocalesList")),s=d(a("./hooks/useRegistry"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function d(e){return e&&e.__esModule?e:{default:e}}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}const e=({availableLocales:e,changeableDefaultLanguage:t,componentId:a,cssClass:i,defaultLanguageId:d,id:f,locales:p,readOnly:m})=>{const y=a||f,[L,b]=(0,l.useState)(e),[g,v]=(0,l.useState)(d),[w,O]=(0,l.useState)(d),[j,M]=(0,l.useState)(!1);(0,s.default)({componentId:y,states:{availableLocales:L,defaultLocale:g,editingLocale:w}});const{observer:h,onClose:C}=(0,n.useModal)({onClose:()=>M(!1)}),E=l.default.useRef(null);return l.default.createElement(l.default.Fragment,null,j&&l.default.createElement(o.default,{observer:h,onCancel:()=>{E.current=null,C()},onConfirm:()=>{(e=>{g===e.id&&v(w),w===e.id&&O(g);const t=new Map(L);t.delete(e.id),b(t)})(E.current),C()}}),l.default.createElement("div",{className:"autofit-row"},l.default.createElement("div",{className:"autofit-col autofit-col-expand"},l.default.createElement(c.default,{className:i,id:f,readOnly:m},l.default.createElement(u.default,{availableLocales:L,changeableDefaultLanguage:t,defaultLocale:g,editingLocale:w,onLocaleClicked:e=>{t&&v(e.id),O(e.id)},onLocaleRemoved:e=>{E.current=e,M(!0)}}),l.default.createElement("div",{className:"autofit-col"},l.default.createElement(r.default,{locales:p,onItemClick:e=>{b(new Map(L).set(e.id,e)),O(e.id)}}))))))}}}));
//# sourceMappingURL=index.js.map