import{s as a}from"./chunk-LvLJmgfZ.js";import{t as d}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import"./compiler-runtime-B3qBwwSJ.js";import{g as f}from"./useEventListener-C0195JsF.js";import{t as g}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-CTDqNQr6.js";import"./dist-12S8I4CH.js";import"./dist-DcwTQG1A.js";import"./dist-DnjsPBRJ.js";import"./dist-BJZAIIze.js";import"./dist-aRc_dRed.js";import"./dist-CPjTeT8p.js";import{t as h}from"./copy-icon-neDQUo4Q.js";import{n as c}from"./error-banner-BSxEOIn2.js";import{t as x}from"./esm-B30N1GS0.js";import"./dist-CZvbHnyT.js";import"./dist-C-3FVUQA.js";import"./dist-l4RTzHX-.js";import"./dist-fLBYOt9R.js";import"./dist-DJuRuTXr.js";import"./dist-BKgHjzML.js";import"./dist-kLs0VbW_.js";import"./dist-D47O3FBX.js";import"./dist-DQl27SFq.js";import{n as v,t as p}from"./esm-BDGraAqp.js";var j=a(d(),1),o=a(g(),1);const e={python:"py",python3:"py",javascript:"js",typescript:"ts",shell:"sh",bash:"sh",unknown:"text",undefined:"text"};function m(t){return t?t in p:!1}var y=({language:t,hideUnsupportedLanguageErrors:n,showCopyButton:u,extensions:r=[],...s})=>{t=e[t||""]||t;let i=m(t);i||f.warn(`Language ${t} not found in CodeMirror.`);let l=(0,j.useMemo)(()=>m(t)?[v(t),...r].filter(Boolean):r,[t,r]);return(0,o.jsxs)("div",{className:"relative w-full group hover-actions-parent",children:[!i&&!n&&(0,o.jsx)(c,{className:"mb-1 rounded-sm",error:`Language ${t} not supported. Supported languages are: ${Object.keys(p).join(", ")}`}),u&&i&&(0,o.jsx)(h,{tooltip:!1,buttonClassName:"absolute top-2 right-2 z-10 hover-action",className:"h-4 w-4 text-muted-foreground",value:s.value||"",toastTitle:"Copied to clipboard"}),(0,o.jsx)(x,{...s,extensions:l})]})};export{e as LANGUAGE_MAP,y as default};
