"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./tslib.es6-CHeFCc6E.js"),T=require("./ripple-handlers-C7an-EE1.js"),v=require("./utils-wMBJ9n_n.js"),r=require("./mwc-slider.css-DytByuJk.js"),d=require("./query-assigned-elements-8EurZY45.js"),S=require("./property-DYTC_2-m.js"),l=require("./state-C3HoXfoa.js"),h=require("./query-Dv2F3m_t.js"),b=require("./class-map-DTzB8z-1.js"),n=require("./if-defined-CZCqOAYs.js"),p=require("./style-map-DOMuf9Fg.js");/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class s extends r.SliderBase{constructor(){super(...arguments),this.valueStart=0,this.startThumbWithIndicator=!1,this.startThumbTop=!1,this.shouldRenderStartRipple=!1,this.startThumbTransformStyle="",this.startThumbTransitionStyle="",this.startThumbCssProperties={},this.startRippleHandlers=new T.RippleHandlers(()=>(this.shouldRenderStartRipple=!0,this.startRipple))}update(t){if(t.has("valueStart")&&this.mdcFoundation){this.mdcFoundation.setValueStart(this.valueStart);const e=this.mdcFoundation.getValueStart();e!==this.valueStart&&(this.valueStart=e)}super.update(t)}renderRootEl(t){const e=b.o({"mdc-slider--disabled":this.disabled,"mdc-slider--discrete":this.discrete});return d.x`
    <div
        class="mdc-slider mdc-slider--range ${e}"
        @pointerdown=${this.onPointerdown}
        @pointerup=${this.onPointerup}
        @contextmenu=${this.onContextmenu}>
      ${t}
    </div>`}renderStartInput(){var t;return d.x`
      <input
          class="mdc-slider__input start"
          type="range"
          step=${this.step}
          min=${this.min}
          max=${this.valueEnd}
          .value=${this.valueStart}
          @change=${this.onStartChange}
          @focus=${this.onStartFocus}
          @blur=${this.onStartBlur}
          ?disabled=${this.disabled}
          aria-label=${n.l(this.ariaLabel)}
          aria-labelledby=${n.l(this.ariaLabelledBy)}
          aria-describedby=${n.l(this.ariaDescribedBy)}
          aria-valuetext=${n.l((t=this.valueToAriaTextTransform)===null||t===void 0?void 0:t.call(this,this.valueStart))}>
    `}renderEndInput(){var t;return d.x`
      <input
          class="mdc-slider__input end"
          type="range"
          step=${this.step}
          min=${this.valueStart}
          max=${this.max}
          .value=${this.valueEnd}
          @change=${this.onEndChange.bind(this)}
          @focus=${this.onEndFocus}
          @blur=${this.onEndBlur}
          ?disabled=${this.disabled}
          name=${this.name}
          aria-label=${n.l(this.ariaLabel)}
          aria-labelledby=${n.l(this.ariaLabelledBy)}
          aria-describedby=${n.l(this.ariaDescribedBy)}
          aria-valuetext=${n.l((t=this.valueToAriaTextTransform)===null||t===void 0?void 0:t.call(this,this.valueEnd))}>
    `}renderTrack(){const t=p.o({"transform-origin":this.trackTransformOriginStyle,left:this.trackLeftStyle?this.trackLeftStyle:getComputedStyle(this).direction==="rtl"?"":`calc(${(this.valueStart-this.min)/(this.max-this.min)*100}%)`,right:this.trackRightStyle?this.trackRightStyle:getComputedStyle(this).direction!=="rtl"?"":`calc(${(this.valueStart-this.min)/(this.max-this.min)*100}%)`,"-webkit-transform":`scaleX(${(this.valueEnd-this.valueStart)/(this.max-this.min)})`,transform:`scaleX(${(this.valueEnd-this.valueStart)/(this.max-this.min)})`,"-webkit-transition":this.trackTransitionStyle,transition:this.trackTransitionStyle});return d.x`
      <div class="mdc-slider__track">
        <div class="mdc-slider__track--inactive"></div>
        <div class="mdc-slider__track--active">
          <div
              class="mdc-slider__track--active_fill"
              style=${t}>
          </div>
        </div>
      </div>`}renderStartThumb(){const t=b.o({"mdc-slider__thumb--with-indicator":this.startThumbWithIndicator,"mdc-slider__thumb--top":this.startThumbTop}),e=p.o(Object.assign({"-webkit-transform":this.startThumbTransformStyle,transform:this.startThumbTransformStyle,"-webkit-transition":this.startThumbTransitionStyle,transition:this.startThumbTransitionStyle,left:this.startThumbTransformStyle||getComputedStyle(this).direction==="rtl"?"":`calc(${(this.valueStart-this.min)/(this.max-this.min)*100}% - 24px)`,right:this.startThumbTransformStyle||getComputedStyle(this).direction!=="rtl"?"":`calc(${(this.valueStart-this.min)/(this.max-this.min)*100}% - 24px)`},this.startThumbCssProperties)),i=this.shouldRenderStartRipple?d.x`<mwc-ripple class="ripple" unbounded></mwc-ripple>`:d.A;return d.x`
      <div
          class="mdc-slider__thumb start ${t}"
          style=${e}
          @mouseenter=${this.onStartMouseenter}
          @mouseleave=${this.onStartMouseleave}>
        ${i}
        ${this.renderValueIndicator(this.valueToValueIndicatorTransform(this.valueStart))}
        <div class="mdc-slider__thumb-knob"></div>
      </div>
    `}createAdapter(){return{addClass:t=>{switch(t){case"mdc-slider--disabled":this.disabled=!0;break}},removeClass:t=>{switch(t){case"mdc-slider--disabled":this.disabled=!1;break}},hasClass:t=>{switch(t){case"mdc-slider--disabled":return this.disabled;case"mdc-slider--range":return!0;case"mdc-slider--discrete":return this.discrete;default:return!1}},addThumbClass:(t,e)=>{if(e===r.Thumb.START)switch(t){case"mdc-slider__thumb--with-indicator":this.startThumbWithIndicator=!0;break;case"mdc-slider__thumb--top":this.startThumbTop=!0;break}else switch(t){case"mdc-slider__thumb--with-indicator":this.endThumbWithIndicator=!0;break;case"mdc-slider__thumb--top":this.endThumbTop=!0;break}},removeThumbClass:(t,e)=>{if(e===r.Thumb.START)switch(t){case"mdc-slider__thumb--with-indicator":this.startThumbWithIndicator=!1;break;case"mdc-slider__thumb--top":this.startThumbTop=!1;break}else switch(t){case"mdc-slider__thumb--with-indicator":this.endThumbWithIndicator=!1;break;case"mdc-slider__thumb--top":this.endThumbTop=!1;break}},registerEventHandler:()=>{},deregisterEventHandler:()=>{},registerBodyEventHandler:(t,e)=>{document.body.addEventListener(t,e)},deregisterBodyEventHandler:(t,e)=>{document.body.removeEventListener(t,e)},registerInputEventHandler:(t,e,i)=>{t===r.Thumb.START?this.startInput.addEventListener(e,i):this.formElement.addEventListener(e,i)},deregisterInputEventHandler:(t,e,i)=>{t===r.Thumb.START?this.startInput.removeEventListener(e,i):this.formElement.removeEventListener(e,i)},registerThumbEventHandler:()=>{},deregisterThumbEventHandler:()=>{},registerWindowEventHandler:(t,e)=>{window.addEventListener(t,e)},deregisterWindowEventHandler:(t,e)=>{window.removeEventListener(t,e)},emitChangeEvent:(t,e)=>{const i=new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:t,thumb:e}});this.dispatchEvent(i)},emitDragEndEvent:(t,e)=>{e===r.Thumb.START?this.startRippleHandlers.endPress():this.endRippleHandlers.endPress()},emitDragStartEvent:(t,e)=>{e===r.Thumb.START?this.startRippleHandlers.startPress():this.endRippleHandlers.startPress()},emitInputEvent:(t,e)=>{const i=new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t,thumb:e}});this.dispatchEvent(i)},focusInput:t=>{t===r.Thumb.START?this.startInput.focus():this.formElement.focus()},getAttribute:()=>"",getBoundingClientRect:()=>this.mdcRoot.getBoundingClientRect(),getInputAttribute:(t,e)=>{if(e===r.Thumb.START)switch(t){case"min":return this.min.toString();case"max":return this.valueEnd.toString();case"value":return this.valueStart.toString();case"step":return this.step.toString();default:return null}switch(t){case"min":return this.valueStart.toString();case"max":return this.max.toString();case"value":return this.valueEnd.toString();case"step":return this.step.toString();default:return null}},getInputValue:t=>t===r.Thumb.START?this.valueStart.toString():this.valueEnd.toString(),getThumbBoundingClientRect:t=>t===r.Thumb.START?this.startThumb.getBoundingClientRect():this.endThumb.getBoundingClientRect(),getThumbKnobWidth:t=>t===r.Thumb.START?this.startThumbKnob.getBoundingClientRect().width:this.endThumbKnob.getBoundingClientRect().width,getValueIndicatorContainerWidth:t=>t===r.Thumb.START?this.startValueIndicatorContainer.getBoundingClientRect().width:this.endValueIndicatorContainer.getBoundingClientRect().width,getValueToAriaValueTextFn:()=>this.valueToAriaTextTransform,isInputFocused:t=>{const e=v.deepActiveElementPath(),i=e[e.length-1];return t===r.Thumb.START?i===this.startInput:i===this.formElement},isRTL:()=>getComputedStyle(this).direction==="rtl",setInputAttribute:(t,e,i)=>{r.Thumb.START},removeInputAttribute:t=>{},setThumbStyleProperty:(t,e,i)=>{if(i===r.Thumb.START)switch(t){case"transform":case"-webkit-transform":this.startThumbTransformStyle=e;break;case"transition":case"-webkit-transition":this.startThumbTransitionStyle=e;break;default:t.startsWith("--")&&(this.startThumbCssProperties[t]=e)}else switch(t){case"transform":case"-webkit-transform":this.endThumbTransformStyle=e;break;case"transition":case"-webkit-transition":this.endThumbTransitionStyle=e;break;default:t.startsWith("--")&&(this.endThumbCssProperties[t]=e)}},removeThumbStyleProperty:(t,e)=>{if(e===r.Thumb.START)switch(t){case"left":case"right":break;case"transition":case"-webkit-transition":this.startThumbTransitionStyle="";break}else switch(t){case"left":case"right":break;case"transition":case"-webkit-transition":this.endThumbTransitionStyle="";break}},setTrackActiveStyleProperty:(t,e)=>{switch(t){case"transform-origin":this.trackTransformOriginStyle=e;break;case"left":this.trackLeftStyle=e;break;case"right":this.trackRightStyle=e;break;case"transform":case"-webkit-transform":break;case"transition":case"-webkit-transition":this.trackTransitionStyle=e;break}},removeTrackActiveStyleProperty:t=>{switch(t){case"transition":case"-webkit-transition":this.trackTransitionStyle="";break}},setInputValue:(t,e)=>{e===r.Thumb.START?this.valueStart=Number(t):this.valueEnd=Number(t)},setPointerCapture:t=>{this.mdcRoot.setPointerCapture(t)},setValueIndicatorText:()=>{},updateTickMarks:t=>{this.tickMarks=t}}}onStartChange(t){var e;this.valueStart=Number(t.target.value),(e=this.mdcFoundation)===null||e===void 0||e.handleInputChange(r.Thumb.START)}onStartFocus(){var t;(t=this.mdcFoundation)===null||t===void 0||t.handleInputFocus(r.Thumb.START),this.startRippleHandlers.startFocus()}onStartBlur(){var t;(t=this.mdcFoundation)===null||t===void 0||t.handleInputBlur(r.Thumb.START),this.startRippleHandlers.endFocus()}onStartMouseenter(){var t;(t=this.mdcFoundation)===null||t===void 0||t.handleThumbMouseenter(),this.startRippleHandlers.startHover()}onStartMouseleave(){var t;(t=this.mdcFoundation)===null||t===void 0||t.handleThumbMouseleave(),this.startRippleHandlers.endHover()}setFormData(t){this.name&&(t.append(`${this.name}-start`,`${this.valueStart}`),t.append(`${this.name}-end`,`${this.valueEnd}`))}}a.__decorate([h.i("input.start")],s.prototype,"startInput",void 0);a.__decorate([h.i(".start.mdc-slider__thumb")],s.prototype,"startThumb",void 0);a.__decorate([h.i(".start.mdc-slider__thumb .mdc-slider__thumb-knob")],s.prototype,"startThumbKnob",void 0);a.__decorate([h.i(".start.mdc-slider__thumb .mdc-slider__value-indicator-container")],s.prototype,"startValueIndicatorContainer",void 0);a.__decorate([T.e(".start .ripple")],s.prototype,"startRipple",void 0);a.__decorate([S.n({type:Number})],s.prototype,"valueStart",void 0);a.__decorate([l.t()],s.prototype,"startThumbWithIndicator",void 0);a.__decorate([l.t()],s.prototype,"startThumbTop",void 0);a.__decorate([l.t()],s.prototype,"shouldRenderStartRipple",void 0);a.__decorate([l.t()],s.prototype,"startThumbTransformStyle",void 0);a.__decorate([l.t()],s.prototype,"startThumbTransitionStyle",void 0);a.__decorate([l.t()],s.prototype,"startThumbCssProperties",void 0);var g=Object.getOwnPropertyDescriptor,_=(o,t,e,i)=>{for(var u=i>1?void 0:i?g(t,e):t,c=o.length-1,m;c>=0;c--)(m=o[c])&&(u=m(u)||u);return u};exports.CovalentSliderRange=class extends s{};exports.CovalentSliderRange.styles=[r.styles];exports.CovalentSliderRange=_([d.e("cv-slider-range")],exports.CovalentSliderRange);const f=exports.CovalentSliderRange;exports.default=f;
