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 { WithDisposable } from '@blockeditor/lit';
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { requestConnectedFrame } from '../../../../_common/utils/event.js';
let NoteSlicerIndicator = class NoteSlicerIndicator extends WithDisposable(LitElement) {
    show() {
        requestConnectedFrame(() => {
            this.style.visibility = 'visible';
            requestConnectedFrame(() => {
                this.style.transform = `translate(${this.offset * this.zoom - 20}px, 0)`;
                this.style.width = `${this.width * this.zoom}px`;
            }, this);
        }, this);
    }
    reset() {
        this.style.removeProperty('visibility');
        this.style.removeProperty('transform');
        this.style.removeProperty('width');
    }
    render() {
        return html ` <div class="indicator-line"></div> `;
    }
};
NoteSlicerIndicator.styles = css `
    :host {
      visibility: hidden;
      z-index: 1;
      width: 0px;
      transition: width 0.1s ease-in-out;
      transform-origin: left center;
    }

    .indicator-line {
      height: 2px;
      box-shadow: 0px 4px 11px #3ab4f7;
      border-radius: 1px;
      background-color: var(--affine-blue-500);
    }
  `;
__decorate([
    property({ attribute: false })
], NoteSlicerIndicator.prototype, "width", void 0);
__decorate([
    property({ attribute: false })
], NoteSlicerIndicator.prototype, "offset", void 0);
__decorate([
    property({ attribute: false })
], NoteSlicerIndicator.prototype, "zoom", void 0);
NoteSlicerIndicator = __decorate([
    customElement('note-slicer-indicator')
], NoteSlicerIndicator);
export { NoteSlicerIndicator };
//# sourceMappingURL=slicer-indicator.js.map