const PATH_SEPARATOR = " \u25b8 ";
const POSITION_SEPARATOR = " \u00b7 ";
export function buildInsertTargetLabel({ placeholder, description, index, }) {
    const segments = getAncestorComponentSegments(placeholder.parentComponent);
    segments.push(description || placeholder.name);
    return `${segments.join(PATH_SEPARATOR)}${POSITION_SEPARATOR}${index + 1}`;
}
function getAncestorComponentSegments(parentComponent) {
    const segments = [];
    let component = parentComponent;
    while (component) {
        const parentPlaceholder = component.parentPlaceholder;
        if (!parentPlaceholder)
            break;
        segments.unshift(component.name);
        component = parentPlaceholder.parentComponent;
    }
    segments.unshift("Page");
    return segments;
}
//# sourceMappingURL=insertTargetLabel.js.map