qrdx 0.0.61 → 0.0.62

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 (76) hide show
  1. package/README.md +2 -1
  2. package/dist/angular.js +7 -2
  3. package/dist/angular.js.map +1 -1
  4. package/dist/angular.mjs +7 -2
  5. package/dist/angular.mjs.map +1 -1
  6. package/dist/core.js +7 -7
  7. package/dist/core.js.map +1 -1
  8. package/dist/core.mjs +7 -7
  9. package/dist/core.mjs.map +1 -1
  10. package/dist/element.browser.mjs +6 -6
  11. package/dist/element.browser.mjs.map +1 -1
  12. package/dist/element.js +1 -1
  13. package/dist/element.js.map +1 -1
  14. package/dist/element.mjs +1 -1
  15. package/dist/element.mjs.map +1 -1
  16. package/dist/index.js +7 -7
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +7 -7
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/qr-code-canvas.js +1 -1
  21. package/dist/qr-code-canvas.js.map +1 -1
  22. package/dist/qr-code-canvas.mjs +1 -1
  23. package/dist/qr-code-canvas.mjs.map +1 -1
  24. package/dist/schemas.js +1 -1
  25. package/dist/schemas.js.map +1 -1
  26. package/dist/schemas.mjs +1 -1
  27. package/dist/schemas.mjs.map +1 -1
  28. package/dist/src/angular.d.ts +2 -1
  29. package/dist/src/element.d.ts +2 -0
  30. package/dist/src/element.d.ts.map +1 -1
  31. package/dist/src/helpers.d.ts +2 -2
  32. package/dist/src/helpers.d.ts.map +1 -1
  33. package/dist/src/logo-budget.d.ts +3 -1
  34. package/dist/src/logo-budget.d.ts.map +1 -1
  35. package/dist/src/looks.d.ts +2 -2
  36. package/dist/src/looks.d.ts.map +1 -1
  37. package/dist/src/plain.d.ts.map +1 -1
  38. package/dist/src/print.d.ts.map +1 -1
  39. package/dist/src/qr-code-canvas.d.ts.map +1 -1
  40. package/dist/src/qr-code-props.d.ts +1 -1
  41. package/dist/src/qr-code-props.d.ts.map +1 -1
  42. package/dist/src/scan-score.d.ts.map +1 -1
  43. package/dist/src/symbol.d.ts +13 -0
  44. package/dist/src/symbol.d.ts.map +1 -0
  45. package/dist/src/utils/print-shared.d.ts.map +1 -1
  46. package/dist/src/utils.d.ts +1 -0
  47. package/dist/src/utils.d.ts.map +1 -1
  48. package/dist/src/vue.d.ts.map +1 -1
  49. package/dist/types/index.js +1 -1
  50. package/dist/types/index.js.map +1 -1
  51. package/dist/types/index.mjs +1 -1
  52. package/dist/types/index.mjs.map +1 -1
  53. package/dist/types/qr.d.ts +2 -0
  54. package/dist/types/qr.d.ts.map +1 -1
  55. package/dist/vanilla.browser.mjs +16 -16
  56. package/dist/vanilla.browser.mjs.map +1 -1
  57. package/dist/vue.js +1 -1
  58. package/dist/vue.js.map +1 -1
  59. package/dist/vue.mjs +1 -1
  60. package/dist/vue.mjs.map +1 -1
  61. package/package.json +1 -1
  62. package/src/angular.ts +2 -0
  63. package/src/element.ts +3 -0
  64. package/src/helpers.ts +27 -10
  65. package/src/logo-budget.ts +9 -8
  66. package/src/looks.ts +17 -14
  67. package/src/plain.tsx +5 -7
  68. package/src/print.ts +3 -6
  69. package/src/qr-code-canvas.tsx +5 -7
  70. package/src/qr-code-props.ts +4 -0
  71. package/src/scan-score.ts +5 -4
  72. package/src/symbol.ts +27 -0
  73. package/src/utils/print-shared.ts +5 -9
  74. package/src/utils.tsx +9 -9
  75. package/src/vue.ts +1 -0
  76. package/types/qr.ts +6 -0
@@ -1,9 +1,9 @@
1
- var w4=Object.defineProperty;var Ar=(e,t)=>{for(var r in t)w4(e,r,{get:t[r],enumerable:true});};var uo;(i=>{class e{constructor(a,c,u,l){this.version=a;this.errorCorrectionLevel=c;if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version value out of range");if(l<-1||l>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let f=[];for(let m=0;m<this.size;m++)f.push(false);for(let m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(u);if(this.drawCodewords(p),l==-1){let m=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let d=this.getPenaltyScore();d<m&&(l=h,m=d),this.applyMask(h);}}n(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(a,c){let u=i.QrSegment.makeSegments(a);return e.encodeSegments(u,c)}static encodeBinary(a,c){let u=i.QrSegment.makeBytes(a);return e.encodeSegments([u],c)}static encodeSegments(a,c,u=1,l=40,f=-1,p=true){if(!(e.MIN_VERSION<=u&&u<=l&&l<=e.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let m,h;for(m=u;;m++){let b=e.getNumDataCodewords(m,c)*8,y=o.getTotalBits(a,m);if(y<=b){h=y;break}if(m>=l)throw new RangeError("Data too long")}for(let b of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,b)*8&&(c=b);let d=[];for(let b of a){t(b.mode.modeBits,4,d),t(b.numChars,b.mode.numCharCountBits(m),d);for(let y of b.getData())d.push(y);}n(d.length==h);let g=e.getNumDataCodewords(m,c)*8;n(d.length<=g),t(0,Math.min(4,g-d.length),d),t(0,(8-d.length%8)%8,d),n(d.length%8==0);for(let b=236;d.length<g;b^=253)t(b,8,d);let _=[];for(;_.length*8<d.length;)_.push(0);return d.forEach((b,y)=>_[y>>>3]|=b<<7-(y&7)),new e(m,c,_,f)}size;mask;modules=[];isFunction=[];getModule(a,c){return 0<=a&&a<this.size&&0<=c&&c<this.size&&this.modules[c][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),c=a.length;for(let u=0;u<c;u++)for(let l=0;l<c;l++)u==0&&l==0||u==0&&l==c-1||u==c-1&&l==0||this.drawAlignmentPattern(a[u],a[l]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(a){let c=this.errorCorrectionLevel.formatBits<<3|a,u=c;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;let l=(c<<10|u)^21522;n(l>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,r(l,f));this.setFunctionModule(8,7,r(l,6)),this.setFunctionModule(8,8,r(l,7)),this.setFunctionModule(7,8,r(l,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,r(l,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,r(l,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,r(l,f));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;let c=this.version<<12|a;n(c>>>18==0);for(let u=0;u<18;u++){let l=r(c,u),f=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(f,p,l),this.setFunctionModule(p,f,l);}}drawFinderPattern(a,c){for(let u=-4;u<=4;u++)for(let l=-4;l<=4;l++){let f=Math.max(Math.abs(l),Math.abs(u)),p=a+l,m=c+u;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,f!=2&&f!=4);}}drawAlignmentPattern(a,c){for(let u=-2;u<=2;u++)for(let l=-2;l<=2;l++)this.setFunctionModule(a+l,c+u,Math.max(Math.abs(l),Math.abs(u))!=1);}setFunctionModule(a,c,u){this.modules[c][a]=u,this.isFunction[c][a]=true;}addEccAndInterleave(a){let c=this.version,u=this.errorCorrectionLevel;if(a.length!=e.getNumDataCodewords(c,u))throw new RangeError("Invalid argument");let l=e.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][c],f=e.ECC_CODEWORDS_PER_BLOCK[u.ordinal][c],p=Math.floor(e.getNumRawDataModules(c)/8),m=l-p%l,h=Math.floor(p/l),d=[],g=e.reedSolomonComputeDivisor(f);for(let b=0,y=0;b<l;b++){let S=a.slice(y,y+h-f+(b<m?0:1));y+=S.length;let C=e.reedSolomonComputeRemainder(S,g);b<m&&S.push(0),d.push(S.concat(C));}let _=[];for(let b=0;b<d[0].length;b++)d.forEach((y,S)=>{(b!=h-f||S>=m)&&_.push(y[b]);});return n(_.length==p),_}drawCodewords(a){if(a.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let l=0;l<this.size;l++)for(let f=0;f<2;f++){let p=u-f,h=(u+1&2)==0?this.size-1-l:l;!this.isFunction[h][p]&&c<a.length*8&&(this.modules[h][p]=r(a[c>>>3],7-(c&7)),c++);}}n(c==a.length*8);}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let u=0;u<this.size;u++){let l;switch(a){case 0:l=(u+c)%2==0;break;case 1:l=c%2==0;break;case 2:l=u%3==0;break;case 3:l=(u+c)%3==0;break;case 4:l=(Math.floor(u/3)+Math.floor(c/2))%2==0;break;case 5:l=u*c%2+u*c%3==0;break;case 6:l=(u*c%2+u*c%3)%2==0;break;case 7:l=((u+c)%2+u*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][u]&&l&&(this.modules[c][u]=!this.modules[c][u]);}}getPenaltyScore(){let a=0;for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[f][d]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[f][d],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][f]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[d][f],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){let m=this.modules[f][p];m==this.modules[f][p+1]&&m==this.modules[f+1][p]&&m==this.modules[f+1][p+1]&&(a+=e.PENALTY_N2);}let c=0;for(let f of this.modules)c=f.reduce((p,m)=>p+(m?1:0),c);let u=this.size*this.size,l=Math.ceil(Math.abs(c*20-u*10)/u)-1;return n(0<=l&&l<=9),a+=l*e.PENALTY_N4,n(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return [];{let a=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,u=[6];for(let l=this.size-7;u.length<a;l-=c)u.splice(1,0,l);return u}}static getNumRawDataModules(a){if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*a+128)*a+64;if(a>=2){let u=Math.floor(a/7)+2;c-=(25*u-10)*u-55,a>=7&&(c-=36);}return n(208<=c&&c<=29648),c}static getNumDataCodewords(a,c){return Math.floor(e.getNumRawDataModules(a)/8)-e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a]*e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let c=[];for(let l=0;l<a-1;l++)c.push(0);c.push(1);let u=1;for(let l=0;l<a;l++){for(let f=0;f<c.length;f++)c[f]=e.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=e.reedSolomonMultiply(u,2);}return c}static reedSolomonComputeRemainder(a,c){let u=c.map(l=>0);for(let l of a){let f=l^u.shift();u.push(0),c.forEach((p,m)=>u[m]^=e.reedSolomonMultiply(p,f));}return u}static reedSolomonMultiply(a,c){if(a>>>8||c>>>8)throw new RangeError("Byte out of range");let u=0;for(let l=7;l>=0;l--)u=u<<1^(u>>>7)*285,u^=(c>>>l&1)*a;return n(u>>>8==0),u}finderPenaltyCountPatterns(a){let c=a[1];n(c<=this.size*3);let u=c>0&&a[2]==c&&a[3]==c*3&&a[4]==c&&a[5]==c;return (u&&a[0]>=c*4&&a[6]>=c?1:0)+(u&&a[6]>=c*4&&a[0]>=c?1:0)}finderPenaltyTerminateAndCount(a,c,u){return a&&(this.finderPenaltyAddHistory(c,u),c=0),c+=this.size,this.finderPenaltyAddHistory(c,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,c){c[0]==0&&(a+=this.size),c.pop(),c.unshift(a);}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]]}i.QrCode=e;function t(s,a,c){if(a<0||a>31||s>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)c.push(s>>>u&1);}function r(s,a){return (s>>>a&1)!=0}function n(s){if(!s)throw new Error("Assertion error")}class o{constructor(a,c,u){this.mode=a;this.numChars=c;this.bitData=u;if(c<0)throw new RangeError("Invalid argument");this.bitData=u.slice();}mode;numChars;bitData;static makeBytes(a){let c=[];for(let u of a)t(u,8,c);return new o(o.Mode.BYTE,a.length,c)}static makeNumeric(a){if(!o.isNumeric(a))throw new RangeError("String contains non-numeric characters");let c=[];for(let u=0;u<a.length;){let l=Math.min(a.length-u,3);t(parseInt(a.substr(u,l),10),l*3+1,c),u+=l;}return new o(o.Mode.NUMERIC,a.length,c)}static makeAlphanumeric(a){if(!o.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],u;for(u=0;u+2<=a.length;u+=2){let l=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;l+=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),t(l,11,c);}return u<a.length&&t(o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,c),new o(o.Mode.ALPHANUMERIC,a.length,c)}static makeSegments(a){return a==""?[]:o.isNumeric(a)?[o.makeNumeric(a)]:o.isAlphanumeric(a)?[o.makeAlphanumeric(a)]:[o.makeBytes(o.toUtf8ByteArray(a))]}static makeEci(a){let c=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)t(a,8,c);else if(a<16384)t(2,2,c),t(a,14,c);else if(a<1e6)t(6,3,c),t(a,21,c);else throw new RangeError("ECI assignment value out of range");return new o(o.Mode.ECI,0,c)}static isNumeric(a){return o.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return o.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,c){let u=0;for(let l of a){let f=l.mode.numCharCountBits(c);if(l.numChars>=1<<f)return 1/0;u+=4+f+l.bitData.length;}return u}static toUtf8ByteArray(a){a=encodeURI(a);let c=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?c.push(a.charCodeAt(u)):(c.push(parseInt(a.substr(u+1,2),16)),u+=2);return c}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=o;})(uo||={});(t=>{(n=>{class r{constructor(i,s){this.ordinal=i;this.formatBits=s;}ordinal;formatBits;static LOW=new r(0,1);static MEDIUM=new r(1,0);static QUARTILE=new r(2,3);static HIGH=new r(3,2)}n.Ecc=r;})(t.QrCode||={});})(uo||={});(t=>{(n=>{class r{constructor(i,s){this.modeBits=i;this.numBitsCharCount=s;}modeBits;numBitsCharCount;static NUMERIC=new r(1,[10,12,14]);static ALPHANUMERIC=new r(2,[9,11,13]);static BYTE=new r(4,[8,16,16]);static KANJI=new r(8,[8,10,12]);static ECI=new r(7,[0,0,0]);numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}n.Mode=r;})(t.QrSegment||={});})(uo||={});var Re=uo;var Ze={L:Re.QrCode.Ecc.LOW,M:Re.QrCode.Ecc.MEDIUM,Q:Re.QrCode.Ecc.QUARTILE,H:Re.QrCode.Ecc.HIGH},ye=128,Vt="Q",Pe="#FFFFFF",qe="#000000";var Me=0;var ka=.1;function Ne(e,t="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||t:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||t:t}function it(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function sn(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function Sf(e){return typeof e=="object"&&e!==null&&e.type==="image"}function S4(e,t="#000000"){let r=it(e,t);return r.type==="solid"?r.color:r.type==="image"?r.underlay||t:r.stops[0]?.color||t}function yb(e="center"){let[t,r]=e.split("-");return e==="center"?"center":r?`${r} ${t}`:t==="top"||t==="bottom"?`center ${t}`:`${t} center`}function C4(e){if(!e)return "#000000";if(typeof e=="string")return e;let t=it(e);if(t.type==="solid")return t.color;if(t.type==="image"){let o=t.fit==="tile"?`${25*(t.scale??1)}% auto`:(t.scale??1)===1?t.fit==="contain"?"contain":"cover":`${100*(t.scale??1)}% auto`,i=t.fit==="tile"?"repeat":"no-repeat";return `${`url("${t.src.replace(/"/g,"%22")}")`} ${yb(t.position)} / ${o} ${i}, ${t.underlay??"transparent"}`}let n=[...t.stops].sort((o,i)=>o.offset-i.offset).map(o=>`${o.color} ${o.offset}%`).join(", ");return t.type==="linear"?`linear-gradient(${(t.angle??0)+90}deg, ${n})`:t.type==="angular"?`conic-gradient(from ${t.angle??0}deg, ${n})`:`radial-gradient(circle, ${n})`}var lo=["logo","halftone"],fo={logo:["blend","badge"],halftone:["color","mono"]},Ht=192,Ia=["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"],Cf=["diamond","star","banner"],Ma=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],Ef=["curly"],Af=["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"],an={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},sr={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},ar={bevel:"square",notch:"square"};function He(e,t){return typeof t=="string"&&Object.hasOwn(e,t)?e[t]:t}var vf=["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"],dt=24,Rf="Scan me",cn=.5,vr=1.5,Pf=["square","rounded","circle"],kf=.1,Mi=.3,If=.25,Mf=2,mo=.5,Ti=1,Tf=.07,Of=["square","circle","heart"],Lf=3,At=64,Nt=8,Nf=.42,un=["topLeft","topRight","bottomLeft"],po=.5,Ff=2,Oi=.1,Li=.5,zf=.25,Ta="#e5e7eb",ln="#d1d5db",cr=.3,Df=.2,Ni=.1,Fi=.4,Bf=.3,Zf="#000000",Uf=["corner","code"];function fe(e,t=3){let r=10**t;return Math.round(e*r)/r+0}function x(e,t=3){return String(fe(e,t))}function M(e,...t){let r=e[0]??"";for(let n=0;n<t.length;n++){let o=t[n];r+=(typeof o=="number"?x(o):o)+(e[n+1]??"");}return r}var E4={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},A4=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Gf=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function zi(e,t=Number.POSITIVE_INFINITY){if(!A4.test(e))return null;let r=[],n=0,o=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},i=()=>{o(),Gf.lastIndex=n;let c=Gf.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;n=Gf.lastIndex;let f=Number(u);return Number.isFinite(f)?f:null},s=()=>{o();let c=e[n];return c==="0"||c==="1"?(n++,c==="1"?1:0):null},a=()=>(o(),n<e.length&&/[0-9.+-]/.test(e[n]));for(o();n<e.length;){let c=e[n],u=c.toUpperCase(),l=E4[u];if(l===void 0||r.length===0&&u!=="M")return null;if(n++,l===0){r.push({command:c,values:[]}),o();continue}let f=c,p=true;for(;p||a();){let m=[];for(let h=0;h<l;h++){let d=u==="A"&&(h===3||h===4)?s():i();if(d===null)return null;m.push(d);}r.push({command:f,values:m}),u==="M"&&(f=c==="M"?"L":"l"),p=false;}o();}return r}function xb(e){let t=0;for(let{command:r}of e)t+=r.toUpperCase()==="A"?4:1;return t}function Qf(e,t=1,r=0,n=0){let o="";for(let{command:i,values:s}of e){let a=i.toUpperCase(),c=i===a,u=c?r:0,l=c?n:0,f;switch(a){case "Z":f=[];break;case "H":f=[x(s[0]*t+u)];break;case "V":f=[x(s[0]*t+l)];break;case "A":f=[x(Math.abs(s[0])*t),x(Math.abs(s[1])*t),x(s[2]),String(s[3]),String(s[4]),x(s[5]*t+u),x(s[6]*t+l)];break;default:f=s.map((p,m)=>x(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function Oa(e,t=.25){let r=[],n=[],o=[0,0],i=[0,0],s=()=>{n.length>2&&r.push(n),n=[];};for(let a of e)if(a.op==="M")s(),o=[a.x,a.y],i=o,n.push(o);else if(a.op==="L")i=[a.x,a.y],n.push(i);else if(a.op==="C"){let c=i,u=[a.x1,a.y1],l=[a.x2,a.y2],f=[a.x,a.y],p=Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(l[0]-u[0],l[1]-u[1])+Math.hypot(f[0]-l[0],f[1]-l[1]),m=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*t)))));for(let h=1;h<=m;h++){let d=h/m,g=1-d;n.push([g*g*g*c[0]+3*g*g*d*u[0]+3*g*d*d*l[0]+d*d*d*f[0],g*g*g*c[1]+3*g*g*d*u[1]+3*g*d*d*l[1]+d*d*d*f[1]]);}i=f;}else s(),i=o;return s(),r}function ho(e,t){let r=[o=>o[0]-t.x0,o=>t.x1-o[0],o=>o[1]-t.y0,o=>t.y1-o[1]],n=e;for(let o of r){if(n.length===0)break;let i=n;n=[];for(let s=0;s<i.length;s++){let a=i[s],c=i[(s+i.length-1)%i.length],u=o(a),l=o(c);u>=0?(l<0&&n.push($b(c,a,l,u)),n.push(a)):l>=0&&n.push($b(c,a,l,u));}}return n.length>2?n:[]}function $b(e,t,r,n){let o=r/(r-n);return [e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o]}function wb(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([r,n])=>`${x(r)} ${x(n)}`).join("L")}Z`).join("")}function fn(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(s,a)=>{t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);};for(let s of e)s.op==="C"?(i(s.x1,s.y1),i(s.x2,s.y2),i(s.x,s.y)):s.op!=="Z"&&i(s.x,s.y);return Number.isFinite(t)?{x0:t,y0:r,x1:n,y1:o}:null}var v4={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Eb(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,r)=>{if(r[0]==="#"){let n=r[1].toLowerCase()==="x"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isInteger(n)&&n>0&&n<=1114111&&!(n>=55296&&n<=57343)?String.fromCodePoint(n):t}return v4[r.toLowerCase()]??t})}var R4=60,jf=62,Vf=47,P4=61,Sb=34,Cb=39,Wf=/\s*/y,k4=/[^\s/>]*/y,I4=/[^\s>]*/y,M4=/[^\s=]*/y;function go(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function T4(e,t){let r=e.length,n=w=>{let $=Number.POSITIVE_INFINITY,E=-1;return R=>((R<$||E>=0&&E<R)&&($=R,E=e.indexOf(w,R)),E)},o=n("-->"),i=n("?>"),s=n("]]>"),a=n(">"),c,u=w=>{let $=e.charCodeAt(w);if($!==Sb&&$!==Cb)return w+1;let E=e.indexOf(e[w],w+1);return E<0?r:E+1},l=w=>{for(let $=w;$<r&&!c?.[$];$=u($)){let E=e.charCodeAt($);if(E===jf||E===Vf&&e.charCodeAt($+1)===jf)return $}c??=new Uint8Array(r);for(let $=w;$<r&&!c[$];$=u($))c[$]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=w=>{let $=w+1;if($<f||$>=p){f=$,p=go(k4,e,$),m=-1;for(let R=p;R>$;R--){let P=e.charCodeAt(R);if((R===p||P===Sb||P===Cb)&&(h=l(R),h>=0)){m=R;break}}}if(m<=$)return -1;let E=e.charCodeAt(h)===Vf;return t.open(e.slice($,m),e.slice(m,h),E),h+(E?2:1)},g=-1,_=-1,b=-1,y=w=>{let $=w+2;if($<g||$>=_){g=$,_=go(I4,e,$);let E=go(Wf,e,_);b=_>$&&e.charCodeAt(E)===jf?E:-1;}return b},S=w=>{if(e.startsWith("<!--",w)){let $=o(w+4);if($>=0)return $+3}if(e.startsWith("<?",w)){let $=i(w+2);if($>=0)return $+2}if(e.startsWith("<![CDATA[",w)){let $=s(w+9);if($>=0)return t.cdata(e.slice(w+9,$)),$+3}if(e.startsWith("<!",w)){let $=a(w+2);if($>=0)return $+1}if(e.charCodeAt(w+1)===Vf){let $=y(w);return $<0?-1:(t.close(),$+1)}return d(w)},C=0;for(;C<r;)if(e.charCodeAt(C)===R4){let w=S(C);C=w<0?C+1:w;}else {let w=e.indexOf("<",C),$=w<0?r:w;t.text(e.slice(C,$)),C=$;}}function O4(e){let t={},r=0;for(;r<e.length;){let n=go(M4,e,r);if(n===r){r++;continue}let o=go(Wf,e,n);if(e.charCodeAt(o)===P4){let i=go(Wf,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(r,n)]=Eb(e.slice(i+1,a)),r=a+1;continue}}r=n;}return t}function Rr(e){let t={name:"#root",attrs:{},children:[],text:""},r=[t],n=()=>r.at(-1);T4(e,{open(i,s,a){let c=O4(s),u={name:i,attrs:c,children:[],text:""};n().children.push(u),a||r.push(u);},close(){r.length>1&&r.pop();},text(i){n().text+=Eb(i);},cdata(i){n().text+=i;}});let o=i=>{for(let s of i.children){if(s.name==="svg")return s;let a=o(s);if(a)return a}return null};return o(t)}var _o=[1,0,0,1,0,0];function ve(e,t){let[r,n,o,i,s,a]=e,[c,u,l,f,p,m]=t;return [r*c+o*u,n*c+i*u,r*l+o*f,n*l+i*f,r*p+o*m+s,n*p+i*m+a]}function oe(e,t,r){return [e[0]*t+e[2]*r+e[4],e[1]*t+e[3]*r+e[5]]}function bo(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Wt(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function vt(e){let t=_o;if(!e)return t;for(let[,r,n]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=Wt(n),i=_o;switch(r){case "matrix":o.length===6&&(i=o);break;case "translate":i=[1,0,0,1,o[0]??0,o[1]??0];break;case "scale":i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];break;case "rotate":{let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),[u,l]=[o[1]??0,o[2]??0];i=ve(ve([1,0,0,1,u,l],[a,c,-c,a,0,0]),[1,0,0,1,-u,-l]);break}case "skewX":i=[1,0,Math.tan((o[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((o[0]??0)*Math.PI/180),0,1,0,0];break;}t=ve(t,i);}return t}var Hf=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function L4(e,t,r,n,o,i,s,a,c){if(e===a&&t===c)return [];let u=Math.abs(r),l=Math.abs(n);if(u===0||l===0)return [{op:"L",x:a,y:c}];let f=o*Math.PI/180,p=Math.cos(f),m=Math.sin(f),h=(e-a)/2,d=(t-c)/2,g=p*h+m*d,_=-m*h+p*d,b=g*g/(u*u)+_*_/(l*l);b>1&&(u*=Math.sqrt(b),l*=Math.sqrt(b));let y=u*u*l*l-u*u*_*_-l*l*g*g,S=u*u*_*_+l*l*g*g,C=(i===s?-1:1)*Math.sqrt(Math.max(0,y/S)),w=C*u*_/l,$=-C*l*g/u,E=p*w-m*$+(e+a)/2,R=m*w+p*$+(t+c)/2,P=(re,Q,X,ae)=>Math.atan2(re*ae-Q*X,re*X+Q*ae),I=P(1,0,(g-w)/u,(_-$)/l),T=P((g-w)/u,(_-$)/l,(-g-w)/u,(-_-$)/l);!s&&T>0?T-=2*Math.PI:s&&T<0&&(T+=2*Math.PI);let O=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2)-1e-9)),B=T/O,z=4/3*Math.tan(B/4),F=(re,Q)=>[E+u*p*re-l*m*Q,R+u*m*re+l*p*Q],te=[];for(let re=0;re<O;re++){let Q=I+re*B,X=Q+B,[ae,De]=F(Math.cos(Q)-z*Math.sin(Q),Math.sin(Q)+z*Math.cos(Q)),[Ce,U]=F(Math.cos(X)+z*Math.sin(X),Math.sin(X)-z*Math.cos(X)),[V,ue]=re===O-1?[a,c]:F(Math.cos(X),Math.sin(X));te.push({op:"C",x1:ae,y1:De,x2:Ce,y2:U,x:V,y:ue});}return te}function ur(e){let t=[],r=0,n=0,o=0,i=0,s=0,a="",c=null,u=null,l=()=>{for(;r<e.length&&/[\s,]/.test(e[r]);)r++;},f=()=>{l(),Hf.lastIndex=r;let h=Hf.exec(e);return h?(r=Hf.lastIndex,Number(h[0])):null},p=()=>{l();let h=e[r];return h==="0"||h==="1"?(r++,h==="1"):null},m=h=>{let d=[];for(let g=0;g<h;g++){let _=f();if(_===null)return null;d.push(_);}return d};for(;l(),!(r>=e.length);){let h=e[r];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(h))a=h,r++;else if(!a||a==="Z"||a==="z")break;let d=a===a.toLowerCase(),g=d?n:0,_=d?o:0,b=a.toUpperCase();if(b==="Z"){t.push({op:"Z"}),n=i,o=s,c=null,u=null;continue}if(b==="A"){let w=m(3),$=p(),E=p(),R=m(2);if(!(w&&R)||$===null||E===null)break;let[P,I,T]=w,O=R[0]+g,B=R[1]+_;t.push(...L4(n,o,P,I,T,$,E,O,B)),n=O,o=B,c=null,u=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[b]??0,S=m(y);if(!S)break;let C=S;switch(b){case "M":n=C[0]+g,o=C[1]+_,i=n,s=o,t.push({op:"M",x:n,y:o}),a=d?"l":"L",c=null,u=null;break;case "L":case "H":case "V":b!=="V"&&(n=C[0]+g),b==="V"?o=C[0]+_:b==="L"&&(o=C[1]+_),t.push({op:"L",x:n,y:o}),c=null,u=null;break;case "C":case "S":{let w,$;b==="C"?(w=[C[0]+g,C[1]+_],$=C.slice(2)):(w=c?[2*n-c[0],2*o-c[1]]:[n,o],$=C);let E=[$[0]+g,$[1]+_],R=[$[2]+g,$[3]+_];t.push({op:"C",x1:w[0],y1:w[1],x2:E[0],y2:E[1],x:R[0],y:R[1]}),[n,o]=R,c=E,u=null;break}case "Q":case "T":{let w,$;b==="Q"?(w=[C[0]+g,C[1]+_],$=[C[2]+g,C[3]+_]):(w=u?[2*n-u[0],2*o-u[1]]:[n,o],$=[C[0]+g,C[1]+_]),t.push({op:"C",x1:n+2/3*(w[0]-n),y1:o+2/3*(w[1]-o),x2:$[0]+2/3*(w[0]-$[0]),y2:$[1]+2/3*(w[1]-$[1]),x:$[0],y:$[1]}),[n,o]=$,u=w,c=null;break}}}return t}var La=.5522847498;function qt(e,t,r,n){if(r<=0||n<=0)return [];let o=r*La,i=n*La;return [{op:"M",x:e+r,y:t},{op:"C",x1:e+r,y1:t+i,x2:e+o,y2:t+n,x:e,y:t+n},{op:"C",x1:e-o,y1:t+n,x2:e-r,y2:t+i,x:e-r,y:t},{op:"C",x1:e-r,y1:t-i,x2:e-o,y2:t-n,x:e,y:t-n},{op:"C",x1:e+o,y1:t-n,x2:e+r,y2:t-i,x:e+r,y:t},{op:"Z"}]}function Xt(e,t,r,n,o=0,i=0){if(r<=0||n<=0)return [];let s=Math.min(Math.max(o,0),r/2),a=Math.min(Math.max(i,0),n/2);if(s===0||a===0)return [{op:"M",x:e,y:t},{op:"L",x:e+r,y:t},{op:"L",x:e+r,y:t+n},{op:"L",x:e,y:t+n},{op:"Z"}];let c=s*La,u=a*La,l=e+r,f=t+n;return [{op:"M",x:e+s,y:t},{op:"L",x:l-s,y:t},{op:"C",x1:l-s+c,y1:t,x2:l,y2:t+a-u,x:l,y:t+a},{op:"L",x:l,y:f-a},{op:"C",x1:l,y1:f-a+u,x2:l-s+c,y2:f,x:l-s,y:f},{op:"L",x:e+s,y:f},{op:"C",x1:e+s-c,y1:f,x2:e,y2:f-a+u,x:e,y:f-a},{op:"L",x:e,y:t+a},{op:"C",x1:e,y1:t+a-u,x2:e+s-c,y2:t,x:e+s,y:t},{op:"Z"}]}var mn="qrdx.frame",pn=1,dn="custom",ee={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:dt},Di=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Bi=.95,vb=200,Zi=["frame","text","accent","background"],N4=/[\t\n\v\f\r\u0085\u2028\u2029]/g,F4=/[\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 yo(e,t=dt){let r=e.slice(0,1e3).normalize("NFC").replace(N4," ").replace(F4,"").replace(/\s+/g," ").trim();return Array.from(r).slice(0,Math.max(0,t)).join("").trim()}function z4(e){for(let t of e)if((t.codePointAt(0)??0)>255)return false;return true}var Pr=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function Na(e){let t=xo(e);return {x0:e.qr.x-t,y0:e.qr.y-t,x1:e.qr.x+e.qr.size+t,y1:e.qr.y+e.qr.size+t}}function D4(e){return {x0:e.qr.x,y0:e.qr.y,x1:e.qr.x+e.qr.size,y1:e.qr.y+e.qr.size}}function xo(e){return e.qr.padding??e.qr.size*ee.defaultPadding}var Xf=.52,B4=.35;function Z4(e){let t=e.fontSize??e.box.height*Xf;return Math.min(t*vr,e.box.height*Bi)}var qf=(e,t)=>Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0)>1e-6&&Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)>1e-6;function Ab(e){let t=Na(e),r=Math.min(e.qr.radius??0,(t.x1-t.x0)/2,(t.y1-t.y0)/2),n=[[t.x0+r,t.y0+r,Math.PI],[t.x1-r,t.y0+r,-Math.PI/2],[t.x1-r,t.y1-r,0],[t.x0+r,t.y1-r,Math.PI/2]],o=[];for(let[i,s,a]of n)for(let c=0;c<=8;c++){let u=a+Math.PI/2*(c/8);o.push([i+r*Math.cos(u),s+r*Math.sin(u)]);}return o}function U4([e,t],r,n){if(e<r.x-.01||t<r.y-.01||e>r.x+r.width+.01||t>r.y+r.height+.01)return false;let i=Math.min(n,r.width/2,r.height/2),s=Math.min(Math.max(e,r.x+i),r.x+r.width-i),a=Math.min(Math.max(t,r.y+i),r.y+r.height-i);return Math.hypot(e-s,t-a)<=i+.01}function G4(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),Math.abs(t)/2}function Q4(e,t,r){let n=Na(t);if(!qf(r,n))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:o}=e;return !Ab(t).every(i=>U4(i,o,o.radius??0))}if(e.type==="circle"&&e.hole){let o=e.hole;return !Ab(t).every(([i,s])=>Math.hypot(i-e.cx,s-e.cy)<=o+.01)}if(e.type==="polygon"){let o=ho(e.points,n);return o.length>2&&G4(o)>1e-6}return true}function Yf(e){let t=j4(e),r="stroke"in e?e.stroke:void 0;if(!(r&&t.bounds))return t;let n=e.type==="circle"||e.type==="ellipse"?r.width/2:e.type==="rect"?r.width*Math.SQRT2/2:r.width*2,{x0:o,y0:i,x1:s,y1:a}=t.bounds;return {bounds:{x0:o-n,y0:i-n,x1:s+n,y1:a+n},segments:t.segments*2}}function j4(e){switch(e.type){case "rect":return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case "circle":return {bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case "ellipse":return {bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case "polygon":{let t=e.points.map(([n])=>n),r=e.points.map(([,n])=>n);return {bounds:{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)},segments:e.points.length}}case "path":{let t=zi(e.d,ee.maxDecimals);return t?{bounds:fn(ur(e.d)),segments:xb(t)}:{bounds:null,segments:0}}case "line":{let t=e.width/2,r=Math.hypot(e.x2-e.x1,e.y2-e.y1),n=e.dash?Math.ceil(r/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-t,y0:Math.min(e.y1,e.y2)-t,x1:Math.max(e.x1,e.x2)+t,y1:Math.max(e.y1,e.y2)+t},segments:n*(e.cap==="round"?4:5)}}default:return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:vb}}}function Fa(e,t){let r=ee,n=new TextEncoder().encode(JSON.stringify(e)).length;if(n>r.maxBytes){t(`The spec is ${n} bytes; the limit is ${r.maxBytes}`);return}let{width:o,height:i}=e.artboard,s=Math.max(o,i)*.005,a={x0:-s,y0:-s,x1:o+s,y1:i+s},c=_=>_.x0>=a.x0&&_.y0>=a.y0&&_.x1<=a.x1&&_.y1<=a.y1,{qr:u}=e,l=xo(e);u.plate!=="none"&&l<u.size*r.minPadding-1e-9&&t(`qr.padding must be at least ${r.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(o,i)*r.minQrShare-1e-9&&t(`qr.size must be at least ${r.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let f=Na(e);(f.x0<-1e-9||f.y0<-1e-9||f.x1>o+1e-9||f.y1>i+1e-9)&&t("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*l)/2&&t("qr.radius is larger than half the plate",["qr","radius"]);let p=0,m=0;e.shapes.forEach((_,b)=>{let y=["shapes",b],{bounds:S,segments:C}=Yf(_);if(!S){t("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(c(S)||t("The shape extends outside the artboard",y),_.type==="rect"&&_.hole){let{hole:w}=_;(w.x<_.x||w.y<_.y||w.x+w.width>_.x+_.width+1e-9||w.y+w.height>_.y+_.height+1e-9)&&t("The hole must sit inside its rect",[...y,"hole"]);}_.type==="circle"&&_.hole&&_.hole>=_.r&&t("The hole must be smaller than the circle",[...y,"hole"]),"stroke"in _&&_.stroke&&_.stroke.width>Math.min(o,i)*.1+1e-9&&t("A stroke may be at most 10% of the artboard's shorter side",[...y,"stroke","width"]),u.plate==="background"&&Q4(_,e,S)&&t('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',y),p+=C,typeof _.fill=="object"&&"gradient"in _.fill&&(m+=(_.fill.gradient.steps??32)*C);}),p>r.maxSegments&&t(`The shapes have ${p} segments; the limit is ${r.maxSegments}`,["shapes"]),m>r.maxGradientWork&&t("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=[],d=new Set,g=new Set;e.labels.forEach((_,b)=>{let y=["labels",b];d.has(_.id)&&t(`Label id "${_.id}" is used twice`,[...y,"id"]),d.add(_.id),_.slot!=="fixed"&&(g.has(_.slot)&&t(`Only one label may use the ${_.slot} slot`,[...y,"slot"]),g.add(_.slot));let S=_.maxLength??r.maxTextLength;_.text!==yo(_.text,S)&&t(`Label text must be at most ${S} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(_.type==="text"){C={x0:_.box.x,y0:_.box.y,x1:_.box.x+_.box.width,y1:_.box.y+_.box.height},_.fontSize!==void 0&&_.fontSize>_.box.height*Bi+1e-9&&t("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]);let w=_.box.y+_.box.height/2,$=Z4(_)*B4,E={x0:C.x0,x1:C.x1,y0:w-$,y1:w+$};(qf(C,D4(e))||qf(E,f))&&t("The label overlaps the code or its padding",[...y,"box"]);}else {let{cx:w,cy:$,radius:E}=_.curve,R=_.fontSize*vr*.6;C={x0:w-E-R,y0:$-E-R,x1:w+E+R,y1:$+E+R};let P=Math.hypot(Math.max(f.x0-w,0,w-f.x1),Math.max(f.y0-$,0,$-f.y1));Math.hypot(Math.max(Math.abs(f.x0-w),Math.abs(f.x1-w)),Math.max(Math.abs(f.y0-$),Math.abs(f.y1-$)))<=E-R||P>=E+R||t("The curved label crosses the code or its padding",[...y,"curve"]);}if(c(C)||t("The label extends outside the artboard",y),_.collapse){let w=_.collapse,$=w.y+w.height;(w.y<-1e-9||$>i+1e-9)&&t("The collapse band must sit inside the artboard",[...y,"collapse"]),$>f.y0+1e-6&&w.y<f.y1-1e-6&&t("The collapse band crosses the code or its padding",[...y,"collapse"]);for(let E of h)$>E.y+1e-6&&w.y<E.y+E.height-1e-6&&t("Collapse bands may not overlap",[...y,"collapse"]);h.push(w);}});}var A={};Ar(A,{$brand:()=>mm,$input:()=>zd,$output:()=>Fd,INVALID:()=>ct,NEVER:()=>fm,TimePrecision:()=>Xd,ZodAny:()=>F0,ZodArray:()=>Z0,ZodBase64:()=>Tu,ZodBase64URL:()=>Ou,ZodBigInt:()=>ni,ZodBigIntFormat:()=>Fu,ZodBoolean:()=>ri,ZodCIDRv4:()=>Iu,ZodCIDRv6:()=>Mu,ZodCUID:()=>Cu,ZodCUID2:()=>Eu,ZodCatch:()=>cg,ZodCodec:()=>Os,ZodCompileAsyncError:()=>zt,ZodCompileUnsupportedError:()=>ne,ZodCreditCard:()=>P0,ZodCustom:()=>Ls,ZodCustomStringFormat:()=>In,ZodDate:()=>Rs,ZodDefault:()=>rg,ZodDiscriminatedUnion:()=>G0,ZodE164:()=>Lu,ZodEmail:()=>xu,ZodEmoji:()=>wu,ZodEnum:()=>Jo,ZodError:()=>o8,ZodExactOptional:()=>Zu,ZodFile:()=>K0,ZodFirstPartyTypeKind:()=>wg,ZodFunction:()=>bg,ZodGUID:()=>$u,ZodIBAN:()=>k0,ZodIPv4:()=>Pu,ZodIPv6:()=>ku,ZodISODate:()=>Br,ZodISODateTime:()=>Dr,ZodISODuration:()=>Ur,ZodISOTime:()=>Zr,ZodInstanceOf:()=>$g,ZodIntersection:()=>Q0,ZodIssueCode:()=>a8,ZodJWT:()=>Nu,ZodKSUID:()=>Ru,ZodLazy:()=>hg,ZodLiteral:()=>Y0,ZodMAC:()=>R0,ZodMap:()=>q0,ZodNaN:()=>lg,ZodNanoID:()=>Su,ZodNever:()=>D0,ZodNonOptional:()=>Uu,ZodNull:()=>L0,ZodNullable:()=>tg,ZodNumber:()=>ti,ZodNumberFormat:()=>Mn,ZodObject:()=>ks,ZodOptional:()=>Ms,ZodPipe:()=>Ts,ZodPrefault:()=>og,ZodPreprocess:()=>fg,ZodPromise:()=>_g,ZodReadonly:()=>mg,ZodRealError:()=>yt,ZodRecord:()=>Ko,ZodSet:()=>X0,ZodString:()=>ei,ZodStringFormat:()=>_e,ZodSuccess:()=>ag,ZodSymbol:()=>T0,ZodTemplateLiteral:()=>dg,ZodTransform:()=>J0,ZodTuple:()=>V0,ZodType:()=>Y,ZodULID:()=>Au,ZodURL:()=>vs,ZodUUID:()=>er,ZodUndefined:()=>O0,ZodUnion:()=>Is,ZodUnknown:()=>z0,ZodVoid:()=>B0,ZodXID:()=>vu,ZodXor:()=>U0,_ZodString:()=>yu,_default:()=>ng,_function:()=>K2,any:()=>P2,array:()=>Ps,base64:()=>u2,base64url:()=>l2,bigint:()=>C2,boolean:()=>M0,catch:()=>ug,check:()=>J2,cidrv4:()=>a2,cidrv6:()=>c2,clone:()=>de,codec:()=>W2,coerce:()=>Cg,compile:()=>Ud,config:()=>Te,core:()=>dr,creditCard:()=>m2,cuid:()=>Jy,cuid2:()=>e2,currencyCode:()=>b2,custom:()=>ex,date:()=>I2,decode:()=>$0,decodeAsync:()=>S0,deepPartial:()=>px,describe:()=>tx,discriminatedUnion:()=>F2,e164:()=>f2,email:()=>Gy,emoji:()=>Yy,encode:()=>x0,encodeAsync:()=>w0,endsWith:()=>Zo,enum:()=>Du,exactOptional:()=>eg,file:()=>Q2,flattenError:()=>Ki,float32:()=>x2,float64:()=>$2,formatError:()=>Ji,fromJSONSchema:()=>fx,function:()=>K2,getDiscriminatedOption:()=>fd,getErrorMap:()=>u8,globalRegistry:()=>Ye,gt:()=>Kt,gte:()=>Ct,guid:()=>Qy,hash:()=>y2,hex:()=>_2,hostname:()=>g2,httpUrl:()=>Xy,iban:()=>p2,includes:()=>Do,input:()=>hx,instanceof:()=>nx,int:()=>_u,int32:()=>w2,int64:()=>E2,intersection:()=>j0,invertCodec:()=>q2,ipv4:()=>o2,ipv6:()=>s2,iso:()=>Ns,json:()=>ix,jwt:()=>d2,keyof:()=>M2,ksuid:()=>n2,lazy:()=>gg,length:()=>An,literal:()=>G2,locales:()=>Mc,looseObject:()=>L2,looseRecord:()=>D2,lowercase:()=>Fo,lt:()=>Yt,lte:()=>St,mac:()=>i2,map:()=>B2,maxLength:()=>En,maxSize:()=>Lr,memoizer:()=>_s,meta:()=>rx,mime:()=>Go,minLength:()=>pr,minSize:()=>Jt,multipleOf:()=>Or,nan:()=>H2,nanoid:()=>Ky,nativeEnum:()=>U2,negative:()=>su,never:()=>zu,nonnegative:()=>cu,nonoptional:()=>sg,nonpositive:()=>au,normalize:()=>Qo,null:()=>N0,nullable:()=>As,nullish:()=>j2,number:()=>I0,object:()=>T2,optional:()=>Pn,output:()=>gx,overwrite:()=>Dt,parse:()=>g0,parseAsync:()=>_0,partialRecord:()=>z2,pipe:()=>bu,positive:()=>iu,prefault:()=>ig,preprocess:()=>sx,prettifyError:()=>_m,promise:()=>Y2,properties:()=>Uo,property:()=>uu,readonly:()=>pg,record:()=>W0,refine:()=>yg,regex:()=>No,regexes:()=>kt,registry:()=>Oc,safeDecode:()=>E0,safeDecodeAsync:()=>v0,safeEncode:()=>C0,safeEncodeAsync:()=>A0,safeParse:()=>b0,safeParseAsync:()=>y0,set:()=>Z2,setErrorMap:()=>c8,size:()=>Cn,slugify:()=>Wo,startsWith:()=>Bo,strictObject:()=>O2,string:()=>Es,stringFormat:()=>h2,stringbool:()=>ox,success:()=>V2,superRefine:()=>xg,symbol:()=>v2,templateLiteral:()=>X2,toJSONSchema:()=>pu,toLowerCase:()=>Vo,toUpperCase:()=>Ho,toZod:()=>Ui,transform:()=>Bu,treeifyError:()=>gm,trim:()=>jo,tuple:()=>H0,uint32:()=>S2,uint64:()=>A2,ulid:()=>t2,undefined:()=>R2,union:()=>oi,unknown:()=>Rn,uppercase:()=>zo,url:()=>qy,util:()=>D,uuid:()=>jy,uuidv4:()=>Vy,uuidv6:()=>Hy,uuidv7:()=>Wy,validate:()=>es,validateAsync:()=>ts,void:()=>k2,withParser:()=>Lc,xid:()=>r2,xor:()=>N2});var dr={};Ar(dr,{$ZodAny:()=>rd,$ZodArray:()=>cd,$ZodAsyncError:()=>_t,$ZodBase64:()=>Qp,$ZodBase64URL:()=>jp,$ZodBigInt:()=>wc,$ZodBigIntFormat:()=>Kp,$ZodBoolean:()=>fs,$ZodCIDRv4:()=>Up,$ZodCIDRv6:()=>Gp,$ZodCUID:()=>kp,$ZodCUID2:()=>Ip,$ZodCatch:()=>vd,$ZodCheck:()=>xe,$ZodCheckBigIntFormat:()=>np,$ZodCheckEndsWith:()=>hp,$ZodCheckGreaterThan:()=>sc,$ZodCheckIncludes:()=>pp,$ZodCheckLengthEquals:()=>up,$ZodCheckLessThan:()=>ic,$ZodCheckLowerCase:()=>fp,$ZodCheckMaxLength:()=>ap,$ZodCheckMaxSize:()=>op,$ZodCheckMimeType:()=>bp,$ZodCheckMinLength:()=>cp,$ZodCheckMinSize:()=>ip,$ZodCheckMultipleOf:()=>tp,$ZodCheckNumberFormat:()=>rp,$ZodCheckOverwrite:()=>yp,$ZodCheckProperties:()=>_p,$ZodCheckProperty:()=>gp,$ZodCheckRegex:()=>lp,$ZodCheckSizeEquals:()=>sp,$ZodCheckStartsWith:()=>dp,$ZodCheckStringFormat:()=>Mo,$ZodCheckUpperCase:()=>mp,$ZodCodec:()=>ps,$ZodCreditCard:()=>Hp,$ZodCustom:()=>Od,$ZodCustomStringFormat:()=>Xp,$ZodCyclicError:()=>Pc,$ZodDate:()=>sd,$ZodDefault:()=>Sd,$ZodDiscriminatedUnion:()=>md,$ZodE164:()=>Vp,$ZodEmail:()=>Cp,$ZodEmoji:()=>Rp,$ZodEncodeError:()=>Mr,$ZodEnum:()=>_d,$ZodError:()=>hm,$ZodExactOptional:()=>$d,$ZodFile:()=>yd,$ZodFunction:()=>Md,$ZodGUID:()=>wp,$ZodIBAN:()=>Wp,$ZodIPv4:()=>Dp,$ZodIPv6:()=>Bp,$ZodISODate:()=>Np,$ZodISODateTime:()=>Lp,$ZodISODuration:()=>zp,$ZodISOTime:()=>Fp,$ZodIntersection:()=>pd,$ZodJWT:()=>qp,$ZodKSUID:()=>Op,$ZodLazy:()=>ds,$ZodLiteral:()=>bd,$ZodMAC:()=>Zp,$ZodMap:()=>hd,$ZodNaN:()=>Rd,$ZodNanoID:()=>Pp,$ZodNever:()=>od,$ZodNonOptional:()=>Ed,$ZodNull:()=>td,$ZodNullable:()=>wd,$ZodNumber:()=>$c,$ZodNumberFormat:()=>Yp,$ZodObject:()=>cy,$ZodObjectJIT:()=>ud,$ZodOptional:()=>Cc,$ZodPipe:()=>Ec,$ZodPrefault:()=>Cd,$ZodPreprocess:()=>Pd,$ZodPromise:()=>Td,$ZodReadonly:()=>kd,$ZodRealError:()=>bt,$ZodRecord:()=>dd,$ZodRegistry:()=>Tc,$ZodSet:()=>gd,$ZodString:()=>xn,$ZodStringFormat:()=>he,$ZodSuccess:()=>Ad,$ZodSymbol:()=>Jp,$ZodTemplateLiteral:()=>Id,$ZodTransform:()=>xd,$ZodTuple:()=>Sc,$ZodType:()=>W,$ZodULID:()=>Mp,$ZodURL:()=>vp,$ZodUUID:()=>Sp,$ZodUndefined:()=>ed,$ZodUnion:()=>ms,$ZodUnknown:()=>nd,$ZodVoid:()=>id,$ZodXID:()=>Tp,$ZodXor:()=>ld,$brand:()=>mm,$constructor:()=>v,$input:()=>zd,$output:()=>Fd,Doc:()=>yn,INVALID:()=>ct,JSONSchema:()=>Dy,JSONSchemaGenerator:()=>du,NEVER:()=>fm,TimePrecision:()=>Xd,URL_BAD_FORMAT:()=>Ep,URL_UNPARSEABLE:()=>ss,ZodCompileAsyncError:()=>zt,ZodCompileUnsupportedError:()=>ne,_any:()=>ph,_array:()=>xh,_base64:()=>tu,_base64url:()=>ru,_bigint:()=>sh,_boolean:()=>oh,_catch:()=>jC,_check:()=>Sy,_cidrv4:()=>Jc,_cidrv6:()=>eu,_coercedBigint:()=>ah,_coercedBoolean:()=>ih,_coercedDate:()=>bh,_coercedNumber:()=>Kd,_coercedString:()=>Vd,_creditCard:()=>Wd,_cuid:()=>Vc,_cuid2:()=>Hc,_custom:()=>wh,_date:()=>_h,_decode:()=>Wa,_decodeAsync:()=>Xa,_default:()=>UC,_discriminatedUnion:()=>kC,_e164:()=>nu,_email:()=>zc,_emoji:()=>Qc,_encode:()=>Ha,_encodeAsync:()=>qa,_endsWith:()=>Zo,_enum:()=>NC,_file:()=>$h,_float32:()=>eh,_float64:()=>th,_gt:()=>Kt,_gte:()=>Ct,_guid:()=>Dc,_iban:()=>qd,_includes:()=>Do,_int:()=>Jd,_int32:()=>rh,_int64:()=>ch,_intersection:()=>IC,_ipv4:()=>Yc,_ipv6:()=>Kc,_isoDate:()=>xs,_isoDateTime:()=>ys,_isoDuration:()=>ws,_isoTime:()=>$s,_jwt:()=>ou,_ksuid:()=>Xc,_lazy:()=>qC,_length:()=>An,_literal:()=>zC,_lowercase:()=>Fo,_lt:()=>Yt,_lte:()=>St,_mac:()=>Hd,_map:()=>OC,_max:()=>St,_maxLength:()=>En,_maxSize:()=>Lr,_mime:()=>Go,_min:()=>Ct,_minLength:()=>pr,_minSize:()=>Jt,_multipleOf:()=>Or,_nan:()=>yh,_nanoid:()=>jc,_nativeEnum:()=>FC,_negative:()=>su,_never:()=>hh,_nonnegative:()=>cu,_nonoptional:()=>GC,_nonpositive:()=>au,_normalize:()=>Qo,_null:()=>mh,_nullable:()=>ZC,_number:()=>Yd,_optional:()=>BC,_overwrite:()=>Dt,_parse:()=>Ro,_parseAsync:()=>Po,_pipe:()=>VC,_positive:()=>iu,_promise:()=>XC,_properties:()=>Uo,_property:()=>uu,_readonly:()=>HC,_record:()=>TC,_refine:()=>Sh,_regex:()=>No,_safeDecode:()=>Ka,_safeDecodeAsync:()=>ec,_safeEncode:()=>Ya,_safeEncodeAsync:()=>Ja,_safeParse:()=>ko,_safeParseAsync:()=>Io,_set:()=>LC,_size:()=>Cn,_slugify:()=>Wo,_startsWith:()=>Bo,_string:()=>jd,_stringFormat:()=>vn,_stringbool:()=>vh,_success:()=>QC,_superRefine:()=>Ch,_symbol:()=>lh,_templateLiteral:()=>WC,_toLowerCase:()=>Vo,_toUpperCase:()=>Ho,_transform:()=>DC,_trim:()=>jo,_tuple:()=>MC,_uint32:()=>nh,_uint64:()=>uh,_ulid:()=>Wc,_undefined:()=>fh,_union:()=>RC,_unknown:()=>dh,_uppercase:()=>zo,_url:()=>bs,_uuid:()=>Bc,_uuidv4:()=>Zc,_uuidv6:()=>Uc,_uuidv7:()=>Gc,_void:()=>gh,_xid:()=>qc,_xor:()=>PC,base64Charset:()=>gc,base64urlCharset:()=>ls,canParseURL:()=>Ap,clone:()=>de,compile:()=>Ud,compileFn:()=>Nc,config:()=>Te,createStandardJSONSchemaMethod:()=>qo,createToJSONSchemaMethod:()=>Ph,decode:()=>N3,decodeAsync:()=>z3,describe:()=>Eh,encode:()=>L3,encodeAsync:()=>F3,extractDefs:()=>Fr,finalize:()=>zr,flattenError:()=>Ki,formatError:()=>Ji,getDiscriminatedOption:()=>fd,globalConfig:()=>We,globalRegistry:()=>Ye,handleUnrepresentable:()=>Ue,initializeContext:()=>Nr,isBackEdge:()=>Ic,isRecursiveSchema:()=>kc,isValidBase64:()=>us,isValidBase64URL:()=>_c,isValidCIDRv6:()=>hc,isValidCreditCard:()=>bc,isValidIBAN:()=>yc,isValidIPv6:()=>cs,isValidJWT:()=>xc,locales:()=>Mc,memoizer:()=>_s,mergeValues:()=>To,meta:()=>Ah,parse:()=>ja,parseAsync:()=>Va,parseURLObject:()=>iy,prettifyError:()=>_m,process:()=>ge,processSchema:()=>ge,regexes:()=>kt,registry:()=>Oc,safeDecode:()=>B3,safeDecodeAsync:()=>U3,safeEncode:()=>D3,safeEncodeAsync:()=>Z3,safeParse:()=>k3,safeParseAsync:()=>I3,standardProps:()=>fc,stripTabAndNewline:()=>as,toDotPath:()=>zb,toJSONSchema:()=>pu,toZod:()=>Ui,treeifyError:()=>gm,urlHostnameOk:()=>pc,urlProtocolOk:()=>dc,util:()=>D,validate:()=>es,validateAsync:()=>ts,validateURL:()=>mc,version:()=>xp,withParser:()=>Lc});var D={};Ar(D,{BIGINT_FORMAT_RANGES:()=>Hi,CONSTANT_CATCH:()=>Ga,Class:()=>em,NUMBER_FORMAT_RANGES:()=>Vi,aborted:()=>at,allowsEval:()=>nm,assert:()=>X4,assertEqual:()=>V4,assertIs:()=>W4,assertNever:()=>q4,assertNotEqual:()=>H4,assignProp:()=>Xe,attachSchema:()=>Wi,base64ToUint8Array:()=>Mb,base64urlToUint8Array:()=>h3,cached:()=>Co,captureStackTrace:()=>Ba,cleanEnum:()=>d3,cleanRegex:()=>fr,clone:()=>de,cloneDef:()=>J4,codePointLength:()=>_n,constantCatch:()=>um,createTransparentProxy:()=>i3,defineLazy:()=>tm,defineLazyInternal:()=>J,derived:()=>y3,esc:()=>st,escapeRegex:()=>Pt,explicitlyAborted:()=>sm,extend:()=>c3,finalizeIssue:()=>gt,floatSafeRemainder:()=>Gi,getElementAtPath:()=>e3,getEnumValues:()=>wo,getLengthableOrigin:()=>Xi,getParsedType:()=>o3,getSizableOrigin:()=>qi,hexToUint8Array:()=>_3,hide:()=>Yi,installLazyProp:()=>S3,isObject:()=>gn,isPlainObject:()=>Rt,issue:()=>vo,joinValues:()=>za,jsonStringifyReplacer:()=>So,members:()=>cm,merge:()=>l3,mergeDefs:()=>Ft,normalizeParams:()=>L,nullish:()=>Da,numKeys:()=>n3,objectClone:()=>Y4,omit:()=>a3,optionalKeys:()=>im,own:()=>Ir,parsedType:()=>am,partial:()=>f3,pick:()=>s3,prefixIssues:()=>ht,primitiveTypes:()=>om,promiseAllObject:()=>t3,propertyKeyTypes:()=>ji,randomString:()=>r3,rawShape:()=>Eo,required:()=>m3,safeExtend:()=>u3,shallowClone:()=>Qi,sizeCaps:()=>Ao,slugify:()=>rm,stringifyPrimitive:()=>Za,toZod:()=>Ui,uint8ArrayToBase64:()=>Tb,uint8ArrayToBase64url:()=>g3,uint8ArrayToHex:()=>b3,unwrapMessage:()=>$o});function V4(e){return e}function H4(e){return e}function Ui(){return e=>e}function W4(e){}function q4(e){throw new Error("Unexpected value in exhaustive check")}function X4(e){}function wo(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function za(e,t="|"){return e.map(r=>Za(r)).join(t)}function So(e,t){return typeof t=="bigint"?t.toString():t}var Jf=class{constructor(t){this._getter=t,this._value=void 0;}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Co(e){return new Jf(e)}function Da(e){return e==null}function fr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Gi(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Rb=Symbol("evaluating");function tm(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Rb)return n===void 0&&(n=Rb,n=r()),n},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function Y4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Xe(e,t,r){Object.defineProperty(e,t,{value:r,writable:true,enumerable:true,configurable:true});}function Eo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function lr(e){return Eo(e._zod.def)??e._zod.def.shape}function Pb(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return Xe(this,t,n),n},enumerable:true,configurable:true});}function kb(e,t,r){t in e?Xe(e,t,r):e[t]=r;}function hn(e,t,r,n){let o=lr(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?Pb(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):kb(e,i,n?n(s.value,i):s.value));}}function K4(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Pb(e,r,()=>t[r]):kb(e,r,n.value));}}function Ft(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n);}return Object.defineProperties({},t)}function J4(e){return Ft(e._zod.def)}function e3(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function t3(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function r3(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function st(e){return JSON.stringify(e)}function rm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ba="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nm=Co(()=>{if(We.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function Rt(e){if(gn(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let r=t.prototype;return !(gn(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function Qi(e){return Rt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function n3(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var o3=e=>{let t=typeof e;switch(t){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(e)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ji=new Set(["string","number","symbol"]),om=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,r){let n=new e._zod.constr(t??e._zod.def);return (!t||r?.parent)&&(n._zod.parent=e),n}function L(e){let t=e;if(!t)return {};if(typeof t=="string")return {error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function i3(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Za(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function im(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Vi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Hi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function s3(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return hn(i,e,Ua(e,t)),de(e,Ft(r,{shape:i,checks:[]}))}function Ua(e,t){let r=lr(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o);}return n}function a3(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Ua(e,t)),s={};return hn(s,e,Reflect.ownKeys(lr(e)).filter(a=>!i.has(a))),de(e,Ft(r,{shape:s,checks:[]}))}function c3(e,t){if(!Rt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=lr(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return de(e,Ft(e._zod.def,{shape:Ib(e,t)}))}function Ib(e,t){let r={};return hn(r,e,Reflect.ownKeys(lr(e))),K4(r,t),r}function u3(e,t){if(!Rt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return de(e,Ft(e._zod.def,{shape:Ib(e,t)}))}function l3(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};hn(r,e,Reflect.ownKeys(lr(e))),hn(r,t,Reflect.ownKeys(lr(t)));let n=Ft(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return de(e,n)}function f3(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Ua(t,r)):void 0,c={};return hn(c,t,Reflect.ownKeys(lr(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),de(t,Ft(t._zod.def,{shape:c,checks:[]}))}function m3(e,t,r){let n=r?new Set(Ua(t,r)):void 0,o={};return hn(o,t,Reflect.ownKeys(lr(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),de(t,Ft(t._zod.def,{shape:o}))}function at(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==true)return true;return false}function sm(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===false)return true;return false}function ht(e,t){return t.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(e),r})}function $o(e){return typeof e=="string"?e:e?.message}function Ao(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r]);}return t}function Wi(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r);}function gt(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:$o(e.inst?._zod.def?.error?.(e))??$o(i?.(e))??$o(t?.error?.(e))??$o(r.customError?.(e))??$o(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function qi(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var p3=/[\uD800-\uDBFF]/;function _n(e){let t=e.length;if(!p3.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Xi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function am(e){let t=typeof e;switch(t){case "number":return Number.isNaN(e)?"nan":"number";case "object":{if(e===null)return "null";if(Array.isArray(e))return "array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function vo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function d3(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Mb(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Tb(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function h3(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Mb(t+r)}function g3(e){return Tb(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _3(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function b3(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var em=class{constructor(...t){}};function cm(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:false}):x3(e,r,n.value);}}function Ir(e,t,r,n=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:n,value:r}),r}function Yi(e,t,r){return Ir(e,t,r,false)}function y3(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:true,enumerable:true,get(){return Ir(this,r,n(this))},set(o){Ir(this,r,o);}});}return t}function x3(e,t,r){Object.defineProperty(e,t,{configurable:true,get(){return this==null?r:Ir(this,t,r.bind(this))},set(n){Ir(this,t,n);}});}function $3(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Kf,kr=false,w3={configurable:true,get(){kr=true;}};function J(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Kf!==e._zod){Kf=void 0;return}Kf=e._zod,Object.defineProperty(n,t,{configurable:true,get(){Object.defineProperty(this,t,w3);let o=kr;kr=false;try{let i=r(this);return kr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),kr=kr||o,i}catch(i){throw delete this[t],kr=kr||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function S3(e,t,r,n){let o=$3(e,t);o&&Object.defineProperty(o,t,{configurable:true,get(){let i={configurable:true,writable:true,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:true,writable:true,enumerable:n,value:i});}});}var Ga="~constantCatch";function um(e){let t=()=>e;return t[Ga]=true,t}var Ob,fm=Object.freeze({status:"aborted"}),lm={value:void 0,enumerable:false},Lb="captureStackTrace"in Error?Error:null;function C3(e){let t=Lb;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0;}catch{return Lb=null,new e}try{return new e}finally{t.stackTraceLimit=r;}}}return new e}function v(e,t,r,n){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set;}i.prototype=o;let s=r,a=s&&new WeakSet;function c(p,m){if(p._zod){if(p._zod.traits.has(e))return}else {lm.value=new i(m);try{Object.defineProperty(p,"_zod",lm);}finally{lm.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,_=d;for(;_&&_!==g;)_=Object.getPrototypeOf(_);let b=_??d;a.has(b)||(a.add(b),cm(b,s));}let h=f.prototype;for(let d in h)Object.prototype.hasOwnProperty.call(h,d)&&(d in p||(p[d]=h[d].bind(p)));}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(p){let m=n?.Parent?C3(l):this;c(m,p);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0;}let d=globalThis.__zod_globalConfig?.postProcessor;return d&&d(m),m}return Object.defineProperty(f,"init",{value:c}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?true:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var mm=Symbol("zod_brand"),_t=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Mr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(Ob=globalThis).__zod_globalConfig??(Ob.__zod_globalConfig={});var We=globalThis.__zod_globalConfig;function Te(e){return e&&Object.assign(We,e),We}function E3(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,So,2)),e.message}function A3(e){this._zod.message=e;}var v3={get:E3,set:A3,enumerable:true,configurable:true},dm={value:void 0,enumerable:false},Nb=new WeakSet([Object.prototype,Error.prototype]),Fb=(e,t)=>{e.name="$ZodError",dm.value=t,Object.defineProperty(e,"issues",dm),dm.value=void 0,Object.defineProperty(e,"message",v3);let r=Object.getPrototypeOf(e);Nb.has(r)||(Nb.add(r),Object.defineProperty(r,"toString",{configurable:true,enumerable:false,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true});}}));},hm=v("$ZodError",Fb),bt=v("$ZodError",Fb,void 0,{Parent:Error});function R3(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:true,enumerable:true,configurable:true}):e[t]=r()),e[t]}function Ki(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?R3(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return {formErrors:n,fieldErrors:r}}function Ji(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else {let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else {let c=r,u=0;for(;u<a.length;){let l=a[u],f=u===a.length-1;if(l==="_errors"){f&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:true,writable:true,configurable:true});let p=c[l];f&&p._errors.push(t(s)),c=p,u++;}}}};return n(e),r}function gm(e,t=r=>r.message){let r={errors:[]},n=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>n({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else {let c=[...i,...a.path];if(c.length===0){r.errors.push(t(a));continue}let u=r,l=0;for(;l<c.length;){let f=c[l],p=l===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,f)||Object.defineProperty(u.properties,f,{value:{errors:[]},enumerable:true,writable:true,configurable:true}),u=u.properties[f]):(u.items??(u.items=[]),(s=u.items)[f]??(s[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(t(a)),l++;}}};return n(e),r}function zb(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function _m(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${zb(n.path)}`);return t.join(`
2
- `)}function Qa(e,t){return {callee:t?.callee??e,Err:t?.Err}}var Ro=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:false}:{async:false},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new _t;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>gt(u,s,Te())));throw Ba(c,i?.callee??t),c}return a.value};return t},ja=Ro(bt),Po=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:true}:{async:true},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>gt(u,s,Te())));throw Ba(c,i?.callee??t),c}return a.value};return t},Va=Po(bt),ko=e=>(t,r,n)=>{let o=n?{...n,async:false}:{async:false},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new _t;return i.issues.length?Db(e,i.issues,o):{success:true,data:i.value}},k3=ko(bt);function Db(e,t,r){let n;return {success:false,get error(){return n||(n=new e(t.map(o=>gt(o,r,Te()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0;}}}var Io=e=>async(t,r,n)=>{let o=n?{...n,async:true}:{async:true},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Db(e,i.issues,o):{success:true,data:i.value}},I3=Io(bt),M3=Symbol.for("zod.compile.invalid"),T3=Symbol.for("zod.compile.fallback"),es=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==M3)return true;if(n.definite===true&&r===void 0)return false}return O3(e,t,r)});function O3(e,t,r){let n=r?{...r,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(n[T3]=true,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new _t;return i.issues.length===0}var ts=async(e,t,r)=>{let n=r?{...r,async:true,abortEarly:true}:{async:true,abortEarly:true},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Ha=e=>{let t=Ro(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Qa(r,s))};return r},L3=Ha(bt),Wa=e=>{let t=Ro(e),r=(n,o,i,s)=>t(n,o,i,Qa(r,s));return r},N3=Wa(bt),qa=e=>{let t=Po(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Qa(r,s))};return r},F3=qa(bt),Xa=e=>{let t=Po(e),r=async(n,o,i,s)=>await t(n,o,i,Qa(r,s));return r},z3=Xa(bt),Ya=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ko(e)(t,r,o)},D3=Ya(bt),Ka=e=>(t,r,n)=>ko(e)(t,r,n),B3=Ka(bt),Ja=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Io(e)(t,r,o)},Z3=Ja(bt),ec=e=>async(t,r,n)=>Io(e)(t,r,n),U3=ec(bt);var kt={};Ar(kt,{anyString:()=>Qm,base64:()=>Lm,base64url:()=>Nm,bigint:()=>Vm,boolean:()=>Hm,browserEmail:()=>X3,cidrv4:()=>Tm,cidrv6:()=>Om,creditCard:()=>tc,cuid:()=>ym,cuid2:()=>xm,currencyCode:()=>Bm,date:()=>Zm,datetime:()=>Gm,domain:()=>zm,duration:()=>Am,e164:()=>Dm,email:()=>Rm,emoji:()=>Pm,extendedDuration:()=>G3,guid:()=>vm,hex:()=>Km,hostname:()=>Fm,html5Email:()=>H3,httpProtocol:()=>rs,iban:()=>rc,idnEmail:()=>q3,integer:()=>ns,ipv4:()=>km,ipv6:()=>Im,ksuid:()=>Sm,lowercase:()=>Xm,mac:()=>Mm,md5_base64:()=>e6,md5_base64url:()=>t6,md5_hex:()=>J3,nanoid:()=>Cm,nanoidOfLength:()=>Em,null:()=>Wm,number:()=>mr,rfc5322Email:()=>W3,sha1_base64:()=>n6,sha1_base64url:()=>o6,sha1_hex:()=>r6,sha256_base64:()=>s6,sha256_base64url:()=>a6,sha256_hex:()=>i6,sha384_base64:()=>u6,sha384_base64url:()=>l6,sha384_hex:()=>c6,sha512_base64:()=>m6,sha512_base64url:()=>p6,sha512_hex:()=>f6,string:()=>jm,time:()=>Um,ulid:()=>$m,undefined:()=>qm,unicodeEmail:()=>Bb,uppercase:()=>Ym,uuid:()=>bn,uuid4:()=>Q3,uuid6:()=>j3,uuid7:()=>V3,xid:()=>wm});var ym=/^[cC][0-9a-z]{6,}$/,xm=/^[0-9a-z]+$/,$m=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wm=/^[0-9a-vA-V]{20}$/,Sm=/^[A-Za-z0-9]{27}$/,Cm=/^[a-zA-Z0-9_-]{21}$/;function Em(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Am=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,G3=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vm=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Q3=bn(4),j3=bn(6),V3=bn(7),Rm=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,H3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,W3=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Bb=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,q3=Bb,X3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Y3="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Pm(){return new RegExp(Y3,"u")}var km=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Im=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Mm=e=>{let t=Pt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Tm=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Om=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Nm=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Fm=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,zm=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,rs=/^https?$/,Dm=/^\+[1-9]\d{6,14}$/,tc=/^\d(?:[ -]?\d){11,18}$/,Bm=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,rc=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Zb="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function K3(e){return new RegExp(`^${e}$`)}var Zm=K3(Zb);function bm(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Um(e){return new RegExp(`^${bm(e)}$`)}function Gm(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${bm({precision:e.precision,seconds:true})}(?:${t.join("|")})`,n=e.local?`${r}|${bm({precision:e.precision})}`:r;return new RegExp(`^${Zb}T(?:${n})$`)}var Qm=/^[\s\S]{0,}$/,jm=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Vm=/^-?\d+n?$/,ns=/^-?\d+$/,mr=/^-?\d+(?:\.\d+)?$/,Hm=/^(?:true|false)$/i,Wm=/^null$/i;var qm=/^undefined$/i;var Xm=/^[^A-Z]*$/,Ym=/^[^a-z]*$/,Km=/^[0-9a-fA-F]*$/;function os(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function is(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var J3=/^[0-9a-fA-F]{32}$/,e6=os(22,"=="),t6=is(22),r6=/^[0-9a-fA-F]{40}$/,n6=os(27,"="),o6=is(27),i6=/^[0-9a-fA-F]{64}$/,s6=os(43,"="),a6=is(43),c6=/^[0-9a-fA-F]{96}$/,u6=os(64,""),l6=is(64),f6=/^[0-9a-fA-F]{128}$/,m6=os(86,"=="),p6=is(86);var xe=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[]);}),Jm=e=>{let t=e.value;return !Da(t)&&t.size!==void 0},ep=e=>{let t=e.value;return !Da(t)&&t.length!==void 0},nc={number:"number",bigint:"bigint",object:"date"},ic=v("$ZodCheckLessThan",(e,t)=>{xe.init(e,t);let r=nc[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:nc[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),sc=v("$ZodCheckGreaterThan",(e,t)=>{xe.init(e,t);let r=nc[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:nc[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),tp=v("$ZodCheckMultipleOf",(e,t)=>{xe.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Gi(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort});};}),rp=v("$ZodCheckNumberFormat",(e,t)=>{xe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Vi[t.format];e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:false,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:true,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:true,inst:e,continue:!t.abort});};}),np=v("$ZodCheckBigIntFormat",(e,t)=>{xe.init(e,t);let[r,n]=Hi[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:true,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:true,inst:e,continue:!t.abort});};}),op=v("$ZodCheckMaxSize",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Jm),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:qi(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),ip=v("$ZodCheckMinSize",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Jm),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:qi(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),sp=v("$ZodCheckSizeEquals",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Jm),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:qi(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),ap=v("$ZodCheckMaxLength",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=ep),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?_n(o):i)<=t.maximum)return;let a=Xi(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),cp=v("$ZodCheckMinLength",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=ep),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?_n(o):i)>=t.minimum)return;let a=Xi(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),up=v("$ZodCheckLengthEquals",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=ep),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?_n(o):i;if(s===t.length)return;let a=Xi(o),c=s>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Mo=v("$ZodCheckStringFormat",(e,t)=>{var r,n;xe.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(n=e._zod).check??(n.check=()=>{});}),lp=v("$ZodCheckRegex",(e,t)=>{Mo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),fp=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Xm),Mo.init(e,t);}),mp=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ym),Mo.init(e,t);}),pp=v("$ZodCheckIncludes",(e,t)=>{xe.init(e,t);let r=Pt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort});};}),dp=v("$ZodCheckStartsWith",(e,t)=>{xe.init(e,t);let r=new RegExp(`^${Pt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort});};}),hp=v("$ZodCheckEndsWith",(e,t)=>{xe.init(e,t);let r=new RegExp(`.*${Pt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort});};});function oc(e,t,r){e.issues.length&&t.issues.push(...ht(r,e.issues));}var gp=v("$ZodCheckProperty",(e,t)=>{xe.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>oc(o,r,t.property));oc(n,r,t.property);};}),_p=v("$ZodCheckProperties",(e,t)=>{xe.init(e,t),Yi(e,Symbol.iterator,function*(){yield e;});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=n.value,i;for(let[s,a]of r){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>oc(u,n,s)))):oc(c,n,s);}if(i)return Promise.all(i).then(()=>{})};}),bp=v("$ZodCheckMimeType",(e,t)=>{xe.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort});};}),yp=v("$ZodCheckOverwrite",(e,t)=>{xe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value);};});var yn=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r;}indented(t){this.indent+=1;try{t(this);}finally{this.indent-=1;}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
1
+ var C4=Object.defineProperty;var vr=(e,t)=>{for(var r in t)C4(e,r,{get:t[r],enumerable:true});};var uo;(i=>{class e{constructor(a,c,u,l){this.version=a;this.errorCorrectionLevel=c;if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version value out of range");if(l<-1||l>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let f=[];for(let m=0;m<this.size;m++)f.push(false);for(let m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(u);if(this.drawCodewords(p),l==-1){let m=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);let d=this.getPenaltyScore();d<m&&(l=h,m=d),this.applyMask(h);}}n(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[];}version;errorCorrectionLevel;static encodeText(a,c){let u=i.QrSegment.makeSegments(a);return e.encodeSegments(u,c)}static encodeBinary(a,c){let u=i.QrSegment.makeBytes(a);return e.encodeSegments([u],c)}static encodeSegments(a,c,u=1,l=40,f=-1,p=true){if(!(e.MIN_VERSION<=u&&u<=l&&l<=e.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let m,h;for(m=u;;m++){let b=e.getNumDataCodewords(m,c)*8,y=o.getTotalBits(a,m);if(y<=b){h=y;break}if(m>=l)throw new RangeError("Data too long")}for(let b of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,b)*8&&(c=b);let d=[];for(let b of a){t(b.mode.modeBits,4,d),t(b.numChars,b.mode.numCharCountBits(m),d);for(let y of b.getData())d.push(y);}n(d.length==h);let g=e.getNumDataCodewords(m,c)*8;n(d.length<=g),t(0,Math.min(4,g-d.length),d),t(0,(8-d.length%8)%8,d),n(d.length%8==0);for(let b=236;d.length<g;b^=253)t(b,8,d);let _=[];for(;_.length*8<d.length;)_.push(0);return d.forEach((b,y)=>_[y>>>3]|=b<<7-(y&7)),new e(m,c,_,f)}size;mask;modules=[];isFunction=[];getModule(a,c){return 0<=a&&a<this.size&&0<=c&&c<this.size&&this.modules[c][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),c=a.length;for(let u=0;u<c;u++)for(let l=0;l<c;l++)u==0&&l==0||u==0&&l==c-1||u==c-1&&l==0||this.drawAlignmentPattern(a[u],a[l]);this.drawFormatBits(0),this.drawVersion();}drawFormatBits(a){let c=this.errorCorrectionLevel.formatBits<<3|a,u=c;for(let f=0;f<10;f++)u=u<<1^(u>>>9)*1335;let l=(c<<10|u)^21522;n(l>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,r(l,f));this.setFunctionModule(8,7,r(l,6)),this.setFunctionModule(8,8,r(l,7)),this.setFunctionModule(7,8,r(l,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,r(l,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,r(l,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,r(l,f));this.setFunctionModule(8,this.size-8,true);}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;let c=this.version<<12|a;n(c>>>18==0);for(let u=0;u<18;u++){let l=r(c,u),f=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(f,p,l),this.setFunctionModule(p,f,l);}}drawFinderPattern(a,c){for(let u=-4;u<=4;u++)for(let l=-4;l<=4;l++){let f=Math.max(Math.abs(l),Math.abs(u)),p=a+l,m=c+u;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,f!=2&&f!=4);}}drawAlignmentPattern(a,c){for(let u=-2;u<=2;u++)for(let l=-2;l<=2;l++)this.setFunctionModule(a+l,c+u,Math.max(Math.abs(l),Math.abs(u))!=1);}setFunctionModule(a,c,u){this.modules[c][a]=u,this.isFunction[c][a]=true;}addEccAndInterleave(a){let c=this.version,u=this.errorCorrectionLevel;if(a.length!=e.getNumDataCodewords(c,u))throw new RangeError("Invalid argument");let l=e.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][c],f=e.ECC_CODEWORDS_PER_BLOCK[u.ordinal][c],p=Math.floor(e.getNumRawDataModules(c)/8),m=l-p%l,h=Math.floor(p/l),d=[],g=e.reedSolomonComputeDivisor(f);for(let b=0,y=0;b<l;b++){let S=a.slice(y,y+h-f+(b<m?0:1));y+=S.length;let C=e.reedSolomonComputeRemainder(S,g);b<m&&S.push(0),d.push(S.concat(C));}let _=[];for(let b=0;b<d[0].length;b++)d.forEach((y,S)=>{(b!=h-f||S>=m)&&_.push(y[b]);});return n(_.length==p),_}drawCodewords(a){if(a.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let l=0;l<this.size;l++)for(let f=0;f<2;f++){let p=u-f,h=(u+1&2)==0?this.size-1-l:l;!this.isFunction[h][p]&&c<a.length*8&&(this.modules[h][p]=r(a[c>>>3],7-(c&7)),c++);}}n(c==a.length*8);}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let u=0;u<this.size;u++){let l;switch(a){case 0:l=(u+c)%2==0;break;case 1:l=c%2==0;break;case 2:l=u%3==0;break;case 3:l=(u+c)%3==0;break;case 4:l=(Math.floor(u/3)+Math.floor(c/2))%2==0;break;case 5:l=u*c%2+u*c%3==0;break;case 6:l=(u*c%2+u*c%3)%2==0;break;case 7:l=((u+c)%2+u*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][u]&&l&&(this.modules[c][u]=!this.modules[c][u]);}}getPenaltyScore(){let a=0;for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[f][d]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[f][d],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size;f++){let p=false,m=0,h=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][f]==p?(m++,m==5?a+=e.PENALTY_N1:m>5&&a++):(this.finderPenaltyAddHistory(m,h),p||(a+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),p=this.modules[d][f],m=1);a+=this.finderPenaltyTerminateAndCount(p,m,h)*e.PENALTY_N3;}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){let m=this.modules[f][p];m==this.modules[f][p+1]&&m==this.modules[f+1][p]&&m==this.modules[f+1][p+1]&&(a+=e.PENALTY_N2);}let c=0;for(let f of this.modules)c=f.reduce((p,m)=>p+(m?1:0),c);let u=this.size*this.size,l=Math.ceil(Math.abs(c*20-u*10)/u)-1;return n(0<=l&&l<=9),a+=l*e.PENALTY_N4,n(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return [];{let a=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,u=[6];for(let l=this.size-7;u.length<a;l-=c)u.splice(1,0,l);return u}}static getNumRawDataModules(a){if(a<e.MIN_VERSION||a>e.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*a+128)*a+64;if(a>=2){let u=Math.floor(a/7)+2;c-=(25*u-10)*u-55,a>=7&&(c-=36);}return n(208<=c&&c<=29648),c}static getNumDataCodewords(a,c){return Math.floor(e.getNumRawDataModules(a)/8)-e.ECC_CODEWORDS_PER_BLOCK[c.ordinal][a]*e.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let c=[];for(let l=0;l<a-1;l++)c.push(0);c.push(1);let u=1;for(let l=0;l<a;l++){for(let f=0;f<c.length;f++)c[f]=e.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=e.reedSolomonMultiply(u,2);}return c}static reedSolomonComputeRemainder(a,c){let u=c.map(l=>0);for(let l of a){let f=l^u.shift();u.push(0),c.forEach((p,m)=>u[m]^=e.reedSolomonMultiply(p,f));}return u}static reedSolomonMultiply(a,c){if(a>>>8||c>>>8)throw new RangeError("Byte out of range");let u=0;for(let l=7;l>=0;l--)u=u<<1^(u>>>7)*285,u^=(c>>>l&1)*a;return n(u>>>8==0),u}finderPenaltyCountPatterns(a){let c=a[1];n(c<=this.size*3);let u=c>0&&a[2]==c&&a[3]==c*3&&a[4]==c&&a[5]==c;return (u&&a[0]>=c*4&&a[6]>=c?1:0)+(u&&a[6]>=c*4&&a[0]>=c?1:0)}finderPenaltyTerminateAndCount(a,c,u){return a&&(this.finderPenaltyAddHistory(c,u),c=0),c+=this.size,this.finderPenaltyAddHistory(c,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,c){c[0]==0&&(a+=this.size),c.pop(),c.unshift(a);}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]]}i.QrCode=e;function t(s,a,c){if(a<0||a>31||s>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)c.push(s>>>u&1);}function r(s,a){return (s>>>a&1)!=0}function n(s){if(!s)throw new Error("Assertion error")}class o{constructor(a,c,u){this.mode=a;this.numChars=c;this.bitData=u;if(c<0)throw new RangeError("Invalid argument");this.bitData=u.slice();}mode;numChars;bitData;static makeBytes(a){let c=[];for(let u of a)t(u,8,c);return new o(o.Mode.BYTE,a.length,c)}static makeNumeric(a){if(!o.isNumeric(a))throw new RangeError("String contains non-numeric characters");let c=[];for(let u=0;u<a.length;){let l=Math.min(a.length-u,3);t(parseInt(a.substr(u,l),10),l*3+1,c),u+=l;}return new o(o.Mode.NUMERIC,a.length,c)}static makeAlphanumeric(a){if(!o.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],u;for(u=0;u+2<=a.length;u+=2){let l=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;l+=o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),t(l,11,c);}return u<a.length&&t(o.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,c),new o(o.Mode.ALPHANUMERIC,a.length,c)}static makeSegments(a){return a==""?[]:o.isNumeric(a)?[o.makeNumeric(a)]:o.isAlphanumeric(a)?[o.makeAlphanumeric(a)]:[o.makeBytes(o.toUtf8ByteArray(a))]}static makeEci(a){let c=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)t(a,8,c);else if(a<16384)t(2,2,c),t(a,14,c);else if(a<1e6)t(6,3,c),t(a,21,c);else throw new RangeError("ECI assignment value out of range");return new o(o.Mode.ECI,0,c)}static isNumeric(a){return o.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return o.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,c){let u=0;for(let l of a){let f=l.mode.numCharCountBits(c);if(l.numChars>=1<<f)return 1/0;u+=4+f+l.bitData.length;}return u}static toUtf8ByteArray(a){a=encodeURI(a);let c=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?c.push(a.charCodeAt(u)):(c.push(parseInt(a.substr(u+1,2),16)),u+=2);return c}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}i.QrSegment=o;})(uo||={});(t=>{(n=>{class r{constructor(i,s){this.ordinal=i;this.formatBits=s;}ordinal;formatBits;static LOW=new r(0,1);static MEDIUM=new r(1,0);static QUARTILE=new r(2,3);static HIGH=new r(3,2)}n.Ecc=r;})(t.QrCode||={});})(uo||={});(t=>{(n=>{class r{constructor(i,s){this.modeBits=i;this.numBitsCharCount=s;}modeBits;numBitsCharCount;static NUMERIC=new r(1,[10,12,14]);static ALPHANUMERIC=new r(2,[9,11,13]);static BYTE=new r(4,[8,16,16]);static KANJI=new r(8,[8,10,12]);static ECI=new r(7,[0,0,0]);numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}}n.Mode=r;})(t.QrSegment||={});})(uo||={});var vt=uo;var Ia={L:vt.QrCode.Ecc.LOW,M:vt.QrCode.Ecc.MEDIUM,Q:vt.QrCode.Ecc.QUARTILE,H:vt.QrCode.Ecc.HIGH},$e=128,jt="Q",Pe="#FFFFFF",We="#000000";var Me=0;var Ma=.1;function Fe(e,t="#000000"){return e?typeof e=="string"?e:e.type==="solid"?e.color:e.type==="image"?e.underlay||t:(e.type==="linear"||e.type==="radial"||e.type==="angular")&&e.stops[0]?.color||t:t}function ot(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function sn(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function vf(e){return typeof e=="object"&&e!==null&&e.type==="image"}function v4(e,t="#000000"){let r=ot(e,t);return r.type==="solid"?r.color:r.type==="image"?r.underlay||t:r.stops[0]?.color||t}function $b(e="center"){let[t,r]=e.split("-");return e==="center"?"center":r?`${r} ${t}`:t==="top"||t==="bottom"?`center ${t}`:`${t} center`}function A4(e){if(!e)return "#000000";if(typeof e=="string")return e;let t=ot(e);if(t.type==="solid")return t.color;if(t.type==="image"){let o=t.fit==="tile"?`${25*(t.scale??1)}% auto`:(t.scale??1)===1?t.fit==="contain"?"contain":"cover":`${100*(t.scale??1)}% auto`,i=t.fit==="tile"?"repeat":"no-repeat";return `${`url("${t.src.replace(/"/g,"%22")}")`} ${$b(t.position)} / ${o} ${i}, ${t.underlay??"transparent"}`}let n=[...t.stops].sort((o,i)=>o.offset-i.offset).map(o=>`${o.color} ${o.offset}%`).join(", ");return t.type==="linear"?`linear-gradient(${(t.angle??0)+90}deg, ${n})`:t.type==="angular"?`conic-gradient(from ${t.angle??0}deg, ${n})`:`radial-gradient(circle, ${n})`}var lo=["logo","halftone"],fo={logo:["blend","badge"],halftone:["color","mono"]},Vt=192,Ta=["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"],Af=["diamond","star","banner"],Oa=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse","porthole","notch","plus","bud","bowl"],Ef=["curly"],Rf=["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"],an={x:"plus",pebble:"rounded",flower:"circle",beads:"circle",bubble:"circle",chain:"circle",petal:"leaf",drop:"rounded",squircle:"rounded"},ir={pebble:"squircle",tag:"rounded",crest:"shield",doodle:"squircle",stamp:"notch"},sr={bevel:"square",notch:"square"};function Ve(e,t){return typeof t=="string"&&Object.hasOwn(e,t)?e[t]:t}var Pf=["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"],pt=24,kf="Scan me",cn=.5,Ar=1.5,If=["square","rounded","circle"],Mf=.1,Ti=.3,Tf=.25,Of=2,mo=.5,Oi=1,Lf=.07,Nf=["square","circle","heart"],Ff=3,At=64,Nt=8,zf=.42,un=["topLeft","topRight","bottomLeft"],po=.5,Df=2,Li=.1,Ni=.5,Bf=.25,La="#e5e7eb",ln="#d1d5db",ar=.3,Zf=.2,Fi=.1,zi=.4,Uf=.3,Gf="#000000",Qf=["corner","code"];function le(e,t=3){let r=10**t;return Math.round(e*r)/r+0}function x(e,t=3){return String(le(e,t))}function M(e,...t){let r=e[0]??"";for(let n=0;n<t.length;n++){let o=t[n];r+=(typeof o=="number"?x(o):o)+(e[n+1]??"");}return r}var E4={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},R4=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,jf=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function Di(e,t=Number.POSITIVE_INFINITY){if(!R4.test(e))return null;let r=[],n=0,o=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},i=()=>{o(),jf.lastIndex=n;let c=jf.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;n=jf.lastIndex;let f=Number(u);return Number.isFinite(f)?f:null},s=()=>{o();let c=e[n];return c==="0"||c==="1"?(n++,c==="1"?1:0):null},a=()=>(o(),n<e.length&&/[0-9.+-]/.test(e[n]));for(o();n<e.length;){let c=e[n],u=c.toUpperCase(),l=E4[u];if(l===void 0||r.length===0&&u!=="M")return null;if(n++,l===0){r.push({command:c,values:[]}),o();continue}let f=c,p=true;for(;p||a();){let m=[];for(let h=0;h<l;h++){let d=u==="A"&&(h===3||h===4)?s():i();if(d===null)return null;m.push(d);}r.push({command:f,values:m}),u==="M"&&(f=c==="M"?"L":"l"),p=false;}o();}return r}function wb(e){let t=0;for(let{command:r}of e)t+=r.toUpperCase()==="A"?4:1;return t}function Vf(e,t=1,r=0,n=0){let o="";for(let{command:i,values:s}of e){let a=i.toUpperCase(),c=i===a,u=c?r:0,l=c?n:0,f;switch(a){case "Z":f=[];break;case "H":f=[x(s[0]*t+u)];break;case "V":f=[x(s[0]*t+l)];break;case "A":f=[x(Math.abs(s[0])*t),x(Math.abs(s[1])*t),x(s[2]),String(s[3]),String(s[4]),x(s[5]*t+u),x(s[6]*t+l)];break;default:f=s.map((p,m)=>x(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function Na(e,t=.25){let r=[],n=[],o=[0,0],i=[0,0],s=()=>{n.length>2&&r.push(n),n=[];};for(let a of e)if(a.op==="M")s(),o=[a.x,a.y],i=o,n.push(o);else if(a.op==="L")i=[a.x,a.y],n.push(i);else if(a.op==="C"){let c=i,u=[a.x1,a.y1],l=[a.x2,a.y2],f=[a.x,a.y],p=Math.hypot(u[0]-c[0],u[1]-c[1])+Math.hypot(l[0]-u[0],l[1]-u[1])+Math.hypot(f[0]-l[0],f[1]-l[1]),m=Math.max(2,Math.min(64,Math.ceil(Math.sqrt(p/(4*t)))));for(let h=1;h<=m;h++){let d=h/m,g=1-d;n.push([g*g*g*c[0]+3*g*g*d*u[0]+3*g*d*d*l[0]+d*d*d*f[0],g*g*g*c[1]+3*g*g*d*u[1]+3*g*d*d*l[1]+d*d*d*f[1]]);}i=f;}else s(),i=o;return s(),r}function ho(e,t){let r=[o=>o[0]-t.x0,o=>t.x1-o[0],o=>o[1]-t.y0,o=>t.y1-o[1]],n=e;for(let o of r){if(n.length===0)break;let i=n;n=[];for(let s=0;s<i.length;s++){let a=i[s],c=i[(s+i.length-1)%i.length],u=o(a),l=o(c);u>=0?(l<0&&n.push(Sb(c,a,l,u)),n.push(a)):l>=0&&n.push(Sb(c,a,l,u));}}return n.length>2?n:[]}function Sb(e,t,r,n){let o=r/(r-n);return [e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o]}function Cb(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([r,n])=>`${x(r)} ${x(n)}`).join("L")}Z`).join("")}function fn(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(s,a)=>{t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);};for(let s of e)s.op==="C"?(i(s.x1,s.y1),i(s.x2,s.y2),i(s.x,s.y)):s.op!=="Z"&&i(s.x,s.y);return Number.isFinite(t)?{x0:t,y0:r,x1:n,y1:o}:null}var P4={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Eb(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,r)=>{if(r[0]==="#"){let n=r[1].toLowerCase()==="x"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isInteger(n)&&n>0&&n<=1114111&&!(n>=55296&&n<=57343)?String.fromCodePoint(n):t}return P4[r.toLowerCase()]??t})}var k4=60,Hf=62,Wf=47,I4=61,vb=34,Ab=39,Xf=/\s*/y,M4=/[^\s/>]*/y,T4=/[^\s>]*/y,O4=/[^\s=]*/y;function go(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function L4(e,t){let r=e.length,n=w=>{let $=Number.POSITIVE_INFINITY,v=-1;return R=>((R<$||v>=0&&v<R)&&($=R,v=e.indexOf(w,R)),v)},o=n("-->"),i=n("?>"),s=n("]]>"),a=n(">"),c,u=w=>{let $=e.charCodeAt(w);if($!==vb&&$!==Ab)return w+1;let v=e.indexOf(e[w],w+1);return v<0?r:v+1},l=w=>{for(let $=w;$<r&&!c?.[$];$=u($)){let v=e.charCodeAt($);if(v===Hf||v===Wf&&e.charCodeAt($+1)===Hf)return $}c??=new Uint8Array(r);for(let $=w;$<r&&!c[$];$=u($))c[$]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=w=>{let $=w+1;if($<f||$>=p){f=$,p=go(M4,e,$),m=-1;for(let R=p;R>$;R--){let P=e.charCodeAt(R);if((R===p||P===vb||P===Ab)&&(h=l(R),h>=0)){m=R;break}}}if(m<=$)return -1;let v=e.charCodeAt(h)===Wf;return t.open(e.slice($,m),e.slice(m,h),v),h+(v?2:1)},g=-1,_=-1,b=-1,y=w=>{let $=w+2;if($<g||$>=_){g=$,_=go(T4,e,$);let v=go(Xf,e,_);b=_>$&&e.charCodeAt(v)===Hf?v:-1;}return b},S=w=>{if(e.startsWith("<!--",w)){let $=o(w+4);if($>=0)return $+3}if(e.startsWith("<?",w)){let $=i(w+2);if($>=0)return $+2}if(e.startsWith("<![CDATA[",w)){let $=s(w+9);if($>=0)return t.cdata(e.slice(w+9,$)),$+3}if(e.startsWith("<!",w)){let $=a(w+2);if($>=0)return $+1}if(e.charCodeAt(w+1)===Wf){let $=y(w);return $<0?-1:(t.close(),$+1)}return d(w)},C=0;for(;C<r;)if(e.charCodeAt(C)===k4){let w=S(C);C=w<0?C+1:w;}else {let w=e.indexOf("<",C),$=w<0?r:w;t.text(e.slice(C,$)),C=$;}}function N4(e){let t={},r=0;for(;r<e.length;){let n=go(O4,e,r);if(n===r){r++;continue}let o=go(Xf,e,n);if(e.charCodeAt(o)===I4){let i=go(Xf,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(r,n)]=Eb(e.slice(i+1,a)),r=a+1;continue}}r=n;}return t}function Er(e){let t={name:"#root",attrs:{},children:[],text:""},r=[t],n=()=>r.at(-1);L4(e,{open(i,s,a){let c=N4(s),u={name:i,attrs:c,children:[],text:""};n().children.push(u),a||r.push(u);},close(){r.length>1&&r.pop();},text(i){n().text+=Eb(i);},cdata(i){n().text+=i;}});let o=i=>{for(let s of i.children){if(s.name==="svg")return s;let a=o(s);if(a)return a}return null};return o(t)}var _o=[1,0,0,1,0,0];function Ee(e,t){let[r,n,o,i,s,a]=e,[c,u,l,f,p,m]=t;return [r*c+o*u,n*c+i*u,r*l+o*f,n*l+i*f,r*p+o*m+s,n*p+i*m+a]}function ne(e,t,r){return [e[0]*t+e[2]*r+e[4],e[1]*t+e[3]*r+e[5]]}function bo(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Ht(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function Et(e){let t=_o;if(!e)return t;for(let[,r,n]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=Ht(n),i=_o;switch(r){case "matrix":o.length===6&&(i=o);break;case "translate":i=[1,0,0,1,o[0]??0,o[1]??0];break;case "scale":i=[o[0]??1,0,0,o[1]??o[0]??1,0,0];break;case "rotate":{let s=(o[0]??0)*Math.PI/180,a=Math.cos(s),c=Math.sin(s),[u,l]=[o[1]??0,o[2]??0];i=Ee(Ee([1,0,0,1,u,l],[a,c,-c,a,0,0]),[1,0,0,1,-u,-l]);break}case "skewX":i=[1,0,Math.tan((o[0]??0)*Math.PI/180),1,0,0];break;case "skewY":i=[1,Math.tan((o[0]??0)*Math.PI/180),0,1,0,0];break;}t=Ee(t,i);}return t}var qf=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function F4(e,t,r,n,o,i,s,a,c){if(e===a&&t===c)return [];let u=Math.abs(r),l=Math.abs(n);if(u===0||l===0)return [{op:"L",x:a,y:c}];let f=o*Math.PI/180,p=Math.cos(f),m=Math.sin(f),h=(e-a)/2,d=(t-c)/2,g=p*h+m*d,_=-m*h+p*d,b=g*g/(u*u)+_*_/(l*l);b>1&&(u*=Math.sqrt(b),l*=Math.sqrt(b));let y=u*u*l*l-u*u*_*_-l*l*g*g,S=u*u*_*_+l*l*g*g,C=(i===s?-1:1)*Math.sqrt(Math.max(0,y/S)),w=C*u*_/l,$=-C*l*g/u,v=p*w-m*$+(e+a)/2,R=m*w+p*$+(t+c)/2,P=(W,re,G,ce)=>Math.atan2(W*ce-re*G,W*G+re*ce),I=P(1,0,(g-w)/u,(_-$)/l),T=P((g-w)/u,(_-$)/l,(-g-w)/u,(-_-$)/l);!s&&T>0?T-=2*Math.PI:s&&T<0&&(T+=2*Math.PI);let O=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2)-1e-9)),D=T/O,B=4/3*Math.tan(D/4),N=(W,re)=>[v+u*p*W-l*m*re,R+u*m*W+l*p*re],te=[];for(let W=0;W<O;W++){let re=I+W*D,G=re+D,[ce,Ne]=N(Math.cos(re)-B*Math.sin(re),Math.sin(re)+B*Math.cos(re)),[Re,Z]=N(Math.cos(G)+B*Math.sin(G),Math.sin(G)-B*Math.cos(G)),[X,ye]=W===O-1?[a,c]:N(Math.cos(G),Math.sin(G));te.push({op:"C",x1:ce,y1:Ne,x2:Re,y2:Z,x:X,y:ye});}return te}function cr(e){let t=[],r=0,n=0,o=0,i=0,s=0,a="",c=null,u=null,l=()=>{for(;r<e.length&&/[\s,]/.test(e[r]);)r++;},f=()=>{l(),qf.lastIndex=r;let h=qf.exec(e);return h?(r=qf.lastIndex,Number(h[0])):null},p=()=>{l();let h=e[r];return h==="0"||h==="1"?(r++,h==="1"):null},m=h=>{let d=[];for(let g=0;g<h;g++){let _=f();if(_===null)return null;d.push(_);}return d};for(;l(),!(r>=e.length);){let h=e[r];if(/[MmLlHhVvCcSsQqTtAaZz]/.test(h))a=h,r++;else if(!a||a==="Z"||a==="z")break;let d=a===a.toLowerCase(),g=d?n:0,_=d?o:0,b=a.toUpperCase();if(b==="Z"){t.push({op:"Z"}),n=i,o=s,c=null,u=null;continue}if(b==="A"){let w=m(3),$=p(),v=p(),R=m(2);if(!(w&&R)||$===null||v===null)break;let[P,I,T]=w,O=R[0]+g,D=R[1]+_;t.push(...F4(n,o,P,I,T,$,v,O,D)),n=O,o=D,c=null,u=null;continue}let y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[b]??0,S=m(y);if(!S)break;let C=S;switch(b){case "M":n=C[0]+g,o=C[1]+_,i=n,s=o,t.push({op:"M",x:n,y:o}),a=d?"l":"L",c=null,u=null;break;case "L":case "H":case "V":b!=="V"&&(n=C[0]+g),b==="V"?o=C[0]+_:b==="L"&&(o=C[1]+_),t.push({op:"L",x:n,y:o}),c=null,u=null;break;case "C":case "S":{let w,$;b==="C"?(w=[C[0]+g,C[1]+_],$=C.slice(2)):(w=c?[2*n-c[0],2*o-c[1]]:[n,o],$=C);let v=[$[0]+g,$[1]+_],R=[$[2]+g,$[3]+_];t.push({op:"C",x1:w[0],y1:w[1],x2:v[0],y2:v[1],x:R[0],y:R[1]}),[n,o]=R,c=v,u=null;break}case "Q":case "T":{let w,$;b==="Q"?(w=[C[0]+g,C[1]+_],$=[C[2]+g,C[3]+_]):(w=u?[2*n-u[0],2*o-u[1]]:[n,o],$=[C[0]+g,C[1]+_]),t.push({op:"C",x1:n+2/3*(w[0]-n),y1:o+2/3*(w[1]-o),x2:$[0]+2/3*(w[0]-$[0]),y2:$[1]+2/3*(w[1]-$[1]),x:$[0],y:$[1]}),[n,o]=$,u=w,c=null;break}}}return t}var Fa=.5522847498;function Wt(e,t,r,n){if(r<=0||n<=0)return [];let o=r*Fa,i=n*Fa;return [{op:"M",x:e+r,y:t},{op:"C",x1:e+r,y1:t+i,x2:e+o,y2:t+n,x:e,y:t+n},{op:"C",x1:e-o,y1:t+n,x2:e-r,y2:t+i,x:e-r,y:t},{op:"C",x1:e-r,y1:t-i,x2:e-o,y2:t-n,x:e,y:t-n},{op:"C",x1:e+o,y1:t-n,x2:e+r,y2:t-i,x:e+r,y:t},{op:"Z"}]}function qt(e,t,r,n,o=0,i=0){if(r<=0||n<=0)return [];let s=Math.min(Math.max(o,0),r/2),a=Math.min(Math.max(i,0),n/2);if(s===0||a===0)return [{op:"M",x:e,y:t},{op:"L",x:e+r,y:t},{op:"L",x:e+r,y:t+n},{op:"L",x:e,y:t+n},{op:"Z"}];let c=s*Fa,u=a*Fa,l=e+r,f=t+n;return [{op:"M",x:e+s,y:t},{op:"L",x:l-s,y:t},{op:"C",x1:l-s+c,y1:t,x2:l,y2:t+a-u,x:l,y:t+a},{op:"L",x:l,y:f-a},{op:"C",x1:l,y1:f-a+u,x2:l-s+c,y2:f,x:l-s,y:f},{op:"L",x:e+s,y:f},{op:"C",x1:e+s-c,y1:f,x2:e,y2:f-a+u,x:e,y:f-a},{op:"L",x:e,y:t+a},{op:"C",x1:e,y1:t+a-u,x2:e+s-c,y2:t,x:e+s,y:t},{op:"Z"}]}var mn="qrdx.frame",pn=1,dn="custom",J={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:pt},Bi=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],Zi=.95,Pb=200,Ui=["frame","text","accent","background"],z4=/[\t\n\v\f\r\u0085\u2028\u2029]/g,D4=/[\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 yo(e,t=pt){let r=e.slice(0,1e3).normalize("NFC").replace(z4," ").replace(D4,"").replace(/\s+/g," ").trim();return Array.from(r).slice(0,Math.max(0,t)).join("").trim()}function B4(e){for(let t of e)if((t.codePointAt(0)??0)>255)return false;return true}var Rr=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function za(e){let t=xo(e);return {x0:e.qr.x-t,y0:e.qr.y-t,x1:e.qr.x+e.qr.size+t,y1:e.qr.y+e.qr.size+t}}function Z4(e){return {x0:e.qr.x,y0:e.qr.y,x1:e.qr.x+e.qr.size,y1:e.qr.y+e.qr.size}}function xo(e){return e.qr.padding??e.qr.size*J.defaultPadding}var Kf=.52,U4=.35;function G4(e){let t=e.fontSize??e.box.height*Kf;return Math.min(t*Ar,e.box.height*Zi)}var Yf=(e,t)=>Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0)>1e-6&&Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)>1e-6;function Rb(e){let t=za(e),r=Math.min(e.qr.radius??0,(t.x1-t.x0)/2,(t.y1-t.y0)/2),n=[[t.x0+r,t.y0+r,Math.PI],[t.x1-r,t.y0+r,-Math.PI/2],[t.x1-r,t.y1-r,0],[t.x0+r,t.y1-r,Math.PI/2]],o=[];for(let[i,s,a]of n)for(let c=0;c<=8;c++){let u=a+Math.PI/2*(c/8);o.push([i+r*Math.cos(u),s+r*Math.sin(u)]);}return o}function Q4([e,t],r,n){if(e<r.x-.01||t<r.y-.01||e>r.x+r.width+.01||t>r.y+r.height+.01)return false;let i=Math.min(n,r.width/2,r.height/2),s=Math.min(Math.max(e,r.x+i),r.x+r.width-i),a=Math.min(Math.max(t,r.y+i),r.y+r.height-i);return Math.hypot(e-s,t-a)<=i+.01}function j4(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),Math.abs(t)/2}function V4(e,t,r){let n=za(t);if(!Yf(r,n))return false;if("stroke"in e&&e.stroke)return true;if(e.fill==="background")return false;if(e.type==="rect"&&e.hole){let{hole:o}=e;return !Rb(t).every(i=>Q4(i,o,o.radius??0))}if(e.type==="circle"&&e.hole){let o=e.hole;return !Rb(t).every(([i,s])=>Math.hypot(i-e.cx,s-e.cy)<=o+.01)}if(e.type==="polygon"){let o=ho(e.points,n);return o.length>2&&j4(o)>1e-6}return true}function Jf(e){let t=H4(e),r="stroke"in e?e.stroke:void 0;if(!(r&&t.bounds))return t;let n=e.type==="circle"||e.type==="ellipse"?r.width/2:e.type==="rect"?r.width*Math.SQRT2/2:r.width*2,{x0:o,y0:i,x1:s,y1:a}=t.bounds;return {bounds:{x0:o-n,y0:i-n,x1:s+n,y1:a+n},segments:t.segments*2}}function H4(e){switch(e.type){case "rect":return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height},segments:e.hole?18:9};case "circle":return {bounds:{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r},segments:e.hole?10:5};case "ellipse":return {bounds:{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry},segments:5};case "polygon":{let t=e.points.map(([n])=>n),r=e.points.map(([,n])=>n);return {bounds:{x0:Math.min(...t),y0:Math.min(...r),x1:Math.max(...t),y1:Math.max(...r)},segments:e.points.length}}case "path":{let t=Di(e.d,J.maxDecimals);return t?{bounds:fn(cr(e.d)),segments:wb(t)}:{bounds:null,segments:0}}case "line":{let t=e.width/2,r=Math.hypot(e.x2-e.x1,e.y2-e.y1),n=e.dash?Math.ceil(r/(e.dash[0]+e.dash[1])):1;return {bounds:{x0:Math.min(e.x1,e.x2)-t,y0:Math.min(e.y1,e.y2)-t,x1:Math.max(e.x1,e.x2)+t,y1:Math.max(e.y1,e.y2)+t},segments:n*(e.cap==="round"?4:5)}}default:return {bounds:{x0:e.x,y0:e.y,x1:e.x+e.size,y1:e.y+e.size},segments:Pb}}}function Da(e,t){let r=J,n=new TextEncoder().encode(JSON.stringify(e)).length;if(n>r.maxBytes){t(`The spec is ${n} bytes; the limit is ${r.maxBytes}`);return}let{width:o,height:i}=e.artboard,s=Math.max(o,i)*.005,a={x0:-s,y0:-s,x1:o+s,y1:i+s},c=_=>_.x0>=a.x0&&_.y0>=a.y0&&_.x1<=a.x1&&_.y1<=a.y1,{qr:u}=e,l=xo(e);u.plate!=="none"&&l<u.size*r.minPadding-1e-9&&t(`qr.padding must be at least ${r.minPadding*100}% of qr.size`,["qr","padding"]),u.size<Math.min(o,i)*r.minQrShare-1e-9&&t(`qr.size must be at least ${r.minQrShare*100}% of the artboard's shorter side`,["qr","size"]);let f=za(e);(f.x0<-1e-9||f.y0<-1e-9||f.x1>o+1e-9||f.y1>i+1e-9)&&t("The code and its padding must sit inside the artboard",["qr"]),(u.radius??0)>(u.size+2*l)/2&&t("qr.radius is larger than half the plate",["qr","radius"]);let p=0,m=0;e.shapes.forEach((_,b)=>{let y=["shapes",b],{bounds:S,segments:C}=Jf(_);if(!S){t("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(c(S)||t("The shape extends outside the artboard",y),_.type==="rect"&&_.hole){let{hole:w}=_;(w.x<_.x||w.y<_.y||w.x+w.width>_.x+_.width+1e-9||w.y+w.height>_.y+_.height+1e-9)&&t("The hole must sit inside its rect",[...y,"hole"]);}_.type==="circle"&&_.hole&&_.hole>=_.r&&t("The hole must be smaller than the circle",[...y,"hole"]),"stroke"in _&&_.stroke&&_.stroke.width>Math.min(o,i)*.1+1e-9&&t("A stroke may be at most 10% of the artboard's shorter side",[...y,"stroke","width"]),u.plate==="background"&&V4(_,e,S)&&t('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',y),p+=C,typeof _.fill=="object"&&"gradient"in _.fill&&(m+=(_.fill.gradient.steps??32)*C);}),p>r.maxSegments&&t(`The shapes have ${p} segments; the limit is ${r.maxSegments}`,["shapes"]),m>r.maxGradientWork&&t("Gradient fills are too detailed (fewer steps or simpler shapes)",["shapes"]);let h=[],d=new Set,g=new Set;e.labels.forEach((_,b)=>{let y=["labels",b];d.has(_.id)&&t(`Label id "${_.id}" is used twice`,[...y,"id"]),d.add(_.id),_.slot!=="fixed"&&(g.has(_.slot)&&t(`Only one label may use the ${_.slot} slot`,[...y,"slot"]),g.add(_.slot));let S=_.maxLength??r.maxTextLength;_.text!==yo(_.text,S)&&t(`Label text must be at most ${S} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...y,"text"]);let C;if(_.type==="text"){C={x0:_.box.x,y0:_.box.y,x1:_.box.x+_.box.width,y1:_.box.y+_.box.height},_.fontSize!==void 0&&_.fontSize>_.box.height*Zi+1e-9&&t("fontSize may be at most 95% of the label's row height",[...y,"fontSize"]);let w=_.box.y+_.box.height/2,$=G4(_)*U4,v={x0:C.x0,x1:C.x1,y0:w-$,y1:w+$};(Yf(C,Z4(e))||Yf(v,f))&&t("The label overlaps the code or its padding",[...y,"box"]);}else {let{cx:w,cy:$,radius:v}=_.curve,R=_.fontSize*Ar*.6;C={x0:w-v-R,y0:$-v-R,x1:w+v+R,y1:$+v+R};let P=Math.hypot(Math.max(f.x0-w,0,w-f.x1),Math.max(f.y0-$,0,$-f.y1));Math.hypot(Math.max(Math.abs(f.x0-w),Math.abs(f.x1-w)),Math.max(Math.abs(f.y0-$),Math.abs(f.y1-$)))<=v-R||P>=v+R||t("The curved label crosses the code or its padding",[...y,"curve"]);}if(c(C)||t("The label extends outside the artboard",y),_.collapse){let w=_.collapse,$=w.y+w.height;(w.y<-1e-9||$>i+1e-9)&&t("The collapse band must sit inside the artboard",[...y,"collapse"]),$>f.y0+1e-6&&w.y<f.y1-1e-6&&t("The collapse band crosses the code or its padding",[...y,"collapse"]);for(let v of h)$>v.y+1e-6&&w.y<v.y+v.height-1e-6&&t("Collapse bands may not overlap",[...y,"collapse"]);h.push(w);}});}var A={};vr(A,{$brand:()=>dm,$input:()=>Bd,$output:()=>Dd,INVALID:()=>at,NEVER:()=>pm,TimePrecision:()=>Kd,ZodAny:()=>D0,ZodArray:()=>G0,ZodBase64:()=>Lu,ZodBase64URL:()=>Nu,ZodBigInt:()=>ni,ZodBigIntFormat:()=>Du,ZodBoolean:()=>ri,ZodCIDRv4:()=>Tu,ZodCIDRv6:()=>Ou,ZodCUID:()=>Au,ZodCUID2:()=>Eu,ZodCatch:()=>lg,ZodCodec:()=>Ls,ZodCompileAsyncError:()=>zt,ZodCompileUnsupportedError:()=>ee,ZodCreditCard:()=>I0,ZodCustom:()=>Ns,ZodCustomStringFormat:()=>In,ZodDate:()=>Ps,ZodDefault:()=>og,ZodDiscriminatedUnion:()=>j0,ZodE164:()=>Fu,ZodEmail:()=>wu,ZodEmoji:()=>Cu,ZodEnum:()=>Jo,ZodError:()=>s8,ZodExactOptional:()=>Gu,ZodFile:()=>eg,ZodFirstPartyTypeKind:()=>Cg,ZodFunction:()=>xg,ZodGUID:()=>Su,ZodIBAN:()=>M0,ZodIPv4:()=>Iu,ZodIPv6:()=>Mu,ZodISODate:()=>Dr,ZodISODateTime:()=>zr,ZodISODuration:()=>Zr,ZodISOTime:()=>Br,ZodInstanceOf:()=>Sg,ZodIntersection:()=>V0,ZodIssueCode:()=>u8,ZodJWT:()=>zu,ZodKSUID:()=>ku,ZodLazy:()=>_g,ZodLiteral:()=>J0,ZodMAC:()=>k0,ZodMap:()=>Y0,ZodNaN:()=>mg,ZodNanoID:()=>vu,ZodNever:()=>Z0,ZodNonOptional:()=>Qu,ZodNull:()=>F0,ZodNullable:()=>ng,ZodNumber:()=>ti,ZodNumberFormat:()=>Mn,ZodObject:()=>Is,ZodOptional:()=>Ts,ZodPipe:()=>Os,ZodPrefault:()=>sg,ZodPreprocess:()=>pg,ZodPromise:()=>yg,ZodReadonly:()=>dg,ZodRealError:()=>bt,ZodRecord:()=>Ko,ZodSet:()=>K0,ZodString:()=>ei,ZodStringFormat:()=>_e,ZodSuccess:()=>ug,ZodSymbol:()=>L0,ZodTemplateLiteral:()=>gg,ZodTransform:()=>tg,ZodTuple:()=>W0,ZodType:()=>q,ZodULID:()=>Ru,ZodURL:()=>Rs,ZodUUID:()=>Jt,ZodUndefined:()=>N0,ZodUnion:()=>Ms,ZodUnknown:()=>B0,ZodVoid:()=>U0,ZodXID:()=>Pu,ZodXor:()=>Q0,_ZodString:()=>$u,_default:()=>ig,_function:()=>ex,any:()=>I2,array:()=>ks,base64:()=>f2,base64url:()=>m2,bigint:()=>A2,boolean:()=>O0,catch:()=>fg,check:()=>tx,cidrv4:()=>u2,cidrv6:()=>l2,clone:()=>pe,codec:()=>X2,coerce:()=>Ag,compile:()=>Qd,config:()=>Oe,core:()=>pr,creditCard:()=>d2,cuid:()=>t2,cuid2:()=>r2,currencyCode:()=>x2,custom:()=>rx,date:()=>T2,decode:()=>S0,decodeAsync:()=>v0,deepPartial:()=>hx,describe:()=>nx,discriminatedUnion:()=>D2,e164:()=>p2,email:()=>jy,emoji:()=>Jy,encode:()=>w0,encodeAsync:()=>C0,endsWith:()=>Zo,enum:()=>Zu,exactOptional:()=>rg,file:()=>V2,flattenError:()=>Ji,float32:()=>w2,float64:()=>S2,formatError:()=>es,fromJSONSchema:()=>px,function:()=>ex,getDiscriminatedOption:()=>pd,getErrorMap:()=>f8,globalRegistry:()=>Xe,gt:()=>Yt,gte:()=>St,guid:()=>Vy,hash:()=>$2,hex:()=>y2,hostname:()=>b2,httpUrl:()=>Ky,iban:()=>h2,includes:()=>Do,input:()=>_x,instanceof:()=>ix,int:()=>yu,int32:()=>C2,int64:()=>E2,intersection:()=>H0,invertCodec:()=>Y2,ipv4:()=>s2,ipv6:()=>c2,iso:()=>Fs,json:()=>ax,jwt:()=>g2,keyof:()=>O2,ksuid:()=>i2,lazy:()=>bg,length:()=>An,literal:()=>j2,locales:()=>Oc,looseObject:()=>F2,looseRecord:()=>Z2,lowercase:()=>Fo,lt:()=>Xt,lte:()=>wt,mac:()=>a2,map:()=>U2,maxLength:()=>vn,maxSize:()=>Or,memoizer:()=>bs,meta:()=>ox,mime:()=>Go,minLength:()=>mr,minSize:()=>Kt,multipleOf:()=>Tr,nan:()=>q2,nanoid:()=>e2,nativeEnum:()=>Q2,negative:()=>cu,never:()=>Bu,nonnegative:()=>lu,nonoptional:()=>cg,nonpositive:()=>uu,normalize:()=>Qo,null:()=>z0,nullable:()=>Es,nullish:()=>H2,number:()=>T0,object:()=>L2,optional:()=>Pn,output:()=>bx,overwrite:()=>Dt,parse:()=>b0,parseAsync:()=>y0,partialRecord:()=>B2,pipe:()=>xu,positive:()=>au,prefault:()=>ag,preprocess:()=>cx,prettifyError:()=>ym,promise:()=>J2,properties:()=>Uo,property:()=>fu,readonly:()=>hg,record:()=>X0,refine:()=>$g,regex:()=>No,regexes:()=>kt,registry:()=>Nc,safeDecode:()=>E0,safeDecodeAsync:()=>P0,safeEncode:()=>A0,safeEncodeAsync:()=>R0,safeParse:()=>x0,safeParseAsync:()=>$0,set:()=>G2,setErrorMap:()=>l8,size:()=>Cn,slugify:()=>Wo,startsWith:()=>Bo,strictObject:()=>N2,string:()=>As,stringFormat:()=>_2,stringbool:()=>sx,success:()=>W2,superRefine:()=>wg,symbol:()=>P2,templateLiteral:()=>K2,toJSONSchema:()=>hu,toLowerCase:()=>Vo,toUpperCase:()=>Ho,toZod:()=>Gi,transform:()=>Uu,treeifyError:()=>bm,trim:()=>jo,tuple:()=>q0,uint32:()=>v2,uint64:()=>R2,ulid:()=>n2,undefined:()=>k2,union:()=>oi,unknown:()=>Rn,uppercase:()=>zo,url:()=>Yy,util:()=>z,uuid:()=>Hy,uuidv4:()=>Wy,uuidv6:()=>qy,uuidv7:()=>Xy,validate:()=>ts,validateAsync:()=>rs,void:()=>M2,withParser:()=>Fc,xid:()=>o2,xor:()=>z2});var pr={};vr(pr,{$ZodAny:()=>od,$ZodArray:()=>ld,$ZodAsyncError:()=>gt,$ZodBase64:()=>Vp,$ZodBase64URL:()=>Hp,$ZodBigInt:()=>Cc,$ZodBigIntFormat:()=>ed,$ZodBoolean:()=>ms,$ZodCIDRv4:()=>Qp,$ZodCIDRv6:()=>jp,$ZodCUID:()=>Mp,$ZodCUID2:()=>Tp,$ZodCatch:()=>Pd,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>ip,$ZodCheckEndsWith:()=>_p,$ZodCheckGreaterThan:()=>cc,$ZodCheckIncludes:()=>hp,$ZodCheckLengthEquals:()=>fp,$ZodCheckLessThan:()=>ac,$ZodCheckLowerCase:()=>pp,$ZodCheckMaxLength:()=>up,$ZodCheckMaxSize:()=>sp,$ZodCheckMimeType:()=>xp,$ZodCheckMinLength:()=>lp,$ZodCheckMinSize:()=>ap,$ZodCheckMultipleOf:()=>np,$ZodCheckNumberFormat:()=>op,$ZodCheckOverwrite:()=>$p,$ZodCheckProperties:()=>yp,$ZodCheckProperty:()=>bp,$ZodCheckRegex:()=>mp,$ZodCheckSizeEquals:()=>cp,$ZodCheckStartsWith:()=>gp,$ZodCheckStringFormat:()=>Mo,$ZodCheckUpperCase:()=>dp,$ZodCodec:()=>ds,$ZodCreditCard:()=>qp,$ZodCustom:()=>Nd,$ZodCustomStringFormat:()=>Kp,$ZodCyclicError:()=>Ic,$ZodDate:()=>cd,$ZodDefault:()=>vd,$ZodDiscriminatedUnion:()=>dd,$ZodE164:()=>Wp,$ZodEmail:()=>Ap,$ZodEmoji:()=>kp,$ZodEncodeError:()=>Ir,$ZodEnum:()=>yd,$ZodError:()=>_m,$ZodExactOptional:()=>Sd,$ZodFile:()=>$d,$ZodFunction:()=>Od,$ZodGUID:()=>Cp,$ZodIBAN:()=>Xp,$ZodIPv4:()=>Zp,$ZodIPv6:()=>Up,$ZodISODate:()=>zp,$ZodISODateTime:()=>Fp,$ZodISODuration:()=>Bp,$ZodISOTime:()=>Dp,$ZodIntersection:()=>hd,$ZodJWT:()=>Yp,$ZodKSUID:()=>Np,$ZodLazy:()=>hs,$ZodLiteral:()=>xd,$ZodMAC:()=>Gp,$ZodMap:()=>_d,$ZodNaN:()=>kd,$ZodNanoID:()=>Ip,$ZodNever:()=>sd,$ZodNonOptional:()=>Ed,$ZodNull:()=>nd,$ZodNullable:()=>Cd,$ZodNumber:()=>Sc,$ZodNumberFormat:()=>Jp,$ZodObject:()=>ly,$ZodObjectJIT:()=>fd,$ZodOptional:()=>Ac,$ZodPipe:()=>Ec,$ZodPrefault:()=>Ad,$ZodPreprocess:()=>Id,$ZodPromise:()=>Ld,$ZodReadonly:()=>Md,$ZodRealError:()=>_t,$ZodRecord:()=>gd,$ZodRegistry:()=>Lc,$ZodSet:()=>bd,$ZodString:()=>xn,$ZodStringFormat:()=>de,$ZodSuccess:()=>Rd,$ZodSymbol:()=>td,$ZodTemplateLiteral:()=>Td,$ZodTransform:()=>wd,$ZodTuple:()=>vc,$ZodType:()=>V,$ZodULID:()=>Op,$ZodURL:()=>Pp,$ZodUUID:()=>vp,$ZodUndefined:()=>rd,$ZodUnion:()=>ps,$ZodUnknown:()=>id,$ZodVoid:()=>ad,$ZodXID:()=>Lp,$ZodXor:()=>md,$brand:()=>dm,$constructor:()=>E,$input:()=>Bd,$output:()=>Dd,Doc:()=>yn,INVALID:()=>at,JSONSchema:()=>Zy,JSONSchemaGenerator:()=>gu,NEVER:()=>pm,TimePrecision:()=>Kd,URL_BAD_FORMAT:()=>Ep,URL_UNPARSEABLE:()=>as,ZodCompileAsyncError:()=>zt,ZodCompileUnsupportedError:()=>ee,_any:()=>hh,_array:()=>wh,_base64:()=>nu,_base64url:()=>ou,_bigint:()=>ch,_boolean:()=>sh,_catch:()=>HC,_check:()=>vy,_cidrv4:()=>tu,_cidrv6:()=>ru,_coercedBigint:()=>uh,_coercedBoolean:()=>ah,_coercedDate:()=>xh,_coercedNumber:()=>eh,_coercedString:()=>Wd,_creditCard:()=>Xd,_cuid:()=>Wc,_cuid2:()=>qc,_custom:()=>Ch,_date:()=>yh,_decode:()=>Xa,_decodeAsync:()=>Ka,_default:()=>QC,_discriminatedUnion:()=>MC,_e164:()=>iu,_email:()=>Bc,_emoji:()=>Vc,_encode:()=>qa,_encodeAsync:()=>Ya,_endsWith:()=>Zo,_enum:()=>zC,_file:()=>Sh,_float32:()=>rh,_float64:()=>nh,_gt:()=>Yt,_gte:()=>St,_guid:()=>Zc,_iban:()=>Yd,_includes:()=>Do,_int:()=>th,_int32:()=>oh,_int64:()=>lh,_intersection:()=>TC,_ipv4:()=>Jc,_ipv6:()=>eu,_isoDate:()=>$s,_isoDateTime:()=>xs,_isoDuration:()=>Ss,_isoTime:()=>ws,_jwt:()=>su,_ksuid:()=>Kc,_lazy:()=>YC,_length:()=>An,_literal:()=>BC,_lowercase:()=>Fo,_lt:()=>Xt,_lte:()=>wt,_mac:()=>qd,_map:()=>NC,_max:()=>wt,_maxLength:()=>vn,_maxSize:()=>Or,_mime:()=>Go,_min:()=>St,_minLength:()=>mr,_minSize:()=>Kt,_multipleOf:()=>Tr,_nan:()=>$h,_nanoid:()=>Hc,_nativeEnum:()=>DC,_negative:()=>cu,_never:()=>_h,_nonnegative:()=>lu,_nonoptional:()=>jC,_nonpositive:()=>uu,_normalize:()=>Qo,_null:()=>dh,_nullable:()=>GC,_number:()=>Jd,_optional:()=>UC,_overwrite:()=>Dt,_parse:()=>Ro,_parseAsync:()=>Po,_pipe:()=>WC,_positive:()=>au,_promise:()=>KC,_properties:()=>Uo,_property:()=>fu,_readonly:()=>qC,_record:()=>LC,_refine:()=>vh,_regex:()=>No,_safeDecode:()=>ec,_safeDecodeAsync:()=>rc,_safeEncode:()=>Ja,_safeEncodeAsync:()=>tc,_safeParse:()=>ko,_safeParseAsync:()=>Io,_set:()=>FC,_size:()=>Cn,_slugify:()=>Wo,_startsWith:()=>Bo,_string:()=>Hd,_stringFormat:()=>En,_stringbool:()=>Ph,_success:()=>VC,_superRefine:()=>Ah,_symbol:()=>mh,_templateLiteral:()=>XC,_toLowerCase:()=>Vo,_toUpperCase:()=>Ho,_transform:()=>ZC,_trim:()=>jo,_tuple:()=>OC,_uint32:()=>ih,_uint64:()=>fh,_ulid:()=>Xc,_undefined:()=>ph,_union:()=>kC,_unknown:()=>gh,_uppercase:()=>zo,_url:()=>ys,_uuid:()=>Uc,_uuidv4:()=>Gc,_uuidv6:()=>Qc,_uuidv7:()=>jc,_void:()=>bh,_xid:()=>Yc,_xor:()=>IC,base64Charset:()=>bc,base64urlCharset:()=>fs,canParseURL:()=>Rp,clone:()=>pe,compile:()=>Qd,compileFn:()=>zc,config:()=>Oe,createStandardJSONSchemaMethod:()=>qo,createToJSONSchemaMethod:()=>Ih,decode:()=>z3,decodeAsync:()=>B3,describe:()=>Eh,encode:()=>F3,encodeAsync:()=>D3,extractDefs:()=>Nr,finalize:()=>Fr,flattenError:()=>Ji,formatError:()=>es,getDiscriminatedOption:()=>pd,globalConfig:()=>He,globalRegistry:()=>Xe,handleUnrepresentable:()=>Ze,initializeContext:()=>Lr,isBackEdge:()=>Tc,isRecursiveSchema:()=>Mc,isValidBase64:()=>ls,isValidBase64URL:()=>yc,isValidCIDRv6:()=>_c,isValidCreditCard:()=>xc,isValidIBAN:()=>$c,isValidIPv6:()=>us,isValidJWT:()=>wc,locales:()=>Oc,memoizer:()=>bs,mergeValues:()=>To,meta:()=>Rh,parse:()=>Ha,parseAsync:()=>Wa,parseURLObject:()=>ay,prettifyError:()=>ym,process:()=>he,processSchema:()=>he,regexes:()=>kt,registry:()=>Nc,safeDecode:()=>U3,safeDecodeAsync:()=>Q3,safeEncode:()=>Z3,safeEncodeAsync:()=>G3,safeParse:()=>M3,safeParseAsync:()=>T3,standardProps:()=>pc,stripTabAndNewline:()=>cs,toDotPath:()=>Bb,toJSONSchema:()=>hu,toZod:()=>Gi,treeifyError:()=>bm,urlHostnameOk:()=>hc,urlProtocolOk:()=>gc,util:()=>z,validate:()=>ts,validateAsync:()=>rs,validateURL:()=>dc,version:()=>wp,withParser:()=>Fc});var z={};vr(z,{BIGINT_FORMAT_RANGES:()=>Wi,CONSTANT_CATCH:()=>ja,Class:()=>rm,NUMBER_FORMAT_RANGES:()=>Hi,aborted:()=>st,allowsEval:()=>im,assert:()=>K4,assertEqual:()=>W4,assertIs:()=>X4,assertNever:()=>Y4,assertNotEqual:()=>q4,assignProp:()=>qe,attachSchema:()=>qi,base64ToUint8Array:()=>Ob,base64urlToUint8Array:()=>_3,cached:()=>Co,captureStackTrace:()=>Ua,cleanEnum:()=>g3,cleanRegex:()=>lr,clone:()=>pe,cloneDef:()=>t3,codePointLength:()=>_n,constantCatch:()=>fm,createTransparentProxy:()=>a3,defineLazy:()=>nm,defineLazyInternal:()=>K,derived:()=>$3,esc:()=>it,escapeRegex:()=>Pt,explicitlyAborted:()=>cm,extend:()=>l3,finalizeIssue:()=>ht,floatSafeRemainder:()=>Qi,getElementAtPath:()=>r3,getEnumValues:()=>wo,getLengthableOrigin:()=>Yi,getParsedType:()=>s3,getSizableOrigin:()=>Xi,hexToUint8Array:()=>y3,hide:()=>Ki,installLazyProp:()=>v3,isObject:()=>gn,isPlainObject:()=>Rt,issue:()=>Eo,joinValues:()=>Ba,jsonStringifyReplacer:()=>So,members:()=>lm,merge:()=>m3,mergeDefs:()=>Ft,normalizeParams:()=>L,nullish:()=>Za,numKeys:()=>i3,objectClone:()=>J4,omit:()=>u3,optionalKeys:()=>am,own:()=>kr,parsedType:()=>um,partial:()=>p3,pick:()=>c3,prefixIssues:()=>dt,primitiveTypes:()=>sm,promiseAllObject:()=>n3,propertyKeyTypes:()=>Vi,randomString:()=>o3,rawShape:()=>vo,required:()=>d3,safeExtend:()=>f3,shallowClone:()=>ji,sizeCaps:()=>Ao,slugify:()=>om,stringifyPrimitive:()=>Ga,toZod:()=>Gi,uint8ArrayToBase64:()=>Lb,uint8ArrayToBase64url:()=>b3,uint8ArrayToHex:()=>x3,unwrapMessage:()=>$o});function W4(e){return e}function q4(e){return e}function Gi(){return e=>e}function X4(e){}function Y4(e){throw new Error("Unexpected value in exhaustive check")}function K4(e){}function wo(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ba(e,t="|"){return e.map(r=>Ga(r)).join(t)}function So(e,t){return typeof t=="bigint"?t.toString():t}var tm=class{constructor(t){this._getter=t,this._value=void 0;}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Co(e){return new tm(e)}function Za(e){return e==null}function lr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Qi(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var kb=Symbol("evaluating");function nm(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==kb)return n===void 0&&(n=kb,n=r()),n},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function J4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function qe(e,t,r){Object.defineProperty(e,t,{value:r,writable:true,enumerable:true,configurable:true});}function vo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function ur(e){return vo(e._zod.def)??e._zod.def.shape}function Ib(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return qe(this,t,n),n},enumerable:true,configurable:true});}function Mb(e,t,r){t in e?qe(e,t,r):e[t]=r;}function hn(e,t,r,n){let o=ur(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?Ib(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):Mb(e,i,n?n(s.value,i):s.value));}}function e3(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Ib(e,r,()=>t[r]):Mb(e,r,n.value));}}function Ft(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n);}return Object.defineProperties({},t)}function t3(e){return Ft(e._zod.def)}function r3(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function n3(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function o3(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function it(e){return JSON.stringify(e)}function om(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ua="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var im=Co(()=>{if(He.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function Rt(e){if(gn(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let r=t.prototype;return !(gn(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function ji(e){return Rt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function i3(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var s3=e=>{let t=typeof e;switch(t){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(e)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Vi=new Set(["string","number","symbol"]),sm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pe(e,t,r){let n=new e._zod.constr(t??e._zod.def);return (!t||r?.parent)&&(n._zod.parent=e),n}function L(e){let t=e;if(!t)return {};if(typeof t=="string")return {error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message;}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function a3(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Ga(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function am(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Hi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Wi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function c3(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return hn(i,e,Qa(e,t)),pe(e,Ft(r,{shape:i,checks:[]}))}function Qa(e,t){let r=ur(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o);}return n}function u3(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Qa(e,t)),s={};return hn(s,e,Reflect.ownKeys(ur(e)).filter(a=>!i.has(a))),pe(e,Ft(r,{shape:s,checks:[]}))}function l3(e,t){if(!Rt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=ur(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pe(e,Ft(e._zod.def,{shape:Tb(e,t)}))}function Tb(e,t){let r={};return hn(r,e,Reflect.ownKeys(ur(e))),e3(r,t),r}function f3(e,t){if(!Rt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return pe(e,Ft(e._zod.def,{shape:Tb(e,t)}))}function m3(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};hn(r,e,Reflect.ownKeys(ur(e))),hn(r,t,Reflect.ownKeys(ur(t)));let n=Ft(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return pe(e,n)}function p3(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Qa(t,r)):void 0,c={};return hn(c,t,Reflect.ownKeys(ur(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),pe(t,Ft(t._zod.def,{shape:c,checks:[]}))}function d3(e,t,r){let n=r?new Set(Qa(t,r)):void 0,o={};return hn(o,t,Reflect.ownKeys(ur(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),pe(t,Ft(t._zod.def,{shape:o}))}function st(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==true)return true;return false}function cm(e,t=0){if(e.aborted===true)return true;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===false)return true;return false}function dt(e,t){return t.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(e),r})}function $o(e){return typeof e=="string"?e:e?.message}function Ao(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r]);}return t}function qi(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r);}function ht(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:$o(e.inst?._zod.def?.error?.(e))??$o(i?.(e))??$o(t?.error?.(e))??$o(r.customError?.(e))??$o(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function Xi(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var h3=/[\uD800-\uDBFF]/;function _n(e){let t=e.length;if(!h3.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Yi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function um(e){let t=typeof e;switch(t){case "number":return Number.isNaN(e)?"nan":"number";case "object":{if(e===null)return "null";if(Array.isArray(e))return "array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Eo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function g3(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ob(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Lb(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function _3(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ob(t+r)}function b3(e){return Lb(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function y3(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function x3(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var rm=class{constructor(...t){}};function lm(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:false}):w3(e,r,n.value);}}function kr(e,t,r,n=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:n,value:r}),r}function Ki(e,t,r){return kr(e,t,r,false)}function $3(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:true,enumerable:true,get(){return kr(this,r,n(this))},set(o){kr(this,r,o);}});}return t}function w3(e,t,r){Object.defineProperty(e,t,{configurable:true,get(){return this==null?r:kr(this,t,r.bind(this))},set(n){kr(this,t,n);}});}function S3(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var em,Pr=false,C3={configurable:true,get(){Pr=true;}};function K(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&em!==e._zod){em=void 0;return}em=e._zod,Object.defineProperty(n,t,{configurable:true,get(){Object.defineProperty(this,t,C3);let o=Pr;Pr=false;try{let i=r(this);return Pr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Pr=Pr||o,i}catch(i){throw delete this[t],Pr=Pr||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function v3(e,t,r,n){let o=S3(e,t);o&&Object.defineProperty(o,t,{configurable:true,get(){let i={configurable:true,writable:true,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:true,writable:true,enumerable:n,value:i});}});}var ja="~constantCatch";function fm(e){let t=()=>e;return t[ja]=true,t}var Nb,pm=Object.freeze({status:"aborted"}),mm={value:void 0,enumerable:false},Fb="captureStackTrace"in Error?Error:null;function A3(e){let t=Fb;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0;}catch{return Fb=null,new e}try{return new e}finally{t.stackTraceLimit=r;}}}return new e}function E(e,t,r,n){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set;}i.prototype=o;let s=r,a=s&&new WeakSet;function c(p,m){if(p._zod){if(p._zod.traits.has(e))return}else {mm.value=new i(m);try{Object.defineProperty(p,"_zod",mm);}finally{mm.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,_=d;for(;_&&_!==g;)_=Object.getPrototypeOf(_);let b=_??d;a.has(b)||(a.add(b),lm(b,s));}let h=f.prototype;for(let d in h)Object.prototype.hasOwnProperty.call(h,d)&&(d in p||(p[d]=h[d].bind(p)));}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(p){let m=n?.Parent?A3(l):this;c(m,p);let h=m._zod.deferred;if(h){for(let g of h)g();m._zod.deferred=void 0;}let d=globalThis.__zod_globalConfig?.postProcessor;return d&&d(m),m}return Object.defineProperty(f,"init",{value:c}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?true:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var dm=Symbol("zod_brand"),gt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Ir=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(Nb=globalThis).__zod_globalConfig??(Nb.__zod_globalConfig={});var He=globalThis.__zod_globalConfig;function Oe(e){return e&&Object.assign(He,e),He}function E3(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,So,2)),e.message}function R3(e){this._zod.message=e;}var P3={get:E3,set:R3,enumerable:true,configurable:true},gm={value:void 0,enumerable:false},zb=new WeakSet([Object.prototype,Error.prototype]),Db=(e,t)=>{e.name="$ZodError",gm.value=t,Object.defineProperty(e,"issues",gm),gm.value=void 0,Object.defineProperty(e,"message",P3);let r=Object.getPrototypeOf(e);zb.has(r)||(zb.add(r),Object.defineProperty(r,"toString",{configurable:true,enumerable:false,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:true,writable:true});}}));},_m=E("$ZodError",Db),_t=E("$ZodError",Db,void 0,{Parent:Error});function k3(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:true,enumerable:true,configurable:true}):e[t]=r()),e[t]}function Ji(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?k3(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return {formErrors:n,fieldErrors:r}}function es(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else {let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else {let c=r,u=0;for(;u<a.length;){let l=a[u],f=u===a.length-1;if(l==="_errors"){f&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:true,writable:true,configurable:true});let p=c[l];f&&p._errors.push(t(s)),c=p,u++;}}}};return n(e),r}function bm(e,t=r=>r.message){let r={errors:[]},n=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>n({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else {let c=[...i,...a.path];if(c.length===0){r.errors.push(t(a));continue}let u=r,l=0;for(;l<c.length;){let f=c[l],p=l===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,f)||Object.defineProperty(u.properties,f,{value:{errors:[]},enumerable:true,writable:true,configurable:true}),u=u.properties[f]):(u.items??(u.items=[]),(s=u.items)[f]??(s[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(t(a)),l++;}}};return n(e),r}function Bb(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function ym(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${Bb(n.path)}`);return t.join(`
2
+ `)}function Va(e,t){return {callee:t?.callee??e,Err:t?.Err}}var Ro=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:false}:{async:false},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new gt;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>ht(u,s,Oe())));throw Ua(c,i?.callee??t),c}return a.value};return t},Ha=Ro(_t),Po=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:true}:{async:true},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>ht(u,s,Oe())));throw Ua(c,i?.callee??t),c}return a.value};return t},Wa=Po(_t),ko=e=>(t,r,n)=>{let o=n?{...n,async:false}:{async:false},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new gt;return i.issues.length?Zb(e,i.issues,o):{success:true,data:i.value}},M3=ko(_t);function Zb(e,t,r){let n;return {success:false,get error(){return n||(n=new e(t.map(o=>ht(o,r,Oe()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0;}}}var Io=e=>async(t,r,n)=>{let o=n?{...n,async:true}:{async:true},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Zb(e,i.issues,o):{success:true,data:i.value}},T3=Io(_t),O3=Symbol.for("zod.compile.invalid"),L3=Symbol.for("zod.compile.fallback"),ts=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==O3)return true;if(n.definite===true&&r===void 0)return false}return N3(e,t,r)});function N3(e,t,r){let n=r?{...r,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(n[L3]=true,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new gt;return i.issues.length===0}var rs=async(e,t,r)=>{let n=r?{...r,async:true,abortEarly:true}:{async:true,abortEarly:true},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},qa=e=>{let t=Ro(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Va(r,s))};return r},F3=qa(_t),Xa=e=>{let t=Ro(e),r=(n,o,i,s)=>t(n,o,i,Va(r,s));return r},z3=Xa(_t),Ya=e=>{let t=Po(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Va(r,s))};return r},D3=Ya(_t),Ka=e=>{let t=Po(e),r=async(n,o,i,s)=>await t(n,o,i,Va(r,s));return r},B3=Ka(_t),Ja=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return ko(e)(t,r,o)},Z3=Ja(_t),ec=e=>(t,r,n)=>ko(e)(t,r,n),U3=ec(_t),tc=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Io(e)(t,r,o)},G3=tc(_t),rc=e=>async(t,r,n)=>Io(e)(t,r,n),Q3=rc(_t);var kt={};vr(kt,{anyString:()=>Vm,base64:()=>Fm,base64url:()=>zm,bigint:()=>Wm,boolean:()=>qm,browserEmail:()=>K3,cidrv4:()=>Lm,cidrv6:()=>Nm,creditCard:()=>nc,cuid:()=>$m,cuid2:()=>wm,currencyCode:()=>Um,date:()=>Gm,datetime:()=>jm,domain:()=>Bm,duration:()=>Rm,e164:()=>Zm,email:()=>km,emoji:()=>Im,extendedDuration:()=>j3,guid:()=>Pm,hex:()=>ep,hostname:()=>Dm,html5Email:()=>q3,httpProtocol:()=>ns,iban:()=>oc,idnEmail:()=>Y3,integer:()=>os,ipv4:()=>Mm,ipv6:()=>Tm,ksuid:()=>vm,lowercase:()=>Km,mac:()=>Om,md5_base64:()=>r6,md5_base64url:()=>n6,md5_hex:()=>t6,nanoid:()=>Am,nanoidOfLength:()=>Em,null:()=>Xm,number:()=>fr,rfc5322Email:()=>X3,sha1_base64:()=>i6,sha1_base64url:()=>s6,sha1_hex:()=>o6,sha256_base64:()=>c6,sha256_base64url:()=>u6,sha256_hex:()=>a6,sha384_base64:()=>f6,sha384_base64url:()=>m6,sha384_hex:()=>l6,sha512_base64:()=>d6,sha512_base64url:()=>h6,sha512_hex:()=>p6,string:()=>Hm,time:()=>Qm,ulid:()=>Sm,undefined:()=>Ym,unicodeEmail:()=>Ub,uppercase:()=>Jm,uuid:()=>bn,uuid4:()=>V3,uuid6:()=>H3,uuid7:()=>W3,xid:()=>Cm});var $m=/^[cC][0-9a-z]{6,}$/,wm=/^[0-9a-z]+$/,Sm=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Cm=/^[0-9a-vA-V]{20}$/,vm=/^[A-Za-z0-9]{27}$/,Am=/^[a-zA-Z0-9_-]{21}$/;function Em(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Rm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j3=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pm=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,V3=bn(4),H3=bn(6),W3=bn(7),km=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,q3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,X3=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ub=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Y3=Ub,K3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,J3="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Im(){return new RegExp(J3,"u")}var Mm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Om=e=>{let t=Pt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Lm=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zm=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Dm=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Bm=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,ns=/^https?$/,Zm=/^\+[1-9]\d{6,14}$/,nc=/^\d(?:[ -]?\d){11,18}$/,Um=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,oc=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Gb="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function e6(e){return new RegExp(`^${e}$`)}var Gm=e6(Gb);function xm(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qm(e){return new RegExp(`^${xm(e)}$`)}function jm(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${xm({precision:e.precision,seconds:true})}(?:${t.join("|")})`,n=e.local?`${r}|${xm({precision:e.precision})}`:r;return new RegExp(`^${Gb}T(?:${n})$`)}var Vm=/^[\s\S]{0,}$/,Hm=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Wm=/^-?\d+n?$/,os=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,qm=/^(?:true|false)$/i,Xm=/^null$/i;var Ym=/^undefined$/i;var Km=/^[^A-Z]*$/,Jm=/^[^a-z]*$/,ep=/^[0-9a-fA-F]*$/;function is(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ss(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var t6=/^[0-9a-fA-F]{32}$/,r6=is(22,"=="),n6=ss(22),o6=/^[0-9a-fA-F]{40}$/,i6=is(27,"="),s6=ss(27),a6=/^[0-9a-fA-F]{64}$/,c6=is(43,"="),u6=ss(43),l6=/^[0-9a-fA-F]{96}$/,f6=is(64,""),m6=ss(64),p6=/^[0-9a-fA-F]{128}$/,d6=is(86,"=="),h6=ss(86);var we=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[]);}),tp=e=>{let t=e.value;return !Za(t)&&t.size!==void 0},rp=e=>{let t=e.value;return !Za(t)&&t.length!==void 0},ic={number:"number",bigint:"bigint",object:"date"},ac=E("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let r=ic[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ic[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),cc=E("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let r=ic[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ic[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort});};}),np=E("$ZodCheckMultipleOf",(e,t)=>{we.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Qi(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort});};}),op=E("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Hi[t.format];e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:false,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:true,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:true,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:true,inst:e,continue:!t.abort});};}),ip=E("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[r,n]=Wi[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:true,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:true,inst:e,continue:!t.abort});};}),sp=E("$ZodCheckMaxSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=tp),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:Xi(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),ap=E("$ZodCheckMinSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=tp),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:Xi(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),cp=E("$ZodCheckSizeEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=tp),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:Xi(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),up=E("$ZodCheckMaxLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=rp),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?_n(o):i)<=t.maximum)return;let a=Yi(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),lp=E("$ZodCheckMinLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=rp),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?_n(o):i)>=t.minimum)return;let a=Yi(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),fp=E("$ZodCheckLengthEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=rp),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?_n(o):i;if(s===t.length)return;let a=Yi(o),c=s>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:true,exact:true,input:n.value,inst:e,continue:!t.abort});};}),Mo=E("$ZodCheckStringFormat",(e,t)=>{var r,n;we.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort});}):(n=e._zod).check??(n.check=()=>{});}),mp=E("$ZodCheckRegex",(e,t)=>{Mo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort});};}),pp=E("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Km),Mo.init(e,t);}),dp=E("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Jm),Mo.init(e,t);}),hp=E("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let r=Pt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort});};}),gp=E("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`^${Pt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort});};}),_p=E("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`.*${Pt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort});};});function sc(e,t,r){e.issues.length&&t.issues.push(...dt(r,e.issues));}var bp=E("$ZodCheckProperty",(e,t)=>{we.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>sc(o,r,t.property));sc(n,r,t.property);};}),yp=E("$ZodCheckProperties",(e,t)=>{we.init(e,t),Ki(e,Symbol.iterator,function*(){yield e;});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=n.value,i;for(let[s,a]of r){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>sc(u,n,s)))):sc(c,n,s);}if(i)return Promise.all(i).then(()=>{})};}),xp=E("$ZodCheckMimeType",(e,t)=>{we.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort});};}),$p=E("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value);};});var yn=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r;}indented(t){this.indent+=1;try{t(this);}finally{this.indent-=1;}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
3
3
  `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s);}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
4
4
  ${r.join(`
5
5
  `)}
6
- };`)(...Object.values(this.closed))}};var xp={major:4,minor:6,patch:7};var W=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xp;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {let i=(a,c,u)=>{if(a.memo)return a;let l=at(a),f;for(let p of c){if(p._zod.def.when){if(sm(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&u?.async===false)throw new _t;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(Wi(a.issues,m,e),l||(l=at(a,m)));});else {if(a.issues.length===m)continue;Wi(a.issues,m,e),l||(l=at(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(at(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new _t;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:true});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===false)throw new _t;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return Yi(this,"~standard",fc(this))},set"~standard"(e){Ir(this,"~standard",e);}}),oy=(e,t)=>e.issues.length?{issues:e.issues.map(r=>gt(r,t,Te()))}:{value:e.value};async function d6(e,t){let r={async:true};return oy(await e._zod.run({value:t,issues:[]},r),r)}function fc(e){return {validate:t=>{let r={async:false};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return oy(n,r)}catch{}return d6(e,t)},vendor:"zod",version:1}}var xn=v("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=t.pattern??Qm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r};}),he=v("$ZodStringFormat",(e,t)=>{Mo.init(e,t),xn.init(e,t);}),wp=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vm),he.init(e,t);}),Sp=v("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bn(n));}else t.pattern??(t.pattern=bn());he.init(e,t);}),Cp=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Rm),he.init(e,t);}),Ep=1,ss=2;function Ap(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function mc(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Ap(e)||ss:iy(e,t)}function iy(e,t){if(!t.normalize&&t.protocol?.source===rs.source&&!/^https?:\/\//i.test(e))return Ep;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??ss}return new URL(e)}catch{return ss}}var h6=/[\t\n\r]/g;function as(e){return e.replace(h6,"")}function pc(e,t){return t.lastIndex=0,t.test(e.hostname)}function dc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var vp=v("$ZodURL",(e,t)=>{he.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=mc(n,t);if(o===Ep){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===ss){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=as(n);return}t.hostname&&!pc(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!dc(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:as(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});}};}),Rp=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Pm()),he.init(e,t);}),Pp=v("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Cm:Em(t.length)),he.init(e,t);}),kp=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ym),he.init(e,t);}),Ip=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xm),he.init(e,t);}),Mp=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=$m),he.init(e,t);}),Tp=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wm),he.init(e,t);}),Op=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Sm),he.init(e,t);}),Lp=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Gm(t)),he.init(e,t);}),Np=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Zm),he.init(e,t);}),Fp=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Um(t)),he.init(e,t);}),zp=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Am),he.init(e,t);}),Dp=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=km),he.init(e,t);}),g6=/^[0-9a-fA-F:.]+$/;function cs(e){return g6.test(e)?Ap(`http://[${e}]`):false}var Bp=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Im),he.init(e,t),e._zod.check=r=>{cs(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort});};}),Zp=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Mm(t.delimiter)),he.init(e,t);}),Up=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Tm),he.init(e,t);});function hc(e){let t=e.split("/");if(t.length!==2)return false;let[r,n]=t;if(!n)return false;let o=Number(n);return `${o}`!==n||o<0||o>128?false:cs(r)}var Gp=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Om),he.init(e,t),e._zod.check=r=>{hc(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort});};});function us(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var gc=/^[0-9a-zA-Z+/]*={0,2}$/,Qp=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gc),he.init(e,t),e._zod.check=r=>{us(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort});};}),ls=/^[A-Za-z0-9_-]*$/;function _c(e){if(!ls.test(e))return false;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return us(r)}var jp=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ls),he.init(e,t),e._zod.check=r=>{_c(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort});};}),Vp=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dm),he.init(e,t);}),_6=/[- ]/g;function b6(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o;}return n%10===0}function bc(e){return tc.test(e)?b6(e.replace(_6,"")):false}var Hp=v("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=tc),he.init(e,t),e._zod.check=r=>{bc(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort});};});function y6(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}return t===1}function yc(e){return rc.test(e)?y6(e):false}var Wp=v("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=rc),he.init(e,t),e._zod.check=r=>{yc(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort});};});function xc(e,t=null){try{let r=e.split(".");if(r.length!==3)return !1;let[n]=r;if(!n)return !1;let o=JSON.parse(atob(n));return !("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return false}}var qp=v("$ZodJWT",(e,t)=>{he.init(e,t),e._zod.check=r=>{xc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort});};}),Xp=v("$ZodCustomStringFormat",(e,t)=>{he.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort});};}),$c=v("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=mr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value);}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r};}),Yp=v("$ZodNumberFormat",(e,t)=>{rp.init(e,t),$c.init(e,t);}),fs=v("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Hm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value;}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r};}),wc=v("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=Vm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r};}),Kp=v("$ZodBigIntFormat",(e,t)=>{np.init(e,t),wc.init(e,t);}),Jp=v("$ZodSymbol",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r};}),ed=v("$ZodUndefined",(e,t)=>{W.init(e,t),e._zod.pattern=qm,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r};}),td=v("$ZodNull",(e,t)=>{W.init(e,t),e._zod.pattern=Wm,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r};}),rd=v("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r;}),nd=v("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r;}),od=v("$ZodNever",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r);}),id=v("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r};}),sd=v("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value);}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r};});function ad(e,t){let r=Ao(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,u]of Ao(e._zod.def.checks))if(a>c&&u._zod.def.when(i)){let l=i.issues.length;return u._zod.check(i),i.issues[l].continue=false,Wi(i.issues,l,e),i}}return o(i,s)};}var x6=e=>Array.isArray(e)?e.length:-1,$6=e=>e instanceof Map?e.size:-1,w6=e=>e instanceof Set?e.size:-1;function Gb(e,t,r){e.issues.length&&t.issues.push(...ht(r,e.issues)),t.value[r]=e.value;}var cd=v("$ZodArray",(e,t)=>{W.init(e,t);let r=We.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>Gb(f,n,c)));else if(Gb(l,n,c),a&&l.issues.length!==0&&at(l))break}return s.length?Promise.all(s).then(()=>n):n},ad(e,x6);});function lc(e,t,r,n,o,i){let s=r in n,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...ht(r,e.issues));}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value;}}var S6=[];function sy(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:S6,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=im(e.shape);return {...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function ay(e,t,r,n,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optin,p=u.optout,m=0;for(let h in t){if(s&&r.issues.length!==m){if(at(r,m))break;m=r.issues.length;}if(c.has(h))continue;if(h==="__proto__"){l==="never"&&a.push(h);continue}if(l==="never"){a.push(h);continue}let d=u.run({value:t[h],issues:[]},n);d instanceof Promise?e.push(d.then(g=>lc(g,r,h,t,f,p))):lc(d,r,h,t,f,p);}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:true}),e.length?Promise.all(e).then(()=>r):r}var cy=v("$ZodObject",(e,t)=>{W.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(t,"shape",{get:u});}let o=Co(()=>sy(t));J(e,"propValues",u=>{let l=u.def.shape,f={};for(let p in l){let m=l[p]._zod;if(m.values){Object.prototype.hasOwnProperty.call(f,p)||Xe(f,p,new Set);for(let h of m.values)f[p].add(h);m.optin!==void 0&&f[p].add(void 0);}}return f});let i=gn,s=t.catchall,a,c=We.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],m=a.shape,h=l?.abortEarly,d=u.issues.length;for(let g of a.allKeys){if(h&&u.issues.length!==d){if(at(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let _=m[g],b=_._zod.optin,y=_._zod.optout,S=_._zod.run({value:f[g],issues:[]},l);S instanceof Promise?p.push(S.then(C=>lc(C,u,g,f,b,y))):lc(S,u,g,f,b,y);}return s?ay(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),ud=v("$ZodObjectJIT",(e,t)=>{cy.init(e,t);let r=e._zod.parse,n=Co(()=>sy(t)),o=We.memoizer,i=m=>{let h=n.value,d=h.symbolKeys,g=new yn(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),_=C=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,b=(C,w)=>`
6
+ };`)(...Object.values(this.closed))}};var wp={major:4,minor:6,patch:7};var V=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wp;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse;});else {let i=(a,c,u)=>{if(a.memo)return a;let l=st(a),f;for(let p of c){if(p._zod.def.when){if(cm(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&u?.async===false)throw new gt;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(qi(a.issues,m,e),l||(l=st(a,m)));});else {if(a.issues.length===m)continue;qi(a.issues,m,e),l||(l=st(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(st(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new gt;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:true});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===false)throw new gt;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return Ki(this,"~standard",pc(this))},set"~standard"(e){kr(this,"~standard",e);}}),sy=(e,t)=>e.issues.length?{issues:e.issues.map(r=>ht(r,t,Oe()))}:{value:e.value};async function g6(e,t){let r={async:true};return sy(await e._zod.run({value:t,issues:[]},r),r)}function pc(e){return {validate:t=>{let r={async:false};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return sy(n,r)}catch{}return g6(e,t)},vendor:"zod",version:1}}var xn=E("$ZodString",(e,t)=>{V.init(e,t),e._zod.pattern=t.pattern??Vm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r};}),de=E("$ZodStringFormat",(e,t)=>{Mo.init(e,t),xn.init(e,t);}),Cp=E("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Pm),de.init(e,t);}),vp=E("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bn(n));}else t.pattern??(t.pattern=bn());de.init(e,t);}),Ap=E("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=km),de.init(e,t);}),Ep=1,as=2;function Rp(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function dc(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Rp(e)||as:ay(e,t)}function ay(e,t){if(!t.normalize&&t.protocol?.source===ns.source&&!/^https?:\/\//i.test(e))return Ep;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??as}return new URL(e)}catch{return as}}var _6=/[\t\n\r]/g;function cs(e){return e.replace(_6,"")}function hc(e,t){return t.lastIndex=0,t.test(e.hostname)}function gc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Pp=E("$ZodURL",(e,t)=>{de.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=dc(n,t);if(o===Ep){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===as){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=cs(n);return}t.hostname&&!hc(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!gc(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:cs(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});}};}),kp=E("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Im()),de.init(e,t);}),Ip=E("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Am:Em(t.length)),de.init(e,t);}),Mp=E("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$m),de.init(e,t);}),Tp=E("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=wm),de.init(e,t);}),Op=E("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Sm),de.init(e,t);}),Lp=E("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cm),de.init(e,t);}),Np=E("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vm),de.init(e,t);}),Fp=E("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=jm(t)),de.init(e,t);}),zp=E("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Gm),de.init(e,t);}),Dp=E("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Qm(t)),de.init(e,t);}),Bp=E("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Rm),de.init(e,t);}),Zp=E("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Mm),de.init(e,t);}),b6=/^[0-9a-fA-F:.]+$/;function us(e){return b6.test(e)?Rp(`http://[${e}]`):false}var Up=E("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tm),de.init(e,t),e._zod.check=r=>{us(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort});};}),Gp=E("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Om(t.delimiter)),de.init(e,t);}),Qp=E("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lm),de.init(e,t);});function _c(e){let t=e.split("/");if(t.length!==2)return false;let[r,n]=t;if(!n)return false;let o=Number(n);return `${o}`!==n||o<0||o>128?false:us(r)}var jp=E("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nm),de.init(e,t),e._zod.check=r=>{_c(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort});};});function ls(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var bc=/^[0-9a-zA-Z+/]*={0,2}$/,Vp=E("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=bc),de.init(e,t),e._zod.check=r=>{ls(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort});};}),fs=/^[A-Za-z0-9_-]*$/;function yc(e){if(!fs.test(e))return false;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ls(r)}var Hp=E("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fs),de.init(e,t),e._zod.check=r=>{yc(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort});};}),Wp=E("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zm),de.init(e,t);}),y6=/[- ]/g;function x6(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o;}return n%10===0}function xc(e){return nc.test(e)?x6(e.replace(y6,"")):false}var qp=E("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=nc),de.init(e,t),e._zod.check=r=>{xc(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort});};});function $6(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97;}return t===1}function $c(e){return oc.test(e)?$6(e):false}var Xp=E("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=oc),de.init(e,t),e._zod.check=r=>{$c(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort});};});function wc(e,t=null){try{let r=e.split(".");if(r.length!==3)return !1;let[n]=r;if(!n)return !1;let o=JSON.parse(atob(n));return !("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return false}}var Yp=E("$ZodJWT",(e,t)=>{de.init(e,t),e._zod.check=r=>{wc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort});};}),Kp=E("$ZodCustomStringFormat",(e,t)=>{de.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort});};}),Sc=E("$ZodNumber",(e,t)=>{V.init(e,t),e._zod.pattern=fr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value);}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r};}),Jp=E("$ZodNumberFormat",(e,t)=>{op.init(e,t),Sc.init(e,t);}),ms=E("$ZodBoolean",(e,t)=>{V.init(e,t),e._zod.pattern=qm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value;}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r};}),Cc=E("$ZodBigInt",(e,t)=>{V.init(e,t),e._zod.pattern=Wm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r};}),ed=E("$ZodBigIntFormat",(e,t)=>{ip.init(e,t),Cc.init(e,t);}),td=E("$ZodSymbol",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r};}),rd=E("$ZodUndefined",(e,t)=>{V.init(e,t),e._zod.pattern=Ym,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r};}),nd=E("$ZodNull",(e,t)=>{V.init(e,t),e._zod.pattern=Xm,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r};}),od=E("$ZodAny",(e,t)=>{V.init(e,t),e._zod.parse=r=>r;}),id=E("$ZodUnknown",(e,t)=>{V.init(e,t),e._zod.parse=r=>r;}),sd=E("$ZodNever",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r);}),ad=E("$ZodVoid",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r};}),cd=E("$ZodDate",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value);}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r};});function ud(e,t){let r=Ao(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,u]of Ao(e._zod.def.checks))if(a>c&&u._zod.def.when(i)){let l=i.issues.length;return u._zod.check(i),i.issues[l].continue=false,qi(i.issues,l,e),i}}return o(i,s)};}var w6=e=>Array.isArray(e)?e.length:-1,S6=e=>e instanceof Map?e.size:-1,C6=e=>e instanceof Set?e.size:-1;function jb(e,t,r){e.issues.length&&t.issues.push(...dt(r,e.issues)),t.value[r]=e.value;}var ld=E("$ZodArray",(e,t)=>{V.init(e,t);let r=He.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>jb(f,n,c)));else if(jb(l,n,c),a&&l.issues.length!==0&&st(l))break}return s.length?Promise.all(s).then(()=>n):n},ud(e,w6);});function mc(e,t,r,n,o,i){let s=r in n,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...dt(r,e.issues));}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value;}}var v6=[];function cy(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:v6,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=am(e.shape);return {...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function uy(e,t,r,n,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optin,p=u.optout,m=0;for(let h in t){if(s&&r.issues.length!==m){if(st(r,m))break;m=r.issues.length;}if(c.has(h))continue;if(h==="__proto__"){l==="never"&&a.push(h);continue}if(l==="never"){a.push(h);continue}let d=u.run({value:t[h],issues:[]},n);d instanceof Promise?e.push(d.then(g=>mc(g,r,h,t,f,p))):mc(d,r,h,t,f,p);}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:true}),e.length?Promise.all(e).then(()=>r):r}var ly=E("$ZodObject",(e,t)=>{V.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(t,"shape",{get:u});}let o=Co(()=>cy(t));K(e,"propValues",u=>{let l=u.def.shape,f={};for(let p in l){let m=l[p]._zod;if(m.values){Object.prototype.hasOwnProperty.call(f,p)||qe(f,p,new Set);for(let h of m.values)f[p].add(h);m.optin!==void 0&&f[p].add(void 0);}}return f});let i=gn,s=t.catchall,a,c=He.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],m=a.shape,h=l?.abortEarly,d=u.issues.length;for(let g of a.allKeys){if(h&&u.issues.length!==d){if(st(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let _=m[g],b=_._zod.optin,y=_._zod.optout,S=_._zod.run({value:f[g],issues:[]},l);S instanceof Promise?p.push(S.then(C=>mc(C,u,g,f,b,y))):mc(S,u,g,f,b,y);}return s?uy(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),fd=E("$ZodObjectJIT",(e,t)=>{ly.init(e,t);let r=e._zod.parse,n=Co(()=>cy(t)),o=He.memoizer,i=m=>{let h=n.value,d=h.symbolKeys,g=new yn(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),_=C=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,b=(C,w)=>`
7
7
  let ${C}_ab = false;
8
8
  for (let i = 0; i < ${C}.issues.length; i++) {
9
9
  const iss = ${C}.issues[i];
@@ -14,8 +14,8 @@ ${r.join(`
14
14
  if (${C}_ab && ctx && ctx.abortEarly) {
15
15
  payload.value = newResult;
16
16
  return payload;
17
- }`;g.write("const input = payload.value;");let y=Object.create(null),S=0;for(let C of h.allKeys)y[C]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of h.allKeys){if(C==="__proto__")continue;let w=y[C],$=typeof C=="symbol"?`syms[${d.indexOf(C)}]`:st(C),E=`${$} in input`,R=m[C],P=R?._zod?.optin,I=P!==void 0,T=R?._zod?.optout==="optional";if(g.write(`const ${w} = ${_($)};`),I&&T){let O=P==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;g.write(`
18
- const ${w}_present = ${E};
17
+ }`;g.write("const input = payload.value;");let y=Object.create(null),S=0;for(let C of h.allKeys)y[C]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of h.allKeys){if(C==="__proto__")continue;let w=y[C],$=typeof C=="symbol"?`syms[${d.indexOf(C)}]`:it(C),v=`${$} in input`,R=m[C],P=R?._zod?.optin,I=P!==void 0,T=R?._zod?.optout==="optional";if(g.write(`const ${w} = ${_($)};`),I&&T){let O=P==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;g.write(`
18
+ const ${w}_present = ${v};
19
19
  if (!${w}.issues.length || ${w}_present) {
20
20
  if (${w}.issues.length) {${b(w,$)}
21
21
  }
@@ -29,11 +29,11 @@ ${r.join(`
29
29
  if (${w}.issues.length) {${b(w,$)}
30
30
  }
31
31
  `),P==="defaulted"?g.write(`newResult[${$}] = ${w}.value;`):g.write(`
32
- if (${w}.value !== undefined || ${E}) {
32
+ if (${w}.value !== undefined || ${v}) {
33
33
  newResult[${$}] = ${w}.value;
34
34
  }
35
35
  `)):g.write(`
36
- const ${w}_present = ${E};
36
+ const ${w}_present = ${v};
37
37
  if (${w}.issues.length) {${b(w,$)}
38
38
  }
39
39
  if (!${w}_present && !${w}.issues.length) {
@@ -53,15 +53,15 @@ ${r.join(`
53
53
  newResult[${$}] = ${w}.value;
54
54
  }
55
55
 
56
- `);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=gn,c=!We.jitless,l=c&&nm.value,f=t.catchall,p;e._zod.parse=(m,h)=>{p??(p=n.value);let d=m.value;return a(d)?c&&l&&h?.async===false&&h.jitless!==true?(s||(s=i(t.shape)),m=s(m,h),f?ay([],d,m,h,p,e,h?.abortEarly===true):m):r(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),m)};});function Qb(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!at(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>gt(s,n,Te())))}),t)}var ms=v("$ZodUnion",(e,t)=>{W.init(e,t),J(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),J(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),J(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),J(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>fr(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=true;else {if(c.issues.length===0)return c;s.push(c);}}return i?Promise.all(s).then(a=>Qb(a,n,e,o)):Qb(s,n,e,o)};});function jb(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>gt(s,n,Te())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:false,matches:o}),t)}var ld=v("$ZodXor",(e,t)=>{ms.init(e,t),t.inclusive=false;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(s.push(c),i=true):s.push(c);}return i?Promise.all(s).then(a=>jb(a,n,e,o)):jb(s,n,e,o)};});function fd(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=uy(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function uy(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null);}else t.set(o,r);}return t}var md=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,ms.init(e,t);let r=e._zod.parse;J(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&s++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,u)||Xe(i,u,new Set);for(let f of l)i[u].add(f);}}return !o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=Eo(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=Co(()=>uy(t));e._zod.parse=(o,i)=>{let s=o.value;if(!gn(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],c=n.value.get(a);return c&&(a!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(u=>n.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)};}),pd=v("$ZodIntersection",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Vb(r,c,u)):Vb(r,i,s)};});function To(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return {valid:true,data:e};if(Rt(e)&&Rt(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=To(e[i],t[i]);if(!s.valid)return {valid:false,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data;}return {valid:true,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=To(o,i);if(!s.valid)return {valid:false,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function Vb(e,t,r){let n=new Map,o,i=new Map,s=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);i.has(p)||i.set(p,u),f=[p];}else return false;for(let p of f)n.has(p)||n.set(p,{}),n.get(p)[l]=true;return true};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of r.issues)s(u,"r")||e.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&e.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&i.has(l)&&e.issues.push(i.get(l));}let c=To(t.value,r.value);if(!c.valid){if(at(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Sc=v("$ZodTuple",(e,t)=>{W.init(e,t);let r=t.items,n=We.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let a=[],c=Hb(r,"optin"),u=Hb(r,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:true,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:true,input:s,inst:e,origin:"array"});}let l=new Array(r.length),f=t.rest?i?.abortEarly:void 0,p=false;for(let m=0;m<r.length;m++){let h=r[m]._zod.run({value:s[m],issues:[]},i);h instanceof Promise?a.push(h.then(d=>{l[m]=d;})):(l[m]=h,f&&!p&&h.issues.length&&(p=at(h)));}if(t.rest&&!p){let m=r.length-1,h=s.slice(r.length),d=o.issues.length;for(let g of h){if(f&&o.issues.length!==d){if(at(o,d))break;d=o.issues.length;}m++;let _=t.rest._zod.run({value:g,issues:[]},i);_ instanceof Promise?a.push(_.then(b=>Wb(b,o,m))):Wb(_,o,m);}}return a.length?Promise.all(a).then(()=>qb(l,o,r,s,u)):qb(l,o,r,s,u)};});function Hb(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Wb(e,t,r){e.issues.length&&t.issues.push(...ht(r,e.issues)),t.value[r]=e.value;}function qb(e,t,r,n,o){for(let i=0;i<r.length;i++){let s=e[i],a=i<n.length;if(!a&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...ht(i,s.issues));}t.value[i]=s.value;}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var dd=v("$ZodRecord",(e,t)=>{W.init(e,t);let r=We.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Rt(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>gt(h,o,Te())),input:l,path:[l],inst:e});continue}let p=f.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...ht(l,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...ht(l,m.issues)),n.value[p]=m.value);}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l];}else u=u??[],u.push(l);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:true});}else {n.value=r?r.alloc(e,n,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&mr.test(u)&&l.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h);}if(l.issues.length){t.mode==="loose"?n.value[u]=i[u]:a?(c=c??[],c.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>gt(h,o,Te())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[u],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...ht(u,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...ht(u,m.issues)),n.value[p]=m.value);}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:true});}return s.length?Promise.all(s).then(()=>n):n};}),hd=v("$ZodMap",(e,t)=>{W.init(e,t);let r=We.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let s=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let a=o?.abortEarly,c=n.issues.length;for(let[u,l]of i){if(a&&n.issues.length!==c){if(at(n,c))break;c=n.issues.length;}let f=t.keyType._zod.run({value:u,issues:[]},o),p=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise||p instanceof Promise?s.push(Promise.all([f,p]).then(([m,h])=>{Xb(m,h,n,u,i,e,o);})):Xb(f,p,n,u,i,e,o);}return s.length?Promise.all(s).then(()=>n):n},ad(e,$6);});function Xb(e,t,r,n,o,i,s){e.issues.length&&(ji.has(typeof n)?r.issues.push(...ht(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>gt(a,s,Te()))})),t.issues.length&&(ji.has(typeof n)?r.issues.push(...ht(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>gt(a,s,Te()))})),r.value.set(e.value,t.value);}var gd=v("$ZodSet",(e,t)=>{W.init(e,t);let r=We.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let s=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let a=o?.abortEarly,c=n.issues.length;for(let u of i){if(a&&n.issues.length!==c){if(at(n,c))break;c=n.issues.length;}let l=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise?s.push(l.then(f=>Yb(f,n))):Yb(l,n);}return s.length?Promise.all(s).then(()=>n):n},ad(e,w6);});function Yb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var _d=v("$ZodEnum",(e,t)=>{W.init(e,t);let r=wo(t.entries),n=new Set(r);e._zod.values=n,J(e,"pattern",o=>{let i=wo(o.def.entries).filter(s=>ji.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>Pt(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o};}),bd=v("$ZodLiteral",(e,t)=>{W.init(e,t);let r=new Set(t.values);e._zod.values=r,J(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?Pt(i):i?Pt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n};}),yd=v("$ZodFile",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r};}),xd=v("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.optin="optional",We.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mr(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return (o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new _t;return r.value=o,r};});function Kb(e,t){return e.value=t.issues.length?void 0:t.value,e}var Cc=v("$ZodOptional",(e,t)=>{W.init(e,t),J(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",J(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),J(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${fr(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Kb(r,i)):Kb(r,o)}return t.innerType._zod.run(r,n)};}),$d=v("$ZodExactOptional",(e,t)=>{Cc.init(e,t),J(e,"values",r=>r.def.innerType._zod.values),J(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n);}),wd=v("$ZodNullable",(e,t)=>{W.init(e,t),J(e,"optin",r=>r.def.innerType._zod.optin),J(e,"optout",r=>r.def.innerType._zod.optout),J(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${fr(n.source)}|null)$`):void 0}),J(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n);}),Sd=v("$ZodDefault",(e,t)=>{W.init(e,t),e._zod.optin="defaulted",J(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Jb(i,t)):Jb(o,t)};});function Jb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Cd=v("$ZodPrefault",(e,t)=>{W.init(e,t),e._zod.optin="defaulted",J(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n));}),Ed=v("$ZodNonOptional",(e,t)=>{W.init(e,t),J(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>ey(i,e)):ey(o,e)};});function ey(e,t){return !e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Ad=v("$ZodSuccess",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mr("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)};});function ty(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>gt(o,n,Te()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var vd=v("$ZodCatch",(e,t)=>{W.init(e,t),J(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),J(e,"optout",r=>r.def.innerType._zod.optout),J(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>ty(r,i,t,n)):ty(r,o,t,n)};}),Rd=v("$ZodNaN",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r);}),Ec=v("$ZodPipe",(e,t)=>{W.init(e,t),J(e,"values",r=>r.def.in._zod.values),J(e,"optin",r=>r.def.in._zod.optin),J(e,"optout",r=>r.def.out._zod.optout),J(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>ac(s,t.in,n)):ac(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>ac(i,t.out,n)):ac(o,t.out,n)};});function ac(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},r)}var ps=v("$ZodCodec",(e,t)=>{W.init(e,t),J(e,"values",r=>r.def.in._zod.values),J(e,"optin",r=>r.def.in._zod.optin),J(e,"optout",r=>r.def.out._zod.optout),J(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>cc(s,t,n)):cc(i,t,n)}else {let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>cc(s,t,n)):cc(i,t,n)}};});function cc(e,t,r){if(e.issues.length)return e.aborted=true,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>uc(e,i,t.out,r)):uc(e,o,t.out,r)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>uc(e,i,t.in,r)):uc(e,o,t.in,r)}}function uc(e,t,r,n){return e.issues.length?(e.aborted=true,e):r._zod.run({value:t,issues:e.issues},n)}var Pd=v("$ZodPreprocess",(e,t)=>{Ec.init(e,t);}),kd=v("$ZodReadonly",(e,t)=>{W.init(e,t),J(e,"propValues",r=>r.def.innerType._zod.propValues),J(e,"values",r=>r.def.innerType._zod.values),J(e,"optin",r=>r.def.innerType?._zod?.optin),J(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(ry):ry(o)};});function ry(e){return e.memo||(e.value=Object.freeze(e.value)),e}function C6(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(r=c.pattern),n||(n=!!c.format?.includes("int"));let u=c.minimum??c.length,l=c.maximum??c.length;u!==void 0&&(o===void 0||u>o)&&(o=u),l!==void 0&&(i===void 0||l<i)&&(i=l);}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return "(?!)";if(o!==void 0||i!==void 0)return jm({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (n&&s===mr?ns:s)?.source}function $p(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=$p(n);return r&&o&&i&&i!==o?r.replace(fr(o),()=>fr(i)):r}if(t.options){let o=t.options.map($p);if(o.every(Boolean))return `^(${o.map(i=>fr(i)).join("|")})$`}return C6(e)}var Id=v("$ZodTemplateLiteral",(e,t)=>{W.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=$p(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(fr(o));}else if(n===null||om.has(typeof n))r.push(Pt(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n);}),Md=v("$ZodFunction",(e,t)=>(W.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?ja(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?ja(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await Va(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await Va(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Sc({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Td=v("$ZodPromise",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n));}),ds=v("$ZodLazy",(e,t)=>{W.init(e,t),tm(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),J(e,"pattern",r=>r.innerType?._zod?.pattern),J(e,"propValues",r=>r.innerType?._zod?.propValues),J(e,"optin",r=>r.innerType?._zod?.optin??void 0),J(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n);}),Od=v("$ZodCustom",(e,t)=>{xe.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>ny(i,r,n,e));ny(o,r,n,e);};});function ny(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(vo(o));}}var Pc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},Nd="~memo",fy=[];function my(e){return e!==null&&typeof e=="object"}function Ld(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var py=new WeakMap,Oo=0,Rc=1,hs=2;function gs(e,t,r){let n=py.get(e);if(n!==void 0)return n?hs:Oo;if(t.has(e))return hs;t.add(e);let o=Oo,i=l=>{if(o!==hs&&l?._zod){let f=gs(l,t,r);f>o&&(o=f);}},s=(l,f)=>{let p=Oo;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?Rc:h.value?._zod?gs(h.value,t,r):Oo;d>p&&(p=d);}return p},a=l=>{l>o&&(o=l);},c=e._zod.def,u=c.type;switch(u){case "object":{let l=Eo(c);a(l?s(l):Rc),i(c.catchall);break}case "array":i(c.element);break;case "tuple":for(let l of c.items)i(l);i(c.rest);break;case "record":case "map":i(c.keyType),i(c.valueType);break;case "set":i(c.valueType);break;case "union":for(let l of c.options)i(l);break;case "intersection":i(c.left),i(c.right);break;case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":i(c.innerType);break;case "pipe":i(c.in),i(c.out);break;case "function":i(c.input),i(c.output);break;case "lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?gs(l,t,false):Rc);break}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":break;default:for(let l in c){let f=Object.getOwnPropertyDescriptor(c,l);if(!f||f.get)continue;let p=f.value;if(!(!p||typeof p!="object")){if(p._zod)i(p);else if(Array.isArray(p))for(let m of p)i(m);}}}return t.delete(e),E6(e,o)}function E6(e,t){return t!==Rc&&py.set(e,t===hs),t}function kc(e){return gs(e,new Set,true)!==Oo}function A6(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Ac,vc=[],v6={alloc(e,t,r){let n=Ac;if(!n)return r;Ac=void 0;let o={value:r,issues:null};return n.set(t.value,o),vc.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Ic(i,o.value))throw new Pc;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n);});},attach(e){var t;let r,n=false,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(r===void 0){let _=gs(e,new Set,false);if(_===Oo)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);_===hs||n?r=true:n=true;}let l=c.value;if(!my(l))return s(c,u);let f=u[Nd];f||(f={buckets:new WeakMap,backEdges:void 0},u[Nd]=f);let p;o===u?p=i:(p=A6(f,e),o=u,i=p);let m=p.get(l);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...Ld(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;Ac=p;let h=vc.length,d=s(c,u);Ac=void 0;let g=vc.length>h?vc.pop():void 0;return d instanceof Promise?d.then(_=>(g&&(g.issues=_.issues.length?Ld(_.issues):fy),_)):(g&&(g.issues=d.issues.length?Ld(d.issues):fy),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function _s(){return v6}function Ic(e,t){let r=e[Nd]?.backEdges;return r!==void 0&&my(t)&&r.has(t)}var Mc={};var dy,Fd=Symbol("ZodOutput"),zd=Symbol("ZodInput"),Tc=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Oc(){return new Tc}(dy=globalThis).__zod_globalRegistry??(dy.__zod_globalRegistry=Oc());var Ye=globalThis.__zod_globalRegistry;var ct=Symbol.for("zod.compile.invalid"),hy=Symbol.for("zod.compile.fallback"),zt=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},ne=class extends Error{constructor(t,r=true){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r;}};function P6(e,t){try{return Nc(e,{assertOnly:!0})}catch{return t}}function Ud(e,t){try{let r=Nc(e),n=Lc(e,r);return n._zod.bag.validator=P6(e,r),n}catch(r){if(t?.strict)throw r;return e}}function Lc(e,t){if(kc(e))throw new ne("a schema whose subtree contains a reference cycle");let r=de(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[hy]||a&&Ic(a,s.value))return o(s,a);let c=t(s.value);return c!==ct?(s.value=c,s):(a&&(a[hy]=true),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||k6(r,e,t),r}function k6(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(s,a)=>{let c=r(s);return c!==ct?{success:true,data:c}:i(s,a)};}if(typeof o.parse=="function"){let i=o.parse;n.parse=(s,a)=>{let c=r(s);return c!==ct?c:i(s,a)};}}function Nc(e,t){let r=true;try{r=kc(e);}catch{}if(r)throw new ne("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new yn(["input"]),i=ke(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[ct,...n.constants.values()],c=o.content.join(`
56
+ `);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=gn,c=!He.jitless,l=c&&im.value,f=t.catchall,p;e._zod.parse=(m,h)=>{p??(p=n.value);let d=m.value;return a(d)?c&&l&&h?.async===false&&h.jitless!==true?(s||(s=i(t.shape)),m=s(m,h),f?uy([],d,m,h,p,e,h?.abortEarly===true):m):r(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),m)};});function Vb(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!st(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>ht(s,n,Oe())))}),t)}var ps=E("$ZodUnion",(e,t)=>{V.init(e,t),K(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),K(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),K(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),K(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>lr(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=true;else {if(c.issues.length===0)return c;s.push(c);}}return i?Promise.all(s).then(a=>Vb(a,n,e,o)):Vb(s,n,e,o)};});function Hb(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>ht(s,n,Oe())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:false,matches:o}),t)}var md=E("$ZodXor",(e,t)=>{ps.init(e,t),t.inclusive=false;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=false,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(s.push(c),i=true):s.push(c);}return i?Promise.all(s).then(a=>Hb(a,n,e,o)):Hb(s,n,e,o)};});function pd(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=fy(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function fy(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null);}else t.set(o,r);}return t}var dd=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,ps.init(e,t);let r=e._zod.parse;K(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&s++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,u)||qe(i,u,new Set);for(let f of l)i[u].add(f);}}return !o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=vo(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=Co(()=>fy(t));e._zod.parse=(o,i)=>{let s=o.value;if(!gn(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],c=n.value.get(a);return c&&(a!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(u=>n.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)};}),hd=E("$ZodIntersection",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Wb(r,c,u)):Wb(r,i,s)};});function To(e,t){if(e===t)return {valid:true,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return {valid:true,data:e};if(Rt(e)&&Rt(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=To(e[i],t[i]);if(!s.valid)return {valid:false,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data;}return {valid:true,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=To(o,i);if(!s.valid)return {valid:false,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function Wb(e,t,r){let n=new Map,o,i=new Map,s=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);i.has(p)||i.set(p,u),f=[p];}else return false;for(let p of f)n.has(p)||n.set(p,{}),n.get(p)[l]=true;return true};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of r.issues)s(u,"r")||e.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&e.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&i.has(l)&&e.issues.push(i.get(l));}let c=To(t.value,r.value);if(!c.valid){if(st(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var vc=E("$ZodTuple",(e,t)=>{V.init(e,t);let r=t.items,n=He.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let a=[],c=qb(r,"optin"),u=qb(r,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:true,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:true,input:s,inst:e,origin:"array"});}let l=new Array(r.length),f=t.rest?i?.abortEarly:void 0,p=false;for(let m=0;m<r.length;m++){let h=r[m]._zod.run({value:s[m],issues:[]},i);h instanceof Promise?a.push(h.then(d=>{l[m]=d;})):(l[m]=h,f&&!p&&h.issues.length&&(p=st(h)));}if(t.rest&&!p){let m=r.length-1,h=s.slice(r.length),d=o.issues.length;for(let g of h){if(f&&o.issues.length!==d){if(st(o,d))break;d=o.issues.length;}m++;let _=t.rest._zod.run({value:g,issues:[]},i);_ instanceof Promise?a.push(_.then(b=>Xb(b,o,m))):Xb(_,o,m);}}return a.length?Promise.all(a).then(()=>Yb(l,o,r,s,u)):Yb(l,o,r,s,u)};});function qb(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function Xb(e,t,r){e.issues.length&&t.issues.push(...dt(r,e.issues)),t.value[r]=e.value;}function Yb(e,t,r,n,o){for(let i=0;i<r.length;i++){let s=e[i],a=i<n.length;if(!a&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...dt(i,s.issues));}t.value[i]=s.value;}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var gd=E("$ZodRecord",(e,t)=>{V.init(e,t);let r=He.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Rt(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(h=>ht(h,o,Oe())),input:l,path:[l],inst:e});continue}let p=f.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[l],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...dt(l,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...dt(l,m.issues)),n.value[p]=m.value);}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l];}else u=u??[],u.push(l);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:true});}else {n.value=r?r.alloc(e,n,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&fr.test(u)&&l.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h);}if(l.issues.length){t.mode==="loose"?n.value[u]=i[u]:a?(c=c??[],c.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>ht(h,o,Oe())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let m=t.valueType._zod.run({value:i[u],issues:[]},o);m instanceof Promise?s.push(m.then(h=>{h.issues.length&&n.issues.push(...dt(u,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...dt(u,m.issues)),n.value[p]=m.value);}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:true});}return s.length?Promise.all(s).then(()=>n):n};}),_d=E("$ZodMap",(e,t)=>{V.init(e,t);let r=He.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let s=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let a=o?.abortEarly,c=n.issues.length;for(let[u,l]of i){if(a&&n.issues.length!==c){if(st(n,c))break;c=n.issues.length;}let f=t.keyType._zod.run({value:u,issues:[]},o),p=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise||p instanceof Promise?s.push(Promise.all([f,p]).then(([m,h])=>{Kb(m,h,n,u,i,e,o);})):Kb(f,p,n,u,i,e,o);}return s.length?Promise.all(s).then(()=>n):n},ud(e,S6);});function Kb(e,t,r,n,o,i,s){e.issues.length&&(Vi.has(typeof n)?r.issues.push(...dt(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>ht(a,s,Oe()))})),t.issues.length&&(Vi.has(typeof n)?r.issues.push(...dt(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>ht(a,s,Oe()))})),r.value.set(e.value,t.value);}var bd=E("$ZodSet",(e,t)=>{V.init(e,t);let r=He.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let s=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let a=o?.abortEarly,c=n.issues.length;for(let u of i){if(a&&n.issues.length!==c){if(st(n,c))break;c=n.issues.length;}let l=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise?s.push(l.then(f=>Jb(f,n))):Jb(l,n);}return s.length?Promise.all(s).then(()=>n):n},ud(e,C6);});function Jb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var yd=E("$ZodEnum",(e,t)=>{V.init(e,t);let r=wo(t.entries),n=new Set(r);e._zod.values=n,K(e,"pattern",o=>{let i=wo(o.def.entries).filter(s=>Vi.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>Pt(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o};}),xd=E("$ZodLiteral",(e,t)=>{V.init(e,t);let r=new Set(t.values);e._zod.values=r,K(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?Pt(i):i?Pt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n};}),$d=E("$ZodFile",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r};}),wd=E("$ZodTransform",(e,t)=>{V.init(e,t),e._zod.optin="optional",He.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ir(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return (o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new gt;return r.value=o,r};});function ey(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ac=E("$ZodOptional",(e,t)=>{V.init(e,t),K(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",K(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),K(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${lr(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>ey(r,i)):ey(r,o)}return t.innerType._zod.run(r,n)};}),Sd=E("$ZodExactOptional",(e,t)=>{Ac.init(e,t),K(e,"values",r=>r.def.innerType._zod.values),K(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n);}),Cd=E("$ZodNullable",(e,t)=>{V.init(e,t),K(e,"optin",r=>r.def.innerType._zod.optin),K(e,"optout",r=>r.def.innerType._zod.optout),K(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${lr(n.source)}|null)$`):void 0}),K(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n);}),vd=E("$ZodDefault",(e,t)=>{V.init(e,t),e._zod.optin="defaulted",K(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>ty(i,t)):ty(o,t)};});function ty(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ad=E("$ZodPrefault",(e,t)=>{V.init(e,t),e._zod.optin="defaulted",K(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n));}),Ed=E("$ZodNonOptional",(e,t)=>{V.init(e,t),K(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>ry(i,e)):ry(o,e)};});function ry(e,t){return !e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Rd=E("$ZodSuccess",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ir("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)};});function ny(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>ht(o,n,Oe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var Pd=E("$ZodCatch",(e,t)=>{V.init(e,t),K(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),K(e,"optout",r=>r.def.innerType._zod.optout),K(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>ny(r,i,t,n)):ny(r,o,t,n)};}),kd=E("$ZodNaN",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r);}),Ec=E("$ZodPipe",(e,t)=>{V.init(e,t),K(e,"values",r=>r.def.in._zod.values),K(e,"optin",r=>r.def.in._zod.optin),K(e,"optout",r=>r.def.out._zod.optout),K(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>uc(s,t.in,n)):uc(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>uc(i,t.out,n)):uc(o,t.out,n)};});function uc(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=true,e):t._zod.run({value:e.value,issues:e.issues},r)}var ds=E("$ZodCodec",(e,t)=>{V.init(e,t),K(e,"values",r=>r.def.in._zod.values),K(e,"optin",r=>r.def.in._zod.optin),K(e,"optout",r=>r.def.out._zod.optout),K(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>lc(s,t,n)):lc(i,t,n)}else {let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>lc(s,t,n)):lc(i,t,n)}};});function lc(e,t,r){if(e.issues.length)return e.aborted=true,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>fc(e,i,t.out,r)):fc(e,o,t.out,r)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>fc(e,i,t.in,r)):fc(e,o,t.in,r)}}function fc(e,t,r,n){return e.issues.length?(e.aborted=true,e):r._zod.run({value:t,issues:e.issues},n)}var Id=E("$ZodPreprocess",(e,t)=>{Ec.init(e,t);}),Md=E("$ZodReadonly",(e,t)=>{V.init(e,t),K(e,"propValues",r=>r.def.innerType._zod.propValues),K(e,"values",r=>r.def.innerType._zod.values),K(e,"optin",r=>r.def.innerType?._zod?.optin),K(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(oy):oy(o)};});function oy(e){return e.memo||(e.value=Object.freeze(e.value)),e}function A6(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(r=c.pattern),n||(n=!!c.format?.includes("int"));let u=c.minimum??c.length,l=c.maximum??c.length;u!==void 0&&(o===void 0||u>o)&&(o=u),l!==void 0&&(i===void 0||l<i)&&(i=l);}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return "(?!)";if(o!==void 0||i!==void 0)return Hm({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (n&&s===fr?os:s)?.source}function Sp(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=Sp(n);return r&&o&&i&&i!==o?r.replace(lr(o),()=>lr(i)):r}if(t.options){let o=t.options.map(Sp);if(o.every(Boolean))return `^(${o.map(i=>lr(i)).join("|")})$`}return A6(e)}var Td=E("$ZodTemplateLiteral",(e,t)=>{V.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=Sp(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(lr(o));}else if(n===null||sm.has(typeof n))r.push(Pt(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n);}),Od=E("$ZodFunction",(e,t)=>(V.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?Ha(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?Ha(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await Wa(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await Wa(e._def.output,i):i},"_zod",{value:e._zod,enumerable:false})},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new vc({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Ld=E("$ZodPromise",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n));}),hs=E("$ZodLazy",(e,t)=>{V.init(e,t),nm(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),K(e,"pattern",r=>r.innerType?._zod?.pattern),K(e,"propValues",r=>r.innerType?._zod?.propValues),K(e,"optin",r=>r.innerType?._zod?.optin??void 0),K(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n);}),Nd=E("$ZodCustom",(e,t)=>{we.init(e,t),V.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>iy(i,r,n,e));iy(o,r,n,e);};});function iy(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Eo(o));}}var Ic=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},zd="~memo",py=[];function dy(e){return e!==null&&typeof e=="object"}function Fd(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var hy=new WeakMap,Oo=0,kc=1,gs=2;function _s(e,t,r){let n=hy.get(e);if(n!==void 0)return n?gs:Oo;if(t.has(e))return gs;t.add(e);let o=Oo,i=l=>{if(o!==gs&&l?._zod){let f=_s(l,t,r);f>o&&(o=f);}},s=(l,f)=>{let p=Oo;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?kc:h.value?._zod?_s(h.value,t,r):Oo;d>p&&(p=d);}return p},a=l=>{l>o&&(o=l);},c=e._zod.def,u=c.type;switch(u){case "object":{let l=vo(c);a(l?s(l):kc),i(c.catchall);break}case "array":i(c.element);break;case "tuple":for(let l of c.items)i(l);i(c.rest);break;case "record":case "map":i(c.keyType),i(c.valueType);break;case "set":i(c.valueType);break;case "union":for(let l of c.options)i(l);break;case "intersection":i(c.left),i(c.right);break;case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":i(c.innerType);break;case "pipe":i(c.in),i(c.out);break;case "function":i(c.input),i(c.output);break;case "lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?_s(l,t,false):kc);break}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":break;default:for(let l in c){let f=Object.getOwnPropertyDescriptor(c,l);if(!f||f.get)continue;let p=f.value;if(!(!p||typeof p!="object")){if(p._zod)i(p);else if(Array.isArray(p))for(let m of p)i(m);}}}return t.delete(e),E6(e,o)}function E6(e,t){return t!==kc&&hy.set(e,t===gs),t}function Mc(e){return _s(e,new Set,true)!==Oo}function R6(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Rc,Pc=[],P6={alloc(e,t,r){let n=Rc;if(!n)return r;Rc=void 0;let o={value:r,issues:null};return n.set(t.value,o),Pc.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Tc(i,o.value))throw new Ic;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n);});},attach(e){var t;let r,n=false,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(r===void 0){let _=_s(e,new Set,false);if(_===Oo)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);_===gs||n?r=true:n=true;}let l=c.value;if(!dy(l))return s(c,u);let f=u[zd];f||(f={buckets:new WeakMap,backEdges:void 0},u[zd]=f);let p;o===u?p=i:(p=R6(f,e),o=u,i=p);let m=p.get(l);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...Fd(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;Rc=p;let h=Pc.length,d=s(c,u);Rc=void 0;let g=Pc.length>h?Pc.pop():void 0;return d instanceof Promise?d.then(_=>(g&&(g.issues=_.issues.length?Fd(_.issues):py),_)):(g&&(g.issues=d.issues.length?Fd(d.issues):py),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function bs(){return P6}function Tc(e,t){let r=e[zd]?.backEdges;return r!==void 0&&dy(t)&&r.has(t)}var Oc={};var gy,Dd=Symbol("ZodOutput"),Bd=Symbol("ZodInput"),Lc=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Nc(){return new Lc}(gy=globalThis).__zod_globalRegistry??(gy.__zod_globalRegistry=Nc());var Xe=globalThis.__zod_globalRegistry;var at=Symbol.for("zod.compile.invalid"),_y=Symbol.for("zod.compile.fallback"),zt=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},ee=class extends Error{constructor(t,r=true){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r;}};function I6(e,t){try{return zc(e,{assertOnly:!0})}catch{return t}}function Qd(e,t){try{let r=zc(e),n=Fc(e,r);return n._zod.bag.validator=I6(e,r),n}catch(r){if(t?.strict)throw r;return e}}function Fc(e,t){if(Mc(e))throw new ee("a schema whose subtree contains a reference cycle");let r=pe(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[_y]||a&&Tc(a,s.value))return o(s,a);let c=t(s.value);return c!==at?(s.value=c,s):(a&&(a[_y]=true),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||M6(r,e,t),r}function M6(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(s,a)=>{let c=r(s);return c!==at?{success:true,data:c}:i(s,a)};}if(typeof o.parse=="function"){let i=o.parse;n.parse=(s,a)=>{let c=r(s);return c!==at?c:i(s,a)};}}function zc(e,t){let r=true;try{r=Mc(e);}catch{}if(r)throw new ee("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new yn(["input"]),i=ke(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[at,...n.constants.values()],c=o.content.join(`
57
57
  `),u=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
58
58
  ${c}`:c:"",l=Function,f=`return (input) => {
59
59
  ${c}
60
- }`,p;try{p=new l(...s,f)(...a);}catch(m){throw new ne(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=n.definite,p}function j(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function wn(e,t){return e.definite=false,j(e,t)}function Z(e){return `v${e.varCounter++}`}function I6(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return ct;let n=r;return n.issues.length===0?n.value:ct}function tt(e,t,r,n,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return ke(e,t,r,n,o)}catch(u){if(!(u instanceof ne)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let f of l)t.constants.delete(f);}return t.constantCounter=a,t.varCounter=c,M6(e,t,r,n)}}function M6(e,t,r,n){t.definite=false;let o=j(t,r),i=j(t,I6),s=Z(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var T6=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function O6(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let s of o){let a=s._zod.def;if(a.when&&!T6.has(a.check))throw new ne('check with a custom "when" condition');switch(a.check){case "greater_than":L6(e,t,a,i);break;case "less_than":N6(e,t,a,i);break;case "multiple_of":F6(e,t,a,i);break;case "number_format":$y(e,a,i);break;case "min_length":{let c=Tr(a.minimum,"min_length"),u=Dd(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=Tr(a.maximum,"max_length"),u=Dd(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=Tr(a.length,"length_equals"),u=Dd(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case "min_size":e.write(`if (${i}.size < ${Tr(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${Tr(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${Tr(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=wy(e,t,a,i);break;case "custom":i=G6(e,t,s,i);break;case "bigint_format":z6(e,a,i);break;case "mime_type":D6(e,t,a,i);break;case "property":Z6(e,t,a,i);break;case "properties":B6(e,t,a,i);break;case "overwrite":{let c=Z(t);U6(e,t,s,i,c),i=c;break}default:throw new ne(`check type ${a.check}`)}}return i}function Dd(e,t,r,n){let o=j(t,_n),i=Z(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function Tr(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new ne(`${t} bound of type ${typeof e}`);return `${e}`}function xy(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new ne("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new ne("comparison check with Invalid Date bound");return j(e,t)}throw new ne(`comparison check bound of type ${typeof t}`)}function L6(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${xy(t,r.value)}) return INVALID;`);}function N6(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${xy(t,r.value)}) return INVALID;`);}function F6(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new ne("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`);}else {let o=j(t,Gi);e.write(`if (${o}(${n}, ${Tr(r.value,"multiple_of")}) !== 0) return INVALID;`);}}function $y(e,t,r){let n=t.format;switch(n){case "safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case "int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case "uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case "float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case "float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new ne(`number format ${n}`)}}function z6(e,t,r){let n=t.format;if(n)switch(n){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new ne(`bigint format ${n}`)}}function D6(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=j(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`);}}function B6(e,t,r,n){if(r.when)throw new ne('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?j(t,i):st(i),a=Z(t);e.write(`const ${a} = ${n}[${s}];`),tt(e,t,o[i],a,false);}}function Z6(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;ke(e,t,r.schema,o);}function U6(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new ne("overwrite check without a transform function");if(Sn(i))throw new zt("z.compile: async overwrite transforms are not supported");let s=j(t,i);e.write(`const ${o} = ${s}(${n});`);}function Bd(){throw new _t}function Gd(e){this.issues.push(e);}function G6(e,t,r,n){let o=r._zod.def;if(o.fn){if(Sn(o.fn))throw new zt("z.compile: async .refine() predicates are not supported");let i=wn(t,o.fn),s=j(t,Bd),a=Z(t);return e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),n}if(r._zod.check){if(Sn(r._zod.check))throw new zt("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=wn(t,u=>{let l={value:u,issues:[],addIssue:Gd};return i(l)instanceof Promise&&Bd(),l.issues.length===0?l.value:ct}),c=Z(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new ne("custom check without a predicate or check function")}var Q6=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function wy(e,t,r,n,o=true){let i=r.format;if(i==="base64"){let u=j(t,us);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=j(t,_c);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=j(t,xc),l=j(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=j(t,cs);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=j(t,hc);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=j(t,bc);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=j(t,yc);return e.write(`if (!${u}(${n})) return INVALID;`),n}let s=r;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=j(t,mc),l=j(t,r),f=Z(t),p=Z(t);if(e.write(`const ${f} = ${n}.trim();`),e.write(`const ${p} = ${u}(${f}, ${l});`),e.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let d=j(t,pc);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=j(t,dc);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=Z(t),h=s.normalize?`${p}.href`:`${j(t,as)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=r.fn;if(a){if(Sn(a))throw new ne(`async string format ${i}`);let u=j(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(Q6.has(i)&&r.pattern){let u=j(t,r.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${n})) return INVALID;`),n}let c=r.format;switch(c){case "regex":throw new ne("regex format without a pattern");case "lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case "uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case "includes":e.write(`if (!${n}.includes(${st(r.includes)})) return INVALID;`);break;case "starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${st(u)}) return INVALID;`);break}case "ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${st(u)}) return INVALID;`);break}default:throw new ne(`string format ${c}`)}return n}function ke(e,t,r,n,o=true){let i=r._zod.def,s=i.type;if(i.coerce)throw new ne(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=j6(e,t,r,n,a);break;case "number":c=V6(e,r,n);break;case "boolean":c=H6(e,n);break;case "bigint":c=W6(e,r,n);break;case "symbol":c=q6(e,n);break;case "undefined":c=X6(e,n);break;case "null":c=Y6(e,n);break;case "any":case "unknown":c=n;break;case "never":e.write("return INVALID;"),c=n;break;case "void":c=K6(e,n);break;case "nan":c=J6(e,n);break;case "date":c=eC(e,n);break;case "object":c=tC(e,t,r,n,a);break;case "optional":c=rC(e,t,r,n,a);break;case "nullable":c=iC(e,t,r,n,a);break;case "array":c=sC(e,t,r,n,a);break;case "literal":c=aC(e,t,r,n);break;case "enum":c=cC(e,t,r,n);break;case "readonly":{let u=_y(e,t,r,n),l=Z(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":_y(e,t,r,n),c="true";break;case "default":case "prefault":c=uC(e,t,r,n);break;case "nonoptional":c=lC(e,t,r,n);break;case "tuple":c=fC(e,t,r,n);break;case "union":c=mC(e,t,r,n);break;case "intersection":c=hC(e,t,r,n);break;case "record":c=gC(e,t,r,n);break;case "map":c=bC(e,t,r,n);break;case "set":c=yC(e,t,r,n);break;case "file":c=xC(e,n);break;case "template_literal":c=$C(e,t,r,n);break;case "lazy":c=wC(e,t,r,n);break;case "pipe":c=SC(e,t,r,n);break;case "custom":c=CC(e,t,r,n);break;case "transform":c=vC(e,t,r,n);break;case "catch":c=AC(e,t,r,n);break;default:throw new ne(`schema type ${s}`)}return c===null?null:O6(e,t,r,c)}function j6(e,t,r,n,o=true){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:wy(e,t,i,n,o)}function V6(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&$y(e,{format:n.format},r),r}function H6(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function W6(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function q6(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function X6(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Y6(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function K6(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function J6(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function eC(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function tC(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=b=>typeof b=="symbol"?j(t,b):st(b),f=b=>typeof b=="symbol"?`[${l(b)}]`:st(b),p=s;if(a.includes("__proto__"))throw new ne('object shape key "__proto__"');let m=new Map;for(let b of u){let y=p[b],S=l(b),C=Z(t);if(e.write(`const ${C} = ${n}[${S}];`),y._zod.optin!==void 0){let w=Z(t);e.write(`let ${w} = (() => {`),e.indented($=>{let E=tt($,t,y,C);$.write(`return ${E};`);}),e.write("})();"),y._zod.optout==="optional"?(e.write(`if (${w} === INVALID) {`),e.indented($=>{$.write(`if (${S} in ${n}) return INVALID;`),$.write(`${w} = undefined;`);}),e.write("}")):e.write(`if (${w} === INVALID) return INVALID;`),m.set(b,w);}else {oC(y)&&e.write(`if (!(${S} in ${n})) return INVALID;`);let w=tt(e,t,y,C,o);w!==null&&m.set(b,w);}}let h=i.catchall,d="none";if(h){let b=h._zod.def.type;if(b==="never"){let y=a.map(S=>`k !== ${st(S)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(S=>{S.write(`if (${y}) return INVALID;`);}),e.write("}");}else (b==="unknown"||b==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=Z(t),_=u.some(b=>gy(p[b])||Zd(p[b]));if(!o){if(d==="schema"){let b=a.length>0?j(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(y=>{y.write('if (k === "__proto__") continue;'),b&&y.write(`if (${b}.has(k)) continue;`);let S=Z(t);y.write(`const ${S} = ${n}[k];`),tt(y,t,h,S,false);}),e.write("}");}return null}if(_){e.write(`const ${g} = {};`);for(let b of u){let y=l(b),S=m.get(b);Zd(p[b])?e.write(`if (${y} in ${n}) ${g}[${y}] = ${S};`):gy(p[b])?e.write(`if (${S} !== undefined || ${y} in ${n}) ${g}[${y}] = ${S};`):e.write(`${g}[${y}] = ${S};`);}}else {let b=u.map(y=>`${f(y)}: ${m.get(y)}`).join(", ");e.write(`const ${g} = { ${b} };`);}if(d!=="none"){let b=a.length>0?j(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(y=>{if(y.write('if (k === "__proto__") continue;'),b&&y.write(`if (${b}.has(k)) continue;`),d==="passthrough")y.write(`${g}[k] = ${n}[k];`);else {let S=Z(t);y.write(`const ${S} = ${n}[k];`);let C=tt(y,t,h,S);y.write(`${g}[k] = ${C};`);}}),e.write("}");}return g}function rC(e,t,r,n,o=true){let i=r._zod.def;if(nC(r))return ke(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let a=Z(t),c=Z(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=ke(l,t,i.innerType,n);l.write(`return ${f};`);}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`);}),e.write("} else {"),e.indented(u=>{let l=ke(u,t,i.innerType,n);u.write(`${a} = ${l};`);}),e.write("}"),a}let s=o?Z(t):null;return s&&e.write(`let ${s};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=ke(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function nC(e){return e._zod.traits?.has("$ZodExactOptional")===true}function oC(e){return e._zod.optin===void 0&&$n(e)}function $n(e){if(e._zod.def.coerce)return true;let t=e._zod.def;switch(t.type){case "any":case "unknown":case "undefined":case "void":case "default":case "prefault":case "transform":case "custom":case "lazy":return true;case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "never":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":return false;case "nonoptional":return t.innerType?$n(t.innerType):false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":case "nullable":case "readonly":case "success":return t.innerType?$n(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some($n):true;case "intersection":return !t.left||!t.right?true:$n(t.left)&&$n(t.right);case "pipe":return t.in?$n(t.in):true;default:return true}}function Zd(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function gy(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&Lo(e)}function Lo(e){let t=e._zod.def;switch(t.type){case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":case "never":case "success":return false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":return true;case "nullable":case "readonly":case "nonoptional":return t.innerType?Lo(t.innerType):true;case "union":return t.options?t.options.some(Lo):true;case "intersection":return !t.left||!t.right||Lo(t.left)||Lo(t.right);case "pipe":return t.out?Lo(t.out):true;default:return true}}function iC(e,t,r,n,o=true){let i=r._zod.def,s=o?Z(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=ke(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function Qd(e,t,r){for(let[n,o]of Ao(t._zod.def.checks))e.write(`if (${r} > ${Tr(n,o._zod.def.check)}) return INVALID;`);}function sC(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),Qd(e,r,`${n}.length`);let s=o?Z(t):null,a=Z(t),c=Z(t);return s&&e.write(`const ${s} = new Array(${n}.length);`),e.write(`for (let ${a} = 0; ${a} < ${n}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${n}[${a}];`);let l=tt(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function aC(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=j(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=j(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${st(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${n} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${n} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${n} !== ${s}n) return INVALID;`);else throw new ne(`literal type ${typeof s}`);return n}function cC(e,t,r,n){let o=r._zod.values;if(!o)throw new ne("enum schema without enumerated values");let i=j(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function _y(e,t,r,n){let o=r._zod.def;return ke(e,t,o.innerType,n)}function uC(e,t,r,n){let o=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return ke(e,t,o.innerType,n);let c=j(t,s),u=Z(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),ke(e,t,o.innerType,u)}let a=Z(t);if(s){let c=j(t,s),u=j(t,Qi);e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`);}),e.write("} else {"),e.indented(l=>{let f=ke(l,t,o.innerType,n);l.write(`${a} = ${f} === undefined ? ${u}(${c}()) : ${f};`);}),e.write("}");}else e.write(`let ${a};`),e.write(`if (${n} !== undefined) {`),e.indented(c=>{let u=ke(c,t,o.innerType,n);c.write(`${a} = ${u};`);}),e.write("}");return a}function lC(e,t,r,n){let o=r._zod.def,i=ke(e,t,o.innerType,n),s=Z(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function fC(e,t,r,n){let o=r._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let a=by(i,"optin"),c=by(i,"optout");s?e.write(`if (${n}.length < ${a}) return INVALID;`):e.write(`if (${n}.length < ${a} || ${n}.length > ${i.length}) return INVALID;`);let u=Z(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let f=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(p=>{p.write(`if (${l} < ${n}.length) {`),p.indented(m=>{let h=Z(t);m.write(`const ${h} = ${n}[${l}];`);let d=tt(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(Zd(f)){m.write(`${u}.length = ${l};`);return}let h=Z(t),d=Z(t);m.write(`const ${h} = undefined;`),m.write(`const ${d} = (() => {`),m.indented(g=>{let _=tt(g,t,f,h);g.write(`return ${_};`);}),m.write("})();"),m.write(`if (${d} === INVALID || ${d} === undefined) ${u}.length = ${l};`),m.write(`else ${u}[${l}] = ${d};`);}),p.write("}");}),e.write("}");else {let p=Z(t);e.write(`const ${p} = ${n}[${l}];`);let m=tt(e,t,f,p);e.write(`${u}[${l}] = ${m};`);}}if(s){let l=Z(t),f=Z(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${n}.length; ${l}++) {`),e.indented(p=>{p.write(`const ${f} = ${n}[${l}];`);let m=tt(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function by(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function mC(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return pC(e,t,o,n);if(o.inclusive===false)throw new ne("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return ke(e,t,i[0],n);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=j(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=Z(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let f=ke(l,t,u,n);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function pC(e,t,r,n){if(r.unionFallback)throw new ne("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=Z(t),i=Z(t);e.write(`const ${o} = ${n}?.[${st(r.discriminator)}];`),e.write(`let ${i};`);let s=true,a=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new ne("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new ne(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>dC(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=ke(p,t,c,n);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function dC(e,t,r){if(typeof r=="string")return `${t} === ${st(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return `${t} === ${r}`;if(r===null)return `${t} === null`;if(r===void 0)return `${t} === undefined`;if(typeof r=="bigint")return `${t} === ${r}n`;if(typeof r=="symbol"){let n=j(e,r);return `${t} === ${n}`}throw new ne(`literal discriminator value ${String(r)}`)}function hC(e,t,r,n){let o=r._zod.def;t.definite=false;let i=tt(e,t,o.left,n),s=tt(e,t,o.right,n),a=j(t,To),c=Z(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function gC(e,t,r,n){let o=r._zod.def,i=j(t,Rt);e.write(`if (!${i}(${n})) return INVALID;`);let s=Z(t),a=Z(t),c=Z(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let m=[];for(let d of l){if(!(typeof d=="string"||typeof d=="number"||typeof d=="symbol"))throw new ne(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new ne('record key "__proto__"');m.push(g);let _=j(t,d),b=ke(e,t,o.keyType,_),y=Z(t);e.write(`const ${y} = ${n}[${_C(t,g)}];`);let S=tt(e,t,o.valueType,y);e.write(`${s}[${b}] = ${S};`);}let h=j(t,new Set(m));return e.write(`for (const ${a} in ${n}) {`),e.indented(d=>{d.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?d.write(`if (${a} !== "__proto__") ${s}[${a}] = ${n}[${a}];`):d.write("return INVALID;");}),e.write("}"),s}let f=o.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let m=o.mode==="loose",h=Nc(o.keyType);h.definite===false&&(t.definite=false);let d=j(t,h),g=j(t,mr),_=Z(t);return yy(e,t,n,a,b=>{b.write(`let ${_} = ${d}(${a});`),b.write(`if (${_} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${_} = ${d}(Number(${a}));`),m?b.write(`if (${_} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):b.write(`if (${_} === INVALID) return INVALID;`),b.write(`if (${_} === "__proto__") continue;`);let y=Z(t);b.write(`const ${y} = ${n}[${a}];`);let S=tt(b,t,o.valueType,y);b.write(`${s}[${_}] = ${S};`);}),s}return yy(e,t,n,a,m=>{m.write(`const ${c} = ${n}[${a}];`);let h=tt(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function yy(e,t,r,n,o,i){let s=j(t,Object.prototype.propertyIsEnumerable),a=Z(t),c=Z(t),u=Z(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${c}[${u}];`),l.write(`if (${n} === "__proto__" || !${s}.call(${r}, ${n})) continue;`),o(l);}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${a}[${u}];`),l.write(`if (!${s}.call(${r}, ${n})) continue;`),i?l.write(i):o(l);}),e.write("}");}function _C(e,t){return typeof t=="string"?st(t):j(e,t)}function bC(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),Qd(e,r,`${n}.size`);let i=Z(t),s=Z(t),a=Z(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${n}) {`),e.indented(c=>{let u=ke(c,t,o.keyType,s),l=ke(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function yC(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),Qd(e,r,`${n}.size`);let i=Z(t),s=Z(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${n}) {`),e.indented(a=>{let c=ke(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function xC(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function $C(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=j(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`);}return n}function wC(e,t,r,n){let o=r._zod.def,i=wn(t,o.getter),s=j(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;");}),c.write("};");}),e.write("}");let a=Z(t);return e.write(`const ${a} = ${s}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function SC(e,t,r,n){let o=r._zod.def,i=ke(e,t,o.in,n);if(o.transform){if(Sn(o.transform))throw new zt("z.compile: async transforms in pipes are not supported");let s=o.transform,c=wn(t,l=>{let f={value:l,issues:[],addIssue:Gd},p=s(l,f);return p instanceof Promise?ct:f.issues.length===0?p:ct}),u=Z(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),ke(e,t,o.out,u)}else return ke(e,t,o.out,i)}function Sn(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function CC(e,t,r,n){let o=r._zod.def;if(o.fn){if(Sn(o.fn))throw new zt("z.compile: async custom predicates are not supported");let i=wn(t,o.fn),s=j(t,Bd),a=Z(t);e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`);}else throw new ne("custom schema without a predicate function");return n}function EC(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return ct;let o=n;return o.issues.length===0?o.value:t()}function AC(e,t,r,n){let o=r._zod.def;if(!o.catchValue[Ga])throw new ne("catch with a callback (only a constant catch value compiles)",false);let i=Z(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=tt(u,t,o.innerType,n);u.write(`return ${l};`);}),e.write("})();");let s=j(t,o.innerType),a=wn(t,o.catchValue),c=j(t,EC);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${n});`),u.write(`if (${i} === INVALID) return INVALID;`);}),e.write("}"),i}function vC(e,t,r,n){let o=r._zod.def;if(o.transform){if(Sn(o.transform))throw new zt("z.compile: async transforms are not supported");let i=o.transform,a=wn(t,u=>{let l={value:u,issues:[],addIssue:Gd},f=i(u,l);return f instanceof Promise?ct:l.issues.length===0?f:ct}),c=Z(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}function Fc(e){return e.checks&&(e.checks=[...e.checks]),e}function jd(e,t){return new e(Fc({type:"string",...L(t)}))}function Vd(e,t){return new e(Fc({type:"string",coerce:true,...L(t)}))}function zc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...L(t)})}function Dc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...L(t)})}function Bc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...L(t)})}function Zc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...L(t)})}function Uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...L(t)})}function Gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...L(t)})}function bs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...L(t)})}function Qc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...L(t)})}function jc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...L(t)})}function Vc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...L(t)})}function Hc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...L(t)})}function Wc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...L(t)})}function qc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...L(t)})}function Xc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...L(t)})}function Yc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...L(t)})}function Kc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...L(t)})}function Hd(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...L(t)})}function Jc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...L(t)})}function eu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...L(t)})}function tu(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...L(t)})}function ru(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...L(t)})}function nu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...L(t)})}function Wd(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...L(t)})}function qd(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...L(t)})}function ou(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...L(t)})}var Xd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ys(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...L(t)})}function xs(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function $s(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function ws(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function Yd(e,t){return new e(Fc({type:"number",checks:[],...L(t)}))}function Kd(e,t){return new e(Fc({type:"number",coerce:true,checks:[],...L(t)}))}function Jd(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...L(t)})}function eh(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...L(t)})}function th(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...L(t)})}function rh(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...L(t)})}function nh(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...L(t)})}function oh(e,t){return new e({type:"boolean",...L(t)})}function ih(e,t){return new e({type:"boolean",coerce:true,...L(t)})}function sh(e,t){return new e({type:"bigint",...L(t)})}function ah(e,t){return new e({type:"bigint",coerce:true,...L(t)})}function ch(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...L(t)})}function uh(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...L(t)})}function lh(e,t){return new e({type:"symbol",...L(t)})}function fh(e,t){return new e({type:"undefined",...L(t)})}function mh(e,t){return new e({type:"null",...L(t)})}function ph(e){return new e({type:"any"})}function dh(e){return new e({type:"unknown"})}function hh(e,t){return new e({type:"never",...L(t)})}function gh(e,t){return new e({type:"void",...L(t)})}function _h(e,t){return new e({type:"date",...L(t)})}function bh(e,t){return new e({type:"date",coerce:true,...L(t)})}function yh(e,t){return new e({type:"nan",...L(t)})}function Yt(e,t){return new ic({check:"less_than",...L(t),value:e,inclusive:false})}function St(e,t){return new ic({check:"less_than",...L(t),value:e,inclusive:true})}function Kt(e,t){return new sc({check:"greater_than",...L(t),value:e,inclusive:false})}function Ct(e,t){return new sc({check:"greater_than",...L(t),value:e,inclusive:true})}function iu(e){return Kt(0,e)}function su(e){return Yt(0,e)}function au(e){return St(0,e)}function cu(e){return Ct(0,e)}function Or(e,t){return new tp({check:"multiple_of",...L(t),value:e})}function Lr(e,t){return new op({check:"max_size",...L(t),maximum:e})}function Jt(e,t){return new ip({check:"min_size",...L(t),minimum:e})}function Cn(e,t){return new sp({check:"size_equals",...L(t),size:e})}function En(e,t){return new ap({check:"max_length",...L(t),maximum:e})}function pr(e,t){return new cp({check:"min_length",...L(t),minimum:e})}function An(e,t){return new up({check:"length_equals",...L(t),length:e})}function No(e,t){return new lp({check:"string_format",format:"regex",...L(t),pattern:e})}function Fo(e){return new fp({check:"string_format",format:"lowercase",...L(e)})}function zo(e){return new mp({check:"string_format",format:"uppercase",...L(e)})}function Do(e,t){return new pp({check:"string_format",format:"includes",...L(t),includes:e})}function Bo(e,t){return new dp({check:"string_format",format:"starts_with",...L(t),prefix:e})}function Zo(e,t){return new hp({check:"string_format",format:"ends_with",...L(t),suffix:e})}function uu(e,t,r){return new gp({check:"property",property:e,schema:t,...L(r)})}function Uo(e,t){return new _p({check:"properties",shape:e,...L(t)})}function Go(e,t){return new bp({check:"mime_type",mime:e,...L(t)})}function Dt(e){return new yp({check:"overwrite",tx:e})}function Qo(e){return Dt(t=>t.normalize(e))}function jo(){return Dt(e=>e.trim())}function Vo(){return Dt(e=>e.toLowerCase())}function Ho(){return Dt(e=>e.toUpperCase())}function Wo(){return Dt(e=>rm(e))}function xh(e,t,r){return new e({type:"array",element:t,...L(r)})}function RC(e,t,r){return new e({type:"union",options:t,...L(r)})}function PC(e,t,r){return new e({type:"union",options:t,inclusive:false,...L(r)})}function kC(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...L(n)})}function IC(e,t,r){return new e({type:"intersection",left:t,right:r})}function MC(e,t,r,n){let o=r instanceof W,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...L(i)})}function TC(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...L(n)})}function OC(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...L(n)})}function LC(e,t,r){return new e({type:"set",valueType:t,...L(r)})}function NC(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...L(r)})}function FC(e,t,r){return new e({type:"enum",entries:t,...L(r)})}function zC(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...L(r)})}function $h(e,t){return new e({type:"file",...L(t)})}function DC(e,t){return new e({type:"transform",transform:t})}function BC(e,t){return new e({type:"optional",innerType:t})}function ZC(e,t){return new e({type:"nullable",innerType:t})}function UC(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Qi(r)}})}function GC(e,t,r){return new e({type:"nonoptional",innerType:t,...L(r)})}function QC(e,t){return new e({type:"success",innerType:t})}function jC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:um(r)})}function VC(e,t,r){return new e({type:"pipe",in:t,out:r})}function HC(e,t){return new e({type:"readonly",innerType:t})}function WC(e,t,r){return new e({type:"template_literal",parts:t,...L(r)})}function qC(e,t){return new e({type:"lazy",getter:t})}function XC(e,t){return new e({type:"promise",innerType:t})}function wh(e,t,r){let n=L(r);return n.abort??(n.abort=true),new e({type:"custom",check:"custom",fn:t,...n})}function Sh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...L(r)})}function Ch(e,t){let r=Sy(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(vo(o,n.value,r._zod.def));else {let i=o;i.fatal&&(i.continue=false),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(vo(i));}},e(n.value,n)),t);return r}function Sy(e,t){let r=new xe({check:"custom",...L(t)});return r._zod.check=e,r}function Eh(e){let t=new xe({check:"describe"});return t._zod.onattach=[r=>{let n=Ye.get(r)??{};Ye.add(r,{...n,description:e});}],t._zod.check=()=>{},t}function Ah(e){let t=new xe({check:"meta"});return t._zod.onattach=[r=>{let n=Ye.get(r)??{};Ye.add(r,{...n,...e});}],t._zod.check=()=>{},t}function vh(e,t){let r=L(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(n),s=new Set(o),a=e.Codec??ps,c=e.Boolean??fs,u=e.String??xn,l=new u({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:l,out:f,transform:((m,h)=>{let d=m;return r.case!=="sensitive"&&(d=d.toLowerCase()),i.has(d)?true:s.has(d)?false:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:p,continue:false}),{})}),reverseTransform:((m,h)=>m===true?n[0]||"true":o[0]||"false"),error:r.error});return p._zod.bag.truthy=n,p._zod.bag.falsy=o,p._zod.bag.case=r.case??"insensitive",p}function vn(e,t,r,n={}){let o=L(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Ss(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&Xe(e,n,r[n]);return e}function Nr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ye,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Ue(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return false;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),true}function ge(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else {let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else {let p=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,l);}let f=e._zod.parent;f&&(s.ref||(s.ref=f),ge(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Ss(s.schema,c),t.io==="input"&&ut(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Cy(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Fr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0]);}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(h=>h);if(f)return {ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${Cy(m)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return {ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return {defId:l,ref:u+Cy(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let f in l)delete l[f];l.$ref=c;};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
60
+ }`,p;try{p=new l(...s,f)(...a);}catch(m){throw new ee(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=n.definite,p}function j(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function wn(e,t){return e.definite=false,j(e,t)}function U(e){return `v${e.varCounter++}`}function T6(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return at;let n=r;return n.issues.length===0?n.value:at}function et(e,t,r,n,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return ke(e,t,r,n,o)}catch(u){if(!(u instanceof ee)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let f of l)t.constants.delete(f);}return t.constantCounter=a,t.varCounter=c,O6(e,t,r,n)}}function O6(e,t,r,n){t.definite=false;let o=j(t,r),i=j(t,T6),s=U(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var L6=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function N6(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let s of o){let a=s._zod.def;if(a.when&&!L6.has(a.check))throw new ee('check with a custom "when" condition');switch(a.check){case "greater_than":F6(e,t,a,i);break;case "less_than":z6(e,t,a,i);break;case "multiple_of":D6(e,t,a,i);break;case "number_format":Sy(e,a,i);break;case "min_length":{let c=Mr(a.minimum,"min_length"),u=Zd(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=Mr(a.maximum,"max_length"),u=Zd(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=Mr(a.length,"length_equals"),u=Zd(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case "min_size":e.write(`if (${i}.size < ${Mr(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${Mr(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${Mr(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=Cy(e,t,a,i);break;case "custom":i=j6(e,t,s,i);break;case "bigint_format":B6(e,a,i);break;case "mime_type":Z6(e,t,a,i);break;case "property":G6(e,t,a,i);break;case "properties":U6(e,t,a,i);break;case "overwrite":{let c=U(t);Q6(e,t,s,i,c),i=c;break}default:throw new ee(`check type ${a.check}`)}}return i}function Zd(e,t,r,n){let o=j(t,_n),i=U(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function Mr(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new ee(`${t} bound of type ${typeof e}`);return `${e}`}function wy(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new ee("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new ee("comparison check with Invalid Date bound");return j(e,t)}throw new ee(`comparison check bound of type ${typeof t}`)}function F6(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${wy(t,r.value)}) return INVALID;`);}function z6(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${wy(t,r.value)}) return INVALID;`);}function D6(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new ee("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`);}else {let o=j(t,Qi);e.write(`if (${o}(${n}, ${Mr(r.value,"multiple_of")}) !== 0) return INVALID;`);}}function Sy(e,t,r){let n=t.format;switch(n){case "safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case "int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case "uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case "float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case "float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new ee(`number format ${n}`)}}function B6(e,t,r){let n=t.format;if(n)switch(n){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new ee(`bigint format ${n}`)}}function Z6(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=j(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`);}}function U6(e,t,r,n){if(r.when)throw new ee('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?j(t,i):it(i),a=U(t);e.write(`const ${a} = ${n}[${s}];`),et(e,t,o[i],a,false);}}function G6(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;ke(e,t,r.schema,o);}function Q6(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new ee("overwrite check without a transform function");if(Sn(i))throw new zt("z.compile: async overwrite transforms are not supported");let s=j(t,i);e.write(`const ${o} = ${s}(${n});`);}function Ud(){throw new gt}function jd(e){this.issues.push(e);}function j6(e,t,r,n){let o=r._zod.def;if(o.fn){if(Sn(o.fn))throw new zt("z.compile: async .refine() predicates are not supported");let i=wn(t,o.fn),s=j(t,Ud),a=U(t);return e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),n}if(r._zod.check){if(Sn(r._zod.check))throw new zt("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=wn(t,u=>{let l={value:u,issues:[],addIssue:jd};return i(l)instanceof Promise&&Ud(),l.issues.length===0?l.value:at}),c=U(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new ee("custom check without a predicate or check function")}var V6=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Cy(e,t,r,n,o=true){let i=r.format;if(i==="base64"){let u=j(t,ls);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=j(t,yc);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=j(t,wc),l=j(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=j(t,us);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=j(t,_c);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=j(t,xc);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=j(t,$c);return e.write(`if (!${u}(${n})) return INVALID;`),n}let s=r;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=j(t,dc),l=j(t,r),f=U(t),p=U(t);if(e.write(`const ${f} = ${n}.trim();`),e.write(`const ${p} = ${u}(${f}, ${l});`),e.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let d=j(t,hc);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=j(t,gc);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=U(t),h=s.normalize?`${p}.href`:`${j(t,cs)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=r.fn;if(a){if(Sn(a))throw new ee(`async string format ${i}`);let u=j(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(V6.has(i)&&r.pattern){let u=j(t,r.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${n})) return INVALID;`),n}let c=r.format;switch(c){case "regex":throw new ee("regex format without a pattern");case "lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case "uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case "includes":e.write(`if (!${n}.includes(${it(r.includes)})) return INVALID;`);break;case "starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${it(u)}) return INVALID;`);break}case "ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${it(u)}) return INVALID;`);break}default:throw new ee(`string format ${c}`)}return n}function ke(e,t,r,n,o=true){let i=r._zod.def,s=i.type;if(i.coerce)throw new ee(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=H6(e,t,r,n,a);break;case "number":c=W6(e,r,n);break;case "boolean":c=q6(e,n);break;case "bigint":c=X6(e,r,n);break;case "symbol":c=Y6(e,n);break;case "undefined":c=K6(e,n);break;case "null":c=J6(e,n);break;case "any":case "unknown":c=n;break;case "never":e.write("return INVALID;"),c=n;break;case "void":c=eC(e,n);break;case "nan":c=tC(e,n);break;case "date":c=rC(e,n);break;case "object":c=nC(e,t,r,n,a);break;case "optional":c=oC(e,t,r,n,a);break;case "nullable":c=aC(e,t,r,n,a);break;case "array":c=cC(e,t,r,n,a);break;case "literal":c=uC(e,t,r,n);break;case "enum":c=lC(e,t,r,n);break;case "readonly":{let u=yy(e,t,r,n),l=U(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":yy(e,t,r,n),c="true";break;case "default":case "prefault":c=fC(e,t,r,n);break;case "nonoptional":c=mC(e,t,r,n);break;case "tuple":c=pC(e,t,r,n);break;case "union":c=dC(e,t,r,n);break;case "intersection":c=_C(e,t,r,n);break;case "record":c=bC(e,t,r,n);break;case "map":c=xC(e,t,r,n);break;case "set":c=$C(e,t,r,n);break;case "file":c=wC(e,n);break;case "template_literal":c=SC(e,t,r,n);break;case "lazy":c=CC(e,t,r,n);break;case "pipe":c=vC(e,t,r,n);break;case "custom":c=AC(e,t,r,n);break;case "transform":c=PC(e,t,r,n);break;case "catch":c=RC(e,t,r,n);break;default:throw new ee(`schema type ${s}`)}return c===null?null:N6(e,t,r,c)}function H6(e,t,r,n,o=true){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:Cy(e,t,i,n,o)}function W6(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&Sy(e,{format:n.format},r),r}function q6(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function X6(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case "int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case "uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function Y6(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function K6(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function J6(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function eC(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function tC(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function rC(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function nC(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=b=>typeof b=="symbol"?j(t,b):it(b),f=b=>typeof b=="symbol"?`[${l(b)}]`:it(b),p=s;if(a.includes("__proto__"))throw new ee('object shape key "__proto__"');let m=new Map;for(let b of u){let y=p[b],S=l(b),C=U(t);if(e.write(`const ${C} = ${n}[${S}];`),y._zod.optin!==void 0){let w=U(t);e.write(`let ${w} = (() => {`),e.indented($=>{let v=et($,t,y,C);$.write(`return ${v};`);}),e.write("})();"),y._zod.optout==="optional"?(e.write(`if (${w} === INVALID) {`),e.indented($=>{$.write(`if (${S} in ${n}) return INVALID;`),$.write(`${w} = undefined;`);}),e.write("}")):e.write(`if (${w} === INVALID) return INVALID;`),m.set(b,w);}else {sC(y)&&e.write(`if (!(${S} in ${n})) return INVALID;`);let w=et(e,t,y,C,o);w!==null&&m.set(b,w);}}let h=i.catchall,d="none";if(h){let b=h._zod.def.type;if(b==="never"){let y=a.map(S=>`k !== ${it(S)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(S=>{S.write(`if (${y}) return INVALID;`);}),e.write("}");}else (b==="unknown"||b==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=U(t),_=u.some(b=>by(p[b])||Gd(p[b]));if(!o){if(d==="schema"){let b=a.length>0?j(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(y=>{y.write('if (k === "__proto__") continue;'),b&&y.write(`if (${b}.has(k)) continue;`);let S=U(t);y.write(`const ${S} = ${n}[k];`),et(y,t,h,S,false);}),e.write("}");}return null}if(_){e.write(`const ${g} = {};`);for(let b of u){let y=l(b),S=m.get(b);Gd(p[b])?e.write(`if (${y} in ${n}) ${g}[${y}] = ${S};`):by(p[b])?e.write(`if (${S} !== undefined || ${y} in ${n}) ${g}[${y}] = ${S};`):e.write(`${g}[${y}] = ${S};`);}}else {let b=u.map(y=>`${f(y)}: ${m.get(y)}`).join(", ");e.write(`const ${g} = { ${b} };`);}if(d!=="none"){let b=a.length>0?j(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(y=>{if(y.write('if (k === "__proto__") continue;'),b&&y.write(`if (${b}.has(k)) continue;`),d==="passthrough")y.write(`${g}[k] = ${n}[k];`);else {let S=U(t);y.write(`const ${S} = ${n}[k];`);let C=et(y,t,h,S);y.write(`${g}[k] = ${C};`);}}),e.write("}");}return g}function oC(e,t,r,n,o=true){let i=r._zod.def;if(iC(r))return ke(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let a=U(t),c=U(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=ke(l,t,i.innerType,n);l.write(`return ${f};`);}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`);}),e.write("} else {"),e.indented(u=>{let l=ke(u,t,i.innerType,n);u.write(`${a} = ${l};`);}),e.write("}"),a}let s=o?U(t):null;return s&&e.write(`let ${s};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=ke(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function iC(e){return e._zod.traits?.has("$ZodExactOptional")===true}function sC(e){return e._zod.optin===void 0&&$n(e)}function $n(e){if(e._zod.def.coerce)return true;let t=e._zod.def;switch(t.type){case "any":case "unknown":case "undefined":case "void":case "default":case "prefault":case "transform":case "custom":case "lazy":return true;case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "never":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":return false;case "nonoptional":return t.innerType?$n(t.innerType):false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":case "nullable":case "readonly":case "success":return t.innerType?$n(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some($n):true;case "intersection":return !t.left||!t.right?true:$n(t.left)&&$n(t.right);case "pipe":return t.in?$n(t.in):true;default:return true}}function Gd(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function by(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&Lo(e)}function Lo(e){let t=e._zod.def;switch(t.type){case "string":case "number":case "boolean":case "bigint":case "symbol":case "null":case "nan":case "date":case "object":case "array":case "tuple":case "record":case "map":case "set":case "file":case "template_literal":case "never":case "success":return false;case "literal":return !!t.values?.includes(void 0);case "enum":return !!e._zod.values?.has(void 0);case "optional":return true;case "nullable":case "readonly":case "nonoptional":return t.innerType?Lo(t.innerType):true;case "union":return t.options?t.options.some(Lo):true;case "intersection":return !t.left||!t.right||Lo(t.left)||Lo(t.right);case "pipe":return t.out?Lo(t.out):true;default:return true}}function aC(e,t,r,n,o=true){let i=r._zod.def,s=o?U(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=ke(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function Vd(e,t,r){for(let[n,o]of Ao(t._zod.def.checks))e.write(`if (${r} > ${Mr(n,o._zod.def.check)}) return INVALID;`);}function cC(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),Vd(e,r,`${n}.length`);let s=o?U(t):null,a=U(t),c=U(t);return s&&e.write(`const ${s} = new Array(${n}.length);`),e.write(`for (let ${a} = 0; ${a} < ${n}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${n}[${a}];`);let l=et(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function uC(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=j(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=j(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${it(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${n} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${n} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${n} !== ${s}n) return INVALID;`);else throw new ee(`literal type ${typeof s}`);return n}function lC(e,t,r,n){let o=r._zod.values;if(!o)throw new ee("enum schema without enumerated values");let i=j(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function yy(e,t,r,n){let o=r._zod.def;return ke(e,t,o.innerType,n)}function fC(e,t,r,n){let o=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return ke(e,t,o.innerType,n);let c=j(t,s),u=U(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),ke(e,t,o.innerType,u)}let a=U(t);if(s){let c=j(t,s),u=j(t,ji);e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`);}),e.write("} else {"),e.indented(l=>{let f=ke(l,t,o.innerType,n);l.write(`${a} = ${f} === undefined ? ${u}(${c}()) : ${f};`);}),e.write("}");}else e.write(`let ${a};`),e.write(`if (${n} !== undefined) {`),e.indented(c=>{let u=ke(c,t,o.innerType,n);c.write(`${a} = ${u};`);}),e.write("}");return a}function mC(e,t,r,n){let o=r._zod.def,i=ke(e,t,o.innerType,n),s=U(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function pC(e,t,r,n){let o=r._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let a=xy(i,"optin"),c=xy(i,"optout");s?e.write(`if (${n}.length < ${a}) return INVALID;`):e.write(`if (${n}.length < ${a} || ${n}.length > ${i.length}) return INVALID;`);let u=U(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let f=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(p=>{p.write(`if (${l} < ${n}.length) {`),p.indented(m=>{let h=U(t);m.write(`const ${h} = ${n}[${l}];`);let d=et(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(Gd(f)){m.write(`${u}.length = ${l};`);return}let h=U(t),d=U(t);m.write(`const ${h} = undefined;`),m.write(`const ${d} = (() => {`),m.indented(g=>{let _=et(g,t,f,h);g.write(`return ${_};`);}),m.write("})();"),m.write(`if (${d} === INVALID || ${d} === undefined) ${u}.length = ${l};`),m.write(`else ${u}[${l}] = ${d};`);}),p.write("}");}),e.write("}");else {let p=U(t);e.write(`const ${p} = ${n}[${l}];`);let m=et(e,t,f,p);e.write(`${u}[${l}] = ${m};`);}}if(s){let l=U(t),f=U(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${n}.length; ${l}++) {`),e.indented(p=>{p.write(`const ${f} = ${n}[${l}];`);let m=et(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function xy(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function dC(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return hC(e,t,o,n);if(o.inclusive===false)throw new ee("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return ke(e,t,i[0],n);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=j(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=U(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let f=ke(l,t,u,n);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function hC(e,t,r,n){if(r.unionFallback)throw new ee("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=U(t),i=U(t);e.write(`const ${o} = ${n}?.[${it(r.discriminator)}];`),e.write(`let ${i};`);let s=true,a=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new ee("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new ee(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>gC(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=ke(p,t,c,n);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function gC(e,t,r){if(typeof r=="string")return `${t} === ${it(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return `${t} === ${r}`;if(r===null)return `${t} === null`;if(r===void 0)return `${t} === undefined`;if(typeof r=="bigint")return `${t} === ${r}n`;if(typeof r=="symbol"){let n=j(e,r);return `${t} === ${n}`}throw new ee(`literal discriminator value ${String(r)}`)}function _C(e,t,r,n){let o=r._zod.def;t.definite=false;let i=et(e,t,o.left,n),s=et(e,t,o.right,n),a=j(t,To),c=U(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function bC(e,t,r,n){let o=r._zod.def,i=j(t,Rt);e.write(`if (!${i}(${n})) return INVALID;`);let s=U(t),a=U(t),c=U(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let m=[];for(let d of l){if(!(typeof d=="string"||typeof d=="number"||typeof d=="symbol"))throw new ee(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new ee('record key "__proto__"');m.push(g);let _=j(t,d),b=ke(e,t,o.keyType,_),y=U(t);e.write(`const ${y} = ${n}[${yC(t,g)}];`);let S=et(e,t,o.valueType,y);e.write(`${s}[${b}] = ${S};`);}let h=j(t,new Set(m));return e.write(`for (const ${a} in ${n}) {`),e.indented(d=>{d.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?d.write(`if (${a} !== "__proto__") ${s}[${a}] = ${n}[${a}];`):d.write("return INVALID;");}),e.write("}"),s}let f=o.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let m=o.mode==="loose",h=zc(o.keyType);h.definite===false&&(t.definite=false);let d=j(t,h),g=j(t,fr),_=U(t);return $y(e,t,n,a,b=>{b.write(`let ${_} = ${d}(${a});`),b.write(`if (${_} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${_} = ${d}(Number(${a}));`),m?b.write(`if (${_} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):b.write(`if (${_} === INVALID) return INVALID;`),b.write(`if (${_} === "__proto__") continue;`);let y=U(t);b.write(`const ${y} = ${n}[${a}];`);let S=et(b,t,o.valueType,y);b.write(`${s}[${_}] = ${S};`);}),s}return $y(e,t,n,a,m=>{m.write(`const ${c} = ${n}[${a}];`);let h=et(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function $y(e,t,r,n,o,i){let s=j(t,Object.prototype.propertyIsEnumerable),a=U(t),c=U(t),u=U(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${c}[${u}];`),l.write(`if (${n} === "__proto__" || !${s}.call(${r}, ${n})) continue;`),o(l);}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${a}[${u}];`),l.write(`if (!${s}.call(${r}, ${n})) continue;`),i?l.write(i):o(l);}),e.write("}");}function yC(e,t){return typeof t=="string"?it(t):j(e,t)}function xC(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),Vd(e,r,`${n}.size`);let i=U(t),s=U(t),a=U(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${n}) {`),e.indented(c=>{let u=ke(c,t,o.keyType,s),l=ke(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function $C(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),Vd(e,r,`${n}.size`);let i=U(t),s=U(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${n}) {`),e.indented(a=>{let c=ke(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function wC(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function SC(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=j(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`);}return n}function CC(e,t,r,n){let o=r._zod.def,i=wn(t,o.getter),s=j(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;");}),c.write("};");}),e.write("}");let a=U(t);return e.write(`const ${a} = ${s}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function vC(e,t,r,n){let o=r._zod.def,i=ke(e,t,o.in,n);if(o.transform){if(Sn(o.transform))throw new zt("z.compile: async transforms in pipes are not supported");let s=o.transform,c=wn(t,l=>{let f={value:l,issues:[],addIssue:jd},p=s(l,f);return p instanceof Promise?at:f.issues.length===0?p:at}),u=U(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),ke(e,t,o.out,u)}else return ke(e,t,o.out,i)}function Sn(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function AC(e,t,r,n){let o=r._zod.def;if(o.fn){if(Sn(o.fn))throw new zt("z.compile: async custom predicates are not supported");let i=wn(t,o.fn),s=j(t,Ud),a=U(t);e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`);}else throw new ee("custom schema without a predicate function");return n}function EC(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return at;let o=n;return o.issues.length===0?o.value:t()}function RC(e,t,r,n){let o=r._zod.def;if(!o.catchValue[ja])throw new ee("catch with a callback (only a constant catch value compiles)",false);let i=U(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=et(u,t,o.innerType,n);u.write(`return ${l};`);}),e.write("})();");let s=j(t,o.innerType),a=wn(t,o.catchValue),c=j(t,EC);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${n});`),u.write(`if (${i} === INVALID) return INVALID;`);}),e.write("}"),i}function PC(e,t,r,n){let o=r._zod.def;if(o.transform){if(Sn(o.transform))throw new zt("z.compile: async transforms are not supported");let i=o.transform,a=wn(t,u=>{let l={value:u,issues:[],addIssue:jd},f=i(u,l);return f instanceof Promise?at:l.issues.length===0?f:at}),c=U(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}function Dc(e){return e.checks&&(e.checks=[...e.checks]),e}function Hd(e,t){return new e(Dc({type:"string",...L(t)}))}function Wd(e,t){return new e(Dc({type:"string",coerce:true,...L(t)}))}function Bc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...L(t)})}function Zc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...L(t)})}function Uc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...L(t)})}function Gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...L(t)})}function Qc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...L(t)})}function jc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...L(t)})}function ys(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...L(t)})}function Vc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...L(t)})}function Hc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...L(t)})}function Wc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...L(t)})}function qc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...L(t)})}function Xc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...L(t)})}function Yc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...L(t)})}function Kc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...L(t)})}function Jc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...L(t)})}function eu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...L(t)})}function qd(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...L(t)})}function tu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...L(t)})}function ru(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...L(t)})}function nu(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...L(t)})}function ou(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...L(t)})}function iu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...L(t)})}function Xd(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...L(t)})}function Yd(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...L(t)})}function su(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...L(t)})}var Kd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function xs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...L(t)})}function $s(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function ws(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function Ss(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function Jd(e,t){return new e(Dc({type:"number",checks:[],...L(t)}))}function eh(e,t){return new e(Dc({type:"number",coerce:true,checks:[],...L(t)}))}function th(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...L(t)})}function rh(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...L(t)})}function nh(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...L(t)})}function oh(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...L(t)})}function ih(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...L(t)})}function sh(e,t){return new e({type:"boolean",...L(t)})}function ah(e,t){return new e({type:"boolean",coerce:true,...L(t)})}function ch(e,t){return new e({type:"bigint",...L(t)})}function uh(e,t){return new e({type:"bigint",coerce:true,...L(t)})}function lh(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...L(t)})}function fh(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...L(t)})}function mh(e,t){return new e({type:"symbol",...L(t)})}function ph(e,t){return new e({type:"undefined",...L(t)})}function dh(e,t){return new e({type:"null",...L(t)})}function hh(e){return new e({type:"any"})}function gh(e){return new e({type:"unknown"})}function _h(e,t){return new e({type:"never",...L(t)})}function bh(e,t){return new e({type:"void",...L(t)})}function yh(e,t){return new e({type:"date",...L(t)})}function xh(e,t){return new e({type:"date",coerce:true,...L(t)})}function $h(e,t){return new e({type:"nan",...L(t)})}function Xt(e,t){return new ac({check:"less_than",...L(t),value:e,inclusive:false})}function wt(e,t){return new ac({check:"less_than",...L(t),value:e,inclusive:true})}function Yt(e,t){return new cc({check:"greater_than",...L(t),value:e,inclusive:false})}function St(e,t){return new cc({check:"greater_than",...L(t),value:e,inclusive:true})}function au(e){return Yt(0,e)}function cu(e){return Xt(0,e)}function uu(e){return wt(0,e)}function lu(e){return St(0,e)}function Tr(e,t){return new np({check:"multiple_of",...L(t),value:e})}function Or(e,t){return new sp({check:"max_size",...L(t),maximum:e})}function Kt(e,t){return new ap({check:"min_size",...L(t),minimum:e})}function Cn(e,t){return new cp({check:"size_equals",...L(t),size:e})}function vn(e,t){return new up({check:"max_length",...L(t),maximum:e})}function mr(e,t){return new lp({check:"min_length",...L(t),minimum:e})}function An(e,t){return new fp({check:"length_equals",...L(t),length:e})}function No(e,t){return new mp({check:"string_format",format:"regex",...L(t),pattern:e})}function Fo(e){return new pp({check:"string_format",format:"lowercase",...L(e)})}function zo(e){return new dp({check:"string_format",format:"uppercase",...L(e)})}function Do(e,t){return new hp({check:"string_format",format:"includes",...L(t),includes:e})}function Bo(e,t){return new gp({check:"string_format",format:"starts_with",...L(t),prefix:e})}function Zo(e,t){return new _p({check:"string_format",format:"ends_with",...L(t),suffix:e})}function fu(e,t,r){return new bp({check:"property",property:e,schema:t,...L(r)})}function Uo(e,t){return new yp({check:"properties",shape:e,...L(t)})}function Go(e,t){return new xp({check:"mime_type",mime:e,...L(t)})}function Dt(e){return new $p({check:"overwrite",tx:e})}function Qo(e){return Dt(t=>t.normalize(e))}function jo(){return Dt(e=>e.trim())}function Vo(){return Dt(e=>e.toLowerCase())}function Ho(){return Dt(e=>e.toUpperCase())}function Wo(){return Dt(e=>om(e))}function wh(e,t,r){return new e({type:"array",element:t,...L(r)})}function kC(e,t,r){return new e({type:"union",options:t,...L(r)})}function IC(e,t,r){return new e({type:"union",options:t,inclusive:false,...L(r)})}function MC(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...L(n)})}function TC(e,t,r){return new e({type:"intersection",left:t,right:r})}function OC(e,t,r,n){let o=r instanceof V,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...L(i)})}function LC(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...L(n)})}function NC(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...L(n)})}function FC(e,t,r){return new e({type:"set",valueType:t,...L(r)})}function zC(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...L(r)})}function DC(e,t,r){return new e({type:"enum",entries:t,...L(r)})}function BC(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...L(r)})}function Sh(e,t){return new e({type:"file",...L(t)})}function ZC(e,t){return new e({type:"transform",transform:t})}function UC(e,t){return new e({type:"optional",innerType:t})}function GC(e,t){return new e({type:"nullable",innerType:t})}function QC(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ji(r)}})}function jC(e,t,r){return new e({type:"nonoptional",innerType:t,...L(r)})}function VC(e,t){return new e({type:"success",innerType:t})}function HC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:fm(r)})}function WC(e,t,r){return new e({type:"pipe",in:t,out:r})}function qC(e,t){return new e({type:"readonly",innerType:t})}function XC(e,t,r){return new e({type:"template_literal",parts:t,...L(r)})}function YC(e,t){return new e({type:"lazy",getter:t})}function KC(e,t){return new e({type:"promise",innerType:t})}function Ch(e,t,r){let n=L(r);return n.abort??(n.abort=true),new e({type:"custom",check:"custom",fn:t,...n})}function vh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...L(r)})}function Ah(e,t){let r=vy(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Eo(o,n.value,r._zod.def));else {let i=o;i.fatal&&(i.continue=false),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(Eo(i));}},e(n.value,n)),t);return r}function vy(e,t){let r=new we({check:"custom",...L(t)});return r._zod.check=e,r}function Eh(e){let t=new we({check:"describe"});return t._zod.onattach=[r=>{let n=Xe.get(r)??{};Xe.add(r,{...n,description:e});}],t._zod.check=()=>{},t}function Rh(e){let t=new we({check:"meta"});return t._zod.onattach=[r=>{let n=Xe.get(r)??{};Xe.add(r,{...n,...e});}],t._zod.check=()=>{},t}function Ph(e,t){let r=L(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(n),s=new Set(o),a=e.Codec??ds,c=e.Boolean??ms,u=e.String??xn,l=new u({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:l,out:f,transform:((m,h)=>{let d=m;return r.case!=="sensitive"&&(d=d.toLowerCase()),i.has(d)?true:s.has(d)?false:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:p,continue:false}),{})}),reverseTransform:((m,h)=>m===true?n[0]||"true":o[0]||"false"),error:r.error});return p._zod.bag.truthy=n,p._zod.bag.falsy=o,p._zod.bag.case=r.case??"insensitive",p}function En(e,t,r,n={}){let o=L(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Cs(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&qe(e,n,r[n]);return e}function Lr(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Xe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Ze(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return false;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),true}function he(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else {let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else {let p=s.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,l);}let f=e._zod.parent;f&&(s.ref||(s.ref=f),he(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Cs(s.schema,c),t.io==="input"&&ct(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Ay(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Nr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0]);}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(h=>h);if(f)return {ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${Ay(m)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return {ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return {defId:l,ref:u+Ay(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let f in l)delete l[f];l.$ref=c;};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
61
61
 
62
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s);}e.external&&(e.sharedDefsExtractedFor=e.external);}function vy(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;vy(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s);}}delete e.anyOf,e.type=r.length===1?r[0]:r;}var Ry=new Set(["type","properties","required","additionalProperties"]),Ey=["oneOf","anyOf"];function Ay(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Rh(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Ry.has(s))return null;t.push(i);}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??Ay(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:Rh(a)??{allOf:a};Xe(r,s,c);}for(let s of i.required??[])n.add(s);}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===false))o.additionalProperties=false;else {let i=[];for(let s of t){let a=Ay(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a);}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i});}return o}function YC(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Ry)if(o in e)return;let r=t.filter(o=>Ey.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=Rh(t);else {let o=r[0],i=Ey.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>Rh([...s,c]));if(a.some(c=>!c))return;n={[i]:a};}n&&(delete e.allOf,Ss(e,n));}function zr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Ss(u,h),Ss(u,l),a._zod.parent===f)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(h.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g];}let p=a._zod.parent;if(p&&p!==f){n(p);let m=e.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let h in u)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h])&&delete u[h];}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]});};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of [...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())vy(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of [c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=a.get(l);f?f.push(u):a.set(l,[u]);}for(let c of e.intersections)for(let u of a.get(c)??[])YC(u);}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a);}Ss(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Xe(s,c.defId,c.def));}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:qo(t,"input",e.processors),output:qo(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ut(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return false;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return true;if(n.type==="array")return ut(n.element,r);if(n.type==="set")return ut(n.valueType,r);if(n.type==="lazy")return ut(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return ut(n.innerType,r);if(n.type==="intersection")return ut(n.left,r)||ut(n.right,r);if(n.type==="record"||n.type==="map")return ut(n.keyType,r)||ut(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:ut(n.in,r)||ut(n.out,r);if(n.type==="object"){for(let o in n.shape)if(ut(n.shape[o],r))return true;return false}if(n.type==="union"){for(let o of n.options)if(ut(o,r))return true;return false}if(n.type==="tuple"){for(let o of n.items)if(ut(o,r))return true;return !!(n.rest&&ut(n.rest,r))}return false}var Ph=(e,t={})=>r=>{let n=Nr({...r,processors:t});return ge(e,n),Fr(n,e),zr(n,e)},qo=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Nr({...o??{},target:i,io:t,processors:r});return ge(e,s),Fr(s,e),zr(s,e)};var Xo=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r);},Yo=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r);},Py=(e,t)=>{Xo(e,"minimum",t),Yo(e,"maximum",t);},Ty=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},Oy=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},Ly=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t];},Ny=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},ky=(e,t)=>Xo(e,"minimum",t.minimum),Iy=(e,t)=>Yo(e,"maximum",t.maximum),My=e=>(t,r)=>{Ny(t,r.format);let[n,o]=e[r.format];Xo(t,"minimum",n),Yo(t,"maximum",o);},KC={greater_than:(e,t)=>Xo(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Yo(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ty(e,t.value),number_format:My(Vi),bigint_format:My(Hi),min_length:ky,max_length:Iy,length_equals:(e,t)=>Py(e,t.length),min_size:ky,max_size:Iy,size_equals:(e,t)=>Py(e,t.size),string_format:(e,t)=>{Ny(e,t.format),t.pattern&&Oy(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=true);},mime_type:(e,t)=>Ly(e,t.mime)};function Ge(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)KC[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Xo(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Xo(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Yo(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Yo(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Ty(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&Ly(t,o.mime);for(let i of o.patterns??[])Oy(t,i);return t}var JC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},e8=new Map([[gc,Lm],[ls,Nm]]),Fy=e=>e8.get(e)??e,Mh=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Ge(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=JC[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let f=[...c].map(Fy);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]);}},Th=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Ge(e);o.type=l?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f?m?(o.minimum=u,o.exclusiveMinimum=true):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?m?(o.maximum=c,o.exclusiveMaximum=true):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let _ of a)Number.isFinite(_)&&_!==0?h.add(Math.abs(_)):Ue(e,t,o,n,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(_=>({multipleOf:_}))]);}},Oh=(e,t,r,n)=>{r.type="boolean";},Lh=(e,t,r,n)=>{Ue(e,t,r,n,"BigInt cannot be represented in JSON Schema");},Nh=(e,t,r,n)=>{Ue(e,t,r,n,"Symbols cannot be represented in JSON Schema");},Fh=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},zh=(e,t,r,n)=>{Ue(e,t,r,n,"Undefined cannot be represented in JSON Schema");},Dh=(e,t,r,n)=>{Ue(e,t,r,n,"Void cannot be represented in JSON Schema");},Bh=(e,t,r,n)=>{r.not={};},Zh=(e,t,r,n)=>{},Uh=(e,t,r,n)=>{},Gh=(e,t,r,n)=>{Ue(e,t,r,n,"Date cannot be represented in JSON Schema");},Qh=(e,t,r,n)=>{let o=e._zod.def,i=wo(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i;},jh=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(Ue(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Ue(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s));}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s;}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i;},Vh=(e,t,r,n)=>{Ue(e,t,r,n,"NaN cannot be represented in JSON Schema");},Hh=(e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source;},Wh=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=Ge(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})));},qh=(e,t,r,n)=>{r.type="boolean";},Xh=(e,t,r,n)=>{Ue(e,t,r,n,"Custom types cannot be represented in JSON Schema");},Yh=(e,t,r,n)=>{Ue(e,t,r,n,"Function types cannot be represented in JSON Schema");},Kh=(e,t,r,n)=>{Ue(e,t,r,n,"Transforms cannot be represented in JSON Schema");},Jh=(e,t,r,n)=>{Ue(e,t,r,n,"Map cannot be represented in JSON Schema");},e0=(e,t,r,n)=>{Ue(e,t,r,n,"Set cannot be represented in JSON Schema");},t0=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=Ge(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ge(i.element,t,{...n,path:[...n.path,"items"]});};function Cs(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Cs(t.out):t.type==="catch"?Cs(t.innerType):e._zod.optin}var r0=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Ue(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)Xe(o.properties,u,ge(s[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?Cs(l)===void 0:l._zod.optout===void 0)&&c.push(u);}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=false:i.catchall?i.catchall&&(o.additionalProperties=ge(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},fu=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>ge(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s;},n0=(e,t,r,n)=>{let o=e._zod.def,i=ge(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=ge(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c,t.intersections.push(c);},o0=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((d,g)=>ge(d,t,{...n,path:[...n.path,s,g]})),u=i.rest?ge(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let d=i.items[l-1];if(!(t.io==="input"?Cs(d)!==void 0:d._zod.optout==="optional"))break;l--;}let f=i.items.length,p=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,p?o.items=false:u&&(o.items=u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):(o.items=c,p?o.additionalItems=false:u&&(o.additionalItems=u),l>0&&(o.minItems=l),p&&(o.maxItems=f));let{minimum:m,maximum:h}=Ge(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function kh(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let d=kh(e,h,r);return d===h?t:d}for(let h of ["anyOf","oneOf"]){let d=t[h];if(!Array.isArray(d))continue;let g=d.map(_=>kh(e,_,r));g.some((_,b)=>_!==d[b])&&(t={...t,[h]:g});}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:f,id:p,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",i||(m.pattern=(n.includes("number")?mr:ns).source)),m}var Ih=new WeakMap;function t8(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Ih.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||r.has(i))continue;let s=kh(t,i,new Set);s!==i&&r.set(i,s);}if(r.size)for(let n of e.seen.values())for(let o of [n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i);}}var i0=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=Ge(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=ge(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)Xe(o.patternProperties,Fy(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=ge(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Ih.get(t);l||(l=[],Ih.set(t,l),t.deferred.push(()=>t8(t))),l.push(e);}o.additionalProperties=ge(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&Cs(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String));}},s0=(e,t,r,n)=>{let o=e._zod.def,i=ge(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=true):r.anyOf=[i,{type:"null"}];},a0=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},c0=Symbol();function zy(e,t,r,n,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(Ue(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),c0):JSON.parse(s)}var u0=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=zy(o.defaultValue,e,t,r,n);s!==c0&&(r.default=s);},l0=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=zy(o.defaultValue,e,t,r,n);s!==c0&&(r._prefault=s);},f0=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{Ue(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s;},m0=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;ge(s,t,n);let a=t.seen.get(e);a.ref=s;},p0=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=true;},d0=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},mu=(e,t,r,n)=>{let o=e._zod.def;ge(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},h0=(e,t,r,n)=>{let o=e._zod.innerType;ge(o,t,n);let i=t.seen.get(e);i.ref=o;},lu={string:Mh,number:Th,boolean:Oh,bigint:Lh,symbol:Nh,null:Fh,undefined:zh,void:Dh,never:Bh,any:Zh,unknown:Uh,date:Gh,enum:Qh,literal:jh,nan:Vh,template_literal:Hh,file:Wh,success:qh,custom:Xh,function:Yh,transform:Kh,map:Jh,set:e0,array:t0,object:r0,union:fu,intersection:n0,tuple:o0,record:i0,nullable:s0,nonoptional:a0,default:u0,prefault:l0,catch:f0,pipe:m0,readonly:p0,promise:d0,optional:mu,lazy:h0};function pu(e,t){if("_idmap"in e){let n=e,o=Nr({...t,processors:lu}),i={};for(let c of n._idmap.entries()){let[u,l]=c;ge(l,o);}let s={},a={registry:n,uri:t?.uri,defs:i};o.external=a;for(let c of n._idmap.entries()){let[u,l]=c;Fr(o,l),Xe(s,u,zr(o,l));}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i};}return {schemas:s}}let r=Nr({...t,processors:lu});return ge(e,r),Fr(r,e),zr(r,e)}var du=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t;}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Nr({processors:lu,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}});}process(t,r={path:[],schemaPath:[]}){return ge(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Fr(this.ctx,t);let n=zr(this.ctx,t),{"~standard":o,...i}=n;return i}};var Dy={};var ii={};Ar(ii,{ZodAny:()=>F0,ZodArray:()=>Z0,ZodBase64:()=>Tu,ZodBase64URL:()=>Ou,ZodBigInt:()=>ni,ZodBigIntFormat:()=>Fu,ZodBoolean:()=>ri,ZodCIDRv4:()=>Iu,ZodCIDRv6:()=>Mu,ZodCUID:()=>Cu,ZodCUID2:()=>Eu,ZodCatch:()=>cg,ZodCodec:()=>Os,ZodCreditCard:()=>P0,ZodCustom:()=>Ls,ZodCustomStringFormat:()=>In,ZodDate:()=>Rs,ZodDefault:()=>rg,ZodDiscriminatedUnion:()=>G0,ZodE164:()=>Lu,ZodEmail:()=>xu,ZodEmoji:()=>wu,ZodEnum:()=>Jo,ZodExactOptional:()=>Zu,ZodFile:()=>K0,ZodFunction:()=>bg,ZodGUID:()=>$u,ZodIBAN:()=>k0,ZodIPv4:()=>Pu,ZodIPv6:()=>ku,ZodISODate:()=>Br,ZodISODateTime:()=>Dr,ZodISODuration:()=>Ur,ZodISOTime:()=>Zr,ZodInstanceOf:()=>$g,ZodIntersection:()=>Q0,ZodJWT:()=>Nu,ZodKSUID:()=>Ru,ZodLazy:()=>hg,ZodLiteral:()=>Y0,ZodMAC:()=>R0,ZodMap:()=>q0,ZodNaN:()=>lg,ZodNanoID:()=>Su,ZodNever:()=>D0,ZodNonOptional:()=>Uu,ZodNull:()=>L0,ZodNullable:()=>tg,ZodNumber:()=>ti,ZodNumberFormat:()=>Mn,ZodObject:()=>ks,ZodOptional:()=>Ms,ZodPipe:()=>Ts,ZodPrefault:()=>og,ZodPreprocess:()=>fg,ZodPromise:()=>_g,ZodReadonly:()=>mg,ZodRecord:()=>Ko,ZodSet:()=>X0,ZodString:()=>ei,ZodStringFormat:()=>_e,ZodSuccess:()=>ag,ZodSymbol:()=>T0,ZodTemplateLiteral:()=>dg,ZodTransform:()=>J0,ZodTuple:()=>V0,ZodType:()=>Y,ZodULID:()=>Au,ZodURL:()=>vs,ZodUUID:()=>er,ZodUndefined:()=>O0,ZodUnion:()=>Is,ZodUnknown:()=>z0,ZodVoid:()=>B0,ZodXID:()=>vu,ZodXor:()=>U0,_ZodString:()=>yu,_default:()=>ng,_function:()=>K2,any:()=>P2,array:()=>Ps,base64:()=>u2,base64url:()=>l2,bigint:()=>C2,boolean:()=>M0,catch:()=>ug,check:()=>J2,cidrv4:()=>a2,cidrv6:()=>c2,codec:()=>W2,creditCard:()=>m2,cuid:()=>Jy,cuid2:()=>e2,currencyCode:()=>b2,custom:()=>ex,date:()=>I2,describe:()=>tx,discriminatedUnion:()=>F2,e164:()=>f2,email:()=>Gy,emoji:()=>Yy,enum:()=>Du,exactOptional:()=>eg,file:()=>Q2,float32:()=>x2,float64:()=>$2,function:()=>K2,guid:()=>Qy,hash:()=>y2,hex:()=>_2,hostname:()=>g2,httpUrl:()=>Xy,iban:()=>p2,instanceof:()=>nx,int:()=>_u,int32:()=>w2,int64:()=>E2,intersection:()=>j0,invertCodec:()=>q2,ipv4:()=>o2,ipv6:()=>s2,json:()=>ix,jwt:()=>d2,keyof:()=>M2,ksuid:()=>n2,lazy:()=>gg,literal:()=>G2,looseObject:()=>L2,looseRecord:()=>D2,mac:()=>i2,map:()=>B2,meta:()=>rx,nan:()=>H2,nanoid:()=>Ky,nativeEnum:()=>U2,never:()=>zu,nonoptional:()=>sg,null:()=>N0,nullable:()=>As,nullish:()=>j2,number:()=>I0,object:()=>T2,optional:()=>Pn,partialRecord:()=>z2,pipe:()=>bu,prefault:()=>ig,preprocess:()=>sx,promise:()=>Y2,readonly:()=>pg,record:()=>W0,refine:()=>yg,set:()=>Z2,strictObject:()=>O2,string:()=>Es,stringFormat:()=>h2,stringbool:()=>ox,success:()=>V2,superRefine:()=>xg,symbol:()=>v2,templateLiteral:()=>X2,transform:()=>Bu,tuple:()=>H0,uint32:()=>S2,uint64:()=>A2,ulid:()=>t2,undefined:()=>R2,union:()=>oi,unknown:()=>Rn,url:()=>qy,uuid:()=>jy,uuidv4:()=>Vy,uuidv6:()=>Hy,uuidv7:()=>Wy,void:()=>k2,xid:()=>r2,xor:()=>N2});var n8=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case "invalid_type":{let s=o(i.expected),a=am(i.input),c=o(a,i.input);return `Invalid input: expected ${s}, received ${c}`}case "invalid_value":return i.values.length===1?`Invalid input: expected ${Za(i.values[0])}`:`Invalid option: expected one of ${za(i.values,"|")}`;case "too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case "too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case "invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${i.divisor}`;case "unrecognized_keys":return `Unrecognized key${i.keys.length>1?"s":""}: ${za(i.keys,", ")}`;case "invalid_key":return `Invalid key in ${i.origin}`;case "invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===false?"Invalid input: more than one option matched":"Invalid input";case "invalid_element":return `Invalid value in ${i.origin}`;default:return "Invalid input"}}};function By(){return {localeError:n8()}}var hu={};Ar(hu,{endsWith:()=>Zo,gt:()=>Kt,gte:()=>Ct,includes:()=>Do,length:()=>An,lowercase:()=>Fo,lt:()=>Yt,lte:()=>St,maxLength:()=>En,maxSize:()=>Lr,mime:()=>Go,minLength:()=>pr,minSize:()=>Jt,multipleOf:()=>Or,negative:()=>su,nonnegative:()=>cu,nonpositive:()=>au,normalize:()=>Qo,overwrite:()=>Dt,positive:()=>iu,properties:()=>Uo,property:()=>uu,regex:()=>No,size:()=>Cn,slugify:()=>Wo,startsWith:()=>Bo,toLowerCase:()=>Vo,toUpperCase:()=>Ho,trim:()=>jo,uppercase:()=>zo});var Zy=new WeakSet([Object.prototype,Error.prototype]);function gu(e,t,r){Object.defineProperty(e,t,{configurable:true,enumerable:false,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:true,writable:true});}});}var Uy=(e,t)=>{hm.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Zy.has(r)||(Zy.add(r),gu(r,"format",n=>o=>Ji(n,o)),gu(r,"flatten",n=>o=>Ki(n,o)),gu(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,So,2);}),gu(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,So,2);}),Object.defineProperty(r,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},o8=v("ZodError",Uy),yt=v("ZodError",Uy,void 0,{Parent:Error});var g0=Ro(yt),_0=Po(yt),b0=ko(yt),y0=Io(yt),x0=Ha(yt),$0=Wa(yt),w0=qa(yt),S0=Xa(yt),C0=Ya(yt),E0=Ka(yt),A0=Ja(yt),v0=ec(yt);function s8(){We.localeError||Te(By());}function kn(){We.memoizer||Te({memoizer:_s()});}var Y=v("ZodType",(e,t)=>(s8(),W.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(D.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:true})},with(...e){return this.check(...e)},clone(e,t){return de(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(yg(e,t))},superRefine(e,t){return this.check(xg(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return Pn(this)},exactOptional(){return eg(this)},nullable(){return As(this)},nullish(){return Pn(As(this))},nonoptional(e){return sg(this,e)},array(){return Ps(this)},or(e){return oi([this,e])},and(e){return j0(this,e)},transform(e){return bu(this,Bu(e))},default(e){return ng(this,e)},prefault(e){return ig(this,e)},catch(e){return ug(this,e)},pipe(e){return bu(this,e)},readonly(){return pg(this)},describe(e){let t=this.clone();return Ye.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ye.get(this);let t=this.clone();return Ye.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return D.hide(this,"~standard",{...fc(this),jsonSchema:{input:qo(this,"input"),output:qo(this,"output")}})},set"~standard"(e){D.own(this,"~standard",e);},parse:function e(t,r){return g0(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await _0(this,t,r,{callee:e})},safeParse(e,t){return b0(this,e,t)},async safeParseAsync(e,t){return y0(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){D.own(this,"spa",e);},validate(e,t){return es(this,e,t)},validateAsync(e,t){return ts(this,e,t)},encode:function e(t,r){return x0(this,t,r,{callee:e})},decode:function e(t,r){return $0(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await w0(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await S0(this,t,r,{callee:e})},safeEncode(e,t){return C0(this,e,t)},safeDecode(e,t){return E0(this,e,t)},async safeEncodeAsync(e,t){return A0(this,e,t)},async safeDecodeAsync(e,t){return v0(this,e,t)},toJSONSchema(e){return Ph(this,{})(e)},get description(){return Ye.get(this)?.description},get _def(){return this._zod.def}}),yu=v("_ZodString",(e,t)=>{xn.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mh(e,r,n);},D.derived({format:e=>Ge(e).format??null,minLength:e=>Ge(e).minimum??null,maxLength:e=>Ge(e).maximum??null},{regex(...e){return this.check(No(...e))},includes(...e){return this.check(Do(...e))},startsWith(...e){return this.check(Bo(...e))},endsWith(...e){return this.check(Zo(...e))},min(...e){return this.check(pr(...e))},max(...e){return this.check(En(...e))},length(...e){return this.check(An(...e))},nonempty(...e){return this.check(pr(1,...e))},lowercase(e){return this.check(Fo(e))},uppercase(e){return this.check(zo(e))},trim(){return this.check(jo())},normalize(...e){return this.check(Qo(...e))},toLowerCase(){return this.check(Vo())},toUpperCase(){return this.check(Ho())},slugify(){return this.check(Wo())}})),ei=v("ZodString",(e,t)=>{xn.init(e,t),yu.init(e,t);},{email(e){return this.check(zc(xu,e))},url(e){return this.check(bs(vs,e))},jwt(e){return this.check(ou(Nu,e))},emoji(e){return this.check(Qc(wu,e))},guid(e){return this.check(Dc($u,e))},uuid(e){return this.check(Bc(er,e))},uuidv4(e){return this.check(Zc(er,e))},uuidv6(e){return this.check(Uc(er,e))},uuidv7(e){return this.check(Gc(er,e))},nanoid(e){return this.check(jc(Su,e))},cuid(e){return this.check(Vc(Cu,e))},cuid2(e){return this.check(Hc(Eu,e))},ulid(e){return this.check(Wc(Au,e))},base64(e){return this.check(tu(Tu,e))},base64url(e){return this.check(ru(Ou,e))},xid(e){return this.check(qc(vu,e))},ksuid(e){return this.check(Xc(Ru,e))},ipv4(e){return this.check(Yc(Pu,e))},ipv6(e){return this.check(Kc(ku,e))},cidrv4(e){return this.check(Jc(Iu,e))},cidrv6(e){return this.check(eu(Mu,e))},e164(e){return this.check(nu(Lu,e))},datetime(e){return this.check(ys(Dr,e))},date(e){return this.check(xs(Br,e))},time(e){return this.check($s(Zr,e))},duration(e){return this.check(ws(Ur,e))}});function Es(e){return jd(ei,e)}var _e=v("ZodStringFormat",(e,t)=>{he.init(e,t),yu.init(e,t);}),Dr=v("ZodISODateTime",(e,t)=>{Lp.init(e,t),_e.init(e,t);}),Br=v("ZodISODate",(e,t)=>{Np.init(e,t),_e.init(e,t);}),Zr=v("ZodISOTime",(e,t)=>{Fp.init(e,t),_e.init(e,t);}),Ur=v("ZodISODuration",(e,t)=>{zp.init(e,t),_e.init(e,t);}),xu=v("ZodEmail",(e,t)=>{Cp.init(e,t),_e.init(e,t);});function Gy(e){return zc(xu,e)}var $u=v("ZodGUID",(e,t)=>{wp.init(e,t),_e.init(e,t);});function Qy(e){return Dc($u,e)}var er=v("ZodUUID",(e,t)=>{Sp.init(e,t),_e.init(e,t);});function jy(e){return Bc(er,e)}function Vy(e){return Zc(er,e)}function Hy(e){return Uc(er,e)}function Wy(e){return Gc(er,e)}var vs=v("ZodURL",(e,t)=>{vp.init(e,t),_e.init(e,t);});function qy(e){return bs(vs,e)}function Xy(e){return bs(vs,{protocol:rs,hostname:zm,...D.normalizeParams(e)})}var wu=v("ZodEmoji",(e,t)=>{Rp.init(e,t),_e.init(e,t);});function Yy(e){return Qc(wu,e)}var Su=v("ZodNanoID",(e,t)=>{Pp.init(e,t),_e.init(e,t);});function Ky(e){return jc(Su,e)}var Cu=v("ZodCUID",(e,t)=>{kp.init(e,t),_e.init(e,t);});function Jy(e){return Vc(Cu,e)}var Eu=v("ZodCUID2",(e,t)=>{Ip.init(e,t),_e.init(e,t);});function e2(e){return Hc(Eu,e)}var Au=v("ZodULID",(e,t)=>{Mp.init(e,t),_e.init(e,t);});function t2(e){return Wc(Au,e)}var vu=v("ZodXID",(e,t)=>{Tp.init(e,t),_e.init(e,t);});function r2(e){return qc(vu,e)}var Ru=v("ZodKSUID",(e,t)=>{Op.init(e,t),_e.init(e,t);});function n2(e){return Xc(Ru,e)}var Pu=v("ZodIPv4",(e,t)=>{Dp.init(e,t),_e.init(e,t);});function o2(e){return Yc(Pu,e)}var R0=v("ZodMAC",(e,t)=>{Zp.init(e,t),_e.init(e,t);});function i2(e){return Hd(R0,e)}var ku=v("ZodIPv6",(e,t)=>{Bp.init(e,t),_e.init(e,t);});function s2(e){return Kc(ku,e)}var Iu=v("ZodCIDRv4",(e,t)=>{Up.init(e,t),_e.init(e,t);});function a2(e){return Jc(Iu,e)}var Mu=v("ZodCIDRv6",(e,t)=>{Gp.init(e,t),_e.init(e,t);});function c2(e){return eu(Mu,e)}var Tu=v("ZodBase64",(e,t)=>{Qp.init(e,t),_e.init(e,t);});function u2(e){return tu(Tu,e)}var Ou=v("ZodBase64URL",(e,t)=>{jp.init(e,t),_e.init(e,t);});function l2(e){return ru(Ou,e)}var Lu=v("ZodE164",(e,t)=>{Vp.init(e,t),_e.init(e,t);});function f2(e){return nu(Lu,e)}var P0=v("ZodCreditCard",(e,t)=>{Hp.init(e,t),_e.init(e,t);});function m2(e){return Wd(P0,e)}var k0=v("ZodIBAN",(e,t)=>{Wp.init(e,t),_e.init(e,t);});function p2(e){return qd(k0,e)}var Nu=v("ZodJWT",(e,t)=>{qp.init(e,t),_e.init(e,t);});function d2(e){return ou(Nu,e)}var In=v("ZodCustomStringFormat",(e,t)=>{Xp.init(e,t),_e.init(e,t);});function h2(e,t,r={}){return vn(In,e,t,r)}function g2(e){return vn(In,"hostname",Fm,e)}function _2(e){return vn(In,"hex",Km,e)}function b2(e){return vn(In,"currency_code",Bm,e)}function y2(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=kt[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return vn(In,n,o,t)}var ti=v("ZodNumber",(e,t)=>{$c.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Th(e,r,n,o),e.isFinite=true;},D.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=Ge(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=Ge(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=Ge(e);return !!t||!!r?.some(Number.isSafeInteger)},format:e=>Ge(e).format??null},{gt(e,t){return this.check(Kt(e,t))},gte(e,t){return this.check(Ct(e,t))},min(e,t){return this.check(Ct(e,t))},lt(e,t){return this.check(Yt(e,t))},lte(e,t){return this.check(St(e,t))},max(e,t){return this.check(St(e,t))},int(e){return this.check(_u(e))},safe(e){return this.check(_u(e))},positive(e){return this.check(Kt(0,e))},nonnegative(e){return this.check(Ct(0,e))},negative(e){return this.check(Yt(0,e))},nonpositive(e){return this.check(St(0,e))},multipleOf(e,t){return this.check(Or(e,t))},step(e,t){return this.check(Or(e,t))},finite(){return this}}));function I0(e){return Yd(ti,e)}var Mn=v("ZodNumberFormat",(e,t)=>{Yp.init(e,t),ti.init(e,t);});function _u(e){return Jd(Mn,e)}function x2(e){return eh(Mn,e)}function $2(e){return th(Mn,e)}function w2(e){return rh(Mn,e)}function S2(e){return nh(Mn,e)}var ri=v("ZodBoolean",(e,t)=>{fs.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Oh(e,r,n);});function M0(e){return oh(ri,e)}var ni=v("ZodBigInt",(e,t)=>{wc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lh(e,r,n,o);},D.derived({minValue:e=>Ge(e).minimum??null,maxValue:e=>Ge(e).maximum??null,format:e=>Ge(e).format??null},{gte(e,t){return this.check(Ct(e,t))},min(e,t){return this.check(Ct(e,t))},gt(e,t){return this.check(Kt(e,t))},lt(e,t){return this.check(Yt(e,t))},lte(e,t){return this.check(St(e,t))},max(e,t){return this.check(St(e,t))},positive(e){return this.check(Kt(BigInt(0),e))},negative(e){return this.check(Yt(BigInt(0),e))},nonpositive(e){return this.check(St(BigInt(0),e))},nonnegative(e){return this.check(Ct(BigInt(0),e))},multipleOf(e,t){return this.check(Or(e,t))}}));function C2(e){return sh(ni,e)}var Fu=v("ZodBigIntFormat",(e,t)=>{Kp.init(e,t),ni.init(e,t);});function E2(e){return ch(Fu,e)}function A2(e){return uh(Fu,e)}var T0=v("ZodSymbol",(e,t)=>{Jp.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nh(e,r,n,o);});function v2(e){return lh(T0,e)}var O0=v("ZodUndefined",(e,t)=>{ed.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zh(e,r,n,o);});function R2(e){return fh(O0,e)}var L0=v("ZodNull",(e,t)=>{td.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fh(e,r,n);});function N0(e){return mh(L0,e)}var F0=v("ZodAny",(e,t)=>{rd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zh();});function P2(){return ph(F0)}var z0=v("ZodUnknown",(e,t)=>{nd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uh();});function Rn(){return dh(z0)}var D0=v("ZodNever",(e,t)=>{od.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bh(e,r,n);});function zu(e){return hh(D0,e)}var B0=v("ZodVoid",(e,t)=>{id.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dh(e,r,n,o);});function k2(e){return gh(B0,e)}var Rs=v("ZodDate",(e,t)=>{sd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gh(e,r,n,o),e.min=(r,n)=>e.check(Ct(r,n)),e.max=(r,n)=>e.check(St(r,n));},D.derived({minDate:e=>{let{minimum:t}=Ge(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Ge(e);return t?new Date(t):null}},{}));function I2(e){return _h(Rs,e)}var Z0=v("ZodArray",(e,t)=>{kn(),cd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>t0(e,r,n,o),e.element=t.element;},{min(e,t){return this.check(pr(e,t))},nonempty(e){return this.check(pr(1,e))},max(e,t){return this.check(En(e,t))},length(e,t){return this.check(An(e,t))},unwrap(){return this.element}});function Ps(e,t){return xh(Z0,e,t)}function M2(e){let t=e._zod.def.shape;return Du(Object.keys(t))}var ks=v("ZodObject",(e,t)=>{kn(),ud.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>r0(e,r,n,o),D.installLazyProp(e,"shape",r=>r._zod.def.shape,false);},{keyof(){return Du(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(D.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(D.mergeDefs(this._zod.def,{catchall:Rn()}))},loose(){return this.clone(D.mergeDefs(this._zod.def,{catchall:Rn()}))},strict(){return this.clone(D.mergeDefs(this._zod.def,{catchall:zu()}))},strip(){return this.clone(D.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return D.extend(this,e)},safeExtend(e){return D.safeExtend(this,e)},merge(e){return D.merge(this,e)},pick(e){return D.pick(this,e)},omit(e){return D.omit(this,e)},partial(...e){return D.partial(Ms,this,e[0])},exactPartial(...e){return D.partial(Zu,this,e[0],"exactPartial")},required(...e){return D.required(Uu,this,e[0])}});function T2(e,t){let r={type:"object",shape:e??{},...D.normalizeParams(t)};return new ks(r)}function O2(e,t){return new ks({type:"object",shape:e,catchall:zu(),...D.normalizeParams(t)})}function L2(e,t){return new ks({type:"object",shape:e,catchall:Rn(),...D.normalizeParams(t)})}var Is=v("ZodUnion",(e,t)=>{ms.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fu(e,r,n,o),e.options=t.options;});function oi(e,t){return new Is({type:"union",options:e,...D.normalizeParams(t)})}var U0=v("ZodXor",(e,t)=>{Is.init(e,t),ld.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fu(e,r,n,o),e.options=t.options;});function N2(e,t){return new U0({type:"union",options:e,inclusive:false,...D.normalizeParams(t)})}var G0=v("ZodDiscriminatedUnion",(e,t)=>{Is.init(e,t),md.init(e,t);});function F2(e,t,r){return new G0({type:"union",options:t,discriminator:e,...D.normalizeParams(r)})}var Q0=v("ZodIntersection",(e,t)=>{pd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>n0(e,r,n,o);});function j0(e,t){return new Q0({type:"intersection",left:e,right:t})}var V0=v("ZodTuple",(e,t)=>{kn(),Sc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>o0(e,r,n,o);},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Ms({type:"optional",innerType:t}))})}});function H0(e,t,r){let n=t instanceof W,o=n?r:t,i=n?t:null;return new V0({type:"tuple",items:e,rest:i,...D.normalizeParams(o)})}var Ko=v("ZodRecord",(e,t)=>{kn(),dd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>i0(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType;});function W0(e,t,r){return !t||!t._zod?new Ko({type:"record",keyType:Es(),valueType:e,...D.normalizeParams(t)}):new Ko({type:"record",keyType:e,valueType:t,...D.normalizeParams(r)})}function z2(e,t,r){return new Ko({type:"record",keyType:e,valueType:t,...D.normalizeParams(r),partial:true})}function D2(e,t,r){return new Ko({type:"record",keyType:e,valueType:t,mode:"loose",...D.normalizeParams(r)})}var q0=v("ZodMap",(e,t)=>{kn(),hd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jh(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Jt(...r)),e.nonempty=r=>e.check(Jt(1,r)),e.max=(...r)=>e.check(Lr(...r)),e.size=(...r)=>e.check(Cn(...r));});function B2(e,t,r){return new q0({type:"map",keyType:e,valueType:t,...D.normalizeParams(r)})}var X0=v("ZodSet",(e,t)=>{kn(),gd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>e0(e,r,n,o),e.min=(...r)=>e.check(Jt(...r)),e.nonempty=r=>e.check(Jt(1,r)),e.max=(...r)=>e.check(Lr(...r)),e.size=(...r)=>e.check(Cn(...r));});function Z2(e,t){return new X0({type:"set",valueType:e,...D.normalizeParams(t)})}var Jo=v("ZodEnum",(e,t)=>{_d.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Qh(e,n,o),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Jo({...t,checks:[],...D.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Jo({...t,checks:[],...D.normalizeParams(o),entries:i})};});function Du(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Jo({type:"enum",entries:r,...D.normalizeParams(t)})}function U2(e,t){return new Jo({type:"enum",entries:e,...D.normalizeParams(t)})}var Y0=v("ZodLiteral",(e,t)=>{bd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jh(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}});});function G2(e,t){return new Y0({type:"literal",values:Array.isArray(e)?e:[e],...D.normalizeParams(t)})}var K0=v("ZodFile",(e,t)=>{yd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wh(e,r,n),e.min=(r,n)=>e.check(Jt(r,n)),e.max=(r,n)=>e.check(Lr(r,n)),e.mime=(r,n)=>e.check(Go(Array.isArray(r)?r:[r],n));});function Q2(e){return $h(K0,e)}var J0=v("ZodTransform",(e,t)=>{kn(),xd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kh(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Mr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(D.issue(i,r.value,t));else {let s=i;s.fatal&&(s.continue=false),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(D.issue(s));}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)};});function Bu(e){return new J0({type:"transform",transform:e})}var Ms=v("ZodOptional",(e,t)=>{Cc.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Pn(e){return new Ms({type:"optional",innerType:e})}var Zu=v("ZodExactOptional",(e,t)=>{$d.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mu(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function eg(e){return new Zu({type:"optional",innerType:e})}var tg=v("ZodNullable",(e,t)=>{wd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>s0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function As(e){return new tg({type:"nullable",innerType:e})}function j2(e){return Pn(As(e))}var rg=v("ZodDefault",(e,t)=>{Sd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>u0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function ng(e,t){return new rg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():D.shallowClone(t)}})}var og=v("ZodPrefault",(e,t)=>{Cd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>l0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function ig(e,t){return new og({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():D.shallowClone(t)}})}var Uu=v("ZodNonOptional",(e,t)=>{Ed.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>a0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function sg(e,t){return new Uu({type:"nonoptional",innerType:e,...D.normalizeParams(t)})}var ag=v("ZodSuccess",(e,t)=>{Ad.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qh(e,r,n),e.unwrap=()=>e._zod.def.innerType;});function V2(e){return new ag({type:"success",innerType:e})}var cg=v("ZodCatch",(e,t)=>{vd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>f0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function ug(e,t){return new cg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:D.constantCatch(t)})}var lg=v("ZodNaN",(e,t)=>{Rd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vh(e,r,n,o);});function H2(e){return yh(lg,e)}var Ts=v("ZodPipe",(e,t)=>{Ec.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>m0(e,r,n,o),e.in=t.in,e.out=t.out;});function bu(e,t){return new Ts({type:"pipe",in:e,out:t})}var Os=v("ZodCodec",(e,t)=>{Ts.init(e,t),ps.init(e,t);});function W2(e,t,r){return new Os({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function q2(e){let t=e._zod.def;return new Os({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var fg=v("ZodPreprocess",(e,t)=>{Ts.init(e,t),Pd.init(e,t);}),mg=v("ZodReadonly",(e,t)=>{kd.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>p0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function pg(e){return new mg({type:"readonly",innerType:e})}var dg=v("ZodTemplateLiteral",(e,t)=>{Id.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hh(e,r,n);});function X2(e,t){return new dg({type:"template_literal",parts:e,...D.normalizeParams(t)})}var hg=v("ZodLazy",(e,t)=>{ds.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>h0(e,r,n,o),e.unwrap=()=>e._zod.def.getter();});function gg(e){return new hg({type:"lazy",getter:e})}var _g=v("ZodPromise",(e,t)=>{Td.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>d0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Y2(e){return new _g({type:"promise",innerType:e})}var bg=v("ZodFunction",(e,t)=>{Md.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yh(e,r,n,o);});function K2(e){return new bg({type:"function",input:Array.isArray(e?.input)?H0(e?.input):e?.input??Ps(Rn()),output:e?.output??Rn()})}var Ls=v("ZodCustom",(e,t)=>{Od.init(e,t),Y.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xh(e,r,n,o);});function J2(e){let t=new xe({check:"custom"});return t._zod.check=e,t}function ex(e,t){return wh(Ls,e??(()=>true),t)}function yg(e,t={}){return Sh(Ls,e,t)}function xg(e,t){return Ch(e,t)}var tx=Eh,rx=Ah,$g=v("ZodInstanceOf",(e,t)=>{Ls.init(e,t);},{properties(e,t){return this.check(Uo(e,t))}});function nx(e,t={}){let r=new $g({type:"custom",check:"custom",fn:n=>n instanceof e,abort:true,...D.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]});},r}var ox=(...e)=>vh({Codec:Os,Boolean:ri,String:ei},...e);function ix(e){let t=gg(()=>oi([Es(e),I0(),M0(),N0(),Ps(t),W0(Es(),t)]));return t}function sx(e,t){return new fg({type:"pipe",in:Bu(e),out:t})}var a8={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function c8(e){Te({customError:e});}function u8(){return Te().customError}var wg;wg||(wg={});var Ns={};Ar(Ns,{ZodISODate:()=>Br,ZodISODateTime:()=>Dr,ZodISODuration:()=>Ur,ZodISOTime:()=>Zr,date:()=>f8,datetime:()=>l8,duration:()=>p8,time:()=>m8});function l8(e){return ys(Dr,e)}function f8(e){return xs(Br,e)}function m8(e){return $s(Zr,e)}function p8(e){return ws(Ur,e)}var N={...ii,...hu,iso:Ns},d8=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function h8(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function ax(e,t){return e.map((r,n)=>n<t?r:r.optional())}function g8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function _8(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:g8(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function b8(e,t){return N.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:true,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:true}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:true,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:true}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:true});}}).pipe(e)}function Sg(e,t){if(e===null)return "z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return `${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=Sg(s,t);if(a===null)return null;i.push(a);}return `a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let s=Sg(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`);}return `o${o.length}:{${o.join(",")}}`}finally{t.delete(e);}}var y8=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),x8=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Fs(e){return typeof e!="object"||e===null?false:Array.isArray(e)?e.some(Fs):typeof e.$ref=="string"?true:Object.entries(e).some(([t,r])=>y8.has(t)?Fs(r):!x8.has(t)||typeof r!="object"||r===null?false:Object.values(r).some(Fs))}function cx(e){return e===1?"element":"elements"}function $8(e,t){return N.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===true){let i=new Map;for(let s=0;s<o.length;s++){let a=Sg(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:true});}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${cx(i)}; found ${a}`,input:o,continue:true}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${cx(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function ux(e,t){if(e!==false)return e===void 0||e===true?N.any():lt(e,t)}var w8=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function lx(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return N.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return N.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=_8(o,t),s=lt(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===true&&o.length===1&&o[0]===null)return N.null();if(o.length===0)return N.never();if(o.length===1)return N.literal(o[0]);if(o.every(s=>typeof s=="string"))return N.enum(o);let i=o.map(s=>N.literal(s));return i.length<2?i[0]:N.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return N.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return lx(s,t)});return o.length===0?N.never():o.length===1?o[0]:N.union(o)}if(!r)return N.any();let n;switch(r){case "string":{let o=N.string();if(e.format){let i=e.format;i==="email"?o=o.check(N.email()):i==="uri"||i==="uri-reference"?o=o.check(N.url()):i==="uuid"||i==="guid"?o=o.check(N.uuid()):i==="date-time"?o=o.check(N.iso.datetime({offset:true})):i==="date"?o=o.check(N.iso.date()):i==="time"?o=o.check(N.regex(w8)):i==="duration"?o=o.check(N.iso.duration()):i==="hostname"?o=o.check(N.hostname()):i==="ipv4"?o=o.check(N.ipv4()):i==="ipv6"?o=o.check(N.ipv6()):i==="mac"?o=o.check(N.mac()):i==="cidr"?o=o.check(N.cidrv4()):i==="cidr-v6"?o=o.check(N.cidrv6()):i==="base64"?o=o.check(N.base64()):i==="base64url"?o=o.check(N.base64url()):i==="e164"?o=o.check(N.e164()):i==="credit_card"?o=o.check(N.creditCard()):i==="iban"?o=o.check(N.iban()):i==="jwt"?o=o.check(N.jwt()):i==="emoji"?o=o.check(N.emoji()):i==="nanoid"?o=o.check(N.nanoid()):i==="cuid"?o=o.check(N.cuid()):i==="cuid2"?o=o.check(N.cuid2()):i==="ulid"?o=o.check(N.ulid()):i==="xid"?o=o.check(N.xid()):i==="ksuid"&&(o=o.check(N.ksuid()));}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case "number":case "integer":{let o=r==="integer"?N.number().int():N.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==true&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==true&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===true&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===true&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case "boolean":{n=N.boolean();break}case "null":{n=N.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?lt(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=lt(p,t);Xe(o,f,s.has(f)?m:m.optional());}if(e.patternProperties){let f=e.patternProperties,p=Object.keys(f),m=[];for(let d of p){let g=lt(f[d],t),_=N.string().regex(new RegExp(d));m.push(N.looseRecord(_,g));}let h=[];if(Object.keys(o).length>0&&h.push(N.object(o).passthrough()),h.push(...m),h.length===0)n=N.object({}).passthrough();else if(h.length===1)n=h[0];else {let d=N.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=N.intersection(d,h[g]);n=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(b=>new RegExp(b)),_=n;n=n.check(b=>{if(!Rt(b.value))return;let y=[];for(let S of Object.keys(b.value))d.includes(S)||g.some(C=>C.test(S))||y.push(S);y.length&&b.issues.push({code:"unrecognized_keys",keys:y,input:b.value,inst:_});});}}else {let f=N.object(o);e.additionalProperties===false?n=f.strict():a?n=f.catchall(a):n=f.passthrough();}let c=e.propertyNames!==void 0&&e.propertyNames!==true,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let f;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;f=lt(p,t);}n=b8(n,{keySchema:f,minProperties:u,maxProperties:l});}break}case "array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(f=>lt(f,t)),c=ax(a,s),u=Array.isArray(i)?void 0:ux(i,t),l=N.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(N.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(N.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>lt(f,t)),c=ax(a,s),u=ux(e.additionalItems,t),l=N.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(N.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(N.maxLength(e.maxItems)));}else if(i!==void 0){let s=lt(i,t),a=N.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a;}else n=N.array(N.any());(e.uniqueItems===true||e.contains!==void 0)&&(n=$8(n,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?lt(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function lt(e,t){if(typeof e=="boolean")return e?N.any():N.never();let r=lx(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>lt(u,t)),c=N.union(a);r=n?N.intersection(r,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>lt(u,t)),c=N.xor(a);r=n?N.intersection(r,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:N.any();else {let a=n?r:lt(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=N.intersection(a,lt(e.allOf[u],t));r=a;}e.nullable===true&&t.version==="openapi-3.0"&&(r=N.nullable(r)),e.readOnly===true&&(r=N.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Fs(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of ["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a]);}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Fs(e.contains)&&(o.contains=e.contains);for(let a of ["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a]);}for(let a of Object.keys(e))d8.has(a)||Xe(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function fx(e,t){if(typeof e=="boolean")return e?N.any():N.never();let r;try{r=JSON.parse(JSON.stringify(e));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=h8(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ye};return lt(r,i)}var mx=Symbol("z.visit/resolving");function zs(e,t){let r=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},n=new Map;function o(s){let a=n.get(s);if(a===mx)return new ds({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,mx);let c=i(s),u=r(c,c!==s);return n.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case "object":{let u=a.shape,l=Object.keys(u),f=false,p={};for(let h of l){let d=o(u[h]);d!==u[h]&&(f=true),p[h]=d;}let m=a.catchall;return a.catchall&&(m=o(a.catchall),m!==a.catchall&&(f=true)),f?de(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:de(s,{...a,element:u})}case "tuple":{let u=a.items,l=false,f=[];for(let m of u){let h=o(m);h!==m&&(l=true),f.push(h);}let p=a.rest;return a.rest&&(p=o(a.rest),p!==a.rest&&(l=true)),l?de(s,{...a,items:f,rest:p}):s}case "record":case "map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:de(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:de(s,{...a,valueType:u})}case "union":{let u=a.options,l=false,f=[];for(let p of u){let m=o(p);m!==p&&(l=true),f.push(m);}return l?de(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:de(s,{...a,left:u,right:l})}case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":{let u=o(a.innerType);return u===a.innerType?s:de(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:de(s,{...a,in:u,out:l})}case "function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:de(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return de(s,{...f,getter:()=>o(u())})}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":return s;default:return s}}return o(e)}function px(e){return zs(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:oi(r.options)}})}function S8(e,t){if(!t?.length)return e;let r=e._zod.def;return de(e,Ft(r,{checks:[...r.checks??[],...t]}),{parent:true})}function dx(e){return S8(e.out,e.checks)}function C8(e){return e.in._zod.traits.has("$ZodTransform")?dx(e):e.in}function hx(e){return zs(e,{pipe:t=>C8(t._zod.def),default:(t,r)=>r?Pn(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function gx(e){return zs(e,{pipe:t=>dx(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var Cg={};Ar(Cg,{bigint:()=>R8,boolean:()=>v8,date:()=>P8,number:()=>A8,string:()=>E8});function E8(e){return Vd(ei,e)}function A8(e){return Kd(ti,e)}function v8(e){return ih(ri,e)}function R8(e){return ah(ni,e)}function P8(e){return bh(Rs,e)}var Eg=A.enum(lo),Ag=A.enum([...fo.logo,...fo.halftone]),_x=e=>Math.ceil(e/3)*4,vg=A.object({width:A.number().int().min(1).max(Ht),height:A.number().int().min(1).max(Ht),data:A.string().max(_x(Ht*Ht*4))}).refine(e=>e.data.length===_x(e.width*e.height*4),{message:"Art image data does not match its width and height"}),Gu=A.object({mode:Eg,image:vg,intensity:A.number().min(0).max(1).optional(),variant:Ag.optional(),matchEyes:A.boolean().optional()});var bx=A.enum(["solid","linear","radial","angular","image"]),Rg=A.object({type:A.literal("solid"),color:A.string()}),Ds=A.object({color:A.string(),offset:A.number().min(0).max(100)}),Pg=A.object({type:A.literal("linear"),stops:A.array(Ds).min(2),angle:A.number().optional().default(0)}),kg=A.object({type:A.literal("radial"),stops:A.array(Ds).min(2)}),Ig=A.object({type:A.literal("angular"),stops:A.array(Ds).min(2),angle:A.number().optional().default(0)}),Mg=A.enum(["cover","contain","tile"]),Tg=A.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Og=A.object({type:A.literal("image"),src:A.string().min(1),fit:Mg.optional().default("cover"),scale:A.number().min(.1).max(4).optional().default(1),position:Tg.optional().default("center"),opacity:A.number().min(0).max(1).optional().default(1),underlay:A.string().optional()}),hr=A.union([A.string(),Rg,Pg,kg,Ig,Og]);var yx=A.object({x:A.number(),y:A.number(),w:A.number(),h:A.number()});var xx=e=>He(ar,e),Bs=A.preprocess(xx,A.enum([...Ia,...Cf])),$x=A.preprocess(xx,A.enum(Ia));var wx=e=>He(sr,e),Zs=A.preprocess(wx,A.enum([...Ma,...Ef])),Sx=A.preprocess(wx,A.enum(Ma));var Lg=A.enum(vf),Us=A.object({style:Lg,text:A.string().max(dt).optional(),color:A.string().optional(),textColor:A.string().optional(),secondaryText:A.string().max(dt).optional(),secondaryColor:A.string().optional(),fontScale:A.number().min(cn).max(vr).optional()});var Oe=A.number().min(-ee.maxCoordinate).max(ee.maxCoordinate).refine(Pr,{message:`Numbers may have at most ${ee.maxDecimals} decimals`}),rt=Oe.refine(e=>e>0,{message:"Must be greater than 0"}),Qu=Oe.refine(e=>e>=0,{message:"Must not be negative"}),Gs=A.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Cx=A.union([A.enum(Zi),Gs]),Ax=e=>A.object({mix:A.tuple([e,e]),amount:A.number().min(0).max(1).refine(Pr)}).strict(),Gr=A.union([Cx,Ax(Cx)]),k8=A.union([Gs,Ax(A.union([A.enum(["frame","accent","background"]),Gs]))]),gr=A.union([Gr,A.object({gradient:A.object({from:Gr,to:Gr,direction:A.enum(["horizontal","vertical"]).optional(),steps:A.int().min(2).max(ee.maxGradientSteps).optional()}).strict()}).strict()]),Ng={x:Oe,y:Oe,width:rt,height:rt},Qs=A.object({color:Gr,width:rt}).strict(),I8=A.object({type:A.literal("rect"),...Ng,radius:Qu.optional(),fill:gr,hole:A.object({...Ng,radius:Qu.optional()}).strict().optional(),stroke:Qs.optional()}).strict(),M8=A.object({type:A.literal("circle"),cx:Oe,cy:Oe,r:rt,hole:rt.optional(),fill:gr,stroke:Qs.optional()}).strict(),T8=A.object({type:A.literal("ellipse"),cx:Oe,cy:Oe,rx:rt,ry:rt,fill:gr,stroke:Qs.optional()}).strict(),O8=A.object({type:A.literal("polygon"),points:A.array(A.tuple([Oe,Oe])).min(3).max(ee.maxPolygonPoints),fill:gr,stroke:Qs.optional()}).strict(),L8=A.object({type:A.literal("path"),d:A.string().min(2).max(ee.maxPathLength),fill:gr,fillRule:A.enum(["nonzero","evenodd"]).optional(),stroke:Qs.optional()}).strict(),N8=A.object({type:A.literal("line"),x1:Oe,y1:Oe,x2:Oe,y2:Oe,width:rt,cap:A.enum(["butt","round"]).optional(),dash:A.tuple([rt,rt]).optional(),fill:gr}).strict(),F8=A.object({type:A.literal("icon"),icon:A.enum(Di),x:Oe,y:Oe,size:rt,fill:gr}).strict(),Fg=A.discriminatedUnion("type",[I8,M8,T8,O8,L8,N8,F8]),vx={id:A.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:A.enum(["primary","secondary","fixed"]),text:A.string().max(200),maxLength:A.int().min(1).max(dt).optional(),color:Gr,weight:A.enum(["bold","regular"]).optional(),collapse:A.object({y:Oe,height:rt}).strict().optional()},z8=A.object({type:A.literal("text"),...vx,box:A.object(Ng).strict(),align:A.enum(["start","middle","end"]).optional(),fontSize:rt.optional()}).strict(),D8=A.object({type:A.literal("curved"),...vx,curve:A.object({cx:Oe,cy:Oe,radius:rt,side:A.enum(["top","bottom"]),spread:A.number().min(20).max(300).refine(Pr).optional()}).strict(),fontSize:rt}).strict(),zg=A.discriminatedUnion("type",[z8,D8]),Ex=Oe.refine(e=>e>=ee.minArtboard&&e<=ee.maxArtboard,{message:`Artboard sides must be ${ee.minArtboard} to ${ee.maxArtboard} units`}),B8=A.object({kind:A.literal(mn),version:A.literal(pn),artboard:A.object({width:Ex,height:Ex}).strict(),qr:A.object({x:Oe,y:Oe,size:rt,padding:Qu.optional(),radius:Qu.optional(),plate:A.enum(["opaque","background","none"]).optional()}).strict(),colors:A.object({frame:Gs,text:k8.optional(),accent:Gs.optional()}).strict(),shapes:A.array(Fg).max(ee.maxShapes),labels:A.array(zg).max(ee.maxLabels),bleed:A.union([A.literal("none"),Gr]).optional()}).strict(),ju=B8.superRefine((e,t)=>Fa(e,(r,n=[])=>t.addIssue({code:"custom",message:r,path:n})));function Rx(e){let t=ju.safeParse(e);return t.success?[]:t.error.issues.map(r=>r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message)}var Dg=Us.extend({style:A.literal(dn),spec:ju}),Vu=A.discriminatedUnion("style",[Us,Dg]);var Hu=A.preprocess(e=>He(an,e),A.enum(Af));var Wu=A.enum(Pf),Bg=A.object({src:A.string(),height:A.number(),width:A.number(),excavate:A.boolean(),x:A.number().optional(),y:A.number().optional(),padding:A.number().min(0).optional(),shape:Wu.optional(),plate:A.string().optional()}),Px=A.object({size:A.number().min(kf).max(Mi).optional(),padding:A.number().min(0).max(Mf).optional(),x:A.number().min(0).max(1).optional(),y:A.number().min(0).max(1).optional(),shape:Wu.optional(),plate:A.string().optional()}),Zg=A.enum(["L","M","Q","H"]),Ug=A.enum(Of),Gg=A.object({type:A.literal("silhouette"),width:A.number().int().min(Nt).max(At),height:A.number().int().min(Nt).max(At),cells:A.string().max(At*At).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),Qg=A.union([Ug,Gg]),js=A.object({outer:hr.optional(),inner:hr.optional()}),jg=A.object({topLeft:js.optional(),topRight:js.optional(),bottomLeft:js.optional()}),Vs=A.object({outer:Zs.optional(),inner:Bs.optional()}),Vg=A.object({topLeft:Vs.optional(),topRight:Vs.optional(),bottomLeft:Vs.optional()}),Hg=A.enum(Uf),Wg=A.object({color:A.string().optional(),width:A.number().min(Oi).max(Li).optional()}),qg=A.object({color:A.string().optional(),opacity:A.number().min(Ni).max(Fi).optional(),dx:A.number().min(-cr).max(cr).optional(),dy:A.number().min(-cr).max(cr).optional()}),kx=A.object({value:A.string(),size:A.number().optional(),level:Zg.optional(),bgColor:hr.optional(),fgColor:hr.optional(),eyeColor:hr.optional(),dotColor:hr.optional(),bodyPattern:Hu.optional(),cornerEyePattern:Zs.optional(),cornerEyeDotPattern:Bs.optional(),margin:A.number().optional(),imageSettings:Bg.optional(),isOGContext:A.boolean().optional(),templateId:A.string().optional(),customProps:A.record(A.string(),A.any()).optional(),frame:Vu.optional(),art:Gu.optional(),eyeColors:jg.optional(),moduleScale:A.number().min(mo).max(Ti).optional(),autoLevel:A.boolean().optional(),shape:Qg.optional(),eyeShapes:Vg.optional(),eyeGradient:Hg.optional(),bgRadius:A.number().min(0).max(po).optional(),backdrop:A.string().optional(),halo:Wg.optional(),shadow:qg.optional()});var Ix=A.object({fgColor:A.string().optional(),bgColor:A.string().optional()}),Mx=A.object({pixelSize:A.number(),url:A.string()}),Tx=A.object({id:A.string(),name:A.string(),description:A.string().optional()});var ft=e=>e/255,Hs=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,me=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function Xg(e){let{width:t,height:r,data:n}=e,o=[0,t-1,(r-1)*t,r*t-1].map(s=>{let a=s*4;return {color:[ft(n[a]),ft(n[a+1]),ft(n[a+2])],alpha:n[a+3]/255}});if(o.some(s=>s.alpha<.9))return null;let i=o[0].color;return o.every(({color:s})=>Hs(s,i)<.006)?i:null}function Z8(e){let{width:t,height:r,data:n}=e,o=Xg(e),i=new Float32Array(t*r);for(let s=0;s<i.length;s++){let a=s*4,c=n[a+3]/255;if(o&&c>0){let u=Math.sqrt(Hs([ft(n[a]),ft(n[a+1]),ft(n[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var U8=8,G8=.14,Ox=.006;function Q8(e,t){let{width:r,height:n,data:o}=e,i=new Float64Array(4096),s=new Float64Array(4096*3),a=0;for(let m=0;m<t.length;m++){if(t[m]<.9)continue;let h=m*4,d=Math.floor(o[h]/16)*256+Math.floor(o[h+1]/16)*16+Math.floor(o[h+2]/16);i[d]+=1,s[d*3]+=ft(o[h]),s[d*3+1]+=ft(o[h+1]),s[d*3+2]+=ft(o[h+2]),a++;}if(a===0)return {palette:[],error:0};let c=[...i.keys()].filter(m=>i[m]>0).sort((m,h)=>i[h]-i[m]),u=[];for(let m of c){if(i[m]/a<Ox/2||u.length>=U8)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>Hs(d,h)>=G8**2)&&u.push(h);}let l=[],f=0;for(let m=0;m<3;m++){l=u.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),f=0;for(let h=0;h<t.length;h++){if(t[h]<.9)continue;let d=h*4,g=[ft(o[d]),ft(o[d+1]),ft(o[d+2])],_=0,b=Number.POSITIVE_INFINITY;for(let[S,C]of u.entries()){let w=Hs(g,C);w<b&&(b=w,_=S);}let y=l[_];y.n++,y.r+=g[0],y.g+=g[1],y.b+=g[2],y.x+=h%r,y.y+=Math.floor(h/r),f+=Math.sqrt(b);}for(let[h,d]of l.entries())d.n>0&&(u[h]=[d.r/d.n,d.g/d.n,d.b/d.n]);}return {palette:u.map((m,h)=>({color:m,area:l[h].n/a,cx:l[h].n?l[h].x/l[h].n+.5:r/2,cy:l[h].n?l[h].y/l[h].n+.5:n/2})).filter(m=>m.area>=Ox).sort((m,h)=>h.area-m.area),error:f/a}}function j8(e,t,r){let n=t+2,o=r+2,i=(f,p)=>f<=0||p<=0||f>t||p>r?0:e[(p-1)*t+(f-1)],s=new Map,a=new Map,c=f=>{let p=a.get(f);if(p)return p;let m=Math.floor(f/2),h=m%n,d=Math.floor(m/n),g=i(h,d),_=f%2===1,b=_?i(h,d+1):i(h+1,d),y=g===b?.5:Math.min(1,Math.max(0,(.5-g)/(b-g))),S=_?[h-.5,d-.5+y]:[h-.5+y,d-.5];return a.set(f,S),S},u=(f,p)=>{s.set(f,p);};for(let f=0;f<o-1;f++)for(let p=0;p<n-1;p++){let m=i(p,f)>=.5,h=i(p+1,f)>=.5,d=i(p+1,f+1)>=.5,g=i(p,f+1)>=.5,_=2*(f*n+p),b=2*((f+1)*n+p),y=2*(f*n+p)+1,S=2*(f*n+p+1)+1;switch((m?8:0)+(h?4:0)+(d?2:0)+(g?1:0)){case 1:u(b,y);break;case 2:u(S,b);break;case 3:u(S,y);break;case 4:u(_,S);break;case 5:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(_,y),u(b,S)):(u(_,S),u(b,y));break}case 6:u(_,b);break;case 7:u(_,y);break;case 8:u(y,_);break;case 9:u(b,_);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(y,b),u(S,_)):(u(y,_),u(S,b));break}case 11:u(S,_);break;case 12:u(y,S);break;case 13:u(b,S);break;case 14:u(y,b);break;}}let l=[];for(let f of s.keys()){if(!s.has(f))continue;let p=[],m=f;for(;m!==void 0&&s.has(m);){p.push(c(m));let h=s.get(m);s.delete(m),m=h;}p.length>=3&&l.push(p);}return l}function V8(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1];}return t/2}function Lx(e,t){if(e.length<=2)return e;let r=new Uint8Array(e.length);r[0]=1,r[e.length-1]=1;let n=[[0,e.length-1]];for(;n.length>0;){let[o,i]=n.pop(),s=e[o],a=e[i],c=a[0]-s[0],u=a[1]-s[1],l=Math.hypot(c,u)||1,f=-1,p=t;for(let m=o+1;m<i;m++){let h=e[m],d=Math.abs(u*(h[0]-s[0])-c*(h[1]-s[1]))/l;d>p&&(p=d,f=m);}f>=0&&(r[f]=1,n.push([o,f],[f,i]));}return e.filter((o,i)=>r[i]===1)}function H8(e,t){let r=0,n=-1;for(let[s,a]of e.entries()){let c=(a[0]-e[0][0])**2+(a[1]-e[0][1])**2;c>n&&(n=c,r=s);}let o=Lx(e.slice(0,r+1),t),i=Lx([...e.slice(r),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var Qr=e=>fe(e,2);function W8(e,t){let r=e.length,n=(i,s)=>{let a=Math.hypot(s[0]-i[0],s[1]-i[1])||1,c=Math.min(.5,t/a);return [i[0]+(s[0]-i[0])*c,i[1]+(s[1]-i[1])*c]},o="";for(let i=0;i<r;i++){let s=e[i],a=n(s,e[(i-1+r)%r]),c=n(s,e[(i+1)%r]);o+=i===0?`M${Qr(a[0])} ${Qr(a[1])}`:`L${Qr(a[0])} ${Qr(a[1])}`,o+=`Q${Qr(s[0])} ${Qr(s[1])} ${Qr(c[0])} ${Qr(c[1])}`;}return `${o}Z`}function q8(e,t,r){let n="";for(let o of j8(e,t,r)){if(Math.abs(V8(o))<.8)continue;let i=H8(o,.18);i.length>=3&&(n+=W8(i,.9));}return n}var X8=.075;function Nx(e){let{width:t,height:r,data:n}=e,o=Z8(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=Q8(e,o),c={width:t,height:r,palette:s,alpha:o,coverage:i/(t*r)};if(s.length===0||a>X8)return {...c,layers:[],photographic:s.length>0};let u=s.length,l=Array.from({length:u},()=>new Float32Array(t*r)),f=s.map(d=>d.color);for(let d=0;d<o.length;d++){let g=o[d];if(g<=0)continue;let _=d*4,b=[ft(n[_]),ft(n[_+1]),ft(n[_+2])],y=0,S=-1,C=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY;for(let I=0;I<u;I++){let T=Hs(b,f[I]);T<C?(S=y,w=C,y=I,C=T):T<w&&(S=I,w=T);}if(S<0||C<1e-6){l[y][d]=g;continue}let $=f[y],E=f[S],R=[E[0]-$[0],E[1]-$[1],E[2]-$[2]],P=Math.min(1,Math.max(0,((b[0]-$[0])*R[0]+(b[1]-$[1])*R[1]+(b[2]-$[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));l[y][d]=g*(1-P),l[S][d]=g*P;}let p=[],m=new Float32Array(t*r),h=new Array(u);for(let d=u-1;d>=0;d--){let g=l[d];for(let _=0;_<m.length;_++)m[_]+=g[_];h[d]=m.slice();}for(let d=0;d<u;d++){let g=q8(h[d],t,r);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:Yg}=Re,Y8={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function K8(e){let t=e*4+17,r=new Uint8Array(t*t),n=(s,a)=>{s>=0&&a>=0&&s<t&&a<t&&(r[a*t+s]=1);};for(let s=0;s<t;s++)n(6,s),n(s,6);for(let[s,a]of [[3,3],[t-4,3],[3,t-4]])for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++)n(s+u,a+c);let o=[];if(e>1){let s=Math.floor(e/7)+2,a=e===32?26:Math.ceil((e*4+4)/(s*2-2))*2;o.push(6);for(let c=t-7;o.length<s;c-=a)o.splice(1,0,c);}let i=o.length-1;for(let[s,a]of o.entries())for(let[c,u]of o.entries())if(!(s===0&&c===0||s===0&&c===i||s===i&&c===0))for(let l=-2;l<=2;l++)for(let f=-2;f<=2;f++)n(a+f,u+l);for(let s=0;s<=8;s++)n(8,s),n(s,8);for(let s=0;s<8;s++)n(t-1-s,8),n(8,t-1-s);if(e>=7)for(let s=0;s<18;s++){let a=t-11+s%3,c=Math.floor(s/3);n(a,c),n(c,a);}return r}function J8(e,t){let r=e*4+17,n=Ze[t].ordinal,o=Yg.NUM_ERROR_CORRECTION_BLOCKS[n]?.[e]??0,i=Yg.ECC_CODEWORDS_PER_BLOCK[n]?.[e]??0,s=Math.floor(Yg.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(S,C)=>c+(C<a?0:1)),l=[],f=[],p=c-i;for(let S=0;S<=c;S++)for(let C=0;C<o;C++)if(C<a){if(S===p)continue;l.push(C),f.push(S<p?S:S-1);}else l.push(C),f.push(S);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=K8(e),h=new Int16Array(r*r).fill(-1),d=new Int16Array(r*r).fill(-1),g=new Int8Array(r*r).fill(-1),_=s*8,b=0;for(let S=r-1;S>=1;S-=2){S===6&&(S=5);let C=(S+1&2)===0;for(let w=0;w<r;w++)for(let $=0;$<2;$++){let E=S-$,P=(C?r-1-w:w)*r+E;if(!m[P]&&b<_){let I=b>>>3;h[P]=l[I],d[P]=f[I],g[P]=7-(b&7),b++;}}}if(b!==_)throw new Error(`Codeword map: placement mismatch at version ${e}`);let y=Y8[`${e}${t}`]??0;return {version:e,level:t,size:r,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-y)/2),block:h,codeword:d,bit:g}}var eE=8,Tn=new Map;function Ws(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let r=`${e}${t}`,n=Tn.get(r);if(n)return Tn.delete(r),Tn.set(r,n),n;let o=J8(e,t);if(Tn.size>=eE){let i=Tn.keys().next().value;i!==void 0&&Tn.delete(i);}return Tn.set(r,o),o}function qs(e,t){let r=new Array(e.blocks).fill(0),n=new Set;for(let o of t){let i=e.block[o]??-1;if(i<0)continue;let s=i*4096+e.codeword[o];n.has(s)||(n.add(s),r[i]=r[i]+1);}return r}var tE={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"},rE=Object.fromEntries(Object.entries(tE).map(([e,t])=>[e,[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]]));function Fx(e,t){let r=e.trim(),n=Number.parseFloat(r);return Number.isNaN(n)?Number.NaN:r.endsWith("%")?n/100*t:n}function we(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let r=rE[t];if(r)return {r:r[0],g:r[1],b:r[2],a:1};if(t.startsWith("#")){let o=t.slice(1);return (o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(o)?{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16),a:o.length===8?Number.parseInt(o.slice(6,8),16)/255:1}:null}let n=/^rgba?\(([^)]*)\)$/.exec(t);if(n){let[o,i]=n[1].split("/"),s=o.split(/[\s,]+/).filter(Boolean);if(s.length!==(i===void 0&&s.length===4?4:3))return null;let a=i??s[3],[c,u,l]=s.slice(0,3).map(m=>Fx(m,255)),f=a===void 0?1:Fx(a,1);if([c,u,l,f].some(m=>Number.isNaN(m)))return null;let p=(m,h)=>Math.min(Math.max(m,0),h);return {r:p(c,255),g:p(u,255),b:p(l,255),a:p(f,1)}}return null}function jr(e,t,r){let n=e/255,o=t/255,i=r/255,s=1-Math.max(n,o,i);return s>=1?[0,0,0,1]:[fe((1-n-s)/(1-s)),fe((1-o-s)/(1-s)),fe((1-i-s)/(1-s)),fe(s)]}function It(e){return e.children}var nE=e=>e==null?null:`${e}`;function Kg(e,t,r){let n=t??{},o=r;if("key"in n){let{key:i,...s}=n;i!==void 0&&(o=i),n=s;}return {type:e,props:n,key:nE(o)}}function oE(e,t){let r=e;return {type:r.type,props:{...r.props,...t},key:r.key??null}}function iE(e,t,...r){let n={...t};return r.length>0&&(n.children=r.length===1?r[0]:r),Kg(e,n)}var sE={jsx:Kg,jsxs:Kg,createElement:iE,cloneElement:oE,Fragment:It},Xs=sE;var Jg=e=>e===It?Xs.Fragment:e;function k(e,t,r){return Xs.jsx(Jg(e),t,r)}function Be(e,t,r){return Xs.jsxs(Jg(e),t,r)}function qu(e,t,...r){return Xs.createElement(Jg(e),t??null,...r)}function On(e,t){return Xs.cloneElement(e,t)}var aE=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),zx=Symbol.for("react.fragment");function Ln(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!aE.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===zx)&&typeof t.props=="object"&&t.props!==null}var si=e=>e===It||e===zx;var Qx=.6,r1={logo:160,halftone:160};function cE(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}var ai=class{entries=new Map;limit;constructor(t){this.limit=t;}get(t,r){let n=this.entries.get(t);if(n!==void 0)return this.entries.delete(t),this.entries.set(t,n),n;let o=r();if(this.entries.size>=this.limit){let i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(t,o),o}},uE=new ai(8);function lE(e){return uE.get(e,()=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r})}function n1(e){let{width:t,height:r,data:n}=e;if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>Ht||r>Ht||typeof n!="string")return null;try{let o=lE(n);return o.length===t*r*4?{width:t,height:r,data:o}:null}catch{return null}}function jx(e,t={}){let{width:r,height:n,data:o}=e;if(!(r>0&&n>0)||o.length<r*n*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=Math.min(r,n),s=t.square?Math.floor((r-i)/2):0,a=t.square?Math.floor((n-i)/2):0,c=t.square?i:r,u=t.square?i:n,l=Math.min(Math.max(Math.round(t.maxSize??r1.halftone),1),Ht),f=Math.min(1,l/Math.max(c,u)),p=Math.max(1,Math.round(c*f)),m=Math.max(1,Math.round(u*f)),h=new Uint8Array(p*m*4);for(let d=0;d<m;d++){let g=Math.floor(d*u/m),_=Math.max(g+1,Math.floor((d+1)*u/m));for(let b=0;b<p;b++){let y=Math.floor(b*c/p),S=Math.max(y+1,Math.floor((b+1)*c/p)),C=0,w=0,$=0,E=0,R=0;for(let I=g;I<_;I++)for(let T=y;T<S;T++){let O=((I+a)*r+T+s)*4,B=o[O+3]/255;C+=o[O]*B,w+=o[O+1]*B,$+=o[O+2]*B,E+=B,R++;}let P=(d*p+b)*4;h[P]=E>0?Math.round(C/E):0,h[P+1]=E>0?Math.round(w/E):0,h[P+2]=E>0?Math.round($/E):0,h[P+3]=Math.round(E/R*255);}}return {width:p,height:m,data:cE(h)}}async function fE(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(r=>{e.addEventListener("load",r,{once:true}),e.addEventListener("error",r,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((r,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>r(o),o.onerror=()=>n(new Error("Could not load the art image")),o.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function mE(e,t={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let r=t.mode??"halftone",n=t.maxSize??r1[r],o=await fE(e),i=o.naturalWidth||o.width||n,s=o.naturalHeight||o.height||n,a=r==="halftone",c=Math.min(1,n*4/(a?Math.min(i,s):Math.max(i,s))),u=Math.max(1,Math.round(i*c)),l=Math.max(1,Math.round(s*c)),f=document.createElement("canvas");f.width=u,f.height=l;let p=f.getContext("2d",{willReadFrequently:true});if(!p)throw new Error("Could not get a canvas context");p.imageSmoothingQuality="high",p.drawImage(o,0,0,u,l);let m;try{m=p.getImageData(0,0,u,l);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{f.remove();}return jx(m,{maxSize:n,square:a})}function o1(e){return !!(e&&lo.includes(e.mode)&&e.image&&n1(e.image))}function Ku(e){let t=fo[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function pE(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function Ys(e,t){let r=pE(e,t),n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return o}var dE=0,Mt=1,Bt=2,Vr=3,Dx=4,Bx=new Map;function Vx(e){let t=Bx.get(e);if(t)return t;let r=e*4+17,n=new Uint8Array(r*r),o=(i,s,a,c,u)=>{for(let l=Math.max(0,s);l<Math.min(r,s+c);l++)for(let f=Math.max(0,i);f<Math.min(r,i+a);f++)n[l*r+f]=u;};o(6,0,1,r,Dx),o(0,6,r,1,Dx),o(0,8,9,1,Vr),o(8,0,1,9,Vr),o(r-8,8,8,1,Vr),o(8,r-8,1,8,Vr),e>=7&&(o(r-11,0,3,6,Vr),o(0,r-11,6,3,Vr));for(let[i,s]of Ys(e,r))o(i-2,s-2,5,5,Bt);return o(0,0,8,8,Mt),o(r-8,0,8,8,Mt),o(0,r-8,8,8,Mt),Bx.set(e,n),n}function hE(e){let t=e*4+17,r=Vx(e);return Array.from({length:t},(n,o)=>Array.from({length:t},(i,s)=>r[o*t+s]!==dE))}function gE(e){let t=e[8],r=t?.[0]?1:0,n=t?.[1]?1:0,o=(1-r)*2+n;return ["M","L","H","Q"][o]??"M"}function ci(e,t){let r=we(e);return !r||r.a===0?t:[r.r/255,r.g/255,r.b/255]}var Fn=(e,t,r)=>[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r,e[2]+(t[2]-e[2])*r];function Hr(e,t,r,n){let o=me(e);if(n?o<=r:o>=r)return e;let i=me(t);return Math.abs(o-i)<1e-6?t:Fn(e,t,Math.min(1,Math.max(0,(o-r)/(o-i))))}var Hx=e=>Math.max(...e)-Math.min(...e),_E=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,e1=e=>e.toString(16).padStart(2,"0");function mt(e,t=1){let r=n=>Math.min(255,Math.round(Math.round(Math.min(Math.max(n,0),1)*255)/t)*t);return `#${e1(r(e[0]))}${e1(r(e[1]))}${e1(r(e[2]))}`}function bE(e){let t=e<0?-1:1,r=Math.abs(e),n=1/(1+.3275911*r),o=1-((((1.061405429*n-1.453152027)*n+1.421413741)*n-.284496736)*n+.254829592)*n*Math.exp(-r*r);return t*o}var i1=.3,Zx=e=>1-Math.exp(-((e/2)**2)/(2*i1**2)),yE=e=>bE(e/(2*i1*Math.SQRT2))**2,xE=(e,t,r)=>{let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)};function s1(e,t,r,n){let o=n==="cover"?Math.max(r/e,r/t):Math.min(r/e,r/t);return {scale:o,offsetX:(r-e*o)/2,offsetY:(r-t*o)/2}}function Wx(e,t){let{width:r,height:n,data:o}=e,i=new Float32Array(r*n*3),s=t??new Float32Array(r*n);for(let a=0;a<r*n;a++)i[a*3]=o[a*4]/255,i[a*3+1]=o[a*4+1]/255,i[a*3+2]=o[a*4+2]/255,t||(s[a]=o[a*4+3]/255);return {width:r,height:n,rgb:i,alpha:s}}function $E(e){let t=Wx(e),{rgb:r,alpha:n}=t,o=new Float64Array(256),i=0;for(let f=0;f<n.length;f++){if(n[f]<.5)continue;let p=me([r[f*3],r[f*3+1],r[f*3+2]]);o[Math.min(255,Math.floor(p*256))]+=1,i++;}let s=f=>{let p=0;for(let m=0;m<256;m++)if(p+=o[m],p>=f*i)return m/255;return 1},a=i?s(.01):0,c=i?s(.99):1;c-a<.15&&(a=0,c=1);let u=Math.min(1.6,1/(c-a)),l=(a+c)/2;for(let f=0;f<n.length;f++){let p=[r[f*3],r[f*3+1],r[f*3+2]],m=me(p),h=.5+(m-l)*u;for(let d=0;d<3;d++)r[f*3+d]=Math.min(1,Math.max(0,h+(p[d]-m)*1.12));}return t}function qx(e,t,r,n,o=1){let{width:i,height:s,rgb:a,alpha:c}=e,u=Math.min(Math.max(t-.5,0),i-1),l=Math.min(Math.max(r-.5,0),s-1),f=Math.floor(u),p=Math.floor(l),m=Math.min(f+1,i-1),h=Math.min(p+1,s-1),d=u-f,g=l-p,_=0,b=0,y=0,S=0,C=($,E,R)=>{let P=E*i+$,I=c[P]*R;_+=a[P*3]*I,b+=a[P*3+1]*I,y+=a[P*3+2]*I,S+=I;};if(C(f,p,(1-d)*(1-g)),C(m,p,d*(1-g)),C(f,h,(1-d)*g),C(m,h,d*g),S<=0)return n;let w=S*o;return [n[0]+(_/S-n[0])*w,n[1]+(b/S-n[1])*w,n[2]+(y/S-n[2])*w]}var wE=new ai(4),SE=new ai(6),CE=new ai(6);function a1(e,t){return SE.get(e.image.data,()=>Nx(t))}function Xx(e,t,r){return CE.get(e.image.data,()=>Wx(t,r.alpha))}var Qe=e=>fe(e,2),Yx=e=>fe(e,4),zn=class{groups=new Map;add(t,r){let n=this.groups.get(t);n?n.push(r):this.groups.set(t,[r]);}cellRun(t,r,n,o){this.add(t,`M${r} ${n}h${o}.04v1.04h-${o}.04z`);}circle(t,r,n,o){this.add(t,EE(r,n,o));}toElements(t){return [...this.groups].map(([r,n],o)=>k("path",{d:n.join(""),fill:r},`${t}-${o}`))}};function EE(e,t,r){let n=Qe(r*2),o=Qe(r);return `M${Qe(e-r)} ${Qe(t)}a${o} ${o} 0 1 0 ${n} 0a${o} ${o} 0 1 0 ${-n} 0z`}function Nn(e,t,r,n,o){let i=Math.min(o,r/2,n/2);if(i<=0)return `M${Qe(e)} ${Qe(t)}h${Qe(r)}v${Qe(n)}h${Qe(-r)}z`;let s=Qe(i);return `M${Qe(e+i)} ${Qe(t)}h${Qe(r-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${Qe(n-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${Qe(-(r-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${Qe(-(n-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function Kx(e,t,r){let n="";for(let[o,i]of e){let s=(o-2+t)*r,a=(i-2+t)*r;n+=Nn(s,a,5*r,5*r,r*.35),n+=Nn(s+r,a+r,3*r,3*r,r*.15),n+=Nn(s+2*r,a+2*r,r,r,r*.12);}return n}var AE={blend:1,badge:1,color:.9,mono:.7},Yu=.35;function vE(e,t){let r=ci(e,[0,0,0]),n=ci(t,[1,1,1]),o=me(n)-me(r);return o>=Yu?null:o<=-Yu?"inverted":"low-contrast"}function Jx(e,t,r){let n=Math.min(Math.max(e.intensity??Qx,0),AE[Ku(e)]);return me(r)-me(t)>=Yu?n:0}function RE(e){let{art:t,modules:r,version:n}=e,o=t.image&&n1(t.image);if(!(o&&lo.includes(t.mode)))return null;let i=r.length;if(i!==n*4+17)return null;let s=ci(e.fgColor,[0,0,0]),a=ci(e.bgColor,[1,1,1]),c=Jx(t,s,a);return c<=0?null:{art:t,image:o,modules:r,size:i,version:n,kinds:Vx(n),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:Ku(t),body:e.body}}function c1(e){let t=RE(e);if(!t)return null;let r;return t.art.mode==="halftone"?r=t.variant==="mono"?OE(t):TE(t):r=t.variant==="badge"?GE(t):LE(t),k("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:r})}function PE(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var e$=8.5,Ux=new Map;function u1(e){let t=e*4+17,r=Ux.get(e);if(!r){let i=t*2,s=new Uint8Array(i*i),a=e$*2;for(let c=0;c<i;c++)for(let u=0;u<i;u++){let l=u<a||u>=i-a,f=c<a||c>=i-a;l&&f&&!(u>=i-a&&c>=i-a)&&(s[c*i+u]=1);}for(let[c,u]of Ys(e,t))for(let l=(u-2)*2-1;l<(u+3)*2+1;l++)for(let f=(c-2)*2-1;f<(c+3)*2+1;f++)f>=0&&l>=0&&f<i&&l<i&&(s[l*i+f]=1);Ux.set(e,s),r=s;}let n=r,o=t*2;return (i,s)=>{let a=Math.floor(i*2),c=Math.floor(s*2);return a>=0&&c>=0&&a<o&&c<o&&n[c*o+a]===1}}function t$(e,t,r=false){let{image:n,size:o,kinds:i,fg:s,bg:a}=e,c=wE.get(e.art.image.data,()=>$E(n)),u=s1(n.width,n.height,o,"cover"),l=o*t,f=new Float32Array(l*l*3).fill(Number.NaN),m=1/(t*u.scale)>1.3?2:1,h=me(a)-.1*(me(a)-me(s)),d=u1(e.version);for(let g=0;g<o;g++)for(let _=0;_<o;_++){let b=i[g*o+_],y=b===Mt||b===Bt;if(!(y&&!r))for(let S=0;S<t;S++)for(let C=0;C<t;C++){let w=0,$=0,E=0;for(let z=0;z<m;z++)for(let F=0;F<m;F++){let te=_+(C+(F+.5)/m)/t,re=g+(S+(z+.5)/m)/t,Q=qx(c,(te-u.offsetX)/u.scale,(re-u.offsetY)/u.scale,a);w+=Q[0],$+=Q[1],E+=Q[2];}let R=m*m,P=[w/R,$/R,E/R],I=_+(C+.5)/t,T=g+(S+.5)/t,O=Math.min(I,T,o-I,o-T);O<1.5&&(P=Fn(P,a,.35*(1-O/1.5))),r&&(y||d(I,T))&&(P=Hr(P,a,h,false));let B=((g*t+S)*l+_*t+C)*3;f[B]=P[0],f[B+1]=P[1],f[B+2]=P[2];}}return {n:t,count:l,rgb:f}}function kE(e,t,r){let{size:n,kinds:o,modules:i,fg:s,bg:a,t:c}=e,{n:u,count:l,rgb:f}=t,p=me(s),m=me(a),h=m-p,d=PE(c,u),g=E=>.2126*f[E]+.7152*f[E+1]+.0722*f[E+2],_=new Float32Array(n*n),b=new Float32Array(n*n);for(let E=0;E<n;E++)for(let R=0;R<n;R++){let P=o[E*n+R];if(P===Mt){_[E*n+R]=m;continue}if(P===Bt){_[E*n+R]=i[E]?.[R]?p:m;continue}let I=0,T=0,O=0;for(let B=0;B<u;B++)for(let z=0;z<u;z++){let F=g(((E*u+B)*l+R*u+z)*3);I+=F,r.under[B*u+z]||(T+=F,O++);}_[E*n+R]=I/(u*u),b[E*n+R]=O?T/O:I/(u*u);}let y=n+1,S=new Float64Array(y*y);for(let E=0;E<n;E++)for(let R=0;R<n;R++)S[(E+1)*y+R+1]=_[E*n+R]+S[E*y+R+1]+S[(E+1)*y+R]-S[E*y+R];let C=2,w=(E,R)=>{let P=Math.max(0,E-C),I=Math.max(0,R-C),T=Math.min(n,E+C+1),O=Math.min(n,R+C+1);return (S[O*y+T]-S[I*y+T]-S[O*y+P]+S[I*y+P])/((T-P)*(O-I))},$=r.weight;for(let E=0;E<n;E++)for(let R=0;R<n;R++){let P=o[E*n+R];if(P===Mt||P===Bt)continue;let I=P===Vr,T=(d.margin+(I?.08:0))*h,O=(d.darkCap-(I?.12:0))*h,B=($*((r.light-r.dark)/2)-T)/(1-$),z=w(R,E),F=b[E*n+R],te=!!i[E]?.[R],re=0,Q=a;if(te){let X=Math.min(z+B,p+O);F>X&&(re=(F-X)/Math.max(F-p,1e-6),Q=s);}else {let X=Math.max(z-B,m-O);F<X&&(re=(X-F)/Math.max(m-F,1e-6));}if(!(re<=0)){re=Math.min(1,re);for(let X=0;X<u;X++)for(let ae=0;ae<u;ae++){let De=((E*u+X)*l+R*u+ae)*3;for(let Ce=0;Ce<3;Ce++)f[De+Ce]+=(Q[Ce]-f[De+Ce])*re;}}}}function r$(e,t,r,n){let{count:o}=t,i=new zn;for(let c=0;c<o;c++){let u=0,l=r(c*o);for(let f=1;f<=o;f++){let p=f<o?r(c*o+f):null;(f===o||p!==l)&&(l&&i.cellRun(l,u,c,f-u),u=f,l=p);}}let s=e.pixelSize/t.n,a=Qe(e.margin*e.pixelSize);return k("g",{transform:`translate(${a} ${a}) scale(${Yx(s)})`,children:i.toElements(n)},n)}function l1(e,t){let r=Ys(e.version,e.size);return r.length===0?[]:[k("path",{d:Kx(r,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function n$(e){let{image:t,size:r}=e;return Math.floor(Math.min(t.width,t.height)/r)>=4&&r<=45?4:3}var IE=e=>2*i1*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function ME(e,t,r){let n=t+1,o=new Float64Array(n*n);for(let s=0;s<t;s++)for(let a=0;a<t;a++)o[(s+1)*n+a+1]=e[s*t+a]+o[s*n+a+1]+o[(s+1)*n+a]-o[s*n+a];let i=new Float32Array(t*t);for(let s=0;s<t;s++)for(let a=0;a<t;a++){let c=Math.max(0,a-r),u=Math.max(0,s-r),l=Math.min(t,a+r+1),f=Math.min(t,s+r+1);i[s*t+a]=(o[f*n+l]-o[u*n+l]-o[f*n+c]+o[u*n+c])/((l-c)*(f-u));}return i}function o$(e,t,r,n){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=me(a),l=me(c),f=l-u,p=ME(t,o,2),m=new Float32Array(o*o),h=new Float32Array(o*o).fill(Number.NaN);for(let d=0;d<o;d++)for(let g=0;g<o;g++){let _=d*o+g,b=i[_];if(b===Mt||b===Bt)continue;let y=b===Vr,S=n.base+(y?.08:0),C=(n.margin+(y?.03:0))*f,w=(n.cap-(y?.04:0))*f,$=Zx(S),E=Zx(y?Math.max(n.max,.94):n.max),R=$*((n.dark+n.light)/2)+(1-$)*p[_],P=r[_],I=!!s[d]?.[g],T=I?n.dark:n.light,O=I?Math.min(R-C,u+w):Math.max(R+C,l-w),z=(I?P<=O:P>=O)?0:(P-O)/(P-T);z>E&&(z=E,h[_]=Math.min(l,Math.max(u,(O-E*T)/(1-E))));let F=I?P<=O-.06:P>=O+.06;n.skip&&F&&!y||(z=Math.max(z,$)),m[_]=z>0?IE(z):0;}return {diameter:m,surround:h}}function TE(e){let{size:t,kinds:r,modules:n,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=n$(e),l=t$(e,u,true),f=me(o),p=me(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,_=(w,$,E,R)=>(($*u+R)*d+w*u+E)*3,b=new Float32Array(t*t);for(let w=0;w<t;w++)for(let $=0;$<t;$++){let E=r[w*t+$];if(E===Mt||E===Bt){b[w*t+$]=E===Bt&&n[w]?.[$]?f:p;continue}let R=0;for(let P=0;P<u;P++)for(let I=0;I<u;I++){let T=_($,w,I,P);R+=.2126*g[T]+.7152*g[T+1]+.0722*g[T+2];}b[w*t+$]=R/(u*u);}let y=o$(e,b,b,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let w=0;w<t;w++)for(let $=0;$<t;$++){let E=y.surround[w*t+$];if(Number.isNaN(E))continue;let R=b[w*t+$],I=E<R?o:i,T=Math.min(1,Math.abs(R-E)/Math.max(Math.abs(R-me(I)),1e-6));for(let O=0;O<u;O++)for(let B=0;B<u;B++){let z=_($,w,B,O);for(let F=0;F<3;F++)g[z+F]+=(I[F]-g[z+F])*T;}}let S=[r$(e,l,w=>{let $=w*3;return Number.isNaN(g[$])?null:mt([g[$],g[$+1],g[$+2]],8)},"art-photo")],C=new zn;for(let w=0;w<t;w++)for(let $=0;$<t;$++){let E=y.diameter[w*t+$];if(!(E>0))continue;let R=0,P=0,I=0;for(let B=0;B<u;B++)for(let z=0;z<u;z++){let F=_($,w,z,B);R+=g[F],P+=g[F+1],I+=g[F+2];}let T=[R/(u*u),P/(u*u),I/(u*u)],O=n[w]?.[$]?Hr(T,o,m,true):Hr(T,i,h,false);C.circle(mt(O,10),($+a+.5)*c,(w+a+.5)*c,E/2*c);}return S.push(...C.toElements("art-dot"),...l1(e,mt(o))),S}function OE(e){let{size:t,kinds:r,modules:n,fg:o,bg:i}=e,s=n$(e),a=t$(e,s),c=me(o),u=me(i),l=s%2===1?1:2,f=(s-l)/2,p=R=>R>=f&&R<f+l,m=[];for(let R=0;R<s;R++)for(let P=0;P<s;P++)m.push(p(P)&&p(R));kE(e,a,{weight:yE(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),_=new Int8Array(h*h).fill(-1);for(let R=0;R<h*h;R++){let P=R*3;if(Number.isNaN(d[P])){g[R]=Number.NaN;continue}let I=(.2126*d[P]+.7152*d[P+1]+.0722*d[P+2]-c)/(u-c);g[R]=.5+(xE(0,1,I)-.5)*1.15;}for(let R=0;R<t;R++)for(let P=0;P<t;P++){let I=r[R*t+P];if(!(I===Mt||I===Bt))for(let T=f;T<f+l;T++)for(let O=f;O<f+l;O++)_[(R*s+T)*h+P*s+O]=n[R]?.[P]?0:1;}let b=u1(e.version);for(let R=0;R<h;R++)for(let P=0;P<h;P++){let I=R*h+P;_[I]<0&&b((P+.5)/s,(R+.5)/s)&&(_[I]=1);}let y=new Uint8Array(h*h),S=.3,C=0,w=0,$=(R,P,I)=>{if(R<0||R>=h||P>=h)return;let T=P*h+R;if(!Number.isNaN(g[T])){let O=Math.floor(R/s)===Math.floor(C/s)&&Math.floor(P/s)===Math.floor(w/s);g[T]+=O?I:I*S;}};for(let R=0;R<h;R++){let P=R%2===0?1:-1;for(let I=0;I<h;I++){let T=P===1?I:h-1-I,O=R*h+T,B=g[O];if(Number.isNaN(B))continue;let z=_[O]>=0?_[O]:B>=.5?1:0;y[O]=z===0?1:0;let F=Math.min(.75,Math.max(-0.75,B-z));C=T,w=R,$(T+P,R,F*7/16),$(T-P,R+1,F*3/16),$(T,R+1,F*5/16),$(T+P,R+1,F/16);}}let E=mt(o);return [r$(e,a,R=>y[R]?E:null,"art-halftone"),...l1(e,E)]}function Gx(e,t){let r=null,n=0;for(let o of e.palette){if(t&&_E(o.color,t)<.02)continue;let i=o.area*(.35+Hx(o.color))*(me(o.color)>.86?.05:1);i>n&&(n=i,r=o.color);}return r}function i$(e,t,r,n,o){let i;if(e.photographic){let s=new zn,{width:a,height:c,rgb:u,alpha:l}=t;for(let f=0;f<c;f++){let p=0,m=null;for(let h=0;h<=a;h++){let d=f*a+h,g=h<a&&l[d]>=.5?mt(n([u[d*3],u[d*3+1],u[d*3+2]]),6):null;(h===a||g!==m)&&(m&&s.cellRun(m,p,f,h-p),p=h,m=g);}}i=s.toElements(`${o}-px`);}else i=e.layers.map((s,a)=>k("path",{d:s.d,fill:mt(n(s.color)),fillRule:"evenodd"},`${o}-${a}`));return k("g",{transform:`translate(${Qe(r.x)} ${Qe(r.y)}) scale(${Yx(r.scale)})`,children:i},o)}function LE(e){let{art:t,image:r,size:n,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=a1(t,r),p=Xx(t,r,f),m=s1(f.width,f.height,n,"contain"),h=Math.min(1,.3+1.4*c),d=F=>Fn(a,F,h),g=mt(a),_=mt(s),b=[i$(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],y=e$,S=(F,te)=>Nn((F+u)*l,(te+u)*l,(y+.4)*l,(y+.4)*l,1.2*l),C=Ys(e.version,n).map(([F,te])=>Nn((F-2.5+u)*l,(te-2.5+u)*l,6*l,6*l,l*.8)).join("");b.push(k("path",{d:S(-0.4,-0.4)+S(n-y,-0.4)+S(-0.4,n-y)+C,fill:g},"art-plates"));let w=u1(e.version),$=me(a),E=me(s),R=new Float32Array(n*n),P=new Float32Array(n*n),I=new Array(n*n);for(let F=0;F<n;F++)for(let te=0;te<n;te++){let re=F*n+te,Q=o[re];if(Q===Mt||Q===Bt){R[re]=Q===Bt&&i[F]?.[te]?E:$;continue}let X=1,ae=0,De=0,Ce=0,U=0;for(let V=0;V<4;V++)for(let ue=0;ue<4;ue++){let et=te+(ue+.5)/4,Ee=F+(V+.5)/4,Qt=w(et,Ee)?a:qx(p,(et-m.offsetX)/m.scale,(Ee-m.offsetY)/m.scale,a,h),or=me(Qt);X=Math.min(X,or),ae+=or,De+=Qt[0],Ce+=Qt[1],U+=Qt[2];}R[re]=ae/16,P[re]=X,I[re]=[De/16,Ce/16,U/16];}let T=E+.08*($-E),O=$-.04*($-E),B=o$(e,R,R,{base:.74-.26*c,max:.9,dark:T,light:O,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),z=new zn;for(let F=0;F<n;F++)for(let te=0;te<n;te++){let re=F*n+te,Q=B.diameter[re],X=!!i[F]?.[te];if(!(Q>0)||!X&&P[re]>=$-.02)continue;let ae=X?Hr(I[re],s,T,true):Hr(I[re],a,O,false);z.circle(mt(ae,8),(te+u+.5)*l,(F+u+.5)*l,Q/2*l);}return b.push(...z.toElements("art-dot")),b.push(...l1(e,_)),b}var NE={L:.5,M:.72,Q:.88,H:1},s$=.32,a$=.55,FE=.6,zE=2;function c$(e,t,r){let n=t>=1?e:e*t,o=t>=1?e/t:e,i=Math.max(.7,e*.09),s=n+2*i,a=o+2*i;return {logoW:n,logoH:o,plateW:s,plateH:a,radius:Math.min(s,a)*.26,cx:r/2,cy:r/2}}var u$=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function l$(e,t,r){return m$(t+.5,r+.5,e)<a$}function DE(e,t){let r=u$(e),n=a$+1,o=Math.max(0,Math.floor(e.cx-e.plateW/2-n)),i=Math.min(t-1,Math.ceil(e.cx+e.plateW/2+n)),s=Math.max(0,Math.floor(e.cy-e.plateH/2-n)),a=Math.min(t-1,Math.ceil(e.cy+e.plateH/2+n)),c=[];for(let u=s;u<=a;u++)for(let l=o;l<=i;l++)l$(r,l,u)&&c.push(u*t+l);return c}var BE=e=>Math.floor(e.correctable*FE);function t1(e,t,r){let n=c$(e,t,r.size),o=BE(r);return qs(r,DE(n,r.size)).every(i=>i<=o)}function f$(e,t,r){if(t1(r,t,e))return r;let n=0,o=r;if(!t1(n,t,e))return -1;for(;o-n>1/64;){let i=(n+o)/2;t1(i,t,e)?n=i:o=i;}return n}var Xu=new Map;function ZE(e,t){let r=`${e.version}${e.level}:${t.toFixed(3)}`,n=Xu.get(r);return n===void 0&&(n=f$(e,t,s$*e.size),Xu.size>=64&&Xu.clear(),Xu.set(r,n)),n}function UE(e,t){let{size:r,t:n,modules:o,version:i}=e,s=gE(o),a=(.18+.15*n)*NE[s],c=t.width/t.height,u=Math.min(s$,a)*r,l=Ws(i,s),f=Math.max(0,ZE(l,c));if(f<zE)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=f$(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:c$(p,c,r)}}function m$(e,t,r){let n=Math.abs(e-r.cx)-(r.w/2-r.r),o=Math.abs(t-r.cy)-(r.h/2-r.r);return Math.hypot(Math.max(n,0),Math.max(o,0))+Math.min(Math.max(n,o),0)-r.r}function p$(e,t){let{fg:r,bg:n,t:o}=e,i=me(r),s=me(n),a=Gx(t),c=Math.min(1,o/.6),u=a?Hr(a,r,i+.3*(s-i),true):r,l=Fn(r,u,c),f=a?Gx(t,a):null,p=i+.42*(s-i),m=f&&me(f)<=p+.22?Fn(r,Hr(f,r,p,true),c):l;return {body:l,inner:m}}function GE(e){let{art:t,image:r,size:n,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=a1(t,r),f=UE(e,l).plate,{body:p}=p$(e,l),m=mt(p),h=f&&u$(f),d=i.map(I=>[...I]);for(let I=0;I<n;I++)for(let T=0;T<n;T++){let O=o[I*n+T];(O===Bt||h&&O!==Mt&&l$(h,T,I))&&(d[I][T]=false);}let g=[],_=e.body?.(d);if(_)g.push(k("g",{fill:m,children:_},"art-body"));else {let I=new zn;for(let T=0;T<n;T++)for(let O=0;O<n;O++)d[T]?.[O]&&o[T*n+O]!==Mt&&I.circle(m,(O+a+.5)*c,(T+a+.5)*c,.45*c);g.push(...I.toElements("art-body"));}let b=Ys(u,n).filter(([I,T])=>!h||m$(I+.5,T+.5,h)>3.2);if(b.length>0&&g.push(k("path",{d:Kx(b,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let y=Xx(t,r,l),S=(f.cx-f.plateW/2+a)*c,C=(f.cy-f.plateH/2+a)*c,w=f.plateW*c,$=f.plateH*c,E=f.radius*c,R=.1*c,P=Nn(S,C,w,$,E);return g.push(k("path",{d:P,fill:mt(s)},"art-plate"),k("path",{d:P+Nn(S+R,C+R,w-2*R,$-2*R,E-R),fill:mt(Fn(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),i$(l,y,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},I=>I,"art-logo")),g}function f1(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let r=t.image&&n1(t.image);if(!r)return null;let n=ci(e.fgColor,[0,0,0]),o=ci(e.bgColor,[1,1,1]),i=Jx(t,n,o);if(i<=0)return null;let s=a1(t,r);if(s.palette.length===0)return null;if(Ku(t)==="badge"){let{body:h,inner:d}=p$({fg:n,bg:o,t:i},s),g={outer:mt(h),inner:mt(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=me(n),c=me(o),u=Math.min(1,i/.6),l=e.version*4+17,f=s1(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,_=(d-f.offsetY)/f.scale,b=null,y=0;for(let C of s.palette){if(me(C.color)>.86)continue;let w=(C.cx-g)**2+(C.cy-_)**2,$=C.area*(.35+Hx(C.color))*Math.exp(-w/(2*p**2));$>y&&(y=$,b=C.color);}if(!b)return {};let S=Hr(b,n,a+.42*(c-a),true);return {inner:mt(Fn(n,S,u))}};return {topLeft:m(3.5,3.5),topRight:m(l-3.5,3.5),bottomLeft:m(3.5,l-3.5)}}var QE=16384;var d$=e=>e*3+3&-4,m1=(e,t)=>Math.floor((e*t+255*(255-t)+127)/255);function p1(e,t,r){if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>16384||r>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${t} x ${r}`);if(e.length!==t*r*4)throw new RangeError(`Expected ${t*r*4} RGBA bytes for ${t} x ${r}, got ${e.length}`);let n=d$(t),o=n*r,i=new Uint8Array(54+o),s=new DataView(i.buffer);i[0]=66,i[1]=77,s.setUint32(2,i.length,true),s.setUint32(10,54,true),s.setUint32(14,40,true),s.setInt32(18,t,true),s.setInt32(22,r,true),s.setUint16(26,1,true),s.setUint16(28,24,true),s.setUint32(30,0,true),s.setUint32(34,o,true),s.setInt32(38,2835,true),s.setInt32(42,2835,true);for(let a=0;a<r;a++){let c=a*t*4,u=54+(r-1-a)*n;for(let l=0;l<t;l++){let f=e[c+3],p=e[c],m=e[c+1],h=e[c+2];f===255?(i[u]=h,i[u+1]=m,i[u+2]=p):(i[u]=m1(h,f),i[u+1]=m1(m,f),i[u+2]=m1(p,f)),c+=4,u+=3;}}return i}function d1(e){if(e.length<54||e[0]!==66||e[1]!==77)return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getInt32(18,true),n=t.getInt32(22,true);return t.getUint32(2,true)===e.length&&t.getUint32(10,true)===54&&t.getUint32(14,true)===40&&r>0&&n>0&&t.getUint16(26,true)===1&&t.getUint16(28,true)===24&&t.getUint32(30,true)===0&&e.length===54+d$(r)*n}function Ju(e){let t=e.getContext("2d");if(!t)throw new Error("Could not get canvas context");let{data:r}=t.getImageData(0,0,e.width,e.height),n=p1(r,e.width,e.height);if(!d1(n))throw new Error("Could not write a BMP file");return new Blob([n],{type:"image/bmp"})}function ce(e){if(e.length===0)return "";let[t,...r]=e;return `M${x(t[0])} ${x(t[1])}${r.map(([n,o])=>`L${x(n)} ${x(o)}`).join("")}Z`}function pe(e,t,r){return `M${x(e-r)} ${x(t)}A${x(r)} ${x(r)} 0 1 1 ${x(e+r)} ${x(t)}A${x(r)} ${x(r)} 0 1 1 ${x(e-r)} ${x(t)}Z`}function G(e,t,r,n,o=0){let i=Math.min(r,n)/2,[s,a,c,u]=(typeof o=="number"?[o,o,o,o]:o).map(f=>Math.max(0,Math.min(f,i))),l=(f,p,m)=>f>0?`A${x(f)} ${x(f)} 0 0 1 ${x(p)} ${x(m)}`:"";return `M${x(e+s)} ${x(t)}H${x(e+r-a)}${l(a,e+r,t+a)}V${x(t+n-c)}${l(c,e+r-c,t+n)}H${x(e+u)}${l(u,e,t+n-u)}V${x(t+s)}${l(s,e+s,t)}Z`}function h1(e,t,r,n){return [[e+n,t],[e+r-n,t],[e+r,t+n],[e+r,t+r-n],[e+r-n,t+r],[e+n,t+r],[e,t+r-n],[e,t+n]]}function ui(e,t,r,n,o=-90){return Array.from({length:n},(i,s)=>{let a=(o+360/n*s)*Math.PI/180;return [e+r*Math.cos(a),t+r*Math.sin(a)]})}function li(e,t,r,n,o=5){return Array.from({length:o*2},(i,s)=>{let a=s%2===0?r:n,c=-Math.PI/2+Math.PI/o*s;return [e+a*Math.cos(c),t+a*Math.sin(c)]})}function fi(e,t,r,n,o=4,i=64){return Array.from({length:i},(s,a)=>{let c=2*Math.PI*a/i,u=Math.cos(c),l=Math.sin(c);return [e+r*Math.sign(u)*Math.abs(u)**(2/o),t+n*Math.sign(l)*Math.abs(l)**(2/o)]})}function mi(e,t,r){let n=r/2,o=(i,s)=>`${x(e+i*n)} ${x(t+s*n)}`;return `M${o(0,-0.52)}C${o(.18,-0.92)} ${o(.98,-0.94)} ${o(1,-0.34)}C${o(1,.12)} ${o(.5,.48)} ${o(0,.92)}C${o(-0.5,.48)} ${o(-1,.12)} ${o(-1,-0.34)}C${o(-0.98,-0.94)} ${o(-0.18,-0.92)} ${o(0,-0.52)}Z`}function h$(e,t,r,n){if(n===0)return e;let o=n*Math.PI/180,i=Math.cos(o),s=Math.sin(o);return e.map(([a,c])=>[t+(a-t)*i-(c-r)*s,r+(a-t)*s+(c-r)*i])}function el(e,t,r=0){let n=Math.imul(e+2654435769,2246822507)^Math.imul(t+r,3266489909);return n=Math.imul(n^n>>>15,739982445),n=Math.imul(n^n>>>12,695872825),n^=n>>>15,(n>>>0)/4294967296}function Dn(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0).toString(36)}function g1(e,t,r,n,o){let i=Math.max(0,Math.min(o,Math.min(r,n)/2)),s=(a,c)=>`A${x(i)} ${x(i)} 0 0 0 ${x(a)} ${x(c)}`;return `M${x(e+i)} ${x(t)}H${x(e+r-i)}${s(e+r,t+i)}V${x(t+n-i)}${s(e+r-i,t+n)}H${x(e+i)}${s(e,t+n-i)}V${x(t+i)}${s(e+i,t)}Z`}function tl(e,t,r,n,o){let i=Math.max(0,Math.min(o,Math.min(r,n)/2));return ce([[e+i,t],[e+r-i,t],[e+r-i,t+i],[e+r,t+i],[e+r,t+n-i],[e+r-i,t+n-i],[e+r-i,t+n],[e+i,t+n],[e+i,t+n-i],[e,t+n-i],[e,t+i],[e+i,t+i]])}function Ks(e,t,r,n,o){let i=n,s=r/2,a=(s-i)*.55,c=(u,l)=>`${x(e+u)} ${x(t+l)}`;return `M${c(i,0)}C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}C${c(s+a,o)} ${c(r-i-a,0)} ${c(r-i,0)}A${x(i)} ${x(i)} 0 0 1 ${c(r,i)}C${c(r,i+a)} ${c(r-o,s-a)} ${c(r-o,s)}C${c(r-o,s+a)} ${c(r,r-i-a)} ${c(r,r-i)}A${x(i)} ${x(i)} 0 0 1 ${c(r-i,r)}C${c(r-i-a,r)} ${c(s+a,r-o)} ${c(s,r-o)}C${c(s-a,r-o)} ${c(i+a,r)} ${c(i,r)}A${x(i)} ${x(i)} 0 0 1 ${c(0,r-i)}C${c(0,r-i-a)} ${c(o,s+a)} ${c(o,s)}C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}A${x(i)} ${x(i)} 0 0 1 ${c(i,0)}Z`}function _1(e,t,r,n,o,i){let s=r/2,a=(c,u)=>`${x(e+c)} ${x(t+u)}`;return `M${a(n,0)}H${x(e+r-n)}A${x(n)} ${x(n)} 0 0 1 ${a(r,n)}V${x(t+o)}C${a(r,o+1.55*i)} ${a(s+1.6*i,r)} ${a(s,r)}C${a(s-1.6*i,r)} ${a(0,o+1.55*i)} ${a(0,o)}V${x(t+n)}A${x(n)} ${x(n)} 0 0 1 ${a(n,0)}Z`}var jE=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function g$(e){return jE.includes(e)}var _$={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 rl(e,t){if(e===void 0||!Number.isFinite(e))return 1;let r=t?_$[t]??1:mo;return Math.min(Ti,Math.max(mo,r,e))}function VE(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}function HE(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function b1(e){let t=(e-17)/4,r=Number.isInteger(t)?HE(t,e):[],n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return (i,s)=>o.some(([a,c])=>Math.abs(i-a)<=2&&Math.abs(s-c)<=2)}var WE={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:e=>e===0||e===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:e=>e===0||e===2?1:.4,fillets:false}};function qE(e,t,r,n,o,i){switch(e){case "horizontal-line":{let s=n*.43;return G(t-n/2,r-s,n,2*s)}case "leaf":{let s=n*.5;return G(t-s,r-s,2*s,2*s,[n*.4,n*.05,n*.4,n*.05])}case "plus":{let s=n*.22,a=n*.5;return ce([[t-s,r-a],[t+s,r-a],[t+s,r-s],[t+a,r-s],[t+a,r+s],[t+s,r+s],[t+s,r+a],[t-s,r+a],[t-s,r+s],[t-a,r+s],[t-a,r-s],[t-s,r-s]])}case "hexagon":return ce(ui(t,r,n*.54,6));case "star":return ce(li(t,r+n*.04,n*.62,n*.34));case "heart":return mi(t,r+n*.02,n*1.08);case "random-dots":return pe(t,r,n*(.38+.15*el(o,i)));case "mosaic":{let s=n*(.8+.14*el(o,i,1))/2,a=[[t-s,r-s],[t+s,r-s],[t+s,r+s],[t-s,r+s]];return ce(h$(a,t,r,(el(o,i,2)-.5)*16))}case "octagon":return ce(ui(t,r,n*.48/Math.cos(Math.PI/8),8,22.5));default:return pe(t,r,n*.45)}}function b$(e,t){let{margin:r,pixelSize:n,pattern:o}=t,i=rl(t.scale,o),s=e.length,a=t.plain?()=>false:b1(s),c=(d,g)=>!t.plain&&VE(d,g,s),u=(d,g)=>d>=0&&g>=0&&d<s&&g<s&&!!e[g]?.[d]&&!c(d,g),l=d=>(d+.5+r)*n,f=[],p=[],m=WE[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let _=l(g),b=l(d);if(a(g,d)){f.push(M`M${_-n/2} ${b-n/2}h${n}v${n}h${-n}z`);continue}if(!m){p.push(qE(o,_,b,n*i,g,d));continue}let y=n*m.thickness*i/2,S=m.horizontal&&u(g+1,d),C=m.horizontal&&u(g-1,d),w=m.vertical&&u(g,d-1),$=m.vertical&&u(g,d+1),R=[!(w||C),!(w||S),!($||S),!($||C)].map((P,I)=>P?y*m.radius(I):0);p.push(G(_-y,b-y,2*y,2*y,R)),2*y<n&&(S&&p.push(G(_,b-y,n,2*y)),$&&p.push(G(_-y,b,2*y,n)));}if(m?.fillets&&i===1){let d=n*.3;for(let g=0;g<s;g++)for(let _=0;_<s;_++){if(u(_,g)||c(_,g))continue;let b=l(_)-n/2,y=l(g)-n/2,S=b+n,C=y+n;u(_-1,g)&&u(_,g-1)&&u(_-1,g-1)&&p.push(M`M${b} ${y}h${d}A${d} ${d} 0 0 0 ${b} ${y+d}Z`),u(_+1,g)&&u(_,g-1)&&u(_+1,g-1)&&p.push(M`M${S} ${y}v${d}A${d} ${d} 0 0 0 ${S-d} ${y}Z`),u(_+1,g)&&u(_,g+1)&&u(_+1,g+1)&&p.push(M`M${S} ${C}h${-d}A${d} ${d} 0 0 0 ${S} ${C-d}Z`),u(_-1,g)&&u(_,g+1)&&u(_-1,g+1)&&p.push(M`M${b} ${C}v${-d}A${d} ${d} 0 0 0 ${b+d} ${C}Z`);}}let h=[];return p.length>0&&h.push(k("path",{d:p.join("")},"modules")),f.length>0&&h.push(k("path",{d:f.join("")},"alignment")),h}var b9=(e,t,r,n)=>{let o=document.createElement("canvas");o.width=t,o.height=r;let i=o.getContext("2d");if(!i)return;i.putImageData(e,0,0);let s=o.toDataURL("image/png"),a=document.createElement("a");a.href=s,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a);},XE=async(e,t,r,n)=>{let{default:o}=await import('jsqr');return new Promise(i=>{e.complete?s():(e.onload=()=>s(),e.onerror=()=>i(null));function s(){let a=document.createElement("canvas");requestAnimationFrame(()=>{if(!(e.naturalWidth&&e.naturalHeight)){i(null);return}let c=e.naturalWidth/e.naturalHeight<=.33||e.naturalWidth/e.naturalHeight>=3?Math.sqrt(e.naturalWidth*e.naturalHeight/12e5):e.naturalWidth/e.naturalHeight<=.5||e.naturalWidth/e.naturalHeight>=2?Math.sqrt(e.naturalWidth*e.naturalHeight/9e5):Math.sqrt(e.naturalWidth*e.naturalHeight/64e4),u=a.getContext("2d",{willReadFrequently:true});if(!u){i(null);return}let l=[1,.8,.6,.4,.2,.1];for(let f of l){let p=Math.floor(e.naturalWidth*t*f/c),m=Math.floor(e.naturalHeight*t*f/c);a.width=p,a.height=m,u.clearRect(0,0,p,m),u.imageSmoothingEnabled=true,u.imageSmoothingQuality="high";try{u.drawImage(e,Math.floor(r),Math.floor(n),Math.floor(e.naturalWidth*t),Math.floor(e.naturalHeight*t),0,0,p,m);let h=u.getImageData(0,0,p,m);try{let d=o(h.data,p,m);if(d?.data){i(d);return}}catch(d){console.error("QR Detection error:",d);}}catch(h){console.error("Canvas drawing error:",h);}}i(null);});}})},y$=async(e,t,r=false)=>{if(!e)return "NO_QR";await new Promise(o=>setTimeout(o,100));let n=[{dx:0,dy:0,ratio:1},{dx:0,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:0,ratio:.65},{dx:e.naturalWidth*.35/2,dy:e.naturalHeight*.35/2,ratio:.65}];for(let o of n)try{let i=await XE(e,o.ratio,o.dx,o.dy);if(i?.data)return r?i:i.data}catch(i){console.warn("QR decode error:",i);}return "NO_QR"};function y9(e,t,r){if(!(e&&t)||t.length!==4)return;let n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;let o=n.getContext("2d");if(!o)return;o.drawImage(e,0,0),o.save(),o.strokeStyle="#ff0000",o.lineWidth=Math.max(5,Math.min(e.naturalWidth,e.naturalHeight)/200),o.shadowColor="transparent",o.shadowBlur=0,o.beginPath(),o.moveTo(t[0].x,t[0].y),o.lineTo(t[1].x,t[1].y),o.lineTo(t[3].x,t[3].y),o.lineTo(t[2].x,t[2].y),o.closePath(),o.stroke(),o.fillStyle="#ff0000",t.forEach((a,c)=>{o.fillRect(a.x-3,a.y-3,6,6),o.fillStyle="#ffffff",o.font="16px Arial",o.fillText(`${c}`,a.x+5,a.y-5),o.fillStyle="#ff0000";}),o.restore();let i=n.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s);}var y1=(e,t=0)=>{for(let r=t;r<e.length;r++)if(e[r]?.continue!==true)return true;return false};function Wr(e,t=[],r={}){return {...r,run(n){let o=e({value:n,issues:[]}),i=y1(o.issues);for(let s of t){if(s.hasLength){let c=o.value;if(o.issues.some(u=>u.continue===false)||c===null||c===void 0||c.length===void 0)continue}else if(i)continue;let a=o.issues.length;s.run(o),!i&&o.issues.length>a&&(i=y1(o.issues,a));}return o}}}function YE(e){if(typeof e=="number")return Number.isNaN(e)?"NaN":Number.isFinite(e)?"number":String(e);if(e===null)return "null";if(Array.isArray(e))return "array";if(typeof e=="object"){let t=e.constructor;if(Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&t)return t.name}return typeof e}var Zn=(e,t)=>({path:[],message:`Invalid input: expected ${e}, received ${YE(t)}`}),KE={string:"characters",array:"items"};function _r(e,t,r,n){let o=KE[t],i=e?"Too big":"Too small",s=`${e?"<=":">="}${r}`;return {path:[],message:o?`${i}: expected ${t} to have ${s} ${o}`:`${i}: expected ${t} to be ${s}`,continue:n}}var x1=e=>typeof e=="string"?`"${e}"`:`${e}`,S$=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function C1(e,t,r){for(let n of r)n.path.unshift(t),e.push(n);}var JE=e=>e>=55296&&e<=56319,eA=e=>e>=56320&&e<=57343;function tA(e){let t=e.length;for(let r=0;r<e.length-1;r++)JE(e.charCodeAt(r))&&eA(e.charCodeAt(r+1))&&(t--,r++);return t}var C$=e=>Array.isArray(e)?"array":typeof e=="string"?"string":"unknown",ta=e=>({run(t){t.value<e&&t.issues.push(_r(false,"number",e,true));}}),ra=e=>({run(t){t.value>e&&t.issues.push(_r(true,"number",e,true));}}),hi=(e,t="Invalid input")=>({run(r){e(r.value)||r.issues.push({path:[],message:t,continue:true});}}),E$=e=>typeof e=="string"?tA(e):e.length,A$=e=>({hasLength:true,run(t){let r=t.value;E$(r)<e&&t.issues.push(_r(false,C$(r),e,true));}}),E1=e=>({hasLength:true,run(t){let r=t.value;E$(r)>e&&t.issues.push(_r(true,C$(r),e,true));}}),v$=(e,t)=>({run(r){e.lastIndex=0,e.test(r.value)||r.issues.push({path:[],message:t??`Invalid string: must match pattern ${e}`,continue:true});}}),rA={run(e){let t=e.value;Number.isInteger(t)?Number.isSafeInteger(t)||e.issues.push(t>0?_r(true,"int",Number.MAX_SAFE_INTEGER,true):_r(false,"int",Number.MIN_SAFE_INTEGER,true)):e.issues.push({...Zn("int",t),continue:false});}},Un=(...e)=>Wr(t=>{let r=t.value;return typeof r=="number"&&Number.isFinite(r)||t.issues.push(Zn("number",r)),t},e),R$=(...e)=>Un(rA,...e),nl=(...e)=>Wr(t=>(typeof t.value!="string"&&t.issues.push(Zn("string",t.value)),t),e);function Ot(e){let t=e.length===1?`Invalid input: expected ${x1(e[0])}`:`Invalid option: expected one of ${e.map(x1).join("|")}`;return Wr(r=>(e.includes(r.value)||r.issues.push({path:[],message:t}),r),[],{values:e})}var Tt=e=>Ot([e]),Se=e=>({optional:true,run:t=>t===void 0?{value:t,issues:[]}:e.run(t)});function Fe(e,t=[]){let r=Object.keys(e),n=new Set(r);return Wr(o=>{let i=o.value;if(!S$(i))return o.issues.push(Zn("object",i)),o;let s={};for(let c of r){let u=e[c],l=u.run(i[c]),f=c in i;C1(o.issues,c,l.issues),f||u.optional||l.issues.length>0||o.issues.push({path:[c],message:"Invalid input: expected nonoptional, received undefined"}),f&&(s[c]=l.value);}o.value=s;let a=[];for(let c in i)n.has(c)||a.push(c);return a.length>0&&o.issues.push({path:[],message:`Unrecognized key${a.length>1?"s":""}: ${a.map(x1).join(", ")}`,continue:true}),o},t,{shape:e})}function $1(e,t,r){let n=[];return t!==void 0&&n.push(A$(t)),r!==void 0&&n.push(E1(r)),Wr(o=>{let i=o.value;if(Array.isArray(i)&&r!==void 0&&i.length>r)return o.issues.push(_r(true,"array",r,false)),o;if(!Array.isArray(i))return o.issues.push(Zn("array",i)),o;let s=new Array(i.length);for(let a=0;a<i.length;a++){let c=e.run(i[a]);C1(o.issues,a,c.issues),s[a]=c.value;}return o.value=s,o},n)}function w1(e){return Wr(t=>{let r=t.value;if(!Array.isArray(r))return t.issues.push(Zn("tuple",r)),t;if(r.length<e.length)return t.issues.push(_r(false,"array",e.length,void 0)),t;r.length>e.length&&t.issues.push(_r(true,"array",e.length,void 0));let n=[];return e.forEach((o,i)=>{let s=o.run(r[i]);C1(t.issues,i,s.issues),n[i]=s.value;}),t.value=n,t})}function di(e){return Wr(t=>{let r=[];for(let o of e){let i=o.run(t.value);if(i.issues.length===0)return i;r.push(i);}let n=r.filter(o=>!y1(o.issues));return n.length===1?n[0]:(t.issues.push({path:[],message:"Invalid input"}),t)})}function P$(e,t){let r=new Map;for(let o of t)for(let i of o.shape?.[e]?.values??[])r.set(i,o);let n=`Invalid discriminator value. Expected ${[...r.keys()].map(o=>`'${o}'`).join(" | ")}`;return Wr(o=>{let i=o.value;if(!S$(i))return o.issues.push(Zn("object",i)),o;let s=r.get(i[e]);return s?s.run(i):(o.issues.push({path:[e],message:n}),o)})}var nA=hi(Pr,`Numbers may have at most ${ee.maxDecimals} decimals`),il=[ta(-ee.maxCoordinate),ra(ee.maxCoordinate),nA],je=Un(...il),nt=Un(...il,hi(e=>e>0,"Must be greater than 0")),ol=Un(...il,hi(e=>e>=0,"Must not be negative")),ea=nl(v$(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),x$=di([Ot(Zi),ea]),k$=e=>Fe({mix:w1([e,e]),amount:Un(ta(0),ra(1),hi(Pr))}),pi=di([x$,k$(x$)]),oA=di([ea,k$(di([Ot(["frame","accent","background"]),ea]))]),Bn=di([pi,Fe({gradient:Fe({from:pi,to:pi,direction:Se(Ot(["horizontal","vertical"])),steps:Se(R$(ta(2),ra(ee.maxGradientSteps)))})})]),S1=()=>({x:je,y:je,width:nt,height:nt}),Js=Fe({color:pi,width:nt}),iA=P$("type",[Fe({type:Tt("rect"),...S1(),radius:Se(ol),fill:Bn,hole:Se(Fe({...S1(),radius:Se(ol)})),stroke:Se(Js)}),Fe({type:Tt("circle"),cx:je,cy:je,r:nt,hole:Se(nt),fill:Bn,stroke:Se(Js)}),Fe({type:Tt("ellipse"),cx:je,cy:je,rx:nt,ry:nt,fill:Bn,stroke:Se(Js)}),Fe({type:Tt("polygon"),points:$1(w1([je,je]),3,ee.maxPolygonPoints),fill:Bn,stroke:Se(Js)}),Fe({type:Tt("path"),d:nl(A$(2),E1(ee.maxPathLength)),fill:Bn,fillRule:Se(Ot(["nonzero","evenodd"])),stroke:Se(Js)}),Fe({type:Tt("line"),x1:je,y1:je,x2:je,y2:je,width:nt,cap:Se(Ot(["butt","round"])),dash:Se(w1([nt,nt])),fill:Bn}),Fe({type:Tt("icon"),icon:Ot(Di),x:je,y:je,size:nt,fill:Bn})]),$$=()=>({id:nl(v$(/^[a-z][a-z0-9-]{0,31}$/)),slot:Ot(["primary","secondary","fixed"]),text:nl(E1(200)),maxLength:Se(R$(ta(1),ra(dt))),color:pi,weight:Se(Ot(["bold","regular"])),collapse:Se(Fe({y:je,height:nt}))}),sA=P$("type",[Fe({type:Tt("text"),...$$(),box:Fe(S1()),align:Se(Ot(["start","middle","end"])),fontSize:Se(nt)}),Fe({type:Tt("curved"),...$$(),curve:Fe({cx:je,cy:je,radius:nt,side:Ot(["top","bottom"]),spread:Se(Un(ta(20),ra(300),hi(Pr)))}),fontSize:nt})]),w$=Un(...il,hi(e=>e>=ee.minArtboard&&e<=ee.maxArtboard,`Artboard sides must be ${ee.minArtboard} to ${ee.maxArtboard} units`)),aA=Fe({kind:Tt(mn),version:Tt(pn),artboard:Fe({width:w$,height:w$}),qr:Fe({x:je,y:je,size:nt,padding:Se(ol),radius:Se(ol),plate:Se(Ot(["opaque","background","none"]))}),colors:Fe({frame:ea,text:Se(oA),accent:Se(ea)}),shapes:$1(iA,void 0,ee.maxShapes),labels:$1(sA,void 0,ee.maxLabels),bleed:Se(di([Tt("none"),pi]))},[{run(e){Fa(e.value,(t,r=[])=>{e.issues.push({path:[...r],message:t,continue:true});});}}]);function sl(e){let t=aA.run(e);return t.issues.length===0?{success:true,data:t.value}:{success:false,issues:t.issues.map(({path:r,message:n})=>({path:r,message:n}))}}var I$=({path:e,message:t})=>e.length>0?`${e.join(".")}: ${t}`:t;var A1=24,qr=(e,t,r,n)=>{let o=n*Math.PI/180;return [e+r*Math.cos(o),t+r*Math.sin(o)]},al=([e,t])=>`${x(e)} ${x(t)}`;function gi(e,t,r,n,o,i){let s=i-o>180?1:0;return `M${al(qr(e,t,n,o))}A${x(n)} ${x(n)} 0 ${s} 1 ${al(qr(e,t,n,i))}L${al(qr(e,t,r,i))}A${x(r)} ${x(r)} 0 ${s} 0 ${al(qr(e,t,r,o))}Z`}function na(e,t,r,n){return `M${x(e-r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e+r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e-r)} ${x(t)}Z`}function cA(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),t/2}function M$(e){return ce(cA(e)<0?[...e].reverse():e)}function cl(e,t,r,n,o){let i=Math.hypot(r-e,n-t)||1,s=-(n-t)/i*(o/2),a=(r-e)/i*(o/2);return M$([[e+s,t+a],[r+s,n+a],[r-s,n-a],[e-s,t-a]])}var pt=(...e)=>({d:e.join(""),fillRule:"nonzero"}),br=(...e)=>({d:e.join(""),fillRule:"evenodd"});function uA(){let e=[];for(let t of [0,60,120]){let[r,n]=qr(12,12,10.5,t+180),[o,i]=qr(12,12,10.5,t);e.push(cl(r,n,o,i,2));}for(let t=0;t<6;t++){let r=t*60,[n,o]=qr(12,12,6.2,r);for(let i of [-45,45]){let[s,a]=qr(n,o,3.6,r+i);e.push(cl(n,o,s,a,1.7));}}return pt(...e)}var lA={wifi:()=>pt(gi(12,20,4.6,7.2,-135,-45),gi(12,20,9.2,11.8,-135,-45),gi(12,20,13.8,16.4,-135,-45),pe(12,20,2.2)),star:()=>pt(ce(li(12,12.8,11.6,4.8))),heart:()=>pt(mi(12,12.4,22)),phone:()=>br(G(6,1.5,12,21,2.6),G(7.8,4.2,8.4,13.4,.6),pe(12,19.8,1.1)),headphones:()=>pt(gi(12,13,7.6,9.8,-180,0),G(2,12,5,9.5,2),G(17,12,5,9.5,2)),calendar:()=>br(G(2.5,4,19,17.5,2.5),G(4.6,9,14.8,10.6,.8),G(7,11.4,2.6,2.6,.4),G(10.7,11.4,2.6,2.6,.4),G(14.4,11.4,2.6,2.6,.4),G(7,15.1,2.6,2.6,.4),G(10.7,15.1,2.6,2.6,.4),G(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),G(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>pt(pe(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:()=>br(G(2,3,20,14,4),ce([[6.5,17],[11.5,17],[5.8,21.8]]),pe(7.5,10,1.5),pe(12,10,1.5),pe(16.5,10,1.5)),bag:()=>pt(G(3.5,7.5,17,14.5,2),gi(12,7.5,3.1,4.8,-180,0)),bell:()=>pt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",G(1.5,18.2,21,2.6,1.3),G(11.2,6.6,1.6,2.6,0),G(9.8,4.6,4.4,2.4,1.2)),cup:()=>pt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",gi(17,10.2,1.7,3.6,-90,90),G(2,20.6,17,2,1),G(7,1.6,1.6,3.4,.8),G(11.6,1.6,1.6,3.4,.8)),card:()=>br(G(1.5,4.5,21,15,2.5),G(1.5,8,21,3,0),G(4.5,13.6,4.6,3.2,.6)),check:()=>br(pe(12,12,10.5),ce([[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:()=>br(pe(12,12,10.5),pe(12,7.2,1.6),G(10.6,10,2.8,8,.8)),home:()=>br(ce([[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]]),G(10,14.5,4,7,[.6,.6,0,0])),pin:()=>br("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",pe(12,9.5,3)),share:()=>pt(cl(6,12,18,5,1.8),cl(6,12,18,19,1.8),pe(18,5,3.2),pe(6,12,3.2),pe(18,19,3.2)),download:()=>pt(G(10.6,2,2.8,9.5,0),ce([[6,10],[18,10],[12,16.5]]),ce([[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:()=>br(pe(12,12,10.5),pe(12,12,8.4),ce([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:uA,pumpkin:()=>pt(na(7.8,14.6,5.8,6.9),na(16.2,14.6,5.8,6.9),na(12,14.6,4.8,7.4),G(10.9,3.4,2.2,4.6,.8),M$([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>pt(ce([[12,1.5],[16.8,8.2],[7.2,8.2]]),ce([[12,5.2],[19,13.6],[5,13.6]]),ce([[12,9.4],[21.2,19.2],[2.8,19.2]]),G(10.4,18.6,3.2,3.9,.4)),sparkle:()=>pt(ce(li(9.5,13.5,9,2.4,4)),ce(li(19,5,4,1.1,4))),gift:()=>pt(G(3,11.2,7.8,10.6,1),G(13.2,11.2,7.8,10.6,1),G(2,7.4,8.8,3.2,1),G(13.2,7.4,8.8,3.2,1),na(8.8,4.8,2.9,1.9),na(15.2,4.8,2.9,1.9))};function v1(e){return lA[e]()}function T$(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function P1(e){let t=0;for(let r of e)t+=T$(r);return Math.max(t,1)}var R1=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function oa(e,t,r){let n=we(e)??{r:0,g:0,b:0},o=we(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,r));return `#${R1(n.r+(o.r-n.r)*i)}${R1(n.g+(o.g-n.g)*i)}${R1(n.b+(o.b-n.b)*i)}`}function O$(e,t,r,n,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>T$(d)*o),f=l.reduce((d,g)=>d+g,0)+u*Math.max(0,c.length-1),p=i==="top"?n-o*.35:n+o*.35,m=[],h=0;return c.forEach((d,g)=>{let _=l[g],b=(h+_/2)/p;if(h+=_+u,d.trim()==="")return;let y=i==="top"?-Math.PI/2-f/2/p+b:Math.PI/2+f/2/p-b;m.push({text:d,x:t+p*Math.cos(y),y:r+p*Math.sin(y),fontSize:o,maxWidth:o*2,color:s,rotate:y*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var ia=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},L$=new WeakMap;function Gn(e){if(e&&typeof e=="object"){let r=L$.get(e);if(r)return r}if(e==null)throw new ia(['A "custom" frame needs a spec']);let t=sl(e);if(!t.success)throw new ia(t.issues.map(I$));return typeof e=="object"&&L$.set(e,t.data),t.data}function k1(e){let t=Gn(e);return xo(t)/t.qr.size}var fA=e=>{let t=we(e);return !!(t&&t.a>=1)};function mA(e,t){let r=Ne(t,Pe);return e.qr.plate==="none"?{color:r,plate:false}:fA(r)?{color:r,plate:true}:e.qr.plate==="background"?{color:r,plate:false}:{color:Pe,plate:true}}function ul(e,t,r=Pe){let n=t.color||e.colors.frame,o=t.secondaryColor||e.colors.accent||n,i=c=>c==="frame"?n:c==="accent"?o:c==="background"?r:c,s=e.colors.text,a=t.textColor||(s===void 0?n:typeof s=="string"?s:oa(i(s.mix[0]),i(s.mix[1]),s.amount));return {frame:n,text:a,accent:o}}function pA(e,t,r){let n=ul(t,e,r),o=i=>{switch(i){case "frame":return n.frame;case "text":return n.text;case "accent":return n.accent;case "background":return r;default:return i}};return i=>typeof i=="string"?o(i):oa(o(i.mix[0]),o(i.mix[1]),i.amount)}function N$(e,t,r=0,n=0){let o=zi(e);return o?Qf(o,t,r,n):""}function dA(e,t,r,n){return `M${x(e-r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e+r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e-r)} ${x(t)}Z`}function hA(e,t){let[r,n,o,i]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],s=Math.hypot(o-r,i-n),a=e.width*t/2,c=s>0?(o-r)/s:1,u=s>0?(i-n)/s:0,l=-u*a,f=c*a,p=(g,_)=>{let b=[r+c*g,n+u*g],y=[r+c*_,n+u*_];if(e.cap==="round"&&_-g>2*a){let S=[b[0]+c*a,b[1]+u*a],C=[y[0]-c*a,y[1]-u*a];return `M${x(S[0]-l)} ${x(S[1]-f)}L${x(C[0]-l)} ${x(C[1]-f)}A${x(a)} ${x(a)} 0 0 1 ${x(C[0]+l)} ${x(C[1]+f)}L${x(S[0]+l)} ${x(S[1]+f)}A${x(a)} ${x(a)} 0 0 1 ${x(S[0]-l)} ${x(S[1]-f)}Z`}return `M${x(b[0]-l)} ${x(b[1]-f)}L${x(y[0]-l)} ${x(y[1]-f)}L${x(y[0]+l)} ${x(y[1]+f)}L${x(b[0]+l)} ${x(b[1]+f)}Z`};if(!e.dash)return {type:"path",d:p(0,s),fillRule:"nonzero"};let m=e.dash[0]*t,h=m+e.dash[1]*t,d=[];for(let g=0;g+m<=s+1e-6;g+=h)d.push(p(g,g+m));return {type:"path",d:d.join(""),fillRule:"nonzero"}}function gA(e,t){switch(e.type){case "rect":return {type:"rect",x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t,radius:(e.radius??0)*t,...e.hole&&{hole:{x:e.hole.x*t,y:e.hole.y*t,width:e.hole.width*t,height:e.hole.height*t,radius:(e.hole.radius??0)*t}}};case "circle":return {type:"path",d:pe(e.cx*t,e.cy*t,e.r*t)+(e.hole?pe(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:dA(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:e.points.map(([r,n])=>[r*t,n*t])};case "path":return {type:"path",d:N$(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return hA(e,t);default:{let r=v1(e.icon);return {type:"path",d:N$(r.d,e.size*t/A1,e.x*t,e.y*t),fillRule:r.fillRule}}}}function _A(e){if(e.type==="rect"){let{x:t,y:r,width:n,height:o,radius:i,hole:s}=e;return [...Xt(t,r,n,o,i,i),...s?Xt(s.x,s.y,s.width,s.height,s.radius,s.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,r],n)=>n===0?{op:"M",x:t,y:r}:{op:"L",x:t,y:r}),{op:"Z"}]:ur(e.d)}function bA(e,t,r){let n=_A(e),o=Oa(n,.2),i=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",s=t.direction==="vertical",a=g=>s?g[1]:g[0],c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let g of o)for(let _ of g)c=Math.min(c,a(_)),u=Math.max(u,a(_));if(!(u>c))return [];let l=t.steps??32,f=r(t.from),p=r(t.to),m=u-c,h=m*.002,d=[];for(let g=0;g<l;g++){let _=c+m*g/l,b=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),y=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:_,y1:b}:{x0:_,x1:b,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},S=o.map(C=>ho(C,y)).filter(C=>C.length>2);S.length!==0&&d.push({type:"path",d:wb(S),fill:oa(f,p,(g+.5)/l),fillRule:i});}return d}function yA(e,t,r){let n=gA(e,t),o="stroke"in e&&e.stroke?{stroke:r(e.stroke.color),strokeWidth:e.stroke.width*t}:void 0;if(typeof e.fill=="object"&&"gradient"in e.fill){let i=bA(n,e.fill.gradient,r);return o?[...i,{...n,fill:"none",...o}]:i}return [{...n,fill:r(e.fill),...o}]}function xA(e,t){let r=Math.min(e.maxLength??ee.maxTextLength,ee.maxTextLength),n=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return yo(n,r)}function $A(e){return e===void 0||!Number.isFinite(e)?1:Math.min(vr,Math.max(cn,e))}function wA(e,t,r,n,o,i){let s=o(e.color),a=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:d,cy:g,radius:_,side:b,spread:y=140}=e.curve,S=_*n*(y*Math.PI/180),C=Math.min(e.fontSize*n*r,S/(P1(t)+.08*t.length));return O$(t,d*n,g*n,_*n,C,b,s,i).map(w=>({...w,...a}))}let c=e.box.x*n,u=e.box.y*n,l=e.box.width*n,f=e.box.height*n;if(!(f>0))return [];let p=(e.fontSize??e.box.height*Xf)*n,m=Math.min(p*r,f*Bi,l/P1(t)),h=e.align??"middle";return [{text:t,x:h==="start"?c:h==="end"?c+l:c+l/2,y:u+f/2+m*.35,fontSize:m,maxWidth:l,color:s,...h!=="middle"&&{align:h},...a,field:i}]}function SA(e){let t=0,r=0,n=0,o=0;return e.map(({command:i,values:s})=>{let a=i.toUpperCase(),c=i!==a;switch(a){case "Z":return t=n,r=o,{command:"Z",values:[]};case "H":return t=(c?t:0)+s[0],{command:"H",values:[t]};case "V":return r=(c?r:0)+s[0],{command:"V",values:[r]};case "A":return t=(c?t:0)+s[5],r=(c?r:0)+s[6],{command:"A",values:[...s.slice(0,5),t,r]};default:{let u=s.map((l,f)=>c?l+(f%2===0?t:r):l);return t=u.at(-2),r=u.at(-1),a==="M"&&(n=t,o=r),{command:a,values:u}}}})}function CA(e,t){let r=zi(e);return r?Qf(SA(r).map(({command:n,values:o})=>n==="V"?{command:n,values:[t(o[0])]}:n==="H"||n==="Z"?{command:n,values:o}:n==="A"?{command:n,values:[...o.slice(0,6),t(o[6])]}:{command:n,values:o.map((i,s)=>s%2===1?t(i):i)})):e}function EA(e,t){let r=(n,o)=>{let i=t(n);return {y:i,height:t(n+o)-i}};switch(e.type){case "rect":return {...e,...r(e.y,e.height),...e.hole&&{hole:{...e.hole,...r(e.hole.y,e.hole.height)}}};case "circle":case "ellipse":return {...e,cy:t(e.cy)};case "polygon":return {...e,points:e.points.map(([n,o])=>[n,t(o)])};case "path":return {...e,d:CA(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function AA(e,t){if(t.length===0)return e;let r=o=>{let i=o;for(let s of t)i-=Math.min(Math.max(o-s.y,0),s.height);return i},n=(o,i)=>t.some(s=>o>=s.y-1e-6&&i<=s.y+s.height+1e-6);return {...e,artboard:{...e.artboard,height:r(e.artboard.height)},qr:{...e.qr,y:r(e.qr.y)},shapes:e.shapes.filter(o=>{let{bounds:i}=Yf(o);return !(i&&n(i.y0,i.y1))}).map(o=>EA(o,r)),labels:e.labels.map(o=>{if(o.type==="curved")return {...o,curve:{...o.curve,cy:r(o.curve.cy)}};let i=r(o.box.y);return {...o,box:{...o.box,y:i,height:r(o.box.y+o.box.height)-i}}})}}function sa(e,t,r,n,o={}){let i=new Map(t.labels.map(g=>[g.id,xA(g,r)])),s=AA(t,t.labels.flatMap(g=>g.collapse&&!i.get(g.id)?[g.collapse]:[])),a=e/s.qr.size,c=mA(s,n),u=pA(r,s,c.color),l=s.shapes.flatMap(g=>yA(g,a,u));if(c.plate){let g=xo(s)*a;l.push({type:"rect",x:s.qr.x*a-g,y:s.qr.y*a-g,width:e+2*g,height:e+2*g,radius:(s.qr.radius??0)*a,fill:c.color});}let f=$A(r.fontScale),p=s.labels.flatMap(g=>{let _=i.get(g.id);if(!_)return [];let b=(g.slot==="fixed"?void 0:o[g.slot])??g.id;return wA(g,_,f,a,u,b)}),m=p[0],h=m&&m.rotate===void 0?m:null,d=s.bleed??"none";return {width:s.artboard.width*a,height:s.artboard.height*a,qrX:s.qr.x*a,qrY:s.qr.y*a,qrSize:e,shapes:l,label:h,extraLabels:h?p.slice(1):p,squareEdges:d!=="none",color:u(d==="none"?"frame":d)}}function I1(e,t,r){return sa(e,Gn(t.spec),t,r)}var F$={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 M1={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 z$={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 D$={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 B$={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 Z$={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 U$={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 G$={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 Q$={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 ll={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 j$={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 V$={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 H$={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 W$={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 q$={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 X$={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 Y$={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 K$={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 J$={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 Ve=(e,t,r,n,o)=>({style:e,name:t,tags:o,labelOn:n,spec:r}),T1=[Ve("banner-bottom","Banner",M1,"frame",["bottom","band"]),Ve("banner-top","Top banner",z$,"frame",["top","band"]),Ve("banner-top-bottom","Two banners",D$,"frame",["top","bottom","band"]),Ve("border","Border",B$,"background",["square","outline"]),Ve("rounded-border","Rounded",W$,"background",["border","outline"]),Ve("gradient-border","Gradient",ll,"background",["border","colorful"]),Ve("focus","Focus",Q$,"background",["corners","brackets"]),Ve("speech-bubble","Bubble",q$,"frame",["speech"]),Ve("speech-bubble-top","Bubble top",X$,"frame",["speech"]),Ve("chat-bubble","Chat",Z$,"frame",["message","bubble"]),Ve("circle","Circle",U$,"frame",["round","ring","curved"]),Ve("badge","Ribbon",F$,"frame",["badge","banner"]),Ve("sticker","Sticker",Y$,"frame",["label"]),Ve("polaroid","Polaroid",H$,"frame",["photo","picture"]),Ve("phone","Phone",V$,"background",["mobile","screen"]),Ve("ticket","Ticket",J$,"frame",["event","pass"]),Ve("tag","Tag",K$,"frame",["price","label"]),Ve("envelope","Envelope",G$,"frame",["mail","letter"]),Ve("menu-card","Menu card",j$,"background",["menu","restaurant"])],VA=new Map(T1.map(e=>[e.style,e]));function O1(e){return VA.get(e)}var HA=Object.fromEntries(T1.map(e=>[e.style,e.spec])),WA={from:ll.colors.frame,to:ll.colors.accent};function fl(e){return !e||e.style==="none"?null:e.style===dn?e.spec??null:O1(e.style)?.spec??null}function qA(e){let t=fl(e);return e&&typeof t?.colors?.frame=="string"?ul(t,e):null}var XA={primary:"text",secondary:"secondaryText"};function ew(e,t,r){let n=O1(t.style)?.spec??M1;return sa(e,Gn(n),t,r,XA)}var pl="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",rw=.08,nw="data-qrdx-frame-label";function xt(e){return !!(e?.style&&e.style!=="none")}function L1(e){let t=fl(e);return t?k1(t):rw}function YA(e){return (e.text??Rf).trim().slice(0,dt)}function KA(e){return (e.secondaryText??"").trim().slice(0,dt)}function Qn(e,t,r){return t.style===dn?I1(e,t,r):ew(e,t,r)}function yr(e,t){if(!xt(t))return {width:e,height:e};let{width:r,height:n}=Qn(e,t);return {width:r,height:n}}var be=e=>fe(e,2);function tw({x:e,y:t,width:r,height:n,radius:o}){let i=be(Math.min(o,r/2,n/2)),[s,a,c,u]=[be(e),be(t),be(r),be(n)];return i<=0?M`M${s} ${a}h${c}v${u}h${-c}z`:M`M${s+i} ${a}h${be(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+M`v${be(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+M`h${be(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+M`v${be(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function ml(e){return e.stroke&&e.strokeWidth?{stroke:e.stroke,strokeWidth:be(e.strokeWidth)}:{}}function ow(e,t){return e.type==="rect"&&e.hole?k("path",{d:tw(e)+tw(e.hole),fill:e.fill,fillRule:"evenodd",...ml(e)},t):e.type==="polygon"?k("polygon",{fill:e.fill,points:e.points.map(([r,n])=>`${be(r)},${be(n)}`).join(" "),...ml(e)},t):e.type==="path"?k("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"},...ml(e)},t):qu("rect",{...ml(e),fill:e.fill,height:be(e.height),key:t,width:be(e.width),x:be(e.x),y:be(e.y),...e.radius>0&&{rx:be(e.radius),ry:be(e.radius)}})}function iw(e){return e.shapes.map((t,r)=>ow(t,r))}function aa(e,t){let{size:r,frame:n,bgColor:o,svgProps:i,markLabels:s}=t,a=Qn(r,n,o),c=sw(a),u=be(a.width),l=be(a.height);return Be("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[k("g",{"data-qrdx-frame":n.style,children:a.shapes.map((f,p)=>ow(f,p))}),On(e,{x:be(a.qrX),y:be(a.qrY),width:r,height:r}),c.map((f,p)=>k("text",{"data-max-width":be(f.maxWidth),fill:f.color,fontFamily:pl,fontSize:be(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:be(f.x),y:be(f.y),...f.rotate&&{transform:`rotate(${be(f.rotate)} ${be(f.x)} ${be(f.y)})`},...s&&f.field&&{[nw]:f.field},children:f.text},p))]})}function JA(e){let{frame:t,size:r=ye,bgColor:n,slot:o,svgProps:i}=e,s=o??k("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg"});return xt(t)?aa(s,{size:r,frame:t,bgColor:n,svgProps:i}):k("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...i,children:On(s,{x:0,y:0,width:r,height:r})})}function sw(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var ev={2:6,3:12};function aw(e){let t=[e.start],r=e.start;for(let n of e.segments){let o=n.at(-1);if(n.length===1)t.push(o);else {let i=ev[n.length];for(let s=1;s<=i;s++){let a=s/i,c=1-a;if(n.length===2){let[u]=n;t.push([c*c*r[0]+2*c*a*u[0]+a*a*o[0],c*c*r[1]+2*c*a*u[1]+a*a*o[1]]);}else {let[u,l]=n;t.push([c*c*c*r[0]+3*c*c*a*u[0]+3*c*a*a*l[0]+a*a*a*o[0],c*c*c*r[1]+3*c*c*a*u[1]+3*c*a*a*l[1]+a*a*a*o[1]]);}}}r=o;}return t}function uw(e,t){let r=[];for(let n of e)for(let o=0;o<n.length;o++){let[i,s]=n[o],[a,c]=n[(o+1)%n.length];s<=t!=c<=t&&r.push(i+(t-s)/(c-s)*(a-i));}return r.sort((n,o)=>n-o)}function lw(e,t){let r=0;for(let n of e)if(n<t)r++;else break;return r%2===1}function tv(e,t,r){return lw(uw(e,r),t)}function fw(e){let t=new Map;return (r,n)=>{let o=t.get(n);return o||(o=uw(e,n),t.set(n,o)),lw(o,r)}}function rv(e,t,r,n){let o=r[0]-e,i=r[1]-t,s=n[0]-r[0],a=n[1]-r[1],c=l=>Math.max(Math.abs(o+l*s),Math.abs(i+l*a)),u=Math.min(c(0),c(1));for(let[l,f]of [[i-o,s-a],[-(o+i),s+a]])if(f!==0){let p=l/f;p>0&&p<1&&(u=Math.min(u,c(p)));}return u}function nv(e,t,r){if(!tv(e,t,r))return 0;let n=Number.POSITIVE_INFINITY;for(let o of e)for(let i=0;i<o.length;i++)n=Math.min(n,rv(t,r,o[i],o[(i+1)%o.length]));return Number.isFinite(n)?n:0}function ov(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let i of e)for(let[s,a]of i)t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);return {x0:t,y0:r,x1:n,y1:o}}function mw(e){let t=e.map(aw),r=ov(t),n=r.x1-r.x0,o=r.y1-r.y0;if(!(n>0&&o>0))return null;let i=(h,d)=>{let g=Math.max(h-r.x0,r.x1-h,d-r.y0,r.y1-d);return g>0?nv(t,h,d)/(2*g):0},s={cx:r.x0+n/2,cy:r.y0+o/2,value:0};s.value=i(s.cx,s.cy);let a=32;for(let h=1;h<a;h++)for(let d=1;d<a;d++){let g=r.x0+n*d/a,_=r.y0+o*h/a,b=i(g,_);b>s.value&&(s={cx:g,cy:_,value:b});}let c=n/a,u=o/a;for(let h=0;h<6;h++){let d=s;for(let g=-2;g<=2;g++)for(let _=-2;_<=2;_++){let b=d.cx+c*_/2,y=d.cy+u*g/2,S=i(b,y);S>s.value&&(s={cx:b,cy:y,value:S});}c/=2,u/=2;}if(s.value<=0)return null;let f=.5/Math.max(s.cx-r.x0,r.x1-s.cx,s.cy-r.y0,r.y1-s.cy),p=([h,d])=>[.5+(h-s.cx)*f,.5+(d-s.cy)*f],m=e.map(h=>({start:p(h.start),segments:h.segments.map(d=>d.map(p))}));return {rings:m,polygons:m.map(aw),half:s.value}}function pw(e,t){let r=([o,i])=>`${x(o*t)} ${x(i*t)}`,n="";for(let o of e.rings){n+=`M${r(o.start)}`;for(let i of o.segments){let s=i.length===1?"L":i.length===2?"Q":"C";n+=s+i.map(r).join(" ");}n+="Z";}return n}var iv={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]]]},cw;function dw(){return cw??=mw([iv]),cw}function sv(e){let{width:t,height:r,cells:n}=e;return Number.isInteger(t)&&Number.isInteger(r)&&t>=Nt&&r>=Nt&&t<=At&&r<=At&&typeof n=="string"&&n.length===t*r&&/^[01]*$/.test(n)?(o,i)=>o>=0&&i>=0&&o<t&&i<r&&n[i*t+o]==="1":null}var xr=([e,t])=>`${e},${t}`;function av(e,t,r){let n=(c,u)=>e(c-1,u-1),o=new Map,i=(c,u)=>{for(let[l,f]of [[c,u],[u,c]]){let p=o.get(xr(l))??[];p.push(f),o.set(xr(l),p);}};for(let c=0;c<=r;c++)for(let u=0;u<=t;u++){let l=n(u,c),f=n(u+1,c),p=n(u+1,c+1),m=n(u,c+1),h=[u,c-.5],d=[u+.5,c],g=[u,c+.5],_=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(_,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(_,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(_,h);break;case 5:i(h,d),i(_,g);break;case 10:i(_,h),i(g,d);break;}}let s=[],a=new Set;for(let[c,u]of o){if(a.has(c)||u.length===0)continue;let[l,f]=c.split(",").map(Number),p=[[l,f]];a.add(c);let m=[l,f],h=u[0];for(;!a.has(xr(h));){a.add(xr(h)),p.push(h);let d=cv(o.get(xr(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(uv(p));}return s}function cv(e,t,r){let n=xr(t);return e.find(o=>xr(o)!==n&&!r.has(xr(o)))??e.find(o=>xr(o)!==n)}function uv(e){let t=[];for(let r=0;r<e.length;r++){let n=e[(r-1+e.length)%e.length],o=e[r],i=e[(r+1)%e.length],s=(o[0]-n[0])*(i[1]-o[1])-(o[1]-n[1])*(i[0]-o[0]);Math.abs(s)>1e-9&&t.push(o);}return t.length>=3?t:e}function lv(e){let t=(i,s)=>[(i[0]+s[0])/2,(i[1]+s[1])/2],r=e.length,n=t(e[r-1],e[0]),o=e.map((i,s)=>[i,t(i,e[(s+1)%r])]);return {start:n,segments:o}}var ca=new Map;function N1(e){let t=`${e.width}x${e.height}:${e.cells}`,r=ca.get(t);if(r)return r;let n=sv(e),o;if(!n)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=av(n,e.width,e.height),s=i.length>0?mw(i.map(lv)):null;o=s&&2*s.half>=Nf?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return ca.size>16&&ca.delete(ca.keys().next().value),ca.set(t,o),o}var fv=1,hw=.5,gw=.5,mv=.5;function jn(e){return Math.max(e,Lf)}function dl(e){return e==="heart"?dw():typeof e=="object"&&e?.type==="silhouette"?N1(e).outline:null}function ua(e){return e==="circle"||dl(e)!==null}var pv={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 dv(e){let{outline:t,problem:r}=N1(e);if(t&&!r)return {ok:true,share:2*t.half};let n=r??"invalid";return {ok:false,reason:n,message:pv[n]}}function Ke(e,t,r){if(r==="circle"){let s=jn(t),a=(e/2+s)*Math.SQRT2+fv;return Math.ceil(a-e/2)}let n=dl(r);if(!n)return t;let o=jn(t),i=(e+2*(o+mv))/(2*n.half);return Math.ceil((i-e)/2-1e-9)}function _w(e){let t=e>>>0;return ()=>{t=t+1831565813>>>0;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function hv(e,t,r){let n=Ke(t,r,"circle"),o=jn(r),i=t+2*n,s=i/2,a=s-hw-.5,c=_w(Number.parseInt(Dn(e),36)||1),u=n-o,l=n+t+o;return Array.from({length:i},(f,p)=>Array.from({length:i},(m,h)=>{let d=c()<gw;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var gv=Array.from({length:8},(e,t)=>{let r=t*Math.PI/4;return [Math.cos(r),Math.sin(r)]});function bw(e,t,r,n){if(n==="circle")return hv(e,t,r);let o=dl(n);if(!o)return null;let i=Ke(t,r,n),s=jn(r),a=t+2*i,c=fw(o.polygons),u=.5+hw,l=(h,d)=>{let g=h+.5,_=d+.5;return c(g/a,_/a)?gv.every(([b,y])=>c((g+b*u)/a,(_+y*u)/a)):false},f=_w(Number.parseInt(Dn(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,_)=>{let b=f()<gw;return _>=p&&_<m&&d>=p&&d<m?false:b&&l(_,d)}))}function F1(e,t){if(e==="circle")return {circle:t/2};let r=dl(e);return r?{path:pw(r,t)}:null}function _v(e,t){let r=F1(e,t);return r?"circle"in r?pe(t/2,t/2,r.circle):r.path:null}function bv(e){return e==="top-left"?0:e==="top-right"?1:3}function hl(e,t,r,n="circle",o="top-left"){let i=r*2,s=r,a=i/3;switch(n){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let c=bv(o),u=(c+2)%4,l=1.3*a,f=.7*a,p=h=>{switch(n){case "leaf":return h===c||h===u;case "leaf-reverse":return !(h===c||h===u);case "drop":return h===c;default:return h===u}},m=[0,1,2,3].map(h=>p(h)?f:l);return k("path",{d:G(e-r,t-r,i,i,m)})}case "extra-rounded":return k("path",{d:G(e-r,t-r,i,i,1.15*a)});case "plus":{let c=1.15*a,u=r;return k("path",{d:ce([[e-c,t-u],[e+c,t-u],[e+c,t-c],[e+u,t-c],[e+u,t+c],[e+c,t+c],[e+c,t+u],[e-c,t+u],[e-c,t+c],[e-u,t+c],[e-u,t-c],[e-c,t-c]])})}case "cross-rounded":{let c=1.15*a,u=.5*a;return k("path",{d:G(e-r,t-c,i,2*c,u)+G(e-c,t-r,2*c,i,u)})}case "hexagon":return k("path",{d:ce(ui(e,t,1.72*a,6))});case "octagon":return k("path",{d:ce(ui(e,t,r/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return k("path",{d:pe(e-c,t-c,u)+pe(e+c,t-c,u)+pe(e+c,t+c,u)+pe(e-c,t+c,u)+pe(e,t,1.2*a)})}case "heart":return k("path",{d:mi(e,t+.12*a,3.5*a)});case "squircle":return k("path",{d:ce(fi(e,t,r,r,4,64))});case "dots":{let c=[];for(let u of [-1,0,1])for(let l of [-1,0,1])c.push(pe(e+l*a*.82,t+u*a*.82,.58*a));return k("path",{d:c.join("")})}case "cushion":return k("path",{d:Ks(e-r,t-r,i,.6*a,.15*a)});case "square":return k("rect",{height:x(i),transform:M`rotate(0,${e},${t})`,width:x(i),x:x(e-s),y:x(t-s)});case "rounded":return k("rect",{height:x(i),rx:x(r*.5),ry:x(r*.5),transform:M`rotate(0,${e},${t})`,width:x(i),x:x(e-s),y:x(t-s)});case "diamond":return k("path",{d:M`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:M`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}H ${u(25)}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${19.285714285714285*c}h ${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} -${10.714285714285714*c}v -${19.285714285714285*c}h -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(33.57142857142857)} ${l(29.285714285714285)}h ${12.857142857142856*c}c ${4.285714285714286*c} 0 ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c}v ${12.857142857142856*c}c 0 ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c}h -${12.857142857142856*c}c -${4.285714285714286*c} 0 -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c}v -${12.857142857142856*c}c 0 -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c}z`;return k("path",{d:f,transform:M`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(38.84615384615385)},${l(26.546153846153846)}c${.6692307692307691*c},-${1.0153846153846153*c},${2.215384615384615*c},-${1.0153846153846153*c},${2.884615384615384*c},0l${4.038461538461538*c},${6.069230769230768*c}c${.23076923076923075*c},${.3461538461538461*c},${.6*c},${.6*c},${1.0153846153846153*c},${.7153846153846153*c}l${7.223076923076922*c},${1.823076923076923*c}c${1.2*c},${.3*c},${1.6846153846153844*c},${1.7076923076923076*c},${.8999999999999999*c},${2.6538461538461533*c}l-${4.73076923076923*c},${5.584615384615384*c}c-${.2769230769230769*c},${.3230769230769231*c},-${.41538461538461535*c},${.7384615384615384*c},-${.3923076923076923*c},${1.1307692307692307*c}l${.4384615384615384*c},${7.199999999999999*c}c${.06923076923076922*c},${1.2*c},-${1.1769230769230767*c},${2.0769230769230766*c},-${2.3307692307692305*c},${1.6384615384615382*c}l-${6.9692307692307685*c},-${2.6076923076923073*c}c-${.3923076923076923*c},-${.16153846153846155*c},-${.8538461538461538*c},-${.16153846153846155*c},-${1.2461538461538462*c},0l-${6.9692307692307685*c},${2.6076923076923073*c}c-${1.1538461538461537*c},${.4384615384615384*c},-${2.4*c},-${.4384615384615384*c},-${2.3307692307692305*c},-${1.6384615384615382*c}l${.4384615384615384*c},-${7.199999999999999*c}c${.023076923076923075*c},-${.41538461538461535*c},-${.11538461538461538*c},-${.8307692307692307*c},-${.3923076923076923*c},-${1.1307692307692307*c}l-${4.73076923076923*c},-${5.584615384615384*c}c-${.7846153846153846*c},-${.923076923076923*c},-${.3230769230769231*c},-${2.3307692307692305*c},${.8999999999999999*c},-${2.6538461538461533*c}l${7.223076923076922*c},-${1.823076923076923*c}c${.41538461538461535*c},-${.11538461538461538*c},${.7846153846153846*c},-${.3461538461538461*c},${1.0153846153846153*c},-${.7153846153846153*c}l${4.038461538461538*c},-${6.069230769230768*c}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return k("g",{transform:M`translate(${e-40*c},${t-40*c}) scale(${x(c,6)})`,children:k("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 k("circle",{cx:x(e),cy:x(t),r:x(r),transform:M`rotate(0,${e},${t})`})}}function _i(e,t,r,n){let o=e==="top-left"?0:e==="top-right"?1:3,i=(o+2)%4;return [0,1,2,3].map(s=>s===o||n&&s===i?r:t)}function yw(e,t,r,n){let o=r/7,i=Math.max(0,(n+Math.SQRT2-2)*o);return ce(h1(e,t,r,n*o))+ce(h1(e+o,t+o,5*o,i))}function xw(e,t,r,n,o=false){let i=r/7,s=a=>o?_i(n,0,a,true):_i(n,a,0,true);return G(e,t,r,r,s(2.5*i))+G(e+i,t+i,5*i,5*i,s(1.5*i))}function yv(e,t,r,n){let o=r/7;return G(e,t,r,r,_i(n,2.6*o,0,false))+G(e+o,t+o,5*o,5*o,_i(n,1.6*o,0,false))}function xv(e,t,r){let n=r/7,o=e+r/2,i=t+r/2;return ce(fi(o,i,3.5*n,3.5*n,4,96))+ce(fi(o,i,2.5*n,2.5*n,4,96))}function $v(e,t,r){let n=r/7,o=.12*n;return Ks(e,t,r,1.4*n,o)+Ks(e+n,t+n,5*n,.7*n,o)}function wv(e,t,r){let n=r/7;return _1(e,t,r,.7*n,3.9*n,n)+_1(e+n,t+n,5*n,.35*n,2.7*n,.8*n)}function Sv(e,t,r,n){let o=r/7;return G(e,t,r,r,_i(n,.5*o,2.5*o,false))+G(e+o,t+o,5*o,5*o,_i(n,.25*o,1.5*o,false))}function Cv(e,t,r){return G(e+r,t+r,5*r,5*r,1.5*r)}function Ev(e,t,r){return ce(fi(e,t,3.5*r,3.5*r,2.75,96))}function Av(e,t,r){let n=r/7;return Ev(e+r/2,t+r/2,n)+tl(e+n,t+n,5*n,5*n,.52*n)}function vv(e,t,r){let n=r/7;return g1(e,t,r,r,1.15*n)+g1(e+n,t+n,5*n,5*n,.74*n)}function Rv(e,t,r){let n=r/7;return tl(e,t,r,r,.8*n)+tl(e+n,t+n,5*n,5*n,.52*n)}function z1(e,t,r,n){let[o,i,s,a]=n,c=(l,f)=>M`${e+l} ${t+f}`,u=(l,f,p)=>l[0]==="round"?M`A${l[1]} ${l[1]} 0 0 1 ${c(f,p)}`:M`L${c(f,p)}`;return M`M${c(o[1],0)}L${c(r-i[1],0)}`+u(i,r,i[1])+M`L${c(r,r-s[1])}`+u(s,r-s[1],r)+M`L${c(a[1],r)}`+u(a,0,r-a[1])+M`L${c(0,o[1])}`+u(o,o[1],0)+"Z"}function Pv(e,t){let r=[0,1,2,3].map(o=>t(o)?["round",2.8*e]:["cut",1.6*e]),n=[0,1,2,3].map(o=>t(o)?["round",1.5*e]:["cut",1.01*e]);return [r,n]}function kv(e,t,r,n){let o=r/7,i=n==="top-left"?0:n==="top-right"?1:3,s=(i+2)%4,[a,c]=Pv(o,u=>u===i||u===s);return z1(e,t,r,a)+z1(e+o,t+o,5*o,c)}function Iv(e,t,r){let n=r/7;return z1(e,t,r,[["cut",1.6*n],["cut",1.6*n],["round",3*n],["round",3*n]])+Cv(e,t,n)}function Mv(e,t,r){let n=r/7;return M`M ${e} ${t}v ${r}h ${r}v -${r}z`+M`M ${e+n} ${t+n}h ${5*n}v ${5*n}h -${5*n}z`}function Tv(e,t,r){let n=r/7,o=n*.875,i=n*.4375,s=M`M ${e+o} ${t}`+M`h ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+n+i} ${t+n}`+M`h ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function Ov(e,t,r){let n=e+r/2,o=t+r/2,i=fe(r/2),s=fe(r*(2.5/7));return M`M ${n-i} ${o}`+M`a ${i} ${i} 0 1 0 ${i*2} 0`+M`a ${i} ${i} 0 1 0 ${-i*2} 0z`+M`M ${n-s} ${o}`+M`a ${s} ${s} 0 1 1 ${s*2} 0`+M`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function Lv(e,t,r){let n=r/74.7002,o=a=>a*n+e,i=a=>a*n+t;return M`M${o(37.3496)} ${i(0)}C${o(39.2939)} ${i(0)} ${o(40.9948)} ${i(1.03842)} ${o(41.9287)} ${i(2.59082)}C${o(43.2293)} ${i(1.34013)} ${o(45.1347)} ${i(.780267)} ${o(47.0098)} ${i(1.28027)}C${o(48.8871)} ${i(1.78928)} ${o(50.261)} ${i(3.23767)} ${o(50.7578)} ${i(4.98438)}C${o(52.3454)} ${i(4.0996)} ${o(54.3432)} ${i(4.047)} ${o(56.0303)} ${i(5.01953)}C${o(57.7094)} ${i(5.98752)} ${o(58.6586)} ${i(7.73647)} ${o(58.6924)} ${i(9.5459)}C${o(60.4517)} ${i(9.10661)} ${o(62.3883)} ${i(9.57215)} ${o(63.7598)} ${i(10.9502)}C${o(65.1282)} ${i(12.3253)} ${o(65.5963)} ${i(14.2585)} ${o(65.1641)} ${i(16.0127)}C${o(66.974)} ${i(16.044)} ${o(68.7242)} ${i(16.9982)} ${o(69.7002)} ${i(18.6797)}C${o(70.6781)} ${i(20.3647)} ${o(70.6241)} ${i(22.3635)} ${o(69.7402)} ${i(23.9502)}C${o(71.4776)} ${i(24.4496)} ${o(72.9194)} ${i(25.8232)} ${o(73.4199)} ${i(27.7002)}C${o(73.927)} ${i(29.5707)} ${o(73.3661)} ${i(31.4794)} ${o(72.1104)} ${i(32.7822)}C${o(73.6621)} ${i(33.7163)} ${o(74.7002)} ${i(35.4166)} ${o(74.7002)} ${i(37.3604)}C${o(74.7001)} ${i(39.307)} ${o(73.6582)} ${i(41.0084)} ${o(72.1025)} ${i(41.9414)}C${o(73.357)} ${i(43.245)} ${o(73.9207)} ${i(45.1525)} ${o(73.4199)} ${i(47.0303)}C${o(72.9187)} ${i(48.9027)} ${o(71.4782)} ${i(50.2735)} ${o(69.7383)} ${i(50.7734)}C${o(70.6201)} ${i(52.3601)} ${o(70.6716)} ${i(54.3549)} ${o(69.7002)} ${i(56.04)}C${o(68.7237)} ${i(57.7225)} ${o(66.9721)} ${i(58.6729)} ${o(65.1611)} ${i(58.7031)}C${o(65.598)} ${i(60.4623)} ${o(65.131)} ${i(62.3982)} ${o(63.7598)} ${i(63.7695)}C${o(62.3847)} ${i(65.138)} ${o(60.4515)} ${i(65.6061)} ${o(58.6973)} ${i(65.1738)}C${o(58.6635)} ${i(66.9833)} ${o(57.7094)} ${i(68.7322)} ${o(56.0303)} ${i(69.7002)}C${o(54.3461)} ${i(70.6777)} ${o(52.348)} ${i(70.6248)} ${o(50.7617)} ${i(69.7422)}C${o(50.2643)} ${i(71.4831)} ${o(48.8896)} ${i(72.9284)} ${o(47.0098)} ${i(73.4297)}C${o(45.1389)} ${i(73.9368)} ${o(43.2296)} ${i(73.3763)} ${o(41.9268)} ${i(72.1201)}C${o(40.9927)} ${i(73.6717)} ${o(39.2932)} ${i(74.71)} ${o(37.3496)} ${i(74.71)}C${o(35.4051)} ${i(74.7098)} ${o(33.7042)} ${i(73.6711)} ${o(32.7705)} ${i(72.1182)}C${o(31.4697)} ${i(73.3758)} ${o(29.5597)} ${i(73.9418)} ${o(27.6797)} ${i(73.4404)}V${i(73.4502)}C${o(25.8065)} ${i(72.9422)} ${o(24.434)} ${i(71.4985)} ${o(23.9346)} ${i(69.7568)}C${o(22.3504)} ${i(70.6301)} ${o(20.3591)} ${i(70.6781)} ${o(18.6797)} ${i(69.71)}C${o(16.9957)} ${i(68.7391)} ${o(16.045)} ${i(66.9831)} ${o(16.0166)} ${i(65.168)}C${o(14.2547)} ${i(65.6091)} ${o(12.3134)} ${i(65.1435)} ${o(10.9395)} ${i(63.7695)}C${o(9.5687)} ${i(62.3919)} ${o(9.10168)} ${i(60.454)} ${o(9.53809)} ${i(58.6973)}C${o(7.72791)} ${i(58.6641)} ${o(5.97815)} ${i(57.71)} ${o(5.00977)} ${i(56.0303)}C${o(4.03552)} ${i(54.3517)} ${o(4.08377)} ${i(52.3649)} ${o(4.95801)} ${i(50.7812)}C${o(3.21705)} ${i(50.2839)} ${o(1.77087)} ${i(48.9101)} ${o(1.26953)} ${i(47.0303)}V${i(47.0205)}C${o(.762081)} ${i(45.1489)} ${o(1.32758)} ${i(43.2375)} ${o(2.58496)} ${i(41.9346)}C${o(1.03604)} ${i(41)} ${o(108484e-9)} ${i(39.3019)} ${o(0)} ${i(37.3604)}C${o(0)} ${i(35.4159)} ${o(1.03815)} ${i(33.7141)} ${o(2.59082)} ${i(32.7803)}C${o(1.34044)} ${i(31.4797)} ${o(.780389)} ${i(29.575)} ${o(1.28027)} ${i(27.7002)}C${o(1.78258)} ${i(25.8232)} ${o(3.22806)} ${i(24.4482)} ${o(4.97363)} ${i(23.9512)}C${o(4.08938)} ${i(22.3638)} ${o(4.03743)} ${i(20.3664)} ${o(5.00977)} ${i(18.6797)}C${o(5.97815)} ${i(16.9999)} ${o(7.72788)} ${i(16.0496)} ${o(9.53809)} ${i(16.0166)}C${o(9.10139)} ${i(14.2576)} ${o(9.56846)} ${i(12.3214)} ${o(10.9395)} ${i(10.9502)}C${o(12.3171)} ${i(9.57911)} ${o(14.2558)} ${i(9.11137)} ${o(16.0127)} ${i(9.54785)}C${o(16.0426)} ${i(7.73421)} ${o(16.9969)} ${i(5.97989)} ${o(18.6797)} ${i(5.00977)}C${o(20.3596)} ${i(4.03474)} ${o(22.3521)} ${i(4.08468)} ${o(23.9365)} ${i(4.96094)}C${o(24.4378)} ${i(3.22749)} ${o(25.8059)} ${i(1.7898)} ${o(27.6797)} ${i(1.29004)}C${o(29.5511)} ${i(.78264)} ${o(31.4617)} ${i(1.34357)} ${o(32.7646)} ${i(2.60059)}C${o(33.6971)} ${i(1.04268)} ${o(35.4013)} ${i(152405e-9)} ${o(37.3496)} ${i(0)}ZM${o(41.0615)} ${i(9.17578)}C${o(40.1006)} ${i(10.1057)} ${o(38.793)} ${i(10.6797)} ${o(37.3496)} ${i(10.6797)}C${o(35.9064)} ${i(10.6796)} ${o(34.5985)} ${i(10.1066)} ${o(33.6377)} ${i(9.17676)}C${o(32.9511)} ${i(10.3241)} ${o(31.8358)} ${i(11.2176)} ${o(30.4404)} ${i(11.5898)}C${o(29.0527)} ${i(11.9661)} ${o(27.6436)} ${i(11.7542)} ${o(26.4766)} ${i(11.1074)}C${o(26.1072)} ${i(12.3879)} ${o(25.2629)} ${i(13.5333)} ${o(24.0195)} ${i(14.25)}C${o(22.7695)} ${i(14.9754)} ${o(21.347)} ${i(15.1322)} ${o(20.0479)} ${i(14.8047)}C${o(20.0289)} ${i(16.1454)} ${o(19.5108)} ${i(17.4793)} ${o(18.4902)} ${i(18.5)}C${o(17.4696)} ${i(19.5158)} ${o(16.1409)} ${i(20.033)} ${o(14.8066)} ${i(20.0566)}C${o(15.1312)} ${i(21.3534)} ${o(14.9738)} ${i(22.7723)} ${o(14.25)} ${i(24.0195)}C${o(13.5243)} ${i(25.2699)} ${o(12.3701)} ${i(26.1148)} ${o(11.082)} ${i(26.4795)}C${o(11.7347)} ${i(27.6479)} ${o(11.9529)} ${i(29.062)} ${o(11.5801)} ${i(30.46)}C${o(11.2085)} ${i(31.8485)} ${o(10.3194)} ${i(32.9607)} ${o(9.17578)} ${i(33.6475)}C${o(10.106)} ${i(34.6084)} ${o(10.6797)} ${i(35.9167)} ${o(10.6797)} ${i(37.3604)}C${o(10.6796)} ${i(38.805)} ${o(10.1053)} ${i(40.1141)} ${o(9.17383)} ${i(41.0752)}C${o(10.3132)} ${i(41.7614)} ${o(11.1999)} ${i(42.871)} ${o(11.5703)} ${i(44.2598)}C${o(11.946)} ${i(45.6504)} ${o(11.7335)} ${i(47.0592)} ${o(11.0889)} ${i(48.2266)}C${o(12.377)} ${i(48.593)} ${o(13.5297)} ${i(49.441)} ${o(14.25)} ${i(50.6904)}C${o(14.9754)} ${i(51.9405)} ${o(15.1322)} ${i(53.3629)} ${o(14.8047)} ${i(54.6621)}C${o(16.142)} ${i(54.6835)} ${o(17.4721)} ${i(55.2016)} ${o(18.4902)} ${i(56.2197)}C${o(19.5097)} ${i(57.2441)} ${o(20.0278)} ${i(58.5787)} ${o(20.0479)} ${i(59.918)}C${o(21.3469)} ${i(59.5917)} ${o(22.7696)} ${i(59.7493)} ${o(24.0195)} ${i(60.4697)}C${o(25.2676)} ${i(61.1892)} ${o(26.1117)} ${i(62.3406)} ${o(26.4775)} ${i(63.627)}C${o(27.6424)} ${i(62.9822)} ${o(29.0498)} ${i(62.7688)} ${o(30.4404)} ${i(63.1396)}C${o(31.8284)} ${i(63.5112)} ${o(32.9402)} ${i(64.3999)} ${o(33.627)} ${i(65.543)}C${o(34.5887)} ${i(64.6072)} ${o(35.9012)} ${i(64.0304)} ${o(37.3496)} ${i(64.0303)}C${o(38.7912)} ${i(64.0303)} ${o(40.098)} ${i(64.6023)} ${o(41.0586)} ${i(65.5303)}C${o(41.7458)} ${i(64.3887)} ${o(42.8594)} ${i(63.5007)} ${o(44.25)} ${i(63.1299)}C${o(45.643)} ${i(62.7522)} ${o(47.057)} ${i(62.9676)} ${o(48.2266)} ${i(63.6201)}C${o(48.5931)} ${i(62.3323)} ${o(49.4413)} ${i(61.1801)} ${o(50.6904)} ${i(60.46)}C${o(51.9373)} ${i(59.7364)} ${o(53.3558)} ${i(59.5781)} ${o(54.6523)} ${i(59.9023)}C${o(54.6744)} ${i(58.5659)} ${o(55.1925)} ${i(57.2372)} ${o(56.21)} ${i(56.2197)}C${o(57.2339)} ${i(55.2007)} ${o(58.5676)} ${i(54.6816)} ${o(59.9062)} ${i(54.6611)}C${o(59.5835)} ${i(53.3649)} ${o(59.7414)} ${i(51.9468)} ${o(60.46)} ${i(50.7002)}C${o(61.1797)} ${i(49.4517)} ${o(62.3312)} ${i(48.6068)} ${o(63.6182)} ${i(48.2412)}C${o(62.9651)} ${i(47.0726)} ${o(62.7473)} ${i(45.658)} ${o(63.1201)} ${i(44.2598)}C${o(63.4916)} ${i(42.8718)} ${o(64.3794)} ${i(41.7591)} ${o(65.5225)} ${i(41.0723)}C${o(64.5929)} ${i(40.1115)} ${o(64.0206)} ${i(38.8033)} ${o(64.0205)} ${i(37.3604)}C${o(64.0205)} ${i(35.9186)} ${o(64.5915)} ${i(34.611)} ${o(65.5195)} ${i(33.6504)}C${o(64.3785)} ${i(32.9631)} ${o(63.4908)} ${i(31.8501)} ${o(63.1201)} ${i(30.46)}C${o(62.7421)} ${i(29.0656)} ${o(62.9572)} ${i(27.6498)} ${o(63.6113)} ${i(26.4795)}C${o(62.3272)} ${i(26.1115)} ${o(61.1784)} ${i(25.2657)} ${o(60.46)} ${i(24.0195)}C${o(59.7364)} ${i(22.7727)} ${o(59.5781)} ${i(21.3541)} ${o(59.9023)} ${i(20.0576)}C${o(58.5626)} ${i(20.038)} ${o(57.23)} ${i(19.52)} ${o(56.21)} ${i(18.5)}C${o(55.1931)} ${i(17.4783)} ${o(54.675)} ${i(16.1482)} ${o(54.6523)} ${i(14.8125)}C${o(53.3557)} ${i(15.1357)} ${o(51.9374)} ${i(14.9785)} ${o(50.6904)} ${i(14.2598)}C${o(49.4399)} ${i(13.5339)} ${o(48.5931)} ${i(12.3801)} ${o(48.2285)} ${i(11.0918)}C${o(47.0603)} ${i(11.7439)} ${o(45.6474)} ${i(11.9624)} ${o(44.25)} ${i(11.5898)}V${i(11.5801)}C${o(42.8613)} ${i(11.2085)} ${o(41.7483)} ${i(10.3196)} ${o(41.0615)} ${i(9.17578)}Z`}function D1(e){let t=e/70;return {scale:t,transform:(n,o)=>(n-5)*t+o}}function Nv(e,t,r){let{scale:n,transform:o}=D1(r);return M`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}H ${o(5,e)}zM ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${35*n}z`}function Fv(e,t,r){let n=r/7,o=n*1.5,i=n*.75,s=M`M ${e+o} ${t}`+M`h ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+n+i} ${t+n}`+M`h ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function zv(e,t,r){let{scale:n,transform:o}=D1(r);return M`M ${o(5,e)} ${o(40,t)}a ${35*n} ${35*n}, 0, 0, 0, ${35*n} ${35*n}h ${30*n}a ${5*n} ${5*n}, 0, 0, 0, ${5*n} -${5*n}v -${30*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} -${35*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} ${35*n}zM ${o(40,e)} ${o(15,t)}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} ${25*n}v ${25*n}h -${25*n}a ${25*n} ${25*n}, 0, 0, 1, -${25*n} -${25*n}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} -${25*n}z`}function Dv(e,t,r){let{scale:n,transform:o}=D1(r);return M`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} ${25*n}M ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} -${15*n}z`}function Bv(e,t,r){let n=r/70,o=e+r/2-40*n,i=t+r/2-40*n,s=(c,u)=>c*n+u;return M`M${s(35.19239999999999,o)} ${s(5.837547376725838,i)}C${s(37.69667692307692,o)} ${s(3.8737070690335305,i)}, ${s(41.218430769230764,o)} ${s(3.8737092228796843,i)}, ${s(43.722707692307694,o)} ${s(5.837547376725838,i)}L${s(46.62781538461539,o)} ${s(8.115648915187375,i)}L${s(50.23356923076923,o)} ${s(7.32361506903353,i)}C${s(53.342,o)} ${s(6.640824299802762,i)}, ${s(56.51483076923077,o)} ${s(8.168784299802759,i)}, ${s(57.91892307692308,o)} ${s(11.024719684418145,i)}L${s(59.54787692307692,o)} ${s(14.337679684418145,i)}L${s(63.14027692307692,o)} ${s(15.188578145956608,i)}C${s(66.23707692307693,o)} ${s(15.922091992110452,i)}, ${s(68.43270769230769,o)} ${s(18.675396607495067,i)}, ${s(68.45876923076924,o)} ${s(21.857768915187375,i)}L${s(68.48892307692307,o)} ${s(25.54931045364891,i)}L${s(71.35633846153846,o)} ${s(27.874602761341222,i)}C${s(73.82830769230769,o)} ${s(29.879187376725838,i)}, ${s(74.61187692307692,o)} ${s(33.312418145956606,i)}, ${s(73.25452307692306,o)} ${s(36.19103353057199,i)}L${s(71.68006153846153,o)} ${s(39.530141222879685,i)}L${s(73.25452307692306,o)} ${s(42.86924891518738,i)}C${s(74.61187692307692,o)} ${s(45.747864299802764,i)}, ${s(73.82830769230769,o)} ${s(49.18109506903353,i)}, ${s(71.35633846153846,o)} ${s(51.18567968441815,i)}L${s(68.48892307692307,o)} ${s(53.510971992110456,i)}L${s(68.45876923076924,o)} ${s(57.202664299802755,i)}C${s(68.43270769230769,o)} ${s(60.38497199211046,i)}, ${s(66.23707692307693,o)} ${s(63.13823353057199,i)}, ${s(63.14027692307692,o)} ${s(63.871833530572,i)}L${s(59.54787692307692,o)} ${s(64.72260276134121,i)}L${s(57.91892307692308,o)} ${s(68.03564891518737,i)}C${s(56.51483076923077,o)} ${s(70.89164891518737,i)}, ${s(53.342,o)} ${s(72.41958737672583,i)}, ${s(50.23356923076923,o)} ${s(71.7368181459566,i)}L${s(46.62781538461539,o)} ${s(70.94463353057199,i)}L${s(43.722707692307694,o)} ${s(73.22275660749506,i)}C${s(41.218430769230764,o)} ${s(75.18663353057198,i)}, ${s(37.69667692307692,o)} ${s(75.18663353057198,i)}, ${s(35.19239999999999,o)} ${s(73.22275660749506,i)}L${s(32.28729230769231,o)} ${s(70.94463353057199,i)}L${s(28.68153846153846,o)} ${s(71.7368181459566,i)}C${s(25.573215384615384,o)} ${s(72.41958737672583,i)}, ${s(22.400384615384613,o)} ${s(70.89164891518737,i)}, ${s(20.996141538461536,o)} ${s(68.03564891518737,i)}L${s(19.36720923076923,o)} ${s(64.72260276134121,i)}L${s(15.774852307692306,o)} ${s(63.871833530572,i)}C${s(12.67803076923077,o)} ${s(63.13823353057199,i)}, ${s(10.48237846153846,o)} ${s(60.38497199211046,i)}, ${s(10.45636,o)} ${s(57.202664299802755,i)}L${s(10.426163076923077,o)} ${s(53.510971992110456,i)}L${s(7.558747692307692,o)} ${s(51.18567968441815,i)}C${s(5.086880338461539,o)} ${s(49.18109506903353,i)}, ${s(4.303258769230769,o)} ${s(45.747864299802764,i)}, ${s(5.660599692307692,o)} ${s(42.86924891518738,i)}L${s(7.235153846153846,o)} ${s(39.530141222879685,i)}L${s(5.660599692307692,o)} ${s(36.19103353057199,i)}C${s(4.3032566153846155,o)} ${s(33.312418145956606,i)}, ${s(5.086885938461538,o)} ${s(29.879187376725838,i)}, ${s(7.558747692307692,o)} ${s(27.874602761341222,i)}L${s(10.426163076923077,o)} ${s(25.54931045364891,i)}L${s(10.45636,o)} ${s(21.857768915187375,i)}C${s(10.48237846153846,o)} ${s(18.67537506903353,i)}, ${s(12.678052307692308,o)} ${s(15.922091992110452,i)}, ${s(15.774852307692306,o)} ${s(15.188578145956608,i)}L${s(19.36720923076923,o)} ${s(14.337679684418145,i)}L${s(20.996141538461536,o)} ${s(11.024719684418145,i)}C${s(22.400384615384613,o)} ${s(8.168784299802759,i)}, ${s(25.573215384615384,o)} ${s(6.640824299802762,i)}, ${s(28.68153846153846,o)} ${s(7.32361506903353,i)}L${s(32.28729230769231,o)} ${s(8.115648915187375,i)}L${s(35.19239999999999,o)} ${s(5.837547376725838,i)}M${s(39.45766153846154,o)} ${s(13.665055069033532,i)}L${s(37.01498461538461,o)} ${s(15.58053506903353,i)}C${s(35.39098461538461,o)} ${s(16.854061222879682,i)}, ${s(33.282799999999995,o)} ${s(17.335251992110454,i)}, ${s(31.26701538461538,o)} ${s(16.892464299802757,i)}L${s(28.235046153846152,o)} ${s(16.22649506903353,i)}L${s(26.865415384615382,o)} ${s(19.012107376725837,i)}C${s(25.954812307692308,o)} ${s(20.864178145956608,i)}, ${s(24.264193846153844,o)} ${s(22.212399684418145,i)}, ${s(22.255926153846154,o)} ${s(22.688076607495066,i)}L${s(19.235393846153844,o)} ${s(23.40354122287968,i)}L${s(19.21,o)} ${s(26.507556607495065,i)}C${s(19.19313538461538,o)} ${s(28.57137199211045,i)}, ${s(18.25492,o)} ${s(30.519525838264297,i)}, ${s(16.651919999999997,o)} ${s(31.81937199211045,i)}L${s(14.240926153846154,o)} ${s(33.774633530572,i)}L${s(15.564830769230769,o)} ${s(36.58238737672584,i)}C${s(16.445064615384617,o)} ${s(38.44891045364892,i)}, ${s(16.445064615384617,o)} ${s(40.611371992110456,i)}, ${s(15.564830769230769,o)} ${s(42.47811045364892,i)}L${s(14.240926153846154,o)} ${s(45.28564891518738,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}L${s(13.883236923076923,o)} ${s(50.654971992110454,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}C${s(18.25492,o)} ${s(48.54075660749507,i)}, ${s(19.19313538461538,o)} ${s(50.4891258382643,i)}, ${s(19.21,o)} ${s(52.5527258382643,i)}L${s(19.235393846153844,o)} ${s(55.65684891518738,i)}L${s(22.255926153846154,o)} ${s(56.37235660749507,i)}C${s(24.264193846153844,o)} ${s(56.847925838264295,i)}, ${s(25.954812307692308,o)} ${s(58.196233530571995,i)}, ${s(26.865415384615382,o)} ${s(60.0483258382643,i)}L${s(28.235046153846152,o)} ${s(62.833895069033524,i)}L${s(31.26701538461538,o)} ${s(62.1679258382643,i)}C${s(33.282799999999995,o)} ${s(61.72509506903353,i)}, ${s(35.39098461538461,o)} ${s(62.20626429980276,i)}, ${s(37.01498461538461,o)} ${s(63.47983353057199,i)}L${s(39.45766153846154,o)} ${s(65.39524891518737,i)}L${s(41.90012307692308,o)} ${s(63.47983353057199,i)}C${s(43.524123076923075,o)} ${s(62.20626429980276,i)}, ${s(45.632307692307684,o)} ${s(61.72509506903353,i)}, ${s(47.6480923076923,o)} ${s(62.1679258382643,i)}L${s(50.68006153846154,o)} ${s(62.833895069033524,i)}L${s(52.049692307692304,o)} ${s(60.0483258382643,i)}C${s(52.960338461538456,o)} ${s(58.196233530571995,i)}, ${s(54.6508923076923,o)} ${s(56.847925838264295,i)}, ${s(56.65913846153846,o)} ${s(56.37235660749507,i)}L${s(59.67969230769231,o)} ${s(55.65684891518738,i)}L${s(59.70510769230769,o)} ${s(52.5527258382643,i)}C${s(59.72190769230769,o)} ${s(50.4891258382643,i)}, ${s(60.66012307692307,o)} ${s(48.54075660749507,i)}, ${s(62.263230769230766,o)} ${s(47.240910453648915,i)}L${s(64.67424615384616,o)} ${s(45.28564891518738,i)}L${s(63.35027692307692,o)} ${s(42.47811045364892,i)}C${s(62.47,o)} ${s(40.611371992110456,i)}, ${s(62.47,o)} ${s(38.44891045364892,i)}, ${s(63.35027692307692,o)} ${s(36.58238737672584,i)}L${s(64.67424615384616,o)} ${s(33.774633530572,i)}L${s(62.263230769230766,o)} ${s(31.81958737672584,i)}C${s(60.66012307692307,o)} ${s(30.519525838264297,i)}, ${s(59.72190769230769,o)} ${s(28.57137199211045,i)}, ${s(59.70510769230769,o)} ${s(26.507556607495065,i)}L${s(59.67969230769231,o)} ${s(23.40354122287968,i)}L${s(56.65913846153846,o)} ${s(22.688076607495066,i)}C${s(54.6508923076923,o)} ${s(22.212399684418145,i)}, ${s(52.960338461538456,o)} ${s(20.864178145956608,i)}, ${s(52.049692307692304,o)} ${s(19.012128915187375,i)}L${s(50.68006153846154,o)} ${s(16.22649506903353,i)}L${s(47.6480923076923,o)} ${s(16.892464299802757,i)}C${s(45.632307692307684,o)} ${s(17.335251992110454,i)}, ${s(43.524338461538456,o)} ${s(16.85408276134122,i)}, ${s(41.90012307692308,o)} ${s(15.58053506903353,i)}L${s(39.45766153846154,o)} ${s(13.665055069033532,i)}Z`}function gl(e,t,r,n,o="top-left"){switch(n){case "leaf":return xw(e,t,r,o);case "leaf-reverse":return xw(e,t,r,o,true);case "drop":return yv(e,t,r,o);case "octagon":return yw(e,t,r,1.6);case "bevel":return yw(e,t,r,1.1);case "squircle":return xv(e,t,r);case "cushion":return $v(e,t,r);case "shield":return wv(e,t,r);case "petal":return Sv(e,t,r,o);case "porthole":return Av(e,t,r);case "notch":return vv(e,t,r);case "plus":return Rv(e,t,r);case "bud":return kv(e,t,r,o);case "bowl":return Iv(e,t,r);case "gear":return Lv(e,t,r);case "rounded":return Tv(e,t,r);case "circle":return Ov(e,t,r);case "diya":return Nv(e,t,r);case "extra-rounded":return Fv(e,t,r);case "message":return zv(e,t,r);case "pointy":return Dv(e,t,r);case "curly":return Bv(e,t,r);default:return Mv(e,t,r)}}var _l=.22,bl=.14;function $w(e,t,r={}){if(e==="circle")return k("circle",{cx:x(t.x+t.w/2),cy:x(t.y+t.h/2),r:x(Math.min(t.w,t.h)/2),...r});let n=e==="rounded"?Math.min(t.w,t.h)*_l:0;return k("rect",{height:x(t.h),width:x(t.w),x:x(t.x),y:x(t.y),...n>0&&{rx:x(n),ry:x(n)},...r})}function Zv(e,t){let r=e.w*t,n=e.h*t;return {x:e.x+r,y:e.y+n,w:e.w-2*r,h:e.h-2*n}}function yl(e,t){let r=e.shape??"square",n=e.plate,o=n?Zv(t,bl):t,i=a=>k("image",{height:x(o.h),href:e.src,preserveAspectRatio:"none",width:x(o.w),x:x(o.x),y:x(o.y),...a&&{clipPath:`url(#${a})`}});if(r==="square"&&!n)return i();let s=r==="square"?void 0:`qrdx-logo-${Dn(`${r}|${x(o.x)}|${x(o.y)}|${x(o.w)}|${x(o.h)}`)}`;return Be("g",{children:[n&&$w(r,t,{fill:n}),s&&k("clipPath",{id:s,children:$w(r,o)}),i(s)]})}var ww=.6,Uv=["L","M","Q","H"];function Sw(e){let t=Re.QrCode.encodeText(e.value,Ze[e.level]),r=Uv[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:Ke(t.size,e.margin,e.shape),map:Ws(t.version,r),level:r,version:t.version}}function Cw(e,t){let{cells:r,map:n}=e,o=r.length,i=Xr(r,e.code.size,e.layoutMargin,t);if(!i)return null;let s=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},a=[];for(let u=Math.max(0,s.y);u<Math.min(o,s.y+s.h);u++)for(let l=Math.max(0,s.x);l<Math.min(o,s.x+s.w);l++)a.push(u*o+l);let c=qs(n,a);return {worst:Math.max(0,...c),correctable:n.correctable,budget:Math.floor(n.correctable*ww),level:e.level,version:e.version}}function xl(e,t){return Cw(Sw(e),t)}var Ew=e=>!e||e.worst<=e.budget;function Gv(e,t){return Ew(xl(e,t))}function B1(e,t,r,n){let o=t.map(a=>Sw({...e,level:a})),i=a=>{let c=n(a);return o.every(u=>Ew(Cw(u,c)))};if(i(r))return r;let s=e.size*.005;for(let a=r-s;a>0;a-=s)if(i(a))return a;return 0}function bi(e,t){if(!t)return;let r=Math.floor(e.size*ka),n=t.width||r,o=t.height||r,i=p=>{if(p===n)return t;let m=o*p/n;return {...t,width:p,height:m,...t.x!=null&&{x:t.x+(n-p)/2},...t.y!=null&&{y:t.y+(o-m)/2}}},s=e.level??Vt,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape},c=p=>Je({...e,level:s,imageSettings:p}),u=p=>{let m=B1(a,[p],n,i);return m>0?i(m):void 0},l=c(t);if(l===s)return u(s);let f=u(l);return f&&c(f)===l?f:u(s)}var Aw={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"]},vw={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Rw=["circle","curly"],Pw=["diamond","banner","star"],kw={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Zt=["square","liquid","classy","classy-rounded"],Iw={"circle/rounded":Zt,"circle/extra-rounded":Zt,"circle/message":[...Zt,"leaf"],"circle/pointy":Zt,"circle/leaf-reverse":Zt,"circle/drop":Zt,"circle/bevel":[...Zt,"leaf"],"circle/squircle":[...Zt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Zt,"circle/shield":[...Zt,"rounded","horizontal-line","leaf"],"circle/petal":Zt};function Mw(e,t,r){return (kw[e]?.includes(t)??false)&&!Iw[`${e}/${t}`]?.includes(r)}function Z1(e){let t=He(an,e.bodyPattern??"circle"),r=He(sr,e.cornerEyePattern??"gear"),n=He(ar,e.cornerEyeDotPattern??"circle");return Aw[n]?.includes(r)?{kind:"dot-eye",message:`${n} centres in ${r} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:vw[t]?.includes(r)?{kind:"body-eye",message:`${t} dots next to ${r} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:Pw.includes(n)?{kind:"dot",message:`${n} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Rw.includes(r)?{kind:"eye",message:`${r} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Mw(n,r,t)?{kind:"sharp-dot-eye",message:`${n} centres in ${r} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var U1=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},Qv=e=>255*(e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055);function Lw({r:e,g:t,b:r}){let n=U1(e),o=U1(t),i=U1(r),s=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*i),a=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*i),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*i),u=1.9779984951*s-2.428592205*a+.4505937099*c,l=.0259040371*s+.7827717662*a-.808675766*c;return {l:.2104542553*s+.793617785*a-.0040720468*c,c:Math.hypot(u,l),h:Math.atan2(l,u)}}function G1({l:e,c:t,h:r}){let n=t*Math.cos(r),o=t*Math.sin(r),i=(e+.3963377774*n+.2158037573*o)**3,s=(e-.1055613458*n-.0638541728*o)**3,a=(e-.0894841775*n-1.291485548*o)**3;return [4.0767416621*i-3.3077115913*s+.2309699292*a,-1.2684380046*i+2.6097574011*s-.3413193965*a,-0.0041960863*i-.7034186147*s+1.707614701*a]}var Tw=1e-7,Ow=e=>e.every(t=>t>=-Tw&&t<=1+Tw),jv=20;function $l(e){let t=G1(e);if(!Ow(t)){let i=0,s=e.c;for(let a=0;a<jv;a++){let c=(i+s)/2;Ow(G1({...e,c}))?i=c:s=c;}t=G1({...e,c:i});}let[r=0,n=0,o=0]=t.map(i=>Math.round(Qv(Math.min(1,Math.max(0,i)))));return {r,g:n,b:o,a:1}}var Fw="gear",Vv="circle";function tr(e,t){let r=e.eyeShapes?.[t];return {outer:He(sr,r?.outer??e.cornerEyePattern??Fw),inner:He(ar,r?.inner??e.cornerEyeDotPattern??Vv)}}var Hv=["curly","circle"];function H1(e){let t=un.map(r=>tr(e,r));for(let r of Hv)if(t.some(n=>n.outer===r))return r;return t[0]?.outer??Fw}var Nw=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function W1(e){let t=null,r=new Set;for(let n of un){let{outer:o,inner:i}=tr(e,n),s=`${o}/${i}`;if(r.has(s))continue;r.add(s);let a=Z1({bodyPattern:e.bodyPattern,cornerEyePattern:o,cornerEyeDotPattern:i});a&&(!t||Nw.indexOf(a.kind)<Nw.indexOf(t.kind))&&(t=a);}return t}function xi(e,t,r,n){if(!(e&&Number.isFinite(e))||e<=0||ua(n)||r<=0)return 0;let o=Math.min(po,Ff*r/(t+2*r));return Math.min(e,o)}function Wv(e){let{value:t,level:r,shape:n,autoLevel:o,isOGContext:i}=e,s=e.size??ye,a=e.margin??Me,c=bi({value:`${t}`,size:s,margin:a,level:r,shape:n,autoLevel:o,isOGContext:i},e.imageSettings),u=Je({value:`${t}`,size:s,level:r,margin:a,imageSettings:c,isOGContext:i,autoLevel:o,shape:n}),l=Re.QrCode.encodeText(`${t}`,Ze[u]).size;return xi(po,l,a,n)}var V1=(e,t,r,n)=>Math.min(n,Math.max(r,typeof e=="number"&&Number.isFinite(e)?e:t)),qv=/^hsla?\(([^)]*)\)$/,Xv=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,Yv=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function Q1(e,t){let r=e?.trim()??"";if(!Yv.test(r))return Number.NaN;let n=Number.parseFloat(r),o=r.endsWith("%")||t?n/100:n;return Math.min(1,Math.max(0,o))}function Kv(e){let t=qv.exec(e);if(!t)return null;let[r="",n]=(t[1]??"").split("/"),o=r.split(/[\s,]+/).filter(Boolean);if(o.length!==(n===void 0&&o.length===4?4:3))return null;let[i="",s,a,c]=o,u=Q1(s,true),l=Q1(a,true),f=Q1(n??c??"1",false),p=Number.parseFloat(i);if(!(Xv.test(i)&&[u,l,f].every(Number.isFinite)))return null;let m=u*Math.min(l,1-l),h=d=>{let g=(d+p/30)%12,_=g<0?g+12:g;return 255*(l-m*Math.max(-1,Math.min(_-3,9-_,1)))};return {r:h(0),g:h(8),b:h(4),a:f}}function El(e){let t=e?.trim().toLowerCase()??"";return t==="none"?{r:0,g:0,b:0,a:0}:we(t)??Kv(t)}function wl(e){return El(e)?.a??1}function zw(e){let t=it(e,Pe);return t.type==="solid"?wl(t.color)<1:t.type==="image"?wl(t.underlay??"transparent")<1:t.stops.some(r=>wl(r.color)<1)}var yi=({r:e,g:t,b:r})=>[.2126*e+.7152*t+.0722*r,.299*e+.587*t+.114*r],Cl=yi(we(ln)),Hn=1e-9,Sl=(e,t,r)=>e.every((n,o)=>n>=t[o]-Hn&&n<=r[o]+Hn),q1=({r:e,g:t,b:r})=>`#${[e,t,r].map(n=>Math.round(n).toString(16).padStart(2,"0")).join("")}`;function Dw(e){let t=El(e.color||Ta);return t&&t.a>0?q1(t):Ta}var Jv=24,e7=12;function Bw(e,t,r){if(Sl(yi(e),t,r))return e;if(e.r===e.g&&e.g===e.b){let u=Math.min(Math.floor(Math.min(...r)+Hn),Math.max(e.r,Math.ceil(Math.max(...t)-Hn)));return u>=Math.max(...t)-Hn?{r:u,g:u,b:u,a:1}:null}let n=Lw(e),o=u=>{let l=$l({l:n.l,c:u,h:n.h}),f=yi(l);if(Sl(f,t,r))return l;let p=f.some((_,b)=>_<t[b]),m=_=>yi(_).every((b,y)=>p?b>=t[y]-Hn:b<=r[y]+Hn),h=n.l,d=p?1:0;for(let _=0;_<Jv;_++){let b=(h+d)/2;m($l({l:b,c:u,h:n.h}))?d=b:h=b;}let g=$l({l:d,c:u,h:n.h});return Sl(yi(g),t,r)?g:null},i=o(n.c);if(i)return i;let s=o(0);if(!s)return null;let a=0,c=n.c;for(let u=0;u<e7;u++){let l=(a+c)/2,f=o(l);f?(a=l,s=f):c=l;}return s}var j1="or turn the halo off";function Zw(e){let t=it(e,Pe);if(t.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, ${j1}`};if(zw(e))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, ${j1}`};let r=(t.type==="solid"?[t.color]:t.stops.map(o=>o.color)).map(El),n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let o of r){let i=o?yi(o):[0,0];n[0]=Math.min(n[0],i[0]),n[1]=Math.min(n[1],i[1]);}return Sl(Cl,Cl,n)?n:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${ln}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${ln} or lighter, ${j1}`}}function X1(e,t){let r=Zw(t);if(!Array.isArray(r))return r;let n=Dw(e),o=Bw(we(n),Cl,r);return {drawn:o?q1(o):ln,picked:n}}function t7(e,t){let r=X1({color:e},t);return "drawn"in r?r.drawn:null}function r7(e,t,r=4){let n=Zw(t),o=El(e);if(!(Array.isArray(n)&&o))return [];let i=new Set;for(let s=0;s<r;s++){let a=s/r,c=Cl.map((l,f)=>l+a*((n[f]??l)-l)),u=Bw({...o,a:1},c,n);u&&i.add(q1(u));}return [...i]}function Y1(e){if(!e.halo)return null;let t=X1(e.halo,e.bgColor);return "drawn"in t?t.drawn===t.picked?null:{reason:"adjusted",color:t.drawn,message:`Halo drawn as ${t.drawn} instead of ${t.picked} so the code still scans: a rim must read no lighter than the background and at least as light as ${ln}`,fix:`To have it drawn as picked, choose a color in that range, such as ${t.drawn}`}:t}function la(e,t){if(!e)return null;let r=t?X1(e,t.bgColor):null;if(r&&!("drawn"in r))return null;let n=V1(e.width,zf,Oi,Li);return {color:r?r.drawn:Dw(e),width:n}}function K1(e){if(!e)return null;let t=o=>V1(o,Df,-cr,cr),r=t(e.dx),n=t(e.dy);return r===0&&n===0?null:{color:e.color||Zf,opacity:V1(e.opacity,Bf,Ni,Fi),dx:r,dy:n}}var J1="data-qrdx-part",Uw="data-qrdx-eye",n7=["eye-outer","eye-centre","body","logo","background"];function e_(e,t,r){if(e)return r?{[J1]:t,[Uw]:r}:{[J1]:t}}var fa=300;function rr(e){return {id:e.id,name:e.name,description:e.description,spec:e.spec,wrapper:(t,r)=>{let n=Gn(e.spec),o=r?.fgColor,i=(typeof o=="string"?o:Ne(o,""))||"black",s=sa(n.qr.size,n,{color:i}),{x:a,y:c,scale:u}=e.at;return k("svg",{height:fa,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${fa} ${fa}`,width:fa,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Be("g",{"data-qrdx-template":e.id,transform:`translate(${x(a)} ${x(c)})${u===1?"":` scale(${u})`}`,children:[iw(s),k("g",{fill:"none",transform:`translate(${x(s.qrX)} ${x(s.qrY)}) scale(${s.qrSize/fa})`,children:t})]})})}}}var Gw={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 Qw=rr({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Gw,at:{x:47,y:95,scale:1}});var jw={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>k("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:k("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var pa=593,Yr=296.5,ma=146.5,Yw=294.5,Kw=231.228,Jw="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",i7="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",s7="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",Vw="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Hw=52,a7=240;function Ww(e){let t=0;return e.split(" ").map(r=>(t+=Number.parseInt(r,36),t/1e4))}var t_;function c7(){if(!t_){let e=Ww(i7),t=Ww(s7),r=[];for(let n=0;n<Vw.length;n+=3){let o=Number.parseInt(Vw.slice(n,n+3),36);r.push({cx:e[Math.floor(o/Hw)],cy:t[o%Hw]});}t_=r;}return t_}function u7(e){let t=0;for(let r=0;r<e.length;r++)t=t*32-t+e.charCodeAt(r),t%=2147483647;return Math.abs(t)}function eS(e){let t=c7(),r=u7(e),n=()=>(r=(r*9301+49297)%233280,r/233280),o=t.map((i,s)=>s);for(let i=o.length-1;i>0;i--){let s=Math.floor(n()*(i+1));[o[i],o[s]]=[o[s],o[i]];}return o.slice(0,a7).sort((i,s)=>i-s).map(i=>t[i])}var qw=300,l7=49,f7=6;function tS(e,t){if(qw/t<=l7+.5)return e;let r=ma,n=ma+qw,o=f7*t+t/2;return e.filter(({cx:i,cy:s})=>Math.max(r-i,i-n,r-s,s-n)>=o)}var rS="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",da=32,nS=3.5,m7=da*cn,oS=246.5,$r=2*Math.PI*oS,o_=.36,Xw=oS+o_*da,r_=400;function $i(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function p7(e){let t=e.slice(0,r_).split(" ").map(r=>yo(r,r_)).join(" ");return Array.from(t).slice(0,r_)}var d7="\u2026",iS=1;function sS(e,t,r,n=false){return n&&t===e.length-1?iS*r:$i(e[t],r)}function i_(e,t,r=false){let n=0;for(let o=0;o<e.length;o++)n+=sS(e,o,t,r);return n}function n_(e,t,r,n=false){return i_(e,t,n)+r*Math.max(0,e.length-1)+$i(" ",t)+2*r<=$r}var aS=e=>e.join("").split(" ").filter(Boolean),h7=(e,t)=>Array.from(Array.from({length:t},()=>e.join(" ")).join(" "));function cS(e,t,r){if(n_(e,t,r))return {chars:e,fontSize:t,letterSpacing:r};let n=Math.min(r,0),o=Math.min(t,m7),i=(d,g=false)=>{let _=i_(d,t,g)+$i(" ",t),b=d.length+1,y=($r-_)/b;if(y>=n)return {chars:d,fontSize:t,letterSpacing:y,cut:g};let S=($r-n*b)/_*t;return S>=o?{chars:d,fontSize:S,letterSpacing:n,cut:g}:null},s=i(e);if(s)return s;let a=aS(e),c=uS(a);for(let d=a.length/c.length-1;d>=1;d--){let g=h7(c,d);if(n_(g,o,n))return i(g)??{chars:g,fontSize:o,letterSpacing:n}}let u=$r-$i(" ",o)-iS*o-2*n,l=0,f=0,p=0;for(let[d,g]of e.entries()){if(l+=$i(g,o)+n,l>u)break;p=d+1,(p===e.length||e[p]===" ")&&(f=p);}let m=[...g7(e.slice(0,f>0?f:p)),d7];return (n_(m,t,r,true)?{chars:m,fontSize:t,letterSpacing:r,cut:true}:null)??i(m,true)??{chars:m,fontSize:o,letterSpacing:n,cut:true}}function g7(e){let t=e.length;for(;t>0&&/[\s.,;:!?*·•\-–—]/u.test(e[t-1]);)t--;return e.slice(0,t)}function uS(e){for(let t=1;t<e.length;t++)if(e.length%t===0&&e.every((r,n)=>r===e[n%t]))return e.slice(0,t);return e}function _7(e,t,r){let n=aS(e);if(n.length===0)return {chars:[],fontSize:t,letterSpacing:r};let o=Array.from(uS(n).join(" ")),i=i_(o,t)+$i(" ",t),s=i+(o.length+1)*r,a=Math.min(r,0),c=null;for(let u of new Set([Math.floor($r/s),Math.ceil($r/s)])){if(u<1)continue;let l=($r-u*i)/(u*(o.length+1));if(l>=a&&(!c||Math.abs(l-r)<Math.abs(c.letterSpacing-r))){let f=Array.from({length:u},()=>o.join(""));c={chars:Array.from(f.join(" ")),fontSize:t,letterSpacing:l};}}return c??cS(o,t,r)}function lS(e,t){let{position:r,rotation:n}=t,o=p7(e),i=t.fill==="repeat"?_7(o,t.fontSize,t.letterSpacing):cS(o,t.fontSize,t.letterSpacing),{fontSize:s,letterSpacing:a}=i,c=[],u=0;for(let[d,g]of i.chars.entries()){let _=sS(i.chars,d,s,i.cut);c.push({char:g,along:u+_/2}),u+=_+a;}let l=u-(c.length>0?a:0),f=r!=="bottom",p=f?Xw-o_*s:Xw+o_*s,m=l/$r*180,h=[];for(let{char:d,along:g}of c){if(d.trim()==="")continue;let _=g/$r*360,b=f?n-m+_:n+180+m-_,y=b*Math.PI/180;h.push({char:d,x:fe(Yr+p*Math.sin(y)),y:fe(Yr-p*Math.cos(y)),rotate:fe(f?b:b-180)});}return {text:i.chars.join(""),letters:h,fontSize:s===t.fontSize?s:fe(s),letterSpacing:a}}var wi=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,fS={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:(e,t,r)=>{let n=Ne(t?.fgColor,"#000000"),o=Ne(t?.bgColor,"#ffffff"),i=r?.pixelSize??9,s=fe(i/2),a=tS(eS(r?.url??""),i),c=wi(t?.fontSize,da),u=c>0?c:da,l=typeof t?.customText=="string"?t.customText:rS,f=lS(l,{fontSize:u,letterSpacing:wi(t?.fontLetterSpacing,nS),position:t?.textPosition==="bottom"?"bottom":"top",rotation:wi(t?.textRotation,0),fill:t?.textFill==="repeat"?"repeat":"none"}),p=t?.textColor||"#ffffff",m=t?.fontFamily||pl,h=t?.fontWeight??900,d=wi(t?.strokeWidth,0),g=t?.strokeColor||"#000000",_=[{radius:Yr,width:wi(t?.outerStrokeWidth,d),color:t?.outerStrokeColor||g},{radius:Kw,width:wi(t?.innerStrokeWidth,d),color:t?.innerStrokeColor||g}].filter(b=>b.width>0);return Be("svg",{height:pa,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${pa} ${pa}`,width:pa,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[k("circle",{cx:Yr,cy:Yr,fill:o,r:Yw}),k("g",{fill:n,children:a.map((b,y)=>k("circle",{cx:b.cx,cy:b.cy,r:s},y))}),k("path",{d:Jw,fill:t?.outerCircleColor||n}),_.map((b,y)=>k("circle",{cx:Yr,cy:Yr,fill:"none",r:b.radius,stroke:b.color,strokeWidth:b.width},y)),k("g",{"aria-hidden":"true",children:f.letters.map((b,y)=>k("text",{fill:p,fontFamily:m,fontSize:f.fontSize,fontWeight:h,textAnchor:"middle",transform:`rotate(${b.rotate} ${b.x} ${b.y})`,x:b.x,y:b.y,children:b.char},y))}),k("g",{transform:`translate(${ma} ${ma})`,children:e})]})}};var mS={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 pS=rr({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:mS,at:{x:38,y:10,scale:1}});var dS={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 hS=rr({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:dS,at:{x:0,y:0,scale:300/316}});var gS={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 _S=rr({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:gS,at:{x:46,y:1,scale:1}});var bS={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 yS=rr({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:bS,at:{x:24,y:0,scale:1}});var ha={default:jw,Arrow:Qw,StandardBox:_S,SquareBorder:hS,StrikedBox:yS,Halloween:pS,DotRing:fS},xS={FlamQR:"DotRing"},Al=e=>{if(Object.hasOwn(ha,e))return ha[e];let t=Object.hasOwn(xS,e)?xS[e]:void 0;return t?ha[t]:void 0},mL=()=>Object.values(ha),pL=()=>Object.keys(ha);var s_=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function CS(e){return `#${s_(e.r)}${s_(e.g)}${s_(e.b)}`}function Si(e){let t=we(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:CS(t),opacity:fe(t.a,3)}}function vl(e,t){let r=Math.min(Math.max(e.a,0),1);return {r:e.r*r+t.r*(1-r),g:e.g*r+t.g*(1-r),b:e.b*r+t.b*(1-r),a:1}}var ES={r:0,g:0,b:0,a:1};function w7(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:we(t.color)??ES})).sort((t,r)=>t.offset-r.offset)}function a_(e,t){let r=e[0],n=e.at(-1);if(!(r&&n))return ES;if(t<=r.offset)return r.color;if(t>=n.offset)return n.color;for(let o=0;o+1<e.length;o++){let i=e[o],s=e[o+1];if(t>=i.offset&&t<=s.offset){let a=s.offset-i.offset,c=a>0?(t-i.offset)/a:1,u=i.color.a+(s.color.a-i.color.a)*c,l=(f,p)=>{let m=f*i.color.a+(p*s.color.a-f*i.color.a)*c;return u>0?m/u:f+(p-f)*c};return {r:l(i.color.r,s.color.r),g:l(i.color.g,s.color.g),b:l(i.color.b,s.color.b),a:u}}}return n.color}var $S=4,wS=720,S7=2;function AS(e,t,r,n,o){let i=w7(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(b=>Math.abs(b.color.a-s)<.002),c=[...new Set([0,...i.map(b=>b.offset),1])].sort((b,y)=>b-y),u=[];for(let b=0;b+1<c.length;b++){let y=c[b],S=c[b+1];if(S<=y)continue;let C=a_(i,y+1e-9),w=a_(i,S-1e-9),$=Math.max(Math.abs(C.r*C.a-w.r*w.a),Math.abs(C.g*C.a-w.g*w.a),Math.abs(C.b*C.a-w.b*w.a),Math.abs(C.a-w.a)*255),E=Math.ceil($/S7),R=Math.ceil((S-y)*360/$S),P=Math.max(1,E,R);for(let I=0;I<P;I++)u.push([y+(S-y)*I/P,y+(S-y)*(I+1)/P]);}let l=u;if(u.length>wS){let b=Math.ceil(u.length/wS);l=[];for(let y=0;y<u.length;y+=b){let S=u.slice(y,y+b);l.push([S[0][0],S.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*$S/2*(Math.PI/180)),m=b=>{let y=b*Math.PI/180;return [x(r+p*Math.cos(y)),x(n+p*Math.sin(y))]},h=`${x(r)} ${x(n)}`,d=b=>fe((b%360+360)%360,4),g=l.length-1,_=l.map(([b,y],S)=>{let C=a_(i,(b+y)/2),w=(y-b)*360,$=a&&S===0&&g>0?w:0,E=a&&S<g?w:0,R=f+b*360-$,P=f+y*360+E,[I,T]=m(R),[O,B]=m(P);return {d:`M${h}L${I} ${T}L${O} ${B}Z`,color:CS(C),...a||C.a>=1?{}:{opacity:fe(C.a,3)},from:d(R),sweep:fe(P-R,4)}});return a&&s<1?{wedges:_,opacity:fe(s,3)}:{wedges:_}}function SS(e,t,r,n){return (Math.atan2(n-t,r-e)*180/Math.PI%360+360)%360}function vS(e,t,r){if(e>=r.x-1e-6&&e<=r.x+r.width+1e-6&&t>=r.y-1e-6&&t<=r.y+r.height+1e-6)return null;let o=[[r.x,r.y],[r.x+r.width,r.y],[r.x,r.y+r.height],[r.x+r.width,r.y+r.height]],i=SS(e,t,r.x+r.width/2,r.y+r.height/2),s=0,a=0;for(let[c,u]of o){let l=SS(e,t,c,u)-i;l>180?l-=360:l<=-180&&(l+=360),s=Math.min(s,l),a=Math.max(a,l);}return [i+s,i+a]}function RS(e,t){let r=e[1]-e[0],n=t[1]-t[0];if(r>=360||n>=360)return true;let o=((t[0]-e[0])%360+360)%360;return o<=r||o+n>=360}function u_(e,t){return e.slice().map((r,n)=>n<t.y||n>=t.y+t.h?r:r.map((o,i)=>i<t.x||i>=t.x+t.w?o:false))}function IS(e,t=0){let r=[];return e.forEach((n,o)=>{let i=null;n.forEach((s,a)=>{if(!s&&i!==null){r.push(M`M${i+t} ${o+t}h${a-i}v1H${i+t}z`),i=null;return}if(a===n.length-1){if(!s)return;i===null?r.push(M`M${a+t},${o+t} h1v1H${a+t}z`):r.push(M`M${i+t},${o+t} h${a+1-i}v1H${i+t}z`);return}s&&i===null&&(i=a);});}),r.join("")}function C7(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}var E7=.9;function c_(e,t){let{margin:r,pixelSize:n,pattern:o="circle",plain:i=false}=t;if(g$(o))return b$(e,{margin:r,pixelSize:n,pattern:o,scale:t.scale,plain:i});let s=rl(t.scale,o),a=[],c=e.length,u=n*.45,l=i?()=>false:b1(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!C7(h,p,c))){let d=(h+.5+r)*n,g=(p+.5+r)*n,_=`${h}-${p}`,b=a.length;if(l(h,p)){a.push(k("rect",{height:x(n),width:x(n),x:x(d-n/2),y:x(g-n/2)},_));return}switch(o){case "circle":a.push(k("circle",{cx:x(d),cy:x(g),r:x(u),transform:M`rotate(0,${d},${g})`},_));break;case "circle-large":{let y=n*.5;a.push(k("circle",{cx:x(d),cy:x(g),r:x(y),transform:M`rotate(0,${d},${g})`},_));}break;case "small-square":{let y=n*.357143;a.push(k("path",{d:M`M ${d-y} ${g-y}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:M`rotate(0,${d},${g})`},_));}break;case "diamond":{let y=n*.357143;a.push(k("path",{d:M`M ${d-y} ${g-y}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:M`rotate(45,${d},${g})`},_));}break;case "circle-mixed":{let y=(h+p)%3===0?E7:(h+p)%2===0?1:1.25,S=u*y;a.push(k("circle",{cx:x(d),cy:x(g),r:x(S),transform:M`rotate(0,${d},${g})`},_));}break;case "pacman":{let y=n*.5,S=n*.357143;a.push(k("path",{d:M`M ${d-y} ${g-S}v ${n*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${n*.714286}h -${y}v -${n*.714286}z`,transform:M`rotate(${(h+p)%2===0?0:90},${d},${g})`},_));}break;case "rounded":{let y=n*.5,S=n*.2;a.push(k("rect",{height:x(n),rx:x(S),ry:x(S),transform:M`rotate(0,${d},${g})`,width:x(n),x:x(d-y),y:x(g-y)},_));}break;case "square":{let y=n*.5;a.push(k("rect",{height:x(n),transform:M`rotate(0,${d},${g})`,width:x(n),x:x(d-y),y:x(g-y)},_));}break;case "vertical-line":{let y=n*.714286,S=n;a.push(k("path",{d:M`M ${d-n*.5} ${g-y*.5}v ${y}h ${S}v -${y}z`,transform:M`rotate(90,${d},${g})`},_));}break;default:a.push(k("circle",{cx:x(d),cy:x(g),r:x(u),transform:M`rotate(0,${d},${g})`},_));}if(s!==1&&a.length>b){let y=a.pop();a.push(k("g",{transform:M`translate(${d},${g}) scale(${x(s,6)}) translate(${-d},${-g})`,children:y},_));}}});}),a}function A7(e,t){let r=e*Math.PI/180,n=t/2,o=t/2,i=Math.sqrt(t*t+t*t)/2,s=n-i*Math.cos(r),a=o-i*Math.sin(r),c=n+i*Math.cos(r),u=o+i*Math.sin(r);return {x1:s,y1:a,x2:c,y2:u}}function l_(e,t){return `${e}-${Dn(JSON.stringify(t))}`}function v7(e,t,r,n,o){let i=e;if(e===0)switch(o){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let s=i*Math.PI/180,a=t+n/2,c=r+n/2,u=Math.sqrt(n*n+n*n)/2,l=a-u*Math.cos(s),f=c-u*Math.sin(s),p=a+u*Math.cos(s),m=c+u*Math.sin(s);return {x1:l,y1:f,x2:p,y2:m}}function kl(e,t){return t.map((r,n)=>{let{color:o,opacity:i}=Si(r.color);return k("stop",{offset:`${r.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${n}`)})}function MS(e,t,r,n,o,i){let s=AS(t.stops,t.angle??0,r,n,o),a=s.wedges.map((c,u)=>k("path",{d:c.d,"data-arc":`${c.from} ${c.sweep}`,fill:c.color,fillOpacity:c.opacity,shapeRendering:c.opacity===void 0?void 0:"crispEdges"},`${e}-w-${u}`));return k("pattern",{"data-qrdx-conic":`${x(r)} ${x(n)}`,height:x(i),id:e,patternUnits:"userSpaceOnUse",width:x(i),x:0,y:0,children:s.opacity===void 0?a:k("g",{opacity:s.opacity,children:a})},e)}function R7(e="center"){let[t,r]=e.split("-"),n=e==="center"?"center":t,o=r??(t==="left"||t==="right"?t:"center");return {x:o==="left"?0:o==="right"?1:.5,y:n==="top"?0:n==="bottom"?1:.5}}var P7=["xMin","xMid","xMax"],k7=["YMin","YMid","YMax"];function TS(e,t,r){let n=t.scale??1,o=t.fit==="tile",i=o?r/4*n:r,s=t.underlay?Si(t.underlay):null,a=o?i:r*n,c=R7(t.position),u=o?0:c.x*(r-a),l=o?0:c.y*(r-a),f=o?"xMidYMid slice":`${P7[c.x*2]??"xMid"}${k7[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return Be("pattern",{height:x(i),id:e,patternUnits:"userSpaceOnUse",width:x(i),x:0,y:0,children:[s&&k("rect",{fill:s.color,fillOpacity:s.opacity,height:x(i),width:x(i),x:0,y:0}),k("image",{height:x(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:x(a),x:x(u),y:x(l)})]},e)}var OS=(e,t)=>l_("img",[e,t]);function I7(e,t,r,n,o,i,s){let a=it(e);if(a.type==="solid")return null;if(a.type==="image"){let u=OS(a,s);return {id:u,element:TS(u,a,s)}}let c=l_(i,[a,t,r,n,o,...a.type==="angular"?[s]:[]]);if(a.type==="linear"){let u=a,l=u.angle??0,{x1:f,y1:p,x2:m,y2:h}=v7(l,t,r,n,o);return {id:c,element:k("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:x(f),x2:x(m),y1:x(p),y2:x(h),children:kl(c,u.stops)},c)}}if(a.type==="radial"){let u=a,l=t+n/2,f=r+n/2,p=n/2*.97;return {id:c,element:k("radialGradient",{cx:x(l),cy:x(f),fx:x(l),fy:x(f),gradientUnits:"userSpaceOnUse",id:c,r:x(p),children:kl(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:MS(c,a,t+n/2,r+n/2,n*.75,s)}:null}function Rl(e,t,r){let n=it(e);if(n.type==="solid")return null;if(n.type==="image"){let i=OS(n,t);return {id:i,element:TS(i,n,t)}}let o=l_(r,[n,t]);if(n.type==="linear"){let i=n,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=A7(s,t);return {id:o,element:k("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:x(a),x2:x(u),y1:x(c),y2:x(l),children:kl(o,i.stops)},o)}}if(n.type==="radial"){let i=n,s=t/2,a=t/2,c=t/2*.97;return {id:o,element:k("radialGradient",{cx:x(s),cy:x(a),fx:x(s),fy:x(a),gradientUnits:"userSpaceOnUse",id:o,r:x(c),children:kl(o,i.stops)},o)}}return n.type==="angular"?{id:o,element:MS(o,n,t/2,t/2,t*.75,t)}:null}var Pl=e=>sn(e)||Sf(e);function PS(e){let t=new Set,r=[];for(let n of e)n&&!t.has(n.id)&&(t.add(n.id),r.push(n.element));return r}function wr(e,t,r){if(t)return {fill:`url(#${t})`};let n=it(e,r),o=n.type==="solid"?n.color:n.type==="image"?n.underlay??r:r,{color:i,opacity:s}=Si(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function Xr(e,t,r,n){if(n==null)return null;let o=e.length,i=Math.floor(t*ka),s=(o+2*r)/t,a=(n.width||i)*s,c=(n.height||i)*s,u=n.x==null?o/2-a/2:n.x*s,l=n.y==null?o/2-c/2:n.y*s,f=null;if(n.excavate){let p=Math.max(0,n.padding??0)*s,m=Math.floor(u-p),h=Math.floor(l-p),d=Math.ceil(a+u+p-m),g=Math.ceil(c+l+p-h);f={x:m,y:h,w:d,h:g};}return {x:u,y:l,h:c,w:a,excavation:f}}function Je(e){let t=e.level??Vt,{imageSettings:r}=e,n=e.isOGContext&&r?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&r&&n!=="H"){let o=Re.QrCode.encodeText(e.value,Ze[n]).getModules(),i=Xr(o,e.size??ye,Ke(o.length,e.margin??Me,e.shape),r);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>Tf&&(n="H");}return n}function M7(e,t,r,n){let o=t/r,i=e.w*o,s=e.h*o,a=(e.x+n)*o,c=(e.y+n)*o;return {imgWidth:i,imgHeight:s,imgLeft:a,imgTop:c}}function Ei(e){let{value:t,size:r=ye,level:n=Vt,bgColor:o=Pe,fgColor:i=qe,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=Me,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:_,art:b,eyeColors:y,moduleScale:S,autoLevel:C,shape:w,eyeShapes:$,eyeGradient:E,bgRadius:R,backdrop:P,halo:I,shadow:T,frameLabelMarkers:O,partMarkers:B,...z}=e,F=He(an,c),te=He(sr,u),re=He(ar,l),Q=bi({value:t,size:r,margin:f,level:n,shape:w,autoLevel:C,isOGContext:p},m),X=xt(_),ae=X?{}:z,De=K=>X?aa(K,{size:r,frame:_,bgColor:o,svgProps:z,markLabels:O}):K,Ce=Je({value:t,size:r,level:n,margin:f,imageSettings:Q,isOGContext:p,autoLevel:C,shape:w}),U=Re.QrCode.encodeText(t,Ze[Ce]),V=U.getModules(),ue=Ke(V.length,f,w),et=bw(t,V.length,f,w),Ee=(K,ot)=>e_(B,K,ot),Qt=xi(R,V.length,ue,w),or=(K,ot)=>{let jt=F1(w,K);if(!jt){if(Qt>0){let ir=x(Qt*K),Lt=P?Si(P):null;return Be(It,{children:[Lt&&k("rect",{"data-qrdx-look":"backdrop",fill:Lt.color,fillOpacity:Lt.opacity,height:K,width:K,x:0,y:0}),k("rect",{...ot,height:K,rx:ir,ry:ir,width:K,x:0,y:0,...Ee("background")})]})}return k("rect",{...ot,height:K,width:K,x:0,y:0,...Ee("background")})}return "circle"in jt?k("circle",{cx:x(K/2),cy:x(K/2),...ot,r:x(K/2),...Ee("background")}):k("path",{d:jt.path,...ot,...Ee("background")})},nn=V.length+ue*2,H=Xr(V,r,ue,Q),le=null;if(Q!=null&&H!=null){H.excavation!=null&&(V=u_(V,H.excavation));let{imgWidth:K,imgHeight:ot,imgLeft:jt,imgTop:ir}=M7(H,r,nn,ue);if(p){let Lt=Q.shape??"square";le=k("img",{alt:"Logo",src:Q.src,style:{position:"absolute",left:`${x(jt)}px`,top:`${x(ir)}px`,width:`${x(K)}px`,height:`${x(ot)}px`,...Lt!=="square"&&{borderRadius:Lt==="circle"?"50%":`${x(Math.min(K,ot)*_l)}px`},...Q.plate&&{backgroundColor:Q.plate,padding:`${x(K*bl)}px`,boxSizing:"border-box"}}});}else le=yl(Q,{x:jt,y:ir,w:K,h:ot}),B&&(le=On(le,Ee("logo")));}let q=r/nn,Le=V.length,Ae=7*q,nf=1.5*q,nb={fgColor:Ne(i,qe),bgColor:Ne(o,Pe)},Yn=o1(b)?c1({art:b,modules:V,version:U.version,margin:ue,pixelSize:q,...nb,body:K=>c_(K,{margin:ue,pixelSize:q,pattern:F,scale:S})}):null,ob=Yn&&B?On(Yn,Ee("body")):Yn,ib=Yn&&b?f1({art:b,version:U.version,...nb}):null,sb=Yn?null:c_(V,{margin:ue,pixelSize:q,pattern:F,scale:S}),Ra=et?c_(et,{margin:0,pixelSize:q,pattern:F,scale:S,plain:true}):null,Pa=it(o,Pe),of=it(i,qe),ab=Pl(Pa)?Rl(Pa,r,"bg-color"):null,sf=Pl(of)?Rl(of,r,"fg-color"):null,y4=wr(o,ab?.id??null,Pe),cb=wr(i,sf?.id??null,qe),ub=ob?Be(It,{children:[ob,Ra&&k("g",{...cb,...Ee("body"),children:Ra})]}):Be("g",{...cb,...Ee("body"),children:[sb,Ra]}),Kn=ue*q,Jn=ue*q,eo=(Le-7+ue)*q,to=ue*q,ro=ue*q,no=(Le-7+ue)*q,on=Ne(i,qe),oo=K=>y?.[K]?.outer??ib?.[K]?.outer??s,io=K=>y?.[K]?.inner??ib?.[K]?.inner??a,so=(K,ot,jt,ir,Lt)=>{let co=it(K,on);if(!Pl(co))return null;if(E==="code"&&sn(co)){let wf=JSON.stringify(co)===JSON.stringify(of);return Rl(co,r,wf?"fg-color":Lt)}return I7(co,ot,jt,Ae,ir,Lt,r)},af=so(oo("topLeft"),Kn,Jn,"top-left","corners-square-color-0-0"),cf=so(oo("topRight"),eo,to,"top-right","corners-square-color-1-0"),uf=so(oo("bottomLeft"),ro,no,"bottom-left","corners-square-color-0-1"),lf=so(io("topLeft"),Kn,Jn,"top-left","corners-dot-color-0-0"),ff=so(io("topRight"),eo,to,"top-right","corners-dot-color-1-0"),mf=so(io("bottomLeft"),ro,no,"bottom-left","corners-dot-color-0-1"),lb=wr(oo("topLeft"),af?.id??null,on),fb=wr(oo("topRight"),cf?.id??null,on),mb=wr(oo("bottomLeft"),uf?.id??null,on),pb=wr(io("topLeft"),lf?.id??null,on),db=wr(io("topRight"),ff?.id??null,on),hb=wr(io("bottomLeft"),mf?.id??null,on),ao={cornerEyePattern:te,cornerEyeDotPattern:re,eyeShapes:$},pf=gl(Kn,Jn,Ae,tr(ao,"topLeft").outer,"top-left"),df=hl(Kn+Ae/2,Jn+Ae/2,nf,tr(ao,"topLeft").inner,"top-left"),hf=gl(eo,to,Ae,tr(ao,"topRight").outer,"top-right"),gf=hl(eo+Ae/2,to+Ae/2,nf,tr(ao,"topRight").inner,"top-right"),_f=gl(ro,no,Ae,tr(ao,"bottomLeft").outer,"bottom-left"),bf=hl(ro+Ae/2,no+Ae/2,nf,tr(ao,"bottomLeft").inner,"bottom-left"),yf=la(I,{bgColor:o}),Ii=K1(T),gb=K=>Be(It,{children:[Yn?null:sb,Ra,k("path",{d:pf,fillRule:K}),df,k("path",{d:hf,fillRule:K}),gf,k("path",{d:_f,fillRule:K}),bf]}),xf=null;if(yf){let{color:K}=yf;xf=k("g",{"data-qrdx-look":"halo",fill:K,stroke:K,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:x(2*yf.width*q),children:gb("nonzero")});}let $f=null;if(Ii){let{color:K}=Si(Ii.color);$f=k("g",{"data-qrdx-look":"shadow",fill:K,opacity:x(Ii.opacity),transform:M`translate(${Ii.dx*q},${Ii.dy*q})`,children:gb("evenodd")});}let x4=Be(It,{children:[k("defs",{children:PS([ab,sf,af,cf,uf,lf,ff,mf])}),or(r,y4),xf,$f,ub,k("g",{...lb,...Ee("eye-outer","top-left"),children:k("path",{d:pf,fillRule:"evenodd",transform:M`rotate(0,${Kn+Ae/2},${Jn+Ae/2})`})}),k("g",{...pb,...Ee("eye-centre","top-left"),children:df}),k("g",{...fb,...Ee("eye-outer","top-right"),children:k("path",{d:hf,fillRule:"evenodd",transform:M`rotate(0,${eo+Ae/2},${to+Ae/2})`})}),k("g",{...db,...Ee("eye-centre","top-right"),children:gf}),k("g",{...mb,...Ee("eye-outer","bottom-left"),children:k("path",{d:_f,fillRule:"evenodd",transform:M`rotate(0,${ro+Ae/2},${no+Ae/2})`})}),k("g",{...hb,...Ee("eye-centre","bottom-left"),children:bf}),le]}),_b=d||(h?Al(h):void 0);if(_b){let ot=Pl(Pa)?Rl(Pa,300,"bg-color-template"):null,jt=wr(o,ot?.id??null,Pe),ir=Be("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[k("defs",{children:PS([ot,sf,af,cf,uf,lf,ff,mf])}),or(300,jt),Be("g",{transform:`scale(${x(300/r,6)})`,children:[xf,$f,ub,k("g",{...lb,...Ee("eye-outer","top-left"),children:k("path",{d:pf,fillRule:"evenodd",transform:M`rotate(0,${Kn+Ae/2},${Jn+Ae/2})`})}),k("g",{...pb,...Ee("eye-centre","top-left"),children:df}),k("g",{...fb,...Ee("eye-outer","top-right"),children:k("path",{d:hf,fillRule:"evenodd",transform:M`rotate(0,${eo+Ae/2},${to+Ae/2})`})}),k("g",{...db,...Ee("eye-centre","top-right"),children:gf}),k("g",{...mb,...Ee("eye-outer","bottom-left"),children:k("path",{d:_f,fillRule:"evenodd",transform:M`rotate(0,${ro+Ae/2},${no+Ae/2})`})}),k("g",{...hb,...Ee("eye-centre","bottom-left"),children:bf}),le]})]}),Lt=300/r,wf={pixelSize:q*Lt,url:t},bb=_b.wrapper(ir,{fgColor:i,bgColor:o,...g||{},...z},wf),$4={...bb?.props?.style||{},width:void 0,height:void 0,...ae.style};return De(On(bb,{...ae,width:r,height:r,style:$4}))}return De(k("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...ae,children:x4}))}var BL=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),ZL=e=>{let t=e.trim().replace(/^#/,"");t.length===3||t.length===4?t=t.slice(0,3).split("").map(n=>n+n).join(""):t.length===8&&(t=t.slice(0,6));let r=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r?{r:Number.parseInt(r[1],16),g:Number.parseInt(r[2],16),b:Number.parseInt(r[3],16)}:null},Ci=(e,t,r)=>{let[n,o,i]=[e,t,r].map(s=>(s/=255,s<=.03928?s/12.92:((s+.055)/1.055)**2.4));return .2126*n+.7152*o+.0722*i},kS=e=>{let t=we(e);if(!t)return null;let r=n=>n*t.a+255*(1-t.a);return {r:r(t.r),g:r(t.g),b:r(t.b)}},UL=(e,t)=>{let r=kS(e),n=kS(t);if(!(r&&n))return 1;let o=Ci(r.r,r.g,r.b),i=Ci(n.r,n.g,n.b),s=Math.max(o,i),a=Math.min(o,i);return (s+.05)/(a+.05)},GL=e=>e>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:e>=4.5?{level:"AA",warning:false,message:"Good contrast"}:e>=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 T7=256,O7=16384,L7=128;var NS=(e,t)=>{if(!(Number.isInteger(e)&&Number.isInteger(t))||e<1||t<1||e>16384||t>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${e} x ${t}`)},f_=(e,t)=>e>>6*(2-t)&63;function FS(e,t,r){NS(t,r);let n=t*r;if(e.length!==n*4)throw new RangeError(`Expected ${n*4} RGBA bytes for ${t} x ${r}, got ${e.length}`);let o=new Map,i=false,s=false,a=false;for(let _=0;_<n;_++){let b=_*4,y=e[b+3];if(y<128){i=true,s||=y>0;continue}if(s||=y<255,!a){let S=e[b]<<16|e[b+1]<<8|e[b+2];o.has(S)||(o.set(S,o.size),a=o.size>256);}}let c=i?255:256,u=!a&&o.size<=c,l=new Uint8Array(n),f,p,m;if(u){p=[];for(let _ of o.keys())p.push(_>>16&255,_>>8&255,_&255);f=o.size,m=(_,b,y)=>o.get(_<<16|b<<8|y);}else {let _=N7(e,n,c);p=_.palette,f=_.palette.length/3,m=(b,y,S)=>_.bucketIndex[zS(b,y,S)];}let h=i?f:null;for(let _=0;_<n;_++){let b=_*4;e[b+3]<128?l[_]=h:l[_]=m(e[b],e[b+1],e[b+2]);}let d=f+(i?1:0),g=new Uint8Array(d*3);return g.set(p),i&&g.fill(255,f*3),{width:t,height:r,palette:g,indices:l,transparentIndex:h,colors:d,lossless:u&&!s}}var zS=(e,t,r)=>e>>2<<12|t>>2<<6|r>>2;function N7(e,t,r){let n=new Uint32Array(262144),o=new Float64Array(262144),i=new Float64Array(262144),s=new Float64Array(262144);for(let p=0;p<t;p++){let m=p*4;if(e[m+3]<128)continue;let h=e[m],d=e[m+1],g=e[m+2],_=zS(h,d,g);n[_]=n[_]+1,o[_]=o[_]+h,i[_]=i[_]+d,s[_]=s[_]+g;}let a=[];for(let p=0;p<262144;p++)n[p]>0&&a.push(p);let c=[{keys:a,pixels:a.reduce((p,m)=>p+n[m],0)}];for(;c.length<r;){let p=-1;for(let $=0;$<c.length;$++){let E=c[$];E.keys.length>1&&(p===-1||E.pixels>c[p].pixels)&&(p=$);}if(p===-1)break;let m=c[p],h=0,d=-1;for(let $ of [0,1,2]){let E=255,R=0;for(let P of m.keys){let I=f_(P,$);E=Math.min(E,I),R=Math.max(R,I);}R-E>d&&(d=R-E,h=$);}let g=[...m.keys].sort(($,E)=>f_($,h)-f_(E,h)||$-E),_=m.pixels/2,b=0,y=1;for(let $=0;$<g.length-1&&(b+=n[g[$]],y=$+1,!(b>=_));$++);let S=g.slice(0,y),C=g.slice(y),w=$=>$.reduce((E,R)=>E+n[R],0);c.splice(p,1,{keys:S,pixels:w(S)},{keys:C,pixels:w(C)});}let u=[];for(let p of c){let m=0,h=0,d=0;for(let g of p.keys)m+=o[g],h+=i[g],d+=s[g];u.push(Math.round(m/p.pixels),Math.round(h/p.pixels),Math.round(d/p.pixels));}let l=new Uint8Array(262144),f=u.length/3;for(let p of a){let m=n[p],h=o[p]/m,d=i[p]/m,g=s[p]/m,_=0,b=Number.POSITIVE_INFINITY;for(let y=0;y<f;y++){let S=h-u[y*3],C=d-u[y*3+1],w=g-u[y*3+2],$=S*S+C*C+w*w;$<b&&(b=$,_=y);}l[p]=_;}return {palette:u,bucketIndex:l}}var F7=e=>Math.max(1,Math.ceil(Math.log2(e))),Il=class{buffer=new Uint8Array(1024);length=0;push(...t){this.ensure(t.length);for(let r of t)this.buffer[this.length++]=r;}u16(t){this.push(t&255,t>>8&255);}ascii(t){for(let r=0;r<t.length;r++)this.push(t.charCodeAt(r));}bytes(t){this.ensure(t.length),this.buffer.set(t,this.length),this.length+=t.length;}ensure(t){if(this.length+t<=this.buffer.length)return;let r=this.buffer.length;for(;r<this.length+t;)r*=2;let n=new Uint8Array(r);n.set(this.buffer.subarray(0,this.length)),this.buffer=n;}result(){return this.buffer.slice(0,this.length)}};function z7(e,t){let r=new Il,n=1<<t,o=n+1,i=[],s=0,a=0,c=()=>{i.length>0&&(r.push(i.length,...i),i=[]);},u=d=>{i.push(d),i.length===255&&c();},l=(d,g)=>{for(s|=d<<a,a+=g;a>=8;)u(s&255),s>>>=8,a-=8;},f=new Int32Array(1048576),p=t+1,m=o+1;l(n,p);let h=e[0];for(let d=1;d<e.length;d++){let g=e[d],_=h<<8|g,b=f[_];if(b!==0){h=b-1;continue}l(h,p),m===4096?(l(n,p),f=new Int32Array(1048576),m=o+1,p=t+1):(m>=1<<p&&p++,f[_]=m+1,m++),h=g;}return l(h,p),l(o,p),a>0&&u(s&255),c(),r.result()}function DS(e){let{width:t,height:r,palette:n,indices:o,transparentIndex:i}=e;NS(t,r);let s=n.length/3;if(!Number.isInteger(s)||s<1||s>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${n.length} bytes`);if(o.length!==t*r)throw new RangeError(`Expected ${t*r} palette indices for ${t} x ${r}, got ${o.length}`);if(i!==null&&!(Number.isInteger(i)&&i>=0&&i<s))throw new RangeError(`The transparent index ${i} isn't in a palette of ${s} colors`);for(let f=0;f<o.length;f++)if(o[f]>=s)throw new RangeError(`Pixel ${f} points at color ${o[f]}, past the palette of ${s}`);let a=F7(s),c=1<<a,u=Math.max(2,a),l=new Il;return l.ascii("GIF89a"),l.u16(t),l.u16(r),l.push(240|a-1,0,0),l.bytes(n),l.bytes(new Uint8Array((c-s)*3)),i!==null&&l.push(33,249,4,1,0,0,i,0),l.push(44),l.u16(0),l.u16(0),l.u16(t),l.u16(r),l.push(0),l.push(u),l.bytes(z7(o,u)),l.push(0),l.push(59),l.result()}function m_(e,t,r){let n=FS(e,t,r);return {file:DS(n),image:n}}function p_(e){let{palette:t,indices:r,transparentIndex:n}=e,o=new Uint8ClampedArray(r.length*4);for(let i=0;i<r.length;i++){let s=r[i],a=i*4;o[a]=t[s*3],o[a+1]=t[s*3+1],o[a+2]=t[s*3+2],o[a+3]=s===n?0:255;}return o}var LS="GIF89a";function d_(e){if(e.length<32)return false;for(let c=0;c<LS.length;c++)if(e[c]!==LS.charCodeAt(c))return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint16(6,true),n=t.getUint16(8,true),o=e[10];if(r<1||n<1||!(o&128))return false;let i=13+3*(1<<(o&7)+1);if(e.length<i)return false;let s=c=>{let u=c;for(;u<e.length;){let l=e[u];if(u+=1,l===0)return u;u+=l;}return -1},a=0;for(;i<e.length;){let c=e[i];if(c===59)return a===1&&i===e.length-1;if(c===33)i=s(i+2);else if(c===44){if(i+10>e.length||t.getUint16(i+5,true)!==r||t.getUint16(i+7,true)!==n||e[i+9]&128)return false;let u=e[i+10];if(u<2||u>8)return false;a+=1,i=s(i+11);}else return false;if(i===-1)return false}return false}var ga="image/gif",Tl=class extends Error{constructor(t){super(t),this.name="GIFScanError";}},Ml=255;function BS(e){let t=new Uint8ClampedArray(e.length);for(let r=0;r<e.length;r+=4){let n=e[r+3];for(let o=0;o<3;o++)t[r+o]=Math.round((e[r+o]*n+Ml*(Ml-n))/Ml);t[r+3]=Ml;}return t}function ZS(e,t,r){let n=Uint8ClampedArray.from(t.data),o=e(n,t.width,t.height,{inversionAttempts:"dontInvert"});if(!o)return false;if(o.data===r)return true;try{return new TextDecoder().decode(Uint8Array.from(o.binaryData))===r}catch{return false}}async function D7(e,t,r){let{width:n,height:o}=e,i=BS(e.data),s=BS(t.data);if(t.width===n&&t.height===o&&i.every((u,l)=>u===s[l]))return;let a;try{a=(await import('jsqr')).default;}catch{throw new Tl("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(!ZS(a,{data:i,width:n,height:o},r))return;if(!ZS(a,{data:s,width:t.width,height:t.height},r))throw new Tl("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function B7(e,t){let{file:r,image:n}=m_(e.data,e.width,e.height);if(!d_(r))throw new Error("Could not write a GIF file");return t!==void 0&&!n.lossless&&await D7(e,{data:p_(n),width:e.width,height:e.height},t),{file:r,colors:n.colors,lossless:n.lossless}}async function Ol(e,t){let r=e.getContext("2d");if(!r)throw new Error("Could not get canvas context");let{data:n}=r.getImageData(0,0,e.width,e.height),{file:o}=await B7({data:n,width:e.width,height:e.height},t);return new Blob([o],{type:ga})}var Ll=[16,32,48,256],qn="image/vnd.microsoft.icon",Wn=256,h_=64,_a=6,ba=16,Z7=[137,80,78,71,13,10,26,10],U7=16,US=20,G7=32,GS=e=>e.length>=US+4&&Z7.every((t,r)=>e[r]===t),QS=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return {width:t.getUint32(U7),height:t.getUint32(US)}};function g_(e){if(e.length<1||e.length>h_)throw new RangeError(`An ICO holds 1 to ${h_} images, got ${e.length}`);for(let{width:s,height:a,png:c}of e){let u=f=>Number.isInteger(f)&&f>=1&&f<=Wn;if(!(u(s)&&u(a)))throw new RangeError(`ICO images must be whole numbers from 1 to ${Wn} px, got ${s} x ${a}`);if(!GS(c))throw new RangeError("Every ICO image must be a PNG file");let l=QS(c);if(l.width!==s||l.height!==a)throw new RangeError(`An ICO image says ${s} x ${a} but its PNG is ${l.width} x ${l.height}`)}let t=_a+ba*e.length,r=e.reduce((s,a)=>s+a.png.length,0),n=new Uint8Array(t+r),o=new DataView(n.buffer);o.setUint16(0,0,true),o.setUint16(2,1,true),o.setUint16(4,e.length,true);let i=t;return e.forEach(({width:s,height:a,png:c},u)=>{let l=_a+ba*u;n[l]=s===Wn?0:s,n[l+1]=a===Wn?0:a,n[l+2]=0,n[l+3]=0,o.setUint16(l+4,1,true),o.setUint16(l+6,G7,true),o.setUint32(l+8,c.length,true),o.setUint32(l+12,i,true),n.set(c,i),i+=c.length;}),n}function __(e){if(e.length<_a+ba)return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint16(4,true);if(t.getUint16(0,true)!==0||t.getUint16(2,true)!==1||r<1||r>h_||e.length<_a+ba*r)return false;for(let n=0;n<r;n++){let o=_a+ba*n,i=e[o]||Wn,s=e[o+1]||Wn,a=t.getUint32(o+8,true),c=t.getUint32(o+12,true);if(c+a>e.length)return false;let u=e.subarray(c,c+a);if(!GS(u))return false;let l=QS(u);if(l.width!==i||l.height!==s)return false}return true}var jS="data:image/png;base64,";function Q7(e){let t=e.toDataURL("image/png");if(!t.startsWith(jS))throw new Error("This browser can't write a PNG from a canvas");let r=atob(t.slice(jS.length)),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function b_(e){let t=g_(e.map(r=>({width:r.width,height:r.height,png:Q7(r)})));if(!__(t))throw new Error("Could not write an ICO file");return new Blob([t],{type:qn})}function VS(e){return b_([e])}var j7=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"]]),V7=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"]]),H7=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),W7=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"]),q7=new Set(["autoFocus","multiple","muted"]),X7=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),Y7=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(" ")),HS=":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",K7=new RegExp(`^[${HS}][${HS}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Nl=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,J7=/^[\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,eR="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",tR=e=>J7.test(e)?eR:e,qS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),rR=/["'&<>]/;function y_(e){if(!rR.test(e))return e;let t="",r=0;for(let n=0;n<e.length;n++){let o;switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#x27;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}t+=e.slice(r,n)+o,r=n+1;}return t+e.slice(r)}var Sr=e=>typeof e=="function"||typeof e=="symbol",WS=new Map,nR=e=>{let t=WS.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),WS.set(e,t)),t};function oR(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return "";let t="";for(let r of Object.keys(e)){let n=e[r];if(n==null||typeof n=="boolean"||n==="")continue;let o;if(r.startsWith("--"))o=`${r}:${`${n}`.trim()}`;else {let i=typeof n=="number"?n===0||Y7.has(r)?`${n}`:`${n}px`:`${n}`.trim();o=`${nR(r)}:${i}`;}t=t?`${t};${o}`:o;}return t}function Ai(e,t){if(t==null||H7.has(e))return null;let r=V7.get(e);if(r!==void 0)return Sr(t)||typeof t=="boolean"?null:{name:r,value:`${t}`};switch(e){case "style":{let o=oR(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||Sr(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:tR(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||Sr(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return Sr(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return Sr(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(q7.has(e))return t&&!Sr(t)?{name:e.toLowerCase(),value:""}:null;if(X7.has(e))return Sr(t)?null:{name:e,value:`${t}`};if(W7.has(e))return t&&!Sr(t)?{name:e,value:""}:null;if(e.length>2&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N"))return null;let n=j7.get(e)??e;if(!K7.test(n)||Sr(t))return null;if(typeof t=="boolean"){let o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-")return null}return {name:n,value:`${t}`}}var XS="http://www.w3.org/2000/svg",YS="http://www.w3.org/1999/xhtml",iR="http://www.w3.org/1999/xlink",sR="http://www.w3.org/XML/1998/namespace",aR="http://www.w3.org/2000/xmlns/";function cR(e,t,r){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(aR,t,r):t.startsWith("xlink:")?e.setAttributeNS(iR,t,r):t.startsWith("xml:")?e.setAttributeNS(sR,t,r):e.setAttribute(t,r);}function ya(e,t,r,n){if(t==null||typeof t=="boolean")return;if(typeof t=="string"||typeof t=="number"||typeof t=="bigint"){e.appendChild(n.createTextNode(`${t}`));return}if(Array.isArray(t)){for(let c of t)ya(e,c,r,n);return}if(!Ln(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(si(o)){ya(e,i.children,r,n);return}if(typeof o=="function"){ya(e,o(i),r,n);return}if(!Nl.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?XS:r,a=n.createElementNS(s,o);for(let c of Object.keys(i)){let u=Ai(c,i[c]);u&&cR(a,u.name,u.value);}ya(a,i.children,s===XS&&o==="foreignObject"?YS:s,n),e.appendChild(a);}function xa(e,t=document){let r=t.createDocumentFragment();return ya(r,e,YS,t),r}function nr(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return y_(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let r of e)t+=nr(r);return t}if(!Ln(e))throw new TypeError("qrdx: can't render this value as SVG markup");return uR(e)}function uR(e){let{type:t,props:r}=e;if(si(t))return nr(r.children);if(typeof t=="function")return nr(t(r));if(!Nl.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let n=`<${t}`;for(let s of Object.keys(r)){let a=Ai(s,r[s]);a&&(n+=` ${a.name}="${y_(a.value)}"`);}if(qS.has(t))return `${n}/>`;let o=r.dangerouslySetInnerHTML?.__html,i=o==null?nr(r.children):`${o}`;return `${n}>${i}</${t}>`}function x_(e){return nr(Ei(e))}function lR(e,t=document){return xa(Ei(e),t).firstChild}var fR=16384;var $_=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],mR=8,w_=class{buffer;position=0;bits=0;used=0;constructor(t){this.buffer=new Uint8Array(Math.max(t,64));}write(t,r){if(r!==0)for(this.bits|=t<<this.used,this.used+=r;this.used>=8;){if(this.position===this.buffer.length){let n=new Uint8Array(this.buffer.length*2);n.set(this.buffer),this.buffer=n;}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 n5(e,t){let r=new Uint8Array(e.length),n=[];for(let u=0;u<e.length;u++)(e[u]??0)>0&&n.push(u);if(n.length===0)return r;if(n.length===1)return r[n[0]]=1,r;let o=n.length,i=2*o-1,s=new Float64Array(i),a=new Int32Array(i),c=new Uint8Array(i);for(let u=1;;u*=2){for(let d=0;d<o;d++)s[d]=Math.max(e[n[d]]??0,u);let l=Array.from({length:o},(d,g)=>g).sort((d,g)=>s[d]-s[g]||d-g),f=0,p=o,m=d=>f<o&&(p>=d||s[l[f]]<=s[p])?l[f++]:p++;for(let d=o;d<i;d++){let g=m(d),_=m(d);s[d]=s[g]+s[_],a[g]=d,a[_]=d;}c[i-1]=0;let h=0;for(let d=i-2;d>=0;d--){let g=c[a[d]]+1;c[d]=g,d<o&&g>h&&(h=g);}if(h<=t){for(let d=0;d<o;d++)r[n[d]]=c[d];return r}}}function pR(e,t){let r=0;for(let n=0;n<t;n++)r=r<<1|e>>n&1;return r}function o5(e){let t=new Uint16Array(16),r=0;for(let a of e)a>0&&(t[a]=t[a]+1,r++);let n=new Uint16Array(16),o=0;for(let a=1;a<=15;a++)o=o+t[a-1]<<1,n[a]=o;let i=new Uint16Array(e.length),s=new Uint8Array(e.length);return e.forEach((a,c)=>{if(a===0)return;let u=n[a];n[a]=u+1,i[c]=pR(u,a),s[c]=r===1?0:a;}),{lengths:e,codes:i,emitted:s}}function Xn(e,t,r){e.write(t.codes[r],t.emitted[r]);}function dR(e){let t=[],r=i=>t.push({code:i,extra:0,extraBits:0}),n=mR,o=0;for(;o<e.length;){let i=e[o],s=1;for(;o+s<e.length&&e[o+s]===i;)s++;o+=s;let a=s;if(i===0){for(;a>0;)if(a<3)for(;a>0;a--)r(0);else if(a<=10)t.push({code:17,extra:a-3,extraBits:3}),a=0;else {let c=Math.min(a,138);t.push({code:18,extra:c-11,extraBits:7}),a-=c;}continue}for(i!==n&&(r(i),n=i,a--);a>0;)if(a<3)for(;a>0;a--)r(i);else {let c=Math.min(a,6);t.push({code:16,extra:c-3,extraBits:2}),a-=c;}}return t}function hR(e,t){let r=[];if(t.forEach((a,c)=>{a>0&&r.push(c);}),r.length<=2&&r.every(a=>a<256)){let[a=0,c]=r;e.write(1,1),e.write(r.length===2?1:0,1),a<2?(e.write(0,1),e.write(a,1)):(e.write(1,1),e.write(a,8)),c!==void 0&&e.write(c,8);return}let n=dR(t),o=new Uint32Array(19);for(let a of n)o[a.code]=o[a.code]+1;let i=o5(n5(o,7)),s=$_.length;for(;s>4&&i.lengths[$_[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[$_[a]],3);e.write(0,1);for(let a of n)Xn(e,i,a.code),e.write(a.extra,a.extraBits);}function Fl(e){let t=e-1;if(t<4)return {symbol:t,extra:0,extraBits:0};let r=31-Math.clz32(t),n=t>>r-1&1,o=r-1;return {symbol:2*r+n,extra:t&(1<<o)-1,extraBits:o}}function KS(e,t,r,n){let o=0;for(;o<n&&e[t+o]===e[t+o-r];)o++;return o}function JS(e,t,r){let n=e.length,o=0;for(;o<n;){let i=Math.min(4096,n-o),s=o>=1?KS(e,o,1,i):0,a=o>=t?KS(e,o,t,i):0;if(Math.max(s,a)>=3){a>=s?(r.copy(a,t===1?2:1),o+=a):(r.copy(s,2),o+=s);continue}r.literal(e[o]),o++;}}var e5=20;function t5(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n);}function r5(e,t,r){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24&255;}function C_(e,t,r){if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>16384||r>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${t} \xD7 ${r})`);let n=t*r;if(e.length<n*4)throw new RangeError(`Expected ${n*4} bytes of RGBA for ${t} \xD7 ${r}, got ${e.length}`);let o=new Uint32Array(n),i=false;for(let C=0;C<n;C++){let w=C*4,$=e[w],E=e[w+1],R=e[w+2],P=e[w+3];P!==255&&(i=true),o[C]=(P<<24|($-E&255)<<16|E<<8|R-E&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);JS(o,t,{literal(C){s[C>>>8&255]++,a[C>>>16&255]++,c[C&255]++,u[C>>>24]++;},copy(C,w){s[256+Fl(C).symbol]++,l[Fl(w).symbol]++;}});let f=[s,a,c,u,l].map(C=>n5(C,15)),[p,m,h,d,g]=f.map(o5),_=new w_(Math.ceil(n/4)+1024);_.write(47,8),_.write(t-1,14),_.write(r-1,14),_.write(i?1:0,1),_.write(0,3),_.write(1,1),_.write(2,2),_.write(0,1),_.write(0,1),_.write(0,1);for(let C of f)hR(_,C);JS(o,t,{literal(C){Xn(_,p,C>>>8&255),Xn(_,m,C>>>16&255),Xn(_,h,C&255),Xn(_,d,C>>>24);},copy(C,w){let $=Fl(C);Xn(_,p,256+$.symbol),_.write($.extra,$.extraBits);let E=Fl(w);Xn(_,g,E.symbol),_.write(E.extra,E.extraBits);}});let b=_.finish(),y=b.length+(b.length&1),S=new Uint8Array(e5+y);return t5(S,0,"RIFF"),r5(S,4,S.length-8),t5(S,8,"WEBPVP8L"),r5(S,16,b.length),S.set(b,e5),S}function S_(e,t,r){return String.fromCharCode(...e.subarray(t,t+r))}function i5(e){return e.length>=12&&S_(e,0,4)==="RIFF"&&S_(e,8,4)==="WEBP"}function E_(e){if(!i5(e))return null;let t=12;for(;t+8<=e.length;){let r=S_(e,t,4);if(r==="VP8L")return "lossless";if(r==="VP8 ")return "lossy";let n=(e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0;t+=8+n+(n&1);}return null}function gR(e,t,r){return typeof e.toBlob!="function"?Promise.resolve(null):new Promise(n=>{try{e.toBlob(n,t,r);}catch{n(null);}})}async function zl(e,t={}){let r=t.quality!==void 0,n=r?Math.min(1,Math.max(0,Number(t.quality))):1,o=await gR(e,"image/webp",n);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=E_(c);if(u==="lossless"||r&&u==="lossy")return new Blob([c],{type:"image/webp"})}let i=e.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:s}=i.getImageData(0,0,e.width,e.height),a=C_(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var s5=32768;async function $t(e){let t=new Uint8Array(await e.arrayBuffer()),r="";for(let n=0;n<t.length;n+=s5)r+=String.fromCharCode(...t.subarray(n,n+s5));return `data:${e.type||"application/octet-stream"};base64,${btoa(r)}`}async function Ut(e){let t={...e};if(e.imageSettings?.src)try{let l=await _R(e.imageSettings.src);t={...e,imageSettings:{...e.imageSettings,src:l}};}catch{let{imageSettings:l,...f}=e;t=f;}let{hideLogo:r,url:n,logo:o,scale:i,frameLabelMarkers:s,partMarkers:a,...c}=t,u=x_({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var _R=e=>new Promise((t,r)=>{if(e.startsWith("data:")){t(e);return}let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{let o=document.createElement("canvas");o.width=n.naturalWidth||n.width,o.height=n.naturalHeight||n.height;let i=o.getContext("2d");if(!i){r(new Error("Could not get canvas context"));return}i.drawImage(n,0,0);let s=o.toDataURL("image/png");o.remove(),t(s);}catch(o){r(new Error(`Failed to convert image to base64: ${o}`));}},n.onerror=()=>{r(new Error(`Could not load image from ${e.slice(0,100)}... Check CORS settings or use a data URL.`));},n.src=e;});async function Cr(e,t,r){let n=await Ut(e),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),i;try{let s=new TextEncoder().encode(o),a=Array.from(s,u=>String.fromCharCode(u)).join("");i=`data:image/svg+xml;base64,${btoa(a)}`;}catch(s){throw new Error(`Failed to encode SVG for canvas conversion: ${s}`)}return new Promise((s,a)=>{let c=document.createElement("canvas"),u=c.getContext("2d");if(!u){a(new Error("Could not get canvas context"));return}let l=new Image,{width:f,height:p}=yr(e.size||ye,e.frame);c.width=Math.round(f),c.height=Math.round(p);let m=setTimeout(()=>{c.remove(),a(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);l.onload=()=>{clearTimeout(m);try{if(t==="image/jpeg"&&(u.fillStyle="white",u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),r)s(c);else if(t==="image/webp")zl(c).then($t).then(s,a).finally(()=>c.remove());else if(t==="image/bmp")$t(Ju(c)).then(s,a).finally(()=>c.remove());else if(t===ga)Ol(c,e.value).then($t).then(s,a).finally(()=>c.remove());else if(t===qn||t==="image/x-icon")$t(VS(c)).then(s,a).finally(()=>c.remove());else {let h=c.toDataURL(t,1);c.remove(),s(h);}}catch(h){clearTimeout(m),c.remove(),a(new Error(`Failed to draw SVG to canvas: ${h}`));}},l.onerror=()=>{clearTimeout(m),c.remove(),a(new Error("Could not load SVG"));},l.src=i;})}var a5=["gradientUnits","gradientTransform","spreadMethod"],bR={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},yR={r:0,g:0,b:0,a:1};function c5(e,t){for(let r of (e.attrs.style??"").split(";")){let[n,...o]=r.split(":");if(n?.trim()===t)return o.join(":").trim()}return e.attrs[t]}function A_(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function xR(e){let t=[],r=0;for(let n of e.children){if(n.name!=="stop")continue;let o=(n.attrs.offset??"0").trim(),i=Number.parseFloat(o),s=Number.isFinite(i)?o.endsWith("%")?i/100:i:0;r=Math.max(r,Math.min(Math.max(s,0),1));let a=c5(n,"stop-color")??"#000000",c=we(a==="currentColor"?"#000000":a)??yR,u=Number.parseFloat(c5(n,"stop-opacity")??"1");t.push({offset:r,color:Number.isFinite(u)?{...c,a:c.a*Math.min(Math.max(u,0),1)}:c});}return t}function Dl(e){let t=new Map,r=o=>{let i=o.attrs.id;A_(o)&&i&&!t.has(i)&&t.set(i,o);for(let s of o.children)r(s);};r(e);let n=new Map;for(let[o,i]of t){let s=A_(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=A_(l)===s?[...a5,...bR[s]]:a5;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=xR(l));let p=l.attrs.href??l.attrs["xlink:href"];l=p?.startsWith("#")?t.get(p.slice(1)):void 0;}n.set(o,{kind:s,attrs:a,stops:c});}return n}function v_(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(f,p)=>{t=Math.min(t,f),n=Math.max(n,f),r=Math.min(r,p),o=Math.max(o,p);},s=(f,p,m,h)=>{let d=-f+3*p-3*m+h,g=2*(f-2*p+m),_=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-_/g];let b=g*g-4*d*_;if(b<0)return [];let y=Math.sqrt(b);return [(-g+y)/(2*d),(-g-y)/(2*d)]},a=(f,p,m,h,d)=>{let g=1-f;return g*g*g*p+3*g*g*f*m+3*g*f*f*h+f**3*d},c=0,u=0,l=[0,0];for(let f of e)if(f.op==="M"&&(l=[f.x,f.y]),f.op==="M"||f.op==="L")i(f.x,f.y),c=f.x,u=f.y;else if(f.op==="C"){i(f.x,f.y);for(let p of [...s(c,f.x1,f.x2,f.x),...s(u,f.y1,f.y2,f.y)])p>0&&p<1&&i(a(p,c,f.x1,f.x2,f.x),a(p,u,f.y1,f.y2,f.y));c=f.x,u=f.y;}else [c,u]=l;return Number.isFinite(t)?{x:t,y:r,width:n-t,height:o-r}:null}var $R=e=>e[0]*e[3]-e[1]*e[2];function Kr(e){let t=$R(e);if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let[r,n,o,i,s,a]=e;return [i/t,-n/t,-o/t,r/t,(o*a-i*s)/t,(n*s-r*a)/t]}function l5(e,t,r){let{kind:n,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every(w=>w.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=_o;if(!c){let w=v_(t);if(!w||w.width<=0||w.height<=0)return null;u=[w.width,0,0,w.height,w.x,w.y];}let l=ve(u,vt(o.gradientTransform));if(!Kr(l))return a.color;let[f,p]=r,m=Math.sqrt((f*f+p*p)/2),h=(w,$)=>{let E=Number.parseFloat(w);return Number.isFinite(E)?w.trim().endsWith("%")?E/100*(c?$:1):E:null},d=(w,$,E)=>h(o[w]??$,E)??h($,E)??0;if(n==="linear"){let w=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[$,E,R,P]=w;return $===R&&E===P?a.color:{kind:n,coords:w,matrix:l,stops:i}}let g=d("cx","50%",f),_=d("cy","50%",p),b=d("r","50%",m),y=o.fx===void 0?g:d("fx","50%",f),S=o.fy===void 0?_:d("fy","50%",p),C=Math.max(0,d("fr","0%",m));return b<0?null:b===0?a.color:{kind:n,coords:[y,S,C,g,_,b],matrix:l,stops:i}}function Bl(e){return e.map(t=>x(t,6)).join(" ")}function wR(e,t){return (t==="cmyk"?jr(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(n=>x(n,4)).join(" ")}var u5=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function SR(e,t){let r=[],n=e.map(a=>fe(a.offset,4)),o=e.map(a=>wR(a.color,t)),i=n[0],s=n.at(-1);if(i>0){let a=o[0];r.push({from:0,to:i,c0:a,c1:a});}for(let a=0;a+1<e.length;a++){let c=n[a],u=n[a+1];u>c&&r.push({from:c,to:u,c0:o[a],c1:o[a+1]});}if(s<1){let a=o.at(-1);r.push({from:s,to:1,c0:a,c1:a});}if(r.length===1){let[a]=r;return u5(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${r.map(a=>u5(a.c0,a.c1)).join(" ")}]`,`/Bounds [${r.slice(1).map(a=>x(a.from,4)).join(" ")}]`,`/Encode [${r.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Zl(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(r=>x(r,6)).join(" ")}]`,`/Function ${SR(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function CR(e,t){if(e.op==="Z")return e;if(e.op==="C"){let[o,i]=oe(t,e.x1,e.y1),[s,a]=oe(t,e.x2,e.y2),[c,u]=oe(t,e.x,e.y);return {op:"C",x1:o,y1:i,x2:s,y2:a,x:c,y:u}}let[r,n]=oe(t,e.x,e.y);return {op:e.op,x:r,y:n}}function Gl(e){let t={round:1,bevel:2}[e.strokeLinejoin?.trim()??""],r={round:1,square:2}[e.strokeLinecap?.trim()??""];return {join:t??0,cap:r??0}}var f5={r:255,g:255,b:255,a:1},ER=/^url\(\s*#bg-color-/,Ul=/^url\(\s*#([^)\s]+)\s*\)/,AR=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function se(e,t){let r=e.attrs.style;if(r)for(let n of r.split(";")){let[o,...i]=n.split(":");if(o?.trim()===t)return i.join(":").trim()}return e.attrs[t]}function ie(e,t,r=0){if(e===void 0||e==="")return r;let n=Number.parseFloat(e);return Number.isNaN(n)?r:e.trim().endsWith("%")?n/100*t:n}function $a(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let r=e.children.find(o=>o.name==="stop"),n=r&&(se(r,"stop-color")??"#000000");n&&t.set(e.attrs.id,n);}for(let r of e.children)$a(r,t);return t}function wa(e,t){if(e.name==="image"){let r=e.attrs.href??e.attrs["xlink:href"];r&&t.add(r);}for(let r of e.children)wa(r,t);return t}function Ql(e){return /^data:image\/png[;,]/i.test(e)?"PNG":/^data:image\/jpe?g[;,]/i.test(e)?"JPEG":null}async function jl(e){return typeof document>"u"||typeof Image>"u"?null:await new Promise(t=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>{let n=document.createElement("canvas"),o=Math.max(r.naturalWidth||512,r.naturalHeight||512),i=Math.min(1024/o,4);n.width=Math.round((r.naturalWidth||512)*i),n.height=Math.round((r.naturalHeight||512)*i);let s=n.getContext("2d");if(!s){t(null);return}s.drawImage(r,0,0,n.width,n.height);try{t(n.toDataURL("image/png"));}catch{t(null);}},r.onerror=()=>t(null),r.src=e;})}function m5(e,t,r){let n={x:ie(e.attrs.x,t[0]),y:ie(e.attrs.y,t[1]),width:ie(e.attrs.width,t[0]),height:ie(e.attrs.height,t[1])};if(n.width<=0||n.height<=0)return null;let o=(e.attrs.preserveAspectRatio??"").trim();if(!o||o.startsWith("none")||!r||!(r.width>0&&r.height>0))return {draw:n,clip:null};let[i="xMidYMid",s="meet"]=o.split(/\s+/),a=s==="slice",c=(a?Math.max:Math.min)(n.width/r.width,n.height/r.height),u=r.width*c,l=r.height*c,f=p=>{let m=p==="x"?i.slice(0,4):i.slice(4);return m.endsWith("Min")?0:m.endsWith("Max")?1:.5};return {draw:{x:n.x+(n.width-u)*f("x"),y:n.y+(n.height-l)*f("y"),width:u,height:l},clip:a?n:null}}function p5(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)p5(r,t);return t}function d5(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)d5(r,t);return t}function vR(e,t){let[r,n]=t,o=(i,s)=>ie(e.attrs[i],s);switch(e.name){case "path":return ur(e.attrs.d??"");case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;return Xt(o("x",r),o("y",n),o("width",r),o("height",n),ie(i,r),ie(s,n))}case "circle":{let i=o("r",Math.hypot(r,n)/Math.SQRT2);return qt(o("cx",r),o("cy",n),i,i)}case "ellipse":return qt(o("cx",r),o("cy",n),o("rx",r),o("ry",n));default:return []}}var vi=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=f5;paper=f5;background=null;onPaper=false;inConic=false;constructor(t,r=null){this.gradients=t,this.shadings=r;}resolveColor(t){if(!t||t==="none")return null;let r=Ul.exec(t);if(r)return this.resolveColor(this.gradients.get(r[1]));let n=we(t==="currentColor"?"#000000":t);return n&&n.a>0?n:null}shadedGradient(t){let r=t?Ul.exec(t)?.[1]:void 0;return r?this.shadings?.get(r):void 0}resolveFill(t,r,n,o=1){if(o<=0)return null;let i=this.patternOf(t);if(i)return {pattern:i,alpha:o};let s=this.shadedGradient(t);if(s){let u=l5(s,r,n);if(!u)return null;if("coords"in u)return {gradient:u,alpha:o};let l={...u,a:u.a*o};return l.a>0?{color:l}:null}let a=this.resolveColor(t);if(!a)return null;let c={...a,a:a.a*o};return c.a>0?{color:c}:null}patternOf(t){let r=t?Ul.exec(t)?.[1]:void 0,n=r?this.patterns.get(r):void 0;if(!(n?.attrs.patternUnits!=="userSpaceOnUse"||(n.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||n.attrs.viewBox))return n}flatten(t){if(t.a>=1)return t;let r=this.background,n=r!==null&&Math.abs(r.r-t.r)<.5&&Math.abs(r.g-t.g)<.5&&Math.abs(r.b-t.b)<.5&&Math.abs(r.a-t.a)<.002;return vl(t,this.onPaper||n?this.paper:this.backdrop)}paintPattern(t,r,n,o){let i=v_(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=r.viewport,c=ie(n.attrs.x,s),u=ie(n.attrs.y,a),l=ie(n.attrs.width,s),f=ie(n.attrs.height,a);if(!(l>0&&f>0))return true;let p=vt(n.attrs.patternTransform),m=Kr(p);if(!m)return true;if(!this.beginClip(t,r.matrix,r.fillRule==="evenodd"))return false;let h=this.inConic;this.inConic=n.attrs["data-qrdx-conic"]!==void 0;try{let d=[oe(m,i.x,i.y),oe(m,i.x+i.width,i.y),oe(m,i.x,i.y+i.height),oe(m,i.x+i.width,i.y+i.height)],g=d.map(([O])=>O),_=d.map(([,O])=>O),b=Math.min(...g),y=Math.max(...g),S=Math.min(..._),C=Math.max(..._),w=Math.floor((b-c)/l),$=Math.ceil((y-c)/l)-1,E=Math.floor((S-u)/f),R=Math.ceil((C-u)/f)-1,P=($-w+1)*(R-E+1);if(P>4096)return !0;let I=(n.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),T=ve(r.matrix,p);for(let O=E;O<=R;O++)for(let B=w;B<=$;B++){let z=c+B*l,F=u+O*f,te=ve(T,[1,0,0,1,z,F]),re={x:b-z,y:S-F,width:y-b,height:C-S},Q=I.length===2&&I.every(Number.isFinite)?vS(I[0],I[1],re):null,X=P>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:l,y:0},{op:"L",x:l,y:f},{op:"L",x:0,y:f},{op:"Z"}],te,!1);try{let ae={matrix:te,viewport:r.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},De=(Ce,U)=>{for(let V of Ce){if(V.name==="g"&&!V.attrs.transform){let ue=Number.parseFloat(V.attrs.opacity??"1");De(V.children,{...U,opacity:(U.opacity??1)*(Number.isFinite(ue)?ue:1)});continue}if(Q&&V.attrs["data-arc"]){let[ue,et]=V.attrs["data-arc"].split(/\s+/).map(Number);if(!RS([ue,ue+et],Q))continue}this.walk(V,U);}};De(n.children,ae);}finally{X&&this.endClip();}}}finally{this.inConic=h,this.endClip();}return true}paintBleed(t,r,n,o){if(!this.shadedGradient(n))return false;let[i,s]=this.viewportMatrix({...t,attrs:{...t.attrs,x:"0",y:"0"}},{...r,matrix:ve(r.matrix,vt(t.attrs.transform))}),a=Kr(i);if(!a)return false;let[c,u,l,f]=o,m=[[c,u],[l,u],[l,f],[c,f]].map(([h,d])=>oe(a,h,d)).map(([h,d],g)=>({op:g===0?"M":"L",x:h,y:d}));return m.push({op:"Z"}),this.paint(m,{name:"rect",attrs:{},children:[],text:""},{...r,matrix:i,viewport:s,fill:n,fillRule:"nonzero",stroke:"none"}),true}beginClip(t,r,n){return false}endClip(){}clipOf(t,r){let n=se(t,"clip-path"),o=n?Ul.exec(n)?.[1]:void 0,i=o?this.clipPaths.get(o):void 0;if(!i)return null;let s=[],a=false;for(let c of i.children){let u=vR(c,r.viewport);if(u.length===0)continue;let l=vt(c.attrs.transform),f=l[0]===1&&l[1]===0&&l[2]===0&&l[3]===1&&l[4]===0&&l[5]===0;s.push(...f?u:u.map(p=>CR(p,l))),a||=se(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:r.matrix,evenOdd:a}:null}viewportMatrix(t,r){let n=ie(t.attrs.x,r.viewport[0]),o=ie(t.attrs.y,r.viewport[1]),i=ie(t.attrs.width,r.viewport[0],r.viewport[0]),s=ie(t.attrs.height,r.viewport[1],r.viewport[1]),a=Wt(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [ve(r.matrix,[1,0,0,1,n,o]),[i,s]];let[c,u,l,f]=a,p=i/l,m=s/f,h=n,d=o;if((t.attrs.preserveAspectRatio??"").trim()!=="none"){let g=t.attrs.preserveAspectRatio?.includes("slice")?Math.max(p,m):Math.min(p,m);h+=(i-l*g)/2,d+=(s-f*g)/2,p=g,m=g;}return [ve(r.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,r,n=false){if(n&&(this.clipPaths=p5(t,new Map),this.patterns=d5(t,new Map)),AR.has(t.name)||se(t,"display")==="none"||se(t,"visibility")==="hidden")return;let o=ve(r.matrix,vt(t.attrs.transform)),i=r.viewport;if(t.name==="svg"){let[p,m]=this.viewportMatrix(n?{...t,attrs:{...t.attrs,x:"0",y:"0"}}:t,{...r,matrix:o});o=p,i=m;}let s=se(t,"font-size"),a=Number.parseFloat(se(t,"opacity")??"1"),c=se(t,"fill-opacity"),u=c===void 0?r.fillOpacity??1:Number.parseFloat(c),l={fillOpacity:Number.isFinite(u)?Math.min(Math.max(u,0),1):1,opacity:(r.opacity??1)*(Number.isFinite(a)?Math.min(Math.max(a,0),1):1),matrix:o,viewport:i,fill:se(t,"fill")??r.fill,fillRule:se(t,"fill-rule")??r.fillRule,stroke:se(t,"stroke")??r.stroke,strokeWidth:se(t,"stroke-width")===void 0?r.strokeWidth:ie(se(t,"stroke-width"),i[0],1),strokeLinejoin:se(t,"stroke-linejoin")??r.strokeLinejoin,strokeLinecap:se(t,"stroke-linecap")??r.strokeLinecap,fontSize:s===void 0?r.fontSize:ie(s,16,16),fontWeight:se(t,"font-weight")??r.fontWeight,textAnchor:se(t,"text-anchor")??r.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&ER.test(se(t,"fill")??"")&&(this.onPaper=true);try{let p=t.attrs["clip-path"]?this.clipOf(t,l):null;if(p&&this.beginClip(p.segments,p.matrix,p.evenOdd)){try{this.paintNode(t,l);}finally{this.endClip();}return}this.paintNode(t,l);}finally{this.onPaper=f;}}paintNode(t,r){let[n,o]=r.viewport,i=(s,a)=>ie(t.attrs[s],a);switch(t.name){case "path":this.paint(ur(t.attrs.d??""),t,r);return;case "rect":{let s=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;this.paint(Xt(i("x",n),i("y",o),i("width",n),i("height",o),ie(s,n),ie(a,o)),t,r);return}case "circle":{let s=i("r",Math.hypot(n,o)/Math.SQRT2);this.paint(qt(i("cx",n),i("cy",o),s,s),t,r);return}case "ellipse":this.paint(qt(i("cx",n),i("cy",o),i("rx",n),i("ry",o)),t,r);return;case "line":this.paint([{op:"M",x:i("x1",n),y:i("y1",o)},{op:"L",x:i("x2",n),y:i("y2",o)}],t,{...r,fill:"none"});return;case "polygon":case "polyline":{let s=Wt(t.attrs.points),a=[];for(let c=0;c+1<s.length;c+=2)a.push({op:c===0?"M":"L",x:s[c],y:s[c+1]});t.name==="polygon"&&a.length>0&&a.push({op:"Z"}),this.paint(a,t,r);return}case "text":this.text(t,r);return;case "image":this.image(t,r);return;default:for(let s of t.children)this.walk(s,r);}}};var Vl=1e3;async function Sa(e){let t=await Ut(Jr({...e,size:e.size??ye},Vl));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function R_(e){if(xt(e.frame)){let t=Qn(Vl,e.frame);return t.squareEdges?t.color:null}if(e.backdrop&&e.bgRadius){let t=Re.QrCode.encodeText(e.value,Ze[Je(e)]).size,r=Ke(t,e.margin??Me,e.shape);if(xi(e.bgRadius,t,r,e.shape)>0)return Ne(e.backdrop,Pe)}return Ne(e.bgColor,Pe)}function Hl(e,t){let r=R_(e);if(!(r&&sn(e.bgColor))||xt(e.frame)||e.templateId||e.customTemplate)return r;let n=Rr(t)?.children.find(i=>i.name==="rect"),o=n&&se(n,"fill");return o?.startsWith("url(")?o:r}function Wl(e,t){let r={r:255,g:255,b:255,a:1},n=we(Ne(t.bgColor,Pe));e.paper=r,e.background=n&&!sn(t.bgColor)?n:null,e.backdrop=n?vl(n,r):r;}var ql=25.4,h5=5,g5=2e3,Er=Vl,P_=5,_5=2,PR=.25*(ql/72);function kR(e,t="mm"){return t==="in"?e*ql:e}function IR(e){let t=Je(e),r=Re.QrCode.encodeText(e.value,Ze[t]).size;return r+Ke(r,e.margin??Me,e.shape)*2}function Xl(e,t){let r=kR(t.size,t.unit);if(!Number.isFinite(r)||r<h5||r>g5)throw new Error(`Print size must be between ${h5} mm and ${g5/1e3} m`);let n=Math.min(Math.max(t.bleed??0,0),20),o=r/Er,i=xt(e.frame)?Qn(Er,e.frame):null,s=(i?.width??Er)*o,a=(i?.height??Er)*o,c=t.cropMarks?n+_5+P_+1:n,u=IR(e);return {codeWidth:r,trimWidth:s,trimHeight:a,bleed:n,pageWidth:s+2*c,pageHeight:a+2*c,trimX:c,trimY:c,moduleSize:r/u,moduleCount:u,maxScanDistance:r*10}}var k_=class e{pdf;internals;names=new Map;constructor(t,r){this.pdf=t,this.internals=r;}static attach(t){let r=t.internal;return typeof t.advancedAPI!="function"||typeof t.addShadingPattern!="function"||typeof r.write!="function"||typeof r.events?.subscribe!="function"?null:new e(t,r)}name(t){let r=this.names.get(t);return r||(this.names.size===0&&this.install(),r=`Sh${this.names.size}`,this.names.set(t,r)),r}install(){this.pdf.advancedAPI(t=>{t.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[t,r]of this.names)this.internals.write(`/${r} ${t}`);});}},I_=class extends vi{pdf;cmyk;images;shadingResources;constructor(t,r,n,o,i){super(n,o?.gradients??null),this.pdf=t,this.cmyk=r,this.images=i,this.shadingResources=o?.resources??null;}setColor(t,r){let n=t==="fill"?this.pdf.setFillColor.bind(this.pdf):t==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[o,i,s,a]=jr(r.r,r.g,r.b);n(o,i,s,a);}else n(Math.round(r.r),Math.round(r.g),Math.round(r.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(t,r){let n=false;for(let o of t)if(o.op==="M"){let[i,s]=oe(r,o.x,o.y);this.pdf.moveTo(i,s),n=true;}else if(o.op==="L"){let[i,s]=oe(r,o.x,o.y);n?this.pdf.lineTo(i,s):(this.pdf.moveTo(i,s),n=true);}else if(o.op==="C"){let[i,s]=oe(r,o.x1,o.y1),[a,c]=oe(r,o.x2,o.y2),[u,l]=oe(r,o.x,o.y);this.pdf.curveTo(i,s,a,c,u,l);}else n&&this.pdf.close();}shade(t,r,n){let o=this.pdf.internal,i=o.scaleFactor,s=[i,0,0,-i,0,o.pageSize.getHeight()*i],a=ve(s,ve(r.matrix,n.matrix));if(!(this.shadingResources&&Kr(a)))return;let c=this.shadingResources.name(Zl(n,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(t,r.matrix),this.pdf.clip(r.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),o.write(`${Bl(a)} cm /${c} sh`),this.pdf.restoreGraphicsState();}beginClip(t,r,n){return this.pdf.saveGraphicsState(),this.tracePath(t,r),this.pdf.clip(n?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(t,r,n){if(t>=1&&r>=1){n();return}this.pdf.saveGraphicsState();let o=this.pdf.GState;this.pdf.setGState(new o({opacity:t,"stroke-opacity":r}));try{n();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(t,r){let n=t.stops[0]?.color.a??1;return t.stops.every(i=>Math.abs(i.color.a-n)<.002)?{gradient:{...t,stops:t.stops.map(i=>({...i,color:{...i.color,a:1}}))},alpha:n*r}:{gradient:{...t,stops:t.stops.map(i=>({...i,color:this.flatten({...i.color,a:i.color.a*r})}))},alpha:1}}paint(t,r,n){if(t.length===0)return;let o=n.opacity??1;if(o<=0)return;let i=this.resolveFill(n.fill,t,n.viewport,(n.fillOpacity??1)*o);if(i&&"pattern"in i)this.paintPattern(t,n,i.pattern,i.alpha);else if(i&&"gradient"in i){let{gradient:f,alpha:p}=this.opaqueGradient(i.gradient,i.alpha);this.withAlpha(p,1,()=>this.shade(t,n,f));}let s=i&&"color"in i?i.color:null,a=s&&this.inConic?this.flatten(s):s,c=n.strokeWidth>0?this.resolveColor(n.stroke):null,u=c&&{...c,a:c.a*o};if(!(a||u))return;let l=n.fillRule==="evenodd";this.withAlpha(a?.a??1,u?.a??1,()=>{a&&this.setColor("fill",a);let f=u?Gl(n):{join:0,cap:0};u&&(this.setColor("draw",u),this.pdf.setLineWidth(n.strokeWidth*bo(n.matrix)),(f.join||f.cap)&&(this.pdf.setLineJoin(f.join),this.pdf.setLineCap(f.cap))),this.tracePath(t,n.matrix),a&&u?l?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():a?l?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(f.join||f.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=bo(r.matrix),[s,a]=oe(r.matrix,ie(t.attrs.x,r.viewport[0]),ie(t.attrs.y,r.viewport[1])),c=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600;this.pdf.setFont("helvetica",c?"bold":"normal");let u=r.fontSize*i*(72/ql);this.pdf.setFontSize(u);let l=Number.parseFloat(t.attrs["data-max-width"]??"");if(l>0){let m=l*i,h=this.pdf.getTextWidth(n);h>m&&(u*=m/h,this.pdf.setFontSize(u));}this.setColor("text",o);let f=Math.atan2(r.matrix[1],r.matrix[0]);if(Math.abs(f)>2e-4){let m=r.textAnchor==="middle"?this.pdf.getTextWidth(n)/2:r.textAnchor==="end"?this.pdf.getTextWidth(n):0;this.pdf.text(n,s-m*Math.cos(f),a-m*Math.sin(f),{angle:-f*180/Math.PI,baseline:"alphabetic"});return}let p=r.textAnchor==="middle"?"center":r.textAnchor==="end"?"right":"left";this.pdf.text(n,s,a,{align:p,baseline:"alphabetic"});}aliases=new Map;image(t,r){let n=t.attrs.href??t.attrs["xlink:href"],o=n&&(Ql(n)?n:this.images.get(n)),i=o&&Ql(o);if(!(o&&i))return;let s=this.aliases.get(o);s||(s=`qrdx-image-${this.aliases.size}`,this.aliases.set(o,s));let a=null;if(t.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(o);a={width:g.width,height:g.height};}catch{a=null;}let c=m5(t,r.viewport,a);if(!c)return;let{draw:u,clip:l}=c,[f,p]=oe(r.matrix,u.x,u.y),[m,h]=oe(r.matrix,u.x+u.width,u.y+u.height),d=l!==null&&this.beginClip([{op:"M",x:l.x,y:l.y},{op:"L",x:l.x+l.width,y:l.y},{op:"L",x:l.x+l.width,y:l.y+l.height},{op:"L",x:l.x,y:l.y+l.height},{op:"Z"}],r.matrix,false);try{this.withAlpha(r.opacity??1,1,()=>{this.pdf.addImage(o,i,Math.min(f,m),Math.min(p,h),Math.abs(m-f),Math.abs(h-p),s);});}finally{d&&this.endClip();}}};function MR(e,t,r){let{trimX:n,trimY:o,trimWidth:i,trimHeight:s,bleed:a}=r,c=a+_5,u=n,l=n+i,f=o,p=o+s;t.setRegistrationColor(),e.setLineWidth(PR);for(let m of [u,l]){let h=m===u?-1:1;for(let d of [f,p]){let g=d===f?-1:1;e.line(m+h*c,d,m+h*(c+P_),d),e.line(m,d+g*c,m,d+g*(c+P_));}}}async function TR(e,t){return (await b5(e,t)).output("dataurlstring")}async function iF(e,t){return (await b5(e,t)).output("arraybuffer")}async function b5(e,t){let r=Xl(e,t),n;try{({jsPDF:n}=await import('jspdf'));}catch(_){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${_})`)}let o=await Sa(e),i=Rr(o);if(!i)throw new Error("Failed to render the QR code for printing");let s=new Map;for(let _ of wa(i,new Set))if(!Ql(_)){let b=await jl(_);b&&s.set(_,b);}let a=new n({orientation:r.pageWidth>r.pageHeight?"landscape":"portrait",unit:"mm",format:[r.pageWidth,r.pageHeight],compress:true,floatPrecision:3});a.setProperties({title:"QR code",creator:"qrdx"});let c=Dl(i),u=c.size>0?k_.attach(a):null,l=new I_(a,t.colorMode==="cmyk",$a(i,new Map),u?{gradients:c,resources:u}:null,s);Wl(l,e);let f=r.codeWidth/Er,p=ie(i.attrs.width,Er,Er),m=ie(i.attrs.height,Er,Er),h={matrix:ve([1,0,0,1,r.trimX,r.trimY],[f,0,0,f,0,0]),viewport:[p,m],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},d=r.bleed>0?Hl(e,o):null,g=[r.trimX-r.bleed,r.trimY-r.bleed,r.trimX+r.trimWidth+r.bleed,r.trimY+r.trimHeight+r.bleed];if(!(d&&l.paintBleed(i,h,d,g))){let _=d?l.resolveColor(d):null;_&&(l.setColor("fill",_),a.rect(r.trimX-r.bleed,r.trimY-r.bleed,r.trimWidth+2*r.bleed,r.trimHeight+2*r.bleed,"F"));}return l.walk(i,h,true),t.cropMarks&&MR(a,l,r),a}async function OR(e,t){let r=Xl(e,{size:t.size,unit:t.unit}),n=await Sa(e),o=t.unit??"mm",i=c=>`${x(o==="in"?c/ql:c)}${o}`,s=/^<svg\b[^>]*>/.exec(n)?.[0];if(!s)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
63
- ${s.replace(/\swidth="[^"]*"/,` width="${i(r.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${i(r.trimHeight)}"`)}${n.slice(s.length)}`}async function sF(e,t){let r=await TR(e,t);Et(r,t.filename??"qr-code-print.pdf");}async function aF(e,t){let r=await OR(e,t);Et(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r)}`,t.filename??"qr-code-print.svg");}var LR=[137,80,78,71,13,10,26,10];async function x5(e,t){let r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function $5(e){return typeof CompressionStream>"u"?null:await x5(e,new CompressionStream("deflate"))}async function NR(e){if(typeof DecompressionStream>"u")return null;try{return await x5(e,new DecompressionStream("deflate"))}catch{return null}}var M_=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,y5={0:1,2:3,3:1,4:2,6:4};function FR(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),s=Math.abs(n-r);return o<=i&&o<=s?e:i<=s?t:r}async function T_(e){if(LR.some((d,g)=>e[g]!==d))return null;let t=8,r=0,n=0,o=-1,i=null,s=null,a=[];for(;t+8<=e.length;){let d=M_(e,t),g=String.fromCharCode(...e.subarray(t+4,t+8)),_=e.subarray(t+8,t+8+d);if(t+=12+d,g==="IHDR"){r=M_(_,0),n=M_(_,4);let b=_[8];o=_[9];let y=_[12];if(b!==8||y!==0||!(o in y5))return null}else if(g==="PLTE")i=_;else if(g==="tRNS")s=_;else if(g==="IDAT")a.push(_);else if(g==="IEND")break}if(!(r&&n)||r*n>4096*4096)return null;let c=new Uint8Array(a.reduce((d,g)=>d+g.length,0)),u=0;for(let d of a)c.set(d,u),u+=d.length;let l=await NR(c),f=y5[o],p=r*f;if(!l||l.length<n*(p+1))return null;let m=new Uint8Array(n*p);for(let d=0;d<n;d++){let g=l[d*(p+1)],_=l.subarray(d*(p+1)+1,(d+1)*(p+1)),b=d*p;for(let y=0;y<p;y++){let S=y>=f?m[b+y-f]:0,C=d>0?m[b-p+y]:0,w=d>0&&y>=f?m[b-p+y-f]:0,$=_[y],E=0;g===1?E=S:g===2?E=C:g===3?E=S+C>>1:g===4&&(E=FR(S,C,w)),m[b+y]=$+E&255;}}let h=new Uint8Array(r*n*4);for(let d=0;d<r*n;d++){let g=d*4,_=d*f;if(o===3){let b=m[_];h[g]=i?.[b*3]??0,h[g+1]=i?.[b*3+1]??0,h[g+2]=i?.[b*3+2]??0,h[g+3]=s?.[b]??255;}else if(o===0||o===4){let b=m[_];h[g]=b,h[g+1]=b,h[g+2]=b,h[g+3]=o===4?m[_+1]:255;}else h[g]=m[_],h[g+1]=m[_+1],h[g+2]=m[_+2],h[g+3]=o===6?m[_+3]:255;}return {width:r,height:n,data:h}}var zR=25.4,w5=72/zR,DR=50;function BR(e){let t=/^data:[^,]*?(;base64)?,(.*)$/s.exec(e);if(!t)return null;try{let r=t[1]?atob(t[2]):decodeURIComponent(t[2]),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o)&255;return n}catch{return null}}function ZR(e){if(e[0]!==255||e[1]!==216)return null;let t=2;for(;t+9<e.length;){if(e[t]!==255)return null;let r=e[t+1];if(r===216||r>=208&&r<=215){t+=2;continue}let n=e[t+2]<<8|e[t+3];if(r===192||r===193||r===194){let o=e[t+5]<<8|e[t+6],i=e[t+7]<<8|e[t+8],s=e[t+9];return {width:i,height:o,components:s,progressive:r===194}}t+=2+n;}return null}async function UR(e,t){let{width:r,height:n,data:o}=e,i=t?4:3,s=new Uint8Array(r*n*i);for(let c=0;c<r*n;c++){let u=o[c*4+3]/255,l=o[c*4]*u+255*(1-u),f=o[c*4+1]*u+255*(1-u),p=o[c*4+2]*u+255*(1-u);if(t){let[m,h,d,g]=jr(l,f,p);s.set([m*255,h*255,d*255,g*255].map(Math.round),c*i);}else s.set([Math.round(l),Math.round(f),Math.round(p)],c*i);}let a=await $5(s);return {kind:"raw",width:r,height:n,components:i,bytes:a??s,compressed:!!a}}async function GR(e,t){let r=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(r)){let s=await jl(r);if(!s)return null;r=s;}let n=BR(r);if(!n)return null;let o=ZR(n);if(o)return o.components===1||o.components===3?{kind:"jpeg",width:o.width,height:o.height,components:o.components,bytes:n,progressive:o.progressive}:null;let i=await T_(n);return i?await UR(i,t):null}function QR(e){let t="",r=0,n=o=>{t+=o,r+=o.length,r>=76&&(t+=`
64
- `,r=0);};for(let o=0;o<e.length;o+=4){let i=Math.min(4,e.length-o),s=0;for(let c=0;c<4;c++)s=s*256+(c<i?e[o+c]:0);if(s===0&&i===4){n("z");continue}let a=[];for(let c=0;c<5;c++)a.unshift(String.fromCharCode(s%85+33)),s=Math.floor(s/85);n(a.slice(0,i+1).join(""));}return `${t}~>`}var jR=`/qrdxdict 40 dict def
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s);}e.external&&(e.sharedDefsExtractedFor=e.external);}function Py(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;Py(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s);}}delete e.anyOf,e.type=r.length===1?r[0]:r;}var ky=new Set(["type","properties","required","additionalProperties"]),Ey=["oneOf","anyOf"];function Ry(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function kh(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!ky.has(s))return null;t.push(i);}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??Ry(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:kh(a)??{allOf:a};qe(r,s,c);}for(let s of i.required??[])n.add(s);}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===false))o.additionalProperties=false;else {let i=[];for(let s of t){let a=Ry(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a);}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i});}return o}function JC(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of ky)if(o in e)return;let r=t.filter(o=>Ey.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=kh(t);else {let o=r[0],i=Ey.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>kh([...s,c]));if(a.some(c=>!c))return;n={[i]:a};}n&&(delete e.allOf,Cs(e,n));}function Fr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Cs(u,h),Cs(u,l),a._zod.parent===f)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(h.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g];}let p=a._zod.parent;if(p&&p!==f){n(p);let m=e.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let h in u)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(u[h])===JSON.stringify(m.def[h])&&delete u[h];}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]});};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of [...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Py(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of [c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=a.get(l);f?f.push(u):a.set(l,[u]);}for(let c of e.intersections)for(let u of a.get(c)??[])JC(u);}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a);}Cs(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,qe(s,c.defId,c.def));}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:qo(t,"input",e.processors),output:qo(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ct(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return false;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return true;if(n.type==="array")return ct(n.element,r);if(n.type==="set")return ct(n.valueType,r);if(n.type==="lazy")return ct(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return ct(n.innerType,r);if(n.type==="intersection")return ct(n.left,r)||ct(n.right,r);if(n.type==="record"||n.type==="map")return ct(n.keyType,r)||ct(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:ct(n.in,r)||ct(n.out,r);if(n.type==="object"){for(let o in n.shape)if(ct(n.shape[o],r))return true;return false}if(n.type==="union"){for(let o of n.options)if(ct(o,r))return true;return false}if(n.type==="tuple"){for(let o of n.items)if(ct(o,r))return true;return !!(n.rest&&ct(n.rest,r))}return false}var Ih=(e,t={})=>r=>{let n=Lr({...r,processors:t});return he(e,n),Nr(n,e),Fr(n,e)},qo=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Lr({...o??{},target:i,io:t,processors:r});return he(e,s),Nr(s,e),Fr(s,e)};var Xo=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r);},Yo=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r);},Iy=(e,t)=>{Xo(e,"minimum",t),Yo(e,"maximum",t);},Ly=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},Ny=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},Fy=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t];},zy=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},My=(e,t)=>Xo(e,"minimum",t.minimum),Ty=(e,t)=>Yo(e,"maximum",t.maximum),Oy=e=>(t,r)=>{zy(t,r.format);let[n,o]=e[r.format];Xo(t,"minimum",n),Yo(t,"maximum",o);},e8={greater_than:(e,t)=>Xo(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Yo(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ly(e,t.value),number_format:Oy(Hi),bigint_format:Oy(Wi),min_length:My,max_length:Ty,length_equals:(e,t)=>Iy(e,t.length),min_size:My,max_size:Ty,size_equals:(e,t)=>Iy(e,t.size),string_format:(e,t)=>{zy(e,t.format),t.pattern&&Ny(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=true);},mime_type:(e,t)=>Fy(e,t.mime)};function Ue(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)e8[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Xo(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Xo(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Yo(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Yo(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Ly(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&Fy(t,o.mime);for(let i of o.patterns??[])Ny(t,i);return t}var t8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},r8=new Map([[bc,Fm],[fs,zm]]),Dy=e=>r8.get(e)??e,Oh=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Ue(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=t8[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let f=[...c].map(Dy);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))]);}},Lh=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Ue(e);o.type=l?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f?m?(o.minimum=u,o.exclusiveMinimum=true):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?m?(o.maximum=c,o.exclusiveMaximum=true):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let _ of a)Number.isFinite(_)&&_!==0?h.add(Math.abs(_)):Ze(e,t,o,n,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(_=>({multipleOf:_}))]);}},Nh=(e,t,r,n)=>{r.type="boolean";},Fh=(e,t,r,n)=>{Ze(e,t,r,n,"BigInt cannot be represented in JSON Schema");},zh=(e,t,r,n)=>{Ze(e,t,r,n,"Symbols cannot be represented in JSON Schema");},Dh=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},Bh=(e,t,r,n)=>{Ze(e,t,r,n,"Undefined cannot be represented in JSON Schema");},Zh=(e,t,r,n)=>{Ze(e,t,r,n,"Void cannot be represented in JSON Schema");},Uh=(e,t,r,n)=>{r.not={};},Gh=(e,t,r,n)=>{},Qh=(e,t,r,n)=>{},jh=(e,t,r,n)=>{Ze(e,t,r,n,"Date cannot be represented in JSON Schema");},Vh=(e,t,r,n)=>{let o=e._zod.def,i=wo(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i;},Hh=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(Ze(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Ze(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s));}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s;}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i;},Wh=(e,t,r,n)=>{Ze(e,t,r,n,"NaN cannot be represented in JSON Schema");},qh=(e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source;},Xh=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=Ue(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})));},Yh=(e,t,r,n)=>{r.type="boolean";},Kh=(e,t,r,n)=>{Ze(e,t,r,n,"Custom types cannot be represented in JSON Schema");},Jh=(e,t,r,n)=>{Ze(e,t,r,n,"Function types cannot be represented in JSON Schema");},e0=(e,t,r,n)=>{Ze(e,t,r,n,"Transforms cannot be represented in JSON Schema");},t0=(e,t,r,n)=>{Ze(e,t,r,n,"Map cannot be represented in JSON Schema");},r0=(e,t,r,n)=>{Ze(e,t,r,n,"Set cannot be represented in JSON Schema");},n0=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=Ue(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=he(i.element,t,{...n,path:[...n.path,"items"]});};function vs(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?vs(t.out):t.type==="catch"?vs(t.innerType):e._zod.optin}var o0=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Ze(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)qe(o.properties,u,he(s[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?vs(l)===void 0:l._zod.optout===void 0)&&c.push(u);}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=false:i.catchall?i.catchall&&(o.additionalProperties=he(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},pu=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>he(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s;},i0=(e,t,r,n)=>{let o=e._zod.def,i=he(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=he(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c,t.intersections.push(c);},s0=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((d,g)=>he(d,t,{...n,path:[...n.path,s,g]})),u=i.rest?he(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let d=i.items[l-1];if(!(t.io==="input"?vs(d)!==void 0:d._zod.optout==="optional"))break;l--;}let f=i.items.length,p=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,p?o.items=false:u&&(o.items=u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),p&&(o.maxItems=f)):(o.items=c,p?o.additionalItems=false:u&&(o.additionalItems=u),l>0&&(o.minItems=l),p&&(o.maxItems=f));let{minimum:m,maximum:h}=Ue(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function Mh(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let d=Mh(e,h,r);return d===h?t:d}for(let h of ["anyOf","oneOf"]){let d=t[h];if(!Array.isArray(d))continue;let g=d.map(_=>Mh(e,_,r));g.some((_,b)=>_!==d[b])&&(t={...t,[h]:g});}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:f,id:p,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",i||(m.pattern=(n.includes("number")?fr:os).source)),m}var Th=new WeakMap;function n8(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Th.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||r.has(i))continue;let s=Mh(t,i,new Set);s!==i&&r.set(i,s);}if(r.size)for(let n of e.seen.values())for(let o of [n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i);}}var a0=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=Ue(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=he(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)qe(o.patternProperties,Dy(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=he(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Th.get(t);l||(l=[],Th.set(t,l),t.deferred.push(()=>n8(t))),l.push(e);}o.additionalProperties=he(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&vs(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String));}},c0=(e,t,r,n)=>{let o=e._zod.def,i=he(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=true):r.anyOf=[i,{type:"null"}];},u0=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},l0=Symbol();function By(e,t,r,n,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(Ze(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),l0):JSON.parse(s)}var f0=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=By(o.defaultValue,e,t,r,n);s!==l0&&(r.default=s);},m0=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=By(o.defaultValue,e,t,r,n);s!==l0&&(r._prefault=s);},p0=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{Ze(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s;},d0=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;he(s,t,n);let a=t.seen.get(e);a.ref=s;},h0=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=true;},g0=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},du=(e,t,r,n)=>{let o=e._zod.def;he(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},_0=(e,t,r,n)=>{let o=e._zod.innerType;he(o,t,n);let i=t.seen.get(e);i.ref=o;},mu={string:Oh,number:Lh,boolean:Nh,bigint:Fh,symbol:zh,null:Dh,undefined:Bh,void:Zh,never:Uh,any:Gh,unknown:Qh,date:jh,enum:Vh,literal:Hh,nan:Wh,template_literal:qh,file:Xh,success:Yh,custom:Kh,function:Jh,transform:e0,map:t0,set:r0,array:n0,object:o0,union:pu,intersection:i0,tuple:s0,record:a0,nullable:c0,nonoptional:u0,default:f0,prefault:m0,catch:p0,pipe:d0,readonly:h0,promise:g0,optional:du,lazy:_0};function hu(e,t){if("_idmap"in e){let n=e,o=Lr({...t,processors:mu}),i={};for(let c of n._idmap.entries()){let[u,l]=c;he(l,o);}let s={},a={registry:n,uri:t?.uri,defs:i};o.external=a;for(let c of n._idmap.entries()){let[u,l]=c;Nr(o,l),qe(s,u,Fr(o,l));}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i};}return {schemas:s}}let r=Lr({...t,processors:mu});return he(e,r),Nr(r,e),Fr(r,e)}var gu=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t;}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Lr({processors:mu,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}});}process(t,r={path:[],schemaPath:[]}){return he(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Nr(this.ctx,t);let n=Fr(this.ctx,t),{"~standard":o,...i}=n;return i}};var Zy={};var ii={};vr(ii,{ZodAny:()=>D0,ZodArray:()=>G0,ZodBase64:()=>Lu,ZodBase64URL:()=>Nu,ZodBigInt:()=>ni,ZodBigIntFormat:()=>Du,ZodBoolean:()=>ri,ZodCIDRv4:()=>Tu,ZodCIDRv6:()=>Ou,ZodCUID:()=>Au,ZodCUID2:()=>Eu,ZodCatch:()=>lg,ZodCodec:()=>Ls,ZodCreditCard:()=>I0,ZodCustom:()=>Ns,ZodCustomStringFormat:()=>In,ZodDate:()=>Ps,ZodDefault:()=>og,ZodDiscriminatedUnion:()=>j0,ZodE164:()=>Fu,ZodEmail:()=>wu,ZodEmoji:()=>Cu,ZodEnum:()=>Jo,ZodExactOptional:()=>Gu,ZodFile:()=>eg,ZodFunction:()=>xg,ZodGUID:()=>Su,ZodIBAN:()=>M0,ZodIPv4:()=>Iu,ZodIPv6:()=>Mu,ZodISODate:()=>Dr,ZodISODateTime:()=>zr,ZodISODuration:()=>Zr,ZodISOTime:()=>Br,ZodInstanceOf:()=>Sg,ZodIntersection:()=>V0,ZodJWT:()=>zu,ZodKSUID:()=>ku,ZodLazy:()=>_g,ZodLiteral:()=>J0,ZodMAC:()=>k0,ZodMap:()=>Y0,ZodNaN:()=>mg,ZodNanoID:()=>vu,ZodNever:()=>Z0,ZodNonOptional:()=>Qu,ZodNull:()=>F0,ZodNullable:()=>ng,ZodNumber:()=>ti,ZodNumberFormat:()=>Mn,ZodObject:()=>Is,ZodOptional:()=>Ts,ZodPipe:()=>Os,ZodPrefault:()=>sg,ZodPreprocess:()=>pg,ZodPromise:()=>yg,ZodReadonly:()=>dg,ZodRecord:()=>Ko,ZodSet:()=>K0,ZodString:()=>ei,ZodStringFormat:()=>_e,ZodSuccess:()=>ug,ZodSymbol:()=>L0,ZodTemplateLiteral:()=>gg,ZodTransform:()=>tg,ZodTuple:()=>W0,ZodType:()=>q,ZodULID:()=>Ru,ZodURL:()=>Rs,ZodUUID:()=>Jt,ZodUndefined:()=>N0,ZodUnion:()=>Ms,ZodUnknown:()=>B0,ZodVoid:()=>U0,ZodXID:()=>Pu,ZodXor:()=>Q0,_ZodString:()=>$u,_default:()=>ig,_function:()=>ex,any:()=>I2,array:()=>ks,base64:()=>f2,base64url:()=>m2,bigint:()=>A2,boolean:()=>O0,catch:()=>fg,check:()=>tx,cidrv4:()=>u2,cidrv6:()=>l2,codec:()=>X2,creditCard:()=>d2,cuid:()=>t2,cuid2:()=>r2,currencyCode:()=>x2,custom:()=>rx,date:()=>T2,describe:()=>nx,discriminatedUnion:()=>D2,e164:()=>p2,email:()=>jy,emoji:()=>Jy,enum:()=>Zu,exactOptional:()=>rg,file:()=>V2,float32:()=>w2,float64:()=>S2,function:()=>ex,guid:()=>Vy,hash:()=>$2,hex:()=>y2,hostname:()=>b2,httpUrl:()=>Ky,iban:()=>h2,instanceof:()=>ix,int:()=>yu,int32:()=>C2,int64:()=>E2,intersection:()=>H0,invertCodec:()=>Y2,ipv4:()=>s2,ipv6:()=>c2,json:()=>ax,jwt:()=>g2,keyof:()=>O2,ksuid:()=>i2,lazy:()=>bg,literal:()=>j2,looseObject:()=>F2,looseRecord:()=>Z2,mac:()=>a2,map:()=>U2,meta:()=>ox,nan:()=>q2,nanoid:()=>e2,nativeEnum:()=>Q2,never:()=>Bu,nonoptional:()=>cg,null:()=>z0,nullable:()=>Es,nullish:()=>H2,number:()=>T0,object:()=>L2,optional:()=>Pn,partialRecord:()=>B2,pipe:()=>xu,prefault:()=>ag,preprocess:()=>cx,promise:()=>J2,readonly:()=>hg,record:()=>X0,refine:()=>$g,set:()=>G2,strictObject:()=>N2,string:()=>As,stringFormat:()=>_2,stringbool:()=>sx,success:()=>W2,superRefine:()=>wg,symbol:()=>P2,templateLiteral:()=>K2,transform:()=>Uu,tuple:()=>q0,uint32:()=>v2,uint64:()=>R2,ulid:()=>n2,undefined:()=>k2,union:()=>oi,unknown:()=>Rn,url:()=>Yy,uuid:()=>Hy,uuidv4:()=>Wy,uuidv6:()=>qy,uuidv7:()=>Xy,void:()=>M2,xid:()=>o2,xor:()=>z2});var i8=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case "invalid_type":{let s=o(i.expected),a=um(i.input),c=o(a,i.input);return `Invalid input: expected ${s}, received ${c}`}case "invalid_value":return i.values.length===1?`Invalid input: expected ${Ga(i.values[0])}`:`Invalid option: expected one of ${Ba(i.values,"|")}`;case "too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case "too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case "invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??i.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${i.divisor}`;case "unrecognized_keys":return `Unrecognized key${i.keys.length>1?"s":""}: ${Ba(i.keys,", ")}`;case "invalid_key":return `Invalid key in ${i.origin}`;case "invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===false?"Invalid input: more than one option matched":"Invalid input";case "invalid_element":return `Invalid value in ${i.origin}`;default:return "Invalid input"}}};function Uy(){return {localeError:i8()}}var _u={};vr(_u,{endsWith:()=>Zo,gt:()=>Yt,gte:()=>St,includes:()=>Do,length:()=>An,lowercase:()=>Fo,lt:()=>Xt,lte:()=>wt,maxLength:()=>vn,maxSize:()=>Or,mime:()=>Go,minLength:()=>mr,minSize:()=>Kt,multipleOf:()=>Tr,negative:()=>cu,nonnegative:()=>lu,nonpositive:()=>uu,normalize:()=>Qo,overwrite:()=>Dt,positive:()=>au,properties:()=>Uo,property:()=>fu,regex:()=>No,size:()=>Cn,slugify:()=>Wo,startsWith:()=>Bo,toLowerCase:()=>Vo,toUpperCase:()=>Ho,trim:()=>jo,uppercase:()=>zo});var Gy=new WeakSet([Object.prototype,Error.prototype]);function bu(e,t,r){Object.defineProperty(e,t,{configurable:true,enumerable:false,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:true,writable:true}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:true,writable:true});}});}var Qy=(e,t)=>{_m.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Gy.has(r)||(Gy.add(r),bu(r,"format",n=>o=>es(n,o)),bu(r,"flatten",n=>o=>Ji(n,o)),bu(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,So,2);}),bu(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,So,2);}),Object.defineProperty(r,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},s8=E("ZodError",Qy),bt=E("ZodError",Qy,void 0,{Parent:Error});var b0=Ro(bt),y0=Po(bt),x0=ko(bt),$0=Io(bt),w0=qa(bt),S0=Xa(bt),C0=Ya(bt),v0=Ka(bt),A0=Ja(bt),E0=ec(bt),R0=tc(bt),P0=rc(bt);function c8(){He.localeError||Oe(Uy());}function kn(){He.memoizer||Oe({memoizer:bs()});}var q=E("ZodType",(e,t)=>(c8(),V.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(z.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:true})},with(...e){return this.check(...e)},clone(e,t){return pe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($g(e,t))},superRefine(e,t){return this.check(wg(e,t))},overwrite(e){return this.check(Dt(e))},optional(){return Pn(this)},exactOptional(){return rg(this)},nullable(){return Es(this)},nullish(){return Pn(Es(this))},nonoptional(e){return cg(this,e)},array(){return ks(this)},or(e){return oi([this,e])},and(e){return H0(this,e)},transform(e){return xu(this,Uu(e))},default(e){return ig(this,e)},prefault(e){return ag(this,e)},catch(e){return fg(this,e)},pipe(e){return xu(this,e)},readonly(){return hg(this)},describe(e){let t=this.clone();return Xe.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xe.get(this);let t=this.clone();return Xe.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return z.hide(this,"~standard",{...pc(this),jsonSchema:{input:qo(this,"input"),output:qo(this,"output")}})},set"~standard"(e){z.own(this,"~standard",e);},parse:function e(t,r){return b0(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await y0(this,t,r,{callee:e})},safeParse(e,t){return x0(this,e,t)},async safeParseAsync(e,t){return $0(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){z.own(this,"spa",e);},validate(e,t){return ts(this,e,t)},validateAsync(e,t){return rs(this,e,t)},encode:function e(t,r){return w0(this,t,r,{callee:e})},decode:function e(t,r){return S0(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await C0(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await v0(this,t,r,{callee:e})},safeEncode(e,t){return A0(this,e,t)},safeDecode(e,t){return E0(this,e,t)},async safeEncodeAsync(e,t){return R0(this,e,t)},async safeDecodeAsync(e,t){return P0(this,e,t)},toJSONSchema(e){return Ih(this,{})(e)},get description(){return Xe.get(this)?.description},get _def(){return this._zod.def}}),$u=E("_ZodString",(e,t)=>{xn.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Oh(e,r,n);},z.derived({format:e=>Ue(e).format??null,minLength:e=>Ue(e).minimum??null,maxLength:e=>Ue(e).maximum??null},{regex(...e){return this.check(No(...e))},includes(...e){return this.check(Do(...e))},startsWith(...e){return this.check(Bo(...e))},endsWith(...e){return this.check(Zo(...e))},min(...e){return this.check(mr(...e))},max(...e){return this.check(vn(...e))},length(...e){return this.check(An(...e))},nonempty(...e){return this.check(mr(1,...e))},lowercase(e){return this.check(Fo(e))},uppercase(e){return this.check(zo(e))},trim(){return this.check(jo())},normalize(...e){return this.check(Qo(...e))},toLowerCase(){return this.check(Vo())},toUpperCase(){return this.check(Ho())},slugify(){return this.check(Wo())}})),ei=E("ZodString",(e,t)=>{xn.init(e,t),$u.init(e,t);},{email(e){return this.check(Bc(wu,e))},url(e){return this.check(ys(Rs,e))},jwt(e){return this.check(su(zu,e))},emoji(e){return this.check(Vc(Cu,e))},guid(e){return this.check(Zc(Su,e))},uuid(e){return this.check(Uc(Jt,e))},uuidv4(e){return this.check(Gc(Jt,e))},uuidv6(e){return this.check(Qc(Jt,e))},uuidv7(e){return this.check(jc(Jt,e))},nanoid(e){return this.check(Hc(vu,e))},cuid(e){return this.check(Wc(Au,e))},cuid2(e){return this.check(qc(Eu,e))},ulid(e){return this.check(Xc(Ru,e))},base64(e){return this.check(nu(Lu,e))},base64url(e){return this.check(ou(Nu,e))},xid(e){return this.check(Yc(Pu,e))},ksuid(e){return this.check(Kc(ku,e))},ipv4(e){return this.check(Jc(Iu,e))},ipv6(e){return this.check(eu(Mu,e))},cidrv4(e){return this.check(tu(Tu,e))},cidrv6(e){return this.check(ru(Ou,e))},e164(e){return this.check(iu(Fu,e))},datetime(e){return this.check(xs(zr,e))},date(e){return this.check($s(Dr,e))},time(e){return this.check(ws(Br,e))},duration(e){return this.check(Ss(Zr,e))}});function As(e){return Hd(ei,e)}var _e=E("ZodStringFormat",(e,t)=>{de.init(e,t),$u.init(e,t);}),zr=E("ZodISODateTime",(e,t)=>{Fp.init(e,t),_e.init(e,t);}),Dr=E("ZodISODate",(e,t)=>{zp.init(e,t),_e.init(e,t);}),Br=E("ZodISOTime",(e,t)=>{Dp.init(e,t),_e.init(e,t);}),Zr=E("ZodISODuration",(e,t)=>{Bp.init(e,t),_e.init(e,t);}),wu=E("ZodEmail",(e,t)=>{Ap.init(e,t),_e.init(e,t);});function jy(e){return Bc(wu,e)}var Su=E("ZodGUID",(e,t)=>{Cp.init(e,t),_e.init(e,t);});function Vy(e){return Zc(Su,e)}var Jt=E("ZodUUID",(e,t)=>{vp.init(e,t),_e.init(e,t);});function Hy(e){return Uc(Jt,e)}function Wy(e){return Gc(Jt,e)}function qy(e){return Qc(Jt,e)}function Xy(e){return jc(Jt,e)}var Rs=E("ZodURL",(e,t)=>{Pp.init(e,t),_e.init(e,t);});function Yy(e){return ys(Rs,e)}function Ky(e){return ys(Rs,{protocol:ns,hostname:Bm,...z.normalizeParams(e)})}var Cu=E("ZodEmoji",(e,t)=>{kp.init(e,t),_e.init(e,t);});function Jy(e){return Vc(Cu,e)}var vu=E("ZodNanoID",(e,t)=>{Ip.init(e,t),_e.init(e,t);});function e2(e){return Hc(vu,e)}var Au=E("ZodCUID",(e,t)=>{Mp.init(e,t),_e.init(e,t);});function t2(e){return Wc(Au,e)}var Eu=E("ZodCUID2",(e,t)=>{Tp.init(e,t),_e.init(e,t);});function r2(e){return qc(Eu,e)}var Ru=E("ZodULID",(e,t)=>{Op.init(e,t),_e.init(e,t);});function n2(e){return Xc(Ru,e)}var Pu=E("ZodXID",(e,t)=>{Lp.init(e,t),_e.init(e,t);});function o2(e){return Yc(Pu,e)}var ku=E("ZodKSUID",(e,t)=>{Np.init(e,t),_e.init(e,t);});function i2(e){return Kc(ku,e)}var Iu=E("ZodIPv4",(e,t)=>{Zp.init(e,t),_e.init(e,t);});function s2(e){return Jc(Iu,e)}var k0=E("ZodMAC",(e,t)=>{Gp.init(e,t),_e.init(e,t);});function a2(e){return qd(k0,e)}var Mu=E("ZodIPv6",(e,t)=>{Up.init(e,t),_e.init(e,t);});function c2(e){return eu(Mu,e)}var Tu=E("ZodCIDRv4",(e,t)=>{Qp.init(e,t),_e.init(e,t);});function u2(e){return tu(Tu,e)}var Ou=E("ZodCIDRv6",(e,t)=>{jp.init(e,t),_e.init(e,t);});function l2(e){return ru(Ou,e)}var Lu=E("ZodBase64",(e,t)=>{Vp.init(e,t),_e.init(e,t);});function f2(e){return nu(Lu,e)}var Nu=E("ZodBase64URL",(e,t)=>{Hp.init(e,t),_e.init(e,t);});function m2(e){return ou(Nu,e)}var Fu=E("ZodE164",(e,t)=>{Wp.init(e,t),_e.init(e,t);});function p2(e){return iu(Fu,e)}var I0=E("ZodCreditCard",(e,t)=>{qp.init(e,t),_e.init(e,t);});function d2(e){return Xd(I0,e)}var M0=E("ZodIBAN",(e,t)=>{Xp.init(e,t),_e.init(e,t);});function h2(e){return Yd(M0,e)}var zu=E("ZodJWT",(e,t)=>{Yp.init(e,t),_e.init(e,t);});function g2(e){return su(zu,e)}var In=E("ZodCustomStringFormat",(e,t)=>{Kp.init(e,t),_e.init(e,t);});function _2(e,t,r={}){return En(In,e,t,r)}function b2(e){return En(In,"hostname",Dm,e)}function y2(e){return En(In,"hex",ep,e)}function x2(e){return En(In,"currency_code",Um,e)}function $2(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=kt[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return En(In,n,o,t)}var ti=E("ZodNumber",(e,t)=>{Sc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lh(e,r,n,o),e.isFinite=true;},z.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=Ue(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=Ue(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=Ue(e);return !!t||!!r?.some(Number.isSafeInteger)},format:e=>Ue(e).format??null},{gt(e,t){return this.check(Yt(e,t))},gte(e,t){return this.check(St(e,t))},min(e,t){return this.check(St(e,t))},lt(e,t){return this.check(Xt(e,t))},lte(e,t){return this.check(wt(e,t))},max(e,t){return this.check(wt(e,t))},int(e){return this.check(yu(e))},safe(e){return this.check(yu(e))},positive(e){return this.check(Yt(0,e))},nonnegative(e){return this.check(St(0,e))},negative(e){return this.check(Xt(0,e))},nonpositive(e){return this.check(wt(0,e))},multipleOf(e,t){return this.check(Tr(e,t))},step(e,t){return this.check(Tr(e,t))},finite(){return this}}));function T0(e){return Jd(ti,e)}var Mn=E("ZodNumberFormat",(e,t)=>{Jp.init(e,t),ti.init(e,t);});function yu(e){return th(Mn,e)}function w2(e){return rh(Mn,e)}function S2(e){return nh(Mn,e)}function C2(e){return oh(Mn,e)}function v2(e){return ih(Mn,e)}var ri=E("ZodBoolean",(e,t)=>{ms.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nh(e,r,n);});function O0(e){return sh(ri,e)}var ni=E("ZodBigInt",(e,t)=>{Cc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fh(e,r,n,o);},z.derived({minValue:e=>Ue(e).minimum??null,maxValue:e=>Ue(e).maximum??null,format:e=>Ue(e).format??null},{gte(e,t){return this.check(St(e,t))},min(e,t){return this.check(St(e,t))},gt(e,t){return this.check(Yt(e,t))},lt(e,t){return this.check(Xt(e,t))},lte(e,t){return this.check(wt(e,t))},max(e,t){return this.check(wt(e,t))},positive(e){return this.check(Yt(BigInt(0),e))},negative(e){return this.check(Xt(BigInt(0),e))},nonpositive(e){return this.check(wt(BigInt(0),e))},nonnegative(e){return this.check(St(BigInt(0),e))},multipleOf(e,t){return this.check(Tr(e,t))}}));function A2(e){return ch(ni,e)}var Du=E("ZodBigIntFormat",(e,t)=>{ed.init(e,t),ni.init(e,t);});function E2(e){return lh(Du,e)}function R2(e){return fh(Du,e)}var L0=E("ZodSymbol",(e,t)=>{td.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zh(e,r,n,o);});function P2(e){return mh(L0,e)}var N0=E("ZodUndefined",(e,t)=>{rd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bh(e,r,n,o);});function k2(e){return ph(N0,e)}var F0=E("ZodNull",(e,t)=>{nd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dh(e,r,n);});function z0(e){return dh(F0,e)}var D0=E("ZodAny",(e,t)=>{od.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gh();});function I2(){return hh(D0)}var B0=E("ZodUnknown",(e,t)=>{id.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qh();});function Rn(){return gh(B0)}var Z0=E("ZodNever",(e,t)=>{sd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uh(e,r,n);});function Bu(e){return _h(Z0,e)}var U0=E("ZodVoid",(e,t)=>{ad.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zh(e,r,n,o);});function M2(e){return bh(U0,e)}var Ps=E("ZodDate",(e,t)=>{cd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jh(e,r,n,o),e.min=(r,n)=>e.check(St(r,n)),e.max=(r,n)=>e.check(wt(r,n));},z.derived({minDate:e=>{let{minimum:t}=Ue(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Ue(e);return t?new Date(t):null}},{}));function T2(e){return yh(Ps,e)}var G0=E("ZodArray",(e,t)=>{kn(),ld.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>n0(e,r,n,o),e.element=t.element;},{min(e,t){return this.check(mr(e,t))},nonempty(e){return this.check(mr(1,e))},max(e,t){return this.check(vn(e,t))},length(e,t){return this.check(An(e,t))},unwrap(){return this.element}});function ks(e,t){return wh(G0,e,t)}function O2(e){let t=e._zod.def.shape;return Zu(Object.keys(t))}var Is=E("ZodObject",(e,t)=>{kn(),fd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>o0(e,r,n,o),z.installLazyProp(e,"shape",r=>r._zod.def.shape,false);},{keyof(){return Zu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(z.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(z.mergeDefs(this._zod.def,{catchall:Rn()}))},loose(){return this.clone(z.mergeDefs(this._zod.def,{catchall:Rn()}))},strict(){return this.clone(z.mergeDefs(this._zod.def,{catchall:Bu()}))},strip(){return this.clone(z.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return z.extend(this,e)},safeExtend(e){return z.safeExtend(this,e)},merge(e){return z.merge(this,e)},pick(e){return z.pick(this,e)},omit(e){return z.omit(this,e)},partial(...e){return z.partial(Ts,this,e[0])},exactPartial(...e){return z.partial(Gu,this,e[0],"exactPartial")},required(...e){return z.required(Qu,this,e[0])}});function L2(e,t){let r={type:"object",shape:e??{},...z.normalizeParams(t)};return new Is(r)}function N2(e,t){return new Is({type:"object",shape:e,catchall:Bu(),...z.normalizeParams(t)})}function F2(e,t){return new Is({type:"object",shape:e,catchall:Rn(),...z.normalizeParams(t)})}var Ms=E("ZodUnion",(e,t)=>{ps.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pu(e,r,n,o),e.options=t.options;});function oi(e,t){return new Ms({type:"union",options:e,...z.normalizeParams(t)})}var Q0=E("ZodXor",(e,t)=>{Ms.init(e,t),md.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pu(e,r,n,o),e.options=t.options;});function z2(e,t){return new Q0({type:"union",options:e,inclusive:false,...z.normalizeParams(t)})}var j0=E("ZodDiscriminatedUnion",(e,t)=>{Ms.init(e,t),dd.init(e,t);});function D2(e,t,r){return new j0({type:"union",options:t,discriminator:e,...z.normalizeParams(r)})}var V0=E("ZodIntersection",(e,t)=>{hd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>i0(e,r,n,o);});function H0(e,t){return new V0({type:"intersection",left:e,right:t})}var W0=E("ZodTuple",(e,t)=>{kn(),vc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>s0(e,r,n,o);},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Ts({type:"optional",innerType:t}))})}});function q0(e,t,r){let n=t instanceof V,o=n?r:t,i=n?t:null;return new W0({type:"tuple",items:e,rest:i,...z.normalizeParams(o)})}var Ko=E("ZodRecord",(e,t)=>{kn(),gd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>a0(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType;});function X0(e,t,r){return !t||!t._zod?new Ko({type:"record",keyType:As(),valueType:e,...z.normalizeParams(t)}):new Ko({type:"record",keyType:e,valueType:t,...z.normalizeParams(r)})}function B2(e,t,r){return new Ko({type:"record",keyType:e,valueType:t,...z.normalizeParams(r),partial:true})}function Z2(e,t,r){return new Ko({type:"record",keyType:e,valueType:t,mode:"loose",...z.normalizeParams(r)})}var Y0=E("ZodMap",(e,t)=>{kn(),_d.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>t0(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Kt(...r)),e.nonempty=r=>e.check(Kt(1,r)),e.max=(...r)=>e.check(Or(...r)),e.size=(...r)=>e.check(Cn(...r));});function U2(e,t,r){return new Y0({type:"map",keyType:e,valueType:t,...z.normalizeParams(r)})}var K0=E("ZodSet",(e,t)=>{kn(),bd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>r0(e,r,n,o),e.min=(...r)=>e.check(Kt(...r)),e.nonempty=r=>e.check(Kt(1,r)),e.max=(...r)=>e.check(Or(...r)),e.size=(...r)=>e.check(Cn(...r));});function G2(e,t){return new K0({type:"set",valueType:e,...z.normalizeParams(t)})}var Jo=E("ZodEnum",(e,t)=>{yd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Vh(e,n,o),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Jo({...t,checks:[],...z.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Jo({...t,checks:[],...z.normalizeParams(o),entries:i})};});function Zu(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Jo({type:"enum",entries:r,...z.normalizeParams(t)})}function Q2(e,t){return new Jo({type:"enum",entries:e,...z.normalizeParams(t)})}var J0=E("ZodLiteral",(e,t)=>{xd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hh(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}});});function j2(e,t){return new J0({type:"literal",values:Array.isArray(e)?e:[e],...z.normalizeParams(t)})}var eg=E("ZodFile",(e,t)=>{$d.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xh(e,r,n),e.min=(r,n)=>e.check(Kt(r,n)),e.max=(r,n)=>e.check(Or(r,n)),e.mime=(r,n)=>e.check(Go(Array.isArray(r)?r:[r],n));});function V2(e){return Sh(eg,e)}var tg=E("ZodTransform",(e,t)=>{kn(),wd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>e0(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ir(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(z.issue(i,r.value,t));else {let s=i;s.fatal&&(s.continue=false),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(z.issue(s));}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)};});function Uu(e){return new tg({type:"transform",transform:e})}var Ts=E("ZodOptional",(e,t)=>{Ac.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>du(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Pn(e){return new Ts({type:"optional",innerType:e})}var Gu=E("ZodExactOptional",(e,t)=>{Sd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>du(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function rg(e){return new Gu({type:"optional",innerType:e})}var ng=E("ZodNullable",(e,t)=>{Cd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>c0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Es(e){return new ng({type:"nullable",innerType:e})}function H2(e){return Pn(Es(e))}var og=E("ZodDefault",(e,t)=>{vd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>f0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function ig(e,t){return new og({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():z.shallowClone(t)}})}var sg=E("ZodPrefault",(e,t)=>{Ad.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>m0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function ag(e,t){return new sg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():z.shallowClone(t)}})}var Qu=E("ZodNonOptional",(e,t)=>{Ed.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>u0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function cg(e,t){return new Qu({type:"nonoptional",innerType:e,...z.normalizeParams(t)})}var ug=E("ZodSuccess",(e,t)=>{Rd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yh(e,r,n),e.unwrap=()=>e._zod.def.innerType;});function W2(e){return new ug({type:"success",innerType:e})}var lg=E("ZodCatch",(e,t)=>{Pd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>p0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function fg(e,t){return new lg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:z.constantCatch(t)})}var mg=E("ZodNaN",(e,t)=>{kd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wh(e,r,n,o);});function q2(e){return $h(mg,e)}var Os=E("ZodPipe",(e,t)=>{Ec.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>d0(e,r,n,o),e.in=t.in,e.out=t.out;});function xu(e,t){return new Os({type:"pipe",in:e,out:t})}var Ls=E("ZodCodec",(e,t)=>{Os.init(e,t),ds.init(e,t);});function X2(e,t,r){return new Ls({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Y2(e){let t=e._zod.def;return new Ls({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var pg=E("ZodPreprocess",(e,t)=>{Os.init(e,t),Id.init(e,t);}),dg=E("ZodReadonly",(e,t)=>{Md.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>h0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function hg(e){return new dg({type:"readonly",innerType:e})}var gg=E("ZodTemplateLiteral",(e,t)=>{Td.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qh(e,r,n);});function K2(e,t){return new gg({type:"template_literal",parts:e,...z.normalizeParams(t)})}var _g=E("ZodLazy",(e,t)=>{hs.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_0(e,r,n,o),e.unwrap=()=>e._zod.def.getter();});function bg(e){return new _g({type:"lazy",getter:e})}var yg=E("ZodPromise",(e,t)=>{Ld.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>g0(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function J2(e){return new yg({type:"promise",innerType:e})}var xg=E("ZodFunction",(e,t)=>{Od.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jh(e,r,n,o);});function ex(e){return new xg({type:"function",input:Array.isArray(e?.input)?q0(e?.input):e?.input??ks(Rn()),output:e?.output??Rn()})}var Ns=E("ZodCustom",(e,t)=>{Nd.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kh(e,r,n,o);});function tx(e){let t=new we({check:"custom"});return t._zod.check=e,t}function rx(e,t){return Ch(Ns,e??(()=>true),t)}function $g(e,t={}){return vh(Ns,e,t)}function wg(e,t){return Ah(e,t)}var nx=Eh,ox=Rh,Sg=E("ZodInstanceOf",(e,t)=>{Ns.init(e,t);},{properties(e,t){return this.check(Uo(e,t))}});function ix(e,t={}){let r=new Sg({type:"custom",check:"custom",fn:n=>n instanceof e,abort:true,...z.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]});},r}var sx=(...e)=>Ph({Codec:Ls,Boolean:ri,String:ei},...e);function ax(e){let t=bg(()=>oi([As(e),T0(),O0(),z0(),ks(t),X0(As(),t)]));return t}function cx(e,t){return new pg({type:"pipe",in:Uu(e),out:t})}var u8={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function l8(e){Oe({customError:e});}function f8(){return Oe().customError}var Cg;Cg||(Cg={});var Fs={};vr(Fs,{ZodISODate:()=>Dr,ZodISODateTime:()=>zr,ZodISODuration:()=>Zr,ZodISOTime:()=>Br,date:()=>p8,datetime:()=>m8,duration:()=>h8,time:()=>d8});function m8(e){return xs(zr,e)}function p8(e){return $s(Dr,e)}function d8(e){return ws(Br,e)}function h8(e){return Ss(Zr,e)}var F={...ii,..._u,iso:Fs},g8=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function _8(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function ux(e,t){return e.map((r,n)=>n<t?r:r.optional())}function b8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function y8(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:b8(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function x8(e,t){return F.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:true,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:true}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:true,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:true}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:true});}}).pipe(e)}function vg(e,t){if(e===null)return "z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return `${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=vg(s,t);if(a===null)return null;i.push(a);}return `a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let s=vg(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`);}return `o${o.length}:{${o.join(",")}}`}finally{t.delete(e);}}var $8=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),w8=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function zs(e){return typeof e!="object"||e===null?false:Array.isArray(e)?e.some(zs):typeof e.$ref=="string"?true:Object.entries(e).some(([t,r])=>$8.has(t)?zs(r):!w8.has(t)||typeof r!="object"||r===null?false:Object.values(r).some(zs))}function lx(e){return e===1?"element":"elements"}function S8(e,t){return F.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===true){let i=new Map;for(let s=0;s<o.length;s++){let a=vg(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:true});}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${lx(i)}; found ${a}`,input:o,continue:true}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${lx(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function fx(e,t){if(e!==false)return e===void 0||e===true?F.any():ut(e,t)}var C8=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function mx(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return F.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return F.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=y8(o,t),s=ut(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===true&&o.length===1&&o[0]===null)return F.null();if(o.length===0)return F.never();if(o.length===1)return F.literal(o[0]);if(o.every(s=>typeof s=="string"))return F.enum(o);let i=o.map(s=>F.literal(s));return i.length<2?i[0]:F.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return F.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return mx(s,t)});return o.length===0?F.never():o.length===1?o[0]:F.union(o)}if(!r)return F.any();let n;switch(r){case "string":{let o=F.string();if(e.format){let i=e.format;i==="email"?o=o.check(F.email()):i==="uri"||i==="uri-reference"?o=o.check(F.url()):i==="uuid"||i==="guid"?o=o.check(F.uuid()):i==="date-time"?o=o.check(F.iso.datetime({offset:true})):i==="date"?o=o.check(F.iso.date()):i==="time"?o=o.check(F.regex(C8)):i==="duration"?o=o.check(F.iso.duration()):i==="hostname"?o=o.check(F.hostname()):i==="ipv4"?o=o.check(F.ipv4()):i==="ipv6"?o=o.check(F.ipv6()):i==="mac"?o=o.check(F.mac()):i==="cidr"?o=o.check(F.cidrv4()):i==="cidr-v6"?o=o.check(F.cidrv6()):i==="base64"?o=o.check(F.base64()):i==="base64url"?o=o.check(F.base64url()):i==="e164"?o=o.check(F.e164()):i==="credit_card"?o=o.check(F.creditCard()):i==="iban"?o=o.check(F.iban()):i==="jwt"?o=o.check(F.jwt()):i==="emoji"?o=o.check(F.emoji()):i==="nanoid"?o=o.check(F.nanoid()):i==="cuid"?o=o.check(F.cuid()):i==="cuid2"?o=o.check(F.cuid2()):i==="ulid"?o=o.check(F.ulid()):i==="xid"?o=o.check(F.xid()):i==="ksuid"&&(o=o.check(F.ksuid()));}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case "number":case "integer":{let o=r==="integer"?F.number().int():F.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==true&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==true&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===true&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===true&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case "boolean":{n=F.boolean();break}case "null":{n=F.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?ut(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=ut(p,t);qe(o,f,s.has(f)?m:m.optional());}if(e.patternProperties){let f=e.patternProperties,p=Object.keys(f),m=[];for(let d of p){let g=ut(f[d],t),_=F.string().regex(new RegExp(d));m.push(F.looseRecord(_,g));}let h=[];if(Object.keys(o).length>0&&h.push(F.object(o).passthrough()),h.push(...m),h.length===0)n=F.object({}).passthrough();else if(h.length===1)n=h[0];else {let d=F.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=F.intersection(d,h[g]);n=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(b=>new RegExp(b)),_=n;n=n.check(b=>{if(!Rt(b.value))return;let y=[];for(let S of Object.keys(b.value))d.includes(S)||g.some(C=>C.test(S))||y.push(S);y.length&&b.issues.push({code:"unrecognized_keys",keys:y,input:b.value,inst:_});});}}else {let f=F.object(o);e.additionalProperties===false?n=f.strict():a?n=f.catchall(a):n=f.passthrough();}let c=e.propertyNames!==void 0&&e.propertyNames!==true,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let f;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;f=ut(p,t);}n=x8(n,{keySchema:f,minProperties:u,maxProperties:l});}break}case "array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(f=>ut(f,t)),c=ux(a,s),u=Array.isArray(i)?void 0:fx(i,t),l=F.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(F.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(F.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>ut(f,t)),c=ux(a,s),u=fx(e.additionalItems,t),l=F.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(F.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(F.maxLength(e.maxItems)));}else if(i!==void 0){let s=ut(i,t),a=F.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a;}else n=F.array(F.any());(e.uniqueItems===true||e.contains!==void 0)&&(n=S8(n,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?ut(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function ut(e,t){if(typeof e=="boolean")return e?F.any():F.never();let r=mx(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>ut(u,t)),c=F.union(a);r=n?F.intersection(r,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>ut(u,t)),c=F.xor(a);r=n?F.intersection(r,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:F.any();else {let a=n?r:ut(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=F.intersection(a,ut(e.allOf[u],t));r=a;}e.nullable===true&&t.version==="openapi-3.0"&&(r=F.nullable(r)),e.readOnly===true&&(r=F.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!zs(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of ["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a]);}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!zs(e.contains)&&(o.contains=e.contains);for(let a of ["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a]);}for(let a of Object.keys(e))g8.has(a)||qe(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function px(e,t){if(typeof e=="boolean")return e?F.any():F.never();let r;try{r=JSON.parse(JSON.stringify(e));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=_8(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Xe};return ut(r,i)}var dx=Symbol("z.visit/resolving");function Ds(e,t){let r=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},n=new Map;function o(s){let a=n.get(s);if(a===dx)return new hs({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,dx);let c=i(s),u=r(c,c!==s);return n.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case "object":{let u=a.shape,l=Object.keys(u),f=false,p={};for(let h of l){let d=o(u[h]);d!==u[h]&&(f=true),p[h]=d;}let m=a.catchall;return a.catchall&&(m=o(a.catchall),m!==a.catchall&&(f=true)),f?pe(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:pe(s,{...a,element:u})}case "tuple":{let u=a.items,l=false,f=[];for(let m of u){let h=o(m);h!==m&&(l=true),f.push(h);}let p=a.rest;return a.rest&&(p=o(a.rest),p!==a.rest&&(l=true)),l?pe(s,{...a,items:f,rest:p}):s}case "record":case "map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:pe(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:pe(s,{...a,valueType:u})}case "union":{let u=a.options,l=false,f=[];for(let p of u){let m=o(p);m!==p&&(l=true),f.push(m);}return l?pe(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:pe(s,{...a,left:u,right:l})}case "optional":case "nullable":case "default":case "prefault":case "catch":case "readonly":case "nonoptional":case "promise":case "success":{let u=o(a.innerType);return u===a.innerType?s:pe(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:pe(s,{...a,in:u,out:l})}case "function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:pe(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return pe(s,{...f,getter:()=>o(u())})}case "template_literal":case "string":case "number":case "int":case "boolean":case "bigint":case "symbol":case "undefined":case "null":case "void":case "never":case "any":case "unknown":case "date":case "nan":case "enum":case "literal":case "file":case "transform":case "custom":return s;default:return s}}return o(e)}function hx(e){return Ds(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:oi(r.options)}})}function v8(e,t){if(!t?.length)return e;let r=e._zod.def;return pe(e,Ft(r,{checks:[...r.checks??[],...t]}),{parent:true})}function gx(e){return v8(e.out,e.checks)}function A8(e){return e.in._zod.traits.has("$ZodTransform")?gx(e):e.in}function _x(e){return Ds(e,{pipe:t=>A8(t._zod.def),default:(t,r)=>r?Pn(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function bx(e){return Ds(e,{pipe:t=>gx(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var Ag={};vr(Ag,{bigint:()=>k8,boolean:()=>P8,date:()=>I8,number:()=>R8,string:()=>E8});function E8(e){return Wd(ei,e)}function R8(e){return eh(ti,e)}function P8(e){return ah(ri,e)}function k8(e){return uh(ni,e)}function I8(e){return xh(Ps,e)}var Eg=A.enum(lo),Rg=A.enum([...fo.logo,...fo.halftone]),yx=e=>Math.ceil(e/3)*4,Pg=A.object({width:A.number().int().min(1).max(Vt),height:A.number().int().min(1).max(Vt),data:A.string().max(yx(Vt*Vt*4))}).refine(e=>e.data.length===yx(e.width*e.height*4),{message:"Art image data does not match its width and height"}),ju=A.object({mode:Eg,image:Pg,intensity:A.number().min(0).max(1).optional(),variant:Rg.optional(),matchEyes:A.boolean().optional()});var xx=A.enum(["solid","linear","radial","angular","image"]),kg=A.object({type:A.literal("solid"),color:A.string()}),Bs=A.object({color:A.string(),offset:A.number().min(0).max(100)}),Ig=A.object({type:A.literal("linear"),stops:A.array(Bs).min(2),angle:A.number().optional().default(0)}),Mg=A.object({type:A.literal("radial"),stops:A.array(Bs).min(2)}),Tg=A.object({type:A.literal("angular"),stops:A.array(Bs).min(2),angle:A.number().optional().default(0)}),Og=A.enum(["cover","contain","tile"]),Lg=A.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),Ng=A.object({type:A.literal("image"),src:A.string().min(1),fit:Og.optional().default("cover"),scale:A.number().min(.1).max(4).optional().default(1),position:Lg.optional().default("center"),opacity:A.number().min(0).max(1).optional().default(1),underlay:A.string().optional()}),dr=A.union([A.string(),kg,Ig,Mg,Tg,Ng]);var $x=A.object({x:A.number(),y:A.number(),w:A.number(),h:A.number()});var wx=e=>Ve(sr,e),Zs=A.preprocess(wx,A.enum([...Ta,...Af])),Sx=A.preprocess(wx,A.enum(Ta));var Cx=e=>Ve(ir,e),Us=A.preprocess(Cx,A.enum([...Oa,...Ef])),vx=A.preprocess(Cx,A.enum(Oa));var Fg=A.enum(Pf),Gs=A.object({style:Fg,text:A.string().max(pt).optional(),color:A.string().optional(),textColor:A.string().optional(),secondaryText:A.string().max(pt).optional(),secondaryColor:A.string().optional(),fontScale:A.number().min(cn).max(Ar).optional()});var Le=A.number().min(-J.maxCoordinate).max(J.maxCoordinate).refine(Rr,{message:`Numbers may have at most ${J.maxDecimals} decimals`}),tt=Le.refine(e=>e>0,{message:"Must be greater than 0"}),Vu=Le.refine(e=>e>=0,{message:"Must not be negative"}),Qs=A.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Ax=A.union([A.enum(Ui),Qs]),Rx=e=>A.object({mix:A.tuple([e,e]),amount:A.number().min(0).max(1).refine(Rr)}).strict(),Ur=A.union([Ax,Rx(Ax)]),M8=A.union([Qs,Rx(A.union([A.enum(["frame","accent","background"]),Qs]))]),hr=A.union([Ur,A.object({gradient:A.object({from:Ur,to:Ur,direction:A.enum(["horizontal","vertical"]).optional(),steps:A.int().min(2).max(J.maxGradientSteps).optional()}).strict()}).strict()]),zg={x:Le,y:Le,width:tt,height:tt},js=A.object({color:Ur,width:tt}).strict(),T8=A.object({type:A.literal("rect"),...zg,radius:Vu.optional(),fill:hr,hole:A.object({...zg,radius:Vu.optional()}).strict().optional(),stroke:js.optional()}).strict(),O8=A.object({type:A.literal("circle"),cx:Le,cy:Le,r:tt,hole:tt.optional(),fill:hr,stroke:js.optional()}).strict(),L8=A.object({type:A.literal("ellipse"),cx:Le,cy:Le,rx:tt,ry:tt,fill:hr,stroke:js.optional()}).strict(),N8=A.object({type:A.literal("polygon"),points:A.array(A.tuple([Le,Le])).min(3).max(J.maxPolygonPoints),fill:hr,stroke:js.optional()}).strict(),F8=A.object({type:A.literal("path"),d:A.string().min(2).max(J.maxPathLength),fill:hr,fillRule:A.enum(["nonzero","evenodd"]).optional(),stroke:js.optional()}).strict(),z8=A.object({type:A.literal("line"),x1:Le,y1:Le,x2:Le,y2:Le,width:tt,cap:A.enum(["butt","round"]).optional(),dash:A.tuple([tt,tt]).optional(),fill:hr}).strict(),D8=A.object({type:A.literal("icon"),icon:A.enum(Bi),x:Le,y:Le,size:tt,fill:hr}).strict(),Dg=A.discriminatedUnion("type",[T8,O8,L8,N8,F8,z8,D8]),Px={id:A.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:A.enum(["primary","secondary","fixed"]),text:A.string().max(200),maxLength:A.int().min(1).max(pt).optional(),color:Ur,weight:A.enum(["bold","regular"]).optional(),collapse:A.object({y:Le,height:tt}).strict().optional()},B8=A.object({type:A.literal("text"),...Px,box:A.object(zg).strict(),align:A.enum(["start","middle","end"]).optional(),fontSize:tt.optional()}).strict(),Z8=A.object({type:A.literal("curved"),...Px,curve:A.object({cx:Le,cy:Le,radius:tt,side:A.enum(["top","bottom"]),spread:A.number().min(20).max(300).refine(Rr).optional()}).strict(),fontSize:tt}).strict(),Bg=A.discriminatedUnion("type",[B8,Z8]),Ex=Le.refine(e=>e>=J.minArtboard&&e<=J.maxArtboard,{message:`Artboard sides must be ${J.minArtboard} to ${J.maxArtboard} units`}),U8=A.object({kind:A.literal(mn),version:A.literal(pn),artboard:A.object({width:Ex,height:Ex}).strict(),qr:A.object({x:Le,y:Le,size:tt,padding:Vu.optional(),radius:Vu.optional(),plate:A.enum(["opaque","background","none"]).optional()}).strict(),colors:A.object({frame:Qs,text:M8.optional(),accent:Qs.optional()}).strict(),shapes:A.array(Dg).max(J.maxShapes),labels:A.array(Bg).max(J.maxLabels),bleed:A.union([A.literal("none"),Ur]).optional()}).strict(),Hu=U8.superRefine((e,t)=>Da(e,(r,n=[])=>t.addIssue({code:"custom",message:r,path:n})));function kx(e){let t=Hu.safeParse(e);return t.success?[]:t.error.issues.map(r=>r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message)}var Zg=Gs.extend({style:A.literal(dn),spec:Hu}),Wu=A.discriminatedUnion("style",[Gs,Zg]);var qu=A.preprocess(e=>Ve(an,e),A.enum(Rf));var Xu=A.enum(If),Ug=A.object({src:A.string(),height:A.number(),width:A.number(),excavate:A.boolean(),x:A.number().optional(),y:A.number().optional(),padding:A.number().min(0).optional(),shape:Xu.optional(),plate:A.string().optional()}),Ix=A.object({size:A.number().min(Mf).max(Ti).optional(),padding:A.number().min(0).max(Of).optional(),x:A.number().min(0).max(1).optional(),y:A.number().min(0).max(1).optional(),shape:Xu.optional(),plate:A.string().optional()}),Gg=A.enum(["L","M","Q","H"]),Qg=A.enum(Nf),jg=A.object({type:A.literal("silhouette"),width:A.number().int().min(Nt).max(At),height:A.number().int().min(Nt).max(At),cells:A.string().max(At*At).regex(/^[01]*$/).describe('Row by row, "1" inside the shape and "0" outside: width \xD7 height characters')}).refine(e=>e.cells.length===e.width*e.height,{message:"Silhouette cells do not match its width and height"}),Vg=A.union([Qg,jg]),Vs=A.object({outer:dr.optional(),inner:dr.optional()}),Hg=A.object({topLeft:Vs.optional(),topRight:Vs.optional(),bottomLeft:Vs.optional()}),Hs=A.object({outer:Us.optional(),inner:Zs.optional()}),Wg=A.object({topLeft:Hs.optional(),topRight:Hs.optional(),bottomLeft:Hs.optional()}),qg=A.enum(Qf),Xg=A.object({color:A.string().optional(),width:A.number().min(Li).max(Ni).optional()}),Yg=A.object({color:A.string().optional(),opacity:A.number().min(Fi).max(zi).optional(),dx:A.number().min(-ar).max(ar).optional(),dy:A.number().min(-ar).max(ar).optional()}),Mx=A.object({value:A.string(),size:A.number().optional(),level:Gg.optional(),bgColor:dr.optional(),fgColor:dr.optional(),eyeColor:dr.optional(),dotColor:dr.optional(),bodyPattern:qu.optional(),cornerEyePattern:Us.optional(),cornerEyeDotPattern:Zs.optional(),margin:A.number().optional(),imageSettings:Ug.optional(),isOGContext:A.boolean().optional(),templateId:A.string().optional(),customProps:A.record(A.string(),A.any()).optional(),frame:Wu.optional(),art:ju.optional(),eyeColors:Hg.optional(),moduleScale:A.number().min(mo).max(Oi).optional(),autoLevel:A.boolean().optional(),exactLevel:A.boolean().optional(),shape:Vg.optional(),eyeShapes:Wg.optional(),eyeGradient:qg.optional(),bgRadius:A.number().min(0).max(po).optional(),backdrop:A.string().optional(),halo:Xg.optional(),shadow:Yg.optional()});var Tx=A.object({fgColor:A.string().optional(),bgColor:A.string().optional()}),Ox=A.object({pixelSize:A.number(),url:A.string()}),Lx=A.object({id:A.string(),name:A.string(),description:A.string().optional()});var lt=e=>e/255,Ws=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,fe=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function Kg(e){let{width:t,height:r,data:n}=e,o=[0,t-1,(r-1)*t,r*t-1].map(s=>{let a=s*4;return {color:[lt(n[a]),lt(n[a+1]),lt(n[a+2])],alpha:n[a+3]/255}});if(o.some(s=>s.alpha<.9))return null;let i=o[0].color;return o.every(({color:s})=>Ws(s,i)<.006)?i:null}function G8(e){let{width:t,height:r,data:n}=e,o=Kg(e),i=new Float32Array(t*r);for(let s=0;s<i.length;s++){let a=s*4,c=n[a+3]/255;if(o&&c>0){let u=Math.sqrt(Ws([lt(n[a]),lt(n[a+1]),lt(n[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var Q8=8,j8=.14,Nx=.006;function V8(e,t){let{width:r,height:n,data:o}=e,i=new Float64Array(4096),s=new Float64Array(4096*3),a=0;for(let m=0;m<t.length;m++){if(t[m]<.9)continue;let h=m*4,d=Math.floor(o[h]/16)*256+Math.floor(o[h+1]/16)*16+Math.floor(o[h+2]/16);i[d]+=1,s[d*3]+=lt(o[h]),s[d*3+1]+=lt(o[h+1]),s[d*3+2]+=lt(o[h+2]),a++;}if(a===0)return {palette:[],error:0};let c=[...i.keys()].filter(m=>i[m]>0).sort((m,h)=>i[h]-i[m]),u=[];for(let m of c){if(i[m]/a<Nx/2||u.length>=Q8)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>Ws(d,h)>=j8**2)&&u.push(h);}let l=[],f=0;for(let m=0;m<3;m++){l=u.map(()=>({n:0,r:0,g:0,b:0,x:0,y:0})),f=0;for(let h=0;h<t.length;h++){if(t[h]<.9)continue;let d=h*4,g=[lt(o[d]),lt(o[d+1]),lt(o[d+2])],_=0,b=Number.POSITIVE_INFINITY;for(let[S,C]of u.entries()){let w=Ws(g,C);w<b&&(b=w,_=S);}let y=l[_];y.n++,y.r+=g[0],y.g+=g[1],y.b+=g[2],y.x+=h%r,y.y+=Math.floor(h/r),f+=Math.sqrt(b);}for(let[h,d]of l.entries())d.n>0&&(u[h]=[d.r/d.n,d.g/d.n,d.b/d.n]);}return {palette:u.map((m,h)=>({color:m,area:l[h].n/a,cx:l[h].n?l[h].x/l[h].n+.5:r/2,cy:l[h].n?l[h].y/l[h].n+.5:n/2})).filter(m=>m.area>=Nx).sort((m,h)=>h.area-m.area),error:f/a}}function H8(e,t,r){let n=t+2,o=r+2,i=(f,p)=>f<=0||p<=0||f>t||p>r?0:e[(p-1)*t+(f-1)],s=new Map,a=new Map,c=f=>{let p=a.get(f);if(p)return p;let m=Math.floor(f/2),h=m%n,d=Math.floor(m/n),g=i(h,d),_=f%2===1,b=_?i(h,d+1):i(h+1,d),y=g===b?.5:Math.min(1,Math.max(0,(.5-g)/(b-g))),S=_?[h-.5,d-.5+y]:[h-.5+y,d-.5];return a.set(f,S),S},u=(f,p)=>{s.set(f,p);};for(let f=0;f<o-1;f++)for(let p=0;p<n-1;p++){let m=i(p,f)>=.5,h=i(p+1,f)>=.5,d=i(p+1,f+1)>=.5,g=i(p,f+1)>=.5,_=2*(f*n+p),b=2*((f+1)*n+p),y=2*(f*n+p)+1,S=2*(f*n+p+1)+1;switch((m?8:0)+(h?4:0)+(d?2:0)+(g?1:0)){case 1:u(b,y);break;case 2:u(S,b);break;case 3:u(S,y);break;case 4:u(_,S);break;case 5:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(_,y),u(b,S)):(u(_,S),u(b,y));break}case 6:u(_,b);break;case 7:u(_,y);break;case 8:u(y,_);break;case 9:u(b,_);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(y,b),u(S,_)):(u(y,_),u(S,b));break}case 11:u(S,_);break;case 12:u(y,S);break;case 13:u(b,S);break;case 14:u(y,b);break;}}let l=[];for(let f of s.keys()){if(!s.has(f))continue;let p=[],m=f;for(;m!==void 0&&s.has(m);){p.push(c(m));let h=s.get(m);s.delete(m),m=h;}p.length>=3&&l.push(p);}return l}function W8(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r],o=e[(r+1)%e.length];t+=n[0]*o[1]-o[0]*n[1];}return t/2}function Fx(e,t){if(e.length<=2)return e;let r=new Uint8Array(e.length);r[0]=1,r[e.length-1]=1;let n=[[0,e.length-1]];for(;n.length>0;){let[o,i]=n.pop(),s=e[o],a=e[i],c=a[0]-s[0],u=a[1]-s[1],l=Math.hypot(c,u)||1,f=-1,p=t;for(let m=o+1;m<i;m++){let h=e[m],d=Math.abs(u*(h[0]-s[0])-c*(h[1]-s[1]))/l;d>p&&(p=d,f=m);}f>=0&&(r[f]=1,n.push([o,f],[f,i]));}return e.filter((o,i)=>r[i]===1)}function q8(e,t){let r=0,n=-1;for(let[s,a]of e.entries()){let c=(a[0]-e[0][0])**2+(a[1]-e[0][1])**2;c>n&&(n=c,r=s);}let o=Fx(e.slice(0,r+1),t),i=Fx([...e.slice(r),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var Gr=e=>le(e,2);function X8(e,t){let r=e.length,n=(i,s)=>{let a=Math.hypot(s[0]-i[0],s[1]-i[1])||1,c=Math.min(.5,t/a);return [i[0]+(s[0]-i[0])*c,i[1]+(s[1]-i[1])*c]},o="";for(let i=0;i<r;i++){let s=e[i],a=n(s,e[(i-1+r)%r]),c=n(s,e[(i+1)%r]);o+=i===0?`M${Gr(a[0])} ${Gr(a[1])}`:`L${Gr(a[0])} ${Gr(a[1])}`,o+=`Q${Gr(s[0])} ${Gr(s[1])} ${Gr(c[0])} ${Gr(c[1])}`;}return `${o}Z`}function Y8(e,t,r){let n="";for(let o of H8(e,t,r)){if(Math.abs(W8(o))<.8)continue;let i=q8(o,.18);i.length>=3&&(n+=X8(i,.9));}return n}var K8=.075;function zx(e){let{width:t,height:r,data:n}=e,o=G8(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=V8(e,o),c={width:t,height:r,palette:s,alpha:o,coverage:i/(t*r)};if(s.length===0||a>K8)return {...c,layers:[],photographic:s.length>0};let u=s.length,l=Array.from({length:u},()=>new Float32Array(t*r)),f=s.map(d=>d.color);for(let d=0;d<o.length;d++){let g=o[d];if(g<=0)continue;let _=d*4,b=[lt(n[_]),lt(n[_+1]),lt(n[_+2])],y=0,S=-1,C=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY;for(let I=0;I<u;I++){let T=Ws(b,f[I]);T<C?(S=y,w=C,y=I,C=T):T<w&&(S=I,w=T);}if(S<0||C<1e-6){l[y][d]=g;continue}let $=f[y],v=f[S],R=[v[0]-$[0],v[1]-$[1],v[2]-$[2]],P=Math.min(1,Math.max(0,((b[0]-$[0])*R[0]+(b[1]-$[1])*R[1]+(b[2]-$[2])*R[2])/(R[0]**2+R[1]**2+R[2]**2)));l[y][d]=g*(1-P),l[S][d]=g*P;}let p=[],m=new Float32Array(t*r),h=new Array(u);for(let d=u-1;d>=0;d--){let g=l[d];for(let _=0;_<m.length;_++)m[_]+=g[_];h[d]=m.slice();}for(let d=0;d<u;d++){let g=Y8(h[d],t,r);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:Jg}=vt,J8={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function ev(e){let t=e*4+17,r=new Uint8Array(t*t),n=(s,a)=>{s>=0&&a>=0&&s<t&&a<t&&(r[a*t+s]=1);};for(let s=0;s<t;s++)n(6,s),n(s,6);for(let[s,a]of [[3,3],[t-4,3],[3,t-4]])for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++)n(s+u,a+c);let o=[];if(e>1){let s=Math.floor(e/7)+2,a=e===32?26:Math.ceil((e*4+4)/(s*2-2))*2;o.push(6);for(let c=t-7;o.length<s;c-=a)o.splice(1,0,c);}let i=o.length-1;for(let[s,a]of o.entries())for(let[c,u]of o.entries())if(!(s===0&&c===0||s===0&&c===i||s===i&&c===0))for(let l=-2;l<=2;l++)for(let f=-2;f<=2;f++)n(a+f,u+l);for(let s=0;s<=8;s++)n(8,s),n(s,8);for(let s=0;s<8;s++)n(t-1-s,8),n(8,t-1-s);if(e>=7)for(let s=0;s<18;s++){let a=t-11+s%3,c=Math.floor(s/3);n(a,c),n(c,a);}return r}function tv(e,t){let r=e*4+17,n=Ia[t].ordinal,o=Jg.NUM_ERROR_CORRECTION_BLOCKS[n]?.[e]??0,i=Jg.ECC_CODEWORDS_PER_BLOCK[n]?.[e]??0,s=Math.floor(Jg.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(S,C)=>c+(C<a?0:1)),l=[],f=[],p=c-i;for(let S=0;S<=c;S++)for(let C=0;C<o;C++)if(C<a){if(S===p)continue;l.push(C),f.push(S<p?S:S-1);}else l.push(C),f.push(S);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=ev(e),h=new Int16Array(r*r).fill(-1),d=new Int16Array(r*r).fill(-1),g=new Int8Array(r*r).fill(-1),_=s*8,b=0;for(let S=r-1;S>=1;S-=2){S===6&&(S=5);let C=(S+1&2)===0;for(let w=0;w<r;w++)for(let $=0;$<2;$++){let v=S-$,P=(C?r-1-w:w)*r+v;if(!m[P]&&b<_){let I=b>>>3;h[P]=l[I],d[P]=f[I],g[P]=7-(b&7),b++;}}}if(b!==_)throw new Error(`Codeword map: placement mismatch at version ${e}`);let y=J8[`${e}${t}`]??0;return {version:e,level:t,size:r,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-y)/2),block:h,codeword:d,bit:g}}var rv=8,Tn=new Map;function qs(e,t){if(!(Number.isInteger(e)&&e>=1&&e<=40))throw new RangeError(`QR version must be 1\u201340, got ${e}`);let r=`${e}${t}`,n=Tn.get(r);if(n)return Tn.delete(r),Tn.set(r,n),n;let o=tv(e,t);if(Tn.size>=rv){let i=Tn.keys().next().value;i!==void 0&&Tn.delete(i);}return Tn.set(r,o),o}function Xs(e,t){let r=new Array(e.blocks).fill(0),n=new Set;for(let o of t){let i=e.block[o]??-1;if(i<0)continue;let s=i*4096+e.codeword[o];n.has(s)||(n.add(s),r[i]=r[i]+1);}return r}var nv={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"},ov=Object.fromEntries(Object.entries(nv).map(([e,t])=>[e,[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]]));function Dx(e,t){let r=e.trim(),n=Number.parseFloat(r);return Number.isNaN(n)?Number.NaN:r.endsWith("%")?n/100*t:n}function ve(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let r=ov[t];if(r)return {r:r[0],g:r[1],b:r[2],a:1};if(t.startsWith("#")){let o=t.slice(1);return (o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),/^[0-9a-f]{6}([0-9a-f]{2})?$/.test(o)?{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16),a:o.length===8?Number.parseInt(o.slice(6,8),16)/255:1}:null}let n=/^rgba?\(([^)]*)\)$/.exec(t);if(n){let[o,i]=n[1].split("/"),s=o.split(/[\s,]+/).filter(Boolean);if(s.length!==(i===void 0&&s.length===4?4:3))return null;let a=i??s[3],[c,u,l]=s.slice(0,3).map(m=>Dx(m,255)),f=a===void 0?1:Dx(a,1);if([c,u,l,f].some(m=>Number.isNaN(m)))return null;let p=(m,h)=>Math.min(Math.max(m,0),h);return {r:p(c,255),g:p(u,255),b:p(l,255),a:p(f,1)}}return null}function Qr(e,t,r){let n=e/255,o=t/255,i=r/255,s=1-Math.max(n,o,i);return s>=1?[0,0,0,1]:[le((1-n-s)/(1-s)),le((1-o-s)/(1-s)),le((1-i-s)/(1-s)),le(s)]}function It(e){return e.children}var iv=e=>e==null?null:`${e}`;function e1(e,t,r){let n=t??{},o=r;if("key"in n){let{key:i,...s}=n;i!==void 0&&(o=i),n=s;}return {type:e,props:n,key:iv(o)}}function sv(e,t){let r=e;return {type:r.type,props:{...r.props,...t},key:r.key??null}}function av(e,t,...r){let n={...t};return r.length>0&&(n.children=r.length===1?r[0]:r),e1(e,n)}var cv={jsx:e1,jsxs:e1,createElement:av,cloneElement:sv,Fragment:It},Ys=cv;var t1=e=>e===It?Ys.Fragment:e;function k(e,t,r){return Ys.jsx(t1(e),t,r)}function Be(e,t,r){return Ys.jsxs(t1(e),t,r)}function Yu(e,t,...r){return Ys.createElement(t1(e),t??null,...r)}function On(e,t){return Ys.cloneElement(e,t)}var uv=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Bx=Symbol.for("react.fragment");function Ln(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!uv.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===Bx)&&typeof t.props=="object"&&t.props!==null}var si=e=>e===It||e===Bx;var Vx=.6,o1={logo:160,halftone:160};function lv(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}var ai=class{entries=new Map;limit;constructor(t){this.limit=t;}get(t,r){let n=this.entries.get(t);if(n!==void 0)return this.entries.delete(t),this.entries.set(t,n),n;let o=r();if(this.entries.size>=this.limit){let i=this.entries.keys().next().value;i!==void 0&&this.entries.delete(i);}return this.entries.set(t,o),o}},fv=new ai(8);function mv(e){return fv.get(e,()=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r})}function i1(e){let{width:t,height:r,data:n}=e;if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>Vt||r>Vt||typeof n!="string")return null;try{let o=mv(n);return o.length===t*r*4?{width:t,height:r,data:o}:null}catch{return null}}function Hx(e,t={}){let{width:r,height:n,data:o}=e;if(!(r>0&&n>0)||o.length<r*n*4)throw new Error("Art image pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=Math.min(r,n),s=t.square?Math.floor((r-i)/2):0,a=t.square?Math.floor((n-i)/2):0,c=t.square?i:r,u=t.square?i:n,l=Math.min(Math.max(Math.round(t.maxSize??o1.halftone),1),Vt),f=Math.min(1,l/Math.max(c,u)),p=Math.max(1,Math.round(c*f)),m=Math.max(1,Math.round(u*f)),h=new Uint8Array(p*m*4);for(let d=0;d<m;d++){let g=Math.floor(d*u/m),_=Math.max(g+1,Math.floor((d+1)*u/m));for(let b=0;b<p;b++){let y=Math.floor(b*c/p),S=Math.max(y+1,Math.floor((b+1)*c/p)),C=0,w=0,$=0,v=0,R=0;for(let I=g;I<_;I++)for(let T=y;T<S;T++){let O=((I+a)*r+T+s)*4,D=o[O+3]/255;C+=o[O]*D,w+=o[O+1]*D,$+=o[O+2]*D,v+=D,R++;}let P=(d*p+b)*4;h[P]=v>0?Math.round(C/v):0,h[P+1]=v>0?Math.round(w/v):0,h[P+2]=v>0?Math.round($/v):0,h[P+3]=Math.round(v/R*255);}}return {width:p,height:m,data:lv(h)}}async function pv(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(r=>{e.addEventListener("load",r,{once:true}),e.addEventListener("error",r,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((r,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>r(o),o.onerror=()=>n(new Error("Could not load the art image")),o.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function dv(e,t={}){if(typeof document>"u")throw new Error("loadQRArtImage needs a browser; pass decoded pixels to createQRArtImage instead");let r=t.mode??"halftone",n=t.maxSize??o1[r],o=await pv(e),i=o.naturalWidth||o.width||n,s=o.naturalHeight||o.height||n,a=r==="halftone",c=Math.min(1,n*4/(a?Math.min(i,s):Math.max(i,s))),u=Math.max(1,Math.round(i*c)),l=Math.max(1,Math.round(s*c)),f=document.createElement("canvas");f.width=u,f.height=l;let p=f.getContext("2d",{willReadFrequently:true});if(!p)throw new Error("Could not get a canvas context");p.imageSmoothingQuality="high",p.drawImage(o,0,0,u,l);let m;try{m=p.getImageData(0,0,u,l);}catch{throw new Error("Could not read the art image (cross-origin images need CORS); upload it instead")}finally{f.remove();}return Hx(m,{maxSize:n,square:a})}function s1(e){return !!(e&&lo.includes(e.mode)&&e.image&&i1(e.image))}function el(e){let t=fo[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function hv(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function Ks(e,t){let r=hv(e,t),n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return o}var gv=0,Mt=1,Bt=2,jr=3,Zx=4,Ux=new Map;function Wx(e){let t=Ux.get(e);if(t)return t;let r=e*4+17,n=new Uint8Array(r*r),o=(i,s,a,c,u)=>{for(let l=Math.max(0,s);l<Math.min(r,s+c);l++)for(let f=Math.max(0,i);f<Math.min(r,i+a);f++)n[l*r+f]=u;};o(6,0,1,r,Zx),o(0,6,r,1,Zx),o(0,8,9,1,jr),o(8,0,1,9,jr),o(r-8,8,8,1,jr),o(8,r-8,1,8,jr),e>=7&&(o(r-11,0,3,6,jr),o(0,r-11,6,3,jr));for(let[i,s]of Ks(e,r))o(i-2,s-2,5,5,Bt);return o(0,0,8,8,Mt),o(r-8,0,8,8,Mt),o(0,r-8,8,8,Mt),Ux.set(e,n),n}function _v(e){let t=e*4+17,r=Wx(e);return Array.from({length:t},(n,o)=>Array.from({length:t},(i,s)=>r[o*t+s]!==gv))}function bv(e){let t=e[8],r=t?.[0]?1:0,n=t?.[1]?1:0,o=(1-r)*2+n;return ["M","L","H","Q"][o]??"M"}function ci(e,t){let r=ve(e);return !r||r.a===0?t:[r.r/255,r.g/255,r.b/255]}var Fn=(e,t,r)=>[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r,e[2]+(t[2]-e[2])*r];function Vr(e,t,r,n){let o=fe(e);if(n?o<=r:o>=r)return e;let i=fe(t);return Math.abs(o-i)<1e-6?t:Fn(e,t,Math.min(1,Math.max(0,(o-r)/(o-i))))}var qx=e=>Math.max(...e)-Math.min(...e),yv=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,r1=e=>e.toString(16).padStart(2,"0");function ft(e,t=1){let r=n=>Math.min(255,Math.round(Math.round(Math.min(Math.max(n,0),1)*255)/t)*t);return `#${r1(r(e[0]))}${r1(r(e[1]))}${r1(r(e[2]))}`}function xv(e){let t=e<0?-1:1,r=Math.abs(e),n=1/(1+.3275911*r),o=1-((((1.061405429*n-1.453152027)*n+1.421413741)*n-.284496736)*n+.254829592)*n*Math.exp(-r*r);return t*o}var a1=.3,Gx=e=>1-Math.exp(-((e/2)**2)/(2*a1**2)),$v=e=>xv(e/(2*a1*Math.SQRT2))**2,wv=(e,t,r)=>{let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)};function c1(e,t,r,n){let o=n==="cover"?Math.max(r/e,r/t):Math.min(r/e,r/t);return {scale:o,offsetX:(r-e*o)/2,offsetY:(r-t*o)/2}}function Xx(e,t){let{width:r,height:n,data:o}=e,i=new Float32Array(r*n*3),s=t??new Float32Array(r*n);for(let a=0;a<r*n;a++)i[a*3]=o[a*4]/255,i[a*3+1]=o[a*4+1]/255,i[a*3+2]=o[a*4+2]/255,t||(s[a]=o[a*4+3]/255);return {width:r,height:n,rgb:i,alpha:s}}function Sv(e){let t=Xx(e),{rgb:r,alpha:n}=t,o=new Float64Array(256),i=0;for(let f=0;f<n.length;f++){if(n[f]<.5)continue;let p=fe([r[f*3],r[f*3+1],r[f*3+2]]);o[Math.min(255,Math.floor(p*256))]+=1,i++;}let s=f=>{let p=0;for(let m=0;m<256;m++)if(p+=o[m],p>=f*i)return m/255;return 1},a=i?s(.01):0,c=i?s(.99):1;c-a<.15&&(a=0,c=1);let u=Math.min(1.6,1/(c-a)),l=(a+c)/2;for(let f=0;f<n.length;f++){let p=[r[f*3],r[f*3+1],r[f*3+2]],m=fe(p),h=.5+(m-l)*u;for(let d=0;d<3;d++)r[f*3+d]=Math.min(1,Math.max(0,h+(p[d]-m)*1.12));}return t}function Yx(e,t,r,n,o=1){let{width:i,height:s,rgb:a,alpha:c}=e,u=Math.min(Math.max(t-.5,0),i-1),l=Math.min(Math.max(r-.5,0),s-1),f=Math.floor(u),p=Math.floor(l),m=Math.min(f+1,i-1),h=Math.min(p+1,s-1),d=u-f,g=l-p,_=0,b=0,y=0,S=0,C=($,v,R)=>{let P=v*i+$,I=c[P]*R;_+=a[P*3]*I,b+=a[P*3+1]*I,y+=a[P*3+2]*I,S+=I;};if(C(f,p,(1-d)*(1-g)),C(m,p,d*(1-g)),C(f,h,(1-d)*g),C(m,h,d*g),S<=0)return n;let w=S*o;return [n[0]+(_/S-n[0])*w,n[1]+(b/S-n[1])*w,n[2]+(y/S-n[2])*w]}var Cv=new ai(4),vv=new ai(6),Av=new ai(6);function u1(e,t){return vv.get(e.image.data,()=>zx(t))}function Kx(e,t,r){return Av.get(e.image.data,()=>Xx(t,r.alpha))}var Ge=e=>le(e,2),Jx=e=>le(e,4),zn=class{groups=new Map;add(t,r){let n=this.groups.get(t);n?n.push(r):this.groups.set(t,[r]);}cellRun(t,r,n,o){this.add(t,`M${r} ${n}h${o}.04v1.04h-${o}.04z`);}circle(t,r,n,o){this.add(t,Ev(r,n,o));}toElements(t){return [...this.groups].map(([r,n],o)=>k("path",{d:n.join(""),fill:r},`${t}-${o}`))}};function Ev(e,t,r){let n=Ge(r*2),o=Ge(r);return `M${Ge(e-r)} ${Ge(t)}a${o} ${o} 0 1 0 ${n} 0a${o} ${o} 0 1 0 ${-n} 0z`}function Nn(e,t,r,n,o){let i=Math.min(o,r/2,n/2);if(i<=0)return `M${Ge(e)} ${Ge(t)}h${Ge(r)}v${Ge(n)}h${Ge(-r)}z`;let s=Ge(i);return `M${Ge(e+i)} ${Ge(t)}h${Ge(r-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${Ge(n-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${Ge(-(r-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${Ge(-(n-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function e$(e,t,r){let n="";for(let[o,i]of e){let s=(o-2+t)*r,a=(i-2+t)*r;n+=Nn(s,a,5*r,5*r,r*.35),n+=Nn(s+r,a+r,3*r,3*r,r*.15),n+=Nn(s+2*r,a+2*r,r,r,r*.12);}return n}var Rv={blend:1,badge:1,color:.9,mono:.7},Ju=.35;function Pv(e,t){let r=ci(e,[0,0,0]),n=ci(t,[1,1,1]),o=fe(n)-fe(r);return o>=Ju?null:o<=-Ju?"inverted":"low-contrast"}function t$(e,t,r){let n=Math.min(Math.max(e.intensity??Vx,0),Rv[el(e)]);return fe(r)-fe(t)>=Ju?n:0}function kv(e){let{art:t,modules:r,version:n}=e,o=t.image&&i1(t.image);if(!(o&&lo.includes(t.mode)))return null;let i=r.length;if(i!==n*4+17)return null;let s=ci(e.fgColor,[0,0,0]),a=ci(e.bgColor,[1,1,1]),c=t$(t,s,a);return c<=0?null:{art:t,image:o,modules:r,size:i,version:n,kinds:Wx(n),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:el(t),body:e.body}}function l1(e){let t=kv(e);if(!t)return null;let r;return t.art.mode==="halftone"?r=t.variant==="mono"?Nv(t):Lv(t):r=t.variant==="badge"?jv(t):Fv(t),k("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:r})}function Iv(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var r$=8.5,Qx=new Map;function f1(e){let t=e*4+17,r=Qx.get(e);if(!r){let i=t*2,s=new Uint8Array(i*i),a=r$*2;for(let c=0;c<i;c++)for(let u=0;u<i;u++){let l=u<a||u>=i-a,f=c<a||c>=i-a;l&&f&&!(u>=i-a&&c>=i-a)&&(s[c*i+u]=1);}for(let[c,u]of Ks(e,t))for(let l=(u-2)*2-1;l<(u+3)*2+1;l++)for(let f=(c-2)*2-1;f<(c+3)*2+1;f++)f>=0&&l>=0&&f<i&&l<i&&(s[l*i+f]=1);Qx.set(e,s),r=s;}let n=r,o=t*2;return (i,s)=>{let a=Math.floor(i*2),c=Math.floor(s*2);return a>=0&&c>=0&&a<o&&c<o&&n[c*o+a]===1}}function n$(e,t,r=false){let{image:n,size:o,kinds:i,fg:s,bg:a}=e,c=Cv.get(e.art.image.data,()=>Sv(n)),u=c1(n.width,n.height,o,"cover"),l=o*t,f=new Float32Array(l*l*3).fill(Number.NaN),m=1/(t*u.scale)>1.3?2:1,h=fe(a)-.1*(fe(a)-fe(s)),d=f1(e.version);for(let g=0;g<o;g++)for(let _=0;_<o;_++){let b=i[g*o+_],y=b===Mt||b===Bt;if(!(y&&!r))for(let S=0;S<t;S++)for(let C=0;C<t;C++){let w=0,$=0,v=0;for(let B=0;B<m;B++)for(let N=0;N<m;N++){let te=_+(C+(N+.5)/m)/t,W=g+(S+(B+.5)/m)/t,re=Yx(c,(te-u.offsetX)/u.scale,(W-u.offsetY)/u.scale,a);w+=re[0],$+=re[1],v+=re[2];}let R=m*m,P=[w/R,$/R,v/R],I=_+(C+.5)/t,T=g+(S+.5)/t,O=Math.min(I,T,o-I,o-T);O<1.5&&(P=Fn(P,a,.35*(1-O/1.5))),r&&(y||d(I,T))&&(P=Vr(P,a,h,false));let D=((g*t+S)*l+_*t+C)*3;f[D]=P[0],f[D+1]=P[1],f[D+2]=P[2];}}return {n:t,count:l,rgb:f}}function Mv(e,t,r){let{size:n,kinds:o,modules:i,fg:s,bg:a,t:c}=e,{n:u,count:l,rgb:f}=t,p=fe(s),m=fe(a),h=m-p,d=Iv(c,u),g=v=>.2126*f[v]+.7152*f[v+1]+.0722*f[v+2],_=new Float32Array(n*n),b=new Float32Array(n*n);for(let v=0;v<n;v++)for(let R=0;R<n;R++){let P=o[v*n+R];if(P===Mt){_[v*n+R]=m;continue}if(P===Bt){_[v*n+R]=i[v]?.[R]?p:m;continue}let I=0,T=0,O=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let N=g(((v*u+D)*l+R*u+B)*3);I+=N,r.under[D*u+B]||(T+=N,O++);}_[v*n+R]=I/(u*u),b[v*n+R]=O?T/O:I/(u*u);}let y=n+1,S=new Float64Array(y*y);for(let v=0;v<n;v++)for(let R=0;R<n;R++)S[(v+1)*y+R+1]=_[v*n+R]+S[v*y+R+1]+S[(v+1)*y+R]-S[v*y+R];let C=2,w=(v,R)=>{let P=Math.max(0,v-C),I=Math.max(0,R-C),T=Math.min(n,v+C+1),O=Math.min(n,R+C+1);return (S[O*y+T]-S[I*y+T]-S[O*y+P]+S[I*y+P])/((T-P)*(O-I))},$=r.weight;for(let v=0;v<n;v++)for(let R=0;R<n;R++){let P=o[v*n+R];if(P===Mt||P===Bt)continue;let I=P===jr,T=(d.margin+(I?.08:0))*h,O=(d.darkCap-(I?.12:0))*h,D=($*((r.light-r.dark)/2)-T)/(1-$),B=w(R,v),N=b[v*n+R],te=!!i[v]?.[R],W=0,re=a;if(te){let G=Math.min(B+D,p+O);N>G&&(W=(N-G)/Math.max(N-p,1e-6),re=s);}else {let G=Math.max(B-D,m-O);N<G&&(W=(G-N)/Math.max(m-N,1e-6));}if(!(W<=0)){W=Math.min(1,W);for(let G=0;G<u;G++)for(let ce=0;ce<u;ce++){let Ne=((v*u+G)*l+R*u+ce)*3;for(let Re=0;Re<3;Re++)f[Ne+Re]+=(re[Re]-f[Ne+Re])*W;}}}}function o$(e,t,r,n){let{count:o}=t,i=new zn;for(let c=0;c<o;c++){let u=0,l=r(c*o);for(let f=1;f<=o;f++){let p=f<o?r(c*o+f):null;(f===o||p!==l)&&(l&&i.cellRun(l,u,c,f-u),u=f,l=p);}}let s=e.pixelSize/t.n,a=Ge(e.margin*e.pixelSize);return k("g",{transform:`translate(${a} ${a}) scale(${Jx(s)})`,children:i.toElements(n)},n)}function m1(e,t){let r=Ks(e.version,e.size);return r.length===0?[]:[k("path",{d:e$(r,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function i$(e){let{image:t,size:r}=e;return Math.floor(Math.min(t.width,t.height)/r)>=4&&r<=45?4:3}var Tv=e=>2*a1*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function Ov(e,t,r){let n=t+1,o=new Float64Array(n*n);for(let s=0;s<t;s++)for(let a=0;a<t;a++)o[(s+1)*n+a+1]=e[s*t+a]+o[s*n+a+1]+o[(s+1)*n+a]-o[s*n+a];let i=new Float32Array(t*t);for(let s=0;s<t;s++)for(let a=0;a<t;a++){let c=Math.max(0,a-r),u=Math.max(0,s-r),l=Math.min(t,a+r+1),f=Math.min(t,s+r+1);i[s*t+a]=(o[f*n+l]-o[u*n+l]-o[f*n+c]+o[u*n+c])/((l-c)*(f-u));}return i}function s$(e,t,r,n){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=fe(a),l=fe(c),f=l-u,p=Ov(t,o,2),m=new Float32Array(o*o),h=new Float32Array(o*o).fill(Number.NaN);for(let d=0;d<o;d++)for(let g=0;g<o;g++){let _=d*o+g,b=i[_];if(b===Mt||b===Bt)continue;let y=b===jr,S=n.base+(y?.08:0),C=(n.margin+(y?.03:0))*f,w=(n.cap-(y?.04:0))*f,$=Gx(S),v=Gx(y?Math.max(n.max,.94):n.max),R=$*((n.dark+n.light)/2)+(1-$)*p[_],P=r[_],I=!!s[d]?.[g],T=I?n.dark:n.light,O=I?Math.min(R-C,u+w):Math.max(R+C,l-w),B=(I?P<=O:P>=O)?0:(P-O)/(P-T);B>v&&(B=v,h[_]=Math.min(l,Math.max(u,(O-v*T)/(1-v))));let N=I?P<=O-.06:P>=O+.06;n.skip&&N&&!y||(B=Math.max(B,$)),m[_]=B>0?Tv(B):0;}return {diameter:m,surround:h}}function Lv(e){let{size:t,kinds:r,modules:n,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=i$(e),l=n$(e,u,true),f=fe(o),p=fe(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,_=(w,$,v,R)=>(($*u+R)*d+w*u+v)*3,b=new Float32Array(t*t);for(let w=0;w<t;w++)for(let $=0;$<t;$++){let v=r[w*t+$];if(v===Mt||v===Bt){b[w*t+$]=v===Bt&&n[w]?.[$]?f:p;continue}let R=0;for(let P=0;P<u;P++)for(let I=0;I<u;I++){let T=_($,w,I,P);R+=.2126*g[T]+.7152*g[T+1]+.0722*g[T+2];}b[w*t+$]=R/(u*u);}let y=s$(e,b,b,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let w=0;w<t;w++)for(let $=0;$<t;$++){let v=y.surround[w*t+$];if(Number.isNaN(v))continue;let R=b[w*t+$],I=v<R?o:i,T=Math.min(1,Math.abs(R-v)/Math.max(Math.abs(R-fe(I)),1e-6));for(let O=0;O<u;O++)for(let D=0;D<u;D++){let B=_($,w,D,O);for(let N=0;N<3;N++)g[B+N]+=(I[N]-g[B+N])*T;}}let S=[o$(e,l,w=>{let $=w*3;return Number.isNaN(g[$])?null:ft([g[$],g[$+1],g[$+2]],8)},"art-photo")],C=new zn;for(let w=0;w<t;w++)for(let $=0;$<t;$++){let v=y.diameter[w*t+$];if(!(v>0))continue;let R=0,P=0,I=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let N=_($,w,B,D);R+=g[N],P+=g[N+1],I+=g[N+2];}let T=[R/(u*u),P/(u*u),I/(u*u)],O=n[w]?.[$]?Vr(T,o,m,true):Vr(T,i,h,false);C.circle(ft(O,10),($+a+.5)*c,(w+a+.5)*c,v/2*c);}return S.push(...C.toElements("art-dot"),...m1(e,ft(o))),S}function Nv(e){let{size:t,kinds:r,modules:n,fg:o,bg:i}=e,s=i$(e),a=n$(e,s),c=fe(o),u=fe(i),l=s%2===1?1:2,f=(s-l)/2,p=R=>R>=f&&R<f+l,m=[];for(let R=0;R<s;R++)for(let P=0;P<s;P++)m.push(p(P)&&p(R));Mv(e,a,{weight:$v(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),_=new Int8Array(h*h).fill(-1);for(let R=0;R<h*h;R++){let P=R*3;if(Number.isNaN(d[P])){g[R]=Number.NaN;continue}let I=(.2126*d[P]+.7152*d[P+1]+.0722*d[P+2]-c)/(u-c);g[R]=.5+(wv(0,1,I)-.5)*1.15;}for(let R=0;R<t;R++)for(let P=0;P<t;P++){let I=r[R*t+P];if(!(I===Mt||I===Bt))for(let T=f;T<f+l;T++)for(let O=f;O<f+l;O++)_[(R*s+T)*h+P*s+O]=n[R]?.[P]?0:1;}let b=f1(e.version);for(let R=0;R<h;R++)for(let P=0;P<h;P++){let I=R*h+P;_[I]<0&&b((P+.5)/s,(R+.5)/s)&&(_[I]=1);}let y=new Uint8Array(h*h),S=.3,C=0,w=0,$=(R,P,I)=>{if(R<0||R>=h||P>=h)return;let T=P*h+R;if(!Number.isNaN(g[T])){let O=Math.floor(R/s)===Math.floor(C/s)&&Math.floor(P/s)===Math.floor(w/s);g[T]+=O?I:I*S;}};for(let R=0;R<h;R++){let P=R%2===0?1:-1;for(let I=0;I<h;I++){let T=P===1?I:h-1-I,O=R*h+T,D=g[O];if(Number.isNaN(D))continue;let B=_[O]>=0?_[O]:D>=.5?1:0;y[O]=B===0?1:0;let N=Math.min(.75,Math.max(-0.75,D-B));C=T,w=R,$(T+P,R,N*7/16),$(T-P,R+1,N*3/16),$(T,R+1,N*5/16),$(T+P,R+1,N/16);}}let v=ft(o);return [o$(e,a,R=>y[R]?v:null,"art-halftone"),...m1(e,v)]}function jx(e,t){let r=null,n=0;for(let o of e.palette){if(t&&yv(o.color,t)<.02)continue;let i=o.area*(.35+qx(o.color))*(fe(o.color)>.86?.05:1);i>n&&(n=i,r=o.color);}return r}function a$(e,t,r,n,o){let i;if(e.photographic){let s=new zn,{width:a,height:c,rgb:u,alpha:l}=t;for(let f=0;f<c;f++){let p=0,m=null;for(let h=0;h<=a;h++){let d=f*a+h,g=h<a&&l[d]>=.5?ft(n([u[d*3],u[d*3+1],u[d*3+2]]),6):null;(h===a||g!==m)&&(m&&s.cellRun(m,p,f,h-p),p=h,m=g);}}i=s.toElements(`${o}-px`);}else i=e.layers.map((s,a)=>k("path",{d:s.d,fill:ft(n(s.color)),fillRule:"evenodd"},`${o}-${a}`));return k("g",{transform:`translate(${Ge(r.x)} ${Ge(r.y)}) scale(${Jx(r.scale)})`,children:i},o)}function Fv(e){let{art:t,image:r,size:n,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=u1(t,r),p=Kx(t,r,f),m=c1(f.width,f.height,n,"contain"),h=Math.min(1,.3+1.4*c),d=N=>Fn(a,N,h),g=ft(a),_=ft(s),b=[a$(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],y=r$,S=(N,te)=>Nn((N+u)*l,(te+u)*l,(y+.4)*l,(y+.4)*l,1.2*l),C=Ks(e.version,n).map(([N,te])=>Nn((N-2.5+u)*l,(te-2.5+u)*l,6*l,6*l,l*.8)).join("");b.push(k("path",{d:S(-0.4,-0.4)+S(n-y,-0.4)+S(-0.4,n-y)+C,fill:g},"art-plates"));let w=f1(e.version),$=fe(a),v=fe(s),R=new Float32Array(n*n),P=new Float32Array(n*n),I=new Array(n*n);for(let N=0;N<n;N++)for(let te=0;te<n;te++){let W=N*n+te,re=o[W];if(re===Mt||re===Bt){R[W]=re===Bt&&i[N]?.[te]?v:$;continue}let G=1,ce=0,Ne=0,Re=0,Z=0;for(let X=0;X<4;X++)for(let ye=0;ye<4;ye++){let Ce=te+(ye+.5)/4,rn=N+(X+.5)/4,xe=w(Ce,rn)?a:Yx(p,(Ce-m.offsetX)/m.scale,(rn-m.offsetY)/m.scale,a,h),nr=fe(xe);G=Math.min(G,nr),ce+=nr,Ne+=xe[0],Re+=xe[1],Z+=xe[2];}R[W]=ce/16,P[W]=G,I[W]=[Ne/16,Re/16,Z/16];}let T=v+.08*($-v),O=$-.04*($-v),D=s$(e,R,R,{base:.74-.26*c,max:.9,dark:T,light:O,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),B=new zn;for(let N=0;N<n;N++)for(let te=0;te<n;te++){let W=N*n+te,re=D.diameter[W],G=!!i[N]?.[te];if(!(re>0)||!G&&P[W]>=$-.02)continue;let ce=G?Vr(I[W],s,T,true):Vr(I[W],a,O,false);B.circle(ft(ce,8),(te+u+.5)*l,(N+u+.5)*l,re/2*l);}return b.push(...B.toElements("art-dot")),b.push(...m1(e,_)),b}var zv={L:.5,M:.72,Q:.88,H:1},c$=.32,u$=.55,Dv=.6,Bv=2;function l$(e,t,r){let n=t>=1?e:e*t,o=t>=1?e/t:e,i=Math.max(.7,e*.09),s=n+2*i,a=o+2*i;return {logoW:n,logoH:o,plateW:s,plateH:a,radius:Math.min(s,a)*.26,cx:r/2,cy:r/2}}var f$=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function m$(e,t,r){return d$(t+.5,r+.5,e)<u$}function Zv(e,t){let r=f$(e),n=u$+1,o=Math.max(0,Math.floor(e.cx-e.plateW/2-n)),i=Math.min(t-1,Math.ceil(e.cx+e.plateW/2+n)),s=Math.max(0,Math.floor(e.cy-e.plateH/2-n)),a=Math.min(t-1,Math.ceil(e.cy+e.plateH/2+n)),c=[];for(let u=s;u<=a;u++)for(let l=o;l<=i;l++)m$(r,l,u)&&c.push(u*t+l);return c}var Uv=e=>Math.floor(e.correctable*Dv);function n1(e,t,r){let n=l$(e,t,r.size),o=Uv(r);return Xs(r,Zv(n,r.size)).every(i=>i<=o)}function p$(e,t,r){if(n1(r,t,e))return r;let n=0,o=r;if(!n1(n,t,e))return -1;for(;o-n>1/64;){let i=(n+o)/2;n1(i,t,e)?n=i:o=i;}return n}var Ku=new Map;function Gv(e,t){let r=`${e.version}${e.level}:${t.toFixed(3)}`,n=Ku.get(r);return n===void 0&&(n=p$(e,t,c$*e.size),Ku.size>=64&&Ku.clear(),Ku.set(r,n)),n}function Qv(e,t){let{size:r,t:n,modules:o,version:i}=e,s=bv(o),a=(.18+.15*n)*zv[s],c=t.width/t.height,u=Math.min(c$,a)*r,l=qs(i,s),f=Math.max(0,Gv(l,c));if(f<Bv)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=p$(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:l$(p,c,r)}}function d$(e,t,r){let n=Math.abs(e-r.cx)-(r.w/2-r.r),o=Math.abs(t-r.cy)-(r.h/2-r.r);return Math.hypot(Math.max(n,0),Math.max(o,0))+Math.min(Math.max(n,o),0)-r.r}function h$(e,t){let{fg:r,bg:n,t:o}=e,i=fe(r),s=fe(n),a=jx(t),c=Math.min(1,o/.6),u=a?Vr(a,r,i+.3*(s-i),true):r,l=Fn(r,u,c),f=a?jx(t,a):null,p=i+.42*(s-i),m=f&&fe(f)<=p+.22?Fn(r,Vr(f,r,p,true),c):l;return {body:l,inner:m}}function jv(e){let{art:t,image:r,size:n,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=u1(t,r),f=Qv(e,l).plate,{body:p}=h$(e,l),m=ft(p),h=f&&f$(f),d=i.map(I=>[...I]);for(let I=0;I<n;I++)for(let T=0;T<n;T++){let O=o[I*n+T];(O===Bt||h&&O!==Mt&&m$(h,T,I))&&(d[I][T]=false);}let g=[],_=e.body?.(d);if(_)g.push(k("g",{fill:m,children:_},"art-body"));else {let I=new zn;for(let T=0;T<n;T++)for(let O=0;O<n;O++)d[T]?.[O]&&o[T*n+O]!==Mt&&I.circle(m,(O+a+.5)*c,(T+a+.5)*c,.45*c);g.push(...I.toElements("art-body"));}let b=Ks(u,n).filter(([I,T])=>!h||d$(I+.5,T+.5,h)>3.2);if(b.length>0&&g.push(k("path",{d:e$(b,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let y=Kx(t,r,l),S=(f.cx-f.plateW/2+a)*c,C=(f.cy-f.plateH/2+a)*c,w=f.plateW*c,$=f.plateH*c,v=f.radius*c,R=.1*c,P=Nn(S,C,w,$,v);return g.push(k("path",{d:P,fill:ft(s)},"art-plate"),k("path",{d:P+Nn(S+R,C+R,w-2*R,$-2*R,v-R),fill:ft(Fn(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),a$(l,y,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},I=>I,"art-logo")),g}function p1(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let r=t.image&&i1(t.image);if(!r)return null;let n=ci(e.fgColor,[0,0,0]),o=ci(e.bgColor,[1,1,1]),i=t$(t,n,o);if(i<=0)return null;let s=u1(t,r);if(s.palette.length===0)return null;if(el(t)==="badge"){let{body:h,inner:d}=h$({fg:n,bg:o,t:i},s),g={outer:ft(h),inner:ft(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=fe(n),c=fe(o),u=Math.min(1,i/.6),l=e.version*4+17,f=c1(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,_=(d-f.offsetY)/f.scale,b=null,y=0;for(let C of s.palette){if(fe(C.color)>.86)continue;let w=(C.cx-g)**2+(C.cy-_)**2,$=C.area*(.35+qx(C.color))*Math.exp(-w/(2*p**2));$>y&&(y=$,b=C.color);}if(!b)return {};let S=Vr(b,n,a+.42*(c-a),true);return {inner:ft(Fn(n,S,u))}};return {topLeft:m(3.5,3.5),topRight:m(l-3.5,3.5),bottomLeft:m(3.5,l-3.5)}}var Vv=16384;var g$=e=>e*3+3&-4,d1=(e,t)=>Math.floor((e*t+255*(255-t)+127)/255);function h1(e,t,r){if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>16384||r>16384)throw new RangeError(`BMP width and height must be whole numbers from 1 to 16384, got ${t} x ${r}`);if(e.length!==t*r*4)throw new RangeError(`Expected ${t*r*4} RGBA bytes for ${t} x ${r}, got ${e.length}`);let n=g$(t),o=n*r,i=new Uint8Array(54+o),s=new DataView(i.buffer);i[0]=66,i[1]=77,s.setUint32(2,i.length,true),s.setUint32(10,54,true),s.setUint32(14,40,true),s.setInt32(18,t,true),s.setInt32(22,r,true),s.setUint16(26,1,true),s.setUint16(28,24,true),s.setUint32(30,0,true),s.setUint32(34,o,true),s.setInt32(38,2835,true),s.setInt32(42,2835,true);for(let a=0;a<r;a++){let c=a*t*4,u=54+(r-1-a)*n;for(let l=0;l<t;l++){let f=e[c+3],p=e[c],m=e[c+1],h=e[c+2];f===255?(i[u]=h,i[u+1]=m,i[u+2]=p):(i[u]=d1(h,f),i[u+1]=d1(m,f),i[u+2]=d1(p,f)),c+=4,u+=3;}}return i}function g1(e){if(e.length<54||e[0]!==66||e[1]!==77)return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getInt32(18,true),n=t.getInt32(22,true);return t.getUint32(2,true)===e.length&&t.getUint32(10,true)===54&&t.getUint32(14,true)===40&&r>0&&n>0&&t.getUint16(26,true)===1&&t.getUint16(28,true)===24&&t.getUint32(30,true)===0&&e.length===54+g$(r)*n}function tl(e){let t=e.getContext("2d");if(!t)throw new Error("Could not get canvas context");let{data:r}=t.getImageData(0,0,e.width,e.height),n=h1(r,e.width,e.height);if(!g1(n))throw new Error("Could not write a BMP file");return new Blob([n],{type:"image/bmp"})}function ue(e){if(e.length===0)return "";let[t,...r]=e;return `M${x(t[0])} ${x(t[1])}${r.map(([n,o])=>`L${x(n)} ${x(o)}`).join("")}Z`}function me(e,t,r){return `M${x(e-r)} ${x(t)}A${x(r)} ${x(r)} 0 1 1 ${x(e+r)} ${x(t)}A${x(r)} ${x(r)} 0 1 1 ${x(e-r)} ${x(t)}Z`}function Q(e,t,r,n,o=0){let i=Math.min(r,n)/2,[s,a,c,u]=(typeof o=="number"?[o,o,o,o]:o).map(f=>Math.max(0,Math.min(f,i))),l=(f,p,m)=>f>0?`A${x(f)} ${x(f)} 0 0 1 ${x(p)} ${x(m)}`:"";return `M${x(e+s)} ${x(t)}H${x(e+r-a)}${l(a,e+r,t+a)}V${x(t+n-c)}${l(c,e+r-c,t+n)}H${x(e+u)}${l(u,e,t+n-u)}V${x(t+s)}${l(s,e+s,t)}Z`}function _1(e,t,r,n){return [[e+n,t],[e+r-n,t],[e+r,t+n],[e+r,t+r-n],[e+r-n,t+r],[e+n,t+r],[e,t+r-n],[e,t+n]]}function ui(e,t,r,n,o=-90){return Array.from({length:n},(i,s)=>{let a=(o+360/n*s)*Math.PI/180;return [e+r*Math.cos(a),t+r*Math.sin(a)]})}function li(e,t,r,n,o=5){return Array.from({length:o*2},(i,s)=>{let a=s%2===0?r:n,c=-Math.PI/2+Math.PI/o*s;return [e+a*Math.cos(c),t+a*Math.sin(c)]})}function fi(e,t,r,n,o=4,i=64){return Array.from({length:i},(s,a)=>{let c=2*Math.PI*a/i,u=Math.cos(c),l=Math.sin(c);return [e+r*Math.sign(u)*Math.abs(u)**(2/o),t+n*Math.sign(l)*Math.abs(l)**(2/o)]})}function mi(e,t,r){let n=r/2,o=(i,s)=>`${x(e+i*n)} ${x(t+s*n)}`;return `M${o(0,-0.52)}C${o(.18,-0.92)} ${o(.98,-0.94)} ${o(1,-0.34)}C${o(1,.12)} ${o(.5,.48)} ${o(0,.92)}C${o(-0.5,.48)} ${o(-1,.12)} ${o(-1,-0.34)}C${o(-0.98,-0.94)} ${o(-0.18,-0.92)} ${o(0,-0.52)}Z`}function _$(e,t,r,n){if(n===0)return e;let o=n*Math.PI/180,i=Math.cos(o),s=Math.sin(o);return e.map(([a,c])=>[t+(a-t)*i-(c-r)*s,r+(a-t)*s+(c-r)*i])}function rl(e,t,r=0){let n=Math.imul(e+2654435769,2246822507)^Math.imul(t+r,3266489909);return n=Math.imul(n^n>>>15,739982445),n=Math.imul(n^n>>>12,695872825),n^=n>>>15,(n>>>0)/4294967296}function Dn(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0).toString(36)}function b1(e,t,r,n,o){let i=Math.max(0,Math.min(o,Math.min(r,n)/2)),s=(a,c)=>`A${x(i)} ${x(i)} 0 0 0 ${x(a)} ${x(c)}`;return `M${x(e+i)} ${x(t)}H${x(e+r-i)}${s(e+r,t+i)}V${x(t+n-i)}${s(e+r-i,t+n)}H${x(e+i)}${s(e,t+n-i)}V${x(t+i)}${s(e+i,t)}Z`}function nl(e,t,r,n,o){let i=Math.max(0,Math.min(o,Math.min(r,n)/2));return ue([[e+i,t],[e+r-i,t],[e+r-i,t+i],[e+r,t+i],[e+r,t+n-i],[e+r-i,t+n-i],[e+r-i,t+n],[e+i,t+n],[e+i,t+n-i],[e,t+n-i],[e,t+i],[e+i,t+i]])}function Js(e,t,r,n,o){let i=n,s=r/2,a=(s-i)*.55,c=(u,l)=>`${x(e+u)} ${x(t+l)}`;return `M${c(i,0)}C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}C${c(s+a,o)} ${c(r-i-a,0)} ${c(r-i,0)}A${x(i)} ${x(i)} 0 0 1 ${c(r,i)}C${c(r,i+a)} ${c(r-o,s-a)} ${c(r-o,s)}C${c(r-o,s+a)} ${c(r,r-i-a)} ${c(r,r-i)}A${x(i)} ${x(i)} 0 0 1 ${c(r-i,r)}C${c(r-i-a,r)} ${c(s+a,r-o)} ${c(s,r-o)}C${c(s-a,r-o)} ${c(i+a,r)} ${c(i,r)}A${x(i)} ${x(i)} 0 0 1 ${c(0,r-i)}C${c(0,r-i-a)} ${c(o,s+a)} ${c(o,s)}C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}A${x(i)} ${x(i)} 0 0 1 ${c(i,0)}Z`}function y1(e,t,r,n,o,i){let s=r/2,a=(c,u)=>`${x(e+c)} ${x(t+u)}`;return `M${a(n,0)}H${x(e+r-n)}A${x(n)} ${x(n)} 0 0 1 ${a(r,n)}V${x(t+o)}C${a(r,o+1.55*i)} ${a(s+1.6*i,r)} ${a(s,r)}C${a(s-1.6*i,r)} ${a(0,o+1.55*i)} ${a(0,o)}V${x(t+n)}A${x(n)} ${x(n)} 0 0 1 ${a(n,0)}Z`}var Hv=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function b$(e){return Hv.includes(e)}var y$={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 ol(e,t){if(e===void 0||!Number.isFinite(e))return 1;let r=t?y$[t]??1:mo;return Math.min(Oi,Math.max(mo,r,e))}function Wv(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}function qv(e,t){if(e===1)return [];let r=Math.floor(e/7)+2,n=e===32?26:Math.ceil((e*4+4)/(r*2-2))*2,o=[6];for(let i=t-7;o.length<r;i-=n)o.splice(1,0,i);return o}function x1(e){let t=(e-17)/4,r=Number.isInteger(t)?qv(t,e):[],n=r.length-1,o=[];for(let[i,s]of r.entries())for(let[a,c]of r.entries())i===0&&a===0||i===0&&a===n||i===n&&a===0||o.push([s,c]);return (i,s)=>o.some(([a,c])=>Math.abs(i-a)<=2&&Math.abs(s-c)<=2)}var Xv={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:e=>e===0||e===2?1:0,fillets:false},"classy-rounded":{horizontal:true,vertical:true,thickness:1,radius:e=>e===0||e===2?1:.4,fillets:false}};function Yv(e,t,r,n,o,i){switch(e){case "horizontal-line":{let s=n*.43;return Q(t-n/2,r-s,n,2*s)}case "leaf":{let s=n*.5;return Q(t-s,r-s,2*s,2*s,[n*.4,n*.05,n*.4,n*.05])}case "plus":{let s=n*.22,a=n*.5;return ue([[t-s,r-a],[t+s,r-a],[t+s,r-s],[t+a,r-s],[t+a,r+s],[t+s,r+s],[t+s,r+a],[t-s,r+a],[t-s,r+s],[t-a,r+s],[t-a,r-s],[t-s,r-s]])}case "hexagon":return ue(ui(t,r,n*.54,6));case "star":return ue(li(t,r+n*.04,n*.62,n*.34));case "heart":return mi(t,r+n*.02,n*1.08);case "random-dots":return me(t,r,n*(.38+.15*rl(o,i)));case "mosaic":{let s=n*(.8+.14*rl(o,i,1))/2,a=[[t-s,r-s],[t+s,r-s],[t+s,r+s],[t-s,r+s]];return ue(_$(a,t,r,(rl(o,i,2)-.5)*16))}case "octagon":return ue(ui(t,r,n*.48/Math.cos(Math.PI/8),8,22.5));default:return me(t,r,n*.45)}}function x$(e,t){let{margin:r,pixelSize:n,pattern:o}=t,i=ol(t.scale,o),s=e.length,a=t.plain?()=>false:x1(s),c=(d,g)=>!t.plain&&Wv(d,g,s),u=(d,g)=>d>=0&&g>=0&&d<s&&g<s&&!!e[g]?.[d]&&!c(d,g),l=d=>(d+.5+r)*n,f=[],p=[],m=Xv[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let _=l(g),b=l(d);if(a(g,d)){f.push(M`M${_-n/2} ${b-n/2}h${n}v${n}h${-n}z`);continue}if(!m){p.push(Yv(o,_,b,n*i,g,d));continue}let y=n*m.thickness*i/2,S=m.horizontal&&u(g+1,d),C=m.horizontal&&u(g-1,d),w=m.vertical&&u(g,d-1),$=m.vertical&&u(g,d+1),R=[!(w||C),!(w||S),!($||S),!($||C)].map((P,I)=>P?y*m.radius(I):0);p.push(Q(_-y,b-y,2*y,2*y,R)),2*y<n&&(S&&p.push(Q(_,b-y,n,2*y)),$&&p.push(Q(_-y,b,2*y,n)));}if(m?.fillets&&i===1){let d=n*.3;for(let g=0;g<s;g++)for(let _=0;_<s;_++){if(u(_,g)||c(_,g))continue;let b=l(_)-n/2,y=l(g)-n/2,S=b+n,C=y+n;u(_-1,g)&&u(_,g-1)&&u(_-1,g-1)&&p.push(M`M${b} ${y}h${d}A${d} ${d} 0 0 0 ${b} ${y+d}Z`),u(_+1,g)&&u(_,g-1)&&u(_+1,g-1)&&p.push(M`M${S} ${y}v${d}A${d} ${d} 0 0 0 ${S-d} ${y}Z`),u(_+1,g)&&u(_,g+1)&&u(_+1,g+1)&&p.push(M`M${S} ${C}h${-d}A${d} ${d} 0 0 0 ${S} ${C-d}Z`),u(_-1,g)&&u(_,g+1)&&u(_-1,g+1)&&p.push(M`M${b} ${C}v${-d}A${d} ${d} 0 0 0 ${b+d} ${C}Z`);}}let h=[];return p.length>0&&h.push(k("path",{d:p.join("")},"modules")),f.length>0&&h.push(k("path",{d:f.join("")},"alignment")),h}var x9=(e,t,r,n)=>{let o=document.createElement("canvas");o.width=t,o.height=r;let i=o.getContext("2d");if(!i)return;i.putImageData(e,0,0);let s=o.toDataURL("image/png"),a=document.createElement("a");a.href=s,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a);},Kv=async(e,t,r,n)=>{let{default:o}=await import('jsqr');return new Promise(i=>{e.complete?s():(e.onload=()=>s(),e.onerror=()=>i(null));function s(){let a=document.createElement("canvas");requestAnimationFrame(()=>{if(!(e.naturalWidth&&e.naturalHeight)){i(null);return}let c=e.naturalWidth/e.naturalHeight<=.33||e.naturalWidth/e.naturalHeight>=3?Math.sqrt(e.naturalWidth*e.naturalHeight/12e5):e.naturalWidth/e.naturalHeight<=.5||e.naturalWidth/e.naturalHeight>=2?Math.sqrt(e.naturalWidth*e.naturalHeight/9e5):Math.sqrt(e.naturalWidth*e.naturalHeight/64e4),u=a.getContext("2d",{willReadFrequently:true});if(!u){i(null);return}let l=[1,.8,.6,.4,.2,.1];for(let f of l){let p=Math.floor(e.naturalWidth*t*f/c),m=Math.floor(e.naturalHeight*t*f/c);a.width=p,a.height=m,u.clearRect(0,0,p,m),u.imageSmoothingEnabled=true,u.imageSmoothingQuality="high";try{u.drawImage(e,Math.floor(r),Math.floor(n),Math.floor(e.naturalWidth*t),Math.floor(e.naturalHeight*t),0,0,p,m);let h=u.getImageData(0,0,p,m);try{let d=o(h.data,p,m);if(d?.data){i(d);return}}catch(d){console.error("QR Detection error:",d);}}catch(h){console.error("Canvas drawing error:",h);}}i(null);});}})},$$=async(e,t,r=false)=>{if(!e)return "NO_QR";await new Promise(o=>setTimeout(o,100));let n=[{dx:0,dy:0,ratio:1},{dx:0,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:e.naturalHeight*.35,ratio:.65},{dx:e.naturalWidth*.35,dy:0,ratio:.65},{dx:e.naturalWidth*.35/2,dy:e.naturalHeight*.35/2,ratio:.65}];for(let o of n)try{let i=await Kv(e,o.ratio,o.dx,o.dy);if(i?.data)return r?i:i.data}catch(i){console.warn("QR decode error:",i);}return "NO_QR"};function $9(e,t,r){if(!(e&&t)||t.length!==4)return;let n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;let o=n.getContext("2d");if(!o)return;o.drawImage(e,0,0),o.save(),o.strokeStyle="#ff0000",o.lineWidth=Math.max(5,Math.min(e.naturalWidth,e.naturalHeight)/200),o.shadowColor="transparent",o.shadowBlur=0,o.beginPath(),o.moveTo(t[0].x,t[0].y),o.lineTo(t[1].x,t[1].y),o.lineTo(t[3].x,t[3].y),o.lineTo(t[2].x,t[2].y),o.closePath(),o.stroke(),o.fillStyle="#ff0000",t.forEach((a,c)=>{o.fillRect(a.x-3,a.y-3,6,6),o.fillStyle="#ffffff",o.font="16px Arial",o.fillText(`${c}`,a.x+5,a.y-5),o.fillStyle="#ff0000";}),o.restore();let i=n.toDataURL("image/png"),s=document.createElement("a");s.href=i,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s);}var $1=(e,t=0)=>{for(let r=t;r<e.length;r++)if(e[r]?.continue!==true)return true;return false};function Hr(e,t=[],r={}){return {...r,run(n){let o=e({value:n,issues:[]}),i=$1(o.issues);for(let s of t){if(s.hasLength){let c=o.value;if(o.issues.some(u=>u.continue===false)||c===null||c===void 0||c.length===void 0)continue}else if(i)continue;let a=o.issues.length;s.run(o),!i&&o.issues.length>a&&(i=$1(o.issues,a));}return o}}}function Jv(e){if(typeof e=="number")return Number.isNaN(e)?"NaN":Number.isFinite(e)?"number":String(e);if(e===null)return "null";if(Array.isArray(e))return "array";if(typeof e=="object"){let t=e.constructor;if(Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&t)return t.name}return typeof e}var Zn=(e,t)=>({path:[],message:`Invalid input: expected ${e}, received ${Jv(t)}`}),eA={string:"characters",array:"items"};function gr(e,t,r,n){let o=eA[t],i=e?"Too big":"Too small",s=`${e?"<=":">="}${r}`;return {path:[],message:o?`${i}: expected ${t} to have ${s} ${o}`:`${i}: expected ${t} to be ${s}`,continue:n}}var w1=e=>typeof e=="string"?`"${e}"`:`${e}`,v$=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function A1(e,t,r){for(let n of r)n.path.unshift(t),e.push(n);}var tA=e=>e>=55296&&e<=56319,rA=e=>e>=56320&&e<=57343;function nA(e){let t=e.length;for(let r=0;r<e.length-1;r++)tA(e.charCodeAt(r))&&rA(e.charCodeAt(r+1))&&(t--,r++);return t}var A$=e=>Array.isArray(e)?"array":typeof e=="string"?"string":"unknown",ra=e=>({run(t){t.value<e&&t.issues.push(gr(false,"number",e,true));}}),na=e=>({run(t){t.value>e&&t.issues.push(gr(true,"number",e,true));}}),hi=(e,t="Invalid input")=>({run(r){e(r.value)||r.issues.push({path:[],message:t,continue:true});}}),E$=e=>typeof e=="string"?nA(e):e.length,R$=e=>({hasLength:true,run(t){let r=t.value;E$(r)<e&&t.issues.push(gr(false,A$(r),e,true));}}),E1=e=>({hasLength:true,run(t){let r=t.value;E$(r)>e&&t.issues.push(gr(true,A$(r),e,true));}}),P$=(e,t)=>({run(r){e.lastIndex=0,e.test(r.value)||r.issues.push({path:[],message:t??`Invalid string: must match pattern ${e}`,continue:true});}}),oA={run(e){let t=e.value;Number.isInteger(t)?Number.isSafeInteger(t)||e.issues.push(t>0?gr(true,"int",Number.MAX_SAFE_INTEGER,true):gr(false,"int",Number.MIN_SAFE_INTEGER,true)):e.issues.push({...Zn("int",t),continue:false});}},Un=(...e)=>Hr(t=>{let r=t.value;return typeof r=="number"&&Number.isFinite(r)||t.issues.push(Zn("number",r)),t},e),k$=(...e)=>Un(oA,...e),il=(...e)=>Hr(t=>(typeof t.value!="string"&&t.issues.push(Zn("string",t.value)),t),e);function Ot(e){let t=e.length===1?`Invalid input: expected ${w1(e[0])}`:`Invalid option: expected one of ${e.map(w1).join("|")}`;return Hr(r=>(e.includes(r.value)||r.issues.push({path:[],message:t}),r),[],{values:e})}var Tt=e=>Ot([e]),Ae=e=>({optional:true,run:t=>t===void 0?{value:t,issues:[]}:e.run(t)});function ze(e,t=[]){let r=Object.keys(e),n=new Set(r);return Hr(o=>{let i=o.value;if(!v$(i))return o.issues.push(Zn("object",i)),o;let s={};for(let c of r){let u=e[c],l=u.run(i[c]),f=c in i;A1(o.issues,c,l.issues),f||u.optional||l.issues.length>0||o.issues.push({path:[c],message:"Invalid input: expected nonoptional, received undefined"}),f&&(s[c]=l.value);}o.value=s;let a=[];for(let c in i)n.has(c)||a.push(c);return a.length>0&&o.issues.push({path:[],message:`Unrecognized key${a.length>1?"s":""}: ${a.map(w1).join(", ")}`,continue:true}),o},t,{shape:e})}function S1(e,t,r){let n=[];return t!==void 0&&n.push(R$(t)),r!==void 0&&n.push(E1(r)),Hr(o=>{let i=o.value;if(Array.isArray(i)&&r!==void 0&&i.length>r)return o.issues.push(gr(true,"array",r,false)),o;if(!Array.isArray(i))return o.issues.push(Zn("array",i)),o;let s=new Array(i.length);for(let a=0;a<i.length;a++){let c=e.run(i[a]);A1(o.issues,a,c.issues),s[a]=c.value;}return o.value=s,o},n)}function C1(e){return Hr(t=>{let r=t.value;if(!Array.isArray(r))return t.issues.push(Zn("tuple",r)),t;if(r.length<e.length)return t.issues.push(gr(false,"array",e.length,void 0)),t;r.length>e.length&&t.issues.push(gr(true,"array",e.length,void 0));let n=[];return e.forEach((o,i)=>{let s=o.run(r[i]);A1(t.issues,i,s.issues),n[i]=s.value;}),t.value=n,t})}function di(e){return Hr(t=>{let r=[];for(let o of e){let i=o.run(t.value);if(i.issues.length===0)return i;r.push(i);}let n=r.filter(o=>!$1(o.issues));return n.length===1?n[0]:(t.issues.push({path:[],message:"Invalid input"}),t)})}function I$(e,t){let r=new Map;for(let o of t)for(let i of o.shape?.[e]?.values??[])r.set(i,o);let n=`Invalid discriminator value. Expected ${[...r.keys()].map(o=>`'${o}'`).join(" | ")}`;return Hr(o=>{let i=o.value;if(!v$(i))return o.issues.push(Zn("object",i)),o;let s=r.get(i[e]);return s?s.run(i):(o.issues.push({path:[e],message:n}),o)})}var iA=hi(Rr,`Numbers may have at most ${J.maxDecimals} decimals`),al=[ra(-J.maxCoordinate),na(J.maxCoordinate),iA],Qe=Un(...al),rt=Un(...al,hi(e=>e>0,"Must be greater than 0")),sl=Un(...al,hi(e=>e>=0,"Must not be negative")),ta=il(P$(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),w$=di([Ot(Ui),ta]),M$=e=>ze({mix:C1([e,e]),amount:Un(ra(0),na(1),hi(Rr))}),pi=di([w$,M$(w$)]),sA=di([ta,M$(di([Ot(["frame","accent","background"]),ta]))]),Bn=di([pi,ze({gradient:ze({from:pi,to:pi,direction:Ae(Ot(["horizontal","vertical"])),steps:Ae(k$(ra(2),na(J.maxGradientSteps)))})})]),v1=()=>({x:Qe,y:Qe,width:rt,height:rt}),ea=ze({color:pi,width:rt}),aA=I$("type",[ze({type:Tt("rect"),...v1(),radius:Ae(sl),fill:Bn,hole:Ae(ze({...v1(),radius:Ae(sl)})),stroke:Ae(ea)}),ze({type:Tt("circle"),cx:Qe,cy:Qe,r:rt,hole:Ae(rt),fill:Bn,stroke:Ae(ea)}),ze({type:Tt("ellipse"),cx:Qe,cy:Qe,rx:rt,ry:rt,fill:Bn,stroke:Ae(ea)}),ze({type:Tt("polygon"),points:S1(C1([Qe,Qe]),3,J.maxPolygonPoints),fill:Bn,stroke:Ae(ea)}),ze({type:Tt("path"),d:il(R$(2),E1(J.maxPathLength)),fill:Bn,fillRule:Ae(Ot(["nonzero","evenodd"])),stroke:Ae(ea)}),ze({type:Tt("line"),x1:Qe,y1:Qe,x2:Qe,y2:Qe,width:rt,cap:Ae(Ot(["butt","round"])),dash:Ae(C1([rt,rt])),fill:Bn}),ze({type:Tt("icon"),icon:Ot(Bi),x:Qe,y:Qe,size:rt,fill:Bn})]),S$=()=>({id:il(P$(/^[a-z][a-z0-9-]{0,31}$/)),slot:Ot(["primary","secondary","fixed"]),text:il(E1(200)),maxLength:Ae(k$(ra(1),na(pt))),color:pi,weight:Ae(Ot(["bold","regular"])),collapse:Ae(ze({y:Qe,height:rt}))}),cA=I$("type",[ze({type:Tt("text"),...S$(),box:ze(v1()),align:Ae(Ot(["start","middle","end"])),fontSize:Ae(rt)}),ze({type:Tt("curved"),...S$(),curve:ze({cx:Qe,cy:Qe,radius:rt,side:Ot(["top","bottom"]),spread:Ae(Un(ra(20),na(300),hi(Rr)))}),fontSize:rt})]),C$=Un(...al,hi(e=>e>=J.minArtboard&&e<=J.maxArtboard,`Artboard sides must be ${J.minArtboard} to ${J.maxArtboard} units`)),uA=ze({kind:Tt(mn),version:Tt(pn),artboard:ze({width:C$,height:C$}),qr:ze({x:Qe,y:Qe,size:rt,padding:Ae(sl),radius:Ae(sl),plate:Ae(Ot(["opaque","background","none"]))}),colors:ze({frame:ta,text:Ae(sA),accent:Ae(ta)}),shapes:S1(aA,void 0,J.maxShapes),labels:S1(cA,void 0,J.maxLabels),bleed:Ae(di([Tt("none"),pi]))},[{run(e){Da(e.value,(t,r=[])=>{e.issues.push({path:[...r],message:t,continue:true});});}}]);function cl(e){let t=uA.run(e);return t.issues.length===0?{success:true,data:t.value}:{success:false,issues:t.issues.map(({path:r,message:n})=>({path:r,message:n}))}}var T$=({path:e,message:t})=>e.length>0?`${e.join(".")}: ${t}`:t;var R1=24,Wr=(e,t,r,n)=>{let o=n*Math.PI/180;return [e+r*Math.cos(o),t+r*Math.sin(o)]},ul=([e,t])=>`${x(e)} ${x(t)}`;function gi(e,t,r,n,o,i){let s=i-o>180?1:0;return `M${ul(Wr(e,t,n,o))}A${x(n)} ${x(n)} 0 ${s} 1 ${ul(Wr(e,t,n,i))}L${ul(Wr(e,t,r,i))}A${x(r)} ${x(r)} 0 ${s} 0 ${ul(Wr(e,t,r,o))}Z`}function oa(e,t,r,n){return `M${x(e-r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e+r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e-r)} ${x(t)}Z`}function lA(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),t/2}function O$(e){return ue(lA(e)<0?[...e].reverse():e)}function ll(e,t,r,n,o){let i=Math.hypot(r-e,n-t)||1,s=-(n-t)/i*(o/2),a=(r-e)/i*(o/2);return O$([[e+s,t+a],[r+s,n+a],[r-s,n-a],[e-s,t-a]])}var mt=(...e)=>({d:e.join(""),fillRule:"nonzero"}),_r=(...e)=>({d:e.join(""),fillRule:"evenodd"});function fA(){let e=[];for(let t of [0,60,120]){let[r,n]=Wr(12,12,10.5,t+180),[o,i]=Wr(12,12,10.5,t);e.push(ll(r,n,o,i,2));}for(let t=0;t<6;t++){let r=t*60,[n,o]=Wr(12,12,6.2,r);for(let i of [-45,45]){let[s,a]=Wr(n,o,3.6,r+i);e.push(ll(n,o,s,a,1.7));}}return mt(...e)}var mA={wifi:()=>mt(gi(12,20,4.6,7.2,-135,-45),gi(12,20,9.2,11.8,-135,-45),gi(12,20,13.8,16.4,-135,-45),me(12,20,2.2)),star:()=>mt(ue(li(12,12.8,11.6,4.8))),heart:()=>mt(mi(12,12.4,22)),phone:()=>_r(Q(6,1.5,12,21,2.6),Q(7.8,4.2,8.4,13.4,.6),me(12,19.8,1.1)),headphones:()=>mt(gi(12,13,7.6,9.8,-180,0),Q(2,12,5,9.5,2),Q(17,12,5,9.5,2)),calendar:()=>_r(Q(2.5,4,19,17.5,2.5),Q(4.6,9,14.8,10.6,.8),Q(7,11.4,2.6,2.6,.4),Q(10.7,11.4,2.6,2.6,.4),Q(14.4,11.4,2.6,2.6,.4),Q(7,15.1,2.6,2.6,.4),Q(10.7,15.1,2.6,2.6,.4),Q(6.5,1.4,2.4,2.6,[1.2,1.2,0,0]),Q(15.1,1.4,2.4,2.6,[1.2,1.2,0,0])),user:()=>mt(me(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:()=>_r(Q(2,3,20,14,4),ue([[6.5,17],[11.5,17],[5.8,21.8]]),me(7.5,10,1.5),me(12,10,1.5),me(16.5,10,1.5)),bag:()=>mt(Q(3.5,7.5,17,14.5,2),gi(12,7.5,3.1,4.8,-180,0)),bell:()=>mt("M3.5 17.2A8.5 8.5 0 0 1 20.5 17.2Z",Q(1.5,18.2,21,2.6,1.3),Q(11.2,6.6,1.6,2.6,0),Q(9.8,4.6,4.4,2.4,1.2)),cup:()=>mt("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",gi(17,10.2,1.7,3.6,-90,90),Q(2,20.6,17,2,1),Q(7,1.6,1.6,3.4,.8),Q(11.6,1.6,1.6,3.4,.8)),card:()=>_r(Q(1.5,4.5,21,15,2.5),Q(1.5,8,21,3,0),Q(4.5,13.6,4.6,3.2,.6)),check:()=>_r(me(12,12,10.5),ue([[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:()=>_r(me(12,12,10.5),me(12,7.2,1.6),Q(10.6,10,2.8,8,.8)),home:()=>_r(ue([[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]]),Q(10,14.5,4,7,[.6,.6,0,0])),pin:()=>_r("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",me(12,9.5,3)),share:()=>mt(ll(6,12,18,5,1.8),ll(6,12,18,19,1.8),me(18,5,3.2),me(6,12,3.2),me(18,19,3.2)),download:()=>mt(Q(10.6,2,2.8,9.5,0),ue([[6,10],[18,10],[12,16.5]]),ue([[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:()=>_r(me(12,12,10.5),me(12,12,8.4),ue([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:fA,pumpkin:()=>mt(oa(7.8,14.6,5.8,6.9),oa(16.2,14.6,5.8,6.9),oa(12,14.6,4.8,7.4),Q(10.9,3.4,2.2,4.6,.8),O$([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>mt(ue([[12,1.5],[16.8,8.2],[7.2,8.2]]),ue([[12,5.2],[19,13.6],[5,13.6]]),ue([[12,9.4],[21.2,19.2],[2.8,19.2]]),Q(10.4,18.6,3.2,3.9,.4)),sparkle:()=>mt(ue(li(9.5,13.5,9,2.4,4)),ue(li(19,5,4,1.1,4))),gift:()=>mt(Q(3,11.2,7.8,10.6,1),Q(13.2,11.2,7.8,10.6,1),Q(2,7.4,8.8,3.2,1),Q(13.2,7.4,8.8,3.2,1),oa(8.8,4.8,2.9,1.9),oa(15.2,4.8,2.9,1.9))};function P1(e){return mA[e]()}function L$(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function I1(e){let t=0;for(let r of e)t+=L$(r);return Math.max(t,1)}var k1=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function ia(e,t,r){let n=ve(e)??{r:0,g:0,b:0},o=ve(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,r));return `#${k1(n.r+(o.r-n.r)*i)}${k1(n.g+(o.g-n.g)*i)}${k1(n.b+(o.b-n.b)*i)}`}function N$(e,t,r,n,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>L$(d)*o),f=l.reduce((d,g)=>d+g,0)+u*Math.max(0,c.length-1),p=i==="top"?n-o*.35:n+o*.35,m=[],h=0;return c.forEach((d,g)=>{let _=l[g],b=(h+_/2)/p;if(h+=_+u,d.trim()==="")return;let y=i==="top"?-Math.PI/2-f/2/p+b:Math.PI/2+f/2/p-b;m.push({text:d,x:t+p*Math.cos(y),y:r+p*Math.sin(y),fontSize:o,maxWidth:o*2,color:s,rotate:y*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var sa=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},F$=new WeakMap;function Gn(e){if(e&&typeof e=="object"){let r=F$.get(e);if(r)return r}if(e==null)throw new sa(['A "custom" frame needs a spec']);let t=cl(e);if(!t.success)throw new sa(t.issues.map(T$));return typeof e=="object"&&F$.set(e,t.data),t.data}function M1(e){let t=Gn(e);return xo(t)/t.qr.size}var pA=e=>{let t=ve(e);return !!(t&&t.a>=1)};function dA(e,t){let r=Fe(t,Pe);return e.qr.plate==="none"?{color:r,plate:false}:pA(r)?{color:r,plate:true}:e.qr.plate==="background"?{color:r,plate:false}:{color:Pe,plate:true}}function fl(e,t,r=Pe){let n=t.color||e.colors.frame,o=t.secondaryColor||e.colors.accent||n,i=c=>c==="frame"?n:c==="accent"?o:c==="background"?r:c,s=e.colors.text,a=t.textColor||(s===void 0?n:typeof s=="string"?s:ia(i(s.mix[0]),i(s.mix[1]),s.amount));return {frame:n,text:a,accent:o}}function hA(e,t,r){let n=fl(t,e,r),o=i=>{switch(i){case "frame":return n.frame;case "text":return n.text;case "accent":return n.accent;case "background":return r;default:return i}};return i=>typeof i=="string"?o(i):ia(o(i.mix[0]),o(i.mix[1]),i.amount)}function z$(e,t,r=0,n=0){let o=Di(e);return o?Vf(o,t,r,n):""}function gA(e,t,r,n){return `M${x(e-r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e+r)} ${x(t)}A${x(r)} ${x(n)} 0 1 1 ${x(e-r)} ${x(t)}Z`}function _A(e,t){let[r,n,o,i]=[e.x1*t,e.y1*t,e.x2*t,e.y2*t],s=Math.hypot(o-r,i-n),a=e.width*t/2,c=s>0?(o-r)/s:1,u=s>0?(i-n)/s:0,l=-u*a,f=c*a,p=(g,_)=>{let b=[r+c*g,n+u*g],y=[r+c*_,n+u*_];if(e.cap==="round"&&_-g>2*a){let S=[b[0]+c*a,b[1]+u*a],C=[y[0]-c*a,y[1]-u*a];return `M${x(S[0]-l)} ${x(S[1]-f)}L${x(C[0]-l)} ${x(C[1]-f)}A${x(a)} ${x(a)} 0 0 1 ${x(C[0]+l)} ${x(C[1]+f)}L${x(S[0]+l)} ${x(S[1]+f)}A${x(a)} ${x(a)} 0 0 1 ${x(S[0]-l)} ${x(S[1]-f)}Z`}return `M${x(b[0]-l)} ${x(b[1]-f)}L${x(y[0]-l)} ${x(y[1]-f)}L${x(y[0]+l)} ${x(y[1]+f)}L${x(b[0]+l)} ${x(b[1]+f)}Z`};if(!e.dash)return {type:"path",d:p(0,s),fillRule:"nonzero"};let m=e.dash[0]*t,h=m+e.dash[1]*t,d=[];for(let g=0;g+m<=s+1e-6;g+=h)d.push(p(g,g+m));return {type:"path",d:d.join(""),fillRule:"nonzero"}}function bA(e,t){switch(e.type){case "rect":return {type:"rect",x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t,radius:(e.radius??0)*t,...e.hole&&{hole:{x:e.hole.x*t,y:e.hole.y*t,width:e.hole.width*t,height:e.hole.height*t,radius:(e.hole.radius??0)*t}}};case "circle":return {type:"path",d:me(e.cx*t,e.cy*t,e.r*t)+(e.hole?me(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:gA(e.cx*t,e.cy*t,e.rx*t,e.ry*t),fillRule:"nonzero"};case "polygon":return {type:"polygon",points:e.points.map(([r,n])=>[r*t,n*t])};case "path":return {type:"path",d:z$(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return _A(e,t);default:{let r=P1(e.icon);return {type:"path",d:z$(r.d,e.size*t/R1,e.x*t,e.y*t),fillRule:r.fillRule}}}}function yA(e){if(e.type==="rect"){let{x:t,y:r,width:n,height:o,radius:i,hole:s}=e;return [...qt(t,r,n,o,i,i),...s?qt(s.x,s.y,s.width,s.height,s.radius,s.radius):[]]}return e.type==="polygon"?[...e.points.map(([t,r],n)=>n===0?{op:"M",x:t,y:r}:{op:"L",x:t,y:r}),{op:"Z"}]:cr(e.d)}function xA(e,t,r){let n=yA(e),o=Na(n,.2),i=e.type==="rect"?e.hole?"evenodd":"nonzero":e.type==="path"?e.fillRule??"nonzero":"nonzero",s=t.direction==="vertical",a=g=>s?g[1]:g[0],c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let g of o)for(let _ of g)c=Math.min(c,a(_)),u=Math.max(u,a(_));if(!(u>c))return [];let l=t.steps??32,f=r(t.from),p=r(t.to),m=u-c,h=m*.002,d=[];for(let g=0;g<l;g++){let _=c+m*g/l,b=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),y=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:_,y1:b}:{x0:_,x1:b,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},S=o.map(C=>ho(C,y)).filter(C=>C.length>2);S.length!==0&&d.push({type:"path",d:Cb(S),fill:ia(f,p,(g+.5)/l),fillRule:i});}return d}function $A(e,t,r){let n=bA(e,t),o="stroke"in e&&e.stroke?{stroke:r(e.stroke.color),strokeWidth:e.stroke.width*t}:void 0;if(typeof e.fill=="object"&&"gradient"in e.fill){let i=xA(n,e.fill.gradient,r);return o?[...i,{...n,fill:"none",...o}]:i}return [{...n,fill:r(e.fill),...o}]}function wA(e,t){let r=Math.min(e.maxLength??J.maxTextLength,J.maxTextLength),n=e.slot==="primary"?t.text??e.text:e.slot==="secondary"?t.secondaryText??e.text:e.text;return yo(n,r)}function SA(e){return e===void 0||!Number.isFinite(e)?1:Math.min(Ar,Math.max(cn,e))}function CA(e,t,r,n,o,i){let s=o(e.color),a=e.weight==="regular"?{fontWeight:400}:{};if(e.type==="curved"){let{cx:d,cy:g,radius:_,side:b,spread:y=140}=e.curve,S=_*n*(y*Math.PI/180),C=Math.min(e.fontSize*n*r,S/(I1(t)+.08*t.length));return N$(t,d*n,g*n,_*n,C,b,s,i).map(w=>({...w,...a}))}let c=e.box.x*n,u=e.box.y*n,l=e.box.width*n,f=e.box.height*n;if(!(f>0))return [];let p=(e.fontSize??e.box.height*Kf)*n,m=Math.min(p*r,f*Zi,l/I1(t)),h=e.align??"middle";return [{text:t,x:h==="start"?c:h==="end"?c+l:c+l/2,y:u+f/2+m*.35,fontSize:m,maxWidth:l,color:s,...h!=="middle"&&{align:h},...a,field:i}]}function vA(e){let t=0,r=0,n=0,o=0;return e.map(({command:i,values:s})=>{let a=i.toUpperCase(),c=i!==a;switch(a){case "Z":return t=n,r=o,{command:"Z",values:[]};case "H":return t=(c?t:0)+s[0],{command:"H",values:[t]};case "V":return r=(c?r:0)+s[0],{command:"V",values:[r]};case "A":return t=(c?t:0)+s[5],r=(c?r:0)+s[6],{command:"A",values:[...s.slice(0,5),t,r]};default:{let u=s.map((l,f)=>c?l+(f%2===0?t:r):l);return t=u.at(-2),r=u.at(-1),a==="M"&&(n=t,o=r),{command:a,values:u}}}})}function AA(e,t){let r=Di(e);return r?Vf(vA(r).map(({command:n,values:o})=>n==="V"?{command:n,values:[t(o[0])]}:n==="H"||n==="Z"?{command:n,values:o}:n==="A"?{command:n,values:[...o.slice(0,6),t(o[6])]}:{command:n,values:o.map((i,s)=>s%2===1?t(i):i)})):e}function EA(e,t){let r=(n,o)=>{let i=t(n);return {y:i,height:t(n+o)-i}};switch(e.type){case "rect":return {...e,...r(e.y,e.height),...e.hole&&{hole:{...e.hole,...r(e.hole.y,e.hole.height)}}};case "circle":case "ellipse":return {...e,cy:t(e.cy)};case "polygon":return {...e,points:e.points.map(([n,o])=>[n,t(o)])};case "path":return {...e,d:AA(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function RA(e,t){if(t.length===0)return e;let r=o=>{let i=o;for(let s of t)i-=Math.min(Math.max(o-s.y,0),s.height);return i},n=(o,i)=>t.some(s=>o>=s.y-1e-6&&i<=s.y+s.height+1e-6);return {...e,artboard:{...e.artboard,height:r(e.artboard.height)},qr:{...e.qr,y:r(e.qr.y)},shapes:e.shapes.filter(o=>{let{bounds:i}=Jf(o);return !(i&&n(i.y0,i.y1))}).map(o=>EA(o,r)),labels:e.labels.map(o=>{if(o.type==="curved")return {...o,curve:{...o.curve,cy:r(o.curve.cy)}};let i=r(o.box.y);return {...o,box:{...o.box,y:i,height:r(o.box.y+o.box.height)-i}}})}}function aa(e,t,r,n,o={}){let i=new Map(t.labels.map(g=>[g.id,wA(g,r)])),s=RA(t,t.labels.flatMap(g=>g.collapse&&!i.get(g.id)?[g.collapse]:[])),a=e/s.qr.size,c=dA(s,n),u=hA(r,s,c.color),l=s.shapes.flatMap(g=>$A(g,a,u));if(c.plate){let g=xo(s)*a;l.push({type:"rect",x:s.qr.x*a-g,y:s.qr.y*a-g,width:e+2*g,height:e+2*g,radius:(s.qr.radius??0)*a,fill:c.color});}let f=SA(r.fontScale),p=s.labels.flatMap(g=>{let _=i.get(g.id);if(!_)return [];let b=(g.slot==="fixed"?void 0:o[g.slot])??g.id;return CA(g,_,f,a,u,b)}),m=p[0],h=m&&m.rotate===void 0?m:null,d=s.bleed??"none";return {width:s.artboard.width*a,height:s.artboard.height*a,qrX:s.qr.x*a,qrY:s.qr.y*a,qrSize:e,shapes:l,label:h,extraLabels:h?p.slice(1):p,squareEdges:d!=="none",color:u(d==="none"?"frame":d)}}function T1(e,t,r){return aa(e,Gn(t.spec),t,r)}var D$={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 O1={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 B$={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 Z$={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 U$={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 G$={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 Q$={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 j$={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 V$={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 ml={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 H$={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 W$={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 q$={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 X$={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 Y$={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 K$={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 J$={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 ew={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 tw={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 je=(e,t,r,n,o)=>({style:e,name:t,tags:o,labelOn:n,spec:r}),L1=[je("banner-bottom","Banner",O1,"frame",["bottom","band"]),je("banner-top","Top banner",B$,"frame",["top","band"]),je("banner-top-bottom","Two banners",Z$,"frame",["top","bottom","band"]),je("border","Border",U$,"background",["square","outline"]),je("rounded-border","Rounded",X$,"background",["border","outline"]),je("gradient-border","Gradient",ml,"background",["border","colorful"]),je("focus","Focus",V$,"background",["corners","brackets"]),je("speech-bubble","Bubble",Y$,"frame",["speech"]),je("speech-bubble-top","Bubble top",K$,"frame",["speech"]),je("chat-bubble","Chat",G$,"frame",["message","bubble"]),je("circle","Circle",Q$,"frame",["round","ring","curved"]),je("badge","Ribbon",D$,"frame",["badge","banner"]),je("sticker","Sticker",J$,"frame",["label"]),je("polaroid","Polaroid",q$,"frame",["photo","picture"]),je("phone","Phone",W$,"background",["mobile","screen"]),je("ticket","Ticket",tw,"frame",["event","pass"]),je("tag","Tag",ew,"frame",["price","label"]),je("envelope","Envelope",j$,"frame",["mail","letter"]),je("menu-card","Menu card",H$,"background",["menu","restaurant"])],WA=new Map(L1.map(e=>[e.style,e]));function N1(e){return WA.get(e)}var qA=Object.fromEntries(L1.map(e=>[e.style,e.spec])),XA={from:ml.colors.frame,to:ml.colors.accent};function pl(e){return !e||e.style==="none"?null:e.style===dn?e.spec??null:N1(e.style)?.spec??null}function YA(e){let t=pl(e);return e&&typeof t?.colors?.frame=="string"?fl(t,e):null}var KA={primary:"text",secondary:"secondaryText"};function rw(e,t,r){let n=N1(t.style)?.spec??O1;return aa(e,Gn(n),t,r,KA)}var hl="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",ow=.08,iw="data-qrdx-frame-label";function yt(e){return !!(e?.style&&e.style!=="none")}function F1(e){let t=pl(e);return t?M1(t):ow}function JA(e){return (e.text??kf).trim().slice(0,pt)}function eE(e){return (e.secondaryText??"").trim().slice(0,pt)}function Qn(e,t,r){return t.style===dn?T1(e,t,r):rw(e,t,r)}function br(e,t){if(!yt(t))return {width:e,height:e};let{width:r,height:n}=Qn(e,t);return {width:r,height:n}}var be=e=>le(e,2);function nw({x:e,y:t,width:r,height:n,radius:o}){let i=be(Math.min(o,r/2,n/2)),[s,a,c,u]=[be(e),be(t),be(r),be(n)];return i<=0?M`M${s} ${a}h${c}v${u}h${-c}z`:M`M${s+i} ${a}h${be(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+M`v${be(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+M`h${be(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+M`v${be(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function dl(e){return e.stroke&&e.strokeWidth?{stroke:e.stroke,strokeWidth:be(e.strokeWidth)}:{}}function sw(e,t){return e.type==="rect"&&e.hole?k("path",{d:nw(e)+nw(e.hole),fill:e.fill,fillRule:"evenodd",...dl(e)},t):e.type==="polygon"?k("polygon",{fill:e.fill,points:e.points.map(([r,n])=>`${be(r)},${be(n)}`).join(" "),...dl(e)},t):e.type==="path"?k("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"},...dl(e)},t):Yu("rect",{...dl(e),fill:e.fill,height:be(e.height),key:t,width:be(e.width),x:be(e.x),y:be(e.y),...e.radius>0&&{rx:be(e.radius),ry:be(e.radius)}})}function aw(e){return e.shapes.map((t,r)=>sw(t,r))}function ca(e,t){let{size:r,frame:n,bgColor:o,svgProps:i,markLabels:s}=t,a=Qn(r,n,o),c=cw(a),u=be(a.width),l=be(a.height);return Be("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[k("g",{"data-qrdx-frame":n.style,children:a.shapes.map((f,p)=>sw(f,p))}),On(e,{x:be(a.qrX),y:be(a.qrY),width:r,height:r}),c.map((f,p)=>k("text",{"data-max-width":be(f.maxWidth),fill:f.color,fontFamily:hl,fontSize:be(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:be(f.x),y:be(f.y),...f.rotate&&{transform:`rotate(${be(f.rotate)} ${be(f.x)} ${be(f.y)})`},...s&&f.field&&{[iw]:f.field},children:f.text},p))]})}function tE(e){let{frame:t,size:r=$e,bgColor:n,slot:o,svgProps:i}=e,s=o??k("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg"});return yt(t)?ca(s,{size:r,frame:t,bgColor:n,svgProps:i}):k("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...i,children:On(s,{x:0,y:0,width:r,height:r})})}function cw(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var rE={2:6,3:12};function uw(e){let t=[e.start],r=e.start;for(let n of e.segments){let o=n.at(-1);if(n.length===1)t.push(o);else {let i=rE[n.length];for(let s=1;s<=i;s++){let a=s/i,c=1-a;if(n.length===2){let[u]=n;t.push([c*c*r[0]+2*c*a*u[0]+a*a*o[0],c*c*r[1]+2*c*a*u[1]+a*a*o[1]]);}else {let[u,l]=n;t.push([c*c*c*r[0]+3*c*c*a*u[0]+3*c*a*a*l[0]+a*a*a*o[0],c*c*c*r[1]+3*c*c*a*u[1]+3*c*a*a*l[1]+a*a*a*o[1]]);}}}r=o;}return t}function fw(e,t){let r=[];for(let n of e)for(let o=0;o<n.length;o++){let[i,s]=n[o],[a,c]=n[(o+1)%n.length];s<=t!=c<=t&&r.push(i+(t-s)/(c-s)*(a-i));}return r.sort((n,o)=>n-o)}function mw(e,t){let r=0;for(let n of e)if(n<t)r++;else break;return r%2===1}function nE(e,t,r){return mw(fw(e,r),t)}function pw(e){let t=new Map;return (r,n)=>{let o=t.get(n);return o||(o=fw(e,n),t.set(n,o)),mw(o,r)}}function oE(e,t,r,n){let o=r[0]-e,i=r[1]-t,s=n[0]-r[0],a=n[1]-r[1],c=l=>Math.max(Math.abs(o+l*s),Math.abs(i+l*a)),u=Math.min(c(0),c(1));for(let[l,f]of [[i-o,s-a],[-(o+i),s+a]])if(f!==0){let p=l/f;p>0&&p<1&&(u=Math.min(u,c(p)));}return u}function iE(e,t,r){if(!nE(e,t,r))return 0;let n=Number.POSITIVE_INFINITY;for(let o of e)for(let i=0;i<o.length;i++)n=Math.min(n,oE(t,r,o[i],o[(i+1)%o.length]));return Number.isFinite(n)?n:0}function sE(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let i of e)for(let[s,a]of i)t=Math.min(t,s),r=Math.min(r,a),n=Math.max(n,s),o=Math.max(o,a);return {x0:t,y0:r,x1:n,y1:o}}function dw(e){let t=e.map(uw),r=sE(t),n=r.x1-r.x0,o=r.y1-r.y0;if(!(n>0&&o>0))return null;let i=(h,d)=>{let g=Math.max(h-r.x0,r.x1-h,d-r.y0,r.y1-d);return g>0?iE(t,h,d)/(2*g):0},s={cx:r.x0+n/2,cy:r.y0+o/2,value:0};s.value=i(s.cx,s.cy);let a=32;for(let h=1;h<a;h++)for(let d=1;d<a;d++){let g=r.x0+n*d/a,_=r.y0+o*h/a,b=i(g,_);b>s.value&&(s={cx:g,cy:_,value:b});}let c=n/a,u=o/a;for(let h=0;h<6;h++){let d=s;for(let g=-2;g<=2;g++)for(let _=-2;_<=2;_++){let b=d.cx+c*_/2,y=d.cy+u*g/2,S=i(b,y);S>s.value&&(s={cx:b,cy:y,value:S});}c/=2,u/=2;}if(s.value<=0)return null;let f=.5/Math.max(s.cx-r.x0,r.x1-s.cx,s.cy-r.y0,r.y1-s.cy),p=([h,d])=>[.5+(h-s.cx)*f,.5+(d-s.cy)*f],m=e.map(h=>({start:p(h.start),segments:h.segments.map(d=>d.map(p))}));return {rings:m,polygons:m.map(uw),half:s.value}}function hw(e,t){let r=([o,i])=>`${x(o*t)} ${x(i*t)}`,n="";for(let o of e.rings){n+=`M${r(o.start)}`;for(let i of o.segments){let s=i.length===1?"L":i.length===2?"Q":"C";n+=s+i.map(r).join(" ");}n+="Z";}return n}var aE={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]]]},lw;function gw(){return lw??=dw([aE]),lw}function cE(e){let{width:t,height:r,cells:n}=e;return Number.isInteger(t)&&Number.isInteger(r)&&t>=Nt&&r>=Nt&&t<=At&&r<=At&&typeof n=="string"&&n.length===t*r&&/^[01]*$/.test(n)?(o,i)=>o>=0&&i>=0&&o<t&&i<r&&n[i*t+o]==="1":null}var yr=([e,t])=>`${e},${t}`;function uE(e,t,r){let n=(c,u)=>e(c-1,u-1),o=new Map,i=(c,u)=>{for(let[l,f]of [[c,u],[u,c]]){let p=o.get(yr(l))??[];p.push(f),o.set(yr(l),p);}};for(let c=0;c<=r;c++)for(let u=0;u<=t;u++){let l=n(u,c),f=n(u+1,c),p=n(u+1,c+1),m=n(u,c+1),h=[u,c-.5],d=[u+.5,c],g=[u,c+.5],_=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(_,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(_,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(_,h);break;case 5:i(h,d),i(_,g);break;case 10:i(_,h),i(g,d);break;}}let s=[],a=new Set;for(let[c,u]of o){if(a.has(c)||u.length===0)continue;let[l,f]=c.split(",").map(Number),p=[[l,f]];a.add(c);let m=[l,f],h=u[0];for(;!a.has(yr(h));){a.add(yr(h)),p.push(h);let d=lE(o.get(yr(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(fE(p));}return s}function lE(e,t,r){let n=yr(t);return e.find(o=>yr(o)!==n&&!r.has(yr(o)))??e.find(o=>yr(o)!==n)}function fE(e){let t=[];for(let r=0;r<e.length;r++){let n=e[(r-1+e.length)%e.length],o=e[r],i=e[(r+1)%e.length],s=(o[0]-n[0])*(i[1]-o[1])-(o[1]-n[1])*(i[0]-o[0]);Math.abs(s)>1e-9&&t.push(o);}return t.length>=3?t:e}function mE(e){let t=(i,s)=>[(i[0]+s[0])/2,(i[1]+s[1])/2],r=e.length,n=t(e[r-1],e[0]),o=e.map((i,s)=>[i,t(i,e[(s+1)%r])]);return {start:n,segments:o}}var ua=new Map;function z1(e){let t=`${e.width}x${e.height}:${e.cells}`,r=ua.get(t);if(r)return r;let n=cE(e),o;if(!n)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=uE(n,e.width,e.height),s=i.length>0?dw(i.map(mE)):null;o=s&&2*s.half>=zf?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return ua.size>16&&ua.delete(ua.keys().next().value),ua.set(t,o),o}var pE=1,_w=.5,bw=.5,dE=.5;function jn(e){return Math.max(e,Ff)}function gl(e){return e==="heart"?gw():typeof e=="object"&&e?.type==="silhouette"?z1(e).outline:null}function la(e){return e==="circle"||gl(e)!==null}var hE={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 gE(e){let{outline:t,problem:r}=z1(e);if(t&&!r)return {ok:true,share:2*t.half};let n=r??"invalid";return {ok:false,reason:n,message:hE[n]}}function Ye(e,t,r){if(r==="circle"){let s=jn(t),a=(e/2+s)*Math.SQRT2+pE;return Math.ceil(a-e/2)}let n=gl(r);if(!n)return t;let o=jn(t),i=(e+2*(o+dE))/(2*n.half);return Math.ceil((i-e)/2-1e-9)}function yw(e){let t=e>>>0;return ()=>{t=t+1831565813>>>0;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function _E(e,t,r){let n=Ye(t,r,"circle"),o=jn(r),i=t+2*n,s=i/2,a=s-_w-.5,c=yw(Number.parseInt(Dn(e),36)||1),u=n-o,l=n+t+o;return Array.from({length:i},(f,p)=>Array.from({length:i},(m,h)=>{let d=c()<bw;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var bE=Array.from({length:8},(e,t)=>{let r=t*Math.PI/4;return [Math.cos(r),Math.sin(r)]});function xw(e,t,r,n){if(n==="circle")return _E(e,t,r);let o=gl(n);if(!o)return null;let i=Ye(t,r,n),s=jn(r),a=t+2*i,c=pw(o.polygons),u=.5+_w,l=(h,d)=>{let g=h+.5,_=d+.5;return c(g/a,_/a)?bE.every(([b,y])=>c((g+b*u)/a,(_+y*u)/a)):false},f=yw(Number.parseInt(Dn(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,_)=>{let b=f()<bw;return _>=p&&_<m&&d>=p&&d<m?false:b&&l(_,d)}))}function D1(e,t){if(e==="circle")return {circle:t/2};let r=gl(e);return r?{path:hw(r,t)}:null}function yE(e,t){let r=D1(e,t);return r?"circle"in r?me(t/2,t/2,r.circle):r.path:null}function Ke(e,t,r){return vt.QrCode.encodeSegments(vt.QrSegment.makeSegments(e),Ia[t],vt.QrCode.MIN_VERSION,vt.QrCode.MAX_VERSION,-1,!r)}function xE(e){return e==="top-left"?0:e==="top-right"?1:3}function _l(e,t,r,n="circle",o="top-left"){let i=r*2,s=r,a=i/3;switch(n){case "leaf":case "leaf-reverse":case "drop":case "drop-reverse":{let c=xE(o),u=(c+2)%4,l=1.3*a,f=.7*a,p=h=>{switch(n){case "leaf":return h===c||h===u;case "leaf-reverse":return !(h===c||h===u);case "drop":return h===c;default:return h===u}},m=[0,1,2,3].map(h=>p(h)?f:l);return k("path",{d:Q(e-r,t-r,i,i,m)})}case "extra-rounded":return k("path",{d:Q(e-r,t-r,i,i,1.15*a)});case "plus":{let c=1.15*a,u=r;return k("path",{d:ue([[e-c,t-u],[e+c,t-u],[e+c,t-c],[e+u,t-c],[e+u,t+c],[e+c,t+c],[e+c,t+u],[e-c,t+u],[e-c,t+c],[e-u,t+c],[e-u,t-c],[e-c,t-c]])})}case "cross-rounded":{let c=1.15*a,u=.5*a;return k("path",{d:Q(e-r,t-c,i,2*c,u)+Q(e-c,t-r,2*c,i,u)})}case "hexagon":return k("path",{d:ue(ui(e,t,1.72*a,6))});case "octagon":return k("path",{d:ue(ui(e,t,r/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return k("path",{d:me(e-c,t-c,u)+me(e+c,t-c,u)+me(e+c,t+c,u)+me(e-c,t+c,u)+me(e,t,1.2*a)})}case "heart":return k("path",{d:mi(e,t+.12*a,3.5*a)});case "squircle":return k("path",{d:ue(fi(e,t,r,r,4,64))});case "dots":{let c=[];for(let u of [-1,0,1])for(let l of [-1,0,1])c.push(me(e+l*a*.82,t+u*a*.82,.58*a));return k("path",{d:c.join("")})}case "cushion":return k("path",{d:Js(e-r,t-r,i,.6*a,.15*a)});case "square":return k("rect",{height:x(i),transform:M`rotate(0,${e},${t})`,width:x(i),x:x(e-s),y:x(t-s)});case "rounded":return k("rect",{height:x(i),rx:x(r*.5),ry:x(r*.5),transform:M`rotate(0,${e},${t})`,width:x(i),x:x(e-s),y:x(t-s)});case "diamond":return k("path",{d:M`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:M`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${8.571428571428571*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} ${10.714285714285714*c}h ${19.285714285714285*c}v -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} -${10.714285714285714*c}h -${8.571428571428571*c}H ${u(25)}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(25)} ${l(35.714285714285715)}v ${19.285714285714285*c}h ${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, ${10.714285714285714*c} -${10.714285714285714*c}v -${19.285714285714285*c}h -${19.285714285714285*c}a ${10.714285714285714*c} ${10.714285714285714*c}, 0, 0, 0, -${10.714285714285714*c} ${10.714285714285714*c}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(33.57142857142857)} ${l(29.285714285714285)}h ${12.857142857142856*c}c ${4.285714285714286*c} 0 ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c} ${4.285714285714286*c}v ${12.857142857142856*c}c 0 ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c}h -${12.857142857142856*c}c -${4.285714285714286*c} 0 -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c} -${4.285714285714286*c}v -${12.857142857142856*c}c 0 -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c} ${4.285714285714286*c} -${4.285714285714286*c}z`;return k("path",{d:f,transform:M`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=M`M ${u(38.84615384615385)},${l(26.546153846153846)}c${.6692307692307691*c},-${1.0153846153846153*c},${2.215384615384615*c},-${1.0153846153846153*c},${2.884615384615384*c},0l${4.038461538461538*c},${6.069230769230768*c}c${.23076923076923075*c},${.3461538461538461*c},${.6*c},${.6*c},${1.0153846153846153*c},${.7153846153846153*c}l${7.223076923076922*c},${1.823076923076923*c}c${1.2*c},${.3*c},${1.6846153846153844*c},${1.7076923076923076*c},${.8999999999999999*c},${2.6538461538461533*c}l-${4.73076923076923*c},${5.584615384615384*c}c-${.2769230769230769*c},${.3230769230769231*c},-${.41538461538461535*c},${.7384615384615384*c},-${.3923076923076923*c},${1.1307692307692307*c}l${.4384615384615384*c},${7.199999999999999*c}c${.06923076923076922*c},${1.2*c},-${1.1769230769230767*c},${2.0769230769230766*c},-${2.3307692307692305*c},${1.6384615384615382*c}l-${6.9692307692307685*c},-${2.6076923076923073*c}c-${.3923076923076923*c},-${.16153846153846155*c},-${.8538461538461538*c},-${.16153846153846155*c},-${1.2461538461538462*c},0l-${6.9692307692307685*c},${2.6076923076923073*c}c-${1.1538461538461537*c},${.4384615384615384*c},-${2.4*c},-${.4384615384615384*c},-${2.3307692307692305*c},-${1.6384615384615382*c}l${.4384615384615384*c},-${7.199999999999999*c}c${.023076923076923075*c},-${.41538461538461535*c},-${.11538461538461538*c},-${.8307692307692307*c},-${.3923076923076923*c},-${1.1307692307692307*c}l-${4.73076923076923*c},-${5.584615384615384*c}c-${.7846153846153846*c},-${.923076923076923*c},-${.3230769230769231*c},-${2.3307692307692305*c},${.8999999999999999*c},-${2.6538461538461533*c}l${7.223076923076922*c},-${1.823076923076923*c}c${.41538461538461535*c},-${.11538461538461538*c},${.7846153846153846*c},-${.3461538461538461*c},${1.0153846153846153*c},-${.7153846153846153*c}l${4.038461538461538*c},-${6.069230769230768*c}z`;return k("path",{clipRule:"evenodd",d:f,transform:M`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return k("g",{transform:M`translate(${e-40*c},${t-40*c}) scale(${x(c,6)})`,children:k("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 k("circle",{cx:x(e),cy:x(t),r:x(r),transform:M`rotate(0,${e},${t})`})}}function _i(e,t,r,n){let o=e==="top-left"?0:e==="top-right"?1:3,i=(o+2)%4;return [0,1,2,3].map(s=>s===o||n&&s===i?r:t)}function $w(e,t,r,n){let o=r/7,i=Math.max(0,(n+Math.SQRT2-2)*o);return ue(_1(e,t,r,n*o))+ue(_1(e+o,t+o,5*o,i))}function ww(e,t,r,n,o=false){let i=r/7,s=a=>o?_i(n,0,a,true):_i(n,a,0,true);return Q(e,t,r,r,s(2.5*i))+Q(e+i,t+i,5*i,5*i,s(1.5*i))}function $E(e,t,r,n){let o=r/7;return Q(e,t,r,r,_i(n,2.6*o,0,false))+Q(e+o,t+o,5*o,5*o,_i(n,1.6*o,0,false))}function wE(e,t,r){let n=r/7,o=e+r/2,i=t+r/2;return ue(fi(o,i,3.5*n,3.5*n,4,96))+ue(fi(o,i,2.5*n,2.5*n,4,96))}function SE(e,t,r){let n=r/7,o=.12*n;return Js(e,t,r,1.4*n,o)+Js(e+n,t+n,5*n,.7*n,o)}function CE(e,t,r){let n=r/7;return y1(e,t,r,.7*n,3.9*n,n)+y1(e+n,t+n,5*n,.35*n,2.7*n,.8*n)}function vE(e,t,r,n){let o=r/7;return Q(e,t,r,r,_i(n,.5*o,2.5*o,false))+Q(e+o,t+o,5*o,5*o,_i(n,.25*o,1.5*o,false))}function AE(e,t,r){return Q(e+r,t+r,5*r,5*r,1.5*r)}function EE(e,t,r){return ue(fi(e,t,3.5*r,3.5*r,2.75,96))}function RE(e,t,r){let n=r/7;return EE(e+r/2,t+r/2,n)+nl(e+n,t+n,5*n,5*n,.52*n)}function PE(e,t,r){let n=r/7;return b1(e,t,r,r,1.15*n)+b1(e+n,t+n,5*n,5*n,.74*n)}function kE(e,t,r){let n=r/7;return nl(e,t,r,r,.8*n)+nl(e+n,t+n,5*n,5*n,.52*n)}function B1(e,t,r,n){let[o,i,s,a]=n,c=(l,f)=>M`${e+l} ${t+f}`,u=(l,f,p)=>l[0]==="round"?M`A${l[1]} ${l[1]} 0 0 1 ${c(f,p)}`:M`L${c(f,p)}`;return M`M${c(o[1],0)}L${c(r-i[1],0)}`+u(i,r,i[1])+M`L${c(r,r-s[1])}`+u(s,r-s[1],r)+M`L${c(a[1],r)}`+u(a,0,r-a[1])+M`L${c(0,o[1])}`+u(o,o[1],0)+"Z"}function IE(e,t){let r=[0,1,2,3].map(o=>t(o)?["round",2.8*e]:["cut",1.6*e]),n=[0,1,2,3].map(o=>t(o)?["round",1.5*e]:["cut",1.01*e]);return [r,n]}function ME(e,t,r,n){let o=r/7,i=n==="top-left"?0:n==="top-right"?1:3,s=(i+2)%4,[a,c]=IE(o,u=>u===i||u===s);return B1(e,t,r,a)+B1(e+o,t+o,5*o,c)}function TE(e,t,r){let n=r/7;return B1(e,t,r,[["cut",1.6*n],["cut",1.6*n],["round",3*n],["round",3*n]])+AE(e,t,n)}function OE(e,t,r){let n=r/7;return M`M ${e} ${t}v ${r}h ${r}v -${r}z`+M`M ${e+n} ${t+n}h ${5*n}v ${5*n}h -${5*n}z`}function LE(e,t,r){let n=r/7,o=n*.875,i=n*.4375,s=M`M ${e+o} ${t}`+M`h ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+n+i} ${t+n}`+M`h ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function NE(e,t,r){let n=e+r/2,o=t+r/2,i=le(r/2),s=le(r*(2.5/7));return M`M ${n-i} ${o}`+M`a ${i} ${i} 0 1 0 ${i*2} 0`+M`a ${i} ${i} 0 1 0 ${-i*2} 0z`+M`M ${n-s} ${o}`+M`a ${s} ${s} 0 1 1 ${s*2} 0`+M`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function FE(e,t,r){let n=r/74.7002,o=a=>a*n+e,i=a=>a*n+t;return M`M${o(37.3496)} ${i(0)}C${o(39.2939)} ${i(0)} ${o(40.9948)} ${i(1.03842)} ${o(41.9287)} ${i(2.59082)}C${o(43.2293)} ${i(1.34013)} ${o(45.1347)} ${i(.780267)} ${o(47.0098)} ${i(1.28027)}C${o(48.8871)} ${i(1.78928)} ${o(50.261)} ${i(3.23767)} ${o(50.7578)} ${i(4.98438)}C${o(52.3454)} ${i(4.0996)} ${o(54.3432)} ${i(4.047)} ${o(56.0303)} ${i(5.01953)}C${o(57.7094)} ${i(5.98752)} ${o(58.6586)} ${i(7.73647)} ${o(58.6924)} ${i(9.5459)}C${o(60.4517)} ${i(9.10661)} ${o(62.3883)} ${i(9.57215)} ${o(63.7598)} ${i(10.9502)}C${o(65.1282)} ${i(12.3253)} ${o(65.5963)} ${i(14.2585)} ${o(65.1641)} ${i(16.0127)}C${o(66.974)} ${i(16.044)} ${o(68.7242)} ${i(16.9982)} ${o(69.7002)} ${i(18.6797)}C${o(70.6781)} ${i(20.3647)} ${o(70.6241)} ${i(22.3635)} ${o(69.7402)} ${i(23.9502)}C${o(71.4776)} ${i(24.4496)} ${o(72.9194)} ${i(25.8232)} ${o(73.4199)} ${i(27.7002)}C${o(73.927)} ${i(29.5707)} ${o(73.3661)} ${i(31.4794)} ${o(72.1104)} ${i(32.7822)}C${o(73.6621)} ${i(33.7163)} ${o(74.7002)} ${i(35.4166)} ${o(74.7002)} ${i(37.3604)}C${o(74.7001)} ${i(39.307)} ${o(73.6582)} ${i(41.0084)} ${o(72.1025)} ${i(41.9414)}C${o(73.357)} ${i(43.245)} ${o(73.9207)} ${i(45.1525)} ${o(73.4199)} ${i(47.0303)}C${o(72.9187)} ${i(48.9027)} ${o(71.4782)} ${i(50.2735)} ${o(69.7383)} ${i(50.7734)}C${o(70.6201)} ${i(52.3601)} ${o(70.6716)} ${i(54.3549)} ${o(69.7002)} ${i(56.04)}C${o(68.7237)} ${i(57.7225)} ${o(66.9721)} ${i(58.6729)} ${o(65.1611)} ${i(58.7031)}C${o(65.598)} ${i(60.4623)} ${o(65.131)} ${i(62.3982)} ${o(63.7598)} ${i(63.7695)}C${o(62.3847)} ${i(65.138)} ${o(60.4515)} ${i(65.6061)} ${o(58.6973)} ${i(65.1738)}C${o(58.6635)} ${i(66.9833)} ${o(57.7094)} ${i(68.7322)} ${o(56.0303)} ${i(69.7002)}C${o(54.3461)} ${i(70.6777)} ${o(52.348)} ${i(70.6248)} ${o(50.7617)} ${i(69.7422)}C${o(50.2643)} ${i(71.4831)} ${o(48.8896)} ${i(72.9284)} ${o(47.0098)} ${i(73.4297)}C${o(45.1389)} ${i(73.9368)} ${o(43.2296)} ${i(73.3763)} ${o(41.9268)} ${i(72.1201)}C${o(40.9927)} ${i(73.6717)} ${o(39.2932)} ${i(74.71)} ${o(37.3496)} ${i(74.71)}C${o(35.4051)} ${i(74.7098)} ${o(33.7042)} ${i(73.6711)} ${o(32.7705)} ${i(72.1182)}C${o(31.4697)} ${i(73.3758)} ${o(29.5597)} ${i(73.9418)} ${o(27.6797)} ${i(73.4404)}V${i(73.4502)}C${o(25.8065)} ${i(72.9422)} ${o(24.434)} ${i(71.4985)} ${o(23.9346)} ${i(69.7568)}C${o(22.3504)} ${i(70.6301)} ${o(20.3591)} ${i(70.6781)} ${o(18.6797)} ${i(69.71)}C${o(16.9957)} ${i(68.7391)} ${o(16.045)} ${i(66.9831)} ${o(16.0166)} ${i(65.168)}C${o(14.2547)} ${i(65.6091)} ${o(12.3134)} ${i(65.1435)} ${o(10.9395)} ${i(63.7695)}C${o(9.5687)} ${i(62.3919)} ${o(9.10168)} ${i(60.454)} ${o(9.53809)} ${i(58.6973)}C${o(7.72791)} ${i(58.6641)} ${o(5.97815)} ${i(57.71)} ${o(5.00977)} ${i(56.0303)}C${o(4.03552)} ${i(54.3517)} ${o(4.08377)} ${i(52.3649)} ${o(4.95801)} ${i(50.7812)}C${o(3.21705)} ${i(50.2839)} ${o(1.77087)} ${i(48.9101)} ${o(1.26953)} ${i(47.0303)}V${i(47.0205)}C${o(.762081)} ${i(45.1489)} ${o(1.32758)} ${i(43.2375)} ${o(2.58496)} ${i(41.9346)}C${o(1.03604)} ${i(41)} ${o(108484e-9)} ${i(39.3019)} ${o(0)} ${i(37.3604)}C${o(0)} ${i(35.4159)} ${o(1.03815)} ${i(33.7141)} ${o(2.59082)} ${i(32.7803)}C${o(1.34044)} ${i(31.4797)} ${o(.780389)} ${i(29.575)} ${o(1.28027)} ${i(27.7002)}C${o(1.78258)} ${i(25.8232)} ${o(3.22806)} ${i(24.4482)} ${o(4.97363)} ${i(23.9512)}C${o(4.08938)} ${i(22.3638)} ${o(4.03743)} ${i(20.3664)} ${o(5.00977)} ${i(18.6797)}C${o(5.97815)} ${i(16.9999)} ${o(7.72788)} ${i(16.0496)} ${o(9.53809)} ${i(16.0166)}C${o(9.10139)} ${i(14.2576)} ${o(9.56846)} ${i(12.3214)} ${o(10.9395)} ${i(10.9502)}C${o(12.3171)} ${i(9.57911)} ${o(14.2558)} ${i(9.11137)} ${o(16.0127)} ${i(9.54785)}C${o(16.0426)} ${i(7.73421)} ${o(16.9969)} ${i(5.97989)} ${o(18.6797)} ${i(5.00977)}C${o(20.3596)} ${i(4.03474)} ${o(22.3521)} ${i(4.08468)} ${o(23.9365)} ${i(4.96094)}C${o(24.4378)} ${i(3.22749)} ${o(25.8059)} ${i(1.7898)} ${o(27.6797)} ${i(1.29004)}C${o(29.5511)} ${i(.78264)} ${o(31.4617)} ${i(1.34357)} ${o(32.7646)} ${i(2.60059)}C${o(33.6971)} ${i(1.04268)} ${o(35.4013)} ${i(152405e-9)} ${o(37.3496)} ${i(0)}ZM${o(41.0615)} ${i(9.17578)}C${o(40.1006)} ${i(10.1057)} ${o(38.793)} ${i(10.6797)} ${o(37.3496)} ${i(10.6797)}C${o(35.9064)} ${i(10.6796)} ${o(34.5985)} ${i(10.1066)} ${o(33.6377)} ${i(9.17676)}C${o(32.9511)} ${i(10.3241)} ${o(31.8358)} ${i(11.2176)} ${o(30.4404)} ${i(11.5898)}C${o(29.0527)} ${i(11.9661)} ${o(27.6436)} ${i(11.7542)} ${o(26.4766)} ${i(11.1074)}C${o(26.1072)} ${i(12.3879)} ${o(25.2629)} ${i(13.5333)} ${o(24.0195)} ${i(14.25)}C${o(22.7695)} ${i(14.9754)} ${o(21.347)} ${i(15.1322)} ${o(20.0479)} ${i(14.8047)}C${o(20.0289)} ${i(16.1454)} ${o(19.5108)} ${i(17.4793)} ${o(18.4902)} ${i(18.5)}C${o(17.4696)} ${i(19.5158)} ${o(16.1409)} ${i(20.033)} ${o(14.8066)} ${i(20.0566)}C${o(15.1312)} ${i(21.3534)} ${o(14.9738)} ${i(22.7723)} ${o(14.25)} ${i(24.0195)}C${o(13.5243)} ${i(25.2699)} ${o(12.3701)} ${i(26.1148)} ${o(11.082)} ${i(26.4795)}C${o(11.7347)} ${i(27.6479)} ${o(11.9529)} ${i(29.062)} ${o(11.5801)} ${i(30.46)}C${o(11.2085)} ${i(31.8485)} ${o(10.3194)} ${i(32.9607)} ${o(9.17578)} ${i(33.6475)}C${o(10.106)} ${i(34.6084)} ${o(10.6797)} ${i(35.9167)} ${o(10.6797)} ${i(37.3604)}C${o(10.6796)} ${i(38.805)} ${o(10.1053)} ${i(40.1141)} ${o(9.17383)} ${i(41.0752)}C${o(10.3132)} ${i(41.7614)} ${o(11.1999)} ${i(42.871)} ${o(11.5703)} ${i(44.2598)}C${o(11.946)} ${i(45.6504)} ${o(11.7335)} ${i(47.0592)} ${o(11.0889)} ${i(48.2266)}C${o(12.377)} ${i(48.593)} ${o(13.5297)} ${i(49.441)} ${o(14.25)} ${i(50.6904)}C${o(14.9754)} ${i(51.9405)} ${o(15.1322)} ${i(53.3629)} ${o(14.8047)} ${i(54.6621)}C${o(16.142)} ${i(54.6835)} ${o(17.4721)} ${i(55.2016)} ${o(18.4902)} ${i(56.2197)}C${o(19.5097)} ${i(57.2441)} ${o(20.0278)} ${i(58.5787)} ${o(20.0479)} ${i(59.918)}C${o(21.3469)} ${i(59.5917)} ${o(22.7696)} ${i(59.7493)} ${o(24.0195)} ${i(60.4697)}C${o(25.2676)} ${i(61.1892)} ${o(26.1117)} ${i(62.3406)} ${o(26.4775)} ${i(63.627)}C${o(27.6424)} ${i(62.9822)} ${o(29.0498)} ${i(62.7688)} ${o(30.4404)} ${i(63.1396)}C${o(31.8284)} ${i(63.5112)} ${o(32.9402)} ${i(64.3999)} ${o(33.627)} ${i(65.543)}C${o(34.5887)} ${i(64.6072)} ${o(35.9012)} ${i(64.0304)} ${o(37.3496)} ${i(64.0303)}C${o(38.7912)} ${i(64.0303)} ${o(40.098)} ${i(64.6023)} ${o(41.0586)} ${i(65.5303)}C${o(41.7458)} ${i(64.3887)} ${o(42.8594)} ${i(63.5007)} ${o(44.25)} ${i(63.1299)}C${o(45.643)} ${i(62.7522)} ${o(47.057)} ${i(62.9676)} ${o(48.2266)} ${i(63.6201)}C${o(48.5931)} ${i(62.3323)} ${o(49.4413)} ${i(61.1801)} ${o(50.6904)} ${i(60.46)}C${o(51.9373)} ${i(59.7364)} ${o(53.3558)} ${i(59.5781)} ${o(54.6523)} ${i(59.9023)}C${o(54.6744)} ${i(58.5659)} ${o(55.1925)} ${i(57.2372)} ${o(56.21)} ${i(56.2197)}C${o(57.2339)} ${i(55.2007)} ${o(58.5676)} ${i(54.6816)} ${o(59.9062)} ${i(54.6611)}C${o(59.5835)} ${i(53.3649)} ${o(59.7414)} ${i(51.9468)} ${o(60.46)} ${i(50.7002)}C${o(61.1797)} ${i(49.4517)} ${o(62.3312)} ${i(48.6068)} ${o(63.6182)} ${i(48.2412)}C${o(62.9651)} ${i(47.0726)} ${o(62.7473)} ${i(45.658)} ${o(63.1201)} ${i(44.2598)}C${o(63.4916)} ${i(42.8718)} ${o(64.3794)} ${i(41.7591)} ${o(65.5225)} ${i(41.0723)}C${o(64.5929)} ${i(40.1115)} ${o(64.0206)} ${i(38.8033)} ${o(64.0205)} ${i(37.3604)}C${o(64.0205)} ${i(35.9186)} ${o(64.5915)} ${i(34.611)} ${o(65.5195)} ${i(33.6504)}C${o(64.3785)} ${i(32.9631)} ${o(63.4908)} ${i(31.8501)} ${o(63.1201)} ${i(30.46)}C${o(62.7421)} ${i(29.0656)} ${o(62.9572)} ${i(27.6498)} ${o(63.6113)} ${i(26.4795)}C${o(62.3272)} ${i(26.1115)} ${o(61.1784)} ${i(25.2657)} ${o(60.46)} ${i(24.0195)}C${o(59.7364)} ${i(22.7727)} ${o(59.5781)} ${i(21.3541)} ${o(59.9023)} ${i(20.0576)}C${o(58.5626)} ${i(20.038)} ${o(57.23)} ${i(19.52)} ${o(56.21)} ${i(18.5)}C${o(55.1931)} ${i(17.4783)} ${o(54.675)} ${i(16.1482)} ${o(54.6523)} ${i(14.8125)}C${o(53.3557)} ${i(15.1357)} ${o(51.9374)} ${i(14.9785)} ${o(50.6904)} ${i(14.2598)}C${o(49.4399)} ${i(13.5339)} ${o(48.5931)} ${i(12.3801)} ${o(48.2285)} ${i(11.0918)}C${o(47.0603)} ${i(11.7439)} ${o(45.6474)} ${i(11.9624)} ${o(44.25)} ${i(11.5898)}V${i(11.5801)}C${o(42.8613)} ${i(11.2085)} ${o(41.7483)} ${i(10.3196)} ${o(41.0615)} ${i(9.17578)}Z`}function Z1(e){let t=e/70;return {scale:t,transform:(n,o)=>(n-5)*t+o}}function zE(e,t,r){let{scale:n,transform:o}=Z1(r);return M`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}H ${o(5,e)}zM ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${35*n}z`}function DE(e,t,r){let n=r/7,o=n*1.5,i=n*.75,s=M`M ${e+o} ${t}`+M`h ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${o} ${o}`+M`v ${r-2*o}`+M`a ${o} ${o} 0 0 1 ${-o} ${o}`+M`h ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${-o} ${-o}`+M`v ${-(r-2*o)}`+M`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=M`M ${e+n+i} ${t+n}`+M`h ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${i} ${i}`+M`v ${5*n-2*i}`+M`a ${i} ${i} 0 0 1 ${-i} ${i}`+M`h ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${-i} ${-i}`+M`v ${-(5*n-2*i)}`+M`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function BE(e,t,r){let{scale:n,transform:o}=Z1(r);return M`M ${o(5,e)} ${o(40,t)}a ${35*n} ${35*n}, 0, 0, 0, ${35*n} ${35*n}h ${30*n}a ${5*n} ${5*n}, 0, 0, 0, ${5*n} -${5*n}v -${30*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} -${35*n}a ${35*n} ${35*n}, 0, 0, 0, -${35*n} ${35*n}zM ${o(40,e)} ${o(15,t)}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} ${25*n}v ${25*n}h -${25*n}a ${25*n} ${25*n}, 0, 0, 1, -${25*n} -${25*n}a ${25*n} ${25*n}, 0, 0, 1, ${25*n} -${25*n}z`}function ZE(e,t,r){let{scale:n,transform:o}=Z1(r);return M`M ${o(5,e)} ${o(30,t)}v ${20*n}a ${25*n} ${25*n}, 0, 0, 0, ${25*n} ${25*n}h ${45*n}v -${45*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} -${25*n}h -${20*n}a ${25*n} ${25*n}, 0, 0, 0, -${25*n} ${25*n}M ${o(30,e)} ${o(15,t)}h ${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} ${15*n}v ${35*n}h -${35*n}a ${15*n} ${15*n}, 0, 0, 1, -${15*n} -${15*n}v -${20*n}a ${15*n} ${15*n}, 0, 0, 1, ${15*n} -${15*n}z`}function UE(e,t,r){let n=r/70,o=e+r/2-40*n,i=t+r/2-40*n,s=(c,u)=>c*n+u;return M`M${s(35.19239999999999,o)} ${s(5.837547376725838,i)}C${s(37.69667692307692,o)} ${s(3.8737070690335305,i)}, ${s(41.218430769230764,o)} ${s(3.8737092228796843,i)}, ${s(43.722707692307694,o)} ${s(5.837547376725838,i)}L${s(46.62781538461539,o)} ${s(8.115648915187375,i)}L${s(50.23356923076923,o)} ${s(7.32361506903353,i)}C${s(53.342,o)} ${s(6.640824299802762,i)}, ${s(56.51483076923077,o)} ${s(8.168784299802759,i)}, ${s(57.91892307692308,o)} ${s(11.024719684418145,i)}L${s(59.54787692307692,o)} ${s(14.337679684418145,i)}L${s(63.14027692307692,o)} ${s(15.188578145956608,i)}C${s(66.23707692307693,o)} ${s(15.922091992110452,i)}, ${s(68.43270769230769,o)} ${s(18.675396607495067,i)}, ${s(68.45876923076924,o)} ${s(21.857768915187375,i)}L${s(68.48892307692307,o)} ${s(25.54931045364891,i)}L${s(71.35633846153846,o)} ${s(27.874602761341222,i)}C${s(73.82830769230769,o)} ${s(29.879187376725838,i)}, ${s(74.61187692307692,o)} ${s(33.312418145956606,i)}, ${s(73.25452307692306,o)} ${s(36.19103353057199,i)}L${s(71.68006153846153,o)} ${s(39.530141222879685,i)}L${s(73.25452307692306,o)} ${s(42.86924891518738,i)}C${s(74.61187692307692,o)} ${s(45.747864299802764,i)}, ${s(73.82830769230769,o)} ${s(49.18109506903353,i)}, ${s(71.35633846153846,o)} ${s(51.18567968441815,i)}L${s(68.48892307692307,o)} ${s(53.510971992110456,i)}L${s(68.45876923076924,o)} ${s(57.202664299802755,i)}C${s(68.43270769230769,o)} ${s(60.38497199211046,i)}, ${s(66.23707692307693,o)} ${s(63.13823353057199,i)}, ${s(63.14027692307692,o)} ${s(63.871833530572,i)}L${s(59.54787692307692,o)} ${s(64.72260276134121,i)}L${s(57.91892307692308,o)} ${s(68.03564891518737,i)}C${s(56.51483076923077,o)} ${s(70.89164891518737,i)}, ${s(53.342,o)} ${s(72.41958737672583,i)}, ${s(50.23356923076923,o)} ${s(71.7368181459566,i)}L${s(46.62781538461539,o)} ${s(70.94463353057199,i)}L${s(43.722707692307694,o)} ${s(73.22275660749506,i)}C${s(41.218430769230764,o)} ${s(75.18663353057198,i)}, ${s(37.69667692307692,o)} ${s(75.18663353057198,i)}, ${s(35.19239999999999,o)} ${s(73.22275660749506,i)}L${s(32.28729230769231,o)} ${s(70.94463353057199,i)}L${s(28.68153846153846,o)} ${s(71.7368181459566,i)}C${s(25.573215384615384,o)} ${s(72.41958737672583,i)}, ${s(22.400384615384613,o)} ${s(70.89164891518737,i)}, ${s(20.996141538461536,o)} ${s(68.03564891518737,i)}L${s(19.36720923076923,o)} ${s(64.72260276134121,i)}L${s(15.774852307692306,o)} ${s(63.871833530572,i)}C${s(12.67803076923077,o)} ${s(63.13823353057199,i)}, ${s(10.48237846153846,o)} ${s(60.38497199211046,i)}, ${s(10.45636,o)} ${s(57.202664299802755,i)}L${s(10.426163076923077,o)} ${s(53.510971992110456,i)}L${s(7.558747692307692,o)} ${s(51.18567968441815,i)}C${s(5.086880338461539,o)} ${s(49.18109506903353,i)}, ${s(4.303258769230769,o)} ${s(45.747864299802764,i)}, ${s(5.660599692307692,o)} ${s(42.86924891518738,i)}L${s(7.235153846153846,o)} ${s(39.530141222879685,i)}L${s(5.660599692307692,o)} ${s(36.19103353057199,i)}C${s(4.3032566153846155,o)} ${s(33.312418145956606,i)}, ${s(5.086885938461538,o)} ${s(29.879187376725838,i)}, ${s(7.558747692307692,o)} ${s(27.874602761341222,i)}L${s(10.426163076923077,o)} ${s(25.54931045364891,i)}L${s(10.45636,o)} ${s(21.857768915187375,i)}C${s(10.48237846153846,o)} ${s(18.67537506903353,i)}, ${s(12.678052307692308,o)} ${s(15.922091992110452,i)}, ${s(15.774852307692306,o)} ${s(15.188578145956608,i)}L${s(19.36720923076923,o)} ${s(14.337679684418145,i)}L${s(20.996141538461536,o)} ${s(11.024719684418145,i)}C${s(22.400384615384613,o)} ${s(8.168784299802759,i)}, ${s(25.573215384615384,o)} ${s(6.640824299802762,i)}, ${s(28.68153846153846,o)} ${s(7.32361506903353,i)}L${s(32.28729230769231,o)} ${s(8.115648915187375,i)}L${s(35.19239999999999,o)} ${s(5.837547376725838,i)}M${s(39.45766153846154,o)} ${s(13.665055069033532,i)}L${s(37.01498461538461,o)} ${s(15.58053506903353,i)}C${s(35.39098461538461,o)} ${s(16.854061222879682,i)}, ${s(33.282799999999995,o)} ${s(17.335251992110454,i)}, ${s(31.26701538461538,o)} ${s(16.892464299802757,i)}L${s(28.235046153846152,o)} ${s(16.22649506903353,i)}L${s(26.865415384615382,o)} ${s(19.012107376725837,i)}C${s(25.954812307692308,o)} ${s(20.864178145956608,i)}, ${s(24.264193846153844,o)} ${s(22.212399684418145,i)}, ${s(22.255926153846154,o)} ${s(22.688076607495066,i)}L${s(19.235393846153844,o)} ${s(23.40354122287968,i)}L${s(19.21,o)} ${s(26.507556607495065,i)}C${s(19.19313538461538,o)} ${s(28.57137199211045,i)}, ${s(18.25492,o)} ${s(30.519525838264297,i)}, ${s(16.651919999999997,o)} ${s(31.81937199211045,i)}L${s(14.240926153846154,o)} ${s(33.774633530572,i)}L${s(15.564830769230769,o)} ${s(36.58238737672584,i)}C${s(16.445064615384617,o)} ${s(38.44891045364892,i)}, ${s(16.445064615384617,o)} ${s(40.611371992110456,i)}, ${s(15.564830769230769,o)} ${s(42.47811045364892,i)}L${s(14.240926153846154,o)} ${s(45.28564891518738,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}L${s(13.883236923076923,o)} ${s(50.654971992110454,i)}L${s(16.651919999999997,o)} ${s(47.240910453648915,i)}C${s(18.25492,o)} ${s(48.54075660749507,i)}, ${s(19.19313538461538,o)} ${s(50.4891258382643,i)}, ${s(19.21,o)} ${s(52.5527258382643,i)}L${s(19.235393846153844,o)} ${s(55.65684891518738,i)}L${s(22.255926153846154,o)} ${s(56.37235660749507,i)}C${s(24.264193846153844,o)} ${s(56.847925838264295,i)}, ${s(25.954812307692308,o)} ${s(58.196233530571995,i)}, ${s(26.865415384615382,o)} ${s(60.0483258382643,i)}L${s(28.235046153846152,o)} ${s(62.833895069033524,i)}L${s(31.26701538461538,o)} ${s(62.1679258382643,i)}C${s(33.282799999999995,o)} ${s(61.72509506903353,i)}, ${s(35.39098461538461,o)} ${s(62.20626429980276,i)}, ${s(37.01498461538461,o)} ${s(63.47983353057199,i)}L${s(39.45766153846154,o)} ${s(65.39524891518737,i)}L${s(41.90012307692308,o)} ${s(63.47983353057199,i)}C${s(43.524123076923075,o)} ${s(62.20626429980276,i)}, ${s(45.632307692307684,o)} ${s(61.72509506903353,i)}, ${s(47.6480923076923,o)} ${s(62.1679258382643,i)}L${s(50.68006153846154,o)} ${s(62.833895069033524,i)}L${s(52.049692307692304,o)} ${s(60.0483258382643,i)}C${s(52.960338461538456,o)} ${s(58.196233530571995,i)}, ${s(54.6508923076923,o)} ${s(56.847925838264295,i)}, ${s(56.65913846153846,o)} ${s(56.37235660749507,i)}L${s(59.67969230769231,o)} ${s(55.65684891518738,i)}L${s(59.70510769230769,o)} ${s(52.5527258382643,i)}C${s(59.72190769230769,o)} ${s(50.4891258382643,i)}, ${s(60.66012307692307,o)} ${s(48.54075660749507,i)}, ${s(62.263230769230766,o)} ${s(47.240910453648915,i)}L${s(64.67424615384616,o)} ${s(45.28564891518738,i)}L${s(63.35027692307692,o)} ${s(42.47811045364892,i)}C${s(62.47,o)} ${s(40.611371992110456,i)}, ${s(62.47,o)} ${s(38.44891045364892,i)}, ${s(63.35027692307692,o)} ${s(36.58238737672584,i)}L${s(64.67424615384616,o)} ${s(33.774633530572,i)}L${s(62.263230769230766,o)} ${s(31.81958737672584,i)}C${s(60.66012307692307,o)} ${s(30.519525838264297,i)}, ${s(59.72190769230769,o)} ${s(28.57137199211045,i)}, ${s(59.70510769230769,o)} ${s(26.507556607495065,i)}L${s(59.67969230769231,o)} ${s(23.40354122287968,i)}L${s(56.65913846153846,o)} ${s(22.688076607495066,i)}C${s(54.6508923076923,o)} ${s(22.212399684418145,i)}, ${s(52.960338461538456,o)} ${s(20.864178145956608,i)}, ${s(52.049692307692304,o)} ${s(19.012128915187375,i)}L${s(50.68006153846154,o)} ${s(16.22649506903353,i)}L${s(47.6480923076923,o)} ${s(16.892464299802757,i)}C${s(45.632307692307684,o)} ${s(17.335251992110454,i)}, ${s(43.524338461538456,o)} ${s(16.85408276134122,i)}, ${s(41.90012307692308,o)} ${s(15.58053506903353,i)}L${s(39.45766153846154,o)} ${s(13.665055069033532,i)}Z`}function bl(e,t,r,n,o="top-left"){switch(n){case "leaf":return ww(e,t,r,o);case "leaf-reverse":return ww(e,t,r,o,true);case "drop":return $E(e,t,r,o);case "octagon":return $w(e,t,r,1.6);case "bevel":return $w(e,t,r,1.1);case "squircle":return wE(e,t,r);case "cushion":return SE(e,t,r);case "shield":return CE(e,t,r);case "petal":return vE(e,t,r,o);case "porthole":return RE(e,t,r);case "notch":return PE(e,t,r);case "plus":return kE(e,t,r);case "bud":return ME(e,t,r,o);case "bowl":return TE(e,t,r);case "gear":return FE(e,t,r);case "rounded":return LE(e,t,r);case "circle":return NE(e,t,r);case "diya":return zE(e,t,r);case "extra-rounded":return DE(e,t,r);case "message":return BE(e,t,r);case "pointy":return ZE(e,t,r);case "curly":return UE(e,t,r);default:return OE(e,t,r)}}var yl=.22,xl=.14;function Sw(e,t,r={}){if(e==="circle")return k("circle",{cx:x(t.x+t.w/2),cy:x(t.y+t.h/2),r:x(Math.min(t.w,t.h)/2),...r});let n=e==="rounded"?Math.min(t.w,t.h)*yl:0;return k("rect",{height:x(t.h),width:x(t.w),x:x(t.x),y:x(t.y),...n>0&&{rx:x(n),ry:x(n)},...r})}function GE(e,t){let r=e.w*t,n=e.h*t;return {x:e.x+r,y:e.y+n,w:e.w-2*r,h:e.h-2*n}}function $l(e,t){let r=e.shape??"square",n=e.plate,o=n?GE(t,xl):t,i=a=>k("image",{height:x(o.h),href:e.src,preserveAspectRatio:"none",width:x(o.w),x:x(o.x),y:x(o.y),...a&&{clipPath:`url(#${a})`}});if(r==="square"&&!n)return i();let s=r==="square"?void 0:`qrdx-logo-${Dn(`${r}|${x(o.x)}|${x(o.y)}|${x(o.w)}|${x(o.h)}`)}`;return Be("g",{children:[n&&Sw(r,t,{fill:n}),s&&k("clipPath",{id:s,children:Sw(r,o)}),i(s)]})}var Cw=.6,QE=["L","M","Q","H"];function vw(e){let t=Ke(e.value,e.level,e.exactLevel),r=QE[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:Ye(t.size,e.margin,e.shape),map:qs(t.version,r),level:r,version:t.version}}function Aw(e,t){let{cells:r,map:n}=e,o=r.length,i=qr(r,e.code.size,e.layoutMargin,t);if(!i)return null;let s=i.excavation??{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.ceil(i.x+i.w)-Math.floor(i.x),h:Math.ceil(i.y+i.h)-Math.floor(i.y)},a=[];for(let u=Math.max(0,s.y);u<Math.min(o,s.y+s.h);u++)for(let l=Math.max(0,s.x);l<Math.min(o,s.x+s.w);l++)a.push(u*o+l);let c=Xs(n,a);return {worst:Math.max(0,...c),correctable:n.correctable,budget:Math.floor(n.correctable*Cw),level:e.level,version:e.version}}function wl(e,t){return Aw(vw(e),t)}var Ew=e=>!e||e.worst<=e.budget;function jE(e,t){return Ew(wl(e,t))}function U1(e,t,r,n){let o=t.map(a=>vw({...e,level:a})),i=a=>{let c=n(a);return o.every(u=>Ew(Aw(u,c)))};if(i(r))return r;let s=e.size*.005;for(let a=r-s;a>0;a-=s)if(i(a))return a;return 0}function bi(e,t){if(!t)return;let r=Math.floor(e.size*Ma),n=t.width||r,o=t.height||r,i=p=>{if(p===n)return t;let m=o*p/n;return {...t,width:p,height:m,...t.x!=null&&{x:t.x+(n-p)/2},...t.y!=null&&{y:t.y+(o-m)/2}}},s=e.level??jt,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape,exactLevel:e.exactLevel},c=p=>Je({...e,level:s,imageSettings:p}),u=p=>{let m=U1(a,[p],n,i);return m>0?i(m):void 0},l=c(t);if(l===s)return u(s);let f=u(l);return f&&c(f)===l?f:u(s)}var Rw={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"]},Pw={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},kw=["circle","curly"],Iw=["diamond","banner","star"],Mw={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Zt=["square","liquid","classy","classy-rounded"],Tw={"circle/rounded":Zt,"circle/extra-rounded":Zt,"circle/message":[...Zt,"leaf"],"circle/pointy":Zt,"circle/leaf-reverse":Zt,"circle/drop":Zt,"circle/bevel":[...Zt,"leaf"],"circle/squircle":[...Zt,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Zt,"circle/shield":[...Zt,"rounded","horizontal-line","leaf"],"circle/petal":Zt};function Ow(e,t,r){return (Mw[e]?.includes(t)??false)&&!Tw[`${e}/${t}`]?.includes(r)}function G1(e){let t=Ve(an,e.bodyPattern??"circle"),r=Ve(ir,e.cornerEyePattern??"gear"),n=Ve(sr,e.cornerEyeDotPattern??"circle");return Rw[n]?.includes(r)?{kind:"dot-eye",message:`${n} centres in ${r} eyes are missed by strict decoders`,fix:"Pick a square, rounded or circle centre, or another eye shape"}:Pw[t]?.includes(r)?{kind:"body-eye",message:`${t} dots next to ${r} eyes are missed up close`,fix:"Pick a fuller dot shape or another eye shape"}:Iw.includes(n)?{kind:"dot",message:`${n} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:kw.includes(r)?{kind:"eye",message:`${r} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:Ow(n,r,t)?{kind:"sharp-dot-eye",message:`${n} centres in ${r} eyes are missed by some decoders on screens and in sharp prints`,fix:"Pick a rounded centre, or gear or octagon eyes"}:null}var Q1=e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},VE=e=>255*(e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055);function Fw({r:e,g:t,b:r}){let n=Q1(e),o=Q1(t),i=Q1(r),s=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*i),a=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*i),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*i),u=1.9779984951*s-2.428592205*a+.4505937099*c,l=.0259040371*s+.7827717662*a-.808675766*c;return {l:.2104542553*s+.793617785*a-.0040720468*c,c:Math.hypot(u,l),h:Math.atan2(l,u)}}function j1({l:e,c:t,h:r}){let n=t*Math.cos(r),o=t*Math.sin(r),i=(e+.3963377774*n+.2158037573*o)**3,s=(e-.1055613458*n-.0638541728*o)**3,a=(e-.0894841775*n-1.291485548*o)**3;return [4.0767416621*i-3.3077115913*s+.2309699292*a,-1.2684380046*i+2.6097574011*s-.3413193965*a,-0.0041960863*i-.7034186147*s+1.707614701*a]}var Lw=1e-7,Nw=e=>e.every(t=>t>=-Lw&&t<=1+Lw),HE=20;function Sl(e){let t=j1(e);if(!Nw(t)){let i=0,s=e.c;for(let a=0;a<HE;a++){let c=(i+s)/2;Nw(j1({...e,c}))?i=c:s=c;}t=j1({...e,c:i});}let[r=0,n=0,o=0]=t.map(i=>Math.round(VE(Math.min(1,Math.max(0,i)))));return {r,g:n,b:o,a:1}}var Dw="gear",WE="circle";function er(e,t){let r=e.eyeShapes?.[t];return {outer:Ve(ir,r?.outer??e.cornerEyePattern??Dw),inner:Ve(sr,r?.inner??e.cornerEyeDotPattern??WE)}}var qE=["curly","circle"];function q1(e){let t=un.map(r=>er(e,r));for(let r of qE)if(t.some(n=>n.outer===r))return r;return t[0]?.outer??Dw}var zw=["dot-eye","body-eye","dot","sharp-dot-eye","eye"];function X1(e){let t=null,r=new Set;for(let n of un){let{outer:o,inner:i}=er(e,n),s=`${o}/${i}`;if(r.has(s))continue;r.add(s);let a=G1({bodyPattern:e.bodyPattern,cornerEyePattern:o,cornerEyeDotPattern:i});a&&(!t||zw.indexOf(a.kind)<zw.indexOf(t.kind))&&(t=a);}return t}function xi(e,t,r,n){if(!(e&&Number.isFinite(e))||e<=0||la(n)||r<=0)return 0;let o=Math.min(po,Df*r/(t+2*r));return Math.min(e,o)}function XE(e){let{value:t,level:r,shape:n,autoLevel:o,exactLevel:i,isOGContext:s}=e,a=e.size??$e,c=e.margin??Me,u=bi({value:`${t}`,size:a,margin:c,level:r,shape:n,autoLevel:o,exactLevel:i,isOGContext:s},e.imageSettings),l=Je({value:`${t}`,size:a,level:r,margin:c,imageSettings:u,isOGContext:s,autoLevel:o,exactLevel:i,shape:n}),f=Ke(`${t}`,l,i).size;return xi(po,f,c,n)}var W1=(e,t,r,n)=>Math.min(n,Math.max(r,typeof e=="number"&&Number.isFinite(e)?e:t)),YE=/^hsla?\(([^)]*)\)$/,KE=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?$/,JE=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)%?$/;function V1(e,t){let r=e?.trim()??"";if(!JE.test(r))return Number.NaN;let n=Number.parseFloat(r),o=r.endsWith("%")||t?n/100:n;return Math.min(1,Math.max(0,o))}function e7(e){let t=YE.exec(e);if(!t)return null;let[r="",n]=(t[1]??"").split("/"),o=r.split(/[\s,]+/).filter(Boolean);if(o.length!==(n===void 0&&o.length===4?4:3))return null;let[i="",s,a,c]=o,u=V1(s,true),l=V1(a,true),f=V1(n??c??"1",false),p=Number.parseFloat(i);if(!(KE.test(i)&&[u,l,f].every(Number.isFinite)))return null;let m=u*Math.min(l,1-l),h=d=>{let g=(d+p/30)%12,_=g<0?g+12:g;return 255*(l-m*Math.max(-1,Math.min(_-3,9-_,1)))};return {r:h(0),g:h(8),b:h(4),a:f}}function El(e){let t=e?.trim().toLowerCase()??"";return t==="none"?{r:0,g:0,b:0,a:0}:ve(t)??e7(t)}function Cl(e){return El(e)?.a??1}function Bw(e){let t=ot(e,Pe);return t.type==="solid"?Cl(t.color)<1:t.type==="image"?Cl(t.underlay??"transparent")<1:t.stops.some(r=>Cl(r.color)<1)}var yi=({r:e,g:t,b:r})=>[.2126*e+.7152*t+.0722*r,.299*e+.587*t+.114*r],Al=yi(ve(ln)),Hn=1e-9,vl=(e,t,r)=>e.every((n,o)=>n>=t[o]-Hn&&n<=r[o]+Hn),Y1=({r:e,g:t,b:r})=>`#${[e,t,r].map(n=>Math.round(n).toString(16).padStart(2,"0")).join("")}`;function Zw(e){let t=El(e.color||La);return t&&t.a>0?Y1(t):La}var t7=24,r7=12;function Uw(e,t,r){if(vl(yi(e),t,r))return e;if(e.r===e.g&&e.g===e.b){let u=Math.min(Math.floor(Math.min(...r)+Hn),Math.max(e.r,Math.ceil(Math.max(...t)-Hn)));return u>=Math.max(...t)-Hn?{r:u,g:u,b:u,a:1}:null}let n=Fw(e),o=u=>{let l=Sl({l:n.l,c:u,h:n.h}),f=yi(l);if(vl(f,t,r))return l;let p=f.some((_,b)=>_<t[b]),m=_=>yi(_).every((b,y)=>p?b>=t[y]-Hn:b<=r[y]+Hn),h=n.l,d=p?1:0;for(let _=0;_<t7;_++){let b=(h+d)/2;m(Sl({l:b,c:u,h:n.h}))?d=b:h=b;}let g=Sl({l:d,c:u,h:n.h});return vl(yi(g),t,r)?g:null},i=o(n.c);if(i)return i;let s=o(0);if(!s)return null;let a=0,c=n.c;for(let u=0;u<r7;u++){let l=(a+c)/2,f=o(l);f?(a=l,s=f):c=l;}return s}var H1="or turn the halo off";function Gw(e){let t=ot(e,Pe);if(t.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, ${H1}`};if(Bw(e))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, ${H1}`};let r=(t.type==="solid"?[t.color]:t.stops.map(o=>o.color)).map(El),n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let o of r){let i=o?yi(o):[0,0];n[0]=Math.min(n[0],i[0]),n[1]=Math.min(n[1],i[1]);}return vl(Al,Al,n)?n:{reason:"dark-background",message:`A halo needs a light background, at least as light as ${ln}: on a darker one the rim makes the code unreadable`,fix:`Lighten the background to ${ln} or lighter, ${H1}`}}function K1(e,t){let r=Gw(t);if(!Array.isArray(r))return r;let n=Zw(e),o=Uw(ve(n),Al,r);return {drawn:o?Y1(o):ln,picked:n}}function n7(e,t){let r=K1({color:e},t);return "drawn"in r?r.drawn:null}function o7(e,t,r=4){let n=Gw(t),o=El(e);if(!(Array.isArray(n)&&o))return [];let i=new Set;for(let s=0;s<r;s++){let a=s/r,c=Al.map((l,f)=>l+a*((n[f]??l)-l)),u=Uw({...o,a:1},c,n);u&&i.add(Y1(u));}return [...i]}function J1(e){if(!e.halo)return null;let t=K1(e.halo,e.bgColor);return "drawn"in t?t.drawn===t.picked?null:{reason:"adjusted",color:t.drawn,message:`Halo drawn as ${t.drawn} instead of ${t.picked} so the code still scans: a rim must read no lighter than the background and at least as light as ${ln}`,fix:`To have it drawn as picked, choose a color in that range, such as ${t.drawn}`}:t}function fa(e,t){if(!e)return null;let r=t?K1(e,t.bgColor):null;if(r&&!("drawn"in r))return null;let n=W1(e.width,Bf,Li,Ni);return {color:r?r.drawn:Zw(e),width:n}}function e_(e){if(!e)return null;let t=o=>W1(o,Zf,-ar,ar),r=t(e.dx),n=t(e.dy);return r===0&&n===0?null:{color:e.color||Gf,opacity:W1(e.opacity,Uf,Fi,zi),dx:r,dy:n}}var t_="data-qrdx-part",Qw="data-qrdx-eye",i7=["eye-outer","eye-centre","body","logo","background"];function r_(e,t,r){if(e)return r?{[t_]:t,[Qw]:r}:{[t_]:t}}var ma=300;function tr(e){return {id:e.id,name:e.name,description:e.description,spec:e.spec,wrapper:(t,r)=>{let n=Gn(e.spec),o=r?.fgColor,i=(typeof o=="string"?o:Fe(o,""))||"black",s=aa(n.qr.size,n,{color:i}),{x:a,y:c,scale:u}=e.at;return k("svg",{height:ma,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${ma} ${ma}`,width:ma,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Be("g",{"data-qrdx-template":e.id,transform:`translate(${x(a)} ${x(c)})${u===1?"":` scale(${u})`}`,children:[aw(s),k("g",{fill:"none",transform:`translate(${x(s.qrX)} ${x(s.qrY)}) scale(${s.qrSize/ma})`,children:t})]})})}}}var jw={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 Vw=tr({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:jw,at:{x:47,y:95,scale:1}});var Hw={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>k("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:k("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var da=593,Xr=296.5,pa=146.5,Jw=294.5,eS=231.228,tS="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",a7="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",c7="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",Ww="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",qw=52,u7=240;function Xw(e){let t=0;return e.split(" ").map(r=>(t+=Number.parseInt(r,36),t/1e4))}var n_;function l7(){if(!n_){let e=Xw(a7),t=Xw(c7),r=[];for(let n=0;n<Ww.length;n+=3){let o=Number.parseInt(Ww.slice(n,n+3),36);r.push({cx:e[Math.floor(o/qw)],cy:t[o%qw]});}n_=r;}return n_}function f7(e){let t=0;for(let r=0;r<e.length;r++)t=t*32-t+e.charCodeAt(r),t%=2147483647;return Math.abs(t)}function rS(e){let t=l7(),r=f7(e),n=()=>(r=(r*9301+49297)%233280,r/233280),o=t.map((i,s)=>s);for(let i=o.length-1;i>0;i--){let s=Math.floor(n()*(i+1));[o[i],o[s]]=[o[s],o[i]];}return o.slice(0,u7).sort((i,s)=>i-s).map(i=>t[i])}var Yw=300,m7=49,p7=6;function nS(e,t){if(Yw/t<=m7+.5)return e;let r=pa,n=pa+Yw,o=p7*t+t/2;return e.filter(({cx:i,cy:s})=>Math.max(r-i,i-n,r-s,s-n)>=o)}var oS="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",ha=32,iS=3.5,d7=ha*cn,sS=246.5,xr=2*Math.PI*sS,s_=.36,Kw=sS+s_*ha,o_=400;function $i(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function h7(e){let t=e.slice(0,o_).split(" ").map(r=>yo(r,o_)).join(" ");return Array.from(t).slice(0,o_)}var g7="\u2026",aS=1;function cS(e,t,r,n=false){return n&&t===e.length-1?aS*r:$i(e[t],r)}function a_(e,t,r=false){let n=0;for(let o=0;o<e.length;o++)n+=cS(e,o,t,r);return n}function i_(e,t,r,n=false){return a_(e,t,n)+r*Math.max(0,e.length-1)+$i(" ",t)+2*r<=xr}var uS=e=>e.join("").split(" ").filter(Boolean),_7=(e,t)=>Array.from(Array.from({length:t},()=>e.join(" ")).join(" "));function lS(e,t,r){if(i_(e,t,r))return {chars:e,fontSize:t,letterSpacing:r};let n=Math.min(r,0),o=Math.min(t,d7),i=(d,g=false)=>{let _=a_(d,t,g)+$i(" ",t),b=d.length+1,y=(xr-_)/b;if(y>=n)return {chars:d,fontSize:t,letterSpacing:y,cut:g};let S=(xr-n*b)/_*t;return S>=o?{chars:d,fontSize:S,letterSpacing:n,cut:g}:null},s=i(e);if(s)return s;let a=uS(e),c=fS(a);for(let d=a.length/c.length-1;d>=1;d--){let g=_7(c,d);if(i_(g,o,n))return i(g)??{chars:g,fontSize:o,letterSpacing:n}}let u=xr-$i(" ",o)-aS*o-2*n,l=0,f=0,p=0;for(let[d,g]of e.entries()){if(l+=$i(g,o)+n,l>u)break;p=d+1,(p===e.length||e[p]===" ")&&(f=p);}let m=[...b7(e.slice(0,f>0?f:p)),g7];return (i_(m,t,r,true)?{chars:m,fontSize:t,letterSpacing:r,cut:true}:null)??i(m,true)??{chars:m,fontSize:o,letterSpacing:n,cut:true}}function b7(e){let t=e.length;for(;t>0&&/[\s.,;:!?*·•\-–—]/u.test(e[t-1]);)t--;return e.slice(0,t)}function fS(e){for(let t=1;t<e.length;t++)if(e.length%t===0&&e.every((r,n)=>r===e[n%t]))return e.slice(0,t);return e}function y7(e,t,r){let n=uS(e);if(n.length===0)return {chars:[],fontSize:t,letterSpacing:r};let o=Array.from(fS(n).join(" ")),i=a_(o,t)+$i(" ",t),s=i+(o.length+1)*r,a=Math.min(r,0),c=null;for(let u of new Set([Math.floor(xr/s),Math.ceil(xr/s)])){if(u<1)continue;let l=(xr-u*i)/(u*(o.length+1));if(l>=a&&(!c||Math.abs(l-r)<Math.abs(c.letterSpacing-r))){let f=Array.from({length:u},()=>o.join(""));c={chars:Array.from(f.join(" ")),fontSize:t,letterSpacing:l};}}return c??lS(o,t,r)}function mS(e,t){let{position:r,rotation:n}=t,o=h7(e),i=t.fill==="repeat"?y7(o,t.fontSize,t.letterSpacing):lS(o,t.fontSize,t.letterSpacing),{fontSize:s,letterSpacing:a}=i,c=[],u=0;for(let[d,g]of i.chars.entries()){let _=cS(i.chars,d,s,i.cut);c.push({char:g,along:u+_/2}),u+=_+a;}let l=u-(c.length>0?a:0),f=r!=="bottom",p=f?Kw-s_*s:Kw+s_*s,m=l/xr*180,h=[];for(let{char:d,along:g}of c){if(d.trim()==="")continue;let _=g/xr*360,b=f?n-m+_:n+180+m-_,y=b*Math.PI/180;h.push({char:d,x:le(Xr+p*Math.sin(y)),y:le(Xr-p*Math.cos(y)),rotate:le(f?b:b-180)});}return {text:i.chars.join(""),letters:h,fontSize:s===t.fontSize?s:le(s),letterSpacing:a}}var wi=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,pS={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:(e,t,r)=>{let n=Fe(t?.fgColor,"#000000"),o=Fe(t?.bgColor,"#ffffff"),i=r?.pixelSize??9,s=le(i/2),a=nS(rS(r?.url??""),i),c=wi(t?.fontSize,ha),u=c>0?c:ha,l=typeof t?.customText=="string"?t.customText:oS,f=mS(l,{fontSize:u,letterSpacing:wi(t?.fontLetterSpacing,iS),position:t?.textPosition==="bottom"?"bottom":"top",rotation:wi(t?.textRotation,0),fill:t?.textFill==="repeat"?"repeat":"none"}),p=t?.textColor||"#ffffff",m=t?.fontFamily||hl,h=t?.fontWeight??900,d=wi(t?.strokeWidth,0),g=t?.strokeColor||"#000000",_=[{radius:Xr,width:wi(t?.outerStrokeWidth,d),color:t?.outerStrokeColor||g},{radius:eS,width:wi(t?.innerStrokeWidth,d),color:t?.innerStrokeColor||g}].filter(b=>b.width>0);return Be("svg",{height:da,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${da} ${da}`,width:da,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[k("circle",{cx:Xr,cy:Xr,fill:o,r:Jw}),k("g",{fill:n,children:a.map((b,y)=>k("circle",{cx:b.cx,cy:b.cy,r:s},y))}),k("path",{d:tS,fill:t?.outerCircleColor||n}),_.map((b,y)=>k("circle",{cx:Xr,cy:Xr,fill:"none",r:b.radius,stroke:b.color,strokeWidth:b.width},y)),k("g",{"aria-hidden":"true",children:f.letters.map((b,y)=>k("text",{fill:p,fontFamily:m,fontSize:f.fontSize,fontWeight:h,textAnchor:"middle",transform:`rotate(${b.rotate} ${b.x} ${b.y})`,x:b.x,y:b.y,children:b.char},y))}),k("g",{transform:`translate(${pa} ${pa})`,children:e})]})}};var dS={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 hS=tr({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:dS,at:{x:38,y:10,scale:1}});var gS={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 _S=tr({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:gS,at:{x:0,y:0,scale:300/316}});var bS={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 yS=tr({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:bS,at:{x:46,y:1,scale:1}});var xS={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 $S=tr({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:xS,at:{x:24,y:0,scale:1}});var ga={default:Hw,Arrow:Vw,StandardBox:yS,SquareBorder:_S,StrikedBox:$S,Halloween:hS,DotRing:pS},wS={FlamQR:"DotRing"},Rl=e=>{if(Object.hasOwn(ga,e))return ga[e];let t=Object.hasOwn(wS,e)?wS[e]:void 0;return t?ga[t]:void 0},_L=()=>Object.values(ga),bL=()=>Object.keys(ga);var c_=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function AS(e){return `#${c_(e.r)}${c_(e.g)}${c_(e.b)}`}function Si(e){let t=ve(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:AS(t),opacity:le(t.a,3)}}function Pl(e,t){let r=Math.min(Math.max(e.a,0),1);return {r:e.r*r+t.r*(1-r),g:e.g*r+t.g*(1-r),b:e.b*r+t.b*(1-r),a:1}}var ES={r:0,g:0,b:0,a:1};function C7(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:ve(t.color)??ES})).sort((t,r)=>t.offset-r.offset)}function u_(e,t){let r=e[0],n=e.at(-1);if(!(r&&n))return ES;if(t<=r.offset)return r.color;if(t>=n.offset)return n.color;for(let o=0;o+1<e.length;o++){let i=e[o],s=e[o+1];if(t>=i.offset&&t<=s.offset){let a=s.offset-i.offset,c=a>0?(t-i.offset)/a:1,u=i.color.a+(s.color.a-i.color.a)*c,l=(f,p)=>{let m=f*i.color.a+(p*s.color.a-f*i.color.a)*c;return u>0?m/u:f+(p-f)*c};return {r:l(i.color.r,s.color.r),g:l(i.color.g,s.color.g),b:l(i.color.b,s.color.b),a:u}}}return n.color}var SS=4,CS=720,v7=2;function RS(e,t,r,n,o){let i=C7(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(b=>Math.abs(b.color.a-s)<.002),c=[...new Set([0,...i.map(b=>b.offset),1])].sort((b,y)=>b-y),u=[];for(let b=0;b+1<c.length;b++){let y=c[b],S=c[b+1];if(S<=y)continue;let C=u_(i,y+1e-9),w=u_(i,S-1e-9),$=Math.max(Math.abs(C.r*C.a-w.r*w.a),Math.abs(C.g*C.a-w.g*w.a),Math.abs(C.b*C.a-w.b*w.a),Math.abs(C.a-w.a)*255),v=Math.ceil($/v7),R=Math.ceil((S-y)*360/SS),P=Math.max(1,v,R);for(let I=0;I<P;I++)u.push([y+(S-y)*I/P,y+(S-y)*(I+1)/P]);}let l=u;if(u.length>CS){let b=Math.ceil(u.length/CS);l=[];for(let y=0;y<u.length;y+=b){let S=u.slice(y,y+b);l.push([S[0][0],S.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*SS/2*(Math.PI/180)),m=b=>{let y=b*Math.PI/180;return [x(r+p*Math.cos(y)),x(n+p*Math.sin(y))]},h=`${x(r)} ${x(n)}`,d=b=>le((b%360+360)%360,4),g=l.length-1,_=l.map(([b,y],S)=>{let C=u_(i,(b+y)/2),w=(y-b)*360,$=a&&S===0&&g>0?w:0,v=a&&S<g?w:0,R=f+b*360-$,P=f+y*360+v,[I,T]=m(R),[O,D]=m(P);return {d:`M${h}L${I} ${T}L${O} ${D}Z`,color:AS(C),...a||C.a>=1?{}:{opacity:le(C.a,3)},from:d(R),sweep:le(P-R,4)}});return a&&s<1?{wedges:_,opacity:le(s,3)}:{wedges:_}}function vS(e,t,r,n){return (Math.atan2(n-t,r-e)*180/Math.PI%360+360)%360}function PS(e,t,r){if(e>=r.x-1e-6&&e<=r.x+r.width+1e-6&&t>=r.y-1e-6&&t<=r.y+r.height+1e-6)return null;let o=[[r.x,r.y],[r.x+r.width,r.y],[r.x,r.y+r.height],[r.x+r.width,r.y+r.height]],i=vS(e,t,r.x+r.width/2,r.y+r.height/2),s=0,a=0;for(let[c,u]of o){let l=vS(e,t,c,u)-i;l>180?l-=360:l<=-180&&(l+=360),s=Math.min(s,l),a=Math.max(a,l);}return [i+s,i+a]}function kS(e,t){let r=e[1]-e[0],n=t[1]-t[0];if(r>=360||n>=360)return true;let o=((t[0]-e[0])%360+360)%360;return o<=r||o+n>=360}function f_(e,t){return e.slice().map((r,n)=>n<t.y||n>=t.y+t.h?r:r.map((o,i)=>i<t.x||i>=t.x+t.w?o:false))}function TS(e,t=0){let r=[];return e.forEach((n,o)=>{let i=null;n.forEach((s,a)=>{if(!s&&i!==null){r.push(M`M${i+t} ${o+t}h${a-i}v1H${i+t}z`),i=null;return}if(a===n.length-1){if(!s)return;i===null?r.push(M`M${a+t},${o+t} h1v1H${a+t}z`):r.push(M`M${i+t},${o+t} h${a+1-i}v1H${i+t}z`);return}s&&i===null&&(i=a);});}),r.join("")}function A7(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}var E7=.9;function l_(e,t){let{margin:r,pixelSize:n,pattern:o="circle",plain:i=false}=t;if(b$(o))return x$(e,{margin:r,pixelSize:n,pattern:o,scale:t.scale,plain:i});let s=ol(t.scale,o),a=[],c=e.length,u=n*.45,l=i?()=>false:x1(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!A7(h,p,c))){let d=(h+.5+r)*n,g=(p+.5+r)*n,_=`${h}-${p}`,b=a.length;if(l(h,p)){a.push(k("rect",{height:x(n),width:x(n),x:x(d-n/2),y:x(g-n/2)},_));return}switch(o){case "circle":a.push(k("circle",{cx:x(d),cy:x(g),r:x(u),transform:M`rotate(0,${d},${g})`},_));break;case "circle-large":{let y=n*.5;a.push(k("circle",{cx:x(d),cy:x(g),r:x(y),transform:M`rotate(0,${d},${g})`},_));}break;case "small-square":{let y=n*.357143;a.push(k("path",{d:M`M ${d-y} ${g-y}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:M`rotate(0,${d},${g})`},_));}break;case "diamond":{let y=n*.357143;a.push(k("path",{d:M`M ${d-y} ${g-y}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:M`rotate(45,${d},${g})`},_));}break;case "circle-mixed":{let y=(h+p)%3===0?E7:(h+p)%2===0?1:1.25,S=u*y;a.push(k("circle",{cx:x(d),cy:x(g),r:x(S),transform:M`rotate(0,${d},${g})`},_));}break;case "pacman":{let y=n*.5,S=n*.357143;a.push(k("path",{d:M`M ${d-y} ${g-S}v ${n*.714286}h ${y}a ${y*.5} ${y*.5}, 0, 0, 0, 0 -${n*.714286}h -${y}v -${n*.714286}z`,transform:M`rotate(${(h+p)%2===0?0:90},${d},${g})`},_));}break;case "rounded":{let y=n*.5,S=n*.2;a.push(k("rect",{height:x(n),rx:x(S),ry:x(S),transform:M`rotate(0,${d},${g})`,width:x(n),x:x(d-y),y:x(g-y)},_));}break;case "square":{let y=n*.5;a.push(k("rect",{height:x(n),transform:M`rotate(0,${d},${g})`,width:x(n),x:x(d-y),y:x(g-y)},_));}break;case "vertical-line":{let y=n*.714286,S=n;a.push(k("path",{d:M`M ${d-n*.5} ${g-y*.5}v ${y}h ${S}v -${y}z`,transform:M`rotate(90,${d},${g})`},_));}break;default:a.push(k("circle",{cx:x(d),cy:x(g),r:x(u),transform:M`rotate(0,${d},${g})`},_));}if(s!==1&&a.length>b){let y=a.pop();a.push(k("g",{transform:M`translate(${d},${g}) scale(${x(s,6)}) translate(${-d},${-g})`,children:y},_));}}});}),a}function R7(e,t){let r=e*Math.PI/180,n=t/2,o=t/2,i=Math.sqrt(t*t+t*t)/2,s=n-i*Math.cos(r),a=o-i*Math.sin(r),c=n+i*Math.cos(r),u=o+i*Math.sin(r);return {x1:s,y1:a,x2:c,y2:u}}function m_(e,t){return `${e}-${Dn(JSON.stringify(t))}`}function P7(e,t,r,n,o){let i=e;if(e===0)switch(o){case "top-left":i=0;break;case "top-right":i=90;break;case "bottom-left":i=270;break;default:i=0;}let s=i*Math.PI/180,a=t+n/2,c=r+n/2,u=Math.sqrt(n*n+n*n)/2,l=a-u*Math.cos(s),f=c-u*Math.sin(s),p=a+u*Math.cos(s),m=c+u*Math.sin(s);return {x1:l,y1:f,x2:p,y2:m}}function Ml(e,t){return t.map((r,n)=>{let{color:o,opacity:i}=Si(r.color);return k("stop",{offset:`${r.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${n}`)})}function OS(e,t,r,n,o,i){let s=RS(t.stops,t.angle??0,r,n,o),a=s.wedges.map((c,u)=>k("path",{d:c.d,"data-arc":`${c.from} ${c.sweep}`,fill:c.color,fillOpacity:c.opacity,shapeRendering:c.opacity===void 0?void 0:"crispEdges"},`${e}-w-${u}`));return k("pattern",{"data-qrdx-conic":`${x(r)} ${x(n)}`,height:x(i),id:e,patternUnits:"userSpaceOnUse",width:x(i),x:0,y:0,children:s.opacity===void 0?a:k("g",{opacity:s.opacity,children:a})},e)}function k7(e="center"){let[t,r]=e.split("-"),n=e==="center"?"center":t,o=r??(t==="left"||t==="right"?t:"center");return {x:o==="left"?0:o==="right"?1:.5,y:n==="top"?0:n==="bottom"?1:.5}}var I7=["xMin","xMid","xMax"],M7=["YMin","YMid","YMax"];function LS(e,t,r){let n=t.scale??1,o=t.fit==="tile",i=o?r/4*n:r,s=t.underlay?Si(t.underlay):null,a=o?i:r*n,c=k7(t.position),u=o?0:c.x*(r-a),l=o?0:c.y*(r-a),f=o?"xMidYMid slice":`${I7[c.x*2]??"xMid"}${M7[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return Be("pattern",{height:x(i),id:e,patternUnits:"userSpaceOnUse",width:x(i),x:0,y:0,children:[s&&k("rect",{fill:s.color,fillOpacity:s.opacity,height:x(i),width:x(i),x:0,y:0}),k("image",{height:x(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:x(a),x:x(u),y:x(l)})]},e)}var NS=(e,t)=>m_("img",[e,t]);function T7(e,t,r,n,o,i,s){let a=ot(e);if(a.type==="solid")return null;if(a.type==="image"){let u=NS(a,s);return {id:u,element:LS(u,a,s)}}let c=m_(i,[a,t,r,n,o,...a.type==="angular"?[s]:[]]);if(a.type==="linear"){let u=a,l=u.angle??0,{x1:f,y1:p,x2:m,y2:h}=P7(l,t,r,n,o);return {id:c,element:k("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:x(f),x2:x(m),y1:x(p),y2:x(h),children:Ml(c,u.stops)},c)}}if(a.type==="radial"){let u=a,l=t+n/2,f=r+n/2,p=n/2*.97;return {id:c,element:k("radialGradient",{cx:x(l),cy:x(f),fx:x(l),fy:x(f),gradientUnits:"userSpaceOnUse",id:c,r:x(p),children:Ml(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:OS(c,a,t+n/2,r+n/2,n*.75,s)}:null}function kl(e,t,r){let n=ot(e);if(n.type==="solid")return null;if(n.type==="image"){let i=NS(n,t);return {id:i,element:LS(i,n,t)}}let o=m_(r,[n,t]);if(n.type==="linear"){let i=n,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=R7(s,t);return {id:o,element:k("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:x(a),x2:x(u),y1:x(c),y2:x(l),children:Ml(o,i.stops)},o)}}if(n.type==="radial"){let i=n,s=t/2,a=t/2,c=t/2*.97;return {id:o,element:k("radialGradient",{cx:x(s),cy:x(a),fx:x(s),fy:x(a),gradientUnits:"userSpaceOnUse",id:o,r:x(c),children:Ml(o,i.stops)},o)}}return n.type==="angular"?{id:o,element:OS(o,n,t/2,t/2,t*.75,t)}:null}var Il=e=>sn(e)||vf(e);function IS(e){let t=new Set,r=[];for(let n of e)n&&!t.has(n.id)&&(t.add(n.id),r.push(n.element));return r}function $r(e,t,r){if(t)return {fill:`url(#${t})`};let n=ot(e,r),o=n.type==="solid"?n.color:n.type==="image"?n.underlay??r:r,{color:i,opacity:s}=Si(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function qr(e,t,r,n){if(n==null)return null;let o=e.length,i=Math.floor(t*Ma),s=(o+2*r)/t,a=(n.width||i)*s,c=(n.height||i)*s,u=n.x==null?o/2-a/2:n.x*s,l=n.y==null?o/2-c/2:n.y*s,f=null;if(n.excavate){let p=Math.max(0,n.padding??0)*s,m=Math.floor(u-p),h=Math.floor(l-p),d=Math.ceil(a+u+p-m),g=Math.ceil(c+l+p-h);f={x:m,y:h,w:d,h:g};}return {x:u,y:l,h:c,w:a,excavation:f}}function Je(e){let t=e.level??jt,{imageSettings:r}=e,n=e.isOGContext&&r?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&r&&n!=="H"){let o=Ke(e.value,n,e.exactLevel).getModules(),i=qr(o,e.size??$e,Ye(o.length,e.margin??Me,e.shape),r);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>Lf&&(n="H");}return n}function O7(e,t,r,n){let o=t/r,i=e.w*o,s=e.h*o,a=(e.x+n)*o,c=(e.y+n)*o;return {imgWidth:i,imgHeight:s,imgLeft:a,imgTop:c}}function vi(e){let{value:t,size:r=$e,level:n=jt,bgColor:o=Pe,fgColor:i=We,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=Me,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:_,art:b,eyeColors:y,moduleScale:S,autoLevel:C,exactLevel:w,shape:$,eyeShapes:v,eyeGradient:R,bgRadius:P,backdrop:I,halo:T,shadow:O,frameLabelMarkers:D,partMarkers:B,...N}=e,te=Ve(an,c),W=Ve(ir,u),re=Ve(sr,l),G=bi({value:t,size:r,margin:f,level:n,shape:$,autoLevel:C,exactLevel:w,isOGContext:p},m),ce=yt(_),Ne=ce?{}:N,Re=Y=>ce?ca(Y,{size:r,frame:_,bgColor:o,svgProps:N,markLabels:D}):Y,Z=Je({value:t,size:r,level:n,margin:f,imageSettings:G,isOGContext:p,autoLevel:C,exactLevel:w,shape:$}),X=Ke(t,Z,w),ye=X.getModules(),Ce=Ye(ye.length,f,$),rn=xw(t,ye.length,f,$),xe=(Y,nt)=>r_(B,Y,nt),nr=xi(P,ye.length,Ce,$),nn=(Y,nt)=>{let Qt=D1($,Y);if(!Qt){if(nr>0){let or=x(nr*Y),Lt=I?Si(I):null;return Be(It,{children:[Lt&&k("rect",{"data-qrdx-look":"backdrop",fill:Lt.color,fillOpacity:Lt.opacity,height:Y,width:Y,x:0,y:0}),k("rect",{...nt,height:Y,rx:or,ry:or,width:Y,x:0,y:0,...xe("background")})]})}return k("rect",{...nt,height:Y,width:Y,x:0,y:0,...xe("background")})}return "circle"in Qt?k("circle",{cx:x(Y/2),cy:x(Y/2),...nt,r:x(Y/2),...xe("background")}):k("path",{d:Qt.path,...nt,...xe("background")})},H=ye.length+Ce*2,ge=qr(ye,r,Ce,G),ie=null;if(G!=null&&ge!=null){ge.excavation!=null&&(ye=f_(ye,ge.excavation));let{imgWidth:Y,imgHeight:nt,imgLeft:Qt,imgTop:or}=O7(ge,r,H,Ce);if(p){let Lt=G.shape??"square";ie=k("img",{alt:"Logo",src:G.src,style:{position:"absolute",left:`${x(Qt)}px`,top:`${x(or)}px`,width:`${x(Y)}px`,height:`${x(nt)}px`,...Lt!=="square"&&{borderRadius:Lt==="circle"?"50%":`${x(Math.min(Y,nt)*yl)}px`},...G.plate&&{backgroundColor:G.plate,padding:`${x(Y*xl)}px`,boxSizing:"border-box"}}});}else ie=$l(G,{x:Qt,y:or,w:Y,h:nt}),B&&(ie=On(ie,xe("logo")));}let oe=r/H,Ii=ye.length,Te=7*oe,sf=1.5*oe,ib={fgColor:Fe(i,We),bgColor:Fe(o,Pe)},Yn=s1(b)?l1({art:b,modules:ye,version:X.version,margin:Ce,pixelSize:oe,...ib,body:Y=>l_(Y,{margin:Ce,pixelSize:oe,pattern:te,scale:S})}):null,sb=Yn&&B?On(Yn,xe("body")):Yn,ab=Yn&&b?p1({art:b,version:X.version,...ib}):null,cb=Yn?null:l_(ye,{margin:Ce,pixelSize:oe,pattern:te,scale:S}),Pa=rn?l_(rn,{margin:0,pixelSize:oe,pattern:te,scale:S,plain:true}):null,ka=ot(o,Pe),af=ot(i,We),ub=Il(ka)?kl(ka,r,"bg-color"):null,cf=Il(af)?kl(af,r,"fg-color"):null,$4=$r(o,ub?.id??null,Pe),lb=$r(i,cf?.id??null,We),fb=sb?Be(It,{children:[sb,Pa&&k("g",{...lb,...xe("body"),children:Pa})]}):Be("g",{...lb,...xe("body"),children:[cb,Pa]}),Kn=Ce*oe,Jn=Ce*oe,eo=(Ii-7+Ce)*oe,to=Ce*oe,ro=Ce*oe,no=(Ii-7+Ce)*oe,on=Fe(i,We),oo=Y=>y?.[Y]?.outer??ab?.[Y]?.outer??s,io=Y=>y?.[Y]?.inner??ab?.[Y]?.inner??a,so=(Y,nt,Qt,or,Lt)=>{let co=ot(Y,on);if(!Il(co))return null;if(R==="code"&&sn(co)){let Cf=JSON.stringify(co)===JSON.stringify(af);return kl(co,r,Cf?"fg-color":Lt)}return T7(co,nt,Qt,Te,or,Lt,r)},uf=so(oo("topLeft"),Kn,Jn,"top-left","corners-square-color-0-0"),lf=so(oo("topRight"),eo,to,"top-right","corners-square-color-1-0"),ff=so(oo("bottomLeft"),ro,no,"bottom-left","corners-square-color-0-1"),mf=so(io("topLeft"),Kn,Jn,"top-left","corners-dot-color-0-0"),pf=so(io("topRight"),eo,to,"top-right","corners-dot-color-1-0"),df=so(io("bottomLeft"),ro,no,"bottom-left","corners-dot-color-0-1"),mb=$r(oo("topLeft"),uf?.id??null,on),pb=$r(oo("topRight"),lf?.id??null,on),db=$r(oo("bottomLeft"),ff?.id??null,on),hb=$r(io("topLeft"),mf?.id??null,on),gb=$r(io("topRight"),pf?.id??null,on),_b=$r(io("bottomLeft"),df?.id??null,on),ao={cornerEyePattern:W,cornerEyeDotPattern:re,eyeShapes:v},hf=bl(Kn,Jn,Te,er(ao,"topLeft").outer,"top-left"),gf=_l(Kn+Te/2,Jn+Te/2,sf,er(ao,"topLeft").inner,"top-left"),_f=bl(eo,to,Te,er(ao,"topRight").outer,"top-right"),bf=_l(eo+Te/2,to+Te/2,sf,er(ao,"topRight").inner,"top-right"),yf=bl(ro,no,Te,er(ao,"bottomLeft").outer,"bottom-left"),xf=_l(ro+Te/2,no+Te/2,sf,er(ao,"bottomLeft").inner,"bottom-left"),$f=fa(T,{bgColor:o}),Mi=e_(O),bb=Y=>Be(It,{children:[Yn?null:cb,Pa,k("path",{d:hf,fillRule:Y}),gf,k("path",{d:_f,fillRule:Y}),bf,k("path",{d:yf,fillRule:Y}),xf]}),wf=null;if($f){let{color:Y}=$f;wf=k("g",{"data-qrdx-look":"halo",fill:Y,stroke:Y,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:x(2*$f.width*oe),children:bb("nonzero")});}let Sf=null;if(Mi){let{color:Y}=Si(Mi.color);Sf=k("g",{"data-qrdx-look":"shadow",fill:Y,opacity:x(Mi.opacity),transform:M`translate(${Mi.dx*oe},${Mi.dy*oe})`,children:bb("evenodd")});}let w4=Be(It,{children:[k("defs",{children:IS([ub,cf,uf,lf,ff,mf,pf,df])}),nn(r,$4),wf,Sf,fb,k("g",{...mb,...xe("eye-outer","top-left"),children:k("path",{d:hf,fillRule:"evenodd",transform:M`rotate(0,${Kn+Te/2},${Jn+Te/2})`})}),k("g",{...hb,...xe("eye-centre","top-left"),children:gf}),k("g",{...pb,...xe("eye-outer","top-right"),children:k("path",{d:_f,fillRule:"evenodd",transform:M`rotate(0,${eo+Te/2},${to+Te/2})`})}),k("g",{...gb,...xe("eye-centre","top-right"),children:bf}),k("g",{...db,...xe("eye-outer","bottom-left"),children:k("path",{d:yf,fillRule:"evenodd",transform:M`rotate(0,${ro+Te/2},${no+Te/2})`})}),k("g",{..._b,...xe("eye-centre","bottom-left"),children:xf}),ie]}),yb=d||(h?Rl(h):void 0);if(yb){let nt=Il(ka)?kl(ka,300,"bg-color-template"):null,Qt=$r(o,nt?.id??null,Pe),or=Be("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[k("defs",{children:IS([nt,cf,uf,lf,ff,mf,pf,df])}),nn(300,Qt),Be("g",{transform:`scale(${x(300/r,6)})`,children:[wf,Sf,fb,k("g",{...mb,...xe("eye-outer","top-left"),children:k("path",{d:hf,fillRule:"evenodd",transform:M`rotate(0,${Kn+Te/2},${Jn+Te/2})`})}),k("g",{...hb,...xe("eye-centre","top-left"),children:gf}),k("g",{...pb,...xe("eye-outer","top-right"),children:k("path",{d:_f,fillRule:"evenodd",transform:M`rotate(0,${eo+Te/2},${to+Te/2})`})}),k("g",{...gb,...xe("eye-centre","top-right"),children:bf}),k("g",{...db,...xe("eye-outer","bottom-left"),children:k("path",{d:yf,fillRule:"evenodd",transform:M`rotate(0,${ro+Te/2},${no+Te/2})`})}),k("g",{..._b,...xe("eye-centre","bottom-left"),children:xf}),ie]})]}),Lt=300/r,Cf={pixelSize:oe*Lt,url:t},xb=yb.wrapper(or,{fgColor:i,bgColor:o,...g||{},...N},Cf),S4={...xb?.props?.style||{},width:void 0,height:void 0,...Ne.style};return Re(On(xb,{...Ne,width:r,height:r,style:S4}))}return Re(k("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...Ne,children:w4}))}var jL=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),VL=e=>{let t=e.trim().replace(/^#/,"");t.length===3||t.length===4?t=t.slice(0,3).split("").map(n=>n+n).join(""):t.length===8&&(t=t.slice(0,6));let r=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r?{r:Number.parseInt(r[1],16),g:Number.parseInt(r[2],16),b:Number.parseInt(r[3],16)}:null},Ci=(e,t,r)=>{let[n,o,i]=[e,t,r].map(s=>(s/=255,s<=.03928?s/12.92:((s+.055)/1.055)**2.4));return .2126*n+.7152*o+.0722*i},MS=e=>{let t=ve(e);if(!t)return null;let r=n=>n*t.a+255*(1-t.a);return {r:r(t.r),g:r(t.g),b:r(t.b)}},HL=(e,t)=>{let r=MS(e),n=MS(t);if(!(r&&n))return 1;let o=Ci(r.r,r.g,r.b),i=Ci(n.r,n.g,n.b),s=Math.max(o,i),a=Math.min(o,i);return (s+.05)/(a+.05)},WL=e=>e>=7?{level:"AAA",warning:false,message:"Excellent contrast"}:e>=4.5?{level:"AA",warning:false,message:"Good contrast"}:e>=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 L7=256,N7=16384,F7=128;var zS=(e,t)=>{if(!(Number.isInteger(e)&&Number.isInteger(t))||e<1||t<1||e>16384||t>16384)throw new RangeError(`GIF width and height must be whole numbers from 1 to 16384, got ${e} x ${t}`)},p_=(e,t)=>e>>6*(2-t)&63;function DS(e,t,r){zS(t,r);let n=t*r;if(e.length!==n*4)throw new RangeError(`Expected ${n*4} RGBA bytes for ${t} x ${r}, got ${e.length}`);let o=new Map,i=false,s=false,a=false;for(let _=0;_<n;_++){let b=_*4,y=e[b+3];if(y<128){i=true,s||=y>0;continue}if(s||=y<255,!a){let S=e[b]<<16|e[b+1]<<8|e[b+2];o.has(S)||(o.set(S,o.size),a=o.size>256);}}let c=i?255:256,u=!a&&o.size<=c,l=new Uint8Array(n),f,p,m;if(u){p=[];for(let _ of o.keys())p.push(_>>16&255,_>>8&255,_&255);f=o.size,m=(_,b,y)=>o.get(_<<16|b<<8|y);}else {let _=z7(e,n,c);p=_.palette,f=_.palette.length/3,m=(b,y,S)=>_.bucketIndex[BS(b,y,S)];}let h=i?f:null;for(let _=0;_<n;_++){let b=_*4;e[b+3]<128?l[_]=h:l[_]=m(e[b],e[b+1],e[b+2]);}let d=f+(i?1:0),g=new Uint8Array(d*3);return g.set(p),i&&g.fill(255,f*3),{width:t,height:r,palette:g,indices:l,transparentIndex:h,colors:d,lossless:u&&!s}}var BS=(e,t,r)=>e>>2<<12|t>>2<<6|r>>2;function z7(e,t,r){let n=new Uint32Array(262144),o=new Float64Array(262144),i=new Float64Array(262144),s=new Float64Array(262144);for(let p=0;p<t;p++){let m=p*4;if(e[m+3]<128)continue;let h=e[m],d=e[m+1],g=e[m+2],_=BS(h,d,g);n[_]=n[_]+1,o[_]=o[_]+h,i[_]=i[_]+d,s[_]=s[_]+g;}let a=[];for(let p=0;p<262144;p++)n[p]>0&&a.push(p);let c=[{keys:a,pixels:a.reduce((p,m)=>p+n[m],0)}];for(;c.length<r;){let p=-1;for(let $=0;$<c.length;$++){let v=c[$];v.keys.length>1&&(p===-1||v.pixels>c[p].pixels)&&(p=$);}if(p===-1)break;let m=c[p],h=0,d=-1;for(let $ of [0,1,2]){let v=255,R=0;for(let P of m.keys){let I=p_(P,$);v=Math.min(v,I),R=Math.max(R,I);}R-v>d&&(d=R-v,h=$);}let g=[...m.keys].sort(($,v)=>p_($,h)-p_(v,h)||$-v),_=m.pixels/2,b=0,y=1;for(let $=0;$<g.length-1&&(b+=n[g[$]],y=$+1,!(b>=_));$++);let S=g.slice(0,y),C=g.slice(y),w=$=>$.reduce((v,R)=>v+n[R],0);c.splice(p,1,{keys:S,pixels:w(S)},{keys:C,pixels:w(C)});}let u=[];for(let p of c){let m=0,h=0,d=0;for(let g of p.keys)m+=o[g],h+=i[g],d+=s[g];u.push(Math.round(m/p.pixels),Math.round(h/p.pixels),Math.round(d/p.pixels));}let l=new Uint8Array(262144),f=u.length/3;for(let p of a){let m=n[p],h=o[p]/m,d=i[p]/m,g=s[p]/m,_=0,b=Number.POSITIVE_INFINITY;for(let y=0;y<f;y++){let S=h-u[y*3],C=d-u[y*3+1],w=g-u[y*3+2],$=S*S+C*C+w*w;$<b&&(b=$,_=y);}l[p]=_;}return {palette:u,bucketIndex:l}}var D7=e=>Math.max(1,Math.ceil(Math.log2(e))),Tl=class{buffer=new Uint8Array(1024);length=0;push(...t){this.ensure(t.length);for(let r of t)this.buffer[this.length++]=r;}u16(t){this.push(t&255,t>>8&255);}ascii(t){for(let r=0;r<t.length;r++)this.push(t.charCodeAt(r));}bytes(t){this.ensure(t.length),this.buffer.set(t,this.length),this.length+=t.length;}ensure(t){if(this.length+t<=this.buffer.length)return;let r=this.buffer.length;for(;r<this.length+t;)r*=2;let n=new Uint8Array(r);n.set(this.buffer.subarray(0,this.length)),this.buffer=n;}result(){return this.buffer.slice(0,this.length)}};function B7(e,t){let r=new Tl,n=1<<t,o=n+1,i=[],s=0,a=0,c=()=>{i.length>0&&(r.push(i.length,...i),i=[]);},u=d=>{i.push(d),i.length===255&&c();},l=(d,g)=>{for(s|=d<<a,a+=g;a>=8;)u(s&255),s>>>=8,a-=8;},f=new Int32Array(1048576),p=t+1,m=o+1;l(n,p);let h=e[0];for(let d=1;d<e.length;d++){let g=e[d],_=h<<8|g,b=f[_];if(b!==0){h=b-1;continue}l(h,p),m===4096?(l(n,p),f=new Int32Array(1048576),m=o+1,p=t+1):(m>=1<<p&&p++,f[_]=m+1,m++),h=g;}return l(h,p),l(o,p),a>0&&u(s&255),c(),r.result()}function ZS(e){let{width:t,height:r,palette:n,indices:o,transparentIndex:i}=e;zS(t,r);let s=n.length/3;if(!Number.isInteger(s)||s<1||s>256)throw new RangeError(`A GIF palette holds 1 to 256 colors, got ${n.length} bytes`);if(o.length!==t*r)throw new RangeError(`Expected ${t*r} palette indices for ${t} x ${r}, got ${o.length}`);if(i!==null&&!(Number.isInteger(i)&&i>=0&&i<s))throw new RangeError(`The transparent index ${i} isn't in a palette of ${s} colors`);for(let f=0;f<o.length;f++)if(o[f]>=s)throw new RangeError(`Pixel ${f} points at color ${o[f]}, past the palette of ${s}`);let a=D7(s),c=1<<a,u=Math.max(2,a),l=new Tl;return l.ascii("GIF89a"),l.u16(t),l.u16(r),l.push(240|a-1,0,0),l.bytes(n),l.bytes(new Uint8Array((c-s)*3)),i!==null&&l.push(33,249,4,1,0,0,i,0),l.push(44),l.u16(0),l.u16(0),l.u16(t),l.u16(r),l.push(0),l.push(u),l.bytes(B7(o,u)),l.push(0),l.push(59),l.result()}function d_(e,t,r){let n=DS(e,t,r);return {file:ZS(n),image:n}}function h_(e){let{palette:t,indices:r,transparentIndex:n}=e,o=new Uint8ClampedArray(r.length*4);for(let i=0;i<r.length;i++){let s=r[i],a=i*4;o[a]=t[s*3],o[a+1]=t[s*3+1],o[a+2]=t[s*3+2],o[a+3]=s===n?0:255;}return o}var FS="GIF89a";function g_(e){if(e.length<32)return false;for(let c=0;c<FS.length;c++)if(e[c]!==FS.charCodeAt(c))return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint16(6,true),n=t.getUint16(8,true),o=e[10];if(r<1||n<1||!(o&128))return false;let i=13+3*(1<<(o&7)+1);if(e.length<i)return false;let s=c=>{let u=c;for(;u<e.length;){let l=e[u];if(u+=1,l===0)return u;u+=l;}return -1},a=0;for(;i<e.length;){let c=e[i];if(c===59)return a===1&&i===e.length-1;if(c===33)i=s(i+2);else if(c===44){if(i+10>e.length||t.getUint16(i+5,true)!==r||t.getUint16(i+7,true)!==n||e[i+9]&128)return false;let u=e[i+10];if(u<2||u>8)return false;a+=1,i=s(i+11);}else return false;if(i===-1)return false}return false}var _a="image/gif",Ll=class extends Error{constructor(t){super(t),this.name="GIFScanError";}},Ol=255;function US(e){let t=new Uint8ClampedArray(e.length);for(let r=0;r<e.length;r+=4){let n=e[r+3];for(let o=0;o<3;o++)t[r+o]=Math.round((e[r+o]*n+Ol*(Ol-n))/Ol);t[r+3]=Ol;}return t}function GS(e,t,r){let n=Uint8ClampedArray.from(t.data),o=e(n,t.width,t.height,{inversionAttempts:"dontInvert"});if(!o)return false;if(o.data===r)return true;try{return new TextDecoder().decode(Uint8Array.from(o.binaryData))===r}catch{return false}}async function Z7(e,t,r){let{width:n,height:o}=e,i=US(e.data),s=US(t.data);if(t.width===n&&t.height===o&&i.every((u,l)=>u===s[l]))return;let a;try{a=(await import('jsqr')).default;}catch{throw new Ll("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(!GS(a,{data:i,width:n,height:o},r))return;if(!GS(a,{data:s,width:t.width,height:t.height},r))throw new Ll("This design uses more colors than a GIF holds (256), and the reduced image would not scan. Download a PNG instead.")}async function U7(e,t){let{file:r,image:n}=d_(e.data,e.width,e.height);if(!g_(r))throw new Error("Could not write a GIF file");return t!==void 0&&!n.lossless&&await Z7(e,{data:h_(n),width:e.width,height:e.height},t),{file:r,colors:n.colors,lossless:n.lossless}}async function Nl(e,t){let r=e.getContext("2d");if(!r)throw new Error("Could not get canvas context");let{data:n}=r.getImageData(0,0,e.width,e.height),{file:o}=await U7({data:n,width:e.width,height:e.height},t);return new Blob([o],{type:_a})}var Fl=[16,32,48,256],qn="image/vnd.microsoft.icon",Wn=256,__=64,ba=6,ya=16,G7=[137,80,78,71,13,10,26,10],Q7=16,QS=20,j7=32,jS=e=>e.length>=QS+4&&G7.every((t,r)=>e[r]===t),VS=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return {width:t.getUint32(Q7),height:t.getUint32(QS)}};function b_(e){if(e.length<1||e.length>__)throw new RangeError(`An ICO holds 1 to ${__} images, got ${e.length}`);for(let{width:s,height:a,png:c}of e){let u=f=>Number.isInteger(f)&&f>=1&&f<=Wn;if(!(u(s)&&u(a)))throw new RangeError(`ICO images must be whole numbers from 1 to ${Wn} px, got ${s} x ${a}`);if(!jS(c))throw new RangeError("Every ICO image must be a PNG file");let l=VS(c);if(l.width!==s||l.height!==a)throw new RangeError(`An ICO image says ${s} x ${a} but its PNG is ${l.width} x ${l.height}`)}let t=ba+ya*e.length,r=e.reduce((s,a)=>s+a.png.length,0),n=new Uint8Array(t+r),o=new DataView(n.buffer);o.setUint16(0,0,true),o.setUint16(2,1,true),o.setUint16(4,e.length,true);let i=t;return e.forEach(({width:s,height:a,png:c},u)=>{let l=ba+ya*u;n[l]=s===Wn?0:s,n[l+1]=a===Wn?0:a,n[l+2]=0,n[l+3]=0,o.setUint16(l+4,1,true),o.setUint16(l+6,j7,true),o.setUint32(l+8,c.length,true),o.setUint32(l+12,i,true),n.set(c,i),i+=c.length;}),n}function y_(e){if(e.length<ba+ya)return false;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint16(4,true);if(t.getUint16(0,true)!==0||t.getUint16(2,true)!==1||r<1||r>__||e.length<ba+ya*r)return false;for(let n=0;n<r;n++){let o=ba+ya*n,i=e[o]||Wn,s=e[o+1]||Wn,a=t.getUint32(o+8,true),c=t.getUint32(o+12,true);if(c+a>e.length)return false;let u=e.subarray(c,c+a);if(!jS(u))return false;let l=VS(u);if(l.width!==i||l.height!==s)return false}return true}var HS="data:image/png;base64,";function V7(e){let t=e.toDataURL("image/png");if(!t.startsWith(HS))throw new Error("This browser can't write a PNG from a canvas");let r=atob(t.slice(HS.length)),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function x_(e){let t=b_(e.map(r=>({width:r.width,height:r.height,png:V7(r)})));if(!y_(t))throw new Error("Could not write an ICO file");return new Blob([t],{type:qn})}function WS(e){return x_([e])}var H7=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"]]),W7=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"]]),q7=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),X7=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"]),Y7=new Set(["autoFocus","multiple","muted"]),K7=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),J7=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(" ")),qS=":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",eR=new RegExp(`^[${qS}][${qS}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),zl=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,tR=/^[\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,rR="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",nR=e=>tR.test(e)?rR:e,YS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),oR=/["'&<>]/;function $_(e){if(!oR.test(e))return e;let t="",r=0;for(let n=0;n<e.length;n++){let o;switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#x27;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}t+=e.slice(r,n)+o,r=n+1;}return t+e.slice(r)}var wr=e=>typeof e=="function"||typeof e=="symbol",XS=new Map,iR=e=>{let t=XS.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),XS.set(e,t)),t};function sR(e){if(typeof e=="string")return e;if(typeof e!="object"||e===null)return "";let t="";for(let r of Object.keys(e)){let n=e[r];if(n==null||typeof n=="boolean"||n==="")continue;let o;if(r.startsWith("--"))o=`${r}:${`${n}`.trim()}`;else {let i=typeof n=="number"?n===0||J7.has(r)?`${n}`:`${n}px`:`${n}`.trim();o=`${iR(r)}:${i}`;}t=t?`${t};${o}`:o;}return t}function Ai(e,t){if(t==null||q7.has(e))return null;let r=W7.get(e);if(r!==void 0)return wr(t)||typeof t=="boolean"?null:{name:r,value:`${t}`};switch(e){case "style":{let o=sR(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||wr(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:nR(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||wr(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return wr(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return wr(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(Y7.has(e))return t&&!wr(t)?{name:e.toLowerCase(),value:""}:null;if(K7.has(e))return wr(t)?null:{name:e,value:`${t}`};if(X7.has(e))return t&&!wr(t)?{name:e,value:""}:null;if(e.length>2&&(e[0]==="o"||e[0]==="O")&&(e[1]==="n"||e[1]==="N"))return null;let n=H7.get(e)??e;if(!eR.test(n)||wr(t))return null;if(typeof t=="boolean"){let o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-")return null}return {name:n,value:`${t}`}}var KS="http://www.w3.org/2000/svg",JS="http://www.w3.org/1999/xhtml",aR="http://www.w3.org/1999/xlink",cR="http://www.w3.org/XML/1998/namespace",uR="http://www.w3.org/2000/xmlns/";function lR(e,t,r){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(uR,t,r):t.startsWith("xlink:")?e.setAttributeNS(aR,t,r):t.startsWith("xml:")?e.setAttributeNS(cR,t,r):e.setAttribute(t,r);}function xa(e,t,r,n){if(t==null||typeof t=="boolean")return;if(typeof t=="string"||typeof t=="number"||typeof t=="bigint"){e.appendChild(n.createTextNode(`${t}`));return}if(Array.isArray(t)){for(let c of t)xa(e,c,r,n);return}if(!Ln(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(si(o)){xa(e,i.children,r,n);return}if(typeof o=="function"){xa(e,o(i),r,n);return}if(!zl.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?KS:r,a=n.createElementNS(s,o);for(let c of Object.keys(i)){let u=Ai(c,i[c]);u&&lR(a,u.name,u.value);}xa(a,i.children,s===KS&&o==="foreignObject"?JS:s,n),e.appendChild(a);}function $a(e,t=document){let r=t.createDocumentFragment();return xa(r,e,JS,t),r}function rr(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return $_(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let r of e)t+=rr(r);return t}if(!Ln(e))throw new TypeError("qrdx: can't render this value as SVG markup");return fR(e)}function fR(e){let{type:t,props:r}=e;if(si(t))return rr(r.children);if(typeof t=="function")return rr(t(r));if(!zl.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let n=`<${t}`;for(let s of Object.keys(r)){let a=Ai(s,r[s]);a&&(n+=` ${a.name}="${$_(a.value)}"`);}if(YS.has(t))return `${n}/>`;let o=r.dangerouslySetInnerHTML?.__html,i=o==null?rr(r.children):`${o}`;return `${n}>${i}</${t}>`}function w_(e){return rr(vi(e))}function mR(e,t=document){return $a(vi(e),t).firstChild}var pR=16384;var S_=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],dR=8,C_=class{buffer;position=0;bits=0;used=0;constructor(t){this.buffer=new Uint8Array(Math.max(t,64));}write(t,r){if(r!==0)for(this.bits|=t<<this.used,this.used+=r;this.used>=8;){if(this.position===this.buffer.length){let n=new Uint8Array(this.buffer.length*2);n.set(this.buffer),this.buffer=n;}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 i5(e,t){let r=new Uint8Array(e.length),n=[];for(let u=0;u<e.length;u++)(e[u]??0)>0&&n.push(u);if(n.length===0)return r;if(n.length===1)return r[n[0]]=1,r;let o=n.length,i=2*o-1,s=new Float64Array(i),a=new Int32Array(i),c=new Uint8Array(i);for(let u=1;;u*=2){for(let d=0;d<o;d++)s[d]=Math.max(e[n[d]]??0,u);let l=Array.from({length:o},(d,g)=>g).sort((d,g)=>s[d]-s[g]||d-g),f=0,p=o,m=d=>f<o&&(p>=d||s[l[f]]<=s[p])?l[f++]:p++;for(let d=o;d<i;d++){let g=m(d),_=m(d);s[d]=s[g]+s[_],a[g]=d,a[_]=d;}c[i-1]=0;let h=0;for(let d=i-2;d>=0;d--){let g=c[a[d]]+1;c[d]=g,d<o&&g>h&&(h=g);}if(h<=t){for(let d=0;d<o;d++)r[n[d]]=c[d];return r}}}function hR(e,t){let r=0;for(let n=0;n<t;n++)r=r<<1|e>>n&1;return r}function s5(e){let t=new Uint16Array(16),r=0;for(let a of e)a>0&&(t[a]=t[a]+1,r++);let n=new Uint16Array(16),o=0;for(let a=1;a<=15;a++)o=o+t[a-1]<<1,n[a]=o;let i=new Uint16Array(e.length),s=new Uint8Array(e.length);return e.forEach((a,c)=>{if(a===0)return;let u=n[a];n[a]=u+1,i[c]=hR(u,a),s[c]=r===1?0:a;}),{lengths:e,codes:i,emitted:s}}function Xn(e,t,r){e.write(t.codes[r],t.emitted[r]);}function gR(e){let t=[],r=i=>t.push({code:i,extra:0,extraBits:0}),n=dR,o=0;for(;o<e.length;){let i=e[o],s=1;for(;o+s<e.length&&e[o+s]===i;)s++;o+=s;let a=s;if(i===0){for(;a>0;)if(a<3)for(;a>0;a--)r(0);else if(a<=10)t.push({code:17,extra:a-3,extraBits:3}),a=0;else {let c=Math.min(a,138);t.push({code:18,extra:c-11,extraBits:7}),a-=c;}continue}for(i!==n&&(r(i),n=i,a--);a>0;)if(a<3)for(;a>0;a--)r(i);else {let c=Math.min(a,6);t.push({code:16,extra:c-3,extraBits:2}),a-=c;}}return t}function _R(e,t){let r=[];if(t.forEach((a,c)=>{a>0&&r.push(c);}),r.length<=2&&r.every(a=>a<256)){let[a=0,c]=r;e.write(1,1),e.write(r.length===2?1:0,1),a<2?(e.write(0,1),e.write(a,1)):(e.write(1,1),e.write(a,8)),c!==void 0&&e.write(c,8);return}let n=gR(t),o=new Uint32Array(19);for(let a of n)o[a.code]=o[a.code]+1;let i=s5(i5(o,7)),s=S_.length;for(;s>4&&i.lengths[S_[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[S_[a]],3);e.write(0,1);for(let a of n)Xn(e,i,a.code),e.write(a.extra,a.extraBits);}function Dl(e){let t=e-1;if(t<4)return {symbol:t,extra:0,extraBits:0};let r=31-Math.clz32(t),n=t>>r-1&1,o=r-1;return {symbol:2*r+n,extra:t&(1<<o)-1,extraBits:o}}function e5(e,t,r,n){let o=0;for(;o<n&&e[t+o]===e[t+o-r];)o++;return o}function t5(e,t,r){let n=e.length,o=0;for(;o<n;){let i=Math.min(4096,n-o),s=o>=1?e5(e,o,1,i):0,a=o>=t?e5(e,o,t,i):0;if(Math.max(s,a)>=3){a>=s?(r.copy(a,t===1?2:1),o+=a):(r.copy(s,2),o+=s);continue}r.literal(e[o]),o++;}}var r5=20;function n5(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n);}function o5(e,t,r){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24&255;}function A_(e,t,r){if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>16384||r>16384)throw new RangeError(`WebP images are 1 to 16384 pixels wide and high (got ${t} \xD7 ${r})`);let n=t*r;if(e.length<n*4)throw new RangeError(`Expected ${n*4} bytes of RGBA for ${t} \xD7 ${r}, got ${e.length}`);let o=new Uint32Array(n),i=false;for(let C=0;C<n;C++){let w=C*4,$=e[w],v=e[w+1],R=e[w+2],P=e[w+3];P!==255&&(i=true),o[C]=(P<<24|($-v&255)<<16|v<<8|R-v&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);t5(o,t,{literal(C){s[C>>>8&255]++,a[C>>>16&255]++,c[C&255]++,u[C>>>24]++;},copy(C,w){s[256+Dl(C).symbol]++,l[Dl(w).symbol]++;}});let f=[s,a,c,u,l].map(C=>i5(C,15)),[p,m,h,d,g]=f.map(s5),_=new C_(Math.ceil(n/4)+1024);_.write(47,8),_.write(t-1,14),_.write(r-1,14),_.write(i?1:0,1),_.write(0,3),_.write(1,1),_.write(2,2),_.write(0,1),_.write(0,1),_.write(0,1);for(let C of f)_R(_,C);t5(o,t,{literal(C){Xn(_,p,C>>>8&255),Xn(_,m,C>>>16&255),Xn(_,h,C&255),Xn(_,d,C>>>24);},copy(C,w){let $=Dl(C);Xn(_,p,256+$.symbol),_.write($.extra,$.extraBits);let v=Dl(w);Xn(_,g,v.symbol),_.write(v.extra,v.extraBits);}});let b=_.finish(),y=b.length+(b.length&1),S=new Uint8Array(r5+y);return n5(S,0,"RIFF"),o5(S,4,S.length-8),n5(S,8,"WEBPVP8L"),o5(S,16,b.length),S.set(b,r5),S}function v_(e,t,r){return String.fromCharCode(...e.subarray(t,t+r))}function a5(e){return e.length>=12&&v_(e,0,4)==="RIFF"&&v_(e,8,4)==="WEBP"}function E_(e){if(!a5(e))return null;let t=12;for(;t+8<=e.length;){let r=v_(e,t,4);if(r==="VP8L")return "lossless";if(r==="VP8 ")return "lossy";let n=(e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0;t+=8+n+(n&1);}return null}function bR(e,t,r){return typeof e.toBlob!="function"?Promise.resolve(null):new Promise(n=>{try{e.toBlob(n,t,r);}catch{n(null);}})}async function Bl(e,t={}){let r=t.quality!==void 0,n=r?Math.min(1,Math.max(0,Number(t.quality))):1,o=await bR(e,"image/webp",n);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=E_(c);if(u==="lossless"||r&&u==="lossy")return new Blob([c],{type:"image/webp"})}let i=e.getContext("2d");if(!i)throw new Error("Could not get canvas context");let{data:s}=i.getImageData(0,0,e.width,e.height),a=A_(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var c5=32768;async function xt(e){let t=new Uint8Array(await e.arrayBuffer()),r="";for(let n=0;n<t.length;n+=c5)r+=String.fromCharCode(...t.subarray(n,n+c5));return `data:${e.type||"application/octet-stream"};base64,${btoa(r)}`}async function Ut(e){let t={...e};if(e.imageSettings?.src)try{let l=await yR(e.imageSettings.src);t={...e,imageSettings:{...e.imageSettings,src:l}};}catch{let{imageSettings:l,...f}=e;t=f;}let{hideLogo:r,url:n,logo:o,scale:i,frameLabelMarkers:s,partMarkers:a,...c}=t,u=w_({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var yR=e=>new Promise((t,r)=>{if(e.startsWith("data:")){t(e);return}let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{let o=document.createElement("canvas");o.width=n.naturalWidth||n.width,o.height=n.naturalHeight||n.height;let i=o.getContext("2d");if(!i){r(new Error("Could not get canvas context"));return}i.drawImage(n,0,0);let s=o.toDataURL("image/png");o.remove(),t(s);}catch(o){r(new Error(`Failed to convert image to base64: ${o}`));}},n.onerror=()=>{r(new Error(`Could not load image from ${e.slice(0,100)}... Check CORS settings or use a data URL.`));},n.src=e;});async function Sr(e,t,r){let n=await Ut(e),o=decodeURIComponent(n.replace("data:image/svg+xml,","")),i;try{let s=new TextEncoder().encode(o),a=Array.from(s,u=>String.fromCharCode(u)).join("");i=`data:image/svg+xml;base64,${btoa(a)}`;}catch(s){throw new Error(`Failed to encode SVG for canvas conversion: ${s}`)}return new Promise((s,a)=>{let c=document.createElement("canvas"),u=c.getContext("2d");if(!u){a(new Error("Could not get canvas context"));return}let l=new Image,{width:f,height:p}=br(e.size||$e,e.frame);c.width=Math.round(f),c.height=Math.round(p);let m=setTimeout(()=>{c.remove(),a(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);l.onload=()=>{clearTimeout(m);try{if(t==="image/jpeg"&&(u.fillStyle="white",u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),r)s(c);else if(t==="image/webp")Bl(c).then(xt).then(s,a).finally(()=>c.remove());else if(t==="image/bmp")xt(tl(c)).then(s,a).finally(()=>c.remove());else if(t===_a)Nl(c,e.value).then(xt).then(s,a).finally(()=>c.remove());else if(t===qn||t==="image/x-icon")xt(WS(c)).then(s,a).finally(()=>c.remove());else {let h=c.toDataURL(t,1);c.remove(),s(h);}}catch(h){clearTimeout(m),c.remove(),a(new Error(`Failed to draw SVG to canvas: ${h}`));}},l.onerror=()=>{clearTimeout(m),c.remove(),a(new Error("Could not load SVG"));},l.src=i;})}var u5=["gradientUnits","gradientTransform","spreadMethod"],xR={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},$R={r:0,g:0,b:0,a:1};function l5(e,t){for(let r of (e.attrs.style??"").split(";")){let[n,...o]=r.split(":");if(n?.trim()===t)return o.join(":").trim()}return e.attrs[t]}function R_(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function wR(e){let t=[],r=0;for(let n of e.children){if(n.name!=="stop")continue;let o=(n.attrs.offset??"0").trim(),i=Number.parseFloat(o),s=Number.isFinite(i)?o.endsWith("%")?i/100:i:0;r=Math.max(r,Math.min(Math.max(s,0),1));let a=l5(n,"stop-color")??"#000000",c=ve(a==="currentColor"?"#000000":a)??$R,u=Number.parseFloat(l5(n,"stop-opacity")??"1");t.push({offset:r,color:Number.isFinite(u)?{...c,a:c.a*Math.min(Math.max(u,0),1)}:c});}return t}function Zl(e){let t=new Map,r=o=>{let i=o.attrs.id;R_(o)&&i&&!t.has(i)&&t.set(i,o);for(let s of o.children)r(s);};r(e);let n=new Map;for(let[o,i]of t){let s=R_(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=R_(l)===s?[...u5,...xR[s]]:u5;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=wR(l));let p=l.attrs.href??l.attrs["xlink:href"];l=p?.startsWith("#")?t.get(p.slice(1)):void 0;}n.set(o,{kind:s,attrs:a,stops:c});}return n}function P_(e){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=(f,p)=>{t=Math.min(t,f),n=Math.max(n,f),r=Math.min(r,p),o=Math.max(o,p);},s=(f,p,m,h)=>{let d=-f+3*p-3*m+h,g=2*(f-2*p+m),_=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-_/g];let b=g*g-4*d*_;if(b<0)return [];let y=Math.sqrt(b);return [(-g+y)/(2*d),(-g-y)/(2*d)]},a=(f,p,m,h,d)=>{let g=1-f;return g*g*g*p+3*g*g*f*m+3*g*f*f*h+f**3*d},c=0,u=0,l=[0,0];for(let f of e)if(f.op==="M"&&(l=[f.x,f.y]),f.op==="M"||f.op==="L")i(f.x,f.y),c=f.x,u=f.y;else if(f.op==="C"){i(f.x,f.y);for(let p of [...s(c,f.x1,f.x2,f.x),...s(u,f.y1,f.y2,f.y)])p>0&&p<1&&i(a(p,c,f.x1,f.x2,f.x),a(p,u,f.y1,f.y2,f.y));c=f.x,u=f.y;}else [c,u]=l;return Number.isFinite(t)?{x:t,y:r,width:n-t,height:o-r}:null}var SR=e=>e[0]*e[3]-e[1]*e[2];function Yr(e){let t=SR(e);if(!Number.isFinite(t)||Math.abs(t)<1e-12)return null;let[r,n,o,i,s,a]=e;return [i/t,-n/t,-o/t,r/t,(o*a-i*s)/t,(n*s-r*a)/t]}function m5(e,t,r){let{kind:n,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every(w=>w.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=_o;if(!c){let w=P_(t);if(!w||w.width<=0||w.height<=0)return null;u=[w.width,0,0,w.height,w.x,w.y];}let l=Ee(u,Et(o.gradientTransform));if(!Yr(l))return a.color;let[f,p]=r,m=Math.sqrt((f*f+p*p)/2),h=(w,$)=>{let v=Number.parseFloat(w);return Number.isFinite(v)?w.trim().endsWith("%")?v/100*(c?$:1):v:null},d=(w,$,v)=>h(o[w]??$,v)??h($,v)??0;if(n==="linear"){let w=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[$,v,R,P]=w;return $===R&&v===P?a.color:{kind:n,coords:w,matrix:l,stops:i}}let g=d("cx","50%",f),_=d("cy","50%",p),b=d("r","50%",m),y=o.fx===void 0?g:d("fx","50%",f),S=o.fy===void 0?_:d("fy","50%",p),C=Math.max(0,d("fr","0%",m));return b<0?null:b===0?a.color:{kind:n,coords:[y,S,C,g,_,b],matrix:l,stops:i}}function Ul(e){return e.map(t=>x(t,6)).join(" ")}function CR(e,t){return (t==="cmyk"?Qr(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(n=>x(n,4)).join(" ")}var f5=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function vR(e,t){let r=[],n=e.map(a=>le(a.offset,4)),o=e.map(a=>CR(a.color,t)),i=n[0],s=n.at(-1);if(i>0){let a=o[0];r.push({from:0,to:i,c0:a,c1:a});}for(let a=0;a+1<e.length;a++){let c=n[a],u=n[a+1];u>c&&r.push({from:c,to:u,c0:o[a],c1:o[a+1]});}if(s<1){let a=o.at(-1);r.push({from:s,to:1,c0:a,c1:a});}if(r.length===1){let[a]=r;return f5(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${r.map(a=>f5(a.c0,a.c1)).join(" ")}]`,`/Bounds [${r.slice(1).map(a=>x(a.from,4)).join(" ")}]`,`/Encode [${r.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Gl(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(r=>x(r,6)).join(" ")}]`,`/Function ${vR(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function AR(e,t){if(e.op==="Z")return e;if(e.op==="C"){let[o,i]=ne(t,e.x1,e.y1),[s,a]=ne(t,e.x2,e.y2),[c,u]=ne(t,e.x,e.y);return {op:"C",x1:o,y1:i,x2:s,y2:a,x:c,y:u}}let[r,n]=ne(t,e.x,e.y);return {op:e.op,x:r,y:n}}function jl(e){let t={round:1,bevel:2}[e.strokeLinejoin?.trim()??""],r={round:1,square:2}[e.strokeLinecap?.trim()??""];return {join:t??0,cap:r??0}}var p5={r:255,g:255,b:255,a:1},ER=/^url\(\s*#bg-color-/,Ql=/^url\(\s*#([^)\s]+)\s*\)/,RR=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function ae(e,t){let r=e.attrs.style;if(r)for(let n of r.split(";")){let[o,...i]=n.split(":");if(o?.trim()===t)return i.join(":").trim()}return e.attrs[t]}function se(e,t,r=0){if(e===void 0||e==="")return r;let n=Number.parseFloat(e);return Number.isNaN(n)?r:e.trim().endsWith("%")?n/100*t:n}function wa(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let r=e.children.find(o=>o.name==="stop"),n=r&&(ae(r,"stop-color")??"#000000");n&&t.set(e.attrs.id,n);}for(let r of e.children)wa(r,t);return t}function Sa(e,t){if(e.name==="image"){let r=e.attrs.href??e.attrs["xlink:href"];r&&t.add(r);}for(let r of e.children)Sa(r,t);return t}function Vl(e){return /^data:image\/png[;,]/i.test(e)?"PNG":/^data:image\/jpe?g[;,]/i.test(e)?"JPEG":null}async function Hl(e){return typeof document>"u"||typeof Image>"u"?null:await new Promise(t=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>{let n=document.createElement("canvas"),o=Math.max(r.naturalWidth||512,r.naturalHeight||512),i=Math.min(1024/o,4);n.width=Math.round((r.naturalWidth||512)*i),n.height=Math.round((r.naturalHeight||512)*i);let s=n.getContext("2d");if(!s){t(null);return}s.drawImage(r,0,0,n.width,n.height);try{t(n.toDataURL("image/png"));}catch{t(null);}},r.onerror=()=>t(null),r.src=e;})}function d5(e,t,r){let n={x:se(e.attrs.x,t[0]),y:se(e.attrs.y,t[1]),width:se(e.attrs.width,t[0]),height:se(e.attrs.height,t[1])};if(n.width<=0||n.height<=0)return null;let o=(e.attrs.preserveAspectRatio??"").trim();if(!o||o.startsWith("none")||!r||!(r.width>0&&r.height>0))return {draw:n,clip:null};let[i="xMidYMid",s="meet"]=o.split(/\s+/),a=s==="slice",c=(a?Math.max:Math.min)(n.width/r.width,n.height/r.height),u=r.width*c,l=r.height*c,f=p=>{let m=p==="x"?i.slice(0,4):i.slice(4);return m.endsWith("Min")?0:m.endsWith("Max")?1:.5};return {draw:{x:n.x+(n.width-u)*f("x"),y:n.y+(n.height-l)*f("y"),width:u,height:l},clip:a?n:null}}function h5(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)h5(r,t);return t}function g5(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)g5(r,t);return t}function PR(e,t){let[r,n]=t,o=(i,s)=>se(e.attrs[i],s);switch(e.name){case "path":return cr(e.attrs.d??"");case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;return qt(o("x",r),o("y",n),o("width",r),o("height",n),se(i,r),se(s,n))}case "circle":{let i=o("r",Math.hypot(r,n)/Math.SQRT2);return Wt(o("cx",r),o("cy",n),i,i)}case "ellipse":return Wt(o("cx",r),o("cy",n),o("rx",r),o("ry",n));default:return []}}var Ei=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=p5;paper=p5;background=null;onPaper=false;inConic=false;constructor(t,r=null){this.gradients=t,this.shadings=r;}resolveColor(t){if(!t||t==="none")return null;let r=Ql.exec(t);if(r)return this.resolveColor(this.gradients.get(r[1]));let n=ve(t==="currentColor"?"#000000":t);return n&&n.a>0?n:null}shadedGradient(t){let r=t?Ql.exec(t)?.[1]:void 0;return r?this.shadings?.get(r):void 0}resolveFill(t,r,n,o=1){if(o<=0)return null;let i=this.patternOf(t);if(i)return {pattern:i,alpha:o};let s=this.shadedGradient(t);if(s){let u=m5(s,r,n);if(!u)return null;if("coords"in u)return {gradient:u,alpha:o};let l={...u,a:u.a*o};return l.a>0?{color:l}:null}let a=this.resolveColor(t);if(!a)return null;let c={...a,a:a.a*o};return c.a>0?{color:c}:null}patternOf(t){let r=t?Ql.exec(t)?.[1]:void 0,n=r?this.patterns.get(r):void 0;if(!(n?.attrs.patternUnits!=="userSpaceOnUse"||(n.attrs.patternContentUnits??"userSpaceOnUse")!=="userSpaceOnUse"||n.attrs.viewBox))return n}flatten(t){if(t.a>=1)return t;let r=this.background,n=r!==null&&Math.abs(r.r-t.r)<.5&&Math.abs(r.g-t.g)<.5&&Math.abs(r.b-t.b)<.5&&Math.abs(r.a-t.a)<.002;return Pl(t,this.onPaper||n?this.paper:this.backdrop)}paintPattern(t,r,n,o){let i=P_(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=r.viewport,c=se(n.attrs.x,s),u=se(n.attrs.y,a),l=se(n.attrs.width,s),f=se(n.attrs.height,a);if(!(l>0&&f>0))return true;let p=Et(n.attrs.patternTransform),m=Yr(p);if(!m)return true;if(!this.beginClip(t,r.matrix,r.fillRule==="evenodd"))return false;let h=this.inConic;this.inConic=n.attrs["data-qrdx-conic"]!==void 0;try{let d=[ne(m,i.x,i.y),ne(m,i.x+i.width,i.y),ne(m,i.x,i.y+i.height),ne(m,i.x+i.width,i.y+i.height)],g=d.map(([O])=>O),_=d.map(([,O])=>O),b=Math.min(...g),y=Math.max(...g),S=Math.min(..._),C=Math.max(..._),w=Math.floor((b-c)/l),$=Math.ceil((y-c)/l)-1,v=Math.floor((S-u)/f),R=Math.ceil((C-u)/f)-1,P=($-w+1)*(R-v+1);if(P>4096)return !0;let I=(n.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),T=Ee(r.matrix,p);for(let O=v;O<=R;O++)for(let D=w;D<=$;D++){let B=c+D*l,N=u+O*f,te=Ee(T,[1,0,0,1,B,N]),W={x:b-B,y:S-N,width:y-b,height:C-S},re=I.length===2&&I.every(Number.isFinite)?PS(I[0],I[1],W):null,G=P>1&&this.beginClip([{op:"M",x:0,y:0},{op:"L",x:l,y:0},{op:"L",x:l,y:f},{op:"L",x:0,y:f},{op:"Z"}],te,!1);try{let ce={matrix:te,viewport:r.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},Ne=(Re,Z)=>{for(let X of Re){if(X.name==="g"&&!X.attrs.transform){let ye=Number.parseFloat(X.attrs.opacity??"1");Ne(X.children,{...Z,opacity:(Z.opacity??1)*(Number.isFinite(ye)?ye:1)});continue}if(re&&X.attrs["data-arc"]){let[ye,Ce]=X.attrs["data-arc"].split(/\s+/).map(Number);if(!kS([ye,ye+Ce],re))continue}this.walk(X,Z);}};Ne(n.children,ce);}finally{G&&this.endClip();}}}finally{this.inConic=h,this.endClip();}return true}paintBleed(t,r,n,o){if(!this.shadedGradient(n))return false;let[i,s]=this.viewportMatrix({...t,attrs:{...t.attrs,x:"0",y:"0"}},{...r,matrix:Ee(r.matrix,Et(t.attrs.transform))}),a=Yr(i);if(!a)return false;let[c,u,l,f]=o,m=[[c,u],[l,u],[l,f],[c,f]].map(([h,d])=>ne(a,h,d)).map(([h,d],g)=>({op:g===0?"M":"L",x:h,y:d}));return m.push({op:"Z"}),this.paint(m,{name:"rect",attrs:{},children:[],text:""},{...r,matrix:i,viewport:s,fill:n,fillRule:"nonzero",stroke:"none"}),true}beginClip(t,r,n){return false}endClip(){}clipOf(t,r){let n=ae(t,"clip-path"),o=n?Ql.exec(n)?.[1]:void 0,i=o?this.clipPaths.get(o):void 0;if(!i)return null;let s=[],a=false;for(let c of i.children){let u=PR(c,r.viewport);if(u.length===0)continue;let l=Et(c.attrs.transform),f=l[0]===1&&l[1]===0&&l[2]===0&&l[3]===1&&l[4]===0&&l[5]===0;s.push(...f?u:u.map(p=>AR(p,l))),a||=ae(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:r.matrix,evenOdd:a}:null}viewportMatrix(t,r){let n=se(t.attrs.x,r.viewport[0]),o=se(t.attrs.y,r.viewport[1]),i=se(t.attrs.width,r.viewport[0],r.viewport[0]),s=se(t.attrs.height,r.viewport[1],r.viewport[1]),a=Ht(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [Ee(r.matrix,[1,0,0,1,n,o]),[i,s]];let[c,u,l,f]=a,p=i/l,m=s/f,h=n,d=o;if((t.attrs.preserveAspectRatio??"").trim()!=="none"){let g=t.attrs.preserveAspectRatio?.includes("slice")?Math.max(p,m):Math.min(p,m);h+=(i-l*g)/2,d+=(s-f*g)/2,p=g,m=g;}return [Ee(r.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,r,n=false){if(n&&(this.clipPaths=h5(t,new Map),this.patterns=g5(t,new Map)),RR.has(t.name)||ae(t,"display")==="none"||ae(t,"visibility")==="hidden")return;let o=Ee(r.matrix,Et(t.attrs.transform)),i=r.viewport;if(t.name==="svg"){let[p,m]=this.viewportMatrix(n?{...t,attrs:{...t.attrs,x:"0",y:"0"}}:t,{...r,matrix:o});o=p,i=m;}let s=ae(t,"font-size"),a=Number.parseFloat(ae(t,"opacity")??"1"),c=ae(t,"fill-opacity"),u=c===void 0?r.fillOpacity??1:Number.parseFloat(c),l={fillOpacity:Number.isFinite(u)?Math.min(Math.max(u,0),1):1,opacity:(r.opacity??1)*(Number.isFinite(a)?Math.min(Math.max(a,0),1):1),matrix:o,viewport:i,fill:ae(t,"fill")??r.fill,fillRule:ae(t,"fill-rule")??r.fillRule,stroke:ae(t,"stroke")??r.stroke,strokeWidth:ae(t,"stroke-width")===void 0?r.strokeWidth:se(ae(t,"stroke-width"),i[0],1),strokeLinejoin:ae(t,"stroke-linejoin")??r.strokeLinejoin,strokeLinecap:ae(t,"stroke-linecap")??r.strokeLinecap,fontSize:s===void 0?r.fontSize:se(s,16,16),fontWeight:ae(t,"font-weight")??r.fontWeight,textAnchor:ae(t,"text-anchor")??r.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&ER.test(ae(t,"fill")??"")&&(this.onPaper=true);try{let p=t.attrs["clip-path"]?this.clipOf(t,l):null;if(p&&this.beginClip(p.segments,p.matrix,p.evenOdd)){try{this.paintNode(t,l);}finally{this.endClip();}return}this.paintNode(t,l);}finally{this.onPaper=f;}}paintNode(t,r){let[n,o]=r.viewport,i=(s,a)=>se(t.attrs[s],a);switch(t.name){case "path":this.paint(cr(t.attrs.d??""),t,r);return;case "rect":{let s=t.attrs.rx??t.attrs.ry,a=t.attrs.ry??t.attrs.rx;this.paint(qt(i("x",n),i("y",o),i("width",n),i("height",o),se(s,n),se(a,o)),t,r);return}case "circle":{let s=i("r",Math.hypot(n,o)/Math.SQRT2);this.paint(Wt(i("cx",n),i("cy",o),s,s),t,r);return}case "ellipse":this.paint(Wt(i("cx",n),i("cy",o),i("rx",n),i("ry",o)),t,r);return;case "line":this.paint([{op:"M",x:i("x1",n),y:i("y1",o)},{op:"L",x:i("x2",n),y:i("y2",o)}],t,{...r,fill:"none"});return;case "polygon":case "polyline":{let s=Ht(t.attrs.points),a=[];for(let c=0;c+1<s.length;c+=2)a.push({op:c===0?"M":"L",x:s[c],y:s[c+1]});t.name==="polygon"&&a.length>0&&a.push({op:"Z"}),this.paint(a,t,r);return}case "text":this.text(t,r);return;case "image":this.image(t,r);return;default:for(let s of t.children)this.walk(s,r);}}};var Wl=1e3;async function Ca(e){let t=await Ut(Kr({...e,size:e.size??$e},Wl));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function k_(e){if(yt(e.frame)){let t=Qn(Wl,e.frame);return t.squareEdges?t.color:null}if(e.backdrop&&e.bgRadius){let t=Ke(e.value,Je(e),e.exactLevel).size,r=Ye(t,e.margin??Me,e.shape);if(xi(e.bgRadius,t,r,e.shape)>0)return Fe(e.backdrop,Pe)}return Fe(e.bgColor,Pe)}function ql(e,t){let r=k_(e);if(!(r&&sn(e.bgColor))||yt(e.frame)||e.templateId||e.customTemplate)return r;let n=Er(t)?.children.find(i=>i.name==="rect"),o=n&&ae(n,"fill");return o?.startsWith("url(")?o:r}function Xl(e,t){let r={r:255,g:255,b:255,a:1},n=ve(Fe(t.bgColor,Pe));e.paper=r,e.background=n&&!sn(t.bgColor)?n:null,e.backdrop=n?Pl(n,r):r;}var Yl=25.4,_5=5,b5=2e3,Cr=Wl,I_=5,y5=2,IR=.25*(Yl/72);function MR(e,t="mm"){return t==="in"?e*Yl:e}function TR(e){let t=Je(e),r=Ke(e.value,t,e.exactLevel).size;return r+Ye(r,e.margin??Me,e.shape)*2}function Kl(e,t){let r=MR(t.size,t.unit);if(!Number.isFinite(r)||r<_5||r>b5)throw new Error(`Print size must be between ${_5} mm and ${b5/1e3} m`);let n=Math.min(Math.max(t.bleed??0,0),20),o=r/Cr,i=yt(e.frame)?Qn(Cr,e.frame):null,s=(i?.width??Cr)*o,a=(i?.height??Cr)*o,c=t.cropMarks?n+y5+I_+1:n,u=TR(e);return {codeWidth:r,trimWidth:s,trimHeight:a,bleed:n,pageWidth:s+2*c,pageHeight:a+2*c,trimX:c,trimY:c,moduleSize:r/u,moduleCount:u,maxScanDistance:r*10}}var M_=class e{pdf;internals;names=new Map;constructor(t,r){this.pdf=t,this.internals=r;}static attach(t){let r=t.internal;return typeof t.advancedAPI!="function"||typeof t.addShadingPattern!="function"||typeof r.write!="function"||typeof r.events?.subscribe!="function"?null:new e(t,r)}name(t){let r=this.names.get(t);return r||(this.names.size===0&&this.install(),r=`Sh${this.names.size}`,this.names.set(t,r)),r}install(){this.pdf.advancedAPI(t=>{t.addShadingPattern("qrdx-shadings",{});}),this.internals.events.subscribe("putShadingPatternDict",()=>{for(let[t,r]of this.names)this.internals.write(`/${r} ${t}`);});}},T_=class extends Ei{pdf;cmyk;images;shadingResources;constructor(t,r,n,o,i){super(n,o?.gradients??null),this.pdf=t,this.cmyk=r,this.images=i,this.shadingResources=o?.resources??null;}setColor(t,r){let n=t==="fill"?this.pdf.setFillColor.bind(this.pdf):t==="draw"?this.pdf.setDrawColor.bind(this.pdf):this.pdf.setTextColor.bind(this.pdf);if(this.cmyk){let[o,i,s,a]=Qr(r.r,r.g,r.b);n(o,i,s,a);}else n(Math.round(r.r),Math.round(r.g),Math.round(r.b));}setRegistrationColor(){this.cmyk?this.pdf.setDrawColor(1,1,1,1):this.pdf.setDrawColor(0,0,0);}tracePath(t,r){let n=false;for(let o of t)if(o.op==="M"){let[i,s]=ne(r,o.x,o.y);this.pdf.moveTo(i,s),n=true;}else if(o.op==="L"){let[i,s]=ne(r,o.x,o.y);n?this.pdf.lineTo(i,s):(this.pdf.moveTo(i,s),n=true);}else if(o.op==="C"){let[i,s]=ne(r,o.x1,o.y1),[a,c]=ne(r,o.x2,o.y2),[u,l]=ne(r,o.x,o.y);this.pdf.curveTo(i,s,a,c,u,l);}else n&&this.pdf.close();}shade(t,r,n){let o=this.pdf.internal,i=o.scaleFactor,s=[i,0,0,-i,0,o.pageSize.getHeight()*i],a=Ee(s,Ee(r.matrix,n.matrix));if(!(this.shadingResources&&Yr(a)))return;let c=this.shadingResources.name(Gl(n,this.cmyk?"cmyk":"rgb"));this.pdf.saveGraphicsState(),this.tracePath(t,r.matrix),this.pdf.clip(r.fillRule==="evenodd"?"evenodd":void 0),this.pdf.discardPath(),o.write(`${Ul(a)} cm /${c} sh`),this.pdf.restoreGraphicsState();}beginClip(t,r,n){return this.pdf.saveGraphicsState(),this.tracePath(t,r),this.pdf.clip(n?"evenodd":void 0),this.pdf.discardPath(),true}endClip(){this.pdf.restoreGraphicsState();}withAlpha(t,r,n){if(t>=1&&r>=1){n();return}this.pdf.saveGraphicsState();let o=this.pdf.GState;this.pdf.setGState(new o({opacity:t,"stroke-opacity":r}));try{n();}finally{this.pdf.restoreGraphicsState();}}opaqueGradient(t,r){let n=t.stops[0]?.color.a??1;return t.stops.every(i=>Math.abs(i.color.a-n)<.002)?{gradient:{...t,stops:t.stops.map(i=>({...i,color:{...i.color,a:1}}))},alpha:n*r}:{gradient:{...t,stops:t.stops.map(i=>({...i,color:this.flatten({...i.color,a:i.color.a*r})}))},alpha:1}}paint(t,r,n){if(t.length===0)return;let o=n.opacity??1;if(o<=0)return;let i=this.resolveFill(n.fill,t,n.viewport,(n.fillOpacity??1)*o);if(i&&"pattern"in i)this.paintPattern(t,n,i.pattern,i.alpha);else if(i&&"gradient"in i){let{gradient:f,alpha:p}=this.opaqueGradient(i.gradient,i.alpha);this.withAlpha(p,1,()=>this.shade(t,n,f));}let s=i&&"color"in i?i.color:null,a=s&&this.inConic?this.flatten(s):s,c=n.strokeWidth>0?this.resolveColor(n.stroke):null,u=c&&{...c,a:c.a*o};if(!(a||u))return;let l=n.fillRule==="evenodd";this.withAlpha(a?.a??1,u?.a??1,()=>{a&&this.setColor("fill",a);let f=u?jl(n):{join:0,cap:0};u&&(this.setColor("draw",u),this.pdf.setLineWidth(n.strokeWidth*bo(n.matrix)),(f.join||f.cap)&&(this.pdf.setLineJoin(f.join),this.pdf.setLineCap(f.cap))),this.tracePath(t,n.matrix),a&&u?l?this.pdf.fillStrokeEvenOdd():this.pdf.fillStroke():a?l?this.pdf.fillEvenOdd():this.pdf.fill():this.pdf.stroke(),(f.join||f.cap)&&(this.pdf.setLineJoin(0),this.pdf.setLineCap(0));});}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=bo(r.matrix),[s,a]=ne(r.matrix,se(t.attrs.x,r.viewport[0]),se(t.attrs.y,r.viewport[1])),c=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600;this.pdf.setFont("helvetica",c?"bold":"normal");let u=r.fontSize*i*(72/Yl);this.pdf.setFontSize(u);let l=Number.parseFloat(t.attrs["data-max-width"]??"");if(l>0){let m=l*i,h=this.pdf.getTextWidth(n);h>m&&(u*=m/h,this.pdf.setFontSize(u));}this.setColor("text",o);let f=Math.atan2(r.matrix[1],r.matrix[0]);if(Math.abs(f)>2e-4){let m=r.textAnchor==="middle"?this.pdf.getTextWidth(n)/2:r.textAnchor==="end"?this.pdf.getTextWidth(n):0;this.pdf.text(n,s-m*Math.cos(f),a-m*Math.sin(f),{angle:-f*180/Math.PI,baseline:"alphabetic"});return}let p=r.textAnchor==="middle"?"center":r.textAnchor==="end"?"right":"left";this.pdf.text(n,s,a,{align:p,baseline:"alphabetic"});}aliases=new Map;image(t,r){let n=t.attrs.href??t.attrs["xlink:href"],o=n&&(Vl(n)?n:this.images.get(n)),i=o&&Vl(o);if(!(o&&i))return;let s=this.aliases.get(o);s||(s=`qrdx-image-${this.aliases.size}`,this.aliases.set(o,s));let a=null;if(t.attrs.preserveAspectRatio)try{let g=this.pdf.getImageProperties(o);a={width:g.width,height:g.height};}catch{a=null;}let c=d5(t,r.viewport,a);if(!c)return;let{draw:u,clip:l}=c,[f,p]=ne(r.matrix,u.x,u.y),[m,h]=ne(r.matrix,u.x+u.width,u.y+u.height),d=l!==null&&this.beginClip([{op:"M",x:l.x,y:l.y},{op:"L",x:l.x+l.width,y:l.y},{op:"L",x:l.x+l.width,y:l.y+l.height},{op:"L",x:l.x,y:l.y+l.height},{op:"Z"}],r.matrix,false);try{this.withAlpha(r.opacity??1,1,()=>{this.pdf.addImage(o,i,Math.min(f,m),Math.min(p,h),Math.abs(m-f),Math.abs(h-p),s);});}finally{d&&this.endClip();}}};function OR(e,t,r){let{trimX:n,trimY:o,trimWidth:i,trimHeight:s,bleed:a}=r,c=a+y5,u=n,l=n+i,f=o,p=o+s;t.setRegistrationColor(),e.setLineWidth(IR);for(let m of [u,l]){let h=m===u?-1:1;for(let d of [f,p]){let g=d===f?-1:1;e.line(m+h*c,d,m+h*(c+I_),d),e.line(m,d+g*c,m,d+g*(c+I_));}}}async function LR(e,t){return (await x5(e,t)).output("dataurlstring")}async function lF(e,t){return (await x5(e,t)).output("arraybuffer")}async function x5(e,t){let r=Kl(e,t),n;try{({jsPDF:n}=await import('jspdf'));}catch(_){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${_})`)}let o=await Ca(e),i=Er(o);if(!i)throw new Error("Failed to render the QR code for printing");let s=new Map;for(let _ of Sa(i,new Set))if(!Vl(_)){let b=await Hl(_);b&&s.set(_,b);}let a=new n({orientation:r.pageWidth>r.pageHeight?"landscape":"portrait",unit:"mm",format:[r.pageWidth,r.pageHeight],compress:true,floatPrecision:3});a.setProperties({title:"QR code",creator:"qrdx"});let c=Zl(i),u=c.size>0?M_.attach(a):null,l=new T_(a,t.colorMode==="cmyk",wa(i,new Map),u?{gradients:c,resources:u}:null,s);Xl(l,e);let f=r.codeWidth/Cr,p=se(i.attrs.width,Cr,Cr),m=se(i.attrs.height,Cr,Cr),h={matrix:Ee([1,0,0,1,r.trimX,r.trimY],[f,0,0,f,0,0]),viewport:[p,m],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},d=r.bleed>0?ql(e,o):null,g=[r.trimX-r.bleed,r.trimY-r.bleed,r.trimX+r.trimWidth+r.bleed,r.trimY+r.trimHeight+r.bleed];if(!(d&&l.paintBleed(i,h,d,g))){let _=d?l.resolveColor(d):null;_&&(l.setColor("fill",_),a.rect(r.trimX-r.bleed,r.trimY-r.bleed,r.trimWidth+2*r.bleed,r.trimHeight+2*r.bleed,"F"));}return l.walk(i,h,true),t.cropMarks&&OR(a,l,r),a}async function NR(e,t){let r=Kl(e,{size:t.size,unit:t.unit}),n=await Ca(e),o=t.unit??"mm",i=c=>`${x(o==="in"?c/Yl:c)}${o}`,s=/^<svg\b[^>]*>/.exec(n)?.[0];if(!s)throw new Error("Failed to render the QR code for printing");return `<?xml version="1.0" encoding="UTF-8"?>
63
+ ${s.replace(/\swidth="[^"]*"/,` width="${i(r.trimWidth)}"`).replace(/\sheight="[^"]*"/,` height="${i(r.trimHeight)}"`)}${n.slice(s.length)}`}async function fF(e,t){let r=await LR(e,t);Ct(r,t.filename??"qr-code-print.pdf");}async function mF(e,t){let r=await NR(e,t);Ct(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r)}`,t.filename??"qr-code-print.svg");}var FR=[137,80,78,71,13,10,26,10];async function w5(e,t){let r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function S5(e){return typeof CompressionStream>"u"?null:await w5(e,new CompressionStream("deflate"))}async function zR(e){if(typeof DecompressionStream>"u")return null;try{return await w5(e,new DecompressionStream("deflate"))}catch{return null}}var O_=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,$5={0:1,2:3,3:1,4:2,6:4};function DR(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),s=Math.abs(n-r);return o<=i&&o<=s?e:i<=s?t:r}async function L_(e){if(FR.some((d,g)=>e[g]!==d))return null;let t=8,r=0,n=0,o=-1,i=null,s=null,a=[];for(;t+8<=e.length;){let d=O_(e,t),g=String.fromCharCode(...e.subarray(t+4,t+8)),_=e.subarray(t+8,t+8+d);if(t+=12+d,g==="IHDR"){r=O_(_,0),n=O_(_,4);let b=_[8];o=_[9];let y=_[12];if(b!==8||y!==0||!(o in $5))return null}else if(g==="PLTE")i=_;else if(g==="tRNS")s=_;else if(g==="IDAT")a.push(_);else if(g==="IEND")break}if(!(r&&n)||r*n>4096*4096)return null;let c=new Uint8Array(a.reduce((d,g)=>d+g.length,0)),u=0;for(let d of a)c.set(d,u),u+=d.length;let l=await zR(c),f=$5[o],p=r*f;if(!l||l.length<n*(p+1))return null;let m=new Uint8Array(n*p);for(let d=0;d<n;d++){let g=l[d*(p+1)],_=l.subarray(d*(p+1)+1,(d+1)*(p+1)),b=d*p;for(let y=0;y<p;y++){let S=y>=f?m[b+y-f]:0,C=d>0?m[b-p+y]:0,w=d>0&&y>=f?m[b-p+y-f]:0,$=_[y],v=0;g===1?v=S:g===2?v=C:g===3?v=S+C>>1:g===4&&(v=DR(S,C,w)),m[b+y]=$+v&255;}}let h=new Uint8Array(r*n*4);for(let d=0;d<r*n;d++){let g=d*4,_=d*f;if(o===3){let b=m[_];h[g]=i?.[b*3]??0,h[g+1]=i?.[b*3+1]??0,h[g+2]=i?.[b*3+2]??0,h[g+3]=s?.[b]??255;}else if(o===0||o===4){let b=m[_];h[g]=b,h[g+1]=b,h[g+2]=b,h[g+3]=o===4?m[_+1]:255;}else h[g]=m[_],h[g+1]=m[_+1],h[g+2]=m[_+2],h[g+3]=o===6?m[_+3]:255;}return {width:r,height:n,data:h}}var BR=25.4,C5=72/BR,ZR=50;function UR(e){let t=/^data:[^,]*?(;base64)?,(.*)$/s.exec(e);if(!t)return null;try{let r=t[1]?atob(t[2]):decodeURIComponent(t[2]),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o)&255;return n}catch{return null}}function GR(e){if(e[0]!==255||e[1]!==216)return null;let t=2;for(;t+9<e.length;){if(e[t]!==255)return null;let r=e[t+1];if(r===216||r>=208&&r<=215){t+=2;continue}let n=e[t+2]<<8|e[t+3];if(r===192||r===193||r===194){let o=e[t+5]<<8|e[t+6],i=e[t+7]<<8|e[t+8],s=e[t+9];return {width:i,height:o,components:s,progressive:r===194}}t+=2+n;}return null}async function QR(e,t){let{width:r,height:n,data:o}=e,i=t?4:3,s=new Uint8Array(r*n*i);for(let c=0;c<r*n;c++){let u=o[c*4+3]/255,l=o[c*4]*u+255*(1-u),f=o[c*4+1]*u+255*(1-u),p=o[c*4+2]*u+255*(1-u);if(t){let[m,h,d,g]=Qr(l,f,p);s.set([m*255,h*255,d*255,g*255].map(Math.round),c*i);}else s.set([Math.round(l),Math.round(f),Math.round(p)],c*i);}let a=await S5(s);return {kind:"raw",width:r,height:n,components:i,bytes:a??s,compressed:!!a}}async function jR(e,t){let r=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(r)){let s=await Hl(r);if(!s)return null;r=s;}let n=UR(r);if(!n)return null;let o=GR(n);if(o)return o.components===1||o.components===3?{kind:"jpeg",width:o.width,height:o.height,components:o.components,bytes:n,progressive:o.progressive}:null;let i=await L_(n);return i?await QR(i,t):null}function VR(e){let t="",r=0,n=o=>{t+=o,r+=o.length,r>=76&&(t+=`
64
+ `,r=0);};for(let o=0;o<e.length;o+=4){let i=Math.min(4,e.length-o),s=0;for(let c=0;c<4;c++)s=s*256+(c<i?e[o+c]:0);if(s===0&&i===4){n("z");continue}let a=[];for(let c=0;c<5;c++)a.unshift(String.fromCharCode(s%85+33)),s=Math.floor(s/85);n(a.slice(0,i+1).join(""));}return `${t}~>`}var HR=`/qrdxdict 40 dict def
65
65
  qrdxdict begin
66
66
  /m {moveto} bind def
67
67
  /l {lineto} bind def
@@ -82,11 +82,11 @@ qrdxdict begin
82
82
  } bind def
83
83
  /QRDX-Regular /Helvetica latin1
84
84
  /QRDX-Bold /Helvetica-Bold latin1
85
- end`;function O_(e){let t="(";for(let r of e){let n=r.codePointAt(0)??63;r==="("||r===")"||r==="\\"?t+=`\\${r}`:r==="\u2026"?t+="...":n>=32&&n<127?t+=r:n>=160&&n<=255?t+=`\\${n.toString(8).padStart(3,"0")}`:t+="?";}return `${t})`}var L_=class extends vi{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(t,r,n,o){super(r,n),this.cmyk=t,this.images=o;}color(t){if(this.cmyk){let[r,n,o,i]=jr(t.r,t.g,t.b);return `${x(r)} ${x(n)} ${x(o)} ${x(i)} cmyk`}return `${x(t.r/255)} ${x(t.g/255)} ${x(t.b/255)} rg`}tracePath(t,r){let n=["n"],o=false;for(let i of t)if(i.op==="M"||i.op==="L"&&!o){let[s,a]=oe(r,i.x,i.y);n.push(`${x(s)} ${x(a)} m`),o=true;}else if(i.op==="L"){let[s,a]=oe(r,i.x,i.y);n.push(`${x(s)} ${x(a)} l`);}else if(i.op==="C"){if(!o)continue;let[s,a]=oe(r,i.x1,i.y1),[c,u]=oe(r,i.x2,i.y2),[l,f]=oe(r,i.x,i.y);n.push(`${x(s)} ${x(a)} ${x(c)} ${x(u)} ${x(l)} ${x(f)} c`);}else o&&n.push("h");return n.join(" ")}beginClip(t,r,n){return this.out.push(`gsave ${this.tracePath(t,r)} ${n?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(t,r,n,o,i){this.out.push(`${this.color(t)} n ${x(r)} ${x(n)} m ${x(r+o)} ${x(n)} l ${x(r+o)} ${x(n+i)} l ${x(r)} ${x(n+i)} l h f`);}shade(t,r,n){let o=ve(r.matrix,n.matrix);if(!Kr(o))return;let i=Zl(n,this.cmyk?"cmyk":"rgb"),s=this.shadingNames.get(i);s||(s=`Sh${this.shadingNames.size}`,this.shadingNames.set(i,s)),this.usesLevel3=true;let a=r.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(t,r.matrix)} ${a} n [${Bl(o)}] concat ${s} shfill grestore`);}paint(t,r,n){if(t.length===0)return;let o=n.opacity??1;if(o<=0)return;let i=this.resolveFill(n.fill,t,n.viewport,(n.fillOpacity??1)*o);i&&"pattern"in i?this.paintPattern(t,n,i.pattern,i.alpha):i&&"gradient"in i&&this.shade(t,n,{...i.gradient,stops:i.gradient.stops.map(f=>({...f,color:this.flatten({...f.color,a:f.color.a*i.alpha})}))});let s=i&&"color"in i?this.flatten(i.color):null,a=n.strokeWidth>0?this.resolveColor(n.stroke):null,c=a&&this.flatten({...a,a:a.a*o});if(!(s||c))return;let u=this.tracePath(t,n.matrix),l=n.fillRule==="evenodd"?"ef":"f";if(s&&c?this.out.push(`gsave ${this.color(s)} ${u} ${l} grestore`):s&&this.out.push(`${this.color(s)} ${u} ${l}`),c){let f=`${this.color(c)} ${x(n.strokeWidth*bo(n.matrix))} w ${u} s`,{join:p,cap:m}=Gl(n);this.out.push(p||m?`gsave ${p} setlinejoin ${m} setlinecap ${f} grestore`:f);}}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=bo(r.matrix),[s,a]=oe(r.matrix,ie(t.attrs.x,r.viewport[0]),ie(t.attrs.y,r.viewport[1])),u=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",l=x(r.fontSize*i),f=Number.parseFloat(t.attrs["data-max-width"]??""),p=f>0?` dup stringwidth pop dup ${x(f*i)} gt {${x(f*i)} exch div ${l} mul ${u} findfont exch scalefont setfont} {pop} ifelse`:"",m=r.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":r.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",h=Math.atan2(r.matrix[1],r.matrix[0])*180/Math.PI;if(Math.abs(h)>.01){this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${x(s)} ${x(a)} translate ${x(h)} rotate ${O_(n)}${p} 0 0 moveto${m} show grestore`);return}this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${O_(n)}${p} ${x(s)} ${x(a)} moveto${m} show grestore`);}image(t,r){let n=t.attrs.href??t.attrs["xlink:href"],o=n?this.images.get(n):void 0;if(!o)return;let i=ie(t.attrs.x,r.viewport[0]),s=ie(t.attrs.y,r.viewport[1]),a=ie(t.attrs.width,r.viewport[0]),c=ie(t.attrs.height,r.viewport[1]);if(a<=0||c<=0)return;let[u,l]=oe(r.matrix,i,s),[f,p]=oe(r.matrix,i+a,s+c),{components:m}=o,h=m===1?"/DeviceGray":m===4?"/DeviceCMYK":"/DeviceRGB",d=Array.from({length:m},()=>"0 1").join(" "),g="/ASCII85Decode filter";o.kind==="jpeg"?(g+=" /DCTDecode filter",o.progressive&&(this.usesLevel3=true)):o.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(u,f))} ${x(Math.min(l,p))} translate ${x(Math.abs(f-u))} ${x(Math.abs(p-l))} scale`,`${h} setcolorspace`,`<< /ImageType 1 /Width ${o.width} /Height ${o.height} /BitsPerComponent 8 /Decode [${d}] /ImageMatrix [${o.width} 0 0 -${o.height} 0 ${o.height}] /DataSource currentfile ${g} >> image`,QR(o.bytes),"grestore"].join(`
86
- `));}};async function S5(e,t={}){let r=Rr(e);if(!r)throw new Error("Could not read the SVG to convert to EPS");let n=ie(r.attrs.width,0,0)||512,o=ie(r.attrs.height,0,0)||n,i=t.width??n;if(!(Number.isFinite(i)&&i>0))throw new Error("EPS width must be a positive number of points");let s=i/n,a=o*s,c=Math.max(0,t.bleed??0),u=i+2*c,l=a+2*c,f=t.colorMode==="cmyk",p=new Map;for(let b of wa(r,new Set)){let y=await GR(b,f);y&&p.set(b,y);}let m=new L_(f,$a(r,new Map),Dl(r),p);Wl(m,{bgColor:t.background??"#ffffff"});let d={matrix:ve([1,0,0,-1,c,l-c],[s,0,0,s,0,0]),viewport:[n,o],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=c>0?t.bleedColor??void 0:void 0;if(!(g&&m.paintBleed(r,d,g,[0,0,u,l]))){let b=g?m.resolveColor(g):null;b&&m.rect(b,0,0,u,l);}m.walk(r,d,true);let _=(t.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(u)} ${Math.ceil(l)}`,`%%HiResBoundingBox: 0 0 ${x(u)} ${x(l)}`,`%%Title: ${O_(_)}`,"%%Creator: qrdx",`%%LanguageLevel: ${m.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",jR,"%%EndProlog","qrdxdict begin",...Array.from(m.shadingNames,([b,y])=>`/${y} ${b} def`),"gsave",...m.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
87
- `)}var C5="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 E5(e){return [e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Object.values(e.eyeColors??{}).flatMap(r=>[r?.outer,r?.inner])].some(r=>typeof r=="object"&&r?.type==="image")}async function Yl(e,t={}){if(E5(e))throw new Error(C5);let r=Xl(e,{size:t.sizeMm??DR,unit:"mm",bleed:t.bleedMm}),n=await Sa(e);return await S5(n,{width:r.trimWidth*w5,bleed:r.bleed*w5,bleedColor:r.bleed>0?Hl(e,n):R_(e),colorMode:t.colorMode,background:Ne(e.bgColor,Pe)})}function Kl(e){return `data:application/postscript;base64,${btoa(e)}`}async function VR(e,t={}){let r=await Yl(e,t);Et(Kl(r),t.filename??"qr-code-print.eps");}var N_={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:ga,extension:"gif",vector:false},ico:{mimeType:qn,extension:"ico",vector:false,sizes:Ll},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}},IF={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 F_(e,t){return e<50||t<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:e>5e3||t>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:e!==t?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function Jr(e,t){let{imageSettings:r,size:n}=e;if(!(r&&n)||n===t)return {...e,size:t};let o=t/n;return {...e,size:t,imageSettings:{...r,width:r.width*o,height:r.height*o,...r.x!=null&&{x:r.x*o},...r.y!=null&&{y:r.y*o},...r.padding!=null&&{padding:r.padding*o}}}}function Et(e,t){let r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r);}var A5=e=>(N_[e]??N_.png).mimeType;function HR(e,t,r){let{extension:n,vector:o,sizes:i}=N_[e];if(o||i)return `qr-code.${n}`;let{width:s,height:a}=yr(t.width,r);return `qr-code-${Math.round(s)}x${Math.round(a)}.${n}`}async function v5(e,t={}){let r=await Cr(e,"image/webp",true);try{return await zl(r,t)}finally{r.remove();}}async function R5(e){let t=await Cr(e,"image/png",true);try{return Ju(t)}finally{t.remove();}}async function P5(e){let t=await Cr(e,"image/png",true);try{return await Ol(t,e.value)}finally{t.remove();}}async function k5(e,t=Ll){let r=[];try{for(let n of t)r.push(await Cr(Jr({...e,frame:void 0},n),"image/png",!0));return b_(r)}finally{for(let n of r)n.remove();}}var WR=25.4/72;async function I5(e){let t=await Yl(e,{sizeMm:(e.size??ye)*WR});return Kl(t)}async function M5(e){let t;try{({jsPDF:t}=await import('jspdf'));}catch(p){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${p})`)}let r=await Ut(e),n=decodeURIComponent(r.replace("data:image/svg+xml,","")),o;try{let p=new TextEncoder().encode(n),m=Array.from(p,d=>String.fromCharCode(d)).join("");o=`data:image/svg+xml;base64,${btoa(m)}`;}catch(p){throw new Error(`Failed to encode SVG for PDF conversion: ${p}`)}let{width:i,height:s}=yr(e.size||ye,e.frame),a=await new Promise((p,m)=>{let h=new Image,d=document.createElement("canvas");d.width=Math.round(i),d.height=Math.round(s);let g=d.getContext("2d");if(!g){m(new Error("Could not get canvas context"));return}let _=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(_);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(b){clearTimeout(_),d.remove(),m(new Error(`Failed to draw image to canvas: ${b}`));}},h.onerror=()=>{clearTimeout(_),d.remove(),m(new Error("Could not load SVG for PDF conversion"));},h.src=o;}),c=a.toDataURL("image/png",1),u=i*.264583,l=s*.264583,f=new t({orientation:u>l?"landscape":"portrait",unit:"mm",format:[u,l]});return f.addImage(c,"PNG",0,0,u,l),a.remove(),f.output("dataurlstring")}async function T5(e,t){let{format:r,size:n,filename:o,quality:i}=t,s=F_(n.width,n.height);if(!s.isValid)throw new Error(s.error);let a=Jr(e,n.width),c=o||HR(r,n,e.frame);try{if(r==="svg"){let u=await Ut(a);Et(u,c);}else if(r==="pdf"){let u=await M5(a);Et(u,c);}else if(r==="eps")Et(await I5(a),c);else if(r==="webp"){let u=await v5(a,{quality:i});Et(await $t(u),c);}else if(r==="bmp"){let u=await R5(a);Et(await $t(u),c);}else if(r==="gif"){let u=await P5(a);Et(await $t(u),c);}else if(r==="ico"){let u=await k5(a);Et(await $t(u),c);}else {let u=A5(r),l=await Cr(a,u);if(typeof l=="string")Et(l,c);else throw new Error("Failed to generate image data URL")}}catch(u){throw console.error(`Error downloading ${r.toUpperCase()}:`,u),u}}async function O5(e,t,r,n={}){let o=F_(r.width,r.height);if(!o.isValid)throw new Error(o.error);let i=Jr(e,r.width);if(t==="svg")return await Ut(i);if(t==="pdf")return await M5(i);if(t==="eps")return await I5(i);if(t==="webp")return await $t(await v5(i,n));if(t==="bmp")return await $t(await R5(i));if(t==="gif")return await $t(await P5(i));if(t==="ico")return await $t(await k5(i));let s=A5(t),a=await Cr(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}async function MF(e,t={width:ye,height:ye}){try{let r=F_(t.width,t.height);if(!r.isValid)throw new Error(r.error);let n=Jr(e,t.width),o=Cr(n,"image/png",!0).then(i=>new Promise((s,a)=>{let c=i;c.toBlob(u=>{c.remove(),u?s(u):a(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":o})]);}catch(r){throw console.error("Error copying to clipboard:",r),r}}async function TF(e){let t=await Ut(e);return decodeURIComponent(t.replace("data:image/svg+xml,",""))}var wt={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},$e=class extends Error{},qR={script:e=>`Removed ${ze(e,"script")}`,style:e=>`Removed ${ze(e,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":e=>`Removed ${ze(e,"foreignObject element")}`,image:e=>`Removed ${ze(e,"image")}: frames are vector shapes only`,use:e=>`Removed ${ze(e,"<use> reference")}: ungroup or detach symbols before exporting`,text:e=>`Removed ${ze(e,"text element")}: add text as labels in the frame editor`,effects:e=>`Removed ${ze(e,"filter, mask, clip path or pattern")}`,animation:e=>`Removed ${ze(e,"animation")}`,unknown:e=>`Removed ${ze(e,"unsupported element")}`,"nested-svg":e=>`Removed ${ze(e,"nested <svg>")}: flatten it first`,handlers:e=>`Removed ${ze(e,"event handler attribute")}`,links:e=>`Removed ${ze(e,"link")} (href)`,"external-paint":e=>`Removed ${ze(e,"fill or stroke")} that referenced something outside the file`,gradient:e=>`Flattened ${ze(e,"gradient")} to its first color: add gradients in the frame editor`,opacity:e=>`Made ${ze(e,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":e=>`${ze(e,"color")} couldn't be read and fell back to the parent color`,stroke:e=>`Removed ${ze(e,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:e=>`Drew ${ze(e,"dashed stroke")} as solid`,clipped:e=>`Cut ${ze(e,"shape")} at the edge of the artboard`,outside:e=>`Removed ${ze(e,"shape")} outside the artboard`,colors:e=>`Merged ${ze(e,"color")} with similar ones (${wt.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 ze(e,t){return `${e} ${t}${e===1?"":"s"}`}var Z_=class{counts=new Map;add(t,r=1){this.counts.set(t,(this.counts.get(t)??0)+r);}list(){return [...this.counts].map(([t,r])=>({code:t,count:r,message:qR[t](r)}))}},XR=/^\s*<\?xml\s[^?>]*\?>/,z_=/[A-Za-z_][\w:.-]*/y,D_=/<\/([A-Za-z_][\w:.-]*)\s*>/y,Jl=/\s*/y,YR=/[A-Za-z_:][\w:.-]*/y,KR=/[^"<]*/y,JR=/[^'<]*/y;function Ri(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function L5(e,t){let r=Ri(Jl,e,t),n=Ri(YR,e,r);if(r===t||n===r)return -1;let o=Ri(Jl,e,n);if(e[o]!=="=")return -1;let i=Ri(Jl,e,o+1),s=e[i];if(s!=='"'&&s!=="'")return -1;let c=Ri(s==='"'?KR:JR,e,i+1);return e[c]===s?c+1:-1}function eP(e,t){let r=Ri(Jl,e,t);return e[r]===">"?{end:r+1,selfClosing:false}:e.startsWith("/>",r)?{end:r+2,selfClosing:true}:null}function tP(e){let t=[],r=0,n="",o=0;for(;o<e.length;){let i=e.indexOf("<",o);if(i<0)break;if(o=i,e.startsWith("<!--",o)){let u=e.indexOf("-->",o+4);if(u<0)throw new $e("The SVG has an unclosed comment");o=u+3;continue}if(e.startsWith("<![CDATA[",o)){let u=e.indexOf("]]>",o+9);if(u<0)throw new $e("The SVG has an unclosed CDATA section");o=u+3;continue}if(e.startsWith("<?",o)){let u=e.indexOf("?>",o+2);if(u<0)throw new $e("The SVG has an unclosed declaration");o=u+2;continue}if(e.startsWith("<!",o))throw new $e("DOCTYPE and other declarations are not allowed");if(e[o+1]==="/"){D_.lastIndex=o;let u=D_.exec(e);if(!u)throw new $e("The SVG has a malformed closing tag");if(t.pop()!==u[1])throw new $e(`The SVG closes <${u[1]}> out of order`);o=D_.lastIndex;continue}z_.lastIndex=o+1;let s=z_.exec(e);if(!s)throw new $e("The SVG has a malformed tag");let a=z_.lastIndex;for(let u=L5(e,a);u>=0;u=L5(e,a))a=u;let c=eP(e,a);if(!c)throw new $e(`The SVG has a malformed <${s[0]}> tag (attributes must be quoted and may not contain "<")`);if(r++,r>wt.maxElements)throw new $e(`The SVG has more than ${wt.maxElements} elements`);if(n||(n=s[0]),!c.selfClosing&&(t.push(s[0]),t.length>wt.maxDepth))throw new $e(`The SVG nests elements more than ${wt.maxDepth} deep`);o=c.end;}if(t.length>0)throw new $e(`The SVG doesn't close <${t.at(-1)}>`);return n}function rP(e){if(typeof e!="string")throw new $e("Expected SVG markup as a string");let t=new TextEncoder().encode(e).length;if(t>wt.maxBytes)throw new $e(`The SVG is ${Math.ceil(t/1e3)} KB; the limit is ${wt.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(e))throw new $e("DOCTYPE and entity declarations are not allowed");let r=e.replace(XR,"");if(r.includes("<?"))throw new $e("Processing instructions (such as xml-stylesheet) are not allowed");if(tP(r)!=="svg")throw new $e("The file must start with an <svg> element");return r}var B_=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function Gt(e){let t=e?.replace(/!important/i,"").trim();return t===""||t==="inherit"?void 0:t}function U_(e,t,r,n){let o=e.trim();if(o==="none"||o==="transparent")return null;if(/^url\(/i.test(o)){let s=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(o)?.[1],a=s?r.get(s):void 0;return a?(n.add("gradient"),U_(a,t,r,n)):(n.add("external-paint"),null)}let i=we(o==="currentColor"?t.color:o);return i?i.a<=0?null:`#${B_(i.r)}${B_(i.g)}${B_(i.b)}`:(n.add("invalid-paint"),null)}function nP(e){let t=new Map,r=o=>{(o.name==="linearGradient"||o.name==="radialGradient")&&o.attrs.id&&t.set(o.attrs.id,o);for(let i of o.children)r(i);};r(e);let n=new Map;for(let[o,i]of t){let s=i.children.find(c=>c.name==="stop");if(!s){let c=(i.attrs.href??i.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];s=c?t.get(c)?.children.find(u=>u.name==="stop"):void 0;}let a=s&&Gt(se(s,"stop-color"));a&&n.set(o,a);}return n}function N5(e,t){return e.map(r=>{if(r.op==="Z")return r;if(r.op==="C"){let[i,s]=oe(t,r.x1,r.y1),[a,c]=oe(t,r.x2,r.y2),[u,l]=oe(t,r.x,r.y);return {op:"C",x1:i,y1:s,x2:a,y2:c,x:u,y:l}}let[n,o]=oe(t,r.x,r.y);return {op:r.op,x:n,y:o}})}function oP(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),t/2}function Q_(e){return e.length<3?[]:[...e.map(([t,r],n)=>({op:n===0?"M":"L",x:t,y:r})),{op:"Z"}]}var en=e=>Number.isFinite(e);function Ie(e,t,r=0){let n=Number.parseFloat(e.attrs[t]??"");return en(n)?n:r}function F5(e){switch(e.name){case "path":return ur(e.attrs.d??"");case "rect":{let t=e.attrs.rx??e.attrs.ry,r=e.attrs.ry??e.attrs.rx;return Xt(Ie(e,"x"),Ie(e,"y"),Ie(e,"width"),Ie(e,"height"),Number.parseFloat(t??"0")||0,Number.parseFloat(r??"0")||0)}case "circle":{let t=Ie(e,"r");return qt(Ie(e,"cx"),Ie(e,"cy"),t,t)}case "ellipse":return qt(Ie(e,"cx"),Ie(e,"cy"),Ie(e,"rx"),Ie(e,"ry"));case "polygon":case "polyline":{let t=Wt(e.attrs.points),r=[];for(let n=0;n+1<t.length;n+=2)r.push([t[n],t[n+1]]);return Q_(r)}default:return []}}function iP(e,t){let r=t/2;switch(e.name){case "rect":{let n=Ie(e,"x"),o=Ie(e,"y"),i=Ie(e,"width"),s=Ie(e,"height"),a=Number.parseFloat(e.attrs.rx??e.attrs.ry??"0")||0,c=Xt(n-r,o-r,i+t,s+t,a>0?a+r:0,a>0?a+r:0);if(i<=t||s<=t)return c;let u=Math.max(a-r,0);return [...c,...Xt(n+r,o+r,i-t,s-t,u,u)]}case "circle":case "ellipse":{let n=Ie(e,"cx"),o=Ie(e,"cy"),i=e.name==="circle"?Ie(e,"r"):Ie(e,"rx"),s=e.name==="circle"?Ie(e,"r"):Ie(e,"ry"),a=qt(n,o,i+r,s+r);return i<=r||s<=r?a:[...a,...qt(n,o,i-r,s-r)]}case "line":{let[n,o,i,s]=["x1","y1","x2","y2"].map(f=>Ie(e,f)),a=Math.hypot(i-n,s-o);if(a===0)return [];let c=-(s-o)/a*r,u=(i-n)/a*r,l=[[n+c,o+u],[i+c,s+u],[i-c,s-u],[n-c,o-u]];return Q_(oP(l)<0?l.reverse():l)}default:return null}}var sP=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),aP=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),cP={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"},uP=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function D5(e,t){for(let r of Object.keys(e.attrs)){let n=r.toLowerCase();n.startsWith("on")?t.add("handlers"):n==="href"||n==="xlink:href"?e.name!=="linearGradient"&&e.name!=="radialGradient"&&t.add("links"):(n==="filter"||n==="mask"||n==="clip-path")&&t.add("effects");}}function B5(e,t,r,n,o){if(D5(e,n),Gt(se(e,"display"))==="none"||Gt(se(e,"visibility"))==="hidden")return;let i=Number.parseFloat(se(e,"opacity")??"1"),s=Gt(se(e,"fill-rule")),a=Number.parseFloat(Gt(se(e,"stroke-width"))??""),c={matrix:ve(t.matrix,vt(e.attrs.transform)),fill:Gt(se(e,"fill"))??t.fill,fillRule:s==="evenodd"||s==="nonzero"?s:t.fillRule,stroke:Gt(se(e,"stroke"))??t.stroke,strokeWidth:en(a)&&a>=0?a:t.strokeWidth,color:Gt(se(e,"color"))??t.color,opacity:t.opacity*(en(i)?i:1)};for(let u of e.children){if(aP.has(u.name))continue;let l=cP[u.name];if(l){n.add(l);continue}if(u.name==="svg"){n.add("nested-svg");continue}if(u.name==="g"||u.name==="a"){B5(u,c,r,n,o);continue}if(!sP.has(u.name)){n.add("unknown");continue}lP(u,c,r,n,o);}}function lP(e,t,r,n,o){if(D5(e,n),Gt(se(e,"display"))==="none"||Gt(se(e,"visibility"))==="hidden")return;let i=ve(t.matrix,vt(e.attrs.transform));if(e.name==="rect"&&uP.test(e.attrs.id??"")&&!o.qrBox){o.qrBox=fn(N5(F5(e),i));return}let s=g=>Gt(se(e,g)),a=t.opacity*Number.parseFloat(s("opacity")??"1"),c=Number.parseFloat(s("fill-opacity")??"1"),u=Number.parseFloat(s("stroke-opacity")??"1"),l=s("fill-rule"),f={...t,fill:s("fill")??t.fill,fillRule:l==="evenodd"||l==="nonzero"?l:t.fillRule,stroke:s("stroke")??t.stroke,color:s("color")??t.color},p=Number.parseFloat(s("stroke-width")??""),m=en(p)&&p>=0?p:t.strokeWidth,h=(g,_,b)=>{if(g.length!==0){if(o.segments+=g.length,o.segments>wt.maxInputSegments)throw new $e(`The SVG has more than ${wt.maxInputSegments} path segments; simplify it`);o.shapes.push({segments:N5(g,i),fill:_,fillRule:b});}},d=g=>{let _=(en(a)?a:1)*(en(g)?g:1);return _<=0?false:(_<1&&n.add("opacity"),true)};if(e.name!=="line"){let g=U_(f.fill,f,r,n);g&&d(c)&&h(F5(e),g,f.fillRule);}if(m>0&&f.stroke!=="none"){let g=U_(f.stroke,f,r,n);if(g&&d(u)){let _=iP(e,m);_?((s("stroke-dasharray")??"none")!=="none"&&n.add("dash"),h(_,g,e.name==="line"?"nonzero":"evenodd")):n.add("stroke");}}}function fP(e,t){let r=u=>{let l=10**t;return Math.round(u*l)/l+0},n=u=>x(u,t),o="",i=0,s=0,a=0,c=0;for(let u of e){if(u.op==="Z"){o+="z",i=a,s=c;continue}let l=r(u.x),f=r(u.y);if(u.op==="M")o+=`m${n(l-i)} ${n(f-s)}`,a=l,c=f;else if(u.op==="L"){if(l===i&&f===s)continue;o+=f===s?`h${n(l-i)}`:l===i?`v${n(f-s)}`:`l${n(l-i)} ${n(f-s)}`;}else o+=`c${n(r(u.x1)-i)} ${n(r(u.y1)-s)} ${n(r(u.x2)-i)} ${n(r(u.y2)-s)} ${n(l-i)} ${n(f-s)}`;i=l,s=f;}return o}var mP=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function pP(e){let t=[];for(let r of e){let n=fn(r.segments);if(!n)continue;let o=t.at(-1);o&&o.shape.fill===r.fill&&o.shape.fillRule===r.fillRule&&!o.boxes.some(i=>mP(i,n))?(o.shape={...o.shape,segments:[...o.shape.segments,...r.segments]},o.boxes.push(n)):t.push({shape:r,boxes:[n]});}return t.map(r=>r.shape)}var G_=e=>[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)];function dP(e,t,r){let n=new Map;for(let s of e)n.set(s.fill,(n.get(s.fill)??0)+1);let o=new Map([...n.keys()].map(s=>[s,s])),i=0;for(;n.size>t;){let s=[...n.keys()],a=[s[0],s[1]],c=Number.POSITIVE_INFINITY;for(let m=0;m<s.length;m++)for(let h=m+1;h<s.length;h++){let d=G_(s[m]),g=G_(s[h]),_=Math.hypot(d[0]-g[0],d[1]-g[1],d[2]-g[2]);_<c&&(c=_,a=[s[m],s[h]]);}let[u,l]=a,[f,p]=(n.get(u)??0)>=(n.get(l)??0)?[u,l]:[l,u];n.set(f,(n.get(f)??0)+(n.get(p)??0)),n.delete(p);for(let[m,h]of o)h===p&&o.set(m,f);i++;}return i>0&&r.add("colors",i),o}var z5=e=>{let[t,r,n]=G_(e);return .2126*t+.7152*r+.0722*n>235};function hP(e,t={}){let r=new Z_;try{let n=rP(e),o=Rr(n);if(!o)throw new $e("No <svg> element found");let i=Wt(o.attrs.viewBox),[s,a,c,u]=[0,0,0,0];if(i.length===4&&i[2]>0&&i[3]>0?[s,a,c,u]=i:(c=Ie(o,"width"),u=Ie(o,"height")),!(en(c)&&en(u)&&c>0&&u>0))throw new $e("The SVG needs a viewBox (or a width and height)");let f=wt.artboardSide/Math.max(c,u),p=Math.round(c*f*10)/10,m=Math.round(u*f*10)/10;if(Math.min(p,m)<ee.minArtboard)throw new $e("The artboard is too narrow: its sides may differ by 20 times at most");let h=[f,0,0,f,-s*f,-a*f],d={shapes:[],qrBox:null,segments:0};B5(o,{matrix:h,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},nP(o),r,d);let g={x0:0,y0:0,x1:p,y1:m},_=Math.max(p,m)*.004,b=[],y=0,S=0;for(let U of d.shapes){let V=fn(U.segments);if(!V||V.x1<=0||V.y1<=0||V.x0>=p||V.y0>=m){y++;continue}if(V.x0<-_||V.y0<-_||V.x1>p+_||V.y1>m+_){let ue=Oa(U.segments,.25).map(et=>ho(et,g)).filter(et=>et.length>2);if(ue.length===0){y++;continue}S++,b.push({...U,segments:ue.flatMap(et=>Q_(et))});}else b.push(U);}if(y>0&&r.add("outside",y),S>0&&r.add("clipped",S),b.length===0)throw new $e("The SVG has no filled shapes to use");let C=dP(b,wt.maxColors,r);for(let U of b)U.fill=C.get(U.fill)??U.fill;let w=new Map,$=new Map;for(let U of b){let V=fn(U.segments);w.set(U.fill,(w.get(U.fill)??0)+(V.x1-V.x0)*(V.y1-V.y0)),$.set(U.fill,($.get(U.fill)??0)+1);}let E=[...w.keys()].sort((U,V)=>Number(z5(U))-Number(z5(V))||w.get(V)-w.get(U)),R=E[0],P=E[1],I=U=>U===R?"frame":U===P?"accent":U,T=d.qrBox;if(!T&&t.qr){let[U,V]=oe(h,t.qr.x,t.qr.y);T={x0:U,y0:V,x1:U+t.qr.size*f,y1:V+t.qr.size*f};}let O,B,z;T?(O=Math.min(T.x1-T.x0,T.y1-T.y0),B=(T.x0+T.x1-O)/2,z=(T.y0+T.y1-O)/2):(r.add("qr-placed"),O=Math.min(p,m)*.6,B=(p-O)/2,z=(m-O)/2);let F=U=>Math.round(U*10)/10+0;if(O=Math.floor(O*10)/10,B=F(B),z=F(z),O<Math.min(p,m)*ee.minQrShare)throw new $e("The QR area must be at least half the frame's shorter side");let te=Math.min(B,z,p-B-O,m-z-O);if(te<O*ee.minPadding-1e-9)throw new $e("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let re=Math.min(Math.max(t.padding??wt.padding,ee.minPadding),.2),Q=Math.floor(Math.min(O*re,te)*10)/10,X=pP(b);if(X.length>ee.maxShapes)throw new $e(`The artwork has ${X.length} separate shapes; the limit is ${ee.maxShapes}. Combine shapes of the same color first`);let ae={kind:mn,version:pn,artboard:{width:p,height:m},qr:{x:B,y:z,size:O,padding:Q},colors:{frame:R,...P&&{accent:P}},shapes:X.map(U=>({type:"path",d:fP(U.segments,wt.decimals),fill:I(U.fill),...U.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},De=sl(ae);if(!De.success){let U=De.issues[0];throw new $e(`The converted frame doesn't fit the frame format: ${U?.message??"invalid"}`)}let Ce=E.map(U=>({color:U,ref:U===R?"frame":U===P?"accent":"fixed",shapes:$.get(U)??0}));return {ok:!0,spec:De.data,warnings:r.list(),palette:Ce}}catch(n){return {ok:false,error:n instanceof $e?n.message:`Could not read the SVG (${n instanceof Error?n.name:"error"})`,warnings:r.list()}}}var gP=1114,_P={"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 bP=[{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 j_(e){return Array.isArray(e)?`[${e.map(j_).join(",")}]`:e&&typeof e=="object"?`{${Object.keys(e).filter(r=>e[r]!==void 0).sort().map(r=>`${JSON.stringify(r)}:${j_(e[r])}`).join(",")}}`:JSON.stringify(e)}function yP(e){let t=j_(e),r=2166136261;for(let n=0;n<t.length;n++)r^=t.charCodeAt(n),r=Math.imul(r,16777619)>>>0;return r.toString(16).padStart(8,"0")}function xP(e,t){return Re.QrCode.encodeText(e,Ze[t??Vt]).size}function Z5(e,t,r,n=r.size*(t?.size??If)){let o={src:e,width:n,height:n,excavate:true,...t?.shape&&t.shape!=="square"&&{shape:t.shape},...t?.plate&&{plate:t.plate}},i=t?.x!==void 0||t?.y!==void 0;if(!(t?.padding||i))return o;let s=xP(r.value,r.level),a=Ke(s,r.margin,r.shape),c=r.size/(s+2*a);if(t.padding&&(o.padding=t.padding*c),i){let u=s*c,l=f=>Math.min(Math.max((f??.5)*u-n/2,0),u-n);o.x=l(t.x),o.y=l(t.y);}return o}function U5(e,t,r,n){let o=r.level??Vt,i=o;n&&(i=Je({...r,imageSettings:Z5(e,t,r),autoLevel:n}));let s=c=>{let u=f=>Z5(e,t,{...r,level:c},f),l=B1(r,[c],u().width,u);return l>0?u(l):void 0};if(i===o)return s(o);let a=s(i);return a&&Je({...r,imageSettings:a,autoLevel:n})===i?a:s(o)}function $P({value:e,level:t,margin:r,shape:n,autoLevel:o,logoOptions:i}){let a=U5("data:,",{...i,size:Mi},{value:`${e}`,size:1024,margin:r??Me,level:t,shape:n},o);return a?a.width/1024:0}function V_({value:e,size:t=1024,fgColor:r,bgColor:n,eyeColor:o,dotColor:i,bodyPattern:s,hideLogo:a,logo:c,logoOptions:u,margin:l,cornerEyePattern:f,cornerEyeDotPattern:p,level:m,templateId:h,frame:d,eyeColors:g,moduleScale:_,autoLevel:b,shape:y,eyeShapes:S,eyeGradient:C,bgRadius:w,backdrop:$,halo:E,shadow:R}){let P={value:`${e}`,size:t,margin:l??Me,level:m,shape:y},I=!a&&c?U5(c,u,P,b):void 0;return {value:P.value,bgColor:n,fgColor:r,eyeColor:o,dotColor:i,bodyPattern:s,cornerEyePattern:f,cornerEyeDotPattern:p,level:m,templateId:h,size:t,margin:l,...d&&{frame:d},...g&&{eyeColors:g},..._!==void 0&&{moduleScale:_},...b&&{autoLevel:b},...y&&y!=="square"&&{shape:y},...S&&{eyeShapes:S},...C&&C!=="corner"&&{eyeGradient:C},...w&&{bgRadius:w},...$&&{backdrop:$},...E&&{halo:E},...R&&{shadow:R},...I&&{imageSettings:I}}}var G5=.06,Q5=.16,j5=512;function V5(e){let{width:t,height:r}=e;if(!(t>0&&r>0)||e.data.length<t*r*4)return null;let n=Uint8Array.from(e.data),o=Xg({width:t,height:r,data:n});if(!o)return null;let i=m=>{let h=m*4;return Math.hypot(n[h]/255-o[0],n[h+1]/255-o[1],n[h+2]/255-o[2])},s=new Uint8Array(t*r),a=new Int32Array(t*r),c=0,u=0,l=m=>{s[m]||n[m*4+3]===0||i(m)>=Q5||(s[m]=1,a[u++]=m);};for(let m=0;m<t;m++)l(m),l((r-1)*t+m);for(let m=0;m<r;m++)l(m*t),l(m*t+t-1);for(;c<u;){let m=a[c++],h=m%t;h>0&&l(m-1),h<t-1&&l(m+1),m>=t&&l(m-t),m<(r-1)*t&&l(m+t);}let f=new Uint8ClampedArray(n),p=o;for(let m=0;m<t*r;m++){if(!s[m])continue;let h=Math.min(1,Math.max(0,(i(m)-G5)/(Q5-G5))),d=m*4;if(f[d+3]=Math.round(n[d+3]*h),h>0&&h<1)for(let g=0;g<3;g++){let b=(n[d+g]/255-(1-h)*p[g])/h;f[d+g]=Math.round(Math.min(1,Math.max(0,b))*255);}}return {width:t,height:r,data:f}}async function wP(e){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let t=await new Promise(a=>{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>a(c),c.onerror=()=>a(null),c.src=e;});if(!t)return null;let r=t.naturalWidth||512,n=t.naturalHeight||512,o=Math.min(1,j5/Math.max(r,n)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(r*o)),i.height=Math.max(1,Math.round(n*o));let s=i.getContext("2d",{willReadFrequently:true});if(!s)return null;try{s.drawImage(t,0,0,i.width,i.height);let a=s.getImageData(0,0,i.width,i.height),c=V5(a);return c?(a.data.set(c.data),s.putImageData(a,0,0),i.toDataURL("image/png")):null}catch{return null}finally{i.remove();}}async function SP(e){let{value:t,size:r=ye,level:n=Vt,bgColor:o=Pe,fgColor:i=qe,margin:s=Me,imageSettings:a,eyeColor:c,dotColor:u,bodyPattern:l,cornerEyePattern:f,cornerEyeDotPattern:p,isOGContext:m,templateId:h,customTemplate:d,customProps:g,frame:_,art:b,eyeColors:y,moduleScale:S,eyeShapes:C,eyeGradient:w,bgRadius:$,backdrop:E,halo:R,shadow:P,frameLabelMarkers:I,partMarkers:T,autoLevel:O,...B}=e,z=bi({value:t,size:r,margin:s,level:n,autoLevel:O},a),F=Je({value:t,size:r,level:n,margin:s,imageSettings:z,autoLevel:O}),te=Re.QrCode.encodeText(t,Ze[F]).getModules(),re=te.length+s*2,Q=Xr(te,r,s,z),X=null;if(z!=null&&Q!=null){Q.excavation!=null&&(te=u_(te,Q.excavation));let De=z.src.startsWith("data:")?z.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(z.src)}&w=100&h=100&encoding=base64`).then(Ce=>{if(!Ce.ok)throw new Error(`Failed to load QR logo (${Ce.status}): ${z.src}`);return Ce.text()});X={settings:{...z,src:De},box:{x:Q.x+s,y:Q.y+s,w:Q.w,h:Q.h}};}let ae=IS(te,s);return {size:r,numCells:re,fgPath:ae,bgColor:o,fgColor:i,frame:_,svgProps:B,logo:X}}function CP(e){let{size:t,numCells:r,fgPath:n,bgColor:o,fgColor:i,frame:s,svgProps:a,logo:c}=e,u=xt(s),l=c?yl(c.settings,c.box):k(It,{}),f=Be("svg",{height:t,viewBox:`0 0 ${r} ${r}`,width:t,xmlns:"http://www.w3.org/2000/svg",...u?{}:a,children:[k("path",{d:`M0,0 h${r}v${r}H0z`,fill:Ne(o,Pe),shapeRendering:"crispEdges"}),k("path",{d:n,fill:Ne(i,qe),shapeRendering:"crispEdges"}),l]});return u&&s?aa(f,{size:t,frame:s,bgColor:o,svgProps:a}):f}async function EP(e){return CP(await SP(e))}var AP={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 vP(e){let t={};for(let r of Object.keys(e))Object.hasOwn(AP,r)||(t[r]=e[r]);return t}var RP=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function H5(e){let t=Object.fromEntries(RP.map(r=>[r,e[r]]));return V_({...t,margin:e.margin??Me})}function W5(e,t){let{size:r=ye,scale:n=1,level:o,style:i,customTemplate:s,customProps:a,frame:c,art:u,eyeColors:l,moduleScale:f,autoLevel:p,shape:m,frameLabelMarkers:h,partMarkers:d}=e,g={...t.eyeShapes&&{eyeShapes:t.eyeShapes},...t.eyeGradient&&{eyeGradient:t.eyeGradient},...t.bgRadius&&{bgRadius:t.bgRadius},...t.backdrop&&{backdrop:t.backdrop},...t.halo&&{halo:t.halo},...t.shadow&&{shadow:t.shadow}},_=r*n,b=_/t.size,y=t.imageSettings&&{...t.imageSettings,height:t.imageSettings.height*b,width:t.imageSettings.width*b,...t.imageSettings.x!=null&&{x:t.imageSettings.x*b},...t.imageSettings.y!=null&&{y:t.imageSettings.y*b},...t.imageSettings.padding!=null&&{padding:t.imageSettings.padding*b}};return {art:u,bgColor:t.bgColor,bodyPattern:t.bodyPattern,cornerEyeDotPattern:t.cornerEyeDotPattern,cornerEyePattern:t.cornerEyePattern,customProps:a,customTemplate:s,dotColor:t.dotColor,eyeColor:t.eyeColor,fgColor:t.fgColor,frame:c,level:o||t.level,margin:t.margin,...l&&{eyeColors:l},...f!==void 0&&{moduleScale:f},...p&&{autoLevel:p},...m&&m!=="square"&&{shape:m},...g,...h&&{frameLabelMarkers:h},...d&&{partMarkers:d},size:_,style:i,templateId:t.templateId,value:t.value,...y&&{imageSettings:y},...vP(e)}}function PP(e){return W5(e,H5(e))}function q5(e,t){let r=[],n=o=>{if(o==null||typeof o=="boolean")return;if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"){r.push(`${o}`);return}if(Array.isArray(o)){for(let u of o)n(u);return}if(!Ln(o))throw new TypeError("qrdx: can't render this value");let{type:i,props:s,key:a}=o;if(si(i)){n(s.children);return}if(typeof i=="function"){n(i(s));return}let c={};for(let u of Object.keys(s)){let l=Ai(u,s[u]);l&&(c[l.name]=l.value);}r.push(t(i,c,q5(s.children,t),a));};return n(e),r}var Pi=300,Ca=e=>{let t=typeof e=="number"?e:Number.parseFloat(String(e));return Number.isFinite(t)?t:void 0};function kP(e){let t=Ca(e.x)??0,r=Ca(e.y)??0,n=Wt(typeof e.viewBox=="string"?e.viewBox:void 0),o=Ca(e.width),i=Ca(e.height);if(n.length!==4||!(n[2]&&n[3]&&o&&i))return [1,0,0,1,t,r];let[s,a,c,u]=n,l=Math.min(o/c,i/u);return [l,0,0,l,t+(o-c*l)/2-s*l,r+(i-u*l)/2-a*l]}function H_(e,t,r,n){if(e===t)return r;if(Array.isArray(e)){for(let a of e){let c=H_(a,t,r,false);if(c)return c}return null}let o=e;if(!o||typeof o!="object"||!o.props)return null;let{props:i}=o,s=ve(r,vt(typeof i.transform=="string"?i.transform:void 0));return o.type==="svg"&&!n&&(s=ve(s,kP(i))),H_(i.children,t,s,false)}function W_(e){let t=e.customTemplate||(e.templateId?Al(e.templateId):void 0);if(!t)return 1;let r={type:"svg",props:{height:Pi,viewBox:`0 0 ${Pi} ${Pi}`,width:Pi},key:null},n;try{n=t.wrapper(r,{fgColor:typeof e.fgColor=="string"?e.fgColor:void 0,bgColor:typeof e.bgColor=="string"?e.bgColor:void 0,...e.customProps??{}},{pixelSize:10,url:e.value});}catch{return 1}let o=n?.props;if(!o)return 1;let i=Wt(typeof o.viewBox=="string"?o.viewBox:void 0),s=i.length===4?i[2]:Ca(o.width),a=H_(n,r,_o,true);if(!(a&&s))return 1;let[c,u]=oe(a,0,0),[l,f]=oe(a,Pi,Pi),m=Math.min(Math.abs(l-c),Math.abs(f-u))/s;return m>0&&m<=1?m:1}var n4=[96,160,320],X_=640;function rf(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function rn(e){if(e?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var o4=()=>new Promise(e=>setTimeout(e,0));async function K_(){let{default:e}=await import('jsqr');return e}function Y_(e,t){if(!e)return false;if(e.data===t)return true;try{return new TextDecoder().decode(Uint8Array.from(e.binaryData))===t}catch{return false}}function IP(e,t,r=.7){let{data:n,width:o,height:i}=e,s=o*i,a=Math.max(1,Math.round(t*.25)),c=MP(n,s);if(c){for(let l=0;l<s;l++)c[l]=128+(c[l]-128)*r;X5(c,o,i,a);for(let l=0,f=0;l<s;l++,f+=4){let p=c[l];n[f]=p,n[f+1]=p,n[f+2]=p;}return}let u=new Uint8ClampedArray(s);for(let l=0;l<3;l++){for(let f=0,p=l;f<s;f++,p+=4)u[f]=128+(n[p]-128)*r;X5(u,o,i,a);for(let f=0,p=l;f<s;f++,p+=4)n[p]=u[f];}}function MP(e,t){let r=new Uint8ClampedArray(t);for(let n=0,o=0;n<t;n++,o+=4){let i=e[o];if(i!==e[o+1]||i!==e[o+2])return null;r[n]=i;}return r}function X5(e,t,r,n){let o=2*n+1,i=new Float32Array(t*r),s=a=>{let c=a?r:t,u=a?t:r,l=a?t:1,f=a?1:t;for(let p=0;p<c;p++){let m=p*l,h=0;for(let d=-n;d<=n;d++)h+=e[m+Math.min(Math.max(d,0),u-1)*f];for(let d=0;d<u;d++)i[m+d*f]=h/o,h=h-e[m+Math.max(d-n,0)*f]+e[m+Math.min(d+n+1,u-1)*f];}e.set(i);};for(let a=0;a<2;a++)s(true),s(false);}function ki(e,t){let r=document.createElement("canvas");r.width=Math.max(1,Math.round(e)),r.height=Math.max(1,Math.round(t));let n=r.getContext("2d",{willReadFrequently:true});if(!n)throw new Error("Could not get canvas context");return n.imageSmoothingEnabled=true,n.imageSmoothingQuality="high",{canvas:r,ctx:n}}var TP=[.9,1,1.1];function i4(e){return TP.map(t=>e*t)}function J_(e,t,r,n,o){let i=0;for(let s of i4(r)){let a=t(s);if(IP(a,s/n),o(e(a.data,a.width,a.height))&&(i++,i>=2))break}return i>=2?"pass":i===1?"fragile":"fail"}var q_={small:"small print or far away",medium:"typical phone distance",large:"close up"};function OP(e,t){return e===t[0]&&t.length>1?q_.small:e===t.at(-1)?q_.large:q_.medium}function s4(e,t,r){if(r==="pass")return 0;let n=t===1?[45]:t===2?[20,45]:[15,20,45],o=n[Math.round(e*(n.length-1)/Math.max(t-1,1))]??20;return r==="fragile"?Math.round(o/2):o}function a4(e,t,r){let n=`${e} px (${OP(e,t)})`;return r==="pass"?{id:`decode-${e}`,passed:true,message:`Reads at ${n}, with camera blur`}:{id:`decode-${e}`,passed:false,message:r==="fragile"?`Reads at ${n} only some of the time`:`Doesn't read at ${n}`,fix:e===t[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 c4(e,t){return t?"fails":e>=85?"great":e>=65?"ok":"risky"}function LP(e,t,r){let n=it(e,t);if(n.type==="solid")return [n.color];if(n.type!=="image")return n.stops.map(a=>a.color);let o=n.underlay?tf(n.underlay):null,i=r?.[n.src];if(!i)return n.underlay?[n.underlay]:[];let s=n.opacity??1;return [i.light,i.dark].flatMap(a=>{let c=tf(a);if(!c)return [];let u={...c,a:c.a*s};if(!o)return [Y5(u)];let l=u.a+o.a*(1-u.a),f=(p,m)=>l>0?(p*u.a+m*o.a*(1-u.a))/l:0;return [Y5({r:f(u.r,o.r),g:f(u.g,o.g),b:f(u.b,o.b),a:l})]})}var Y5=({r:e,g:t,b:r,a:n})=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(r)}, ${Math.round(n*1e3)/1e3})`;function NP(e){let t=[],r=e.width*e.height;for(let i=0;i<r;i++){let s=e.data[i*4],a=e.data[i*4+1],c=e.data[i*4+2];e.data[i*4+3]<128||t.push({lum:Ci(s,a,c),r:s,g:a,b:c});}if(t.length===0)return null;t.sort((i,s)=>i.lum-s.lum);let n=Math.max(1,Math.round(t.length/10)),o=i=>{let s=i.reduce((c,u)=>({r:c.r+u.r,g:c.g+u.g,b:c.b+u.b}),{r:0,g:0,b:0}),a=c=>Math.round(c/i.length).toString(16).padStart(2,"0");return `#${a(s.r)}${a(s.g)}${a(s.b)}`};return {dark:o(t.slice(0,n)),light:o(t.slice(-n))}}async function FP(e){rf();let t=await va(e),{canvas:r,ctx:n}=ki(64,64);n.drawImage(t,0,0,64,64);let o=NP(n.getImageData(0,0,64,64));return r.remove(),o}function u4(e){let t=[e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...un.flatMap(n=>[e.eyeColors?.[n]?.outer,e.eyeColors?.[n]?.inner])],r=new Set;for(let n of t)typeof n=="object"&&n?.type==="image"&&r.add(n.src);return [...r]}var Ea=null;function tf(e){let t=we(e);if(t||typeof document>"u")return t;if(Ea??=document.createElement("canvas").getContext("2d"),!Ea)return null;Ea.fillStyle="#010203",Ea.fillStyle=e;let r=String(Ea.fillStyle);return r==="#010203"?null:we(r)}var K5=e=>Ci(e.r,e.g,e.b),l4=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),Aa=4.5,zP=3,J5=1.5,e4={code:7,background:12},t4={r:255,g:255,b:255,a:1},r4=(e,t)=>({r:e.r*e.a+t.r*(1-e.a),g:e.g*e.a+t.g*(1-e.a),b:e.b*e.a+t.b*(1-e.a),a:1});function DP(e,t={}){let r=t.imageTones,n=(h,d)=>{let g=typeof h=="object"&&h?.type==="image";return LP(h,d,r).map(_=>({color:_,picture:g}))},o=e.fgColor??qe,i=un.flatMap(h=>{let d=e.eyeColors?.[h];return [...d?.outer?n(d.outer,qe):[],...d?.inner?n(d.inner,qe):[]]}),s=[...n(o,qe),...n(e.eyeColor??o,qe),...n(e.dotColor??o,qe),...i],a=n(e.bgColor,Pe),c=la(e.halo,e)?.color;c&&a.push({color:c,picture:false});let u=(a.length>0?a:[{color:"#ffffff",picture:false}]).map(h=>{let d=tf(h.color);return {color:d?r4(d,t4):t4,picture:h.picture}}),l=s.flatMap(h=>{let d=tf(h.color);return d?[{color:d,picture:h.picture}]:[]}),f=Number.POSITIVE_INFINITY,p=Aa,m=false;for(let h of l)for(let d of u){let g=K5(r4(h.color,d.color)),_=K5(d.color),b=l4(g,_),y=d.picture?e4.background:h.picture?e4.code:Aa;b/y<f/p&&(f=b,p=y),g>_&&(m=true);}return {ratio:Number.isFinite(f)?f:Number.POSITIVE_INFINITY,required:p,inverted:m}}function BP(e,t){let{ratio:r,inverted:n,required:o}=DP(e,{imageTones:t});if(!Number.isFinite(r))return {checks:[],penalty:0,fails:false};let i=o/Aa,s=o!==Aa,a=Math.round(r*10)/10,c=[],u=0;return r>=o?c.push({id:"contrast",passed:true,message:`Contrast ${a}:1 between code and background`}):(u=r<J5*i?60:r<zP*i?30:10,c.push({id:"contrast",passed:false,message:s?`Low contrast for a picture (${a}:1); ${o}:1 or more scans reliably`:`Low contrast (${a}:1); 4.5:1 or more scans reliably`,fix:s?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),n?(u+=10,c.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"})):c.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:c,penalty:u,fails:r<J5*(o/Aa)}}function eb(e){return Re.QrCode.encodeText(e.value,Ze[Je(e)]).getModules()}function ZP(e){let{imageSettings:t}=e;if(!t)return {check:null,penalty:0};let r=eb(e),n=Xr(r,e.size??ye,Ke(r.length,e.margin??Me,e.shape),t);if(!n)return {check:null,penalty:0};let o=n.excavation??n,i=r.length,a=[[0,0],[i-8,0],[0,i-8]].some(([h,d])=>o.x<h+9&&o.x+o.w>h&&o.y<d+9&&o.y+o.h>d),c=i>21?i-9:null,u=c!==null&&o.x<c+5&&o.x+o.w>c&&o.y<c+5&&o.y+o.h>c;if(a||u)return {check:{id:"logo",passed:false,message:a?"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 l=o.w*o.h/(i*i),f=Je(e),p=Math.round(l*100),m=xl({value:e.value,size:e.size??ye,margin:e.margin??Me,level:f,shape:e.shape},t);return !m||m.worst<=m.budget?{check:{id:"logo",passed:true,message:`Logo covers ${p}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${p}% of the code and spoils ${m.worst} codewords in one block, which repairs ${m.correctable}`,fix:m.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:m.worst>m.correctable?25:10}}function UP(e){let t=ua(e.shape)?jn(e.margin??Me):e.margin??Me,r=eb(e).length+2*t,n=t+(xt(e.frame)?L1(e.frame)*r:0),o=Math.round(n*10)/10;return n>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${o} modules`},penalty:0}:n>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${o} 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 GP(e){let t=Y1(e);return t?t.reason==="adjusted"?{check:{id:"halo",passed:true,message:t.message},penalty:0}:{check:{id:"halo",passed:false,message:t.message,fix:t.fix},penalty:15}:{check:null,penalty:0}}function QP(e){let t=H1(e);return t==="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}:t==="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 ${t} eyes`},penalty:0}}function va(e){return new Promise((t,r)=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=()=>r(new Error("Could not load image")),n.src=e;})}var jP=`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 VP(e){let{imageSettings:t}=e;if(!t||t.src.startsWith("data:"))return e;let r=jP;try{let n=await va(t.src),{canvas:o,ctx:i}=ki(n.naturalWidth||256,n.naturalHeight||256);i.drawImage(n,0,0,o.width,o.height),r=o.toDataURL("image/png");}catch{}return {...e,imageSettings:{...t,src:r}}}async function HP(e){let t=new Map;for(let o of u4(e))if(!o.startsWith("data:"))try{let i=await va(o),{canvas:s,ctx:a}=ki(i.naturalWidth||256,i.naturalHeight||256);a.drawImage(i,0,0,s.width,s.height),t.set(o,s.toDataURL("image/png")),s.remove();}catch{t.set(o,null);}if(t.size===0)return e;let r=o=>{if(typeof o!="object"||o?.type!=="image")return o;let i=t.get(o.src);return i===void 0?o:i?{...o,src:i}:o.underlay??qe},n=e.eyeColors?Object.fromEntries(Object.entries(e.eyeColors).map(([o,i])=>[o,i&&{outer:r(i.outer),inner:r(i.inner)}])):void 0;return {...e,bgColor:r(e.bgColor),fgColor:r(e.fgColor),eyeColor:r(e.eyeColor),dotColor:r(e.dotColor),...n&&{eyeColors:n}}}async function tb(e,t,r,n,o){let i=[],s=0,a=BP(e,o);s+=a.penalty;let c=ZP(e);s+=c.penalty;let u=UP(e);s+=u.penalty;let l=QP(e);s+=l.penalty;let f=GP(e);s+=f.penalty;let p=W1(e),m=p?.kind==="eye"?null:p;m&&m.kind!=="sharp-dot-eye"&&(s+=10);let h=await K_();rn(n);let d=eb(e).length,g=d+2*Ke(d,e.margin??Me,e.shape),_=[],b=false;for(let[C,w]of r.entries()){await o4(),rn(n);let $=J_(h,t,w,g,E=>Y_(E,e.value));s+=s4(C,r.length,$),_.push(a4(w,r,$)),C===r.length-1&&$==="fail"&&(b=true);}i.push(..._,...a.checks),c.check&&i.push(c.check),i.push(l.check,u.check),f.check&&i.push(f.check),m&&i.push({id:"style-pair",passed:false,message:m.message,fix:m.fix});let y=b||a.fails,S=Math.max(0,Math.min(100,100-s));return y&&(S=Math.min(S,30)),{score:S,grade:c4(S,y),checks:i}}function f4(e){return [...e.sizes??n4].filter(t=>t>0).sort((t,r)=>t-r)}async function Tz(e,t={}){rf();let{draw:r,sizes:n,imageTones:o}=await m4(e,t);return await tb(e,r,n,t.signal,o)}async function Oz(e,t={}){rf();let{draw:r,sizes:n,imageTones:o}=await m4(e,t),i=n.flatMap(s=>i4(s).map(a=>{let{data:c,width:u,height:l}=r(a);return {codeWidth:a,width:u,height:l,data:c}}));return {sizes:n,frames:i,imageTones:o}}async function Lz(e,t,r={}){let n=new Map(t.frames.map(i=>[i.codeWidth,i]));return await tb(e,i=>{let s=n.get(i);if(!s||s.data.length<s.width*s.height*4)throw new Error(`No scan frame with the code ${i} px wide: draw the frames with drawScanFrames for these props and sizes`);return {data:new Uint8ClampedArray(s.data),width:s.width,height:s.height,colorSpace:"srgb"}},t.sizes,r.signal,t.imageTones)}async function m4(e,t){let{signal:r}=t,n=f4(t),o=X_/W_(e),i=await HP(await VP(Jr({...e,size:e.size??ye},o)));rn(r);let s={};for(let f of u4(e))try{let p=await FP(f);p&&(s[f]=p);}catch{}rn(r);let a=await Ut(i),c=await va(a);rn(r);let u=yr(o,e.frame);return {draw:f=>{let p=f/X_,m=u.width*p,h=u.height*p,d=Math.max(8,Math.round(f*.12)),{canvas:g,ctx:_}=ki(m+2*d,h+2*d);_.fillStyle="#ffffff",_.fillRect(0,0,g.width,g.height),_.drawImage(c,d,d,m,h);let b=_.getImageData(0,0,g.width,g.height);return g.remove(),b},sizes:n,imageTones:s}}var Nz=X_;async function Fz(e,t,r={}){let{width:n,height:o}=t;if(!(n>0&&o>0)||t.data.length<n*o*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=f4(r),s=e.size??ye,a=yr(s,e.frame),c=n*s*W_(e)/a.width,u={data:WP(t),width:n,height:o},l=p4(u.data);return await tb(e,p=>{let m=d4(u,p/c,l),h=Math.max(8,Math.round(p*.12));return qP(m,h)},i,r.signal)}function WP(e){let{data:t,width:r,height:n}=e,o=new Uint8ClampedArray(r*n*4);for(let i=0;i<r*n*4;i+=4){let s=t[i+3]/255;for(let a=0;a<3;a++)o[i+a]=t[i+a]*s+255*(1-s);o[i+3]=255;}return o}function qP(e,t){let r=e.width+2*t,n=e.height+2*t,o=new Uint8ClampedArray(r*n*4).fill(255);for(let i=0;i<e.height;i++)o.set(e.data.subarray(i*e.width*4,(i+1)*e.width*4),((i+t)*r+t)*4);return {data:o,width:r,height:n,colorSpace:"srgb"}}var tn=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function ef(e,t){return .299*e[t]+.587*e[t+1]+.114*e[t+2]}function XP(e,t){let r=0;for(let a=0;a<256;a++)r+=a*e[a];let n=0,o=0,i=0,s=128;for(let a=0;a<256;a++){if(o+=e[a],o===0)continue;let c=t-o;if(c===0)break;n+=a*e[a];let u=n/o,l=(r-n)/c,f=o*c*(u-l)**2;f>i&&(i=f,s=a);}return s}async function YP(e){if(!(e instanceof Blob))return e.complete||await new Promise(r=>{e.addEventListener("load",r,{once:true}),e.addEventListener("error",r,{once:true});}),e;let t=URL.createObjectURL(e);try{let r=await va(t);return await r.decode?.().catch(()=>{}),r}finally{setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function zz(e,t={}){rf();let{signal:r}=t,n=[...t.sizes??n4].filter(H=>H>0).sort((H,le)=>H-le),o=await K_(),i=await YP(e);rn(r);let s=i.naturalWidth||i.width,a=i.naturalHeight||i.height;if(!(s&&a))throw new Error("Could not read this image");let c=Math.min(1,1600/Math.max(s,a)),{canvas:u,ctx:l}=ki(s*c,a*c);l.fillStyle="#ffffff",l.fillRect(0,0,u.width,u.height),l.drawImage(i,0,0,u.width,u.height);let f=l.getImageData(0,0,u.width,u.height),p=o(f.data,f.width,f.height);if(rn(r),!p){let H=await y$(i,0,false);return u.remove(),typeof H!="string"||H==="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:H,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:m,version:h}=p,d=17+4*h,g=(tn(m.topLeftCorner,m.topRightCorner)+tn(m.bottomLeftCorner,m.bottomRightCorner)+tn(m.topLeftCorner,m.bottomLeftCorner)+tn(m.topRightCorner,m.bottomRightCorner))/4,_=g/d,b=[m.topLeftCorner,m.topRightCorner,m.bottomRightCorner,m.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(...b.map(H=>H.x)))),S=Math.min(f.width,Math.ceil(Math.max(...b.map(H=>H.x)))),C=Math.max(0,Math.floor(Math.min(...b.map(H=>H.y)))),w=Math.min(f.height,Math.ceil(Math.max(...b.map(H=>H.y)))),$=[],E=0,R=new Array(256).fill(0),P=0;for(let H=C;H<w;H++)for(let le=y;le<S;le++){let q=Math.round(ef(f.data,(H*f.width+le)*4));R[q]=R[q]+1,P++;}let I=XP(R,P),T={dark:[0,0,0,0],light:[0,0,0,0]};for(let H=C;H<w;H++)for(let le=y;le<S;le++){let q=(H*f.width+le)*4,Le=ef(f.data,q)<=I?T.dark:T.light;Le[0]=Le[0]+f.data[q],Le[1]=Le[1]+f.data[q+1],Le[2]=Le[2]+f.data[q+2],Le[3]=Le[3]+1;}let O=H=>{let le=Math.max(H[3],1);return Ci(H[0]/le,H[1]/le,H[2]/le)},B=O(T.dark),z=O(T.light),F=l4(B,z),te=Math.round(F*10)/10;F>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${te}:1 in the image`}):(E+=F<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${te}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let Q=[m.topLeftFinderPattern,m.topRightFinderPattern,m.bottomLeftFinderPattern].map(H=>{let le=Math.min(f.width-1,Math.max(0,Math.round(H.x))),q=Math.min(f.height-1,Math.max(0,Math.round(H.y)));return ef(f.data,(q*f.width+le)*4)}).filter(H=>H>I).length>=2;Q?(E+=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 X=Math.max(2,Math.round(_*2)),ae={minX:y-X,maxX:S+X,minY:C-X,maxY:w+X};if(ae.minX<0||ae.minY<0||ae.maxX>f.width||ae.maxY>f.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let H=0,le=0;for(let q=ae.minY;q<ae.maxY;q++)for(let Le=ae.minX;Le<ae.maxX;Le++){if(Le>=y&&Le<S&&q>=C&&q<w)continue;let Ae=ef(f.data,(q*f.width+Le)*4);(Q?Ae>I:Ae<=I)&&H++,le++;}H/Math.max(le,1)>.12?(E+=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"});}_<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(_*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(_)} px per module`});let Ce=Math.round(_*4),U=Math.max(0,y-Ce),V=Math.max(0,C-Ce),ue=Math.min(f.width,S+Ce)-U,et=Math.min(f.height,w+Ce)-V,Ee=H=>{let le=H/g,q=ki(ue*le,et*le);q.ctx.drawImage(u,U,V,ue,et,0,0,q.canvas.width,q.canvas.height);let Le=q.ctx.getImageData(0,0,q.canvas.width,q.canvas.height);return q.canvas.remove(),Le},Qt=[],or=false;for(let[H,le]of n.entries()){await o4(),rn(r);let q=J_(o,Ee,le,d,Le=>Le?.data===p.data);E+=s4(H,n.length,q),Qt.push(a4(le,n,q)),H===n.length-1&&q==="fail"&&(or=true);}u.remove();let nn=Math.max(0,Math.min(100,100-E));return or&&(nn=Math.min(nn,30)),{data:p.data,version:h,score:nn,grade:c4(nn,or),checks:[...Qt,...$]}}var KP=[320];function p4(e){for(let t=0;t<e.length;t+=4)if(e[t]!==e[t+1]||e[t]!==e[t+2])return false;return true}function d4(e,t,r=false){let n=Math.min(1,t),o=Math.max(1,Math.round(e.width*n)),i=Math.max(1,Math.round(e.height*n)),s=new Uint8ClampedArray(o*i*4),a=e.width/o,c=e.height/i,{data:u}=e;for(let l=0;l<i;l++){let f=Math.floor(l*c),p=Math.max(f+1,Math.min(e.height,Math.floor((l+1)*c)));for(let m=0;m<o;m++){let h=Math.floor(m*a),d=Math.max(h+1,Math.min(e.width,Math.floor((m+1)*a))),g=(p-f)*(d-h),_=(l*o+m)*4,b=0;if(r){for(let C=f;C<p;C++)for(let w=h;w<d;w++)b+=u[(C*e.width+w)*4];s[_]=b/g,s[_+1]=s[_],s[_+2]=s[_],s[_+3]=255;continue}let y=0,S=0;for(let C=f;C<p;C++)for(let w=h;w<d;w++){let $=(C*e.width+w)*4;b+=u[$],y+=u[$+1],S+=u[$+2];}s[_]=b/g,s[_+1]=y/g,s[_+2]=S/g,s[_+3]=255;}}return {data:s,width:o,height:i,colorSpace:"srgb"}}function JP(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(e.binaryData))}catch{return e.data}}async function Dz(e,t,r={}){let{width:n,height:o}=e;if(!(n>0&&o>0)||e.data.length<n*o*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=await K_(),s={data:e.data instanceof Uint8ClampedArray?e.data:Uint8ClampedArray.from(e.data),width:n,height:o},a=i(s.data,n,o,{inversionAttempts:"dontInvert"});if(!a)return {data:null,version:null,passed:false};let c=JP(a),{version:u,location:l}=a;if(!Y_(a,t))return {data:c,version:u,passed:false};let f=17+4*u,p=(tn(l.topLeftCorner,l.topRightCorner)+tn(l.bottomLeftCorner,l.bottomRightCorner)+tn(l.topLeftCorner,l.bottomLeftCorner)+tn(l.topRightCorner,l.bottomRightCorner))/4,m=p4(s.data);for(let h of r.sizes??KP)if(J_(i,g=>d4(s,g/p,m),h,f,g=>Y_(g,t))!=="pass")return {data:c,version:u,passed:false};return {data:c,version:u,passed:true}}var ek=16,h4=.01;function tk(e){let t=new Float64Array(256);for(let c of e)t[Math.min(255,Math.max(0,Math.round(c*255)))]++;let r=e.length,n=0;for(let c=0;c<256;c++)n+=c*t[c];let o=0,i=0,s=0,a=128;for(let c=0;c<256;c++){if(i+=t[c],i===0)continue;let u=r-i;if(u===0)break;o+=c*t[c];let l=o/i,f=(n-o)/u,p=i*u*(l-f)**2;p>s&&(s=p,a=c);}return (a+.5)/255}function rk(e,t){let{width:r,height:n,data:o}=e,i=r*n,s=new Uint8Array(i),a=0;for(let m=0;m<i;m++)o[m*4+3]<128&&a++;if(t==="alpha"||t==="auto"&&a>i*.02&&a<i*.98){for(let m=0;m<i;m++)s[m]=o[m*4+3]>=128?1:0;return s}let u=new Float32Array(i);for(let m=0;m<i;m++){let h=o[m*4+3]/255,d=.2126*o[m*4]+.7152*o[m*4+1]+.0722*o[m*4+2];u[m]=1-(d*h+255*(1-h))/255;}let l=tk(u);for(let m=0;m<i;m++)s[m]=u[m]>l?1:0;let f=0,p=0;for(let m=0;m<r;m++)for(let h of [0,n-1])f++,p+=s[h*r+m];for(let m=1;m<n-1;m++)for(let h of [0,r-1])f++,p+=s[m*r+h];if(p>f/2)for(let m=0;m<i;m++)s[m]=s[m]?0:1;return s}function g4(e,t,r,n){for(let o of [1,0]){let i=new Uint8Array(e.length);for(let s=0;s<e.length;s++){if(i[s]||e[s]!==o)continue;let a=[s];i[s]=1;let c=false;for(let l of a){let f=l%t,p=(l-f)/t;(f===0||p===0||f===t-1||p===r-1)&&(c=true);for(let[m,h]of [[f-1,p],[f+1,p],[f,p-1],[f,p+1]]){if(m<0||h<0||m>=t||h>=r)continue;let d=h*t+m;!i[d]&&e[d]===o&&(i[d]=1,a.push(d));}}if((o===1||!c)&&a.length<n)for(let l of a)e[l]=o?0:1;}}}function _4(e,t={}){let{width:r,height:n,data:o}=e;if(!(r>0&&n>0)||o.length<r*n*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=rk(e,t.mode??"auto"),s=i.reduce(($,E)=>$+E,0);g4(i,r,n,Math.max(16,s*h4));let a=r,c=n,u=-1,l=-1;for(let $=0;$<n;$++)for(let E=0;E<r;E++)i[$*r+E]&&(a=Math.min(a,E),c=Math.min(c,$),u=Math.max(u,E),l=Math.max(l,$));if(u<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let f=u-a+1,p=l-c+1;if(Math.max(f,p)<ek)throw new Error("The shape is too small to trace; use a bigger picture");let h=Math.min(Math.max(Math.round(t.cells??At),Nt),At)/Math.max(f,p),d=Math.max(Nt,Math.round(f*h)),g=Math.max(Nt,Math.round(p*h)),_=Math.max(1,Math.round(f*h)),b=Math.max(1,Math.round(p*h)),y=Math.floor((d-_)/2),S=Math.floor((g-b)/2),C=new Uint8Array(d*g);for(let $=0;$<b;$++){let E=c+Math.floor($*p/b),R=Math.max(E+1,c+Math.floor(($+1)*p/b));for(let P=0;P<_;P++){let I=a+Math.floor(P*f/_),T=Math.max(I+1,a+Math.floor((P+1)*f/_)),O=0;for(let B=E;B<R;B++)for(let z=I;z<T;z++)O+=i[B*r+z];C[($+S)*d+P+y]=O*2>=(R-E)*(T-I)?1:0;}}let w=C.reduce(($,E)=>$+E,0);if(g4(C,d,g,Math.max(4,w*h4)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:d,height:g,cells:Array.from(C,$=>$?"1":"0").join("")}}var rb=512;async function nk(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(r=>{e.addEventListener("load",r,{once:true}),e.addEventListener("error",r,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((r,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>r(o),o.onerror=()=>n(new Error("Could not load the picture")),o.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function ok(e,t={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let r=await nk(e),n=r.naturalWidth||r.width||rb,o=r.naturalHeight||r.height||rb,i=rb/Math.max(n,o),s=Math.max(1,Math.round(n*i)),a=Math.max(1,Math.round(o*i)),c=document.createElement("canvas");c.width=s,c.height=a;let u=c.getContext("2d",{willReadFrequently:true});if(!u)throw new Error("Could not get a canvas context");u.drawImage(r,0,0,s,a);let l;try{l=u.getImageData(0,0,s,a);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{c.remove();}return _4(l,t)}var b4=(e,t)=>{let r=t??e.size??ye;return {width:r,height:r}};function LD(e,t){let r=typeof e=="string"?document.querySelector(e):e;if(!r)throw new Error(`qrdx: no element matches ${String(e)}`);let n={...t},o=null,i="",s=false,a=()=>{let c=Ei(n),u=nr(c);if(o&&u===i)return;let l=xa(c,r.ownerDocument).firstChild;o?.parentNode===r?o.replaceWith(l):r.appendChild(l),o=l,i=u;};return a(),{get svg(){return o},get options(){return n},update(c){if(s)throw new Error("qrdx: this QR code was destroyed");n={...n,...c},a();},toSVGString(){return i||nr(Ei(n))},toDataURL(c="png",u={}){return O5(n,c,b4(n,u.size),{quality:u.quality})},download(c={}){return T5(n,{format:c.format??"png",size:b4(n,c.size),filename:c.filename,quality:c.quality})},destroy(){s||(s=true,o?.remove(),o=null);}}}/**
85
+ end`;function N_(e){let t="(";for(let r of e){let n=r.codePointAt(0)??63;r==="("||r===")"||r==="\\"?t+=`\\${r}`:r==="\u2026"?t+="...":n>=32&&n<127?t+=r:n>=160&&n<=255?t+=`\\${n.toString(8).padStart(3,"0")}`:t+="?";}return `${t})`}var F_=class extends Ei{out=[];shadingNames=new Map;cmyk;images;usesLevel3=false;constructor(t,r,n,o){super(r,n),this.cmyk=t,this.images=o;}color(t){if(this.cmyk){let[r,n,o,i]=Qr(t.r,t.g,t.b);return `${x(r)} ${x(n)} ${x(o)} ${x(i)} cmyk`}return `${x(t.r/255)} ${x(t.g/255)} ${x(t.b/255)} rg`}tracePath(t,r){let n=["n"],o=false;for(let i of t)if(i.op==="M"||i.op==="L"&&!o){let[s,a]=ne(r,i.x,i.y);n.push(`${x(s)} ${x(a)} m`),o=true;}else if(i.op==="L"){let[s,a]=ne(r,i.x,i.y);n.push(`${x(s)} ${x(a)} l`);}else if(i.op==="C"){if(!o)continue;let[s,a]=ne(r,i.x1,i.y1),[c,u]=ne(r,i.x2,i.y2),[l,f]=ne(r,i.x,i.y);n.push(`${x(s)} ${x(a)} ${x(c)} ${x(u)} ${x(l)} ${x(f)} c`);}else o&&n.push("h");return n.join(" ")}beginClip(t,r,n){return this.out.push(`gsave ${this.tracePath(t,r)} ${n?"eoclip":"clip"} n`),true}endClip(){this.out.push("grestore");}rect(t,r,n,o,i){this.out.push(`${this.color(t)} n ${x(r)} ${x(n)} m ${x(r+o)} ${x(n)} l ${x(r+o)} ${x(n+i)} l ${x(r)} ${x(n+i)} l h f`);}shade(t,r,n){let o=Ee(r.matrix,n.matrix);if(!Yr(o))return;let i=Gl(n,this.cmyk?"cmyk":"rgb"),s=this.shadingNames.get(i);s||(s=`Sh${this.shadingNames.size}`,this.shadingNames.set(i,s)),this.usesLevel3=true;let a=r.fillRule==="evenodd"?"eoclip":"clip";this.out.push(`gsave ${this.tracePath(t,r.matrix)} ${a} n [${Ul(o)}] concat ${s} shfill grestore`);}paint(t,r,n){if(t.length===0)return;let o=n.opacity??1;if(o<=0)return;let i=this.resolveFill(n.fill,t,n.viewport,(n.fillOpacity??1)*o);i&&"pattern"in i?this.paintPattern(t,n,i.pattern,i.alpha):i&&"gradient"in i&&this.shade(t,n,{...i.gradient,stops:i.gradient.stops.map(f=>({...f,color:this.flatten({...f.color,a:f.color.a*i.alpha})}))});let s=i&&"color"in i?this.flatten(i.color):null,a=n.strokeWidth>0?this.resolveColor(n.stroke):null,c=a&&this.flatten({...a,a:a.a*o});if(!(s||c))return;let u=this.tracePath(t,n.matrix),l=n.fillRule==="evenodd"?"ef":"f";if(s&&c?this.out.push(`gsave ${this.color(s)} ${u} ${l} grestore`):s&&this.out.push(`${this.color(s)} ${u} ${l}`),c){let f=`${this.color(c)} ${x(n.strokeWidth*bo(n.matrix))} w ${u} s`,{join:p,cap:m}=jl(n);this.out.push(p||m?`gsave ${p} setlinejoin ${m} setlinecap ${f} grestore`:f);}}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=bo(r.matrix),[s,a]=ne(r.matrix,se(t.attrs.x,r.viewport[0]),se(t.attrs.y,r.viewport[1])),u=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",l=x(r.fontSize*i),f=Number.parseFloat(t.attrs["data-max-width"]??""),p=f>0?` dup stringwidth pop dup ${x(f*i)} gt {${x(f*i)} exch div ${l} mul ${u} findfont exch scalefont setfont} {pop} ifelse`:"",m=r.textAnchor==="middle"?" dup stringwidth pop 2 div neg 0 rmoveto":r.textAnchor==="end"?" dup stringwidth pop neg 0 rmoveto":"",h=Math.atan2(r.matrix[1],r.matrix[0])*180/Math.PI;if(Math.abs(h)>.01){this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${x(s)} ${x(a)} translate ${x(h)} rotate ${N_(n)}${p} 0 0 moveto${m} show grestore`);return}this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${N_(n)}${p} ${x(s)} ${x(a)} moveto${m} show grestore`);}image(t,r){let n=t.attrs.href??t.attrs["xlink:href"],o=n?this.images.get(n):void 0;if(!o)return;let i=se(t.attrs.x,r.viewport[0]),s=se(t.attrs.y,r.viewport[1]),a=se(t.attrs.width,r.viewport[0]),c=se(t.attrs.height,r.viewport[1]);if(a<=0||c<=0)return;let[u,l]=ne(r.matrix,i,s),[f,p]=ne(r.matrix,i+a,s+c),{components:m}=o,h=m===1?"/DeviceGray":m===4?"/DeviceCMYK":"/DeviceRGB",d=Array.from({length:m},()=>"0 1").join(" "),g="/ASCII85Decode filter";o.kind==="jpeg"?(g+=" /DCTDecode filter",o.progressive&&(this.usesLevel3=true)):o.compressed&&(g+=" /FlateDecode filter",this.usesLevel3=true),this.out.push(["gsave",`${x(Math.min(u,f))} ${x(Math.min(l,p))} translate ${x(Math.abs(f-u))} ${x(Math.abs(p-l))} scale`,`${h} setcolorspace`,`<< /ImageType 1 /Width ${o.width} /Height ${o.height} /BitsPerComponent 8 /Decode [${d}] /ImageMatrix [${o.width} 0 0 -${o.height} 0 ${o.height}] /DataSource currentfile ${g} >> image`,VR(o.bytes),"grestore"].join(`
86
+ `));}};async function v5(e,t={}){let r=Er(e);if(!r)throw new Error("Could not read the SVG to convert to EPS");let n=se(r.attrs.width,0,0)||512,o=se(r.attrs.height,0,0)||n,i=t.width??n;if(!(Number.isFinite(i)&&i>0))throw new Error("EPS width must be a positive number of points");let s=i/n,a=o*s,c=Math.max(0,t.bleed??0),u=i+2*c,l=a+2*c,f=t.colorMode==="cmyk",p=new Map;for(let b of Sa(r,new Set)){let y=await jR(b,f);y&&p.set(b,y);}let m=new F_(f,wa(r,new Map),Zl(r),p);Xl(m,{bgColor:t.background??"#ffffff"});let d={matrix:Ee([1,0,0,-1,c,l-c],[s,0,0,s,0,0]),viewport:[n,o],fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start"},g=c>0?t.bleedColor??void 0:void 0;if(!(g&&m.paintBleed(r,d,g,[0,0,u,l]))){let b=g?m.resolveColor(g):null;b&&m.rect(b,0,0,u,l);}m.walk(r,d,true);let _=(t.title??"QR code").replace(/[^\x20-\x7e]/g,"?");return ["%!PS-Adobe-3.0 EPSF-3.0",`%%BoundingBox: 0 0 ${Math.ceil(u)} ${Math.ceil(l)}`,`%%HiResBoundingBox: 0 0 ${x(u)} ${x(l)}`,`%%Title: ${N_(_)}`,"%%Creator: qrdx",`%%LanguageLevel: ${m.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",HR,"%%EndProlog","qrdxdict begin",...Array.from(m.shadingNames,([b,y])=>`/${y} ${b} def`),"gsave",...m.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
87
+ `)}var A5="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 E5(e){return [e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Object.values(e.eyeColors??{}).flatMap(r=>[r?.outer,r?.inner])].some(r=>typeof r=="object"&&r?.type==="image")}async function Jl(e,t={}){if(E5(e))throw new Error(A5);let r=Kl(e,{size:t.sizeMm??ZR,unit:"mm",bleed:t.bleedMm}),n=await Ca(e);return await v5(n,{width:r.trimWidth*C5,bleed:r.bleed*C5,bleedColor:r.bleed>0?ql(e,n):k_(e),colorMode:t.colorMode,background:Fe(e.bgColor,Pe)})}function ef(e){return `data:application/postscript;base64,${btoa(e)}`}async function WR(e,t={}){let r=await Jl(e,t);Ct(ef(r),t.filename??"qr-code-print.eps");}var z_={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:_a,extension:"gif",vector:false},ico:{mimeType:qn,extension:"ico",vector:false,sizes:Fl},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}},NF={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 D_(e,t){return e<50||t<50?{isValid:false,error:"Size must be at least 50x50 pixels"}:e>5e3||t>5e3?{isValid:false,error:"Size must not exceed 5000x5000 pixels"}:e!==t?{isValid:false,error:"Width and height must be equal for QR codes"}:{isValid:true}}function Kr(e,t){let{imageSettings:r,size:n}=e;if(!(r&&n)||n===t)return {...e,size:t};let o=t/n;return {...e,size:t,imageSettings:{...r,width:r.width*o,height:r.height*o,...r.x!=null&&{x:r.x*o},...r.y!=null&&{y:r.y*o},...r.padding!=null&&{padding:r.padding*o}}}}function Ct(e,t){let r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r);}var R5=e=>(z_[e]??z_.png).mimeType;function qR(e,t,r){let{extension:n,vector:o,sizes:i}=z_[e];if(o||i)return `qr-code.${n}`;let{width:s,height:a}=br(t.width,r);return `qr-code-${Math.round(s)}x${Math.round(a)}.${n}`}async function P5(e,t={}){let r=await Sr(e,"image/webp",true);try{return await Bl(r,t)}finally{r.remove();}}async function k5(e){let t=await Sr(e,"image/png",true);try{return tl(t)}finally{t.remove();}}async function I5(e){let t=await Sr(e,"image/png",true);try{return await Nl(t,e.value)}finally{t.remove();}}async function M5(e,t=Fl){let r=[];try{for(let n of t)r.push(await Sr(Kr({...e,frame:void 0},n),"image/png",!0));return x_(r)}finally{for(let n of r)n.remove();}}var XR=25.4/72;async function T5(e){let t=await Jl(e,{sizeMm:(e.size??$e)*XR});return ef(t)}async function O5(e){let t;try{({jsPDF:t}=await import('jspdf'));}catch(p){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${p})`)}let r=await Ut(e),n=decodeURIComponent(r.replace("data:image/svg+xml,","")),o;try{let p=new TextEncoder().encode(n),m=Array.from(p,d=>String.fromCharCode(d)).join("");o=`data:image/svg+xml;base64,${btoa(m)}`;}catch(p){throw new Error(`Failed to encode SVG for PDF conversion: ${p}`)}let{width:i,height:s}=br(e.size||$e,e.frame),a=await new Promise((p,m)=>{let h=new Image,d=document.createElement("canvas");d.width=Math.round(i),d.height=Math.round(s);let g=d.getContext("2d");if(!g){m(new Error("Could not get canvas context"));return}let _=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(_);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(b){clearTimeout(_),d.remove(),m(new Error(`Failed to draw image to canvas: ${b}`));}},h.onerror=()=>{clearTimeout(_),d.remove(),m(new Error("Could not load SVG for PDF conversion"));},h.src=o;}),c=a.toDataURL("image/png",1),u=i*.264583,l=s*.264583,f=new t({orientation:u>l?"landscape":"portrait",unit:"mm",format:[u,l]});return f.addImage(c,"PNG",0,0,u,l),a.remove(),f.output("dataurlstring")}async function L5(e,t){let{format:r,size:n,filename:o,quality:i}=t,s=D_(n.width,n.height);if(!s.isValid)throw new Error(s.error);let a=Kr(e,n.width),c=o||qR(r,n,e.frame);try{if(r==="svg"){let u=await Ut(a);Ct(u,c);}else if(r==="pdf"){let u=await O5(a);Ct(u,c);}else if(r==="eps")Ct(await T5(a),c);else if(r==="webp"){let u=await P5(a,{quality:i});Ct(await xt(u),c);}else if(r==="bmp"){let u=await k5(a);Ct(await xt(u),c);}else if(r==="gif"){let u=await I5(a);Ct(await xt(u),c);}else if(r==="ico"){let u=await M5(a);Ct(await xt(u),c);}else {let u=R5(r),l=await Sr(a,u);if(typeof l=="string")Ct(l,c);else throw new Error("Failed to generate image data URL")}}catch(u){throw console.error(`Error downloading ${r.toUpperCase()}:`,u),u}}async function N5(e,t,r,n={}){let o=D_(r.width,r.height);if(!o.isValid)throw new Error(o.error);let i=Kr(e,r.width);if(t==="svg")return await Ut(i);if(t==="pdf")return await O5(i);if(t==="eps")return await T5(i);if(t==="webp")return await xt(await P5(i,n));if(t==="bmp")return await xt(await k5(i));if(t==="gif")return await xt(await I5(i));if(t==="ico")return await xt(await M5(i));let s=R5(t),a=await Sr(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}async function FF(e,t={width:$e,height:$e}){try{let r=D_(t.width,t.height);if(!r.isValid)throw new Error(r.error);let n=Kr(e,t.width),o=Sr(n,"image/png",!0).then(i=>new Promise((s,a)=>{let c=i;c.toBlob(u=>{c.remove(),u?s(u):a(new Error("Failed to create blob from canvas"));},"image/png");}));await navigator.clipboard.write([new ClipboardItem({"image/png":o})]);}catch(r){throw console.error("Error copying to clipboard:",r),r}}async function zF(e){let t=await Ut(e);return decodeURIComponent(t.replace("data:image/svg+xml,",""))}var $t={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},Se=class extends Error{},YR={script:e=>`Removed ${De(e,"script")}`,style:e=>`Removed ${De(e,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":e=>`Removed ${De(e,"foreignObject element")}`,image:e=>`Removed ${De(e,"image")}: frames are vector shapes only`,use:e=>`Removed ${De(e,"<use> reference")}: ungroup or detach symbols before exporting`,text:e=>`Removed ${De(e,"text element")}: add text as labels in the frame editor`,effects:e=>`Removed ${De(e,"filter, mask, clip path or pattern")}`,animation:e=>`Removed ${De(e,"animation")}`,unknown:e=>`Removed ${De(e,"unsupported element")}`,"nested-svg":e=>`Removed ${De(e,"nested <svg>")}: flatten it first`,handlers:e=>`Removed ${De(e,"event handler attribute")}`,links:e=>`Removed ${De(e,"link")} (href)`,"external-paint":e=>`Removed ${De(e,"fill or stroke")} that referenced something outside the file`,gradient:e=>`Flattened ${De(e,"gradient")} to its first color: add gradients in the frame editor`,opacity:e=>`Made ${De(e,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":e=>`${De(e,"color")} couldn't be read and fell back to the parent color`,stroke:e=>`Removed ${De(e,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:e=>`Drew ${De(e,"dashed stroke")} as solid`,clipped:e=>`Cut ${De(e,"shape")} at the edge of the artboard`,outside:e=>`Removed ${De(e,"shape")} outside the artboard`,colors:e=>`Merged ${De(e,"color")} with similar ones (${$t.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 De(e,t){return `${e} ${t}${e===1?"":"s"}`}var G_=class{counts=new Map;add(t,r=1){this.counts.set(t,(this.counts.get(t)??0)+r);}list(){return [...this.counts].map(([t,r])=>({code:t,count:r,message:YR[t](r)}))}},KR=/^\s*<\?xml\s[^?>]*\?>/,B_=/[A-Za-z_][\w:.-]*/y,Z_=/<\/([A-Za-z_][\w:.-]*)\s*>/y,tf=/\s*/y,JR=/[A-Za-z_:][\w:.-]*/y,eP=/[^"<]*/y,tP=/[^'<]*/y;function Ri(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function F5(e,t){let r=Ri(tf,e,t),n=Ri(JR,e,r);if(r===t||n===r)return -1;let o=Ri(tf,e,n);if(e[o]!=="=")return -1;let i=Ri(tf,e,o+1),s=e[i];if(s!=='"'&&s!=="'")return -1;let c=Ri(s==='"'?eP:tP,e,i+1);return e[c]===s?c+1:-1}function rP(e,t){let r=Ri(tf,e,t);return e[r]===">"?{end:r+1,selfClosing:false}:e.startsWith("/>",r)?{end:r+2,selfClosing:true}:null}function nP(e){let t=[],r=0,n="",o=0;for(;o<e.length;){let i=e.indexOf("<",o);if(i<0)break;if(o=i,e.startsWith("<!--",o)){let u=e.indexOf("-->",o+4);if(u<0)throw new Se("The SVG has an unclosed comment");o=u+3;continue}if(e.startsWith("<![CDATA[",o)){let u=e.indexOf("]]>",o+9);if(u<0)throw new Se("The SVG has an unclosed CDATA section");o=u+3;continue}if(e.startsWith("<?",o)){let u=e.indexOf("?>",o+2);if(u<0)throw new Se("The SVG has an unclosed declaration");o=u+2;continue}if(e.startsWith("<!",o))throw new Se("DOCTYPE and other declarations are not allowed");if(e[o+1]==="/"){Z_.lastIndex=o;let u=Z_.exec(e);if(!u)throw new Se("The SVG has a malformed closing tag");if(t.pop()!==u[1])throw new Se(`The SVG closes <${u[1]}> out of order`);o=Z_.lastIndex;continue}B_.lastIndex=o+1;let s=B_.exec(e);if(!s)throw new Se("The SVG has a malformed tag");let a=B_.lastIndex;for(let u=F5(e,a);u>=0;u=F5(e,a))a=u;let c=rP(e,a);if(!c)throw new Se(`The SVG has a malformed <${s[0]}> tag (attributes must be quoted and may not contain "<")`);if(r++,r>$t.maxElements)throw new Se(`The SVG has more than ${$t.maxElements} elements`);if(n||(n=s[0]),!c.selfClosing&&(t.push(s[0]),t.length>$t.maxDepth))throw new Se(`The SVG nests elements more than ${$t.maxDepth} deep`);o=c.end;}if(t.length>0)throw new Se(`The SVG doesn't close <${t.at(-1)}>`);return n}function oP(e){if(typeof e!="string")throw new Se("Expected SVG markup as a string");let t=new TextEncoder().encode(e).length;if(t>$t.maxBytes)throw new Se(`The SVG is ${Math.ceil(t/1e3)} KB; the limit is ${$t.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(e))throw new Se("DOCTYPE and entity declarations are not allowed");let r=e.replace(KR,"");if(r.includes("<?"))throw new Se("Processing instructions (such as xml-stylesheet) are not allowed");if(nP(r)!=="svg")throw new Se("The file must start with an <svg> element");return r}var U_=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function Gt(e){let t=e?.replace(/!important/i,"").trim();return t===""||t==="inherit"?void 0:t}function Q_(e,t,r,n){let o=e.trim();if(o==="none"||o==="transparent")return null;if(/^url\(/i.test(o)){let s=/^url\(\s*['"]?#([^)'"\s]+)['"]?\s*\)/i.exec(o)?.[1],a=s?r.get(s):void 0;return a?(n.add("gradient"),Q_(a,t,r,n)):(n.add("external-paint"),null)}let i=ve(o==="currentColor"?t.color:o);return i?i.a<=0?null:`#${U_(i.r)}${U_(i.g)}${U_(i.b)}`:(n.add("invalid-paint"),null)}function iP(e){let t=new Map,r=o=>{(o.name==="linearGradient"||o.name==="radialGradient")&&o.attrs.id&&t.set(o.attrs.id,o);for(let i of o.children)r(i);};r(e);let n=new Map;for(let[o,i]of t){let s=i.children.find(c=>c.name==="stop");if(!s){let c=(i.attrs.href??i.attrs["xlink:href"])?.match(/^#(.+)$/)?.[1];s=c?t.get(c)?.children.find(u=>u.name==="stop"):void 0;}let a=s&&Gt(ae(s,"stop-color"));a&&n.set(o,a);}return n}function z5(e,t){return e.map(r=>{if(r.op==="Z")return r;if(r.op==="C"){let[i,s]=ne(t,r.x1,r.y1),[a,c]=ne(t,r.x2,r.y2),[u,l]=ne(t,r.x,r.y);return {op:"C",x1:i,y1:s,x2:a,y2:c,x:u,y:l}}let[n,o]=ne(t,r.x,r.y);return {op:r.op,x:n,y:o}})}function sP(e){let t=0;return e.forEach(([r,n],o)=>{let[i,s]=e[(o+1)%e.length];t+=r*s-i*n;}),t/2}function V_(e){return e.length<3?[]:[...e.map(([t,r],n)=>({op:n===0?"M":"L",x:t,y:r})),{op:"Z"}]}var Jr=e=>Number.isFinite(e);function Ie(e,t,r=0){let n=Number.parseFloat(e.attrs[t]??"");return Jr(n)?n:r}function D5(e){switch(e.name){case "path":return cr(e.attrs.d??"");case "rect":{let t=e.attrs.rx??e.attrs.ry,r=e.attrs.ry??e.attrs.rx;return qt(Ie(e,"x"),Ie(e,"y"),Ie(e,"width"),Ie(e,"height"),Number.parseFloat(t??"0")||0,Number.parseFloat(r??"0")||0)}case "circle":{let t=Ie(e,"r");return Wt(Ie(e,"cx"),Ie(e,"cy"),t,t)}case "ellipse":return Wt(Ie(e,"cx"),Ie(e,"cy"),Ie(e,"rx"),Ie(e,"ry"));case "polygon":case "polyline":{let t=Ht(e.attrs.points),r=[];for(let n=0;n+1<t.length;n+=2)r.push([t[n],t[n+1]]);return V_(r)}default:return []}}function aP(e,t){let r=t/2;switch(e.name){case "rect":{let n=Ie(e,"x"),o=Ie(e,"y"),i=Ie(e,"width"),s=Ie(e,"height"),a=Number.parseFloat(e.attrs.rx??e.attrs.ry??"0")||0,c=qt(n-r,o-r,i+t,s+t,a>0?a+r:0,a>0?a+r:0);if(i<=t||s<=t)return c;let u=Math.max(a-r,0);return [...c,...qt(n+r,o+r,i-t,s-t,u,u)]}case "circle":case "ellipse":{let n=Ie(e,"cx"),o=Ie(e,"cy"),i=e.name==="circle"?Ie(e,"r"):Ie(e,"rx"),s=e.name==="circle"?Ie(e,"r"):Ie(e,"ry"),a=Wt(n,o,i+r,s+r);return i<=r||s<=r?a:[...a,...Wt(n,o,i-r,s-r)]}case "line":{let[n,o,i,s]=["x1","y1","x2","y2"].map(f=>Ie(e,f)),a=Math.hypot(i-n,s-o);if(a===0)return [];let c=-(s-o)/a*r,u=(i-n)/a*r,l=[[n+c,o+u],[i+c,s+u],[i-c,s-u],[n-c,o-u]];return V_(sP(l)<0?l.reverse():l)}default:return null}}var cP=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),uP=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),lP={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"},fP=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function Z5(e,t){for(let r of Object.keys(e.attrs)){let n=r.toLowerCase();n.startsWith("on")?t.add("handlers"):n==="href"||n==="xlink:href"?e.name!=="linearGradient"&&e.name!=="radialGradient"&&t.add("links"):(n==="filter"||n==="mask"||n==="clip-path")&&t.add("effects");}}function U5(e,t,r,n,o){if(Z5(e,n),Gt(ae(e,"display"))==="none"||Gt(ae(e,"visibility"))==="hidden")return;let i=Number.parseFloat(ae(e,"opacity")??"1"),s=Gt(ae(e,"fill-rule")),a=Number.parseFloat(Gt(ae(e,"stroke-width"))??""),c={matrix:Ee(t.matrix,Et(e.attrs.transform)),fill:Gt(ae(e,"fill"))??t.fill,fillRule:s==="evenodd"||s==="nonzero"?s:t.fillRule,stroke:Gt(ae(e,"stroke"))??t.stroke,strokeWidth:Jr(a)&&a>=0?a:t.strokeWidth,color:Gt(ae(e,"color"))??t.color,opacity:t.opacity*(Jr(i)?i:1)};for(let u of e.children){if(uP.has(u.name))continue;let l=lP[u.name];if(l){n.add(l);continue}if(u.name==="svg"){n.add("nested-svg");continue}if(u.name==="g"||u.name==="a"){U5(u,c,r,n,o);continue}if(!cP.has(u.name)){n.add("unknown");continue}mP(u,c,r,n,o);}}function mP(e,t,r,n,o){if(Z5(e,n),Gt(ae(e,"display"))==="none"||Gt(ae(e,"visibility"))==="hidden")return;let i=Ee(t.matrix,Et(e.attrs.transform));if(e.name==="rect"&&fP.test(e.attrs.id??"")&&!o.qrBox){o.qrBox=fn(z5(D5(e),i));return}let s=g=>Gt(ae(e,g)),a=t.opacity*Number.parseFloat(s("opacity")??"1"),c=Number.parseFloat(s("fill-opacity")??"1"),u=Number.parseFloat(s("stroke-opacity")??"1"),l=s("fill-rule"),f={...t,fill:s("fill")??t.fill,fillRule:l==="evenodd"||l==="nonzero"?l:t.fillRule,stroke:s("stroke")??t.stroke,color:s("color")??t.color},p=Number.parseFloat(s("stroke-width")??""),m=Jr(p)&&p>=0?p:t.strokeWidth,h=(g,_,b)=>{if(g.length!==0){if(o.segments+=g.length,o.segments>$t.maxInputSegments)throw new Se(`The SVG has more than ${$t.maxInputSegments} path segments; simplify it`);o.shapes.push({segments:z5(g,i),fill:_,fillRule:b});}},d=g=>{let _=(Jr(a)?a:1)*(Jr(g)?g:1);return _<=0?false:(_<1&&n.add("opacity"),true)};if(e.name!=="line"){let g=Q_(f.fill,f,r,n);g&&d(c)&&h(D5(e),g,f.fillRule);}if(m>0&&f.stroke!=="none"){let g=Q_(f.stroke,f,r,n);if(g&&d(u)){let _=aP(e,m);_?((s("stroke-dasharray")??"none")!=="none"&&n.add("dash"),h(_,g,e.name==="line"?"nonzero":"evenodd")):n.add("stroke");}}}function pP(e,t){let r=u=>{let l=10**t;return Math.round(u*l)/l+0},n=u=>x(u,t),o="",i=0,s=0,a=0,c=0;for(let u of e){if(u.op==="Z"){o+="z",i=a,s=c;continue}let l=r(u.x),f=r(u.y);if(u.op==="M")o+=`m${n(l-i)} ${n(f-s)}`,a=l,c=f;else if(u.op==="L"){if(l===i&&f===s)continue;o+=f===s?`h${n(l-i)}`:l===i?`v${n(f-s)}`:`l${n(l-i)} ${n(f-s)}`;}else o+=`c${n(r(u.x1)-i)} ${n(r(u.y1)-s)} ${n(r(u.x2)-i)} ${n(r(u.y2)-s)} ${n(l-i)} ${n(f-s)}`;i=l,s=f;}return o}var dP=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function hP(e){let t=[];for(let r of e){let n=fn(r.segments);if(!n)continue;let o=t.at(-1);o&&o.shape.fill===r.fill&&o.shape.fillRule===r.fillRule&&!o.boxes.some(i=>dP(i,n))?(o.shape={...o.shape,segments:[...o.shape.segments,...r.segments]},o.boxes.push(n)):t.push({shape:r,boxes:[n]});}return t.map(r=>r.shape)}var j_=e=>[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)];function gP(e,t,r){let n=new Map;for(let s of e)n.set(s.fill,(n.get(s.fill)??0)+1);let o=new Map([...n.keys()].map(s=>[s,s])),i=0;for(;n.size>t;){let s=[...n.keys()],a=[s[0],s[1]],c=Number.POSITIVE_INFINITY;for(let m=0;m<s.length;m++)for(let h=m+1;h<s.length;h++){let d=j_(s[m]),g=j_(s[h]),_=Math.hypot(d[0]-g[0],d[1]-g[1],d[2]-g[2]);_<c&&(c=_,a=[s[m],s[h]]);}let[u,l]=a,[f,p]=(n.get(u)??0)>=(n.get(l)??0)?[u,l]:[l,u];n.set(f,(n.get(f)??0)+(n.get(p)??0)),n.delete(p);for(let[m,h]of o)h===p&&o.set(m,f);i++;}return i>0&&r.add("colors",i),o}var B5=e=>{let[t,r,n]=j_(e);return .2126*t+.7152*r+.0722*n>235};function _P(e,t={}){let r=new G_;try{let n=oP(e),o=Er(n);if(!o)throw new Se("No <svg> element found");let i=Ht(o.attrs.viewBox),[s,a,c,u]=[0,0,0,0];if(i.length===4&&i[2]>0&&i[3]>0?[s,a,c,u]=i:(c=Ie(o,"width"),u=Ie(o,"height")),!(Jr(c)&&Jr(u)&&c>0&&u>0))throw new Se("The SVG needs a viewBox (or a width and height)");let f=$t.artboardSide/Math.max(c,u),p=Math.round(c*f*10)/10,m=Math.round(u*f*10)/10;if(Math.min(p,m)<J.minArtboard)throw new Se("The artboard is too narrow: its sides may differ by 20 times at most");let h=[f,0,0,f,-s*f,-a*f],d={shapes:[],qrBox:null,segments:0};U5(o,{matrix:h,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},iP(o),r,d);let g={x0:0,y0:0,x1:p,y1:m},_=Math.max(p,m)*.004,b=[],y=0,S=0;for(let Z of d.shapes){let X=fn(Z.segments);if(!X||X.x1<=0||X.y1<=0||X.x0>=p||X.y0>=m){y++;continue}if(X.x0<-_||X.y0<-_||X.x1>p+_||X.y1>m+_){let ye=Na(Z.segments,.25).map(Ce=>ho(Ce,g)).filter(Ce=>Ce.length>2);if(ye.length===0){y++;continue}S++,b.push({...Z,segments:ye.flatMap(Ce=>V_(Ce))});}else b.push(Z);}if(y>0&&r.add("outside",y),S>0&&r.add("clipped",S),b.length===0)throw new Se("The SVG has no filled shapes to use");let C=gP(b,$t.maxColors,r);for(let Z of b)Z.fill=C.get(Z.fill)??Z.fill;let w=new Map,$=new Map;for(let Z of b){let X=fn(Z.segments);w.set(Z.fill,(w.get(Z.fill)??0)+(X.x1-X.x0)*(X.y1-X.y0)),$.set(Z.fill,($.get(Z.fill)??0)+1);}let v=[...w.keys()].sort((Z,X)=>Number(B5(Z))-Number(B5(X))||w.get(X)-w.get(Z)),R=v[0],P=v[1],I=Z=>Z===R?"frame":Z===P?"accent":Z,T=d.qrBox;if(!T&&t.qr){let[Z,X]=ne(h,t.qr.x,t.qr.y);T={x0:Z,y0:X,x1:Z+t.qr.size*f,y1:X+t.qr.size*f};}let O,D,B;T?(O=Math.min(T.x1-T.x0,T.y1-T.y0),D=(T.x0+T.x1-O)/2,B=(T.y0+T.y1-O)/2):(r.add("qr-placed"),O=Math.min(p,m)*.6,D=(p-O)/2,B=(m-O)/2);let N=Z=>Math.round(Z*10)/10+0;if(O=Math.floor(O*10)/10,D=N(D),B=N(B),O<Math.min(p,m)*J.minQrShare)throw new Se("The QR area must be at least half the frame's shorter side");let te=Math.min(D,B,p-D-O,m-B-O);if(te<O*J.minPadding-1e-9)throw new Se("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let W=Math.min(Math.max(t.padding??$t.padding,J.minPadding),.2),re=Math.floor(Math.min(O*W,te)*10)/10,G=hP(b);if(G.length>J.maxShapes)throw new Se(`The artwork has ${G.length} separate shapes; the limit is ${J.maxShapes}. Combine shapes of the same color first`);let ce={kind:mn,version:pn,artboard:{width:p,height:m},qr:{x:D,y:B,size:O,padding:re},colors:{frame:R,...P&&{accent:P}},shapes:G.map(Z=>({type:"path",d:pP(Z.segments,$t.decimals),fill:I(Z.fill),...Z.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},Ne=cl(ce);if(!Ne.success){let Z=Ne.issues[0];throw new Se(`The converted frame doesn't fit the frame format: ${Z?.message??"invalid"}`)}let Re=v.map(Z=>({color:Z,ref:Z===R?"frame":Z===P?"accent":"fixed",shapes:$.get(Z)??0}));return {ok:!0,spec:Ne.data,warnings:r.list(),palette:Re}}catch(n){return {ok:false,error:n instanceof Se?n.message:`Could not read the SVG (${n instanceof Error?n.name:"error"})`,warnings:r.list()}}}var bP=1114,yP={"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 xP=[{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 H_(e){return Array.isArray(e)?`[${e.map(H_).join(",")}]`:e&&typeof e=="object"?`{${Object.keys(e).filter(r=>e[r]!==void 0).sort().map(r=>`${JSON.stringify(r)}:${H_(e[r])}`).join(",")}}`:JSON.stringify(e)}function $P(e){let t=H_(e),r=2166136261;for(let n=0;n<t.length;n++)r^=t.charCodeAt(n),r=Math.imul(r,16777619)>>>0;return r.toString(16).padStart(8,"0")}function wP(e,t,r){return Ke(e,t??jt,r).size}function G5(e,t,r,n=r.size*(t?.size??Tf)){let o={src:e,width:n,height:n,excavate:true,...t?.shape&&t.shape!=="square"&&{shape:t.shape},...t?.plate&&{plate:t.plate}},i=t?.x!==void 0||t?.y!==void 0;if(!(t?.padding||i))return o;let s=wP(r.value,r.level,r.exactLevel),a=Ye(s,r.margin,r.shape),c=r.size/(s+2*a);if(t.padding&&(o.padding=t.padding*c),i){let u=s*c,l=f=>Math.min(Math.max((f??.5)*u-n/2,0),u-n);o.x=l(t.x),o.y=l(t.y);}return o}function Q5(e,t,r,n){let o=r.level??jt,i=o;n&&(i=Je({...r,imageSettings:G5(e,t,r),autoLevel:n}));let s=c=>{let u=f=>G5(e,t,{...r,level:c},f),l=U1(r,[c],u().width,u);return l>0?u(l):void 0};if(i===o)return s(o);let a=s(i);return a&&Je({...r,imageSettings:a,autoLevel:n})===i?a:s(o)}function SP({value:e,level:t,margin:r,shape:n,autoLevel:o,exactLevel:i,logoOptions:s}){let c=Q5("data:,",{...s,size:Ti},{value:`${e}`,size:1024,margin:r??Me,level:t,shape:n,exactLevel:i},o);return c?c.width/1024:0}function W_({value:e,size:t=1024,fgColor:r,bgColor:n,eyeColor:o,dotColor:i,bodyPattern:s,hideLogo:a,logo:c,logoOptions:u,margin:l,cornerEyePattern:f,cornerEyeDotPattern:p,level:m,templateId:h,frame:d,eyeColors:g,moduleScale:_,autoLevel:b,exactLevel:y,shape:S,eyeShapes:C,eyeGradient:w,bgRadius:$,backdrop:v,halo:R,shadow:P}){let I={value:`${e}`,size:t,margin:l??Me,level:m,shape:S,exactLevel:y},T=!a&&c?Q5(c,u,I,b):void 0;return {value:I.value,bgColor:n,fgColor:r,eyeColor:o,dotColor:i,bodyPattern:s,cornerEyePattern:f,cornerEyeDotPattern:p,level:m,templateId:h,size:t,margin:l,...d&&{frame:d},...g&&{eyeColors:g},..._!==void 0&&{moduleScale:_},...b&&{autoLevel:b},...y&&{exactLevel:y},...S&&S!=="square"&&{shape:S},...C&&{eyeShapes:C},...w&&w!=="corner"&&{eyeGradient:w},...$&&{bgRadius:$},...v&&{backdrop:v},...R&&{halo:R},...P&&{shadow:P},...T&&{imageSettings:T}}}var j5=.06,V5=.16,H5=512;function W5(e){let{width:t,height:r}=e;if(!(t>0&&r>0)||e.data.length<t*r*4)return null;let n=Uint8Array.from(e.data),o=Kg({width:t,height:r,data:n});if(!o)return null;let i=m=>{let h=m*4;return Math.hypot(n[h]/255-o[0],n[h+1]/255-o[1],n[h+2]/255-o[2])},s=new Uint8Array(t*r),a=new Int32Array(t*r),c=0,u=0,l=m=>{s[m]||n[m*4+3]===0||i(m)>=V5||(s[m]=1,a[u++]=m);};for(let m=0;m<t;m++)l(m),l((r-1)*t+m);for(let m=0;m<r;m++)l(m*t),l(m*t+t-1);for(;c<u;){let m=a[c++],h=m%t;h>0&&l(m-1),h<t-1&&l(m+1),m>=t&&l(m-t),m<(r-1)*t&&l(m+t);}let f=new Uint8ClampedArray(n),p=o;for(let m=0;m<t*r;m++){if(!s[m])continue;let h=Math.min(1,Math.max(0,(i(m)-j5)/(V5-j5))),d=m*4;if(f[d+3]=Math.round(n[d+3]*h),h>0&&h<1)for(let g=0;g<3;g++){let b=(n[d+g]/255-(1-h)*p[g])/h;f[d+g]=Math.round(Math.min(1,Math.max(0,b))*255);}}return {width:t,height:r,data:f}}async function CP(e){if(typeof document>"u"||typeof Image>"u")throw new Error("removeLogoBackground needs a browser (canvas)");let t=await new Promise(a=>{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>a(c),c.onerror=()=>a(null),c.src=e;});if(!t)return null;let r=t.naturalWidth||512,n=t.naturalHeight||512,o=Math.min(1,H5/Math.max(r,n)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(r*o)),i.height=Math.max(1,Math.round(n*o));let s=i.getContext("2d",{willReadFrequently:true});if(!s)return null;try{s.drawImage(t,0,0,i.width,i.height);let a=s.getImageData(0,0,i.width,i.height),c=W5(a);return c?(a.data.set(c.data),s.putImageData(a,0,0),i.toDataURL("image/png")):null}catch{return null}finally{i.remove();}}async function vP(e){let{value:t,size:r=$e,level:n=jt,bgColor:o=Pe,fgColor:i=We,margin:s=Me,imageSettings:a,eyeColor:c,dotColor:u,bodyPattern:l,cornerEyePattern:f,cornerEyeDotPattern:p,isOGContext:m,templateId:h,customTemplate:d,customProps:g,frame:_,art:b,eyeColors:y,moduleScale:S,eyeShapes:C,eyeGradient:w,bgRadius:$,backdrop:v,halo:R,shadow:P,frameLabelMarkers:I,partMarkers:T,autoLevel:O,exactLevel:D,...B}=e,N=bi({value:t,size:r,margin:s,level:n,autoLevel:O,exactLevel:D},a),te=Je({value:t,size:r,level:n,margin:s,imageSettings:N,autoLevel:O,exactLevel:D}),W=Ke(t,te,D).getModules(),re=W.length+s*2,G=qr(W,r,s,N),ce=null;if(N!=null&&G!=null){G.excavation!=null&&(W=f_(W,G.excavation));let Re=N.src.startsWith("data:")?N.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(N.src)}&w=100&h=100&encoding=base64`).then(Z=>{if(!Z.ok)throw new Error(`Failed to load QR logo (${Z.status}): ${N.src}`);return Z.text()});ce={settings:{...N,src:Re},box:{x:G.x+s,y:G.y+s,w:G.w,h:G.h}};}let Ne=TS(W,s);return {size:r,numCells:re,fgPath:Ne,bgColor:o,fgColor:i,frame:_,svgProps:B,logo:ce}}function AP(e){let{size:t,numCells:r,fgPath:n,bgColor:o,fgColor:i,frame:s,svgProps:a,logo:c}=e,u=yt(s),l=c?$l(c.settings,c.box):k(It,{}),f=Be("svg",{height:t,viewBox:`0 0 ${r} ${r}`,width:t,xmlns:"http://www.w3.org/2000/svg",...u?{}:a,children:[k("path",{d:`M0,0 h${r}v${r}H0z`,fill:Fe(o,Pe),shapeRendering:"crispEdges"}),k("path",{d:n,fill:Fe(i,We),shapeRendering:"crispEdges"}),l]});return u&&s?ca(f,{size:t,frame:s,bgColor:o,svgProps:a}):f}async function EP(e){return AP(await vP(e))}var RP={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,exactLevel: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 PP(e){let t={};for(let r of Object.keys(e))Object.hasOwn(RP,r)||(t[r]=e[r]);return t}var kP=["value","fgColor","hideLogo","bgColor","eyeColor","dotColor","bodyPattern","cornerEyePattern","cornerEyeDotPattern","level","templateId","logo","logoOptions","margin","autoLevel","exactLevel","shape","eyeShapes","eyeGradient","bgRadius","backdrop","halo","shadow"];function q5(e){let t=Object.fromEntries(kP.map(r=>[r,e[r]]));return W_({...t,margin:e.margin??Me})}function X5(e,t){let{size:r=$e,scale:n=1,level:o,style:i,customTemplate:s,customProps:a,frame:c,art:u,eyeColors:l,moduleScale:f,autoLevel:p,exactLevel:m,shape:h,frameLabelMarkers:d,partMarkers:g}=e,_={...t.eyeShapes&&{eyeShapes:t.eyeShapes},...t.eyeGradient&&{eyeGradient:t.eyeGradient},...t.bgRadius&&{bgRadius:t.bgRadius},...t.backdrop&&{backdrop:t.backdrop},...t.halo&&{halo:t.halo},...t.shadow&&{shadow:t.shadow}},b=r*n,y=b/t.size,S=t.imageSettings&&{...t.imageSettings,height:t.imageSettings.height*y,width:t.imageSettings.width*y,...t.imageSettings.x!=null&&{x:t.imageSettings.x*y},...t.imageSettings.y!=null&&{y:t.imageSettings.y*y},...t.imageSettings.padding!=null&&{padding:t.imageSettings.padding*y}};return {art:u,bgColor:t.bgColor,bodyPattern:t.bodyPattern,cornerEyeDotPattern:t.cornerEyeDotPattern,cornerEyePattern:t.cornerEyePattern,customProps:a,customTemplate:s,dotColor:t.dotColor,eyeColor:t.eyeColor,fgColor:t.fgColor,frame:c,level:o||t.level,margin:t.margin,...l&&{eyeColors:l},...f!==void 0&&{moduleScale:f},...p&&{autoLevel:p},...m&&{exactLevel:m},...h&&h!=="square"&&{shape:h},..._,...d&&{frameLabelMarkers:d},...g&&{partMarkers:g},size:b,style:i,templateId:t.templateId,value:t.value,...S&&{imageSettings:S},...PP(e)}}function IP(e){return X5(e,q5(e))}function Y5(e,t){let r=[],n=o=>{if(o==null||typeof o=="boolean")return;if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"){r.push(`${o}`);return}if(Array.isArray(o)){for(let u of o)n(u);return}if(!Ln(o))throw new TypeError("qrdx: can't render this value");let{type:i,props:s,key:a}=o;if(si(i)){n(s.children);return}if(typeof i=="function"){n(i(s));return}let c={};for(let u of Object.keys(s)){let l=Ai(u,s[u]);l&&(c[l.name]=l.value);}r.push(t(i,c,Y5(s.children,t),a));};return n(e),r}var Pi=300,va=e=>{let t=typeof e=="number"?e:Number.parseFloat(String(e));return Number.isFinite(t)?t:void 0};function MP(e){let t=va(e.x)??0,r=va(e.y)??0,n=Ht(typeof e.viewBox=="string"?e.viewBox:void 0),o=va(e.width),i=va(e.height);if(n.length!==4||!(n[2]&&n[3]&&o&&i))return [1,0,0,1,t,r];let[s,a,c,u]=n,l=Math.min(o/c,i/u);return [l,0,0,l,t+(o-c*l)/2-s*l,r+(i-u*l)/2-a*l]}function q_(e,t,r,n){if(e===t)return r;if(Array.isArray(e)){for(let a of e){let c=q_(a,t,r,false);if(c)return c}return null}let o=e;if(!o||typeof o!="object"||!o.props)return null;let{props:i}=o,s=Ee(r,Et(typeof i.transform=="string"?i.transform:void 0));return o.type==="svg"&&!n&&(s=Ee(s,MP(i))),q_(i.children,t,s,false)}function X_(e){let t=e.customTemplate||(e.templateId?Rl(e.templateId):void 0);if(!t)return 1;let r={type:"svg",props:{height:Pi,viewBox:`0 0 ${Pi} ${Pi}`,width:Pi},key:null},n;try{n=t.wrapper(r,{fgColor:typeof e.fgColor=="string"?e.fgColor:void 0,bgColor:typeof e.bgColor=="string"?e.bgColor:void 0,...e.customProps??{}},{pixelSize:10,url:e.value});}catch{return 1}let o=n?.props;if(!o)return 1;let i=Ht(typeof o.viewBox=="string"?o.viewBox:void 0),s=i.length===4?i[2]:va(o.width),a=q_(n,r,_o,true);if(!(a&&s))return 1;let[c,u]=ne(a,0,0),[l,f]=ne(a,Pi,Pi),m=Math.min(Math.abs(l-c),Math.abs(f-u))/s;return m>0&&m<=1?m:1}var i4=[96,160,320],K_=640;function of(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function tn(e){if(e?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var s4=()=>new Promise(e=>setTimeout(e,0));async function eb(){let{default:e}=await import('jsqr');return e}function J_(e,t){if(!e)return false;if(e.data===t)return true;try{return new TextDecoder().decode(Uint8Array.from(e.binaryData))===t}catch{return false}}function TP(e,t,r=.7){let{data:n,width:o,height:i}=e,s=o*i,a=Math.max(1,Math.round(t*.25)),c=OP(n,s);if(c){for(let l=0;l<s;l++)c[l]=128+(c[l]-128)*r;K5(c,o,i,a);for(let l=0,f=0;l<s;l++,f+=4){let p=c[l];n[f]=p,n[f+1]=p,n[f+2]=p;}return}let u=new Uint8ClampedArray(s);for(let l=0;l<3;l++){for(let f=0,p=l;f<s;f++,p+=4)u[f]=128+(n[p]-128)*r;K5(u,o,i,a);for(let f=0,p=l;f<s;f++,p+=4)n[p]=u[f];}}function OP(e,t){let r=new Uint8ClampedArray(t);for(let n=0,o=0;n<t;n++,o+=4){let i=e[o];if(i!==e[o+1]||i!==e[o+2])return null;r[n]=i;}return r}function K5(e,t,r,n){let o=2*n+1,i=new Float32Array(t*r),s=a=>{let c=a?r:t,u=a?t:r,l=a?t:1,f=a?1:t;for(let p=0;p<c;p++){let m=p*l,h=0;for(let d=-n;d<=n;d++)h+=e[m+Math.min(Math.max(d,0),u-1)*f];for(let d=0;d<u;d++)i[m+d*f]=h/o,h=h-e[m+Math.max(d-n,0)*f]+e[m+Math.min(d+n+1,u-1)*f];}e.set(i);};for(let a=0;a<2;a++)s(true),s(false);}function ki(e,t){let r=document.createElement("canvas");r.width=Math.max(1,Math.round(e)),r.height=Math.max(1,Math.round(t));let n=r.getContext("2d",{willReadFrequently:true});if(!n)throw new Error("Could not get canvas context");return n.imageSmoothingEnabled=true,n.imageSmoothingQuality="high",{canvas:r,ctx:n}}var LP=[.9,1,1.1];function a4(e){return LP.map(t=>e*t)}function tb(e,t,r,n,o){let i=0;for(let s of a4(r)){let a=t(s);if(TP(a,s/n),o(e(a.data,a.width,a.height))&&(i++,i>=2))break}return i>=2?"pass":i===1?"fragile":"fail"}var Y_={small:"small print or far away",medium:"typical phone distance",large:"close up"};function NP(e,t){return e===t[0]&&t.length>1?Y_.small:e===t.at(-1)?Y_.large:Y_.medium}function c4(e,t,r){if(r==="pass")return 0;let n=t===1?[45]:t===2?[20,45]:[15,20,45],o=n[Math.round(e*(n.length-1)/Math.max(t-1,1))]??20;return r==="fragile"?Math.round(o/2):o}function u4(e,t,r){let n=`${e} px (${NP(e,t)})`;return r==="pass"?{id:`decode-${e}`,passed:true,message:`Reads at ${n}, with camera blur`}:{id:`decode-${e}`,passed:false,message:r==="fragile"?`Reads at ${n} only some of the time`:`Doesn't read at ${n}`,fix:e===t[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 l4(e,t){return t?"fails":e>=85?"great":e>=65?"ok":"risky"}function FP(e,t,r){let n=ot(e,t);if(n.type==="solid")return [n.color];if(n.type!=="image")return n.stops.map(a=>a.color);let o=n.underlay?nf(n.underlay):null,i=r?.[n.src];if(!i)return n.underlay?[n.underlay]:[];let s=n.opacity??1;return [i.light,i.dark].flatMap(a=>{let c=nf(a);if(!c)return [];let u={...c,a:c.a*s};if(!o)return [J5(u)];let l=u.a+o.a*(1-u.a),f=(p,m)=>l>0?(p*u.a+m*o.a*(1-u.a))/l:0;return [J5({r:f(u.r,o.r),g:f(u.g,o.g),b:f(u.b,o.b),a:l})]})}var J5=({r:e,g:t,b:r,a:n})=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(r)}, ${Math.round(n*1e3)/1e3})`;function zP(e){let t=[],r=e.width*e.height;for(let i=0;i<r;i++){let s=e.data[i*4],a=e.data[i*4+1],c=e.data[i*4+2];e.data[i*4+3]<128||t.push({lum:Ci(s,a,c),r:s,g:a,b:c});}if(t.length===0)return null;t.sort((i,s)=>i.lum-s.lum);let n=Math.max(1,Math.round(t.length/10)),o=i=>{let s=i.reduce((c,u)=>({r:c.r+u.r,g:c.g+u.g,b:c.b+u.b}),{r:0,g:0,b:0}),a=c=>Math.round(c/i.length).toString(16).padStart(2,"0");return `#${a(s.r)}${a(s.g)}${a(s.b)}`};return {dark:o(t.slice(0,n)),light:o(t.slice(-n))}}async function DP(e){of();let t=await Ra(e),{canvas:r,ctx:n}=ki(64,64);n.drawImage(t,0,0,64,64);let o=zP(n.getImageData(0,0,64,64));return r.remove(),o}function f4(e){let t=[e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...un.flatMap(n=>[e.eyeColors?.[n]?.outer,e.eyeColors?.[n]?.inner])],r=new Set;for(let n of t)typeof n=="object"&&n?.type==="image"&&r.add(n.src);return [...r]}var Aa=null;function nf(e){let t=ve(e);if(t||typeof document>"u")return t;if(Aa??=document.createElement("canvas").getContext("2d"),!Aa)return null;Aa.fillStyle="#010203",Aa.fillStyle=e;let r=String(Aa.fillStyle);return r==="#010203"?null:ve(r)}var e4=e=>Ci(e.r,e.g,e.b),m4=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),Ea=4.5,BP=3,t4=1.5,r4={code:7,background:12},n4={r:255,g:255,b:255,a:1},o4=(e,t)=>({r:e.r*e.a+t.r*(1-e.a),g:e.g*e.a+t.g*(1-e.a),b:e.b*e.a+t.b*(1-e.a),a:1});function ZP(e,t={}){let r=t.imageTones,n=(h,d)=>{let g=typeof h=="object"&&h?.type==="image";return FP(h,d,r).map(_=>({color:_,picture:g}))},o=e.fgColor??We,i=un.flatMap(h=>{let d=e.eyeColors?.[h];return [...d?.outer?n(d.outer,We):[],...d?.inner?n(d.inner,We):[]]}),s=[...n(o,We),...n(e.eyeColor??o,We),...n(e.dotColor??o,We),...i],a=n(e.bgColor,Pe),c=fa(e.halo,e)?.color;c&&a.push({color:c,picture:false});let u=(a.length>0?a:[{color:"#ffffff",picture:false}]).map(h=>{let d=nf(h.color);return {color:d?o4(d,n4):n4,picture:h.picture}}),l=s.flatMap(h=>{let d=nf(h.color);return d?[{color:d,picture:h.picture}]:[]}),f=Number.POSITIVE_INFINITY,p=Ea,m=false;for(let h of l)for(let d of u){let g=e4(o4(h.color,d.color)),_=e4(d.color),b=m4(g,_),y=d.picture?r4.background:h.picture?r4.code:Ea;b/y<f/p&&(f=b,p=y),g>_&&(m=true);}return {ratio:Number.isFinite(f)?f:Number.POSITIVE_INFINITY,required:p,inverted:m}}function UP(e,t){let{ratio:r,inverted:n,required:o}=ZP(e,{imageTones:t});if(!Number.isFinite(r))return {checks:[],penalty:0,fails:false};let i=o/Ea,s=o!==Ea,a=Math.round(r*10)/10,c=[],u=0;return r>=o?c.push({id:"contrast",passed:true,message:`Contrast ${a}:1 between code and background`}):(u=r<t4*i?60:r<BP*i?30:10,c.push({id:"contrast",passed:false,message:s?`Low contrast for a picture (${a}:1); ${o}:1 or more scans reliably`:`Low contrast (${a}:1); 4.5:1 or more scans reliably`,fix:s?"Lower the picture's opacity over a darker underlay (dots) or a lighter one (background)":"Use a darker code color or a lighter background"})),n?(u+=10,c.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"})):c.push({id:"polarity",passed:true,message:"Dark code on a light background"}),{checks:c,penalty:u,fails:r<t4*(o/Ea)}}function rb(e){return Ke(e.value,Je(e),e.exactLevel).getModules()}function GP(e){let{imageSettings:t}=e;if(!t)return {check:null,penalty:0};let r=rb(e),n=qr(r,e.size??$e,Ye(r.length,e.margin??Me,e.shape),t);if(!n)return {check:null,penalty:0};let o=n.excavation??n,i=r.length,a=[[0,0],[i-8,0],[0,i-8]].some(([h,d])=>o.x<h+9&&o.x+o.w>h&&o.y<d+9&&o.y+o.h>d),c=i>21?i-9:null,u=c!==null&&o.x<c+5&&o.x+o.w>c&&o.y<c+5&&o.y+o.h>c;if(a||u)return {check:{id:"logo",passed:false,message:a?"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 l=o.w*o.h/(i*i),f=Je(e),p=Math.round(l*100),m=wl({value:e.value,size:e.size??$e,margin:e.margin??Me,level:f,shape:e.shape,exactLevel:e.exactLevel},t);return !m||m.worst<=m.budget?{check:{id:"logo",passed:true,message:`Logo covers ${p}% of the code; error correction repairs it with room to spare`},penalty:0}:{check:{id:"logo",passed:false,message:`Logo covers ${p}% of the code and spoils ${m.worst} codewords in one block, which repairs ${m.correctable}`,fix:m.level==="H"?"Use a smaller logo":"Switch error correction to H or use a smaller logo"},penalty:m.worst>m.correctable?25:10}}function QP(e){let t=la(e.shape)?jn(e.margin??Me):e.margin??Me,r=rb(e).length+2*t,n=t+(yt(e.frame)?F1(e.frame)*r:0),o=Math.round(n*10)/10;return n>=4?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${o} modules`},penalty:0}:n>=1.5?{check:{id:"quiet-zone",passed:true,message:`Quiet zone of ${o} 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 jP(e){let t=J1(e);return t?t.reason==="adjusted"?{check:{id:"halo",passed:true,message:t.message},penalty:0}:{check:{id:"halo",passed:false,message:t.message,fix:t.fix},penalty:15}:{check:null,penalty:0}}function VP(e){let t=q1(e);return t==="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}:t==="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 ${t} eyes`},penalty:0}}function Ra(e){return new Promise((t,r)=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=()=>r(new Error("Could not load image")),n.src=e;})}var HP=`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 WP(e){let{imageSettings:t}=e;if(!t||t.src.startsWith("data:"))return e;let r=HP;try{let n=await Ra(t.src),{canvas:o,ctx:i}=ki(n.naturalWidth||256,n.naturalHeight||256);i.drawImage(n,0,0,o.width,o.height),r=o.toDataURL("image/png");}catch{}return {...e,imageSettings:{...t,src:r}}}async function qP(e){let t=new Map;for(let o of f4(e))if(!o.startsWith("data:"))try{let i=await Ra(o),{canvas:s,ctx:a}=ki(i.naturalWidth||256,i.naturalHeight||256);a.drawImage(i,0,0,s.width,s.height),t.set(o,s.toDataURL("image/png")),s.remove();}catch{t.set(o,null);}if(t.size===0)return e;let r=o=>{if(typeof o!="object"||o?.type!=="image")return o;let i=t.get(o.src);return i===void 0?o:i?{...o,src:i}:o.underlay??We},n=e.eyeColors?Object.fromEntries(Object.entries(e.eyeColors).map(([o,i])=>[o,i&&{outer:r(i.outer),inner:r(i.inner)}])):void 0;return {...e,bgColor:r(e.bgColor),fgColor:r(e.fgColor),eyeColor:r(e.eyeColor),dotColor:r(e.dotColor),...n&&{eyeColors:n}}}async function nb(e,t,r,n,o){let i=[],s=0,a=UP(e,o);s+=a.penalty;let c=GP(e);s+=c.penalty;let u=QP(e);s+=u.penalty;let l=VP(e);s+=l.penalty;let f=jP(e);s+=f.penalty;let p=X1(e),m=p?.kind==="eye"?null:p;m&&m.kind!=="sharp-dot-eye"&&(s+=10);let h=await eb();tn(n);let d=rb(e).length,g=d+2*Ye(d,e.margin??Me,e.shape),_=[],b=false;for(let[C,w]of r.entries()){await s4(),tn(n);let $=tb(h,t,w,g,v=>J_(v,e.value));s+=c4(C,r.length,$),_.push(u4(w,r,$)),C===r.length-1&&$==="fail"&&(b=true);}i.push(..._,...a.checks),c.check&&i.push(c.check),i.push(l.check,u.check),f.check&&i.push(f.check),m&&i.push({id:"style-pair",passed:false,message:m.message,fix:m.fix});let y=b||a.fails,S=Math.max(0,Math.min(100,100-s));return y&&(S=Math.min(S,30)),{score:S,grade:l4(S,y),checks:i}}function p4(e){return [...e.sizes??i4].filter(t=>t>0).sort((t,r)=>t-r)}async function zz(e,t={}){of();let{draw:r,sizes:n,imageTones:o}=await d4(e,t);return await nb(e,r,n,t.signal,o)}async function Dz(e,t={}){of();let{draw:r,sizes:n,imageTones:o}=await d4(e,t),i=n.flatMap(s=>a4(s).map(a=>{let{data:c,width:u,height:l}=r(a);return {codeWidth:a,width:u,height:l,data:c}}));return {sizes:n,frames:i,imageTones:o}}async function Bz(e,t,r={}){let n=new Map(t.frames.map(i=>[i.codeWidth,i]));return await nb(e,i=>{let s=n.get(i);if(!s||s.data.length<s.width*s.height*4)throw new Error(`No scan frame with the code ${i} px wide: draw the frames with drawScanFrames for these props and sizes`);return {data:new Uint8ClampedArray(s.data),width:s.width,height:s.height,colorSpace:"srgb"}},t.sizes,r.signal,t.imageTones)}async function d4(e,t){let{signal:r}=t,n=p4(t),o=K_/X_(e),i=await qP(await WP(Kr({...e,size:e.size??$e},o)));tn(r);let s={};for(let f of f4(e))try{let p=await DP(f);p&&(s[f]=p);}catch{}tn(r);let a=await Ut(i),c=await Ra(a);tn(r);let u=br(o,e.frame);return {draw:f=>{let p=f/K_,m=u.width*p,h=u.height*p,d=Math.max(8,Math.round(f*.12)),{canvas:g,ctx:_}=ki(m+2*d,h+2*d);_.fillStyle="#ffffff",_.fillRect(0,0,g.width,g.height),_.drawImage(c,d,d,m,h);let b=_.getImageData(0,0,g.width,g.height);return g.remove(),b},sizes:n,imageTones:s}}var Zz=K_;async function Uz(e,t,r={}){let{width:n,height:o}=t;if(!(n>0&&o>0)||t.data.length<n*o*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=p4(r),s=e.size??$e,a=br(s,e.frame),c=n*s*X_(e)/a.width,u={data:XP(t),width:n,height:o},l=h4(u.data);return await nb(e,p=>{let m=g4(u,p/c,l),h=Math.max(8,Math.round(p*.12));return YP(m,h)},i,r.signal)}function XP(e){let{data:t,width:r,height:n}=e,o=new Uint8ClampedArray(r*n*4);for(let i=0;i<r*n*4;i+=4){let s=t[i+3]/255;for(let a=0;a<3;a++)o[i+a]=t[i+a]*s+255*(1-s);o[i+3]=255;}return o}function YP(e,t){let r=e.width+2*t,n=e.height+2*t,o=new Uint8ClampedArray(r*n*4).fill(255);for(let i=0;i<e.height;i++)o.set(e.data.subarray(i*e.width*4,(i+1)*e.width*4),((i+t)*r+t)*4);return {data:o,width:r,height:n,colorSpace:"srgb"}}var en=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function rf(e,t){return .299*e[t]+.587*e[t+1]+.114*e[t+2]}function KP(e,t){let r=0;for(let a=0;a<256;a++)r+=a*e[a];let n=0,o=0,i=0,s=128;for(let a=0;a<256;a++){if(o+=e[a],o===0)continue;let c=t-o;if(c===0)break;n+=a*e[a];let u=n/o,l=(r-n)/c,f=o*c*(u-l)**2;f>i&&(i=f,s=a);}return s}async function JP(e){if(!(e instanceof Blob))return e.complete||await new Promise(r=>{e.addEventListener("load",r,{once:true}),e.addEventListener("error",r,{once:true});}),e;let t=URL.createObjectURL(e);try{let r=await Ra(t);return await r.decode?.().catch(()=>{}),r}finally{setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function Gz(e,t={}){of();let{signal:r}=t,n=[...t.sizes??i4].filter(H=>H>0).sort((H,ge)=>H-ge),o=await eb(),i=await JP(e);tn(r);let s=i.naturalWidth||i.width,a=i.naturalHeight||i.height;if(!(s&&a))throw new Error("Could not read this image");let c=Math.min(1,1600/Math.max(s,a)),{canvas:u,ctx:l}=ki(s*c,a*c);l.fillStyle="#ffffff",l.fillRect(0,0,u.width,u.height),l.drawImage(i,0,0,u.width,u.height);let f=l.getImageData(0,0,u.width,u.height),p=o(f.data,f.width,f.height);if(tn(r),!p){let H=await $$(i,0,false);return u.remove(),typeof H!="string"||H==="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:H,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:m,version:h}=p,d=17+4*h,g=(en(m.topLeftCorner,m.topRightCorner)+en(m.bottomLeftCorner,m.bottomRightCorner)+en(m.topLeftCorner,m.bottomLeftCorner)+en(m.topRightCorner,m.bottomRightCorner))/4,_=g/d,b=[m.topLeftCorner,m.topRightCorner,m.bottomRightCorner,m.bottomLeftCorner],y=Math.max(0,Math.floor(Math.min(...b.map(H=>H.x)))),S=Math.min(f.width,Math.ceil(Math.max(...b.map(H=>H.x)))),C=Math.max(0,Math.floor(Math.min(...b.map(H=>H.y)))),w=Math.min(f.height,Math.ceil(Math.max(...b.map(H=>H.y)))),$=[],v=0,R=new Array(256).fill(0),P=0;for(let H=C;H<w;H++)for(let ge=y;ge<S;ge++){let ie=Math.round(rf(f.data,(H*f.width+ge)*4));R[ie]=R[ie]+1,P++;}let I=KP(R,P),T={dark:[0,0,0,0],light:[0,0,0,0]};for(let H=C;H<w;H++)for(let ge=y;ge<S;ge++){let ie=(H*f.width+ge)*4,oe=rf(f.data,ie)<=I?T.dark:T.light;oe[0]=oe[0]+f.data[ie],oe[1]=oe[1]+f.data[ie+1],oe[2]=oe[2]+f.data[ie+2],oe[3]=oe[3]+1;}let O=H=>{let ge=Math.max(H[3],1);return Ci(H[0]/ge,H[1]/ge,H[2]/ge)},D=O(T.dark),B=O(T.light),N=m4(D,B),te=Math.round(N*10)/10;N>=4.5?$.push({id:"contrast",passed:true,message:`Contrast ${te}:1 in the image`}):(v+=N<2?30:10,$.push({id:"contrast",passed:false,message:`Low contrast in the image (${te}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let re=[m.topLeftFinderPattern,m.topRightFinderPattern,m.bottomLeftFinderPattern].map(H=>{let ge=Math.min(f.width-1,Math.max(0,Math.round(H.x))),ie=Math.min(f.height-1,Math.max(0,Math.round(H.y)));return rf(f.data,(ie*f.width+ge)*4)}).filter(H=>H>I).length>=2;re?(v+=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 G=Math.max(2,Math.round(_*2)),ce={minX:y-G,maxX:S+G,minY:C-G,maxY:w+G};if(ce.minX<0||ce.minY<0||ce.maxX>f.width||ce.maxY>f.height)$.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let H=0,ge=0;for(let ie=ce.minY;ie<ce.maxY;ie++)for(let oe=ce.minX;oe<ce.maxX;oe++){if(oe>=y&&oe<S&&ie>=C&&ie<w)continue;let Ii=rf(f.data,(ie*f.width+oe)*4);(re?Ii>I:Ii<=I)&&H++,ge++;}H/Math.max(ge,1)>.12?(v+=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"});}_<2?$.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(_*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(_)} px per module`});let Re=Math.round(_*4),Z=Math.max(0,y-Re),X=Math.max(0,C-Re),ye=Math.min(f.width,S+Re)-Z,Ce=Math.min(f.height,w+Re)-X,rn=H=>{let ge=H/g,ie=ki(ye*ge,Ce*ge);ie.ctx.drawImage(u,Z,X,ye,Ce,0,0,ie.canvas.width,ie.canvas.height);let oe=ie.ctx.getImageData(0,0,ie.canvas.width,ie.canvas.height);return ie.canvas.remove(),oe},xe=[],nr=false;for(let[H,ge]of n.entries()){await s4(),tn(r);let ie=tb(o,rn,ge,d,oe=>oe?.data===p.data);v+=c4(H,n.length,ie),xe.push(u4(ge,n,ie)),H===n.length-1&&ie==="fail"&&(nr=true);}u.remove();let nn=Math.max(0,Math.min(100,100-v));return nr&&(nn=Math.min(nn,30)),{data:p.data,version:h,score:nn,grade:l4(nn,nr),checks:[...xe,...$]}}var ek=[320];function h4(e){for(let t=0;t<e.length;t+=4)if(e[t]!==e[t+1]||e[t]!==e[t+2])return false;return true}function g4(e,t,r=false){let n=Math.min(1,t),o=Math.max(1,Math.round(e.width*n)),i=Math.max(1,Math.round(e.height*n)),s=new Uint8ClampedArray(o*i*4),a=e.width/o,c=e.height/i,{data:u}=e;for(let l=0;l<i;l++){let f=Math.floor(l*c),p=Math.max(f+1,Math.min(e.height,Math.floor((l+1)*c)));for(let m=0;m<o;m++){let h=Math.floor(m*a),d=Math.max(h+1,Math.min(e.width,Math.floor((m+1)*a))),g=(p-f)*(d-h),_=(l*o+m)*4,b=0;if(r){for(let C=f;C<p;C++)for(let w=h;w<d;w++)b+=u[(C*e.width+w)*4];s[_]=b/g,s[_+1]=s[_],s[_+2]=s[_],s[_+3]=255;continue}let y=0,S=0;for(let C=f;C<p;C++)for(let w=h;w<d;w++){let $=(C*e.width+w)*4;b+=u[$],y+=u[$+1],S+=u[$+2];}s[_]=b/g,s[_+1]=y/g,s[_+2]=S/g,s[_+3]=255;}}return {data:s,width:o,height:i,colorSpace:"srgb"}}function tk(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(e.binaryData))}catch{return e.data}}async function Qz(e,t,r={}){let{width:n,height:o}=e;if(!(n>0&&o>0)||e.data.length<n*o*4)throw new Error("Pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=await eb(),s={data:e.data instanceof Uint8ClampedArray?e.data:Uint8ClampedArray.from(e.data),width:n,height:o},a=i(s.data,n,o,{inversionAttempts:"dontInvert"});if(!a)return {data:null,version:null,passed:false};let c=tk(a),{version:u,location:l}=a;if(!J_(a,t))return {data:c,version:u,passed:false};let f=17+4*u,p=(en(l.topLeftCorner,l.topRightCorner)+en(l.bottomLeftCorner,l.bottomRightCorner)+en(l.topLeftCorner,l.bottomLeftCorner)+en(l.topRightCorner,l.bottomRightCorner))/4,m=h4(s.data);for(let h of r.sizes??ek)if(tb(i,g=>g4(s,g/p,m),h,f,g=>J_(g,t))!=="pass")return {data:c,version:u,passed:false};return {data:c,version:u,passed:true}}var rk=16,_4=.01;function nk(e){let t=new Float64Array(256);for(let c of e)t[Math.min(255,Math.max(0,Math.round(c*255)))]++;let r=e.length,n=0;for(let c=0;c<256;c++)n+=c*t[c];let o=0,i=0,s=0,a=128;for(let c=0;c<256;c++){if(i+=t[c],i===0)continue;let u=r-i;if(u===0)break;o+=c*t[c];let l=o/i,f=(n-o)/u,p=i*u*(l-f)**2;p>s&&(s=p,a=c);}return (a+.5)/255}function ok(e,t){let{width:r,height:n,data:o}=e,i=r*n,s=new Uint8Array(i),a=0;for(let m=0;m<i;m++)o[m*4+3]<128&&a++;if(t==="alpha"||t==="auto"&&a>i*.02&&a<i*.98){for(let m=0;m<i;m++)s[m]=o[m*4+3]>=128?1:0;return s}let u=new Float32Array(i);for(let m=0;m<i;m++){let h=o[m*4+3]/255,d=.2126*o[m*4]+.7152*o[m*4+1]+.0722*o[m*4+2];u[m]=1-(d*h+255*(1-h))/255;}let l=nk(u);for(let m=0;m<i;m++)s[m]=u[m]>l?1:0;let f=0,p=0;for(let m=0;m<r;m++)for(let h of [0,n-1])f++,p+=s[h*r+m];for(let m=1;m<n-1;m++)for(let h of [0,r-1])f++,p+=s[m*r+h];if(p>f/2)for(let m=0;m<i;m++)s[m]=s[m]?0:1;return s}function b4(e,t,r,n){for(let o of [1,0]){let i=new Uint8Array(e.length);for(let s=0;s<e.length;s++){if(i[s]||e[s]!==o)continue;let a=[s];i[s]=1;let c=false;for(let l of a){let f=l%t,p=(l-f)/t;(f===0||p===0||f===t-1||p===r-1)&&(c=true);for(let[m,h]of [[f-1,p],[f+1,p],[f,p-1],[f,p+1]]){if(m<0||h<0||m>=t||h>=r)continue;let d=h*t+m;!i[d]&&e[d]===o&&(i[d]=1,a.push(d));}}if((o===1||!c)&&a.length<n)for(let l of a)e[l]=o?0:1;}}}function y4(e,t={}){let{width:r,height:n,data:o}=e;if(!(r>0&&n>0)||o.length<r*n*4)throw new Error("Silhouette pixels must be width \xD7 height \xD7 4 RGBA bytes");let i=ok(e,t.mode??"auto"),s=i.reduce(($,v)=>$+v,0);b4(i,r,n,Math.max(16,s*_4));let a=r,c=n,u=-1,l=-1;for(let $=0;$<n;$++)for(let v=0;v<r;v++)i[$*r+v]&&(a=Math.min(a,v),c=Math.min(c,$),u=Math.max(u,v),l=Math.max(l,$));if(u<0)throw new Error("No shape found: use a picture with a dark or opaque shape on a light or clear background");let f=u-a+1,p=l-c+1;if(Math.max(f,p)<rk)throw new Error("The shape is too small to trace; use a bigger picture");let h=Math.min(Math.max(Math.round(t.cells??At),Nt),At)/Math.max(f,p),d=Math.max(Nt,Math.round(f*h)),g=Math.max(Nt,Math.round(p*h)),_=Math.max(1,Math.round(f*h)),b=Math.max(1,Math.round(p*h)),y=Math.floor((d-_)/2),S=Math.floor((g-b)/2),C=new Uint8Array(d*g);for(let $=0;$<b;$++){let v=c+Math.floor($*p/b),R=Math.max(v+1,c+Math.floor(($+1)*p/b));for(let P=0;P<_;P++){let I=a+Math.floor(P*f/_),T=Math.max(I+1,a+Math.floor((P+1)*f/_)),O=0;for(let D=v;D<R;D++)for(let B=I;B<T;B++)O+=i[D*r+B];C[($+S)*d+P+y]=O*2>=(R-v)*(T-I)?1:0;}}let w=C.reduce(($,v)=>$+v,0);if(b4(C,d,g,Math.max(4,w*_4)),!C.includes(1))throw new Error("The shape is too small to trace; use a bigger picture");return {type:"silhouette",width:d,height:g,cells:Array.from(C,$=>$?"1":"0").join("")}}var ob=512;async function ik(e){if(typeof e!="string"&&!(e instanceof Blob))return e.complete||await new Promise(r=>{e.addEventListener("load",r,{once:true}),e.addEventListener("error",r,{once:true});}),e;let t=typeof e=="string"?e:URL.createObjectURL(e);try{return await new Promise((r,n)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>r(o),o.onerror=()=>n(new Error("Could not load the picture")),o.src=t;})}finally{typeof e!="string"&&setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function sk(e,t={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let r=await ik(e),n=r.naturalWidth||r.width||ob,o=r.naturalHeight||r.height||ob,i=ob/Math.max(n,o),s=Math.max(1,Math.round(n*i)),a=Math.max(1,Math.round(o*i)),c=document.createElement("canvas");c.width=s,c.height=a;let u=c.getContext("2d",{willReadFrequently:true});if(!u)throw new Error("Could not get a canvas context");u.drawImage(r,0,0,s,a);let l;try{l=u.getImageData(0,0,s,a);}catch{throw new Error("Could not read the picture (cross-origin images need CORS); upload it instead")}finally{c.remove();}return y4(l,t)}var x4=(e,t)=>{let r=t??e.size??$e;return {width:r,height:r}};function BD(e,t){let r=typeof e=="string"?document.querySelector(e):e;if(!r)throw new Error(`qrdx: no element matches ${String(e)}`);let n={...t},o=null,i="",s=false,a=()=>{let c=vi(n),u=rr(c);if(o&&u===i)return;let l=$a(c,r.ownerDocument).firstChild;o?.parentNode===r?o.replaceWith(l):r.appendChild(l),o=l,i=u;};return a(),{get svg(){return o},get options(){return n},update(c){if(s)throw new Error("qrdx: this QR code was destroyed");n={...n,...c},a();},toSVGString(){return i||rr(vi(n))},toDataURL(c="png",u={}){return N5(n,c,x4(n,u.size),{quality:u.quality})},download(c={}){return L5(n,{format:c.format??"png",size:x4(n,c.size),filename:c.filename,quality:c.quality})},destroy(){s||(s=true,o?.remove(),o=null);}}}/**
88
88
  * @license QR Code generator library (TypeScript)
89
89
  * Copyright (c) Project Nayuki.
90
90
  * SPDX-License-Identifier: MIT
91
- */export{Tf as AUTO_LEVEL_LOGO_COVERAGE,Qw as Arrow,po as BG_RADIUS_MAX,Ff as BG_RADIUS_QUIET_RATIO,QE as BMP_MAX_DIMENSION,Af as BODY_PATTERN,T1 as BUILT_IN_FRAMES,HA as BUILT_IN_FRAME_SPECS,Ia as CORNER_EYE_DOT_PATTERNS,Ma as CORNER_EYE_PATTERNS,dn as CUSTOM_FRAME_STYLE,Qx as DEFAULT_ART_INTENSITY,Rf as DEFAULT_FRAME_TEXT,Me as DEFAULT_MARGIN,ye as DEFAULT_SIZE,N_ as DOWNLOAD_FORMATS,fS as DotRing,C5 as EPS_IMAGE_FILL_REASON,Uf as EYE_GRADIENT_SPANS,un as EYE_POSITIONS,Zi as FRAME_COLOR_TOKENS,pl as FRAME_FONT_FAMILY,vr as FRAME_FONT_SCALE_MAX,cn as FRAME_FONT_SCALE_MIN,rw as FRAME_GAP_RATIO,Di as FRAME_ICONS,A1 as FRAME_ICON_BOX,vb as FRAME_ICON_MAX_SEGMENTS,wt as FRAME_IMPORT_LIMITS,nw as FRAME_LABEL_ATTRIBUTE,mn as FRAME_SPEC_KIND,Bi as FRAME_SPEC_LABEL_MAX_FONT,ee as FRAME_SPEC_LIMITS,pn as FRAME_SPEC_VERSION,vf as FRAME_STYLES,dt as FRAME_TEXT_MAX_LENGTH,It as Fragment,ia as FrameSpecError,Tl as GIFScanError,L7 as GIF_ALPHA_THRESHOLD,T7 as GIF_MAX_COLORS,O7 as GIF_MAX_DIMENSION,ga as GIF_MIME,WA as GRADIENT_FRAME_DEFAULTS,Ta as HALO_COLOR_DEFAULT,ln as HALO_LIGHT_MIN,zf as HALO_WIDTH_DEFAULT,Li as HALO_WIDTH_MAX,Oi as HALO_WIDTH_MIN,pS as Halloween,Wn as ICO_MAX_DIMENSION,qn as ICO_MIME,Ll as ICO_SIZES,j5 as LOGO_CLEANUP_MAX_SIDE,ww as LOGO_EC_SAFETY,Mf as LOGO_PADDING_MAX,bl as LOGO_PLATE_INSET,_l as LOGO_ROUNDED_RADIUS,Pf as LOGO_SHAPES,If as LOGO_SIZE_DEFAULT,Mi as LOGO_SIZE_MAX,kf as LOGO_SIZE_MIN,_$ as MODULE_SCALE_FLOOR,Ti as MODULE_SCALE_MAX,mo as MODULE_SCALE_MIN,bP as OFFICIAL_FRAME_COLLECTIONS,gP as OFFICIAL_FRAME_COUNT,_P as OFFICIAL_FRAME_COUNTS,KP as PIXEL_SCAN_SIZES,Nz as PIXEL_SCORE_MIN_CODE_WIDTH,IF as PRESET_SIZES,Ht as QR_ART_MAX_SAMPLE_SIZE,Yu as QR_ART_MIN_LUMA_GAP,lo as QR_ART_MODES,r1 as QR_ART_SAMPLE_SIZES,fo as QR_ART_VARIANTS,Lf as QR_CIRCLE_QUIET_MIN,Uw as QR_EYE_ATTRIBUTE,n7 as QR_PARTS,J1 as QR_PART_ATTRIBUTE,Of as QR_SHAPES,At as QR_SILHOUETTE_MAX_CELLS,Nt as QR_SILHOUETTE_MIN_CELLS,Nf as QR_SILHOUETTE_MIN_SHARE,Cf as RETIRED_CORNER_EYE_DOT_PATTERNS,Ef as RETIRED_CORNER_EYE_PATTERNS,J5 as SCAN_CONTRAST_FAIL,zP as SCAN_CONTRAST_LOW,Aa as SCAN_CONTRAST_MIN,e4 as SCAN_IMAGE_CONTRAST_MIN,n4 as SCAN_TEST_SIZES,Zf as SHADOW_COLOR_DEFAULT,Df as SHADOW_OFFSET_DEFAULT,cr as SHADOW_OFFSET_MAX,Bf as SHADOW_OPACITY_DEFAULT,Fi as SHADOW_OPACITY_MAX,Ni as SHADOW_OPACITY_MIN,Iw as SHARP_DOT_EYE_SAFE_BODIES,BL as SUPPORTS_PATH2D,hS as SquareBorder,_S as StandardBox,yS as StrikedBox,ha as TEMPLATES,vw as WEAK_BODY_EYES,Pw as WEAK_DOTS,Aw as WEAK_DOT_EYES,Rw as WEAK_EYES,kw as WEAK_SHARP_DOT_EYES,fR as WEBP_MAX_DIMENSION,an as WITHDRAWN_BODY_PATTERNS,ar as WITHDRAWN_CORNER_EYE_DOT_PATTERNS,sr as WITHDRAWN_CORNER_EYE_PATTERNS,Ig as angularGradientSchema,Vu as anyFrameSchema,D7 as assertGIFStillScans,Ix as baseTemplatePropsSchema,$t as blobToDataUrl,Hu as bodyPatternSchema,Ju as canvasToBMP,Ol as canvasToGIF,VS as canvasToICO,Q7 as canvasToPNGBytes,zl as canvasToWebP,b_ as canvasesToICO,jn as circleQuietZone,xi as clampBgRadius,rl as clampModuleScale,wl as colorAlpha,hr as colorConfigSchema,bx as colorTypeSchema,M7 as convertImageSettingsToPixels,MF as copyQRCodeToClipboard,Bs as cornerEyeDotPatternSchema,Zs as cornerEyePatternSchema,JA as createFrameTree,jx as createQRArtImage,LD as createQRCode,Ei as createQRCodeTree,_4 as createQRSilhouette,Dg as customFrameSchema,qs as damagedCodewords,T_ as decodePNGPixels,jw as defaultTemplate,Et as downloadFile,b9 as downloadImageData,y9 as downloadImageWithBoundingBox,VR as downloadPrintEPS,sF as downloadPrintPDF,aF as downloadPrintSVG,T5 as downloadQRCode,Oz as drawScanFrames,p1 as encodeBMP,DS as encodeGIF,m_ as encodeGIFFromRGBA,g_ as encodeICO,C_ as encodeWebPLossless,Kl as epsToDataUrl,Zg as errorLevelSchema,u_ as excavateModules,yx as excavationSchema,js as eyeColorOverrideSchema,jg as eyeColorsSchema,Hg as eyeGradientSpanSchema,tr as eyeShapeOf,Vs as eyeShapeOverrideSchema,Vg as eyeShapesSchema,t7 as fitHaloColor,sw as frameLabels,Us as frameSchema,Gr as frameSpecColorSchema,yP as frameSpecHash,zg as frameSpecLabelSchema,fl as frameSpecOf,xo as frameSpecPadding,gr as frameSpecPaintSchema,Na as frameSpecQrZone,ju as frameSpecSchema,Fg as frameSpecShapeSchema,Lg as frameStyleSchema,IS as generatePath,mL as getAllTemplates,Wv as getBgRadiusLimit,O1 as getBuiltInFrame,Ws as getCodewordMap,S4 as getColorString,GL as getContrastLevel,UL as getContrastRatio,I1 as getCustomFrameLayout,HR as getDownloadFilename,W1 as getEyeStyleRisk,qA as getFrameColors,yr as getFrameDimensions,L1 as getFrameGapRatio,v1 as getFrameIconPath,Qn as getFrameLayout,KA as getFrameSecondaryText,ul as getFrameSpecColors,k1 as getFrameSpecGapRatio,Rx as getFrameSpecIssues,YA as getFrameText,Y1 as getHaloRisk,zz as getImageScanScore,Xr as getImageSettings,FP as getImageTones,NP as getImageTonesFromPixels,Ke as getLayoutMargin,xl as getLogoBlockDamage,$P as getLogoSizeLimit,Ci as getLuminance,C4 as getNormalizedColor,Xl as getPrintLayout,vE as getQRArtColorIssue,f1 as getQRArtEyeColors,Ku as getQRArtVariant,R5 as getQRAsBMP,Cr as getQRAsCanvas,Yl as getQRAsEPS,P5 as getQRAsGIF,k5 as getQRAsICO,TR as getQRAsPrintPDF,iF as getQRAsPrintPDFBuffer,OR as getQRAsPrintSVG,Ut as getQRAsSVGDataUri,EP as getQRAsSVGNode,v5 as getQRAsWebP,H5 as getQRCodeData,O5 as getQRCodeDataUrl,W5 as getQRCodeSVGProps,V_ as getQRData,hE as getQRFunctionModules,IR as getQRModuleCount,_v as getQRShapePath,dv as getQRSilhouetteFit,TF as getSVGString,DP as getScanContrast,Tz as getScanScore,Lz as getScanScoreFromFrames,Fz as getScanScoreFromPixels,Ne as getSolidColor,Z1 as getStylePairRisk,Al as getTemplate,pL as getTemplateIds,E_ as getWebPCompression,Ds as gradientStopSchema,qu as h,Wg as haloSchema,r7 as haloTints,y$ as handleImageLoad,E5 as hasImageFill,ZL as hexToRgb,Mg as imageFitSchema,Og as imagePaintSchema,yb as imagePositionCss,Tg as imagePositionSchema,Bg as imageSettingsSchema,hP as importFrameSvg,p_ as indexedToRGBA,d1 as isBMPFile,xt as isFrameActive,d_ as isGIFFile,sn as isGradient,__ as isICOFile,Sf as isImagePaint,z4 as isLatin1Text,o1 as isQRArtActive,Ln as isQRNode,zw as isSeeThroughBackground,ua as isShapedCode,Mw as isWeakSharpPair,i5 as isWebPFile,Pg as linearGradientSchema,mE as loadQRArtImage,ok as loadQRSilhouette,Gv as logoFitsBudget,Px as logoOptionsSchema,Wu as logoShapeSchema,oa as mixFrameColors,it as normalizeColorConfig,e_ as partMarker,$x as pickableCornerEyeDotPatternSchema,Sx as pickableCornerEyePatternSchema,B7 as pixelsToGIF,vg as qrArtImageSchema,Eg as qrArtModeSchema,Gu as qrArtSchema,Ag as qrArtVariantSchema,Qg as qrCodeShapeSchema,kx as qrPropsSchema,Ug as qrShapeSchema,Gg as qrSilhouetteSchema,FS as quantizeRGBA,kg as radialGradientSchema,V5 as removeLogoBackdrop,wP as removeLogoBackground,c1 as renderQRArt,xa as renderToDOM,nr as renderToString,Je as resolveErrorLevel,Gn as resolveFrameSpec,la as resolveHalo,PP as resolveQRCodeProps,K1 as resolveShadow,jr as rgbToCmyk,yo as sanitizeFrameText,Dz as scanQRPixels,qg as shadowSchema,Rg as solidColorSchema,S5 as svgToEPS,Mx as templateConfigSchema,Tx as templateDefinitionBaseSchema,q5 as toHyperscript,lR as toSVGElement,x_ as toSVGString,F_ as validateSize,H1 as weakestEyePattern,Jr as withQRSize,He as withdrawnFallback};//# sourceMappingURL=vanilla.browser.mjs.map
91
+ */export{Lf as AUTO_LEVEL_LOGO_COVERAGE,Vw as Arrow,po as BG_RADIUS_MAX,Df as BG_RADIUS_QUIET_RATIO,Vv as BMP_MAX_DIMENSION,Rf as BODY_PATTERN,L1 as BUILT_IN_FRAMES,qA as BUILT_IN_FRAME_SPECS,Ta as CORNER_EYE_DOT_PATTERNS,Oa as CORNER_EYE_PATTERNS,dn as CUSTOM_FRAME_STYLE,Vx as DEFAULT_ART_INTENSITY,kf as DEFAULT_FRAME_TEXT,Me as DEFAULT_MARGIN,$e as DEFAULT_SIZE,z_ as DOWNLOAD_FORMATS,pS as DotRing,A5 as EPS_IMAGE_FILL_REASON,Qf as EYE_GRADIENT_SPANS,un as EYE_POSITIONS,Ui as FRAME_COLOR_TOKENS,hl as FRAME_FONT_FAMILY,Ar as FRAME_FONT_SCALE_MAX,cn as FRAME_FONT_SCALE_MIN,ow as FRAME_GAP_RATIO,Bi as FRAME_ICONS,R1 as FRAME_ICON_BOX,Pb as FRAME_ICON_MAX_SEGMENTS,$t as FRAME_IMPORT_LIMITS,iw as FRAME_LABEL_ATTRIBUTE,mn as FRAME_SPEC_KIND,Zi as FRAME_SPEC_LABEL_MAX_FONT,J as FRAME_SPEC_LIMITS,pn as FRAME_SPEC_VERSION,Pf as FRAME_STYLES,pt as FRAME_TEXT_MAX_LENGTH,It as Fragment,sa as FrameSpecError,Ll as GIFScanError,F7 as GIF_ALPHA_THRESHOLD,L7 as GIF_MAX_COLORS,N7 as GIF_MAX_DIMENSION,_a as GIF_MIME,XA as GRADIENT_FRAME_DEFAULTS,La as HALO_COLOR_DEFAULT,ln as HALO_LIGHT_MIN,Bf as HALO_WIDTH_DEFAULT,Ni as HALO_WIDTH_MAX,Li as HALO_WIDTH_MIN,hS as Halloween,Wn as ICO_MAX_DIMENSION,qn as ICO_MIME,Fl as ICO_SIZES,H5 as LOGO_CLEANUP_MAX_SIDE,Cw as LOGO_EC_SAFETY,Of as LOGO_PADDING_MAX,xl as LOGO_PLATE_INSET,yl as LOGO_ROUNDED_RADIUS,If as LOGO_SHAPES,Tf as LOGO_SIZE_DEFAULT,Ti as LOGO_SIZE_MAX,Mf as LOGO_SIZE_MIN,y$ as MODULE_SCALE_FLOOR,Oi as MODULE_SCALE_MAX,mo as MODULE_SCALE_MIN,xP as OFFICIAL_FRAME_COLLECTIONS,bP as OFFICIAL_FRAME_COUNT,yP as OFFICIAL_FRAME_COUNTS,ek as PIXEL_SCAN_SIZES,Zz as PIXEL_SCORE_MIN_CODE_WIDTH,NF as PRESET_SIZES,Vt as QR_ART_MAX_SAMPLE_SIZE,Ju as QR_ART_MIN_LUMA_GAP,lo as QR_ART_MODES,o1 as QR_ART_SAMPLE_SIZES,fo as QR_ART_VARIANTS,Ff as QR_CIRCLE_QUIET_MIN,Qw as QR_EYE_ATTRIBUTE,i7 as QR_PARTS,t_ as QR_PART_ATTRIBUTE,Nf as QR_SHAPES,At as QR_SILHOUETTE_MAX_CELLS,Nt as QR_SILHOUETTE_MIN_CELLS,zf as QR_SILHOUETTE_MIN_SHARE,Af as RETIRED_CORNER_EYE_DOT_PATTERNS,Ef as RETIRED_CORNER_EYE_PATTERNS,t4 as SCAN_CONTRAST_FAIL,BP as SCAN_CONTRAST_LOW,Ea as SCAN_CONTRAST_MIN,r4 as SCAN_IMAGE_CONTRAST_MIN,i4 as SCAN_TEST_SIZES,Gf as SHADOW_COLOR_DEFAULT,Zf as SHADOW_OFFSET_DEFAULT,ar as SHADOW_OFFSET_MAX,Uf as SHADOW_OPACITY_DEFAULT,zi as SHADOW_OPACITY_MAX,Fi as SHADOW_OPACITY_MIN,Tw as SHARP_DOT_EYE_SAFE_BODIES,jL as SUPPORTS_PATH2D,_S as SquareBorder,yS as StandardBox,$S as StrikedBox,ga as TEMPLATES,Pw as WEAK_BODY_EYES,Iw as WEAK_DOTS,Rw as WEAK_DOT_EYES,kw as WEAK_EYES,Mw as WEAK_SHARP_DOT_EYES,pR as WEBP_MAX_DIMENSION,an as WITHDRAWN_BODY_PATTERNS,sr as WITHDRAWN_CORNER_EYE_DOT_PATTERNS,ir as WITHDRAWN_CORNER_EYE_PATTERNS,Tg as angularGradientSchema,Wu as anyFrameSchema,Z7 as assertGIFStillScans,Tx as baseTemplatePropsSchema,xt as blobToDataUrl,qu as bodyPatternSchema,tl as canvasToBMP,Nl as canvasToGIF,WS as canvasToICO,V7 as canvasToPNGBytes,Bl as canvasToWebP,x_ as canvasesToICO,jn as circleQuietZone,xi as clampBgRadius,ol as clampModuleScale,Cl as colorAlpha,dr as colorConfigSchema,xx as colorTypeSchema,O7 as convertImageSettingsToPixels,FF as copyQRCodeToClipboard,Zs as cornerEyeDotPatternSchema,Us as cornerEyePatternSchema,tE as createFrameTree,Hx as createQRArtImage,BD as createQRCode,vi as createQRCodeTree,y4 as createQRSilhouette,Zg as customFrameSchema,Xs as damagedCodewords,L_ as decodePNGPixels,Hw as defaultTemplate,Ct as downloadFile,x9 as downloadImageData,$9 as downloadImageWithBoundingBox,WR as downloadPrintEPS,fF as downloadPrintPDF,mF as downloadPrintSVG,L5 as downloadQRCode,Dz as drawScanFrames,h1 as encodeBMP,ZS as encodeGIF,d_ as encodeGIFFromRGBA,b_ as encodeICO,A_ as encodeWebPLossless,ef as epsToDataUrl,Gg as errorLevelSchema,f_ as excavateModules,$x as excavationSchema,Vs as eyeColorOverrideSchema,Hg as eyeColorsSchema,qg as eyeGradientSpanSchema,er as eyeShapeOf,Hs as eyeShapeOverrideSchema,Wg as eyeShapesSchema,n7 as fitHaloColor,cw as frameLabels,Gs as frameSchema,Ur as frameSpecColorSchema,$P as frameSpecHash,Bg as frameSpecLabelSchema,pl as frameSpecOf,xo as frameSpecPadding,hr as frameSpecPaintSchema,za as frameSpecQrZone,Hu as frameSpecSchema,Dg as frameSpecShapeSchema,Fg as frameStyleSchema,TS as generatePath,_L as getAllTemplates,XE as getBgRadiusLimit,N1 as getBuiltInFrame,qs as getCodewordMap,v4 as getColorString,WL as getContrastLevel,HL as getContrastRatio,T1 as getCustomFrameLayout,qR as getDownloadFilename,X1 as getEyeStyleRisk,YA as getFrameColors,br as getFrameDimensions,F1 as getFrameGapRatio,P1 as getFrameIconPath,Qn as getFrameLayout,eE as getFrameSecondaryText,fl as getFrameSpecColors,M1 as getFrameSpecGapRatio,kx as getFrameSpecIssues,JA as getFrameText,J1 as getHaloRisk,Gz as getImageScanScore,qr as getImageSettings,DP as getImageTones,zP as getImageTonesFromPixels,Ye as getLayoutMargin,wl as getLogoBlockDamage,SP as getLogoSizeLimit,Ci as getLuminance,A4 as getNormalizedColor,Kl as getPrintLayout,Pv as getQRArtColorIssue,p1 as getQRArtEyeColors,el as getQRArtVariant,k5 as getQRAsBMP,Sr as getQRAsCanvas,Jl as getQRAsEPS,I5 as getQRAsGIF,M5 as getQRAsICO,LR as getQRAsPrintPDF,lF as getQRAsPrintPDFBuffer,NR as getQRAsPrintSVG,Ut as getQRAsSVGDataUri,EP as getQRAsSVGNode,P5 as getQRAsWebP,q5 as getQRCodeData,N5 as getQRCodeDataUrl,X5 as getQRCodeSVGProps,W_ as getQRData,_v as getQRFunctionModules,TR as getQRModuleCount,yE as getQRShapePath,gE as getQRSilhouetteFit,zF as getSVGString,ZP as getScanContrast,zz as getScanScore,Bz as getScanScoreFromFrames,Uz as getScanScoreFromPixels,Fe as getSolidColor,G1 as getStylePairRisk,Rl as getTemplate,bL as getTemplateIds,E_ as getWebPCompression,Bs as gradientStopSchema,Yu as h,Xg as haloSchema,o7 as haloTints,$$ as handleImageLoad,E5 as hasImageFill,VL as hexToRgb,Og as imageFitSchema,Ng as imagePaintSchema,$b as imagePositionCss,Lg as imagePositionSchema,Ug as imageSettingsSchema,_P as importFrameSvg,h_ as indexedToRGBA,g1 as isBMPFile,yt as isFrameActive,g_ as isGIFFile,sn as isGradient,y_ as isICOFile,vf as isImagePaint,B4 as isLatin1Text,s1 as isQRArtActive,Ln as isQRNode,Bw as isSeeThroughBackground,la as isShapedCode,Ow as isWeakSharpPair,a5 as isWebPFile,Ig as linearGradientSchema,dv as loadQRArtImage,sk as loadQRSilhouette,jE as logoFitsBudget,Ix as logoOptionsSchema,Xu as logoShapeSchema,ia as mixFrameColors,ot as normalizeColorConfig,r_ as partMarker,Sx as pickableCornerEyeDotPatternSchema,vx as pickableCornerEyePatternSchema,U7 as pixelsToGIF,Pg as qrArtImageSchema,Eg as qrArtModeSchema,ju as qrArtSchema,Rg as qrArtVariantSchema,Vg as qrCodeShapeSchema,Mx as qrPropsSchema,Qg as qrShapeSchema,jg as qrSilhouetteSchema,DS as quantizeRGBA,Mg as radialGradientSchema,W5 as removeLogoBackdrop,CP as removeLogoBackground,l1 as renderQRArt,$a as renderToDOM,rr as renderToString,Je as resolveErrorLevel,Gn as resolveFrameSpec,fa as resolveHalo,IP as resolveQRCodeProps,e_ as resolveShadow,Qr as rgbToCmyk,yo as sanitizeFrameText,Qz as scanQRPixels,Yg as shadowSchema,kg as solidColorSchema,v5 as svgToEPS,Ox as templateConfigSchema,Lx as templateDefinitionBaseSchema,Y5 as toHyperscript,mR as toSVGElement,w_ as toSVGString,D_ as validateSize,q1 as weakestEyePattern,Kr as withQRSize,Ve as withdrawnFallback};//# sourceMappingURL=vanilla.browser.mjs.map
92
92
  //# sourceMappingURL=vanilla.browser.mjs.map