import{E as H,a as z}from"./chunk-K7KAWBRR.js";import{a as R,b as U,c as x}from"./chunk-XUUJ7NBF.js";import{d as O,e as K,i as Q,j as X}from"./chunk-QH7CG3K4.js";import{Ia as d,La as J}from"./chunk-5YPL7P3G.js";import{D as N,K as j,m as L,s as T}from"./chunk-HJI5FNS6.js";import{Bb as a,Dc as _,Hc as w,Ka as n,La as r,Ld as g,Md as B,Oa as h,Rb as v,Sb as C,Sc as M,Sd as D,Tc as F,Ua as $,Uc as E,Vb as V,jc as l,kc as c,kd as A,oc as S,sa as f,ta as m,ua as k,xc as u,yc as p,za as y,zc as I}from"./chunk-XJKQ67XR.js";import{e as G}from"./chunk-SZAW6ZBW.js";var Y,Z,ee,te,P,ie,W,ve,oe=G(()=>{j();j();D();D();H();J();x();x();X();K();Y=["input"],Z=({dt:e})=>`
.p-toggleswitch {
    display: inline-block;
    width: ${e("toggleswitch.width")};
    height: ${e("toggleswitch.height")};

}

.p-toggleswitch-input {
    cursor: pointer;
    appearance: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    opacity: 0;
    z-index: 1;
    outline: 0 none;
    border-radius: ${e("toggleswitch.border.radius")};
}

.p-toggleswitch-slider {
    display: inline-block;
    cursor: pointer;
    width: 100%;
    height: 100%;
    border-width: ${e("toggleswitch.border.width")};
    border-style: solid;
    border-color: ${e("toggleswitch.border.color")};
    background: ${e("toggleswitch.background")};
    transition: background ${e("toggleswitch.transition.duration")}, color ${e("toggleswitch.transition.duration")}, border-color ${e("toggleswitch.transition.duration")}, outline-color ${e("toggleswitch.transition.duration")}, box-shadow ${e("toggleswitch.transition.duration")};
    border-radius: ${e("toggleswitch.border.radius")};
    outline-color: transparent;
    box-shadow: ${e("toggleswitch.shadow")};
}

.p-toggleswitch-slider:before {
    position: absolute;
    content: "";
    top: 50%;
    background: ${e("toggleswitch.handle.background")};
    width: ${e("toggleswitch.handle.size")};
    height: ${e("toggleswitch.handle.size")};
    left: ${e("toggleswitch.gap")};
    margin-top: calc(-1 * calc(${e("toggleswitch.handle.size")} / 2));
    border-radius: ${e("toggleswitch.handle.border.radius")};
    transition: background ${e("toggleswitch.transition.duration")}, left ${e("toggleswitch.slide.duration")};
}

.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {
    background: ${e("toggleswitch.checked.background")};
    border-color: ${e("toggleswitch.checked.border.color")};
}

.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider:before {
    background: ${e("toggleswitch.handle.checked.background")};
    left: calc(${e("toggleswitch.width")} - calc(${e("toggleswitch.handle.size")} + ${e("toggleswitch.gap")}));
}

.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {
    background: ${e("toggleswitch.hover.background")};
    border-color: ${e("toggleswitch.hover.border.color")};
}

.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider:before {
    background: ${e("toggleswitch.handle.hover.background")};
}

.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider {
    background: ${e("toggleswitch.checked.hover.background")};
    border-color: ${e("toggleswitch.checked.hover.border.color")};
}

.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider:before {
    background: ${e("toggleswitch.handle.checked.hover.background")};
}

.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {
    box-shadow: ${e("toggleswitch.focus.ring.shadow")};
    outline: ${e("toggleswitch.focus.ring.width")} ${e("toggleswitch.focus.ring.style")} ${e("toggleswitch.focus.ring.color")};
    outline-offset: ${e("toggleswitch.focus.ring.offset")};
}

.p-toggleswitch.p-invalid > .p-toggleswitch-slider {
    border-color: ${e("toggleswitch.invalid.border.color")};
}

.p-toggleswitch.p-disabled {
    opacity: 1;
}

.p-toggleswitch.p-disabled .p-toggleswitch-slider {
    background: ${e("toggleswitch.disabled.background")};
}

.p-toggleswitch.p-disabled .p-toggleswitch-slider:before {
    background: ${e("toggleswitch.handle.disabled.background")};
}
`,ee={root:{position:"relative"}},te={root:({instance:e})=>({"p-toggleswitch p-component":!0,"p-toggleswitch-checked":e.checked(),"p-disabled":e.disabled,"p-invalid":e.invalid}),input:"p-toggleswitch-input",slider:"p-toggleswitch-slider"},P=(()=>{class e extends O{name="toggleswitch";theme=Z;classes=te;inlineStyles=ee;static \u0275fac=(()=>{let i;return function(t){return(i||(i=h(e)))(t||e)}})();static \u0275prov=m({token:e,factory:e.\u0275fac})}return e})(),ie={provide:z,useExisting:f(()=>W),multi:!0},W=(()=>{class e extends Q{style;styleClass;tabindex;inputId;name;disabled;readonly;trueValue=!0;falseValue=!1;ariaLabel;ariaLabelledBy;autofocus;onChange=new $;input;modelValue=!1;focused=!1;onModelChange=()=>{};onModelTouched=()=>{};_componentStyle=y(P);onClick(i){!this.disabled&&!this.readonly&&(this.modelValue=this.checked()?this.falseValue:this.trueValue,this.onModelChange(this.modelValue),this.onChange.emit({originalEvent:i,checked:this.modelValue}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}writeValue(i){this.modelValue=i,this.cd.markForCheck()}registerOnChange(i){this.onModelChange=i}registerOnTouched(i){this.onModelTouched=i}setDisabledState(i){this.disabled=i,this.cd.markForCheck()}checked(){return this.modelValue===this.trueValue}static \u0275fac=(()=>{let i;return function(t){return(i||(i=h(e)))(t||e)}})();static \u0275cmp=v({type:e,selectors:[["p-inputSwitch"],["p-inputswitch"]],viewQuery:function(o,t){if(o&1&&M(Y,5),o&2){let s;F(s=E())&&(t.input=s.first)}},inputs:{style:"style",styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",B],inputId:"inputId",name:"name",disabled:[2,"disabled","disabled",g],readonly:[2,"readonly","readonly",g],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",g]},outputs:{onChange:"onChange"},features:[A([ie,P]),V],decls:5,vars:22,consts:[["input",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["type","checkbox","role","switch",3,"focus","blur","ngClass","checked","disabled","pAutoFocus"],[3,"ngClass"]],template:function(o,t){if(o&1){let s=_();u(0,"div",1),w("click",function(q){return n(s),r(t.onClick(q))}),u(1,"div",2)(2,"input",3,0),w("focus",function(){return n(s),r(t.onFocus())})("blur",function(){return n(s),r(t.onBlur())}),p()(),I(4,"span",4),p()}o&2&&(S(t.styleClass),c("ngClass",t.cx("root"))("ngStyle",t.sx("root"))("ngStyle",t.style),l("data-pc-name","inputswitch")("data-pc-section","root"),a(),l("data-pc-section","hiddenInputWrapper")("data-p-hidden-accessible",!0),a(),c("ngClass",t.cx("input"))("checked",t.checked())("disabled",t.disabled)("pAutoFocus",t.autofocus),l("id",t.inputId)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name)("tabindex",t.tabindex)("data-pc-section","hiddenInput"),a(2),c("ngClass",t.cx("slider")),l("data-pc-section","slider"))},dependencies:[N,L,T,U,R,d],encapsulation:2,changeDetection:0})}return e})(),ve=(()=>{class e{static \u0275fac=function(o){return new(o||e)};static \u0275mod=C({type:e});static \u0275inj=k({imports:[W,d,d]})}return e})()});export{W as a,ve as b,oe as c};
