Liferay.Loader.define("@liferay/object-js-components-web@1.0.33/components/InputLocalized",["module","exports","require","@frontend-taglib-clay$clayui/localized-input","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","./FieldBase","./InputLocalized.scss"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.InputLocalized=function InputLocalized(e){let{disableFlag:t,disabled:r,error:c,id:s,label:u,name:d,onChange:f,placeholder:p,required:b,selectedLocale:y,translations:g}=e,j=function _objectWithoutProperties(e,t){if(null==e)return{};var r,a,l=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,a,l={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(e,["disableFlag","disabled","error","id","label","name","onChange","placeholder","required","selectedLocale","translations"]);const[_,h]=(0,n.useState)(i[0]);return(0,n.useEffect)((()=>{var e;if(t){const e=document.querySelector(".dropdown-toggle");null==e||e.setAttribute("disabled","true")}const r=null!==(e=i.find((({label:e})=>e===y)))&&void 0!==e?e:i[0];h(r)}),[t,y]),n.default.createElement(o.FieldBase,{className:"lfr-objects__input-localized",disabled:r,errorMessage:c,id:s,label:u,required:b},n.default.createElement(a.default,_extends({},j,{className:(0,l.default)({"lfr-objects__input-localized--rtl":"rtl"===Liferay.Language.direction[_.label]}),disabled:r,id:s,label:"",locales:i,name:d,onSelectedLocaleChange:e=>{h(e),f(g,e)},onTranslationsChange:e=>f(e,_),placeholder:p,selectedLocale:_,translations:g})))};var a=_interopRequireDefault(r("@frontend-taglib-clay$clayui/localized-input")),l=_interopRequireDefault(r("liferay!frontend-js-react-web$classnames")),n=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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=a?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=r("./FieldBase");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 _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}r("./InputLocalized.scss");const e=Liferay.ThemeDisplay.getDefaultLanguageId(),i=Object.keys(Liferay.Language.available).sort((t=>t===e?-1:1)).map((e=>({label:e,symbol:e.replace("_","-").toLowerCase()})))}}));
//# sourceMappingURL=InputLocalized.js.map