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;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _PlayPenFooter_instances, _PlayPenFooter_isDark;
import { LitElement, css, html, nothing } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { Bubble } from '../bubble.js';
import './play-button.js';
import './play-console.js';
let PlayPenFooter = class PlayPenFooter extends LitElement {
    constructor() {
        super(...arguments);
        _PlayPenFooter_instances.add(this);
    }
    render() {
        const errs = this.diagnostics?.previewErrs.length
            ? html `<span class="badge">${this.diagnostics?.previewErrs.length}</span>`
            : nothing;
        return html `<footer>
      <div class="buttons">
        <play-button
          appearance="inverted"
          size="medium"
          endIcon="${this._open ? 'caret-down-outline' : 'caret-up-outline'}"
          title="Toggle Console"
          @click=${() => (this._open = !this._open)}
          >Console${errs}</play-button
        >
        <div class="actions">
          <play-button
            appearance="inverted"
            size="medium"
            endIcon="caret-down-outline"
            title="Toggle Device"
            @click=${() => this.dispatchEvent(Bubble('preview-desktop', this.desktop ? false : true))}
            >${this.desktop ? 'Desktop' : 'Mobile'}</play-button
          >
          <play-button
            appearance="inverted"
            size="medium"
            icon=${__classPrivateFieldGet(this, _PlayPenFooter_instances, "m", _PlayPenFooter_isDark).call(this) ? 'night-outline' : 'day-outline'}
            title="Toggle Scheme"
            @click=${() => this.dispatchEvent(Bubble('preview-scheme', __classPrivateFieldGet(this, _PlayPenFooter_instances, "m", _PlayPenFooter_isDark).call(this) ? 'light' : 'dark'))}
            >Theme</play-button
          >
          <play-button
            appearance="inverted"
            size="medium"
            icon="overflow-horizontal-outline"
            title="Additional Options"
            @click=${() => console.log('Show overflow menu')}
          ></play-button>
        </div>
      </div>
      ${this._open
            ? html `<play-console .diagnostics=${this.diagnostics}></play-console>`
            : nothing}
    </footer>`;
    }
};
_PlayPenFooter_instances = new WeakSet();
_PlayPenFooter_isDark = function _PlayPenFooter_isDark() {
    return (globalThis.matchMedia('(prefers-color-scheme: dark)').matches ||
        this.scheme === 'dark');
};
PlayPenFooter.styles = css `
    footer {
      background-color: var(--rpl-neutral-content-weak);
    }
    .buttons {
      display: flex;
      flex-direction: row;
      column-gap: 16px;
      row-gap: 16px;
      justify-content: space-between;
      padding-top: 0;
      padding-right: 24px;
      padding-bottom: 0;
      padding-left: 24px;
    }
    .actions {
      display: flex;
      flex-direction: row;
      column-gap: 16px;
      row-gap: 16px;
    }

    .badge {
      color: var(--rpl-neutral-background);
      border-radius: 9001px;
      background-color: var(--rpl-orangered-500);
      padding-top: 2px;
      padding-right: 8px;
      padding-bottom: 2px;
      padding-left: 8px;
      font-size: 12px;
      font-style: normal;
      font-weight: 600;
      line-height: 16px;
    }
  `;
__decorate([
    property({ type: Boolean })
], PlayPenFooter.prototype, "desktop", void 0);
__decorate([
    property({ attribute: false })
], PlayPenFooter.prototype, "diagnostics", void 0);
__decorate([
    property()
], PlayPenFooter.prototype, "scheme", void 0);
__decorate([
    state()
], PlayPenFooter.prototype, "_open", void 0);
PlayPenFooter = __decorate([
    customElement('play-pen-footer')
], PlayPenFooter);
export { PlayPenFooter };
//# sourceMappingURL=play-pen-footer.js.map