export const ids=["1442"];export const modules={9643:function(e,t,r){r.r(t),r.d(t,{HaQrCode:function(){return c}});var a=r(44249),i=r(72621),o=(r(13334),r(57243)),s=r(50778),d=r(54647),n=(r(17949),r(91635));let c=(0,a.Z)([(0,s.Mo)("ha-qr-code")],(function(e,t){class r extends t{constructor(...t){super(...t),e(this)}}return{F:r,d:[{kind:"field",decorators:[(0,s.Cb)()],key:"data",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"error-correction-level"})],key:"errorCorrectionLevel",value:()=>"medium"},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"width",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"scale",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"margin",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({attribute:!1,type:Number})],key:"maskPattern",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"center-image"})],key:"centerImage",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,s.IO)("canvas")],key:"_canvas",value:void 0},{kind:"method",key:"willUpdate",value:function(e){(0,i.Z)(r,"willUpdate",this,3)([e]),(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel"))&&this._error&&(this._error=void 0)}},{kind:"method",key:"updated",value:function(e){const t=this._canvas;if(t&&this.data&&(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel")||e.has("centerImage"))){const e=getComputedStyle(this),r=e.getPropertyValue("--rgb-primary-text-color"),a=e.getPropertyValue("--rgb-card-background-color"),i=(0,n.CO)(r.split(",").map((e=>parseInt(e,10)))),o=(0,n.CO)(a.split(",").map((e=>parseInt(e,10))));if(d.toCanvas(t,this.data,{errorCorrectionLevel:this.errorCorrectionLevel||(this.centerImage?"Q":"M"),width:this.width,scale:this.scale,margin:this.margin,maskPattern:this.maskPattern,color:{light:o,dark:i}}).catch((e=>{this._error=e.message})),this.centerImage){const e=this._canvas.getContext("2d"),r=new Image;r.src=this.centerImage,r.onload=()=>{e?.drawImage(r,.375*t.width,.375*t.height,t.width/4,t.height/4)}}}}},{kind:"method",key:"render",value:function(){return this.data?this._error?o.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.dy`<canvas></canvas>`:o.Ld}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{display:block}`}]}}),o.oi)}};
//# sourceMappingURL=1442.6784f9eadbf15d0e.js.map