class d {
  constructor() {
    this.segmentSeparator = "/", this.indexSeparator = "@";
  }
  getAstNodePath(t) {
    if (t.$container) {
      const e = this.getAstNodePath(t.$container), i = this.getPathSegment(t);
      return e + this.segmentSeparator + i;
    }
    return "";
  }
  getPathSegment({ $containerProperty: t, $containerIndex: e }) {
    if (!t)
      throw new Error("Missing '$containerProperty' in AST node.");
    return e !== void 0 ? t + this.indexSeparator + e : t;
  }
  getAstNode(t, e) {
    return e.split(this.segmentSeparator).reduce((n, r) => {
      if (!n || r.length === 0)
        return n;
      const s = r.indexOf(this.indexSeparator);
      if (s > 0) {
        const a = r.substring(0, s), g = parseInt(r.substring(s + 1)), o = n[a];
        return o == null ? void 0 : o[g];
      }
      return n[r];
    }, t);
  }
}
export {
  d as DefaultAstNodeLocator
};
