class r {
  constructor() {
    this.lineStarts = [], this.addNewLine = (i) => this.lineStarts.push(i), this.linePos = (i) => {
      let t = 0, e = this.lineStarts.length;
      for (; t < e; ) {
        const l = t + e >> 1;
        this.lineStarts[l] < i ? t = l + 1 : e = l;
      }
      if (this.lineStarts[t] === i)
        return { line: t + 1, col: 1 };
      if (t === 0)
        return { line: 0, col: i };
      const n = this.lineStarts[t - 1];
      return { line: t, col: i - n + 1 };
    };
  }
}
export {
  r as LineCounter
};
