import{F as tt,v as et}from"./CJ3Pvzvs.js";import{g as y,U as nt,u as j,J as C,i as U,E as rt,L as ot,V as st,r as T,d as it,M as ct,H as at}from"./3LwgCWkS.js";function lt(e){return typeof e=="function"?e():j(e)}function ut(e){if(!C(e))return U(e);const n=new Proxy({},{get(t,r,o){return j(Reflect.get(e.value,r,o))},set(t,r,o){return C(e.value[r])&&!C(o)?e.value[r].value=o:e.value[r]=o,!0},deleteProperty(t,r){return Reflect.deleteProperty(e.value,r)},has(t,r){return Reflect.has(e.value,r)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return U(n)}function ft(e){return ut(y(e))}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ht=()=>{};function $t(...e){if(e.length!==1)return rt(...e);const n=e[0];return typeof n=="function"?ot(st(()=>({get:n,set:ht}))):T(n)}function dt(e,...n){const t=n.flat(),r=t[0];return ft(()=>Object.fromEntries(typeof r=="function"?Object.entries(nt(e)).filter(([o,s])=>r(lt(s),o)):t.map(o=>[o,$t(e,o)])))}var w=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(w||{}),mt=Object.defineProperty,pt=(e,n,t)=>n in e?mt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,R=(e,n,t)=>(pt(e,typeof n!="symbol"?n+"":n,t),t);const gt=[0,1],H=[1,0],Y=[2,3],G=[3,2],Mt={L:gt,M:H,Q:Y,H:G},Pt=/^[0-9]*$/,wt=/^[A-Z0-9 $%*+.\/:-]*$/,v="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",N=1,F=40,S=3,Et=3,b=40,Rt=10,X=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Z=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class bt{constructor(n,t,r,o){if(this.version=n,this.ecc=t,R(this,"size"),R(this,"mask"),R(this,"modules",[]),R(this,"types",[]),n<N||n>F)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=n*4+17;const s=Array.from({length:this.size},()=>!1);for(let l=0;l<this.size;l++)this.modules.push(s.slice()),this.types.push(s.map(()=>0));this.drawFunctionPatterns();const i=this.addEccAndInterleave(r);if(this.drawCodewords(i),o===-1){let l=1e9;for(let c=0;c<8;c++){this.applyMask(c),this.drawFormatBits(c);const a=this.getPenaltyScore();a<l&&(o=c,l=a),this.applyMask(c)}}this.mask=o,this.applyMask(o),this.drawFormatBits(o)}getModule(n,t){return n>=0&&n<this.size&&t>=0&&t<this.size&&this.modules[t][n]}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2===0,w.Timing),this.setFunctionModule(r,6,r%2===0,w.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const n=this.getAlignmentPatternPositions(),t=n.length;for(let r=0;r<t;r++)for(let o=0;o<t;o++)r===0&&o===0||r===0&&o===t-1||r===t-1&&o===0||this.drawAlignmentPattern(n[r],n[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(n){const t=this.ecc[1]<<3|n;let r=t;for(let s=0;s<10;s++)r=r<<1^(r>>>9)*1335;const o=(t<<10|r)^21522;for(let s=0;s<=5;s++)this.setFunctionModule(8,s,M(o,s));this.setFunctionModule(8,7,M(o,6)),this.setFunctionModule(8,8,M(o,7)),this.setFunctionModule(7,8,M(o,8));for(let s=9;s<15;s++)this.setFunctionModule(14-s,8,M(o,s));for(let s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,M(o,s));for(let s=8;s<15;s++)this.setFunctionModule(8,this.size-15+s,M(o,s));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let n=this.version;for(let r=0;r<12;r++)n=n<<1^(n>>>11)*7973;const t=this.version<<12|n;for(let r=0;r<18;r++){const o=M(t,r),s=this.size-11+r%3,i=Math.floor(r/3);this.setFunctionModule(s,i,o),this.setFunctionModule(i,s,o)}}drawFinderPattern(n,t){for(let r=-4;r<=4;r++)for(let o=-4;o<=4;o++){const s=Math.max(Math.abs(o),Math.abs(r)),i=n+o,l=t+r;i>=0&&i<this.size&&l>=0&&l<this.size&&this.setFunctionModule(i,l,s!==2&&s!==4,w.Position)}}drawAlignmentPattern(n,t){for(let r=-2;r<=2;r++)for(let o=-2;o<=2;o++)this.setFunctionModule(n+o,t+r,Math.max(Math.abs(o),Math.abs(r))!==1,w.Alignment)}setFunctionModule(n,t,r,o=w.Function){this.modules[t][n]=r,this.types[t][n]=o}addEccAndInterleave(n){const t=this.version,r=this.ecc;if(n.length!==k(t,r))throw new RangeError("Invalid argument");const o=Z[r[0]][t],s=X[r[0]][t],i=Math.floor(_(t)/8),l=o-i%o,c=Math.floor(i/o),a=[],u=Ot(s);for(let f=0,$=0;f<o;f++){const d=n.slice($,$+c-s+(f<l?0:1));$+=d.length;const m=Bt(d,u);f<l&&d.push(0),a.push(d.concat(m))}const h=[];for(let f=0;f<a[0].length;f++)a.forEach(($,d)=>{(f!==c-s||d>=l)&&h.push($[f])});return h}drawCodewords(n){if(n.length!==Math.floor(_(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let r=this.size-1;r>=1;r-=2){r===6&&(r=5);for(let o=0;o<this.size;o++)for(let s=0;s<2;s++){const i=r-s,c=(r+1&2)===0?this.size-1-o:o;!this.types[c][i]&&t<n.length*8&&(this.modules[c][i]=M(n[t>>>3],7-(t&7)),t++)}}}applyMask(n){if(n<0||n>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let o;switch(n){case 0:o=(r+t)%2===0;break;case 1:o=t%2===0;break;case 2:o=r%3===0;break;case 3:o=(r+t)%3===0;break;case 4:o=(Math.floor(r/3)+Math.floor(t/2))%2===0;break;case 5:o=r*t%2+r*t%3===0;break;case 6:o=(r*t%2+r*t%3)%2===0;break;case 7:o=((r+t)%2+r*t%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[t][r]&&o&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let n=0;for(let s=0;s<this.size;s++){let i=!1,l=0;const c=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[s][a]===i?(l++,l===5?n+=S:l>5&&n++):(this.finderPenaltyAddHistory(l,c),i||(n+=this.finderPenaltyCountPatterns(c)*b),i=this.modules[s][a],l=1);n+=this.finderPenaltyTerminateAndCount(i,l,c)*b}for(let s=0;s<this.size;s++){let i=!1,l=0;const c=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][s]===i?(l++,l===5?n+=S:l>5&&n++):(this.finderPenaltyAddHistory(l,c),i||(n+=this.finderPenaltyCountPatterns(c)*b),i=this.modules[a][s],l=1);n+=this.finderPenaltyTerminateAndCount(i,l,c)*b}for(let s=0;s<this.size-1;s++)for(let i=0;i<this.size-1;i++){const l=this.modules[s][i];l===this.modules[s][i+1]&&l===this.modules[s+1][i]&&l===this.modules[s+1][i+1]&&(n+=Et)}let t=0;for(const s of this.modules)t=s.reduce((i,l)=>i+(l?1:0),t);const r=this.size*this.size,o=Math.ceil(Math.abs(t*20-r*10)/r)-1;return n+=o*Rt,n}getAlignmentPatternPositions(){if(this.version===1)return[];{const n=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(n*2-2))*2,r=[6];for(let o=this.size-7;r.length<n;o-=t)r.splice(1,0,o);return r}}finderPenaltyCountPatterns(n){const t=n[1],r=t>0&&n[2]===t&&n[3]===t*3&&n[4]===t&&n[5]===t;return(r&&n[0]>=t*4&&n[6]>=t?1:0)+(r&&n[6]>=t*4&&n[0]>=t?1:0)}finderPenaltyTerminateAndCount(n,t,r){return n&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(n,t){t[0]===0&&(n+=this.size),t.pop(),t.unshift(n)}}function P(e,n,t){if(n<0||n>31||e>>>n)throw new RangeError("Value out of range");for(let r=n-1;r>=0;r--)t.push(e>>>r&1)}function M(e,n){return(e>>>n&1)!==0}class O{constructor(n,t,r){if(this.mode=n,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}getData(){return this.bitData.slice()}}const kt=[1,10,12,14],At=[2,9,11,13],Ct=[4,8,16,16];function K(e,n){return e[Math.floor((n+7)/17)+1]}function W(e){const n=[];for(const t of e)P(t,8,n);return new O(Ct,e.length,n)}function vt(e){if(!J(e))throw new RangeError("String contains non-numeric characters");const n=[];for(let t=0;t<e.length;){const r=Math.min(e.length-t,3);P(Number.parseInt(e.substring(t,t+r),10),r*3+1,n),t+=r}return new O(kt,e.length,n)}function _t(e){if(!q(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const n=[];let t;for(t=0;t+2<=e.length;t+=2){let r=v.indexOf(e.charAt(t))*45;r+=v.indexOf(e.charAt(t+1)),P(r,11,n)}return t<e.length&&P(v.indexOf(e.charAt(t)),6,n),new O(At,e.length,n)}function It(e){return e===""?[]:J(e)?[vt(e)]:q(e)?[_t(e)]:[W(Ft(e))]}function J(e){return Pt.test(e)}function q(e){return wt.test(e)}function Nt(e,n){let t=0;for(const r of e){const o=K(r.mode,n);if(r.numChars>=1<<o)return Number.POSITIVE_INFINITY;t+=4+o+r.bitData.length}return t}function Ft(e){e=encodeURI(e);const n=[];for(let t=0;t<e.length;t++)e.charAt(t)!=="%"?n.push(e.charCodeAt(t)):(n.push(Number.parseInt(e.substring(t+1,t+3),16)),t+=2);return n}function _(e){if(e<N||e>F)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return n}function k(e,n){return Math.floor(_(e)/8)-X[n[0]][e]*Z[n[0]][e]}function Ot(e){if(e<1||e>255)throw new RangeError("Degree out of range");const n=[];for(let r=0;r<e-1;r++)n.push(0);n.push(1);let t=1;for(let r=0;r<e;r++){for(let o=0;o<n.length;o++)n[o]=I(n[o],t),o+1<n.length&&(n[o]^=n[o+1]);t=I(t,2)}return n}function Bt(e,n){const t=n.map(r=>0);for(const r of e){const o=r^t.shift();t.push(0),n.forEach((s,i)=>t[i]^=I(s,o))}return t}function I(e,n){if(e>>>8||n>>>8)throw new RangeError("Byte out of range");let t=0;for(let r=7;r>=0;r--)t=t<<1^(t>>>7)*285,t^=(n>>>r&1)*e;return t}function Lt(e,n,t=1,r=40,o=-1,s=!0){if(!(N<=t&&t<=r&&r<=F)||o<-1||o>7)throw new RangeError("Invalid value");let i,l;for(i=t;;i++){const h=k(i,n)*8,f=Nt(e,i);if(f<=h){l=f;break}if(i>=r)throw new RangeError("Data too long")}for(const h of[H,Y,G])s&&l<=k(i,h)*8&&(n=h);const c=[];for(const h of e){P(h.mode[0],4,c),P(h.numChars,K(h.mode,i),c);for(const f of h.getData())c.push(f)}const a=k(i,n)*8;P(0,Math.min(4,a-c.length),c),P(0,(8-c.length%8)%8,c);for(let h=236;c.length<a;h^=253)P(h,8,c);const u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((h,f)=>u[f>>>3]|=h<<7-(f&7)),new bt(i,n,u,o)}function Dt(e,n){var h;const{ecc:t="L",boostEcc:r=!1,minVersion:o=1,maxVersion:s=40,maskPattern:i=-1,border:l=1}=n||{},c=typeof e=="string"?It(e):Array.isArray(e)?[W(e)]:void 0;if(!c)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const a=Lt(c,Mt[t],o,s,i,r),u=Vt({version:a.version,maskPattern:a.mask,size:a.size,data:a.modules,types:a.types},l);return n!=null&&n.invert&&(u.data=u.data.map(f=>f.map($=>!$))),(h=n==null?void 0:n.onEncoded)==null||h.call(n,u),u}function Vt(e,n=1){if(!n)return e;const{size:t}=e,r=t+n*2;e.size=r,e.data.forEach(s=>{for(let i=0;i<n;i++)s.unshift(!1),s.push(!1)});for(let s=0;s<n;s++)e.data.unshift(Array.from({length:r},i=>!1)),e.data.push(Array.from({length:r},i=>!1));const o=w.Border;e.types.forEach(s=>{for(let i=0;i<n;i++)s.unshift(o),s.push(o)});for(let s=0;s<n;s++)e.types.unshift(Array.from({length:r},i=>o)),e.types.push(Array.from({length:r},i=>o));return e}function Ut(e){const{whiteColor:n="white",blackColor:t="black",invert:r=!1}=e;return{backgroundColor:r?t:n,foregroundColor:r?n:t}}function Q(e,n=x){return{height:e*n,width:e*n}}function St(e,n=p){const t=typeof e=="number"?e:(e==null?void 0:e.pixel)??n,r=typeof e=="number"?e:(e==null?void 0:e.marker)??n,o=typeof e=="number"?e:(e==null?void 0:e.inner)??r;return{pixelRadius:t,markerRadius:{outer:r,inner:o}}}function yt(e,n="default"){const t=typeof e=="string"?e:(e==null?void 0:e.pixel)||n,r=typeof e=="string"?e:(e==null?void 0:e.marker)||n,o=typeof e=="string"?e:(e==null?void 0:e.inner)||r;return{pixelVariant:t,markerVariant:{outer:r,inner:o}}}function g(e){return Math.max(0,Math.min(1,e))}function E(e,n){const t=e-n,r=7,o=[[n,n],[n,t-r],[t-r,n]],s=(c,a)=>c>=a&&c<a+r;return{isTopLeft:(c,a)=>c<r&&a<r,isTopRight:(c,a)=>c<r&&a>=t-r,isBottomLeft:(c,a)=>c>=t-r&&a<r,isMarker:(c,a)=>o.some(([u,h])=>s(c,u)&&s(a,h)),isMarkerCenter:(c,a)=>o.some(([u,h])=>c>=u+2&&c<=u+4&&a>=h+2&&a<=h+4),markerPositions:o,markerCenterPositions:o.map(([c,a])=>[c+2,a+2])}}const p=.5,B=.1,x=20;function jt(e,n,t,r,o=p,s=B){let i="";const l=g(o),c=g(s),a=c*t/2,u=t-2*a,h=l*u/2;for(let f=0;f<e.size;f++)for(let $=0;$<e.size;$++)if(!E(e.size,n).isMarker(f,$)&&e.data[f][$]){const d=$*t+a,m=f*t+a;i+=A(d,m,u,h,r,c)}return i}function Tt(e,n,t,r,o=p,s=B){let i="";const l=g(o),c=g(s),a=c*t/2,u=t-2*a,h=l*u/2;for(let f=0;f<7;f++)for(let $=0;$<7;$++){if(f>=1&&f<=5&&$>=1&&$<=5)continue;const d=f*t+e+a,m=$*t+n+a;i+=A(d,m,u,h,r,c)}return i}function Ht(e,n,t,r,o=p,s=B){let i="";const l=g(o),c=g(s),a=c*t/2,u=t-2*a,h=l*u/2;for(let f=0;f<3;f++)for(let $=0;$<3;$++){const d=f*t+e+a,m=$*t+n+a;i+=A(d,m,u,h,r,c)}return i}function A(e,n,t,r,o,s=0){const i=e+s,l=n+s,c=t-2*s;return`<rect 
    x="${i}" 
    y="${l}" 
    width="${c}" 
    height="${c}" 
    rx="${r}"
    fill="${o}"
  />`}function Yt(e,n,t,r,o=p){const s=g(o),i=6*t,l=i/2,c=s*l;return`<rect x="${e+t/2}" y="${n+t/2}" width="${i}" height="${i}" rx="${c}" fill="none" stroke="${r}" stroke-width="${t}"/>`}function Gt(e,n,t,r,o=p){const s=g(o),i=t*3;return A(e,n,i,s*i/2,r)}function Xt(e,n,t,r){const o=[];for(let s=0;s<e.size;s++)for(let i=0;i<e.size;i++)if(!E(e.size,n).isMarker(s,i)&&e.data[s][i]){const l=i*t,c=s*t;o.push(`M${l},${c}h${t}v${t}h-${t}z`)}return`<path fill="${r}" d="${o.join("")}" shape-rendering="crispEdges"/>`}function Zt(e,n,t,r){const o=[];return o.push(`M${e},${n}h${7*t}v${7*t}h-${7*t}z M${e+6*t},${n+t}h-${5*t}v${5*t}h${5*t}z`),`<path fill="${r}" d="${o.join("")}"/>`}function Kt(e,n,t,r){return`<rect x="${e}" y="${n}" width="${3*t}" height="${3*t}" fill="${r}"/>`}function Wt(e,n,t,r){const o=t/4,s=[];for(let i=0;i<e.size;i++)for(let l=0;l<e.size;l++)if(!E(e.size,n).isMarker(i,l)&&e.data[i][l]){const c=l*t,a=i*t;s.push(`M${c},${a}h${t}v${t}h-${t}z`),s.push(Qt(e.data,i,l,c,a,t,o))}return`<g shape-rendering="crispEdges">
  <path fill="${r}" d="${s.join("")}"/>
</g>`}function Jt(e,n,t,r){const o=t/4,s=[];return s.push(`M${e},${n}h${7*t}v${7*t}h-${7*t}z M${e+6*t},${n+t}h-${5*t}v${5*t}h${5*t}z M${e+o},${n}h-${o}v${o}h${o}z M${e+7*t},${n}h-${o}v${o}h${o}z M${e},${n+7*t}h${o}v-${o}h-${o}z M${e+7*t-o},${n+7*t}h${o}v-${o}h-${o}z`),`<g shape-rendering="crispEdges">
  <path fill="${r}" d="${s.join("")}"/>
</g>`}function qt(e,n,t,r){const o=t/4,s=[];return s.push(`M${e},${n}h${3*t}v${3*t}h-${3*t}z M${e+o},${n}h-${o}v${o}h${o}z M${e+3*t},${n}h-${o}v${o}h${o}z M${e},${n+3*t}h${o}v-${o}h-${o}z M${e+3*t-o},${n+3*t}h${o}v-${o}h-${o}z`),`<g shape-rendering="crispEdges">
  <path fill="${r}" d="${s.join("")}"/>
</g>`}function Qt(e,n,t,r,o,s,i){const l=(a,u)=>a<0||a>=e.length||u<0||u>=e[0].length?!1:e[a][u];let c="";return!l(n-1,t)&&!l(n,t-1)&&(c+=`M${r+i},${o}h-${i}v${i}h${i}v-${i}z`),!l(n-1,t)&&!l(n,t+1)&&(c+=`M${r+i*2},${o}h${i}v${i}h${i}v-${i}z`),!l(n+0,t+1)&&!l(n+1,t+0)&&(c+=`M${r+s},${o+s-i}h-${i}v${i}h${i}v-${i}z`),!l(n+1,t)&&!l(n+0,t-1)&&(c+=`M${r+i},${o+s-i}h-${i}v${i}h${i}v-${i}z`),c}function xt(e,n,t,r,o=p){const s=[],i=Array(e.size).fill(null).map(()=>Array(e.size).fill(!1)),c=g(o)*t/2;for(let a=0;a<e.size;a++)for(let u=0;u<e.size;u++)!E(e.size,n).isMarker(a,u)&&e.data[a][u]&&!i[a][u]&&s.push(ee(e.data,i,a,u,t,c));return`<path fill="${r}" d="${s.join(" ")}"/>`}function zt(e,n,t,r,o=p){const i=g(o)*t/2,l=z(e,n,7*t,7*t,i),c=re(e+t,n+t,5*t,5*t,i);return`<path fill="${r}" d="${l} ${c}"/>`}function te(e,n,t,r,o=p){const i=g(o)*t/2,l=z(e,n,3*t,3*t,i);return`<path fill="${r}" d="${l}"/>`}function ee(e,n,t,r,o,s){const i=[],l=[[t,r]];for(;l.length>0;){const[c,a]=l.pop();if(c<0||c>=e.length||a<0||a>=e[0].length||!e[c][a]||n[c][a])continue;n[c][a]=!0;const u=a*o,h=c*o,f=c>0&&e[c-1][a],$=a<e[0].length-1&&e[c][a+1],d=c<e.length-1&&e[c+1][a],m=a>0&&e[c][a-1];i.push(ne(u,h,o,s,{top:f,right:$,bottom:d,left:m})),l.push([c-1,a],[c,a+1],[c+1,a],[c,a-1])}return i.join(" ")}function ne(e,n,t,r=p,{top:o,right:s,bottom:i,left:l}){const c=[],a=Math.min(r,t/2),u=a*(4/3)*Math.tan(Math.PI/8);return!l&&!o?(c.push(`M${e},${n+a}`),c.push(`C${e},${n+a-u} ${e+a-u},${n} ${e+a},${n}`)):c.push(`M${e},${n}`),!o&&!s?(c.push(`L${e+t-a},${n}`),c.push(`C${e+t-a+u},${n} ${e+t},${n+a-u} ${e+t},${n+a}`)):c.push(`L${e+t},${n}`),!s&&!i?(c.push(`L${e+t},${n+t-a}`),c.push(`C${e+t},${n+t-a+u} ${e+t-a+u},${n+t} ${e+t-a},${n+t}`)):c.push(`L${e+t},${n+t}`),!i&&!l?(c.push(`L${e+a},${n+t}`),c.push(`C${e+a-u},${n+t} ${e},${n+t-a+u} ${e},${n+t-a}`)):c.push(`L${e},${n+t}`),c.push("Z"),c.join(" ")}function z(e,n,t,r,o=p){const s=Math.min(o,Math.min(t,r)/2),i=s*(4/3)*Math.tan(Math.PI/8);return[`M${e+s},${n}`,`H${e+t-s}`,`C${e+t-s+i},${n} ${e+t},${n+s-i} ${e+t},${n+s}`,`V${n+r-s}`,`C${e+t},${n+r-s+i} ${e+t-s+i},${n+r} ${e+t-s},${n+r}`,`H${e+s}`,`C${e+s-i},${n+r} ${e},${n+r-s+i} ${e},${n+r-s}`,`V${n+s}`,`C${e},${n+s-i} ${e+s-i},${n} ${e+s},${n}`,"Z"].join(" ")}function re(e,n,t,r,o=p){const s=Math.min(o,Math.min(t,r)/2),i=s*(4/3)*Math.tan(Math.PI/8);return[`M${e+t-s},${n}`,`H${e+s}`,`C${e+s-i},${n} ${e},${n+s-i} ${e},${n+s}`,`V${n+r-s}`,`C${e},${n+r-s+i} ${e+s-i},${n+r} ${e+s},${n+r}`,`H${e+t-s}`,`C${e+t-s+i},${n+r} ${e+t},${n+r-s+i} ${e+t},${n+r-s}`,`V${n+s}`,`C${e+t},${n+s-i} ${e+t-s+i},${n} ${e+t-s},${n}`,"Z"].join(" ")}function oe(e,n=1,t,r,o,s,i){const{markerPositions:l}=E(e.size,n);let c="";return l.forEach(([a,u])=>{const h=u*t,f=a*t,$=h+2*t,d=f+2*t;c+=se(o.outer,h,f,t,r,s==null?void 0:s.outer,i),c+=ie(o.inner,$,d,t,r,s==null?void 0:s.inner,i)}),c}function se(e="default",n,t,r,o,s,i){switch(e){case"dots":return Tt(n,t,r,o,s,i);case"circle":return Yt(n,t,r,o,s);case"rounded":return zt(n,t,r,o,s);case"pixelated":return Jt(n,t,r,o);case"default":default:return Zt(n,t,r,o)}}function ie(e="default",n,t,r,o,s,i){switch(e){case"dots":return Ht(n,t,r,o,s,i);case"circle":return Gt(n,t,r,o,s);case"rounded":return te(n,t,r,o,s);case"pixelated":return qt(n,t,r,o);case"default":default:return Kt(n,t,r,o)}}function ce(e,n=1,t,r,o="default",s,i){switch(o){case"circle":case"dots":return jt(e,n,t,r,s,i);case"rounded":return xt(e,n,t,r,s);case"pixelated":return Wt(e,n,t,r);case"default":default:return Xt(e,n,t,r)}}function ae(e,n={}){const{radius:t,pixelSize:r=x,pixelPadding:o,variant:s,border:i}=n,{backgroundColor:l,foregroundColor:c}=Ut(n),{width:a,height:u}=Q(e.size,r);let h=`<rect fill="${l}" width="${a}" height="${u}"/>`;const{pixelRadius:f,markerRadius:$}=St(t),{pixelVariant:d,markerVariant:m}=yt(s);return h+=ce(e,i,r,c,d,f,o),h+=oe(e,i,r,c,m,$,o),h}const fe=it({name:"Qrcode",props:{value:{type:String,required:!0},variant:{type:[String,Object]},radius:{type:Number},pixelPadding:{type:Number},blackColor:{type:String},whiteColor:{type:String},boostEcc:{type:Boolean},border:{type:Number},ecc:{type:String},invert:{type:Boolean},maskPattern:{type:Number},maxVersion:{type:Number},minVersion:{type:Number},onEncoded:{type:Function},pixelSize:{type:Number}},setup(e,{attrs:n}){const t=T(),r=dt(e,(s,i)=>i!=="value"),o=y(()=>tt(r,et().public.qrcode.options));return ct(()=>{const{value:s,radius:i,pixelSize:l,pixelPadding:c,variant:a,width:u,height:h,preserveAspectRatio:f,whiteColor:$,blackColor:d,invert:m,...L}=o.value,D=Dt(e.value,L),V=Q(D.size,l);t.value=at("svg",{...n,width:u,height:h,preserveAspectRatio:f,xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${V.width} ${V.height}`,innerHTML:ae(D,{radius:i,pixelSize:l,pixelPadding:c,variant:a,border:L.border,whiteColor:$,blackColor:d,invert:m})})}),()=>t.value}});export{fe as _};