text: define(["exports","require","../../../lit-element/lit-element.js","../../simple-colors/simple-colors.js","../../simple-modal/simple-modal.js"],(function(e,t,s,o,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LrnsysDialog=void 0,t=babelHelpers.interopRequireWildcard(t);class LrnsysDialog extends o.SimpleColors{static get styles(){return[...super.styles,s.css`
          :host {
            display: inline-block;
            --lrnsys-dialog-color: var(--simple-colors-foreground1, #000);
            --lrnsys-dialog-background-color: var(--simple-colors-background1);
            --lrnsys-dialog-toolbar-background-color: var(
              --simple-colors-background3
            );
            --lrnsys-dialog-secondary-background-color: rgba(255, 255, 255, 0.7);
          }
          :host([dark]) {
            --lrnsys-dialog-toolbar-background-color: var(
              --simple-colors-background1
            );
            --lrnsys-dialog-background-color: var(--simple-colors-background3);
            --lrnsys-dialog-secondary-background-color: rgba(0, 0, 0, 0.7);
          }
          #dialogtrigger {
            display: inline-block;
            min-width: unset;
            margin: var(--lrnsys-dialog-button-margin);
            padding: var(--lrnsys-dialog-button-padding);
          }
        `]}constructor(){super(),this.disabled=!1,this.dynamicImages=!1,this.focusState=!1,this.avatar="",this.icon="",this.text="",this.headingClass="white-text black",setTimeout(()=>{new Promise((e,s)=>t.default(["../../simple-tooltip/simple-tooltip.js"],e,s)),new Promise((e,s)=>t.default(["../../../@polymer/paper-button/paper-button.js"],e,s)),new Promise((e,s)=>t.default(["../../../@polymer/neon-animation/neon-animation.js"],e,s)),new Promise((e,s)=>t.default(["../../../@polymer/neon-animation/neon-animations.js"],e,s)),new Promise((e,s)=>t.default(["../../../@polymer/iron-icons/iron-icons.js"],e,s)),new Promise((e,s)=>t.default(["./lrnsys-button-inner.js"],e,s))},0),this.__modal=window.SimpleModal.requestAvailability()}render(){return s.html`
        <paper-button
          class="${this.class}"
          id="dialogtrigger"
          @click="${this.openDialog}"
          @focus-changed="${this.focusToggle}"
          @mousedown="${this.tapEventOn}"
          @mouseover="${this.tapEventOn}"
          @mouseout="${this.tapEventOff}"
          ?raised="${this.raised}"
          ?disabled="${this.disabled}"
          title="${this.alt}"
          aria-label="${this.alt}"
        >
          <lrnsys-button-inner
            avatar="${this.avatar}"
            icon="${this.icon}"
            text="${this.text}"
          >
            <slot name="button"></slot>
          </lrnsys-button-inner>
        </paper-button>
        <simple-tooltip
          for="dialogtrigger"
          animation-delay="0"
          ?hidden="${!this.alt}"
          >${this.alt}</simple-tooltip
        >
      `}static get tag(){return"lrnsys-dialog"}static get properties(){return{...super.properties,icon:{type:String},raised:{type:Boolean},avatar:{type:String},text:{type:String},alt:{type:String,reflect:!0},header:{type:String},disabled:{type:Boolean},hoverClass:{type:String,attribute:"hover-class"},headingClass:{type:String,attribute:"heading-class"},dynamicImages:{type:Boolean,attribute:"dynamic-images"},focusState:{type:Boolean,attribute:"focus-state"}}}tapEventOn(e){void 0!==this.hoverClass&&this.hoverClass.split(" ").forEach((e,t)=>{""!=e&&this.shadowRoot.querySelector("#dialogtrigger").classList.add(e)})}tapEventOff(e){void 0!==this.hoverClass&&this.hoverClass.split(" ").forEach((e,t)=>{""!=e&&this.shadowRoot.querySelector("#dialogtrigger").classList.remove(e)})}toggleDialog(){this.openDialog()}openDialog(){let e=this.children,t=document.createElement("span"),s=document.createElement("span"),o={};for(var a in e)if(void 0!==e[a].tagName)switch(e[a].getAttribute("slot")){case"toolbar-primary":case"toolbar-secondary":case"toolbar":case"header":o=e[a].cloneNode(!0),o.removeAttribute("slot"),t.appendChild(o);break;case"button":break;default:o=e[a].cloneNode(!0),o.removeAttribute("slot"),this.dynamicImages&&"IRON-IMAGE"===o.tagName&&(o.preventLoad=!1,o.removeAttribute("prevent-load")),s.appendChild(o)}const i=new CustomEvent("simple-modal-show",{bubbles:!0,composed:!0,cancelable:!0,detail:{title:this.header,elements:{header:t,content:s},invokedBy:this.shadowRoot.querySelector("#dialogtrigger"),clone:!0}});this.dispatchEvent(i)}focusToggle(e){(this.dispatchEvent(new CustomEvent("focus-changed",{bubbles:!0,cancelable:!0,composed:!0,detail:{focus:this.focusState}})),void 0!==this.hoverClass)&&this.hoverClass.split(" ").forEach((e,t)=>{""!=e&&(this.focusState?this.shadowRoot.querySelector("#dialogtrigger").classList.add(e):this.shadowRoot.querySelector("#dialogtrigger").classList.remove(e))});this.focusState=!this.focusState}}e.LrnsysDialog=LrnsysDialog,window.customElements.define(LrnsysDialog.tag,LrnsysDialog)}));