// (C) 2021-2025 GoodData Corporation
import { areObjRefsEqual, isDrillFromAttribute, } from "@gooddata/sdk-model";
import { getLocalIdentifierOrDie, getValidDrillOriginAttributes, } from "../../../_staging/drills/drillingUtils.js";
export function isDisplayFormRelevantToDrill(drillDefinition, availableDrillTargets, displayForm) {
    const attributeRef = isDrillFromAttribute(drillDefinition.origin)
        ? drillDefinition.origin?.attribute
        : drillDefinition.origin?.measure;
    const localId = getLocalIdentifierOrDie(attributeRef);
    const relevantAttributes = getValidDrillOriginAttributes(availableDrillTargets, localId);
    return relevantAttributes.some((attribute) => areObjRefsEqual(displayForm.attribute, attribute.attributeHeader.formOf));
}
//# sourceMappingURL=isDisplayFormRelevantToDrill.js.map