import{e}from"./splitTextByLine.mjs";const t=(t,n={})=>{let{lineStart:r,lineLength:i,charStart:a,charLength:o}=n;if(r===void 0&&i===void 0&&a===void 0&&o===void 0)return t;let s=e(t),c=e=>{if(e<=0)return 0;let t=0;for(let n=0;n<Math.min(e,s.length);n++)t+=s[n].length;return t},l=e=>{if(e>=s.length)return t.length;let n=s[e];return c(e)+n.length},u=0,d=t.length;if(r!==void 0&&(u=Math.max(u,c(r))),a!==void 0&&(u=Math.max(u,a)),i!==void 0){let e=(r??0)+i-1;d=Math.min(d,l(e))}return o!==void 0&&(d=Math.min(d,(a??u)+o)),u>=d?``:t.slice(u,d)};export{t};
//# sourceMappingURL=getChunk.mjs.map