import{h,F as Fragment}from"./index-15028158.js";import{a as lookupFormat}from"./languageUtils-d43f5d69.js";var LanguagePickerInline=function(e){var a,n;var l=lookupFormat(e.activeLanguage);var i=Object.keys((a=e.executableLanguages)!==null&&a!==void 0?a:{}).length>0;var t=i?Object.entries(e.languageCapabilities).reduce((function(a,n){var l;var i=n[0],t=n[1];return Object.keys(e.executableLanguages).includes(i)?a:Object.assign(Object.assign({},a),(l={},l[i]=t,l))}),{}):e.languageCapabilities;return h("stencila-menu",{"aria-label":"Programming Language",autoClose:true},h("stencila-button",{iconOnly:true,icon:"terminal",size:"xsmall",slot:"toggle","aria-label":"Toggle menu",color:"key",minimal:true,tooltip:""+l.name,disabled:e.disabled}),i&&h(Fragment,null,Object.values((n=e.executableLanguages)!==null&&n!==void 0?n:{}).map((function(a){return h("stencila-menu-item",{size:"xsmall",onClick:function(){var n;return(n=e.onSetLanguage)===null||n===void 0?void 0:n.call(e,a.name)},icon:a.name===l.name?"check":undefined},a.name)})),h("stencila-menu-item",{size:"xsmall",divider:true},"Not executable")),Object.values(t).map((function(a){return h("stencila-menu-item",{size:"xsmall",onClick:function(){var n;return(n=e.onSetLanguage)===null||n===void 0?void 0:n.call(e,a.name)}},a.name)})))};export{LanguagePickerInline as L};
//# sourceMappingURL=languageSelect-70b0359d.js.map