import{qr_code_styles_default as r}from"./chunk.4XPIAYA2.js";import{watch as t}from"./chunk.C7FWPEOY.js";import{ShoelaceElement as e}from"./chunk.Z7XDKKOD.js";import{__decorateClass as i}from"./chunk.6M63UXML.js";import{html as o}from"../../../../lit/index.js";import{property as s,query as a}from"../../../../lit/decorators.js";import{styleMap as l}from"../../../../lit/directives/style-map.js";import p from"../../../../qr-creator/dist/qr-creator.es6.min.js";var c=class extends e{constructor(){super(...arguments),this.value="",this.label="",this.size=128,this.fill="black",this.background="white",this.radius=0,this.errorCorrection="H"}firstUpdated(){this.generate()}generate(){this.hasUpdated&&p.render({text:this.value,radius:this.radius,ecLevel:this.errorCorrection,fill:this.fill,background:this.background,size:2*this.size},this.canvas)}render(){var r;return o`
      <canvas
        part="base"
        class="qr-code"
        role="img"
        aria-label=${(null==(r=this.label)?void 0:r.length)>0?this.label:this.value}
        style=${l({width:`${this.size}px`,height:`${this.size}px`})}
      ></canvas>
    `}};c.styles=r,i([a("canvas")],c.prototype,"canvas",2),i([s()],c.prototype,"value",2),i([s()],c.prototype,"label",2),i([s({type:Number})],c.prototype,"size",2),i([s()],c.prototype,"fill",2),i([s()],c.prototype,"background",2),i([s({type:Number})],c.prototype,"radius",2),i([s({attribute:"error-correction"})],c.prototype,"errorCorrection",2),i([t(["background","errorCorrection","fill","radius","size","value"])],c.prototype,"generate",1);export{c as SlQrCode};