"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const ModelUtil = require("../../util/ModelUtil.js");
function getLabelAttr(semantic) {
  if (ModelUtil.is(semantic, "bpmn:FlowElement") || ModelUtil.is(semantic, "bpmn:Participant") || ModelUtil.is(semantic, "bpmn:Lane") || ModelUtil.is(semantic, "bpmn:SequenceFlow") || ModelUtil.is(semantic, "bpmn:MessageFlow") || ModelUtil.is(semantic, "bpmn:DataInput") || ModelUtil.is(semantic, "bpmn:DataOutput")) {
    return "name";
  }
  if (ModelUtil.is(semantic, "bpmn:TextAnnotation")) {
    return "text";
  }
  if (ModelUtil.is(semantic, "bpmn:Group")) {
    return "categoryValueRef";
  }
}
function getCategoryValue(semantic) {
  var categoryValueRef = semantic["categoryValueRef"];
  if (!categoryValueRef) {
    return "";
  }
  return categoryValueRef.value || "";
}
function getLabel(element) {
  var semantic = element.businessObject, attr = getLabelAttr(semantic);
  if (attr) {
    if (attr === "categoryValueRef") {
      return getCategoryValue(semantic);
    }
    return semantic[attr] || "";
  }
}
exports.getLabel = getLabel;
