import{isPrimitive as n}from"../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as p}from"./get-variable.js";import{isNode as l}from"./guards/is-node.js";import{isTag as a}from"./guards/is-tag.js";import{isCodeNode as u}from"./guards/is-code-node.js";import{isConditionalNode as c}from"./guards/is-conditional-node.js";import{isExampleNode as d}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as N}from"./guards/is-text-node.js";import{isFunction as b}from"./guards/is-function.js";import{isVariable as g}from"./guards/is-variable.js";function t(m,r={}){const{isTrim:s=!0}=r,e=[];for(const i of m){if(n(i))e.push(String(i));else if(l(i))if(i.type==="tr"&&e.push(`
`),N(i)||u(i)||h(i))e.push(t([o(i,"content")],r));else if(d(i))e.push(t(i.children.map(f=>o(f,"content")),r));else{if(c(i)&&r.skipConditionals)continue;e.push(t(i.children,r))}else a(i)?e.push(t(i.children,r)):b(i)&&e.push(t(Object.values(i.parameters),r));g(i)&&e.push(t([p(i,r.variables)],r))}return s?e.map(i=>i.trim()).join(" ").trim():e.join(" ")}export{t as getInnerText};
