var __decorate=this&&this.__decorate||function(t,o,e,n){var r,s=arguments.length,m=s<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)m=Reflect.decorate(t,o,e,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(m=(s<3?r(m):s>3?r(o,e,m):r(o,e))||m);return s>3&&m&&Object.defineProperty(o,e,m),m};import"../../recorder/components/components.js";import*as Host from"../../../core/host/host.js";import*as i18n from"../../../core/i18n/i18n.js";import*as Buttons from"../../../ui/components/buttons/buttons.js";import*as LitHtml from"../../../ui/lit-html/lit-html.js";import toolbarStyles from"./toolbar.css.js";const{html:html,Decorators:Decorators,LitElement:LitElement}=LitHtml,{customElement:customElement}=Decorators,UIStrings={sendCommandCtrlEnter:"Send command - Ctrl+Enter",sendCommandCmdEnter:"Send command - ⌘+Enter",copyCommand:"Copy command"},str_=i18n.i18n.registerUIStrings("panels/protocol_monitor/components/Toolbar.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_),copyIconUrl=new URL("../../../Images/copy.svg",import.meta.url).toString(),sendIconUrl=new URL("../../../Images/send.svg",import.meta.url).toString();export class CopyCommandEvent extends Event{static eventName="copycommand";constructor(){super(CopyCommandEvent.eventName,{bubbles:!0,composed:!0})}}export class SendCommandEvent extends Event{static eventName="commandsent";constructor(){super(SendCommandEvent.eventName,{bubbles:!0,composed:!0})}}export let Toolbar=class extends LitElement{static styles=[toolbarStyles];#t=()=>{this.dispatchEvent(new CopyCommandEvent)};#o=()=>{this.dispatchEvent(new SendCommandEvent)};render(){return html`
        <div class="toolbar">
          <${Buttons.Button.Button.litTagName}
          title=${i18nString(UIStrings.copyCommand)}
          .size=${"SMALL"}
          .iconUrl=${copyIconUrl}
          .variant=${"toolbar"}
          @click=${this.#t}
        ></${Buttons.Button.Button.litTagName}>
        <${Buttons.Button.Button.litTagName}
          .size=${"SMALL"}
          title=${Host.Platform.isMac()?i18nString(UIStrings.sendCommandCmdEnter):i18nString(UIStrings.sendCommandCtrlEnter)}
          .iconUrl=${sendIconUrl}
          .variant=${"primary_toolbar"}
          @click=${this.#o}
        ></${Buttons.Button.Button.litTagName}>
      </div>
    `}};Toolbar=__decorate([customElement("devtools-pm-toolbar")],Toolbar);