"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[91662],{24031:function(e,r,t){t.a(e,async function(e,i){try{t.r(r);var s,n,o=t(36854),a=t(98117),u=t(28430),h=t(97058),l=t(57567),p=t(25979),c=t(12463),v=t(16472),d=t(92297),_=(t(28706),t(26099),t(3362),t(15697)),w=t(57527),f=t(51209),y=t(69065),b=t(57385),g=t(57230),A=t(148),k=t(88457),m=e([b,k]);[b,k]=m.then?(await m)():m;var C=function(e){function r(){var e;(0,l.A)(this,r);for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return(e=(0,v.A)(this,r,[].concat(i)))._setPreview=function(r){var t;if(r.error)return e._error=r.error,void(e._preview=void 0);var i=(new Date).toISOString();e._preview=(0,h.A)({entity_id:"".concat(null!==(t=r.domain)&&void 0!==t?t:e.stepId,".___flow_preview___"),last_changed:i,last_updated:i,context:{id:"",parent_id:null,user_id:null}},r)},e._debouncedSubscribePreview=(0,g.s)(function(){e._subscribePreview()},250),e}return(0,c.A)(r,e),(0,p.A)(r,[{key:"disconnectedCallback",value:function(){(0,d.A)(r,"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,w.qy)(s||(s=(0,u.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error):(0,w.qy)(n||(n=(0,u.A)(["<entity-preview-row .hass="," .stateObj=","></entity-preview-row>"])),this.hass,this._preview)}},{key:"_subscribePreview",value:(t=(0,a.A)((0,o.A)().m(function e(){var r;return(0,o.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,y.Q)(this.hass,this.domain,this.flowId,this.flowType,this.stepData,this._setPreview),e.n=5,this._unsub;case 5:(0,A.r)(this,"set-flow-errors",{errors:{}}),e.n=7;break;case 6:e.p=6,"string"==typeof(r=e.v).message?this._error=r.message:(this._error=void 0,(0,A.r)(this,"set-flow-errors",r.message)),this._unsub=void 0,this._preview=void 0;case 7:return e.a(2)}},e,this,[[4,6]])})),function(){return t.apply(this,arguments)})}]);var t}(w.WF);(0,_.Cg)([(0,f.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,_.Cg)([(0,f.MZ)({attribute:!1})],C.prototype,"flowType",void 0),(0,_.Cg)([(0,f.MZ)()],C.prototype,"domain",void 0),(0,_.Cg)([(0,f.MZ)({attribute:!1})],C.prototype,"stepId",void 0),(0,_.Cg)([(0,f.MZ)({attribute:!1})],C.prototype,"flowId",void 0),(0,_.Cg)([(0,f.MZ)({attribute:!1})],C.prototype,"stepData",void 0),(0,_.Cg)([(0,f.wk)()],C.prototype,"_preview",void 0),(0,_.Cg)([(0,f.wk)()],C.prototype,"_error",void 0),C=(0,_.Cg)([(0,f.EM)("flow-preview-generic")],C),t.d(r,{FlowPreviewGeneric:function(){return C}}),i()}catch(M){i(M)}})},83101:function(e,r,t){t.a(e,async function(e,i){try{t.r(r);var s,n,o,a,u=t(28430),h=t(57567),l=t(25979),p=t(12463),c=t(16472),v=t(15697),d=t(57527),_=t(51209),w=t(24031),f=t(7598),y=t(15466),b=e([f,y,w]);[f,y,w]=b.then?(await b)():b;var g=function(e){function r(){return(0,h.A)(this,r),(0,c.A)(this,r,arguments)}return(0,p.A)(r,e),(0,l.A)(r,[{key:"render",value:function(){if(!this._preview)return d.s6;if(this._error)return(0,d.qy)(s||(s=(0,u.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error);var e=this._preview.attributes.still_url,r=this._preview.attributes.stream_url;return(0,d.qy)(n||(n=(0,u.A)([" "," ",""])),e?(0,d.qy)(o||(o=(0,u.A)(["<p>Still image:</p> <p> <img src=",' alt="Still preview"/> </p>'])),e):"",r?(0,d.qy)(a||(a=(0,u.A)(['<p>Stream:</p> <ha-spinner class="render-spinner" id="hls-load-spinner" size="large"></ha-spinner> <ha-hls-player autoplay playsinline .hass='," .url="," @load=","></ha-hls-player>"])),this.hass,r,this._videoLoaded):"")}},{key:"_videoLoaded",value:function(){var e;null===(e=this.shadowRoot.getElementById("hls-load-spinner"))||void 0===e||e.remove()}}])}(w.FlowPreviewGeneric);g=(0,v.Cg)([(0,_.EM)("flow-preview-generic_camera")],g),i()}catch(A){i(A)}})}}]);
//# sourceMappingURL=91662.bc21988a58f7a933.js.map