"use strict";(self.webpackChunkknx_frontend=self.webpackChunkknx_frontend||[]).push([[1100],{61100:function(e,t,i){i.r(t);var r,n,s=i(94881),o=i(1781),a=i(6238),d=i(36683),u=i(89231),l=i(29864),c=i(83647),v=i(8364),h=i(27526),f=(i(77052),i(43859),i(98597)),k=i(196),_=i(64656),w=(i(98498),i(11355)),p=i(33167);(0,v.A)([(0,k.EM)("flow-preview-generic")],(function(e,t){var i,v=function(t){function i(){var t;(0,u.A)(this,i);for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t=(0,l.A)(this,i,[].concat(n)),e(t),t}return(0,c.A)(i,t),(0,d.A)(i)}(t);return{F:v,d:[{kind:"field",decorators:[(0,k.MZ)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,k.MZ)()],key:"flowType",value:void 0},{kind:"field",key:"handler",value:void 0},{kind:"field",decorators:[(0,k.MZ)()],key:"domain",value:void 0},{kind:"field",decorators:[(0,k.MZ)()],key:"stepId",value:void 0},{kind:"field",decorators:[(0,k.MZ)()],key:"flowId",value:void 0},{kind:"field",decorators:[(0,k.MZ)()],key:"stepData",value:void 0},{kind:"field",decorators:[(0,k.wk)()],key:"_preview",value:void 0},{kind:"field",decorators:[(0,k.wk)()],key:"_error",value:void 0},{kind:"field",key:"_unsub",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){(0,h.A)(v,"disconnectedCallback",this,3)([]),this._unsub&&(this._unsub.then((function(e){return e()})),this._unsub=void 0)}},{kind:"method",key:"willUpdate",value:function(e){e.has("stepData")&&this._debouncedSubscribePreview()}},{kind:"method",key:"render",value:function(){return this._error?(0,f.qy)(r||(r=(0,a.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error):(0,f.qy)(n||(n=(0,a.A)(["<entity-preview-row\n      .hass=","\n      .stateObj=","\n    ></entity-preview-row>"])),this.hass,this._preview)}},{kind:"field",key:"_setPreview",value:function(){var e=this;return function(t){var i=(new Date).toISOString();e._preview=Object.assign({entity_id:"".concat(e.stepId,".___flow_preview___"),last_changed:i,last_updated:i,context:{id:"",parent_id:null,user_id:null}},t)}}},{kind:"field",key:"_debouncedSubscribePreview",value:function(){var e=this;return(0,w.s)((function(){e._subscribePreview()}),250)}},{kind:"method",key:"_subscribePreview",value:(i=(0,o.A)((0,s.A)().mark((function e(){return(0,s.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._unsub){e.next=6;break}return e.next=3,this._unsub;case 3:e.t0=e.sent,(0,e.t0)(),this._unsub=void 0;case 6:if("repair_flow"!==this.flowType){e.next=8;break}return e.abrupt("return");case 8:try{this._unsub=(0,_.Q)(this.hass,this.domain,this.flowId,this.flowType,this.stepData,this._setPreview),(0,p.r)(this,"set-flow-errors",{errors:{}})}catch(t){"string"==typeof t.message?this._error=t.message:(this._error=void 0,(0,p.r)(this,"set-flow-errors",t.message)),this._unsub=void 0,this._preview=void 0}case 9:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]}}),f.WF)}}]);