var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { TextAlignCenterIcon, TextAlignLeftIcon, TextAlignRightIcon, } from '../../../../_common/icons/index.js';
import { TextAlign } from '../../../../surface-block/elements/consts.js';
const { Left, Center, Right } = TextAlign;
let EdgelessAlignPanel = class EdgelessAlignPanel extends LitElement {
    constructor() {
        super(...arguments);
        this.value = Left;
    }
    _onSelect(value) {
        this.value = value;
        if (this.onSelect) {
            this.onSelect(value);
        }
    }
    render() {
        return html `
      <div class="align-panel-container">
        <edgeless-tool-icon-button
          .tooltip=${'Left'}
          .active=${this.value === 'left'}
          .activeMode=${'background'}
          .iconContainerPadding=${2}
          @click=${() => {
            this._onSelect(Left);
        }}
        >
          ${TextAlignLeftIcon}
        </edgeless-tool-icon-button>
        <edgeless-tool-icon-button
          .tooltip=${'Center'}
          .active=${this.value === 'center'}
          .activeMode=${'background'}
          .iconContainerPadding=${2}
          @click=${() => {
            this._onSelect(Center);
        }}
        >
          ${TextAlignCenterIcon}
        </edgeless-tool-icon-button>
        <edgeless-tool-icon-button
          .tooltip=${'Right'}
          .active=${this.value === 'right'}
          .activeMode=${'background'}
          .iconContainerPadding=${2}
          @click=${() => {
            this._onSelect(Right);
        }}
        >
          ${TextAlignRightIcon}
        </edgeless-tool-icon-button>
      </div>
    `;
    }
};
EdgelessAlignPanel.styles = css `
    :host {
      display: block;
      z-index: 2;
    }
    .align-panel-container {
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--affine-background-overlay-panel-color);
      border-radius: 8px;
      padding: 8px;
      gap: 8px;
    }
    .align-panel-container svg {
      fill: var(--affine-icon-color);
      stroke: none;
    }
  `;
__decorate([
    property({ attribute: false })
], EdgelessAlignPanel.prototype, "value", void 0);
__decorate([
    property({ attribute: false })
], EdgelessAlignPanel.prototype, "onSelect", void 0);
EdgelessAlignPanel = __decorate([
    customElement('edgeless-align-panel')
], EdgelessAlignPanel);
export { EdgelessAlignPanel };
//# sourceMappingURL=align-panel.js.map