"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[2361],{52361:function(e,i,a){a.r(i),a.d(i,{HaFormInteger:function(){return p}});var t,s,d,l,r,n=a(64599),h=a(35806),o=a(71008),u=a(62193),c=a(2816),v=a(27927),m=(a(71522),a(42942),a(48062),a(81027),a(22871),a(66360)),f=a(29818),k=a(50880),p=(a(29906),(0,v.A)([(0,f.EM)("ha-form-integer")],(function(e,i){var a=function(i){function a(){var i;(0,o.A)(this,a);for(var t=arguments.length,s=new Array(t),d=0;d<t;d++)s[d]=arguments[d];return i=(0,u.A)(this,a,[].concat(s)),e(i),i}return(0,c.A)(a,i),(0,h.A)(a)}(i);return{F:a,d:[{kind:"field",decorators:[(0,f.MZ)({attribute:!1})],key:"localize",value:void 0},{kind:"field",decorators:[(0,f.MZ)({attribute:!1})],key:"schema",value:void 0},{kind:"field",decorators:[(0,f.MZ)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,f.MZ)()],key:"label",value:void 0},{kind:"field",decorators:[(0,f.MZ)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,f.MZ)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,f.P)("ha-textfield ha-slider")],key:"_input",value:void 0},{kind:"field",key:"_lastValue",value:void 0},{kind:"method",key:"focus",value:function(){this._input&&this._input.focus()}},{kind:"method",key:"render",value:function(){var e,i;return void 0!==this.schema.valueMin&&void 0!==this.schema.valueMax&&this.schema.valueMax-this.schema.valueMin<256?(0,m.qy)(t||(t=(0,n.A)([" <div> ",' <div class="flex"> ',' <ha-slider labeled .value="','" .min="','" .max="','" .disabled="','" @change="','"></ha-slider> </div> '," </div> "])),this.label,this.schema.required?"":(0,m.qy)(s||(s=(0,n.A)([' <ha-checkbox @change="','" .checked="','" .disabled="','"></ha-checkbox> '])),this._handleCheckboxChange,void 0!==this.data,this.disabled),this._value,this.schema.valueMin,this.schema.valueMax,this.disabled||void 0===this.data&&!this.schema.required,this._valueChanged,this.helper?(0,m.qy)(d||(d=(0,n.A)(["<ha-input-helper-text>","</ha-input-helper-text>"])),this.helper):""):(0,m.qy)(l||(l=(0,n.A)([' <ha-textfield type="number" inputMode="numeric" .label="','" .helper="','" helperPersistent .value="','" .disabled="','" .required="','" .autoValidate="','" .suffix="','" .validationMessage="','" @input="','"></ha-textfield> '])),this.label,this.helper,void 0!==this.data?this.data:"",this.disabled,this.schema.required,this.schema.required,null===(e=this.schema.description)||void 0===e?void 0:e.suffix,this.schema.required?null===(i=this.localize)||void 0===i?void 0:i.call(this,"ui.common.error_required"):void 0,this._valueChanged)}},{kind:"method",key:"updated",value:function(e){e.has("schema")&&this.toggleAttribute("own-margin",!("valueMin"in this.schema&&"valueMax"in this.schema||!this.schema.required))}},{kind:"get",key:"_value",value:function(){var e,i;return void 0!==this.data?this.data:this.schema.required?void 0!==(null===(e=this.schema.description)||void 0===e?void 0:e.suggested_value)&&null!==(null===(i=this.schema.description)||void 0===i?void 0:i.suggested_value)||this.schema.default||this.schema.valueMin||0:this.schema.valueMin||0}},{kind:"method",key:"_handleCheckboxChange",value:function(e){var i;if(e.target.checked)for(var a=0,t=[this._lastValue,null===(s=this.schema.description)||void 0===s?void 0:s.suggested_value,this.schema.default,0];a<t.length;a++){var s,d=t[a];if(void 0!==d){i=d;break}}else this._lastValue=this.data;(0,k.r)(this,"value-changed",{value:i})}},{kind:"method",key:"_valueChanged",value:function(e){var i,a=e.target,t=a.value;if(""!==t&&(i=parseInt(String(t))),this.data!==i)(0,k.r)(this,"value-changed",{value:i});else{var s=void 0===i?"":String(i);a.value!==s&&(a.value=s)}}},{kind:"get",static:!0,key:"styles",value:function(){return(0,m.AH)(r||(r=(0,n.A)([":host([own-margin]){margin-bottom:5px}.flex{display:flex}ha-slider{flex:1}ha-textfield{display:block}"])))}}]}}),m.WF))},29906:function(e,i,a){var t,s=a(64599),d=a(41981),l=a(35806),r=a(71008),n=a(62193),h=a(2816),o=a(27927),u=a(14562),c=a(19867),v=(a(81027),a(75609)),m=a(66360),f=a(29818),k=a(61582);(0,o.A)([(0,f.EM)("ha-slider")],(function(e,i){var a=function(i){function a(){var i;(0,r.A)(this,a);for(var t=arguments.length,s=new Array(t),d=0;d<t;d++)s[d]=arguments[d];return i=(0,n.A)(this,a,[].concat(s)),e(i),i}return(0,h.A)(a,i),(0,l.A)(a)}(i);return{F:a,d:[{kind:"method",key:"connectedCallback",value:function(){(0,u.A)((0,c.A)(a.prototype),"connectedCallback",this).call(this),this.dir=k.G.document.dir}},{kind:"field",static:!0,key:"styles",value:function(){return[].concat((0,d.A)((0,u.A)((0,c.A)(a),"styles",this)),[(0,m.AH)(t||(t=(0,s.A)([":host{--md-sys-color-primary:var(--primary-color);--md-sys-color-on-primary:var(--text-primary-color);--md-sys-color-outline:var(--outline-color);--md-sys-color-on-surface:var(--primary-text-color);--md-slider-handle-width:14px;--md-slider-handle-height:14px;min-width:100px;min-inline-size:100px;width:200px}"])))])}}]}}),v.$)}}]);
//# sourceMappingURL=2361.3kdA4FPIc3o.js.map