import{c as E,e as B,a as j,p as a,t as b,b as u,d as D,f as _,l as F,h as v,m as r,s as S,r as w,j as T,n as Y,k as q}from"../../custom-element.js";import{i as A}from"../../if.js";import{a as C,s as G}from"../../attributes.js";import{a as H}from"../../input.js";import{c as I}from"../../custom-element-forward-events.js";import"../../branches.js";var J=_('<span class="mc-toggle__label svelte-26wadt"> </span>'),K=_('<div><label class="mc-toggle__container svelte-26wadt"><input/> <!></label></div>');const L={hash:"svelte-26wadt",code:`/**
 * Do not edit directly, this file was auto-generated.
 */.mc-toggle.svelte-26wadt {width:fit-content;}.mc-toggle__container.svelte-26wadt {display:flex;align-items:center;cursor:pointer;gap:0.5rem;position:relative;padding:0.25rem;}.mc-toggle__container.svelte-26wadt::before, .mc-toggle__container.svelte-26wadt::after {content:"";}.mc-toggle__container.svelte-26wadt::before {transition:box-shadow 200ms ease;height:1.5rem;width:2.5rem;background-color:var(--forms-color-background-unchecked, #666666);border-radius:var(--border-radius-l, 1rem);flex-shrink:0;}.mc-toggle__container.svelte-26wadt::after {height:1.25rem;width:1.25rem;background-color:var(--forms-color-icon-inverse, #ffffff);border-radius:var(--border-radius-full, 100%);background-position:center;left:0.375rem;position:absolute;top:50%;transform:translateY(-50%);}.mc-toggle__input.svelte-26wadt {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}.mc-toggle__label.svelte-26wadt {color:var(--forms-color-text-default, #000000);font-size:var(--font-size-150, 1rem);font-weight:var(--font-weight-regular, 400);line-height:var(--line-height-m, 1.5);}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):checked) .mc-toggle__container:where(.svelte-26wadt)::before {background-color:var(--forms-color-background-checked, #117f03);}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):checked) .mc-toggle__container:where(.svelte-26wadt)::after {transform:translate(1rem, -50%);}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):disabled) .mc-toggle__container:where(.svelte-26wadt) {cursor:not-allowed;}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):disabled) .mc-toggle__container:where(.svelte-26wadt)::before {background-color:var(--forms-color-background-disabled, #d9d9d9);}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):disabled) .mc-toggle__container:where(.svelte-26wadt)::after {background-color:var(--forms-color-icon-disabled, #737373);}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):disabled) .mc-toggle__label:where(.svelte-26wadt) {color:var(--forms-color-text-disabled, #737373);}.mc-toggle.svelte-26wadt:has(:where(.svelte-26wadt):focus-visible) .mc-toggle__container:where(.svelte-26wadt)::before {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-toggle--m.svelte-26wadt .mc-toggle__container:where(.svelte-26wadt)::before {height:2rem;width:3.5rem;}.mc-toggle--m.svelte-26wadt .mc-toggle__container:where(.svelte-26wadt)::after {height:1.5rem;width:1.5rem;left:0.5rem;}.mc-toggle--m.svelte-26wadt:has(:where(.svelte-26wadt):checked) .mc-toggle__container:where(.svelte-26wadt)::after {transform:translate(1.5rem, -50%);}.mc-toggle--hide-label.svelte-26wadt .mc-toggle__label:where(.svelte-26wadt) {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}`};function M(f,t){B(t,!0),j(f,L);let o=a(t,"id",7),d=a(t,"name",7),l=a(t,"label",7),c=a(t,"checked",15,!1),i=a(t,"disabled",7),n=a(t,"size",7,"s"),p=F(t,["$$slots","$$events","$$legacy","$$host","id","name","label","checked","disabled","size"]);var k={get id(){return o()},set id(e){o(e),r()},get name(){return d()},set name(e){d(e),r()},get label(){return l()},set label(e){l(e),r()},get checked(){return c()},set checked(e=!1){c(e),r()},get disabled(){return i()},set disabled(e){i(e),r()},get size(){return n()},set size(e="s"){n(e),r()}},s=K(),g=v(s),m=v(g);C(m,()=>({id:o(),type:"checkbox",class:"mc-toggle__input",name:d(),disabled:i(),...p}),void 0,void 0,void 0,"svelte-26wadt",!0);var x=S(m,2);{var y=e=>{var h=J(),z=v(h,!0);w(h),b(()=>q(z,l())),u(e,h)};A(x,e=>{l()&&e(y)})}return w(g),w(s),b(()=>{T(s,1,Y(["mc-toggle",`mc-toggle--${n()}`]),"svelte-26wadt"),G(g,"for",o())}),H(m,c),u(f,s),D(k)}customElements.define("m-toggle",E(M,{checked:{attribute:"checked",reflect:!0,type:"Boolean"},disabled:{attribute:"disabled",reflect:!0,type:"Boolean"},id:{},name:{},label:{},size:{}},[],[],{mode:"open"},I));
//# sourceMappingURL=Toggle.js.map
