import { css, LitElement, html } from "lit";
import { property } from "lit/decorators.js";
import { LineMedium, LineType, lineColor, lineWidth } from "../index.js";
import { customElement } from "../../decorator.js";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
let ObcHorizontalLine = class extends LitElement {
  constructor() {
    super(...arguments);
    this.medium = LineMedium.normal;
    this.lineType = LineType.fluid;
    this.length = 1;
  }
  render() {
    if (this.lineType === LineType.connector) {
      const length2 = this.length * 24;
      return html`<svg
        width="${length2}"
        height="24"
        viewBox="0 0 ${length2} 24"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
      >
        <line
          x1="0"
          y1="12"
          x2="${length2}"
          y2="12"
          stroke-width="1"
          stroke="var(--element-neutral-color)"
          stroke-dasharray="4,2"
          stroke-dashoffset="2"
        />
      </svg> `;
    }
    const color = lineColor(this.medium);
    const length = this.length * 24 + 1;
    const width = lineWidth(this.lineType);
    return html`
      <div class="wrapper" style="height: 24px; width: ${this.length * 24}px;">
        <svg
          class="line"
          xmlns="http://www.w3.org/2000/svg"
          viewBox="-.5 0 ${length} 24"
          height="24"
          width=${length}
        >
          <line
            x1="-0.5"
            y1="12"
            x2="${length - 0.5}"
            y2="12"
            stroke-width=${width}
            stroke="var(${color.inner})"
          />
          <line
            x1="-0.5"
            y1="${12 - 0.5 - width / 2}"
            x2="${length - 0.5}"
            y2="${12 - 0.5 - width / 2}"
            stroke-width="1"
            stroke="var(${color.outer})"
          />
          <line
            x1="-0.5"
            y1="${12 + 0.5 + width / 2}"
            x2="${length - 0.5}"
            y2="${12 + 0.5 + width / 2}"
            stroke-width="1"
            stroke="var(${color.outer})"
          />
        </svg>
      </div>
    `;
  }
};
ObcHorizontalLine.styles = css`
    :host {
      display: block;
      line-height: 0;
    }
    svg {
      position: relative;
      left: -0.5px;
      top: -12px;
    }
  `;
__decorateClass([
  property({ type: String })
], ObcHorizontalLine.prototype, "medium", 2);
__decorateClass([
  property({ type: String })
], ObcHorizontalLine.prototype, "lineType", 2);
__decorateClass([
  property({ type: Number })
], ObcHorizontalLine.prototype, "length", 2);
ObcHorizontalLine = __decorateClass([
  customElement("obc-horizontal-line")
], ObcHorizontalLine);
export {
  ObcHorizontalLine
};
//# sourceMappingURL=horizontal-line.js.map
