import{O as e}from"./i18n-CsN8OUP9.js";var t=/^[a-z0-9][a-z0-9+#-]*$/i,n=new Set([``,`text`,`plain`,`plaintext`,`md`,`markdown`]),r=new Set(`bash.c.cpp.css.diff.go.html.java.javascript.js.json.jsx.markdown.md.php.python.py.ruby.rust.rs.sh.sql.swift.tsx.ts.typescript.xml.yaml.yml`.split(`.`));function i(e){let n=e.trim().split(/\s/,1)[0]||``;return t.test(n)&&n.length<=16?n.toLowerCase():``}var a={bash:`terminal`,cmd:`terminal`,console:`terminal`,fish:`terminal`,powershell:`terminal`,ps1:`terminal`,sh:`terminal`,shell:`terminal`,zsh:`terminal`,md:`markdown`,markdown:`markdown`,json:`json`,json5:`json`,ini:`settings-gear`,toml:`settings-gear`,yaml:`settings-gear`,yml:`settings-gear`,dotenv:`settings-gear`,env:`settings-gear`,graphql:`database`,gql:`database`,mysql:`database`,postgres:`database`,postgresql:`database`,sql:`database`,sqlite:`database`,diff:`diff`,patch:`diff`,css:`symbol-color`,less:`symbol-color`,sass:`symbol-color`,scss:`symbol-color`,svg:`symbol-color`,regex:`regex`,regexp:`regex`,curl:`globe`,http:`globe`,docker:`package`,dockerfile:`package`,mermaid:`graph`};function o(e){return a[i(e||``)]||`code`}var s={bash:`bash`,cfg:`ini`,conf:`ini`,css:`css`,dockerfile:`dockerfile`,env:`env`,gql:`graphql`,graphql:`graphql`,ini:`ini`,json:`json`,json5:`json`,less:`less`,markdown:`markdown`,md:`markdown`,mdx:`markdown`,mmd:`mermaid`,ps1:`powershell`,psql:`sql`,sass:`sass`,scss:`scss`,sh:`bash`,sql:`sql`,svg:`svg`,toml:`toml`,yaml:`yaml`,yml:`yml`,zsh:`zsh`};function c(e){let t=l(e);return o(s[t]||t)}function l(t){let n=e((t||``).replace(/\\/g,`/`).split(`/`).pop()),r=n.lastIndexOf(`.`);return r>0?n.slice(r+1):n}var u={astro:`astro`,bash:`bash`,c:`c`,cc:`cpp`,cjs:`javascript`,clj:`clojure`,cpp:`cpp`,cs:`csharp`,css:`css`,cxx:`cpp`,dart:`dart`,dockerfile:`docker`,ex:`elixir`,exs:`elixir`,fish:`fish`,go:`go`,gql:`graphql`,graphql:`graphql`,h:`c`,hpp:`cpp`,hs:`haskell`,htm:`html`,html:`html`,ini:`ini`,java:`java`,jl:`julia`,js:`javascript`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsx:`jsx`,kt:`kotlin`,kts:`kotlin`,less:`less`,lua:`lua`,makefile:`make`,markdown:`markdown`,md:`markdown`,mdx:`mdx`,mjs:`javascript`,ml:`ocaml`,mts:`typescript`,nix:`nix`,php:`php`,pl:`perl`,proto:`proto`,ps1:`powershell`,py:`python`,pyi:`python`,r:`r`,rb:`ruby`,rs:`rust`,sass:`sass`,scala:`scala`,scss:`scss`,sh:`bash`,sql:`sql`,svelte:`svelte`,swift:`swift`,tf:`terraform`,toml:`toml`,ts:`typescript`,tsx:`tsx`,vue:`vue`,xml:`xml`,yaml:`yaml`,yml:`yaml`,zig:`zig`,zsh:`bash`};function d(e){return u[l(e)]||``}function f(e){return e.split(`
`).filter(e=>{let t=e.trim();return!!t&&/^[A-Za-z0-9"'`*-]/.test(t)}).length}var p=[/(^|\s)(const|let|var|function|class|import|export|return|if|for|while|switch)\b/gim,/=>|==|===|!=|!==|\{|\}|;|<\/?[a-z][^>]*>/gi,/^\s*(#include|SELECT|INSERT|UPDATE|DELETE|CREATE|DROP)\b/gim];function m(e){return p.reduce((t,n)=>t+(e.match(n)?.length??0),0)}function h(e){let t=e.trim(),n=(t.match(/\*\*[^*]+\*\*/g)||[]).length+(t.match(/`[^`\n]+`/g)||[]).length;return{bulletLines:(t.match(/^\s*[-*]\s+\S+/gm)||[]).length,codeSignals:m(t),hasMarkdown:n>0,proseLines:f(t),trimmed:t,urlLines:(t.match(/^\s*https?:\/\/\S+\s*$/gim)||[]).length}}var g=/[.!?](?:\s|$)/,_=/^[A-Za-z0-9_][\w.-]*\s*[:=]\s*\S/,v=/^[A-Za-z0-9_][\w.-]*$/;function y(e){let t=e.trim();if(_.test(t))return!0;let n=t.split(/\s+/);return n.length>=2&&n.length<=3&&v.test(n[0])}function b(e){let t=e.split(`
`).filter(e=>e.trim());return t.length<2?!1:t.some(e=>/^\s+\S/.test(e))?!0:!t.some(e=>g.test(e.trim()))&&t.filter(e=>y(e)).length>=Math.max(2,Math.ceil(t.length*.6))}function x(e,t){let r=e.trim(),a=r.toLowerCase(),o=i(e),s=r.split(/\s+/,1)[0]||``,c=!!r&&r!==s;if(/^[-*+]\s/.test(a)||/^https?:\/\//.test(a))return!0;let l=h(t);return l.trimmed?c&&l.codeSignals<=2&&(l.proseLines>=2||l.bulletLines>=1||l.urlLines>=1)?!0:!n.has(o)||b(t)?!1:l.bulletLines>=2&&l.hasMarkdown&&l.codeSignals<=2||l.proseLines>=3&&l.codeSignals===0:!1}function S(e,t){let a=i(e||``),o=h(t||``);return!o.trimmed||o.codeSignals>=3?!1:o.bulletLines>=1&&(o.hasMarkdown||o.proseLines>=2)?!0:b(t||``)?!1:n.has(a)?o.proseLines>=3&&o.codeSignals===0:!r.has(a)&&o.proseLines>=2&&o.codeSignals<=1}export{i as a,x as i,o as n,d as o,S as r,c as t};