1import{T as e}from"./pp-facet-dropdown-FY1eeaHH.js";import{i as t,e as s,b as i}from"./pp-accordion-CA6w9In6.js";import{s as r}from"./pp-highcharts-D5Crk9o0.js";class o extends(e(t)){static get properties(){return{switchId:{type:String,attribute:"switch-id"},labelChecked:{type:String,attribute:"label-checked"},labelUnchecked:{type:String,attribute:"label-unchecked"},storageKey:{type:String,attribute:"storage-key"},disableInput:{type:Boolean,attribute:"disable-input"},checked:{type:Boolean,reflect:!0},isDisabled:{type:Boolean,attribute:!1,reflect:!0}}}constructor(){super(),this.checked=!1,this.isDisabled=!1,this.disableInput=!1}connectedCallback(){super.connectedCallback(),!this.checked&&this.storageKey&&(this.checked="true"===localStorage.getItem(this.storageKey)),this.dispatchSwitchEvent()}dispatchSwitchEvent(){const{switchId:e,checked:t}=this;this.dispatchEvent(new CustomEvent(r,{bubbles:!0,detail:{id:e,checked:t}}))}toggleSwitch(){if(this.disableInput&&this.isDisabled||(this.checked=!this.checked),!this.checked&&this.disableInput){this.isDisabled=!0;this.renderRoot.querySelector("input").disabled=!0}this.storageKey&&localStorage.setItem(this.storageKey,this.checked),this.dispatchSwitchEvent(),this.firesEtEvent&&(this.etEventObject=this.checked?this.labelUnchecked:this.labelChecked,this.dispatchTrackingEvent())}get disableStateClasses(){return{"disabled:opacity-50":this.isDisabled,"before:disabled:cursor-not-allowed":this.isDisabled}}get underlineClasses(){return{"group-hover:underline":!this.isDisabled,"group-focus:underline":!this.isDisabled}}get disableCursorClasses(){return{"cursor-not-allowed":this.isDisabled}}render(){return i` 2 <label class="${s(this.disableCursorClasses)} inline-flex gap-x-12 font-medium text-text-1 text-24 cursor-pointer group"> 3 <input 4 id="${this.switchId}" 5 class="qs-checkbox ${s(this.disableStateClasses)} inline-block flex-shrink-0 appearance-none w-60 h-32 border-2 border-line-2 rounded-button-bl rounded-button-br rounded-button-tl rounded-button-tr bg-static-22 checked:bg-status-bg-1 transition-colors before:block before:aspect-square before:h-full before:bg-line-2 before:border-solid before:border-2 before:border-static-22 before:rounded-button-bl before:rounded-button-br before:rounded-button-tl before:rounded-button-tr before:cursor-pointer before:transition-transform checked:before:border-status-bg-1 checked:before:translate-x-full" 6 type="checkbox" 7 role="switch" 8 ?checked="${this.checked}" 9 @change="${this.toggleSwitch}" 10 /> 11 <span class="${s(this.underlineClasses)}"> 12 ${this.checked?this.labelChecked:this.labelUnchecked} 13 </span> 14 </label> 15 `}createRenderRoot(){return this}}customElements.define("pp-switch",o);export{o as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.