qrdx 0.0.60 → 0.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/core.js +7 -7
  3. package/dist/core.js.map +1 -1
  4. package/dist/core.mjs +7 -7
  5. package/dist/core.mjs.map +1 -1
  6. package/dist/index.js +7 -7
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +7 -7
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/node.js +2 -2
  11. package/dist/node.js.map +1 -1
  12. package/dist/node.mjs +2 -2
  13. package/dist/node.mjs.map +1 -1
  14. package/dist/qr-code-canvas.js +1 -1
  15. package/dist/qr-code-canvas.js.map +1 -1
  16. package/dist/qr-code-canvas.mjs +1 -1
  17. package/dist/qr-code-canvas.mjs.map +1 -1
  18. package/dist/src/api.d.ts +2 -3
  19. package/dist/src/api.d.ts.map +1 -1
  20. package/dist/src/qr-code-canvas.d.ts +2 -8
  21. package/dist/src/qr-code-canvas.d.ts.map +1 -1
  22. package/dist/src/qr-code-svg.d.ts +2 -3
  23. package/dist/src/qr-code-svg.d.ts.map +1 -1
  24. package/dist/src/qr-code.d.ts +2 -2
  25. package/dist/src/qr-code.d.ts.map +1 -1
  26. package/dist/src/qr-frame-svg.d.ts +2 -3
  27. package/dist/src/qr-frame-svg.d.ts.map +1 -1
  28. package/dist/src/rasterize.d.ts +8 -0
  29. package/dist/src/rasterize.d.ts.map +1 -1
  30. package/dist/src/react-elements.d.ts.map +1 -1
  31. package/dist/src/scan-score.d.ts +34 -0
  32. package/dist/src/scan-score.d.ts.map +1 -1
  33. package/dist/types/react.d.ts +21 -3
  34. package/dist/types/react.d.ts.map +1 -1
  35. package/dist/vanilla.browser.mjs +12 -12
  36. package/dist/vanilla.browser.mjs.map +1 -1
  37. package/package.json +4 -6
  38. package/src/api.tsx +3 -4
  39. package/src/qr-code-canvas.tsx +34 -27
  40. package/src/qr-code-svg.tsx +3 -4
  41. package/src/qr-code.tsx +7 -5
  42. package/src/qr-frame-svg.tsx +3 -4
  43. package/src/rasterize.ts +14 -1
  44. package/src/react-elements.ts +40 -2
  45. package/src/scan-score.ts +220 -47
  46. package/types/react.ts +22 -3
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
- 'use strict';var schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js');var xn;(a=>{class t{constructor(s,l,c,u){this.version=s;this.errorCorrectionLevel=l;if(s<t.MIN_VERSION||s>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(u=g,d=h),this.applyMask(g);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(s,l){let c=a.QrSegment.makeSegments(s);return t.encodeSegments(c,l)}static encodeBinary(s,l){let c=a.QrSegment.makeBytes(s);return t.encodeSegments([c],l)}static encodeSegments(s,l,c=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,g;for(d=c;;d++){let _=t.getNumDataCodewords(d,l)*8,y=r.getTotalBits(s,d);if(y<=_){g=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,_)*8&&(l=_);let h=[];for(let _ of s){e(_.mode.modeBits,4,h),e(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==g);let p=t.getNumDataCodewords(d,l)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<p;_^=253)e(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new t(d,l,b,m)}size;mask;modules=[];isFunction=[];getModule(s,l){return 0<=s&&s<this.size&&0<=l&&l<this.size&&this.modules[l][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let s=this.getAlignmentPatternPositions(),l=s.length;for(let c=0;c<l;c++)for(let u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(s[c],s[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(s){let l=this.errorCorrectionLevel.formatBits<<3|s,c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(l<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;let l=this.version<<12|s;o(l>>>18==0);for(let c=0;c<18;c++){let u=n(l,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(s,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=s+u,d=l+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(s,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(s+u,l+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(s,l,c){this.modules[l][s]=c,this.isFunction[l][s]=true;}addEccAndInterleave(s){let l=this.version,c=this.errorCorrectionLevel;if(s.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(t.getNumRawDataModules(l)/8),d=u-f%u,g=Math.floor(f/u),h=[],p=t.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let w=s.slice(y,y+g-m+(_<d?0:1));y+=w.length;let C=t.reedSolomonComputeRemainder(w,p);_<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,w)=>{(_!=g-m||w>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(s){if(s.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=c-m,g=(c+1&2)==0?this.size-1-u:u;!this.isFunction[g][f]&&l<s.length*8&&(this.modules[g][f]=n(s[l>>>3],7-(l&7)),l++);}}o(l==s.length*8);}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let u;switch(s){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c]);}}getPenaltyScore(){let s=0;for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?s+=t.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[m][h],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?s+=t.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][m],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(s+=t.PENALTY_N2);}let l=0;for(let m of this.modules)l=m.reduce((f,d)=>f+(d?1:0),l);let c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return o(0<=u&&u<=9),s+=u*t.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return [];{let s=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2,c=[6];for(let u=this.size-7;c.length<s;u-=l)c.splice(1,0,u);return c}}static getNumRawDataModules(s){if(s<t.MIN_VERSION||s>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*s+128)*s+64;if(s>=2){let c=Math.floor(s/7)+2;l-=(25*c-10)*c-55,s>=7&&(l-=36);}return o(208<=l&&l<=29648),l}static getNumDataCodewords(s,l){return Math.floor(t.getNumRawDataModules(s)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let l=[];for(let u=0;u<s-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<s;u++){for(let m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2);}return l}static reedSolomonComputeRemainder(s,l){let c=l.map(u=>0);for(let u of s){let m=u^c.shift();c.push(0),l.forEach((f,d)=>c[d]^=t.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(s,l){if(s>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(l>>>u&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){let l=s[1];o(l<=this.size*3);let c=l>0&&s[2]==l&&s[3]==l*3&&s[4]==l&&s[5]==l;return (c&&s[0]>=l*4&&s[6]>=l?1:0)+(c&&s[6]>=l*4&&s[0]>=l?1:0)}finderPenaltyTerminateAndCount(s,l,c){return s&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,l){l[0]==0&&(s+=this.size),l.pop(),l.unshift(s);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-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]];static NUM_ERROR_CORRECTION_BLOCKS=[[-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]]}a.QrCode=t;function e(i,s,l){if(s<0||s>31||i>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)l.push(i>>>c&1);}function n(i,s){return (i>>>s&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(s,l,c){this.mode=s;this.numChars=l;this.bitData=c;if(l<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(s){let l=[];for(let c of s)e(c,8,l);return new r(r.Mode.BYTE,s.length,l)}static makeNumeric(s){if(!r.isNumeric(s))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<s.length;){let u=Math.min(s.length-c,3);e(parseInt(s.substr(c,u),10),u*3+1,l),c+=u;}return new r(r.Mode.NUMERIC,s.length,l)}static makeAlphanumeric(s){if(!r.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=s.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),e(u,11,l);}return c<s.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,l),new r(r.Mode.ALPHANUMERIC,s.length,l)}static makeSegments(s){return s==""?[]:r.isNumeric(s)?[r.makeNumeric(s)]:r.isAlphanumeric(s)?[r.makeAlphanumeric(s)]:[r.makeBytes(r.toUtf8ByteArray(s))]}static makeEci(s){let l=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)e(s,8,l);else if(s<16384)e(2,2,l),e(s,14,l);else if(s<1e6)e(6,3,l),e(s,21,l);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,l)}static isNumeric(s){return r.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return r.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,l){let c=0;for(let u of s){let m=u.mode.numCharCountBits(l);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(s){s=encodeURI(s);let l=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?l.push(s.charCodeAt(c)):(l.push(parseInt(s.substr(c+1,2),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(xn||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(xn||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(xn||={});var dt=xn;var St={L:dt.QrCode.Ecc.LOW,M:dt.QrCode.Ecc.MEDIUM,Q:dt.QrCode.Ecc.QUARTILE,H:dt.QrCode.Ecc.HIGH},it=128,Jt="Q",ft="#FFFFFF",Rt="#000000";var pt=0;var Hr=.1;function bt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}function Lt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function Fe(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function Ra(t){return typeof t=="object"&&t!==null&&t.type==="image"}function _d(t,e="#000000"){let n=Lt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function Rl(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function yd(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Lt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${Rl(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var zr=["logo","halftone"],Ea={logo:["blend","badge"],halftone:["color","mono"]},Jn=192,xd=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse","cushion"],$d=["diamond","star","banner"],Sd=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],wd=["curly"],Cd=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],tr={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},Ne={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Oe={bevel:"square",notch:"square"};function Gt(t,e){return typeof e=="string"&&Object.hasOwn(t,e)?t[e]:e}var Md=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],se=24,Aa="Scan me",er=.5,$n=1.5,Rd=["square","rounded","circle"],Ed=.1,Pa=.3,Ia=.25,Ad=2,Wr=.5,va=1,La=.07,Pd=["square","circle","heart"],Ta=3,De=64,_e=8,ka=.42,Be=["topLeft","topRight","bottomLeft"],qr=.5,Fa=2,Na=.1,Oa=.5,Da=.25,Vr="#e5e7eb",Ge="#d1d5db",jr=.3,Ba=.2,Ga=.1,Qa=.4,Ua=.3,Ha="#000000",Id=["corner","code"];function J(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(J(t,e))}function I(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?x(r):r)+(t[o+1]??"");}return n}var vd={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ld=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,za=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function nr(t,e=Number.POSITIVE_INFINITY){if(!Ld.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),za.lastIndex=o;let l=za.exec(t);if(!l)return null;let c=l[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=za.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let l=t[o];return l==="0"||l==="1"?(o++,l==="1"?1:0):null},s=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let l=t[o],c=l.toUpperCase(),u=vd[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:l,values:[]}),r();continue}let m=l,f=true;for(;f||s();){let d=[];for(let g=0;g<u;g++){let h=c==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=l==="M"?"L":"l"),f=false;}r();}return n}function El(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function Wa(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let s=a.toUpperCase(),l=a===s,c=l?n:0,u=l?o:0,m;switch(s){case "Z":m=[];break;case "H":m=[x(i[0]*e+c)];break;case "V":m=[x(i[0]*e+u)];break;case "A":m=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+c),x(i[6]*e+u)];break;default:m=i.map((f,d)=>x(f*e+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function Xr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let s of t)if(s.op==="M")i(),r=[s.x,s.y],a=r,o.push(r);else if(s.op==="L")a=[s.x,s.y],o.push(a);else if(s.op==="C"){let l=a,c=[s.x1,s.y1],u=[s.x2,s.y2],m=[s.x,s.y],f=Math.hypot(c[0]-l[0],c[1]-l[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*l[0]+3*p*p*h*c[0]+3*p*h*h*u[0]+h*h*h*m[0],p*p*p*l[1]+3*p*p*h*c[1]+3*p*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function Sn(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let s=a[i],l=a[(i+a.length-1)%a.length],c=r(s),u=r(l);c>=0?(u<0&&o.push(Al(l,s,u,c)),o.push(s)):u>=0&&o.push(Al(l,s,u,c));}}return o.length>2?o:[]}function Al(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Pl(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function Qe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,s)=>{e=Math.min(e,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var Td={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Ll(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return Td[n.toLowerCase()]??e})}var kd=60,qa=62,Va=47,Fd=61,Il=34,vl=39,Xa=/\s*/y,Nd=/[^\s/>]*/y,Od=/[^\s>]*/y,Dd=/[^\s=]*/y;function wn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Bd(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,M=-1;return R=>((R<$||M>=0&&M<R)&&($=R,M=t.indexOf(S,R)),M)},r=o("-->"),a=o("?>"),i=o("]]>"),s=o(">"),l,c=S=>{let $=t.charCodeAt(S);if($!==Il&&$!==vl)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},u=S=>{for(let $=S;$<n&&!l?.[$];$=c($)){let M=t.charCodeAt($);if(M===qa||M===Va&&t.charCodeAt($+1)===qa)return $}l??=new Uint8Array(n);for(let $=S;$<n&&!l[$];$=c($))l[$]=1;return -1},m=-1,f=-1,d=-1,g=-1,h=S=>{let $=S+1;if($<m||$>=f){m=$,f=wn(Nd,t,$),d=-1;for(let R=f;R>$;R--){let E=t.charCodeAt(R);if((R===f||E===Il||E===vl)&&(g=u(R),g>=0)){d=R;break}}}if(d<=$)return -1;let M=t.charCodeAt(g)===Va;return e.open(t.slice($,d),t.slice(d,g),M),g+(M?2:1)},p=-1,b=-1,_=-1,y=S=>{let $=S+2;if($<p||$>=b){p=$,b=wn(Od,t,$);let M=wn(Xa,t,b);_=b>$&&t.charCodeAt(M)===qa?M:-1;}return _},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=s(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===Va){let $=y(S);return $<0?-1:(e.close(),$+1)}return h(S)},C=0;for(;C<n;)if(t.charCodeAt(C)===kd){let S=w(C);C=S<0?C+1:S;}else {let S=t.indexOf("<",C),$=S<0?n:S;e.text(t.slice(C,$)),C=$;}}function Gd(t){let e={},n=0;for(;n<t.length;){let o=wn(Dd,t,n);if(o===n){n++;continue}let r=wn(Xa,t,o);if(t.charCodeAt(r)===Fd){let a=wn(Xa,t,r+1),i=t[a],s=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(s>=0){e[t.slice(n,o)]=Ll(t.slice(a+1,s)),n=s+1;continue}}n=o;}return e}function ye(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Bd(t,{open(a,i,s){let l=Gd(i),c={name:a,attrs:l,children:[],text:""};o().children.push(c),s||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=Ll(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let s=r(i);if(s)return s}return null};return r(e)}var Cn=[1,0,0,1,0,0];function mt(t,e){let[n,o,r,a,i,s]=t,[l,c,u,m,f,d]=e;return [n*l+r*c,o*l+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+s]}function q(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function Mn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function te(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Qt(t){let e=Cn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=te(o),a=Cn;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,s=Math.cos(i),l=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=mt(mt([1,0,0,1,c,u],[s,l,-l,s,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=mt(e,a);}return e}var ja=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Qd(t,e,n,o,r,a,i,s,l){if(t===s&&e===l)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:s,y:l}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),g=(t-s)/2,h=(e-l)/2,p=f*g+d*h,b=-d*g+f*h,_=p*p/(c*c)+b*b/(u*u);_>1&&(c*=Math.sqrt(_),u*=Math.sqrt(_));let y=c*c*u*u-c*c*b*b-u*u*p*p,w=c*c*b*b+u*u*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,y/w)),S=C*c*b/u,$=-C*u*p/c,M=f*S-d*$+(t+s)/2,R=d*S+f*$+(e+l)/2,E=(W,D,U,X)=>Math.atan2(W*X-D*U,W*U+D*X),P=E(1,0,(p-S)/c,(b-$)/u),v=E((p-S)/c,(b-$)/u,(-p-S)/c,(-b-$)/u);!i&&v>0?v-=2*Math.PI:i&&v<0&&(v+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(v)/(Math.PI/2)-1e-9)),F=v/L,k=4/3*Math.tan(F/4),T=(W,D)=>[M+c*f*W-u*d*D,R+c*d*W+u*f*D],z=[];for(let W=0;W<L;W++){let D=P+W*F,U=D+F,[X,xt]=T(Math.cos(D)-k*Math.sin(D),Math.sin(D)+k*Math.cos(D)),[lt,N]=T(Math.cos(U)+k*Math.sin(U),Math.sin(U)-k*Math.cos(U)),[B,Z]=W===L-1?[s,l]:T(Math.cos(U),Math.sin(U));z.push({op:"C",x1:X,y1:xt,x2:lt,y2:N,x:B,y:Z});}return z}function le(t){let e=[],n=0,o=0,r=0,a=0,i=0,s="",l=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),ja.lastIndex=n;let g=ja.exec(t);return g?(n=ja.lastIndex,Number(g[0])):null},f=()=>{u();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))s=g,n++;else if(!s||s==="Z"||s==="z")break;let h=s===s.toLowerCase(),p=h?o:0,b=h?r:0,_=s.toUpperCase();if(_==="Z"){e.push({op:"Z"}),o=a,r=i,l=null,c=null;continue}if(_==="A"){let S=d(3),$=f(),M=f(),R=d(2);if(!(S&&R)||$===null||M===null)break;let[E,P,v]=S,L=R[0]+p,F=R[1]+b;e.push(...Qd(o,r,E,P,v,$,M,L,F)),o=L,r=F,l=null,c=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,w=d(y);if(!w)break;let C=w;switch(_){case "M":o=C[0]+p,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),s=h?"l":"L",l=null,c=null;break;case "L":case "H":case "V":_!=="V"&&(o=C[0]+p),_==="V"?r=C[0]+b:_==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),l=null,c=null;break;case "C":case "S":{let S,$;_==="C"?(S=[C[0]+p,C[1]+b],$=C.slice(2)):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=C);let M=[$[0]+p,$[1]+b],R=[$[2]+p,$[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:M[0],y2:M[1],x:R[0],y:R[1]}),[o,r]=R,l=M,c=null;break}case "Q":case "T":{let S,$;_==="Q"?(S=[C[0]+p,C[1]+b],$=[C[2]+p,C[3]+b]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[C[0]+p,C[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,c=S,l=null;break}}}return e}var Yr=.5522847498;function ee(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Yr,a=o*Yr;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function ne(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),s=Math.min(Math.max(a,0),o/2);if(i===0||s===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let l=i*Yr,c=s*Yr,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+l,y1:e,x2:u,y2:e+s-c,x:u,y:e+s},{op:"L",x:u,y:m-s},{op:"C",x1:u,y1:m-s+c,x2:u-i+l,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-l,y1:m,x2:t,y2:m-s+c,x:t,y:m-s},{op:"L",x:t,y:e+s},{op:"C",x1:t,y1:e+s-c,x2:t+i-l,y2:e,x:t+i,y:e},{op:"Z"}]}var rr="qrdx.frame",or=1,ar="custom",ot={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:se},Za=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],ir=.95,kl=200,Ka=["frame","text","accent","background"],Ud=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Hd=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function Rn(t,e=se){let n=t.slice(0,1e3).normalize("NFC").replace(Ud," ").replace(Hd,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function zd(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var Zr=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Kr(t){let e=En(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function Wd(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function En(t){return t.qr.padding??t.qr.size*ot.defaultPadding}var Ja=.52,qd=.35;function Vd(t){let e=t.fontSize??t.box.height*Ja;return Math.min(e*$n,t.box.height*ir)}var Ya=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;function Tl(t){let e=Kr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,s]of o)for(let l=0;l<=8;l++){let c=s+Math.PI/2*(l/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function jd([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),s=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-s)<=a+.01}function Xd(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function Yd(t,e,n){let o=Kr(e);if(!Ya(n,o))return false;if("stroke"in t&&t.stroke)return true;if(t.fill==="background")return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !Tl(e).every(a=>jd(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !Tl(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=Sn(t.points,o);return r.length>2&&Xd(r)>1e-6}return true}function ti(t){let e=Zd(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:s}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:s+o},segments:e.segments*2}}function Zd(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=nr(t.d,ot.maxDecimals);return e?{bounds:Qe(le(t.d)),segments:El(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:kl}}}function Fl(t,e){let n=ot,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,s={x0:-i,y0:-i,x1:r+i,y1:a+i},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:c}=t,u=En(t);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Kr(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>a+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:w,segments:C}=ti(b);if(!w){e("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(w)||e("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[...y,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[...y,"stroke","width"]),c.plate==="background"&&Yd(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',y),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==Rn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(b.type==="text"){C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*ir+1e-9&&e("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]);let S=b.box.y+b.box.height/2,$=Vd(b)*qd,M={x0:C.x0,x1:C.x1,y0:S-$,y1:S+$};(Ya(C,Wd(t))||Ya(M,m))&&e("The label overlaps the code or its padding",[...y,"box"]);}else {let{cx:S,cy:$,radius:M}=b.curve,R=b.fontSize*$n*.6;C={x0:S-M-R,y0:$-M-R,x1:S+M+R,y1:$+M+R};let E=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-$,0,$-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-$),Math.abs(m.y1-$)))<=M-R||E>=M+R||e("The curved label crosses the code or its padding",[...y,"curve"]);}if(l(C)||e("The label extends outside the artboard",y),b.collapse){let S=b.collapse,$=S.y+S.height;(S.y<-1e-9||$>a+1e-9)&&e("The collapse band must sit inside the artboard",[...y,"collapse"]),$>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[...y,"collapse"]);for(let M of g)$>M.y+1e-6&&S.y<M.y+M.height-1e-6&&e("Collapse bands may not overlap",[...y,"collapse"]);g.push(S);}});}var Tt=t=>t/255,sr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,tt=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function ei(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let s=i*4;return {color:[Tt(o[s]),Tt(o[s+1]),Tt(o[s+2])],alpha:o[s+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>sr(i,a)<.006)?a:null}function Kd(t){let{width:e,height:n,data:o}=t,r=ei(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let s=i*4,l=o[s+3]/255;if(r&&l>0){let c=Math.sqrt(sr([Tt(o[s]),Tt(o[s+1]),Tt(o[s+2])],r));l*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=l;}return a}var Jd=8,tf=.14,Nl=.006;function ef(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),s=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=Tt(r[g]),i[h*3+1]+=Tt(r[g+1]),i[h*3+2]+=Tt(r[g+2]),s++;}if(s===0)return {palette:[],error:0};let l=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),c=[];for(let d of l){if(a[d]/s<Nl/2||c.length>=Jd)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>sr(h,g)>=tf**2)&&c.push(g);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[Tt(r[h]),Tt(r[h+1]),Tt(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[w,C]of c.entries()){let S=sr(p,C);S<_&&(_=S,b=w);}let y=u[b];y.n++,y.r+=p[0],y.g+=p[1],y.b+=p[2],y.x+=g%n,y.y+=Math.floor(g/n),m+=Math.sqrt(_);}for(let[g,h]of u.entries())h.n>0&&(c[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,g)=>({color:d,area:u[g].n/s,cx:u[g].n?u[g].x/u[g].n+.5:n/2,cy:u[g].n?u[g].y/u[g].n+.5:o/2})).filter(d=>d.area>=Nl).sort((d,g)=>g.area-d.area),error:m/s}}function nf(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,s=new Map,l=m=>{let f=s.get(m);if(f)return f;let d=Math.floor(m/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=m%2===1,_=b?a(g,h+1):a(g+1,h),y=p===_?.5:Math.min(1,Math.max(0,(.5-p)/(_-p))),w=b?[g-.5,h-.5+y]:[g-.5+y,h-.5];return s.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,g=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,p=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:c(_,y);break;case 2:c(w,_);break;case 3:c(w,y);break;case 4:c(b,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(b,y),c(_,w)):(c(b,w),c(_,y));break}case 6:c(b,_);break;case 7:c(b,y);break;case 8:c(y,b);break;case 9:c(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(y,_),c(w,b)):(c(y,b),c(w,_));break}case 11:c(w,b);break;case 12:c(y,w);break;case 13:c(_,w);break;case 14:c(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(l(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&u.push(f);}return u}function rf(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Ol(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],s=t[a],l=s[0]-i[0],c=s[1]-i[1],u=Math.hypot(l,c)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(c*(g[0]-i[0])-l*(g[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function of(t,e){let n=0,o=-1;for(let[i,s]of t.entries()){let l=(s[0]-t[0][0])**2+(s[1]-t[0][1])**2;l>o&&(o=l,n=i);}let r=Ol(t.slice(0,n+1),e),a=Ol([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var xe=t=>J(t,2);function af(t,e){let n=t.length,o=(a,i)=>{let s=Math.hypot(i[0]-a[0],i[1]-a[1])||1,l=Math.min(.5,e/s);return [a[0]+(i[0]-a[0])*l,a[1]+(i[1]-a[1])*l]},r="";for(let a=0;a<n;a++){let i=t[a],s=o(i,t[(a-1+n)%n]),l=o(i,t[(a+1)%n]);r+=a===0?`M${xe(s[0])} ${xe(s[1])}`:`L${xe(s[0])} ${xe(s[1])}`,r+=`Q${xe(i[0])} ${xe(i[1])} ${xe(l[0])} ${xe(l[1])}`;}return `${r}Z`}function sf(t,e,n){let o="";for(let r of nf(t,e,n)){if(Math.abs(rf(r))<.8)continue;let a=of(r,.18);a.length>=3&&(o+=af(a,.9));}return o}var lf=.075;function Dl(t){let{width:e,height:n,data:o}=t,r=Kd(t),a=0;for(let h of r)a+=h;let{palette:i,error:s}=ef(t,r),l={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||s>lf)return {...l,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,_=[Tt(o[b]),Tt(o[b+1]),Tt(o[b+2])],y=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let P=0;P<c;P++){let v=sr(_,m[P]);v<C?(w=y,S=C,y=P,C=v):v<S&&(w=P,S=v);}if(w<0||C<1e-6){u[y][h]=p;continue}let $=m[y],M=m[w],R=[M[0]-$[0],M[1]-$[1],M[2]-$[2]],E=Math.min(1,Math.max(0,((_[0]-$[0])*R[0]+(_[1]-$[1])*R[1]+(_[2]-$[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));u[y][h]=p*(1-E),u[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(c);for(let h=c-1;h>=0;h--){let p=u[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<c;h++){let p=sf(g[h],e,n);p&&f.push({color:m[h],d:p});}return {...l,layers:f,photographic:false}}var{QrCode:ni}=dt,cf={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function uf(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,s)=>{i>=0&&s>=0&&i<e&&s<e&&(n[s*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,s]of [[3,3],[e-4,3],[3,e-4]])for(let l=-4;l<=4;l++)for(let c=-4;c<=4;c++)o(i+c,s+l);let r=[];if(t>1){let i=Math.floor(t/7)+2,s=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let l=e-7;r.length<i;l-=s)r.splice(1,0,l);}let a=r.length-1;for(let[i,s]of r.entries())for(let[l,c]of r.entries())if(!(i===0&&l===0||i===0&&l===a||i===a&&l===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(s+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let s=e-11+i%3,l=Math.floor(i/3);o(s,l),o(l,s);}return n}function mf(t,e){let n=t*4+17,o=St[e].ordinal,r=ni.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=ni.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(ni.getNumRawDataModules(t)/8),s=r-i%r,l=Math.floor(i/r),c=Array.from({length:r},(w,C)=>l+(C<s?0:1)),u=[],m=[],f=l-a;for(let w=0;w<=l;w++)for(let C=0;C<r;C++)if(C<s){if(w===f)continue;u.push(C),m.push(w<f?w:w-1);}else u.push(C),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=uf(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let M=w-$,E=(C?n-1-S:S)*n+M;if(!d[E]&&_<b){let P=_>>>3;g[E]=u[P],h[E]=m[P],p[E]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let y=cf[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-y)/2),block:g,codeword:h,bit:p}}var df=8,Ue=new Map;function lr(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Ue.get(n);if(o)return Ue.delete(n),Ue.set(n,o),o;let r=mf(t,e);if(Ue.size>=df){let a=Ue.keys().next().value;a!==void 0&&Ue.delete(a);}return Ue.set(n,r),r}function cr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var ff={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},hf=Object.fromEntries(Object.entries(ff).map(([t,e])=>[t,[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]]));function Bl(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function at(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=hf[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let s=a??i[3],[l,c,u]=i.slice(0,3).map(d=>Bl(d,255)),m=s===void 0?1:Bl(s,1);if([l,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(l,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function $e(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[J((1-o-i)/(1-i)),J((1-r-i)/(1-i)),J((1-a-i)/(1-i)),J(i)]}function Ut(t){return t.children}var pf=t=>t==null?null:`${t}`;function ri(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:pf(r)}}function gf(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function bf(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),ri(t,o)}var _f={jsx:ri,jsxs:ri,createElement:bf,cloneElement:gf,Fragment:Ut},ur=_f;var oi=t=>t===Ut?ur.Fragment:t;function A(t,e,n){return ur.jsx(oi(t),e,n)}function $t(t,e,n){return ur.jsxs(oi(t),e,n)}function Jr(t,e,...n){return ur.createElement(oi(t),e??null,...n)}function He(t,e){return ur.cloneElement(t,e)}var yf=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Gl=Symbol.for("react.fragment");function ze(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!yf.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===Gl)&&typeof e.props=="object"&&e.props!==null}var An=t=>t===Ut||t===Gl;var ql=.6,si={logo:160,halftone:160};function xf(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var Pn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},$f=new Pn(8);function Sf(t){return $f.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function li(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>Jn||n>Jn||typeof o!="string")return null;try{let r=Sf(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function Vl(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,s=e.square?Math.floor((o-a)/2):0,l=e.square?a:n,c=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??si.halftone),1),Jn),m=Math.min(1,u/Math.max(l,c)),f=Math.max(1,Math.round(l*m)),d=Math.max(1,Math.round(c*m)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*c/d),b=Math.max(p+1,Math.floor((h+1)*c/d));for(let _=0;_<f;_++){let y=Math.floor(_*l/f),w=Math.max(y+1,Math.floor((_+1)*l/f)),C=0,S=0,$=0,M=0,R=0;for(let P=p;P<b;P++)for(let v=y;v<w;v++){let L=((P+s)*n+v+i)*4,F=r[L+3]/255;C+=r[L]*F,S+=r[L+1]*F,$+=r[L+2]*F,M+=F,R++;}let E=(h*f+_)*4;g[E]=M>0?Math.round(C/M):0,g[E+1]=M>0?Math.round(S/M):0,g[E+2]=M>0?Math.round($/M):0,g[E+3]=Math.round(M/R*255);}}return {width:f,height:d,data:xf(g)}}async function wf(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function Cf(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??si[n],r=await wf(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,s=n==="halftone",l=Math.min(1,o*4/(s?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*l)),u=Math.max(1,Math.round(i*l)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return Vl(d,{maxSize:o,square:s})}function ci(t){return !!(t&&zr.includes(t.mode)&&t.image&&li(t.image))}function no(t){let e=Ea[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Mf(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function mr(t,e){let n=Mf(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return r}var Rf=0,Ht=1,Vt=2,Se=3,Ql=4,Ul=new Map;function jl(t){let e=Ul.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,s,l,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+l);u++)for(let m=Math.max(0,a);m<Math.min(n,a+s);m++)o[u*n+m]=c;};r(6,0,1,n,Ql),r(0,6,n,1,Ql),r(0,8,9,1,Se),r(8,0,1,9,Se),r(n-8,8,8,1,Se),r(8,n-8,1,8,Se),t>=7&&(r(n-11,0,3,6,Se),r(0,n-11,6,3,Se));for(let[a,i]of mr(t,n))r(a-2,i-2,5,5,Vt);return r(0,0,8,8,Ht),r(n-8,0,8,8,Ht),r(0,n-8,8,8,Ht),Ul.set(t,o),o}function Ef(t){let e=t*4+17,n=jl(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==Rf))}function Af(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function In(t,e){let n=at(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var qe=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function we(t,e,n,o){let r=tt(t);if(o?r<=n:r>=n)return t;let a=tt(e);return Math.abs(r-a)<1e-6?e:qe(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Xl=t=>Math.max(...t)-Math.min(...t),Pf=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,ai=t=>t.toString(16).padStart(2,"0");function kt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${ai(n(t[0]))}${ai(n(t[1]))}${ai(n(t[2]))}`}function If(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}var ui=.3,Hl=t=>1-Math.exp(-((t/2)**2)/(2*ui**2)),vf=t=>If(t/(2*ui*Math.SQRT2))**2,Lf=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function mi(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function Yl(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let s=0;s<n*o;s++)a[s*3]=r[s*4]/255,a[s*3+1]=r[s*4+1]/255,a[s*3+2]=r[s*4+2]/255,e||(i[s]=r[s*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function Tf(t){let e=Yl(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=tt([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},s=a?i(.01):0,l=a?i(.99):1;l-s<.15&&(s=0,l=1);let c=Math.min(1.6,1/(l-s)),u=(s+l)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=tt(f),g=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function Zl(t,e,n,o,r=1){let{width:a,height:i,rgb:s,alpha:l}=t,c=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),g=Math.min(f+1,i-1),h=c-m,p=u-f,b=0,_=0,y=0,w=0,C=($,M,R)=>{let E=M*a+$,P=l[E]*R;b+=s[E*3]*P,_+=s[E*3+1]*P,y+=s[E*3+2]*P,w+=P;};if(C(m,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(m,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(_/w-o[1])*S,o[2]+(y/w-o[2])*S]}var kf=new Pn(4),Ff=new Pn(6),Nf=new Pn(6);function di(t,e){return Ff.get(t.image.data,()=>Dl(e))}function Kl(t,e,n){return Nf.get(t.image.data,()=>Yl(e,n.alpha))}var wt=t=>J(t,2),Jl=t=>J(t,4),Ve=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,Of(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>A("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function Of(t,e,n){let o=wt(n*2),r=wt(n);return `M${wt(t-n)} ${wt(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function We(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${wt(t)} ${wt(e)}h${wt(n)}v${wt(o)}h${wt(-n)}z`;let i=wt(a);return `M${wt(t+a)} ${wt(e)}h${wt(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${wt(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${wt(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${wt(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function tc(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,s=(a-2+e)*n;o+=We(i,s,5*n,5*n,n*.35),o+=We(i+n,s+n,3*n,3*n,n*.15),o+=We(i+2*n,s+2*n,n,n,n*.12);}return o}var Df={blend:1,badge:1,color:.9,mono:.7},eo=.35;function Bf(t,e){let n=In(t,[0,0,0]),o=In(e,[1,1,1]),r=tt(o)-tt(n);return r>=eo?null:r<=-eo?"inverted":"low-contrast"}function ec(t,e,n){let o=Math.min(Math.max(t.intensity??ql,0),Df[no(t)]);return tt(n)-tt(e)>=eo?o:0}function Gf(t){let{art:e,modules:n,version:o}=t,r=e.image&&li(e.image);if(!(r&&zr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=In(t.fgColor,[0,0,0]),s=In(t.bgColor,[1,1,1]),l=ec(e,i,s);return l<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:jl(o),margin:t.margin,pixelSize:t.pixelSize,t:l,fg:i,bg:s,variant:no(e),body:t.body}}function fi(t){let e=Gf(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?qf(e):Wf(e):n=e.variant==="badge"?e1(e):Vf(e),A("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function Qf(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var nc=8.5,zl=new Map;function hi(t){let e=t*4+17,n=zl.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),s=nc*2;for(let l=0;l<a;l++)for(let c=0;c<a;c++){let u=c<s||c>=a-s,m=l<s||l>=a-s;u&&m&&!(c>=a-s&&l>=a-s)&&(i[l*a+c]=1);}for(let[l,c]of mr(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(l-2)*2-1;m<(l+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);zl.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let s=Math.floor(a*2),l=Math.floor(i*2);return s>=0&&l>=0&&s<r&&l<r&&o[l*r+s]===1}}function rc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:s}=t,l=kf.get(t.art.image.data,()=>Tf(o)),c=mi(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*c.scale)>1.3?2:1,g=tt(s)-.1*(tt(s)-tt(i)),h=hi(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let _=a[p*r+b],y=_===Ht||_===Vt;if(!(y&&!n))for(let w=0;w<e;w++)for(let C=0;C<e;C++){let S=0,$=0,M=0;for(let k=0;k<d;k++)for(let T=0;T<d;T++){let z=b+(C+(T+.5)/d)/e,W=p+(w+(k+.5)/d)/e,D=Zl(l,(z-c.offsetX)/c.scale,(W-c.offsetY)/c.scale,s);S+=D[0],$+=D[1],M+=D[2];}let R=d*d,E=[S/R,$/R,M/R],P=b+(C+.5)/e,v=p+(w+.5)/e,L=Math.min(P,v,r-P,r-v);L<1.5&&(E=qe(E,s,.35*(1-L/1.5))),n&&(y||h(P,v))&&(E=we(E,s,g,false));let F=((p*e+w)*u+b*e+C)*3;m[F]=E[0],m[F+1]=E[1],m[F+2]=E[2];}}return {n:e,count:u,rgb:m}}function Uf(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:s,t:l}=t,{n:c,count:u,rgb:m}=e,f=tt(i),d=tt(s),g=d-f,h=Qf(l,c),p=M=>.2126*m[M]+.7152*m[M+1]+.0722*m[M+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===Ht){b[M*o+R]=d;continue}if(E===Vt){b[M*o+R]=a[M]?.[R]?f:d;continue}let P=0,v=0,L=0;for(let F=0;F<c;F++)for(let k=0;k<c;k++){let T=p(((M*c+F)*u+R*c+k)*3);P+=T,n.under[F*c+k]||(v+=T,L++);}b[M*o+R]=P/(c*c),_[M*o+R]=L?v/L:P/(c*c);}let y=o+1,w=new Float64Array(y*y);for(let M=0;M<o;M++)for(let R=0;R<o;R++)w[(M+1)*y+R+1]=b[M*o+R]+w[M*y+R+1]+w[(M+1)*y+R]-w[M*y+R];let C=2,S=(M,R)=>{let E=Math.max(0,M-C),P=Math.max(0,R-C),v=Math.min(o,M+C+1),L=Math.min(o,R+C+1);return (w[L*y+v]-w[P*y+v]-w[L*y+E]+w[P*y+E])/((v-E)*(L-P))},$=n.weight;for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===Ht||E===Vt)continue;let P=E===Se,v=(h.margin+(P?.08:0))*g,L=(h.darkCap-(P?.12:0))*g,F=($*((n.light-n.dark)/2)-v)/(1-$),k=S(R,M),T=_[M*o+R],z=!!a[M]?.[R],W=0,D=s;if(z){let U=Math.min(k+F,f+L);T>U&&(W=(T-U)/Math.max(T-f,1e-6),D=i);}else {let U=Math.max(k-F,d-L);T<U&&(W=(U-T)/Math.max(d-T,1e-6));}if(!(W<=0)){W=Math.min(1,W);for(let U=0;U<c;U++)for(let X=0;X<c;X++){let xt=((M*c+U)*u+R*c+X)*3;for(let lt=0;lt<3;lt++)m[xt+lt]+=(D[lt]-m[xt+lt])*W;}}}}function oc(t,e,n,o){let{count:r}=e,a=new Ve;for(let l=0;l<r;l++){let c=0,u=n(l*r);for(let m=1;m<=r;m++){let f=m<r?n(l*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,l,m-c),c=m,u=f);}}let i=t.pixelSize/e.n,s=wt(t.margin*t.pixelSize);return A("g",{transform:`translate(${s} ${s}) scale(${Jl(i)})`,children:a.toElements(o)},o)}function pi(t,e){let n=mr(t.version,t.size);return n.length===0?[]:[A("path",{d:tc(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function ac(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var Hf=t=>2*ui*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function zf(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let s=0;s<e;s++)r[(i+1)*o+s+1]=t[i*e+s]+r[i*o+s+1]+r[(i+1)*o+s]-r[i*o+s];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let s=0;s<e;s++){let l=Math.max(0,s-n),c=Math.max(0,i-n),u=Math.min(e,s+n+1),m=Math.min(e,i+n+1);a[i*e+s]=(r[m*o+u]-r[c*o+u]-r[m*o+l]+r[c*o+l])/((u-l)*(m-c));}return a}function ic(t,e,n,o){let{size:r,kinds:a,modules:i,fg:s,bg:l}=t,c=tt(s),u=tt(l),m=u-c,f=zf(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,_=a[b];if(_===Ht||_===Vt)continue;let y=_===Se,w=o.base+(y?.08:0),C=(o.margin+(y?.03:0))*m,S=(o.cap-(y?.04:0))*m,$=Hl(w),M=Hl(y?Math.max(o.max,.94):o.max),R=$*((o.dark+o.light)/2)+(1-$)*f[b],E=n[b],P=!!i[h]?.[p],v=P?o.dark:o.light,L=P?Math.min(R-C,c+S):Math.max(R+C,u-S),k=(P?E<=L:E>=L)?0:(E-L)/(E-v);k>M&&(k=M,g[b]=Math.min(u,Math.max(c,(L-M*v)/(1-M))));let T=P?E<=L-.06:E>=L+.06;o.skip&&T&&!y||(k=Math.max(k,$)),d[b]=k>0?Hf(k):0;}return {diameter:d,surround:g}}function Wf(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:s,pixelSize:l}=t,c=ac(t),u=rc(t,c,true),m=tt(r),f=tt(a),d=m+.1*(f-m),g=f-.05*(f-m),{count:h,rgb:p}=u,b=(S,$,M,R)=>(($*c+R)*h+S*c+M)*3,_=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=n[S*e+$];if(M===Ht||M===Vt){_[S*e+$]=M===Vt&&o[S]?.[$]?m:f;continue}let R=0;for(let E=0;E<c;E++)for(let P=0;P<c;P++){let v=b($,S,P,E);R+=.2126*p[v]+.7152*p[v+1]+.0722*p[v+2];}_[S*e+$]=R/(c*c);}let y=ic(t,_,_,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=y.surround[S*e+$];if(Number.isNaN(M))continue;let R=_[S*e+$],P=M<R?r:a,v=Math.min(1,Math.abs(R-M)/Math.max(Math.abs(R-tt(P)),1e-6));for(let L=0;L<c;L++)for(let F=0;F<c;F++){let k=b($,S,F,L);for(let T=0;T<3;T++)p[k+T]+=(P[T]-p[k+T])*v;}}let w=[oc(t,u,S=>{let $=S*3;return Number.isNaN(p[$])?null:kt([p[$],p[$+1],p[$+2]],8)},"art-photo")],C=new Ve;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=y.diameter[S*e+$];if(!(M>0))continue;let R=0,E=0,P=0;for(let F=0;F<c;F++)for(let k=0;k<c;k++){let T=b($,S,k,F);R+=p[T],E+=p[T+1],P+=p[T+2];}let v=[R/(c*c),E/(c*c),P/(c*c)],L=o[S]?.[$]?we(v,r,d,true):we(v,a,g,false);C.circle(kt(L,10),($+s+.5)*l,(S+s+.5)*l,M/2*l);}return w.push(...C.toElements("art-dot"),...pi(t,kt(r))),w}function qf(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=ac(t),s=rc(t,i),l=tt(r),c=tt(a),u=i%2===1?1:2,m=(i-u)/2,f=R=>R>=m&&R<m+u,d=[];for(let R=0;R<i;R++)for(let E=0;E<i;E++)d.push(f(E)&&f(R));Uf(t,s,{weight:vf(u/i),dark:l,light:c,under:d});let{count:g,rgb:h}=s,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let R=0;R<g*g;R++){let E=R*3;if(Number.isNaN(h[E])){p[R]=Number.NaN;continue}let P=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-l)/(c-l);p[R]=.5+(Lf(0,1,P)-.5)*1.15;}for(let R=0;R<e;R++)for(let E=0;E<e;E++){let P=n[R*e+E];if(!(P===Ht||P===Vt))for(let v=m;v<m+u;v++)for(let L=m;L<m+u;L++)b[(R*i+v)*g+E*i+L]=o[R]?.[E]?0:1;}let _=hi(t.version);for(let R=0;R<g;R++)for(let E=0;E<g;E++){let P=R*g+E;b[P]<0&&_((E+.5)/i,(R+.5)/i)&&(b[P]=1);}let y=new Uint8Array(g*g),w=.3,C=0,S=0,$=(R,E,P)=>{if(R<0||R>=g||E>=g)return;let v=E*g+R;if(!Number.isNaN(p[v])){let L=Math.floor(R/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[v]+=L?P:P*w;}};for(let R=0;R<g;R++){let E=R%2===0?1:-1;for(let P=0;P<g;P++){let v=E===1?P:g-1-P,L=R*g+v,F=p[L];if(Number.isNaN(F))continue;let k=b[L]>=0?b[L]:F>=.5?1:0;y[L]=k===0?1:0;let T=Math.min(.75,Math.max(-0.75,F-k));C=v,S=R,$(v+E,R,T*7/16),$(v-E,R+1,T*3/16),$(v,R+1,T*5/16),$(v+E,R+1,T/16);}}let M=kt(r);return [oc(t,s,R=>y[R]?M:null,"art-halftone"),...pi(t,M)]}function Wl(t,e){let n=null,o=0;for(let r of t.palette){if(e&&Pf(r.color,e)<.02)continue;let a=r.area*(.35+Xl(r.color))*(tt(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function sc(t,e,n,o,r){let a;if(t.photographic){let i=new Ve,{width:s,height:l,rgb:c,alpha:u}=e;for(let m=0;m<l;m++){let f=0,d=null;for(let g=0;g<=s;g++){let h=m*s+g,p=g<s&&u[h]>=.5?kt(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(g===s||p!==d)&&(d&&i.cellRun(d,f,m,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,s)=>A("path",{d:i.d,fill:kt(o(i.color)),fillRule:"evenodd"},`${r}-${s}`));return A("g",{transform:`translate(${wt(n.x)} ${wt(n.y)}) scale(${Jl(n.scale)})`,children:a},r)}function Vf(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:s,t:l,margin:c,pixelSize:u}=t,m=di(e,n),f=Kl(e,n,m),d=mi(m.width,m.height,o,"contain"),g=Math.min(1,.3+1.4*l),h=T=>qe(s,T,g),p=kt(s),b=kt(i),_=[sc(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=nc,w=(T,z)=>We((T+c)*u,(z+c)*u,(y+.4)*u,(y+.4)*u,1.2*u),C=mr(t.version,o).map(([T,z])=>We((T-2.5+c)*u,(z-2.5+c)*u,6*u,6*u,u*.8)).join("");_.push(A("path",{d:w(-0.4,-0.4)+w(o-y,-0.4)+w(-0.4,o-y)+C,fill:p},"art-plates"));let S=hi(t.version),$=tt(s),M=tt(i),R=new Float32Array(o*o),E=new Float32Array(o*o),P=new Array(o*o);for(let T=0;T<o;T++)for(let z=0;z<o;z++){let W=T*o+z,D=r[W];if(D===Ht||D===Vt){R[W]=D===Vt&&a[T]?.[z]?M:$;continue}let U=1,X=0,xt=0,lt=0,N=0;for(let B=0;B<4;B++)for(let Z=0;Z<4;Z++){let Pt=z+(Z+.5)/4,ct=T+(B+.5)/4,Zt=S(Pt,ct)?s:Zl(f,(Pt-d.offsetX)/d.scale,(ct-d.offsetY)/d.scale,s,g),ae=tt(Zt);U=Math.min(U,ae),X+=ae,xt+=Zt[0],lt+=Zt[1],N+=Zt[2];}R[W]=X/16,E[W]=U,P[W]=[xt/16,lt/16,N/16];}let v=M+.08*($-M),L=$-.04*($-M),F=ic(t,R,R,{base:.74-.26*l,max:.9,dark:v,light:L,margin:.23-.1*l,cap:.4+.1*l,skip:l>=.7}),k=new Ve;for(let T=0;T<o;T++)for(let z=0;z<o;z++){let W=T*o+z,D=F.diameter[W],U=!!a[T]?.[z];if(!(D>0)||!U&&E[W]>=$-.02)continue;let X=U?we(P[W],i,v,true):we(P[W],s,L,false);k.circle(kt(X,8),(z+c+.5)*u,(T+c+.5)*u,D/2*u);}return _.push(...k.toElements("art-dot")),_.push(...pi(t,b)),_}var jf={L:.5,M:.72,Q:.88,H:1},lc=.32,cc=.55,Xf=.6,Yf=2;function uc(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,s=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:s,radius:Math.min(i,s)*.26,cx:n/2,cy:n/2}}var mc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function dc(t,e,n){return hc(e+.5,n+.5,t)<cc}function Zf(t,e){let n=mc(t),o=cc+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),s=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),l=[];for(let c=i;c<=s;c++)for(let u=r;u<=a;u++)dc(n,u,c)&&l.push(c*e+u);return l}var Kf=t=>Math.floor(t.correctable*Xf);function ii(t,e,n){let o=uc(t,e,n.size),r=Kf(n);return cr(n,Zf(o,n.size)).every(a=>a<=r)}function fc(t,e,n){if(ii(n,e,t))return n;let o=0,r=n;if(!ii(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;ii(a,e,t)?o=a:r=a;}return o}var to=new Map;function Jf(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=to.get(n);return o===void 0&&(o=fc(t,e,lc*t.size),to.size>=64&&to.clear(),to.set(n,o)),o}function t1(t,e){let{size:n,t:o,modules:r,version:a}=t,i=Af(r),s=(.18+.15*o)*jf[i],l=e.width/e.height,c=Math.min(lc,s)*n,u=lr(a,i),m=Math.max(0,Jf(u,l));if(m<Yf)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=fc(u,l,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:uc(f,l,n)}}function hc(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function pc(t,e){let{fg:n,bg:o,t:r}=t,a=tt(n),i=tt(o),s=Wl(e),l=Math.min(1,r/.6),c=s?we(s,n,a+.3*(i-a),true):n,u=qe(n,c,l),m=s?Wl(e,s):null,f=a+.42*(i-a),d=m&&tt(m)<=f+.22?qe(n,we(m,n,f,true),l):u;return {body:u,inner:d}}function e1(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:s,pixelSize:l,version:c}=t,u=di(e,n),m=t1(t,u).plate,{body:f}=pc(t,u),d=kt(f),g=m&&mc(m),h=a.map(P=>[...P]);for(let P=0;P<o;P++)for(let v=0;v<o;v++){let L=r[P*o+v];(L===Vt||g&&L!==Ht&&dc(g,v,P))&&(h[P][v]=false);}let p=[],b=t.body?.(h);if(b)p.push(A("g",{fill:d,children:b},"art-body"));else {let P=new Ve;for(let v=0;v<o;v++)for(let L=0;L<o;L++)h[v]?.[L]&&r[v*o+L]!==Ht&&P.circle(d,(L+s+.5)*l,(v+s+.5)*l,.45*l);p.push(...P.toElements("art-body"));}let _=mr(c,o).filter(([P,v])=>!g||hc(P+.5,v+.5,g)>3.2);if(_.length>0&&p.push(A("path",{d:tc(_,s,l),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return p;let y=Kl(e,n,u),w=(m.cx-m.plateW/2+s)*l,C=(m.cy-m.plateH/2+s)*l,S=m.plateW*l,$=m.plateH*l,M=m.radius*l,R=.1*l,E=We(w,C,S,$,M);return p.push(A("path",{d:E,fill:kt(i)},"art-plate"),A("path",{d:E+We(w+R,C+R,S-2*R,$-2*R,M-R),fill:kt(qe(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),sc(u,y,{x:(m.cx-m.logoW/2+s)*l,y:(m.cy-m.logoH/2+s)*l,scale:m.logoW/u.width*l},P=>P,"art-logo")),p}function gi(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&li(e.image);if(!n)return null;let o=In(t.fgColor,[0,0,0]),r=In(t.bgColor,[1,1,1]),a=ec(e,o,r);if(a<=0)return null;let i=di(e,n);if(i.palette.length===0)return null;if(no(e)==="badge"){let{body:g,inner:h}=pc({fg:o,bg:r,t:a},i),p={outer:kt(g),inner:kt(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let s=tt(o),l=tt(r),c=Math.min(1,a/.6),u=t.version*4+17,m=mi(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let C of i.palette){if(tt(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,$=C.area*(.35+Xl(C.color))*Math.exp(-S/(2*f**2));$>y&&(y=$,_=C.color);}if(!_)return {};let w=we(_,o,s+.42*(l-s),true);return {inner:kt(qe(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var n1=16384;var gc=t=>t*3+3&-4,bi=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function _i(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${e} x ${n}`);if(t.length!==e*n*4)throw new RangeError(`Expected ${e*n*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let o=gc(e),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,e,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let s=0;s<n;s++){let l=s*e*4,c=54+(n-1-s)*o;for(let u=0;u<e;u++){let m=t[l+3],f=t[l],d=t[l+1],g=t[l+2];m===255?(a[c]=g,a[c+1]=d,a[c+2]=f):(a[c]=bi(g,m),a[c+1]=bi(d,m),a[c+2]=bi(f,m)),l+=4,c+=3;}}return a}function yi(t){if(t.length<54||t[0]!==66||t[1]!==77)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getInt32(18,true),o=e.getInt32(22,true);return e.getUint32(2,true)===t.length&&e.getUint32(10,true)===54&&e.getUint32(14,true)===40&&n>0&&o>0&&e.getUint16(26,true)===1&&e.getUint16(28,true)===24&&e.getUint32(30,true)===0&&t.length===54+gc(n)*o}function ro(t){let e=t.getContext("2d");if(!e)throw new Error("Could not get canvas context");let{data:n}=e.getImageData(0,0,t.width,t.height),o=_i(n,t.width,t.height);if(!yi(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}function Y(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function et(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function O(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,s,l,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-s)}${u(s,t+n,e+s)}V${x(e+o-l)}${u(l,t+n-l,e+o)}H${x(t+c)}${u(c,t,e+o-c)}V${x(e+i)}${u(i,t+i,e)}Z`}function xi(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function vn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let s=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(s),e+n*Math.sin(s)]})}function Ln(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let s=i%2===0?n:o,l=-Math.PI/2+Math.PI/r*i;return [t+s*Math.cos(l),e+s*Math.sin(l)]})}function Tn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,s)=>{let l=2*Math.PI*s/a,c=Math.cos(l),u=Math.sin(l);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function kn(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function bc(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([s,l])=>[e+(s-e)*a-(l-n)*i,n+(s-e)*i+(l-n)*a])}function oo(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function je(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}function $i(t,e,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2)),i=(s,l)=>`A${x(a)} ${x(a)} 0 0 0 ${x(s)} ${x(l)}`;return `M${x(t+a)} ${x(e)}H${x(t+n-a)}${i(t+n,e+a)}V${x(e+o-a)}${i(t+n-a,e+o)}H${x(t+a)}${i(t,e+o-a)}V${x(e+a)}${i(t+a,e)}Z`}function ao(t,e,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2));return Y([[t+a,e],[t+n-a,e],[t+n-a,e+a],[t+n,e+a],[t+n,e+o-a],[t+n-a,e+o-a],[t+n-a,e+o],[t+a,e+o],[t+a,e+o-a],[t,e+o-a],[t,e+a],[t+a,e+a]])}function dr(t,e,n,o,r){let a=o,i=n/2,s=(i-a)*.55,l=(c,u)=>`${x(t+c)} ${x(e+u)}`;return `M${l(a,0)}C${l(a+s,0)} ${l(i-s,r)} ${l(i,r)}C${l(i+s,r)} ${l(n-a-s,0)} ${l(n-a,0)}A${x(a)} ${x(a)} 0 0 1 ${l(n,a)}C${l(n,a+s)} ${l(n-r,i-s)} ${l(n-r,i)}C${l(n-r,i+s)} ${l(n,n-a-s)} ${l(n,n-a)}A${x(a)} ${x(a)} 0 0 1 ${l(n-a,n)}C${l(n-a-s,n)} ${l(i+s,n-r)} ${l(i,n-r)}C${l(i-s,n-r)} ${l(a+s,n)} ${l(a,n)}A${x(a)} ${x(a)} 0 0 1 ${l(0,n-a)}C${l(0,n-a-s)} ${l(r,i+s)} ${l(r,i)}C${l(r,i-s)} ${l(0,a+s)} ${l(0,a)}A${x(a)} ${x(a)} 0 0 1 ${l(a,0)}Z`}function Si(t,e,n,o,r,a){let i=n/2,s=(l,c)=>`${x(t+l)} ${x(e+c)}`;return `M${s(o,0)}H${x(t+n-o)}A${x(o)} ${x(o)} 0 0 1 ${s(n,o)}V${x(e+r)}C${s(n,r+1.55*a)} ${s(i+1.6*a,n)} ${s(i,n)}C${s(i-1.6*a,n)} ${s(0,r+1.55*a)} ${s(0,r)}V${x(e+o)}A${x(o)} ${x(o)} 0 0 1 ${s(o,0)}Z`}var r1=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function _c(t){return r1.includes(t)}var yc={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function io(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?yc[e]??1:Wr;return Math.min(va,Math.max(Wr,n,t))}function o1(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function a1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function wi(t){let e=(t-17)/4,n=Number.isInteger(e)?a1(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return (a,i)=>r.some(([s,l])=>Math.abs(a-s)<=2&&Math.abs(i-l)<=2)}var i1={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function s1(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return O(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return O(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,s=o*.5;return Y([[e-i,n-s],[e+i,n-s],[e+i,n-i],[e+s,n-i],[e+s,n+i],[e+i,n+i],[e+i,n+s],[e-i,n+s],[e-i,n+i],[e-s,n+i],[e-s,n-i],[e-i,n-i]])}case "hexagon":return Y(vn(e,n,o*.54,6));case "star":return Y(Ln(e,n+o*.04,o*.62,o*.34));case "heart":return kn(e,n+o*.02,o*1.08);case "random-dots":return et(e,n,o*(.38+.15*oo(r,a)));case "mosaic":{let i=o*(.8+.14*oo(r,a,1))/2,s=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return Y(bc(s,e,n,(oo(r,a,2)-.5)*16))}case "octagon":return Y(vn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return et(e,n,o*.45)}}function xc(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=io(e.scale,r),i=t.length,s=e.plain?()=>false:wi(i),l=(h,p)=>!e.plain&&o1(h,p,i),c=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!l(h,p),u=h=>(h+.5+n)*o,m=[],f=[],d=i1[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!c(p,h))continue;let b=u(p),_=u(h);if(s(p,h)){m.push(I`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(s1(r,b,_,o*a,p,h));continue}let y=o*d.thickness*a/2,w=d.horizontal&&c(p+1,h),C=d.horizontal&&c(p-1,h),S=d.vertical&&c(p,h-1),$=d.vertical&&c(p,h+1),R=[!(S||C),!(S||w),!($||w),!($||C)].map((E,P)=>E?y*d.radius(P):0);f.push(O(b-y,_-y,2*y,2*y,R)),2*y<o&&(w&&f.push(O(b,_-y,o,2*y)),$&&f.push(O(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(c(b,p)||l(b,p))continue;let _=u(b)-o/2,y=u(p)-o/2,w=_+o,C=y+o;c(b-1,p)&&c(b,p-1)&&c(b-1,p-1)&&f.push(I`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),c(b+1,p)&&c(b,p-1)&&c(b+1,p-1)&&f.push(I`M${w} ${y}v${h}A${h} ${h} 0 0 0 ${w-h} ${y}Z`),c(b+1,p)&&c(b,p+1)&&c(b+1,p+1)&&f.push(I`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),c(b-1,p)&&c(b,p+1)&&c(b-1,p+1)&&f.push(I`M${_} ${C}v${-h}A${h} ${h} 0 0 0 ${_+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(A("path",{d:f.join("")},"modules")),m.length>0&&g.push(A("path",{d:m.join("")},"alignment")),g}var h_=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s);},l1=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let s=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let l=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),c=s.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/l),d=Math.floor(t.naturalHeight*e*m/l);s.width=f,s.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let g=c.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},$c=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await l1(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function p_(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((s,l)=>{r.fillRect(s.x-3,s.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${l}`,s.x+5,s.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var Ci=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function Ce(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=Ci(r.issues);for(let i of e){if(i.hasLength){let l=r.value;if(r.issues.some(c=>c.continue===false)||l===null||l===void 0||l.length===void 0)continue}else if(a)continue;let s=r.issues.length;i.run(r),!a&&r.issues.length>s&&(a=Ci(r.issues,s));}return r}}}function c1(t){if(typeof t=="number")return Number.isNaN(t)?"NaN":Number.isFinite(t)?"number":String(t);if(t===null)return "null";if(Array.isArray(t))return "array";if(typeof t=="object"){let e=t.constructor;if(Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&e)return e.name}return typeof t}var Ye=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${c1(e)}`}),u1={string:"characters",array:"items"};function ce(t,e,n,o){let r=u1[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var Mi=t=>typeof t=="string"?`"${t}"`:`${t}`,Mc=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Pi(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var m1=t=>t>=55296&&t<=56319,d1=t=>t>=56320&&t<=57343;function f1(t){let e=t.length;for(let n=0;n<t.length-1;n++)m1(t.charCodeAt(n))&&d1(t.charCodeAt(n+1))&&(e--,n++);return e}var Rc=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",pr=t=>({run(e){e.value<t&&e.issues.push(ce(false,"number",t,true));}}),gr=t=>({run(e){e.value>t&&e.issues.push(ce(true,"number",t,true));}}),On=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),Ec=t=>typeof t=="string"?f1(t):t.length,Ac=t=>({hasLength:true,run(e){let n=e.value;Ec(n)<t&&e.issues.push(ce(false,Rc(n),t,true));}}),Ii=t=>({hasLength:true,run(e){let n=e.value;Ec(n)>t&&e.issues.push(ce(true,Rc(n),t,true));}}),Pc=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:true});}}),h1={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?ce(true,"int",Number.MAX_SAFE_INTEGER,true):ce(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...Ye("int",e),continue:false});}},Ze=(...t)=>Ce(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(Ye("number",n)),e},t),Ic=(...t)=>Ze(h1,...t),so=(...t)=>Ce(e=>(typeof e.value!="string"&&e.issues.push(Ye("string",e.value)),e),t);function Wt(t){let e=t.length===1?`Invalid input: expected ${Mi(t[0])}`:`Invalid option: expected one of ${t.map(Mi).join("|")}`;return Ce(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var zt=t=>Wt([t]),st=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function _t(t,e=[]){let n=Object.keys(t),o=new Set(n);return Ce(r=>{let a=r.value;if(!Mc(a))return r.issues.push(Ye("object",a)),r;let i={};for(let l of n){let c=t[l],u=c.run(a[l]),m=l in a;Pi(r.issues,l,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[l],message:"Invalid input: expected nonoptional, received undefined"}),m&&(i[l]=u.value);}r.value=i;let s=[];for(let l in a)o.has(l)||s.push(l);return s.length>0&&r.issues.push({path:[],message:`Unrecognized key${s.length>1?"s":""}: ${s.map(Mi).join(", ")}`,continue:true}),r},e,{shape:t})}function Ri(t,e,n){let o=[];return e!==void 0&&o.push(Ac(e)),n!==void 0&&o.push(Ii(n)),Ce(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(ce(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Ye("array",a)),r;let i=new Array(a.length);for(let s=0;s<a.length;s++){let l=t.run(a[s]);Pi(r.issues,s,l.issues),i[s]=l.value;}return r.value=i,r},o)}function Ei(t){return Ce(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(Ye("tuple",n)),e;if(n.length<t.length)return e.issues.push(ce(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(ce(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);Pi(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function Nn(t){return Ce(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!Ci(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function vc(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return Ce(r=>{let a=r.value;if(!Mc(a))return r.issues.push(Ye("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var p1=On(Zr,`Numbers may have at most ${ot.maxDecimals} decimals`),co=[pr(-ot.maxCoordinate),gr(ot.maxCoordinate),p1],Ct=Ze(...co),It=Ze(...co,On(t=>t>0,"Must be greater than 0")),lo=Ze(...co,On(t=>t>=0,"Must not be negative")),hr=so(Pc(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),Sc=Nn([Wt(Ka),hr]),Lc=t=>_t({mix:Ei([t,t]),amount:Ze(pr(0),gr(1),On(Zr))}),Fn=Nn([Sc,Lc(Sc)]),g1=Nn([hr,Lc(Nn([Wt(["frame","accent","background"]),hr]))]),Xe=Nn([Fn,_t({gradient:_t({from:Fn,to:Fn,direction:st(Wt(["horizontal","vertical"])),steps:st(Ic(pr(2),gr(ot.maxGradientSteps)))})})]),Ai=()=>({x:Ct,y:Ct,width:It,height:It}),fr=_t({color:Fn,width:It}),b1=vc("type",[_t({type:zt("rect"),...Ai(),radius:st(lo),fill:Xe,hole:st(_t({...Ai(),radius:st(lo)})),stroke:st(fr)}),_t({type:zt("circle"),cx:Ct,cy:Ct,r:It,hole:st(It),fill:Xe,stroke:st(fr)}),_t({type:zt("ellipse"),cx:Ct,cy:Ct,rx:It,ry:It,fill:Xe,stroke:st(fr)}),_t({type:zt("polygon"),points:Ri(Ei([Ct,Ct]),3,ot.maxPolygonPoints),fill:Xe,stroke:st(fr)}),_t({type:zt("path"),d:so(Ac(2),Ii(ot.maxPathLength)),fill:Xe,fillRule:st(Wt(["nonzero","evenodd"])),stroke:st(fr)}),_t({type:zt("line"),x1:Ct,y1:Ct,x2:Ct,y2:Ct,width:It,cap:st(Wt(["butt","round"])),dash:st(Ei([It,It])),fill:Xe}),_t({type:zt("icon"),icon:Wt(Za),x:Ct,y:Ct,size:It,fill:Xe})]),wc=()=>({id:so(Pc(/^[a-z][a-z0-9-]{0,31}$/)),slot:Wt(["primary","secondary","fixed"]),text:so(Ii(200)),maxLength:st(Ic(pr(1),gr(se))),color:Fn,weight:st(Wt(["bold","regular"])),collapse:st(_t({y:Ct,height:It}))}),_1=vc("type",[_t({type:zt("text"),...wc(),box:_t(Ai()),align:st(Wt(["start","middle","end"])),fontSize:st(It)}),_t({type:zt("curved"),...wc(),curve:_t({cx:Ct,cy:Ct,radius:It,side:Wt(["top","bottom"]),spread:st(Ze(pr(20),gr(300),On(Zr)))}),fontSize:It})]),Cc=Ze(...co,On(t=>t>=ot.minArtboard&&t<=ot.maxArtboard,`Artboard sides must be ${ot.minArtboard} to ${ot.maxArtboard} units`)),y1=_t({kind:zt(rr),version:zt(or),artboard:_t({width:Cc,height:Cc}),qr:_t({x:Ct,y:Ct,size:It,padding:st(lo),radius:st(lo),plate:st(Wt(["opaque","background","none"]))}),colors:_t({frame:hr,text:st(g1),accent:st(hr)}),shapes:Ri(b1,void 0,ot.maxShapes),labels:Ri(_1,void 0,ot.maxLabels),bleed:st(Nn([zt("none"),Fn]))},[{run(t){Fl(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function uo(t){let e=y1.run(t);return e.issues.length===0?{success:true,data:e.value}:{success:false,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var Tc=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;var vi=24,Me=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},mo=([t,e])=>`${x(t)} ${x(e)}`;function Dn(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${mo(Me(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${mo(Me(t,e,o,a))}L${mo(Me(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${mo(Me(t,e,n,r))}Z`}function br(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function x1(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function kc(t){return Y(x1(t)<0?[...t].reverse():t)}function fo(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),s=(n-t)/a*(r/2);return kc([[t+i,e+s],[n+i,o+s],[n-i,o-s],[t-i,e-s]])}var Ft=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ue=(...t)=>({d:t.join(""),fillRule:"evenodd"});function $1(){let t=[];for(let e of [0,60,120]){let[n,o]=Me(12,12,10.5,e+180),[r,a]=Me(12,12,10.5,e);t.push(fo(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Me(12,12,6.2,n);for(let a of [-45,45]){let[i,s]=Me(o,r,3.6,n+a);t.push(fo(o,r,i,s,1.7));}}return Ft(...t)}var S1={wifi:()=>Ft(Dn(12,20,4.6,7.2,-135,-45),Dn(12,20,9.2,11.8,-135,-45),Dn(12,20,13.8,16.4,-135,-45),et(12,20,2.2)),star:()=>Ft(Y(Ln(12,12.8,11.6,4.8))),heart:()=>Ft(kn(12,12.4,22)),phone:()=>ue(O(6,1.5,12,21,2.6),O(7.8,4.2,8.4,13.4,.6),et(12,19.8,1.1)),headphones:()=>Ft(Dn(12,13,7.6,9.8,-180,0),O(2,12,5,9.5,2),O(17,12,5,9.5,2)),calendar:()=>ue(O(2.5,4,19,17.5,2.5),O(4.6,9,14.8,10.6,.8),O(7,11.4,2.6,2.6,.4),O(10.7,11.4,2.6,2.6,.4),O(14.4,11.4,2.6,2.6,.4),O(7,15.1,2.6,2.6,.4),O(10.7,15.1,2.6,2.6,.4),O(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),O(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>Ft(et(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>ue(O(2,3,20,14,4),Y([[6.5,17],[11.5,17],[5.8,21.8]]),et(7.5,10,1.5),et(12,10,1.5),et(16.5,10,1.5)),bag:()=>Ft(O(3.5,7.5,17,14.5,2),Dn(12,7.5,3.1,4.8,-180,0)),bell:()=>Ft("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",O(1.5,18.2,21,2.6,1.3),O(11.2,6.6,1.6,2.6,0),O(9.8,4.6,4.4,2.4,1.2)),cup:()=>Ft("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Dn(17,10.2,1.7,3.6,-90,90),O(2,20.6,17,2,1),O(7,1.6,1.6,3.4,.8),O(11.6,1.6,1.6,3.4,.8)),card:()=>ue(O(1.5,4.5,21,15,2.5),O(1.5,8,21,3,0),O(4.5,13.6,4.6,3.2,.6)),check:()=>ue(et(12,12,10.5),Y([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>ue(et(12,12,10.5),et(12,7.2,1.6),O(10.6,10,2.8,8,.8)),home:()=>ue(Y([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),O(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ue("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",et(12,9.5,3)),share:()=>Ft(fo(6,12,18,5,1.8),fo(6,12,18,19,1.8),et(18,5,3.2),et(6,12,3.2),et(18,19,3.2)),download:()=>Ft(O(10.6,2,2.8,9.5,0),Y([[6,10],[18,10],[12,16.5]]),Y([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>ue(et(12,12,10.5),et(12,12,8.4),Y([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:$1,pumpkin:()=>Ft(br(7.8,14.6,5.8,6.9),br(16.2,14.6,5.8,6.9),br(12,14.6,4.8,7.4),O(10.9,3.4,2.2,4.6,.8),kc([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Ft(Y([[12,1.5],[16.8,8.2],[7.2,8.2]]),Y([[12,5.2],[19,13.6],[5,13.6]]),Y([[12,9.4],[21.2,19.2],[2.8,19.2]]),O(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Ft(Y(Ln(9.5,13.5,9,2.4,4)),Y(Ln(19,5,4,1.1,4))),gift:()=>Ft(O(3,11.2,7.8,10.6,1),O(13.2,11.2,7.8,10.6,1),O(2,7.4,8.8,3.2,1),O(13.2,7.4,8.8,3.2,1),br(8.8,4.8,2.9,1.9),br(15.2,4.8,2.9,1.9))};function Li(t){return S1[t]()}function Fc(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function ki(t){let e=0;for(let n of t)e+=Fc(n);return Math.max(e,1)}var Ti=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function _r(t,e,n){let o=at(t)??{r:0,g:0,b:0},r=at(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${Ti(o.r+(r.r-o.r)*a)}${Ti(o.g+(r.g-o.g)*a)}${Ti(o.b+(r.b-o.b)*a)}`}function Nc(t,e,n,o,r,a,i,s){let l=[...t],c=r*.08,u=l.map(h=>Fc(h)*r),m=u.reduce((h,p)=>h+p,0)+c*Math.max(0,l.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return l.forEach((h,p)=>{let b=u[p],_=(g+b/2)/f;if(g+=b+c,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:e+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:s});}),d}var yr=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Oc=new WeakMap;function Ke(t){if(t&&typeof t=="object"){let n=Oc.get(t);if(n)return n}if(t==null)throw new yr(['A "custom" frame needs a spec']);let e=uo(t);if(!e.success)throw new yr(e.issues.map(Tc));return typeof t=="object"&&Oc.set(t,e.data),e.data}function Fi(t){let e=Ke(t);return En(e)/e.qr.size}var w1=t=>{let e=at(t);return !!(e&&e.a>=1)};function C1(t,e){let n=bt(e,ft);return t.qr.plate==="none"?{color:n,plate:false}:w1(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:ft,plate:true}}function ho(t,e,n=ft){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=l=>l==="frame"?o:l==="accent"?r:l==="background"?n:l,i=t.colors.text,s=e.textColor||(i===void 0?o:typeof i=="string"?i:_r(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:s,accent:r}}function M1(t,e,n){let o=ho(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):_r(r(a.mix[0]),r(a.mix[1]),a.amount)}function Dc(t,e,n=0,o=0){let r=nr(t);return r?Wa(r,e,n,o):""}function R1(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function E1(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),s=t.width*e/2,l=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*s,m=l*s,f=(p,b)=>{let _=[n+l*p,o+c*p],y=[n+l*b,o+c*b];if(t.cap==="round"&&b-p>2*s){let w=[_[0]+l*s,_[1]+c*s],C=[y[0]-l*s,y[1]-c*s];return `M${x(w[0]-u)} ${x(w[1]-m)}L${x(C[0]-u)} ${x(C[1]-m)}A${x(s)} ${x(s)} 0 0 1 ${x(C[0]+u)} ${x(C[1]+m)}L${x(w[0]+u)} ${x(w[1]+m)}A${x(s)} ${x(s)} 0 0 1 ${x(w[0]-u)} ${x(w[1]-m)}Z`}return `M${x(_[0]-u)} ${x(_[1]-m)}L${x(y[0]-u)} ${x(y[1]-m)}L${x(y[0]+u)} ${x(y[1]+m)}L${x(_[0]+u)} ${x(_[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function A1(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:et(t.cx*e,t.cy*e,t.r*e)+(t.hole?et(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:R1(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:Dc(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return E1(t,e);default:{let n=Li(t.icon);return {type:"path",d:Dc(n.d,t.size*e/vi,t.x*e,t.y*e),fillRule:n.fillRule}}}}function P1(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...ne(e,n,o,r,a,a),...i?ne(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:le(t.d)}function I1(t,e,n){let o=P1(t),r=Xr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",s=p=>i?p[1]:p[0],l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)l=Math.min(l,s(b)),c=Math.max(c,s(b));if(!(c>l))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=c-l,g=d*.002,h=[];for(let p=0;p<u;p++){let b=l+d*p/u,_=Math.min(c,l+d*(p+1)/u+(p+1<u?g:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>Sn(C,y)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:Pl(w),fill:_r(m,f,(p+.5)/u),fillRule:a});}return h}function v1(t,e,n){let o=A1(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=I1(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function L1(t,e){let n=Math.min(t.maxLength??ot.maxTextLength,ot.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Rn(o,n)}function T1(t){return t===void 0||!Number.isFinite(t)?1:Math.min($n,Math.max(er,t))}function k1(t,e,n,o,r,a){let i=r(t.color),s=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:_,spread:y=140}=t.curve,w=b*o*(y*Math.PI/180),C=Math.min(t.fontSize*o*n,w/(ki(e)+.08*e.length));return Nc(e,h*o,p*o,b*o,C,_,i,a).map(S=>({...S,...s}))}let l=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let f=(t.fontSize??t.box.height*Ja)*o,d=Math.min(f*n,m*ir,u/ki(e)),g=t.align??"middle";return [{text:e,x:g==="start"?l:g==="end"?l+u:l+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...g!=="middle"&&{align:g},...s,field:a}]}function F1(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let s=a.toUpperCase(),l=a!==s;switch(s){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(l?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(l?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(l?e:0)+i[5],n=(l?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let c=i.map((u,m)=>l?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),s==="M"&&(o=e,r=n),{command:s,values:c}}}})}function N1(t,e){let n=nr(t);return n?Wa(F1(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function O1(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:N1(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function D1(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=ti(r);return !(a&&o(a.y0,a.y1))}).map(r=>O1(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function xr(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,L1(p,n)])),i=D1(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),s=t/i.qr.size,l=C1(i,o),c=M1(n,i,l.color),u=i.shapes.flatMap(p=>v1(p,s,c));if(l.plate){let p=En(i)*s;u.push({type:"rect",x:i.qr.x*s-p,y:i.qr.y*s-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*s,fill:l.color});}let m=T1(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let _=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return k1(p,b,m,s,c,_)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*s,height:i.artboard.height*s,qrX:i.qr.x*s,qrY:i.qr.y*s,qrSize:t,shapes:u,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function Ni(t,e,n){return xr(t,Ke(e.spec),e,n)}var Bc={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var Oi={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Gc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Qc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var Uc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var Hc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var zc={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var Wc={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var qc={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var po={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var Vc={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var jc={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var Xc={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var Yc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var Zc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var Kc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var Jc={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var tu={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var eu={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var Mt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),Di=[Mt("banner-bottom","Banner",Oi,"frame",["bottom","band"]),Mt("banner-top","Top banner",Gc,"frame",["top","band"]),Mt("banner-top-bottom","Two banners",Qc,"frame",["top","bottom","band"]),Mt("border","Border",Uc,"background",["square","outline"]),Mt("rounded-border","Rounded",Yc,"background",["border","outline"]),Mt("gradient-border","Gradient",po,"background",["border","colorful"]),Mt("focus","Focus",qc,"background",["corners","brackets"]),Mt("speech-bubble","Bubble",Zc,"frame",["speech"]),Mt("speech-bubble-top","Bubble top",Kc,"frame",["speech"]),Mt("chat-bubble","Chat",Hc,"frame",["message","bubble"]),Mt("circle","Circle",zc,"frame",["round","ring","curved"]),Mt("badge","Ribbon",Bc,"frame",["badge","banner"]),Mt("sticker","Sticker",Jc,"frame",["label"]),Mt("polaroid","Polaroid",Xc,"frame",["photo","picture"]),Mt("phone","Phone",jc,"background",["mobile","screen"]),Mt("ticket","Ticket",eu,"frame",["event","pass"]),Mt("tag","Tag",tu,"frame",["price","label"]),Mt("envelope","Envelope",Wc,"frame",["mail","letter"]),Mt("menu-card","Menu card",Vc,"background",["menu","restaurant"])],oh=new Map(Di.map(t=>[t.style,t]));function Bi(t){return oh.get(t)}var ah=Object.fromEntries(Di.map(t=>[t.style,t.spec])),ih={from:po.colors.frame,to:po.colors.accent};function go(t){return !t||t.style==="none"?null:t.style===ar?t.spec??null:Bi(t.style)?.spec??null}function sh(t){let e=go(t);return t&&typeof e?.colors?.frame=="string"?ho(e,t):null}var lh={primary:"text",secondary:"secondaryText"};function nu(t,e,n){let o=Bi(e.style)?.spec??Oi;return xr(t,Ke(o),e,n,lh)}var _o="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",ou=.08,au="data-qrdx-frame-label";function Nt(t){return !!(t?.style&&t.style!=="none")}function Gi(t){let e=go(t);return e?Fi(e):ou}function ch(t){return (t.text??Aa).trim().slice(0,se)}function uh(t){return (t.secondaryText??"").trim().slice(0,se)}function Je(t,e,n){return e.style===ar?Ni(t,e,n):nu(t,e,n)}function me(t,e){if(!Nt(e))return {width:t,height:t};let{width:n,height:o}=Je(t,e);return {width:n,height:o}}var nt=t=>J(t,2);function ru({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,s,l,c]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?I`M${i} ${s}h${l}v${c}h${-l}z`:I`M${i+a} ${s}h${nt(l-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+I`v${nt(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+I`h${nt(-(l-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+I`v${nt(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function bo(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:nt(t.strokeWidth)}:{}}function iu(t,e){return t.type==="rect"&&t.hole?A("path",{d:ru(t)+ru(t.hole),fill:t.fill,fillRule:"evenodd",...bo(t)},e):t.type==="polygon"?A("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" "),...bo(t)},e):t.type==="path"?A("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...bo(t)},e):Jr("rect",{...bo(t),fill:t.fill,height:nt(t.height),key:e,width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}})}function su(t){return t.shapes.map((e,n)=>iu(e,n))}function $r(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,s=Je(n,o,r),l=lu(s),c=nt(s.width),u=nt(s.height);return $t("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[A("g",{"data-qrdx-frame":o.style,children:s.shapes.map((m,f)=>iu(m,f))}),He(t,{x:nt(s.qrX),y:nt(s.qrY),width:n,height:n}),l.map((m,f)=>A("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:_o,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[au]:m.field},children:m.text},f))]})}function mh(t){let{frame:e,size:n=it,bgColor:o,slot:r,svgProps:a}=t,i=r??A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg"});return Nt(e)?$r(i,{size:n,frame:e,bgColor:o,svgProps:a}):A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...a,children:He(i,{x:0,y:0,width:n,height:n})})}function lu(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var dh={2:6,3:12};function cu(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=dh[o.length];for(let i=1;i<=a;i++){let s=i/a,l=1-s;if(o.length===2){let[c]=o;e.push([l*l*n[0]+2*l*s*c[0]+s*s*r[0],l*l*n[1]+2*l*s*c[1]+s*s*r[1]]);}else {let[c,u]=o;e.push([l*l*l*n[0]+3*l*l*s*c[0]+3*l*s*s*u[0]+s*s*s*r[0],l*l*l*n[1]+3*l*l*s*c[1]+3*l*s*s*u[1]+s*s*s*r[1]]);}}}n=r;}return e}function mu(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[s,l]=o[(r+1)%o.length];i<=e!=l<=e&&n.push(a+(e-i)/(l-i)*(s-a));}return n.sort((o,r)=>o-r)}function du(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function fh(t,e,n){return du(mu(t,n),e)}function fu(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=mu(t,o),e.set(o,r)),du(r,n)}}function hh(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],s=o[1]-n[1],l=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*s)),c=Math.min(l(0),l(1));for(let[u,m]of [[a-r,i-s],[-(r+a),i+s]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,l(f)));}return c}function ph(t,e,n){if(!fh(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,hh(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function gh(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,s]of a)e=Math.min(e,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);return {x0:e,y0:n,x1:o,y1:r}}function hu(t){let e=t.map(cu),n=gh(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?ph(e,g,h)/(2*p):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let s=32;for(let g=1;g<s;g++)for(let h=1;h<s;h++){let p=n.x0+o*h/s,b=n.y0+r*g/s,_=a(p,b);_>i.value&&(i={cx:p,cy:b,value:_});}let l=o/s,c=r/s;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let _=h.cx+l*b/2,y=h.cy+c*p/2,w=a(_,y);w>i.value&&(i={cx:_,cy:y,value:w});}l/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*m,.5+(h-i.cy)*m],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(cu),half:i.value}}function pu(t,e){let n=([r,a])=>`${x(r*e)} ${x(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var bh={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},uu;function gu(){return uu??=hu([bh]),uu}function _h(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=_e&&n>=_e&&e<=De&&n<=De&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var de=([t,e])=>`${t},${e}`;function yh(t,e,n){let o=(l,c)=>t(l-1,c-1),r=new Map,a=(l,c)=>{for(let[u,m]of [[l,c],[c,l]]){let f=r.get(de(u))??[];f.push(m),r.set(de(u),f);}};for(let l=0;l<=n;l++)for(let c=0;c<=e;c++){let u=o(c,l),m=o(c+1,l),f=o(c+1,l+1),d=o(c,l+1),g=[c,l-.5],h=[c+.5,l],p=[c,l+.5],b=[c-.5,l];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],s=new Set;for(let[l,c]of r){if(s.has(l)||c.length===0)continue;let[u,m]=l.split(",").map(Number),f=[[u,m]];s.add(l);let d=[u,m],g=c[0];for(;!s.has(de(g));){s.add(de(g)),f.push(g);let h=xh(r.get(de(g))??[],d,s);if(!h)break;d=g,g=h;}f.length>=3&&i.push($h(f));}return i}function xh(t,e,n){let o=de(e);return t.find(r=>de(r)!==o&&!n.has(de(r)))??t.find(r=>de(r)!==o)}function $h(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function Sh(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var Sr=new Map;function Qi(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Sr.get(e);if(n)return n;let o=_h(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=yh(o,t.width,t.height),i=a.length>0?hu(a.map(Sh)):null;r=i&&2*i.half>=ka?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return Sr.size>16&&Sr.delete(Sr.keys().next().value),Sr.set(e,r),r}var wh=1,bu=.5,_u=.5,Ch=.5;function tn(t){return Math.max(t,Ta)}function yo(t){return t==="heart"?gu():typeof t=="object"&&t?.type==="silhouette"?Qi(t).outline:null}function wr(t){return t==="circle"||yo(t)!==null}var Mh={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function Rh(t){let{outline:e,problem:n}=Qi(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:Mh[o]}}function Et(t,e,n){if(n==="circle"){let i=tn(e),s=(t/2+i)*Math.SQRT2+wh;return Math.ceil(s-t/2)}let o=yo(n);if(!o)return e;let r=tn(e),a=(t+2*(r+Ch))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function yu(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function Eh(t,e,n){let o=Et(e,n,"circle"),r=tn(n),a=e+2*o,i=a/2,s=i-bu-.5,l=yu(Number.parseInt(je(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,g)=>{let h=l()<_u;return g>=c&&g<u&&f>=c&&f<u?false:h&&Math.hypot(g+.5-i,f+.5-i)<=s}))}var Ah=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function xu(t,e,n,o){if(o==="circle")return Eh(t,e,n);let r=yo(o);if(!r)return null;let a=Et(e,n,o),i=tn(n),s=e+2*a,l=fu(r.polygons),c=.5+bu,u=(g,h)=>{let p=g+.5,b=h+.5;return l(p/s,b/s)?Ah.every(([_,y])=>l((p+_*c)/s,(b+y*c)/s)):false},m=yu(Number.parseInt(je(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:s},(g,h)=>Array.from({length:s},(p,b)=>{let _=m()<_u;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function Ui(t,e){if(t==="circle")return {circle:e/2};let n=yo(t);return n?{path:pu(n,e)}:null}function Ph(t,e){let n=Ui(t,e);return n?"circle"in n?et(e/2,e/2,n.circle):n.path:null}function Ih(t){return t==="top-left"?0:t==="top-right"?1:3}function xo(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,s=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let l=Ih(r),c=(l+2)%4,u=1.3*s,m=.7*s,f=g=>{switch(o){case "leaf":return g===l||g===c;case "leaf-reverse":return !(g===l||g===c);case "drop":return g===l;default:return g===c}},d=[0,1,2,3].map(g=>f(g)?m:u);return A("path",{d:O(t-n,e-n,a,a,d)})}case "extra-rounded":return A("path",{d:O(t-n,e-n,a,a,1.15*s)});case "plus":{let l=1.15*s,c=n;return A("path",{d:Y([[t-l,e-c],[t+l,e-c],[t+l,e-l],[t+c,e-l],[t+c,e+l],[t+l,e+l],[t+l,e+c],[t-l,e+c],[t-l,e+l],[t-c,e+l],[t-c,e-l],[t-l,e-l]])})}case "cross-rounded":{let l=1.15*s,c=.5*s;return A("path",{d:O(t-n,e-l,a,2*l,c)+O(t-l,e-n,2*l,a,c)})}case "hexagon":return A("path",{d:Y(vn(t,e,1.72*s,6))});case "octagon":return A("path",{d:Y(vn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let l=.6*s,c=.9*s;return A("path",{d:et(t-l,e-l,c)+et(t+l,e-l,c)+et(t+l,e+l,c)+et(t-l,e+l,c)+et(t,e,1.2*s)})}case "heart":return A("path",{d:kn(t,e+.12*s,3.5*s)});case "squircle":return A("path",{d:Y(Tn(t,e,n,n,4,64))});case "dots":{let l=[];for(let c of [-1,0,1])for(let u of [-1,0,1])l.push(et(t+u*s*.82,e+c*s*.82,.58*s));return A("path",{d:l.join("")})}case "cushion":return A("path",{d:dr(t-n,e-n,a,.6*s,.15*s)});case "square":return A("rect",{height:x(a),transform:I`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return A("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:I`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return A("path",{d:I`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:I`rotate(45,${t},${e})`});case "message":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "message-reverse":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(-180,${t},${e})`})}case "diya":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}H ${c(25)}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "diya-reverse":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*l}h ${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} -${10.714285714285714*l}v -${19.285714285714285*l}h -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "rounded-triangle":{let l=a/21,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*l}c ${4.285714285714286*l} 0 ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l}v ${12.857142857142856*l}c 0 ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l}h -${12.857142857142856*l}c -${4.285714285714286*l} 0 -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l}v -${12.857142857142856*l}c 0 -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l}z`;return A("path",{d:m,transform:I`rotate(45,${t},${e})`})}case "star":{let l=a/27,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*l},-${1.0153846153846153*l},${2.215384615384615*l},-${1.0153846153846153*l},${2.884615384615384*l},0l${4.038461538461538*l},${6.069230769230768*l}c${.23076923076923075*l},${.3461538461538461*l},${.6*l},${.6*l},${1.0153846153846153*l},${.7153846153846153*l}l${7.223076923076922*l},${1.823076923076923*l}c${1.2*l},${.3*l},${1.6846153846153844*l},${1.7076923076923076*l},${.8999999999999999*l},${2.6538461538461533*l}l-${4.73076923076923*l},${5.584615384615384*l}c-${.2769230769230769*l},${.3230769230769231*l},-${.41538461538461535*l},${.7384615384615384*l},-${.3923076923076923*l},${1.1307692307692307*l}l${.4384615384615384*l},${7.199999999999999*l}c${.06923076923076922*l},${1.2*l},-${1.1769230769230767*l},${2.0769230769230766*l},-${2.3307692307692305*l},${1.6384615384615382*l}l-${6.9692307692307685*l},-${2.6076923076923073*l}c-${.3923076923076923*l},-${.16153846153846155*l},-${.8538461538461538*l},-${.16153846153846155*l},-${1.2461538461538462*l},0l-${6.9692307692307685*l},${2.6076923076923073*l}c-${1.1538461538461537*l},${.4384615384615384*l},-${2.4*l},-${.4384615384615384*l},-${2.3307692307692305*l},-${1.6384615384615382*l}l${.4384615384615384*l},-${7.199999999999999*l}c${.023076923076923075*l},-${.41538461538461535*l},-${.11538461538461538*l},-${.8307692307692307*l},-${.3923076923076923*l},-${1.1307692307692307*l}l-${4.73076923076923*l},-${5.584615384615384*l}c-${.7846153846153846*l},-${.923076923076923*l},-${.3230769230769231*l},-${2.3307692307692305*l},${.8999999999999999*l},-${2.6538461538461533*l}l${7.223076923076922*l},-${1.823076923076923*l}c${.41538461538461535*l},-${.11538461538461538*l},${.7846153846153846*l},-${.3461538461538461*l},${1.0153846153846153*l},-${.7153846153846153*l}l${4.038461538461538*l},-${6.069230769230768*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "banner":{let l=a/28;return A("g",{transform:I`translate(${t-40*l},${e-40*l}) scale(${x(l,6)})`,children:A("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return A("circle",{cx:x(t),cy:x(e),r:x(n),transform:I`rotate(0,${t},${e})`})}}function Bn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function $u(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return Y(xi(t,e,n,o*r))+Y(xi(t+r,e+r,5*r,a))}function Su(t,e,n,o,r=false){let a=n/7,i=s=>r?Bn(o,0,s,true):Bn(o,s,0,true);return O(t,e,n,n,i(2.5*a))+O(t+a,e+a,5*a,5*a,i(1.5*a))}function vh(t,e,n,o){let r=n/7;return O(t,e,n,n,Bn(o,2.6*r,0,false))+O(t+r,e+r,5*r,5*r,Bn(o,1.6*r,0,false))}function Lh(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return Y(Tn(r,a,3.5*o,3.5*o,4,96))+Y(Tn(r,a,2.5*o,2.5*o,4,96))}function Th(t,e,n){let o=n/7,r=.12*o;return dr(t,e,n,1.4*o,r)+dr(t+o,e+o,5*o,.7*o,r)}function kh(t,e,n){let o=n/7;return Si(t,e,n,.7*o,3.9*o,o)+Si(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Fh(t,e,n,o){let r=n/7;return O(t,e,n,n,Bn(o,.5*r,2.5*r,false))+O(t+r,e+r,5*r,5*r,Bn(o,.25*r,1.5*r,false))}function Nh(t,e,n){return O(t+n,e+n,5*n,5*n,1.5*n)}function Oh(t,e,n){return Y(Tn(t,e,3.5*n,3.5*n,2.75,96))}function Dh(t,e,n){let o=n/7;return Oh(t+n/2,e+n/2,o)+ao(t+o,e+o,5*o,5*o,.52*o)}function Bh(t,e,n){let o=n/7;return $i(t,e,n,n,1.15*o)+$i(t+o,e+o,5*o,5*o,.74*o)}function Gh(t,e,n){let o=n/7;return ao(t,e,n,n,.8*o)+ao(t+o,e+o,5*o,5*o,.52*o)}function Hi(t,e,n,o){let[r,a,i,s]=o,l=(u,m)=>I`${t+u} ${e+m}`,c=(u,m,f)=>u[0]==="round"?I`A${u[1]} ${u[1]} 0 0 1 ${l(m,f)}`:I`L${l(m,f)}`;return I`M${l(r[1],0)}L${l(n-a[1],0)}`+c(a,n,a[1])+I`L${l(n,n-i[1])}`+c(i,n-i[1],n)+I`L${l(s[1],n)}`+c(s,0,n-s[1])+I`L${l(0,r[1])}`+c(r,r[1],0)+"Z"}function Qh(t,e){let n=[0,1,2,3].map(r=>e(r)?["round",2.8*t]:["cut",1.6*t]),o=[0,1,2,3].map(r=>e(r)?["round",1.5*t]:["cut",1.01*t]);return [n,o]}function Uh(t,e,n,o){let r=n/7,a=o==="top-left"?0:o==="top-right"?1:3,i=(a+2)%4,[s,l]=Qh(r,c=>c===a||c===i);return Hi(t,e,n,s)+Hi(t+r,e+r,5*r,l)}function Hh(t,e,n){let o=n/7;return Hi(t,e,n,[["cut",1.6*o],["cut",1.6*o],["round",3*o],["round",3*o]])+Nh(t,e,o)}function zh(t,e,n){let o=n/7;return I`M ${t} ${e}v ${n}h ${n}v -${n}z`+I`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function Wh(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=I`M ${t+r} ${e}`+I`h ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${r} ${r}`+I`v ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${-r} ${r}`+I`h ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${-r} ${-r}`+I`v ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=I`M ${t+o+a} ${e+o}`+I`h ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${a} ${a}`+I`v ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${-a} ${a}`+I`h ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${-a} ${-a}`+I`v ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function qh(t,e,n){let o=t+n/2,r=e+n/2,a=J(n/2),i=J(n*(2.5/7));return I`M ${o-a} ${r}`+I`a ${a} ${a} 0 1 0 ${a*2} 0`+I`a ${a} ${a} 0 1 0 ${-a*2} 0z`+I`M ${o-i} ${r}`+I`a ${i} ${i} 0 1 1 ${i*2} 0`+I`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Vh(t,e,n){let o=n/74.7002,r=s=>s*o+t,a=s=>s*o+e;return I`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function zi(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function jh(t,e,n){let{scale:o,transform:r}=zi(n);return I`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function Xh(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=I`M ${t+r} ${e}`+I`h ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${r} ${r}`+I`v ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${-r} ${r}`+I`h ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${-r} ${-r}`+I`v ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=I`M ${t+o+a} ${e+o}`+I`h ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${a} ${a}`+I`v ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${-a} ${a}`+I`h ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${-a} ${-a}`+I`v ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function Yh(t,e,n){let{scale:o,transform:r}=zi(n);return I`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function Zh(t,e,n){let{scale:o,transform:r}=zi(n);return I`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function Kh(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(l,c)=>l*o+c;return I`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function $o(t,e,n,o,r="top-left"){switch(o){case "leaf":return Su(t,e,n,r);case "leaf-reverse":return Su(t,e,n,r,true);case "drop":return vh(t,e,n,r);case "octagon":return $u(t,e,n,1.6);case "bevel":return $u(t,e,n,1.1);case "squircle":return Lh(t,e,n);case "cushion":return Th(t,e,n);case "shield":return kh(t,e,n);case "petal":return Fh(t,e,n,r);case "porthole":return Dh(t,e,n);case "notch":return Bh(t,e,n);case "plus":return Gh(t,e,n);case "bud":return Uh(t,e,n,r);case "bowl":return Hh(t,e,n);case "gear":return Vh(t,e,n);case "rounded":return Wh(t,e,n);case "circle":return qh(t,e,n);case "diya":return jh(t,e,n);case "extra-rounded":return Xh(t,e,n);case "message":return Yh(t,e,n);case "pointy":return Zh(t,e,n);case "curly":return Kh(t,e,n);default:return zh(t,e,n)}}var So=.22,wo=.14;function wu(t,e,n={}){if(t==="circle")return A("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*So:0;return A("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function Jh(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Co(t,e){let n=t.shape??"square",o=t.plate,r=o?Jh(e,wo):e,a=s=>A("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...s&&{clipPath:`url(#${s})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${je(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return $t("g",{children:[o&&wu(n,e,{fill:o}),i&&A("clipPath",{id:i,children:wu(n,r)}),a(i)]})}var Cu=.6,tp=["L","M","Q","H"];function Mu(t){let e=dt.QrCode.encodeText(t.value,St[t.level]),n=tp[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Et(e.size,t.margin,t.shape),map:lr(e.version,n),level:n,version:e.version}}function Ru(t,e){let{cells:n,map:o}=t,r=n.length,a=Re(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},s=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)s.push(c*r+u);let l=cr(o,s);return {worst:Math.max(0,...l),correctable:o.correctable,budget:Math.floor(o.correctable*Cu),level:t.level,version:t.version}}function Mo(t,e){return Ru(Mu(t),e)}var Eu=t=>!t||t.worst<=t.budget;function ep(t,e){return Eu(Mo(t,e))}function Wi(t,e,n,o){let r=e.map(s=>Mu({...t,level:s})),a=s=>{let l=o(s);return r.every(c=>Eu(Ru(c,l)))};if(a(n))return n;let i=t.size*.005;for(let s=n-i;s>0;s-=i)if(a(s))return s;return 0}function Gn(t,e){if(!e)return;let n=Math.floor(t.size*Hr),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Jt,s={value:t.value,size:t.size,margin:t.margin,shape:t.shape},l=f=>At({...t,level:i,imageSettings:f}),c=f=>{let d=Wi(s,[f],o,a);return d>0?a(d):void 0},u=l(e);if(u===i)return c(i);let m=c(u);return m&&l(m)===u?m:c(i)}var Au={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},Pu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Iu=["circle","curly"],vu=["diamond","banner","star"],Lu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},jt=["square","liquid","classy","classy-rounded"],Tu={"circle/rounded":jt,"circle/extra-rounded":jt,"circle/message":[...jt,"leaf"],"circle/pointy":jt,"circle/leaf-reverse":jt,"circle/drop":jt,"circle/bevel":[...jt,"leaf"],"circle/squircle":[...jt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":jt,"circle/shield":[...jt,"rounded","horizontal-line","leaf"],"circle/petal":jt};function ku(t,e,n){return (Lu[t]?.includes(e)??false)&&!Tu[`${t}/${e}`]?.includes(n)}function qi(t){let e=Gt(tr,t.bodyPattern??"circle"),n=Gt(Ne,t.cornerEyePattern??"gear"),o=Gt(Oe,t.cornerEyeDotPattern??"circle");return Au[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Pu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:vu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Iu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:ku(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var Vi=t=>{let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},np=t=>255*(t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055);function Ou({r:t,g:e,b:n}){let o=Vi(t),r=Vi(e),a=Vi(n),i=Math.cbrt(.4122214708*o+.5363325363*r+.0514459929*a),s=Math.cbrt(.2119034982*o+.6806995451*r+.1073969566*a),l=Math.cbrt(.0883024619*o+.2817188376*r+.6299787005*a),c=1.9779984951*i-2.428592205*s+.4505937099*l,u=.0259040371*i+.7827717662*s-.808675766*l;return {l:.2104542553*i+.793617785*s-.0040720468*l,c:Math.hypot(c,u),h:Math.atan2(u,c)}}function ji({l:t,c:e,h:n}){let o=e*Math.cos(n),r=e*Math.sin(n),a=(t+.3963377774*o+.2158037573*r)**3,i=(t-.1055613458*o-.0638541728*r)**3,s=(t-.0894841775*o-1.291485548*r)**3;return [4.0767416621*a-3.3077115913*i+.2309699292*s,-1.2684380046*a+2.6097574011*i-.3413193965*s,-0.0041960863*a-.7034186147*i+1.707614701*s]}var Fu=1e-7,Nu=t=>t.every(e=>e>=-Fu&&e<=1+Fu),rp=20;function Ro(t){let e=ji(t);if(!Nu(e)){let a=0,i=t.c;for(let s=0;s<rp;s++){let l=(a+i)/2;Nu(ji({...t,c:l}))?a=l:i=l;}e=ji({...t,c:a});}let[n=0,o=0,r=0]=e.map(a=>Math.round(np(Math.min(1,Math.max(0,a)))));return {r:n,g:o,b:r,a:1}}var Bu="gear",op="circle";function re(t,e){let n=t.eyeShapes?.[e];return {outer:Gt(Ne,n?.outer??t.cornerEyePattern??Bu),inner:Gt(Oe,n?.inner??t.cornerEyeDotPattern??op)}}var ap=["curly","circle"];function Ki(t){let e=Be.map(n=>re(t,n));for(let n of ap)if(e.some(o=>o.outer===n))return n;return e[0]?.outer??Bu}var Du=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function Ji(t){let e=null,n=new Set;for(let o of Be){let{outer:r,inner:a}=re(t,o),i=`${r}/${a}`;if(n.has(i))continue;n.add(i);let s=qi({bodyPattern:t.bodyPattern,cornerEyePattern:r,cornerEyeDotPattern:a});s&&(!e||Du.indexOf(s.kind)<Du.indexOf(e.kind))&&(e=s);}return e}function Un(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||wr(o)||n<=0)return 0;let r=Math.min(qr,Fa*n/(e+2*n));return Math.min(t,r)}function ip(t){let{value:e,level:n,shape:o,autoLevel:r,isOGContext:a}=t,i=t.size??it,s=t.margin??pt,l=Gn({value:`${e}`,size:i,margin:s,level:n,shape:o,autoLevel:r,isOGContext:a},t.imageSettings),c=At({value:`${e}`,size:i,level:n,margin:s,imageSettings:l,isOGContext:a,autoLevel:r,shape:o}),u=dt.QrCode.encodeText(`${e}`,St[c]).size;return Un(qr,u,s,o)}var Zi=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),sp=/^hsla?\(([^)]*)\)$/,lp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,cp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function Xi(t,e){let n=t?.trim()??"";if(!cp.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||e?o/100:o;return Math.min(1,Math.max(0,r))}function up(t){let e=sp.exec(t);if(!e)return null;let[n="",o]=(e[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[a="",i,s,l]=r,c=Xi(i,true),u=Xi(s,true),m=Xi(o??l??"1",false),f=Number.parseFloat(a);if(!(lp.test(a)&&[c,u,m].every(Number.isFinite)))return null;let d=c*Math.min(u,1-u),g=h=>{let p=(h+f/30)%12,b=p<0?p+12:p;return 255*(u-d*Math.max(-1,Math.min(b-3,9-b,1)))};return {r:g(0),g:g(8),b:g(4),a:m}}function Io(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:at(e)??up(e)}function Eo(t){return Io(t)?.a??1}function Gu(t){let e=Lt(t,ft);return e.type==="solid"?Eo(e.color)<1:e.type==="image"?Eo(e.underlay??"transparent")<1:e.stops.some(n=>Eo(n.color)<1)}var Qn=({r:t,g:e,b:n})=>[.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n],Po=Qn(at(Ge)),nn=1e-9,Ao=(t,e,n)=>t.every((o,r)=>o>=e[r]-nn&&o<=n[r]+nn),ts=({r:t,g:e,b:n})=>`#${[t,e,n].map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`;function Qu(t){let e=Io(t.color||Vr);return e&&e.a>0?ts(e):Vr}var mp=24,dp=12;function Uu(t,e,n){if(Ao(Qn(t),e,n))return t;if(t.r===t.g&&t.g===t.b){let c=Math.min(Math.floor(Math.min(...n)+nn),Math.max(t.r,Math.ceil(Math.max(...e)-nn)));return c>=Math.max(...e)-nn?{r:c,g:c,b:c,a:1}:null}let o=Ou(t),r=c=>{let u=Ro({l:o.l,c,h:o.h}),m=Qn(u);if(Ao(m,e,n))return u;let f=m.some((b,_)=>b<e[_]),d=b=>Qn(b).every((_,y)=>f?_>=e[y]-nn:_<=n[y]+nn),g=o.l,h=f?1:0;for(let b=0;b<mp;b++){let _=(g+h)/2;d(Ro({l:_,c,h:o.h}))?h=_:g=_;}let p=Ro({l:h,c,h:o.h});return Ao(Qn(p),e,n)?p:null},a=r(o.c);if(a)return a;let i=r(0);if(!i)return null;let s=0,l=o.c;for(let c=0;c<dp;c++){let u=(s+l)/2,m=r(u);m?(s=u,i=m):l=u;}return i}var Yi="or turn the halo off";function Hu(t){let e=Lt(t,ft);if(e.type==="image")return {reason:"picture",message:"A halo isn't drawn on a picture background: on the picture's darker parts the rim makes the code unreadable",fix:`Use a background color, ${Yi}`};if(Gu(t))return {reason:"see-through",message:"A halo needs an opaque background: on a grey surface under a see-through code the rim makes it unreadable",fix:`Give the code an opaque background, ${Yi}`};let n=(e.type==="solid"?[e.color]:e.stops.map(r=>r.color)).map(Io),o=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r of n){let a=r?Qn(r):[0,0];o[0]=Math.min(o[0],a[0]),o[1]=Math.min(o[1],a[1]);}return Ao(Po,Po,o)?o:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${Ge}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${Ge} or lighter, ${Yi}`}}function es(t,e){let n=Hu(e);if(!Array.isArray(n))return n;let o=Qu(t),r=Uu(at(o),Po,n);return {drawn:r?ts(r):Ge,picked:o}}function fp(t,e){let n=es({color:t},e);return "drawn"in n?n.drawn:null}function hp(t,e,n=4){let o=Hu(e),r=Io(t);if(!(Array.isArray(o)&&r))return [];let a=new Set;for(let i=0;i<n;i++){let s=i/n,l=Po.map((u,m)=>u+s*((o[m]??u)-u)),c=Uu({...r,a:1},l,o);c&&a.add(ts(c));}return [...a]}function ns(t){if(!t.halo)return null;let e=es(t.halo,t.bgColor);return "drawn"in e?e.drawn===e.picked?null:{reason:"adjusted",color:e.drawn,message:`Halo drawn as ${e.drawn} instead of ${e.picked} so the code still scans: a rim must read no lighter than the background and at least as light as ${Ge}`,fix:`To have it drawn as picked, choose a color in that range, such as ${e.drawn}`}:e}function Cr(t,e){if(!t)return null;let n=e?es(t,e.bgColor):null;if(n&&!("drawn"in n))return null;let o=Zi(t.width,Da,Na,Oa);return {color:n?n.drawn:Qu(t),width:o}}function rs(t){if(!t)return null;let e=r=>Zi(r,Ba,-jr,jr),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||Ha,opacity:Zi(t.opacity,Ua,Ga,Qa),dx:n,dy:o}}var os="data-qrdx-part",zu="data-qrdx-eye",pp=["eye-outer","eye-centre","body","logo","background"];function as(t,e,n){if(t)return n?{[os]:e,[zu]:n}:{[os]:e}}var Mr=300;function oe(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=Ke(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:bt(r,""))||"black",i=xr(o.qr.size,o,{color:a}),{x:s,y:l,scale:c}=t.at;return A("svg",{height:Mr,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Mr} ${Mr}`,width:Mr,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:$t("g",{"data-qrdx-template":t.id,transform:`translate(${x(s)} ${x(l)})${c===1?"":` scale(${c})`}`,children:[su(i),A("g",{fill:"none",transform:`translate(${x(i.qrX)} ${x(i.qrY)}) scale(${i.qrSize/Mr})`,children:e})]})})}}}var Wu={kind:"qrdx.frame",version:1,artboard:{width:185,height:178},qr:{x:35,y:0,size:150,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",fill:"frame"}],labels:[]};var qu=oe({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Wu,at:{x:47,y:95,scale:1}});var Vu={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>A("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:A("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Er=593,Ee=296.5,Rr=146.5,Ju=294.5,t0=231.228,e0="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",bp="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",_p="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",ju="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Xu=52,yp=240;function Yu(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var is;function xp(){if(!is){let t=Yu(bp),e=Yu(_p),n=[];for(let o=0;o<ju.length;o+=3){let r=Number.parseInt(ju.slice(o,o+3),36);n.push({cx:t[Math.floor(r/Xu)],cy:e[r%Xu]});}is=n;}return is}function $p(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function n0(t){let e=xp(),n=$p(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,yp).sort((a,i)=>a-i).map(a=>e[a])}var Zu=300,Sp=49,wp=6;function r0(t,e){if(Zu/e<=Sp+.5)return t;let n=Rr,o=Rr+Zu,r=wp*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var o0="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Ar=32,a0=3.5,Cp=Ar*er,i0=246.5,fe=2*Math.PI*i0,cs=.36,Ku=i0+cs*Ar,ss=400;function Hn(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function Mp(t){let e=t.slice(0,ss).split(" ").map(n=>Rn(n,ss)).join(" ");return Array.from(e).slice(0,ss)}var Rp="\u2026",s0=1;function l0(t,e,n,o=false){return o&&e===t.length-1?s0*n:Hn(t[e],n)}function us(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=l0(t,r,e,n);return o}function ls(t,e,n,o=false){return us(t,e,o)+n*Math.max(0,t.length-1)+Hn(" ",e)+2*n<=fe}var c0=t=>t.join("").split(" ").filter(Boolean),Ep=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function u0(t,e,n){if(ls(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,Cp),a=(h,p=false)=>{let b=us(h,e,p)+Hn(" ",e),_=h.length+1,y=(fe-b)/_;if(y>=o)return {chars:h,fontSize:e,letterSpacing:y,cut:p};let w=(fe-o*_)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let s=c0(t),l=m0(s);for(let h=s.length/l.length-1;h>=1;h--){let p=Ep(l,h);if(ls(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let c=fe-Hn(" ",r)-s0*r-2*o,u=0,m=0,f=0;for(let[h,p]of t.entries()){if(u+=Hn(p,r)+o,u>c)break;f=h+1,(f===t.length||t[f]===" ")&&(m=f);}let d=[...Ap(t.slice(0,m>0?m:f)),Rp];return (ls(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function Ap(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function m0(t){for(let e=1;e<t.length;e++)if(t.length%e===0&&t.every((n,o)=>n===t[o%e]))return t.slice(0,e);return t}function Pp(t,e,n){let o=c0(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(m0(o).join(" ")),a=us(r,e)+Hn(" ",e),i=a+(r.length+1)*n,s=Math.min(n,0),l=null;for(let c of new Set([Math.floor(fe/i),Math.ceil(fe/i)])){if(c<1)continue;let u=(fe-c*a)/(c*(r.length+1));if(u>=s&&(!l||Math.abs(u-n)<Math.abs(l.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));l={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return l??u0(r,e,n)}function d0(t,e){let{position:n,rotation:o}=e,r=Mp(t),a=e.fill==="repeat"?Pp(r,e.fontSize,e.letterSpacing):u0(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:s}=a,l=[],c=0;for(let[h,p]of a.chars.entries()){let b=l0(a.chars,h,i,a.cut);l.push({char:p,along:c+b/2}),c+=b+s;}let u=c-(l.length>0?s:0),m=n!=="bottom",f=m?Ku-cs*i:Ku+cs*i,d=u/fe*180,g=[];for(let{char:h,along:p}of l){if(h.trim()==="")continue;let b=p/fe*360,_=m?o-d+b:o+180+d-b,y=_*Math.PI/180;g.push({char:h,x:J(Ee+f*Math.sin(y)),y:J(Ee-f*Math.cos(y)),rotate:J(m?_:_-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:J(i),letterSpacing:s}}var zn=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,f0={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=bt(e?.fgColor,"#000000"),r=bt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=J(a/2),s=r0(n0(n?.url??""),a),l=zn(e?.fontSize,Ar),c=l>0?l:Ar,u=typeof e?.customText=="string"?e.customText:o0,m=d0(u,{fontSize:c,letterSpacing:zn(e?.fontLetterSpacing,a0),position:e?.textPosition==="bottom"?"bottom":"top",rotation:zn(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||_o,g=e?.fontWeight??900,h=zn(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:Ee,width:zn(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:t0,width:zn(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(_=>_.width>0);return $t("svg",{height:Er,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Er} ${Er}`,width:Er,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A("circle",{cx:Ee,cy:Ee,fill:r,r:Ju}),A("g",{fill:o,children:s.map((_,y)=>A("circle",{cx:_.cx,cy:_.cy,r:i},y))}),A("path",{d:e0,fill:e?.outerCircleColor||o}),b.map((_,y)=>A("circle",{cx:Ee,cy:Ee,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},y)),A("g",{"aria-hidden":"true",children:m.letters.map((_,y)=>A("text",{fill:f,fontFamily:d,fontSize:m.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},y))}),A("g",{transform:`translate(${Rr} ${Rr})`,children:t})]})}};var h0={kind:"qrdx.frame",version:1,artboard:{width:220,height:277},qr:{x:52,y:122,size:114,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"circle",cx:110,cy:167.682,r:99.318,fill:"#FFFFFF",stroke:{color:"#F89941",width:20}},{type:"ellipse",cx:139.989,cy:67.895,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:126.072,cy:69.487,rx:34.051,ry:50.662,fill:"#F89941"},{type:"path",d:"M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:106.316,cy:70.849,rx:33.673,ry:47.851,fill:"#F89941"},{type:"ellipse",cx:78.743,cy:68.448,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:91.744,cy:69.763,rx:32.944,ry:50.385,fill:"#F89941"},{type:"path",d:"M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:111.677,cy:70.871,rx:32.39,ry:47.616,fill:"#F89941"},{type:"ellipse",cx:106.971,cy:71.425,rx:33.221,ry:47.616,fill:"#F89941"},{type:"path",d:"M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",fill:"#000000"},{type:"path",d:"M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",fill:"#000000"},{type:"path",d:"M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",fill:"#000000"},{type:"path",d:"M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",fill:"#5D725F"}],labels:[]};var p0=oe({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:h0,at:{x:38,y:10,scale:1}});var g0={kind:"qrdx.frame",version:1,artboard:{width:316,height:316},qr:{x:20,y:20,size:276,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:"frame",fillRule:"evenodd"}],labels:[]};var b0=oe({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:g0,at:{x:0,y:0,scale:300/316}});var _0={kind:"qrdx.frame",version:1,artboard:{width:208,height:298},qr:{x:14,y:14,size:180,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",fill:"frame"},{type:"path",d:"M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.67l-20.55 -20.55a2.33 2.33 0 0 0 -3.25 0l-20.55 20.55a2.29 2.29 0 0 1 -1.62 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",fill:"frame"}],labels:[]};var y0=oe({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:_0,at:{x:46,y:1,scale:1}});var x0={kind:"qrdx.frame",version:1,artboard:{width:252,height:300},qr:{x:40,y:38,size:174,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",fill:"#22071b"},{type:"path",d:"M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",fill:"#22071b"},{type:"path",d:"M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",fill:"#22071b"},{type:"path",d:"M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",fill:"#22071b"},{type:"path",d:"M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",fill:"#22071b"},{type:"path",d:"M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.18 -2.12a2.14 2.14 0 1 1 2.41 3.53l-5.52 3.67V76.9l-7 4.66a2.15 2.15 0 0 0 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.57 3l-6.36 4.24V275a10.09 10.09 0 0 0 9.83 10.11l-5.87 4a2.15 2.15 0 0 0 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.36l23 -15.41a2.14 2.14 0 0 1 2.41 3.54l-6.58 4.45h52l-5.58 3.75a2.14 2.14 0 0 0 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 277.35a2.14 2.14 0 1 1 2.33 3.6l-6.78 4.38h13a10.18 10.18 0 0 0 10.18 -10.18v-91.1l-4.38 3a2.43 2.43 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l24.38 -16.33a2.13 2.13 0 1 0 -2.4 -3.53l-15.48 10.25V91.53l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.71 -9.19a2.14 2.14 0 0 0 -2.4 -3.54l-11.24 7.57V75.84l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",fill:"#22071b"},{type:"path",d:"M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",fill:"#22071b"}],labels:[]};var $0=oe({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:x0,at:{x:24,y:0,scale:1}});var Pr={default:Vu,Arrow:qu,StandardBox:y0,SquareBorder:b0,StrikedBox:$0,Halloween:p0,DotRing:f0},S0={FlamQR:"DotRing"},vo=t=>{if(Object.hasOwn(Pr,t))return Pr[t];let e=Object.hasOwn(S0,t)?S0[t]:void 0;return e?Pr[e]:void 0},l3=()=>Object.values(Pr),c3=()=>Object.keys(Pr);var ms=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function R0(t){return `#${ms(t.r)}${ms(t.g)}${ms(t.b)}`}function Wn(t){let e=at(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:R0(e),opacity:J(e.a,3)}}function Lo(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}var E0={r:0,g:0,b:0,a:1};function kp(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:at(e.color)??E0})).sort((e,n)=>e.offset-n.offset)}function ds(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return E0;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let s=i.offset-a.offset,l=s>0?(e-a.offset)/s:1,c=a.color.a+(i.color.a-a.color.a)*l,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*l;return c>0?d/c:m+(f-m)*l};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var w0=4,C0=720,Fp=2;function A0(t,e,n,o,r){let a=kp(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,s=a.every(_=>Math.abs(_.color.a-i)<.002),l=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),c=[];for(let _=0;_+1<l.length;_++){let y=l[_],w=l[_+1];if(w<=y)continue;let C=ds(a,y+1e-9),S=ds(a,w-1e-9),$=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),M=Math.ceil($/Fp),R=Math.ceil((w-y)*360/w0),E=Math.max(1,M,R);for(let P=0;P<E;P++)c.push([y+(w-y)*P/E,y+(w-y)*(P+1)/E]);}let u=c;if(c.length>C0){let _=Math.ceil(c.length/C0);u=[];for(let y=0;y<c.length;y+=_){let w=c.slice(y,y+_);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*w0/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [x(n+f*Math.cos(y)),x(o+f*Math.sin(y))]},g=`${x(n)} ${x(o)}`,h=_=>J((_%360+360)%360,4),p=u.length-1,b=u.map(([_,y],w)=>{let C=ds(a,(_+y)/2),S=(y-_)*360,$=s&&w===0&&p>0?S:0,M=s&&w<p?S:0,R=m+_*360-$,E=m+y*360+M,[P,v]=d(R),[L,F]=d(E);return {d:`M${g}L${P} ${v}L${L} ${F}Z`,color:R0(C),...s||C.a>=1?{}:{opacity:J(C.a,3)},from:h(R),sweep:J(E-R,4)}});return s&&i<1?{wedges:b,opacity:J(i,3)}:{wedges:b}}function M0(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function P0(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=M0(t,e,n.x+n.width/2,n.y+n.height/2),i=0,s=0;for(let[l,c]of r){let u=M0(t,e,l,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),s=Math.max(s,u);}return [a+i,a+s]}function I0(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}function hs(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function T0(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,s)=>{if(!i&&a!==null){n.push(I`M${a+e} ${r+e}h${s-a}v1H${a+e}z`),a=null;return}if(s===o.length-1){if(!i)return;a===null?n.push(I`M${s+e},${r+e} h1v1H${s+e}z`):n.push(I`M${a+e},${r+e} h${s+1-a}v1H${a+e}z`);return}i&&a===null&&(a=s);});}),n.join("")}function Np(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var Op=.9;function fs(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(_c(r))return xc(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=io(e.scale,r),s=[],l=t.length,c=o*.45,u=a?()=>false:wi(l);return t.forEach((m,f)=>{m.forEach((d,g)=>{if(d&&(a||!Np(g,f,l))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,_=s.length;if(u(g,f)){s.push(A("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(p-o/2)},b));return}switch(r){case "circle":s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:I`rotate(0,${h},${p})`},b));break;case "circle-large":{let y=o*.5;s.push(A("circle",{cx:x(h),cy:x(p),r:x(y),transform:I`rotate(0,${h},${p})`},b));}break;case "small-square":{let y=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:I`rotate(0,${h},${p})`},b));}break;case "diamond":{let y=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:I`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let y=(g+f)%3===0?Op:(g+f)%2===0?1:1.25,w=c*y;s.push(A("circle",{cx:x(h),cy:x(p),r:x(w),transform:I`rotate(0,${h},${p})`},b));}break;case "pacman":{let y=o*.5,w=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-w}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:I`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let y=o*.5,w=o*.2;s.push(A("rect",{height:x(o),rx:x(w),ry:x(w),transform:I`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "square":{let y=o*.5;s.push(A("rect",{height:x(o),transform:I`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "vertical-line":{let y=o*.714286,w=o;s.push(A("path",{d:I`M ${h-o*.5} ${p-y*.5}v ${y}h ${w}v -${y}z`,transform:I`rotate(90,${h},${p})`},b));}break;default:s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:I`rotate(0,${h},${p})`},b));}if(i!==1&&s.length>_){let y=s.pop();s.push(A("g",{transform:I`translate(${h},${p}) scale(${x(i,6)}) translate(${-h},${-p})`,children:y},b));}}});}),s}function Dp(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),s=r-a*Math.sin(n),l=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:s,x2:l,y2:c}}function ps(t,e){return `${t}-${je(JSON.stringify(e))}`}function Bp(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,s=e+o/2,l=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=s-c*Math.cos(i),m=l-c*Math.sin(i),f=s+c*Math.cos(i),d=l+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Fo(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Wn(n.color);return A("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function k0(t,e,n,o,r,a){let i=A0(e.stops,e.angle??0,n,o,r),s=i.wedges.map((l,c)=>A("path",{d:l.d,"data-arc":`${l.from} ${l.sweep}`,fill:l.color,fillOpacity:l.opacity,shapeRendering:l.opacity===void 0?void 0:"crispEdges"},`${t}-w-${c}`));return A("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?s:A("g",{opacity:i.opacity,children:s})},t)}function Gp(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var Qp=["xMin","xMid","xMax"],Up=["YMin","YMid","YMax"];function F0(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Wn(e.underlay):null,s=r?a:n*o,l=Gp(e.position),c=r?0:l.x*(n-s),u=r?0:l.y*(n-s),m=r?"xMidYMid slice":`${Qp[l.x*2]??"xMid"}${Up[l.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return $t("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&A("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),A("image",{height:x(s),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:x(s),x:x(c),y:x(u)})]},t)}var N0=(t,e)=>ps("img",[t,e]);function Hp(t,e,n,o,r,a,i){let s=Lt(t);if(s.type==="solid")return null;if(s.type==="image"){let c=N0(s,i);return {id:c,element:F0(c,s,i)}}let l=ps(a,[s,e,n,o,r,...s.type==="angular"?[i]:[]]);if(s.type==="linear"){let c=s,u=c.angle??0,{x1:m,y1:f,x2:d,y2:g}=Bp(u,e,n,o,r);return {id:l,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:l,x1:x(m),x2:x(d),y1:x(f),y2:x(g),children:Fo(l,c.stops)},l)}}if(s.type==="radial"){let c=s,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:l,element:A("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:l,r:x(f),children:Fo(l,c.stops)},l)}}return s.type==="angular"?{id:l,element:k0(l,s,e+o/2,n+o/2,o*.75,i)}:null}function To(t,e,n){let o=Lt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=N0(o,e);return {id:a,element:F0(a,o,e)}}let r=ps(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:s,y1:l,x2:c,y2:u}=Dp(i,e);return {id:r,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(s),x2:x(c),y1:x(l),y2:x(u),children:Fo(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,s=e/2,l=e/2*.97;return {id:r,element:A("radialGradient",{cx:x(i),cy:x(s),fx:x(i),fy:x(s),gradientUnits:"userSpaceOnUse",id:r,r:x(l),children:Fo(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:k0(r,o,e/2,e/2,e*.75,e)}:null}var ko=t=>Fe(t)||Ra(t);function v0(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function he(t,e,n){if(e)return {fill:`url(#${e})`};let o=Lt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Wn(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Re(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*Hr),i=(r+2*n)/e,s=(o.width||a)*i,l=(o.height||a)*i,c=o.x==null?r/2-s/2:o.x*i,u=o.y==null?r/2-l/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),g=Math.floor(u-f),h=Math.ceil(s+c+f-d),p=Math.ceil(l+u+f-g);m={x:d,y:g,w:h,h:p};}return {x:c,y:u,h:l,w:s,excavation:m}}function At(t){let e=t.level??Jt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=dt.QrCode.encodeText(t.value,St[o]).getModules(),a=Re(r,t.size??it,Et(r.length,t.margin??pt,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>La&&(o="H");}return o}function zp(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,s=(t.x+o)*r,l=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:s,imgTop:l}}function gs(t){let{value:e,size:n=it,level:o=Jt,bgColor:r=ft,fgColor:a=Rt,eyeColor:i,dotColor:s,bodyPattern:l="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=pt,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,autoLevel:C,shape:S,eyeShapes:$,eyeGradient:M,bgRadius:R,backdrop:E,halo:P,shadow:v,frameLabelMarkers:L,partMarkers:F,...k}=t,T=Gt(tr,l),z=Gt(Ne,c),W=Gt(Oe,u),D=Gn({value:e,size:n,margin:m,level:o,shape:S,autoLevel:C,isOGContext:f},d),U=Nt(b),X=U?{}:k,xt=H=>U?$r(H,{size:n,frame:b,bgColor:r,svgProps:k,markLabels:L}):H,lt=At({value:e,size:n,level:o,margin:m,imageSettings:D,isOGContext:f,autoLevel:C,shape:S}),N=dt.QrCode.encodeText(e,St[lt]),B=N.getModules(),Z=Et(B.length,m,S),Pt=xu(e,B.length,m,S),ct=(H,vt)=>as(F,H,vt),Zt=Un(R,B.length,Z,S),ae=(H,vt)=>{let Kt=Ui(S,H);if(!Kt){if(Zt>0){let ie=x(Zt*H),qt=E?Wn(E):null;return $t(Ut,{children:[qt&&A("rect",{"data-qrdx-look":"backdrop",fill:qt.color,fillOpacity:qt.opacity,height:H,width:H,x:0,y:0}),A("rect",{...vt,height:H,rx:ie,ry:ie,width:H,x:0,y:0,...ct("background")})]})}return A("rect",{...vt,height:H,width:H,x:0,y:0,...ct("background")})}return "circle"in Kt?A("circle",{cx:x(H/2),cy:x(H/2),...vt,r:x(H/2),...ct("background")}):A("path",{d:Kt.path,...vt,...ct("background")})},Te=B.length+Z*2,G=Re(B,n,Z,D),K=null;if(D!=null&&G!=null){G.excavation!=null&&(B=hs(B,G.excavation));let{imgWidth:H,imgHeight:vt,imgLeft:Kt,imgTop:ie}=zp(G,n,Te,Z);if(f){let qt=D.shape??"square";K=A("img",{alt:"Logo",src:D.src,style:{position:"absolute",left:`${x(Kt)}px`,top:`${x(ie)}px`,width:`${x(H)}px`,height:`${x(vt)}px`,...qt!=="square"&&{borderRadius:qt==="circle"?"50%":`${x(Math.min(H,vt)*So)}px`},...D.plate&&{backgroundColor:D.plate,padding:`${x(H*wo)}px`,boxSizing:"border-box"}}});}else K=Co(D,{x:Kt,y:ie,w:H,h:vt}),F&&(K=He(K,ct("logo")));}let Q=n/Te,gt=B.length,ut=7*Q,sa=1.5*Q,ul={fgColor:bt(a,Rt),bgColor:bt(r,ft)},ln=ci(_)?fi({art:_,modules:B,version:N.version,margin:Z,pixelSize:Q,...ul,body:H=>fs(H,{margin:Z,pixelSize:Q,pattern:T,scale:w})}):null,ml=ln&&F?He(ln,ct("body")):ln,dl=ln&&_?gi({art:_,version:N.version,...ul}):null,fl=ln?null:fs(B,{margin:Z,pixelSize:Q,pattern:T,scale:w}),Qr=Pt?fs(Pt,{margin:0,pixelSize:Q,pattern:T,scale:w,plain:true}):null,Ur=Lt(r,ft),la=Lt(a,Rt),hl=ko(Ur)?To(Ur,n,"bg-color"):null,ca=ko(la)?To(la,n,"fg-color"):null,pd=he(r,hl?.id??null,ft),pl=he(a,ca?.id??null,Rt),gl=ml?$t(Ut,{children:[ml,Qr&&A("g",{...pl,...ct("body"),children:Qr})]}):$t("g",{...pl,...ct("body"),children:[fl,Qr]}),cn=Z*Q,un=Z*Q,mn=(gt-7+Z)*Q,dn=Z*Q,fn=Z*Q,hn=(gt-7+Z)*Q,ke=bt(a,Rt),pn=H=>y?.[H]?.outer??dl?.[H]?.outer??i,gn=H=>y?.[H]?.inner??dl?.[H]?.inner??s,bn=(H,vt,Kt,ie,qt)=>{let yn=Lt(H,ke);if(!ko(yn))return null;if(M==="code"&&Fe(yn)){let Ma=JSON.stringify(yn)===JSON.stringify(la);return To(yn,n,Ma?"fg-color":qt)}return Hp(yn,vt,Kt,ut,ie,qt,n)},ua=bn(pn("topLeft"),cn,un,"top-left","corners-square-color-0-0"),ma=bn(pn("topRight"),mn,dn,"top-right","corners-square-color-1-0"),da=bn(pn("bottomLeft"),fn,hn,"bottom-left","corners-square-color-0-1"),fa=bn(gn("topLeft"),cn,un,"top-left","corners-dot-color-0-0"),ha=bn(gn("topRight"),mn,dn,"top-right","corners-dot-color-1-0"),pa=bn(gn("bottomLeft"),fn,hn,"bottom-left","corners-dot-color-0-1"),bl=he(pn("topLeft"),ua?.id??null,ke),_l=he(pn("topRight"),ma?.id??null,ke),yl=he(pn("bottomLeft"),da?.id??null,ke),xl=he(gn("topLeft"),fa?.id??null,ke),$l=he(gn("topRight"),ha?.id??null,ke),Sl=he(gn("bottomLeft"),pa?.id??null,ke),_n={cornerEyePattern:z,cornerEyeDotPattern:W,eyeShapes:$},ga=$o(cn,un,ut,re(_n,"topLeft").outer,"top-left"),ba=xo(cn+ut/2,un+ut/2,sa,re(_n,"topLeft").inner,"top-left"),_a=$o(mn,dn,ut,re(_n,"topRight").outer,"top-right"),ya=xo(mn+ut/2,dn+ut/2,sa,re(_n,"topRight").inner,"top-right"),xa=$o(fn,hn,ut,re(_n,"bottomLeft").outer,"bottom-left"),$a=xo(fn+ut/2,hn+ut/2,sa,re(_n,"bottomLeft").inner,"bottom-left"),Sa=Cr(P,{bgColor:r}),Kn=rs(v),wl=H=>$t(Ut,{children:[ln?null:fl,Qr,A("path",{d:ga,fillRule:H}),ba,A("path",{d:_a,fillRule:H}),ya,A("path",{d:xa,fillRule:H}),$a]}),wa=null;if(Sa){let{color:H}=Sa;wa=A("g",{"data-qrdx-look":"halo",fill:H,stroke:H,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:x(2*Sa.width*Q),children:wl("nonzero")});}let Ca=null;if(Kn){let{color:H}=Wn(Kn.color);Ca=A("g",{"data-qrdx-look":"shadow",fill:H,opacity:x(Kn.opacity),transform:I`translate(${Kn.dx*Q},${Kn.dy*Q})`,children:wl("evenodd")});}let gd=$t(Ut,{children:[A("defs",{children:v0([hl,ca,ua,ma,da,fa,ha,pa])}),ae(n,pd),wa,Ca,gl,A("g",{...bl,...ct("eye-outer","top-left"),children:A("path",{d:ga,fillRule:"evenodd",transform:I`rotate(0,${cn+ut/2},${un+ut/2})`})}),A("g",{...xl,...ct("eye-centre","top-left"),children:ba}),A("g",{..._l,...ct("eye-outer","top-right"),children:A("path",{d:_a,fillRule:"evenodd",transform:I`rotate(0,${mn+ut/2},${dn+ut/2})`})}),A("g",{...$l,...ct("eye-centre","top-right"),children:ya}),A("g",{...yl,...ct("eye-outer","bottom-left"),children:A("path",{d:xa,fillRule:"evenodd",transform:I`rotate(0,${fn+ut/2},${hn+ut/2})`})}),A("g",{...Sl,...ct("eye-centre","bottom-left"),children:$a}),K]}),Cl=h||(g?vo(g):void 0);if(Cl){let vt=ko(Ur)?To(Ur,300,"bg-color-template"):null,Kt=he(r,vt?.id??null,ft),ie=$t("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[A("defs",{children:v0([vt,ca,ua,ma,da,fa,ha,pa])}),ae(300,Kt),$t("g",{transform:`scale(${x(300/n,6)})`,children:[wa,Ca,gl,A("g",{...bl,...ct("eye-outer","top-left"),children:A("path",{d:ga,fillRule:"evenodd",transform:I`rotate(0,${cn+ut/2},${un+ut/2})`})}),A("g",{...xl,...ct("eye-centre","top-left"),children:ba}),A("g",{..._l,...ct("eye-outer","top-right"),children:A("path",{d:_a,fillRule:"evenodd",transform:I`rotate(0,${mn+ut/2},${dn+ut/2})`})}),A("g",{...$l,...ct("eye-centre","top-right"),children:ya}),A("g",{...yl,...ct("eye-outer","bottom-left"),children:A("path",{d:xa,fillRule:"evenodd",transform:I`rotate(0,${fn+ut/2},${hn+ut/2})`})}),A("g",{...Sl,...ct("eye-centre","bottom-left"),children:$a}),K]})]}),qt=300/n,Ma={pixelSize:Q*qt,url:e},Ml=Cl.wrapper(ie,{fgColor:a,bgColor:r,...p||{},...k},Ma),bd={...Ml?.props?.style||{},width:void 0,height:void 0,...X.style};return xt(He(Ml,{...X,width:n,height:n,style:bd}))}return xt(A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...X,children:gd}))}var N3=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),O3=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},qn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},L0=t=>{let e=at(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},D3=(t,e)=>{let n=L0(t),o=L0(e);if(!(n&&o))return 1;let r=qn(n.r,n.g,n.b),a=qn(o.r,o.g,o.b),i=Math.max(r,a),s=Math.min(r,a);return (i+.05)/(s+.05)},B3=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var Wp=256,qp=16384,Vp=128;var D0=(t,e)=>{if(!(Number.isInteger(t)&&Number.isInteger(e))||t<1||e<1||t>16384||e>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${t} x ${e}`)},bs=(t,e)=>t>>6*(2-e)&63;function B0(t,e,n){D0(e,n);let o=e*n;if(t.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let r=new Map,a=false,i=false,s=false;for(let b=0;b<o;b++){let _=b*4,y=t[_+3];if(y<128){a=true,i||=y>0;continue}if(i||=y<255,!s){let w=t[_]<<16|t[_+1]<<8|t[_+2];r.has(w)||(r.set(w,r.size),s=r.size>256);}}let l=a?255:256,c=!s&&r.size<=l,u=new Uint8Array(o),m,f,d;if(c){f=[];for(let b of r.keys())f.push(b>>16&255,b>>8&255,b&255);m=r.size,d=(b,_,y)=>r.get(b<<16|_<<8|y);}else {let b=jp(t,o,l);f=b.palette,m=b.palette.length/3,d=(_,y,w)=>b.bucketIndex[G0(_,y,w)];}let g=a?m:null;for(let b=0;b<o;b++){let _=b*4;t[_+3]<128?u[b]=g:u[b]=d(t[_],t[_+1],t[_+2]);}let h=m+(a?1:0),p=new Uint8Array(h*3);return p.set(f),a&&p.fill(255,m*3),{width:e,height:n,palette:p,indices:u,transparentIndex:g,colors:h,lossless:c&&!i}}var G0=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function jp(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),a=new Float64Array(262144),i=new Float64Array(262144);for(let f=0;f<e;f++){let d=f*4;if(t[d+3]<128)continue;let g=t[d],h=t[d+1],p=t[d+2],b=G0(g,h,p);o[b]=o[b]+1,r[b]=r[b]+g,a[b]=a[b]+h,i[b]=i[b]+p;}let s=[];for(let f=0;f<262144;f++)o[f]>0&&s.push(f);let l=[{keys:s,pixels:s.reduce((f,d)=>f+o[d],0)}];for(;l.length<n;){let f=-1;for(let $=0;$<l.length;$++){let M=l[$];M.keys.length>1&&(f===-1||M.pixels>l[f].pixels)&&(f=$);}if(f===-1)break;let d=l[f],g=0,h=-1;for(let $ of [0,1,2]){let M=255,R=0;for(let E of d.keys){let P=bs(E,$);M=Math.min(M,P),R=Math.max(R,P);}R-M>h&&(h=R-M,g=$);}let p=[...d.keys].sort(($,M)=>bs($,g)-bs(M,g)||$-M),b=d.pixels/2,_=0,y=1;for(let $=0;$<p.length-1&&(_+=o[p[$]],y=$+1,!(_>=b));$++);let w=p.slice(0,y),C=p.slice(y),S=$=>$.reduce((M,R)=>M+o[R],0);l.splice(f,1,{keys:w,pixels:S(w)},{keys:C,pixels:S(C)});}let c=[];for(let f of l){let d=0,g=0,h=0;for(let p of f.keys)d+=r[p],g+=a[p],h+=i[p];c.push(Math.round(d/f.pixels),Math.round(g/f.pixels),Math.round(h/f.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let f of s){let d=o[f],g=r[f]/d,h=a[f]/d,p=i[f]/d,b=0,_=Number.POSITIVE_INFINITY;for(let y=0;y<m;y++){let w=g-c[y*3],C=h-c[y*3+1],S=p-c[y*3+2],$=w*w+C*C+S*S;$<_&&(_=$,b=y);}u[f]=b;}return {palette:c,bucketIndex:u}}var Xp=t=>Math.max(1,Math.ceil(Math.log2(t))),No=class{buffer=new Uint8Array(1024);length=0;push(...e){this.ensure(e.length);for(let n of e)this.buffer[this.length++]=n;}u16(e){this.push(e&255,e>>8&255);}ascii(e){for(let n=0;n<e.length;n++)this.push(e.charCodeAt(n));}bytes(e){this.ensure(e.length),this.buffer.set(e,this.length),this.length+=e.length;}ensure(e){if(this.length+e<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+e;)n*=2;let o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.length)),this.buffer=o;}result(){return this.buffer.slice(0,this.length)}};function Yp(t,e){let n=new No,o=1<<e,r=o+1,a=[],i=0,s=0,l=()=>{a.length>0&&(n.push(a.length,...a),a=[]);},c=h=>{a.push(h),a.length===255&&l();},u=(h,p)=>{for(i|=h<<s,s+=p;s>=8;)c(i&255),i>>>=8,s-=8;},m=new Int32Array(1048576),f=e+1,d=r+1;u(o,f);let g=t[0];for(let h=1;h<t.length;h++){let p=t[h],b=g<<8|p,_=m[b];if(_!==0){g=_-1;continue}u(g,f),d===4096?(u(o,f),m=new Int32Array(1048576),d=r+1,f=e+1):(d>=1<<f&&f++,m[b]=d+1,d++),g=p;}return u(g,f),u(r,f),s>0&&c(i&255),l(),n.result()}function Q0(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:a}=t;D0(e,n);let i=o.length/3;if(!Number.isInteger(i)||i<1||i>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==e*n)throw new RangeError(`Expected ${e*n} palette indices for ${e} x ${n}, got ${r.length}`);if(a!==null&&!(Number.isInteger(a)&&a>=0&&a<i))throw new RangeError(`The transparent index ${a} isn't in a palette of ${i} colors`);for(let m=0;m<r.length;m++)if(r[m]>=i)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${i}`);let s=Xp(i),l=1<<s,c=Math.max(2,s),u=new No;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|s-1,0,0),u.bytes(o),u.bytes(new Uint8Array((l-i)*3)),a!==null&&u.push(33,249,4,1,0,0,a,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(Yp(r,c)),u.push(0),u.push(59),u.result()}function _s(t,e,n){let o=B0(t,e,n);return {file:Q0(o),image:o}}function ys(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let a=0;a<n.length;a++){let i=n[a],s=a*4;r[s]=e[i*3],r[s+1]=e[i*3+1],r[s+2]=e[i*3+2],r[s+3]=i===o?0:255;}return r}var O0="GIF89a";function xs(t){if(t.length<32)return false;for(let l=0;l<O0.length;l++)if(t[l]!==O0.charCodeAt(l))return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(6,true),o=e.getUint16(8,true),r=t[10];if(n<1||o<1||!(r&128))return false;let a=13+3*(1<<(r&7)+1);if(t.length<a)return false;let i=l=>{let c=l;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},s=0;for(;a<t.length;){let l=t[a];if(l===59)return s===1&&a===t.length-1;if(l===33)a=i(a+2);else if(l===44){if(a+10>t.length||e.getUint16(a+5,true)!==n||e.getUint16(a+7,true)!==o||t[a+9]&128)return false;let c=t[a+10];if(c<2||c>8)return false;s+=1,a=i(a+11);}else return false;if(a===-1)return false}return false}var Ir="image/gif",Do=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},Oo=255;function U0(t){let e=new Uint8ClampedArray(t.length);for(let n=0;n<t.length;n+=4){let o=t[n+3];for(let r=0;r<3;r++)e[n+r]=Math.round((t[n+r]*o+Oo*(Oo-o))/Oo);e[n+3]=Oo;}return e}function H0(t,e,n){let o=Uint8ClampedArray.from(e.data),r=t(o,e.width,e.height,{inversionAttempts:"dontInvert"});if(!r)return false;if(r.data===n)return true;try{return new TextDecoder().decode(Uint8Array.from(r.binaryData))===n}catch{return false}}async function Zp(t,e,n){let{width:o,height:r}=t,a=U0(t.data),i=U0(e.data);if(e.width===o&&e.height===r&&a.every((c,u)=>c===i[u]))return;let s;try{s=(await import('jsqr')).default;}catch{throw new Do("This design uses more colors than a GIF holds (256), and the reduced image could not be checked because jsqr is not available. Download a PNG instead.")}if(!H0(s,{data:a,width:o,height:r},n))return;if(!H0(s,{data:i,width:e.width,height:e.height},n))throw new Do("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function Kp(t,e){let{file:n,image:o}=_s(t.data,t.width,t.height);if(!xs(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await Zp(t,{data:ys(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function Bo(t,e){let n=t.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,t.width,t.height),{file:r}=await Kp({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:Ir})}var Go=[16,32,48,256],on="image/vnd.microsoft.icon",rn=256,$s=64,vr=6,Lr=16,Jp=[137,80,78,71,13,10,26,10],tg=16,z0=20,eg=32,W0=t=>t.length>=z0+4&&Jp.every((e,n)=>t[n]===e),q0=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(tg),height:e.getUint32(z0)}};function Ss(t){if(t.length<1||t.length>$s)throw new RangeError(`An ICO holds 1 to ${$s} images, got ${t.length}`);for(let{width:i,height:s,png:l}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=rn;if(!(c(i)&&c(s)))throw new RangeError(`ICO images must be whole numbers from 1 to ${rn} px, got ${i} x ${s}`);if(!W0(l))throw new RangeError("Every ICO image must be a PNG file");let u=q0(l);if(u.width!==i||u.height!==s)throw new RangeError(`An ICO image says ${i} x ${s} but its PNG is ${u.width} x ${u.height}`)}let e=vr+Lr*t.length,n=t.reduce((i,s)=>i+s.png.length,0),o=new Uint8Array(e+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,t.length,true);let a=e;return t.forEach(({width:i,height:s,png:l},c)=>{let u=vr+Lr*c;o[u]=i===rn?0:i,o[u+1]=s===rn?0:s,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,eg,true),r.setUint32(u+8,l.length,true),r.setUint32(u+12,a,true),o.set(l,a),a+=l.length;}),o}function ws(t){if(t.length<vr+Lr)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(4,true);if(e.getUint16(0,true)!==0||e.getUint16(2,true)!==1||n<1||n>$s||t.length<vr+Lr*n)return false;for(let o=0;o<n;o++){let r=vr+Lr*o,a=t[r]||rn,i=t[r+1]||rn,s=e.getUint32(r+8,true),l=e.getUint32(r+12,true);if(l+s>t.length)return false;let c=t.subarray(l,l+s);if(!W0(c))return false;let u=q0(c);if(u.width!==a||u.height!==i)return false}return true}var V0="data:image/png;base64,";function ng(t){let e=t.toDataURL("image/png");if(!e.startsWith(V0))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(V0.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function Cs(t){let e=Ss(t.map(n=>({width:n.width,height:n.height,png:ng(n)})));if(!ws(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:on})}function j0(t){return Cs([t])}var rg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),og=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),ag=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),ig=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),sg=new Set(["autoFocus","multiple","muted"]),lg=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),cg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),X0=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",ug=new RegExp(`^[${X0}][${X0}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Qo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,mg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,dg="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",fg=t=>mg.test(t)?dg:t,Z0=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),hg=/["'&<>]/;function Ms(t){if(!hg.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var pe=t=>typeof t=="function"||typeof t=="symbol",Y0=new Map,pg=t=>{let e=Y0.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),Y0.set(t,e)),e};function gg(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||cg.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${pg(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function Vn(t,e){if(e==null||ag.has(t))return null;let n=og.get(t);if(n!==void 0)return pe(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=gg(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||pe(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:fg(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||pe(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return pe(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return pe(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(sg.has(t))return e&&!pe(e)?{name:t.toLowerCase(),value:""}:null;if(lg.has(t))return pe(e)?null:{name:t,value:`${e}`};if(ig.has(t))return e&&!pe(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=rg.get(t)??t;if(!ug.test(o)||pe(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var K0="http://www.w3.org/2000/svg",J0="http://www.w3.org/1999/xhtml",bg="http://www.w3.org/1999/xlink",_g="http://www.w3.org/XML/1998/namespace",yg="http://www.w3.org/2000/xmlns/";function xg(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(yg,e,n):e.startsWith("xlink:")?t.setAttributeNS(bg,e,n):e.startsWith("xml:")?t.setAttributeNS(_g,e,n):t.setAttribute(e,n);}function Tr(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let l of e)Tr(t,l,n,o);return}if(!ze(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(An(r)){Tr(t,a.children,n,o);return}if(typeof r=="function"){Tr(t,r(a),n,o);return}if(!Qo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?K0:n,s=o.createElementNS(i,r);for(let l of Object.keys(a)){let c=Vn(l,a[l]);c&&xg(s,c.name,c.value);}Tr(s,a.children,i===K0&&r==="foreignObject"?J0:i,o),t.appendChild(s);}function Rs(t,e=document){let n=e.createDocumentFragment();return Tr(n,t,J0,e),n}function an(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return Ms(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=an(n);return e}if(!ze(t))throw new TypeError("qrdx: can't render this value as SVG markup");return $g(t)}function $g(t){let{type:e,props:n}=t;if(An(e))return an(n.children);if(typeof e=="function")return an(e(n));if(!Qo.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let s=Vn(i,n[i]);s&&(o+=` ${s.name}="${Ms(s.value)}"`);}if(Z0.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?an(n.children):`${r}`;return `${o}>${a}</${e}>`}function Es(t){return an(gs(t))}function Sg(t,e=document){return Rs(gs(t),e).firstChild}var wg=16384;var As=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Cg=8,Ps=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function am(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),s=new Int32Array(a),l=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,c);let u=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],s[p]=h,s[b]=h;}l[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=l[s[h]]+1;l[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=l[h];return n}}}function Mg(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function im(t){let e=new Uint16Array(16),n=0;for(let s of t)s>0&&(e[s]=e[s]+1,n++);let o=new Uint16Array(16),r=0;for(let s=1;s<=15;s++)r=r+e[s-1]<<1,o[s]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((s,l)=>{if(s===0)return;let c=o[s];o[s]=c+1,a[l]=Mg(c,s),i[l]=n===1?0:s;}),{lengths:t,codes:a,emitted:i}}function sn(t,e,n){t.write(e.codes[n],e.emitted[n]);}function Rg(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=Cg,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let s=i;if(a===0){for(;s>0;)if(s<3)for(;s>0;s--)n(0);else if(s<=10)e.push({code:17,extra:s-3,extraBits:3}),s=0;else {let l=Math.min(s,138);e.push({code:18,extra:l-11,extraBits:7}),s-=l;}continue}for(a!==o&&(n(a),o=a,s--);s>0;)if(s<3)for(;s>0;s--)n(a);else {let l=Math.min(s,6);e.push({code:16,extra:l-3,extraBits:2}),s-=l;}}return e}function Eg(t,e){let n=[];if(e.forEach((s,l)=>{s>0&&n.push(l);}),n.length<=2&&n.every(s=>s<256)){let[s=0,l]=n;t.write(1,1),t.write(n.length===2?1:0,1),s<2?(t.write(0,1),t.write(s,1)):(t.write(1,1),t.write(s,8)),l!==void 0&&t.write(l,8);return}let o=Rg(e),r=new Uint32Array(19);for(let s of o)r[s.code]=r[s.code]+1;let a=im(am(r,7)),i=As.length;for(;i>4&&a.lengths[As[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let s=0;s<i;s++)t.write(a.lengths[As[s]],3);t.write(0,1);for(let s of o)sn(t,a,s.code),t.write(s.extra,s.extraBits);}function Uo(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function tm(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function em(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?tm(t,r,1,a):0,s=r>=e?tm(t,r,e,a):0;if(Math.max(i,s)>=3){s>=i?(n.copy(s,e===1?2:1),r+=s):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var nm=20;function rm(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function om(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function vs(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let S=C*4,$=t[S],M=t[S+1],R=t[S+2],E=t[S+3];E!==255&&(a=true),r[C]=(E<<24|($-M&255)<<16|M<<8|R-M&255)>>>0;}let i=new Uint32Array(280),s=new Uint32Array(256),l=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);em(r,e,{literal(C){i[C>>>8&255]++,s[C>>>16&255]++,l[C&255]++,c[C>>>24]++;},copy(C,S){i[256+Uo(C).symbol]++,u[Uo(S).symbol]++;}});let m=[i,s,l,c,u].map(C=>am(C,15)),[f,d,g,h,p]=m.map(im),b=new Ps(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)Eg(b,C);em(r,e,{literal(C){sn(b,f,C>>>8&255),sn(b,d,C>>>16&255),sn(b,g,C&255),sn(b,h,C>>>24);},copy(C,S){let $=Uo(C);sn(b,f,256+$.symbol),b.write($.extra,$.extraBits);let M=Uo(S);sn(b,p,M.symbol),b.write(M.extra,M.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),w=new Uint8Array(nm+y);return rm(w,0,"RIFF"),om(w,4,w.length-8),rm(w,8,"WEBPVP8L"),om(w,16,_.length),w.set(_,nm),w}function Is(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function sm(t){return t.length>=12&&Is(t,0,4)==="RIFF"&&Is(t,8,4)==="WEBP"}function Ls(t){if(!sm(t))return null;let e=12;for(;e+8<=t.length;){let n=Is(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function Ag(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function Ho(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await Ag(t,"image/webp",o);if(r){let l=new Uint8Array(await r.arrayBuffer()),c=Ls(l);if(c==="lossless"||n&&c==="lossy")return new Blob([l],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),s=vs(i,t.width,t.height);return new Blob([s],{type:"image/webp"})}var lm=32768;async function Ot(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=lm)n+=String.fromCharCode(...e.subarray(o,o+lm));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function Xt(t){let e={...t};if(t.imageSettings?.src)try{let u=await Pg(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:s,...l}=e,c=Es({...l,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Pg=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function ge(t,e,n){let o=await Xt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),s=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(s)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,s)=>{let l=document.createElement("canvas"),c=l.getContext("2d");if(!c){s(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=me(t.size||it,t.frame);l.width=Math.round(m),l.height=Math.round(f);let d=setTimeout(()=>{l.remove(),s(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,l.width,l.height)),c.drawImage(u,0,0,l.width,l.height),n)i(l);else if(e==="image/webp")Ho(l).then(Ot).then(i,s).finally(()=>l.remove());else if(e==="image/bmp")Ot(ro(l)).then(i,s).finally(()=>l.remove());else if(e===Ir)Bo(l,t.value).then(Ot).then(i,s).finally(()=>l.remove());else if(e===on||e==="image/x-icon")Ot(j0(l)).then(i,s).finally(()=>l.remove());else {let g=l.toDataURL(e,1);l.remove(),i(g);}}catch(g){clearTimeout(d),l.remove(),s(new Error(`Failed to draw SVG to canvas: ${g}`));}},u.onerror=()=>{clearTimeout(d),l.remove(),s(new Error("Could not load SVG"));},u.src=a;})}var cm=["gradientUnits","gradientTransform","spreadMethod"],Ig={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},vg={r:0,g:0,b:0,a:1};function um(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function Ts(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function Lg(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let s=um(o,"stop-color")??"#000000",l=at(s==="currentColor"?"#000000":s)??vg,c=Number.parseFloat(um(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...l,a:l.a*Math.min(Math.max(c,0),1)}:l});}return e}function zo(t){let e=new Map,n=r=>{let a=r.attrs.id;Ts(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=Ts(a),s={},l=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=Ts(u)===i?[...cm,...Ig[i]]:cm;for(let d of m){let g=u.attrs[d];s[d]===void 0&&g!==void 0&&(s[d]=g);}l.length===0&&(l=Lg(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:s,stops:l});}return o}function ks(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,g)=>{let h=-m+3*f-3*d+g,p=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let _=p*p-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-p+y)/(2*h),(-p-y)/(2*h)]},s=(m,f,d,g,h)=>{let p=1-m;return p*p*p*f+3*p*p*m*d+3*p*m*m*g+m**3*h},l=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),l=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(l,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(s(f,l,m.x1,m.x2,m.x),s(f,c,m.y1,m.y2,m.y));l=m.x,c=m.y;}else [l,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var Tg=t=>t[0]*t[3]-t[1]*t[2];function Ae(t){let e=Tg(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,s]=t;return [a/e,-o/e,-r/e,n/e,(r*s-a*i)/e,(o*i-n*s)/e]}function dm(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],s=a.at(-1);if(!(i&&s)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let l=r.gradientUnits==="userSpaceOnUse",c=Cn;if(!l){let S=ks(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=mt(c,Qt(r.gradientTransform));if(!Ae(u))return s.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),g=(S,$)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(l?$:1):M:null},h=(S,$,M)=>g(r[S]??$,M)??g($,M)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[$,M,R,E]=S;return $===R&&M===E?s.color:{kind:o,coords:S,matrix:u,stops:a}}let p=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?p:h("fx","50%",m),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return _<0?null:_===0?s.color:{kind:o,coords:[y,w,C,p,b,_],matrix:u,stops:a}}function Wo(t){return t.map(e=>x(e,6)).join(" ")}function kg(t,e){return (e==="cmyk"?$e(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var mm=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function Fg(t,e){let n=[],o=t.map(s=>J(s.offset,4)),r=t.map(s=>kg(s.color,e)),a=o[0],i=o.at(-1);if(a>0){let s=r[0];n.push({from:0,to:a,c0:s,c1:s});}for(let s=0;s+1<t.length;s++){let l=o[s],c=o[s+1];c>l&&n.push({from:l,to:c,c0:r[s],c1:r[s+1]});}if(i<1){let s=r.at(-1);n.push({from:i,to:1,c0:s,c1:s});}if(n.length===1){let[s]=n;return mm(s.c0,s.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(s=>mm(s.c0,s.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(s=>x(s.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function qo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${Fg(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function Ng(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=q(e,t.x1,t.y1),[i,s]=q(e,t.x2,t.y2),[l,c]=q(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:s,x:l,y:c}}let[n,o]=q(e,t.x,t.y);return {op:t.op,x:n,y:o}}function jo(t){let e={round:1,bevel:2}[t.strokeLinejoin?.trim()??""],n={round:1,square:2}[t.strokeLinecap?.trim()??""];return {join:e??0,cap:n??0}}var fm={r:255,g:255,b:255,a:1},Og=/^url\(\s*#bg-color-/,Vo=/^url\(\s*#([^)\s]+)\s*\)/,Dg=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function j(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function V(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function kr(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(j(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)kr(n,e);return e}function Fr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)Fr(n,e);return e}function Xo(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function Yo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function hm(t,e,n){let o={x:V(t.attrs.x,e[0]),y:V(t.attrs.y,e[1]),width:V(t.attrs.width,e[0]),height:V(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),s=i==="slice",l=(s?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*l,u=n.height*l,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:s?o:null}}function pm(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)pm(n,e);return e}function gm(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)gm(n,e);return e}function Bg(t,e){let[n,o]=e,r=(a,i)=>V(t.attrs[a],i);switch(t.name){case "path":return le(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return ne(r("x",n),r("y",o),r("width",n),r("height",o),V(a,n),V(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return ee(r("cx",n),r("cy",o),a,a)}case "ellipse":return ee(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var jn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=fm;paper=fm;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Vo.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=at(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Vo.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let c=dm(i,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let s=this.resolveColor(e);if(!s)return null;let l={...s,a:s.a*r};return l.a>0?{color:l}:null}patternOf(e){let n=e?Vo.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return Lo(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=ks(e);if(!a||a.width<=0||a.height<=0)return true;let[i,s]=n.viewport,l=V(o.attrs.x,i),c=V(o.attrs.y,s),u=V(o.attrs.width,i),m=V(o.attrs.height,s);if(!(u>0&&m>0))return true;let f=Qt(o.attrs.patternTransform),d=Ae(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[q(d,a.x,a.y),q(d,a.x+a.width,a.y),q(d,a.x,a.y+a.height),q(d,a.x+a.width,a.y+a.height)],p=h.map(([L])=>L),b=h.map(([,L])=>L),_=Math.min(...p),y=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((_-l)/u),$=Math.ceil((y-l)/u)-1,M=Math.floor((w-c)/m),R=Math.ceil((C-c)/m)-1,E=($-S+1)*(R-M+1);if(E>4096)return !0;let P=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),v=mt(n.matrix,f);for(let L=M;L<=R;L++)for(let F=S;F<=$;F++){let k=l+F*u,T=c+L*m,z=mt(v,[1,0,0,1,k,T]),W={x:_-k,y:w-T,width:y-_,height:C-w},D=P.length===2&&P.every(Number.isFinite)?P0(P[0],P[1],W):null,U=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],z,!1);try{let X={matrix:z,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},xt=(lt,N)=>{for(let B of lt){if(B.name==="g"&&!B.attrs.transform){let Z=Number.parseFloat(B.attrs.opacity??"1");xt(B.children,{...N,opacity:(N.opacity??1)*(Number.isFinite(Z)?Z:1)});continue}if(D&&B.attrs["data-arc"]){let[Z,Pt]=B.attrs["data-arc"].split(/\s+/).map(Number);if(!I0([Z,Z+Pt],D))continue}this.walk(B,N);}};xt(o.children,X);}finally{U&&this.endClip();}}}finally{this.inConic=g,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:mt(n.matrix,Qt(e.attrs.transform))}),s=Ae(a);if(!s)return false;let[l,c,u,m]=r,d=[[l,c],[u,c],[u,m],[l,m]].map(([g,h])=>q(s,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=j(e,"clip-path"),r=o?Vo.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],s=false;for(let l of a.children){let c=Bg(l,n.viewport);if(c.length===0)continue;let u=Qt(l.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>Ng(f,u))),s||=j(l,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:s}:null}viewportMatrix(e,n){let o=V(e.attrs.x,n.viewport[0]),r=V(e.attrs.y,n.viewport[1]),a=V(e.attrs.width,n.viewport[0],n.viewport[0]),i=V(e.attrs.height,n.viewport[1],n.viewport[1]),s=te(e.attrs.viewBox);if(s.length!==4||!(s[2]&&s[3]))return [mt(n.matrix,[1,0,0,1,o,r]),[a,i]];let[l,c,u,m]=s,f=a/u,d=i/m,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-u*p)/2,h+=(i-m*p)/2,f=p,d=p;}return [mt(n.matrix,[f,0,0,d,g-l*f,h-c*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=pm(e,new Map),this.patterns=gm(e,new Map)),Dg.has(e.name)||j(e,"display")==="none"||j(e,"visibility")==="hidden")return;let r=mt(n.matrix,Qt(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=j(e,"font-size"),s=Number.parseFloat(j(e,"opacity")??"1"),l=j(e,"fill-opacity"),c=l===void 0?n.fillOpacity??1:Number.parseFloat(l),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(s)?Math.min(Math.max(s,0),1):1),matrix:r,viewport:a,fill:j(e,"fill")??n.fill,fillRule:j(e,"fill-rule")??n.fillRule,stroke:j(e,"stroke")??n.stroke,strokeWidth:j(e,"stroke-width")===void 0?n.strokeWidth:V(j(e,"stroke-width"),a[0],1),strokeLinejoin:j(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:j(e,"stroke-linecap")??n.strokeLinecap,fontSize:i===void 0?n.fontSize:V(i,16,16),fontWeight:j(e,"font-weight")??n.fontWeight,textAnchor:j(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&Og.test(j(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,s)=>V(e.attrs[i],s);switch(e.name){case "path":this.paint(le(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;this.paint(ne(a("x",o),a("y",r),a("width",o),a("height",r),V(i,o),V(s,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(ee(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(ee(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=te(e.attrs.points),s=[];for(let l=0;l+1<i.length;l+=2)s.push({op:l===0?"M":"L",x:i[l],y:i[l+1]});e.name==="polygon"&&s.length>0&&s.push({op:"Z"}),this.paint(s,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var Zo=1e3;async function Nr(t){let e=await Xt(Pe({...t,size:t.size??it},Zo));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Fs(t){if(Nt(t.frame)){let e=Je(Zo,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=dt.QrCode.encodeText(t.value,St[At(t)]).size,n=Et(e,t.margin??pt,t.shape);if(Un(t.bgRadius,e,n,t.shape)>0)return bt(t.backdrop,ft)}return bt(t.bgColor,ft)}function Ko(t,e){let n=Fs(t);if(!(n&&Fe(t.bgColor))||Nt(t.frame)||t.templateId||t.customTemplate)return n;let o=ye(e)?.children.find(a=>a.name==="rect"),r=o&&j(o,"fill");return r?.startsWith("url(")?r:n}function Jo(t,e){let n={r:255,g:255,b:255,a:1},o=at(bt(e.bgColor,ft));t.paper=n,t.background=o&&!Fe(e.bgColor)?o:null,t.backdrop=o?Lo(o,n):n;}var ta=25.4,bm=5,_m=2e3,be=Zo,Ns=5,ym=2,Qg=.25*(ta/72);function Ug(t,e="mm"){return e==="in"?t*ta:t}function Hg(t){let e=At(t),n=dt.QrCode.encodeText(t.value,St[e]).size;return n+Et(n,t.margin??pt,t.shape)*2}function ea(t,e){let n=Ug(e.size,e.unit);if(!Number.isFinite(n)||n<bm||n>_m)throw new Error(`Print size must be between ${bm} mm and ${_m/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/be,a=Nt(t.frame)?Je(be,t.frame):null,i=(a?.width??be)*r,s=(a?.height??be)*r,l=e.cropMarks?o+ym+Ns+1:o,c=Hg(t);return {codeWidth:n,trimWidth:i,trimHeight:s,bleed:o,pageWidth:i+2*l,pageHeight:s+2*l,trimX:l,trimY:l,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var Os=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},Ds=class extends jn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,s]=$e(n.r,n.g,n.b);o(r,a,i,s);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=q(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=q(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=q(n,r.x1,r.y1),[s,l]=q(n,r.x2,r.y2),[c,u]=q(n,r.x,r.y);this.pdf.curveTo(a,i,s,l,c,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],s=mt(i,mt(n.matrix,o.matrix));if(!(this.shadingResources&&Ae(s)))return;let l=this.shadingResources.name(qo(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${Wo(s)} cm /${l} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,s=i&&this.inConic?this.flatten(i):i,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=l&&{...l,a:l.a*r};if(!(s||c))return;let u=o.fillRule==="evenodd";this.withAlpha(s?.a??1,c?.a??1,()=>{s&&this.setColor("fill",s);let m=c?jo(o):{join:0,cap:0};c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*Mn(o.matrix)),(m.join||m.cap)&&(this.pdf.setLineJoin(m.join),this.pdf.setLineCap(m.cap))),this.tracePath(e,o.matrix),s&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():s?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(m.join||m.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Mn(n.matrix),[i,s]=q(n.matrix,V(e.attrs.x,n.viewport[0]),V(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",l?"bold":"normal");let c=n.fontSize*a*(72/ta);this.pdf.setFontSize(c);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,g=this.pdf.getTextWidth(o);g>d&&(c*=d/g,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),s-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,s,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(Xo(o)?o:this.images.get(o)),a=r&&Xo(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let s=null;if(e.attrs.preserveAspectRatio)try{let p=this.pdf.getImageProperties(r);s={width:p.width,height:p.height};}catch{s=null;}let l=hm(e,n.viewport,s);if(!l)return;let{draw:c,clip:u}=l,[m,f]=q(n.matrix,c.x,c.y),[d,g]=q(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,g),Math.abs(d-m),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function zg(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:s}=n,l=s+ym,c=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(Qg);for(let d of [c,u]){let g=d===c?-1:1;for(let h of [m,f]){let p=h===m?-1:1;t.line(d+g*l,h,d+g*(l+Ns),h),t.line(d,h+p*l,d,h+p*(l+Ns));}}}async function Wg(t,e){return (await xm(t,e)).output("dataurlstring")}async function ex(t,e){return (await xm(t,e)).output("arraybuffer")}async function xm(t,e){let n=ea(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Nr(t),a=ye(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of Fr(a,new Set))if(!Xo(b)){let _=await Yo(b);_&&i.set(b,_);}let s=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});s.setProperties({title:"QR code",creator:"qrdx"});let l=zo(a),c=l.size>0?Os.attach(s):null,u=new Ds(s,e.colorMode==="cmyk",kr(a,new Map),c?{gradients:l,resources:c}:null,i);Jo(u,t);let m=n.codeWidth/be,f=V(a.attrs.width,be,be),d=V(a.attrs.height,be,be),g={matrix:mt([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?Ko(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,g,h,p))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),s.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,g,true),e.cropMarks&&zg(s,u,n),s}async function qg(t,e){let n=ea(t,{size:e.size,unit:e.unit}),o=await Nr(t),r=e.unit??"mm",a=l=>`${x(r==="in"?l/ta:l)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
2
- ${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function nx(t,e){let n=await Wg(t,e);Bt(n,e.filename??"qr-code-print.pdf");}async function rx(t,e){let n=await qg(t,e);Bt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var Vg=[137,80,78,71,13,10,26,10];async function Sm(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function wm(t){return typeof CompressionStream>"u"?null:await Sm(t,new CompressionStream("deflate"))}async function jg(t){if(typeof DecompressionStream>"u")return null;try{return await Sm(t,new DecompressionStream("deflate"))}catch{return null}}var Bs=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,$m={0:1,2:3,3:1,4:2,6:4};function Xg(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function Gs(t){if(Vg.some((h,p)=>t[p]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,s=[];for(;e+8<=t.length;){let h=Bs(t,e),p=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,p==="IHDR"){n=Bs(b,0),o=Bs(b,4);let _=b[8];r=b[9];let y=b[12];if(_!==8||y!==0||!(r in $m))return null}else if(p==="PLTE")a=b;else if(p==="tRNS")i=b;else if(p==="IDAT")s.push(b);else if(p==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let l=new Uint8Array(s.reduce((h,p)=>h+p.length,0)),c=0;for(let h of s)l.set(h,c),c+=h.length;let u=await jg(l),m=$m[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let p=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),_=h*f;for(let y=0;y<f;y++){let w=y>=m?d[_+y-m]:0,C=h>0?d[_-f+y]:0,S=h>0&&y>=m?d[_-f+y-m]:0,$=b[y],M=0;p===1?M=w:p===2?M=C:p===3?M=w+C>>1:p===4&&(M=Xg(w,C,S)),d[_+y]=$+M&255;}}let g=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let p=h*4,b=h*m;if(r===3){let _=d[b];g[p]=a?.[_*3]??0,g[p+1]=a?.[_*3+1]??0,g[p+2]=a?.[_*3+2]??0,g[p+3]=i?.[_]??255;}else if(r===0||r===4){let _=d[b];g[p]=_,g[p+1]=_,g[p+2]=_,g[p+3]=r===4?d[b+1]:255;}else g[p]=d[b],g[p+1]=d[b+1],g[p+2]=d[b+2],g[p+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:g}}var Yg=25.4,Cm=72/Yg,Zg=50;function Kg(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function Jg(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function t2(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let l=0;l<n*o;l++){let c=r[l*4+3]/255,u=r[l*4]*c+255*(1-c),m=r[l*4+1]*c+255*(1-c),f=r[l*4+2]*c+255*(1-c);if(e){let[d,g,h,p]=$e(u,m,f);i.set([d*255,g*255,h*255,p*255].map(Math.round),l*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],l*a);}let s=await wm(i);return {kind:"raw",width:n,height:o,components:a,bytes:s??i,compressed:!!s}}async function e2(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await Yo(n);if(!i)return null;n=i;}let o=Kg(n);if(!o)return null;let r=Jg(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await Gs(o);return a?await t2(a,e):null}function n2(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
3
- `,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let l=0;l<4;l++)i=i*256+(l<a?t[r+l]:0);if(i===0&&a===4){o("z");continue}let s=[];for(let l=0;l<5;l++)s.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(s.slice(0,a+1).join(""));}return `${e}~>`}var r2=`/qrdxdict 40 dict def
1
+ 'use strict';var schemas_js=require('./schemas.js'),framesIndex_js=require('./frames-index.js'),framesOfficial_js=require('./frames-official.js');var xn;(a=>{class t{constructor(s,l,c,u){this.version=s;this.errorCorrectionLevel=l;if(s<t.MIN_VERSION||s>t.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let m=[];for(let d=0;d<this.size;d++)m.push(false);for(let d=0;d<this.size;d++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();let f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let d=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);let h=this.getPenaltyScore();h<d&&(u=g,d=h),this.applyMask(g);}}o(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(s,l){let c=a.QrSegment.makeSegments(s);return t.encodeSegments(c,l)}static encodeBinary(s,l){let c=a.QrSegment.makeBytes(s);return t.encodeSegments([c],l)}static encodeSegments(s,l,c=1,u=40,m=-1,f=true){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let d,g;for(d=c;;d++){let _=t.getNumDataCodewords(d,l)*8,y=r.getTotalBits(s,d);if(y<=_){g=y;break}if(d>=u)throw new RangeError("Data too long")}for(let _ of [t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&g<=t.getNumDataCodewords(d,_)*8&&(l=_);let h=[];for(let _ of s){e(_.mode.modeBits,4,h),e(_.numChars,_.mode.numCharCountBits(d),h);for(let y of _.getData())h.push(y);}o(h.length==g);let p=t.getNumDataCodewords(d,l)*8;o(h.length<=p),e(0,Math.min(4,p-h.length),h),e(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let _=236;h.length<p;_^=253)e(_,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((_,y)=>b[y>>>3]|=_<<7-(y&7)),new t(d,l,b,m)}size;mask;modules=[];isFunction=[];getModule(s,l){return 0<=s&&s<this.size&&0<=l&&l<this.size&&this.modules[l][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let s=this.getAlignmentPatternPositions(),l=s.length;for(let c=0;c<l;c++)for(let u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(s[c],s[u]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(s){let l=this.errorCorrectionLevel.formatBits<<3|s,c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;let u=(l<<10|c)^21522;o(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(u,m));this.setFunctionModule(8,7,n(u,6)),this.setFunctionModule(8,8,n(u,7)),this.setFunctionModule(7,8,n(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(u,m));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let s=this.version;for(let c=0;c<12;c++)s=s<<1^(s>>>11)*7973;let l=this.version<<12|s;o(l>>>18==0);for(let c=0;c<18;c++){let u=n(l,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u);}}drawFinderPattern(s,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){let m=Math.max(Math.abs(u),Math.abs(c)),f=s+u,d=l+c;0<=f&&f<this.size&&0<=d&&d<this.size&&this.setFunctionModule(f,d,m!=2&&m!=4);}}drawAlignmentPattern(s,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(s+u,l+c,Math.max(Math.abs(u),Math.abs(c))!=1);}setFunctionModule(s,l,c){this.modules[l][s]=c,this.isFunction[l][s]=true;}addEccAndInterleave(s){let l=this.version,c=this.errorCorrectionLevel;if(s.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(t.getNumRawDataModules(l)/8),d=u-f%u,g=Math.floor(f/u),h=[],p=t.reedSolomonComputeDivisor(m);for(let _=0,y=0;_<u;_++){let w=s.slice(y,y+g-m+(_<d?0:1));y+=w.length;let C=t.reedSolomonComputeRemainder(w,p);_<d&&w.push(0),h.push(w.concat(C));}let b=[];for(let _=0;_<h[0].length;_++)h.forEach((y,w)=>{(_!=g-m||w>=d)&&b.push(y[_]);});return o(b.length==f),b}drawCodewords(s){if(s.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u<this.size;u++)for(let m=0;m<2;m++){let f=c-m,g=(c+1&2)==0?this.size-1-u:u;!this.isFunction[g][f]&&l<s.length*8&&(this.modules[g][f]=n(s[l>>>3],7-(l&7)),l++);}}o(l==s.length*8);}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let u;switch(s){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c]);}}getPenaltyScore(){let s=0;for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[m][h]==f?(d++,d==5?s+=t.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[m][h],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size;m++){let f=false,d=0,g=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][m]==f?(d++,d==5?s+=t.PENALTY_N1:d>5&&s++):(this.finderPenaltyAddHistory(d,g),f||(s+=this.finderPenaltyCountPatterns(g)*t.PENALTY_N3),f=this.modules[h][m],d=1);s+=this.finderPenaltyTerminateAndCount(f,d,g)*t.PENALTY_N3;}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){let d=this.modules[m][f];d==this.modules[m][f+1]&&d==this.modules[m+1][f]&&d==this.modules[m+1][f+1]&&(s+=t.PENALTY_N2);}let l=0;for(let m of this.modules)l=m.reduce((f,d)=>f+(d?1:0),l);let c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return o(0<=u&&u<=9),s+=u*t.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return [];{let s=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2,c=[6];for(let u=this.size-7;c.length<s;u-=l)c.splice(1,0,u);return c}}static getNumRawDataModules(s){if(s<t.MIN_VERSION||s>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*s+128)*s+64;if(s>=2){let c=Math.floor(s/7)+2;l-=(25*c-10)*c-55,s>=7&&(l-=36);}return o(208<=l&&l<=29648),l}static getNumDataCodewords(s,l){return Math.floor(t.getNumRawDataModules(s)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let l=[];for(let u=0;u<s-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<s;u++){for(let m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2);}return l}static reedSolomonComputeRemainder(s,l){let c=l.map(u=>0);for(let u of s){let m=u^c.shift();c.push(0),l.forEach((f,d)=>c[d]^=t.reedSolomonMultiply(f,m));}return c}static reedSolomonMultiply(s,l){if(s>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(l>>>u&1)*s;return o(c>>>8==0),c}finderPenaltyCountPatterns(s){let l=s[1];o(l<=this.size*3);let c=l>0&&s[2]==l&&s[3]==l*3&&s[4]==l&&s[5]==l;return (c&&s[0]>=l*4&&s[6]>=l?1:0)+(c&&s[6]>=l*4&&s[0]>=l?1:0)}finderPenaltyTerminateAndCount(s,l,c){return s&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(s,l){l[0]==0&&(s+=this.size),l.pop(),l.unshift(s);}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-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]];static NUM_ERROR_CORRECTION_BLOCKS=[[-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]]}a.QrCode=t;function e(i,s,l){if(s<0||s>31||i>>>s)throw new RangeError("Value out of range");for(let c=s-1;c>=0;c--)l.push(i>>>c&1);}function n(i,s){return (i>>>s&1)!=0}function o(i){if(!i)throw new Error("Assertion error")}class r{constructor(s,l,c){this.mode=s;this.numChars=l;this.bitData=c;if(l<0)throw new RangeError("Invalid argument");this.bitData=c.slice();}mode;numChars;bitData;static makeBytes(s){let l=[];for(let c of s)e(c,8,l);return new r(r.Mode.BYTE,s.length,l)}static makeNumeric(s){if(!r.isNumeric(s))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<s.length;){let u=Math.min(s.length-c,3);e(parseInt(s.substr(c,u),10),u*3+1,l),c+=u;}return new r(r.Mode.NUMERIC,s.length,l)}static makeAlphanumeric(s){if(!r.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=s.length;c+=2){let u=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c))*45;u+=r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c+1)),e(u,11,l);}return c<s.length&&e(r.ALPHANUMERIC_CHARSET.indexOf(s.charAt(c)),6,l),new r(r.Mode.ALPHANUMERIC,s.length,l)}static makeSegments(s){return s==""?[]:r.isNumeric(s)?[r.makeNumeric(s)]:r.isAlphanumeric(s)?[r.makeAlphanumeric(s)]:[r.makeBytes(r.toUtf8ByteArray(s))]}static makeEci(s){let l=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)e(s,8,l);else if(s<16384)e(2,2,l),e(s,14,l);else if(s<1e6)e(6,3,l),e(s,21,l);else throw new RangeError("ECI assignment value out of range");return new r(r.Mode.ECI,0,l)}static isNumeric(s){return r.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return r.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,l){let c=0;for(let u of s){let m=u.mode.numCharCountBits(l);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.bitData.length;}return c}static toUtf8ByteArray(s){s=encodeURI(s);let l=[];for(let c=0;c<s.length;c++)s.charAt(c)!="%"?l.push(s.charCodeAt(c)):(l.push(parseInt(s.substr(c+1,2),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}a.QrSegment=r;})(xn||={});(e=>{(o=>{class n{constructor(a,i){this.ordinal=a;this.formatBits=i;}ordinal;formatBits;static LOW=new n(0,1);static MEDIUM=new n(1,0);static QUARTILE=new n(2,3);static HIGH=new n(3,2)}o.Ecc=n;})(e.QrCode||={});})(xn||={});(e=>{(o=>{class n{constructor(a,i){this.modeBits=a;this.numBitsCharCount=i;}modeBits;numBitsCharCount;static NUMERIC=new n(1,[10,12,14]);static ALPHANUMERIC=new n(2,[9,11,13]);static BYTE=new n(4,[8,16,16]);static KANJI=new n(8,[8,10,12]);static ECI=new n(7,[0,0,0]);numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}}o.Mode=n;})(e.QrSegment||={});})(xn||={});var dt=xn;var St={L:dt.QrCode.Ecc.LOW,M:dt.QrCode.Ecc.MEDIUM,Q:dt.QrCode.Ecc.QUARTILE,H:dt.QrCode.Ecc.HIGH},it=128,Jt="Q",ft="#FFFFFF",Rt="#000000";var pt=0;var Hr=.1;function bt(t,e="#000000"){return t?typeof t=="string"?t:t.type==="solid"?t.color:t.type==="image"?t.underlay||e:(t.type==="linear"||t.type==="radial"||t.type==="angular")&&t.stops[0]?.color||e:e}function Lt(t,e="#000000"){return t?typeof t=="string"?{type:"solid",color:t}:t:{type:"solid",color:e}}function Fe(t){return !t||typeof t=="string"?false:t.type==="linear"||t.type==="radial"||t.type==="angular"}function Ea(t){return typeof t=="object"&&t!==null&&t.type==="image"}function Sd(t,e="#000000"){let n=Lt(t,e);return n.type==="solid"?n.color:n.type==="image"?n.underlay||e:n.stops[0]?.color||e}function El(t="center"){let[e,n]=t.split("-");return t==="center"?"center":n?`${n} ${e}`:e==="top"||e==="bottom"?`center ${e}`:`${e} center`}function wd(t){if(!t)return "#000000";if(typeof t=="string")return t;let e=Lt(t);if(e.type==="solid")return e.color;if(e.type==="image"){let r=e.fit==="tile"?`${25*(e.scale??1)}% auto`:(e.scale??1)===1?e.fit==="contain"?"contain":"cover":`${100*(e.scale??1)}% auto`,a=e.fit==="tile"?"repeat":"no-repeat";return `${`url("${e.src.replace(/"/g,"%22")}")`} ${El(e.position)} / ${r} ${a}, ${e.underlay??"transparent"}`}let o=[...e.stops].sort((r,a)=>r.offset-a.offset).map(r=>`${r.color} ${r.offset}%`).join(", ");return e.type==="linear"?`linear-gradient(${(e.angle??0)+90}deg, ${o})`:e.type==="angular"?`conic-gradient(from ${e.angle??0}deg, ${o})`:`radial-gradient(circle, ${o})`}var zr=["logo","halftone"],Aa={logo:["blend","badge"],halftone:["color","mono"]},Jn=192,Cd=["square","rounded","circle","message","message-reverse","diya","diya-reverse","rounded-triangle","leaf","drop","plus","cross-rounded","hexagon","octagon","flower","heart","squircle","dots","extra-rounded","leaf-reverse","drop-reverse","cushion"],Md=["diamond","star","banner"],Rd=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],Ed=["curly"],Ad=["circle","circle-large","square","diamond","circle-mixed","pacman","rounded","small-square","vertical-line","horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"],tr={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},Ne={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},Oe={bevel:"square",notch:"square"};function Gt(t,e){return typeof e=="string"&&Object.hasOwn(t,e)?t[e]:e}var Pd=["none","banner-bottom","banner-top","border","rounded-border","speech-bubble","banner-top-bottom","speech-bubble-top","chat-bubble","circle","polaroid","phone","ticket","badge","envelope","tag","menu-card","sticker","gradient-border","focus"],se=24,Pa="Scan me",er=.5,$n=1.5,Id=["square","rounded","circle"],vd=.1,Ia=.3,va=.25,Ld=2,Wr=.5,La=1,Ta=.07,Td=["square","circle","heart"],ka=3,De=64,_e=8,Fa=.42,Be=["topLeft","topRight","bottomLeft"],qr=.5,Na=2,Oa=.1,Da=.5,Ba=.25,Vr="#e5e7eb",Ge="#d1d5db",jr=.3,Ga=.2,Qa=.1,Ua=.4,Ha=.3,za="#000000",kd=["corner","code"];function J(t,e=3){let n=10**e;return Math.round(t*n)/n+0}function x(t,e=3){return String(J(t,e))}function I(t,...e){let n=t[0]??"";for(let o=0;o<e.length;o++){let r=e[o];n+=(typeof r=="number"?x(r):r)+(t[o+1]??"");}return n}var Fd={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Nd=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Wa=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function nr(t,e=Number.POSITIVE_INFINITY){if(!Nd.test(t))return null;let n=[],o=0,r=()=>{for(;o<t.length&&/[\s,]/.test(t[o]);)o++;},a=()=>{r(),Wa.lastIndex=o;let l=Wa.exec(t);if(!l)return null;let c=l[0],u=c.indexOf(".");if(u>=0&&c.length-u-1>e)return null;o=Wa.lastIndex;let m=Number(c);return Number.isFinite(m)?m:null},i=()=>{r();let l=t[o];return l==="0"||l==="1"?(o++,l==="1"?1:0):null},s=()=>(r(),o<t.length&&/[0-9.+-]/.test(t[o]));for(r();o<t.length;){let l=t[o],c=l.toUpperCase(),u=Fd[c];if(u===void 0||n.length===0&&c!=="M")return null;if(o++,u===0){n.push({command:l,values:[]}),r();continue}let m=l,f=true;for(;f||s();){let d=[];for(let g=0;g<u;g++){let h=c==="A"&&(g===3||g===4)?i():a();if(h===null)return null;d.push(h);}n.push({command:m,values:d}),c==="M"&&(m=l==="M"?"L":"l"),f=false;}r();}return n}function Al(t){let e=0;for(let{command:n}of t)e+=n.toUpperCase()==="A"?4:1;return e}function qa(t,e=1,n=0,o=0){let r="";for(let{command:a,values:i}of t){let s=a.toUpperCase(),l=a===s,c=l?n:0,u=l?o:0,m;switch(s){case "Z":m=[];break;case "H":m=[x(i[0]*e+c)];break;case "V":m=[x(i[0]*e+u)];break;case "A":m=[x(Math.abs(i[0])*e),x(Math.abs(i[1])*e),x(i[2]),String(i[3]),String(i[4]),x(i[5]*e+c),x(i[6]*e+u)];break;default:m=i.map((f,d)=>x(f*e+(d%2===0?c:u)));}r+=a+m.join(" ");}return r}function Xr(t,e=.25){let n=[],o=[],r=[0,0],a=[0,0],i=()=>{o.length>2&&n.push(o),o=[];};for(let s of t)if(s.op==="M")i(),r=[s.x,s.y],a=r,o.push(r);else if(s.op==="L")a=[s.x,s.y],o.push(a);else if(s.op==="C"){let l=a,c=[s.x1,s.y1],u=[s.x2,s.y2],m=[s.x,s.y],f=Math.hypot(c[0]-l[0],c[1]-l[1])+Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(m[0]-u[0],m[1]-u[1]),d=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(f/(4*e)))));for(let g=1;g<=d;g++){let h=g/d,p=1-h;o.push([p*p*p*l[0]+3*p*p*h*c[0]+3*p*h*h*u[0]+h*h*h*m[0],p*p*p*l[1]+3*p*p*h*c[1]+3*p*h*h*u[1]+h*h*h*m[1]]);}a=m;}else i(),a=r;return i(),n}function Sn(t,e){let n=[r=>r[0]-e.x0,r=>e.x1-r[0],r=>r[1]-e.y0,r=>e.y1-r[1]],o=t;for(let r of n){if(o.length===0)break;let a=o;o=[];for(let i=0;i<a.length;i++){let s=a[i],l=a[(i+a.length-1)%a.length],c=r(s),u=r(l);c>=0?(u<0&&o.push(Pl(l,s,u,c)),o.push(s)):u>=0&&o.push(Pl(l,s,u,c));}}return o.length>2?o:[]}function Pl(t,e,n,o){let r=n/(n-o);return [t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Il(t){return t.filter(e=>e.length>2).map(e=>`M${e.map(([n,o])=>`${x(n)} ${x(o)}`).join("L")}Z`).join("")}function Qe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(i,s)=>{e=Math.min(e,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);};for(let i of t)i.op==="C"?(a(i.x1,i.y1),a(i.x2,i.y2),a(i.x,i.y)):i.op!=="Z"&&a(i.x,i.y);return Number.isFinite(e)?{x0:e,y0:n,x1:o,y1:r}:null}var Od={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Tl(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){let o=n[1].toLowerCase()==="x"?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return Number.isInteger(o)&&o>0&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):e}return Od[n.toLowerCase()]??e})}var Dd=60,Va=62,ja=47,Bd=61,vl=34,Ll=39,Ya=/\s*/y,Gd=/[^\s/>]*/y,Qd=/[^\s>]*/y,Ud=/[^\s=]*/y;function wn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Hd(t,e){let n=t.length,o=S=>{let $=Number.POSITIVE_INFINITY,M=-1;return R=>((R<$||M>=0&&M<R)&&($=R,M=t.indexOf(S,R)),M)},r=o("-->"),a=o("?>"),i=o("]]>"),s=o(">"),l,c=S=>{let $=t.charCodeAt(S);if($!==vl&&$!==Ll)return S+1;let M=t.indexOf(t[S],S+1);return M<0?n:M+1},u=S=>{for(let $=S;$<n&&!l?.[$];$=c($)){let M=t.charCodeAt($);if(M===Va||M===ja&&t.charCodeAt($+1)===Va)return $}l??=new Uint8Array(n);for(let $=S;$<n&&!l[$];$=c($))l[$]=1;return -1},m=-1,f=-1,d=-1,g=-1,h=S=>{let $=S+1;if($<m||$>=f){m=$,f=wn(Gd,t,$),d=-1;for(let R=f;R>$;R--){let E=t.charCodeAt(R);if((R===f||E===vl||E===Ll)&&(g=u(R),g>=0)){d=R;break}}}if(d<=$)return -1;let M=t.charCodeAt(g)===ja;return e.open(t.slice($,d),t.slice(d,g),M),g+(M?2:1)},p=-1,b=-1,_=-1,y=S=>{let $=S+2;if($<p||$>=b){p=$,b=wn(Qd,t,$);let M=wn(Ya,t,b);_=b>$&&t.charCodeAt(M)===Va?M:-1;}return _},w=S=>{if(t.startsWith("<!--",S)){let $=r(S+4);if($>=0)return $+3}if(t.startsWith("<?",S)){let $=a(S+2);if($>=0)return $+2}if(t.startsWith("<![CDATA[",S)){let $=i(S+9);if($>=0)return e.cdata(t.slice(S+9,$)),$+3}if(t.startsWith("<!",S)){let $=s(S+2);if($>=0)return $+1}if(t.charCodeAt(S+1)===ja){let $=y(S);return $<0?-1:(e.close(),$+1)}return h(S)},C=0;for(;C<n;)if(t.charCodeAt(C)===Dd){let S=w(C);C=S<0?C+1:S;}else {let S=t.indexOf("<",C),$=S<0?n:S;e.text(t.slice(C,$)),C=$;}}function zd(t){let e={},n=0;for(;n<t.length;){let o=wn(Ud,t,n);if(o===n){n++;continue}let r=wn(Ya,t,o);if(t.charCodeAt(r)===Bd){let a=wn(Ya,t,r+1),i=t[a],s=i==='"'||i==="'"?t.indexOf(i,a+1):-1;if(s>=0){e[t.slice(n,o)]=Tl(t.slice(a+1,s)),n=s+1;continue}}n=o;}return e}function ye(t){let e={name:"#root",attrs:{},children:[],text:""},n=[e],o=()=>n.at(-1);Hd(t,{open(a,i,s){let l=zd(i),c={name:a,attrs:l,children:[],text:""};o().children.push(c),s||n.push(c);},close(){n.length>1&&n.pop();},text(a){o().text+=Tl(a);},cdata(a){o().text+=a;}});let r=a=>{for(let i of a.children){if(i.name==="svg")return i;let s=r(i);if(s)return s}return null};return r(e)}var Cn=[1,0,0,1,0,0];function mt(t,e){let[n,o,r,a,i,s]=t,[l,c,u,m,f,d]=e;return [n*l+r*c,o*l+a*c,n*u+r*m,o*u+a*m,n*f+r*d+i,o*f+a*d+s]}function q(t,e,n){return [t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}function Mn(t){return Math.sqrt(Math.abs(t[0]*t[3]-t[1]*t[2]))}function te(t){return t?(t.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Qt(t){let e=Cn;if(!t)return e;for(let[,n,o]of t.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let r=te(o),a=Cn;switch(n){case "matrix":r.length===6&&(a=r);break;case "translate":a=[1,0,0,1,r[0]??0,r[1]??0];break;case "scale":a=[r[0]??1,0,0,r[1]??r[0]??1,0,0];break;case "rotate":{let i=(r[0]??0)*Math.PI/180,s=Math.cos(i),l=Math.sin(i),[c,u]=[r[1]??0,r[2]??0];a=mt(mt([1,0,0,1,c,u],[s,l,-l,s,0,0]),[1,0,0,1,-c,-u]);break}case "skewX":a=[1,0,Math.tan((r[0]??0)*Math.PI/180),1,0,0];break;case "skewY":a=[1,Math.tan((r[0]??0)*Math.PI/180),0,1,0,0];break;}e=mt(e,a);}return e}var Xa=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function Wd(t,e,n,o,r,a,i,s,l){if(t===s&&e===l)return [];let c=Math.abs(n),u=Math.abs(o);if(c===0||u===0)return [{op:"L",x:s,y:l}];let m=r*Math.PI/180,f=Math.cos(m),d=Math.sin(m),g=(t-s)/2,h=(e-l)/2,p=f*g+d*h,b=-d*g+f*h,_=p*p/(c*c)+b*b/(u*u);_>1&&(c*=Math.sqrt(_),u*=Math.sqrt(_));let y=c*c*u*u-c*c*b*b-u*u*p*p,w=c*c*b*b+u*u*p*p,C=(a===i?-1:1)*Math.sqrt(Math.max(0,y/w)),S=C*c*b/u,$=-C*u*p/c,M=f*S-d*$+(t+s)/2,R=d*S+f*$+(e+l)/2,E=(W,D,U,X)=>Math.atan2(W*X-D*U,W*U+D*X),P=E(1,0,(p-S)/c,(b-$)/u),v=E((p-S)/c,(b-$)/u,(-p-S)/c,(-b-$)/u);!i&&v>0?v-=2*Math.PI:i&&v<0&&(v+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(v)/(Math.PI/2)-1e-9)),F=v/L,k=4/3*Math.tan(F/4),T=(W,D)=>[M+c*f*W-u*d*D,R+c*d*W+u*f*D],z=[];for(let W=0;W<L;W++){let D=P+W*F,U=D+F,[X,xt]=T(Math.cos(D)-k*Math.sin(D),Math.sin(D)+k*Math.cos(D)),[lt,N]=T(Math.cos(U)+k*Math.sin(U),Math.sin(U)-k*Math.cos(U)),[B,Z]=W===L-1?[s,l]:T(Math.cos(U),Math.sin(U));z.push({op:"C",x1:X,y1:xt,x2:lt,y2:N,x:B,y:Z});}return z}function le(t){let e=[],n=0,o=0,r=0,a=0,i=0,s="",l=null,c=null,u=()=>{for(;n<t.length&&/[\s,]/.test(t[n]);)n++;},m=()=>{u(),Xa.lastIndex=n;let g=Xa.exec(t);return g?(n=Xa.lastIndex,Number(g[0])):null},f=()=>{u();let g=t[n];return g==="0"||g==="1"?(n++,g==="1"):null},d=g=>{let h=[];for(let p=0;p<g;p++){let b=m();if(b===null)return null;h.push(b);}return h};for(;u(),!(n>=t.length);){let g=t[n];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(g))s=g,n++;else if(!s||s==="Z"||s==="z")break;let h=s===s.toLowerCase(),p=h?o:0,b=h?r:0,_=s.toUpperCase();if(_==="Z"){e.push({op:"Z"}),o=a,r=i,l=null,c=null;continue}if(_==="A"){let S=d(3),$=f(),M=f(),R=d(2);if(!(S&&R)||$===null||M===null)break;let[E,P,v]=S,L=R[0]+p,F=R[1]+b;e.push(...Wd(o,r,E,P,v,$,M,L,F)),o=L,r=F,l=null,c=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,w=d(y);if(!w)break;let C=w;switch(_){case "M":o=C[0]+p,r=C[1]+b,a=o,i=r,e.push({op:"M",x:o,y:r}),s=h?"l":"L",l=null,c=null;break;case "L":case "H":case "V":_!=="V"&&(o=C[0]+p),_==="V"?r=C[0]+b:_==="L"&&(r=C[1]+b),e.push({op:"L",x:o,y:r}),l=null,c=null;break;case "C":case "S":{let S,$;_==="C"?(S=[C[0]+p,C[1]+b],$=C.slice(2)):(S=l?[2*o-l[0],2*r-l[1]]:[o,r],$=C);let M=[$[0]+p,$[1]+b],R=[$[2]+p,$[3]+b];e.push({op:"C",x1:S[0],y1:S[1],x2:M[0],y2:M[1],x:R[0],y:R[1]}),[o,r]=R,l=M,c=null;break}case "Q":case "T":{let S,$;_==="Q"?(S=[C[0]+p,C[1]+b],$=[C[2]+p,C[3]+b]):(S=c?[2*o-c[0],2*r-c[1]]:[o,r],$=[C[0]+p,C[1]+b]),e.push({op:"C",x1:o+2/3*(S[0]-o),y1:r+2/3*(S[1]-r),x2:$[0]+2/3*(S[0]-$[0]),y2:$[1]+2/3*(S[1]-$[1]),x:$[0],y:$[1]}),[o,r]=$,c=S,l=null;break}}}return e}var Yr=.5522847498;function ee(t,e,n,o){if(n<=0||o<=0)return [];let r=n*Yr,a=o*Yr;return [{op:"M",x:t+n,y:e},{op:"C",x1:t+n,y1:e+a,x2:t+r,y2:e+o,x:t,y:e+o},{op:"C",x1:t-r,y1:e+o,x2:t-n,y2:e+a,x:t-n,y:e},{op:"C",x1:t-n,y1:e-a,x2:t-r,y2:e-o,x:t,y:e-o},{op:"C",x1:t+r,y1:e-o,x2:t+n,y2:e-a,x:t+n,y:e},{op:"Z"}]}function ne(t,e,n,o,r=0,a=0){if(n<=0||o<=0)return [];let i=Math.min(Math.max(r,0),n/2),s=Math.min(Math.max(a,0),o/2);if(i===0||s===0)return [{op:"M",x:t,y:e},{op:"L",x:t+n,y:e},{op:"L",x:t+n,y:e+o},{op:"L",x:t,y:e+o},{op:"Z"}];let l=i*Yr,c=s*Yr,u=t+n,m=e+o;return [{op:"M",x:t+i,y:e},{op:"L",x:u-i,y:e},{op:"C",x1:u-i+l,y1:e,x2:u,y2:e+s-c,x:u,y:e+s},{op:"L",x:u,y:m-s},{op:"C",x1:u,y1:m-s+c,x2:u-i+l,y2:m,x:u-i,y:m},{op:"L",x:t+i,y:m},{op:"C",x1:t+i-l,y1:m,x2:t,y2:m-s+c,x:t,y:m-s},{op:"L",x:t,y:e+s},{op:"C",x1:t,y1:e+s-c,x2:t+i-l,y2:e,x:t+i,y:e},{op:"Z"}]}var rr="qrdx.frame",or=1,ar="custom",ot={minArtboard:50,maxArtboard:2e3,maxCoordinate:4e3,maxDecimals:3,maxShapes:64,maxLabels:8,maxPolygonPoints:256,maxPathLength:16e3,maxSegments:2e3,maxGradientSteps:64,maxGradientWork:16e3,maxBytes:32768,minQrShare:.5,minPadding:.04,defaultPadding:.08,maxTextLength:se},Ka=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],ir=.95,Fl=200,Ja=["frame","text","accent","background"],qd=/[\t\n\v\f\r\u0085\u2028\u2029]/g,Vd=/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u115f\u1160\u17b4\u17b5\u180b-\u180f\u200b-\u200f\u202a-\u202e\u2060-\u206f\u3164\ufe00-\ufe0f\ufeff\uffa0\ufff0-\ufffb]|\udb40[\udc00-\udcff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g;function Rn(t,e=se){let n=t.slice(0,1e3).normalize("NFC").replace(qd," ").replace(Vd,"").replace(/\s+/g," ").trim();return Array.from(n).slice(0,Math.max(0,e)).join("").trim()}function jd(t){for(let e of t)if((e.codePointAt(0)??0)>255)return false;return true}var Zr=t=>Math.abs(t*1e3-Math.round(t*1e3))<1e-6;function Kr(t){let e=En(t);return {x0:t.qr.x-e,y0:t.qr.y-e,x1:t.qr.x+t.qr.size+e,y1:t.qr.y+t.qr.size+e}}function Xd(t){return {x0:t.qr.x,y0:t.qr.y,x1:t.qr.x+t.qr.size,y1:t.qr.y+t.qr.size}}function En(t){return t.qr.padding??t.qr.size*ot.defaultPadding}var ti=.52,Yd=.35;function Zd(t){let e=t.fontSize??t.box.height*ti;return Math.min(e*$n,t.box.height*ir)}var Za=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>1e-6&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>1e-6;function kl(t){let e=Kr(t),n=Math.min(t.qr.radius??0,(e.x1-e.x0)/2,(e.y1-e.y0)/2),o=[[e.x0+n,e.y0+n,Math.PI],[e.x1-n,e.y0+n,-Math.PI/2],[e.x1-n,e.y1-n,0],[e.x0+n,e.y1-n,Math.PI/2]],r=[];for(let[a,i,s]of o)for(let l=0;l<=8;l++){let c=s+Math.PI/2*(l/8);r.push([a+n*Math.cos(c),i+n*Math.sin(c)]);}return r}function Kd([t,e],n,o){if(t<n.x-.01||e<n.y-.01||t>n.x+n.width+.01||e>n.y+n.height+.01)return false;let a=Math.min(o,n.width/2,n.height/2),i=Math.min(Math.max(t,n.x+a),n.x+n.width-a),s=Math.min(Math.max(e,n.y+a),n.y+n.height-a);return Math.hypot(t-i,e-s)<=a+.01}function Jd(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),Math.abs(e)/2}function tf(t,e,n){let o=Kr(e);if(!Za(n,o))return false;if("stroke"in t&&t.stroke)return true;if(t.fill==="background")return false;if(t.type==="rect"&&t.hole){let{hole:r}=t;return !kl(e).every(a=>Kd(a,r,r.radius??0))}if(t.type==="circle"&&t.hole){let r=t.hole;return !kl(e).every(([a,i])=>Math.hypot(a-t.cx,i-t.cy)<=r+.01)}if(t.type==="polygon"){let r=Sn(t.points,o);return r.length>2&&Jd(r)>1e-6}return true}function ei(t){let e=ef(t),n="stroke"in t?t.stroke:void 0;if(!(n&&e.bounds))return e;let o=t.type==="circle"||t.type==="ellipse"?n.width/2:t.type==="rect"?n.width*Math.SQRT2/2:n.width*2,{x0:r,y0:a,x1:i,y1:s}=e.bounds;return {bounds:{x0:r-o,y0:a-o,x1:i+o,y1:s+o},segments:e.segments*2}}function ef(t){switch(t.type){case "rect":return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.width,y1:t.y+t.height},segments:t.hole?18:9};case "circle":return {bounds:{x0:t.cx-t.r,y0:t.cy-t.r,x1:t.cx+t.r,y1:t.cy+t.r},segments:t.hole?10:5};case "ellipse":return {bounds:{x0:t.cx-t.rx,y0:t.cy-t.ry,x1:t.cx+t.rx,y1:t.cy+t.ry},segments:5};case "polygon":{let e=t.points.map(([o])=>o),n=t.points.map(([,o])=>o);return {bounds:{x0:Math.min(...e),y0:Math.min(...n),x1:Math.max(...e),y1:Math.max(...n)},segments:t.points.length}}case "path":{let e=nr(t.d,ot.maxDecimals);return e?{bounds:Qe(le(t.d)),segments:Al(e)}:{bounds:null,segments:0}}case "line":{let e=t.width/2,n=Math.hypot(t.x2-t.x1,t.y2-t.y1),o=t.dash?Math.ceil(n/(t.dash[0]+t.dash[1])):1;return {bounds:{x0:Math.min(t.x1,t.x2)-e,y0:Math.min(t.y1,t.y2)-e,x1:Math.max(t.x1,t.x2)+e,y1:Math.max(t.y1,t.y2)+e},segments:o*(t.cap==="round"?4:5)}}default:return {bounds:{x0:t.x,y0:t.y,x1:t.x+t.size,y1:t.y+t.size},segments:Fl}}}function Nl(t,e){let n=ot,o=new TextEncoder().encode(JSON.stringify(t)).length;if(o>n.maxBytes){e(`The spec is ${o} bytes; the limit is ${n.maxBytes}`);return}let{width:r,height:a}=t.artboard,i=Math.max(r,a)*.005,s={x0:-i,y0:-i,x1:r+i,y1:a+i},l=b=>b.x0>=s.x0&&b.y0>=s.y0&&b.x1<=s.x1&&b.y1<=s.y1,{qr:c}=t,u=En(t);c.plate!=="none"&&u<c.size*n.minPadding-1e-9&&e(`qr.padding must be at least ${n.minPadding*100}% of qr.size`,["qr","padding"]),c.size<Math.min(r,a)*n.minQrShare-1e-9&&e(`qr.size must be at least ${n.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let m=Kr(t);(m.x0<-1e-9||m.y0<-1e-9||m.x1>r+1e-9||m.y1>a+1e-9)&&e("The code and its padding must sit inside the artboard",["qr"]),(c.radius??0)>(c.size+2*u)/2&&e("qr.radius is larger than half the plate",["qr","radius"]);let f=0,d=0;t.shapes.forEach((b,_)=>{let y=["shapes",_],{bounds:w,segments:C}=ei(b);if(!w){e("Path data must use only M L H V C S Q T A Z, plain numbers (up to 3 decimals) and start with M",[...y,"d"]);return}if(l(w)||e("The shape extends outside the artboard",y),b.type==="rect"&&b.hole){let{hole:S}=b;(S.x<b.x||S.y<b.y||S.x+S.width>b.x+b.width+1e-9||S.y+S.height>b.y+b.height+1e-9)&&e("The hole must sit inside its rect",[...y,"hole"]);}b.type==="circle"&&b.hole&&b.hole>=b.r&&e("The hole must be smaller than the circle",[...y,"hole"]),"stroke"in b&&b.stroke&&b.stroke.width>Math.min(r,a)*.1+1e-9&&e("A stroke may be at most 10% of the artboard's shorter side",[...y,"stroke","width"]),c.plate==="background"&&tf(b,t,w)&&e('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',y),f+=C,typeof b.fill=="object"&&"gradient"in b.fill&&(d+=(b.fill.gradient.steps??32)*C);}),f>n.maxSegments&&e(`The shapes have ${f} segments; the limit is ${n.maxSegments}`,["shapes"]),d>n.maxGradientWork&&e("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let g=[],h=new Set,p=new Set;t.labels.forEach((b,_)=>{let y=["labels",_];h.has(b.id)&&e(`Label id "${b.id}" is used twice`,[...y,"id"]),h.add(b.id),b.slot!=="fixed"&&(p.has(b.slot)&&e(`Only one label may use the ${b.slot} slot`,[...y,"slot"]),p.add(b.slot));let w=b.maxLength??n.maxTextLength;b.text!==Rn(b.text,w)&&e(`Label text must be at most ${w} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(b.type==="text"){C={x0:b.box.x,y0:b.box.y,x1:b.box.x+b.box.width,y1:b.box.y+b.box.height},b.fontSize!==void 0&&b.fontSize>b.box.height*ir+1e-9&&e("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]);let S=b.box.y+b.box.height/2,$=Zd(b)*Yd,M={x0:C.x0,x1:C.x1,y0:S-$,y1:S+$};(Za(C,Xd(t))||Za(M,m))&&e("The label overlaps the code or its padding",[...y,"box"]);}else {let{cx:S,cy:$,radius:M}=b.curve,R=b.fontSize*$n*.6;C={x0:S-M-R,y0:$-M-R,x1:S+M+R,y1:$+M+R};let E=Math.hypot(Math.max(m.x0-S,0,S-m.x1),Math.max(m.y0-$,0,$-m.y1));Math.hypot(Math.max(Math.abs(m.x0-S),Math.abs(m.x1-S)),Math.max(Math.abs(m.y0-$),Math.abs(m.y1-$)))<=M-R||E>=M+R||e("The curved label crosses the code or its padding",[...y,"curve"]);}if(l(C)||e("The label extends outside the artboard",y),b.collapse){let S=b.collapse,$=S.y+S.height;(S.y<-1e-9||$>a+1e-9)&&e("The collapse band must sit inside the artboard",[...y,"collapse"]),$>m.y0+1e-6&&S.y<m.y1-1e-6&&e("The collapse band crosses the code or its padding",[...y,"collapse"]);for(let M of g)$>M.y+1e-6&&S.y<M.y+M.height-1e-6&&e("Collapse bands may not overlap",[...y,"collapse"]);g.push(S);}});}var Tt=t=>t/255,sr=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,tt=t=>.2126*t[0]+.7152*t[1]+.0722*t[2];function ni(t){let{width:e,height:n,data:o}=t,r=[0,e-1,(n-1)*e,n*e-1].map(i=>{let s=i*4;return {color:[Tt(o[s]),Tt(o[s+1]),Tt(o[s+2])],alpha:o[s+3]/255}});if(r.some(i=>i.alpha<.9))return null;let a=r[0].color;return r.every(({color:i})=>sr(i,a)<.006)?a:null}function nf(t){let{width:e,height:n,data:o}=t,r=ni(t),a=new Float32Array(e*n);for(let i=0;i<a.length;i++){let s=i*4,l=o[s+3]/255;if(r&&l>0){let c=Math.sqrt(sr([Tt(o[s]),Tt(o[s+1]),Tt(o[s+2])],r));l*=Math.min(1,Math.max(0,(c-.06)/.1));}a[i]=l;}return a}var rf=8,of=.14,Ol=.006;function af(t,e){let{width:n,height:o,data:r}=t,a=new Float64Array(4096),i=new Float64Array(4096*3),s=0;for(let d=0;d<e.length;d++){if(e[d]<.9)continue;let g=d*4,h=Math.floor(r[g]/16)*256+Math.floor(r[g+1]/16)*16+Math.floor(r[g+2]/16);a[h]+=1,i[h*3]+=Tt(r[g]),i[h*3+1]+=Tt(r[g+1]),i[h*3+2]+=Tt(r[g+2]),s++;}if(s===0)return {palette:[],error:0};let l=[...a.keys()].filter(d=>a[d]>0).sort((d,g)=>a[g]-a[d]),c=[];for(let d of l){if(a[d]/s<Ol/2||c.length>=rf)break;let g=[i[d*3]/a[d],i[d*3+1]/a[d],i[d*3+2]/a[d]];c.every(h=>sr(h,g)>=of**2)&&c.push(g);}let u=[],m=0;for(let d=0;d<3;d++){u=c.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),m=0;for(let g=0;g<e.length;g++){if(e[g]<.9)continue;let h=g*4,p=[Tt(r[h]),Tt(r[h+1]),Tt(r[h+2])],b=0,_=Number.POSITIVE_INFINITY;for(let[w,C]of c.entries()){let S=sr(p,C);S<_&&(_=S,b=w);}let y=u[b];y.n++,y.r+=p[0],y.g+=p[1],y.b+=p[2],y.x+=g%n,y.y+=Math.floor(g/n),m+=Math.sqrt(_);}for(let[g,h]of u.entries())h.n>0&&(c[g]=[h.r/h.n,h.g/h.n,h.b/h.n]);}return {palette:c.map((d,g)=>({color:d,area:u[g].n/s,cx:u[g].n?u[g].x/u[g].n+.5:n/2,cy:u[g].n?u[g].y/u[g].n+.5:o/2})).filter(d=>d.area>=Ol).sort((d,g)=>g.area-d.area),error:m/s}}function sf(t,e,n){let o=e+2,r=n+2,a=(m,f)=>m<=0||f<=0||m>e||f>n?0:t[(f-1)*e+(m-1)],i=new Map,s=new Map,l=m=>{let f=s.get(m);if(f)return f;let d=Math.floor(m/2),g=d%o,h=Math.floor(d/o),p=a(g,h),b=m%2===1,_=b?a(g,h+1):a(g+1,h),y=p===_?.5:Math.min(1,Math.max(0,(.5-p)/(_-p))),w=b?[g-.5,h-.5+y]:[g-.5+y,h-.5];return s.set(m,w),w},c=(m,f)=>{i.set(m,f);};for(let m=0;m<r-1;m++)for(let f=0;f<o-1;f++){let d=a(f,m)>=.5,g=a(f+1,m)>=.5,h=a(f+1,m+1)>=.5,p=a(f,m+1)>=.5,b=2*(m*o+f),_=2*((m+1)*o+f),y=2*(m*o+f)+1,w=2*(m*o+f+1)+1;switch((d?8:0)+(g?4:0)+(h?2:0)+(p?1:0)){case 1:c(_,y);break;case 2:c(w,_);break;case 3:c(w,y);break;case 4:c(b,w);break;case 5:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(b,y),c(_,w)):(c(b,w),c(_,y));break}case 6:c(b,_);break;case 7:c(b,y);break;case 8:c(y,b);break;case 9:c(_,b);break;case 10:{(a(f,m)+a(f+1,m)+a(f+1,m+1)+a(f,m+1))/4>=.5?(c(y,_),c(w,b)):(c(y,b),c(w,_));break}case 11:c(w,b);break;case 12:c(y,w);break;case 13:c(_,w);break;case 14:c(y,_);break;}}let u=[];for(let m of i.keys()){if(!i.has(m))continue;let f=[],d=m;for(;d!==void 0&&i.has(d);){f.push(l(d));let g=i.get(d);i.delete(d),d=g;}f.length>=3&&u.push(f);}return u}function lf(t){let e=0;for(let n=0;n<t.length;n++){let o=t[n],r=t[(n+1)%t.length];e+=o[0]*r[1]-r[0]*o[1];}return e/2}function Dl(t,e){if(t.length<=2)return t;let n=new Uint8Array(t.length);n[0]=1,n[t.length-1]=1;let o=[[0,t.length-1]];for(;o.length>0;){let[r,a]=o.pop(),i=t[r],s=t[a],l=s[0]-i[0],c=s[1]-i[1],u=Math.hypot(l,c)||1,m=-1,f=e;for(let d=r+1;d<a;d++){let g=t[d],h=Math.abs(c*(g[0]-i[0])-l*(g[1]-i[1]))/u;h>f&&(f=h,m=d);}m>=0&&(n[m]=1,o.push([r,m],[m,a]));}return t.filter((r,a)=>n[a]===1)}function cf(t,e){let n=0,o=-1;for(let[i,s]of t.entries()){let l=(s[0]-t[0][0])**2+(s[1]-t[0][1])**2;l>o&&(o=l,n=i);}let r=Dl(t.slice(0,n+1),e),a=Dl([...t.slice(n),t[0]],e);return [...r.slice(0,-1),...a.slice(0,-1)]}var xe=t=>J(t,2);function uf(t,e){let n=t.length,o=(a,i)=>{let s=Math.hypot(i[0]-a[0],i[1]-a[1])||1,l=Math.min(.5,e/s);return [a[0]+(i[0]-a[0])*l,a[1]+(i[1]-a[1])*l]},r="";for(let a=0;a<n;a++){let i=t[a],s=o(i,t[(a-1+n)%n]),l=o(i,t[(a+1)%n]);r+=a===0?`M${xe(s[0])} ${xe(s[1])}`:`L${xe(s[0])} ${xe(s[1])}`,r+=`Q${xe(i[0])} ${xe(i[1])} ${xe(l[0])} ${xe(l[1])}`;}return `${r}Z`}function mf(t,e,n){let o="";for(let r of sf(t,e,n)){if(Math.abs(lf(r))<.8)continue;let a=cf(r,.18);a.length>=3&&(o+=uf(a,.9));}return o}var df=.075;function Bl(t){let{width:e,height:n,data:o}=t,r=nf(t),a=0;for(let h of r)a+=h;let{palette:i,error:s}=af(t,r),l={width:e,height:n,palette:i,alpha:r,coverage:a/(e*n)};if(i.length===0||s>df)return {...l,layers:[],photographic:i.length>0};let c=i.length,u=Array.from({length:c},()=>new Float32Array(e*n)),m=i.map(h=>h.color);for(let h=0;h<r.length;h++){let p=r[h];if(p<=0)continue;let b=h*4,_=[Tt(o[b]),Tt(o[b+1]),Tt(o[b+2])],y=0,w=-1,C=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY;for(let P=0;P<c;P++){let v=sr(_,m[P]);v<C?(w=y,S=C,y=P,C=v):v<S&&(w=P,S=v);}if(w<0||C<1e-6){u[y][h]=p;continue}let $=m[y],M=m[w],R=[M[0]-$[0],M[1]-$[1],M[2]-$[2]],E=Math.min(1,Math.max(0,((_[0]-$[0])*R[0]+(_[1]-$[1])*R[1]+(_[2]-$[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));u[y][h]=p*(1-E),u[w][h]=p*E;}let f=[],d=new Float32Array(e*n),g=new Array(c);for(let h=c-1;h>=0;h--){let p=u[h];for(let b=0;b<d.length;b++)d[b]+=p[b];g[h]=d.slice();}for(let h=0;h<c;h++){let p=mf(g[h],e,n);p&&f.push({color:m[h],d:p});}return {...l,layers:f,photographic:false}}var{QrCode:ri}=dt,ff={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function hf(t){let e=t*4+17,n=new Uint8Array(e*e),o=(i,s)=>{i>=0&&s>=0&&i<e&&s<e&&(n[s*e+i]=1);};for(let i=0;i<e;i++)o(6,i),o(i,6);for(let[i,s]of [[3,3],[e-4,3],[3,e-4]])for(let l=-4;l<=4;l++)for(let c=-4;c<=4;c++)o(i+c,s+l);let r=[];if(t>1){let i=Math.floor(t/7)+2,s=t===32?26:Math.ceil((t*4+4)/(i*2-2))*2;r.push(6);for(let l=e-7;r.length<i;l-=s)r.splice(1,0,l);}let a=r.length-1;for(let[i,s]of r.entries())for(let[l,c]of r.entries())if(!(i===0&&l===0||i===0&&l===a||i===a&&l===0))for(let u=-2;u<=2;u++)for(let m=-2;m<=2;m++)o(s+m,c+u);for(let i=0;i<=8;i++)o(8,i),o(i,8);for(let i=0;i<8;i++)o(e-1-i,8),o(8,e-1-i);if(t>=7)for(let i=0;i<18;i++){let s=e-11+i%3,l=Math.floor(i/3);o(s,l),o(l,s);}return n}function pf(t,e){let n=t*4+17,o=St[e].ordinal,r=ri.NUM_ERROR_CORRECTION_BLOCKS[o]?.[t]??0,a=ri.ECC_CODEWORDS_PER_BLOCK[o]?.[t]??0,i=Math.floor(ri.getNumRawDataModules(t)/8),s=r-i%r,l=Math.floor(i/r),c=Array.from({length:r},(w,C)=>l+(C<s?0:1)),u=[],m=[],f=l-a;for(let w=0;w<=l;w++)for(let C=0;C<r;C++)if(C<s){if(w===f)continue;u.push(C),m.push(w<f?w:w-1);}else u.push(C),m.push(w);if(u.length!==i)throw new Error(`Codeword map: interleave mismatch at version ${t}`);let d=hf(t),g=new Int16Array(n*n).fill(-1),h=new Int16Array(n*n).fill(-1),p=new Int8Array(n*n).fill(-1),b=i*8,_=0;for(let w=n-1;w>=1;w-=2){w===6&&(w=5);let C=(w+1&2)===0;for(let S=0;S<n;S++)for(let $=0;$<2;$++){let M=w-$,E=(C?n-1-S:S)*n+M;if(!d[E]&&_<b){let P=_>>>3;g[E]=u[P],h[E]=m[P],p[E]=7-(_&7),_++;}}}if(_!==b)throw new Error(`Codeword map: placement mismatch at version ${t}`);let y=ff[`${t}${e}`]??0;return {version:t,level:e,size:n,blocks:r,eccPerBlock:a,blockLengths:c,correctable:Math.floor((a-y)/2),block:g,codeword:h,bit:p}}var gf=8,Ue=new Map;function lr(t,e){if(!(Number.isInteger(t)&&t>=1&&t<=40))throw new RangeError(`QR version must be 1\u201340, got ${t}`);let n=`${t}${e}`,o=Ue.get(n);if(o)return Ue.delete(n),Ue.set(n,o),o;let r=pf(t,e);if(Ue.size>=gf){let a=Ue.keys().next().value;a!==void 0&&Ue.delete(a);}return Ue.set(n,r),r}function cr(t,e){let n=new Array(t.blocks).fill(0),o=new Set;for(let r of e){let a=t.block[r]??-1;if(a<0)continue;let i=a*4096+t.codeword[r];o.has(i)||(o.add(i),n[a]=n[a]+1);}return n}var bf={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},_f=Object.fromEntries(Object.entries(bf).map(([t,e])=>[t,[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]]));function Gl(t,e){let n=t.trim(),o=Number.parseFloat(n);return Number.isNaN(o)?Number.NaN:n.endsWith("%")?o/100*e:o}function at(t){if(!t)return null;let e=t.trim().toLowerCase();if(e==="transparent")return {r:0,g:0,b:0,a:0};let n=_f[e];if(n)return {r:n[0],g:n[1],b:n[2],a:1};if(e.startsWith("#")){let r=e.slice(1);return (r.length===3||r.length===4)&&(r=r.split("").map(a=>a+a).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(r)?{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16),a:r.length===8?Number.parseInt(r.slice(6,8),16)/255:1}:null}let o=/^rgba?\(([^)]*)\)$/.exec(e);if(o){let[r,a]=o[1].split("/"),i=r.split(/[\s,]+/).filter(Boolean);if(i.length!==(a===void 0&&i.length===4?4:3))return null;let s=a??i[3],[l,c,u]=i.slice(0,3).map(d=>Gl(d,255)),m=s===void 0?1:Gl(s,1);if([l,c,u,m].some(d=>Number.isNaN(d)))return null;let f=(d,g)=>Math.min(Math.max(d,0),g);return {r:f(l,255),g:f(c,255),b:f(u,255),a:f(m,1)}}return null}function $e(t,e,n){let o=t/255,r=e/255,a=n/255,i=1-Math.max(o,r,a);return i>=1?[0,0,0,1]:[J((1-o-i)/(1-i)),J((1-r-i)/(1-i)),J((1-a-i)/(1-i)),J(i)]}function Ut(t){return t.children}var yf=t=>t==null?null:`${t}`;function oi(t,e,n){let o=e??{},r=n;if("key"in o){let{key:a,...i}=o;a!==void 0&&(r=a),o=i;}return {type:t,props:o,key:yf(r)}}function xf(t,e){let n=t;return {type:n.type,props:{...n.props,...e},key:n.key??null}}function $f(t,e,...n){let o={...e};return n.length>0&&(o.children=n.length===1?n[0]:n),oi(t,o)}var Sf={jsx:oi,jsxs:oi,createElement:$f,cloneElement:xf,Fragment:Ut},ur=Sf;var ai=t=>t===Ut?ur.Fragment:t;function A(t,e,n){return ur.jsx(ai(t),e,n)}function $t(t,e,n){return ur.jsxs(ai(t),e,n)}function Jr(t,e,...n){return ur.createElement(ai(t),e??null,...n)}function He(t,e){return ur.cloneElement(t,e)}var wf=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Ql=Symbol.for("react.fragment");function ze(t){if(typeof t!="object"||t===null||Array.isArray(t))return false;let e=t;return e.$$typeof!==void 0&&!wf.has(e.$$typeof)?false:(typeof e.type=="string"||typeof e.type=="function"||e.type===Ql)&&typeof e.props=="object"&&e.props!==null}var An=t=>t===Ut||t===Ql;var Vl=.6,li={logo:160,halftone:160};function Cf(t){let e="";for(let o=0;o<t.length;o+=32768)e+=String.fromCharCode(...t.subarray(o,o+32768));return btoa(e)}var Pn=class{entries=new Map;limit;constructor(e){this.limit=e;}get(e,n){let o=this.entries.get(e);if(o!==void 0)return this.entries.delete(e),this.entries.set(e,o),o;let r=n();if(this.entries.size>=this.limit){let a=this.entries.keys().next().value;a!==void 0&&this.entries.delete(a);}return this.entries.set(e,r),r}},Mf=new Pn(8);function Rf(t){return Mf.get(t,()=>{let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n})}function ci(t){let{width:e,height:n,data:o}=t;if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>Jn||n>Jn||typeof o!="string")return null;try{let r=Rf(o);return r.length===e*n*4?{width:e,height:n,data:r}:null}catch{return null}}function jl(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=Math.min(n,o),i=e.square?Math.floor((n-a)/2):0,s=e.square?Math.floor((o-a)/2):0,l=e.square?a:n,c=e.square?a:o,u=Math.min(Math.max(Math.round(e.maxSize??li.halftone),1),Jn),m=Math.min(1,u/Math.max(l,c)),f=Math.max(1,Math.round(l*m)),d=Math.max(1,Math.round(c*m)),g=new Uint8Array(f*d*4);for(let h=0;h<d;h++){let p=Math.floor(h*c/d),b=Math.max(p+1,Math.floor((h+1)*c/d));for(let _=0;_<f;_++){let y=Math.floor(_*l/f),w=Math.max(y+1,Math.floor((_+1)*l/f)),C=0,S=0,$=0,M=0,R=0;for(let P=p;P<b;P++)for(let v=y;v<w;v++){let L=((P+s)*n+v+i)*4,F=r[L+3]/255;C+=r[L]*F,S+=r[L+1]*F,$+=r[L+2]*F,M+=F,R++;}let E=(h*f+_)*4;g[E]=M>0?Math.round(C/M):0,g[E+1]=M>0?Math.round(S/M):0,g[E+2]=M>0?Math.round($/M):0,g[E+3]=Math.round(M/R*255);}}return {width:f,height:d,data:Cf(g)}}async function Ef(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the art image")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function Af(t,e={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let n=e.mode??"halftone",o=e.maxSize??li[n],r=await Ef(t),a=r.naturalWidth||r.width||o,i=r.naturalHeight||r.height||o,s=n==="halftone",l=Math.min(1,o*4/(s?Math.min(a,i):Math.max(a,i))),c=Math.max(1,Math.round(a*l)),u=Math.max(1,Math.round(i*l)),m=document.createElement("canvas");m.width=c,m.height=u;let f=m.getContext("2d",{willReadFrequently:true});if(!f)throw new Error("Could not get a canvas context");f.imageSmoothingQuality="high",f.drawImage(r,0,0,c,u);let d;try{d=f.getImageData(0,0,c,u);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{m.remove();}return jl(d,{maxSize:o,square:s})}function ui(t){return !!(t&&zr.includes(t.mode)&&t.image&&ci(t.image))}function no(t){let e=Aa[t.mode];return t.variant&&e.includes(t.variant)?t.variant:e[0]}function Pf(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function mr(t,e){let n=Pf(t,e),o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return r}var If=0,Ht=1,Vt=2,Se=3,Ul=4,Hl=new Map;function Xl(t){let e=Hl.get(t);if(e)return e;let n=t*4+17,o=new Uint8Array(n*n),r=(a,i,s,l,c)=>{for(let u=Math.max(0,i);u<Math.min(n,i+l);u++)for(let m=Math.max(0,a);m<Math.min(n,a+s);m++)o[u*n+m]=c;};r(6,0,1,n,Ul),r(0,6,n,1,Ul),r(0,8,9,1,Se),r(8,0,1,9,Se),r(n-8,8,8,1,Se),r(8,n-8,1,8,Se),t>=7&&(r(n-11,0,3,6,Se),r(0,n-11,6,3,Se));for(let[a,i]of mr(t,n))r(a-2,i-2,5,5,Vt);return r(0,0,8,8,Ht),r(n-8,0,8,8,Ht),r(0,n-8,8,8,Ht),Hl.set(t,o),o}function vf(t){let e=t*4+17,n=Xl(t);return Array.from({length:e},(o,r)=>Array.from({length:e},(a,i)=>n[r*e+i]!==If))}function Lf(t){let e=t[8],n=e?.[0]?1:0,o=e?.[1]?1:0,r=(1-n)*2+o;return ["M","L","H","Q"][r]??"M"}function In(t,e){let n=at(t);return !n||n.a===0?e:[n.r/255,n.g/255,n.b/255]}var qe=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n];function we(t,e,n,o){let r=tt(t);if(o?r<=n:r>=n)return t;let a=tt(e);return Math.abs(r-a)<1e-6?e:qe(t,e,Math.min(1,Math.max(0,(r-n)/(r-a))))}var Yl=t=>Math.max(...t)-Math.min(...t),Tf=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2,ii=t=>t.toString(16).padStart(2,"0");function kt(t,e=1){let n=o=>Math.min(255,Math.round(Math.round(Math.min(Math.max(o,0),1)*255)/e)*e);return `#${ii(n(t[0]))}${ii(n(t[1]))}${ii(n(t[2]))}`}function kf(t){let e=t<0?-1:1,n=Math.abs(t),o=1/(1+.3275911*n),r=1-((((1.061405429*o-1.453152027)*o+1.421413741)*o-.284496736)*o+.254829592)*o*Math.exp(-n*n);return e*r}var mi=.3,zl=t=>1-Math.exp(-((t/2)**2)/(2*mi**2)),Ff=t=>kf(t/(2*mi*Math.SQRT2))**2,Nf=(t,e,n)=>{let o=Math.min(1,Math.max(0,(n-t)/(e-t)));return o*o*(3-2*o)};function di(t,e,n,o){let r=o==="cover"?Math.max(n/t,n/e):Math.min(n/t,n/e);return {scale:r,offsetX:(n-t*r)/2,offsetY:(n-e*r)/2}}function Zl(t,e){let{width:n,height:o,data:r}=t,a=new Float32Array(n*o*3),i=e??new Float32Array(n*o);for(let s=0;s<n*o;s++)a[s*3]=r[s*4]/255,a[s*3+1]=r[s*4+1]/255,a[s*3+2]=r[s*4+2]/255,e||(i[s]=r[s*4+3]/255);return {width:n,height:o,rgb:a,alpha:i}}function Of(t){let e=Zl(t),{rgb:n,alpha:o}=e,r=new Float64Array(256),a=0;for(let m=0;m<o.length;m++){if(o[m]<.5)continue;let f=tt([n[m*3],n[m*3+1],n[m*3+2]]);r[Math.min(255,Math.floor(f*256))]+=1,a++;}let i=m=>{let f=0;for(let d=0;d<256;d++)if(f+=r[d],f>=m*a)return d/255;return 1},s=a?i(.01):0,l=a?i(.99):1;l-s<.15&&(s=0,l=1);let c=Math.min(1.6,1/(l-s)),u=(s+l)/2;for(let m=0;m<o.length;m++){let f=[n[m*3],n[m*3+1],n[m*3+2]],d=tt(f),g=.5+(d-u)*c;for(let h=0;h<3;h++)n[m*3+h]=Math.min(1,Math.max(0,g+(f[h]-d)*1.12));}return e}function Kl(t,e,n,o,r=1){let{width:a,height:i,rgb:s,alpha:l}=t,c=Math.min(Math.max(e-.5,0),a-1),u=Math.min(Math.max(n-.5,0),i-1),m=Math.floor(c),f=Math.floor(u),d=Math.min(m+1,a-1),g=Math.min(f+1,i-1),h=c-m,p=u-f,b=0,_=0,y=0,w=0,C=($,M,R)=>{let E=M*a+$,P=l[E]*R;b+=s[E*3]*P,_+=s[E*3+1]*P,y+=s[E*3+2]*P,w+=P;};if(C(m,f,(1-h)*(1-p)),C(d,f,h*(1-p)),C(m,g,(1-h)*p),C(d,g,h*p),w<=0)return o;let S=w*r;return [o[0]+(b/w-o[0])*S,o[1]+(_/w-o[1])*S,o[2]+(y/w-o[2])*S]}var Df=new Pn(4),Bf=new Pn(6),Gf=new Pn(6);function fi(t,e){return Bf.get(t.image.data,()=>Bl(e))}function Jl(t,e,n){return Gf.get(t.image.data,()=>Zl(e,n.alpha))}var wt=t=>J(t,2),tc=t=>J(t,4),Ve=class{groups=new Map;add(e,n){let o=this.groups.get(e);o?o.push(n):this.groups.set(e,[n]);}cellRun(e,n,o,r){this.add(e,`M${n} ${o}h${r}.04v1.04h-${r}.04z`);}circle(e,n,o,r){this.add(e,Qf(n,o,r));}toElements(e){return [...this.groups].map(([n,o],r)=>A("path",{d:o.join(""),fill:n},`${e}-${r}`))}};function Qf(t,e,n){let o=wt(n*2),r=wt(n);return `M${wt(t-n)} ${wt(e)}a${r} ${r} 0 1 0 ${o} 0a${r} ${r} 0 1 0 ${-o} 0z`}function We(t,e,n,o,r){let a=Math.min(r,n/2,o/2);if(a<=0)return `M${wt(t)} ${wt(e)}h${wt(n)}v${wt(o)}h${wt(-n)}z`;let i=wt(a);return `M${wt(t+a)} ${wt(e)}h${wt(n-2*a)}a${i} ${i} 0 0 1 ${i} ${i}v${wt(o-2*a)}a${i} ${i} 0 0 1 ${-i} ${i}h${wt(-(n-2*a))}a${i} ${i} 0 0 1 ${-i} ${-i}v${wt(-(o-2*a))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function ec(t,e,n){let o="";for(let[r,a]of t){let i=(r-2+e)*n,s=(a-2+e)*n;o+=We(i,s,5*n,5*n,n*.35),o+=We(i+n,s+n,3*n,3*n,n*.15),o+=We(i+2*n,s+2*n,n,n,n*.12);}return o}var Uf={blend:1,badge:1,color:.9,mono:.7},eo=.35;function Hf(t,e){let n=In(t,[0,0,0]),o=In(e,[1,1,1]),r=tt(o)-tt(n);return r>=eo?null:r<=-eo?"inverted":"low-contrast"}function nc(t,e,n){let o=Math.min(Math.max(t.intensity??Vl,0),Uf[no(t)]);return tt(n)-tt(e)>=eo?o:0}function zf(t){let{art:e,modules:n,version:o}=t,r=e.image&&ci(e.image);if(!(r&&zr.includes(e.mode)))return null;let a=n.length;if(a!==o*4+17)return null;let i=In(t.fgColor,[0,0,0]),s=In(t.bgColor,[1,1,1]),l=nc(e,i,s);return l<=0?null:{art:e,image:r,modules:n,size:a,version:o,kinds:Xl(o),margin:t.margin,pixelSize:t.pixelSize,t:l,fg:i,bg:s,variant:no(e),body:t.body}}function hi(t){let e=zf(t);if(!e)return null;let n;return e.art.mode==="halftone"?n=e.variant==="mono"?Yf(e):Xf(e):n=e.variant==="badge"?a1(e):Zf(e),A("g",{"data-qrdx-art":e.art.mode,"data-qrdx-art-variant":e.variant,children:n})}function Wf(t,e){return {margin:.42-.17*t+(e===3?.04:0),darkCap:.4+.3*t}}var rc=8.5,Wl=new Map;function pi(t){let e=t*4+17,n=Wl.get(t);if(!n){let a=e*2,i=new Uint8Array(a*a),s=rc*2;for(let l=0;l<a;l++)for(let c=0;c<a;c++){let u=c<s||c>=a-s,m=l<s||l>=a-s;u&&m&&!(c>=a-s&&l>=a-s)&&(i[l*a+c]=1);}for(let[l,c]of mr(t,e))for(let u=(c-2)*2-1;u<(c+3)*2+1;u++)for(let m=(l-2)*2-1;m<(l+3)*2+1;m++)m>=0&&u>=0&&m<a&&u<a&&(i[u*a+m]=1);Wl.set(t,i),n=i;}let o=n,r=e*2;return (a,i)=>{let s=Math.floor(a*2),l=Math.floor(i*2);return s>=0&&l>=0&&s<r&&l<r&&o[l*r+s]===1}}function oc(t,e,n=false){let{image:o,size:r,kinds:a,fg:i,bg:s}=t,l=Df.get(t.art.image.data,()=>Of(o)),c=di(o.width,o.height,r,"cover"),u=r*e,m=new Float32Array(u*u*3).fill(Number.NaN),d=1/(e*c.scale)>1.3?2:1,g=tt(s)-.1*(tt(s)-tt(i)),h=pi(t.version);for(let p=0;p<r;p++)for(let b=0;b<r;b++){let _=a[p*r+b],y=_===Ht||_===Vt;if(!(y&&!n))for(let w=0;w<e;w++)for(let C=0;C<e;C++){let S=0,$=0,M=0;for(let k=0;k<d;k++)for(let T=0;T<d;T++){let z=b+(C+(T+.5)/d)/e,W=p+(w+(k+.5)/d)/e,D=Kl(l,(z-c.offsetX)/c.scale,(W-c.offsetY)/c.scale,s);S+=D[0],$+=D[1],M+=D[2];}let R=d*d,E=[S/R,$/R,M/R],P=b+(C+.5)/e,v=p+(w+.5)/e,L=Math.min(P,v,r-P,r-v);L<1.5&&(E=qe(E,s,.35*(1-L/1.5))),n&&(y||h(P,v))&&(E=we(E,s,g,false));let F=((p*e+w)*u+b*e+C)*3;m[F]=E[0],m[F+1]=E[1],m[F+2]=E[2];}}return {n:e,count:u,rgb:m}}function qf(t,e,n){let{size:o,kinds:r,modules:a,fg:i,bg:s,t:l}=t,{n:c,count:u,rgb:m}=e,f=tt(i),d=tt(s),g=d-f,h=Wf(l,c),p=M=>.2126*m[M]+.7152*m[M+1]+.0722*m[M+2],b=new Float32Array(o*o),_=new Float32Array(o*o);for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===Ht){b[M*o+R]=d;continue}if(E===Vt){b[M*o+R]=a[M]?.[R]?f:d;continue}let P=0,v=0,L=0;for(let F=0;F<c;F++)for(let k=0;k<c;k++){let T=p(((M*c+F)*u+R*c+k)*3);P+=T,n.under[F*c+k]||(v+=T,L++);}b[M*o+R]=P/(c*c),_[M*o+R]=L?v/L:P/(c*c);}let y=o+1,w=new Float64Array(y*y);for(let M=0;M<o;M++)for(let R=0;R<o;R++)w[(M+1)*y+R+1]=b[M*o+R]+w[M*y+R+1]+w[(M+1)*y+R]-w[M*y+R];let C=2,S=(M,R)=>{let E=Math.max(0,M-C),P=Math.max(0,R-C),v=Math.min(o,M+C+1),L=Math.min(o,R+C+1);return (w[L*y+v]-w[P*y+v]-w[L*y+E]+w[P*y+E])/((v-E)*(L-P))},$=n.weight;for(let M=0;M<o;M++)for(let R=0;R<o;R++){let E=r[M*o+R];if(E===Ht||E===Vt)continue;let P=E===Se,v=(h.margin+(P?.08:0))*g,L=(h.darkCap-(P?.12:0))*g,F=($*((n.light-n.dark)/2)-v)/(1-$),k=S(R,M),T=_[M*o+R],z=!!a[M]?.[R],W=0,D=s;if(z){let U=Math.min(k+F,f+L);T>U&&(W=(T-U)/Math.max(T-f,1e-6),D=i);}else {let U=Math.max(k-F,d-L);T<U&&(W=(U-T)/Math.max(d-T,1e-6));}if(!(W<=0)){W=Math.min(1,W);for(let U=0;U<c;U++)for(let X=0;X<c;X++){let xt=((M*c+U)*u+R*c+X)*3;for(let lt=0;lt<3;lt++)m[xt+lt]+=(D[lt]-m[xt+lt])*W;}}}}function ac(t,e,n,o){let{count:r}=e,a=new Ve;for(let l=0;l<r;l++){let c=0,u=n(l*r);for(let m=1;m<=r;m++){let f=m<r?n(l*r+m):null;(m===r||f!==u)&&(u&&a.cellRun(u,c,l,m-c),c=m,u=f);}}let i=t.pixelSize/e.n,s=wt(t.margin*t.pixelSize);return A("g",{transform:`translate(${s} ${s}) scale(${tc(i)})`,children:a.toElements(o)},o)}function gi(t,e){let n=mr(t.version,t.size);return n.length===0?[]:[A("path",{d:ec(n,t.margin,t.pixelSize),fill:e,fillRule:"evenodd"},"art-alignment")]}function ic(t){let{image:e,size:n}=t;return Math.floor(Math.min(e.width,e.height)/n)>=4&&n<=45?4:3}var Vf=t=>2*mi*Math.sqrt(-2*Math.log(1-Math.min(t,.95)));function jf(t,e,n){let o=e+1,r=new Float64Array(o*o);for(let i=0;i<e;i++)for(let s=0;s<e;s++)r[(i+1)*o+s+1]=t[i*e+s]+r[i*o+s+1]+r[(i+1)*o+s]-r[i*o+s];let a=new Float32Array(e*e);for(let i=0;i<e;i++)for(let s=0;s<e;s++){let l=Math.max(0,s-n),c=Math.max(0,i-n),u=Math.min(e,s+n+1),m=Math.min(e,i+n+1);a[i*e+s]=(r[m*o+u]-r[c*o+u]-r[m*o+l]+r[c*o+l])/((u-l)*(m-c));}return a}function sc(t,e,n,o){let{size:r,kinds:a,modules:i,fg:s,bg:l}=t,c=tt(s),u=tt(l),m=u-c,f=jf(e,r,2),d=new Float32Array(r*r),g=new Float32Array(r*r).fill(Number.NaN);for(let h=0;h<r;h++)for(let p=0;p<r;p++){let b=h*r+p,_=a[b];if(_===Ht||_===Vt)continue;let y=_===Se,w=o.base+(y?.08:0),C=(o.margin+(y?.03:0))*m,S=(o.cap-(y?.04:0))*m,$=zl(w),M=zl(y?Math.max(o.max,.94):o.max),R=$*((o.dark+o.light)/2)+(1-$)*f[b],E=n[b],P=!!i[h]?.[p],v=P?o.dark:o.light,L=P?Math.min(R-C,c+S):Math.max(R+C,u-S),k=(P?E<=L:E>=L)?0:(E-L)/(E-v);k>M&&(k=M,g[b]=Math.min(u,Math.max(c,(L-M*v)/(1-M))));let T=P?E<=L-.06:E>=L+.06;o.skip&&T&&!y||(k=Math.max(k,$)),d[b]=k>0?Vf(k):0;}return {diameter:d,surround:g}}function Xf(t){let{size:e,kinds:n,modules:o,fg:r,bg:a,t:i,margin:s,pixelSize:l}=t,c=ic(t),u=oc(t,c,true),m=tt(r),f=tt(a),d=m+.1*(f-m),g=f-.05*(f-m),{count:h,rgb:p}=u,b=(S,$,M,R)=>(($*c+R)*h+S*c+M)*3,_=new Float32Array(e*e);for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=n[S*e+$];if(M===Ht||M===Vt){_[S*e+$]=M===Vt&&o[S]?.[$]?m:f;continue}let R=0;for(let E=0;E<c;E++)for(let P=0;P<c;P++){let v=b($,S,P,E);R+=.2126*p[v]+.7152*p[v+1]+.0722*p[v+2];}_[S*e+$]=R/(c*c);}let y=sc(t,_,_,{base:.6-.28*i,max:.86,dark:d,light:g,margin:.2-.1*i,cap:.4+.14*i,skip:false});for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=y.surround[S*e+$];if(Number.isNaN(M))continue;let R=_[S*e+$],P=M<R?r:a,v=Math.min(1,Math.abs(R-M)/Math.max(Math.abs(R-tt(P)),1e-6));for(let L=0;L<c;L++)for(let F=0;F<c;F++){let k=b($,S,F,L);for(let T=0;T<3;T++)p[k+T]+=(P[T]-p[k+T])*v;}}let w=[ac(t,u,S=>{let $=S*3;return Number.isNaN(p[$])?null:kt([p[$],p[$+1],p[$+2]],8)},"art-photo")],C=new Ve;for(let S=0;S<e;S++)for(let $=0;$<e;$++){let M=y.diameter[S*e+$];if(!(M>0))continue;let R=0,E=0,P=0;for(let F=0;F<c;F++)for(let k=0;k<c;k++){let T=b($,S,k,F);R+=p[T],E+=p[T+1],P+=p[T+2];}let v=[R/(c*c),E/(c*c),P/(c*c)],L=o[S]?.[$]?we(v,r,d,true):we(v,a,g,false);C.circle(kt(L,10),($+s+.5)*l,(S+s+.5)*l,M/2*l);}return w.push(...C.toElements("art-dot"),...gi(t,kt(r))),w}function Yf(t){let{size:e,kinds:n,modules:o,fg:r,bg:a}=t,i=ic(t),s=oc(t,i),l=tt(r),c=tt(a),u=i%2===1?1:2,m=(i-u)/2,f=R=>R>=m&&R<m+u,d=[];for(let R=0;R<i;R++)for(let E=0;E<i;E++)d.push(f(E)&&f(R));qf(t,s,{weight:Ff(u/i),dark:l,light:c,under:d});let{count:g,rgb:h}=s,p=new Float32Array(g*g),b=new Int8Array(g*g).fill(-1);for(let R=0;R<g*g;R++){let E=R*3;if(Number.isNaN(h[E])){p[R]=Number.NaN;continue}let P=(.2126*h[E]+.7152*h[E+1]+.0722*h[E+2]-l)/(c-l);p[R]=.5+(Nf(0,1,P)-.5)*1.15;}for(let R=0;R<e;R++)for(let E=0;E<e;E++){let P=n[R*e+E];if(!(P===Ht||P===Vt))for(let v=m;v<m+u;v++)for(let L=m;L<m+u;L++)b[(R*i+v)*g+E*i+L]=o[R]?.[E]?0:1;}let _=pi(t.version);for(let R=0;R<g;R++)for(let E=0;E<g;E++){let P=R*g+E;b[P]<0&&_((E+.5)/i,(R+.5)/i)&&(b[P]=1);}let y=new Uint8Array(g*g),w=.3,C=0,S=0,$=(R,E,P)=>{if(R<0||R>=g||E>=g)return;let v=E*g+R;if(!Number.isNaN(p[v])){let L=Math.floor(R/i)===Math.floor(C/i)&&Math.floor(E/i)===Math.floor(S/i);p[v]+=L?P:P*w;}};for(let R=0;R<g;R++){let E=R%2===0?1:-1;for(let P=0;P<g;P++){let v=E===1?P:g-1-P,L=R*g+v,F=p[L];if(Number.isNaN(F))continue;let k=b[L]>=0?b[L]:F>=.5?1:0;y[L]=k===0?1:0;let T=Math.min(.75,Math.max(-0.75,F-k));C=v,S=R,$(v+E,R,T*7/16),$(v-E,R+1,T*3/16),$(v,R+1,T*5/16),$(v+E,R+1,T/16);}}let M=kt(r);return [ac(t,s,R=>y[R]?M:null,"art-halftone"),...gi(t,M)]}function ql(t,e){let n=null,o=0;for(let r of t.palette){if(e&&Tf(r.color,e)<.02)continue;let a=r.area*(.35+Yl(r.color))*(tt(r.color)>.86?.05:1);a>o&&(o=a,n=r.color);}return n}function lc(t,e,n,o,r){let a;if(t.photographic){let i=new Ve,{width:s,height:l,rgb:c,alpha:u}=e;for(let m=0;m<l;m++){let f=0,d=null;for(let g=0;g<=s;g++){let h=m*s+g,p=g<s&&u[h]>=.5?kt(o([c[h*3],c[h*3+1],c[h*3+2]]),6):null;(g===s||p!==d)&&(d&&i.cellRun(d,f,m,g-f),f=g,d=p);}}a=i.toElements(`${r}-px`);}else a=t.layers.map((i,s)=>A("path",{d:i.d,fill:kt(o(i.color)),fillRule:"evenodd"},`${r}-${s}`));return A("g",{transform:`translate(${wt(n.x)} ${wt(n.y)}) scale(${tc(n.scale)})`,children:a},r)}function Zf(t){let{art:e,image:n,size:o,kinds:r,modules:a,fg:i,bg:s,t:l,margin:c,pixelSize:u}=t,m=fi(e,n),f=Jl(e,n,m),d=di(m.width,m.height,o,"contain"),g=Math.min(1,.3+1.4*l),h=T=>qe(s,T,g),p=kt(s),b=kt(i),_=[lc(m,f,{x:(c+d.offsetX)*u,y:(c+d.offsetY)*u,scale:d.scale*u},h,"art-logo")],y=rc,w=(T,z)=>We((T+c)*u,(z+c)*u,(y+.4)*u,(y+.4)*u,1.2*u),C=mr(t.version,o).map(([T,z])=>We((T-2.5+c)*u,(z-2.5+c)*u,6*u,6*u,u*.8)).join("");_.push(A("path",{d:w(-0.4,-0.4)+w(o-y,-0.4)+w(-0.4,o-y)+C,fill:p},"art-plates"));let S=pi(t.version),$=tt(s),M=tt(i),R=new Float32Array(o*o),E=new Float32Array(o*o),P=new Array(o*o);for(let T=0;T<o;T++)for(let z=0;z<o;z++){let W=T*o+z,D=r[W];if(D===Ht||D===Vt){R[W]=D===Vt&&a[T]?.[z]?M:$;continue}let U=1,X=0,xt=0,lt=0,N=0;for(let B=0;B<4;B++)for(let Z=0;Z<4;Z++){let Pt=z+(Z+.5)/4,ct=T+(B+.5)/4,Zt=S(Pt,ct)?s:Kl(f,(Pt-d.offsetX)/d.scale,(ct-d.offsetY)/d.scale,s,g),ae=tt(Zt);U=Math.min(U,ae),X+=ae,xt+=Zt[0],lt+=Zt[1],N+=Zt[2];}R[W]=X/16,E[W]=U,P[W]=[xt/16,lt/16,N/16];}let v=M+.08*($-M),L=$-.04*($-M),F=sc(t,R,R,{base:.74-.26*l,max:.9,dark:v,light:L,margin:.23-.1*l,cap:.4+.1*l,skip:l>=.7}),k=new Ve;for(let T=0;T<o;T++)for(let z=0;z<o;z++){let W=T*o+z,D=F.diameter[W],U=!!a[T]?.[z];if(!(D>0)||!U&&E[W]>=$-.02)continue;let X=U?we(P[W],i,v,true):we(P[W],s,L,false);k.circle(kt(X,8),(z+c+.5)*u,(T+c+.5)*u,D/2*u);}return _.push(...k.toElements("art-dot")),_.push(...gi(t,b)),_}var Kf={L:.5,M:.72,Q:.88,H:1},cc=.32,uc=.55,Jf=.6,t1=2;function mc(t,e,n){let o=e>=1?t:t*e,r=e>=1?t/e:t,a=Math.max(.7,t*.09),i=o+2*a,s=r+2*a;return {logoW:o,logoH:r,plateW:i,plateH:s,radius:Math.min(i,s)*.26,cx:n/2,cy:n/2}}var dc=t=>({cx:t.cx,cy:t.cy,w:t.plateW,h:t.plateH,r:t.radius});function fc(t,e,n){return pc(e+.5,n+.5,t)<uc}function e1(t,e){let n=dc(t),o=uc+1,r=Math.max(0,Math.floor(t.cx-t.plateW/2-o)),a=Math.min(e-1,Math.ceil(t.cx+t.plateW/2+o)),i=Math.max(0,Math.floor(t.cy-t.plateH/2-o)),s=Math.min(e-1,Math.ceil(t.cy+t.plateH/2+o)),l=[];for(let c=i;c<=s;c++)for(let u=r;u<=a;u++)fc(n,u,c)&&l.push(c*e+u);return l}var n1=t=>Math.floor(t.correctable*Jf);function si(t,e,n){let o=mc(t,e,n.size),r=n1(n);return cr(n,e1(o,n.size)).every(a=>a<=r)}function hc(t,e,n){if(si(n,e,t))return n;let o=0,r=n;if(!si(o,e,t))return -1;for(;r-o>1/64;){let a=(o+r)/2;si(a,e,t)?o=a:r=a;}return o}var to=new Map;function r1(t,e){let n=`${t.version}${t.level}:${e.toFixed(3)}`,o=to.get(n);return o===void 0&&(o=hc(t,e,cc*t.size),to.size>=64&&to.clear(),to.set(n,o)),o}function o1(t,e){let{size:n,t:o,modules:r,version:a}=t,i=Lf(r),s=(.18+.15*o)*Kf[i],l=e.width/e.height,c=Math.min(cc,s)*n,u=lr(a,i),m=Math.max(0,r1(u,l));if(m<t1)return {wantedBox:c,maxBox:m,box:0,plate:null};let f=hc(u,l,Math.min(c,m));return f<0?{wantedBox:c,maxBox:m,box:0,plate:null}:{wantedBox:c,maxBox:m,box:f,plate:mc(f,l,n)}}function pc(t,e,n){let o=Math.abs(t-n.cx)-(n.w/2-n.r),r=Math.abs(e-n.cy)-(n.h/2-n.r);return Math.hypot(Math.max(o,0),Math.max(r,0))+Math.min(Math.max(o,r),0)-n.r}function gc(t,e){let{fg:n,bg:o,t:r}=t,a=tt(n),i=tt(o),s=ql(e),l=Math.min(1,r/.6),c=s?we(s,n,a+.3*(i-a),true):n,u=qe(n,c,l),m=s?ql(e,s):null,f=a+.42*(i-a),d=m&&tt(m)<=f+.22?qe(n,we(m,n,f,true),l):u;return {body:u,inner:d}}function a1(t){let{art:e,image:n,size:o,kinds:r,modules:a,bg:i,margin:s,pixelSize:l,version:c}=t,u=fi(e,n),m=o1(t,u).plate,{body:f}=gc(t,u),d=kt(f),g=m&&dc(m),h=a.map(P=>[...P]);for(let P=0;P<o;P++)for(let v=0;v<o;v++){let L=r[P*o+v];(L===Vt||g&&L!==Ht&&fc(g,v,P))&&(h[P][v]=false);}let p=[],b=t.body?.(h);if(b)p.push(A("g",{fill:d,children:b},"art-body"));else {let P=new Ve;for(let v=0;v<o;v++)for(let L=0;L<o;L++)h[v]?.[L]&&r[v*o+L]!==Ht&&P.circle(d,(L+s+.5)*l,(v+s+.5)*l,.45*l);p.push(...P.toElements("art-body"));}let _=mr(c,o).filter(([P,v])=>!g||pc(P+.5,v+.5,g)>3.2);if(_.length>0&&p.push(A("path",{d:ec(_,s,l),fill:d,fillRule:"evenodd"},"art-alignment")),!m)return p;let y=Jl(e,n,u),w=(m.cx-m.plateW/2+s)*l,C=(m.cy-m.plateH/2+s)*l,S=m.plateW*l,$=m.plateH*l,M=m.radius*l,R=.1*l,E=We(w,C,S,$,M);return p.push(A("path",{d:E,fill:kt(i)},"art-plate"),A("path",{d:E+We(w+R,C+R,S-2*R,$-2*R,M-R),fill:kt(qe(i,f,.16)),fillRule:"evenodd"},"art-plate-ring"),lc(u,y,{x:(m.cx-m.logoW/2+s)*l,y:(m.cy-m.logoH/2+s)*l,scale:m.logoW/u.width*l},P=>P,"art-logo")),p}function bi(t){let{art:e}=t;if(e.mode!=="logo"||e.matchEyes===false)return null;let n=e.image&&ci(e.image);if(!n)return null;let o=In(t.fgColor,[0,0,0]),r=In(t.bgColor,[1,1,1]),a=nc(e,o,r);if(a<=0)return null;let i=fi(e,n);if(i.palette.length===0)return null;if(no(e)==="badge"){let{body:g,inner:h}=gc({fg:o,bg:r,t:a},i),p={outer:kt(g),inner:kt(h)};return {topLeft:p,topRight:p,bottomLeft:p}}let s=tt(o),l=tt(r),c=Math.min(1,a/.6),u=t.version*4+17,m=di(i.width,i.height,u,"contain"),f=.45*Math.max(i.width,i.height),d=(g,h)=>{let p=(g-m.offsetX)/m.scale,b=(h-m.offsetY)/m.scale,_=null,y=0;for(let C of i.palette){if(tt(C.color)>.86)continue;let S=(C.cx-p)**2+(C.cy-b)**2,$=C.area*(.35+Yl(C.color))*Math.exp(-S/(2*f**2));$>y&&(y=$,_=C.color);}if(!_)return {};let w=we(_,o,s+.42*(l-s),true);return {inner:kt(qe(o,w,c))}};return {topLeft:d(3.5,3.5),topRight:d(u-3.5,3.5),bottomLeft:d(3.5,u-3.5)}}var i1=16384;var bc=t=>t*3+3&-4,_i=(t,e)=>Math.floor((t*e+255*(255-e)+127)/255);function yi(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${e} x ${n}`);if(t.length!==e*n*4)throw new RangeError(`Expected ${e*n*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let o=bc(e),r=o*n,a=new Uint8Array(54+r),i=new DataView(a.buffer);a[0]=66,a[1]=77,i.setUint32(2,a.length,true),i.setUint32(10,54,true),i.setUint32(14,40,true),i.setInt32(18,e,true),i.setInt32(22,n,true),i.setUint16(26,1,true),i.setUint16(28,24,true),i.setUint32(30,0,true),i.setUint32(34,r,true),i.setInt32(38,2835,true),i.setInt32(42,2835,true);for(let s=0;s<n;s++){let l=s*e*4,c=54+(n-1-s)*o;for(let u=0;u<e;u++){let m=t[l+3],f=t[l],d=t[l+1],g=t[l+2];m===255?(a[c]=g,a[c+1]=d,a[c+2]=f):(a[c]=_i(g,m),a[c+1]=_i(d,m),a[c+2]=_i(f,m)),l+=4,c+=3;}}return a}function xi(t){if(t.length<54||t[0]!==66||t[1]!==77)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getInt32(18,true),o=e.getInt32(22,true);return e.getUint32(2,true)===t.length&&e.getUint32(10,true)===54&&e.getUint32(14,true)===40&&n>0&&o>0&&e.getUint16(26,true)===1&&e.getUint16(28,true)===24&&e.getUint32(30,true)===0&&t.length===54+bc(n)*o}function ro(t){let e=t.getContext("2d");if(!e)throw new Error("Could not get canvas context");let{data:n}=e.getImageData(0,0,t.width,t.height),o=yi(n,t.width,t.height);if(!xi(o))throw new Error("Could not write a BMP file");return new Blob([o],{type:"image/bmp"})}function Y(t){if(t.length===0)return "";let[e,...n]=t;return `M${x(e[0])} ${x(e[1])}${n.map(([o,r])=>`L${x(o)} ${x(r)}`).join("")}Z`}function et(t,e,n){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(n)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function O(t,e,n,o,r=0){let a=Math.min(n,o)/2,[i,s,l,c]=(typeof r=="number"?[r,r,r,r]:r).map(m=>Math.max(0,Math.min(m,a))),u=(m,f,d)=>m>0?`A${x(m)} ${x(m)} 0 0 1 ${x(f)} ${x(d)}`:"";return `M${x(t+i)} ${x(e)}H${x(t+n-s)}${u(s,t+n,e+s)}V${x(e+o-l)}${u(l,t+n-l,e+o)}H${x(t+c)}${u(c,t,e+o-c)}V${x(e+i)}${u(i,t+i,e)}Z`}function $i(t,e,n,o){return [[t+o,e],[t+n-o,e],[t+n,e+o],[t+n,e+n-o],[t+n-o,e+n],[t+o,e+n],[t,e+n-o],[t,e+o]]}function vn(t,e,n,o,r=-90){return Array.from({length:o},(a,i)=>{let s=(r+360/o*i)*Math.PI/180;return [t+n*Math.cos(s),e+n*Math.sin(s)]})}function Ln(t,e,n,o,r=5){return Array.from({length:r*2},(a,i)=>{let s=i%2===0?n:o,l=-Math.PI/2+Math.PI/r*i;return [t+s*Math.cos(l),e+s*Math.sin(l)]})}function Tn(t,e,n,o,r=4,a=64){return Array.from({length:a},(i,s)=>{let l=2*Math.PI*s/a,c=Math.cos(l),u=Math.sin(l);return [t+n*Math.sign(c)*Math.abs(c)**(2/r),e+o*Math.sign(u)*Math.abs(u)**(2/r)]})}function kn(t,e,n){let o=n/2,r=(a,i)=>`${x(t+a*o)} ${x(e+i*o)}`;return `M${r(0,-0.52)}C${r(.18,-0.92)} ${r(.98,-0.94)} ${r(1,-0.34)}C${r(1,.12)} ${r(.5,.48)} ${r(0,.92)}C${r(-0.5,.48)} ${r(-1,.12)} ${r(-1,-0.34)}C${r(-0.98,-0.94)} ${r(-0.18,-0.92)} ${r(0,-0.52)}Z`}function _c(t,e,n,o){if(o===0)return t;let r=o*Math.PI/180,a=Math.cos(r),i=Math.sin(r);return t.map(([s,l])=>[e+(s-e)*a-(l-n)*i,n+(s-e)*i+(l-n)*a])}function oo(t,e,n=0){let o=Math.imul(t+2654435769,2246822507)^Math.imul(e+n,3266489909);return o=Math.imul(o^o>>>15,739982445),o=Math.imul(o^o>>>12,695872825),o^=o>>>15,(o>>>0)/4294967296}function je(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return (e>>>0).toString(36)}function Si(t,e,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2)),i=(s,l)=>`A${x(a)} ${x(a)} 0 0 0 ${x(s)} ${x(l)}`;return `M${x(t+a)} ${x(e)}H${x(t+n-a)}${i(t+n,e+a)}V${x(e+o-a)}${i(t+n-a,e+o)}H${x(t+a)}${i(t,e+o-a)}V${x(e+a)}${i(t+a,e)}Z`}function ao(t,e,n,o,r){let a=Math.max(0,Math.min(r,Math.min(n,o)/2));return Y([[t+a,e],[t+n-a,e],[t+n-a,e+a],[t+n,e+a],[t+n,e+o-a],[t+n-a,e+o-a],[t+n-a,e+o],[t+a,e+o],[t+a,e+o-a],[t,e+o-a],[t,e+a],[t+a,e+a]])}function dr(t,e,n,o,r){let a=o,i=n/2,s=(i-a)*.55,l=(c,u)=>`${x(t+c)} ${x(e+u)}`;return `M${l(a,0)}C${l(a+s,0)} ${l(i-s,r)} ${l(i,r)}C${l(i+s,r)} ${l(n-a-s,0)} ${l(n-a,0)}A${x(a)} ${x(a)} 0 0 1 ${l(n,a)}C${l(n,a+s)} ${l(n-r,i-s)} ${l(n-r,i)}C${l(n-r,i+s)} ${l(n,n-a-s)} ${l(n,n-a)}A${x(a)} ${x(a)} 0 0 1 ${l(n-a,n)}C${l(n-a-s,n)} ${l(i+s,n-r)} ${l(i,n-r)}C${l(i-s,n-r)} ${l(a+s,n)} ${l(a,n)}A${x(a)} ${x(a)} 0 0 1 ${l(0,n-a)}C${l(0,n-a-s)} ${l(r,i+s)} ${l(r,i)}C${l(r,i-s)} ${l(0,a+s)} ${l(0,a)}A${x(a)} ${x(a)} 0 0 1 ${l(a,0)}Z`}function wi(t,e,n,o,r,a){let i=n/2,s=(l,c)=>`${x(t+l)} ${x(e+c)}`;return `M${s(o,0)}H${x(t+n-o)}A${x(o)} ${x(o)} 0 0 1 ${s(n,o)}V${x(e+r)}C${s(n,r+1.55*a)} ${s(i+1.6*a,n)} ${s(i,n)}C${s(i-1.6*a,n)} ${s(0,r+1.55*a)} ${s(0,r)}V${x(e+o)}A${x(o)} ${x(o)} 0 0 1 ${s(o,0)}Z`}var s1=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function yc(t){return s1.includes(t)}var xc={circle:.95,"circle-large":.85,square:.75,diamond:.95,pacman:.9,rounded:.75,"vertical-line":.8,liquid:.75,"liquid-horizontal":.85,"liquid-vertical":.85,classy:.7,"classy-rounded":.7,leaf:.75,plus:.8,hexagon:.75,star:.85,heart:.85,"random-dots":.85,mosaic:.8,octagon:.8};function io(t,e){if(t===void 0||!Number.isFinite(t))return 1;let n=e?xc[e]??1:Wr;return Math.min(La,Math.max(Wr,n,t))}function l1(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}function c1(t,e){if(t===1)return [];let n=Math.floor(t/7)+2,o=t===32?26:Math.ceil((t*4+4)/(n*2-2))*2,r=[6];for(let a=e-7;r.length<n;a-=o)r.splice(1,0,a);return r}function Ci(t){let e=(t-17)/4,n=Number.isInteger(e)?c1(e,t):[],o=n.length-1,r=[];for(let[a,i]of n.entries())for(let[s,l]of n.entries())a===0&&s===0||a===0&&s===o||a===o&&s===0||r.push([i,l]);return (a,i)=>r.some(([s,l])=>Math.abs(a-s)<=2&&Math.abs(i-l)<=2)}var u1={liquid:{horizontal:true,vertical:true,thickness:1,radius:()=>1,fillets:true},"liquid-horizontal":{horizontal:true,vertical:false,thickness:.86,radius:()=>1,fillets:false},"liquid-vertical":{horizontal:false,vertical:true,thickness:.86,radius:()=>1,fillets:false},classy:{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:t=>t===0||t===2?1:.4,fillets:false}};function m1(t,e,n,o,r,a){switch(t){case "horizontal-line":{let i=o*.43;return O(e-o/2,n-i,o,2*i)}case "leaf":{let i=o*.5;return O(e-i,n-i,2*i,2*i,[o*.4,o*.05,o*.4,o*.05])}case "plus":{let i=o*.22,s=o*.5;return Y([[e-i,n-s],[e+i,n-s],[e+i,n-i],[e+s,n-i],[e+s,n+i],[e+i,n+i],[e+i,n+s],[e-i,n+s],[e-i,n+i],[e-s,n+i],[e-s,n-i],[e-i,n-i]])}case "hexagon":return Y(vn(e,n,o*.54,6));case "star":return Y(Ln(e,n+o*.04,o*.62,o*.34));case "heart":return kn(e,n+o*.02,o*1.08);case "random-dots":return et(e,n,o*(.38+.15*oo(r,a)));case "mosaic":{let i=o*(.8+.14*oo(r,a,1))/2,s=[[e-i,n-i],[e+i,n-i],[e+i,n+i],[e-i,n+i]];return Y(_c(s,e,n,(oo(r,a,2)-.5)*16))}case "octagon":return Y(vn(e,n,o*.48/Math.cos(Math.PI/8),8,22.5));default:return et(e,n,o*.45)}}function $c(t,e){let{margin:n,pixelSize:o,pattern:r}=e,a=io(e.scale,r),i=t.length,s=e.plain?()=>false:Ci(i),l=(h,p)=>!e.plain&&l1(h,p,i),c=(h,p)=>h>=0&&p>=0&&h<i&&p<i&&!!t[p]?.[h]&&!l(h,p),u=h=>(h+.5+n)*o,m=[],f=[],d=u1[r];for(let h=0;h<i;h++)for(let p=0;p<i;p++){if(!c(p,h))continue;let b=u(p),_=u(h);if(s(p,h)){m.push(I`M${b-o/2} ${_-o/2}h${o}v${o}h${-o}z`);continue}if(!d){f.push(m1(r,b,_,o*a,p,h));continue}let y=o*d.thickness*a/2,w=d.horizontal&&c(p+1,h),C=d.horizontal&&c(p-1,h),S=d.vertical&&c(p,h-1),$=d.vertical&&c(p,h+1),R=[!(S||C),!(S||w),!($||w),!($||C)].map((E,P)=>E?y*d.radius(P):0);f.push(O(b-y,_-y,2*y,2*y,R)),2*y<o&&(w&&f.push(O(b,_-y,o,2*y)),$&&f.push(O(b-y,_,2*y,o)));}if(d?.fillets&&a===1){let h=o*.3;for(let p=0;p<i;p++)for(let b=0;b<i;b++){if(c(b,p)||l(b,p))continue;let _=u(b)-o/2,y=u(p)-o/2,w=_+o,C=y+o;c(b-1,p)&&c(b,p-1)&&c(b-1,p-1)&&f.push(I`M${_} ${y}h${h}A${h} ${h} 0 0 0 ${_} ${y+h}Z`),c(b+1,p)&&c(b,p-1)&&c(b+1,p-1)&&f.push(I`M${w} ${y}v${h}A${h} ${h} 0 0 0 ${w-h} ${y}Z`),c(b+1,p)&&c(b,p+1)&&c(b+1,p+1)&&f.push(I`M${w} ${C}h${-h}A${h} ${h} 0 0 0 ${w} ${C-h}Z`),c(b-1,p)&&c(b,p+1)&&c(b-1,p+1)&&f.push(I`M${_} ${C}v${-h}A${h} ${h} 0 0 0 ${_+h} ${C}Z`);}}let g=[];return f.length>0&&g.push(A("path",{d:f.join("")},"modules")),m.length>0&&g.push(A("path",{d:m.join("")},"alignment")),g}var y_=(t,e,n,o)=>{let r=document.createElement("canvas");r.width=e,r.height=n;let a=r.getContext("2d");if(!a)return;a.putImageData(t,0,0);let i=r.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s);},d1=async(t,e,n,o)=>{let{default:r}=await import('jsqr');return new Promise(a=>{t.complete?i():(t.onload=()=>i(),t.onerror=()=>a(null));function i(){let s=document.createElement("canvas");requestAnimationFrame(()=>{if(!(t.naturalWidth&&t.naturalHeight)){a(null);return}let l=t.naturalWidth/t.naturalHeight<=.33||t.naturalWidth/t.naturalHeight>=3?Math.sqrt(t.naturalWidth*t.naturalHeight/12e5):t.naturalWidth/t.naturalHeight<=.5||t.naturalWidth/t.naturalHeight>=2?Math.sqrt(t.naturalWidth*t.naturalHeight/9e5):Math.sqrt(t.naturalWidth*t.naturalHeight/64e4),c=s.getContext("2d",{willReadFrequently:true});if(!c){a(null);return}let u=[1,.8,.6,.4,.2,.1];for(let m of u){let f=Math.floor(t.naturalWidth*e*m/l),d=Math.floor(t.naturalHeight*e*m/l);s.width=f,s.height=d,c.clearRect(0,0,f,d),c.imageSmoothingEnabled=true,c.imageSmoothingQuality="high";try{c.drawImage(t,Math.floor(n),Math.floor(o),Math.floor(t.naturalWidth*e),Math.floor(t.naturalHeight*e),0,0,f,d);let g=c.getImageData(0,0,f,d);try{let h=r(g.data,f,d);if(h?.data){a(h);return}}catch(h){console.error("QR Detection error:",h);}}catch(g){console.error("Canvas drawing error:",g);}}a(null);});}})},Sc=async(t,e,n=false)=>{if(!t)return "NO_QR";await new Promise(r=>setTimeout(r,100));let o=[{dx:0,dy:0,ratio:1},{dx:0,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:t.naturalHeight*.35,ratio:.65},{dx:t.naturalWidth*.35,dy:0,ratio:.65},{dx:t.naturalWidth*.35/2,dy:t.naturalHeight*.35/2,ratio:.65}];for(let r of o)try{let a=await d1(t,r.ratio,r.dx,r.dy);if(a?.data)return n?a:a.data}catch(a){console.warn("QR decode error:",a);}return "NO_QR"};function x_(t,e,n){if(!(t&&e)||e.length!==4)return;let o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;let r=o.getContext("2d");if(!r)return;r.drawImage(t,0,0),r.save(),r.strokeStyle="#ff0000",r.lineWidth=Math.max(5,Math.min(t.naturalWidth,t.naturalHeight)/200),r.shadowColor="transparent",r.shadowBlur=0,r.beginPath(),r.moveTo(e[0].x,e[0].y),r.lineTo(e[1].x,e[1].y),r.lineTo(e[3].x,e[3].y),r.lineTo(e[2].x,e[2].y),r.closePath(),r.stroke(),r.fillStyle="#ff0000",e.forEach((s,l)=>{r.fillRect(s.x-3,s.y-3,6,6),r.fillStyle="#ffffff",r.font="16px Arial",r.fillText(`${l}`,s.x+5,s.y-5),r.fillStyle="#ff0000";}),r.restore();let a=o.toDataURL("image/png"),i=document.createElement("a");i.href=a,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i);}var Mi=(t,e=0)=>{for(let n=e;n<t.length;n++)if(t[n]?.continue!==true)return true;return false};function Ce(t,e=[],n={}){return {...n,run(o){let r=t({value:o,issues:[]}),a=Mi(r.issues);for(let i of e){if(i.hasLength){let l=r.value;if(r.issues.some(c=>c.continue===false)||l===null||l===void 0||l.length===void 0)continue}else if(a)continue;let s=r.issues.length;i.run(r),!a&&r.issues.length>s&&(a=Mi(r.issues,s));}return r}}}function f1(t){if(typeof t=="number")return Number.isNaN(t)?"NaN":Number.isFinite(t)?"number":String(t);if(t===null)return "null";if(Array.isArray(t))return "array";if(typeof t=="object"){let e=t.constructor;if(Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&e)return e.name}return typeof t}var Ye=(t,e)=>({path:[],message:`Invalid input: expected ${t}, received ${f1(e)}`}),h1={string:"characters",array:"items"};function ce(t,e,n,o){let r=h1[e],a=t?"Too big":"Too small",i=`${t?"<=":">="}${n}`;return {path:[],message:r?`${a}: expected ${e} to have ${i} ${r}`:`${a}: expected ${e} to be ${i}`,continue:o}}var Ri=t=>typeof t=="string"?`"${t}"`:`${t}`,Rc=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Ii(t,e,n){for(let o of n)o.path.unshift(e),t.push(o);}var p1=t=>t>=55296&&t<=56319,g1=t=>t>=56320&&t<=57343;function b1(t){let e=t.length;for(let n=0;n<t.length-1;n++)p1(t.charCodeAt(n))&&g1(t.charCodeAt(n+1))&&(e--,n++);return e}var Ec=t=>Array.isArray(t)?"array":typeof t=="string"?"string":"unknown",pr=t=>({run(e){e.value<t&&e.issues.push(ce(false,"number",t,true));}}),gr=t=>({run(e){e.value>t&&e.issues.push(ce(true,"number",t,true));}}),On=(t,e="Invalid input")=>({run(n){t(n.value)||n.issues.push({path:[],message:e,continue:true});}}),Ac=t=>typeof t=="string"?b1(t):t.length,Pc=t=>({hasLength:true,run(e){let n=e.value;Ac(n)<t&&e.issues.push(ce(false,Ec(n),t,true));}}),vi=t=>({hasLength:true,run(e){let n=e.value;Ac(n)>t&&e.issues.push(ce(true,Ec(n),t,true));}}),Ic=(t,e)=>({run(n){t.lastIndex=0,t.test(n.value)||n.issues.push({path:[],message:e??`Invalid string: must match pattern ${t}`,continue:true});}}),_1={run(t){let e=t.value;Number.isInteger(e)?Number.isSafeInteger(e)||t.issues.push(e>0?ce(true,"int",Number.MAX_SAFE_INTEGER,true):ce(false,"int",Number.MIN_SAFE_INTEGER,true)):t.issues.push({...Ye("int",e),continue:false});}},Ze=(...t)=>Ce(e=>{let n=e.value;return typeof n=="number"&&Number.isFinite(n)||e.issues.push(Ye("number",n)),e},t),vc=(...t)=>Ze(_1,...t),so=(...t)=>Ce(e=>(typeof e.value!="string"&&e.issues.push(Ye("string",e.value)),e),t);function Wt(t){let e=t.length===1?`Invalid input: expected ${Ri(t[0])}`:`Invalid option: expected one of ${t.map(Ri).join("|")}`;return Ce(n=>(t.includes(n.value)||n.issues.push({path:[],message:e}),n),[],{values:t})}var zt=t=>Wt([t]),st=t=>({optional:true,run:e=>e===void 0?{value:e,issues:[]}:t.run(e)});function _t(t,e=[]){let n=Object.keys(t),o=new Set(n);return Ce(r=>{let a=r.value;if(!Rc(a))return r.issues.push(Ye("object",a)),r;let i={};for(let l of n){let c=t[l],u=c.run(a[l]),m=l in a;Ii(r.issues,l,u.issues),m||c.optional||u.issues.length>0||r.issues.push({path:[l],message:"Invalid input: expected nonoptional, received undefined"}),m&&(i[l]=u.value);}r.value=i;let s=[];for(let l in a)o.has(l)||s.push(l);return s.length>0&&r.issues.push({path:[],message:`Unrecognized key${s.length>1?"s":""}: ${s.map(Ri).join(", ")}`,continue:true}),r},e,{shape:t})}function Ei(t,e,n){let o=[];return e!==void 0&&o.push(Pc(e)),n!==void 0&&o.push(vi(n)),Ce(r=>{let a=r.value;if(Array.isArray(a)&&n!==void 0&&a.length>n)return r.issues.push(ce(true,"array",n,false)),r;if(!Array.isArray(a))return r.issues.push(Ye("array",a)),r;let i=new Array(a.length);for(let s=0;s<a.length;s++){let l=t.run(a[s]);Ii(r.issues,s,l.issues),i[s]=l.value;}return r.value=i,r},o)}function Ai(t){return Ce(e=>{let n=e.value;if(!Array.isArray(n))return e.issues.push(Ye("tuple",n)),e;if(n.length<t.length)return e.issues.push(ce(false,"array",t.length,void 0)),e;n.length>t.length&&e.issues.push(ce(true,"array",t.length,void 0));let o=[];return t.forEach((r,a)=>{let i=r.run(n[a]);Ii(e.issues,a,i.issues),o[a]=i.value;}),e.value=o,e})}function Nn(t){return Ce(e=>{let n=[];for(let r of t){let a=r.run(e.value);if(a.issues.length===0)return a;n.push(a);}let o=n.filter(r=>!Mi(r.issues));return o.length===1?o[0]:(e.issues.push({path:[],message:"Invalid input"}),e)})}function Lc(t,e){let n=new Map;for(let r of e)for(let a of r.shape?.[t]?.values??[])n.set(a,r);let o=`Invalid discriminator value. Expected ${[...n.keys()].map(r=>`'${r}'`).join(" | ")}`;return Ce(r=>{let a=r.value;if(!Rc(a))return r.issues.push(Ye("object",a)),r;let i=n.get(a[t]);return i?i.run(a):(r.issues.push({path:[t],message:o}),r)})}var y1=On(Zr,`Numbers may have at most ${ot.maxDecimals} decimals`),co=[pr(-ot.maxCoordinate),gr(ot.maxCoordinate),y1],Ct=Ze(...co),It=Ze(...co,On(t=>t>0,"Must be greater than 0")),lo=Ze(...co,On(t=>t>=0,"Must not be negative")),hr=so(Ic(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),wc=Nn([Wt(Ja),hr]),Tc=t=>_t({mix:Ai([t,t]),amount:Ze(pr(0),gr(1),On(Zr))}),Fn=Nn([wc,Tc(wc)]),x1=Nn([hr,Tc(Nn([Wt(["frame","accent","background"]),hr]))]),Xe=Nn([Fn,_t({gradient:_t({from:Fn,to:Fn,direction:st(Wt(["horizontal","vertical"])),steps:st(vc(pr(2),gr(ot.maxGradientSteps)))})})]),Pi=()=>({x:Ct,y:Ct,width:It,height:It}),fr=_t({color:Fn,width:It}),$1=Lc("type",[_t({type:zt("rect"),...Pi(),radius:st(lo),fill:Xe,hole:st(_t({...Pi(),radius:st(lo)})),stroke:st(fr)}),_t({type:zt("circle"),cx:Ct,cy:Ct,r:It,hole:st(It),fill:Xe,stroke:st(fr)}),_t({type:zt("ellipse"),cx:Ct,cy:Ct,rx:It,ry:It,fill:Xe,stroke:st(fr)}),_t({type:zt("polygon"),points:Ei(Ai([Ct,Ct]),3,ot.maxPolygonPoints),fill:Xe,stroke:st(fr)}),_t({type:zt("path"),d:so(Pc(2),vi(ot.maxPathLength)),fill:Xe,fillRule:st(Wt(["nonzero","evenodd"])),stroke:st(fr)}),_t({type:zt("line"),x1:Ct,y1:Ct,x2:Ct,y2:Ct,width:It,cap:st(Wt(["butt","round"])),dash:st(Ai([It,It])),fill:Xe}),_t({type:zt("icon"),icon:Wt(Ka),x:Ct,y:Ct,size:It,fill:Xe})]),Cc=()=>({id:so(Ic(/^[a-z][a-z0-9-]{0,31}$/)),slot:Wt(["primary","secondary","fixed"]),text:so(vi(200)),maxLength:st(vc(pr(1),gr(se))),color:Fn,weight:st(Wt(["bold","regular"])),collapse:st(_t({y:Ct,height:It}))}),S1=Lc("type",[_t({type:zt("text"),...Cc(),box:_t(Pi()),align:st(Wt(["start","middle","end"])),fontSize:st(It)}),_t({type:zt("curved"),...Cc(),curve:_t({cx:Ct,cy:Ct,radius:It,side:Wt(["top","bottom"]),spread:st(Ze(pr(20),gr(300),On(Zr)))}),fontSize:It})]),Mc=Ze(...co,On(t=>t>=ot.minArtboard&&t<=ot.maxArtboard,`Artboard sides must be ${ot.minArtboard} to ${ot.maxArtboard} units`)),w1=_t({kind:zt(rr),version:zt(or),artboard:_t({width:Mc,height:Mc}),qr:_t({x:Ct,y:Ct,size:It,padding:st(lo),radius:st(lo),plate:st(Wt(["opaque","background","none"]))}),colors:_t({frame:hr,text:st(x1),accent:st(hr)}),shapes:Ei($1,void 0,ot.maxShapes),labels:Ei(S1,void 0,ot.maxLabels),bleed:st(Nn([zt("none"),Fn]))},[{run(t){Nl(t.value,(e,n=[])=>{t.issues.push({path:[...n],message:e,continue:true});});}}]);function uo(t){let e=w1.run(t);return e.issues.length===0?{success:true,data:e.value}:{success:false,issues:e.issues.map(({path:n,message:o})=>({path:n,message:o}))}}var kc=({path:t,message:e})=>t.length>0?`${t.join(".")}: ${e}`:e;var Li=24,Me=(t,e,n,o)=>{let r=o*Math.PI/180;return [t+n*Math.cos(r),e+n*Math.sin(r)]},mo=([t,e])=>`${x(t)} ${x(e)}`;function Dn(t,e,n,o,r,a){let i=a-r>180?1:0;return `M${mo(Me(t,e,o,r))}A${x(o)} ${x(o)} 0 ${i} 1 ${mo(Me(t,e,o,a))}L${mo(Me(t,e,n,a))}A${x(n)} ${x(n)} 0 ${i} 0 ${mo(Me(t,e,n,r))}Z`}function br(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function C1(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Fc(t){return Y(C1(t)<0?[...t].reverse():t)}function fo(t,e,n,o,r){let a=Math.hypot(n-t,o-e)||1,i=-(o-e)/a*(r/2),s=(n-t)/a*(r/2);return Fc([[t+i,e+s],[n+i,o+s],[n-i,o-s],[t-i,e-s]])}var Ft=(...t)=>({d:t.join(""),fillRule:"nonzero"}),ue=(...t)=>({d:t.join(""),fillRule:"evenodd"});function M1(){let t=[];for(let e of [0,60,120]){let[n,o]=Me(12,12,10.5,e+180),[r,a]=Me(12,12,10.5,e);t.push(fo(n,o,r,a,2));}for(let e=0;e<6;e++){let n=e*60,[o,r]=Me(12,12,6.2,n);for(let a of [-45,45]){let[i,s]=Me(o,r,3.6,n+a);t.push(fo(o,r,i,s,1.7));}}return Ft(...t)}var R1={wifi:()=>Ft(Dn(12,20,4.6,7.2,-135,-45),Dn(12,20,9.2,11.8,-135,-45),Dn(12,20,13.8,16.4,-135,-45),et(12,20,2.2)),star:()=>Ft(Y(Ln(12,12.8,11.6,4.8))),heart:()=>Ft(kn(12,12.4,22)),phone:()=>ue(O(6,1.5,12,21,2.6),O(7.8,4.2,8.4,13.4,.6),et(12,19.8,1.1)),headphones:()=>Ft(Dn(12,13,7.6,9.8,-180,0),O(2,12,5,9.5,2),O(17,12,5,9.5,2)),calendar:()=>ue(O(2.5,4,19,17.5,2.5),O(4.6,9,14.8,10.6,.8),O(7,11.4,2.6,2.6,.4),O(10.7,11.4,2.6,2.6,.4),O(14.4,11.4,2.6,2.6,.4),O(7,15.1,2.6,2.6,.4),O(10.7,15.1,2.6,2.6,.4),O(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),O(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>Ft(et(12,7.5,4.6),"M3 21.5C3 16.2 7 13.6 12 13.6C17 13.6 21 16.2 21 21.5Z"),chat:()=>ue(O(2,3,20,14,4),Y([[6.5,17],[11.5,17],[5.8,21.8]]),et(7.5,10,1.5),et(12,10,1.5),et(16.5,10,1.5)),bag:()=>Ft(O(3.5,7.5,17,14.5,2),Dn(12,7.5,3.1,4.8,-180,0)),bell:()=>Ft("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",O(1.5,18.2,21,2.6,1.3),O(11.2,6.6,1.6,2.6,0),O(9.8,4.6,4.4,2.4,1.2)),cup:()=>Ft("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Dn(17,10.2,1.7,3.6,-90,90),O(2,20.6,17,2,1),O(7,1.6,1.6,3.4,.8),O(11.6,1.6,1.6,3.4,.8)),card:()=>ue(O(1.5,4.5,21,15,2.5),O(1.5,8,21,3,0),O(4.5,13.6,4.6,3.2,.6)),check:()=>ue(et(12,12,10.5),Y([[6.6,12.4],[8.4,10.6],[10.6,12.8],[15.8,7.6],[17.6,9.4],[10.6,16.4]])),info:()=>ue(et(12,12,10.5),et(12,7.2,1.6),O(10.6,10,2.8,8,.8)),home:()=>ue(Y([[12,2.5],[22.5,11.5],[19.5,11.5],[19.5,21.5],[4.5,21.5],[4.5,11.5],[1.5,11.5]]),O(10,14.5,4,7,[.6,.6,0,0])),pin:()=>ue("M12 22.5C8.5 17.6 4.5 14 4.5 9.5A7.5 7.5 0 0 1 19.5 9.5C19.5 14 15.5 17.6 12 22.5Z",et(12,9.5,3)),share:()=>Ft(fo(6,12,18,5,1.8),fo(6,12,18,19,1.8),et(18,5,3.2),et(6,12,3.2),et(18,19,3.2)),download:()=>Ft(O(10.6,2,2.8,9.5,0),Y([[6,10],[18,10],[12,16.5]]),Y([[2.5,15],[5.3,15],[5.3,19],[18.7,19],[18.7,15],[21.5,15],[21.5,21.8],[2.5,21.8]])),clock:()=>ue(et(12,12,10.5),et(12,12,8.4),Y([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:M1,pumpkin:()=>Ft(br(7.8,14.6,5.8,6.9),br(16.2,14.6,5.8,6.9),br(12,14.6,4.8,7.4),O(10.9,3.4,2.2,4.6,.8),Fc([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>Ft(Y([[12,1.5],[16.8,8.2],[7.2,8.2]]),Y([[12,5.2],[19,13.6],[5,13.6]]),Y([[12,9.4],[21.2,19.2],[2.8,19.2]]),O(10.4,18.6,3.2,3.9,.4)),sparkle:()=>Ft(Y(Ln(9.5,13.5,9,2.4,4)),Y(Ln(19,5,4,1.1,4))),gift:()=>Ft(O(3,11.2,7.8,10.6,1),O(13.2,11.2,7.8,10.6,1),O(2,7.4,8.8,3.2,1),O(13.2,7.4,8.8,3.2,1),br(8.8,4.8,2.9,1.9),br(15.2,4.8,2.9,1.9))};function Ti(t){return R1[t]()}function Nc(t){return t===" "?.3:/[MWmw@%]/.test(t)?.92:/[A-Z0-9#&]/.test(t)?.72:/[il.,:;!'|1]/.test(t)?.32:.6}function Fi(t){let e=0;for(let n of t)e+=Nc(n);return Math.max(e,1)}var ki=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function _r(t,e,n){let o=at(t)??{r:0,g:0,b:0},r=at(e)??{r:255,g:255,b:255},a=Math.min(1,Math.max(0,n));return `#${ki(o.r+(r.r-o.r)*a)}${ki(o.g+(r.g-o.g)*a)}${ki(o.b+(r.b-o.b)*a)}`}function Oc(t,e,n,o,r,a,i,s){let l=[...t],c=r*.08,u=l.map(h=>Nc(h)*r),m=u.reduce((h,p)=>h+p,0)+c*Math.max(0,l.length-1),f=a==="top"?o-r*.35:o+r*.35,d=[],g=0;return l.forEach((h,p)=>{let b=u[p],_=(g+b/2)/f;if(g+=b+c,h.trim()==="")return;let y=a==="top"?-Math.PI/2-m/2/f+_:Math.PI/2+m/2/f-_;d.push({text:h,x:e+f*Math.cos(y),y:n+f*Math.sin(y),fontSize:r,maxWidth:r*2,color:i,rotate:y*180/Math.PI+(a==="top"?90:-90),field:s});}),d}var yr=class extends Error{issues;constructor(e){super(`Invalid frame spec: ${e.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=e;}},Dc=new WeakMap;function Ke(t){if(t&&typeof t=="object"){let n=Dc.get(t);if(n)return n}if(t==null)throw new yr(['A "custom" frame needs a spec']);let e=uo(t);if(!e.success)throw new yr(e.issues.map(kc));return typeof t=="object"&&Dc.set(t,e.data),e.data}function Ni(t){let e=Ke(t);return En(e)/e.qr.size}var E1=t=>{let e=at(t);return !!(e&&e.a>=1)};function A1(t,e){let n=bt(e,ft);return t.qr.plate==="none"?{color:n,plate:false}:E1(n)?{color:n,plate:true}:t.qr.plate==="background"?{color:n,plate:false}:{color:ft,plate:true}}function ho(t,e,n=ft){let o=e.color||t.colors.frame,r=e.secondaryColor||t.colors.accent||o,a=l=>l==="frame"?o:l==="accent"?r:l==="background"?n:l,i=t.colors.text,s=e.textColor||(i===void 0?o:typeof i=="string"?i:_r(a(i.mix[0]),a(i.mix[1]),i.amount));return {frame:o,text:s,accent:r}}function P1(t,e,n){let o=ho(e,t,n),r=a=>{switch(a){case "frame":return o.frame;case "text":return o.text;case "accent":return o.accent;case "background":return n;default:return a}};return a=>typeof a=="string"?r(a):_r(r(a.mix[0]),r(a.mix[1]),a.amount)}function Bc(t,e,n=0,o=0){let r=nr(t);return r?qa(r,e,n,o):""}function I1(t,e,n,o){return `M${x(t-n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t+n)} ${x(e)}A${x(n)} ${x(o)} 0 1 1 ${x(t-n)} ${x(e)}Z`}function v1(t,e){let[n,o,r,a]=[t.x1*e,t.y1*e,t.x2*e,t.y2*e],i=Math.hypot(r-n,a-o),s=t.width*e/2,l=i>0?(r-n)/i:1,c=i>0?(a-o)/i:0,u=-c*s,m=l*s,f=(p,b)=>{let _=[n+l*p,o+c*p],y=[n+l*b,o+c*b];if(t.cap==="round"&&b-p>2*s){let w=[_[0]+l*s,_[1]+c*s],C=[y[0]-l*s,y[1]-c*s];return `M${x(w[0]-u)} ${x(w[1]-m)}L${x(C[0]-u)} ${x(C[1]-m)}A${x(s)} ${x(s)} 0 0 1 ${x(C[0]+u)} ${x(C[1]+m)}L${x(w[0]+u)} ${x(w[1]+m)}A${x(s)} ${x(s)} 0 0 1 ${x(w[0]-u)} ${x(w[1]-m)}Z`}return `M${x(_[0]-u)} ${x(_[1]-m)}L${x(y[0]-u)} ${x(y[1]-m)}L${x(y[0]+u)} ${x(y[1]+m)}L${x(_[0]+u)} ${x(_[1]+m)}Z`};if(!t.dash)return {type:"path",d:f(0,i),fillRule:"nonzero"};let d=t.dash[0]*e,g=d+t.dash[1]*e,h=[];for(let p=0;p+d<=i+1e-6;p+=g)h.push(f(p,p+d));return {type:"path",d:h.join(""),fillRule:"nonzero"}}function L1(t,e){switch(t.type){case "rect":return {type:"rect",x:t.x*e,y:t.y*e,width:t.width*e,height:t.height*e,radius:(t.radius??0)*e,...t.hole&&{hole:{x:t.hole.x*e,y:t.hole.y*e,width:t.hole.width*e,height:t.hole.height*e,radius:(t.hole.radius??0)*e}}};case "circle":return {type:"path",d:et(t.cx*e,t.cy*e,t.r*e)+(t.hole?et(t.cx*e,t.cy*e,t.hole*e):""),fillRule:t.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:I1(t.cx*e,t.cy*e,t.rx*e,t.ry*e),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:t.points.map(([n,o])=>[n*e,o*e])};case "path":return {type:"path",d:Bc(t.d,e),fillRule:t.fillRule??"nonzero"};case "line":return v1(t,e);default:{let n=Ti(t.icon);return {type:"path",d:Bc(n.d,t.size*e/Li,t.x*e,t.y*e),fillRule:n.fillRule}}}}function T1(t){if(t.type==="rect"){let{x:e,y:n,width:o,height:r,radius:a,hole:i}=t;return [...ne(e,n,o,r,a,a),...i?ne(i.x,i.y,i.width,i.height,i.radius,i.radius):[]]}return t.type==="polygon"?[...t.points.map(([e,n],o)=>o===0?{op:"M",x:e,y:n}:{op:"L",x:e,y:n}),{op:"Z"}]:le(t.d)}function k1(t,e,n){let o=T1(t),r=Xr(o,.2),a=t.type==="rect"?t.hole?"evenodd":"nonzero":t.type==="path"?t.fillRule??"nonzero":"nonzero",i=e.direction==="vertical",s=p=>i?p[1]:p[0],l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let p of r)for(let b of p)l=Math.min(l,s(b)),c=Math.max(c,s(b));if(!(c>l))return [];let u=e.steps??32,m=n(e.from),f=n(e.to),d=c-l,g=d*.002,h=[];for(let p=0;p<u;p++){let b=l+d*p/u,_=Math.min(c,l+d*(p+1)/u+(p+1<u?g:0)),y=i?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:b,y1:_}:{x0:b,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},w=r.map(C=>Sn(C,y)).filter(C=>C.length>2);w.length!==0&&h.push({type:"path",d:Il(w),fill:_r(m,f,(p+.5)/u),fillRule:a});}return h}function F1(t,e,n){let o=L1(t,e),r="stroke"in t&&t.stroke?{stroke:n(t.stroke.color),strokeWidth:t.stroke.width*e}:void 0;if(typeof t.fill=="object"&&"gradient"in t.fill){let a=k1(o,t.fill.gradient,n);return r?[...a,{...o,fill:"none",...r}]:a}return [{...o,fill:n(t.fill),...r}]}function N1(t,e){let n=Math.min(t.maxLength??ot.maxTextLength,ot.maxTextLength),o=t.slot==="primary"?e.text??t.text:t.slot==="secondary"?e.secondaryText??t.text:t.text;return Rn(o,n)}function O1(t){return t===void 0||!Number.isFinite(t)?1:Math.min($n,Math.max(er,t))}function D1(t,e,n,o,r,a){let i=r(t.color),s=t.weight==="regular"?{fontWeight:400}:{};if(t.type==="curved"){let{cx:h,cy:p,radius:b,side:_,spread:y=140}=t.curve,w=b*o*(y*Math.PI/180),C=Math.min(t.fontSize*o*n,w/(Fi(e)+.08*e.length));return Oc(e,h*o,p*o,b*o,C,_,i,a).map(S=>({...S,...s}))}let l=t.box.x*o,c=t.box.y*o,u=t.box.width*o,m=t.box.height*o;if(!(m>0))return [];let f=(t.fontSize??t.box.height*ti)*o,d=Math.min(f*n,m*ir,u/Fi(e)),g=t.align??"middle";return [{text:e,x:g==="start"?l:g==="end"?l+u:l+u/2,y:c+m/2+d*.35,fontSize:d,maxWidth:u,color:i,...g!=="middle"&&{align:g},...s,field:a}]}function B1(t){let e=0,n=0,o=0,r=0;return t.map(({command:a,values:i})=>{let s=a.toUpperCase(),l=a!==s;switch(s){case "Z":return e=o,n=r,{command:"Z",values:[]};case "H":return e=(l?e:0)+i[0],{command:"H",values:[e]};case "V":return n=(l?n:0)+i[0],{command:"V",values:[n]};case "A":return e=(l?e:0)+i[5],n=(l?n:0)+i[6],{command:"A",values:[...i.slice(0,5),e,n]};default:{let c=i.map((u,m)=>l?u+(m%2===0?e:n):u);return e=c.at(-2),n=c.at(-1),s==="M"&&(o=e,r=n),{command:s,values:c}}}})}function G1(t,e){let n=nr(t);return n?qa(B1(n).map(({command:o,values:r})=>o==="V"?{command:o,values:[e(r[0])]}:o==="H"||o==="Z"?{command:o,values:r}:o==="A"?{command:o,values:[...r.slice(0,6),e(r[6])]}:{command:o,values:r.map((a,i)=>i%2===1?e(a):a)})):t}function Q1(t,e){let n=(o,r)=>{let a=e(o);return {y:a,height:e(o+r)-a}};switch(t.type){case "rect":return {...t,...n(t.y,t.height),...t.hole&&{hole:{...t.hole,...n(t.hole.y,t.hole.height)}}};case "circle":case "ellipse":return {...t,cy:e(t.cy)};case "polygon":return {...t,points:t.points.map(([o,r])=>[o,e(r)])};case "path":return {...t,d:G1(t.d,e)};case "line":return {...t,y1:e(t.y1),y2:e(t.y2)};default:return {...t,y:e(t.y)}}}function U1(t,e){if(e.length===0)return t;let n=r=>{let a=r;for(let i of e)a-=Math.min(Math.max(r-i.y,0),i.height);return a},o=(r,a)=>e.some(i=>r>=i.y-1e-6&&a<=i.y+i.height+1e-6);return {...t,artboard:{...t.artboard,height:n(t.artboard.height)},qr:{...t.qr,y:n(t.qr.y)},shapes:t.shapes.filter(r=>{let{bounds:a}=ei(r);return !(a&&o(a.y0,a.y1))}).map(r=>Q1(r,n)),labels:t.labels.map(r=>{if(r.type==="curved")return {...r,curve:{...r.curve,cy:n(r.curve.cy)}};let a=n(r.box.y);return {...r,box:{...r.box,y:a,height:n(r.box.y+r.box.height)-a}}})}}function xr(t,e,n,o,r={}){let a=new Map(e.labels.map(p=>[p.id,N1(p,n)])),i=U1(e,e.labels.flatMap(p=>p.collapse&&!a.get(p.id)?[p.collapse]:[])),s=t/i.qr.size,l=A1(i,o),c=P1(n,i,l.color),u=i.shapes.flatMap(p=>F1(p,s,c));if(l.plate){let p=En(i)*s;u.push({type:"rect",x:i.qr.x*s-p,y:i.qr.y*s-p,width:t+2*p,height:t+2*p,radius:(i.qr.radius??0)*s,fill:l.color});}let m=O1(n.fontScale),f=i.labels.flatMap(p=>{let b=a.get(p.id);if(!b)return [];let _=(p.slot==="fixed"?void 0:r[p.slot])??p.id;return D1(p,b,m,s,c,_)}),d=f[0],g=d&&d.rotate===void 0?d:null,h=i.bleed??"none";return {width:i.artboard.width*s,height:i.artboard.height*s,qrX:i.qr.x*s,qrY:i.qr.y*s,qrSize:t,shapes:u,label:g,extraLabels:g?f.slice(1):f,squareEdges:h!=="none",color:c(h==="none"?"frame":h)}}function Oi(t,e,n){return xr(t,Ke(e.spec),e,n)}var Gc={kind:"qrdx.frame",version:1,artboard:{width:1600,height:1470},qr:{x:300,y:120,size:1e3,padding:70,radius:10,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"polygon",points:[[0,1250],[190,1250],[190,1470],[0,1470],[50.4,1360]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[1600,1250],[1549.6,1360],[1600,1470],[1410,1470],[1410,1250]],fill:{mix:["frame","#000000"],amount:.28}},{type:"polygon",points:[[90,1420],[170,1470],[90,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"polygon",points:[[1510,1420],[1510,1470],[1430,1470]],fill:{mix:["frame","#000000"],amount:.5}},{type:"rect",x:220,y:40,width:1160,height:1160,radius:20,fill:"background"},{type:"rect",x:180,y:0,width:1240,height:1240,radius:60,fill:"frame",hole:{x:220,y:40,width:1160,height:1160,radius:20}},{type:"rect",x:90,y:1200,width:1420,height:220,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:170,y:1200,width:1260,height:220}}]};var Di={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:120,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:40,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:220}}],bleed:"frame"};var Qc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1420},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1420,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}],bleed:"frame"};var Uc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1600},qr:{x:120,y:300,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:220,width:1160,height:1160,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1600,fill:"frame",hole:{x:40,y:220,width:1160,height:1160}}],labels:[{type:"text",id:"top",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}},{type:"text",id:"bottom",slot:"secondary",text:"",color:"text",box:{x:120,y:1380,width:1e3,height:220}}],bleed:"frame"};var Hc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,fill:"frame",hole:{x:40,y:40,width:1160,height:1260}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}],bleed:"frame"};var zc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1530},qr:{x:120,y:120,size:1e3,padding:80,radius:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:1400,radius:120,fill:"frame"},{type:"path",d:"M161.2 1380L62 1530Q198.4 1458.5 396.8 1380Z",fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1200,width:1e3,height:200},collapse:{y:1220,height:160}}]};var Wc={kind:"qrdx.frame",version:1,artboard:{width:1978.214,height:1978.214},qr:{x:489.107,y:489.107,size:1e3,padding:50,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"circle",cx:989.107,cy:989.107,r:779.107,fill:"background"},{type:"circle",cx:989.107,cy:989.107,r:989.107,hole:779.107,fill:"frame"},{type:"circle",cx:105,cy:989.107,r:14.7,fill:"text"},{type:"circle",cx:1873.214,cy:989.107,r:14.7,fill:"text"}],labels:[{type:"curved",id:"top",slot:"primary",text:"Scan me",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"top",spread:140},fontSize:105},{type:"curved",id:"bottom",slot:"secondary",text:"",color:"text",curve:{cx:989.107,cy:989.107,radius:884.107,side:"bottom",spread:140},fontSize:105}]};var qc={kind:"qrdx.frame",version:1,artboard:{width:1320,height:1558},qr:{x:160,y:130,size:1e3,padding:60},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:370,width:1320,height:1188,fill:{mix:["frame","#FFFFFF"],amount:.45}},{type:"polygon",points:[[0,370],[660,0],[1320,370]],fill:{mix:["frame","#FFFFFF"],amount:.25}},{type:"rect",x:80,y:50,width:1160,height:1268,fill:"background"},{type:"rect",x:68,y:38,width:1184,height:1280,fill:"frame",hole:{x:80,y:50,width:1160,height:1268}},{type:"polygon",points:[[0,1178],[660,1318],[1320,1178],[1320,1558],[0,1558]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:160,y:1318,width:1e3,height:220}}]};var Vc={kind:"qrdx.frame",version:1,artboard:{width:1230,height:1430},qr:{x:115,y:115,size:1e3,padding:70,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1230,height:1430,fill:"background"},{type:"polygon",points:[[0,0],[200,0],[200,35],[35,35],[35,200],[0,200]],fill:"frame"},{type:"polygon",points:[[1230,0],[1030,0],[1030,35],[1195,35],[1195,200],[1230,200]],fill:"frame"},{type:"polygon",points:[[1230,1230],[1030,1230],[1030,1195],[1195,1195],[1195,1030],[1230,1030]],fill:"frame"},{type:"polygon",points:[[0,1230],[200,1230],[200,1195],[35,1195],[35,1030],[0,1030]],fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:80,y:1210,width:1070,height:200},collapse:{y:1230,height:200}}]};var po={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1360},qr:{x:130,y:130,size:1e3,padding:40,plate:"background"},colors:{frame:"#7c3aed",text:{mix:["frame","accent"],amount:.5},accent:"#db2777"},shapes:[{type:"rect",x:50,y:50,width:1160,height:1260,radius:50,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1360,radius:100,fill:{gradient:{from:"frame",to:"accent",direction:"horizontal",steps:48}},hole:{x:50,y:50,width:1160,height:1260,radius:50}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1130,width:1e3,height:180},collapse:{y:1210,height:100}}]};var jc={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1460},qr:{x:130,y:260,size:1e3,padding:46,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1260,height:1460,radius:30,fill:"frame",hole:{x:22,y:22,width:1216,height:1416,radius:8}},{type:"rect",x:45,y:45,width:1170,height:1370,fill:"frame",hole:{x:53,y:53,width:1154,height:1354}},{type:"rect",x:378,y:181,width:504,height:8,fill:"frame"},{type:"polygon",points:[[630,163],[652,185],[630,207],[608,185]],fill:"frame"}],labels:[{type:"text",id:"title",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:30,width:1e3,height:170},collapse:{y:84,height:130}},{type:"text",id:"footer",slot:"secondary",text:"",color:"text",box:{x:130,y:1270,width:1e3,height:160},collapse:{y:1306,height:70}}]};var Xc={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1610},qr:{x:130,y:250,size:1e3,padding:75,radius:55},colors:{frame:"#000000"},shapes:[{type:"rect",x:0,y:0,width:1260,height:1610,radius:170,fill:"frame"},{type:"rect",x:50,y:170,width:1160,height:1290,radius:60,fill:"background"},{type:"rect",x:520,y:67,width:220,height:36,radius:18,fill:"background"},{type:"rect",x:480,y:1520,width:300,height:30,radius:15,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1290,width:1e3,height:170},collapse:{y:1330,height:130}}]};var Yc={kind:"qrdx.frame",version:1,artboard:{width:1325,height:1555},qr:{x:150,y:150,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:25,y:25,width:1300,height:1530,radius:15,fill:{mix:["frame","#FFFFFF"],amount:.72}},{type:"rect",x:0,y:0,width:1300,height:1530,radius:15,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:150,y:1260,width:1e3,height:240}}]};var Zc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1340},qr:{x:120,y:120,size:1e3,padding:40,plate:"background"},colors:{frame:"#000000"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1260,radius:60,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1340,radius:100,fill:"frame",hole:{x:40,y:40,width:1160,height:1260,radius:60}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1120,width:1e3,height:180},collapse:{y:1200,height:100}}]};var Kc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:120,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:40,y:40,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:0,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:40,width:1160,height:1160,radius:30}},{type:"polygon",points:[[540,1385],[620,1265],[700,1385]],fill:"frame"},{type:"rect",x:0,y:1345,width:1240,height:220,radius:110,fill:"frame"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:1345,width:1e3,height:220}}]};var Jc={kind:"qrdx.frame",version:1,artboard:{width:1240,height:1565},qr:{x:120,y:445,size:1e3,padding:70,radius:20,plate:"background"},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:0,y:0,width:1240,height:220,radius:110,fill:"frame"},{type:"polygon",points:[[540,180],[700,180],[620,300]],fill:"frame"},{type:"rect",x:40,y:365,width:1160,height:1160,radius:30,fill:"background"},{type:"rect",x:0,y:325,width:1240,height:1240,radius:70,fill:"frame",hole:{x:40,y:365,width:1160,height:1160,radius:30}}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:120,y:0,width:1e3,height:220}}]};var tu={kind:"qrdx.frame",version:1,artboard:{width:1420,height:1590},qr:{x:195,y:195,size:1e3,padding:80},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"rect",x:30,y:30,width:1390,height:1560,radius:155,fill:{mix:["frame","#FFFFFF"],amount:.7}},{type:"rect",x:0,y:0,width:1390,height:1560,radius:155,fill:"#FFFFFF"},{type:"rect",x:25,y:25,width:1340,height:1510,radius:130,fill:"frame"},{type:"rect",x:95,y:95,width:1200,height:1200,radius:40,fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:175,y:1295,width:1040,height:240},collapse:{y:1365,height:170}}]};var eu={kind:"qrdx.frame",version:1,artboard:{width:1280,height:1620},qr:{x:140,y:320,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M140 0H1140L1280 140V1580A40 40 0 0 1 1240 1620H40A40 40 0 0 1 0 1580V140ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:"frame",fillRule:"evenodd"},{type:"path",d:"M572 115.2A68 68 0 1 1 708 115.2A68 68 0 1 1 572 115.2ZM600 115.2A40 40 0 1 1 680 115.2A40 40 0 1 1 600 115.2Z",fill:{mix:["frame","#FFFFFF"],amount:.35},fillRule:"evenodd"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:140,y:1400,width:1e3,height:220},collapse:{y:1420,height:160}}]};var nu={kind:"qrdx.frame",version:1,artboard:{width:1260,height:1490},qr:{x:130,y:130,size:1e3,padding:80,radius:20},colors:{frame:"#000000",text:"#FFFFFF"},shapes:[{type:"path",d:"M40 0H1220A40 40 0 0 1 1260 40V1215A55 55 0 0 0 1260 1325V1450A40 40 0 0 1 1220 1490H40A40 40 0 0 1 0 1450V1325A55 55 0 0 0 0 1215V40A40 40 0 0 1 40 0Z",fill:"frame"},{type:"line",x1:77,y1:1270,x2:1147,y2:1270,width:12,dash:[30,22],fill:"background"}],labels:[{type:"text",id:"cta",slot:"primary",text:"Scan me",color:"text",box:{x:130,y:1270,width:1e3,height:220}}]};var Mt=(t,e,n,o,r)=>({style:t,name:e,tags:r,labelOn:o,spec:n}),Bi=[Mt("banner-bottom","Banner",Di,"frame",["bottom","band"]),Mt("banner-top","Top banner",Qc,"frame",["top","band"]),Mt("banner-top-bottom","Two banners",Uc,"frame",["top","bottom","band"]),Mt("border","Border",Hc,"background",["square","outline"]),Mt("rounded-border","Rounded",Zc,"background",["border","outline"]),Mt("gradient-border","Gradient",po,"background",["border","colorful"]),Mt("focus","Focus",Vc,"background",["corners","brackets"]),Mt("speech-bubble","Bubble",Kc,"frame",["speech"]),Mt("speech-bubble-top","Bubble top",Jc,"frame",["speech"]),Mt("chat-bubble","Chat",zc,"frame",["message","bubble"]),Mt("circle","Circle",Wc,"frame",["round","ring","curved"]),Mt("badge","Ribbon",Gc,"frame",["badge","banner"]),Mt("sticker","Sticker",tu,"frame",["label"]),Mt("polaroid","Polaroid",Yc,"frame",["photo","picture"]),Mt("phone","Phone",Xc,"background",["mobile","screen"]),Mt("ticket","Ticket",nu,"frame",["event","pass"]),Mt("tag","Tag",eu,"frame",["price","label"]),Mt("envelope","Envelope",qc,"frame",["mail","letter"]),Mt("menu-card","Menu card",jc,"background",["menu","restaurant"])],lh=new Map(Bi.map(t=>[t.style,t]));function Gi(t){return lh.get(t)}var ch=Object.fromEntries(Bi.map(t=>[t.style,t.spec])),uh={from:po.colors.frame,to:po.colors.accent};function go(t){return !t||t.style==="none"?null:t.style===ar?t.spec??null:Gi(t.style)?.spec??null}function mh(t){let e=go(t);return t&&typeof e?.colors?.frame=="string"?ho(e,t):null}var dh={primary:"text",secondary:"secondaryText"};function ru(t,e,n){let o=Gi(e.style)?.spec??Di;return xr(t,Ke(o),e,n,dh)}var _o="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",au=.08,iu="data-qrdx-frame-label";function Nt(t){return !!(t?.style&&t.style!=="none")}function Qi(t){let e=go(t);return e?Ni(e):au}function fh(t){return (t.text??Pa).trim().slice(0,se)}function hh(t){return (t.secondaryText??"").trim().slice(0,se)}function Je(t,e,n){return e.style===ar?Oi(t,e,n):ru(t,e,n)}function me(t,e){if(!Nt(e))return {width:t,height:t};let{width:n,height:o}=Je(t,e);return {width:n,height:o}}var nt=t=>J(t,2);function ou({x:t,y:e,width:n,height:o,radius:r}){let a=nt(Math.min(r,n/2,o/2)),[i,s,l,c]=[nt(t),nt(e),nt(n),nt(o)];return a<=0?I`M${i} ${s}h${l}v${c}h${-l}z`:I`M${i+a} ${s}h${nt(l-2*a)}a${a} ${a} 0 0 1 ${a} ${a}`+I`v${nt(c-2*a)}a${a} ${a} 0 0 1 ${-a} ${a}`+I`h${nt(-(l-2*a))}a${a} ${a} 0 0 1 ${-a} ${-a}`+I`v${nt(-(c-2*a))}a${a} ${a} 0 0 1 ${a} ${-a}z`}function bo(t){return t.stroke&&t.strokeWidth?{stroke:t.stroke,strokeWidth:nt(t.strokeWidth)}:{}}function su(t,e){return t.type==="rect"&&t.hole?A("path",{d:ou(t)+ou(t.hole),fill:t.fill,fillRule:"evenodd",...bo(t)},e):t.type==="polygon"?A("polygon",{fill:t.fill,points:t.points.map(([n,o])=>`${nt(n)},${nt(o)}`).join(" "),...bo(t)},e):t.type==="path"?A("path",{d:t.d,fill:t.fill,...t.fillRule==="evenodd"&&{fillRule:"evenodd"},...bo(t)},e):Jr("rect",{...bo(t),fill:t.fill,height:nt(t.height),key:e,width:nt(t.width),x:nt(t.x),y:nt(t.y),...t.radius>0&&{rx:nt(t.radius),ry:nt(t.radius)}})}function lu(t){return t.shapes.map((e,n)=>su(e,n))}function $r(t,e){let{size:n,frame:o,bgColor:r,svgProps:a,markLabels:i}=e,s=Je(n,o,r),l=cu(s),c=nt(s.width),u=nt(s.height);return $t("svg",{height:u,viewBox:`0 0 ${c} ${u}`,width:c,xmlns:"http://www.w3.org/2000/svg",...a,children:[A("g",{"data-qrdx-frame":o.style,children:s.shapes.map((m,f)=>su(m,f))}),He(t,{x:nt(s.qrX),y:nt(s.qrY),width:n,height:n}),l.map((m,f)=>A("text",{"data-max-width":nt(m.maxWidth),fill:m.color,fontFamily:_o,fontSize:nt(m.fontSize),fontWeight:m.fontWeight??700,textAnchor:m.align??"middle",x:nt(m.x),y:nt(m.y),...m.rotate&&{transform:`rotate(${nt(m.rotate)} ${nt(m.x)} ${nt(m.y)})`},...i&&m.field&&{[iu]:m.field},children:m.text},f))]})}function ph(t){let{frame:e,size:n=it,bgColor:o,slot:r,svgProps:a}=t,i=r??A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg"});return Nt(e)?$r(i,{size:n,frame:e,bgColor:o,svgProps:a}):A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...a,children:He(i,{x:0,y:0,width:n,height:n})})}function cu(t){return [...t.label?[t.label]:[],...t.extraLabels??[]]}var gh={2:6,3:12};function uu(t){let e=[t.start],n=t.start;for(let o of t.segments){let r=o.at(-1);if(o.length===1)e.push(r);else {let a=gh[o.length];for(let i=1;i<=a;i++){let s=i/a,l=1-s;if(o.length===2){let[c]=o;e.push([l*l*n[0]+2*l*s*c[0]+s*s*r[0],l*l*n[1]+2*l*s*c[1]+s*s*r[1]]);}else {let[c,u]=o;e.push([l*l*l*n[0]+3*l*l*s*c[0]+3*l*s*s*u[0]+s*s*s*r[0],l*l*l*n[1]+3*l*l*s*c[1]+3*l*s*s*u[1]+s*s*s*r[1]]);}}}n=r;}return e}function du(t,e){let n=[];for(let o of t)for(let r=0;r<o.length;r++){let[a,i]=o[r],[s,l]=o[(r+1)%o.length];i<=e!=l<=e&&n.push(a+(e-i)/(l-i)*(s-a));}return n.sort((o,r)=>o-r)}function fu(t,e){let n=0;for(let o of t)if(o<e)n++;else break;return n%2===1}function bh(t,e,n){return fu(du(t,n),e)}function hu(t){let e=new Map;return (n,o)=>{let r=e.get(o);return r||(r=du(t,o),e.set(o,r)),fu(r,n)}}function _h(t,e,n,o){let r=n[0]-t,a=n[1]-e,i=o[0]-n[0],s=o[1]-n[1],l=u=>Math.max(Math.abs(r+u*i),Math.abs(a+u*s)),c=Math.min(l(0),l(1));for(let[u,m]of [[a-r,i-s],[-(r+a),i+s]])if(m!==0){let f=u/m;f>0&&f<1&&(c=Math.min(c,l(f)));}return c}function yh(t,e,n){if(!bh(t,e,n))return 0;let o=Number.POSITIVE_INFINITY;for(let r of t)for(let a=0;a<r.length;a++)o=Math.min(o,_h(e,n,r[a],r[(a+1)%r.length]));return Number.isFinite(o)?o:0}function xh(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let a of t)for(let[i,s]of a)e=Math.min(e,i),n=Math.min(n,s),o=Math.max(o,i),r=Math.max(r,s);return {x0:e,y0:n,x1:o,y1:r}}function pu(t){let e=t.map(uu),n=xh(e),o=n.x1-n.x0,r=n.y1-n.y0;if(!(o>0&&r>0))return null;let a=(g,h)=>{let p=Math.max(g-n.x0,n.x1-g,h-n.y0,n.y1-h);return p>0?yh(e,g,h)/(2*p):0},i={cx:n.x0+o/2,cy:n.y0+r/2,value:0};i.value=a(i.cx,i.cy);let s=32;for(let g=1;g<s;g++)for(let h=1;h<s;h++){let p=n.x0+o*h/s,b=n.y0+r*g/s,_=a(p,b);_>i.value&&(i={cx:p,cy:b,value:_});}let l=o/s,c=r/s;for(let g=0;g<6;g++){let h=i;for(let p=-2;p<=2;p++)for(let b=-2;b<=2;b++){let _=h.cx+l*b/2,y=h.cy+c*p/2,w=a(_,y);w>i.value&&(i={cx:_,cy:y,value:w});}l/=2,c/=2;}if(i.value<=0)return null;let m=.5/Math.max(i.cx-n.x0,n.x1-i.cx,i.cy-n.y0,n.y1-i.cy),f=([g,h])=>[.5+(g-i.cx)*m,.5+(h-i.cy)*m],d=t.map(g=>({start:f(g.start),segments:g.segments.map(h=>h.map(f))}));return {rings:d,polygons:d.map(uu),half:i.value}}function gu(t,e){let n=([r,a])=>`${x(r*e)} ${x(a*e)}`,o="";for(let r of t.rings){o+=`M${n(r.start)}`;for(let a of r.segments){let i=a.length===1?"L":a.length===2?"Q":"C";o+=i+a.map(n).join(" ");}o+="Z";}return o}var $h={start:[0,-0.58],segments:[[[.2,-0.92],[1,-0.97],[1,-0.3]],[[1,.3],[.62,.6],[0,.92]],[[-0.62,.6],[-1,.3],[-1,-0.3]],[[-1,-0.97],[-0.2,-0.92],[0,-0.58]]]},mu;function bu(){return mu??=pu([$h]),mu}function Sh(t){let{width:e,height:n,cells:o}=t;return Number.isInteger(e)&&Number.isInteger(n)&&e>=_e&&n>=_e&&e<=De&&n<=De&&typeof o=="string"&&o.length===e*n&&/^[01]*$/.test(o)?(r,a)=>r>=0&&a>=0&&r<e&&a<n&&o[a*e+r]==="1":null}var de=([t,e])=>`${t},${e}`;function wh(t,e,n){let o=(l,c)=>t(l-1,c-1),r=new Map,a=(l,c)=>{for(let[u,m]of [[l,c],[c,l]]){let f=r.get(de(u))??[];f.push(m),r.set(de(u),f);}};for(let l=0;l<=n;l++)for(let c=0;c<=e;c++){let u=o(c,l),m=o(c+1,l),f=o(c+1,l+1),d=o(c,l+1),g=[c,l-.5],h=[c+.5,l],p=[c,l+.5],b=[c-.5,l];switch((u?8:0)+(m?4:0)+(f?2:0)+(d?1:0)){case 1:case 14:a(b,p);break;case 2:case 13:a(p,h);break;case 3:case 12:a(b,h);break;case 4:case 11:a(g,h);break;case 6:case 9:a(g,p);break;case 7:case 8:a(b,g);break;case 5:a(g,h),a(b,p);break;case 10:a(b,g),a(p,h);break;}}let i=[],s=new Set;for(let[l,c]of r){if(s.has(l)||c.length===0)continue;let[u,m]=l.split(",").map(Number),f=[[u,m]];s.add(l);let d=[u,m],g=c[0];for(;!s.has(de(g));){s.add(de(g)),f.push(g);let h=Ch(r.get(de(g))??[],d,s);if(!h)break;d=g,g=h;}f.length>=3&&i.push(Mh(f));}return i}function Ch(t,e,n){let o=de(e);return t.find(r=>de(r)!==o&&!n.has(de(r)))??t.find(r=>de(r)!==o)}function Mh(t){let e=[];for(let n=0;n<t.length;n++){let o=t[(n-1+t.length)%t.length],r=t[n],a=t[(n+1)%t.length],i=(r[0]-o[0])*(a[1]-r[1])-(r[1]-o[1])*(a[0]-r[0]);Math.abs(i)>1e-9&&e.push(r);}return e.length>=3?e:t}function Rh(t){let e=(a,i)=>[(a[0]+i[0])/2,(a[1]+i[1])/2],n=t.length,o=e(t[n-1],t[0]),r=t.map((a,i)=>[a,e(a,t[(i+1)%n])]);return {start:o,segments:r}}var Sr=new Map;function Ui(t){let e=`${t.width}x${t.height}:${t.cells}`,n=Sr.get(e);if(n)return n;let o=Sh(t),r;if(!o)r={outline:null,problem:"invalid"};else if(t.cells.includes("1")){let a=wh(o,t.width,t.height),i=a.length>0?pu(a.map(Rh)):null;r=i&&2*i.half>=Fa?{outline:i,problem:null}:{outline:null,problem:i?"thin":"empty"};}else r={outline:null,problem:"empty"};return Sr.size>16&&Sr.delete(Sr.keys().next().value),Sr.set(e,r),r}var Eh=1,_u=.5,yu=.5,Ah=.5;function tn(t){return Math.max(t,ka)}function yo(t){return t==="heart"?bu():typeof t=="object"&&t?.type==="silhouette"?Ui(t).outline:null}function wr(t){return t==="circle"||yo(t)!==null}var Ph={invalid:"This silhouette isn't a valid shape grid.",empty:"No shape found: use a picture with a dark or opaque shape on a light or clear background.",thin:"This shape is too thin to hold the code with its quiet zone. Try a rounder, fuller shape."};function Ih(t){let{outline:e,problem:n}=Ui(t);if(e&&!n)return {ok:true,share:2*e.half};let o=n??"invalid";return {ok:false,reason:o,message:Ph[o]}}function Et(t,e,n){if(n==="circle"){let i=tn(e),s=(t/2+i)*Math.SQRT2+Eh;return Math.ceil(s-t/2)}let o=yo(n);if(!o)return e;let r=tn(e),a=(t+2*(r+Ah))/(2*o.half);return Math.ceil((a-t)/2-1e-9)}function xu(t){let e=t>>>0;return ()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function vh(t,e,n){let o=Et(e,n,"circle"),r=tn(n),a=e+2*o,i=a/2,s=i-_u-.5,l=xu(Number.parseInt(je(t),36)||1),c=o-r,u=o+e+r;return Array.from({length:a},(m,f)=>Array.from({length:a},(d,g)=>{let h=l()<yu;return g>=c&&g<u&&f>=c&&f<u?false:h&&Math.hypot(g+.5-i,f+.5-i)<=s}))}var Lh=Array.from({length:8},(t,e)=>{let n=e*Math.PI/4;return [Math.cos(n),Math.sin(n)]});function $u(t,e,n,o){if(o==="circle")return vh(t,e,n);let r=yo(o);if(!r)return null;let a=Et(e,n,o),i=tn(n),s=e+2*a,l=hu(r.polygons),c=.5+_u,u=(g,h)=>{let p=g+.5,b=h+.5;return l(p/s,b/s)?Lh.every(([_,y])=>l((p+_*c)/s,(b+y*c)/s)):false},m=xu(Number.parseInt(je(t),36)||1),f=a-i,d=a+e+i;return Array.from({length:s},(g,h)=>Array.from({length:s},(p,b)=>{let _=m()<yu;return b>=f&&b<d&&h>=f&&h<d?false:_&&u(b,h)}))}function Hi(t,e){if(t==="circle")return {circle:e/2};let n=yo(t);return n?{path:gu(n,e)}:null}function Th(t,e){let n=Hi(t,e);return n?"circle"in n?et(e/2,e/2,n.circle):n.path:null}function kh(t){return t==="top-left"?0:t==="top-right"?1:3}function xo(t,e,n,o="circle",r="top-left"){let a=n*2,i=n,s=a/3;switch(o){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let l=kh(r),c=(l+2)%4,u=1.3*s,m=.7*s,f=g=>{switch(o){case "leaf":return g===l||g===c;case "leaf-reverse":return !(g===l||g===c);case "drop":return g===l;default:return g===c}},d=[0,1,2,3].map(g=>f(g)?m:u);return A("path",{d:O(t-n,e-n,a,a,d)})}case "extra-rounded":return A("path",{d:O(t-n,e-n,a,a,1.15*s)});case "plus":{let l=1.15*s,c=n;return A("path",{d:Y([[t-l,e-c],[t+l,e-c],[t+l,e-l],[t+c,e-l],[t+c,e+l],[t+l,e+l],[t+l,e+c],[t-l,e+c],[t-l,e+l],[t-c,e+l],[t-c,e-l],[t-l,e-l]])})}case "cross-rounded":{let l=1.15*s,c=.5*s;return A("path",{d:O(t-n,e-l,a,2*l,c)+O(t-l,e-n,2*l,a,c)})}case "hexagon":return A("path",{d:Y(vn(t,e,1.72*s,6))});case "octagon":return A("path",{d:Y(vn(t,e,n/Math.cos(Math.PI/8),8,22.5))});case "flower":{let l=.6*s,c=.9*s;return A("path",{d:et(t-l,e-l,c)+et(t+l,e-l,c)+et(t+l,e+l,c)+et(t-l,e+l,c)+et(t,e,1.2*s)})}case "heart":return A("path",{d:kn(t,e+.12*s,3.5*s)});case "squircle":return A("path",{d:Y(Tn(t,e,n,n,4,64))});case "dots":{let l=[];for(let c of [-1,0,1])for(let u of [-1,0,1])l.push(et(t+u*s*.82,e+c*s*.82,.58*s));return A("path",{d:l.join("")})}case "cushion":return A("path",{d:dr(t-n,e-n,a,.6*s,.15*s)});case "square":return A("rect",{height:x(a),transform:I`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "rounded":return A("rect",{height:x(a),rx:x(n*.5),ry:x(n*.5),transform:I`rotate(0,${t},${e})`,width:x(a),x:x(t-i),y:x(e-i)});case "diamond":return A("path",{d:I`M ${t-i*.714286} ${e-i*.714286}v ${a*.714286}h ${a*.714286}v -${a*.714286}z`,transform:I`rotate(45,${t},${e})`});case "message":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "message-reverse":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(-180,${t},${e})`})}case "diya":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${8.571428571428571*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} ${10.714285714285714*l}h ${19.285714285714285*l}v -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} -${10.714285714285714*l}h -${8.571428571428571*l}H ${c(25)}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "diya-reverse":{let l=a/30,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(25)} ${u(35.714285714285715)}v ${19.285714285714285*l}h ${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, ${10.714285714285714*l} -${10.714285714285714*l}v -${19.285714285714285*l}h -${19.285714285714285*l}a ${10.714285714285714*l} ${10.714285714285714*l}, 0, 0, 0, -${10.714285714285714*l} ${10.714285714285714*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "rounded-triangle":{let l=a/21,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(33.57142857142857)} ${u(29.285714285714285)}h ${12.857142857142856*l}c ${4.285714285714286*l} 0 ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l} ${4.285714285714286*l}v ${12.857142857142856*l}c 0 ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l}h -${12.857142857142856*l}c -${4.285714285714286*l} 0 -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l} -${4.285714285714286*l}v -${12.857142857142856*l}c 0 -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l} ${4.285714285714286*l} -${4.285714285714286*l}z`;return A("path",{d:m,transform:I`rotate(45,${t},${e})`})}case "star":{let l=a/27,c=f=>(f-40)*l+t,u=f=>(f-40)*l+e,m=I`M ${c(38.84615384615385)},${u(26.546153846153846)}c${.6692307692307691*l},-${1.0153846153846153*l},${2.215384615384615*l},-${1.0153846153846153*l},${2.884615384615384*l},0l${4.038461538461538*l},${6.069230769230768*l}c${.23076923076923075*l},${.3461538461538461*l},${.6*l},${.6*l},${1.0153846153846153*l},${.7153846153846153*l}l${7.223076923076922*l},${1.823076923076923*l}c${1.2*l},${.3*l},${1.6846153846153844*l},${1.7076923076923076*l},${.8999999999999999*l},${2.6538461538461533*l}l-${4.73076923076923*l},${5.584615384615384*l}c-${.2769230769230769*l},${.3230769230769231*l},-${.41538461538461535*l},${.7384615384615384*l},-${.3923076923076923*l},${1.1307692307692307*l}l${.4384615384615384*l},${7.199999999999999*l}c${.06923076923076922*l},${1.2*l},-${1.1769230769230767*l},${2.0769230769230766*l},-${2.3307692307692305*l},${1.6384615384615382*l}l-${6.9692307692307685*l},-${2.6076923076923073*l}c-${.3923076923076923*l},-${.16153846153846155*l},-${.8538461538461538*l},-${.16153846153846155*l},-${1.2461538461538462*l},0l-${6.9692307692307685*l},${2.6076923076923073*l}c-${1.1538461538461537*l},${.4384615384615384*l},-${2.4*l},-${.4384615384615384*l},-${2.3307692307692305*l},-${1.6384615384615382*l}l${.4384615384615384*l},-${7.199999999999999*l}c${.023076923076923075*l},-${.41538461538461535*l},-${.11538461538461538*l},-${.8307692307692307*l},-${.3923076923076923*l},-${1.1307692307692307*l}l-${4.73076923076923*l},-${5.584615384615384*l}c-${.7846153846153846*l},-${.923076923076923*l},-${.3230769230769231*l},-${2.3307692307692305*l},${.8999999999999999*l},-${2.6538461538461533*l}l${7.223076923076922*l},-${1.823076923076923*l}c${.41538461538461535*l},-${.11538461538461538*l},${.7846153846153846*l},-${.3461538461538461*l},${1.0153846153846153*l},-${.7153846153846153*l}l${4.038461538461538*l},-${6.069230769230768*l}z`;return A("path",{clipRule:"evenodd",d:m,transform:I`rotate(0,${t},${e})`})}case "banner":{let l=a/28;return A("g",{transform:I`translate(${t-40*l},${e-40*l}) scale(${x(l,6)})`,children:A("path",{clipRule:"evenodd",d:"M38.235 26.104C38.759 25.677, 39.51 25.677, 40.034 26.104L41.776 27.52C42.091 27.777, 42.501 27.887, 42.902 27.822L45.118 27.466C45.785 27.359, 46.436 27.735, 46.677 28.366L47.477 30.464C47.621 30.843, 47.921 31.143, 48.301 31.288L50.399 32.088C51.03 32.328, 51.406 32.979, 51.298 33.646L50.942 35.863C50.878 36.264, 50.988 36.674, 51.244 36.989L52.661 38.73C53.087 39.254, 53.087 40.006, 52.661 40.53L51.244 42.271C50.988 42.587, 50.878 42.996, 50.942 43.397L51.298 45.614C51.406 46.281, 51.03 46.932, 50.399 47.173L48.301 47.972C47.921 48.117, 47.621 48.417, 47.477 48.797L46.677 50.894C46.436 51.526, 45.785 51.901, 45.118 51.794L42.902 51.438C42.501 51.374, 42.091 51.483, 41.776 51.74L40.034 53.157C39.51 53.583, 38.759 53.583, 38.235 53.157L36.493 51.74C36.178 51.483, 35.768 51.374, 35.367 51.438L33.15 51.794C32.483 51.901, 31.833 51.526, 31.592 50.894L30.792 48.797C30.647 48.417, 30.347 48.117, 29.968 47.972L27.87 47.173C27.239 46.932, 26.863 46.281, 26.97 45.614L27.326 43.397C27.391 42.996, 27.281 42.587, 27.025 42.271L25.608 40.53C25.182 40.006, 25.182 39.254, 25.608 38.73L27.025 36.989C27.281 36.674, 27.391 36.264, 27.326 35.863L26.97 33.646C26.863 32.979, 27.239 32.328, 27.87 32.088L29.968 31.288C30.347 31.143, 30.647 30.843, 30.792 30.464L31.592 28.366C31.833 27.735, 32.483 27.359, 33.15 27.466L35.367 27.822C35.768 27.887, 36.178 27.777, 36.493 27.52L38.235 26.104Z"})})}default:return A("circle",{cx:x(t),cy:x(e),r:x(n),transform:I`rotate(0,${t},${e})`})}}function Bn(t,e,n,o){let r=t==="top-left"?0:t==="top-right"?1:3,a=(r+2)%4;return [0,1,2,3].map(i=>i===r||o&&i===a?n:e)}function Su(t,e,n,o){let r=n/7,a=Math.max(0,(o+Math.SQRT2-2)*r);return Y($i(t,e,n,o*r))+Y($i(t+r,e+r,5*r,a))}function wu(t,e,n,o,r=false){let a=n/7,i=s=>r?Bn(o,0,s,true):Bn(o,s,0,true);return O(t,e,n,n,i(2.5*a))+O(t+a,e+a,5*a,5*a,i(1.5*a))}function Fh(t,e,n,o){let r=n/7;return O(t,e,n,n,Bn(o,2.6*r,0,false))+O(t+r,e+r,5*r,5*r,Bn(o,1.6*r,0,false))}function Nh(t,e,n){let o=n/7,r=t+n/2,a=e+n/2;return Y(Tn(r,a,3.5*o,3.5*o,4,96))+Y(Tn(r,a,2.5*o,2.5*o,4,96))}function Oh(t,e,n){let o=n/7,r=.12*o;return dr(t,e,n,1.4*o,r)+dr(t+o,e+o,5*o,.7*o,r)}function Dh(t,e,n){let o=n/7;return wi(t,e,n,.7*o,3.9*o,o)+wi(t+o,e+o,5*o,.35*o,2.7*o,.8*o)}function Bh(t,e,n,o){let r=n/7;return O(t,e,n,n,Bn(o,.5*r,2.5*r,false))+O(t+r,e+r,5*r,5*r,Bn(o,.25*r,1.5*r,false))}function Gh(t,e,n){return O(t+n,e+n,5*n,5*n,1.5*n)}function Qh(t,e,n){return Y(Tn(t,e,3.5*n,3.5*n,2.75,96))}function Uh(t,e,n){let o=n/7;return Qh(t+n/2,e+n/2,o)+ao(t+o,e+o,5*o,5*o,.52*o)}function Hh(t,e,n){let o=n/7;return Si(t,e,n,n,1.15*o)+Si(t+o,e+o,5*o,5*o,.74*o)}function zh(t,e,n){let o=n/7;return ao(t,e,n,n,.8*o)+ao(t+o,e+o,5*o,5*o,.52*o)}function zi(t,e,n,o){let[r,a,i,s]=o,l=(u,m)=>I`${t+u} ${e+m}`,c=(u,m,f)=>u[0]==="round"?I`A${u[1]} ${u[1]} 0 0 1 ${l(m,f)}`:I`L${l(m,f)}`;return I`M${l(r[1],0)}L${l(n-a[1],0)}`+c(a,n,a[1])+I`L${l(n,n-i[1])}`+c(i,n-i[1],n)+I`L${l(s[1],n)}`+c(s,0,n-s[1])+I`L${l(0,r[1])}`+c(r,r[1],0)+"Z"}function Wh(t,e){let n=[0,1,2,3].map(r=>e(r)?["round",2.8*t]:["cut",1.6*t]),o=[0,1,2,3].map(r=>e(r)?["round",1.5*t]:["cut",1.01*t]);return [n,o]}function qh(t,e,n,o){let r=n/7,a=o==="top-left"?0:o==="top-right"?1:3,i=(a+2)%4,[s,l]=Wh(r,c=>c===a||c===i);return zi(t,e,n,s)+zi(t+r,e+r,5*r,l)}function Vh(t,e,n){let o=n/7;return zi(t,e,n,[["cut",1.6*o],["cut",1.6*o],["round",3*o],["round",3*o]])+Gh(t,e,o)}function jh(t,e,n){let o=n/7;return I`M ${t} ${e}v ${n}h ${n}v -${n}z`+I`M ${t+o} ${e+o}h ${5*o}v ${5*o}h -${5*o}z`}function Xh(t,e,n){let o=n/7,r=o*.875,a=o*.4375,i=I`M ${t+r} ${e}`+I`h ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${r} ${r}`+I`v ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${-r} ${r}`+I`h ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${-r} ${-r}`+I`v ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=I`M ${t+o+a} ${e+o}`+I`h ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${a} ${a}`+I`v ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${-a} ${a}`+I`h ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${-a} ${-a}`+I`v ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function Yh(t,e,n){let o=t+n/2,r=e+n/2,a=J(n/2),i=J(n*(2.5/7));return I`M ${o-a} ${r}`+I`a ${a} ${a} 0 1 0 ${a*2} 0`+I`a ${a} ${a} 0 1 0 ${-a*2} 0z`+I`M ${o-i} ${r}`+I`a ${i} ${i} 0 1 1 ${i*2} 0`+I`a ${i} ${i} 0 1 1 ${-i*2} 0z`}function Zh(t,e,n){let o=n/74.7002,r=s=>s*o+t,a=s=>s*o+e;return I`M${r(37.3496)} ${a(0)}C${r(39.2939)} ${a(0)} ${r(40.9948)} ${a(1.03842)} ${r(41.9287)} ${a(2.59082)}C${r(43.2293)} ${a(1.34013)} ${r(45.1347)} ${a(.780267)} ${r(47.0098)} ${a(1.28027)}C${r(48.8871)} ${a(1.78928)} ${r(50.261)} ${a(3.23767)} ${r(50.7578)} ${a(4.98438)}C${r(52.3454)} ${a(4.0996)} ${r(54.3432)} ${a(4.047)} ${r(56.0303)} ${a(5.01953)}C${r(57.7094)} ${a(5.98752)} ${r(58.6586)} ${a(7.73647)} ${r(58.6924)} ${a(9.5459)}C${r(60.4517)} ${a(9.10661)} ${r(62.3883)} ${a(9.57215)} ${r(63.7598)} ${a(10.9502)}C${r(65.1282)} ${a(12.3253)} ${r(65.5963)} ${a(14.2585)} ${r(65.1641)} ${a(16.0127)}C${r(66.974)} ${a(16.044)} ${r(68.7242)} ${a(16.9982)} ${r(69.7002)} ${a(18.6797)}C${r(70.6781)} ${a(20.3647)} ${r(70.6241)} ${a(22.3635)} ${r(69.7402)} ${a(23.9502)}C${r(71.4776)} ${a(24.4496)} ${r(72.9194)} ${a(25.8232)} ${r(73.4199)} ${a(27.7002)}C${r(73.927)} ${a(29.5707)} ${r(73.3661)} ${a(31.4794)} ${r(72.1104)} ${a(32.7822)}C${r(73.6621)} ${a(33.7163)} ${r(74.7002)} ${a(35.4166)} ${r(74.7002)} ${a(37.3604)}C${r(74.7001)} ${a(39.307)} ${r(73.6582)} ${a(41.0084)} ${r(72.1025)} ${a(41.9414)}C${r(73.357)} ${a(43.245)} ${r(73.9207)} ${a(45.1525)} ${r(73.4199)} ${a(47.0303)}C${r(72.9187)} ${a(48.9027)} ${r(71.4782)} ${a(50.2735)} ${r(69.7383)} ${a(50.7734)}C${r(70.6201)} ${a(52.3601)} ${r(70.6716)} ${a(54.3549)} ${r(69.7002)} ${a(56.04)}C${r(68.7237)} ${a(57.7225)} ${r(66.9721)} ${a(58.6729)} ${r(65.1611)} ${a(58.7031)}C${r(65.598)} ${a(60.4623)} ${r(65.131)} ${a(62.3982)} ${r(63.7598)} ${a(63.7695)}C${r(62.3847)} ${a(65.138)} ${r(60.4515)} ${a(65.6061)} ${r(58.6973)} ${a(65.1738)}C${r(58.6635)} ${a(66.9833)} ${r(57.7094)} ${a(68.7322)} ${r(56.0303)} ${a(69.7002)}C${r(54.3461)} ${a(70.6777)} ${r(52.348)} ${a(70.6248)} ${r(50.7617)} ${a(69.7422)}C${r(50.2643)} ${a(71.4831)} ${r(48.8896)} ${a(72.9284)} ${r(47.0098)} ${a(73.4297)}C${r(45.1389)} ${a(73.9368)} ${r(43.2296)} ${a(73.3763)} ${r(41.9268)} ${a(72.1201)}C${r(40.9927)} ${a(73.6717)} ${r(39.2932)} ${a(74.71)} ${r(37.3496)} ${a(74.71)}C${r(35.4051)} ${a(74.7098)} ${r(33.7042)} ${a(73.6711)} ${r(32.7705)} ${a(72.1182)}C${r(31.4697)} ${a(73.3758)} ${r(29.5597)} ${a(73.9418)} ${r(27.6797)} ${a(73.4404)}V${a(73.4502)}C${r(25.8065)} ${a(72.9422)} ${r(24.434)} ${a(71.4985)} ${r(23.9346)} ${a(69.7568)}C${r(22.3504)} ${a(70.6301)} ${r(20.3591)} ${a(70.6781)} ${r(18.6797)} ${a(69.71)}C${r(16.9957)} ${a(68.7391)} ${r(16.045)} ${a(66.9831)} ${r(16.0166)} ${a(65.168)}C${r(14.2547)} ${a(65.6091)} ${r(12.3134)} ${a(65.1435)} ${r(10.9395)} ${a(63.7695)}C${r(9.5687)} ${a(62.3919)} ${r(9.10168)} ${a(60.454)} ${r(9.53809)} ${a(58.6973)}C${r(7.72791)} ${a(58.6641)} ${r(5.97815)} ${a(57.71)} ${r(5.00977)} ${a(56.0303)}C${r(4.03552)} ${a(54.3517)} ${r(4.08377)} ${a(52.3649)} ${r(4.95801)} ${a(50.7812)}C${r(3.21705)} ${a(50.2839)} ${r(1.77087)} ${a(48.9101)} ${r(1.26953)} ${a(47.0303)}V${a(47.0205)}C${r(.762081)} ${a(45.1489)} ${r(1.32758)} ${a(43.2375)} ${r(2.58496)} ${a(41.9346)}C${r(1.03604)} ${a(41)} ${r(108484e-9)} ${a(39.3019)} ${r(0)} ${a(37.3604)}C${r(0)} ${a(35.4159)} ${r(1.03815)} ${a(33.7141)} ${r(2.59082)} ${a(32.7803)}C${r(1.34044)} ${a(31.4797)} ${r(.780389)} ${a(29.575)} ${r(1.28027)} ${a(27.7002)}C${r(1.78258)} ${a(25.8232)} ${r(3.22806)} ${a(24.4482)} ${r(4.97363)} ${a(23.9512)}C${r(4.08938)} ${a(22.3638)} ${r(4.03743)} ${a(20.3664)} ${r(5.00977)} ${a(18.6797)}C${r(5.97815)} ${a(16.9999)} ${r(7.72788)} ${a(16.0496)} ${r(9.53809)} ${a(16.0166)}C${r(9.10139)} ${a(14.2576)} ${r(9.56846)} ${a(12.3214)} ${r(10.9395)} ${a(10.9502)}C${r(12.3171)} ${a(9.57911)} ${r(14.2558)} ${a(9.11137)} ${r(16.0127)} ${a(9.54785)}C${r(16.0426)} ${a(7.73421)} ${r(16.9969)} ${a(5.97989)} ${r(18.6797)} ${a(5.00977)}C${r(20.3596)} ${a(4.03474)} ${r(22.3521)} ${a(4.08468)} ${r(23.9365)} ${a(4.96094)}C${r(24.4378)} ${a(3.22749)} ${r(25.8059)} ${a(1.7898)} ${r(27.6797)} ${a(1.29004)}C${r(29.5511)} ${a(.78264)} ${r(31.4617)} ${a(1.34357)} ${r(32.7646)} ${a(2.60059)}C${r(33.6971)} ${a(1.04268)} ${r(35.4013)} ${a(152405e-9)} ${r(37.3496)} ${a(0)}ZM${r(41.0615)} ${a(9.17578)}C${r(40.1006)} ${a(10.1057)} ${r(38.793)} ${a(10.6797)} ${r(37.3496)} ${a(10.6797)}C${r(35.9064)} ${a(10.6796)} ${r(34.5985)} ${a(10.1066)} ${r(33.6377)} ${a(9.17676)}C${r(32.9511)} ${a(10.3241)} ${r(31.8358)} ${a(11.2176)} ${r(30.4404)} ${a(11.5898)}C${r(29.0527)} ${a(11.9661)} ${r(27.6436)} ${a(11.7542)} ${r(26.4766)} ${a(11.1074)}C${r(26.1072)} ${a(12.3879)} ${r(25.2629)} ${a(13.5333)} ${r(24.0195)} ${a(14.25)}C${r(22.7695)} ${a(14.9754)} ${r(21.347)} ${a(15.1322)} ${r(20.0479)} ${a(14.8047)}C${r(20.0289)} ${a(16.1454)} ${r(19.5108)} ${a(17.4793)} ${r(18.4902)} ${a(18.5)}C${r(17.4696)} ${a(19.5158)} ${r(16.1409)} ${a(20.033)} ${r(14.8066)} ${a(20.0566)}C${r(15.1312)} ${a(21.3534)} ${r(14.9738)} ${a(22.7723)} ${r(14.25)} ${a(24.0195)}C${r(13.5243)} ${a(25.2699)} ${r(12.3701)} ${a(26.1148)} ${r(11.082)} ${a(26.4795)}C${r(11.7347)} ${a(27.6479)} ${r(11.9529)} ${a(29.062)} ${r(11.5801)} ${a(30.46)}C${r(11.2085)} ${a(31.8485)} ${r(10.3194)} ${a(32.9607)} ${r(9.17578)} ${a(33.6475)}C${r(10.106)} ${a(34.6084)} ${r(10.6797)} ${a(35.9167)} ${r(10.6797)} ${a(37.3604)}C${r(10.6796)} ${a(38.805)} ${r(10.1053)} ${a(40.1141)} ${r(9.17383)} ${a(41.0752)}C${r(10.3132)} ${a(41.7614)} ${r(11.1999)} ${a(42.871)} ${r(11.5703)} ${a(44.2598)}C${r(11.946)} ${a(45.6504)} ${r(11.7335)} ${a(47.0592)} ${r(11.0889)} ${a(48.2266)}C${r(12.377)} ${a(48.593)} ${r(13.5297)} ${a(49.441)} ${r(14.25)} ${a(50.6904)}C${r(14.9754)} ${a(51.9405)} ${r(15.1322)} ${a(53.3629)} ${r(14.8047)} ${a(54.6621)}C${r(16.142)} ${a(54.6835)} ${r(17.4721)} ${a(55.2016)} ${r(18.4902)} ${a(56.2197)}C${r(19.5097)} ${a(57.2441)} ${r(20.0278)} ${a(58.5787)} ${r(20.0479)} ${a(59.918)}C${r(21.3469)} ${a(59.5917)} ${r(22.7696)} ${a(59.7493)} ${r(24.0195)} ${a(60.4697)}C${r(25.2676)} ${a(61.1892)} ${r(26.1117)} ${a(62.3406)} ${r(26.4775)} ${a(63.627)}C${r(27.6424)} ${a(62.9822)} ${r(29.0498)} ${a(62.7688)} ${r(30.4404)} ${a(63.1396)}C${r(31.8284)} ${a(63.5112)} ${r(32.9402)} ${a(64.3999)} ${r(33.627)} ${a(65.543)}C${r(34.5887)} ${a(64.6072)} ${r(35.9012)} ${a(64.0304)} ${r(37.3496)} ${a(64.0303)}C${r(38.7912)} ${a(64.0303)} ${r(40.098)} ${a(64.6023)} ${r(41.0586)} ${a(65.5303)}C${r(41.7458)} ${a(64.3887)} ${r(42.8594)} ${a(63.5007)} ${r(44.25)} ${a(63.1299)}C${r(45.643)} ${a(62.7522)} ${r(47.057)} ${a(62.9676)} ${r(48.2266)} ${a(63.6201)}C${r(48.5931)} ${a(62.3323)} ${r(49.4413)} ${a(61.1801)} ${r(50.6904)} ${a(60.46)}C${r(51.9373)} ${a(59.7364)} ${r(53.3558)} ${a(59.5781)} ${r(54.6523)} ${a(59.9023)}C${r(54.6744)} ${a(58.5659)} ${r(55.1925)} ${a(57.2372)} ${r(56.21)} ${a(56.2197)}C${r(57.2339)} ${a(55.2007)} ${r(58.5676)} ${a(54.6816)} ${r(59.9062)} ${a(54.6611)}C${r(59.5835)} ${a(53.3649)} ${r(59.7414)} ${a(51.9468)} ${r(60.46)} ${a(50.7002)}C${r(61.1797)} ${a(49.4517)} ${r(62.3312)} ${a(48.6068)} ${r(63.6182)} ${a(48.2412)}C${r(62.9651)} ${a(47.0726)} ${r(62.7473)} ${a(45.658)} ${r(63.1201)} ${a(44.2598)}C${r(63.4916)} ${a(42.8718)} ${r(64.3794)} ${a(41.7591)} ${r(65.5225)} ${a(41.0723)}C${r(64.5929)} ${a(40.1115)} ${r(64.0206)} ${a(38.8033)} ${r(64.0205)} ${a(37.3604)}C${r(64.0205)} ${a(35.9186)} ${r(64.5915)} ${a(34.611)} ${r(65.5195)} ${a(33.6504)}C${r(64.3785)} ${a(32.9631)} ${r(63.4908)} ${a(31.8501)} ${r(63.1201)} ${a(30.46)}C${r(62.7421)} ${a(29.0656)} ${r(62.9572)} ${a(27.6498)} ${r(63.6113)} ${a(26.4795)}C${r(62.3272)} ${a(26.1115)} ${r(61.1784)} ${a(25.2657)} ${r(60.46)} ${a(24.0195)}C${r(59.7364)} ${a(22.7727)} ${r(59.5781)} ${a(21.3541)} ${r(59.9023)} ${a(20.0576)}C${r(58.5626)} ${a(20.038)} ${r(57.23)} ${a(19.52)} ${r(56.21)} ${a(18.5)}C${r(55.1931)} ${a(17.4783)} ${r(54.675)} ${a(16.1482)} ${r(54.6523)} ${a(14.8125)}C${r(53.3557)} ${a(15.1357)} ${r(51.9374)} ${a(14.9785)} ${r(50.6904)} ${a(14.2598)}C${r(49.4399)} ${a(13.5339)} ${r(48.5931)} ${a(12.3801)} ${r(48.2285)} ${a(11.0918)}C${r(47.0603)} ${a(11.7439)} ${r(45.6474)} ${a(11.9624)} ${r(44.25)} ${a(11.5898)}V${a(11.5801)}C${r(42.8613)} ${a(11.2085)} ${r(41.7483)} ${a(10.3196)} ${r(41.0615)} ${a(9.17578)}Z`}function Wi(t){let e=t/70;return {scale:e,transform:(o,r)=>(o-5)*e+r}}function Kh(t,e,n){let{scale:o,transform:r}=Wi(n);return I`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}H ${r(5,t)}zM ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${35*o}z`}function Jh(t,e,n){let o=n/7,r=o*1.5,a=o*.75,i=I`M ${t+r} ${e}`+I`h ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${r} ${r}`+I`v ${n-2*r}`+I`a ${r} ${r} 0 0 1 ${-r} ${r}`+I`h ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${-r} ${-r}`+I`v ${-(n-2*r)}`+I`a ${r} ${r} 0 0 1 ${r} ${-r}z`,s=I`M ${t+o+a} ${e+o}`+I`h ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${a} ${a}`+I`v ${5*o-2*a}`+I`a ${a} ${a} 0 0 1 ${-a} ${a}`+I`h ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${-a} ${-a}`+I`v ${-(5*o-2*a)}`+I`a ${a} ${a} 0 0 1 ${a} ${-a}z`;return i+s}function tp(t,e,n){let{scale:o,transform:r}=Wi(n);return I`M ${r(5,t)} ${r(40,e)}a ${35*o} ${35*o}, 0, 0, 0, ${35*o} ${35*o}h ${30*o}a ${5*o} ${5*o}, 0, 0, 0, ${5*o} -${5*o}v -${30*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} -${35*o}a ${35*o} ${35*o}, 0, 0, 0, -${35*o} ${35*o}zM ${r(40,t)} ${r(15,e)}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} ${25*o}v ${25*o}h -${25*o}a ${25*o} ${25*o}, 0, 0, 1, -${25*o} -${25*o}a ${25*o} ${25*o}, 0, 0, 1, ${25*o} -${25*o}z`}function ep(t,e,n){let{scale:o,transform:r}=Wi(n);return I`M ${r(5,t)} ${r(30,e)}v ${20*o}a ${25*o} ${25*o}, 0, 0, 0, ${25*o} ${25*o}h ${45*o}v -${45*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} -${25*o}h -${20*o}a ${25*o} ${25*o}, 0, 0, 0, -${25*o} ${25*o}M ${r(30,t)} ${r(15,e)}h ${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} ${15*o}v ${35*o}h -${35*o}a ${15*o} ${15*o}, 0, 0, 1, -${15*o} -${15*o}v -${20*o}a ${15*o} ${15*o}, 0, 0, 1, ${15*o} -${15*o}z`}function np(t,e,n){let o=n/70,r=t+n/2-40*o,a=e+n/2-40*o,i=(l,c)=>l*o+c;return I`M${i(35.19239999999999,r)} ${i(5.837547376725838,a)}C${i(37.69667692307692,r)} ${i(3.8737070690335305,a)}, ${i(41.218430769230764,r)} ${i(3.8737092228796843,a)}, ${i(43.722707692307694,r)} ${i(5.837547376725838,a)}L${i(46.62781538461539,r)} ${i(8.115648915187375,a)}L${i(50.23356923076923,r)} ${i(7.32361506903353,a)}C${i(53.342,r)} ${i(6.640824299802762,a)}, ${i(56.51483076923077,r)} ${i(8.168784299802759,a)}, ${i(57.91892307692308,r)} ${i(11.024719684418145,a)}L${i(59.54787692307692,r)} ${i(14.337679684418145,a)}L${i(63.14027692307692,r)} ${i(15.188578145956608,a)}C${i(66.23707692307693,r)} ${i(15.922091992110452,a)}, ${i(68.43270769230769,r)} ${i(18.675396607495067,a)}, ${i(68.45876923076924,r)} ${i(21.857768915187375,a)}L${i(68.48892307692307,r)} ${i(25.54931045364891,a)}L${i(71.35633846153846,r)} ${i(27.874602761341222,a)}C${i(73.82830769230769,r)} ${i(29.879187376725838,a)}, ${i(74.61187692307692,r)} ${i(33.312418145956606,a)}, ${i(73.25452307692306,r)} ${i(36.19103353057199,a)}L${i(71.68006153846153,r)} ${i(39.530141222879685,a)}L${i(73.25452307692306,r)} ${i(42.86924891518738,a)}C${i(74.61187692307692,r)} ${i(45.747864299802764,a)}, ${i(73.82830769230769,r)} ${i(49.18109506903353,a)}, ${i(71.35633846153846,r)} ${i(51.18567968441815,a)}L${i(68.48892307692307,r)} ${i(53.510971992110456,a)}L${i(68.45876923076924,r)} ${i(57.202664299802755,a)}C${i(68.43270769230769,r)} ${i(60.38497199211046,a)}, ${i(66.23707692307693,r)} ${i(63.13823353057199,a)}, ${i(63.14027692307692,r)} ${i(63.871833530572,a)}L${i(59.54787692307692,r)} ${i(64.72260276134121,a)}L${i(57.91892307692308,r)} ${i(68.03564891518737,a)}C${i(56.51483076923077,r)} ${i(70.89164891518737,a)}, ${i(53.342,r)} ${i(72.41958737672583,a)}, ${i(50.23356923076923,r)} ${i(71.7368181459566,a)}L${i(46.62781538461539,r)} ${i(70.94463353057199,a)}L${i(43.722707692307694,r)} ${i(73.22275660749506,a)}C${i(41.218430769230764,r)} ${i(75.18663353057198,a)}, ${i(37.69667692307692,r)} ${i(75.18663353057198,a)}, ${i(35.19239999999999,r)} ${i(73.22275660749506,a)}L${i(32.28729230769231,r)} ${i(70.94463353057199,a)}L${i(28.68153846153846,r)} ${i(71.7368181459566,a)}C${i(25.573215384615384,r)} ${i(72.41958737672583,a)}, ${i(22.400384615384613,r)} ${i(70.89164891518737,a)}, ${i(20.996141538461536,r)} ${i(68.03564891518737,a)}L${i(19.36720923076923,r)} ${i(64.72260276134121,a)}L${i(15.774852307692306,r)} ${i(63.871833530572,a)}C${i(12.67803076923077,r)} ${i(63.13823353057199,a)}, ${i(10.48237846153846,r)} ${i(60.38497199211046,a)}, ${i(10.45636,r)} ${i(57.202664299802755,a)}L${i(10.426163076923077,r)} ${i(53.510971992110456,a)}L${i(7.558747692307692,r)} ${i(51.18567968441815,a)}C${i(5.086880338461539,r)} ${i(49.18109506903353,a)}, ${i(4.303258769230769,r)} ${i(45.747864299802764,a)}, ${i(5.660599692307692,r)} ${i(42.86924891518738,a)}L${i(7.235153846153846,r)} ${i(39.530141222879685,a)}L${i(5.660599692307692,r)} ${i(36.19103353057199,a)}C${i(4.3032566153846155,r)} ${i(33.312418145956606,a)}, ${i(5.086885938461538,r)} ${i(29.879187376725838,a)}, ${i(7.558747692307692,r)} ${i(27.874602761341222,a)}L${i(10.426163076923077,r)} ${i(25.54931045364891,a)}L${i(10.45636,r)} ${i(21.857768915187375,a)}C${i(10.48237846153846,r)} ${i(18.67537506903353,a)}, ${i(12.678052307692308,r)} ${i(15.922091992110452,a)}, ${i(15.774852307692306,r)} ${i(15.188578145956608,a)}L${i(19.36720923076923,r)} ${i(14.337679684418145,a)}L${i(20.996141538461536,r)} ${i(11.024719684418145,a)}C${i(22.400384615384613,r)} ${i(8.168784299802759,a)}, ${i(25.573215384615384,r)} ${i(6.640824299802762,a)}, ${i(28.68153846153846,r)} ${i(7.32361506903353,a)}L${i(32.28729230769231,r)} ${i(8.115648915187375,a)}L${i(35.19239999999999,r)} ${i(5.837547376725838,a)}M${i(39.45766153846154,r)} ${i(13.665055069033532,a)}L${i(37.01498461538461,r)} ${i(15.58053506903353,a)}C${i(35.39098461538461,r)} ${i(16.854061222879682,a)}, ${i(33.282799999999995,r)} ${i(17.335251992110454,a)}, ${i(31.26701538461538,r)} ${i(16.892464299802757,a)}L${i(28.235046153846152,r)} ${i(16.22649506903353,a)}L${i(26.865415384615382,r)} ${i(19.012107376725837,a)}C${i(25.954812307692308,r)} ${i(20.864178145956608,a)}, ${i(24.264193846153844,r)} ${i(22.212399684418145,a)}, ${i(22.255926153846154,r)} ${i(22.688076607495066,a)}L${i(19.235393846153844,r)} ${i(23.40354122287968,a)}L${i(19.21,r)} ${i(26.507556607495065,a)}C${i(19.19313538461538,r)} ${i(28.57137199211045,a)}, ${i(18.25492,r)} ${i(30.519525838264297,a)}, ${i(16.651919999999997,r)} ${i(31.81937199211045,a)}L${i(14.240926153846154,r)} ${i(33.774633530572,a)}L${i(15.564830769230769,r)} ${i(36.58238737672584,a)}C${i(16.445064615384617,r)} ${i(38.44891045364892,a)}, ${i(16.445064615384617,r)} ${i(40.611371992110456,a)}, ${i(15.564830769230769,r)} ${i(42.47811045364892,a)}L${i(14.240926153846154,r)} ${i(45.28564891518738,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}L${i(13.883236923076923,r)} ${i(50.654971992110454,a)}L${i(16.651919999999997,r)} ${i(47.240910453648915,a)}C${i(18.25492,r)} ${i(48.54075660749507,a)}, ${i(19.19313538461538,r)} ${i(50.4891258382643,a)}, ${i(19.21,r)} ${i(52.5527258382643,a)}L${i(19.235393846153844,r)} ${i(55.65684891518738,a)}L${i(22.255926153846154,r)} ${i(56.37235660749507,a)}C${i(24.264193846153844,r)} ${i(56.847925838264295,a)}, ${i(25.954812307692308,r)} ${i(58.196233530571995,a)}, ${i(26.865415384615382,r)} ${i(60.0483258382643,a)}L${i(28.235046153846152,r)} ${i(62.833895069033524,a)}L${i(31.26701538461538,r)} ${i(62.1679258382643,a)}C${i(33.282799999999995,r)} ${i(61.72509506903353,a)}, ${i(35.39098461538461,r)} ${i(62.20626429980276,a)}, ${i(37.01498461538461,r)} ${i(63.47983353057199,a)}L${i(39.45766153846154,r)} ${i(65.39524891518737,a)}L${i(41.90012307692308,r)} ${i(63.47983353057199,a)}C${i(43.524123076923075,r)} ${i(62.20626429980276,a)}, ${i(45.632307692307684,r)} ${i(61.72509506903353,a)}, ${i(47.6480923076923,r)} ${i(62.1679258382643,a)}L${i(50.68006153846154,r)} ${i(62.833895069033524,a)}L${i(52.049692307692304,r)} ${i(60.0483258382643,a)}C${i(52.960338461538456,r)} ${i(58.196233530571995,a)}, ${i(54.6508923076923,r)} ${i(56.847925838264295,a)}, ${i(56.65913846153846,r)} ${i(56.37235660749507,a)}L${i(59.67969230769231,r)} ${i(55.65684891518738,a)}L${i(59.70510769230769,r)} ${i(52.5527258382643,a)}C${i(59.72190769230769,r)} ${i(50.4891258382643,a)}, ${i(60.66012307692307,r)} ${i(48.54075660749507,a)}, ${i(62.263230769230766,r)} ${i(47.240910453648915,a)}L${i(64.67424615384616,r)} ${i(45.28564891518738,a)}L${i(63.35027692307692,r)} ${i(42.47811045364892,a)}C${i(62.47,r)} ${i(40.611371992110456,a)}, ${i(62.47,r)} ${i(38.44891045364892,a)}, ${i(63.35027692307692,r)} ${i(36.58238737672584,a)}L${i(64.67424615384616,r)} ${i(33.774633530572,a)}L${i(62.263230769230766,r)} ${i(31.81958737672584,a)}C${i(60.66012307692307,r)} ${i(30.519525838264297,a)}, ${i(59.72190769230769,r)} ${i(28.57137199211045,a)}, ${i(59.70510769230769,r)} ${i(26.507556607495065,a)}L${i(59.67969230769231,r)} ${i(23.40354122287968,a)}L${i(56.65913846153846,r)} ${i(22.688076607495066,a)}C${i(54.6508923076923,r)} ${i(22.212399684418145,a)}, ${i(52.960338461538456,r)} ${i(20.864178145956608,a)}, ${i(52.049692307692304,r)} ${i(19.012128915187375,a)}L${i(50.68006153846154,r)} ${i(16.22649506903353,a)}L${i(47.6480923076923,r)} ${i(16.892464299802757,a)}C${i(45.632307692307684,r)} ${i(17.335251992110454,a)}, ${i(43.524338461538456,r)} ${i(16.85408276134122,a)}, ${i(41.90012307692308,r)} ${i(15.58053506903353,a)}L${i(39.45766153846154,r)} ${i(13.665055069033532,a)}Z`}function $o(t,e,n,o,r="top-left"){switch(o){case "leaf":return wu(t,e,n,r);case "leaf-reverse":return wu(t,e,n,r,true);case "drop":return Fh(t,e,n,r);case "octagon":return Su(t,e,n,1.6);case "bevel":return Su(t,e,n,1.1);case "squircle":return Nh(t,e,n);case "cushion":return Oh(t,e,n);case "shield":return Dh(t,e,n);case "petal":return Bh(t,e,n,r);case "porthole":return Uh(t,e,n);case "notch":return Hh(t,e,n);case "plus":return zh(t,e,n);case "bud":return qh(t,e,n,r);case "bowl":return Vh(t,e,n);case "gear":return Zh(t,e,n);case "rounded":return Xh(t,e,n);case "circle":return Yh(t,e,n);case "diya":return Kh(t,e,n);case "extra-rounded":return Jh(t,e,n);case "message":return tp(t,e,n);case "pointy":return ep(t,e,n);case "curly":return np(t,e,n);default:return jh(t,e,n)}}var So=.22,wo=.14;function Cu(t,e,n={}){if(t==="circle")return A("circle",{cx:x(e.x+e.w/2),cy:x(e.y+e.h/2),r:x(Math.min(e.w,e.h)/2),...n});let o=t==="rounded"?Math.min(e.w,e.h)*So:0;return A("rect",{height:x(e.h),width:x(e.w),x:x(e.x),y:x(e.y),...o>0&&{rx:x(o),ry:x(o)},...n})}function rp(t,e){let n=t.w*e,o=t.h*e;return {x:t.x+n,y:t.y+o,w:t.w-2*n,h:t.h-2*o}}function Co(t,e){let n=t.shape??"square",o=t.plate,r=o?rp(e,wo):e,a=s=>A("image",{height:x(r.h),href:t.src,preserveAspectRatio:"none",width:x(r.w),x:x(r.x),y:x(r.y),...s&&{clipPath:`url(#${s})`}});if(n==="square"&&!o)return a();let i=n==="square"?void 0:`qrdx-logo-${je(`${n}|${x(r.x)}|${x(r.y)}|${x(r.w)}|${x(r.h)}`)}`;return $t("g",{children:[o&&Cu(n,e,{fill:o}),i&&A("clipPath",{id:i,children:Cu(n,r)}),a(i)]})}var Mu=.6,op=["L","M","Q","H"];function Ru(t){let e=dt.QrCode.encodeText(t.value,St[t.level]),n=op[e.errorCorrectionLevel.ordinal]??t.level;return {code:t,cells:e.getModules(),layoutMargin:Et(e.size,t.margin,t.shape),map:lr(e.version,n),level:n,version:e.version}}function Eu(t,e){let{cells:n,map:o}=t,r=n.length,a=Re(n,t.code.size,t.layoutMargin,e);if(!a)return null;let i=a.excavation??{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.ceil(a.x+a.w)-Math.floor(a.x),h:Math.ceil(a.y+a.h)-Math.floor(a.y)},s=[];for(let c=Math.max(0,i.y);c<Math.min(r,i.y+i.h);c++)for(let u=Math.max(0,i.x);u<Math.min(r,i.x+i.w);u++)s.push(c*r+u);let l=cr(o,s);return {worst:Math.max(0,...l),correctable:o.correctable,budget:Math.floor(o.correctable*Mu),level:t.level,version:t.version}}function Mo(t,e){return Eu(Ru(t),e)}var Au=t=>!t||t.worst<=t.budget;function ap(t,e){return Au(Mo(t,e))}function qi(t,e,n,o){let r=e.map(s=>Ru({...t,level:s})),a=s=>{let l=o(s);return r.every(c=>Au(Eu(c,l)))};if(a(n))return n;let i=t.size*.005;for(let s=n-i;s>0;s-=i)if(a(s))return s;return 0}function Gn(t,e){if(!e)return;let n=Math.floor(t.size*Hr),o=e.width||n,r=e.height||n,a=f=>{if(f===o)return e;let d=r*f/o;return {...e,width:f,height:d,...e.x!=null&&{x:e.x+(o-f)/2},...e.y!=null&&{y:e.y+(r-d)/2}}},i=t.level??Jt,s={value:t.value,size:t.size,margin:t.margin,shape:t.shape},l=f=>At({...t,level:i,imageSettings:f}),c=f=>{let d=qi(s,[f],o,a);return d>0?a(d):void 0},u=l(e);if(u===i)return c(i);let m=c(u);return m&&l(m)===u?m:c(i)}var Pu={diamond:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"],banner:["square","rounded","diya","leaf"],square:["curly"],diya:["curly"],message:["curly"]},Iu={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},vu=["circle","curly"],Lu=["diamond","banner","star"],Tu={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},jt=["square","liquid","classy","classy-rounded"],ku={"circle/rounded":jt,"circle/extra-rounded":jt,"circle/message":[...jt,"leaf"],"circle/pointy":jt,"circle/leaf-reverse":jt,"circle/drop":jt,"circle/bevel":[...jt,"leaf"],"circle/squircle":[...jt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":jt,"circle/shield":[...jt,"rounded","horizontal-line","leaf"],"circle/petal":jt};function Fu(t,e,n){return (Tu[t]?.includes(e)??false)&&!ku[`${t}/${e}`]?.includes(n)}function Vi(t){let e=Gt(tr,t.bodyPattern??"circle"),n=Gt(Ne,t.cornerEyePattern??"gear"),o=Gt(Oe,t.cornerEyeDotPattern??"circle");return Pu[o]?.includes(n)?{kind:"dot-eye",message:`${o} centres in ${n} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Iu[e]?.includes(n)?{kind:"body-eye",message:`${e} dots next to ${n} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:Lu.includes(o)?{kind:"dot",message:`${o} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:vu.includes(n)?{kind:"eye",message:`${n} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Fu(o,n,e)?{kind:"sharp-dot-eye",message:`${o} centres in ${n} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var ji=t=>{let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},ip=t=>255*(t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055);function Du({r:t,g:e,b:n}){let o=ji(t),r=ji(e),a=ji(n),i=Math.cbrt(.4122214708*o+.5363325363*r+.0514459929*a),s=Math.cbrt(.2119034982*o+.6806995451*r+.1073969566*a),l=Math.cbrt(.0883024619*o+.2817188376*r+.6299787005*a),c=1.9779984951*i-2.428592205*s+.4505937099*l,u=.0259040371*i+.7827717662*s-.808675766*l;return {l:.2104542553*i+.793617785*s-.0040720468*l,c:Math.hypot(c,u),h:Math.atan2(u,c)}}function Xi({l:t,c:e,h:n}){let o=e*Math.cos(n),r=e*Math.sin(n),a=(t+.3963377774*o+.2158037573*r)**3,i=(t-.1055613458*o-.0638541728*r)**3,s=(t-.0894841775*o-1.291485548*r)**3;return [4.0767416621*a-3.3077115913*i+.2309699292*s,-1.2684380046*a+2.6097574011*i-.3413193965*s,-0.0041960863*a-.7034186147*i+1.707614701*s]}var Nu=1e-7,Ou=t=>t.every(e=>e>=-Nu&&e<=1+Nu),sp=20;function Ro(t){let e=Xi(t);if(!Ou(e)){let a=0,i=t.c;for(let s=0;s<sp;s++){let l=(a+i)/2;Ou(Xi({...t,c:l}))?a=l:i=l;}e=Xi({...t,c:a});}let[n=0,o=0,r=0]=e.map(a=>Math.round(ip(Math.min(1,Math.max(0,a)))));return {r:n,g:o,b:r,a:1}}var Gu="gear",lp="circle";function re(t,e){let n=t.eyeShapes?.[e];return {outer:Gt(Ne,n?.outer??t.cornerEyePattern??Gu),inner:Gt(Oe,n?.inner??t.cornerEyeDotPattern??lp)}}var cp=["curly","circle"];function Ji(t){let e=Be.map(n=>re(t,n));for(let n of cp)if(e.some(o=>o.outer===n))return n;return e[0]?.outer??Gu}var Bu=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function ts(t){let e=null,n=new Set;for(let o of Be){let{outer:r,inner:a}=re(t,o),i=`${r}/${a}`;if(n.has(i))continue;n.add(i);let s=Vi({bodyPattern:t.bodyPattern,cornerEyePattern:r,cornerEyeDotPattern:a});s&&(!e||Bu.indexOf(s.kind)<Bu.indexOf(e.kind))&&(e=s);}return e}function Un(t,e,n,o){if(!(t&&Number.isFinite(t))||t<=0||wr(o)||n<=0)return 0;let r=Math.min(qr,Na*n/(e+2*n));return Math.min(t,r)}function up(t){let{value:e,level:n,shape:o,autoLevel:r,isOGContext:a}=t,i=t.size??it,s=t.margin??pt,l=Gn({value:`${e}`,size:i,margin:s,level:n,shape:o,autoLevel:r,isOGContext:a},t.imageSettings),c=At({value:`${e}`,size:i,level:n,margin:s,imageSettings:l,isOGContext:a,autoLevel:r,shape:o}),u=dt.QrCode.encodeText(`${e}`,St[c]).size;return Un(qr,u,s,o)}var Ki=(t,e,n,o)=>Math.min(o,Math.max(n,typeof t=="number"&&Number.isFinite(t)?t:e)),mp=/^hsla?\(([^)]*)\)$/,dp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,fp=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function Yi(t,e){let n=t?.trim()??"";if(!fp.test(n))return Number.NaN;let o=Number.parseFloat(n),r=n.endsWith("%")||e?o/100:o;return Math.min(1,Math.max(0,r))}function hp(t){let e=mp.exec(t);if(!e)return null;let[n="",o]=(e[1]??"").split("/"),r=n.split(/[\s,]+/).filter(Boolean);if(r.length!==(o===void 0&&r.length===4?4:3))return null;let[a="",i,s,l]=r,c=Yi(i,true),u=Yi(s,true),m=Yi(o??l??"1",false),f=Number.parseFloat(a);if(!(dp.test(a)&&[c,u,m].every(Number.isFinite)))return null;let d=c*Math.min(u,1-u),g=h=>{let p=(h+f/30)%12,b=p<0?p+12:p;return 255*(u-d*Math.max(-1,Math.min(b-3,9-b,1)))};return {r:g(0),g:g(8),b:g(4),a:m}}function Io(t){let e=t?.trim().toLowerCase()??"";return e==="none"?{r:0,g:0,b:0,a:0}:at(e)??hp(e)}function Eo(t){return Io(t)?.a??1}function Qu(t){let e=Lt(t,ft);return e.type==="solid"?Eo(e.color)<1:e.type==="image"?Eo(e.underlay??"transparent")<1:e.stops.some(n=>Eo(n.color)<1)}var Qn=({r:t,g:e,b:n})=>[.2126*t+.7152*e+.0722*n,.299*t+.587*e+.114*n],Po=Qn(at(Ge)),nn=1e-9,Ao=(t,e,n)=>t.every((o,r)=>o>=e[r]-nn&&o<=n[r]+nn),es=({r:t,g:e,b:n})=>`#${[t,e,n].map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`;function Uu(t){let e=Io(t.color||Vr);return e&&e.a>0?es(e):Vr}var pp=24,gp=12;function Hu(t,e,n){if(Ao(Qn(t),e,n))return t;if(t.r===t.g&&t.g===t.b){let c=Math.min(Math.floor(Math.min(...n)+nn),Math.max(t.r,Math.ceil(Math.max(...e)-nn)));return c>=Math.max(...e)-nn?{r:c,g:c,b:c,a:1}:null}let o=Du(t),r=c=>{let u=Ro({l:o.l,c,h:o.h}),m=Qn(u);if(Ao(m,e,n))return u;let f=m.some((b,_)=>b<e[_]),d=b=>Qn(b).every((_,y)=>f?_>=e[y]-nn:_<=n[y]+nn),g=o.l,h=f?1:0;for(let b=0;b<pp;b++){let _=(g+h)/2;d(Ro({l:_,c,h:o.h}))?h=_:g=_;}let p=Ro({l:h,c,h:o.h});return Ao(Qn(p),e,n)?p:null},a=r(o.c);if(a)return a;let i=r(0);if(!i)return null;let s=0,l=o.c;for(let c=0;c<gp;c++){let u=(s+l)/2,m=r(u);m?(s=u,i=m):l=u;}return i}var Zi="or turn the halo off";function zu(t){let e=Lt(t,ft);if(e.type==="image")return {reason:"picture",message:"A halo isn't drawn on a picture background: on the picture's darker parts the rim makes the code unreadable",fix:`Use a background color, ${Zi}`};if(Qu(t))return {reason:"see-through",message:"A halo needs an opaque background: on a grey surface under a see-through code the rim makes it unreadable",fix:`Give the code an opaque background, ${Zi}`};let n=(e.type==="solid"?[e.color]:e.stops.map(r=>r.color)).map(Io),o=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r of n){let a=r?Qn(r):[0,0];o[0]=Math.min(o[0],a[0]),o[1]=Math.min(o[1],a[1]);}return Ao(Po,Po,o)?o:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${Ge}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${Ge} or lighter, ${Zi}`}}function ns(t,e){let n=zu(e);if(!Array.isArray(n))return n;let o=Uu(t),r=Hu(at(o),Po,n);return {drawn:r?es(r):Ge,picked:o}}function bp(t,e){let n=ns({color:t},e);return "drawn"in n?n.drawn:null}function _p(t,e,n=4){let o=zu(e),r=Io(t);if(!(Array.isArray(o)&&r))return [];let a=new Set;for(let i=0;i<n;i++){let s=i/n,l=Po.map((u,m)=>u+s*((o[m]??u)-u)),c=Hu({...r,a:1},l,o);c&&a.add(es(c));}return [...a]}function rs(t){if(!t.halo)return null;let e=ns(t.halo,t.bgColor);return "drawn"in e?e.drawn===e.picked?null:{reason:"adjusted",color:e.drawn,message:`Halo drawn as ${e.drawn} instead of ${e.picked} so the code still scans: a rim must read no lighter than the background and at least as light as ${Ge}`,fix:`To have it drawn as picked, choose a color in that range, such as ${e.drawn}`}:e}function Cr(t,e){if(!t)return null;let n=e?ns(t,e.bgColor):null;if(n&&!("drawn"in n))return null;let o=Ki(t.width,Ba,Oa,Da);return {color:n?n.drawn:Uu(t),width:o}}function os(t){if(!t)return null;let e=r=>Ki(r,Ga,-jr,jr),n=e(t.dx),o=e(t.dy);return n===0&&o===0?null:{color:t.color||za,opacity:Ki(t.opacity,Ha,Qa,Ua),dx:n,dy:o}}var as="data-qrdx-part",Wu="data-qrdx-eye",yp=["eye-outer","eye-centre","body","logo","background"];function is(t,e,n){if(t)return n?{[as]:e,[Wu]:n}:{[as]:e}}var Mr=300;function oe(t){return {id:t.id,name:t.name,description:t.description,spec:t.spec,wrapper:(e,n)=>{let o=Ke(t.spec),r=n?.fgColor,a=(typeof r=="string"?r:bt(r,""))||"black",i=xr(o.qr.size,o,{color:a}),{x:s,y:l,scale:c}=t.at;return A("svg",{height:Mr,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Mr} ${Mr}`,width:Mr,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:$t("g",{"data-qrdx-template":t.id,transform:`translate(${x(s)} ${x(l)})${c===1?"":` scale(${c})`}`,children:[lu(i),A("g",{fill:"none",transform:`translate(${x(i.qrX)} ${x(i.qrY)}) scale(${i.qrSize/Mr})`,children:e})]})})}}}var qu={kind:"qrdx.frame",version:1,artboard:{width:185,height:178},qr:{x:35,y:0,size:150,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",fill:"frame"}],labels:[]};var Vu=oe({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:qu,at:{x:47,y:95,scale:1}});var ju={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:t=>A("svg",{height:"300",id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:"0 0 300 300",width:"300",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:A("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:t})})};var Er=593,Ee=296.5,Rr=146.5,t0=294.5,e0=231.228,n0="M296.5 0C460.252 -7.15782e-06 593 132.748 593 296.5C593 460.252 460.253 593 296.5 593C132.748 593 7.15782e-06 460.252 0 296.5C-7.15788e-06 132.748 132.748 7.15788e-06 296.5 0ZM296.5 527.728C424.204 527.728 527.728 424.204 527.728 296.5C527.728 168.796 424.204 65.2713 296.5 65.2713C168.796 65.2713 65.2714 168.796 65.2714 296.5C65.2714 424.204 168.796 527.728 296.5 527.728Z",$p="iaa2 1z3g 1z0y 1z18 1z18 1we8 2mq 1uta 47y 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rxe 73u 1rx4 73u 1rzm 71m 1rzm 71m 1rzc 73u okq 13ce 744 1rx4 744 1rwu 744 1rx4 744 1rx4 73u 1rx4 744 1rx4 73u 1rx4 73u 1rx4 744 1rx4 73u 1rxe 73u 1rx4 73u 1rx4 744 1rzm 71c 1rzm 73u 1rxe 73u 1rx4 744 1rx4 73u 1rx4 73u 1rxe 73u 1rx4 618 12m 1rxe 73u 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z18",Sp="hqpr 5 1z36 1z0y 1z18 1z18 1z0y 1z0y 1a7w otc 1z0y 1z18 1z0y 1z18 1z0y 1z1i 1z0o 1z18 1z0y 1z3q 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1z18 1z0y 1lk8 dgq 1z18 1z18 1z3g 1z0y 1z0y 1z18 1z18 1z0y 1z0y 1z18 1yx2 3w 1z18 60o 1t0a 1z18 1z0y 1z18 1z0y",Xu="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Yu=52,wp=240;function Zu(t){let e=0;return t.split(" ").map(n=>(e+=Number.parseInt(n,36),e/1e4))}var ss;function Cp(){if(!ss){let t=Zu($p),e=Zu(Sp),n=[];for(let o=0;o<Xu.length;o+=3){let r=Number.parseInt(Xu.slice(o,o+3),36);n.push({cx:t[Math.floor(r/Yu)],cy:e[r%Yu]});}ss=n;}return ss}function Mp(t){let e=0;for(let n=0;n<t.length;n++)e=e*32-e+t.charCodeAt(n),e%=2147483647;return Math.abs(e)}function r0(t){let e=Cp(),n=Mp(t),o=()=>(n=(n*9301+49297)%233280,n/233280),r=e.map((a,i)=>i);for(let a=r.length-1;a>0;a--){let i=Math.floor(o()*(a+1));[r[a],r[i]]=[r[i],r[a]];}return r.slice(0,wp).sort((a,i)=>a-i).map(a=>e[a])}var Ku=300,Rp=49,Ep=6;function o0(t,e){if(Ku/e<=Rp+.5)return t;let n=Rr,o=Rr+Ku,r=Ep*e+e/2;return t.filter(({cx:a,cy:i})=>Math.max(n-a,a-o,n-i,i-o)>=r)}var a0="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",Ar=32,i0=3.5,Ap=Ar*er,s0=246.5,fe=2*Math.PI*s0,us=.36,Ju=s0+us*Ar,ls=400;function Hn(t,e){return t===" "||/[il1|!']/.test(t)?e*.3:/[mwMW@%&]/.test(t)?e*.8:e*.6}function Pp(t){let e=t.slice(0,ls).split(" ").map(n=>Rn(n,ls)).join(" ");return Array.from(e).slice(0,ls)}var Ip="\u2026",l0=1;function c0(t,e,n,o=false){return o&&e===t.length-1?l0*n:Hn(t[e],n)}function ms(t,e,n=false){let o=0;for(let r=0;r<t.length;r++)o+=c0(t,r,e,n);return o}function cs(t,e,n,o=false){return ms(t,e,o)+n*Math.max(0,t.length-1)+Hn(" ",e)+2*n<=fe}var u0=t=>t.join("").split(" ").filter(Boolean),vp=(t,e)=>Array.from(Array.from({length:e},()=>t.join(" ")).join(" "));function m0(t,e,n){if(cs(t,e,n))return {chars:t,fontSize:e,letterSpacing:n};let o=Math.min(n,0),r=Math.min(e,Ap),a=(h,p=false)=>{let b=ms(h,e,p)+Hn(" ",e),_=h.length+1,y=(fe-b)/_;if(y>=o)return {chars:h,fontSize:e,letterSpacing:y,cut:p};let w=(fe-o*_)/b*e;return w>=r?{chars:h,fontSize:w,letterSpacing:o,cut:p}:null},i=a(t);if(i)return i;let s=u0(t),l=d0(s);for(let h=s.length/l.length-1;h>=1;h--){let p=vp(l,h);if(cs(p,r,o))return a(p)??{chars:p,fontSize:r,letterSpacing:o}}let c=fe-Hn(" ",r)-l0*r-2*o,u=0,m=0,f=0;for(let[h,p]of t.entries()){if(u+=Hn(p,r)+o,u>c)break;f=h+1,(f===t.length||t[f]===" ")&&(m=f);}let d=[...Lp(t.slice(0,m>0?m:f)),Ip];return (cs(d,e,n,true)?{chars:d,fontSize:e,letterSpacing:n,cut:true}:null)??a(d,true)??{chars:d,fontSize:r,letterSpacing:o,cut:true}}function Lp(t){let e=t.length;for(;e>0&&/[\s.,;:!?*·•\-–—]/u.test(t[e-1]);)e--;return t.slice(0,e)}function d0(t){for(let e=1;e<t.length;e++)if(t.length%e===0&&t.every((n,o)=>n===t[o%e]))return t.slice(0,e);return t}function Tp(t,e,n){let o=u0(t);if(o.length===0)return {chars:[],fontSize:e,letterSpacing:n};let r=Array.from(d0(o).join(" ")),a=ms(r,e)+Hn(" ",e),i=a+(r.length+1)*n,s=Math.min(n,0),l=null;for(let c of new Set([Math.floor(fe/i),Math.ceil(fe/i)])){if(c<1)continue;let u=(fe-c*a)/(c*(r.length+1));if(u>=s&&(!l||Math.abs(u-n)<Math.abs(l.letterSpacing-n))){let m=Array.from({length:c},()=>r.join(""));l={chars:Array.from(m.join(" ")),fontSize:e,letterSpacing:u};}}return l??m0(r,e,n)}function f0(t,e){let{position:n,rotation:o}=e,r=Pp(t),a=e.fill==="repeat"?Tp(r,e.fontSize,e.letterSpacing):m0(r,e.fontSize,e.letterSpacing),{fontSize:i,letterSpacing:s}=a,l=[],c=0;for(let[h,p]of a.chars.entries()){let b=c0(a.chars,h,i,a.cut);l.push({char:p,along:c+b/2}),c+=b+s;}let u=c-(l.length>0?s:0),m=n!=="bottom",f=m?Ju-us*i:Ju+us*i,d=u/fe*180,g=[];for(let{char:h,along:p}of l){if(h.trim()==="")continue;let b=p/fe*360,_=m?o-d+b:o+180+d-b,y=_*Math.PI/180;g.push({char:h,x:J(Ee+f*Math.sin(y)),y:J(Ee-f*Math.cos(y)),rotate:J(m?_:_-180)});}return {text:a.chars.join(""),letters:g,fontSize:i===e.fontSize?i:J(i),letterSpacing:s}}var zn=(t,e)=>typeof t=="number"&&Number.isFinite(t)?t:e,h0={id:"DotRing",name:"Dot Ring",description:"A round code in a ring of dots of its own for every link, with text along the ring",wrapper:(t,e,n)=>{let o=bt(e?.fgColor,"#000000"),r=bt(e?.bgColor,"#ffffff"),a=n?.pixelSize??9,i=J(a/2),s=o0(r0(n?.url??""),a),l=zn(e?.fontSize,Ar),c=l>0?l:Ar,u=typeof e?.customText=="string"?e.customText:a0,m=f0(u,{fontSize:c,letterSpacing:zn(e?.fontLetterSpacing,i0),position:e?.textPosition==="bottom"?"bottom":"top",rotation:zn(e?.textRotation,0),fill:e?.textFill==="repeat"?"repeat":"none"}),f=e?.textColor||"#ffffff",d=e?.fontFamily||_o,g=e?.fontWeight??900,h=zn(e?.strokeWidth,0),p=e?.strokeColor||"#000000",b=[{radius:Ee,width:zn(e?.outerStrokeWidth,h),color:e?.outerStrokeColor||p},{radius:e0,width:zn(e?.innerStrokeWidth,h),color:e?.innerStrokeColor||p}].filter(_=>_.width>0);return $t("svg",{height:Er,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Er} ${Er}`,width:Er,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A("circle",{cx:Ee,cy:Ee,fill:r,r:t0}),A("g",{fill:o,children:s.map((_,y)=>A("circle",{cx:_.cx,cy:_.cy,r:i},y))}),A("path",{d:n0,fill:e?.outerCircleColor||o}),b.map((_,y)=>A("circle",{cx:Ee,cy:Ee,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},y)),A("g",{"aria-hidden":"true",children:m.letters.map((_,y)=>A("text",{fill:f,fontFamily:d,fontSize:m.fontSize,fontWeight:g,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},y))}),A("g",{transform:`translate(${Rr} ${Rr})`,children:t})]})}};var p0={kind:"qrdx.frame",version:1,artboard:{width:220,height:277},qr:{x:52,y:122,size:114,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"circle",cx:110,cy:167.682,r:99.318,fill:"#FFFFFF",stroke:{color:"#F89941",width:20}},{type:"ellipse",cx:139.989,cy:67.895,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:126.072,cy:69.487,rx:34.051,ry:50.662,fill:"#F89941"},{type:"path",d:"M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:106.316,cy:70.849,rx:33.673,ry:47.851,fill:"#F89941"},{type:"ellipse",cx:78.743,cy:68.448,rx:35.445,ry:48.442,fill:"#F89941"},{type:"path",d:"M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:91.744,cy:69.763,rx:32.944,ry:50.385,fill:"#F89941"},{type:"path",d:"M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",fill:"#F89941",stroke:{color:"#E78249",width:5}},{type:"ellipse",cx:111.677,cy:70.871,rx:32.39,ry:47.616,fill:"#F89941"},{type:"ellipse",cx:106.971,cy:71.425,rx:33.221,ry:47.616,fill:"#F89941"},{type:"path",d:"M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",fill:"#000000"},{type:"path",d:"M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",fill:"#000000"},{type:"path",d:"M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",fill:"#000000"},{type:"path",d:"M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",fill:"#5D725F"}],labels:[]};var g0=oe({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:p0,at:{x:38,y:10,scale:1}});var b0={kind:"qrdx.frame",version:1,artboard:{width:316,height:316},qr:{x:20,y:20,size:276,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M308 8H8v300h300V8ZM0 0v316h316V0H0Z",fill:"frame",fillRule:"evenodd"}],labels:[]};var _0=oe({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:b0,at:{x:0,y:0,scale:300/316}});var y0={kind:"qrdx.frame",version:1,artboard:{width:208,height:298},qr:{x:14,y:14,size:180,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",fill:"frame"},{type:"path",d:"M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.67l-20.55 -20.55a2.33 2.33 0 0 0 -3.25 0l-20.55 20.55a2.29 2.29 0 0 1 -1.62 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",fill:"frame"}],labels:[]};var x0=oe({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:y0,at:{x:46,y:1,scale:1}});var $0={kind:"qrdx.frame",version:1,artboard:{width:252,height:300},qr:{x:40,y:38,size:174,padding:0,plate:"none"},colors:{frame:"#000000"},shapes:[{type:"path",d:"M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",fill:"#22071b"},{type:"path",d:"M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",fill:"#22071b"},{type:"path",d:"M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",fill:"#22071b"},{type:"path",d:"M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",fill:"#22071b"},{type:"path",d:"M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",fill:"#22071b"},{type:"path",d:"M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.18 -2.12a2.14 2.14 0 1 1 2.41 3.53l-5.52 3.67V76.9l-7 4.66a2.15 2.15 0 0 0 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.57 3l-6.36 4.24V275a10.09 10.09 0 0 0 9.83 10.11l-5.87 4a2.15 2.15 0 0 0 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.36l23 -15.41a2.14 2.14 0 0 1 2.41 3.54l-6.58 4.45h52l-5.58 3.75a2.14 2.14 0 0 0 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 277.35a2.14 2.14 0 1 1 2.33 3.6l-6.78 4.38h13a10.18 10.18 0 0 0 10.18 -10.18v-91.1l-4.38 3a2.43 2.43 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l24.38 -16.33a2.13 2.13 0 1 0 -2.4 -3.53l-15.48 10.25V91.53l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.71 -9.19a2.14 2.14 0 0 0 -2.4 -3.54l-11.24 7.57V75.84l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",fill:"#22071b"},{type:"path",d:"M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",fill:"#22071b"}],labels:[]};var S0=oe({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:$0,at:{x:24,y:0,scale:1}});var Pr={default:ju,Arrow:Vu,StandardBox:x0,SquareBorder:_0,StrikedBox:S0,Halloween:g0,DotRing:h0},w0={FlamQR:"DotRing"},vo=t=>{if(Object.hasOwn(Pr,t))return Pr[t];let e=Object.hasOwn(w0,t)?w0[t]:void 0;return e?Pr[e]:void 0},f3=()=>Object.values(Pr),h3=()=>Object.keys(Pr);var ds=t=>Math.round(Math.min(Math.max(t,0),255)).toString(16).padStart(2,"0");function E0(t){return `#${ds(t.r)}${ds(t.g)}${ds(t.b)}`}function Wn(t){let e=at(t);return !e||e.a>=1||e.a<=0?{color:t}:{color:E0(e),opacity:J(e.a,3)}}function Lo(t,e){let n=Math.min(Math.max(t.a,0),1);return {r:t.r*n+e.r*(1-n),g:t.g*n+e.g*(1-n),b:t.b*n+e.b*(1-n),a:1}}var A0={r:0,g:0,b:0,a:1};function Dp(t){return [...t].map(e=>({offset:Math.min(Math.max(e.offset/100,0),1),color:at(e.color)??A0})).sort((e,n)=>e.offset-n.offset)}function fs(t,e){let n=t[0],o=t.at(-1);if(!(n&&o))return A0;if(e<=n.offset)return n.color;if(e>=o.offset)return o.color;for(let r=0;r+1<t.length;r++){let a=t[r],i=t[r+1];if(e>=a.offset&&e<=i.offset){let s=i.offset-a.offset,l=s>0?(e-a.offset)/s:1,c=a.color.a+(i.color.a-a.color.a)*l,u=(m,f)=>{let d=m*a.color.a+(f*i.color.a-m*a.color.a)*l;return c>0?d/c:m+(f-m)*l};return {r:u(a.color.r,i.color.r),g:u(a.color.g,i.color.g),b:u(a.color.b,i.color.b),a:c}}}return o.color}var C0=4,M0=720,Bp=2;function P0(t,e,n,o,r){let a=Dp(t);if(a.length===0)return {wedges:[]};let i=a[0].color.a,s=a.every(_=>Math.abs(_.color.a-i)<.002),l=[...new Set([0,...a.map(_=>_.offset),1])].sort((_,y)=>_-y),c=[];for(let _=0;_+1<l.length;_++){let y=l[_],w=l[_+1];if(w<=y)continue;let C=fs(a,y+1e-9),S=fs(a,w-1e-9),$=Math.max(Math.abs(C.r*C.a-S.r*S.a),Math.abs(C.g*C.a-S.g*S.a),Math.abs(C.b*C.a-S.b*S.a),Math.abs(C.a-S.a)*255),M=Math.ceil($/Bp),R=Math.ceil((w-y)*360/C0),E=Math.max(1,M,R);for(let P=0;P<E;P++)c.push([y+(w-y)*P/E,y+(w-y)*(P+1)/E]);}let u=c;if(c.length>M0){let _=Math.ceil(c.length/M0);u=[];for(let y=0;y<c.length;y+=_){let w=c.slice(y,y+_);u.push([w[0][0],w.at(-1)[1]]);}}let m=e-90,f=r/Math.cos(2*C0/2*(Math.PI/180)),d=_=>{let y=_*Math.PI/180;return [x(n+f*Math.cos(y)),x(o+f*Math.sin(y))]},g=`${x(n)} ${x(o)}`,h=_=>J((_%360+360)%360,4),p=u.length-1,b=u.map(([_,y],w)=>{let C=fs(a,(_+y)/2),S=(y-_)*360,$=s&&w===0&&p>0?S:0,M=s&&w<p?S:0,R=m+_*360-$,E=m+y*360+M,[P,v]=d(R),[L,F]=d(E);return {d:`M${g}L${P} ${v}L${L} ${F}Z`,color:E0(C),...s||C.a>=1?{}:{opacity:J(C.a,3)},from:h(R),sweep:J(E-R,4)}});return s&&i<1?{wedges:b,opacity:J(i,3)}:{wedges:b}}function R0(t,e,n,o){return (Math.atan2(o-e,n-t)*180/Math.PI%360+360)%360}function I0(t,e,n){if(t>=n.x-1e-6&&t<=n.x+n.width+1e-6&&e>=n.y-1e-6&&e<=n.y+n.height+1e-6)return null;let r=[[n.x,n.y],[n.x+n.width,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height]],a=R0(t,e,n.x+n.width/2,n.y+n.height/2),i=0,s=0;for(let[l,c]of r){let u=R0(t,e,l,c)-a;u>180?u-=360:u<=-180&&(u+=360),i=Math.min(i,u),s=Math.max(s,u);}return [a+i,a+s]}function v0(t,e){let n=t[1]-t[0],o=e[1]-e[0];if(n>=360||o>=360)return true;let r=((e[0]-t[0])%360+360)%360;return r<=n||r+o>=360}function ps(t,e){return t.slice().map((n,o)=>o<e.y||o>=e.y+e.h?n:n.map((r,a)=>a<e.x||a>=e.x+e.w?r:false))}function k0(t,e=0){let n=[];return t.forEach((o,r)=>{let a=null;o.forEach((i,s)=>{if(!i&&a!==null){n.push(I`M${a+e} ${r+e}h${s-a}v1H${a+e}z`),a=null;return}if(s===o.length-1){if(!i)return;a===null?n.push(I`M${s+e},${r+e} h1v1H${s+e}z`):n.push(I`M${a+e},${r+e} h${s+1-a}v1H${a+e}z`);return}i&&a===null&&(a=s);});}),n.join("")}function Gp(t,e,n){return t<7&&e<7||t>=n-7&&e<7||t<7&&e>=n-7}var Qp=.9;function hs(t,e){let{margin:n,pixelSize:o,pattern:r="circle",plain:a=false}=e;if(yc(r))return $c(t,{margin:n,pixelSize:o,pattern:r,scale:e.scale,plain:a});let i=io(e.scale,r),s=[],l=t.length,c=o*.45,u=a?()=>false:Ci(l);return t.forEach((m,f)=>{m.forEach((d,g)=>{if(d&&(a||!Gp(g,f,l))){let h=(g+.5+n)*o,p=(f+.5+n)*o,b=`${g}-${f}`,_=s.length;if(u(g,f)){s.push(A("rect",{height:x(o),width:x(o),x:x(h-o/2),y:x(p-o/2)},b));return}switch(r){case "circle":s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:I`rotate(0,${h},${p})`},b));break;case "circle-large":{let y=o*.5;s.push(A("circle",{cx:x(h),cy:x(p),r:x(y),transform:I`rotate(0,${h},${p})`},b));}break;case "small-square":{let y=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:I`rotate(0,${h},${p})`},b));}break;case "diamond":{let y=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-y}v ${o*.714286}h ${o*.714286}v -${o*.714286}z`,transform:I`rotate(45,${h},${p})`},b));}break;case "circle-mixed":{let y=(g+f)%3===0?Qp:(g+f)%2===0?1:1.25,w=c*y;s.push(A("circle",{cx:x(h),cy:x(p),r:x(w),transform:I`rotate(0,${h},${p})`},b));}break;case "pacman":{let y=o*.5,w=o*.357143;s.push(A("path",{d:I`M ${h-y} ${p-w}v ${o*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${o*.714286}h -${y}v -${o*.714286}z`,transform:I`rotate(${(g+f)%2===0?0:90},${h},${p})`},b));}break;case "rounded":{let y=o*.5,w=o*.2;s.push(A("rect",{height:x(o),rx:x(w),ry:x(w),transform:I`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "square":{let y=o*.5;s.push(A("rect",{height:x(o),transform:I`rotate(0,${h},${p})`,width:x(o),x:x(h-y),y:x(p-y)},b));}break;case "vertical-line":{let y=o*.714286,w=o;s.push(A("path",{d:I`M ${h-o*.5} ${p-y*.5}v ${y}h ${w}v -${y}z`,transform:I`rotate(90,${h},${p})`},b));}break;default:s.push(A("circle",{cx:x(h),cy:x(p),r:x(c),transform:I`rotate(0,${h},${p})`},b));}if(i!==1&&s.length>_){let y=s.pop();s.push(A("g",{transform:I`translate(${h},${p}) scale(${x(i,6)}) translate(${-h},${-p})`,children:y},b));}}});}),s}function Up(t,e){let n=t*Math.PI/180,o=e/2,r=e/2,a=Math.sqrt(e*e+e*e)/2,i=o-a*Math.cos(n),s=r-a*Math.sin(n),l=o+a*Math.cos(n),c=r+a*Math.sin(n);return {x1:i,y1:s,x2:l,y2:c}}function gs(t,e){return `${t}-${je(JSON.stringify(e))}`}function Hp(t,e,n,o,r){let a=t;if(t===0)switch(r){case "top-left":a=0;break;case "top-right":a=90;break;case "bottom-left":a=270;break;default:a=0;}let i=a*Math.PI/180,s=e+o/2,l=n+o/2,c=Math.sqrt(o*o+o*o)/2,u=s-c*Math.cos(i),m=l-c*Math.sin(i),f=s+c*Math.cos(i),d=l+c*Math.sin(i);return {x1:u,y1:m,x2:f,y2:d}}function Fo(t,e){return e.map((n,o)=>{let{color:r,opacity:a}=Wn(n.color);return A("stop",{offset:`${n.offset}%`,stopColor:r,stopOpacity:a},`${t}-stop-${o}`)})}function F0(t,e,n,o,r,a){let i=P0(e.stops,e.angle??0,n,o,r),s=i.wedges.map((l,c)=>A("path",{d:l.d,"data-arc":`${l.from} ${l.sweep}`,fill:l.color,fillOpacity:l.opacity,shapeRendering:l.opacity===void 0?void 0:"crispEdges"},`${t}-w-${c}`));return A("pattern",{"data-qrdx-conic":`${x(n)} ${x(o)}`,height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:i.opacity===void 0?s:A("g",{opacity:i.opacity,children:s})},t)}function zp(t="center"){let[e,n]=t.split("-"),o=t==="center"?"center":e,r=n??(e==="left"||e==="right"?e:"center");return {x:r==="left"?0:r==="right"?1:.5,y:o==="top"?0:o==="bottom"?1:.5}}var Wp=["xMin","xMid","xMax"],qp=["YMin","YMid","YMax"];function N0(t,e,n){let o=e.scale??1,r=e.fit==="tile",a=r?n/4*o:n,i=e.underlay?Wn(e.underlay):null,s=r?a:n*o,l=zp(e.position),c=r?0:l.x*(n-s),u=r?0:l.y*(n-s),m=r?"xMidYMid slice":`${Wp[l.x*2]??"xMid"}${qp[l.y*2]??"YMid"} ${e.fit==="contain"?"meet":"slice"}`;return $t("pattern",{height:x(a),id:t,patternUnits:"userSpaceOnUse",width:x(a),x:0,y:0,children:[i&&A("rect",{fill:i.color,fillOpacity:i.opacity,height:x(a),width:x(a),x:0,y:0}),A("image",{height:x(s),href:e.src,opacity:(e.opacity??1)<1?e.opacity:void 0,preserveAspectRatio:m,width:x(s),x:x(c),y:x(u)})]},t)}var O0=(t,e)=>gs("img",[t,e]);function Vp(t,e,n,o,r,a,i){let s=Lt(t);if(s.type==="solid")return null;if(s.type==="image"){let c=O0(s,i);return {id:c,element:N0(c,s,i)}}let l=gs(a,[s,e,n,o,r,...s.type==="angular"?[i]:[]]);if(s.type==="linear"){let c=s,u=c.angle??0,{x1:m,y1:f,x2:d,y2:g}=Hp(u,e,n,o,r);return {id:l,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:l,x1:x(m),x2:x(d),y1:x(f),y2:x(g),children:Fo(l,c.stops)},l)}}if(s.type==="radial"){let c=s,u=e+o/2,m=n+o/2,f=o/2*.97;return {id:l,element:A("radialGradient",{cx:x(u),cy:x(m),fx:x(u),fy:x(m),gradientUnits:"userSpaceOnUse",id:l,r:x(f),children:Fo(l,c.stops)},l)}}return s.type==="angular"?{id:l,element:F0(l,s,e+o/2,n+o/2,o*.75,i)}:null}function To(t,e,n){let o=Lt(t);if(o.type==="solid")return null;if(o.type==="image"){let a=O0(o,e);return {id:a,element:N0(a,o,e)}}let r=gs(n,[o,e]);if(o.type==="linear"){let a=o,i=a.angle??0,{x1:s,y1:l,x2:c,y2:u}=Up(i,e);return {id:r,element:A("linearGradient",{gradientUnits:"userSpaceOnUse",id:r,x1:x(s),x2:x(c),y1:x(l),y2:x(u),children:Fo(r,a.stops)},r)}}if(o.type==="radial"){let a=o,i=e/2,s=e/2,l=e/2*.97;return {id:r,element:A("radialGradient",{cx:x(i),cy:x(s),fx:x(i),fy:x(s),gradientUnits:"userSpaceOnUse",id:r,r:x(l),children:Fo(r,a.stops)},r)}}return o.type==="angular"?{id:r,element:F0(r,o,e/2,e/2,e*.75,e)}:null}var ko=t=>Fe(t)||Ea(t);function L0(t){let e=new Set,n=[];for(let o of t)o&&!e.has(o.id)&&(e.add(o.id),n.push(o.element));return n}function he(t,e,n){if(e)return {fill:`url(#${e})`};let o=Lt(t,n),r=o.type==="solid"?o.color:o.type==="image"?o.underlay??n:n,{color:a,opacity:i}=Wn(r);return i===void 0?{fill:a}:{fill:a,fillOpacity:i}}function Re(t,e,n,o){if(o==null)return null;let r=t.length,a=Math.floor(e*Hr),i=(r+2*n)/e,s=(o.width||a)*i,l=(o.height||a)*i,c=o.x==null?r/2-s/2:o.x*i,u=o.y==null?r/2-l/2:o.y*i,m=null;if(o.excavate){let f=Math.max(0,o.padding??0)*i,d=Math.floor(c-f),g=Math.floor(u-f),h=Math.ceil(s+c+f-d),p=Math.ceil(l+u+f-g);m={x:d,y:g,w:h,h:p};}return {x:c,y:u,h:l,w:s,excavation:m}}function At(t){let e=t.level??Jt,{imageSettings:n}=t,o=t.isOGContext&&n?.excavate&&(e==="L"||e==="M")?"Q":e;if(t.autoLevel&&n&&o!=="H"){let r=dt.QrCode.encodeText(t.value,St[o]).getModules(),a=Re(r,t.size??it,Et(r.length,t.margin??pt,t.shape),n);a&&(a.excavation?a.excavation.w*a.excavation.h:a.w*a.h)/(r.length*r.length)>Ta&&(o="H");}return o}function jp(t,e,n,o){let r=e/n,a=t.w*r,i=t.h*r,s=(t.x+o)*r,l=(t.y+o)*r;return {imgWidth:a,imgHeight:i,imgLeft:s,imgTop:l}}function bs(t){let{value:e,size:n=it,level:o=Jt,bgColor:r=ft,fgColor:a=Rt,eyeColor:i,dotColor:s,bodyPattern:l="circle",cornerEyePattern:c="gear",cornerEyeDotPattern:u="circle",margin:m=pt,isOGContext:f=false,imageSettings:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,autoLevel:C,shape:S,eyeShapes:$,eyeGradient:M,bgRadius:R,backdrop:E,halo:P,shadow:v,frameLabelMarkers:L,partMarkers:F,...k}=t,T=Gt(tr,l),z=Gt(Ne,c),W=Gt(Oe,u),D=Gn({value:e,size:n,margin:m,level:o,shape:S,autoLevel:C,isOGContext:f},d),U=Nt(b),X=U?{}:k,xt=H=>U?$r(H,{size:n,frame:b,bgColor:r,svgProps:k,markLabels:L}):H,lt=At({value:e,size:n,level:o,margin:m,imageSettings:D,isOGContext:f,autoLevel:C,shape:S}),N=dt.QrCode.encodeText(e,St[lt]),B=N.getModules(),Z=Et(B.length,m,S),Pt=$u(e,B.length,m,S),ct=(H,vt)=>is(F,H,vt),Zt=Un(R,B.length,Z,S),ae=(H,vt)=>{let Kt=Hi(S,H);if(!Kt){if(Zt>0){let ie=x(Zt*H),qt=E?Wn(E):null;return $t(Ut,{children:[qt&&A("rect",{"data-qrdx-look":"backdrop",fill:qt.color,fillOpacity:qt.opacity,height:H,width:H,x:0,y:0}),A("rect",{...vt,height:H,rx:ie,ry:ie,width:H,x:0,y:0,...ct("background")})]})}return A("rect",{...vt,height:H,width:H,x:0,y:0,...ct("background")})}return "circle"in Kt?A("circle",{cx:x(H/2),cy:x(H/2),...vt,r:x(H/2),...ct("background")}):A("path",{d:Kt.path,...vt,...ct("background")})},Te=B.length+Z*2,G=Re(B,n,Z,D),K=null;if(D!=null&&G!=null){G.excavation!=null&&(B=ps(B,G.excavation));let{imgWidth:H,imgHeight:vt,imgLeft:Kt,imgTop:ie}=jp(G,n,Te,Z);if(f){let qt=D.shape??"square";K=A("img",{alt:"Logo",src:D.src,style:{position:"absolute",left:`${x(Kt)}px`,top:`${x(ie)}px`,width:`${x(H)}px`,height:`${x(vt)}px`,...qt!=="square"&&{borderRadius:qt==="circle"?"50%":`${x(Math.min(H,vt)*So)}px`},...D.plate&&{backgroundColor:D.plate,padding:`${x(H*wo)}px`,boxSizing:"border-box"}}});}else K=Co(D,{x:Kt,y:ie,w:H,h:vt}),F&&(K=He(K,ct("logo")));}let Q=n/Te,gt=B.length,ut=7*Q,la=1.5*Q,ml={fgColor:bt(a,Rt),bgColor:bt(r,ft)},ln=ui(_)?hi({art:_,modules:B,version:N.version,margin:Z,pixelSize:Q,...ml,body:H=>hs(H,{margin:Z,pixelSize:Q,pattern:T,scale:w})}):null,dl=ln&&F?He(ln,ct("body")):ln,fl=ln&&_?bi({art:_,version:N.version,...ml}):null,hl=ln?null:hs(B,{margin:Z,pixelSize:Q,pattern:T,scale:w}),Qr=Pt?hs(Pt,{margin:0,pixelSize:Q,pattern:T,scale:w,plain:true}):null,Ur=Lt(r,ft),ca=Lt(a,Rt),pl=ko(Ur)?To(Ur,n,"bg-color"):null,ua=ko(ca)?To(ca,n,"fg-color"):null,yd=he(r,pl?.id??null,ft),gl=he(a,ua?.id??null,Rt),bl=dl?$t(Ut,{children:[dl,Qr&&A("g",{...gl,...ct("body"),children:Qr})]}):$t("g",{...gl,...ct("body"),children:[hl,Qr]}),cn=Z*Q,un=Z*Q,mn=(gt-7+Z)*Q,dn=Z*Q,fn=Z*Q,hn=(gt-7+Z)*Q,ke=bt(a,Rt),pn=H=>y?.[H]?.outer??fl?.[H]?.outer??i,gn=H=>y?.[H]?.inner??fl?.[H]?.inner??s,bn=(H,vt,Kt,ie,qt)=>{let yn=Lt(H,ke);if(!ko(yn))return null;if(M==="code"&&Fe(yn)){let Ra=JSON.stringify(yn)===JSON.stringify(ca);return To(yn,n,Ra?"fg-color":qt)}return Vp(yn,vt,Kt,ut,ie,qt,n)},ma=bn(pn("topLeft"),cn,un,"top-left","corners-square-color-0-0"),da=bn(pn("topRight"),mn,dn,"top-right","corners-square-color-1-0"),fa=bn(pn("bottomLeft"),fn,hn,"bottom-left","corners-square-color-0-1"),ha=bn(gn("topLeft"),cn,un,"top-left","corners-dot-color-0-0"),pa=bn(gn("topRight"),mn,dn,"top-right","corners-dot-color-1-0"),ga=bn(gn("bottomLeft"),fn,hn,"bottom-left","corners-dot-color-0-1"),_l=he(pn("topLeft"),ma?.id??null,ke),yl=he(pn("topRight"),da?.id??null,ke),xl=he(pn("bottomLeft"),fa?.id??null,ke),$l=he(gn("topLeft"),ha?.id??null,ke),Sl=he(gn("topRight"),pa?.id??null,ke),wl=he(gn("bottomLeft"),ga?.id??null,ke),_n={cornerEyePattern:z,cornerEyeDotPattern:W,eyeShapes:$},ba=$o(cn,un,ut,re(_n,"topLeft").outer,"top-left"),_a=xo(cn+ut/2,un+ut/2,la,re(_n,"topLeft").inner,"top-left"),ya=$o(mn,dn,ut,re(_n,"topRight").outer,"top-right"),xa=xo(mn+ut/2,dn+ut/2,la,re(_n,"topRight").inner,"top-right"),$a=$o(fn,hn,ut,re(_n,"bottomLeft").outer,"bottom-left"),Sa=xo(fn+ut/2,hn+ut/2,la,re(_n,"bottomLeft").inner,"bottom-left"),wa=Cr(P,{bgColor:r}),Kn=os(v),Cl=H=>$t(Ut,{children:[ln?null:hl,Qr,A("path",{d:ba,fillRule:H}),_a,A("path",{d:ya,fillRule:H}),xa,A("path",{d:$a,fillRule:H}),Sa]}),Ca=null;if(wa){let{color:H}=wa;Ca=A("g",{"data-qrdx-look":"halo",fill:H,stroke:H,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:x(2*wa.width*Q),children:Cl("nonzero")});}let Ma=null;if(Kn){let{color:H}=Wn(Kn.color);Ma=A("g",{"data-qrdx-look":"shadow",fill:H,opacity:x(Kn.opacity),transform:I`translate(${Kn.dx*Q},${Kn.dy*Q})`,children:Cl("evenodd")});}let xd=$t(Ut,{children:[A("defs",{children:L0([pl,ua,ma,da,fa,ha,pa,ga])}),ae(n,yd),Ca,Ma,bl,A("g",{..._l,...ct("eye-outer","top-left"),children:A("path",{d:ba,fillRule:"evenodd",transform:I`rotate(0,${cn+ut/2},${un+ut/2})`})}),A("g",{...$l,...ct("eye-centre","top-left"),children:_a}),A("g",{...yl,...ct("eye-outer","top-right"),children:A("path",{d:ya,fillRule:"evenodd",transform:I`rotate(0,${mn+ut/2},${dn+ut/2})`})}),A("g",{...Sl,...ct("eye-centre","top-right"),children:xa}),A("g",{...xl,...ct("eye-outer","bottom-left"),children:A("path",{d:$a,fillRule:"evenodd",transform:I`rotate(0,${fn+ut/2},${hn+ut/2})`})}),A("g",{...wl,...ct("eye-centre","bottom-left"),children:Sa}),K]}),Ml=h||(g?vo(g):void 0);if(Ml){let vt=ko(Ur)?To(Ur,300,"bg-color-template"):null,Kt=he(r,vt?.id??null,ft),ie=$t("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[A("defs",{children:L0([vt,ua,ma,da,fa,ha,pa,ga])}),ae(300,Kt),$t("g",{transform:`scale(${x(300/n,6)})`,children:[Ca,Ma,bl,A("g",{..._l,...ct("eye-outer","top-left"),children:A("path",{d:ba,fillRule:"evenodd",transform:I`rotate(0,${cn+ut/2},${un+ut/2})`})}),A("g",{...$l,...ct("eye-centre","top-left"),children:_a}),A("g",{...yl,...ct("eye-outer","top-right"),children:A("path",{d:ya,fillRule:"evenodd",transform:I`rotate(0,${mn+ut/2},${dn+ut/2})`})}),A("g",{...Sl,...ct("eye-centre","top-right"),children:xa}),A("g",{...xl,...ct("eye-outer","bottom-left"),children:A("path",{d:$a,fillRule:"evenodd",transform:I`rotate(0,${fn+ut/2},${hn+ut/2})`})}),A("g",{...wl,...ct("eye-centre","bottom-left"),children:Sa}),K]})]}),qt=300/n,Ra={pixelSize:Q*qt,url:e},Rl=Ml.wrapper(ie,{fgColor:a,bgColor:r,...p||{},...k},Ra),$d={...Rl?.props?.style||{},width:void 0,height:void 0,...X.style};return xt(He(Rl,{...X,width:n,height:n,style:$d}))}return xt(A("svg",{height:n,viewBox:`0 0 ${n} ${n}`,width:n,xmlns:"http://www.w3.org/2000/svg",...X,children:xd}))}var Q3=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),U3=t=>{let e=t.trim().replace(/^#/,"");e.length===3||e.length===4?e=e.slice(0,3).split("").map(o=>o+o).join(""):e.length===8&&(e=e.slice(0,6));let n=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:Number.parseInt(n[1],16),g:Number.parseInt(n[2],16),b:Number.parseInt(n[3],16)}:null},qn=(t,e,n)=>{let[o,r,a]=[t,e,n].map(i=>(i/=255,i<=.03928?i/12.92:((i+.055)/1.055)**2.4));return .2126*o+.7152*r+.0722*a},T0=t=>{let e=at(t);if(!e)return null;let n=o=>o*e.a+255*(1-e.a);return {r:n(e.r),g:n(e.g),b:n(e.b)}},H3=(t,e)=>{let n=T0(t),o=T0(e);if(!(n&&o))return 1;let r=qn(n.r,n.g,n.b),a=qn(o.r,o.g,o.b),i=Math.max(r,a),s=Math.min(r,a);return (i+.05)/(s+.05)},z3=t=>t>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:t>=4.5?{level:"AA",warning:false,message:"Good contrast"}:t>=3?{level:"AA Large",warning:true,message:"Low contrast - may be difficult to scan"}:{level:"Fail",warning:true,message:"Poor contrast - QR code may not scan properly"};var Xp=256,Yp=16384,Zp=128;var B0=(t,e)=>{if(!(Number.isInteger(t)&&Number.isInteger(e))||t<1||e<1||t>16384||e>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${t} x ${e}`)},_s=(t,e)=>t>>6*(2-e)&63;function G0(t,e,n){B0(e,n);let o=e*n;if(t.length!==o*4)throw new RangeError(`Expected ${o*4} RGBA bytes for ${e} x ${n}, got ${t.length}`);let r=new Map,a=false,i=false,s=false;for(let b=0;b<o;b++){let _=b*4,y=t[_+3];if(y<128){a=true,i||=y>0;continue}if(i||=y<255,!s){let w=t[_]<<16|t[_+1]<<8|t[_+2];r.has(w)||(r.set(w,r.size),s=r.size>256);}}let l=a?255:256,c=!s&&r.size<=l,u=new Uint8Array(o),m,f,d;if(c){f=[];for(let b of r.keys())f.push(b>>16&255,b>>8&255,b&255);m=r.size,d=(b,_,y)=>r.get(b<<16|_<<8|y);}else {let b=Kp(t,o,l);f=b.palette,m=b.palette.length/3,d=(_,y,w)=>b.bucketIndex[Q0(_,y,w)];}let g=a?m:null;for(let b=0;b<o;b++){let _=b*4;t[_+3]<128?u[b]=g:u[b]=d(t[_],t[_+1],t[_+2]);}let h=m+(a?1:0),p=new Uint8Array(h*3);return p.set(f),a&&p.fill(255,m*3),{width:e,height:n,palette:p,indices:u,transparentIndex:g,colors:h,lossless:c&&!i}}var Q0=(t,e,n)=>t>>2<<12|e>>2<<6|n>>2;function Kp(t,e,n){let o=new Uint32Array(262144),r=new Float64Array(262144),a=new Float64Array(262144),i=new Float64Array(262144);for(let f=0;f<e;f++){let d=f*4;if(t[d+3]<128)continue;let g=t[d],h=t[d+1],p=t[d+2],b=Q0(g,h,p);o[b]=o[b]+1,r[b]=r[b]+g,a[b]=a[b]+h,i[b]=i[b]+p;}let s=[];for(let f=0;f<262144;f++)o[f]>0&&s.push(f);let l=[{keys:s,pixels:s.reduce((f,d)=>f+o[d],0)}];for(;l.length<n;){let f=-1;for(let $=0;$<l.length;$++){let M=l[$];M.keys.length>1&&(f===-1||M.pixels>l[f].pixels)&&(f=$);}if(f===-1)break;let d=l[f],g=0,h=-1;for(let $ of [0,1,2]){let M=255,R=0;for(let E of d.keys){let P=_s(E,$);M=Math.min(M,P),R=Math.max(R,P);}R-M>h&&(h=R-M,g=$);}let p=[...d.keys].sort(($,M)=>_s($,g)-_s(M,g)||$-M),b=d.pixels/2,_=0,y=1;for(let $=0;$<p.length-1&&(_+=o[p[$]],y=$+1,!(_>=b));$++);let w=p.slice(0,y),C=p.slice(y),S=$=>$.reduce((M,R)=>M+o[R],0);l.splice(f,1,{keys:w,pixels:S(w)},{keys:C,pixels:S(C)});}let c=[];for(let f of l){let d=0,g=0,h=0;for(let p of f.keys)d+=r[p],g+=a[p],h+=i[p];c.push(Math.round(d/f.pixels),Math.round(g/f.pixels),Math.round(h/f.pixels));}let u=new Uint8Array(262144),m=c.length/3;for(let f of s){let d=o[f],g=r[f]/d,h=a[f]/d,p=i[f]/d,b=0,_=Number.POSITIVE_INFINITY;for(let y=0;y<m;y++){let w=g-c[y*3],C=h-c[y*3+1],S=p-c[y*3+2],$=w*w+C*C+S*S;$<_&&(_=$,b=y);}u[f]=b;}return {palette:c,bucketIndex:u}}var Jp=t=>Math.max(1,Math.ceil(Math.log2(t))),No=class{buffer=new Uint8Array(1024);length=0;push(...e){this.ensure(e.length);for(let n of e)this.buffer[this.length++]=n;}u16(e){this.push(e&255,e>>8&255);}ascii(e){for(let n=0;n<e.length;n++)this.push(e.charCodeAt(n));}bytes(e){this.ensure(e.length),this.buffer.set(e,this.length),this.length+=e.length;}ensure(e){if(this.length+e<=this.buffer.length)return;let n=this.buffer.length;for(;n<this.length+e;)n*=2;let o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.length)),this.buffer=o;}result(){return this.buffer.slice(0,this.length)}};function tg(t,e){let n=new No,o=1<<e,r=o+1,a=[],i=0,s=0,l=()=>{a.length>0&&(n.push(a.length,...a),a=[]);},c=h=>{a.push(h),a.length===255&&l();},u=(h,p)=>{for(i|=h<<s,s+=p;s>=8;)c(i&255),i>>>=8,s-=8;},m=new Int32Array(1048576),f=e+1,d=r+1;u(o,f);let g=t[0];for(let h=1;h<t.length;h++){let p=t[h],b=g<<8|p,_=m[b];if(_!==0){g=_-1;continue}u(g,f),d===4096?(u(o,f),m=new Int32Array(1048576),d=r+1,f=e+1):(d>=1<<f&&f++,m[b]=d+1,d++),g=p;}return u(g,f),u(r,f),s>0&&c(i&255),l(),n.result()}function U0(t){let{width:e,height:n,palette:o,indices:r,transparentIndex:a}=t;B0(e,n);let i=o.length/3;if(!Number.isInteger(i)||i<1||i>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${o.length} bytes`);if(r.length!==e*n)throw new RangeError(`Expected ${e*n} palette indices for ${e} x ${n}, got ${r.length}`);if(a!==null&&!(Number.isInteger(a)&&a>=0&&a<i))throw new RangeError(`The transparent index ${a} isn't in a palette of ${i} colors`);for(let m=0;m<r.length;m++)if(r[m]>=i)throw new RangeError(`Pixel ${m} points at color ${r[m]}, past the palette of ${i}`);let s=Jp(i),l=1<<s,c=Math.max(2,s),u=new No;return u.ascii("GIF89a"),u.u16(e),u.u16(n),u.push(240|s-1,0,0),u.bytes(o),u.bytes(new Uint8Array((l-i)*3)),a!==null&&u.push(33,249,4,1,0,0,a,0),u.push(44),u.u16(0),u.u16(0),u.u16(e),u.u16(n),u.push(0),u.push(c),u.bytes(tg(r,c)),u.push(0),u.push(59),u.result()}function ys(t,e,n){let o=G0(t,e,n);return {file:U0(o),image:o}}function xs(t){let{palette:e,indices:n,transparentIndex:o}=t,r=new Uint8ClampedArray(n.length*4);for(let a=0;a<n.length;a++){let i=n[a],s=a*4;r[s]=e[i*3],r[s+1]=e[i*3+1],r[s+2]=e[i*3+2],r[s+3]=i===o?0:255;}return r}var D0="GIF89a";function $s(t){if(t.length<32)return false;for(let l=0;l<D0.length;l++)if(t[l]!==D0.charCodeAt(l))return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(6,true),o=e.getUint16(8,true),r=t[10];if(n<1||o<1||!(r&128))return false;let a=13+3*(1<<(r&7)+1);if(t.length<a)return false;let i=l=>{let c=l;for(;c<t.length;){let u=t[c];if(c+=1,u===0)return c;c+=u;}return -1},s=0;for(;a<t.length;){let l=t[a];if(l===59)return s===1&&a===t.length-1;if(l===33)a=i(a+2);else if(l===44){if(a+10>t.length||e.getUint16(a+5,true)!==n||e.getUint16(a+7,true)!==o||t[a+9]&128)return false;let c=t[a+10];if(c<2||c>8)return false;s+=1,a=i(a+11);}else return false;if(a===-1)return false}return false}var Ir="image/gif",Do=class extends Error{constructor(e){super(e),this.name="GIFScanError";}},Oo=255;function H0(t){let e=new Uint8ClampedArray(t.length);for(let n=0;n<t.length;n+=4){let o=t[n+3];for(let r=0;r<3;r++)e[n+r]=Math.round((t[n+r]*o+Oo*(Oo-o))/Oo);e[n+3]=Oo;}return e}function z0(t,e,n){let o=Uint8ClampedArray.from(e.data),r=t(o,e.width,e.height,{inversionAttempts:"dontInvert"});if(!r)return false;if(r.data===n)return true;try{return new TextDecoder().decode(Uint8Array.from(r.binaryData))===n}catch{return false}}async function eg(t,e,n){let{width:o,height:r}=t,a=H0(t.data),i=H0(e.data);if(e.width===o&&e.height===r&&a.every((c,u)=>c===i[u]))return;let s;try{s=(await import('jsqr')).default;}catch{throw new Do("This design uses more colors than a GIF holds (256), and the reduced image could not be checked because jsqr is not available. Download a PNG instead.")}if(!z0(s,{data:a,width:o,height:r},n))return;if(!z0(s,{data:i,width:e.width,height:e.height},n))throw new Do("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function ng(t,e){let{file:n,image:o}=ys(t.data,t.width,t.height);if(!$s(n))throw new Error("Could not write a GIF file");return e!==void 0&&!o.lossless&&await eg(t,{data:xs(o),width:t.width,height:t.height},e),{file:n,colors:o.colors,lossless:o.lossless}}async function Bo(t,e){let n=t.getContext("2d");if(!n)throw new Error("Could not get canvas context");let{data:o}=n.getImageData(0,0,t.width,t.height),{file:r}=await ng({data:o,width:t.width,height:t.height},e);return new Blob([r],{type:Ir})}var Go=[16,32,48,256],on="image/vnd.microsoft.icon",rn=256,Ss=64,vr=6,Lr=16,rg=[137,80,78,71,13,10,26,10],og=16,W0=20,ag=32,q0=t=>t.length>=W0+4&&rg.every((e,n)=>t[n]===e),V0=t=>{let e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {width:e.getUint32(og),height:e.getUint32(W0)}};function ws(t){if(t.length<1||t.length>Ss)throw new RangeError(`An ICO holds 1 to ${Ss} images, got ${t.length}`);for(let{width:i,height:s,png:l}of t){let c=m=>Number.isInteger(m)&&m>=1&&m<=rn;if(!(c(i)&&c(s)))throw new RangeError(`ICO images must be whole numbers from 1 to ${rn} px, got ${i} x ${s}`);if(!q0(l))throw new RangeError("Every ICO image must be a PNG file");let u=V0(l);if(u.width!==i||u.height!==s)throw new RangeError(`An ICO image says ${i} x ${s} but its PNG is ${u.width} x ${u.height}`)}let e=vr+Lr*t.length,n=t.reduce((i,s)=>i+s.png.length,0),o=new Uint8Array(e+n),r=new DataView(o.buffer);r.setUint16(0,0,true),r.setUint16(2,1,true),r.setUint16(4,t.length,true);let a=e;return t.forEach(({width:i,height:s,png:l},c)=>{let u=vr+Lr*c;o[u]=i===rn?0:i,o[u+1]=s===rn?0:s,o[u+2]=0,o[u+3]=0,r.setUint16(u+4,1,true),r.setUint16(u+6,ag,true),r.setUint32(u+8,l.length,true),r.setUint32(u+12,a,true),o.set(l,a),a+=l.length;}),o}function Cs(t){if(t.length<vr+Lr)return false;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint16(4,true);if(e.getUint16(0,true)!==0||e.getUint16(2,true)!==1||n<1||n>Ss||t.length<vr+Lr*n)return false;for(let o=0;o<n;o++){let r=vr+Lr*o,a=t[r]||rn,i=t[r+1]||rn,s=e.getUint32(r+8,true),l=e.getUint32(r+12,true);if(l+s>t.length)return false;let c=t.subarray(l,l+s);if(!q0(c))return false;let u=V0(c);if(u.width!==a||u.height!==i)return false}return true}var j0="data:image/png;base64,";function ig(t){let e=t.toDataURL("image/png");if(!e.startsWith(j0))throw new Error("This browser can't write a PNG from a canvas");let n=atob(e.slice(j0.length)),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}function Ms(t){let e=ws(t.map(n=>({width:n.width,height:n.height,png:ig(n)})));if(!Cs(e))throw new Error("Could not write an ICO file");return new Blob([e],{type:on})}function X0(t){return Ms([t])}var sg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),lg=new Map([["className","class"],["tabIndex","tabindex"],["dir","dir"],["role","role"],["viewBox","viewBox"],["width","width"],["height","height"],["xlinkActuate","xlink:actuate"],["xlinkArcrole","xlink:arcrole"],["xlinkRole","xlink:role"],["xlinkShow","xlink:show"],["xlinkTitle","xlink:title"],["xlinkType","xlink:type"],["xmlBase","xml:base"],["xmlLang","xml:lang"],["xmlSpace","xml:space"]]),cg=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),ug=new Set(["inert","allowFullScreen","async","autoPlay","controls","credentialless","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"]),mg=new Set(["autoFocus","multiple","muted"]),dg=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),fg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),Y0=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",hg=new RegExp(`^[${Y0}][${Y0}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Qo=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,pg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,gg="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",bg=t=>pg.test(t)?gg:t,K0=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),_g=/["'&<>]/;function Rs(t){if(!_g.test(t))return t;let e="",n=0;for(let o=0;o<t.length;o++){let r;switch(t.charCodeAt(o)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}e+=t.slice(n,o)+r,n=o+1;}return e+t.slice(n)}var pe=t=>typeof t=="function"||typeof t=="symbol",Z0=new Map,yg=t=>{let e=Z0.get(t);return e===void 0&&(e=t.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),Z0.set(t,e)),e};function xg(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return "";let e="";for(let n of Object.keys(t)){let o=t[n];if(o==null||typeof o=="boolean"||o==="")continue;let r;if(n.startsWith("--"))r=`${n}:${`${o}`.trim()}`;else {let a=typeof o=="number"?o===0||fg.has(n)?`${o}`:`${o}px`:`${o}`.trim();r=`${yg(n)}:${a}`;}e=e?`${e};${r}`:r;}return e}function Vn(t,e){if(e==null||cg.has(t))return null;let n=lg.get(t);if(n!==void 0)return pe(e)||typeof e=="boolean"?null:{name:n,value:`${e}`};switch(t){case "style":{let r=xg(e);return r?{name:"style",value:r}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (t==="src"||t==="href")&&e===""||pe(e)||typeof e=="boolean"?null:{name:t==="xlinkHref"?"xlink:href":t,value:bg(`${e}`)};case "capture":case "download":return e===true?{name:t,value:""}:e===false||pe(e)?null:{name:t,value:`${e}`};case "cols":case "rows":case "size":case "span":return pe(e)||Number.isNaN(Number(e))||!(e>=1)?null:{name:t,value:`${e}`};case "rowSpan":case "start":return pe(e)||Number.isNaN(Number(e))?null:{name:t,value:`${e}`};}if(mg.has(t))return e&&!pe(e)?{name:t.toLowerCase(),value:""}:null;if(dg.has(t))return pe(e)?null:{name:t,value:`${e}`};if(ug.has(t))return e&&!pe(e)?{name:t,value:""}:null;if(t.length>2&&(t[0]==="o"||t[0]==="O")&&(t[1]==="n"||t[1]==="N"))return null;let o=sg.get(t)??t;if(!hg.test(o)||pe(e))return null;if(typeof e=="boolean"){let r=o.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-")return null}return {name:o,value:`${e}`}}var J0="http://www.w3.org/2000/svg",tm="http://www.w3.org/1999/xhtml",$g="http://www.w3.org/1999/xlink",Sg="http://www.w3.org/XML/1998/namespace",wg="http://www.w3.org/2000/xmlns/";function Cg(t,e,n){e==="xmlns"||e.startsWith("xmlns:")?t.setAttributeNS(wg,e,n):e.startsWith("xlink:")?t.setAttributeNS($g,e,n):e.startsWith("xml:")?t.setAttributeNS(Sg,e,n):t.setAttribute(e,n);}function Tr(t,e,n,o){if(e==null||typeof e=="boolean")return;if(typeof e=="string"||typeof e=="number"||typeof e=="bigint"){t.appendChild(o.createTextNode(`${e}`));return}if(Array.isArray(e)){for(let l of e)Tr(t,l,n,o);return}if(!ze(e))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:r,props:a}=e;if(An(r)){Tr(t,a.children,n,o);return}if(typeof r=="function"){Tr(t,r(a),n,o);return}if(!Qo.test(r))throw new TypeError(`qrdx: invalid element name: ${r}`);let i=r==="svg"?J0:n,s=o.createElementNS(i,r);for(let l of Object.keys(a)){let c=Vn(l,a[l]);c&&Cg(s,c.name,c.value);}Tr(s,a.children,i===J0&&r==="foreignObject"?tm:i,o),t.appendChild(s);}function Es(t,e=document){let n=e.createDocumentFragment();return Tr(n,t,tm,e),n}function an(t){if(t==null||typeof t=="boolean")return "";if(typeof t=="string")return Rs(t);if(typeof t=="number"||typeof t=="bigint")return `${t}`;if(Array.isArray(t)){let e="";for(let n of t)e+=an(n);return e}if(!ze(t))throw new TypeError("qrdx: can't render this value as SVG markup");return Mg(t)}function Mg(t){let{type:e,props:n}=t;if(An(e))return an(n.children);if(typeof e=="function")return an(e(n));if(!Qo.test(e))throw new TypeError(`qrdx: invalid element name: ${e}`);let o=`<${e}`;for(let i of Object.keys(n)){let s=Vn(i,n[i]);s&&(o+=` ${s.name}="${Rs(s.value)}"`);}if(K0.has(e))return `${o}/>`;let r=n.dangerouslySetInnerHTML?.__html,a=r==null?an(n.children):`${r}`;return `${o}>${a}</${e}>`}function As(t){return an(bs(t))}function Rg(t,e=document){return Es(bs(t),e).firstChild}var Eg=16384;var Ps=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Ag=8,Is=class{buffer;position=0;bits=0;used=0;constructor(e){this.buffer=new Uint8Array(Math.max(e,64));}write(e,n){if(n!==0)for(this.bits|=e<<this.used,this.used+=n;this.used>=8;){if(this.position===this.buffer.length){let o=new Uint8Array(this.buffer.length*2);o.set(this.buffer),this.buffer=o;}this.buffer[this.position++]=this.bits&255,this.bits>>>=8,this.used-=8;}}finish(){return this.used>0&&this.write(0,8-this.used),this.buffer.subarray(0,this.position)}};function im(t,e){let n=new Uint8Array(t.length),o=[];for(let c=0;c<t.length;c++)(t[c]??0)>0&&o.push(c);if(o.length===0)return n;if(o.length===1)return n[o[0]]=1,n;let r=o.length,a=2*r-1,i=new Float64Array(a),s=new Int32Array(a),l=new Uint8Array(a);for(let c=1;;c*=2){for(let h=0;h<r;h++)i[h]=Math.max(t[o[h]]??0,c);let u=Array.from({length:r},(h,p)=>p).sort((h,p)=>i[h]-i[p]||h-p),m=0,f=r,d=h=>m<r&&(f>=h||i[u[m]]<=i[f])?u[m++]:f++;for(let h=r;h<a;h++){let p=d(h),b=d(h);i[h]=i[p]+i[b],s[p]=h,s[b]=h;}l[a-1]=0;let g=0;for(let h=a-2;h>=0;h--){let p=l[s[h]]+1;l[h]=p,h<r&&p>g&&(g=p);}if(g<=e){for(let h=0;h<r;h++)n[o[h]]=l[h];return n}}}function Pg(t,e){let n=0;for(let o=0;o<e;o++)n=n<<1|t>>o&1;return n}function sm(t){let e=new Uint16Array(16),n=0;for(let s of t)s>0&&(e[s]=e[s]+1,n++);let o=new Uint16Array(16),r=0;for(let s=1;s<=15;s++)r=r+e[s-1]<<1,o[s]=r;let a=new Uint16Array(t.length),i=new Uint8Array(t.length);return t.forEach((s,l)=>{if(s===0)return;let c=o[s];o[s]=c+1,a[l]=Pg(c,s),i[l]=n===1?0:s;}),{lengths:t,codes:a,emitted:i}}function sn(t,e,n){t.write(e.codes[n],e.emitted[n]);}function Ig(t){let e=[],n=a=>e.push({code:a,extra:0,extraBits:0}),o=Ag,r=0;for(;r<t.length;){let a=t[r],i=1;for(;r+i<t.length&&t[r+i]===a;)i++;r+=i;let s=i;if(a===0){for(;s>0;)if(s<3)for(;s>0;s--)n(0);else if(s<=10)e.push({code:17,extra:s-3,extraBits:3}),s=0;else {let l=Math.min(s,138);e.push({code:18,extra:l-11,extraBits:7}),s-=l;}continue}for(a!==o&&(n(a),o=a,s--);s>0;)if(s<3)for(;s>0;s--)n(a);else {let l=Math.min(s,6);e.push({code:16,extra:l-3,extraBits:2}),s-=l;}}return e}function vg(t,e){let n=[];if(e.forEach((s,l)=>{s>0&&n.push(l);}),n.length<=2&&n.every(s=>s<256)){let[s=0,l]=n;t.write(1,1),t.write(n.length===2?1:0,1),s<2?(t.write(0,1),t.write(s,1)):(t.write(1,1),t.write(s,8)),l!==void 0&&t.write(l,8);return}let o=Ig(e),r=new Uint32Array(19);for(let s of o)r[s.code]=r[s.code]+1;let a=sm(im(r,7)),i=Ps.length;for(;i>4&&a.lengths[Ps[i-1]]===0;)i--;t.write(0,1),t.write(i-4,4);for(let s=0;s<i;s++)t.write(a.lengths[Ps[s]],3);t.write(0,1);for(let s of o)sn(t,a,s.code),t.write(s.extra,s.extraBits);}function Uo(t){let e=t-1;if(e<4)return {symbol:e,extra:0,extraBits:0};let n=31-Math.clz32(e),o=e>>n-1&1,r=n-1;return {symbol:2*n+o,extra:e&(1<<r)-1,extraBits:r}}function em(t,e,n,o){let r=0;for(;r<o&&t[e+r]===t[e+r-n];)r++;return r}function nm(t,e,n){let o=t.length,r=0;for(;r<o;){let a=Math.min(4096,o-r),i=r>=1?em(t,r,1,a):0,s=r>=e?em(t,r,e,a):0;if(Math.max(i,s)>=3){s>=i?(n.copy(s,e===1?2:1),r+=s):(n.copy(i,2),r+=i);continue}n.literal(t[r]),r++;}}var rm=20;function om(t,e,n){for(let o=0;o<n.length;o++)t[e+o]=n.charCodeAt(o);}function am(t,e,n){t[e]=n&255,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24&255;}function Ls(t,e,n){if(!(Number.isInteger(e)&&Number.isInteger(n))||e<1||n<1||e>16384||n>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${e} \xD7 ${n})`);let o=e*n;if(t.length<o*4)throw new RangeError(`Expected ${o*4} bytes of RGBA for ${e} \xD7 ${n}, got ${t.length}`);let r=new Uint32Array(o),a=false;for(let C=0;C<o;C++){let S=C*4,$=t[S],M=t[S+1],R=t[S+2],E=t[S+3];E!==255&&(a=true),r[C]=(E<<24|($-M&255)<<16|M<<8|R-M&255)>>>0;}let i=new Uint32Array(280),s=new Uint32Array(256),l=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(40);nm(r,e,{literal(C){i[C>>>8&255]++,s[C>>>16&255]++,l[C&255]++,c[C>>>24]++;},copy(C,S){i[256+Uo(C).symbol]++,u[Uo(S).symbol]++;}});let m=[i,s,l,c,u].map(C=>im(C,15)),[f,d,g,h,p]=m.map(sm),b=new Is(Math.ceil(o/4)+1024);b.write(47,8),b.write(e-1,14),b.write(n-1,14),b.write(a?1:0,1),b.write(0,3),b.write(1,1),b.write(2,2),b.write(0,1),b.write(0,1),b.write(0,1);for(let C of m)vg(b,C);nm(r,e,{literal(C){sn(b,f,C>>>8&255),sn(b,d,C>>>16&255),sn(b,g,C&255),sn(b,h,C>>>24);},copy(C,S){let $=Uo(C);sn(b,f,256+$.symbol),b.write($.extra,$.extraBits);let M=Uo(S);sn(b,p,M.symbol),b.write(M.extra,M.extraBits);}});let _=b.finish(),y=_.length+(_.length&1),w=new Uint8Array(rm+y);return om(w,0,"RIFF"),am(w,4,w.length-8),om(w,8,"WEBPVP8L"),am(w,16,_.length),w.set(_,rm),w}function vs(t,e,n){return String.fromCharCode(...t.subarray(e,e+n))}function lm(t){return t.length>=12&&vs(t,0,4)==="RIFF"&&vs(t,8,4)==="WEBP"}function Ts(t){if(!lm(t))return null;let e=12;for(;e+8<=t.length;){let n=vs(t,e,4);if(n==="VP8L")return "lossless";if(n==="VP8 ")return "lossy";let o=(t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24)>>>0;e+=8+o+(o&1);}return null}function Lg(t,e,n){return typeof t.toBlob!="function"?Promise.resolve(null):new Promise(o=>{try{t.toBlob(o,e,n);}catch{o(null);}})}async function Ho(t,e={}){let n=e.quality!==void 0,o=n?Math.min(1,Math.max(0,Number(e.quality))):1,r=await Lg(t,"image/webp",o);if(r){let l=new Uint8Array(await r.arrayBuffer()),c=Ts(l);if(c==="lossless"||n&&c==="lossy")return new Blob([l],{type:"image/webp"})}let a=t.getContext("2d");if(!a)throw new Error("Could not get canvas context");let{data:i}=a.getImageData(0,0,t.width,t.height),s=Ls(i,t.width,t.height);return new Blob([s],{type:"image/webp"})}var cm=32768;async function Ot(t){let e=new Uint8Array(await t.arrayBuffer()),n="";for(let o=0;o<e.length;o+=cm)n+=String.fromCharCode(...e.subarray(o,o+cm));return `data:${t.type||"application/octet-stream"};base64,${btoa(n)}`}async function Xt(t){let e={...t};if(t.imageSettings?.src)try{let u=await Tg(t.imageSettings.src);e={...t,imageSettings:{...t.imageSettings,src:u}};}catch{let{imageSettings:u,...m}=t;e=m;}let{hideLogo:n,url:o,logo:r,scale:a,frameLabelMarkers:i,partMarkers:s,...l}=e,c=As({...l,templateId:e.templateId,customTemplate:e.customTemplate});return `data:image/svg+xml,${encodeURIComponent(c)}`}var Tg=t=>new Promise((e,n)=>{if(t.startsWith("data:")){e(t);return}let o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{let r=document.createElement("canvas");r.width=o.naturalWidth||o.width,r.height=o.naturalHeight||o.height;let a=r.getContext("2d");if(!a){n(new Error("Could not get canvas context"));return}a.drawImage(o,0,0);let i=r.toDataURL("image/png");r.remove(),e(i);}catch(r){n(new Error(`Failed to convert image to base64: ${r}`));}},o.onerror=()=>{n(new Error(`Could not load image from ${t.slice(0,100)}... Check CORS settings or use a data URL.`));},o.src=t;});async function ge(t,e,n){let o=await Xt(t),r=decodeURIComponent(o.replace("data:image/svg+xml,","")),a;try{let i=new TextEncoder().encode(r),s=Array.from(i,c=>String.fromCharCode(c)).join("");a=`data:image/svg+xml;base64,${btoa(s)}`;}catch(i){throw new Error(`Failed to encode SVG for canvas conversion: ${i}`)}return new Promise((i,s)=>{let l=document.createElement("canvas"),c=l.getContext("2d");if(!c){s(new Error("Could not get canvas context"));return}let u=new Image,{width:m,height:f}=me(t.size||it,t.frame);l.width=Math.round(m),l.height=Math.round(f);let d=setTimeout(()=>{l.remove(),s(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);u.onload=()=>{clearTimeout(d);try{if(e==="image/jpeg"&&(c.fillStyle="white",c.fillRect(0,0,l.width,l.height)),c.drawImage(u,0,0,l.width,l.height),n)i(l);else if(e==="image/webp")Ho(l).then(Ot).then(i,s).finally(()=>l.remove());else if(e==="image/bmp")Ot(ro(l)).then(i,s).finally(()=>l.remove());else if(e===Ir)Bo(l,t.value).then(Ot).then(i,s).finally(()=>l.remove());else if(e===on||e==="image/x-icon")Ot(X0(l)).then(i,s).finally(()=>l.remove());else {let g=l.toDataURL(e,1);l.remove(),i(g);}}catch(g){clearTimeout(d),l.remove(),s(new Error(`Failed to draw SVG to canvas: ${g}`));}},u.onerror=()=>{clearTimeout(d),l.remove(),s(new Error("Could not load SVG"));},u.src=a;})}var um=["gradientUnits","gradientTransform","spreadMethod"],kg={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},Fg={r:0,g:0,b:0,a:1};function mm(t,e){for(let n of (t.attrs.style??"").split(";")){let[o,...r]=n.split(":");if(o?.trim()===e)return r.join(":").trim()}return t.attrs[e]}function ks(t){return t.name==="linearGradient"?"linear":t.name==="radialGradient"?"radial":null}function Ng(t){let e=[],n=0;for(let o of t.children){if(o.name!=="stop")continue;let r=(o.attrs.offset??"0").trim(),a=Number.parseFloat(r),i=Number.isFinite(a)?r.endsWith("%")?a/100:a:0;n=Math.max(n,Math.min(Math.max(i,0),1));let s=mm(o,"stop-color")??"#000000",l=at(s==="currentColor"?"#000000":s)??Fg,c=Number.parseFloat(mm(o,"stop-opacity")??"1");e.push({offset:n,color:Number.isFinite(c)?{...l,a:l.a*Math.min(Math.max(c,0),1)}:l});}return e}function zo(t){let e=new Map,n=r=>{let a=r.attrs.id;ks(r)&&a&&!e.has(a)&&e.set(a,r);for(let i of r.children)n(i);};n(t);let o=new Map;for(let[r,a]of e){let i=ks(a),s={},l=[],c=new Set,u=a;for(;u&&!c.has(u);){c.add(u);let m=ks(u)===i?[...um,...kg[i]]:um;for(let d of m){let g=u.attrs[d];s[d]===void 0&&g!==void 0&&(s[d]=g);}l.length===0&&(l=Ng(u));let f=u.attrs.href??u.attrs["xlink:href"];u=f?.startsWith("#")?e.get(f.slice(1)):void 0;}o.set(r,{kind:i,attrs:s,stops:l});}return o}function Fs(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=(m,f)=>{e=Math.min(e,m),o=Math.max(o,m),n=Math.min(n,f),r=Math.max(r,f);},i=(m,f,d,g)=>{let h=-m+3*f-3*d+g,p=2*(m-2*f+d),b=f-m;if(Math.abs(h)<1e-12)return Math.abs(p)<1e-12?[]:[-b/p];let _=p*p-4*h*b;if(_<0)return [];let y=Math.sqrt(_);return [(-p+y)/(2*h),(-p-y)/(2*h)]},s=(m,f,d,g,h)=>{let p=1-m;return p*p*p*f+3*p*p*m*d+3*p*m*m*g+m**3*h},l=0,c=0,u=[0,0];for(let m of t)if(m.op==="M"&&(u=[m.x,m.y]),m.op==="M"||m.op==="L")a(m.x,m.y),l=m.x,c=m.y;else if(m.op==="C"){a(m.x,m.y);for(let f of [...i(l,m.x1,m.x2,m.x),...i(c,m.y1,m.y2,m.y)])f>0&&f<1&&a(s(f,l,m.x1,m.x2,m.x),s(f,c,m.y1,m.y2,m.y));l=m.x,c=m.y;}else [l,c]=u;return Number.isFinite(e)?{x:e,y:n,width:o-e,height:r-n}:null}var Og=t=>t[0]*t[3]-t[1]*t[2];function Ae(t){let e=Og(t);if(!Number.isFinite(e)||Math.abs(e)<1e-12)return null;let[n,o,r,a,i,s]=t;return [a/e,-o/e,-r/e,n/e,(r*s-a*i)/e,(o*i-n*s)/e]}function fm(t,e,n){let{kind:o,attrs:r,stops:a}=t,i=a[0],s=a.at(-1);if(!(i&&s)||a.every(S=>S.color.a===0))return null;if(a.length===1)return i.color;let l=r.gradientUnits==="userSpaceOnUse",c=Cn;if(!l){let S=Fs(e);if(!S||S.width<=0||S.height<=0)return null;c=[S.width,0,0,S.height,S.x,S.y];}let u=mt(c,Qt(r.gradientTransform));if(!Ae(u))return s.color;let[m,f]=n,d=Math.sqrt((m*m+f*f)/2),g=(S,$)=>{let M=Number.parseFloat(S);return Number.isFinite(M)?S.trim().endsWith("%")?M/100*(l?$:1):M:null},h=(S,$,M)=>g(r[S]??$,M)??g($,M)??0;if(o==="linear"){let S=[h("x1","0%",m),h("y1","0%",f),h("x2","100%",m),h("y2","0%",f)],[$,M,R,E]=S;return $===R&&M===E?s.color:{kind:o,coords:S,matrix:u,stops:a}}let p=h("cx","50%",m),b=h("cy","50%",f),_=h("r","50%",d),y=r.fx===void 0?p:h("fx","50%",m),w=r.fy===void 0?b:h("fy","50%",f),C=Math.max(0,h("fr","0%",d));return _<0?null:_===0?s.color:{kind:o,coords:[y,w,C,p,b,_],matrix:u,stops:a}}function Wo(t){return t.map(e=>x(e,6)).join(" ")}function Dg(t,e){return (e==="cmyk"?$e(t.r,t.g,t.b):[t.r/255,t.g/255,t.b/255]).map(o=>x(o,4)).join(" ")}var dm=(t,e)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${t}] /C1 [${e}] /N 1 >>`;function Bg(t,e){let n=[],o=t.map(s=>J(s.offset,4)),r=t.map(s=>Dg(s.color,e)),a=o[0],i=o.at(-1);if(a>0){let s=r[0];n.push({from:0,to:a,c0:s,c1:s});}for(let s=0;s+1<t.length;s++){let l=o[s],c=o[s+1];c>l&&n.push({from:l,to:c,c0:r[s],c1:r[s+1]});}if(i<1){let s=r.at(-1);n.push({from:i,to:1,c0:s,c1:s});}if(n.length===1){let[s]=n;return dm(s.c0,s.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${n.map(s=>dm(s.c0,s.c1)).join(" ")}]`,`/Bounds [${n.slice(1).map(s=>x(s.from,4)).join(" ")}]`,`/Encode [${n.map(()=>"0 1").join(" ")}] >>`].join(" ")}function qo(t,e){return [`<< /ShadingType ${t.kind==="linear"?2:3}`,`/ColorSpace /Device${e==="cmyk"?"CMYK":"RGB"}`,`/Coords [${t.coords.map(n=>x(n,6)).join(" ")}]`,`/Function ${Bg(t.stops,e)}`,"/Extend [true true] >>"].join(" ")}function Gg(t,e){if(t.op==="Z")return t;if(t.op==="C"){let[r,a]=q(e,t.x1,t.y1),[i,s]=q(e,t.x2,t.y2),[l,c]=q(e,t.x,t.y);return {op:"C",x1:r,y1:a,x2:i,y2:s,x:l,y:c}}let[n,o]=q(e,t.x,t.y);return {op:t.op,x:n,y:o}}function jo(t){let e={round:1,bevel:2}[t.strokeLinejoin?.trim()??""],n={round:1,square:2}[t.strokeLinecap?.trim()??""];return {join:e??0,cap:n??0}}var hm={r:255,g:255,b:255,a:1},Qg=/^url\(\s*#bg-color-/,Vo=/^url\(\s*#([^)\s]+)\s*\)/,Ug=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function j(t,e){let n=t.attrs.style;if(n)for(let o of n.split(";")){let[r,...a]=o.split(":");if(r?.trim()===e)return a.join(":").trim()}return t.attrs[e]}function V(t,e,n=0){if(t===void 0||t==="")return n;let o=Number.parseFloat(t);return Number.isNaN(o)?n:t.trim().endsWith("%")?o/100*e:o}function kr(t,e){if((t.name==="linearGradient"||t.name==="radialGradient")&&t.attrs.id){let n=t.children.find(r=>r.name==="stop"),o=n&&(j(n,"stop-color")??"#000000");o&&e.set(t.attrs.id,o);}for(let n of t.children)kr(n,e);return e}function Fr(t,e){if(t.name==="image"){let n=t.attrs.href??t.attrs["xlink:href"];n&&e.add(n);}for(let n of t.children)Fr(n,e);return e}function Xo(t){return /^data:image\/png[;,]/i.test(t)?"PNG":/^data:image\/jpe?g[;,]/i.test(t)?"JPEG":null}async function Yo(t){return typeof document>"u"||typeof Image>"u"?null:await new Promise(e=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{let o=document.createElement("canvas"),r=Math.max(n.naturalWidth||512,n.naturalHeight||512),a=Math.min(1024/r,4);o.width=Math.round((n.naturalWidth||512)*a),o.height=Math.round((n.naturalHeight||512)*a);let i=o.getContext("2d");if(!i){e(null);return}i.drawImage(n,0,0,o.width,o.height);try{e(o.toDataURL("image/png"));}catch{e(null);}},n.onerror=()=>e(null),n.src=t;})}function pm(t,e,n){let o={x:V(t.attrs.x,e[0]),y:V(t.attrs.y,e[1]),width:V(t.attrs.width,e[0]),height:V(t.attrs.height,e[1])};if(o.width<=0||o.height<=0)return null;let r=(t.attrs.preserveAspectRatio??"").trim();if(!r||r.startsWith("none")||!n||!(n.width>0&&n.height>0))return {draw:o,clip:null};let[a="xMidYMid",i="meet"]=r.split(/\s+/),s=i==="slice",l=(s?Math.max:Math.min)(o.width/n.width,o.height/n.height),c=n.width*l,u=n.height*l,m=f=>{let d=f==="x"?a.slice(0,4):a.slice(4);return d.endsWith("Min")?0:d.endsWith("Max")?1:.5};return {draw:{x:o.x+(o.width-c)*m("x"),y:o.y+(o.height-u)*m("y"),width:c,height:u},clip:s?o:null}}function gm(t,e){t.name==="clipPath"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)gm(n,e);return e}function bm(t,e){t.name==="pattern"&&t.attrs.id&&e.set(t.attrs.id,t);for(let n of t.children)bm(n,e);return e}function Hg(t,e){let[n,o]=e,r=(a,i)=>V(t.attrs[a],i);switch(t.name){case "path":return le(t.attrs.d??"");case "rect":{let a=t.attrs.rx??t.attrs.ry,i=t.attrs.ry??t.attrs.rx;return ne(r("x",n),r("y",o),r("width",n),r("height",o),V(a,n),V(i,o))}case "circle":{let a=r("r",Math.hypot(n,o)/Math.SQRT2);return ee(r("cx",n),r("cy",o),a,a)}case "ellipse":return ee(r("cx",n),r("cy",o),r("rx",n),r("ry",o));default:return []}}var jn=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=hm;paper=hm;background=null;onPaper=false;inConic=false;constructor(e,n=null){this.gradients=e,this.shadings=n;}resolveColor(e){if(!e||e==="none")return null;let n=Vo.exec(e);if(n)return this.resolveColor(this.gradients.get(n[1]));let o=at(e==="currentColor"?"#000000":e);return o&&o.a>0?o:null}shadedGradient(e){let n=e?Vo.exec(e)?.[1]:void 0;return n?this.shadings?.get(n):void 0}resolveFill(e,n,o,r=1){if(r<=0)return null;let a=this.patternOf(e);if(a)return {pattern:a,alpha:r};let i=this.shadedGradient(e);if(i){let c=fm(i,n,o);if(!c)return null;if("coords"in c)return {gradient:c,alpha:r};let u={...c,a:c.a*r};return u.a>0?{color:u}:null}let s=this.resolveColor(e);if(!s)return null;let l={...s,a:s.a*r};return l.a>0?{color:l}:null}patternOf(e){let n=e?Vo.exec(e)?.[1]:void 0,o=n?this.patterns.get(n):void 0;if(!(o?.attrs.patternUnits!=="userSpaceOnUse"||(o.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||o.attrs.viewBox))return o}flatten(e){if(e.a>=1)return e;let n=this.background,o=n!==null&&Math.abs(n.r-e.r)<.5&&Math.abs(n.g-e.g)<.5&&Math.abs(n.b-e.b)<.5&&Math.abs(n.a-e.a)<.002;return Lo(e,this.onPaper||o?this.paper:this.backdrop)}paintPattern(e,n,o,r){let a=Fs(e);if(!a||a.width<=0||a.height<=0)return true;let[i,s]=n.viewport,l=V(o.attrs.x,i),c=V(o.attrs.y,s),u=V(o.attrs.width,i),m=V(o.attrs.height,s);if(!(u>0&&m>0))return true;let f=Qt(o.attrs.patternTransform),d=Ae(f);if(!d)return true;if(!this.beginClip(e,n.matrix,n.fillRule==="evenodd"))return false;let g=this.inConic;this.inConic=o.attrs["data-qrdx-conic"]!==void 0;try{let h=[q(d,a.x,a.y),q(d,a.x+a.width,a.y),q(d,a.x,a.y+a.height),q(d,a.x+a.width,a.y+a.height)],p=h.map(([L])=>L),b=h.map(([,L])=>L),_=Math.min(...p),y=Math.max(...p),w=Math.min(...b),C=Math.max(...b),S=Math.floor((_-l)/u),$=Math.ceil((y-l)/u)-1,M=Math.floor((w-c)/m),R=Math.ceil((C-c)/m)-1,E=($-S+1)*(R-M+1);if(E>4096)return !0;let P=(o.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),v=mt(n.matrix,f);for(let L=M;L<=R;L++)for(let F=S;F<=$;F++){let k=l+F*u,T=c+L*m,z=mt(v,[1,0,0,1,k,T]),W={x:_-k,y:w-T,width:y-_,height:C-w},D=P.length===2&&P.every(Number.isFinite)?I0(P[0],P[1],W):null,U=E>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:u,y:0},{op:"L",x:u,y:m},{op:"L",x:0,y:m},{op:"Z"}],z,!1);try{let X={matrix:z,viewport:n.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:r},xt=(lt,N)=>{for(let B of lt){if(B.name==="g"&&!B.attrs.transform){let Z=Number.parseFloat(B.attrs.opacity??"1");xt(B.children,{...N,opacity:(N.opacity??1)*(Number.isFinite(Z)?Z:1)});continue}if(D&&B.attrs["data-arc"]){let[Z,Pt]=B.attrs["data-arc"].split(/\s+/).map(Number);if(!v0([Z,Z+Pt],D))continue}this.walk(B,N);}};xt(o.children,X);}finally{U&&this.endClip();}}}finally{this.inConic=g,this.endClip();}return true}paintBleed(e,n,o,r){if(!this.shadedGradient(o))return false;let[a,i]=this.viewportMatrix({...e,attrs:{...e.attrs,x:"0",y:"0"}},{...n,matrix:mt(n.matrix,Qt(e.attrs.transform))}),s=Ae(a);if(!s)return false;let[l,c,u,m]=r,d=[[l,c],[u,c],[u,m],[l,m]].map(([g,h])=>q(s,g,h)).map(([g,h],p)=>({op:p===0?"M":"L",x:g,y:h}));return d.push({op:"Z"}),this.paint(d,{name:"rect",attrs:{},children:[],text:""},{...n,matrix:a,viewport:i,fill:o,fillRule:"nonzero",stroke:"none"}),true}beginClip(e,n,o){return false}endClip(){}clipOf(e,n){let o=j(e,"clip-path"),r=o?Vo.exec(o)?.[1]:void 0,a=r?this.clipPaths.get(r):void 0;if(!a)return null;let i=[],s=false;for(let l of a.children){let c=Hg(l,n.viewport);if(c.length===0)continue;let u=Qt(l.attrs.transform),m=u[0]===1&&u[1]===0&&u[2]===0&&u[3]===1&&u[4]===0&&u[5]===0;i.push(...m?c:c.map(f=>Gg(f,u))),s||=j(l,"clip-rule")==="evenodd";}return i.length>0?{segments:i,matrix:n.matrix,evenOdd:s}:null}viewportMatrix(e,n){let o=V(e.attrs.x,n.viewport[0]),r=V(e.attrs.y,n.viewport[1]),a=V(e.attrs.width,n.viewport[0],n.viewport[0]),i=V(e.attrs.height,n.viewport[1],n.viewport[1]),s=te(e.attrs.viewBox);if(s.length!==4||!(s[2]&&s[3]))return [mt(n.matrix,[1,0,0,1,o,r]),[a,i]];let[l,c,u,m]=s,f=a/u,d=i/m,g=o,h=r;if((e.attrs.preserveAspectRatio??"").trim()!=="none"){let p=e.attrs.preserveAspectRatio?.includes("slice")?Math.max(f,d):Math.min(f,d);g+=(a-u*p)/2,h+=(i-m*p)/2,f=p,d=p;}return [mt(n.matrix,[f,0,0,d,g-l*f,h-c*d]),[u,m]]}walk(e,n,o=false){if(o&&(this.clipPaths=gm(e,new Map),this.patterns=bm(e,new Map)),Ug.has(e.name)||j(e,"display")==="none"||j(e,"visibility")==="hidden")return;let r=mt(n.matrix,Qt(e.attrs.transform)),a=n.viewport;if(e.name==="svg"){let[f,d]=this.viewportMatrix(o?{...e,attrs:{...e.attrs,x:"0",y:"0"}}:e,{...n,matrix:r});r=f,a=d;}let i=j(e,"font-size"),s=Number.parseFloat(j(e,"opacity")??"1"),l=j(e,"fill-opacity"),c=l===void 0?n.fillOpacity??1:Number.parseFloat(l),u={fillOpacity:Number.isFinite(c)?Math.min(Math.max(c,0),1):1,opacity:(n.opacity??1)*(Number.isFinite(s)?Math.min(Math.max(s,0),1):1),matrix:r,viewport:a,fill:j(e,"fill")??n.fill,fillRule:j(e,"fill-rule")??n.fillRule,stroke:j(e,"stroke")??n.stroke,strokeWidth:j(e,"stroke-width")===void 0?n.strokeWidth:V(j(e,"stroke-width"),a[0],1),strokeLinejoin:j(e,"stroke-linejoin")??n.strokeLinejoin,strokeLinecap:j(e,"stroke-linecap")??n.strokeLinecap,fontSize:i===void 0?n.fontSize:V(i,16,16),fontWeight:j(e,"font-weight")??n.fontWeight,textAnchor:j(e,"text-anchor")??n.textAnchor},m=this.onPaper;(e.name==="rect"||e.name==="circle"||e.name==="path")&&Qg.test(j(e,"fill")??"")&&(this.onPaper=true);try{let f=e.attrs["clip-path"]?this.clipOf(e,u):null;if(f&&this.beginClip(f.segments,f.matrix,f.evenOdd)){try{this.paintNode(e,u);}finally{this.endClip();}return}this.paintNode(e,u);}finally{this.onPaper=m;}}paintNode(e,n){let[o,r]=n.viewport,a=(i,s)=>V(e.attrs[i],s);switch(e.name){case "path":this.paint(le(e.attrs.d??""),e,n);return;case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;this.paint(ne(a("x",o),a("y",r),a("width",o),a("height",r),V(i,o),V(s,r)),e,n);return}case "circle":{let i=a("r",Math.hypot(o,r)/Math.SQRT2);this.paint(ee(a("cx",o),a("cy",r),i,i),e,n);return}case "ellipse":this.paint(ee(a("cx",o),a("cy",r),a("rx",o),a("ry",r)),e,n);return;case "line":this.paint([{op:"M",x:a("x1",o),y:a("y1",r)},{op:"L",x:a("x2",o),y:a("y2",r)}],e,{...n,fill:"none"});return;case "polygon":case "polyline":{let i=te(e.attrs.points),s=[];for(let l=0;l+1<i.length;l+=2)s.push({op:l===0?"M":"L",x:i[l],y:i[l+1]});e.name==="polygon"&&s.length>0&&s.push({op:"Z"}),this.paint(s,e,n);return}case "text":this.text(e,n);return;case "image":this.image(e,n);return;default:for(let i of e.children)this.walk(i,n);}}};var Zo=1e3;async function Nr(t){let e=await Xt(Pe({...t,size:t.size??it},Zo));return decodeURIComponent(e.replace("data:image/svg+xml,",""))}function Ns(t){if(Nt(t.frame)){let e=Je(Zo,t.frame);return e.squareEdges?e.color:null}if(t.backdrop&&t.bgRadius){let e=dt.QrCode.encodeText(t.value,St[At(t)]).size,n=Et(e,t.margin??pt,t.shape);if(Un(t.bgRadius,e,n,t.shape)>0)return bt(t.backdrop,ft)}return bt(t.bgColor,ft)}function Ko(t,e){let n=Ns(t);if(!(n&&Fe(t.bgColor))||Nt(t.frame)||t.templateId||t.customTemplate)return n;let o=ye(e)?.children.find(a=>a.name==="rect"),r=o&&j(o,"fill");return r?.startsWith("url(")?r:n}function Jo(t,e){let n={r:255,g:255,b:255,a:1},o=at(bt(e.bgColor,ft));t.paper=n,t.background=o&&!Fe(e.bgColor)?o:null,t.backdrop=o?Lo(o,n):n;}var ta=25.4,_m=5,ym=2e3,be=Zo,Os=5,xm=2,Wg=.25*(ta/72);function qg(t,e="mm"){return e==="in"?t*ta:t}function Vg(t){let e=At(t),n=dt.QrCode.encodeText(t.value,St[e]).size;return n+Et(n,t.margin??pt,t.shape)*2}function ea(t,e){let n=qg(e.size,e.unit);if(!Number.isFinite(n)||n<_m||n>ym)throw new Error(`Print size must be between ${_m} mm and ${ym/1e3} m`);let o=Math.min(Math.max(e.bleed??0,0),20),r=n/be,a=Nt(t.frame)?Je(be,t.frame):null,i=(a?.width??be)*r,s=(a?.height??be)*r,l=e.cropMarks?o+xm+Os+1:o,c=Vg(t);return {codeWidth:n,trimWidth:i,trimHeight:s,bleed:o,pageWidth:i+2*l,pageHeight:s+2*l,trimX:l,trimY:l,moduleSize:n/c,moduleCount:c,maxScanDistance:n*10}}var Ds=class t{pdf;internals;names=new Map;constructor(e,n){this.pdf=e,this.internals=n;}static attach(e){let n=e.internal;return typeof e.advancedAPI!="function"||typeof e.addShadingPattern!="function"||typeof n.write!="function"||typeof n.events?.subscribe!="function"?null:new t(e,n)}name(e){let n=this.names.get(e);return n||(this.names.size===0&&this.install(),n=`Sh${this.names.size}`,this.names.set(e,n)),n}install(){this.pdf.advancedAPI(e=>{e.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[e,n]of this.names)this.internals.write(`/${n} ${e}`);});}},Bs=class extends jn{pdf;cmyk;images;shadingResources;constructor(e,n,o,r,a){super(o,r?.gradients??null),this.pdf=e,this.cmyk=n,this.images=a,this.shadingResources=r?.resources??null;}setColor(e,n){let o=e==="fill"?this.pdf.setFillColor.bind(this.pdf):e==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[r,a,i,s]=$e(n.r,n.g,n.b);o(r,a,i,s);}else o(Math.round(n.r),Math.round(n.g),Math.round(n.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(e,n){let o=false;for(let r of e)if(r.op==="M"){let[a,i]=q(n,r.x,r.y);this.pdf.moveTo(a,i),o=true;}else if(r.op==="L"){let[a,i]=q(n,r.x,r.y);o?this.pdf.lineTo(a,i):(this.pdf.moveTo(a,i),o=true);}else if(r.op==="C"){let[a,i]=q(n,r.x1,r.y1),[s,l]=q(n,r.x2,r.y2),[c,u]=q(n,r.x,r.y);this.pdf.curveTo(a,i,s,l,c,u);}else o&&this.pdf.close();}shade(e,n,o){let r=this.pdf.internal,a=r.scaleFactor,i=[a,0,0,-a,0,r.pageSize.getHeight()*a],s=mt(i,mt(n.matrix,o.matrix));if(!(this.shadingResources&&Ae(s)))return;let l=this.shadingResources.name(qo(o,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(e,n.matrix),this.pdf.clip(n.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),r.write(`${Wo(s)} cm /${l} sh`),this.pdf.restoreGraphicsState();}beginClip(e,n,o){return this.pdf.saveGraphicsState(),this.tracePath(e,n),this.pdf.clip(o?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(e,n,o){if(e>=1&&n>=1){o();return}this.pdf.saveGraphicsState();let r=this.pdf.GState;this.pdf.setGState(new r({opacity:e,"stroke-opacity":n}));try{o();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(e,n){let o=e.stops[0]?.color.a??1;return e.stops.every(a=>Math.abs(a.color.a-o)<.002)?{gradient:{...e,stops:e.stops.map(a=>({...a,color:{...a.color,a:1}}))},alpha:o*n}:{gradient:{...e,stops:e.stops.map(a=>({...a,color:this.flatten({...a.color,a:a.color.a*n})}))},alpha:1}}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);if(a&&"pattern"in a)this.paintPattern(e,o,a.pattern,a.alpha);else if(a&&"gradient"in a){let{gradient:m,alpha:f}=this.opaqueGradient(a.gradient,a.alpha);this.withAlpha(f,1,()=>this.shade(e,o,m));}let i=a&&"color"in a?a.color:null,s=i&&this.inConic?this.flatten(i):i,l=o.strokeWidth>0?this.resolveColor(o.stroke):null,c=l&&{...l,a:l.a*r};if(!(s||c))return;let u=o.fillRule==="evenodd";this.withAlpha(s?.a??1,c?.a??1,()=>{s&&this.setColor("fill",s);let m=c?jo(o):{join:0,cap:0};c&&(this.setColor("draw",c),this.pdf.setLineWidth(o.strokeWidth*Mn(o.matrix)),(m.join||m.cap)&&(this.pdf.setLineJoin(m.join),this.pdf.setLineCap(m.cap))),this.tracePath(e,o.matrix),s&&c?u?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():s?u?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(m.join||m.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Mn(n.matrix),[i,s]=q(n.matrix,V(e.attrs.x,n.viewport[0]),V(e.attrs.y,n.viewport[1])),l=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600;this.pdf.setFont("helvetica",l?"bold":"normal");let c=n.fontSize*a*(72/ta);this.pdf.setFontSize(c);let u=Number.parseFloat(e.attrs["data-max-width"]??"");if(u>0){let d=u*a,g=this.pdf.getTextWidth(o);g>d&&(c*=d/g,this.pdf.setFontSize(c));}this.setColor("text",r);let m=Math.atan2(n.matrix[1],n.matrix[0]);if(Math.abs(m)>2e-4){let d=n.textAnchor==="middle"?this.pdf.getTextWidth(o)/2:n.textAnchor==="end"?this.pdf.getTextWidth(o):0;this.pdf.text(o,i-d*Math.cos(m),s-d*Math.sin(m),{angle:-m*180/Math.PI,baseline:"alphabetic"});return}let f=n.textAnchor==="middle"?"center":n.textAnchor==="end"?"right":"left";this.pdf.text(o,i,s,{align:f,baseline:"alphabetic"});}aliases=new Map;image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o&&(Xo(o)?o:this.images.get(o)),a=r&&Xo(r);if(!(r&&a))return;let i=this.aliases.get(r);i||(i=`qrdx-image-${this.aliases.size}`,this.aliases.set(r,i));let s=null;if(e.attrs.preserveAspectRatio)try{let p=this.pdf.getImageProperties(r);s={width:p.width,height:p.height};}catch{s=null;}let l=pm(e,n.viewport,s);if(!l)return;let{draw:c,clip:u}=l,[m,f]=q(n.matrix,c.x,c.y),[d,g]=q(n.matrix,c.x+c.width,c.y+c.height),h=u!==null&&this.beginClip([{op:"M",x:u.x,y:u.y},{op:"L",x:u.x+u.width,y:u.y},{op:"L",x:u.x+u.width,y:u.y+u.height},{op:"L",x:u.x,y:u.y+u.height},{op:"Z"}],n.matrix,false);try{this.withAlpha(n.opacity??1,1,()=>{this.pdf.addImage(r,a,Math.min(m,d),Math.min(f,g),Math.abs(d-m),Math.abs(g-f),i);});}finally{h&&this.endClip();}}};function jg(t,e,n){let{trimX:o,trimY:r,trimWidth:a,trimHeight:i,bleed:s}=n,l=s+xm,c=o,u=o+a,m=r,f=r+i;e.setRegistrationColor(),t.setLineWidth(Wg);for(let d of [c,u]){let g=d===c?-1:1;for(let h of [m,f]){let p=h===m?-1:1;t.line(d+g*l,h,d+g*(l+Os),h),t.line(d,h+p*l,d,h+p*(l+Os));}}}async function Xg(t,e){return (await $m(t,e)).output("dataurlstring")}async function ix(t,e){return (await $m(t,e)).output("arraybuffer")}async function $m(t,e){let n=ea(t,e),o;try{({jsPDF:o}=await import('jspdf'));}catch(b){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${b})`)}let r=await Nr(t),a=ye(r);if(!a)throw new Error("Failed to render the QR code for printing");let i=new Map;for(let b of Fr(a,new Set))if(!Xo(b)){let _=await Yo(b);_&&i.set(b,_);}let s=new o({orientation:n.pageWidth>n.pageHeight?"landscape":"portrait",unit:"mm",format:[n.pageWidth,n.pageHeight],compress:true,floatPrecision:3});s.setProperties({title:"QR code",creator:"qrdx"});let l=zo(a),c=l.size>0?Ds.attach(s):null,u=new Bs(s,e.colorMode==="cmyk",kr(a,new Map),c?{gradients:l,resources:c}:null,i);Jo(u,t);let m=n.codeWidth/be,f=V(a.attrs.width,be,be),d=V(a.attrs.height,be,be),g={matrix:mt([1,0,0,1,n.trimX,n.trimY],[m,0,0,m,0,0]),viewport:[f,d],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},h=n.bleed>0?Ko(t,r):null,p=[n.trimX-n.bleed,n.trimY-n.bleed,n.trimX+n.trimWidth+n.bleed,n.trimY+n.trimHeight+n.bleed];if(!(h&&u.paintBleed(a,g,h,p))){let b=h?u.resolveColor(h):null;b&&(u.setColor("fill",b),s.rect(n.trimX-n.bleed,n.trimY-n.bleed,n.trimWidth+2*n.bleed,n.trimHeight+2*n.bleed,"F"));}return u.walk(a,g,true),e.cropMarks&&jg(s,u,n),s}async function Yg(t,e){let n=ea(t,{size:e.size,unit:e.unit}),o=await Nr(t),r=e.unit??"mm",a=l=>`${x(r==="in"?l/ta:l)}${r}`,i=/^<svg\b[^>]*>/.exec(o)?.[0];if(!i)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
2
+ ${i.replace(/\swidth="[^"]*"/,` width="${a(n.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${a(n.trimHeight)}"`)}${o.slice(i.length)}`}async function sx(t,e){let n=await Xg(t,e);Bt(n,e.filename??"qr-code-print.pdf");}async function lx(t,e){let n=await Yg(t,e);Bt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,e.filename??"qr-code-print.svg");}var Zg=[137,80,78,71,13,10,26,10];async function wm(t,e){let n=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(n).arrayBuffer())}async function Cm(t){return typeof CompressionStream>"u"?null:await wm(t,new CompressionStream("deflate"))}async function Kg(t){if(typeof DecompressionStream>"u")return null;try{return await wm(t,new DecompressionStream("deflate"))}catch{return null}}var Gs=(t,e)=>t[e]*2**24+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3]>>>0,Sm={0:1,2:3,3:1,4:2,6:4};function Jg(t,e,n){let o=t+e-n,r=Math.abs(o-t),a=Math.abs(o-e),i=Math.abs(o-n);return r<=a&&r<=i?t:a<=i?e:n}async function Qs(t){if(Zg.some((h,p)=>t[p]!==h))return null;let e=8,n=0,o=0,r=-1,a=null,i=null,s=[];for(;e+8<=t.length;){let h=Gs(t,e),p=String.fromCharCode(...t.subarray(e+4,e+8)),b=t.subarray(e+8,e+8+h);if(e+=12+h,p==="IHDR"){n=Gs(b,0),o=Gs(b,4);let _=b[8];r=b[9];let y=b[12];if(_!==8||y!==0||!(r in Sm))return null}else if(p==="PLTE")a=b;else if(p==="tRNS")i=b;else if(p==="IDAT")s.push(b);else if(p==="IEND")break}if(!(n&&o)||n*o>4096*4096)return null;let l=new Uint8Array(s.reduce((h,p)=>h+p.length,0)),c=0;for(let h of s)l.set(h,c),c+=h.length;let u=await Kg(l),m=Sm[r],f=n*m;if(!u||u.length<o*(f+1))return null;let d=new Uint8Array(o*f);for(let h=0;h<o;h++){let p=u[h*(f+1)],b=u.subarray(h*(f+1)+1,(h+1)*(f+1)),_=h*f;for(let y=0;y<f;y++){let w=y>=m?d[_+y-m]:0,C=h>0?d[_-f+y]:0,S=h>0&&y>=m?d[_-f+y-m]:0,$=b[y],M=0;p===1?M=w:p===2?M=C:p===3?M=w+C>>1:p===4&&(M=Jg(w,C,S)),d[_+y]=$+M&255;}}let g=new Uint8Array(n*o*4);for(let h=0;h<n*o;h++){let p=h*4,b=h*m;if(r===3){let _=d[b];g[p]=a?.[_*3]??0,g[p+1]=a?.[_*3+1]??0,g[p+2]=a?.[_*3+2]??0,g[p+3]=i?.[_]??255;}else if(r===0||r===4){let _=d[b];g[p]=_,g[p+1]=_,g[p+2]=_,g[p+3]=r===4?d[b+1]:255;}else g[p]=d[b],g[p+1]=d[b+1],g[p+2]=d[b+2],g[p+3]=r===6?d[b+3]:255;}return {width:n,height:o,data:g}}var t2=25.4,Mm=72/t2,e2=50;function n2(t){let e=/^data:[^,]*?(;base64)?,(.*)$/s.exec(t);if(!e)return null;try{let n=e[1]?atob(e[2]):decodeURIComponent(e[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r)&255;return o}catch{return null}}function r2(t){if(t[0]!==255||t[1]!==216)return null;let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let n=t[e+1];if(n===216||n>=208&&n<=215){e+=2;continue}let o=t[e+2]<<8|t[e+3];if(n===192||n===193||n===194){let r=t[e+5]<<8|t[e+6],a=t[e+7]<<8|t[e+8],i=t[e+9];return {width:a,height:r,components:i,progressive:n===194}}e+=2+o;}return null}async function o2(t,e){let{width:n,height:o,data:r}=t,a=e?4:3,i=new Uint8Array(n*o*a);for(let l=0;l<n*o;l++){let c=r[l*4+3]/255,u=r[l*4]*c+255*(1-c),m=r[l*4+1]*c+255*(1-c),f=r[l*4+2]*c+255*(1-c);if(e){let[d,g,h,p]=$e(u,m,f);i.set([d*255,g*255,h*255,p*255].map(Math.round),l*a);}else i.set([Math.round(u),Math.round(m),Math.round(f)],l*a);}let s=await Cm(i);return {kind:"raw",width:n,height:o,components:a,bytes:s??i,compressed:!!s}}async function a2(t,e){let n=t;if(!/^data:image\/(png|jpe?g)[;,]/i.test(n)){let i=await Yo(n);if(!i)return null;n=i;}let o=n2(n);if(!o)return null;let r=r2(o);if(r)return r.components===1||r.components===3?{kind:"jpeg",width:r.width,height:r.height,components:r.components,bytes:o,progressive:r.progressive}:null;let a=await Qs(o);return a?await o2(a,e):null}function i2(t){let e="",n=0,o=r=>{e+=r,n+=r.length,n>=76&&(e+=`
3
+ `,n=0);};for(let r=0;r<t.length;r+=4){let a=Math.min(4,t.length-r),i=0;for(let l=0;l<4;l++)i=i*256+(l<a?t[r+l]:0);if(i===0&&a===4){o("z");continue}let s=[];for(let l=0;l<5;l++)s.unshift(String.fromCharCode(i%85+33)),i=Math.floor(i/85);o(s.slice(0,a+1).join(""));}return `${e}~>`}var s2=`/qrdxdict 40 dict def
4
4
  qrdxdict begin
5
5
  /m {moveto} bind def
6
6
  /l {lineto} bind def
@@ -21,11 +21,11 @@ qrdxdict begin
21
21
  } bind def
22
22
  /QRDX-Regular /Helvetica latin1
23
23
  /QRDX-Bold /Helvetica-Bold latin1
24
- end`;function Qs(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:n==="\u2026"?e+="...":o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var Us=class extends jn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=$e(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,s]=q(n,a.x,a.y);o.push(`${x(i)} ${x(s)} m`),r=true;}else if(a.op==="L"){let[i,s]=q(n,a.x,a.y);o.push(`${x(i)} ${x(s)} l`);}else if(a.op==="C"){if(!r)continue;let[i,s]=q(n,a.x1,a.y1),[l,c]=q(n,a.x2,a.y2),[u,m]=q(n,a.x,a.y);o.push(`${x(i)} ${x(s)} ${x(l)} ${x(c)} ${x(u)} ${x(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=mt(n.matrix,o.matrix);if(!Ae(r))return;let a=qo(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let s=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${s} n [${Wo(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&this.flatten({...s,a:s.a*r});if(!(i||l))return;let c=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";if(i&&l?this.out.push(`gsave ${this.color(i)} ${c} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${c} ${u}`),l){let m=`${this.color(l)} ${x(o.strokeWidth*Mn(o.matrix))} w ${c} s`,{join:f,cap:d}=jo(o);this.out.push(f||d?`gsave ${f} setlinejoin ${d} setlinecap ${m} grestore`:m);}}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Mn(n.matrix),[i,s]=q(n.matrix,V(e.attrs.x,n.viewport[0]),V(e.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=x(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${x(m*a)} gt {${x(m*a)} exch div ${u} mul ${c} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",g=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(g)>.01){this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${x(i)} ${x(s)} translate ${x(g)} rotate ${Qs(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${Qs(o)}${f} ${x(i)} ${x(s)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=V(e.attrs.x,n.viewport[0]),i=V(e.attrs.y,n.viewport[1]),s=V(e.attrs.width,n.viewport[0]),l=V(e.attrs.height,n.viewport[1]);if(s<=0||l<=0)return;let[c,u]=q(n.matrix,a,i),[m,f]=q(n.matrix,a+s,i+l),{components:d}=r,g=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),p="/ASCII85Decode filter";r.kind==="jpeg"?(p+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(p+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(c,m))} ${x(Math.min(u,f))} translate ${x(Math.abs(m-c))} ${x(Math.abs(f-u))} scale`,`${g} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${p} >> image`,n2(r.bytes),"grestore"].join(`
25
- `));}};async function Mm(t,e={}){let n=ye(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=V(n.attrs.width,0,0)||512,r=V(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,s=r*i,l=Math.max(0,e.bleed??0),c=a+2*l,u=s+2*l,m=e.colorMode==="cmyk",f=new Map;for(let _ of Fr(n,new Set)){let y=await e2(_,m);y&&f.set(_,y);}let d=new Us(m,kr(n,new Map),zo(n),f);Jo(d,{bgColor:e.background??"#ffffff"});let h={matrix:mt([1,0,0,-1,l,u-l],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},p=l>0?e.bleedColor??void 0:void 0;if(!(p&&d.paintBleed(n,h,p,[0,0,c,u]))){let _=p?d.resolveColor(p):null;_&&d.rect(_,0,0,c,u);}d.walk(n,h,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(c)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${x(c)} ${x(u)}`,`%%Title: ${Qs(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",r2,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([_,y])=>`/${y} ${_} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
- `)}var Rm="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function Em(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function na(t,e={}){if(Em(t))throw new Error(Rm);let n=ea(t,{size:e.sizeMm??Zg,unit:"mm",bleed:e.bleedMm}),o=await Nr(t);return await Mm(o,{width:n.trimWidth*Cm,bleed:n.bleed*Cm,bleedColor:n.bleed>0?Ko(t,o):Fs(t),colorMode:e.colorMode,background:bt(t.bgColor,ft)})}function ra(t){return `data:application/postscript;base64,${btoa(t)}`}async function o2(t,e={}){let n=await na(t,e);Bt(ra(n),e.filename??"qr-code-print.eps");}var Hs={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},bmp:{mimeType:"image/bmp",extension:"bmp",vector:false},gif:{mimeType:Ir,extension:"gif",vector:false},ico:{mimeType:on,extension:"ico",vector:false,sizes:Go},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},Ex={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function zs(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function Pe(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function Bt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Am=t=>(Hs[t]??Hs.png).mimeType;function a2(t,e,n){let{extension:o,vector:r,sizes:a}=Hs[t];if(r||a)return `qr-code.${o}`;let{width:i,height:s}=me(e.width,n);return `qr-code-${Math.round(i)}x${Math.round(s)}.${o}`}async function Pm(t,e={}){let n=await ge(t,"image/webp",true);try{return await Ho(n,e)}finally{n.remove();}}async function Im(t){let e=await ge(t,"image/png",true);try{return ro(e)}finally{e.remove();}}async function vm(t){let e=await ge(t,"image/png",true);try{return await Bo(e,t.value)}finally{e.remove();}}async function Lm(t,e=Go){let n=[];try{for(let o of e)n.push(await ge(Pe({...t,frame:void 0},o),"image/png",!0));return Cs(n)}finally{for(let o of n)o.remove();}}var i2=25.4/72;async function Tm(t){let e=await na(t,{sizeMm:(t.size??it)*i2});return ra(e)}async function km(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await Xt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=me(t.size||it,t.frame),s=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),l=s.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(l,"PNG",0,0,c,u),s.remove(),m.output("dataurlstring")}async function Ax(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=zs(o.width,o.height);if(!i.isValid)throw new Error(i.error);let s=Pe(t,o.width),l=r||a2(n,o,t.frame);try{if(n==="svg"){let c=await Xt(s);Bt(c,l);}else if(n==="pdf"){let c=await km(s);Bt(c,l);}else if(n==="eps")Bt(await Tm(s),l);else if(n==="webp"){let c=await Pm(s,{quality:a});Bt(await Ot(c),l);}else if(n==="bmp"){let c=await Im(s);Bt(await Ot(c),l);}else if(n==="gif"){let c=await vm(s);Bt(await Ot(c),l);}else if(n==="ico"){let c=await Lm(s);Bt(await Ot(c),l);}else {let c=Am(n),u=await ge(s,c);if(typeof u=="string")Bt(u,l);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function Px(t,e,n,o={}){let r=zs(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=Pe(t,n.width);if(e==="svg")return await Xt(a);if(e==="pdf")return await km(a);if(e==="eps")return await Tm(a);if(e==="webp")return await Ot(await Pm(a,o));if(e==="bmp")return await Ot(await Im(a));if(e==="gif")return await Ot(await vm(a));if(e==="ico")return await Ot(await Lm(a));let i=Am(e),s=await ge(a,i);if(typeof s=="string")return s;throw new Error("Failed to generate QR code data URL")}async function Ix(t,e={width:it,height:it}){try{let n=zs(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=Pe(t,e.width),r=ge(o,"image/png",!0).then(a=>new Promise((i,s)=>{let l=a;l.toBlob(c=>{l.remove(),c?i(c):s(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function vx(t){let e=await Xt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Dt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},rt=class extends Error{},s2={script:t=>`Removed ${yt(t,"script")}`,style:t=>`Removed ${yt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${yt(t,"foreignObject element")}`,image:t=>`Removed ${yt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${yt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${yt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${yt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${yt(t,"animation")}`,unknown:t=>`Removed ${yt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${yt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${yt(t,"event handler attribute")}`,links:t=>`Removed ${yt(t,"link")} (href)`,"external-paint":t=>`Removed ${yt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${yt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${yt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${yt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${yt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${yt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${yt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${yt(t,"shape")} outside the artboard`,colors:t=>`Merged ${yt(t,"color")} with similar ones (${Dt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function yt(t,e){return `${t} ${e}${t===1?"":"s"}`}var js=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:s2[e](n)}))}},l2=/^\s*<\?xml\s[^?>]*\?>/,Ws=/[A-Za-z_][\w:.-]*/y,qs=/<\/([A-Za-z_][\w:.-]*)\s*>/y,oa=/\s*/y,c2=/[A-Za-z_:][\w:.-]*/y,u2=/[^"<]*/y,m2=/[^'<]*/y;function Xn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Fm(t,e){let n=Xn(oa,t,e),o=Xn(c2,t,n);if(n===e||o===n)return -1;let r=Xn(oa,t,o);if(t[r]!=="=")return -1;let a=Xn(oa,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let l=Xn(i==='"'?u2:m2,t,a+1);return t[l]===i?l+1:-1}function d2(t,e){let n=Xn(oa,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function f2(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let c=t.indexOf("-->",r+4);if(c<0)throw new rt("The SVG has an unclosed comment");r=c+3;continue}if(t.startsWith("<![CDATA[",r)){let c=t.indexOf("]]>",r+9);if(c<0)throw new rt("The SVG has an unclosed CDATA section");r=c+3;continue}if(t.startsWith("<?",r)){let c=t.indexOf("?>",r+2);if(c<0)throw new rt("The SVG has an unclosed declaration");r=c+2;continue}if(t.startsWith("<!",r))throw new rt("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){qs.lastIndex=r;let c=qs.exec(t);if(!c)throw new rt("The SVG has a malformed closing tag");if(e.pop()!==c[1])throw new rt(`The SVG closes <${c[1]}> out of order`);r=qs.lastIndex;continue}Ws.lastIndex=r+1;let i=Ws.exec(t);if(!i)throw new rt("The SVG has a malformed tag");let s=Ws.lastIndex;for(let c=Fm(t,s);c>=0;c=Fm(t,s))s=c;let l=d2(t,s);if(!l)throw new rt(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Dt.maxElements)throw new rt(`The SVG has more than ${Dt.maxElements} elements`);if(o||(o=i[0]),!l.selfClosing&&(e.push(i[0]),e.length>Dt.maxDepth))throw new rt(`The SVG nests elements more than ${Dt.maxDepth} deep`);r=l.end;}if(e.length>0)throw new rt(`The SVG doesn't close <${e.at(-1)}>`);return o}function h2(t){if(typeof t!="string")throw new rt("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Dt.maxBytes)throw new rt(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Dt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new rt("DOCTYPE and entity declarations are not allowed");let n=t.replace(l2,"");if(n.includes("<?"))throw new rt("Processing instructions (such as xml-stylesheet) are not allowed");if(f2(n)!=="svg")throw new rt("The file must start with an <svg> element");return n}var Vs=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Yt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Xs(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],s=i?n.get(i):void 0;return s?(o.add("gradient"),Xs(s,e,n,o)):(o.add("external-paint"),null)}let a=at(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${Vs(a.r)}${Vs(a.g)}${Vs(a.b)}`:(o.add("invalid-paint"),null)}function p2(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(l=>l.name==="stop");if(!i){let l=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=l?e.get(l)?.children.find(c=>c.name==="stop"):void 0;}let s=i&&Yt(j(i,"stop-color"));s&&o.set(r,s);}return o}function Nm(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=q(e,n.x1,n.y1),[s,l]=q(e,n.x2,n.y2),[c,u]=q(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:s,y2:l,x:c,y:u}}let[o,r]=q(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function g2(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Zs(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Ie=t=>Number.isFinite(t);function ht(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Ie(o)?o:n}function Om(t){switch(t.name){case "path":return le(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return ne(ht(t,"x"),ht(t,"y"),ht(t,"width"),ht(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ht(t,"r");return ee(ht(t,"cx"),ht(t,"cy"),e,e)}case "ellipse":return ee(ht(t,"cx"),ht(t,"cy"),ht(t,"rx"),ht(t,"ry"));case "polygon":case "polyline":{let e=te(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Zs(n)}default:return []}}function b2(t,e){let n=e/2;switch(t.name){case "rect":{let o=ht(t,"x"),r=ht(t,"y"),a=ht(t,"width"),i=ht(t,"height"),s=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,l=ne(o-n,r-n,a+e,i+e,s>0?s+n:0,s>0?s+n:0);if(a<=e||i<=e)return l;let c=Math.max(s-n,0);return [...l,...ne(o+n,r+n,a-e,i-e,c,c)]}case "circle":case "ellipse":{let o=ht(t,"cx"),r=ht(t,"cy"),a=t.name==="circle"?ht(t,"r"):ht(t,"rx"),i=t.name==="circle"?ht(t,"r"):ht(t,"ry"),s=ee(o,r,a+n,i+n);return a<=n||i<=n?s:[...s,...ee(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>ht(t,m)),s=Math.hypot(a-o,i-r);if(s===0)return [];let l=-(i-r)/s*n,c=(a-o)/s*n,u=[[o+l,r+c],[a+l,i+c],[a-l,i-c],[o-l,r-c]];return Zs(g2(u)<0?u.reverse():u)}default:return null}}var _2=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),y2=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),x2={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},$2=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Bm(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Gm(t,e,n,o,r){if(Bm(t,o),Yt(j(t,"display"))==="none"||Yt(j(t,"visibility"))==="hidden")return;let a=Number.parseFloat(j(t,"opacity")??"1"),i=Yt(j(t,"fill-rule")),s=Number.parseFloat(Yt(j(t,"stroke-width"))??""),l={matrix:mt(e.matrix,Qt(t.attrs.transform)),fill:Yt(j(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Yt(j(t,"stroke"))??e.stroke,strokeWidth:Ie(s)&&s>=0?s:e.strokeWidth,color:Yt(j(t,"color"))??e.color,opacity:e.opacity*(Ie(a)?a:1)};for(let c of t.children){if(y2.has(c.name))continue;let u=x2[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){Gm(c,l,n,o,r);continue}if(!_2.has(c.name)){o.add("unknown");continue}S2(c,l,n,o,r);}}function S2(t,e,n,o,r){if(Bm(t,o),Yt(j(t,"display"))==="none"||Yt(j(t,"visibility"))==="hidden")return;let a=mt(e.matrix,Qt(t.attrs.transform));if(t.name==="rect"&&$2.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=Qe(Nm(Om(t),a));return}let i=p=>Yt(j(t,p)),s=e.opacity*Number.parseFloat(i("opacity")??"1"),l=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Ie(f)&&f>=0?f:e.strokeWidth,g=(p,b,_)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Dt.maxInputSegments)throw new rt(`The SVG has more than ${Dt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Nm(p,a),fill:b,fillRule:_});}},h=p=>{let b=(Ie(s)?s:1)*(Ie(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=Xs(m.fill,m,n,o);p&&h(l)&&g(Om(t),p,m.fillRule);}if(d>0&&m.stroke!=="none"){let p=Xs(m.stroke,m,n,o);if(p&&h(c)){let b=b2(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function w2(t,e){let n=c=>{let u=10**e;return Math.round(c*u)/u+0},o=c=>x(c,e),r="",a=0,i=0,s=0,l=0;for(let c of t){if(c.op==="Z"){r+="z",a=s,i=l;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,s=u,l=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var C2=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function M2(t){let e=[];for(let n of t){let o=Qe(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>C2(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Ys=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function R2(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],s=[i[0],i[1]],l=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let g=d+1;g<i.length;g++){let h=Ys(i[d]),p=Ys(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<l&&(l=b,s=[i[d],i[g]]);}let[c,u]=s,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Dm=t=>{let[e,n,o]=Ys(t);return .2126*e+.7152*n+.0722*o>235};function E2(t,e={}){let n=new js;try{let o=h2(t),r=ye(o);if(!r)throw new rt("No <svg> element found");let a=te(r.attrs.viewBox),[i,s,l,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,s,l,c]=a:(l=ht(r,"width"),c=ht(r,"height")),!(Ie(l)&&Ie(c)&&l>0&&c>0))throw new rt("The SVG needs a viewBox (or a width and height)");let m=Dt.artboardSide/Math.max(l,c),f=Math.round(l*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<ot.minArtboard)throw new rt("The artboard is too narrow: its sides may differ by 20 times at most");let g=[m,0,0,m,-i*m,-s*m],h={shapes:[],qrBox:null,segments:0};Gm(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},p2(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,w=0;for(let N of h.shapes){let B=Qe(N.segments);if(!B||B.x1<=0||B.y1<=0||B.x0>=f||B.y0>=d){y++;continue}if(B.x0<-b||B.y0<-b||B.x1>f+b||B.y1>d+b){let Z=Xr(N.segments,.25).map(Pt=>Sn(Pt,p)).filter(Pt=>Pt.length>2);if(Z.length===0){y++;continue}w++,_.push({...N,segments:Z.flatMap(Pt=>Zs(Pt))});}else _.push(N);}if(y>0&&n.add("outside",y),w>0&&n.add("clipped",w),_.length===0)throw new rt("The SVG has no filled shapes to use");let C=R2(_,Dt.maxColors,n);for(let N of _)N.fill=C.get(N.fill)??N.fill;let S=new Map,$=new Map;for(let N of _){let B=Qe(N.segments);S.set(N.fill,(S.get(N.fill)??0)+(B.x1-B.x0)*(B.y1-B.y0)),$.set(N.fill,($.get(N.fill)??0)+1);}let M=[...S.keys()].sort((N,B)=>Number(Dm(N))-Number(Dm(B))||S.get(B)-S.get(N)),R=M[0],E=M[1],P=N=>N===R?"frame":N===E?"accent":N,v=h.qrBox;if(!v&&e.qr){let[N,B]=q(g,e.qr.x,e.qr.y);v={x0:N,y0:B,x1:N+e.qr.size*m,y1:B+e.qr.size*m};}let L,F,k;v?(L=Math.min(v.x1-v.x0,v.y1-v.y0),F=(v.x0+v.x1-L)/2,k=(v.y0+v.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,F=(f-L)/2,k=(d-L)/2);let T=N=>Math.round(N*10)/10+0;if(L=Math.floor(L*10)/10,F=T(F),k=T(k),L<Math.min(f,d)*ot.minQrShare)throw new rt("The QR area must be at least half the frame's shorter side");let z=Math.min(F,k,f-F-L,d-k-L);if(z<L*ot.minPadding-1e-9)throw new rt("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let W=Math.min(Math.max(e.padding??Dt.padding,ot.minPadding),.2),D=Math.floor(Math.min(L*W,z)*10)/10,U=M2(_);if(U.length>ot.maxShapes)throw new rt(`The artwork has ${U.length} separate shapes; the limit is ${ot.maxShapes}. Combine shapes of the same color first`);let X={kind:rr,version:or,artboard:{width:f,height:d},qr:{x:F,y:k,size:L,padding:D},colors:{frame:R,...E&&{accent:E}},shapes:U.map(N=>({type:"path",d:w2(N.segments,Dt.decimals),fill:P(N.fill),...N.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},xt=uo(X);if(!xt.success){let N=xt.issues[0];throw new rt(`The converted frame doesn't fit the frame format: ${N?.message??"invalid"}`)}let lt=M.map(N=>({color:N,ref:N===R?"frame":N===E?"accent":"fixed",shapes:$.get(N)??0}));return {ok:!0,spec:xt.data,warnings:n.list(),palette:lt}}catch(o){return {ok:false,error:o instanceof rt?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var A2=1114,P2={"call-to-action":134,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28,objects:28,playful:44};var I2=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"},{id:"objects",label:"Everyday objects"},{id:"playful",label:"Playful & surprising"}];function Ks(t){return Array.isArray(t)?`[${t.map(Ks).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Ks(t[n])}`).join(",")}}`:JSON.stringify(t)}function v2(t){let e=Ks(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function L2(t,e){return dt.QrCode.encodeText(t,St[e??Jt]).size}function Qm(t,e,n,o=n.size*(e?.size??Ia)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=L2(n.value,n.level),s=Et(i,n.margin,n.shape),l=n.size/(i+2*s);if(e.padding&&(r.padding=e.padding*l),a){let c=i*l,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(e.x),r.y=u(e.y);}return r}function Um(t,e,n,o){let r=n.level??Jt,a=r;o&&(a=At({...n,imageSettings:Qm(t,e,n),autoLevel:o}));let i=l=>{let c=m=>Qm(t,e,{...n,level:l},m),u=Wi(n,[l],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let s=i(a);return s&&At({...n,imageSettings:s,autoLevel:o})===a?s:i(r)}function T2({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let s=Um("data:,",{...a,size:Pa},{value:`${t}`,size:1024,margin:n??pt,level:e,shape:o},r);return s?s.width/1024:0}function Js({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:s,logo:l,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:_,shape:y,eyeShapes:w,eyeGradient:C,bgRadius:S,backdrop:$,halo:M,shadow:R}){let E={value:`${t}`,size:e,margin:u??pt,level:d,shape:y},P=!s&&l?Um(l,c,E,_):void 0;return {value:E.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:u,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&y!=="square"&&{shape:y},...w&&{eyeShapes:w},...C&&C!=="corner"&&{eyeGradient:C},...S&&{bgRadius:S},...$&&{backdrop:$},...M&&{halo:M},...R&&{shadow:R},...P&&{imageSettings:P}}}var Hm=.06,zm=.16,Wm=512;function qm(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=ei({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),s=new Int32Array(e*n),l=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=zm||(i[d]=1,s[c++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;l<c;){let d=s[l++],g=d%e;g>0&&u(d-1),g<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-Hm)/(zm-Hm))),h=d*4;if(m[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let _=(o[h+p]/255-(1-g)*f[p])/g;m[h+p]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:e,height:n,data:m}}async function k2(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(s=>{let l=new Image;l.crossOrigin="anonymous",l.onload=()=>s(l),l.onerror=()=>s(null),l.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,Wm/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let s=i.getImageData(0,0,a.width,a.height),l=qm(s);return l?(s.data.set(l.data),i.putImageData(s,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}async function F2(t){let{value:e,size:n=it,level:o=Jt,bgColor:r=ft,fgColor:a=Rt,margin:i=pt,imageSettings:s,eyeColor:l,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,eyeShapes:C,eyeGradient:S,bgRadius:$,backdrop:M,halo:R,shadow:E,frameLabelMarkers:P,partMarkers:v,autoLevel:L,...F}=t,k=Gn({value:e,size:n,margin:i,level:o,autoLevel:L},s),T=At({value:e,size:n,level:o,margin:i,imageSettings:k,autoLevel:L}),z=dt.QrCode.encodeText(e,St[T]).getModules(),W=z.length+i*2,D=Re(z,n,i,k),U=null;if(k!=null&&D!=null){D.excavation!=null&&(z=hs(z,D.excavation));let xt=k.src.startsWith("data:")?k.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(k.src)}&w=100&h=100&encoding=base64`).then(lt=>{if(!lt.ok)throw new Error(`Failed to load QR logo (${lt.status}): ${k.src}`);return lt.text()});U={settings:{...k,src:xt},box:{x:D.x+i,y:D.y+i,w:D.w,h:D.h}};}let X=T0(z,i);return {size:n,numCells:W,fgPath:X,bgColor:r,fgColor:a,frame:b,svgProps:F,logo:U}}function N2(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:s,logo:l}=t,c=Nt(i),u=l?Co(l.settings,l.box):A(Ut,{}),m=$t("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...c?{}:s,children:[A("path",{d:`M0,0 h${n}v${n}H0z`,fill:bt(r,ft),shapeRendering:"crispEdges"}),A("path",{d:o,fill:bt(a,Rt),shapeRendering:"crispEdges"}),u]});return c&&i?$r(m,{size:e,frame:i,bgColor:r,svgProps:s}):m}async function O2(t){return N2(await F2(t))}var D2={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,eyeShapes:true,eyeGradient:true,bgRadius:true,backdrop:true,halo:true,shadow:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function B2(t){let e={};for(let n of Object.keys(t))Object.hasOwn(D2,n)||(e[n]=t[n]);return e}var G2=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function Vm(t){let e=Object.fromEntries(G2.map(n=>[n,t[n]]));return Js({...e,margin:t.margin??pt})}function jm(t,e){let{size:n=it,scale:o=1,level:r,style:a,customTemplate:i,customProps:s,frame:l,art:c,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p={...e.eyeShapes&&{eyeShapes:e.eyeShapes},...e.eyeGradient&&{eyeGradient:e.eyeGradient},...e.bgRadius&&{bgRadius:e.bgRadius},...e.backdrop&&{backdrop:e.backdrop},...e.halo&&{halo:e.halo},...e.shadow&&{shadow:e.shadow}},b=n*o,_=b/e.size,y=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*_,width:e.imageSettings.width*_,...e.imageSettings.x!=null&&{x:e.imageSettings.x*_},...e.imageSettings.y!=null&&{y:e.imageSettings.y*_},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*_}};return {art:c,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:s,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:l,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p,...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:b,style:a,templateId:e.templateId,value:e.value,...y&&{imageSettings:y},...B2(t)}}function Q2(t){return jm(t,Vm(t))}function Xm(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!ze(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:s}=r;if(An(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let l={};for(let c of Object.keys(i)){let u=Vn(c,i[c]);u&&(l[u.name]=u.value);}n.push(e(a,l,Xm(i.children,e),s));};return o(t),n}var Yn=300,Or=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function U2(t){let e=Or(t.x)??0,n=Or(t.y)??0,o=te(typeof t.viewBox=="string"?t.viewBox:void 0),r=Or(t.width),a=Or(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,s,l,c]=o,u=Math.min(r/l,a/c);return [u,0,0,u,e+(r-l*u)/2-i*u,n+(a-c*u)/2-s*u]}function tl(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let s of t){let l=tl(s,e,n,false);if(l)return l}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=mt(n,Qt(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=mt(i,U2(a))),tl(a.children,e,i,false)}function el(t){let e=t.customTemplate||(t.templateId?vo(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:Yn,viewBox:`0 0 ${Yn} ${Yn}`,width:Yn},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=te(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:Or(r.width),s=tl(o,n,Cn,true);if(!(s&&i))return 1;let[l,c]=q(s,0,0),[u,m]=q(s,Yn,Yn),d=Math.min(Math.abs(u-l),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var nd=[96,160,320],rl=640;function al(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Le(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var rd=()=>new Promise(t=>setTimeout(t,0));async function il(){let{default:t}=await import('jsqr');return t}function ol(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function H2(t,e,n=.7){let{data:o,width:r,height:a}=t;for(let u=0;u<o.length;u+=4)for(let m=0;m<3;m++)o[u+m]=128+(o[u+m]-128)*n;let i=Math.max(1,Math.round(e*.25)),s=2*i+1,l=new Float32Array(r*a*3),c=u=>{let m=u?a:r,f=u?r:a,d=u?r:1,g=u?1:r;for(let h=0;h<m;h++){let p=h*d,b=0,_=0,y=0;for(let w=-i;w<=i;w++){let C=(p+Math.min(Math.max(w,0),f-1)*g)*4;b+=o[C],_+=o[C+1],y+=o[C+2];}for(let w=0;w<f;w++){let C=(p+w*g)*3;l[C]=b/s,l[C+1]=_/s,l[C+2]=y/s;let S=(p+Math.max(w-i,0)*g)*4,$=(p+Math.min(w+i+1,f-1)*g)*4;b=b-o[S]+o[$],_=_-o[S+1]+o[$+1],y=y-o[S+2]+o[$+2];}}for(let h=0,p=0;h<r*a*3;h+=3,p+=4)o[p]=l[h],o[p+1]=l[h+1],o[p+2]=l[h+2];};for(let u=0;u<2;u++)c(true),c(false);}function Zn(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var z2=[.9,1,1.1];function sl(t,e,n,o,r){let a=0;for(let i of z2){let s=n*i,l=e(s);H2(l,s/o),r(t(l.data,l.width,l.height))&&a++;}return a>=2?"pass":a===1?"fragile":"fail"}var nl={small:"small print or far away",medium:"typical phone distance",large:"close up"};function W2(t,e){return t===e[0]&&e.length>1?nl.small:t===e.at(-1)?nl.large:nl.medium}function od(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function ad(t,e,n){let o=`${t} px (${W2(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function id(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function q2(t,e,n){let o=Lt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(s=>s.color);let r=o.underlay?ia(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(s=>{let l=ia(s);if(!l)return [];let c={...l,a:l.a*i};if(!r)return [Ym(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [Ym({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var Ym=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function V2(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],s=t.data[a*4+1],l=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:qn(i,s,l),r:i,g:s,b:l});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((l,c)=>({r:l.r+c.r,g:l.g+c.g,b:l.b+c.b}),{r:0,g:0,b:0}),s=l=>Math.round(l/a.length).toString(16).padStart(2,"0");return `#${s(i.r)}${s(i.g)}${s(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function j2(t){al();let e=await Gr(t),{canvas:n,ctx:o}=Zn(64,64);o.drawImage(e,0,0,64,64);let r=V2(o.getImageData(0,0,64,64));return n.remove(),r}function sd(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Be.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var Dr=null;function ia(t){let e=at(t);if(e||typeof document>"u")return e;if(Dr??=document.createElement("canvas").getContext("2d"),!Dr)return null;Dr.fillStyle="#010203",Dr.fillStyle=t;let n=String(Dr.fillStyle);return n==="#010203"?null:at(n)}var Zm=t=>qn(t.r,t.g,t.b),ld=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),Br=4.5,X2=3,Km=1.5,Jm={code:7,background:12},td={r:255,g:255,b:255,a:1},ed=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function Y2(t,e={}){let n=e.imageTones,o=(g,h)=>{let p=typeof g=="object"&&g?.type==="image";return q2(g,h,n).map(b=>({color:b,picture:p}))},r=t.fgColor??Rt,a=Be.flatMap(g=>{let h=t.eyeColors?.[g];return [...h?.outer?o(h.outer,Rt):[],...h?.inner?o(h.inner,Rt):[]]}),i=[...o(r,Rt),...o(t.eyeColor??r,Rt),...o(t.dotColor??r,Rt),...a],s=o(t.bgColor,ft),l=Cr(t.halo,t)?.color;l&&s.push({color:l,picture:false});let c=(s.length>0?s:[{color:"#ffffff",picture:false}]).map(g=>{let h=ia(g.color);return {color:h?ed(h,td):td,picture:g.picture}}),u=i.flatMap(g=>{let h=ia(g.color);return h?[{color:h,picture:g.picture}]:[]}),m=Number.POSITIVE_INFINITY,f=Br,d=false;for(let g of u)for(let h of c){let p=Zm(ed(g.color,h.color)),b=Zm(h.color),_=ld(p,b),y=h.picture?Jm.background:g.picture?Jm.code:Br;_/y<m/f&&(m=_,f=y),p>b&&(d=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:f,inverted:d}}function Z2(t,e){let{ratio:n,inverted:o,required:r}=Y2(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Br,i=r!==Br,s=Math.round(n*10)/10,l=[],c=0;return n>=r?l.push({id:"contrast",passed:true,message:`Contrast ${s}:1 between code and background`}):(c=n<Km*a?60:n<X2*a?30:10,l.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${s}:1); ${r}:1 or more scans reliably`:`Low contrast (${s}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,l.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):l.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:l,penalty:c,fails:n<Km*(r/Br)}}function ll(t){return dt.QrCode.encodeText(t.value,St[At(t)]).getModules()}function K2(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=ll(t),o=Re(n,t.size??it,Et(n.length,t.margin??pt,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,s=[[0,0],[a-8,0],[0,a-8]].some(([g,h])=>r.x<g+9&&r.x+r.w>g&&r.y<h+9&&r.y+r.h>h),l=a>21?a-9:null,c=l!==null&&r.x<l+5&&r.x+r.w>l&&r.y<l+5&&r.y+r.h>l;if(s||c)return {check:{id:"logo",passed:false,message:s?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=At(t),f=Math.round(u*100),d=Mo({value:t.value,size:t.size??it,margin:t.margin??pt,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function J2(t){let e=wr(t.shape)?tn(t.margin??pt):t.margin??pt,n=ll(t).length+2*e,o=e+(Nt(t.frame)?Gi(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function tb(t){let e=ns(t);return e?e.reason==="adjusted"?{check:{id:"halo",passed:true,message:e.message},penalty:0}:{check:{id:"halo",passed:false,message:e.message,fix:e.fix},penalty:15}:{check:null,penalty:0}}function eb(t){let e=Ki(t);return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function Gr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var nb=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function rb(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=nb;try{let o=await Gr(e.src),{canvas:r,ctx:a}=Zn(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function ob(t){let e=new Map;for(let r of sd(t))if(!r.startsWith("data:"))try{let a=await Gr(r),{canvas:i,ctx:s}=Zn(a.naturalWidth||256,a.naturalHeight||256);s.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Rt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function cd(t,e,n,o,r){let a=[],i=0,s=Z2(t,r);i+=s.penalty;let l=K2(t);i+=l.penalty;let c=J2(t);i+=c.penalty;let u=eb(t);i+=u.penalty;let m=tb(t);i+=m.penalty;let f=Ji(t),d=f?.kind==="eye"?null:f;d&&d.kind!=="sharp-dot-eye"&&(i+=10);let g=await il();Le(o);let h=ll(t).length,p=h+2*Et(h,t.margin??pt,t.shape),b=[],_=false;for(let[C,S]of n.entries()){await rd(),Le(o);let $=sl(g,e,S,p,M=>ol(M,t.value));i+=od(C,n.length,$),b.push(ad(S,n,$)),C===n.length-1&&$==="fail"&&(_=true);}a.push(...b,...s.checks),l.check&&a.push(l.check),a.push(u.check,c.check),m.check&&a.push(m.check),d&&a.push({id:"style-pair",passed:false,message:d.message,fix:d.fix});let y=_||s.fails,w=Math.max(0,Math.min(100,100-i));return y&&(w=Math.min(w,30)),{score:w,grade:id(w,y),checks:a}}function ud(t){return [...t.sizes??nd].filter(e=>e>0).sort((e,n)=>e-n)}async function v6(t,e={}){al();let{signal:n}=e,o=ud(e),r=rl/el(t),a=await ob(await rb(Pe({...t,size:t.size??it},r)));Le(n);let i={};for(let m of sd(t))try{let f=await j2(m);f&&(i[m]=f);}catch{}Le(n);let s=await Xt(a),l=await Gr(s);Le(n);let c=me(r,t.frame);return await cd(t,m=>{let f=m/rl,d=c.width*f,g=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:p,ctx:b}=Zn(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(l,h,h,d,g);let _=b.getImageData(0,0,p.width,p.height);return p.remove(),_},o,n,i)}var L6=rl;async function T6(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=ud(n),i=t.size??it,s=me(i,t.frame),l=o*i*el(t)/s.width,c={data:ab(e),width:o,height:r};return await cd(t,m=>{let f=md(c,m/l),d=Math.max(8,Math.round(m*.12));return ib(f,d)},a,n.signal)}function ab(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let s=0;s<3;s++)r[a+s]=e[a+s]*i+255*(1-i);r[a+3]=255;}return r}function ib(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var ve=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function aa(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function sb(t,e){let n=0;for(let s=0;s<256;s++)n+=s*t[s];let o=0,r=0,a=0,i=128;for(let s=0;s<256;s++){if(r+=t[s],r===0)continue;let l=e-r;if(l===0)break;o+=s*t[s];let c=o/r,u=(n-o)/l,m=r*l*(c-u)**2;m>a&&(a=m,i=s);}return i}async function lb(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await Gr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function k6(t,e={}){al();let{signal:n}=e,o=[...e.sizes??nd].filter(G=>G>0).sort((G,K)=>G-K),r=await il(),a=await lb(t);Le(n);let i=a.naturalWidth||a.width,s=a.naturalHeight||a.height;if(!(i&&s))throw new Error("Could not read this image");let l=Math.min(1,1600/Math.max(i,s)),{canvas:c,ctx:u}=Zn(i*l,s*l);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(Le(n),!f){let G=await $c(a,0,false);return c.remove(),typeof G!="string"||G==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:G,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:g}=f,h=17+4*g,p=(ve(d.topLeftCorner,d.topRightCorner)+ve(d.bottomLeftCorner,d.bottomRightCorner)+ve(d.topLeftCorner,d.bottomLeftCorner)+ve(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(G=>G.x)))),w=Math.min(m.width,Math.ceil(Math.max(..._.map(G=>G.x)))),C=Math.max(0,Math.floor(Math.min(..._.map(G=>G.y)))),S=Math.min(m.height,Math.ceil(Math.max(..._.map(G=>G.y)))),$=[],M=0,R=new Array(256).fill(0),E=0;for(let G=C;G<S;G++)for(let K=y;K<w;K++){let Q=Math.round(aa(m.data,(G*m.width+K)*4));R[Q]=R[Q]+1,E++;}let P=sb(R,E),v={dark:[0,0,0,0],light:[0,0,0,0]};for(let G=C;G<S;G++)for(let K=y;K<w;K++){let Q=(G*m.width+K)*4,gt=aa(m.data,Q)<=P?v.dark:v.light;gt[0]=gt[0]+m.data[Q],gt[1]=gt[1]+m.data[Q+1],gt[2]=gt[2]+m.data[Q+2],gt[3]=gt[3]+1;}let L=G=>{let K=Math.max(G[3],1);return qn(G[0]/K,G[1]/K,G[2]/K)},F=L(v.dark),k=L(v.light),T=ld(F,k),z=Math.round(T*10)/10;T>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${z}:1 in the image`}):(M+=T<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${z}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let D=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(G=>{let K=Math.min(m.width-1,Math.max(0,Math.round(G.x))),Q=Math.min(m.height-1,Math.max(0,Math.round(G.y)));return aa(m.data,(Q*m.width+K)*4)}).filter(G=>G>P).length>=2;D?(M+=10,$.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let U=Math.max(2,Math.round(b*2)),X={minX:y-U,maxX:w+U,minY:C-U,maxY:S+U};if(X.minX<0||X.minY<0||X.maxX>m.width||X.maxY>m.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let G=0,K=0;for(let Q=X.minY;Q<X.maxY;Q++)for(let gt=X.minX;gt<X.maxX;gt++){if(gt>=y&&gt<w&&Q>=C&&Q<S)continue;let ut=aa(m.data,(Q*m.width+gt)*4);(D?ut>P:ut<=P)&&G++,K++;}G/Math.max(K,1)>.12?(M+=10,$.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let lt=Math.round(b*4),N=Math.max(0,y-lt),B=Math.max(0,C-lt),Z=Math.min(m.width,w+lt)-N,Pt=Math.min(m.height,S+lt)-B,ct=G=>{let K=G/p,Q=Zn(Z*K,Pt*K);Q.ctx.drawImage(c,N,B,Z,Pt,0,0,Q.canvas.width,Q.canvas.height);let gt=Q.ctx.getImageData(0,0,Q.canvas.width,Q.canvas.height);return Q.canvas.remove(),gt},Zt=[],ae=false;for(let[G,K]of o.entries()){await rd(),Le(n);let Q=sl(r,ct,K,h,gt=>gt?.data===f.data);M+=od(G,o.length,Q),Zt.push(ad(K,o,Q)),G===o.length-1&&Q==="fail"&&(ae=true);}c.remove();let Te=Math.max(0,Math.min(100,100-M));return ae&&(Te=Math.min(Te,30)),{data:f.data,version:g,score:Te,grade:id(Te,ae),checks:[...Zt,...$]}}var cb=[320];function md(t,e){let n=Math.min(1,e),o=Math.max(1,Math.round(t.width*n)),r=Math.max(1,Math.round(t.height*n)),a=new Uint8ClampedArray(o*r*4),i=t.width/o,s=t.height/r;for(let l=0;l<r;l++){let c=Math.floor(l*s),u=Math.max(c+1,Math.min(t.height,Math.floor((l+1)*s)));for(let m=0;m<o;m++){let f=Math.floor(m*i),d=Math.max(f+1,Math.min(t.width,Math.floor((m+1)*i))),g=0,h=0,p=0,b=0;for(let w=c;w<u;w++)for(let C=f;C<d;C++){let S=(w*t.width+C)*4;g+=t.data[S],h+=t.data[S+1],p+=t.data[S+2],b+=t.data[S+3];}let _=(u-c)*(d-f),y=(l*o+m)*4;a[y]=g/_,a[y+1]=h/_,a[y+2]=p/_,a[y+3]=b/_;}}return {data:a,width:o,height:r,colorSpace:"srgb"}}function ub(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function F6(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await il(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},s=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!s)return {data:null,version:null,passed:false};let l=ub(s),{version:c,location:u}=s;if(!ol(s,e))return {data:l,version:c,passed:false};let m=17+4*c,f=(ve(u.topLeftCorner,u.topRightCorner)+ve(u.bottomLeftCorner,u.bottomRightCorner)+ve(u.topLeftCorner,u.bottomLeftCorner)+ve(u.topRightCorner,u.bottomRightCorner))/4;for(let d of n.sizes??cb)if(sl(a,h=>md(i,h/f),d,m,h=>ol(h,e))!=="pass")return {data:l,version:c,passed:false};return {data:l,version:c,passed:true}}var mb=16,dd=.01;function db(t){let e=new Float64Array(256);for(let l of t)e[Math.min(255,Math.max(0,Math.round(l*255)))]++;let n=t.length,o=0;for(let l=0;l<256;l++)o+=l*e[l];let r=0,a=0,i=0,s=128;for(let l=0;l<256;l++){if(a+=e[l],a===0)continue;let c=n-a;if(c===0)break;r+=l*e[l];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,s=l);}return (s+.5)/255}function fb(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),s=0;for(let d=0;d<a;d++)r[d*4+3]<128&&s++;if(e==="alpha"||e==="auto"&&s>a*.02&&s<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*g+255*(1-g))/255;}let u=db(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])m++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])m++,f+=i[d*n+g];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function fd(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let s=[i];a[i]=1;let l=false;for(let u of s){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(l=true);for(let[d,g]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,s.push(h));}}if((r===1||!l)&&s.length<o)for(let u of s)t[u]=r?0:1;}}}function hd(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=fb(t,e.mode??"auto"),i=a.reduce(($,M)=>$+M,0);fd(a,n,o,Math.max(16,i*dd));let s=n,l=o,c=-1,u=-1;for(let $=0;$<o;$++)for(let M=0;M<n;M++)a[$*n+M]&&(s=Math.min(s,M),l=Math.min(l,$),c=Math.max(c,M),u=Math.max(u,$));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-s+1,f=u-l+1;if(Math.max(m,f)<mb)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??De),_e),De)/Math.max(m,f),h=Math.max(_e,Math.round(m*g)),p=Math.max(_e,Math.round(f*g)),b=Math.max(1,Math.round(m*g)),_=Math.max(1,Math.round(f*g)),y=Math.floor((h-b)/2),w=Math.floor((p-_)/2),C=new Uint8Array(h*p);for(let $=0;$<_;$++){let M=l+Math.floor($*f/_),R=Math.max(M+1,l+Math.floor(($+1)*f/_));for(let E=0;E<b;E++){let P=s+Math.floor(E*m/b),v=Math.max(P+1,s+Math.floor((E+1)*m/b)),L=0;for(let F=M;F<R;F++)for(let k=P;k<v;k++)L+=a[F*n+k];C[($+w)*h+E+y]=L*2>=(R-M)*(v-P)?1:0;}}let S=C.reduce(($,M)=>$+M,0);if(fd(C,h,p,Math.max(4,S*dd)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,$=>$?"1":"0").join("")}}var cl=512;async function hb(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function pb(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await hb(t),o=n.naturalWidth||n.width||cl,r=n.naturalHeight||n.height||cl,a=cl/Math.max(o,r),i=Math.max(1,Math.round(o*a)),s=Math.max(1,Math.round(r*a)),l=document.createElement("canvas");l.width=i,l.height=s;let c=l.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,s);let u;try{u=c.getImageData(0,0,i,s);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{l.remove();}return hd(u,e)}/**
24
+ end`;function Us(t){let e="(";for(let n of t){let o=n.codePointAt(0)??63;n==="("||n===")"||n==="\\"?e+=`\\${n}`:n==="\u2026"?e+="...":o>=32&&o<127?e+=n:o>=160&&o<=255?e+=`\\${o.toString(8).padStart(3,"0")}`:e+="?";}return `${e})`}var Hs=class extends jn{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(e,n,o,r){super(n,o),this.cmyk=e,this.images=r;}color(e){if(this.cmyk){let[n,o,r,a]=$e(e.r,e.g,e.b);return `${x(n)} ${x(o)} ${x(r)} ${x(a)} cmyk`}return `${x(e.r/255)} ${x(e.g/255)} ${x(e.b/255)} rg`}tracePath(e,n){let o=["n"],r=false;for(let a of e)if(a.op==="M"||a.op==="L"&&!r){let[i,s]=q(n,a.x,a.y);o.push(`${x(i)} ${x(s)} m`),r=true;}else if(a.op==="L"){let[i,s]=q(n,a.x,a.y);o.push(`${x(i)} ${x(s)} l`);}else if(a.op==="C"){if(!r)continue;let[i,s]=q(n,a.x1,a.y1),[l,c]=q(n,a.x2,a.y2),[u,m]=q(n,a.x,a.y);o.push(`${x(i)} ${x(s)} ${x(l)} ${x(c)} ${x(u)} ${x(m)} c`);}else r&&o.push("h");return o.join(" ")}beginClip(e,n,o){return this.out.push(`gsave ${this.tracePath(e,n)} ${o?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(e,n,o,r,a){this.out.push(`${this.color(e)} n ${x(n)} ${x(o)} m ${x(n+r)} ${x(o)} l ${x(n+r)} ${x(o+a)} l ${x(n)} ${x(o+a)} l h f`);}shade(e,n,o){let r=mt(n.matrix,o.matrix);if(!Ae(r))return;let a=qo(o,this.cmyk?"cmyk":"rgb"),i=this.shadingNames.get(a);i||(i=`Sh${this.shadingNames.size}`,this.shadingNames.set(a,i)),this.usesLevel3=true;let s=n.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(e,n.matrix)} ${s} n [${Wo(r)}] concat ${i} shfill grestore`);}paint(e,n,o){if(e.length===0)return;let r=o.opacity??1;if(r<=0)return;let a=this.resolveFill(o.fill,e,o.viewport,(o.fillOpacity??1)*r);a&&"pattern"in a?this.paintPattern(e,o,a.pattern,a.alpha):a&&"gradient"in a&&this.shade(e,o,{...a.gradient,stops:a.gradient.stops.map(m=>({...m,color:this.flatten({...m.color,a:m.color.a*a.alpha})}))});let i=a&&"color"in a?this.flatten(a.color):null,s=o.strokeWidth>0?this.resolveColor(o.stroke):null,l=s&&this.flatten({...s,a:s.a*r});if(!(i||l))return;let c=this.tracePath(e,o.matrix),u=o.fillRule==="evenodd"?"ef":"f";if(i&&l?this.out.push(`gsave ${this.color(i)} ${c} ${u} grestore`):i&&this.out.push(`${this.color(i)} ${c} ${u}`),l){let m=`${this.color(l)} ${x(o.strokeWidth*Mn(o.matrix))} w ${c} s`,{join:f,cap:d}=jo(o);this.out.push(f||d?`gsave ${f} setlinejoin ${d} setlinecap ${m} grestore`:m);}}text(e,n){let o=e.text.replace(/\s+/g," ").trim(),r=this.resolveColor(n.fill);if(!(o&&r))return;let a=Mn(n.matrix),[i,s]=q(n.matrix,V(e.attrs.x,n.viewport[0]),V(e.attrs.y,n.viewport[1])),c=n.fontWeight==="bold"||Number.parseInt(n.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",u=x(n.fontSize*a),m=Number.parseFloat(e.attrs["data-max-width"]??""),f=m>0?` dup stringwidth pop dup ${x(m*a)} gt {${x(m*a)} exch div ${u} mul ${c} findfont exch scalefont setfont} {pop} ifelse`:"",d=n.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":n.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",g=Math.atan2(n.matrix[1],n.matrix[0])*180/Math.PI;if(Math.abs(g)>.01){this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${x(i)} ${x(s)} translate ${x(g)} rotate ${Us(o)}${f} 0 0 moveto${d} show grestore`);return}this.out.push(`gsave ${this.color(r)} ${c} findfont ${u} scalefont setfont ${Us(o)}${f} ${x(i)} ${x(s)} moveto${d} show grestore`);}image(e,n){let o=e.attrs.href??e.attrs["xlink:href"],r=o?this.images.get(o):void 0;if(!r)return;let a=V(e.attrs.x,n.viewport[0]),i=V(e.attrs.y,n.viewport[1]),s=V(e.attrs.width,n.viewport[0]),l=V(e.attrs.height,n.viewport[1]);if(s<=0||l<=0)return;let[c,u]=q(n.matrix,a,i),[m,f]=q(n.matrix,a+s,i+l),{components:d}=r,g=d===1?"/DeviceGray":d===4?"/DeviceCMYK":"/DeviceRGB",h=Array.from({length:d},()=>"0 1").join(" "),p="/ASCII85Decode filter";r.kind==="jpeg"?(p+=" /DCTDecode filter",r.progressive&&(this.usesLevel3=true)):r.compressed&&(p+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(c,m))} ${x(Math.min(u,f))} translate ${x(Math.abs(m-c))} ${x(Math.abs(f-u))} scale`,`${g} setcolorspace`,`<< /ImageType 1 /Width ${r.width} /Height ${r.height} /BitsPerComponent 8 /Decode [${h}] /ImageMatrix [${r.width} 0 0 -${r.height} 0 ${r.height}] /DataSource currentfile ${p} >> image`,i2(r.bytes),"grestore"].join(`
25
+ `));}};async function Rm(t,e={}){let n=ye(t);if(!n)throw new Error("Could not read the SVG to convert to EPS");let o=V(n.attrs.width,0,0)||512,r=V(n.attrs.height,0,0)||o,a=e.width??o;if(!(Number.isFinite(a)&&a>0))throw new Error("EPS width must be a positive number of points");let i=a/o,s=r*i,l=Math.max(0,e.bleed??0),c=a+2*l,u=s+2*l,m=e.colorMode==="cmyk",f=new Map;for(let _ of Fr(n,new Set)){let y=await a2(_,m);y&&f.set(_,y);}let d=new Hs(m,kr(n,new Map),zo(n),f);Jo(d,{bgColor:e.background??"#ffffff"});let h={matrix:mt([1,0,0,-1,l,u-l],[i,0,0,i,0,0]),viewport:[o,r],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},p=l>0?e.bleedColor??void 0:void 0;if(!(p&&d.paintBleed(n,h,p,[0,0,c,u]))){let _=p?d.resolveColor(p):null;_&&d.rect(_,0,0,c,u);}d.walk(n,h,true);let b=(e.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(c)} ${Math.ceil(u)}`,`%%HiResBoundingBox: 0 0 ${x(c)} ${x(u)}`,`%%Title: ${Us(b)}`,"%%Creator: qrdx",`%%LanguageLevel: ${d.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",s2,"%%EndProlog","qrdxdict begin",...Array.from(d.shadingNames,([_,y])=>`/${y} ${_} def`),"gsave",...d.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
26
+ `)}var Em="EPS can't carry image fills: PostScript has no transparency and would repeat the picture for every dot. Download PDF, SVG or PNG instead.";function Am(t){return [t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Object.values(t.eyeColors??{}).flatMap(n=>[n?.outer,n?.inner])].some(n=>typeof n=="object"&&n?.type==="image")}async function na(t,e={}){if(Am(t))throw new Error(Em);let n=ea(t,{size:e.sizeMm??e2,unit:"mm",bleed:e.bleedMm}),o=await Nr(t);return await Rm(o,{width:n.trimWidth*Mm,bleed:n.bleed*Mm,bleedColor:n.bleed>0?Ko(t,o):Ns(t),colorMode:e.colorMode,background:bt(t.bgColor,ft)})}function ra(t){return `data:application/postscript;base64,${btoa(t)}`}async function l2(t,e={}){let n=await na(t,e);Bt(ra(n),e.filename??"qr-code-print.eps");}var zs={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},bmp:{mimeType:"image/bmp",extension:"bmp",vector:false},gif:{mimeType:Ir,extension:"gif",vector:false},ico:{mimeType:on,extension:"ico",vector:false,sizes:Go},svg:{mimeType:"image/svg+xml",extension:"svg",vector:true},pdf:{mimeType:"application/pdf",extension:"pdf",vector:false},eps:{mimeType:"application/postscript",extension:"eps",vector:true}},Lx={small:{width:200,height:200},medium:{width:400,height:400},large:{width:800,height:800},xlarge:{width:1200,height:1200},"2xl":{width:1600,height:1600},"3xl":{width:2e3,height:2e3}};function Ws(t,e){return t<50||e<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:t>5e3||e>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:t!==e?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function Pe(t,e){let{imageSettings:n,size:o}=t;if(!(n&&o)||o===e)return {...t,size:e};let r=e/o;return {...t,size:e,imageSettings:{...n,width:n.width*r,height:n.height*r,...n.x!=null&&{x:n.x*r},...n.y!=null&&{y:n.y*r},...n.padding!=null&&{padding:n.padding*r}}}}function Bt(t,e){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n);}var Pm=t=>(zs[t]??zs.png).mimeType;function c2(t,e,n){let{extension:o,vector:r,sizes:a}=zs[t];if(r||a)return `qr-code.${o}`;let{width:i,height:s}=me(e.width,n);return `qr-code-${Math.round(i)}x${Math.round(s)}.${o}`}async function Im(t,e={}){let n=await ge(t,"image/webp",true);try{return await Ho(n,e)}finally{n.remove();}}async function vm(t){let e=await ge(t,"image/png",true);try{return ro(e)}finally{e.remove();}}async function Lm(t){let e=await ge(t,"image/png",true);try{return await Bo(e,t.value)}finally{e.remove();}}async function Tm(t,e=Go){let n=[];try{for(let o of e)n.push(await ge(Pe({...t,frame:void 0},o),"image/png",!0));return Ms(n)}finally{for(let o of n)o.remove();}}var u2=25.4/72;async function km(t){let e=await na(t,{sizeMm:(t.size??it)*u2});return ra(e)}async function Fm(t){let e;try{({jsPDF:e}=await import('jspdf'));}catch(f){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${f})`)}let n=await Xt(t),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),r;try{let f=new TextEncoder().encode(o),d=Array.from(f,h=>String.fromCharCode(h)).join("");r=`data:image/svg+xml;base64,${btoa(d)}`;}catch(f){throw new Error(`Failed to encode SVG for PDF conversion: ${f}`)}let{width:a,height:i}=me(t.size||it,t.frame),s=await new Promise((f,d)=>{let g=new Image,h=document.createElement("canvas");h.width=Math.round(a),h.height=Math.round(i);let p=h.getContext("2d");if(!p){d(new Error("Could not get canvas context"));return}let b=setTimeout(()=>{h.remove(),d(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);g.onload=()=>{clearTimeout(b);try{p.drawImage(g,0,0,h.width,h.height),f(h);}catch(_){clearTimeout(b),h.remove(),d(new Error(`Failed to draw image to canvas: ${_}`));}},g.onerror=()=>{clearTimeout(b),h.remove(),d(new Error("Could not load SVG for PDF conversion"));},g.src=r;}),l=s.toDataURL("image/png",1),c=a*.264583,u=i*.264583,m=new e({orientation:c>u?"landscape":"portrait",unit:"mm",format:[c,u]});return m.addImage(l,"PNG",0,0,c,u),s.remove(),m.output("dataurlstring")}async function Tx(t,e){let{format:n,size:o,filename:r,quality:a}=e,i=Ws(o.width,o.height);if(!i.isValid)throw new Error(i.error);let s=Pe(t,o.width),l=r||c2(n,o,t.frame);try{if(n==="svg"){let c=await Xt(s);Bt(c,l);}else if(n==="pdf"){let c=await Fm(s);Bt(c,l);}else if(n==="eps")Bt(await km(s),l);else if(n==="webp"){let c=await Im(s,{quality:a});Bt(await Ot(c),l);}else if(n==="bmp"){let c=await vm(s);Bt(await Ot(c),l);}else if(n==="gif"){let c=await Lm(s);Bt(await Ot(c),l);}else if(n==="ico"){let c=await Tm(s);Bt(await Ot(c),l);}else {let c=Pm(n),u=await ge(s,c);if(typeof u=="string")Bt(u,l);else throw new Error("Failed to generate image data URL")}}catch(c){throw console.error(`Error downloading ${n.toUpperCase()}:`,c),c}}async function kx(t,e,n,o={}){let r=Ws(n.width,n.height);if(!r.isValid)throw new Error(r.error);let a=Pe(t,n.width);if(e==="svg")return await Xt(a);if(e==="pdf")return await Fm(a);if(e==="eps")return await km(a);if(e==="webp")return await Ot(await Im(a,o));if(e==="bmp")return await Ot(await vm(a));if(e==="gif")return await Ot(await Lm(a));if(e==="ico")return await Ot(await Tm(a));let i=Pm(e),s=await ge(a,i);if(typeof s=="string")return s;throw new Error("Failed to generate QR code data URL")}async function Fx(t,e={width:it,height:it}){try{let n=Ws(e.width,e.height);if(!n.isValid)throw new Error(n.error);let o=Pe(t,e.width),r=ge(o,"image/png",!0).then(a=>new Promise((i,s)=>{let l=a;l.toBlob(c=>{l.remove(),c?i(c):s(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":r})]);}catch(n){throw console.error("Error copying to clipboard:",n),n}}async function Nx(t){let e=await Xt(t);return decodeURIComponent(e.replace("data:image/svg+xml,",""))}var Dt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},rt=class extends Error{},m2={script:t=>`Removed ${yt(t,"script")}`,style:t=>`Removed ${yt(t,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":t=>`Removed ${yt(t,"foreignObject element")}`,image:t=>`Removed ${yt(t,"image")}: frames are vector shapes only`,use:t=>`Removed ${yt(t,"<use> reference")}: ungroup or detach symbols before exporting`,text:t=>`Removed ${yt(t,"text element")}: add text as labels in the frame editor`,effects:t=>`Removed ${yt(t,"filter, mask, clip path or pattern")}`,animation:t=>`Removed ${yt(t,"animation")}`,unknown:t=>`Removed ${yt(t,"unsupported element")}`,"nested-svg":t=>`Removed ${yt(t,"nested <svg>")}: flatten it first`,handlers:t=>`Removed ${yt(t,"event handler attribute")}`,links:t=>`Removed ${yt(t,"link")} (href)`,"external-paint":t=>`Removed ${yt(t,"fill or stroke")} that referenced something outside the file`,gradient:t=>`Flattened ${yt(t,"gradient")} to its first color: add gradients in the frame editor`,opacity:t=>`Made ${yt(t,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":t=>`${yt(t,"color")} couldn't be read and fell back to the parent color`,stroke:t=>`Removed ${yt(t,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:t=>`Drew ${yt(t,"dashed stroke")} as solid`,clipped:t=>`Cut ${yt(t,"shape")} at the edge of the artboard`,outside:t=>`Removed ${yt(t,"shape")} outside the artboard`,colors:t=>`Merged ${yt(t,"color")} with similar ones (${Dt.maxColors} at most)`,"qr-placed":()=>'No QR placeholder found (a rect with id "qr"): the code was centered; place it in the frame editor'};function yt(t,e){return `${t} ${e}${t===1?"":"s"}`}var Xs=class{counts=new Map;add(e,n=1){this.counts.set(e,(this.counts.get(e)??0)+n);}list(){return [...this.counts].map(([e,n])=>({code:e,count:n,message:m2[e](n)}))}},d2=/^\s*<\?xml\s[^?>]*\?>/,qs=/[A-Za-z_][\w:.-]*/y,Vs=/<\/([A-Za-z_][\w:.-]*)\s*>/y,oa=/\s*/y,f2=/[A-Za-z_:][\w:.-]*/y,h2=/[^"<]*/y,p2=/[^'<]*/y;function Xn(t,e,n){return t.lastIndex=n,t.test(e)?t.lastIndex:n}function Nm(t,e){let n=Xn(oa,t,e),o=Xn(f2,t,n);if(n===e||o===n)return -1;let r=Xn(oa,t,o);if(t[r]!=="=")return -1;let a=Xn(oa,t,r+1),i=t[a];if(i!=='"'&&i!=="'")return -1;let l=Xn(i==='"'?h2:p2,t,a+1);return t[l]===i?l+1:-1}function g2(t,e){let n=Xn(oa,t,e);return t[n]===">"?{end:n+1,selfClosing:false}:t.startsWith("/>",n)?{end:n+2,selfClosing:true}:null}function b2(t){let e=[],n=0,o="",r=0;for(;r<t.length;){let a=t.indexOf("<",r);if(a<0)break;if(r=a,t.startsWith("<!--",r)){let c=t.indexOf("-->",r+4);if(c<0)throw new rt("The SVG has an unclosed comment");r=c+3;continue}if(t.startsWith("<![CDATA[",r)){let c=t.indexOf("]]>",r+9);if(c<0)throw new rt("The SVG has an unclosed CDATA section");r=c+3;continue}if(t.startsWith("<?",r)){let c=t.indexOf("?>",r+2);if(c<0)throw new rt("The SVG has an unclosed declaration");r=c+2;continue}if(t.startsWith("<!",r))throw new rt("DOCTYPE and other declarations are not allowed");if(t[r+1]==="/"){Vs.lastIndex=r;let c=Vs.exec(t);if(!c)throw new rt("The SVG has a malformed closing tag");if(e.pop()!==c[1])throw new rt(`The SVG closes <${c[1]}> out of order`);r=Vs.lastIndex;continue}qs.lastIndex=r+1;let i=qs.exec(t);if(!i)throw new rt("The SVG has a malformed tag");let s=qs.lastIndex;for(let c=Nm(t,s);c>=0;c=Nm(t,s))s=c;let l=g2(t,s);if(!l)throw new rt(`The SVG has a malformed <${i[0]}> tag (attributes must be quoted and may not contain "<")`);if(n++,n>Dt.maxElements)throw new rt(`The SVG has more than ${Dt.maxElements} elements`);if(o||(o=i[0]),!l.selfClosing&&(e.push(i[0]),e.length>Dt.maxDepth))throw new rt(`The SVG nests elements more than ${Dt.maxDepth} deep`);r=l.end;}if(e.length>0)throw new rt(`The SVG doesn't close <${e.at(-1)}>`);return o}function _2(t){if(typeof t!="string")throw new rt("Expected SVG markup as a string");let e=new TextEncoder().encode(t).length;if(e>Dt.maxBytes)throw new rt(`The SVG is ${Math.ceil(e/1e3)} KB; the limit is ${Dt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(t))throw new rt("DOCTYPE and entity declarations are not allowed");let n=t.replace(d2,"");if(n.includes("<?"))throw new rt("Processing instructions (such as xml-stylesheet) are not allowed");if(b2(n)!=="svg")throw new rt("The file must start with an <svg> element");return n}var js=t=>Math.round(Math.min(255,Math.max(0,t))).toString(16).padStart(2,"0");function Yt(t){let e=t?.replace(/!important/i,"").trim();return e===""||e==="inherit"?void 0:e}function Ys(t,e,n,o){let r=t.trim();if(r==="none"||r==="transparent")return null;if(/^url\(/i.test(r)){let i=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(r)?.[1],s=i?n.get(i):void 0;return s?(o.add("gradient"),Ys(s,e,n,o)):(o.add("external-paint"),null)}let a=at(r==="currentColor"?e.color:r);return a?a.a<=0?null:`#${js(a.r)}${js(a.g)}${js(a.b)}`:(o.add("invalid-paint"),null)}function y2(t){let e=new Map,n=r=>{(r.name==="linearGradient"||r.name==="radialGradient")&&r.attrs.id&&e.set(r.attrs.id,r);for(let a of r.children)n(a);};n(t);let o=new Map;for(let[r,a]of e){let i=a.children.find(l=>l.name==="stop");if(!i){let l=(a.attrs.href??a.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];i=l?e.get(l)?.children.find(c=>c.name==="stop"):void 0;}let s=i&&Yt(j(i,"stop-color"));s&&o.set(r,s);}return o}function Om(t,e){return t.map(n=>{if(n.op==="Z")return n;if(n.op==="C"){let[a,i]=q(e,n.x1,n.y1),[s,l]=q(e,n.x2,n.y2),[c,u]=q(e,n.x,n.y);return {op:"C",x1:a,y1:i,x2:s,y2:l,x:c,y:u}}let[o,r]=q(e,n.x,n.y);return {op:n.op,x:o,y:r}})}function x2(t){let e=0;return t.forEach(([n,o],r)=>{let[a,i]=t[(r+1)%t.length];e+=n*i-a*o;}),e/2}function Ks(t){return t.length<3?[]:[...t.map(([e,n],o)=>({op:o===0?"M":"L",x:e,y:n})),{op:"Z"}]}var Ie=t=>Number.isFinite(t);function ht(t,e,n=0){let o=Number.parseFloat(t.attrs[e]??"");return Ie(o)?o:n}function Dm(t){switch(t.name){case "path":return le(t.attrs.d??"");case "rect":{let e=t.attrs.rx??t.attrs.ry,n=t.attrs.ry??t.attrs.rx;return ne(ht(t,"x"),ht(t,"y"),ht(t,"width"),ht(t,"height"),Number.parseFloat(e??"0")||0,Number.parseFloat(n??"0")||0)}case "circle":{let e=ht(t,"r");return ee(ht(t,"cx"),ht(t,"cy"),e,e)}case "ellipse":return ee(ht(t,"cx"),ht(t,"cy"),ht(t,"rx"),ht(t,"ry"));case "polygon":case "polyline":{let e=te(t.attrs.points),n=[];for(let o=0;o+1<e.length;o+=2)n.push([e[o],e[o+1]]);return Ks(n)}default:return []}}function $2(t,e){let n=e/2;switch(t.name){case "rect":{let o=ht(t,"x"),r=ht(t,"y"),a=ht(t,"width"),i=ht(t,"height"),s=Number.parseFloat(t.attrs.rx??t.attrs.ry??"0")||0,l=ne(o-n,r-n,a+e,i+e,s>0?s+n:0,s>0?s+n:0);if(a<=e||i<=e)return l;let c=Math.max(s-n,0);return [...l,...ne(o+n,r+n,a-e,i-e,c,c)]}case "circle":case "ellipse":{let o=ht(t,"cx"),r=ht(t,"cy"),a=t.name==="circle"?ht(t,"r"):ht(t,"rx"),i=t.name==="circle"?ht(t,"r"):ht(t,"ry"),s=ee(o,r,a+n,i+n);return a<=n||i<=n?s:[...s,...ee(o,r,a-n,i-n)]}case "line":{let[o,r,a,i]=["x1","y1","x2","y2"].map(m=>ht(t,m)),s=Math.hypot(a-o,i-r);if(s===0)return [];let l=-(i-r)/s*n,c=(a-o)/s*n,u=[[o+l,r+c],[a+l,i+c],[a-l,i-c],[o-l,r-c]];return Ks(x2(u)<0?u.reverse():u)}default:return null}}var S2=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),w2=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),C2={script:"script",style:"style",foreignObject:"foreign-object",image:"image",feImage:"image",use:"use",text:"text",tspan:"text",textPath:"text",filter:"effects",mask:"effects",clipPath:"effects",pattern:"effects",marker:"effects",symbol:"effects",animate:"animation",animateMotion:"animation",animateTransform:"animation",set:"animation"},M2=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Gm(t,e){for(let n of Object.keys(t.attrs)){let o=n.toLowerCase();o.startsWith("on")?e.add("handlers"):o==="href"||o==="xlink:href"?t.name!=="linearGradient"&&t.name!=="radialGradient"&&e.add("links"):(o==="filter"||o==="mask"||o==="clip-path")&&e.add("effects");}}function Qm(t,e,n,o,r){if(Gm(t,o),Yt(j(t,"display"))==="none"||Yt(j(t,"visibility"))==="hidden")return;let a=Number.parseFloat(j(t,"opacity")??"1"),i=Yt(j(t,"fill-rule")),s=Number.parseFloat(Yt(j(t,"stroke-width"))??""),l={matrix:mt(e.matrix,Qt(t.attrs.transform)),fill:Yt(j(t,"fill"))??e.fill,fillRule:i==="evenodd"||i==="nonzero"?i:e.fillRule,stroke:Yt(j(t,"stroke"))??e.stroke,strokeWidth:Ie(s)&&s>=0?s:e.strokeWidth,color:Yt(j(t,"color"))??e.color,opacity:e.opacity*(Ie(a)?a:1)};for(let c of t.children){if(w2.has(c.name))continue;let u=C2[c.name];if(u){o.add(u);continue}if(c.name==="svg"){o.add("nested-svg");continue}if(c.name==="g"||c.name==="a"){Qm(c,l,n,o,r);continue}if(!S2.has(c.name)){o.add("unknown");continue}R2(c,l,n,o,r);}}function R2(t,e,n,o,r){if(Gm(t,o),Yt(j(t,"display"))==="none"||Yt(j(t,"visibility"))==="hidden")return;let a=mt(e.matrix,Qt(t.attrs.transform));if(t.name==="rect"&&M2.test(t.attrs.id??"")&&!r.qrBox){r.qrBox=Qe(Om(Dm(t),a));return}let i=p=>Yt(j(t,p)),s=e.opacity*Number.parseFloat(i("opacity")??"1"),l=Number.parseFloat(i("fill-opacity")??"1"),c=Number.parseFloat(i("stroke-opacity")??"1"),u=i("fill-rule"),m={...e,fill:i("fill")??e.fill,fillRule:u==="evenodd"||u==="nonzero"?u:e.fillRule,stroke:i("stroke")??e.stroke,color:i("color")??e.color},f=Number.parseFloat(i("stroke-width")??""),d=Ie(f)&&f>=0?f:e.strokeWidth,g=(p,b,_)=>{if(p.length!==0){if(r.segments+=p.length,r.segments>Dt.maxInputSegments)throw new rt(`The SVG has more than ${Dt.maxInputSegments} path segments; simplify it`);r.shapes.push({segments:Om(p,a),fill:b,fillRule:_});}},h=p=>{let b=(Ie(s)?s:1)*(Ie(p)?p:1);return b<=0?false:(b<1&&o.add("opacity"),true)};if(t.name!=="line"){let p=Ys(m.fill,m,n,o);p&&h(l)&&g(Dm(t),p,m.fillRule);}if(d>0&&m.stroke!=="none"){let p=Ys(m.stroke,m,n,o);if(p&&h(c)){let b=$2(t,d);b?((i("stroke-dasharray")??"none")!=="none"&&o.add("dash"),g(b,p,t.name==="line"?"nonzero":"evenodd")):o.add("stroke");}}}function E2(t,e){let n=c=>{let u=10**e;return Math.round(c*u)/u+0},o=c=>x(c,e),r="",a=0,i=0,s=0,l=0;for(let c of t){if(c.op==="Z"){r+="z",a=s,i=l;continue}let u=n(c.x),m=n(c.y);if(c.op==="M")r+=`m${o(u-a)} ${o(m-i)}`,s=u,l=m;else if(c.op==="L"){if(u===a&&m===i)continue;r+=m===i?`h${o(u-a)}`:u===a?`v${o(m-i)}`:`l${o(u-a)} ${o(m-i)}`;}else r+=`c${o(n(c.x1)-a)} ${o(n(c.y1)-i)} ${o(n(c.x2)-a)} ${o(n(c.y2)-i)} ${o(u-a)} ${o(m-i)}`;a=u,i=m;}return r}var A2=(t,e)=>t.x0<e.x1&&e.x0<t.x1&&t.y0<e.y1&&e.y0<t.y1;function P2(t){let e=[];for(let n of t){let o=Qe(n.segments);if(!o)continue;let r=e.at(-1);r&&r.shape.fill===n.fill&&r.shape.fillRule===n.fillRule&&!r.boxes.some(a=>A2(a,o))?(r.shape={...r.shape,segments:[...r.shape.segments,...n.segments]},r.boxes.push(o)):e.push({shape:n,boxes:[o]});}return e.map(n=>n.shape)}var Zs=t=>[Number.parseInt(t.slice(1,3),16),Number.parseInt(t.slice(3,5),16),Number.parseInt(t.slice(5,7),16)];function I2(t,e,n){let o=new Map;for(let i of t)o.set(i.fill,(o.get(i.fill)??0)+1);let r=new Map([...o.keys()].map(i=>[i,i])),a=0;for(;o.size>e;){let i=[...o.keys()],s=[i[0],i[1]],l=Number.POSITIVE_INFINITY;for(let d=0;d<i.length;d++)for(let g=d+1;g<i.length;g++){let h=Zs(i[d]),p=Zs(i[g]),b=Math.hypot(h[0]-p[0],h[1]-p[1],h[2]-p[2]);b<l&&(l=b,s=[i[d],i[g]]);}let[c,u]=s,[m,f]=(o.get(c)??0)>=(o.get(u)??0)?[c,u]:[u,c];o.set(m,(o.get(m)??0)+(o.get(f)??0)),o.delete(f);for(let[d,g]of r)g===f&&r.set(d,m);a++;}return a>0&&n.add("colors",a),r}var Bm=t=>{let[e,n,o]=Zs(t);return .2126*e+.7152*n+.0722*o>235};function v2(t,e={}){let n=new Xs;try{let o=_2(t),r=ye(o);if(!r)throw new rt("No <svg> element found");let a=te(r.attrs.viewBox),[i,s,l,c]=[0,0,0,0];if(a.length===4&&a[2]>0&&a[3]>0?[i,s,l,c]=a:(l=ht(r,"width"),c=ht(r,"height")),!(Ie(l)&&Ie(c)&&l>0&&c>0))throw new rt("The SVG needs a viewBox (or a width and height)");let m=Dt.artboardSide/Math.max(l,c),f=Math.round(l*m*10)/10,d=Math.round(c*m*10)/10;if(Math.min(f,d)<ot.minArtboard)throw new rt("The artboard is too narrow: its sides may differ by 20 times at most");let g=[m,0,0,m,-i*m,-s*m],h={shapes:[],qrBox:null,segments:0};Qm(r,{matrix:g,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},y2(r),n,h);let p={x0:0,y0:0,x1:f,y1:d},b=Math.max(f,d)*.004,_=[],y=0,w=0;for(let N of h.shapes){let B=Qe(N.segments);if(!B||B.x1<=0||B.y1<=0||B.x0>=f||B.y0>=d){y++;continue}if(B.x0<-b||B.y0<-b||B.x1>f+b||B.y1>d+b){let Z=Xr(N.segments,.25).map(Pt=>Sn(Pt,p)).filter(Pt=>Pt.length>2);if(Z.length===0){y++;continue}w++,_.push({...N,segments:Z.flatMap(Pt=>Ks(Pt))});}else _.push(N);}if(y>0&&n.add("outside",y),w>0&&n.add("clipped",w),_.length===0)throw new rt("The SVG has no filled shapes to use");let C=I2(_,Dt.maxColors,n);for(let N of _)N.fill=C.get(N.fill)??N.fill;let S=new Map,$=new Map;for(let N of _){let B=Qe(N.segments);S.set(N.fill,(S.get(N.fill)??0)+(B.x1-B.x0)*(B.y1-B.y0)),$.set(N.fill,($.get(N.fill)??0)+1);}let M=[...S.keys()].sort((N,B)=>Number(Bm(N))-Number(Bm(B))||S.get(B)-S.get(N)),R=M[0],E=M[1],P=N=>N===R?"frame":N===E?"accent":N,v=h.qrBox;if(!v&&e.qr){let[N,B]=q(g,e.qr.x,e.qr.y);v={x0:N,y0:B,x1:N+e.qr.size*m,y1:B+e.qr.size*m};}let L,F,k;v?(L=Math.min(v.x1-v.x0,v.y1-v.y0),F=(v.x0+v.x1-L)/2,k=(v.y0+v.y1-L)/2):(n.add("qr-placed"),L=Math.min(f,d)*.6,F=(f-L)/2,k=(d-L)/2);let T=N=>Math.round(N*10)/10+0;if(L=Math.floor(L*10)/10,F=T(F),k=T(k),L<Math.min(f,d)*ot.minQrShare)throw new rt("The QR area must be at least half the frame's shorter side");let z=Math.min(F,k,f-F-L,d-k-L);if(z<L*ot.minPadding-1e-9)throw new rt("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let W=Math.min(Math.max(e.padding??Dt.padding,ot.minPadding),.2),D=Math.floor(Math.min(L*W,z)*10)/10,U=P2(_);if(U.length>ot.maxShapes)throw new rt(`The artwork has ${U.length} separate shapes; the limit is ${ot.maxShapes}. Combine shapes of the same color first`);let X={kind:rr,version:or,artboard:{width:f,height:d},qr:{x:F,y:k,size:L,padding:D},colors:{frame:R,...E&&{accent:E}},shapes:U.map(N=>({type:"path",d:E2(N.segments,Dt.decimals),fill:P(N.fill),...N.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},xt=uo(X);if(!xt.success){let N=xt.issues[0];throw new rt(`The converted frame doesn't fit the frame format: ${N?.message??"invalid"}`)}let lt=M.map(N=>({color:N,ref:N===R?"frame":N===E?"accent":"fixed",shapes:$.get(N)??0}));return {ok:!0,spec:xt.data,warnings:n.list(),palette:lt}}catch(o){return {ok:false,error:o instanceof rt?o.message:`Could not read the SVG (${o instanceof Error?o.name:"error"})`,warnings:n.list()}}}var L2=1114,T2={"call-to-action":134,holidays:283,seasons:60,"food-drink":71,shopping:64,"beauty-wellness":26,events:77,places:71,"real-estate":35,automotive:27,"health-learning":48,"sports-fitness":36,business:82,nonprofit:28,objects:28,playful:44};var k2=[{id:"call-to-action",label:"Call to action"},{id:"holidays",label:"Holidays"},{id:"seasons",label:"Seasons"},{id:"food-drink",label:"Food & drink"},{id:"shopping",label:"Shops & packaging"},{id:"beauty-wellness",label:"Beauty & wellness"},{id:"events",label:"Events & weddings"},{id:"places",label:"Places & Wi-Fi"},{id:"real-estate",label:"Real estate"},{id:"automotive",label:"Cars & parking"},{id:"health-learning",label:"Health & learning"},{id:"sports-fitness",label:"Sports & fitness"},{id:"business",label:"Business & social"},{id:"nonprofit",label:"Nonprofits & community"},{id:"objects",label:"Everyday objects"},{id:"playful",label:"Playful & surprising"}];function Js(t){return Array.isArray(t)?`[${t.map(Js).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).filter(n=>t[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${Js(t[n])}`).join(",")}}`:JSON.stringify(t)}function F2(t){let e=Js(t),n=2166136261;for(let o=0;o<e.length;o++)n^=e.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n.toString(16).padStart(8,"0")}function N2(t,e){return dt.QrCode.encodeText(t,St[e??Jt]).size}function Um(t,e,n,o=n.size*(e?.size??va)){let r={src:t,width:o,height:o,excavate:true,...e?.shape&&e.shape!=="square"&&{shape:e.shape},...e?.plate&&{plate:e.plate}},a=e?.x!==void 0||e?.y!==void 0;if(!(e?.padding||a))return r;let i=N2(n.value,n.level),s=Et(i,n.margin,n.shape),l=n.size/(i+2*s);if(e.padding&&(r.padding=e.padding*l),a){let c=i*l,u=m=>Math.min(Math.max((m??.5)*c-o/2,0),c-o);r.x=u(e.x),r.y=u(e.y);}return r}function Hm(t,e,n,o){let r=n.level??Jt,a=r;o&&(a=At({...n,imageSettings:Um(t,e,n),autoLevel:o}));let i=l=>{let c=m=>Um(t,e,{...n,level:l},m),u=qi(n,[l],c().width,c);return u>0?c(u):void 0};if(a===r)return i(r);let s=i(a);return s&&At({...n,imageSettings:s,autoLevel:o})===a?s:i(r)}function O2({value:t,level:e,margin:n,shape:o,autoLevel:r,logoOptions:a}){let s=Hm("data:,",{...a,size:Ia},{value:`${t}`,size:1024,margin:n??pt,level:e,shape:o},r);return s?s.width/1024:0}function tl({value:t,size:e=1024,fgColor:n,bgColor:o,eyeColor:r,dotColor:a,bodyPattern:i,hideLogo:s,logo:l,logoOptions:c,margin:u,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,frame:h,eyeColors:p,moduleScale:b,autoLevel:_,shape:y,eyeShapes:w,eyeGradient:C,bgRadius:S,backdrop:$,halo:M,shadow:R}){let E={value:`${t}`,size:e,margin:u??pt,level:d,shape:y},P=!s&&l?Hm(l,c,E,_):void 0;return {value:E.value,bgColor:o,fgColor:n,eyeColor:r,dotColor:a,bodyPattern:i,cornerEyePattern:m,cornerEyeDotPattern:f,level:d,templateId:g,size:e,margin:u,...h&&{frame:h},...p&&{eyeColors:p},...b!==void 0&&{moduleScale:b},..._&&{autoLevel:_},...y&&y!=="square"&&{shape:y},...w&&{eyeShapes:w},...C&&C!=="corner"&&{eyeGradient:C},...S&&{bgRadius:S},...$&&{backdrop:$},...M&&{halo:M},...R&&{shadow:R},...P&&{imageSettings:P}}}var zm=.06,Wm=.16,qm=512;function Vm(t){let{width:e,height:n}=t;if(!(e>0&&n>0)||t.data.length<e*n*4)return null;let o=Uint8Array.from(t.data),r=ni({width:e,height:n,data:o});if(!r)return null;let a=d=>{let g=d*4;return Math.hypot(o[g]/255-r[0],o[g+1]/255-r[1],o[g+2]/255-r[2])},i=new Uint8Array(e*n),s=new Int32Array(e*n),l=0,c=0,u=d=>{i[d]||o[d*4+3]===0||a(d)>=Wm||(i[d]=1,s[c++]=d);};for(let d=0;d<e;d++)u(d),u((n-1)*e+d);for(let d=0;d<n;d++)u(d*e),u(d*e+e-1);for(;l<c;){let d=s[l++],g=d%e;g>0&&u(d-1),g<e-1&&u(d+1),d>=e&&u(d-e),d<(n-1)*e&&u(d+e);}let m=new Uint8ClampedArray(o),f=r;for(let d=0;d<e*n;d++){if(!i[d])continue;let g=Math.min(1,Math.max(0,(a(d)-zm)/(Wm-zm))),h=d*4;if(m[h+3]=Math.round(o[h+3]*g),g>0&&g<1)for(let p=0;p<3;p++){let _=(o[h+p]/255-(1-g)*f[p])/g;m[h+p]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:e,height:n,data:m}}async function D2(t){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let e=await new Promise(s=>{let l=new Image;l.crossOrigin="anonymous",l.onload=()=>s(l),l.onerror=()=>s(null),l.src=t;});if(!e)return null;let n=e.naturalWidth||512,o=e.naturalHeight||512,r=Math.min(1,qm/Math.max(n,o)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(n*r)),a.height=Math.max(1,Math.round(o*r));let i=a.getContext("2d",{willReadFrequently:true});if(!i)return null;try{i.drawImage(e,0,0,a.width,a.height);let s=i.getImageData(0,0,a.width,a.height),l=Vm(s);return l?(s.data.set(l.data),i.putImageData(s,0,0),a.toDataURL("image/png")):null}catch{return null}finally{a.remove();}}async function B2(t){let{value:e,size:n=it,level:o=Jt,bgColor:r=ft,fgColor:a=Rt,margin:i=pt,imageSettings:s,eyeColor:l,dotColor:c,bodyPattern:u,cornerEyePattern:m,cornerEyeDotPattern:f,isOGContext:d,templateId:g,customTemplate:h,customProps:p,frame:b,art:_,eyeColors:y,moduleScale:w,eyeShapes:C,eyeGradient:S,bgRadius:$,backdrop:M,halo:R,shadow:E,frameLabelMarkers:P,partMarkers:v,autoLevel:L,...F}=t,k=Gn({value:e,size:n,margin:i,level:o,autoLevel:L},s),T=At({value:e,size:n,level:o,margin:i,imageSettings:k,autoLevel:L}),z=dt.QrCode.encodeText(e,St[T]).getModules(),W=z.length+i*2,D=Re(z,n,i,k),U=null;if(k!=null&&D!=null){D.excavation!=null&&(z=ps(z,D.excavation));let xt=k.src.startsWith("data:")?k.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(k.src)}&w=100&h=100&encoding=base64`).then(lt=>{if(!lt.ok)throw new Error(`Failed to load QR logo (${lt.status}): ${k.src}`);return lt.text()});U={settings:{...k,src:xt},box:{x:D.x+i,y:D.y+i,w:D.w,h:D.h}};}let X=k0(z,i);return {size:n,numCells:W,fgPath:X,bgColor:r,fgColor:a,frame:b,svgProps:F,logo:U}}function G2(t){let{size:e,numCells:n,fgPath:o,bgColor:r,fgColor:a,frame:i,svgProps:s,logo:l}=t,c=Nt(i),u=l?Co(l.settings,l.box):A(Ut,{}),m=$t("svg",{height:e,viewBox:`0 0 ${n} ${n}`,width:e,xmlns:"http://www.w3.org/2000/svg",...c?{}:s,children:[A("path",{d:`M0,0 h${n}v${n}H0z`,fill:bt(r,ft),shapeRendering:"crispEdges"}),A("path",{d:o,fill:bt(a,Rt),shapeRendering:"crispEdges"}),u]});return c&&i?$r(m,{size:e,frame:i,bgColor:r,svgProps:s}):m}async function Q2(t){return G2(await B2(t))}var U2={value:true,size:true,level:true,bgColor:true,fgColor:true,eyeColor:true,dotColor:true,bodyPattern:true,cornerEyePattern:true,cornerEyeDotPattern:true,margin:true,style:true,imageSettings:true,isOGContext:true,templateId:true,customTemplate:true,customProps:true,frame:true,art:true,eyeColors:true,moduleScale:true,autoLevel:true,shape:true,eyeShapes:true,eyeGradient:true,bgRadius:true,backdrop:true,halo:true,shadow:true,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function H2(t){let e={};for(let n of Object.keys(t))Object.hasOwn(U2,n)||(e[n]=t[n]);return e}var z2=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function jm(t){let e=Object.fromEntries(z2.map(n=>[n,t[n]]));return tl({...e,margin:t.margin??pt})}function Xm(t,e){let{size:n=it,scale:o=1,level:r,style:a,customTemplate:i,customProps:s,frame:l,art:c,eyeColors:u,moduleScale:m,autoLevel:f,shape:d,frameLabelMarkers:g,partMarkers:h}=t,p={...e.eyeShapes&&{eyeShapes:e.eyeShapes},...e.eyeGradient&&{eyeGradient:e.eyeGradient},...e.bgRadius&&{bgRadius:e.bgRadius},...e.backdrop&&{backdrop:e.backdrop},...e.halo&&{halo:e.halo},...e.shadow&&{shadow:e.shadow}},b=n*o,_=b/e.size,y=e.imageSettings&&{...e.imageSettings,height:e.imageSettings.height*_,width:e.imageSettings.width*_,...e.imageSettings.x!=null&&{x:e.imageSettings.x*_},...e.imageSettings.y!=null&&{y:e.imageSettings.y*_},...e.imageSettings.padding!=null&&{padding:e.imageSettings.padding*_}};return {art:c,bgColor:e.bgColor,bodyPattern:e.bodyPattern,cornerEyeDotPattern:e.cornerEyeDotPattern,cornerEyePattern:e.cornerEyePattern,customProps:s,customTemplate:i,dotColor:e.dotColor,eyeColor:e.eyeColor,fgColor:e.fgColor,frame:l,level:r||e.level,margin:e.margin,...u&&{eyeColors:u},...m!==void 0&&{moduleScale:m},...f&&{autoLevel:f},...d&&d!=="square"&&{shape:d},...p,...g&&{frameLabelMarkers:g},...h&&{partMarkers:h},size:b,style:a,templateId:e.templateId,value:e.value,...y&&{imageSettings:y},...H2(t)}}function W2(t){return Xm(t,jm(t))}function Ym(t,e){let n=[],o=r=>{if(r==null||typeof r=="boolean")return;if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"){n.push(`${r}`);return}if(Array.isArray(r)){for(let c of r)o(c);return}if(!ze(r))throw new TypeError("qrdx: can't render this value");let{type:a,props:i,key:s}=r;if(An(a)){o(i.children);return}if(typeof a=="function"){o(a(i));return}let l={};for(let c of Object.keys(i)){let u=Vn(c,i[c]);u&&(l[u.name]=u.value);}n.push(e(a,l,Ym(i.children,e),s));};return o(t),n}var Yn=300,Or=t=>{let e=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isFinite(e)?e:void 0};function q2(t){let e=Or(t.x)??0,n=Or(t.y)??0,o=te(typeof t.viewBox=="string"?t.viewBox:void 0),r=Or(t.width),a=Or(t.height);if(o.length!==4||!(o[2]&&o[3]&&r&&a))return [1,0,0,1,e,n];let[i,s,l,c]=o,u=Math.min(r/l,a/c);return [u,0,0,u,e+(r-l*u)/2-i*u,n+(a-c*u)/2-s*u]}function el(t,e,n,o){if(t===e)return n;if(Array.isArray(t)){for(let s of t){let l=el(s,e,n,false);if(l)return l}return null}let r=t;if(!r||typeof r!="object"||!r.props)return null;let{props:a}=r,i=mt(n,Qt(typeof a.transform=="string"?a.transform:void 0));return r.type==="svg"&&!o&&(i=mt(i,q2(a))),el(a.children,e,i,false)}function nl(t){let e=t.customTemplate||(t.templateId?vo(t.templateId):void 0);if(!e)return 1;let n={type:"svg",props:{height:Yn,viewBox:`0 0 ${Yn} ${Yn}`,width:Yn},key:null},o;try{o=e.wrapper(n,{fgColor:typeof t.fgColor=="string"?t.fgColor:void 0,bgColor:typeof t.bgColor=="string"?t.bgColor:void 0,...t.customProps??{}},{pixelSize:10,url:t.value});}catch{return 1}let r=o?.props;if(!r)return 1;let a=te(typeof r.viewBox=="string"?r.viewBox:void 0),i=a.length===4?a[2]:Or(r.width),s=el(o,n,Cn,true);if(!(s&&i))return 1;let[l,c]=q(s,0,0),[u,m]=q(s,Yn,Yn),d=Math.min(Math.abs(u-l),Math.abs(m-c))/i;return d>0&&d<=1?d:1}var od=[96,160,320],ol=640;function sa(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Le(t){if(t?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var ad=()=>new Promise(t=>setTimeout(t,0));async function il(){let{default:t}=await import('jsqr');return t}function al(t,e){if(!t)return false;if(t.data===e)return true;try{return new TextDecoder().decode(Uint8Array.from(t.binaryData))===e}catch{return false}}function V2(t,e,n=.7){let{data:o,width:r,height:a}=t,i=r*a,s=Math.max(1,Math.round(e*.25)),l=j2(o,i);if(l){for(let u=0;u<i;u++)l[u]=128+(l[u]-128)*n;Zm(l,r,a,s);for(let u=0,m=0;u<i;u++,m+=4){let f=l[u];o[m]=f,o[m+1]=f,o[m+2]=f;}return}let c=new Uint8ClampedArray(i);for(let u=0;u<3;u++){for(let m=0,f=u;m<i;m++,f+=4)c[m]=128+(o[f]-128)*n;Zm(c,r,a,s);for(let m=0,f=u;m<i;m++,f+=4)o[f]=c[m];}}function j2(t,e){let n=new Uint8ClampedArray(e);for(let o=0,r=0;o<e;o++,r+=4){let a=t[r];if(a!==t[r+1]||a!==t[r+2])return null;n[o]=a;}return n}function Zm(t,e,n,o){let r=2*o+1,a=new Float32Array(e*n),i=s=>{let l=s?n:e,c=s?e:n,u=s?e:1,m=s?1:e;for(let f=0;f<l;f++){let d=f*u,g=0;for(let h=-o;h<=o;h++)g+=t[d+Math.min(Math.max(h,0),c-1)*m];for(let h=0;h<c;h++)a[d+h*m]=g/r,g=g-t[d+Math.max(h-o,0)*m]+t[d+Math.min(h+o+1,c-1)*m];}t.set(a);};for(let s=0;s<2;s++)i(true),i(false);}function Zn(t,e){let n=document.createElement("canvas");n.width=Math.max(1,Math.round(t)),n.height=Math.max(1,Math.round(e));let o=n.getContext("2d",{willReadFrequently:true});if(!o)throw new Error("Could not get canvas context");return o.imageSmoothingEnabled=true,o.imageSmoothingQuality="high",{canvas:n,ctx:o}}var X2=[.9,1,1.1];function id(t){return X2.map(e=>t*e)}function sl(t,e,n,o,r){let a=0;for(let i of id(n)){let s=e(i);if(V2(s,i/o),r(t(s.data,s.width,s.height))&&(a++,a>=2))break}return a>=2?"pass":a===1?"fragile":"fail"}var rl={small:"small print or far away",medium:"typical phone distance",large:"close up"};function Y2(t,e){return t===e[0]&&e.length>1?rl.small:t===e.at(-1)?rl.large:rl.medium}function sd(t,e,n){if(n==="pass")return 0;let o=e===1?[45]:e===2?[20,45]:[15,20,45],r=o[Math.round(t*(o.length-1)/Math.max(e-1,1))]??20;return n==="fragile"?Math.round(r/2):r}function ld(t,e,n){let o=`${t} px (${Y2(t,e)})`;return n==="pass"?{id:`decode-${t}`,passed:true,message:`Reads at ${o}, with camera blur`}:{id:`decode-${t}`,passed:false,message:n==="fragile"?`Reads at ${o} only some of the time`:`Doesn't read at ${o}`,fix:t===e[0]?"Print it bigger, shorten the content (fewer modules) or use solid square dots":"Raise the contrast, use bigger dots or a simpler eye shape"}}function cd(t,e){return e?"fails":t>=85?"great":t>=65?"ok":"risky"}function Z2(t,e,n){let o=Lt(t,e);if(o.type==="solid")return [o.color];if(o.type!=="image")return o.stops.map(s=>s.color);let r=o.underlay?ia(o.underlay):null,a=n?.[o.src];if(!a)return o.underlay?[o.underlay]:[];let i=o.opacity??1;return [a.light,a.dark].flatMap(s=>{let l=ia(s);if(!l)return [];let c={...l,a:l.a*i};if(!r)return [Km(c)];let u=c.a+r.a*(1-c.a),m=(f,d)=>u>0?(f*c.a+d*r.a*(1-c.a))/u:0;return [Km({r:m(c.r,r.r),g:m(c.g,r.g),b:m(c.b,r.b),a:u})]})}var Km=({r:t,g:e,b:n,a:o})=>`rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(n)}, ${Math.round(o*1e3)/1e3})`;function K2(t){let e=[],n=t.width*t.height;for(let a=0;a<n;a++){let i=t.data[a*4],s=t.data[a*4+1],l=t.data[a*4+2];t.data[a*4+3]<128||e.push({lum:qn(i,s,l),r:i,g:s,b:l});}if(e.length===0)return null;e.sort((a,i)=>a.lum-i.lum);let o=Math.max(1,Math.round(e.length/10)),r=a=>{let i=a.reduce((l,c)=>({r:l.r+c.r,g:l.g+c.g,b:l.b+c.b}),{r:0,g:0,b:0}),s=l=>Math.round(l/a.length).toString(16).padStart(2,"0");return `#${s(i.r)}${s(i.g)}${s(i.b)}`};return {dark:r(e.slice(0,o)),light:r(e.slice(-o))}}async function J2(t){sa();let e=await Gr(t),{canvas:n,ctx:o}=Zn(64,64);o.drawImage(e,0,0,64,64);let r=K2(o.getImageData(0,0,64,64));return n.remove(),r}function ud(t){let e=[t.bgColor,t.fgColor,t.eyeColor,t.dotColor,...Be.flatMap(o=>[t.eyeColors?.[o]?.outer,t.eyeColors?.[o]?.inner])],n=new Set;for(let o of e)typeof o=="object"&&o?.type==="image"&&n.add(o.src);return [...n]}var Dr=null;function ia(t){let e=at(t);if(e||typeof document>"u")return e;if(Dr??=document.createElement("canvas").getContext("2d"),!Dr)return null;Dr.fillStyle="#010203",Dr.fillStyle=t;let n=String(Dr.fillStyle);return n==="#010203"?null:at(n)}var Jm=t=>qn(t.r,t.g,t.b),md=(t,e)=>(Math.max(t,e)+.05)/(Math.min(t,e)+.05),Br=4.5,tb=3,td=1.5,ed={code:7,background:12},nd={r:255,g:255,b:255,a:1},rd=(t,e)=>({r:t.r*t.a+e.r*(1-t.a),g:t.g*t.a+e.g*(1-t.a),b:t.b*t.a+e.b*(1-t.a),a:1});function eb(t,e={}){let n=e.imageTones,o=(g,h)=>{let p=typeof g=="object"&&g?.type==="image";return Z2(g,h,n).map(b=>({color:b,picture:p}))},r=t.fgColor??Rt,a=Be.flatMap(g=>{let h=t.eyeColors?.[g];return [...h?.outer?o(h.outer,Rt):[],...h?.inner?o(h.inner,Rt):[]]}),i=[...o(r,Rt),...o(t.eyeColor??r,Rt),...o(t.dotColor??r,Rt),...a],s=o(t.bgColor,ft),l=Cr(t.halo,t)?.color;l&&s.push({color:l,picture:false});let c=(s.length>0?s:[{color:"#ffffff",picture:false}]).map(g=>{let h=ia(g.color);return {color:h?rd(h,nd):nd,picture:g.picture}}),u=i.flatMap(g=>{let h=ia(g.color);return h?[{color:h,picture:g.picture}]:[]}),m=Number.POSITIVE_INFINITY,f=Br,d=false;for(let g of u)for(let h of c){let p=Jm(rd(g.color,h.color)),b=Jm(h.color),_=md(p,b),y=h.picture?ed.background:g.picture?ed.code:Br;_/y<m/f&&(m=_,f=y),p>b&&(d=true);}return {ratio:Number.isFinite(m)?m:Number.POSITIVE_INFINITY,required:f,inverted:d}}function nb(t,e){let{ratio:n,inverted:o,required:r}=eb(t,{imageTones:e});if(!Number.isFinite(n))return {checks:[],penalty:0,fails:false};let a=r/Br,i=r!==Br,s=Math.round(n*10)/10,l=[],c=0;return n>=r?l.push({id:"contrast",passed:true,message:`Contrast ${s}:1 between code and background`}):(c=n<td*a?60:n<tb*a?30:10,l.push({id:"contrast",passed:false,message:i?`Low contrast for a picture (${s}:1); ${r}:1 or more scans reliably`:`Low contrast (${s}:1); 4.5:1 or more scans reliably`,fix:i?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),o?(c+=10,l.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):l.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:l,penalty:c,fails:n<td*(r/Br)}}function ll(t){return dt.QrCode.encodeText(t.value,St[At(t)]).getModules()}function rb(t){let{imageSettings:e}=t;if(!e)return {check:null,penalty:0};let n=ll(t),o=Re(n,t.size??it,Et(n.length,t.margin??pt,t.shape),e);if(!o)return {check:null,penalty:0};let r=o.excavation??o,a=n.length,s=[[0,0],[a-8,0],[0,a-8]].some(([g,h])=>r.x<g+9&&r.x+r.w>g&&r.y<h+9&&r.y+r.h>h),l=a>21?a-9:null,c=l!==null&&r.x<l+5&&r.x+r.w>l&&r.y<l+5&&r.y+r.h>l;if(s||c)return {check:{id:"logo",passed:false,message:s?"The logo covers a corner eye":"The logo covers the small square near the bottom-right corner",fix:"Move the logo toward the center or make it smaller"},penalty:40};let u=r.w*r.h/(a*a),m=At(t),f=Math.round(u*100),d=Mo({value:t.value,size:t.size??it,margin:t.margin??pt,level:m,shape:t.shape},e);return !d||d.worst<=d.budget?{check:{id:"logo",passed:true,message:`Logo covers ${f}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${f}% of the code and spoils ${d.worst} codewords in one block, which repairs ${d.correctable}`,fix:d.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:d.worst>d.correctable?25:10}}function ob(t){let e=wr(t.shape)?tn(t.margin??pt):t.margin??pt,n=ll(t).length+2*e,o=e+(Nt(t.frame)?Qi(t.frame)*n:0),r=Math.round(o*10)/10;return o>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules`},penalty:0}:o>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${r} modules (4 is ideal)`},penalty:0}:{check:{id:"quiet-zone",passed:false,message:"No quiet zone around the code",fix:"Leave clear space (about 10% of the code width) around it wherever you place it, or add a frame"},penalty:5}}function ab(t){let e=rs(t);return e?e.reason==="adjusted"?{check:{id:"halo",passed:true,message:e.message},penalty:0}:{check:{id:"halo",passed:false,message:e.message,fix:e.fix},penalty:15}:{check:null,penalty:0}}function ib(t){let e=Ji(t);return e==="curly"?{check:{id:"eye-shape",passed:false,message:"Curly eyes fail strict decoders such as ZXing-based apps",fix:"Pick square, rounded or gear eyes"},penalty:40}:e==="circle"?{check:{id:"eye-shape",passed:false,message:"Circle eyes only read in lenient decoders; many apps miss them",fix:"Pick square, rounded or gear eyes"},penalty:20}:{check:{id:"eye-shape",passed:true,message:`No known decoder issues with ${e} eyes`},penalty:0}}function Gr(t){return new Promise((e,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>n(new Error("Could not load image")),o.src=t;})}var sb=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="10" height="10" rx="2" fill="#808080"/></svg>')}`;async function lb(t){let{imageSettings:e}=t;if(!e||e.src.startsWith("data:"))return t;let n=sb;try{let o=await Gr(e.src),{canvas:r,ctx:a}=Zn(o.naturalWidth||256,o.naturalHeight||256);a.drawImage(o,0,0,r.width,r.height),n=r.toDataURL("image/png");}catch{}return {...t,imageSettings:{...e,src:n}}}async function cb(t){let e=new Map;for(let r of ud(t))if(!r.startsWith("data:"))try{let a=await Gr(r),{canvas:i,ctx:s}=Zn(a.naturalWidth||256,a.naturalHeight||256);s.drawImage(a,0,0,i.width,i.height),e.set(r,i.toDataURL("image/png")),i.remove();}catch{e.set(r,null);}if(e.size===0)return t;let n=r=>{if(typeof r!="object"||r?.type!=="image")return r;let a=e.get(r.src);return a===void 0?r:a?{...r,src:a}:r.underlay??Rt},o=t.eyeColors?Object.fromEntries(Object.entries(t.eyeColors).map(([r,a])=>[r,a&&{outer:n(a.outer),inner:n(a.inner)}])):void 0;return {...t,bgColor:n(t.bgColor),fgColor:n(t.fgColor),eyeColor:n(t.eyeColor),dotColor:n(t.dotColor),...o&&{eyeColors:o}}}async function cl(t,e,n,o,r){let a=[],i=0,s=nb(t,r);i+=s.penalty;let l=rb(t);i+=l.penalty;let c=ob(t);i+=c.penalty;let u=ib(t);i+=u.penalty;let m=ab(t);i+=m.penalty;let f=ts(t),d=f?.kind==="eye"?null:f;d&&d.kind!=="sharp-dot-eye"&&(i+=10);let g=await il();Le(o);let h=ll(t).length,p=h+2*Et(h,t.margin??pt,t.shape),b=[],_=false;for(let[C,S]of n.entries()){await ad(),Le(o);let $=sl(g,e,S,p,M=>al(M,t.value));i+=sd(C,n.length,$),b.push(ld(S,n,$)),C===n.length-1&&$==="fail"&&(_=true);}a.push(...b,...s.checks),l.check&&a.push(l.check),a.push(u.check,c.check),m.check&&a.push(m.check),d&&a.push({id:"style-pair",passed:false,message:d.message,fix:d.fix});let y=_||s.fails,w=Math.max(0,Math.min(100,100-i));return y&&(w=Math.min(w,30)),{score:w,grade:cd(w,y),checks:a}}function dd(t){return [...t.sizes??od].filter(e=>e>0).sort((e,n)=>e-n)}async function N6(t,e={}){sa();let{draw:n,sizes:o,imageTones:r}=await fd(t,e);return await cl(t,n,o,e.signal,r)}async function O6(t,e={}){sa();let{draw:n,sizes:o,imageTones:r}=await fd(t,e),a=o.flatMap(i=>id(i).map(s=>{let{data:l,width:c,height:u}=n(s);return {codeWidth:s,width:c,height:u,data:l}}));return {sizes:o,frames:a,imageTones:r}}async function D6(t,e,n={}){let o=new Map(e.frames.map(a=>[a.codeWidth,a]));return await cl(t,a=>{let i=o.get(a);if(!i||i.data.length<i.width*i.height*4)throw new Error(`No scan frame with the code ${a} px wide: draw the frames with drawScanFrames for these props and sizes`);return {data:new Uint8ClampedArray(i.data),width:i.width,height:i.height,colorSpace:"srgb"}},e.sizes,n.signal,e.imageTones)}async function fd(t,e){let{signal:n}=e,o=dd(e),r=ol/nl(t),a=await cb(await lb(Pe({...t,size:t.size??it},r)));Le(n);let i={};for(let m of ud(t))try{let f=await J2(m);f&&(i[m]=f);}catch{}Le(n);let s=await Xt(a),l=await Gr(s);Le(n);let c=me(r,t.frame);return {draw:m=>{let f=m/ol,d=c.width*f,g=c.height*f,h=Math.max(8,Math.round(m*.12)),{canvas:p,ctx:b}=Zn(d+2*h,g+2*h);b.fillStyle="#ffffff",b.fillRect(0,0,p.width,p.height),b.drawImage(l,h,h,d,g);let _=b.getImageData(0,0,p.width,p.height);return p.remove(),_},sizes:o,imageTones:i}}var B6=ol;async function G6(t,e,n={}){let{width:o,height:r}=e;if(!(o>0&&r>0)||e.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=dd(n),i=t.size??it,s=me(i,t.frame),l=o*i*nl(t)/s.width,c={data:ub(e),width:o,height:r},u=hd(c.data);return await cl(t,f=>{let d=pd(c,f/l,u),g=Math.max(8,Math.round(f*.12));return mb(d,g)},a,n.signal)}function ub(t){let{data:e,width:n,height:o}=t,r=new Uint8ClampedArray(n*o*4);for(let a=0;a<n*o*4;a+=4){let i=e[a+3]/255;for(let s=0;s<3;s++)r[a+s]=e[a+s]*i+255*(1-i);r[a+3]=255;}return r}function mb(t,e){let n=t.width+2*e,o=t.height+2*e,r=new Uint8ClampedArray(n*o*4).fill(255);for(let a=0;a<t.height;a++)r.set(t.data.subarray(a*t.width*4,(a+1)*t.width*4),((a+e)*n+e)*4);return {data:r,width:n,height:o,colorSpace:"srgb"}}var ve=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y);function aa(t,e){return .299*t[e]+.587*t[e+1]+.114*t[e+2]}function db(t,e){let n=0;for(let s=0;s<256;s++)n+=s*t[s];let o=0,r=0,a=0,i=128;for(let s=0;s<256;s++){if(r+=t[s],r===0)continue;let l=e-r;if(l===0)break;o+=s*t[s];let c=o/r,u=(n-o)/l,m=r*l*(c-u)**2;m>a&&(a=m,i=s);}return i}async function fb(t){if(!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=URL.createObjectURL(t);try{let n=await Gr(e);return await n.decode?.().catch(()=>{}),n}finally{setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function Q6(t,e={}){sa();let{signal:n}=e,o=[...e.sizes??od].filter(G=>G>0).sort((G,K)=>G-K),r=await il(),a=await fb(t);Le(n);let i=a.naturalWidth||a.width,s=a.naturalHeight||a.height;if(!(i&&s))throw new Error("Could not read this image");let l=Math.min(1,1600/Math.max(i,s)),{canvas:c,ctx:u}=Zn(i*l,s*l);u.fillStyle="#ffffff",u.fillRect(0,0,c.width,c.height),u.drawImage(a,0,0,c.width,c.height);let m=u.getImageData(0,0,c.width,c.height),f=r(m.data,m.width,m.height);if(Le(n),!f){let G=await Sc(a,0,false);return c.remove(),typeof G!="string"||G==="NO_QR"?{data:null,version:null,score:0,grade:"fails",checks:[{id:"decode",passed:false,message:"No QR code found in this image",fix:"Try a sharper, well-lit, straight-on photo or a screenshot"}]}:{data:G,version:null,score:55,grade:"risky",checks:[{id:"decode",passed:false,message:"Decoded only after cropping; the code is small or hard to find in this image",fix:"Make the code bigger relative to its surroundings"}]}}let{location:d,version:g}=f,h=17+4*g,p=(ve(d.topLeftCorner,d.topRightCorner)+ve(d.bottomLeftCorner,d.bottomRightCorner)+ve(d.topLeftCorner,d.bottomLeftCorner)+ve(d.topRightCorner,d.bottomRightCorner))/4,b=p/h,_=[d.topLeftCorner,d.topRightCorner,d.bottomRightCorner,d.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(..._.map(G=>G.x)))),w=Math.min(m.width,Math.ceil(Math.max(..._.map(G=>G.x)))),C=Math.max(0,Math.floor(Math.min(..._.map(G=>G.y)))),S=Math.min(m.height,Math.ceil(Math.max(..._.map(G=>G.y)))),$=[],M=0,R=new Array(256).fill(0),E=0;for(let G=C;G<S;G++)for(let K=y;K<w;K++){let Q=Math.round(aa(m.data,(G*m.width+K)*4));R[Q]=R[Q]+1,E++;}let P=db(R,E),v={dark:[0,0,0,0],light:[0,0,0,0]};for(let G=C;G<S;G++)for(let K=y;K<w;K++){let Q=(G*m.width+K)*4,gt=aa(m.data,Q)<=P?v.dark:v.light;gt[0]=gt[0]+m.data[Q],gt[1]=gt[1]+m.data[Q+1],gt[2]=gt[2]+m.data[Q+2],gt[3]=gt[3]+1;}let L=G=>{let K=Math.max(G[3],1);return qn(G[0]/K,G[1]/K,G[2]/K)},F=L(v.dark),k=L(v.light),T=md(F,k),z=Math.round(T*10)/10;T>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${z}:1 in the image`}):(M+=T<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${z}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let D=[d.topLeftFinderPattern,d.topRightFinderPattern,d.bottomLeftFinderPattern].map(G=>{let K=Math.min(m.width-1,Math.max(0,Math.round(G.x))),Q=Math.min(m.height-1,Math.max(0,Math.round(G.y)));return aa(m.data,(Q*m.width+K)*4)}).filter(G=>G>P).length>=2;D?(M+=10,$.push({id:"polarity",passed:false,message:"Light code on a dark background; some scanner apps can't read it",fix:"Use dark modules on a light background"})):$.push({id:"polarity",passed:true,message:"Dark code on a light background"});let U=Math.max(2,Math.round(b*2)),X={minX:y-U,maxX:w+U,minY:C-U,maxY:S+U};if(X.minX<0||X.minY<0||X.maxX>m.width||X.maxY>m.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let G=0,K=0;for(let Q=X.minY;Q<X.maxY;Q++)for(let gt=X.minX;gt<X.maxX;gt++){if(gt>=y&&gt<w&&Q>=C&&Q<S)continue;let ut=aa(m.data,(Q*m.width+gt)*4);(D?ut>P:ut<=P)&&G++,K++;}G/Math.max(K,1)>.12?(M+=10,$.push({id:"quiet-zone",passed:false,message:"Something dark touches the code; the quiet zone isn't clear",fix:"Leave clear space (about 4 modules) around the code"})):$.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}b<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(b*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):$.push({id:"resolution",passed:true,message:`About ${Math.round(b)} px per module`});let lt=Math.round(b*4),N=Math.max(0,y-lt),B=Math.max(0,C-lt),Z=Math.min(m.width,w+lt)-N,Pt=Math.min(m.height,S+lt)-B,ct=G=>{let K=G/p,Q=Zn(Z*K,Pt*K);Q.ctx.drawImage(c,N,B,Z,Pt,0,0,Q.canvas.width,Q.canvas.height);let gt=Q.ctx.getImageData(0,0,Q.canvas.width,Q.canvas.height);return Q.canvas.remove(),gt},Zt=[],ae=false;for(let[G,K]of o.entries()){await ad(),Le(n);let Q=sl(r,ct,K,h,gt=>gt?.data===f.data);M+=sd(G,o.length,Q),Zt.push(ld(K,o,Q)),G===o.length-1&&Q==="fail"&&(ae=true);}c.remove();let Te=Math.max(0,Math.min(100,100-M));return ae&&(Te=Math.min(Te,30)),{data:f.data,version:g,score:Te,grade:cd(Te,ae),checks:[...Zt,...$]}}var hb=[320];function hd(t){for(let e=0;e<t.length;e+=4)if(t[e]!==t[e+1]||t[e]!==t[e+2])return false;return true}function pd(t,e,n=false){let o=Math.min(1,e),r=Math.max(1,Math.round(t.width*o)),a=Math.max(1,Math.round(t.height*o)),i=new Uint8ClampedArray(r*a*4),s=t.width/r,l=t.height/a,{data:c}=t;for(let u=0;u<a;u++){let m=Math.floor(u*l),f=Math.max(m+1,Math.min(t.height,Math.floor((u+1)*l)));for(let d=0;d<r;d++){let g=Math.floor(d*s),h=Math.max(g+1,Math.min(t.width,Math.floor((d+1)*s))),p=(f-m)*(h-g),b=(u*r+d)*4,_=0;if(n){for(let C=m;C<f;C++)for(let S=g;S<h;S++)_+=c[(C*t.width+S)*4];i[b]=_/p,i[b+1]=i[b],i[b+2]=i[b],i[b+3]=255;continue}let y=0,w=0;for(let C=m;C<f;C++)for(let S=g;S<h;S++){let $=(C*t.width+S)*4;_+=c[$],y+=c[$+1],w+=c[$+2];}i[b]=_/p,i[b+1]=y/p,i[b+2]=w/p,i[b+3]=255;}}return {data:i,width:r,height:a,colorSpace:"srgb"}}function pb(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(t.binaryData))}catch{return t.data}}async function U6(t,e,n={}){let{width:o,height:r}=t;if(!(o>0&&r>0)||t.data.length<o*r*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=await il(),i={data:t.data instanceof Uint8ClampedArray?t.data:Uint8ClampedArray.from(t.data),width:o,height:r},s=a(i.data,o,r,{inversionAttempts:"dontInvert"});if(!s)return {data:null,version:null,passed:false};let l=pb(s),{version:c,location:u}=s;if(!al(s,e))return {data:l,version:c,passed:false};let m=17+4*c,f=(ve(u.topLeftCorner,u.topRightCorner)+ve(u.bottomLeftCorner,u.bottomRightCorner)+ve(u.topLeftCorner,u.bottomLeftCorner)+ve(u.topRightCorner,u.bottomRightCorner))/4,d=hd(i.data);for(let g of n.sizes??hb)if(sl(a,p=>pd(i,p/f,d),g,m,p=>al(p,e))!=="pass")return {data:l,version:c,passed:false};return {data:l,version:c,passed:true}}var gb=16,gd=.01;function bb(t){let e=new Float64Array(256);for(let l of t)e[Math.min(255,Math.max(0,Math.round(l*255)))]++;let n=t.length,o=0;for(let l=0;l<256;l++)o+=l*e[l];let r=0,a=0,i=0,s=128;for(let l=0;l<256;l++){if(a+=e[l],a===0)continue;let c=n-a;if(c===0)break;r+=l*e[l];let u=r/a,m=(o-r)/c,f=a*c*(u-m)**2;f>i&&(i=f,s=l);}return (s+.5)/255}function _b(t,e){let{width:n,height:o,data:r}=t,a=n*o,i=new Uint8Array(a),s=0;for(let d=0;d<a;d++)r[d*4+3]<128&&s++;if(e==="alpha"||e==="auto"&&s>a*.02&&s<a*.98){for(let d=0;d<a;d++)i[d]=r[d*4+3]>=128?1:0;return i}let c=new Float32Array(a);for(let d=0;d<a;d++){let g=r[d*4+3]/255,h=.2126*r[d*4]+.7152*r[d*4+1]+.0722*r[d*4+2];c[d]=1-(h*g+255*(1-g))/255;}let u=bb(c);for(let d=0;d<a;d++)i[d]=c[d]>u?1:0;let m=0,f=0;for(let d=0;d<n;d++)for(let g of [0,o-1])m++,f+=i[g*n+d];for(let d=1;d<o-1;d++)for(let g of [0,n-1])m++,f+=i[d*n+g];if(f>m/2)for(let d=0;d<a;d++)i[d]=i[d]?0:1;return i}function bd(t,e,n,o){for(let r of [1,0]){let a=new Uint8Array(t.length);for(let i=0;i<t.length;i++){if(a[i]||t[i]!==r)continue;let s=[i];a[i]=1;let l=false;for(let u of s){let m=u%e,f=(u-m)/e;(m===0||f===0||m===e-1||f===n-1)&&(l=true);for(let[d,g]of [[m-1,f],[m+1,f],[m,f-1],[m,f+1]]){if(d<0||g<0||d>=e||g>=n)continue;let h=g*e+d;!a[h]&&t[h]===r&&(a[h]=1,s.push(h));}}if((r===1||!l)&&s.length<o)for(let u of s)t[u]=r?0:1;}}}function _d(t,e={}){let{width:n,height:o,data:r}=t;if(!(n>0&&o>0)||r.length<n*o*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let a=_b(t,e.mode??"auto"),i=a.reduce(($,M)=>$+M,0);bd(a,n,o,Math.max(16,i*gd));let s=n,l=o,c=-1,u=-1;for(let $=0;$<o;$++)for(let M=0;M<n;M++)a[$*n+M]&&(s=Math.min(s,M),l=Math.min(l,$),c=Math.max(c,M),u=Math.max(u,$));if(c<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let m=c-s+1,f=u-l+1;if(Math.max(m,f)<gb)throw new Error("The shape is too small to trace; use a bigger picture");let g=Math.min(Math.max(Math.round(e.cells??De),_e),De)/Math.max(m,f),h=Math.max(_e,Math.round(m*g)),p=Math.max(_e,Math.round(f*g)),b=Math.max(1,Math.round(m*g)),_=Math.max(1,Math.round(f*g)),y=Math.floor((h-b)/2),w=Math.floor((p-_)/2),C=new Uint8Array(h*p);for(let $=0;$<_;$++){let M=l+Math.floor($*f/_),R=Math.max(M+1,l+Math.floor(($+1)*f/_));for(let E=0;E<b;E++){let P=s+Math.floor(E*m/b),v=Math.max(P+1,s+Math.floor((E+1)*m/b)),L=0;for(let F=M;F<R;F++)for(let k=P;k<v;k++)L+=a[F*n+k];C[($+w)*h+E+y]=L*2>=(R-M)*(v-P)?1:0;}}let S=C.reduce(($,M)=>$+M,0);if(bd(C,h,p,Math.max(4,S*gd)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:h,height:p,cells:Array.from(C,$=>$?"1":"0").join("")}}var ul=512;async function yb(t){if(typeof t!="string"&&!(t instanceof Blob))return t.complete||await new Promise(n=>{t.addEventListener("load",n,{once:true}),t.addEventListener("error",n,{once:true});}),t;let e=typeof t=="string"?t:URL.createObjectURL(t);try{return await new Promise((n,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>n(r),r.onerror=()=>o(new Error("Could not load the picture")),r.src=e;})}finally{typeof t!="string"&&setTimeout(()=>URL.revokeObjectURL(e),1e3);}}async function xb(t,e={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let n=await yb(t),o=n.naturalWidth||n.width||ul,r=n.naturalHeight||n.height||ul,a=ul/Math.max(o,r),i=Math.max(1,Math.round(o*a)),s=Math.max(1,Math.round(r*a)),l=document.createElement("canvas");l.width=i,l.height=s;let c=l.getContext("2d",{willReadFrequently:true});if(!c)throw new Error("Could not get a canvas context");c.drawImage(n,0,0,i,s);let u;try{u=c.getImageData(0,0,i,s);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{l.remove();}return _d(u,e)}/**
27
27
  * @license QR Code generator library (TypeScript)
28
28
  * Copyright (c) Project Nayuki.
29
29
  * SPDX-License-Identifier: MIT
30
- */Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"eyeGradientSpanSchema",{enumerable:true,get:function(){return schemas_js.eyeGradientSpanSchema}});Object.defineProperty(exports,"eyeShapeOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeShapeOverrideSchema}});Object.defineProperty(exports,"eyeShapesSchema",{enumerable:true,get:function(){return schemas_js.eyeShapesSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"haloSchema",{enumerable:true,get:function(){return schemas_js.haloSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"shadowSchema",{enumerable:true,get:function(){return schemas_js.shadowSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});exports.AUTO_LEVEL_LOGO_COVERAGE=La;exports.Arrow=qu;exports.BG_RADIUS_MAX=qr;exports.BG_RADIUS_QUIET_RATIO=Fa;exports.BMP_MAX_DIMENSION=n1;exports.BODY_PATTERN=Cd;exports.BUILT_IN_FRAMES=Di;exports.BUILT_IN_FRAME_SPECS=ah;exports.CORNER_EYE_DOT_PATTERNS=xd;exports.CORNER_EYE_PATTERNS=Sd;exports.CUSTOM_FRAME_STYLE=ar;exports.DEFAULT_ART_INTENSITY=ql;exports.DEFAULT_FRAME_TEXT=Aa;exports.DEFAULT_MARGIN=pt;exports.DEFAULT_SIZE=it;exports.DOWNLOAD_FORMATS=Hs;exports.DotRing=f0;exports.EPS_IMAGE_FILL_REASON=Rm;exports.EYE_GRADIENT_SPANS=Id;exports.EYE_POSITIONS=Be;exports.FRAME_COLOR_TOKENS=Ka;exports.FRAME_FONT_FAMILY=_o;exports.FRAME_FONT_SCALE_MAX=$n;exports.FRAME_FONT_SCALE_MIN=er;exports.FRAME_GAP_RATIO=ou;exports.FRAME_ICONS=Za;exports.FRAME_ICON_BOX=vi;exports.FRAME_ICON_MAX_SEGMENTS=kl;exports.FRAME_IMPORT_LIMITS=Dt;exports.FRAME_LABEL_ATTRIBUTE=au;exports.FRAME_SPEC_KIND=rr;exports.FRAME_SPEC_LABEL_MAX_FONT=ir;exports.FRAME_SPEC_LIMITS=ot;exports.FRAME_SPEC_VERSION=or;exports.FRAME_STYLES=Md;exports.FRAME_TEXT_MAX_LENGTH=se;exports.Fragment=Ut;exports.FrameSpecError=yr;exports.GIFScanError=Do;exports.GIF_ALPHA_THRESHOLD=Vp;exports.GIF_MAX_COLORS=Wp;exports.GIF_MAX_DIMENSION=qp;exports.GIF_MIME=Ir;exports.GRADIENT_FRAME_DEFAULTS=ih;exports.HALO_COLOR_DEFAULT=Vr;exports.HALO_LIGHT_MIN=Ge;exports.HALO_WIDTH_DEFAULT=Da;exports.HALO_WIDTH_MAX=Oa;exports.HALO_WIDTH_MIN=Na;exports.Halloween=p0;exports.ICO_MAX_DIMENSION=rn;exports.ICO_MIME=on;exports.ICO_SIZES=Go;exports.LOGO_CLEANUP_MAX_SIDE=Wm;exports.LOGO_EC_SAFETY=Cu;exports.LOGO_PADDING_MAX=Ad;exports.LOGO_PLATE_INSET=wo;exports.LOGO_ROUNDED_RADIUS=So;exports.LOGO_SHAPES=Rd;exports.LOGO_SIZE_DEFAULT=Ia;exports.LOGO_SIZE_MAX=Pa;exports.LOGO_SIZE_MIN=Ed;exports.MODULE_SCALE_FLOOR=yc;exports.MODULE_SCALE_MAX=va;exports.MODULE_SCALE_MIN=Wr;exports.OFFICIAL_FRAME_COLLECTIONS=I2;exports.OFFICIAL_FRAME_COUNT=A2;exports.OFFICIAL_FRAME_COUNTS=P2;exports.PIXEL_SCAN_SIZES=cb;exports.PIXEL_SCORE_MIN_CODE_WIDTH=L6;exports.PRESET_SIZES=Ex;exports.QR_ART_MAX_SAMPLE_SIZE=Jn;exports.QR_ART_MIN_LUMA_GAP=eo;exports.QR_ART_MODES=zr;exports.QR_ART_SAMPLE_SIZES=si;exports.QR_ART_VARIANTS=Ea;exports.QR_CIRCLE_QUIET_MIN=Ta;exports.QR_EYE_ATTRIBUTE=zu;exports.QR_PARTS=pp;exports.QR_PART_ATTRIBUTE=os;exports.QR_SHAPES=Pd;exports.QR_SILHOUETTE_MAX_CELLS=De;exports.QR_SILHOUETTE_MIN_CELLS=_e;exports.QR_SILHOUETTE_MIN_SHARE=ka;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=$d;exports.RETIRED_CORNER_EYE_PATTERNS=wd;exports.SCAN_CONTRAST_FAIL=Km;exports.SCAN_CONTRAST_LOW=X2;exports.SCAN_CONTRAST_MIN=Br;exports.SCAN_IMAGE_CONTRAST_MIN=Jm;exports.SCAN_TEST_SIZES=nd;exports.SHADOW_COLOR_DEFAULT=Ha;exports.SHADOW_OFFSET_DEFAULT=Ba;exports.SHADOW_OFFSET_MAX=jr;exports.SHADOW_OPACITY_DEFAULT=Ua;exports.SHADOW_OPACITY_MAX=Qa;exports.SHADOW_OPACITY_MIN=Ga;exports.SHARP_DOT_EYE_SAFE_BODIES=Tu;exports.SUPPORTS_PATH2D=N3;exports.SquareBorder=b0;exports.StandardBox=y0;exports.StrikedBox=$0;exports.TEMPLATES=Pr;exports.WEAK_BODY_EYES=Pu;exports.WEAK_DOTS=vu;exports.WEAK_DOT_EYES=Au;exports.WEAK_EYES=Iu;exports.WEAK_SHARP_DOT_EYES=Lu;exports.WEBP_MAX_DIMENSION=wg;exports.WITHDRAWN_BODY_PATTERNS=tr;exports.WITHDRAWN_CORNER_EYE_DOT_PATTERNS=Oe;exports.WITHDRAWN_CORNER_EYE_PATTERNS=Ne;exports.assertGIFStillScans=Zp;exports.blobToDataUrl=Ot;exports.canvasToBMP=ro;exports.canvasToGIF=Bo;exports.canvasToICO=j0;exports.canvasToPNGBytes=ng;exports.canvasToWebP=Ho;exports.canvasesToICO=Cs;exports.circleQuietZone=tn;exports.clampBgRadius=Un;exports.clampModuleScale=io;exports.colorAlpha=Eo;exports.convertImageSettingsToPixels=zp;exports.copyQRCodeToClipboard=Ix;exports.createFrameTree=mh;exports.createQRArtImage=Vl;exports.createQRCodeTree=gs;exports.createQRSilhouette=hd;exports.damagedCodewords=cr;exports.decodePNGPixels=Gs;exports.defaultTemplate=Vu;exports.downloadFile=Bt;exports.downloadImageData=h_;exports.downloadImageWithBoundingBox=p_;exports.downloadPrintEPS=o2;exports.downloadPrintPDF=nx;exports.downloadPrintSVG=rx;exports.downloadQRCode=Ax;exports.encodeBMP=_i;exports.encodeGIF=Q0;exports.encodeGIFFromRGBA=_s;exports.encodeICO=Ss;exports.encodeWebPLossless=vs;exports.epsToDataUrl=ra;exports.excavateModules=hs;exports.eyeShapeOf=re;exports.fitHaloColor=fp;exports.frameLabels=lu;exports.frameSpecHash=v2;exports.frameSpecOf=go;exports.frameSpecPadding=En;exports.frameSpecQrZone=Kr;exports.generatePath=T0;exports.getAllTemplates=l3;exports.getBgRadiusLimit=ip;exports.getBuiltInFrame=Bi;exports.getCodewordMap=lr;exports.getColorString=_d;exports.getContrastLevel=B3;exports.getContrastRatio=D3;exports.getCustomFrameLayout=Ni;exports.getDownloadFilename=a2;exports.getEyeStyleRisk=Ji;exports.getFrameColors=sh;exports.getFrameDimensions=me;exports.getFrameGapRatio=Gi;exports.getFrameIconPath=Li;exports.getFrameLayout=Je;exports.getFrameSecondaryText=uh;exports.getFrameSpecColors=ho;exports.getFrameSpecGapRatio=Fi;exports.getFrameText=ch;exports.getHaloRisk=ns;exports.getImageScanScore=k6;exports.getImageSettings=Re;exports.getImageTones=j2;exports.getImageTonesFromPixels=V2;exports.getLayoutMargin=Et;exports.getLogoBlockDamage=Mo;exports.getLogoSizeLimit=T2;exports.getLuminance=qn;exports.getNormalizedColor=yd;exports.getPrintLayout=ea;exports.getQRArtColorIssue=Bf;exports.getQRArtEyeColors=gi;exports.getQRArtVariant=no;exports.getQRAsBMP=Im;exports.getQRAsCanvas=ge;exports.getQRAsEPS=na;exports.getQRAsGIF=vm;exports.getQRAsICO=Lm;exports.getQRAsPrintPDF=Wg;exports.getQRAsPrintPDFBuffer=ex;exports.getQRAsPrintSVG=qg;exports.getQRAsSVGDataUri=Xt;exports.getQRAsSVGNode=O2;exports.getQRAsWebP=Pm;exports.getQRCodeData=Vm;exports.getQRCodeDataUrl=Px;exports.getQRCodeSVGProps=jm;exports.getQRData=Js;exports.getQRFunctionModules=Ef;exports.getQRModuleCount=Hg;exports.getQRShapePath=Ph;exports.getQRSilhouetteFit=Rh;exports.getSVGString=vx;exports.getScanContrast=Y2;exports.getScanScore=v6;exports.getScanScoreFromPixels=T6;exports.getSolidColor=bt;exports.getStylePairRisk=qi;exports.getTemplate=vo;exports.getTemplateIds=c3;exports.getWebPCompression=Ls;exports.h=Jr;exports.haloTints=hp;exports.handleImageLoad=$c;exports.hasImageFill=Em;exports.hexToRgb=O3;exports.imagePositionCss=Rl;exports.importFrameSvg=E2;exports.indexedToRGBA=ys;exports.isBMPFile=yi;exports.isFrameActive=Nt;exports.isGIFFile=xs;exports.isGradient=Fe;exports.isICOFile=ws;exports.isImagePaint=Ra;exports.isLatin1Text=zd;exports.isQRArtActive=ci;exports.isQRNode=ze;exports.isSeeThroughBackground=Gu;exports.isShapedCode=wr;exports.isWeakSharpPair=ku;exports.isWebPFile=sm;exports.loadQRArtImage=Cf;exports.loadQRSilhouette=pb;exports.logoFitsBudget=ep;exports.mixFrameColors=_r;exports.normalizeColorConfig=Lt;exports.partMarker=as;exports.pixelsToGIF=Kp;exports.quantizeRGBA=B0;exports.removeLogoBackdrop=qm;exports.removeLogoBackground=k2;exports.renderQRArt=fi;exports.renderToDOM=Rs;exports.renderToString=an;exports.resolveErrorLevel=At;exports.resolveFrameSpec=Ke;exports.resolveHalo=Cr;exports.resolveQRCodeProps=Q2;exports.resolveShadow=rs;exports.rgbToCmyk=$e;exports.sanitizeFrameText=Rn;exports.scanQRPixels=F6;exports.svgToEPS=Mm;exports.toHyperscript=Xm;exports.toSVGElement=Sg;exports.toSVGString=Es;exports.validateSize=zs;exports.weakestEyePattern=Ki;exports.withQRSize=Pe;exports.withdrawnFallback=Gt;//# sourceMappingURL=core.js.map
30
+ */Object.defineProperty(exports,"angularGradientSchema",{enumerable:true,get:function(){return schemas_js.angularGradientSchema}});Object.defineProperty(exports,"anyFrameSchema",{enumerable:true,get:function(){return schemas_js.anyFrameSchema}});Object.defineProperty(exports,"baseTemplatePropsSchema",{enumerable:true,get:function(){return schemas_js.baseTemplatePropsSchema}});Object.defineProperty(exports,"bodyPatternSchema",{enumerable:true,get:function(){return schemas_js.bodyPatternSchema}});Object.defineProperty(exports,"colorConfigSchema",{enumerable:true,get:function(){return schemas_js.colorConfigSchema}});Object.defineProperty(exports,"colorTypeSchema",{enumerable:true,get:function(){return schemas_js.colorTypeSchema}});Object.defineProperty(exports,"cornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyeDotPatternSchema}});Object.defineProperty(exports,"cornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.cornerEyePatternSchema}});Object.defineProperty(exports,"customFrameSchema",{enumerable:true,get:function(){return schemas_js.customFrameSchema}});Object.defineProperty(exports,"errorLevelSchema",{enumerable:true,get:function(){return schemas_js.errorLevelSchema}});Object.defineProperty(exports,"excavationSchema",{enumerable:true,get:function(){return schemas_js.excavationSchema}});Object.defineProperty(exports,"eyeColorOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeColorOverrideSchema}});Object.defineProperty(exports,"eyeColorsSchema",{enumerable:true,get:function(){return schemas_js.eyeColorsSchema}});Object.defineProperty(exports,"eyeGradientSpanSchema",{enumerable:true,get:function(){return schemas_js.eyeGradientSpanSchema}});Object.defineProperty(exports,"eyeShapeOverrideSchema",{enumerable:true,get:function(){return schemas_js.eyeShapeOverrideSchema}});Object.defineProperty(exports,"eyeShapesSchema",{enumerable:true,get:function(){return schemas_js.eyeShapesSchema}});Object.defineProperty(exports,"frameSchema",{enumerable:true,get:function(){return schemas_js.frameSchema}});Object.defineProperty(exports,"frameSpecColorSchema",{enumerable:true,get:function(){return schemas_js.frameSpecColorSchema}});Object.defineProperty(exports,"frameSpecLabelSchema",{enumerable:true,get:function(){return schemas_js.frameSpecLabelSchema}});Object.defineProperty(exports,"frameSpecPaintSchema",{enumerable:true,get:function(){return schemas_js.frameSpecPaintSchema}});Object.defineProperty(exports,"frameSpecSchema",{enumerable:true,get:function(){return schemas_js.frameSpecSchema}});Object.defineProperty(exports,"frameSpecShapeSchema",{enumerable:true,get:function(){return schemas_js.frameSpecShapeSchema}});Object.defineProperty(exports,"frameStyleSchema",{enumerable:true,get:function(){return schemas_js.frameStyleSchema}});Object.defineProperty(exports,"getFrameSpecIssues",{enumerable:true,get:function(){return schemas_js.getFrameSpecIssues}});Object.defineProperty(exports,"gradientStopSchema",{enumerable:true,get:function(){return schemas_js.gradientStopSchema}});Object.defineProperty(exports,"haloSchema",{enumerable:true,get:function(){return schemas_js.haloSchema}});Object.defineProperty(exports,"imageFitSchema",{enumerable:true,get:function(){return schemas_js.imageFitSchema}});Object.defineProperty(exports,"imagePaintSchema",{enumerable:true,get:function(){return schemas_js.imagePaintSchema}});Object.defineProperty(exports,"imagePositionSchema",{enumerable:true,get:function(){return schemas_js.imagePositionSchema}});Object.defineProperty(exports,"imageSettingsSchema",{enumerable:true,get:function(){return schemas_js.imageSettingsSchema}});Object.defineProperty(exports,"linearGradientSchema",{enumerable:true,get:function(){return schemas_js.linearGradientSchema}});Object.defineProperty(exports,"logoOptionsSchema",{enumerable:true,get:function(){return schemas_js.logoOptionsSchema}});Object.defineProperty(exports,"logoShapeSchema",{enumerable:true,get:function(){return schemas_js.logoShapeSchema}});Object.defineProperty(exports,"pickableCornerEyeDotPatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyeDotPatternSchema}});Object.defineProperty(exports,"pickableCornerEyePatternSchema",{enumerable:true,get:function(){return schemas_js.pickableCornerEyePatternSchema}});Object.defineProperty(exports,"qrArtImageSchema",{enumerable:true,get:function(){return schemas_js.qrArtImageSchema}});Object.defineProperty(exports,"qrArtModeSchema",{enumerable:true,get:function(){return schemas_js.qrArtModeSchema}});Object.defineProperty(exports,"qrArtSchema",{enumerable:true,get:function(){return schemas_js.qrArtSchema}});Object.defineProperty(exports,"qrArtVariantSchema",{enumerable:true,get:function(){return schemas_js.qrArtVariantSchema}});Object.defineProperty(exports,"qrCodeShapeSchema",{enumerable:true,get:function(){return schemas_js.qrCodeShapeSchema}});Object.defineProperty(exports,"qrPropsSchema",{enumerable:true,get:function(){return schemas_js.qrPropsSchema}});Object.defineProperty(exports,"qrShapeSchema",{enumerable:true,get:function(){return schemas_js.qrShapeSchema}});Object.defineProperty(exports,"qrSilhouetteSchema",{enumerable:true,get:function(){return schemas_js.qrSilhouetteSchema}});Object.defineProperty(exports,"radialGradientSchema",{enumerable:true,get:function(){return schemas_js.radialGradientSchema}});Object.defineProperty(exports,"shadowSchema",{enumerable:true,get:function(){return schemas_js.shadowSchema}});Object.defineProperty(exports,"solidColorSchema",{enumerable:true,get:function(){return schemas_js.solidColorSchema}});Object.defineProperty(exports,"templateConfigSchema",{enumerable:true,get:function(){return schemas_js.templateConfigSchema}});Object.defineProperty(exports,"templateDefinitionBaseSchema",{enumerable:true,get:function(){return schemas_js.templateDefinitionBaseSchema}});Object.defineProperty(exports,"OFFICIAL_FRAME_INDEX",{enumerable:true,get:function(){return framesIndex_js.OFFICIAL_FRAME_INDEX}});Object.defineProperty(exports,"OFFICIAL_FRAMES",{enumerable:true,get:function(){return framesOfficial_js.OFFICIAL_FRAMES}});Object.defineProperty(exports,"getOfficialFrame",{enumerable:true,get:function(){return framesOfficial_js.getOfficialFrame}});exports.AUTO_LEVEL_LOGO_COVERAGE=Ta;exports.Arrow=Vu;exports.BG_RADIUS_MAX=qr;exports.BG_RADIUS_QUIET_RATIO=Na;exports.BMP_MAX_DIMENSION=i1;exports.BODY_PATTERN=Ad;exports.BUILT_IN_FRAMES=Bi;exports.BUILT_IN_FRAME_SPECS=ch;exports.CORNER_EYE_DOT_PATTERNS=Cd;exports.CORNER_EYE_PATTERNS=Rd;exports.CUSTOM_FRAME_STYLE=ar;exports.DEFAULT_ART_INTENSITY=Vl;exports.DEFAULT_FRAME_TEXT=Pa;exports.DEFAULT_MARGIN=pt;exports.DEFAULT_SIZE=it;exports.DOWNLOAD_FORMATS=zs;exports.DotRing=h0;exports.EPS_IMAGE_FILL_REASON=Em;exports.EYE_GRADIENT_SPANS=kd;exports.EYE_POSITIONS=Be;exports.FRAME_COLOR_TOKENS=Ja;exports.FRAME_FONT_FAMILY=_o;exports.FRAME_FONT_SCALE_MAX=$n;exports.FRAME_FONT_SCALE_MIN=er;exports.FRAME_GAP_RATIO=au;exports.FRAME_ICONS=Ka;exports.FRAME_ICON_BOX=Li;exports.FRAME_ICON_MAX_SEGMENTS=Fl;exports.FRAME_IMPORT_LIMITS=Dt;exports.FRAME_LABEL_ATTRIBUTE=iu;exports.FRAME_SPEC_KIND=rr;exports.FRAME_SPEC_LABEL_MAX_FONT=ir;exports.FRAME_SPEC_LIMITS=ot;exports.FRAME_SPEC_VERSION=or;exports.FRAME_STYLES=Pd;exports.FRAME_TEXT_MAX_LENGTH=se;exports.Fragment=Ut;exports.FrameSpecError=yr;exports.GIFScanError=Do;exports.GIF_ALPHA_THRESHOLD=Zp;exports.GIF_MAX_COLORS=Xp;exports.GIF_MAX_DIMENSION=Yp;exports.GIF_MIME=Ir;exports.GRADIENT_FRAME_DEFAULTS=uh;exports.HALO_COLOR_DEFAULT=Vr;exports.HALO_LIGHT_MIN=Ge;exports.HALO_WIDTH_DEFAULT=Ba;exports.HALO_WIDTH_MAX=Da;exports.HALO_WIDTH_MIN=Oa;exports.Halloween=g0;exports.ICO_MAX_DIMENSION=rn;exports.ICO_MIME=on;exports.ICO_SIZES=Go;exports.LOGO_CLEANUP_MAX_SIDE=qm;exports.LOGO_EC_SAFETY=Mu;exports.LOGO_PADDING_MAX=Ld;exports.LOGO_PLATE_INSET=wo;exports.LOGO_ROUNDED_RADIUS=So;exports.LOGO_SHAPES=Id;exports.LOGO_SIZE_DEFAULT=va;exports.LOGO_SIZE_MAX=Ia;exports.LOGO_SIZE_MIN=vd;exports.MODULE_SCALE_FLOOR=xc;exports.MODULE_SCALE_MAX=La;exports.MODULE_SCALE_MIN=Wr;exports.OFFICIAL_FRAME_COLLECTIONS=k2;exports.OFFICIAL_FRAME_COUNT=L2;exports.OFFICIAL_FRAME_COUNTS=T2;exports.PIXEL_SCAN_SIZES=hb;exports.PIXEL_SCORE_MIN_CODE_WIDTH=B6;exports.PRESET_SIZES=Lx;exports.QR_ART_MAX_SAMPLE_SIZE=Jn;exports.QR_ART_MIN_LUMA_GAP=eo;exports.QR_ART_MODES=zr;exports.QR_ART_SAMPLE_SIZES=li;exports.QR_ART_VARIANTS=Aa;exports.QR_CIRCLE_QUIET_MIN=ka;exports.QR_EYE_ATTRIBUTE=Wu;exports.QR_PARTS=yp;exports.QR_PART_ATTRIBUTE=as;exports.QR_SHAPES=Td;exports.QR_SILHOUETTE_MAX_CELLS=De;exports.QR_SILHOUETTE_MIN_CELLS=_e;exports.QR_SILHOUETTE_MIN_SHARE=Fa;exports.RETIRED_CORNER_EYE_DOT_PATTERNS=Md;exports.RETIRED_CORNER_EYE_PATTERNS=Ed;exports.SCAN_CONTRAST_FAIL=td;exports.SCAN_CONTRAST_LOW=tb;exports.SCAN_CONTRAST_MIN=Br;exports.SCAN_IMAGE_CONTRAST_MIN=ed;exports.SCAN_TEST_SIZES=od;exports.SHADOW_COLOR_DEFAULT=za;exports.SHADOW_OFFSET_DEFAULT=Ga;exports.SHADOW_OFFSET_MAX=jr;exports.SHADOW_OPACITY_DEFAULT=Ha;exports.SHADOW_OPACITY_MAX=Ua;exports.SHADOW_OPACITY_MIN=Qa;exports.SHARP_DOT_EYE_SAFE_BODIES=ku;exports.SUPPORTS_PATH2D=Q3;exports.SquareBorder=_0;exports.StandardBox=x0;exports.StrikedBox=S0;exports.TEMPLATES=Pr;exports.WEAK_BODY_EYES=Iu;exports.WEAK_DOTS=Lu;exports.WEAK_DOT_EYES=Pu;exports.WEAK_EYES=vu;exports.WEAK_SHARP_DOT_EYES=Tu;exports.WEBP_MAX_DIMENSION=Eg;exports.WITHDRAWN_BODY_PATTERNS=tr;exports.WITHDRAWN_CORNER_EYE_DOT_PATTERNS=Oe;exports.WITHDRAWN_CORNER_EYE_PATTERNS=Ne;exports.assertGIFStillScans=eg;exports.blobToDataUrl=Ot;exports.canvasToBMP=ro;exports.canvasToGIF=Bo;exports.canvasToICO=X0;exports.canvasToPNGBytes=ig;exports.canvasToWebP=Ho;exports.canvasesToICO=Ms;exports.circleQuietZone=tn;exports.clampBgRadius=Un;exports.clampModuleScale=io;exports.colorAlpha=Eo;exports.convertImageSettingsToPixels=jp;exports.copyQRCodeToClipboard=Fx;exports.createFrameTree=ph;exports.createQRArtImage=jl;exports.createQRCodeTree=bs;exports.createQRSilhouette=_d;exports.damagedCodewords=cr;exports.decodePNGPixels=Qs;exports.defaultTemplate=ju;exports.downloadFile=Bt;exports.downloadImageData=y_;exports.downloadImageWithBoundingBox=x_;exports.downloadPrintEPS=l2;exports.downloadPrintPDF=sx;exports.downloadPrintSVG=lx;exports.downloadQRCode=Tx;exports.drawScanFrames=O6;exports.encodeBMP=yi;exports.encodeGIF=U0;exports.encodeGIFFromRGBA=ys;exports.encodeICO=ws;exports.encodeWebPLossless=Ls;exports.epsToDataUrl=ra;exports.excavateModules=ps;exports.eyeShapeOf=re;exports.fitHaloColor=bp;exports.frameLabels=cu;exports.frameSpecHash=F2;exports.frameSpecOf=go;exports.frameSpecPadding=En;exports.frameSpecQrZone=Kr;exports.generatePath=k0;exports.getAllTemplates=f3;exports.getBgRadiusLimit=up;exports.getBuiltInFrame=Gi;exports.getCodewordMap=lr;exports.getColorString=Sd;exports.getContrastLevel=z3;exports.getContrastRatio=H3;exports.getCustomFrameLayout=Oi;exports.getDownloadFilename=c2;exports.getEyeStyleRisk=ts;exports.getFrameColors=mh;exports.getFrameDimensions=me;exports.getFrameGapRatio=Qi;exports.getFrameIconPath=Ti;exports.getFrameLayout=Je;exports.getFrameSecondaryText=hh;exports.getFrameSpecColors=ho;exports.getFrameSpecGapRatio=Ni;exports.getFrameText=fh;exports.getHaloRisk=rs;exports.getImageScanScore=Q6;exports.getImageSettings=Re;exports.getImageTones=J2;exports.getImageTonesFromPixels=K2;exports.getLayoutMargin=Et;exports.getLogoBlockDamage=Mo;exports.getLogoSizeLimit=O2;exports.getLuminance=qn;exports.getNormalizedColor=wd;exports.getPrintLayout=ea;exports.getQRArtColorIssue=Hf;exports.getQRArtEyeColors=bi;exports.getQRArtVariant=no;exports.getQRAsBMP=vm;exports.getQRAsCanvas=ge;exports.getQRAsEPS=na;exports.getQRAsGIF=Lm;exports.getQRAsICO=Tm;exports.getQRAsPrintPDF=Xg;exports.getQRAsPrintPDFBuffer=ix;exports.getQRAsPrintSVG=Yg;exports.getQRAsSVGDataUri=Xt;exports.getQRAsSVGNode=Q2;exports.getQRAsWebP=Im;exports.getQRCodeData=jm;exports.getQRCodeDataUrl=kx;exports.getQRCodeSVGProps=Xm;exports.getQRData=tl;exports.getQRFunctionModules=vf;exports.getQRModuleCount=Vg;exports.getQRShapePath=Th;exports.getQRSilhouetteFit=Ih;exports.getSVGString=Nx;exports.getScanContrast=eb;exports.getScanScore=N6;exports.getScanScoreFromFrames=D6;exports.getScanScoreFromPixels=G6;exports.getSolidColor=bt;exports.getStylePairRisk=Vi;exports.getTemplate=vo;exports.getTemplateIds=h3;exports.getWebPCompression=Ts;exports.h=Jr;exports.haloTints=_p;exports.handleImageLoad=Sc;exports.hasImageFill=Am;exports.hexToRgb=U3;exports.imagePositionCss=El;exports.importFrameSvg=v2;exports.indexedToRGBA=xs;exports.isBMPFile=xi;exports.isFrameActive=Nt;exports.isGIFFile=$s;exports.isGradient=Fe;exports.isICOFile=Cs;exports.isImagePaint=Ea;exports.isLatin1Text=jd;exports.isQRArtActive=ui;exports.isQRNode=ze;exports.isSeeThroughBackground=Qu;exports.isShapedCode=wr;exports.isWeakSharpPair=Fu;exports.isWebPFile=lm;exports.loadQRArtImage=Af;exports.loadQRSilhouette=xb;exports.logoFitsBudget=ap;exports.mixFrameColors=_r;exports.normalizeColorConfig=Lt;exports.partMarker=is;exports.pixelsToGIF=ng;exports.quantizeRGBA=G0;exports.removeLogoBackdrop=Vm;exports.removeLogoBackground=D2;exports.renderQRArt=hi;exports.renderToDOM=Es;exports.renderToString=an;exports.resolveErrorLevel=At;exports.resolveFrameSpec=Ke;exports.resolveHalo=Cr;exports.resolveQRCodeProps=W2;exports.resolveShadow=os;exports.rgbToCmyk=$e;exports.sanitizeFrameText=Rn;exports.scanQRPixels=U6;exports.svgToEPS=Rm;exports.toHyperscript=Ym;exports.toSVGElement=Rg;exports.toSVGString=As;exports.validateSize=Ws;exports.weakestEyePattern=Ji;exports.withQRSize=Pe;exports.withdrawnFallback=Gt;//# sourceMappingURL=core.js.map
31
31
  //# sourceMappingURL=core.js.map