/**
 * Copyright 2020 The Pennsylvania State University
 * @license Apache-2.0, see License.md for full text.
 */
class SimpleProgress extends HTMLElement{get html(){return'\n    <style>\n    :host {\n      display: block;\n      width: 100%;\n      height: 4px;\n      position: relative;\n      overflow: hidden;\n    }\n\n    :host([hidden]) {\n      display: none !important;\n    }\n\n    #primaryProgress {\n      background: var(--simple-progress-color, #37A0CE);\n      position:  absolute;\n      top: 0;\n      right: 0;\n      bottom: 0;\n      left: 0;\n      transform: scaleX(0);\n      transform-origin: right center;\n      animation: indeterminate-bar var(--simple-progress-duration, 2s) var(--simple-progress-delay, 0s) linear infinite;\n    }\n\n    #primaryProgress.finished {\n      animation: none;\n    }\n\n    #primaryProgress::after {\n      content: "";\n      transform-origin: center center;\n      animation: indeterminate-splitter var(--simple-progress-duration, 2s) var(--simple-progress-delay, 0s) linear infinite;\n    }\n\n    #primaryProgress.finished::after {\n      animation: none;\n    }\n\n    @keyframes indeterminate-bar {\n      0% {\n        transform: scaleX(1) translateX(-100%);\n      }\n      50% {\n        transform: scaleX(1) translateX(0%);\n      }\n      75% {\n        transform: scaleX(1) translateX(0%);\n        animation-timing-function: cubic-bezier(.28,.62,.37,.91);\n      }\n      100% {\n        transform: scaleX(0) translateX(0%);\n      }\n    }\n\n    @keyframes indeterminate-splitter {\n      0% {\n        transform: scaleX(.75) translateX(-125%);\n      }\n      30% {\n        transform: scaleX(.75) translateX(-125%);\n        animation-timing-function: cubic-bezier(.42,0,.6,.8);\n      }\n      90% {\n        transform: scaleX(.75) translateX(125%);\n      }\n      100% {\n        transform: scaleX(.75) translateX(125%);\n      }\n    }\n  </style>\n\n  <div id="primaryProgress"></div>'}static get tag(){return"simple-progress"}constructor(){super(),this.template=globalThis.document.createElement("template"),this.attachShadow({mode:"open"}),this.render()}static get observedAttributes(){return["disabled"]}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}_iterationCallback(){this.shadowRoot.querySelector("#primaryProgress").classList.add("finished")}connectedCallback(){globalThis.ShadyCSS&&globalThis.ShadyCSS.styleElement(this)}render(){this.shadowRoot.innerHTML=null,this.template.innerHTML=this.html,globalThis.ShadyCSS&&globalThis.ShadyCSS.prepareTemplate(this.template,this.tag),this.shadowRoot.appendChild(this.template.content.cloneNode(!0))}attributeChangedCallback(){const e=this.shadowRoot.querySelector("#primaryProgress");this.disabled?e.addEventListener("animationiteration",this._iterationCallback.bind(this),{once:!0,passive:!0}):e.classList.remove("finished")}}customElements.define(SimpleProgress.tag,SimpleProgress);export{SimpleProgress};