import{r as M,g as j}from"./qrcode-6dENlXT4.js";function U(c,g){for(var a=0;a<g.length;a++){const e=g[a];if(typeof e!="string"&&!Array.isArray(e)){for(const n in e)if(n!=="default"&&!(n in c)){const r=Object.getOwnPropertyDescriptor(e,n);r&&Object.defineProperty(c,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var w={},p,v;function D(){return v||(v=1,p=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),p}var C={},b={},T;function P(){return T||(T=1,(function(c){function g(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let e=a.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+a);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(r){return[r,r]}))),e.length===6&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+e.slice(0,6).join("")}}c.getOptions=function(e){e||(e={}),e.color||(e.color={});const n=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,t=e.scale||4;return{width:r,scale:r?4:t,margin:n,color:{dark:g(e.color.dark||"#000000ff"),light:g(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},c.getScale=function(e,n){return n.width&&n.width>=e+n.margin*2?n.width/(e+n.margin*2):n.scale},c.getImageWidth=function(e,n){const r=c.getScale(e,n);return Math.floor((e+n.margin*2)*r)},c.qrToImageData=function(e,n,r){const t=n.modules.size,i=n.modules.data,o=c.getScale(t,r),f=Math.floor((t+r.margin*2)*o),u=r.margin*o,l=[r.color.light,r.color.dark];for(let d=0;d<f;d++)for(let s=0;s<f;s++){let m=(d*f+s)*4,h=r.color.light;if(d>=u&&s>=u&&d<f-u&&s<f-u){const y=Math.floor((d-u)/o),I=Math.floor((s-u)/o);h=l[i[y*t+I]?1:0]}e[m++]=h.r,e[m++]=h.g,e[m++]=h.b,e[m]=h.a}}})(b)),b}var q;function k(){return q||(q=1,(function(c){const g=P();function a(n,r,t){n.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=t,r.width=t,r.style.height=t+"px",r.style.width=t+"px"}function e(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}c.render=function(r,t,i){let o=i,f=t;typeof o>"u"&&(!t||!t.getContext)&&(o=t,t=void 0),t||(f=e()),o=g.getOptions(o);const u=g.getImageWidth(r.modules.size,o),l=f.getContext("2d"),d=l.createImageData(u,u);return g.qrToImageData(d.data,r,o),a(l,f,u),l.putImageData(d,0,0),f},c.renderToDataURL=function(r,t,i){let o=i;typeof o>"u"&&(!t||!t.getContext)&&(o=t,t=void 0),o||(o={});const f=c.render(r,t,o),u=o.type||"image/png",l=o.rendererOpts||{};return f.toDataURL(u,l.quality)}})(C)),C}var R={},E;function L(){if(E)return R;E=1;const c=P();function g(n,r){const t=n.a/255,i=r+'="'+n.hex+'"';return t<1?i+" "+r+'-opacity="'+t.toFixed(2).slice(1)+'"':i}function a(n,r,t){let i=n+r;return typeof t<"u"&&(i+=" "+t),i}function e(n,r,t){let i="",o=0,f=!1,u=0;for(let l=0;l<n.length;l++){const d=Math.floor(l%r),s=Math.floor(l/r);!d&&!f&&(f=!0),n[l]?(u++,l>0&&d>0&&n[l-1]||(i+=f?a("M",d+t,.5+s+t):a("m",o,0),o=0,f=!1),d+1<r&&n[l+1]||(i+=a("h",u),u=0)):o++}return i}return R.render=function(r,t,i){const o=c.getOptions(t),f=r.modules.size,u=r.modules.data,l=f+o.margin*2,d=o.color.light.a?"<path "+g(o.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",s="<path "+g(o.color.dark,"stroke")+' d="'+e(u,f,o.margin)+'"/>',m='viewBox="0 0 '+l+" "+l+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+m+' shape-rendering="crispEdges">'+d+s+`</svg>
`;return typeof i=="function"&&i(null,y),y},R}var O;function _(){if(O)return w;O=1;const c=D(),g=M(),a=k(),e=L();function n(r,t,i,o,f){const u=[].slice.call(arguments,1),l=u.length,d=typeof u[l-1]=="function";if(!d&&!c())throw new Error("Callback required as last argument");if(d){if(l<2)throw new Error("Too few arguments provided");l===2?(f=i,i=t,t=o=void 0):l===3&&(t.getContext&&typeof f>"u"?(f=o,o=void 0):(f=o,o=i,i=t,t=void 0))}else{if(l<1)throw new Error("Too few arguments provided");return l===1?(i=t,t=o=void 0):l===2&&!t.getContext&&(o=i,i=t,t=void 0),new Promise(function(s,m){try{const h=g.create(i,o);s(r(h,t,o))}catch(h){m(h)}})}try{const s=g.create(i,o);f(null,r(s,t,o))}catch(s){f(s)}}return w.create=g.create,w.toCanvas=n.bind(null,a.render),w.toDataURL=n.bind(null,a.renderToDataURL),w.toString=n.bind(null,function(r,t,i){return e.render(r,i)}),w}var S=_();const A=j(S),x=U({__proto__:null,default:A},[S]);export{x as b};
