"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[16052],{24031:function(e,t,r){r.a(e,async function(e,i){try{r.r(t);var s,o,n=r(36854),a=r(98117),u=r(28430),h=r(97058),p=r(57567),c=r(25979),_=r(12463),v=r(16472),d=r(92297),w=(r(28706),r(26099),r(3362),r(15697)),f=r(57527),l=r(51209),b=r(69065),y=r(57385),g=r(57230),k=r(148),C=r(88457),A=e([y,C]);[y,C]=A.then?(await A)():A;var m=function(e){function t(){var e;(0,p.A)(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return(e=(0,v.A)(this,t,[].concat(i)))._setPreview=function(t){var r;if(t.error)return e._error=t.error,void(e._preview=void 0);var i=(new Date).toISOString();e._preview=(0,h.A)({entity_id:"".concat(null!==(r=t.domain)&&void 0!==r?r:e.stepId,".___flow_preview___"),last_changed:i,last_updated:i,context:{id:"",parent_id:null,user_id:null}},t)},e._debouncedSubscribePreview=(0,g.s)(function(){e._subscribePreview()},250),e}return(0,_.A)(t,e),(0,c.A)(t,[{key:"disconnectedCallback",value:function(){(0,d.A)(t,"disconnectedCallback",this,3)([]),this._unsub&&(this._unsub.then(function(e){return e()}),this._unsub=void 0)}},{key:"willUpdate",value:function(e){e.has("stepData")&&this._debouncedSubscribePreview()}},{key:"render",value:function(){return this._error?(0,f.qy)(s||(s=(0,u.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error):(0,f.qy)(o||(o=(0,u.A)(["<entity-preview-row .hass="," .stateObj=","></entity-preview-row>"])),this.hass,this._preview)}},{key:"_subscribePreview",value:(r=(0,a.A)((0,n.A)().m(function e(){var t;return(0,n.A)().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._unsub){e.n=2;break}return e.n=1,this._unsub;case 1:(0,e.v)(),this._unsub=void 0;case 2:if("config_flow"===this.flowType||"options_flow"===this.flowType||"config_subentries_flow"===this.flowType||"repair_flow"===this.flowType){e.n=3;break}return e.a(2);case 3:return this._error=void 0,e.p=4,this._unsub=(0,b.Q)(this.hass,this.domain,this.flowId,this.flowType,this.stepData,this._setPreview),e.n=5,this._unsub;case 5:(0,k.r)(this,"set-flow-errors",{errors:{}}),e.n=7;break;case 6:e.p=6,"string"==typeof(t=e.v).message?this._error=t.message:(this._error=void 0,(0,k.r)(this,"set-flow-errors",t.message)),this._unsub=void 0,this._preview=void 0;case 7:return e.a(2)}},e,this,[[4,6]])})),function(){return r.apply(this,arguments)})}]);var r}(f.WF);(0,w.Cg)([(0,l.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,w.Cg)([(0,l.MZ)({attribute:!1})],m.prototype,"flowType",void 0),(0,w.Cg)([(0,l.MZ)()],m.prototype,"domain",void 0),(0,w.Cg)([(0,l.MZ)({attribute:!1})],m.prototype,"stepId",void 0),(0,w.Cg)([(0,l.MZ)({attribute:!1})],m.prototype,"flowId",void 0),(0,w.Cg)([(0,l.MZ)({attribute:!1})],m.prototype,"stepData",void 0),(0,w.Cg)([(0,l.wk)()],m.prototype,"_preview",void 0),(0,w.Cg)([(0,l.wk)()],m.prototype,"_error",void 0),m=(0,w.Cg)([(0,l.EM)("flow-preview-generic")],m),r.d(t,{FlowPreviewGeneric:function(){return m}}),i()}catch(M){i(M)}})}}]);
//# sourceMappingURL=16052.63e42b54dc316006.js.map