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{m as f}from"./useEventListener-CjXriKgk.js";import{t as g}from"./jsx-runtime-CP2fAiZX.js";import"./dist-DUY6xZX8.js";import"./dist-DfBASypd.js";import"./dist-Dq_iQ08e.js";import"./dist-BjtLy-VA.js";import"./dist-odxAaH5Z.js";import"./dist-51xFOPFs.js";import"./Combination-tjZP3FH6.js";import{t as h}from"./copy-icon-6RnnFDPt.js";import{n as c}from"./error-banner-R2OkQKR0.js";import{t as x}from"./esm-BQUzYly2.js";import"./dist-Bq1BhBMA.js";import"./dist-Bbmd3uCi.js";import"./dist-y6DTGoUH.js";import"./dist-C-_581uo.js";import"./dist-DVh79TGS.js";import"./dist-DFv45CtW.js";import"./dist-i0ilBbwP.js";import"./dist-6QbI72oM.js";import"./dist-C30-xTdI.js";import{n as v,t as p}from"./esm-BTyesPLl.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};
