import { I as INLINE_MARKDOWN_REGEX } from './FieldLabel-Cm5A1Jcx.js';

const stripInlineMarkdown = (str) => {
  const parts = [];
  let lastIndex = 0;
  INLINE_MARKDOWN_REGEX.lastIndex = 0;
  let match;
  while ((match = INLINE_MARKDOWN_REGEX.exec(str)) !== null) {
    if (match.index > lastIndex) {
      parts.push(str.substring(lastIndex, match.index));
    }
    const savedIndex = INLINE_MARKDOWN_REGEX.lastIndex;
    const inner = match[1] ?? match[2] ?? match[3] ?? match[4] ?? match[5] ?? "";
    parts.push(match[5] ? inner : stripInlineMarkdown(inner));
    INLINE_MARKDOWN_REGEX.lastIndex = savedIndex;
    lastIndex = savedIndex;
  }
  if (lastIndex < str.length) {
    parts.push(str.substring(lastIndex));
  }
  return parts.join("");
};

export { stripInlineMarkdown as s };
//# sourceMappingURL=stripInlineMarkdown-BZzgG-Zm.js.map
