iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
26 lines • 26.4 kB
JavaScript
/*! For license information please see 73476.d160af31217ec99d.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[73476],{57673:function(e,t,o){o.d(t,{z:function(){return r}});const r=e=>{if(void 0===e)return;if("object"!=typeof e){if("string"==typeof e||isNaN(e)){const t=(null==e?void 0:e.toString().split(":"))||[];if(1===t.length)return{seconds:Number(t[0])};if(t.length>3)return;const o=Number(t[2])||0,r=Math.floor(o);return{hours:Number(t[0])||0,minutes:Number(t[1])||0,seconds:r,milliseconds:Math.floor(1e3*Number((o-r).toFixed(4)))}}return{seconds:e}}if(!("days"in e))return e;const{days:t,minutes:o,seconds:r,milliseconds:a}=e;let i=e.hours||0;return i=(i||0)+24*(t||0),{hours:i,minutes:o,seconds:r,milliseconds:a}}},9503:function(e,t,o){var r=o(40445),a=o(97577),i=o(5124),n=o(67576);let s,l=e=>e;class c extends a.A{get value(){var e;return null!==(e=this._value)&&void 0!==e?e:null}set value(e){this._value=e}static get styles(){return[a.A.styles,(0,i.AH)(s||(s=l`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
--ha-checkbox-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-checkbox-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-checkbox-checked-icon-color,
var(--wa-color-brand-on-loud)
);--wa-form-control-activated-color:var(
--ha-checkbox-checked-background-color,
var(--ha-color-fill-primary-loud-resting)
);-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
--ha-checkbox-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-checkbox-required-marker-offset,
0.1rem
)}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
--ha-checkbox-border-color-hover,
var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
)}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}c=(0,r.Cg)([(0,n.EM)("ha-checkbox")],c)},70947:function(e,t,o){o(62953);var r=o(40445),a=o(50759),i=(o(38625),o(5124)),n=o(67576);o(67094);let s,l,c=e=>e;class d extends a.A{renderCheckboxIcon(){return(0,i.qy)(s||(s=c` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[a.A.styles,(0,i.AH)(l||(l=c`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...e){super(...e),this.selected=!1}}(0,r.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"selected",void 0),d=(0,r.Cg)([(0,n.EM)("ha-dropdown-item")],d)},29823:function(e,t,o){o.a(e,async function(e,t){try{o(3362),o(62953);var r=o(40445),a=o(52254),i=o(5124),n=o(67576),s=e([a]);a=(s.then?(await s)():s)[0];let l,c=e=>e;class d extends a.A{get anchorElement(){var e;return null===(e=this.popup)||void 0===e?void 0:e.anchor}set anchorElement(e){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=e)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!0)}async hideMenu(){const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!1),await super.hideMenu()}static get styles(){return[a.A.styles,(0,i.AH)(l||(l=c`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
--card-background-color,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
)}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...e){super(...e),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,r.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"dropdownTag",void 0),(0,r.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"dropdownItemTag",void 0),d=(0,r.Cg)([(0,n.EM)("ha-dropdown")],d),t()}catch(l){t(l)}})},64138:function(e,t,o){o.a(e,async function(e,r){try{o.r(t),o.d(t,{HaIconPicker:function(){return _}});o(74423),o(44114),o(26910),o(18111),o(22489),o(7588),o(61701),o(13579),o(3362),o(27495),o(25440),o(62953);var a=o(40445),i=o(5124),n=o(67576),s=o(22786),l=o(1087),c=o(700),d=(o(75064),o(38508)),h=(o(47680),e([d]));d=(h.then?(await h)():h)[0];let u,p,v,b=e=>e,g=[],m=!1;const f=(e,t)=>{var o;const r=`${t}:${e.name}`,a=e.name,i=a.split("-"),n=null!==(o=e.keywords)&&void 0!==o?o:[],s={iconName:a};return i.forEach((e,t)=>{s[`part${t}`]=e}),n.forEach((e,t)=>{s[`keyword${t}`]=e}),{id:r,primary:r,icon:r,search_labels:s,sorting_label:r}},y=async()=>{m=!0;const e=await o.e(81340).then(o.t.bind(o,25143,19));g=e.default.map(e=>f(e,"mdi"));const t=[];Object.keys(c.y).forEach(e=>{t.push(k(e))}),(await Promise.all(t)).forEach(e=>{g.push(...e)})},k=async e=>{try{const t=c.y[e].getIconList;if("function"!=typeof t)return[];return(await t()).map(t=>f(t,e))}catch(t){return console.warn(`Unable to load icon list for ${e} iconset`),[]}},w=e=>(0,i.qy)(u||(u=b` <ha-combo-box-item type="button"> <ha-icon .icon="${0}" slot="start"></ha-icon> ${0} </ha-combo-box-item> `),e.id,e.id);class _ extends i.WF{render(){return(0,i.qy)(p||(p=b` <ha-generic-picker allow-custom-value .getItems="${0}" .helper="${0}" .disabled="${0}" .required="${0}" .errorMessage="${0}" .invalid="${0}" .rowRenderer="${0}" .icon="${0}" .label="${0}" .value="${0}" .searchFn="${0}" -changed="${0}"> <slot name="start"></slot> </ha-generic-picker> `),this._getIconPickerItems,this.helper,this.disabled,this.required,this.errorMessage,this.invalid,w,this._icon,this.label,this._value,this._filterIcons,this._valueChanged)}firstUpdated(){m||y().then(()=>{this._getIconPickerItems=()=>g,this.requestUpdate()})}_valueChanged(e){e.stopPropagation(),this._setValue(e.detail.value)}_setValue(e){this.value=e,(0,l.r)(this,"value-changed",{value:this._value},{bubbles:!1,composed:!1})}get _icon(){var e;return null!==(e=this.value)&&void 0!==e&&e.length?this.value:this.placeholder}get _value(){return this.value||""}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.invalid=!1,this._getIconPickerItems=()=>g,this._filterIcons=(0,s.A)((e,t,o)=>{const r=e.toLowerCase().replace(/\s+/g,"-"),a=null!=o&&o.length?o:t;if(!r.length)return a;const i=[];for(const n of a){const e=(n.id.split(":")[1]||n.id).toLowerCase().split("-"),t=n.search_labels?Object.values(n.search_labels).filter(e=>null!==e).map(e=>e.toLowerCase()):[],o=n.id.toLowerCase();e.includes(r)?i.push({item:n,rank:1}):t.includes(r)?i.push({item:n,rank:2}):o.includes(r)?i.push({item:n,rank:3}):t.some(e=>e.includes(r))&&i.push({item:n,rank:4})}return i.sort((e,t)=>e.rank-t.rank).map(e=>e.item)})}}_.styles=(0,i.AH)(v||(v=b`ha-generic-picker{width:100%;display:block}`)),(0,a.Cg)([(0,n.MZ)()],_.prototype,"value",void 0),(0,a.Cg)([(0,n.MZ)()],_.prototype,"label",void 0),(0,a.Cg)([(0,n.MZ)()],_.prototype,"helper",void 0),(0,a.Cg)([(0,n.MZ)()],_.prototype,"placeholder",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"error-message"})],_.prototype,"errorMessage",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"required",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"invalid",void 0),_=(0,a.Cg)([(0,n.EM)("ha-icon-picker")],_),r()}catch(u){r(u)}})},606:function(e,t,o){o.a(e,async function(e,t){try{o(74423),o(18111),o(61701),o(62953);var r=o(40445),a=o(5124),i=o(67576),n=o(63672),s=o(22786),l=o(1087),c=o(29823),d=(o(70947),o(3449),o(88285)),h=(o(67094),e([c,d]));[c,d]=h.then?(await h)():h;let u,p,v,b,g,m,f,y,k,w=e=>e;class _ extends a.WF{render(){return this.disabled?(0,a.qy)(u||(u=w`${0}${0}`),this._renderField(),this._renderHelper()):(0,a.qy)(p||(p=w` <ha-dropdown placement="bottom" -select="${0}" -show="${0}" -hide="${0}"> ${0} ${0} </ha-dropdown> ${0} `),this._handleSelect,this._handleShow,this._handleHide,this._renderField(),this.options?this.options.map(e=>{var t;const o=["string","number"].includes(typeof e);return(0,a.qy)(v||(v=w` <ha-dropdown-item .value="${0}" .disabled="${0}" .selected="${0}"> ${0} <div class="content"> ${0} ${0} </div> </ha-dropdown-item> `),o?e:e.value,!o&&(null!==(t=e.disabled)&&void 0!==t&&t),this.value===(o?e:e.value),e.iconPath?(0,a.qy)(b||(b=w`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),e.iconPath):a.s6,o?e:e.label||e.value,e.secondary?(0,a.qy)(g||(g=w`<div class="secondary">${0}</div>`),e.secondary):a.s6)}):(0,a.qy)(m||(m=w`<slot></slot>`)),this._renderHelper())}_renderField(){const e=this._getValueLabel(this.options,this.value);return(0,a.qy)(f||(f=w` <ha-picker-field slot="trigger" type="button" class="${0}" compact="compact" aria-label="${0}" ="${0}" .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" .hideClearIcon="${0}"> </ha-picker-field> `),this._opened?"opened":"",(0,n.J)(this.label),this._clearValue,this.label,e,this.required,this.disabled,!this.clearable||this.required||this.disabled||!String(this.value))}_renderHelper(){return this.helper?(0,a.qy)(y||(y=w`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):a.s6}_handleSelect(e){e.stopPropagation();const t=e.detail.item.value;t!==this.value&&(0,l.r)(this,"selected",{value:t})}_clearValue(){!this.disabled&&this.value&&(0,l.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...e){super(...e),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,s.A)((e,t)=>{const o=void 0!==t?String(t):void 0;if(!e||!o)return o;for(const r of e){const e=["string","number"].includes(typeof r);if(e&&r===o||!e&&String(r.value)===o)return e?r:r.label||r.value}return o})}}_.styles=(0,a.AH)(k||(k=w`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`)),(0,r.Cg)([(0,i.MZ)({type:Boolean})],_.prototype,"clearable",void 0),(0,r.Cg)([(0,i.MZ)({attribute:!1})],_.prototype,"options",void 0),(0,r.Cg)([(0,i.MZ)()],_.prototype,"label",void 0),(0,r.Cg)([(0,i.MZ)()],_.prototype,"helper",void 0),(0,r.Cg)([(0,i.MZ)()],_.prototype,"value",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],_.prototype,"required",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,r.Cg)([(0,i.wk)()],_.prototype,"_opened",void 0),(0,r.Cg)([(0,i.P)("ha-picker-field")],_.prototype,"_triggerField",void 0),_=(0,r.Cg)([(0,i.EM)("ha-select")],_),t()}catch(u){t(u)}})},14872:function(e,t,o){o.a(e,async function(e,r){try{o.r(t);o(62953);var a=o(40445),i=o(5124),n=o(67576),s=o(57673),l=o(1087),c=(o(9503),o(39927)),d=o(64138),h=o(91485),u=o(14503),p=e([c,d,h]);[c,d,h]=p.then?(await p)():p;let v,b,g=e=>e;class m extends i.WF{set item(e){this._item=e,e?(this._name=e.name||"",this._icon=e.icon||"",this._duration=e.duration||"00:00:00",this._restore=e.restore||!1):(this._name="",this._icon="",this._duration="00:00:00",this._restore=!1),this._setDurationData()}focus(){this.updateComplete.then(()=>{var e;return null===(e=this._focusElement)||void 0===e?void 0:e.focus()})}render(){return this.hass?(0,i.qy)(v||(v=g` <div class="form"> <ha-input .value="${0}" .configValue="${0}" ="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" -changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <ha-duration-input .configValue="${0}" .data="${0}" -changed="${0}" .disabled="${0}"></ha-duration-input> <ha-checkbox .configValue="${0}" .checked="${0}" ="${0}" .disabled="${0}"> ${0} </ha-checkbox> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,"duration",this._duration_data,this._valueChanged,this.disabled,"restore",this._restore,this._toggleRestore,this.disabled,this.hass.localize("ui.dialogs.helper_settings.timer.restore")):i.s6}_valueChanged(e){var t;if(!this.new&&!this._item)return;e.stopPropagation();const o=e.target.configValue,r=(null===(t=e.detail)||void 0===t?void 0:t.value)||e.target.value;if(this[`_${o}`]===r)return;const a=Object.assign({},this._item);r?a[o]=r:delete a[o],(0,l.r)(this,"value-changed",{value:a})}_toggleRestore(e){this._restore=e.target.checked,(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{restore:this._restore})})}_setDurationData(){let e;if("object"==typeof this._duration&&null!==this._duration){const t=this._duration;e={hours:"string"==typeof t.hours?parseFloat(t.hours):t.hours,minutes:"string"==typeof t.minutes?parseFloat(t.minutes):t.minutes,seconds:"string"==typeof t.seconds?parseFloat(t.seconds):t.seconds}}else e=this._duration;this._duration_data=(0,s.z)(e)}static get styles(){return[u.RF,(0,i.AH)(b||(b=g`.form{color:var(--primary-text-color)}ha-duration-input{display:block;margin:8px 0}ha-checkbox{min-height:40px;justify-content:center}`))]}constructor(...e){super(...e),this.new=!1,this.disabled=!1}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"new",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,a.Cg)([(0,n.wk)()],m.prototype,"_name",void 0),(0,a.Cg)([(0,n.wk)()],m.prototype,"_icon",void 0),(0,a.Cg)([(0,n.wk)()],m.prototype,"_duration",void 0),(0,a.Cg)([(0,n.wk)()],m.prototype,"_duration_data",void 0),(0,a.Cg)([(0,n.wk)()],m.prototype,"_restore",void 0),(0,a.Cg)([(0,n.P)("[dialogInitialFocus]")],m.prototype,"_focusElement",void 0),m=(0,a.Cg)([(0,n.EM)("ha-timer-form")],m),r()}catch(v){r(v)}})},22395:function(e,t,o){o(62953);var r=o(5124),a=o(67576),i=o(717);let n;var s=(0,r.AH)(n||(n=(e=>e)`:host{display:inline-flex}.button-group{display:flex;position:relative;isolation:isolate;flex-wrap:wrap} (hover:hover){.button-group::slotted(:hover),.button-group>:hover{z-index:1}}.button-group::slotted(:focus),.button-group::slotted([aria-checked=true]),.button-group::slotted([checked]),.button-group>:focus,.button-group>[aria-checked=true],.button-group>[checked]{z-index:2!important}:host([orientation=horizontal]) .button-group{flex-direction:row}:host([orientation=vertical]) .button-group{flex-direction:column}:host([orientation=horizontal]){--_button-horizontal-indent:var(--wa-form-control-border-width);--_button-horizontal-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}:host([orientation=vertical]){--_button-vertical-indent:var(--wa-form-control-border-width);--_button-vertical-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}::slotted(:not(:first-child):not(:last-child)){--_button-start-start-radius:0;--_button-start-end-radius:0;--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:first-child:not(:last-child)){--_button-start-end-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-end-start-radius:0}:host([orientation=vertical]) ::slotted(:first-child:not(:last-child)){--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=vertical]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-start-end-radius:0}`));let l,c=e=>e;var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u=(e,t,o,r)=>{for(var a,i=r>1?void 0:r?h(t,o):t,n=e.length-1;n>=0;n--)(a=e[n])&&(i=(r?a(t,o,i):a(i))||i);return r&&i&&d(t,o,i),i};let p=class extends i.A{updated(e){super.updated(e),e.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}handleFocus(e){const t=v(e.target,this.childSelector);null==t||t.classList.add("button-focus")}handleBlur(e){const t=v(e.target,this.childSelector);null==t||t.classList.remove("button-focus")}handleMouseOver(e){const t=v(e.target,this.childSelector);null==t||t.classList.add("button-hover")}handleMouseOut(e){const t=v(e.target,this.childSelector);null==t||t.classList.remove("button-hover")}render(){return(0,r.qy)(l||(l=c` <slot part="base" class="button-group" role="${0}" aria-label="${0}" aria-orientation="${0}" ="${0}" ="${0}" ="${0}" ="${0}"></slot> `),this.disableRole?"presentation":"group",this.label,this.orientation,this.handleBlur,this.handleFocus,this.handleMouseOver,this.handleMouseOut)}constructor(){super(...arguments),this.disableRole=!1,this.hasOutlined=!1,this.label="",this.orientation="horizontal",this.childSelector="wa-button, wa-radio-button"}};function v(e,t){var o;return null!==(o=e.closest(t))&&void 0!==o?o:e.querySelector(t)}p.css=[s],u([(0,a.P)("slot")],p.prototype,"defaultSlot",2),u([(0,a.wk)()],p.prototype,"disableRole",2),u([(0,a.wk)()],p.prototype,"hasOutlined",2),u([(0,a.MZ)()],p.prototype,"label",2),u([(0,a.MZ)({reflect:!0})],p.prototype,"orientation",2),u([(0,a.MZ)()],p.prototype,"childSelector",2),p=u([(0,a.EM)("wa-button-group")],p)},97577:function(e,t,o){o.d(t,{A:function(){return C}});o(27495),o(62953);var r=o(5124),a=o(67576),i=o(6412),n=o(63672),s=o(34514),l=o(40991),c=o(92070),d=o(49546),h=o(9395),u=o(62676),p=o(15477),v=o(31896);o(38625);let b;var g=(0,r.AH)(b||(b=(e=>e)`:host{--checked-icon-color:var(--wa-color-brand-on-loud);--checked-icon-scale:0.8;display:inline-flex;color:var(--wa-form-control-value-color);font-family:inherit;font-weight:var(--wa-form-control-value-font-weight);line-height:var(--wa-form-control-value-line-height);user-select:none;-webkit-user-select:none}[part~=control]{display:inline-flex;flex:0 0 auto;position:relative;align-items:center;justify-content:center;width:var(--wa-form-control-toggle-size);height:var(--wa-form-control-toggle-size);border-color:var(--wa-form-control-border-color);border-radius:min(calc(var(--wa-form-control-toggle-size) * .375),var(--wa-border-radius-s));border-style:var(--wa-border-style);border-width:var(--wa-form-control-border-width);background-color:var(--wa-form-control-background-color);transition:background var(--wa-transition-normal),border-color var(--wa-transition-fast),box-shadow var(--wa-transition-fast),color var(--wa-transition-fast);transition-timing-function:var(--wa-transition-easing);margin-inline-end:.5em}[part~=base]{display:flex;align-items:flex-start;position:relative;color:currentColor;vertical-align:middle;cursor:pointer}[part~=label]{display:inline}[part~=control]:has(:checked,:indeterminate){color:var(--checked-icon-color);border-color:var(--wa-form-control-activated-color);background-color:var(--wa-form-control-activated-color)}[part~=control]:has(> input:focus-visible:not(:disabled)){outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host [part~=base]:has(input:disabled){opacity:.5;cursor:not-allowed}input{position:absolute;padding:0;margin:0;height:100%;width:100%;opacity:0;pointer-events:none}[part~=icon]{display:flex;scale:var(--checked-icon-scale)}[part~=icon]::part(svg){translate:0.0009765625em}input:not(:checked,:indeterminate)+[part~=icon]{visibility:hidden}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}`));let m,f,y,k=e=>e;var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,$=(e,t,o,r)=>{for(var a,i=r>1?void 0:r?_(t,o):t,n=e.length-1;n>=0;n--)(a=e[n])&&(i=(r?a(t,o,i):a(i))||i);return r&&i&&w(t,o,i),i};let C=class extends u.q{static get validators(){const e=r.S$?[]:[(0,d.Y)({validationProperty:"checked",validationElement:Object.assign(document.createElement("input"),{type:"checkbox",required:!0})})];return[...super.validators,...e]}get value(){var e;return null!==(e=this._value)&&void 0!==e?e:"on"}set value(e){this._value=e}handleSizeChange(){(0,l.b)(this.localName,this.size)}get checked(){var e;return this.valueHasChanged?Boolean(this._checked):null!==(e=this._checked)&&void 0!==e?e:this.defaultChecked}set checked(e){this._checked=Boolean(e),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.indeterminate=!1,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}connectedCallback(){super.connectedCallback(),this.handleDefaultCheckedChange()}handleDefaultCheckedChange(){this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked,this.input.indeterminate=this.indeterminate),this.customStates.set("checked",this.checked),this.customStates.set("indeterminate",this.indeterminate),this.updateValidity()}handleDisabledChange(){this.customStates.set("disabled",this.disabled)}willUpdate(e){super.willUpdate(e),(e.has("value")||e.has("checked")||e.has("defaultChecked"))&&this.handleValueOrCheckedChange()}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){const e=!!r.S$||this.hasSlotController.test("hint"),t=!!this.hint||!!e,o=!this.checked&&this.indeterminate,a=o?"indeterminate":"check",l=o?"indeterminate":"check";return(0,r.qy)(m||(m=k` <label part="base"> <span part="control"> <input class="input" type="checkbox" title="${0}" name="${0}" value="${0}" .indeterminate="${0}" .checked="${0}" .disabled="${0}" .required="${0}" aria-checked="${0}" aria-describedby="hint" ="${0}"> <wa-icon part="${0}-icon icon" library="system" name="${0}"></wa-icon> </span> <slot part="label"></slot> </label> <slot id="hint" part="hint" name="hint" aria-hidden="${0}" class="${0}"> ${0} </slot> `),this.title,(0,n.J)(this.name),(0,n.J)(this._value),(0,s.V)(this.indeterminate),(0,s.V)(this.checked),this.disabled,this.required,this.indeterminate?"mixed":this.checked?"true":"false",this.handleClick,l,a,t?"false":"true",(0,i.H)({"has-slotted":t}),this.hint)}constructor(){var e;super(...arguments),this.hasSlotController=new c.X(this,"hint"),this.title="",this.name=null,this._value=null!==(e=this.getAttribute("value"))&&void 0!==e?e:null,this.size="m",this.disabled=!1,this.indeterminate=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint=""}};C.css=[p.A,v.A,g],C.shadowRootOptions=Object.assign(Object.assign({},u.q.shadowRootOptions),{},{delegatesFocus:!0}),$([(0,a.P)('input[type="checkbox"]')],C.prototype,"input",2),$([(0,a.MZ)()],C.prototype,"title",2),$([(0,a.MZ)({reflect:!0})],C.prototype,"name",2),$([(0,a.MZ)({reflect:!0})],C.prototype,"value",1),$([(0,a.MZ)({reflect:!0})],C.prototype,"size",2),$([(0,h.w)("size")],C.prototype,"handleSizeChange",1),$([(0,a.MZ)({type:Boolean})],C.prototype,"disabled",2),$([(0,a.MZ)({type:Boolean,reflect:!0})],C.prototype,"indeterminate",2),$([(0,a.MZ)({type:Boolean,attribute:!1})],C.prototype,"checked",1),$([(0,a.MZ)({type:Boolean,reflect:!0,attribute:"checked"})],C.prototype,"defaultChecked",2),$([(0,a.MZ)({type:Boolean,reflect:!0})],C.prototype,"required",2),$([(0,a.MZ)()],C.prototype,"hint",2),$([(0,h.w)(["checked","defaultChecked"])],C.prototype,"handleDefaultCheckedChange",1),$([(0,h.w)(["checked","indeterminate"])],C.prototype,"handleStateChange",1),$([(0,h.w)("disabled")],C.prototype,"handleDisabledChange",1),C=$([(0,a.EM)("wa-checkbox")],C),null===(f=(y=C).disableWarning)||void 0===f||f.call(y,"change-in-update")},49546:function(e,t,o){o.d(t,{Y:function(){return r}});o(44114);const r=(e={})=>{let{validationElement:t,validationProperty:o}=e;t||(t=Object.assign(document.createElement("input"),{required:!0})),o||(o="value");const r={observedAttributes:["required"],message:t.validationMessage,checkValidity(e){var t;const a={message:"",isValid:!0,invalidKeys:[]};if(!(null!==(t=e.required)&&void 0!==t?t:e.hasAttribute("required")))return a;return!e[o]&&(a.message="function"==typeof r.message?r.message(e):r.message||"",a.isValid=!1,a.invalidKeys.push("valueMissing")),a}};return r}}}]);