import{css as i,html as t}from"../../../../../lit/index.js";import{store as e}from"../haxcms-site-store.js";import"../../../../hax-iconset/lib/simple-hax-iconset.js";import"../../../../simple-icon/lib/simple-icon-button-lite.js";import"../../../../simple-tooltip/simple-tooltip.js";import{HAXCMSI18NMixin as l}from"./HAXCMSI18NMixin.js";const EmailPageMixin=function(o){return class extends(l(o)){constructor(){super(),this.t.emailPage="Email page",this.t.emailLinkToCurrentPage="Email link to Current page"}static get styles(){let t=[];return super.styles&&(t=super.styles),[t,i`
          .email-btn {
            color: inherit;
            --simple-icon-height: 24px;
            --simple-icon-width: 24px;
          }
        `]}EmailPageButton(i="left"){return t`
        <div
          id="emailbtnwrapper"
          part="${this.editMode?"edit-mode-active":""}"
        >
          <simple-icon-button-lite
            part="email-btn"
            class="email-btn btn"
            icon="hax:email"
            label="${this.t.emailLinkToCurrentPage}"
            @click="${this.EmailPageButtonAction}"
            id="emailbtn"
          ></simple-icon-button-lite>
          <simple-tooltip for="emailbtn" position="${i}">
            ${this.t.emailPage}
          </simple-tooltip>
        </div>
      `}EmailPageButtonAction(i){let t=e.activeTitle.replace(/"/g,"%22");t=t.replace(/&/g,"%26"),globalThis.open(`mailto:?subject=${t}&body=${encodeURIComponent(globalThis.location.href)}`,"mail")}}};export{EmailPageMixin};