"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var a=f(require("react")),b=require("react-i18next"),c=f(require("prop-types")),d=require("carbon-components-react"),e=require("lodash");function f(a){return a&&a.__esModule?a:{default:a}}var g=function(c){var f=c.availableCodeLanguages,g=void 0===f?[]:f,h=c.activeCodeLanguage,i=void 0===h?"":h,j=c.onChangeCodeLanguage,k=(0,b.useTranslation)(),l=k.t,m=(0,e.isEmpty)(g)&&i||1===g.length,n=i||g[0],o=function(a){return j(a.target.value)};return m?a["default"].createElement("div",{className:"codeSnippetLanguage","aria-label":l("code_snippet_language_label")},n):function renderCodeLanguageSelector(){return a["default"].createElement(d.Select,{key:"codeLanguageSelector",hideLabel:!0,id:"codeSnippetLanguage",className:"codeSnippetLanguage",value:n,required:!0,onChange:o,"data-testid":"codeLanguage-selector"},g.map(function(b){return a["default"].createElement(d.SelectItem,{key:b,value:b,text:b,"data-testid":"codeLanguage-item"})}))}()};g.propTypes={availableCodeLanguages:c["default"].array,activeCodeLanguage:c["default"].string,onChangeCodeLanguage:c["default"].func},g.defaultProps={availableCodeLanguages:[],activeCodeLanguage:"",onChangeCodeLanguage:function onChangeCodeLanguage(){}};var h=g;exports["default"]=h;