import{html as t,css as e}from"../../../lit/index.js";import{DDD as i}from"../../d-d-d/d-d-d.js";import"../../simple-icon/lib/simple-icon-button-lite.js";import"../../simple-icon/lib/simple-icon-lite.js";import"../../simple-icon/lib/simple-icons.js";import"../../hax-iconset/lib/simple-hax-iconset.js";globalThis.customElements.define("lecture-anchor",class LectureAnchor extends i{static get properties(){return{icon:{type:String,reflect:!0},value:{type:Number,reflect:!0},target:{type:String,reflect:!0},associatedID:{type:String,reflect:!0}}}constructor(){super(),this.icon="icons:flag",this.value=0,this.jumbotronHeading="",this.jumbotronContent="",this.target="video-player",this.associatedID=""}static get styles(){return[super.styles,e`
        :host {
          cursor: pointer;
        }

        simple-icon-lite {
          padding-bottom: var(--ddd-spacing-1);
          --simple-icon-color: var(--ddd-theme-primary, black);
        }

        mark {
          background-color: var(
            --ddd-theme-accent,
            var(--ddd-theme-default-keystoneYellow)
          );
          color: var(--ddd-theme-primary, black);
          padding: var(--ddd-spacing-1);
        }
      `]}clickHandler(t){if(console.log(t.type),this._haxState&&"click"===t.type)return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!1;let e;e=this._haxState?globalThis.document.querySelector(".haxcms-theme-element "+this.target):globalThis.document.querySelector(this.target),e?(e.scrollIntoView(),setTimeout((()=>{switch(e.tagName.toLowerCase()){case"lecture-player":case"video-player":case"audio-player":this.value?e.seek(parseInt(this.value)):e.play();break;case"play-list":e.slide=parseInt(this.value)}}),100)):this.target=null}render(){return t`
      <mark @click="${this.clickHandler}">
        <simple-icon-lite icon="${this.icon}" dir="ltr"></simple-icon-lite>
        <slot></slot>
      </mark>
    `}static get tag(){return"video-player-flag"}static get value(){return this.value}static get jumbotronHeading(){return this.jumbotronHeading}static get jumbotronContent(){return this.jumbotronContent}});