import { svg } from "lit";
var TickmarkType = /* @__PURE__ */ ((TickmarkType2) => {
  TickmarkType2["main"] = "main";
  TickmarkType2["primary"] = "primary";
  TickmarkType2["secondary"] = "secondary";
  TickmarkType2["tertiary"] = "tertiary";
  return TickmarkType2;
})(TickmarkType || {});
var TickmarkStyle = /* @__PURE__ */ ((TickmarkStyle2) => {
  TickmarkStyle2["regular"] = "regular";
  TickmarkStyle2["enhanced"] = "enhanced";
  return TickmarkStyle2;
})(TickmarkStyle || {});
function tickmarkColor(style) {
  if (style === "regular") {
    return "var(--instrument-tick-mark-secondary-color)";
  } else {
    return "var(--instrument-tick-mark-primary-color)";
  }
}
function tickmark(angle, tickmarkSize, style, text) {
  const textHeight = -32;
  let lineStartY = -35;
  let lineEndY = -34;
  if (tickmarkSize === "secondary") {
    lineStartY = -24;
    lineEndY = lineStartY + 8;
  } else if (tickmarkSize === "main") {
    lineEndY = lineStartY + 20;
  } else if (tickmarkSize === "tertiary") {
    throw new Error("Tertiary tickmarks are not supported");
  }
  const colorName = tickmarkColor(style);
  const tick = svg`<line x1=${angle} y1=${lineStartY} x2=${angle} y2=${lineEndY} stroke=${colorName} stroke-width="1" vector-effect="non-scaling-stroke"/>`;
  if (text) {
    const textY = lineEndY + textHeight;
    return [
      tick,
      svg`<text x=${angle} y=${textY} class="label" text-anchor="middle">${text}</text>`
    ];
  }
  return tick;
}
export {
  TickmarkStyle,
  TickmarkType,
  tickmark,
  tickmarkColor
};
//# sourceMappingURL=tickmark-flat.js.map
