qrdx 0.0.56 → 0.0.57
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.
- package/README.md +8 -3
- package/dist/angular.js +1 -1
- package/dist/angular.mjs +1 -1
- package/dist/core.js +7 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +7 -7
- package/dist/core.mjs.map +1 -1
- package/dist/element.browser.mjs +6 -6
- package/dist/element.browser.mjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/src/angular.d.ts +2 -2
- package/dist/src/bmp.d.ts +7 -0
- package/dist/src/bmp.d.ts.map +1 -0
- package/dist/src/download.d.ts +12 -5
- package/dist/src/download.d.ts.map +1 -1
- package/dist/src/element.d.ts +1 -1
- package/dist/src/element.d.ts.map +1 -1
- package/dist/src/engine.d.ts +1 -0
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/export.d.ts.map +1 -1
- package/dist/src/utils/bmp.d.ts +18 -0
- package/dist/src/utils/bmp.d.ts.map +1 -0
- package/dist/src/vanilla-api.d.ts +2 -2
- package/dist/src/vanilla-api.d.ts.map +1 -1
- package/dist/src/vue.d.ts +2 -2
- package/dist/src/vue.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +14 -14
- package/dist/vanilla.browser.mjs.map +1 -1
- package/package.json +1 -1
- package/src/angular.ts +2 -2
- package/src/bmp.ts +25 -0
- package/src/download.tsx +40 -5
- package/src/element.ts +1 -1
- package/src/engine.ts +1 -0
- package/src/export.ts +6 -0
- package/src/utils/bmp.ts +126 -0
- package/src/vanilla-api.ts +2 -2
- package/src/vue.ts +2 -2
package/dist/vanilla.browser.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var p4=Object.defineProperty;var hr=(e,t)=>{for(var r in t)p4(e,r,{get:t[r],enumerable:true});};var Qn;(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 _=e.getNumDataCodewords(m,c)*8,b=o.getTotalBits(a,m);if(b<=_){h=b;break}if(m>=l)throw new RangeError("Data too long")}for(let _ of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,_)*8&&(c=_);let d=[];for(let _ of a){t(_.mode.modeBits,4,d),t(_.numChars,_.mode.numCharCountBits(m),d);for(let b of _.getData())d.push(b);}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 _=236;d.length<g;_^=253)t(_,8,d);let y=[];for(;y.length*8<d.length;)y.push(0);return d.forEach((_,b)=>y[b>>>3]|=_<<7-(b&7)),new e(m,c,y,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 _=0,b=0;_<l;_++){let S=a.slice(b,b+h-f+(_<m?0:1));b+=S.length;let v=e.reedSolomonComputeRemainder(S,g);_<m&&S.push(0),d.push(S.concat(v));}let y=[];for(let _=0;_<d[0].length;_++)d.forEach((b,S)=>{(_!=h-f||S>=m)&&y.push(b[_]);});return n(y.length==p),y}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;})(Qn||={});(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||={});})(Qn||={});(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||={});})(Qn||={});var Le=Qn;var Ke={L:Le.QrCode.Ecc.LOW,M:Le.QrCode.Ecc.MEDIUM,Q:Le.QrCode.Ecc.QUARTILE,H:Le.QrCode.Ecc.HIGH},ve=128,Dt="Q",Ne="#FFFFFF",je="#000000";var Oe=0;var Ws=.1;function ze(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 $t(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function Vn(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function bl(e){return typeof e=="object"&&e!==null&&e.type==="image"}function d4(e,t="#000000"){let r=$t(e,t);return r.type==="solid"?r.color:r.type==="image"?r.underlay||t:r.stops[0]?.color||t}function z1(e="center"){let[t,r]=e.split("-");return e==="center"?"center":r?`${r} ${t}`:t==="top"||t==="bottom"?`center ${t}`:`${t} center`}function h4(e){if(!e)return "#000000";if(typeof e=="string")return e;let t=$t(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")}")`} ${z1(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 jn=["logo","halftone"],qn={logo:["blend","badge"],halftone:["color","mono"]},Zt=192,Hs=["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"],xl=["diamond","star","banner"],Xs=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],$l=["curly"],wl=["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"],Sl=["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"],ut=24,vl="Scan me",Wr=.5,gr=1.5,Cl=["square","rounded","circle"],El=.1,li=.3,Al=.25,Pl=2,Wn=.5,fi=1,kl=.07,Rl=["square","circle","heart"],Ml=3,wt=64,Rt=8,Il=.42,Ys=["topLeft","topRight","bottomLeft"];function se(e,t=3){let r=10**t;return Math.round(e*r)/r+0}function $(e,t=3){return String(se(e,t))}function R(e,...t){let r=e[0]??"";for(let n=0;n<t.length;n++){let o=t[n];r+=(typeof o=="number"?$(o):o)+(e[n+1]??"");}return r}var g4={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},y4=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Tl=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function mi(e,t=Number.POSITIVE_INFINITY){if(!y4.test(e))return null;let r=[],n=0,o=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},i=()=>{o(),Tl.lastIndex=n;let c=Tl.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;n=Tl.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=g4[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 O1(e){let t=0;for(let{command:r}of e)t+=r.toUpperCase()==="A"?4:1;return t}function Ll(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=[$(s[0]*t+u)];break;case "V":f=[$(s[0]*t+l)];break;case "A":f=[$(Math.abs(s[0])*t),$(Math.abs(s[1])*t),$(s[2]),String(s[3]),String(s[4]),$(s[5]*t+u),$(s[6]*t+l)];break;default:f=s.map((p,m)=>$(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function Ks(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 Hn(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(F1(c,a,l,u)),n.push(a)):l>=0&&n.push(F1(c,a,l,u));}}return n.length>2?n:[]}function F1(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 D1(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([r,n])=>`${$(r)} ${$(n)}`).join("L")}Z`).join("")}function Hr(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 _4={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function G1(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 _4[r.toLowerCase()]??t})}var b4=60,Nl=62,zl=47,x4=61,Z1=34,B1=39,Fl=/\s*/y,$4=/[^\s/>]*/y,w4=/[^\s>]*/y,S4=/[^\s=]*/y;function Xn(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function v4(e,t){let r=e.length,n=x=>{let w=Number.POSITIVE_INFINITY,C=-1;return A=>((A<w||C>=0&&C<A)&&(w=A,C=e.indexOf(x,A)),C)},o=n("-->"),i=n("?>"),s=n("]]>"),a=n(">"),c,u=x=>{let w=e.charCodeAt(x);if(w!==Z1&&w!==B1)return x+1;let C=e.indexOf(e[x],x+1);return C<0?r:C+1},l=x=>{for(let w=x;w<r&&!c?.[w];w=u(w)){let C=e.charCodeAt(w);if(C===Nl||C===zl&&e.charCodeAt(w+1)===Nl)return w}c??=new Uint8Array(r);for(let w=x;w<r&&!c[w];w=u(w))c[w]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=x=>{let w=x+1;if(w<f||w>=p){f=w,p=Xn($4,e,w),m=-1;for(let A=p;A>w;A--){let k=e.charCodeAt(A);if((A===p||k===Z1||k===B1)&&(h=l(A),h>=0)){m=A;break}}}if(m<=w)return -1;let C=e.charCodeAt(h)===zl;return t.open(e.slice(w,m),e.slice(m,h),C),h+(C?2:1)},g=-1,y=-1,_=-1,b=x=>{let w=x+2;if(w<g||w>=y){g=w,y=Xn(w4,e,w);let C=Xn(Fl,e,y);_=y>w&&e.charCodeAt(C)===Nl?C:-1;}return _},S=x=>{if(e.startsWith("<!--",x)){let w=o(x+4);if(w>=0)return w+3}if(e.startsWith("<?",x)){let w=i(x+2);if(w>=0)return w+2}if(e.startsWith("<![CDATA[",x)){let w=s(x+9);if(w>=0)return t.cdata(e.slice(x+9,w)),w+3}if(e.startsWith("<!",x)){let w=a(x+2);if(w>=0)return w+1}if(e.charCodeAt(x+1)===zl){let w=b(x);return w<0?-1:(t.close(),w+1)}return d(x)},v=0;for(;v<r;)if(e.charCodeAt(v)===b4){let x=S(v);v=x<0?v+1:x;}else {let x=e.indexOf("<",v),w=x<0?r:x;t.text(e.slice(v,w)),v=w;}}function C4(e){let t={},r=0;for(;r<e.length;){let n=Xn(S4,e,r);if(n===r){r++;continue}let o=Xn(Fl,e,n);if(e.charCodeAt(o)===x4){let i=Xn(Fl,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(r,n)]=G1(e.slice(i+1,a)),r=a+1;continue}}r=n;}return t}function yr(e){let t={name:"#root",attrs:{},children:[],text:""},r=[t],n=()=>r.at(-1);v4(e,{open(i,s,a){let c=C4(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+=G1(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 Yn=[1,0,0,1,0,0];function Se(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 Kn(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Bt(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function St(e){let t=Yn;if(!e)return t;for(let[,r,n]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=Bt(n),i=Yn;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=Se(Se([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=Se(t,i);}return t}var Ol=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function E4(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,y=-m*h+p*d,_=g*g/(u*u)+y*y/(l*l);_>1&&(u*=Math.sqrt(_),l*=Math.sqrt(_));let b=u*u*l*l-u*u*y*y-l*l*g*g,S=u*u*y*y+l*l*g*g,v=(i===s?-1:1)*Math.sqrt(Math.max(0,b/S)),x=v*u*y/l,w=-v*l*g/u,C=p*x-m*w+(e+a)/2,A=m*x+p*w+(t+c)/2,k=(te,U,Y,de)=>Math.atan2(te*de-U*Y,te*Y+U*de),M=k(1,0,(g-x)/u,(y-w)/l),T=k((g-x)/u,(y-w)/l,(-g-x)/u,(-y-w)/l);!s&&T>0?T-=2*Math.PI:s&&T<0&&(T+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2)-1e-9)),D=T/L,B=4/3*Math.tan(D/4),z=(te,U)=>[C+u*p*te-l*m*U,A+u*m*te+l*p*U],j=[];for(let te=0;te<L;te++){let U=M+te*D,Y=U+D,[de,Te]=z(Math.cos(U)-B*Math.sin(U),Math.sin(U)+B*Math.cos(U)),[$e,Z]=z(Math.cos(Y)+B*Math.sin(Y),Math.sin(Y)-B*Math.cos(Y)),[K,J]=te===L-1?[a,c]:z(Math.cos(Y),Math.sin(Y));j.push({op:"C",x1:de,y1:Te,x2:$e,y2:Z,x:K,y:J});}return j}function Jt(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(),Ol.lastIndex=r;let h=Ol.exec(e);return h?(r=Ol.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 y=f();if(y===null)return null;d.push(y);}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,y=d?o:0,_=a.toUpperCase();if(_==="Z"){t.push({op:"Z"}),n=i,o=s,c=null,u=null;continue}if(_==="A"){let x=m(3),w=p(),C=p(),A=m(2);if(!(x&&A)||w===null||C===null)break;let[k,M,T]=x,L=A[0]+g,D=A[1]+y;t.push(...E4(n,o,k,M,T,w,C,L,D)),n=L,o=D,c=null,u=null;continue}let b={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,S=m(b);if(!S)break;let v=S;switch(_){case "M":n=v[0]+g,o=v[1]+y,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":_!=="V"&&(n=v[0]+g),_==="V"?o=v[0]+y:_==="L"&&(o=v[1]+y),t.push({op:"L",x:n,y:o}),c=null,u=null;break;case "C":case "S":{let x,w;_==="C"?(x=[v[0]+g,v[1]+y],w=v.slice(2)):(x=c?[2*n-c[0],2*o-c[1]]:[n,o],w=v);let C=[w[0]+g,w[1]+y],A=[w[2]+g,w[3]+y];t.push({op:"C",x1:x[0],y1:x[1],x2:C[0],y2:C[1],x:A[0],y:A[1]}),[n,o]=A,c=C,u=null;break}case "Q":case "T":{let x,w;_==="Q"?(x=[v[0]+g,v[1]+y],w=[v[2]+g,v[3]+y]):(x=u?[2*n-u[0],2*o-u[1]]:[n,o],w=[v[0]+g,v[1]+y]),t.push({op:"C",x1:n+2/3*(x[0]-n),y1:o+2/3*(x[1]-o),x2:w[0]+2/3*(x[0]-w[0]),y2:w[1]+2/3*(x[1]-w[1]),x:w[0],y:w[1]}),[n,o]=w,u=x,c=null;break}}}return t}var Js=.5522847498;function Gt(e,t,r,n){if(r<=0||n<=0)return [];let o=r*Js,i=n*Js;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 Ut(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*Js,u=a*Js,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 Xr="qrdx.frame",Yr=1,Kr="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:ut},pi=["wifi","star","heart","phone","headphones","calendar","user","chat","bag","bell","cup","card","check","info","home","pin","share","download","clock","snowflake","pumpkin","tree","sparkle","gift"],di=.95,Q1=200,hi=["frame","text","accent","background"],A4=/[\t\n\v\f\r\u0085\u2028\u2029]/g,P4=/[\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 Jn(e,t=ut){let r=e.slice(0,1e3).normalize("NFC").replace(A4," ").replace(P4,"").replace(/\s+/g," ").trim();return Array.from(r).slice(0,Math.max(0,t)).join("").trim()}function k4(e){for(let t of e)if((t.codePointAt(0)??0)>255)return false;return true}var _r=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function ea(e){let t=eo(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 R4(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 eo(e){return e.qr.padding??e.qr.size*ee.defaultPadding}var Zl=.52,M4=.35;function I4(e){let t=e.fontSize??e.box.height*Zl;return Math.min(t*gr,e.box.height*di)}var Dl=(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 U1(e){let t=ea(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 T4([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 L4(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 N4(e,t,r){let n=ea(t);if(!Dl(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 !U1(t).every(i=>T4(i,o,o.radius??0))}if(e.type==="circle"&&e.hole){let o=e.hole;return !U1(t).every(([i,s])=>Math.hypot(i-e.cx,s-e.cy)<=o+.01)}if(e.type==="polygon"){let o=Hn(e.points,n);return o.length>2&&L4(o)>1e-6}return true}function Bl(e){let t=z4(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 z4(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=mi(e.d,ee.maxDecimals);return t?{bounds:Hr(Jt(e.d)),segments:O1(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:Q1}}}function ta(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=y=>y.x0>=a.x0&&y.y0>=a.y0&&y.x1<=a.x1&&y.y1<=a.y1,{qr:u}=e,l=eo(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=ea(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((y,_)=>{let b=["shapes",_],{bounds:S,segments:v}=Bl(y);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",[...b,"d"]);return}if(c(S)||t("The shape extends outside the artboard",b),y.type==="rect"&&y.hole){let{hole:x}=y;(x.x<y.x||x.y<y.y||x.x+x.width>y.x+y.width+1e-9||x.y+x.height>y.y+y.height+1e-9)&&t("The hole must sit inside its rect",[...b,"hole"]);}y.type==="circle"&&y.hole&&y.hole>=y.r&&t("The hole must be smaller than the circle",[...b,"hole"]),"stroke"in y&&y.stroke&&y.stroke.width>Math.min(o,i)*.1+1e-9&&t("A stroke may be at most 10% of the artboard's shorter side",[...b,"stroke","width"]),u.plate==="background"&&N4(y,e,S)&&t('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',b),p+=v,typeof y.fill=="object"&&"gradient"in y.fill&&(m+=(y.fill.gradient.steps??32)*v);}),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((y,_)=>{let b=["labels",_];d.has(y.id)&&t(`Label id "${y.id}" is used twice`,[...b,"id"]),d.add(y.id),y.slot!=="fixed"&&(g.has(y.slot)&&t(`Only one label may use the ${y.slot} slot`,[...b,"slot"]),g.add(y.slot));let S=y.maxLength??r.maxTextLength;y.text!==Jn(y.text,S)&&t(`Label text must be at most ${S} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...b,"text"]);let v;if(y.type==="text"){v={x0:y.box.x,y0:y.box.y,x1:y.box.x+y.box.width,y1:y.box.y+y.box.height},y.fontSize!==void 0&&y.fontSize>y.box.height*di+1e-9&&t("fontSize may be at most 95% of the label's row height",[...b,"fontSize"]);let x=y.box.y+y.box.height/2,w=I4(y)*M4,C={x0:v.x0,x1:v.x1,y0:x-w,y1:x+w};(Dl(v,R4(e))||Dl(C,f))&&t("The label overlaps the code or its padding",[...b,"box"]);}else {let{cx:x,cy:w,radius:C}=y.curve,A=y.fontSize*gr*.6;v={x0:x-C-A,y0:w-C-A,x1:x+C+A,y1:w+C+A};let k=Math.hypot(Math.max(f.x0-x,0,x-f.x1),Math.max(f.y0-w,0,w-f.y1));Math.hypot(Math.max(Math.abs(f.x0-x),Math.abs(f.x1-x)),Math.max(Math.abs(f.y0-w),Math.abs(f.y1-w)))<=C-A||k>=C+A||t("The curved label crosses the code or its padding",[...b,"curve"]);}if(c(v)||t("The label extends outside the artboard",b),y.collapse){let x=y.collapse,w=x.y+x.height;(x.y<-1e-9||w>i+1e-9)&&t("The collapse band must sit inside the artboard",[...b,"collapse"]),w>f.y0+1e-6&&x.y<f.y1-1e-6&&t("The collapse band crosses the code or its padding",[...b,"collapse"]);for(let C of h)w>C.y+1e-6&&x.y<C.y+C.height-1e-6&&t("Collapse bands may not overlap",[...b,"collapse"]);h.push(x);}});}var P={};hr(P,{$brand:()=>rf,$input:()=>kp,$output:()=>Pp,INVALID:()=>tt,NEVER:()=>tf,TimePrecision:()=>Bp,ZodAny:()=>Ph,ZodArray:()=>Ih,ZodBase64:()=>Yc,ZodBase64URL:()=>Kc,ZodBigInt:()=>Fo,ZodBigIntFormat:()=>tu,ZodBoolean:()=>Oo,ZodCIDRv4:()=>Hc,ZodCIDRv6:()=>Xc,ZodCUID:()=>Gc,ZodCUID2:()=>Uc,ZodCatch:()=>Jh,ZodCodec:()=>cs,ZodCompileAsyncError:()=>It,ZodCompileUnsupportedError:()=>re,ZodCreditCard:()=>xh,ZodCustom:()=>us,ZodCustomStringFormat:()=>gn,ZodDate:()=>rs,ZodDefault:()=>qh,ZodDiscriminatedUnion:()=>Lh,ZodE164:()=>Jc,ZodEmail:()=>Fc,ZodEmoji:()=>Zc,ZodEnum:()=>Lo,ZodError:()=>HS,ZodExactOptional:()=>iu,ZodFile:()=>Uh,ZodFirstPartyTypeKind:()=>p0,ZodFunction:()=>u0,ZodGUID:()=>Dc,ZodIBAN:()=>$h,ZodIPv4:()=>qc,ZodIPv6:()=>Wc,ZodISODate:()=>kr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Mr,ZodISOTime:()=>Rr,ZodInstanceOf:()=>m0,ZodIntersection:()=>Nh,ZodIssueCode:()=>KS,ZodJWT:()=>eu,ZodKSUID:()=>jc,ZodLazy:()=>s0,ZodLiteral:()=>Gh,ZodMAC:()=>bh,ZodMap:()=>Zh,ZodNaN:()=>t0,ZodNanoID:()=>Bc,ZodNever:()=>Rh,ZodNonOptional:()=>su,ZodNull:()=>Eh,ZodNullable:()=>jh,ZodNumber:()=>zo,ZodNumberFormat:()=>yn,ZodObject:()=>os,ZodOptional:()=>ss,ZodPipe:()=>as,ZodPrefault:()=>Hh,ZodPreprocess:()=>r0,ZodPromise:()=>c0,ZodReadonly:()=>n0,ZodRealError:()=>dt,ZodRecord:()=>To,ZodSet:()=>Bh,ZodString:()=>No,ZodStringFormat:()=>he,ZodSuccess:()=>Kh,ZodSymbol:()=>vh,ZodTemplateLiteral:()=>i0,ZodTransform:()=>Qh,ZodTuple:()=>Oh,ZodType:()=>H,ZodULID:()=>Qc,ZodURL:()=>ts,ZodUUID:()=>qt,ZodUndefined:()=>Ch,ZodUnion:()=>is,ZodUnknown:()=>kh,ZodVoid:()=>Mh,ZodXID:()=>Vc,ZodXor:()=>Th,_ZodString:()=>Oc,_default:()=>Wh,_function:()=>hb,any:()=>j_,array:()=>ns,base64:()=>E_,base64url:()=>A_,bigint:()=>B_,boolean:()=>Sh,catch:()=>e0,check:()=>gb,cidrv4:()=>v_,cidrv6:()=>C_,clone:()=>le,codec:()=>fb,coerce:()=>h0,compile:()=>Tp,config:()=>Pe,core:()=>or,creditCard:()=>k_,cuid:()=>g_,cuid2:()=>y_,currencyCode:()=>N_,custom:()=>yb,date:()=>W_,decode:()=>mh,decodeAsync:()=>dh,deepPartial:()=>Rb,describe:()=>_b,discriminatedUnion:()=>eb,e164:()=>P_,email:()=>s_,emoji:()=>d_,encode:()=>fh,encodeAsync:()=>ph,endsWith:()=>wo,enum:()=>nu,exactOptional:()=>Vh,file:()=>ab,flattenError:()=>Ei,float32:()=>O_,float64:()=>F_,formatError:()=>Ai,fromJSONSchema:()=>Pb,function:()=>hb,getDiscriminatedOption:()=>rp,getErrorMap:()=>e6,globalRegistry:()=>We,gt:()=>Vt,gte:()=>_t,guid:()=>a_,hash:()=>z_,hex:()=>L_,hostname:()=>T_,httpUrl:()=>p_,iban:()=>R_,includes:()=>xo,input:()=>Ib,instanceof:()=>xb,int:()=>Nc,int32:()=>D_,int64:()=>G_,intersection:()=>zh,invertCodec:()=>mb,ipv4:()=>$_,ipv6:()=>S_,iso:()=>ls,json:()=>wb,jwt:()=>M_,keyof:()=>H_,ksuid:()=>x_,lazy:()=>a0,length:()=>fn,literal:()=>sb,locales:()=>Xa,looseObject:()=>K_,looseRecord:()=>rb,lowercase:()=>_o,lt:()=>Qt,lte:()=>yt,mac:()=>w_,map:()=>nb,maxLength:()=>ln,maxSize:()=>vr,memoizer:()=>Vi,meta:()=>bb,mime:()=>vo,minLength:()=>nr,minSize:()=>jt,multipleOf:()=>Sr,nan:()=>lb,nanoid:()=>h_,nativeEnum:()=>ib,negative:()=>vc,never:()=>ru,nonnegative:()=>Ec,nonoptional:()=>Yh,nonpositive:()=>Cc,normalize:()=>Co,null:()=>Ah,nullable:()=>es,nullish:()=>cb,number:()=>wh,object:()=>X_,optional:()=>dn,output:()=>Tb,overwrite:()=>Tt,parse:()=>ah,parseAsync:()=>ch,partialRecord:()=>tb,pipe:()=>zc,positive:()=>Sc,prefault:()=>Xh,preprocess:()=>Sb,prettifyError:()=>cf,promise:()=>db,properties:()=>So,property:()=>Ac,readonly:()=>o0,record:()=>Dh,refine:()=>l0,regex:()=>yo,regexes:()=>Et,registry:()=>Ka,safeDecode:()=>gh,safeDecodeAsync:()=>_h,safeEncode:()=>hh,safeEncodeAsync:()=>yh,safeParse:()=>uh,safeParseAsync:()=>lh,set:()=>ob,setErrorMap:()=>JS,size:()=>un,slugify:()=>ko,startsWith:()=>$o,strictObject:()=>Y_,string:()=>Ji,stringFormat:()=>I_,stringbool:()=>$b,success:()=>ub,superRefine:()=>f0,symbol:()=>Q_,templateLiteral:()=>pb,toJSONSchema:()=>Mc,toLowerCase:()=>Ao,toUpperCase:()=>Po,toZod:()=>gi,transform:()=>ou,treeifyError:()=>af,trim:()=>Eo,tuple:()=>Fh,uint32:()=>Z_,uint64:()=>U_,ulid:()=>__,undefined:()=>V_,union:()=>Do,unknown:()=>pn,uppercase:()=>bo,url:()=>m_,util:()=>F,uuid:()=>c_,uuidv4:()=>u_,uuidv6:()=>l_,uuidv7:()=>f_,validate:()=>Pi,validateAsync:()=>ki,void:()=>q_,withParser:()=>Ja,xid:()=>b_,xor:()=>J_});var or={};hr(or,{$ZodAny:()=>qm,$ZodArray:()=>Jm,$ZodAsyncError:()=>mt,$ZodBase64:()=>Nm,$ZodBase64URL:()=>zm,$ZodBigInt:()=>Za,$ZodBigIntFormat:()=>Um,$ZodBoolean:()=>Di,$ZodCIDRv4:()=>Tm,$ZodCIDRv6:()=>Lm,$ZodCUID:()=>$m,$ZodCUID2:()=>wm,$ZodCatch:()=>_p,$ZodCheck:()=>_e,$ZodCheckBigIntFormat:()=>Wf,$ZodCheckEndsWith:()=>sm,$ZodCheckGreaterThan:()=>va,$ZodCheckIncludes:()=>om,$ZodCheckLengthEquals:()=>em,$ZodCheckLessThan:()=>Sa,$ZodCheckLowerCase:()=>rm,$ZodCheckMaxLength:()=>Kf,$ZodCheckMaxSize:()=>Hf,$ZodCheckMimeType:()=>um,$ZodCheckMinLength:()=>Jf,$ZodCheckMinSize:()=>Xf,$ZodCheckMultipleOf:()=>jf,$ZodCheckNumberFormat:()=>qf,$ZodCheckOverwrite:()=>lm,$ZodCheckProperties:()=>cm,$ZodCheckProperty:()=>am,$ZodCheckRegex:()=>tm,$ZodCheckSizeEquals:()=>Yf,$ZodCheckStartsWith:()=>im,$ZodCheckStringFormat:()=>mo,$ZodCheckUpperCase:()=>nm,$ZodCodec:()=>Bi,$ZodCreditCard:()=>Fm,$ZodCustom:()=>Cp,$ZodCustomStringFormat:()=>Bm,$ZodCyclicError:()=>qa,$ZodDate:()=>Ym,$ZodDefault:()=>dp,$ZodDiscriminatedUnion:()=>np,$ZodE164:()=>Om,$ZodEmail:()=>hm,$ZodEmoji:()=>bm,$ZodEncodeError:()=>$r,$ZodEnum:()=>cp,$ZodError:()=>sf,$ZodExactOptional:()=>mp,$ZodFile:()=>lp,$ZodFunction:()=>Sp,$ZodGUID:()=>pm,$ZodIBAN:()=>Dm,$ZodIPv4:()=>Rm,$ZodIPv6:()=>Mm,$ZodISODate:()=>Am,$ZodISODateTime:()=>Em,$ZodISODuration:()=>km,$ZodISOTime:()=>Pm,$ZodIntersection:()=>op,$ZodJWT:()=>Zm,$ZodKSUID:()=>Cm,$ZodLazy:()=>Gi,$ZodLiteral:()=>up,$ZodMAC:()=>Im,$ZodMap:()=>sp,$ZodNaN:()=>bp,$ZodNanoID:()=>xm,$ZodNever:()=>Hm,$ZodNonOptional:()=>gp,$ZodNull:()=>jm,$ZodNullable:()=>pp,$ZodNumber:()=>Da,$ZodNumberFormat:()=>Gm,$ZodObject:()=>Cy,$ZodObjectJIT:()=>ep,$ZodOptional:()=>Ga,$ZodPipe:()=>Ua,$ZodPrefault:()=>hp,$ZodPreprocess:()=>xp,$ZodPromise:()=>vp,$ZodReadonly:()=>$p,$ZodRealError:()=>pt,$ZodRecord:()=>ip,$ZodRegistry:()=>Ya,$ZodSet:()=>ap,$ZodString:()=>on,$ZodStringFormat:()=>fe,$ZodSuccess:()=>yp,$ZodSymbol:()=>Qm,$ZodTemplateLiteral:()=>wp,$ZodTransform:()=>fp,$ZodTuple:()=>Ba,$ZodType:()=>q,$ZodULID:()=>Sm,$ZodURL:()=>_m,$ZodUUID:()=>dm,$ZodUndefined:()=>Vm,$ZodUnion:()=>Zi,$ZodUnknown:()=>Wm,$ZodVoid:()=>Xm,$ZodXID:()=>vm,$ZodXor:()=>tp,$brand:()=>rf,$constructor:()=>E,$input:()=>kp,$output:()=>Pp,Doc:()=>nn,INVALID:()=>tt,JSONSchema:()=>r_,JSONSchemaGenerator:()=>Ic,NEVER:()=>tf,TimePrecision:()=>Bp,URL_BAD_FORMAT:()=>gm,URL_UNPARSEABLE:()=>Li,ZodCompileAsyncError:()=>It,ZodCompileUnsupportedError:()=>re,_any:()=>od,_array:()=>fd,_base64:()=>bc,_base64url:()=>xc,_bigint:()=>Yp,_boolean:()=>Hp,_catch:()=>zS,_check:()=>Zy,_cidrv4:()=>yc,_cidrv6:()=>_c,_coercedBigint:()=>Kp,_coercedBoolean:()=>Xp,_coercedDate:()=>ud,_coercedNumber:()=>Up,_coercedString:()=>Op,_creditCard:()=>Dp,_cuid:()=>lc,_cuid2:()=>fc,_custom:()=>pd,_date:()=>cd,_decode:()=>ma,_decodeAsync:()=>da,_default:()=>TS,_discriminatedUnion:()=>$S,_e164:()=>$c,_email:()=>rc,_emoji:()=>cc,_encode:()=>fa,_encodeAsync:()=>pa,_endsWith:()=>wo,_enum:()=>AS,_file:()=>md,_float32:()=>Vp,_float64:()=>jp,_gt:()=>Vt,_gte:()=>_t,_guid:()=>nc,_iban:()=>Zp,_includes:()=>xo,_int:()=>Qp,_int32:()=>qp,_int64:()=>Jp,_intersection:()=>wS,_ipv4:()=>hc,_ipv6:()=>gc,_isoDate:()=>Wi,_isoDateTime:()=>qi,_isoDuration:()=>Xi,_isoTime:()=>Hi,_jwt:()=>wc,_ksuid:()=>dc,_lazy:()=>ZS,_length:()=>fn,_literal:()=>kS,_lowercase:()=>_o,_lt:()=>Qt,_lte:()=>yt,_mac:()=>Fp,_map:()=>CS,_max:()=>yt,_maxLength:()=>ln,_maxSize:()=>vr,_mime:()=>vo,_min:()=>_t,_minLength:()=>nr,_minSize:()=>jt,_multipleOf:()=>Sr,_nan:()=>ld,_nanoid:()=>uc,_nativeEnum:()=>PS,_negative:()=>vc,_never:()=>sd,_nonnegative:()=>Ec,_nonoptional:()=>LS,_nonpositive:()=>Cc,_normalize:()=>Co,_null:()=>nd,_nullable:()=>IS,_number:()=>Gp,_optional:()=>MS,_overwrite:()=>Tt,_parse:()=>co,_parseAsync:()=>uo,_pipe:()=>OS,_positive:()=>Sc,_promise:()=>BS,_properties:()=>So,_property:()=>Ac,_readonly:()=>FS,_record:()=>vS,_refine:()=>dd,_regex:()=>yo,_safeDecode:()=>ga,_safeDecodeAsync:()=>_a,_safeEncode:()=>ha,_safeEncodeAsync:()=>ya,_safeParse:()=>lo,_safeParseAsync:()=>fo,_set:()=>ES,_size:()=>un,_slugify:()=>ko,_startsWith:()=>$o,_string:()=>zp,_stringFormat:()=>mn,_stringbool:()=>_d,_success:()=>NS,_superRefine:()=>hd,_symbol:()=>td,_templateLiteral:()=>DS,_toLowerCase:()=>Ao,_toUpperCase:()=>Po,_transform:()=>RS,_trim:()=>Eo,_tuple:()=>SS,_uint32:()=>Wp,_uint64:()=>ed,_ulid:()=>mc,_undefined:()=>rd,_union:()=>bS,_unknown:()=>id,_uppercase:()=>bo,_url:()=>ji,_uuid:()=>oc,_uuidv4:()=>ic,_uuidv6:()=>sc,_uuidv7:()=>ac,_void:()=>ad,_xid:()=>pc,_xor:()=>xS,base64Charset:()=>La,base64urlCharset:()=>Fi,canParseURL:()=>ym,clone:()=>le,compile:()=>Tp,compileFn:()=>ec,config:()=>Pe,createStandardJSONSchemaMethod:()=>Ro,createToJSONSchemaMethod:()=>xd,decode:()=>A3,decodeAsync:()=>k3,describe:()=>gd,encode:()=>E3,encodeAsync:()=>P3,extractDefs:()=>Er,finalize:()=>Ar,flattenError:()=>Ei,formatError:()=>Ai,getDiscriminatedOption:()=>rp,globalConfig:()=>Ue,globalRegistry:()=>We,handleUnrepresentable:()=>Fe,initializeContext:()=>Cr,isBackEdge:()=>Ha,isRecursiveSchema:()=>Wa,isValidBase64:()=>Oi,isValidBase64URL:()=>Na,isValidCIDRv6:()=>Ta,isValidCreditCard:()=>za,isValidIBAN:()=>Oa,isValidIPv6:()=>zi,isValidJWT:()=>Fa,locales:()=>Xa,memoizer:()=>Vi,mergeValues:()=>po,meta:()=>yd,parse:()=>ua,parseAsync:()=>la,parseURLObject:()=>wy,prettifyError:()=>cf,process:()=>me,processSchema:()=>me,regexes:()=>Et,registry:()=>Ka,safeDecode:()=>M3,safeDecodeAsync:()=>T3,safeEncode:()=>R3,safeEncodeAsync:()=>I3,safeParse:()=>$3,safeParseAsync:()=>w3,standardProps:()=>ka,stripTabAndNewline:()=>Ni,toDotPath:()=>ty,toJSONSchema:()=>Mc,toZod:()=>gi,treeifyError:()=>af,urlHostnameOk:()=>Ma,urlProtocolOk:()=>Ia,util:()=>F,validate:()=>Pi,validateAsync:()=>ki,validateURL:()=>Ra,version:()=>fm,withParser:()=>Ja});var F={};hr(F,{BIGINT_FORMAT_RANGES:()=>$i,CONSTANT_CATCH:()=>aa,Class:()=>Ql,NUMBER_FORMAT_RANGES:()=>xi,aborted:()=>et,allowsEval:()=>ql,assert:()=>B4,assertEqual:()=>O4,assertIs:()=>D4,assertNever:()=>Z4,assertNotEqual:()=>F4,assignProp:()=>qe,attachSchema:()=>wi,base64ToUint8Array:()=>H1,base64urlToUint8Array:()=>s3,cached:()=>oo,captureStackTrace:()=>oa,cleanEnum:()=>i3,cleanRegex:()=>tr,clone:()=>le,cloneDef:()=>Q4,codePointLength:()=>tn,constantCatch:()=>Jl,createTransparentProxy:()=>X4,defineLazy:()=>Vl,defineLazyInternal:()=>X,derived:()=>l3,esc:()=>Je,escapeRegex:()=>Ct,explicitlyAborted:()=>Xl,extend:()=>J4,finalizeIssue:()=>ft,floatSafeRemainder:()=>yi,getElementAtPath:()=>V4,getEnumValues:()=>ro,getLengthableOrigin:()=>vi,getParsedType:()=>H4,getSizableOrigin:()=>Si,hexToUint8Array:()=>c3,hide:()=>Ci,installLazyProp:()=>d3,isObject:()=>en,isPlainObject:()=>vt,issue:()=>ao,joinValues:()=>ra,jsonStringifyReplacer:()=>no,members:()=>Kl,merge:()=>t3,mergeDefs:()=>Mt,normalizeParams:()=>N,nullish:()=>na,numKeys:()=>W4,objectClone:()=>G4,omit:()=>K4,optionalKeys:()=>Hl,own:()=>xr,parsedType:()=>Yl,partial:()=>r3,pick:()=>Y4,prefixIssues:()=>lt,primitiveTypes:()=>Wl,promiseAllObject:()=>j4,propertyKeyTypes:()=>bi,randomString:()=>q4,rawShape:()=>io,required:()=>n3,safeExtend:()=>e3,shallowClone:()=>_i,sizeCaps:()=>so,slugify:()=>jl,stringifyPrimitive:()=>ia,toZod:()=>gi,uint8ArrayToBase64:()=>X1,uint8ArrayToBase64url:()=>a3,uint8ArrayToHex:()=>u3,unwrapMessage:()=>to});function O4(e){return e}function F4(e){return e}function gi(){return e=>e}function D4(e){}function Z4(e){throw new Error("Unexpected value in exhaustive check")}function B4(e){}function ro(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 ra(e,t="|"){return e.map(r=>ia(r)).join(t)}function no(e,t){return typeof t=="bigint"?t.toString():t}var Ul=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 oo(e){return new Ul(e)}function na(e){return e==null}function tr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yi(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 V1=Symbol("evaluating");function Vl(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==V1)return n===void 0&&(n=V1,n=r()),n},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function G4(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 io(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function er(e){return io(e._zod.def)??e._zod.def.shape}function j1(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return qe(this,t,n),n},enumerable:true,configurable:true});}function q1(e,t,r){t in e?qe(e,t,r):e[t]=r;}function Jr(e,t,r,n){let o=er(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?j1(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):q1(e,i,n?n(s.value,i):s.value));}}function U4(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?j1(e,r,()=>t[r]):q1(e,r,n.value));}}function Mt(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n);}return Object.defineProperties({},t)}function Q4(e){return Mt(e._zod.def)}function V4(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function j4(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 q4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Je(e){return JSON.stringify(e)}function jl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var oa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function en(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ql=oo(()=>{if(Ue.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function vt(e){if(en(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let r=t.prototype;return !(en(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function _i(e){return vt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function W4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var H4=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}`)}},bi=new Set(["string","number","symbol"]),Wl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(e,t,r){let n=new e._zod.constr(t??e._zod.def);return (!t||r?.parent)&&(n._zod.parent=e),n}function N(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 X4(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 ia(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Hl(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var xi={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]},$i={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Y4(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 Jr(i,e,sa(e,t)),le(e,Mt(r,{shape:i,checks:[]}))}function sa(e,t){let r=er(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 K4(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(sa(e,t)),s={};return Jr(s,e,Reflect.ownKeys(er(e)).filter(a=>!i.has(a))),le(e,Mt(r,{shape:s,checks:[]}))}function J4(e,t){if(!vt(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=er(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 le(e,Mt(e._zod.def,{shape:W1(e,t)}))}function W1(e,t){let r={};return Jr(r,e,Reflect.ownKeys(er(e))),U4(r,t),r}function e3(e,t){if(!vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return le(e,Mt(e._zod.def,{shape:W1(e,t)}))}function t3(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={};Jr(r,e,Reflect.ownKeys(er(e))),Jr(r,t,Reflect.ownKeys(er(t)));let n=Mt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return le(e,n)}function r3(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(sa(t,r)):void 0,c={};return Jr(c,t,Reflect.ownKeys(er(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),le(t,Mt(t._zod.def,{shape:c,checks:[]}))}function n3(e,t,r){let n=r?new Set(sa(t,r)):void 0,o={};return Jr(o,t,Reflect.ownKeys(er(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),le(t,Mt(t._zod.def,{shape:o}))}function et(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 Xl(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 lt(e,t){return t.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(e),r})}function to(e){return typeof e=="string"?e:e?.message}function so(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 ft(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:to(e.inst?._zod.def?.error?.(e))??to(i?.(e))??to(t?.error?.(e))??to(r.customError?.(e))??to(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 Si(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var o3=/[\uD800-\uDBFF]/;function tn(e){let t=e.length;if(!o3.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 vi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Yl(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 ao(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function i3(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function H1(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 X1(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function s3(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return H1(t+r)}function a3(e){return X1(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function c3(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 u3(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ql=class{constructor(...t){}};function Kl(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:false}):f3(e,r,n.value);}}function xr(e,t,r,n=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:n,value:r}),r}function Ci(e,t,r){return xr(e,t,r,false)}function l3(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:true,enumerable:true,get(){return xr(this,r,n(this))},set(o){xr(this,r,o);}});}return t}function f3(e,t,r){Object.defineProperty(e,t,{configurable:true,get(){return this==null?r:xr(this,t,r.bind(this))},set(n){xr(this,t,n);}});}function m3(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Gl,br=false,p3={configurable:true,get(){br=true;}};function X(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Gl!==e._zod){Gl=void 0;return}Gl=e._zod,Object.defineProperty(n,t,{configurable:true,get(){Object.defineProperty(this,t,p3);let o=br;br=false;try{let i=r(this);return br?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),br=br||o,i}catch(i){throw delete this[t],br=br||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function d3(e,t,r,n){let o=m3(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 aa="~constantCatch";function Jl(e){let t=()=>e;return t[aa]=true,t}var Y1,tf=Object.freeze({status:"aborted"}),ef={value:void 0,enumerable:false},K1="captureStackTrace"in Error?Error:null;function h3(e){let t=K1;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0;}catch{return K1=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 {ef.value=new i(m);try{Object.defineProperty(p,"_zod",ef);}finally{ef.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,y=d;for(;y&&y!==g;)y=Object.getPrototypeOf(y);let _=y??d;a.has(_)||(a.add(_),Kl(_,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?h3(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 rf=Symbol("zod_brand"),mt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},$r=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(Y1=globalThis).__zod_globalConfig??(Y1.__zod_globalConfig={});var Ue=globalThis.__zod_globalConfig;function Pe(e){return e&&Object.assign(Ue,e),Ue}function g3(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,no,2)),e.message}function y3(e){this._zod.message=e;}var _3={get:g3,set:y3,enumerable:true,configurable:true},of={value:void 0,enumerable:false},J1=new WeakSet([Object.prototype,Error.prototype]),ey=(e,t)=>{e.name="$ZodError",of.value=t,Object.defineProperty(e,"issues",of),of.value=void 0,Object.defineProperty(e,"message",_3);let r=Object.getPrototypeOf(e);J1.has(r)||(J1.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});}}));},sf=E("$ZodError",ey),pt=E("$ZodError",ey,void 0,{Parent:Error});function b3(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 Ei(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?b3(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return {formErrors:n,fieldErrors:r}}function Ai(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 af(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 ty(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 cf(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 ${ty(n.path)}`);return t.join(`
|
|
2
|
-
`)}function ca(e,t){return {callee:t?.callee??e,Err:t?.Err}}var co=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 mt;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>ft(u,s,Pe())));throw oa(c,i?.callee??t),c}return a.value};return t},ua=co(pt),uo=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=>ft(u,s,Pe())));throw oa(c,i?.callee??t),c}return a.value};return t},la=uo(pt),lo=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 mt;return i.issues.length?ry(e,i.issues,o):{success:true,data:i.value}},$3=lo(pt);function ry(e,t,r){let n;return {success:false,get error(){return n||(n=new e(t.map(o=>ft(o,r,Pe()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0;}}}var fo=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?ry(e,i.issues,o):{success:true,data:i.value}},w3=fo(pt),S3=Symbol.for("zod.compile.invalid"),v3=Symbol.for("zod.compile.fallback"),Pi=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==S3)return true;if(n.definite===true&&r===void 0)return false}return C3(e,t,r)});function C3(e,t,r){let n=r?{...r,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(n[v3]=true,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new mt;return i.issues.length===0}var ki=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},fa=e=>{let t=co(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,ca(r,s))};return r},E3=fa(pt),ma=e=>{let t=co(e),r=(n,o,i,s)=>t(n,o,i,ca(r,s));return r},A3=ma(pt),pa=e=>{let t=uo(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,ca(r,s))};return r},P3=pa(pt),da=e=>{let t=uo(e),r=async(n,o,i,s)=>await t(n,o,i,ca(r,s));return r},k3=da(pt),ha=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return lo(e)(t,r,o)},R3=ha(pt),ga=e=>(t,r,n)=>lo(e)(t,r,n),M3=ga(pt),ya=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return fo(e)(t,r,o)},I3=ya(pt),_a=e=>async(t,r,n)=>fo(e)(t,r,n),T3=_a(pt);var Et={};hr(Et,{anyString:()=>Nf,base64:()=>Ef,base64url:()=>Af,bigint:()=>Of,boolean:()=>Ff,browserEmail:()=>B3,cidrv4:()=>vf,cidrv6:()=>Cf,creditCard:()=>ba,cuid:()=>lf,cuid2:()=>ff,currencyCode:()=>Mf,date:()=>If,datetime:()=>Lf,domain:()=>kf,duration:()=>yf,e164:()=>Rf,email:()=>bf,emoji:()=>xf,extendedDuration:()=>L3,guid:()=>_f,hex:()=>Uf,hostname:()=>Pf,html5Email:()=>F3,httpProtocol:()=>Ri,iban:()=>xa,idnEmail:()=>Z3,integer:()=>Mi,ipv4:()=>$f,ipv6:()=>wf,ksuid:()=>df,lowercase:()=>Bf,mac:()=>Sf,md5_base64:()=>V3,md5_base64url:()=>j3,md5_hex:()=>Q3,nanoid:()=>hf,nanoidOfLength:()=>gf,null:()=>Df,number:()=>rr,rfc5322Email:()=>D3,sha1_base64:()=>W3,sha1_base64url:()=>H3,sha1_hex:()=>q3,sha256_base64:()=>Y3,sha256_base64url:()=>K3,sha256_hex:()=>X3,sha384_base64:()=>ew,sha384_base64url:()=>tw,sha384_hex:()=>J3,sha512_base64:()=>nw,sha512_base64url:()=>ow,sha512_hex:()=>rw,string:()=>zf,time:()=>Tf,ulid:()=>mf,undefined:()=>Zf,unicodeEmail:()=>ny,uppercase:()=>Gf,uuid:()=>rn,uuid4:()=>N3,uuid6:()=>z3,uuid7:()=>O3,xid:()=>pf});var lf=/^[cC][0-9a-z]{6,}$/,ff=/^[0-9a-z]+$/,mf=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,pf=/^[0-9a-vA-V]{20}$/,df=/^[A-Za-z0-9]{27}$/,hf=/^[a-zA-Z0-9_-]{21}$/;function gf(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var yf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,L3=/^[-+]?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)?)??$/,_f=/^([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})$/,rn=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)$/,N3=rn(4),z3=rn(6),O3=rn(7),bf=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,F3=/^[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])?)*$/,D3=/^(([^<>()\[\]\\.,;:\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,}))$/,ny=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Z3=ny,B3=/^[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])?)*$/,G3="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function xf(){return new RegExp(G3,"u")}var $f=/^(?:(?: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])$/,wf=/^(([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}|:))$/,Sf=e=>{let t=Ct(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},vf=/^((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])$/,Cf=/^(([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])$/,Ef=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Af=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Pf=/^(?=.{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])?)*\.?$/,kf=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Ri=/^https?$/,Rf=/^\+[1-9]\d{6,14}$/,ba=/^\d(?:[ -]?\d){11,18}$/,Mf=/^(?: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)$/,xa=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,oy="(?:(?:\\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 U3(e){return new RegExp(`^${e}$`)}var If=U3(oy);function uf(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 Tf(e){return new RegExp(`^${uf(e)}$`)}function Lf(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${uf({precision:e.precision,seconds:true})}(?:${t.join("|")})`,n=e.local?`${r}|${uf({precision:e.precision})}`:r;return new RegExp(`^${oy}T(?:${n})$`)}var Nf=/^[\s\S]{0,}$/,zf=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Of=/^-?\d+n?$/,Mi=/^-?\d+$/,rr=/^-?\d+(?:\.\d+)?$/,Ff=/^(?:true|false)$/i,Df=/^null$/i;var Zf=/^undefined$/i;var Bf=/^[^A-Z]*$/,Gf=/^[^a-z]*$/,Uf=/^[0-9a-fA-F]*$/;function Ii(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ti(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Q3=/^[0-9a-fA-F]{32}$/,V3=Ii(22,"=="),j3=Ti(22),q3=/^[0-9a-fA-F]{40}$/,W3=Ii(27,"="),H3=Ti(27),X3=/^[0-9a-fA-F]{64}$/,Y3=Ii(43,"="),K3=Ti(43),J3=/^[0-9a-fA-F]{96}$/,ew=Ii(64,""),tw=Ti(64),rw=/^[0-9a-fA-F]{128}$/,nw=Ii(86,"=="),ow=Ti(86);var _e=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[]);}),Qf=e=>{let t=e.value;return !na(t)&&t.size!==void 0},Vf=e=>{let t=e.value;return !na(t)&&t.length!==void 0},$a={number:"number",bigint:"bigint",object:"date"},Sa=E("$ZodCheckLessThan",(e,t)=>{_e.init(e,t);let r=$a[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:$a[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});};}),va=E("$ZodCheckGreaterThan",(e,t)=>{_e.init(e,t);let r=$a[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:$a[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});};}),jf=E("$ZodCheckMultipleOf",(e,t)=>{_e.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):yi(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});};}),qf=E("$ZodCheckNumberFormat",(e,t)=>{_e.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=xi[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});};}),Wf=E("$ZodCheckBigIntFormat",(e,t)=>{_e.init(e,t);let[r,n]=$i[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});};}),Hf=E("$ZodCheckMaxSize",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Qf),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:Si(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Xf=E("$ZodCheckMinSize",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Qf),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:Si(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Yf=E("$ZodCheckSizeEquals",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Qf),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:Si(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});};}),Kf=E("$ZodCheckMaxLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?tn(o):i)<=t.maximum)return;let a=vi(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Jf=E("$ZodCheckMinLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?tn(o):i)>=t.minimum)return;let a=vi(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),em=E("$ZodCheckLengthEquals",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?tn(o):i;if(s===t.length)return;let a=vi(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;_e.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=()=>{});}),tm=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});};}),rm=E("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bf),mo.init(e,t);}),nm=E("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Gf),mo.init(e,t);}),om=E("$ZodCheckIncludes",(e,t)=>{_e.init(e,t);let r=Ct(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});};}),im=E("$ZodCheckStartsWith",(e,t)=>{_e.init(e,t);let r=new RegExp(`^${Ct(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});};}),sm=E("$ZodCheckEndsWith",(e,t)=>{_e.init(e,t);let r=new RegExp(`.*${Ct(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 wa(e,t,r){e.issues.length&&t.issues.push(...lt(r,e.issues));}var am=E("$ZodCheckProperty",(e,t)=>{_e.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=>wa(o,r,t.property));wa(n,r,t.property);};}),cm=E("$ZodCheckProperties",(e,t)=>{_e.init(e,t),Ci(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=>wa(u,n,s)))):wa(c,n,s);}if(i)return Promise.all(i).then(()=>{})};}),um=E("$ZodCheckMimeType",(e,t)=>{_e.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});};}),lm=E("$ZodCheckOverwrite",(e,t)=>{_e.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value);};});var nn=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 b4=Object.defineProperty;var hr=(e,t)=>{for(var r in t)b4(e,r,{get:t[r],enumerable:true});};var jn;(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 _=e.getNumDataCodewords(m,c)*8,b=o.getTotalBits(a,m);if(b<=_){h=b;break}if(m>=l)throw new RangeError("Data too long")}for(let _ of [e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&h<=e.getNumDataCodewords(m,_)*8&&(c=_);let d=[];for(let _ of a){t(_.mode.modeBits,4,d),t(_.numChars,_.mode.numCharCountBits(m),d);for(let b of _.getData())d.push(b);}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 _=236;d.length<g;_^=253)t(_,8,d);let y=[];for(;y.length*8<d.length;)y.push(0);return d.forEach((_,b)=>y[b>>>3]|=_<<7-(b&7)),new e(m,c,y,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 _=0,b=0;_<l;_++){let S=a.slice(b,b+h-f+(_<m?0:1));b+=S.length;let v=e.reedSolomonComputeRemainder(S,g);_<m&&S.push(0),d.push(S.concat(v));}let y=[];for(let _=0;_<d[0].length;_++)d.forEach((b,S)=>{(_!=h-f||S>=m)&&y.push(b[_]);});return n(y.length==p),y}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;})(jn||={});(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||={});})(jn||={});(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||={});})(jn||={});var Le=jn;var Ke={L:Le.QrCode.Ecc.LOW,M:Le.QrCode.Ecc.MEDIUM,Q:Le.QrCode.Ecc.QUARTILE,H:Le.QrCode.Ecc.HIGH},ve=128,Zt="Q",Ne="#FFFFFF",je="#000000";var ze=0;var Ws=.1;function Oe(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 $t(e,t="#000000"){return e?typeof e=="string"?{type:"solid",color:e}:e:{type:"solid",color:t}}function qn(e){return !e||typeof e=="string"?false:e.type==="linear"||e.type==="radial"||e.type==="angular"}function xl(e){return typeof e=="object"&&e!==null&&e.type==="image"}function x4(e,t="#000000"){let r=$t(e,t);return r.type==="solid"?r.color:r.type==="image"?r.underlay||t:r.stops[0]?.color||t}function Z1(e="center"){let[t,r]=e.split("-");return e==="center"?"center":r?`${r} ${t}`:t==="top"||t==="bottom"?`center ${t}`:`${t} center`}function $4(e){if(!e)return "#000000";if(typeof e=="string")return e;let t=$t(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")}")`} ${Z1(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 Wn=["logo","halftone"],Hn={logo:["blend","badge"],halftone:["color","mono"]},Bt=192,Hs=["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"],$l=["diamond","star","banner"],Xs=["square","rounded","gear","circle","diya","extra-rounded","message","pointy","leaf","drop","octagon","bevel","squircle","cushion","shield","petal","leaf-reverse"],wl=["curly"],Sl=["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"],vl=["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"],ut=24,Cl="Scan me",Hr=.5,gr=1.5,El=["square","rounded","circle"],Pl=.1,fi=.3,Al=.25,Rl=2,Xn=.5,mi=1,kl=.07,Ml=["square","circle","heart"],Il=3,wt=64,kt=8,Tl=.42,Ys=["topLeft","topRight","bottomLeft"];function se(e,t=3){let r=10**t;return Math.round(e*r)/r+0}function $(e,t=3){return String(se(e,t))}function k(e,...t){let r=e[0]??"";for(let n=0;n<t.length;n++){let o=t[n];r+=(typeof o=="number"?$(o):o)+(e[n+1]??"");}return r}var w4={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},S4=/^[MmLlHhVvCcSsQqTtAaZz0-9.,+\-\s]*$/,Ll=/[+-]?(?:\d+\.?\d*|\.\d+)/y;function pi(e,t=Number.POSITIVE_INFINITY){if(!S4.test(e))return null;let r=[],n=0,o=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n++;},i=()=>{o(),Ll.lastIndex=n;let c=Ll.exec(e);if(!c)return null;let u=c[0],l=u.indexOf(".");if(l>=0&&u.length-l-1>t)return null;n=Ll.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=w4[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 B1(e){let t=0;for(let{command:r}of e)t+=r.toUpperCase()==="A"?4:1;return t}function Nl(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=[$(s[0]*t+u)];break;case "V":f=[$(s[0]*t+l)];break;case "A":f=[$(Math.abs(s[0])*t),$(Math.abs(s[1])*t),$(s[2]),String(s[3]),String(s[4]),$(s[5]*t+u),$(s[6]*t+l)];break;default:f=s.map((p,m)=>$(p*t+(m%2===0?u:l)));}o+=i+f.join(" ");}return o}function Ks(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 Yn(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(U1(c,a,l,u)),n.push(a)):l>=0&&n.push(U1(c,a,l,u));}}return n.length>2?n:[]}function U1(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 G1(e){return e.filter(t=>t.length>2).map(t=>`M${t.map(([r,n])=>`${$(r)} ${$(n)}`).join("L")}Z`).join("")}function Xr(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 j1(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 C4=60,Ol=62,zl=47,E4=61,Q1=34,V1=39,Dl=/\s*/y,P4=/[^\s/>]*/y,A4=/[^\s>]*/y,R4=/[^\s=]*/y;function Kn(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function k4(e,t){let r=e.length,n=x=>{let w=Number.POSITIVE_INFINITY,C=-1;return P=>((P<w||C>=0&&C<P)&&(w=P,C=e.indexOf(x,P)),C)},o=n("-->"),i=n("?>"),s=n("]]>"),a=n(">"),c,u=x=>{let w=e.charCodeAt(x);if(w!==Q1&&w!==V1)return x+1;let C=e.indexOf(e[x],x+1);return C<0?r:C+1},l=x=>{for(let w=x;w<r&&!c?.[w];w=u(w)){let C=e.charCodeAt(w);if(C===Ol||C===zl&&e.charCodeAt(w+1)===Ol)return w}c??=new Uint8Array(r);for(let w=x;w<r&&!c[w];w=u(w))c[w]=1;return -1},f=-1,p=-1,m=-1,h=-1,d=x=>{let w=x+1;if(w<f||w>=p){f=w,p=Kn(P4,e,w),m=-1;for(let P=p;P>w;P--){let R=e.charCodeAt(P);if((P===p||R===Q1||R===V1)&&(h=l(P),h>=0)){m=P;break}}}if(m<=w)return -1;let C=e.charCodeAt(h)===zl;return t.open(e.slice(w,m),e.slice(m,h),C),h+(C?2:1)},g=-1,y=-1,_=-1,b=x=>{let w=x+2;if(w<g||w>=y){g=w,y=Kn(A4,e,w);let C=Kn(Dl,e,y);_=y>w&&e.charCodeAt(C)===Ol?C:-1;}return _},S=x=>{if(e.startsWith("<!--",x)){let w=o(x+4);if(w>=0)return w+3}if(e.startsWith("<?",x)){let w=i(x+2);if(w>=0)return w+2}if(e.startsWith("<![CDATA[",x)){let w=s(x+9);if(w>=0)return t.cdata(e.slice(x+9,w)),w+3}if(e.startsWith("<!",x)){let w=a(x+2);if(w>=0)return w+1}if(e.charCodeAt(x+1)===zl){let w=b(x);return w<0?-1:(t.close(),w+1)}return d(x)},v=0;for(;v<r;)if(e.charCodeAt(v)===C4){let x=S(v);v=x<0?v+1:x;}else {let x=e.indexOf("<",v),w=x<0?r:x;t.text(e.slice(v,w)),v=w;}}function M4(e){let t={},r=0;for(;r<e.length;){let n=Kn(R4,e,r);if(n===r){r++;continue}let o=Kn(Dl,e,n);if(e.charCodeAt(o)===E4){let i=Kn(Dl,e,o+1),s=e[i],a=s==='"'||s==="'"?e.indexOf(s,i+1):-1;if(a>=0){t[e.slice(r,n)]=j1(e.slice(i+1,a)),r=a+1;continue}}r=n;}return t}function yr(e){let t={name:"#root",attrs:{},children:[],text:""},r=[t],n=()=>r.at(-1);k4(e,{open(i,s,a){let c=M4(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+=j1(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 Jn=[1,0,0,1,0,0];function Se(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 eo(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))}function Ut(e){return e?(e.match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)??[]).map(Number):[]}function St(e){let t=Jn;if(!e)return t;for(let[,r,n]of e.matchAll(/(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g)){let o=Ut(n),i=Jn;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=Se(Se([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=Se(t,i);}return t}var Fl=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y;function I4(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,y=-m*h+p*d,_=g*g/(u*u)+y*y/(l*l);_>1&&(u*=Math.sqrt(_),l*=Math.sqrt(_));let b=u*u*l*l-u*u*y*y-l*l*g*g,S=u*u*y*y+l*l*g*g,v=(i===s?-1:1)*Math.sqrt(Math.max(0,b/S)),x=v*u*y/l,w=-v*l*g/u,C=p*x-m*w+(e+a)/2,P=m*x+p*w+(t+c)/2,R=(te,G,Y,de)=>Math.atan2(te*de-G*Y,te*Y+G*de),M=R(1,0,(g-x)/u,(y-w)/l),T=R((g-x)/u,(y-w)/l,(-g-x)/u,(-y-w)/l);!s&&T>0?T-=2*Math.PI:s&&T<0&&(T+=2*Math.PI);let L=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2)-1e-9)),D=T/L,B=4/3*Math.tan(D/4),O=(te,G)=>[C+u*p*te-l*m*G,P+u*m*te+l*p*G],j=[];for(let te=0;te<L;te++){let G=M+te*D,Y=G+D,[de,Te]=O(Math.cos(G)-B*Math.sin(G),Math.sin(G)+B*Math.cos(G)),[$e,Z]=O(Math.cos(Y)+B*Math.sin(Y),Math.sin(Y)-B*Math.cos(Y)),[K,J]=te===L-1?[a,c]:O(Math.cos(Y),Math.sin(Y));j.push({op:"C",x1:de,y1:Te,x2:$e,y2:Z,x:K,y:J});}return j}function Jt(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(),Fl.lastIndex=r;let h=Fl.exec(e);return h?(r=Fl.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 y=f();if(y===null)return null;d.push(y);}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,y=d?o:0,_=a.toUpperCase();if(_==="Z"){t.push({op:"Z"}),n=i,o=s,c=null,u=null;continue}if(_==="A"){let x=m(3),w=p(),C=p(),P=m(2);if(!(x&&P)||w===null||C===null)break;let[R,M,T]=x,L=P[0]+g,D=P[1]+y;t.push(...I4(n,o,R,M,T,w,C,L,D)),n=L,o=D,c=null,u=null;continue}let b={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2}[_]??0,S=m(b);if(!S)break;let v=S;switch(_){case "M":n=v[0]+g,o=v[1]+y,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":_!=="V"&&(n=v[0]+g),_==="V"?o=v[0]+y:_==="L"&&(o=v[1]+y),t.push({op:"L",x:n,y:o}),c=null,u=null;break;case "C":case "S":{let x,w;_==="C"?(x=[v[0]+g,v[1]+y],w=v.slice(2)):(x=c?[2*n-c[0],2*o-c[1]]:[n,o],w=v);let C=[w[0]+g,w[1]+y],P=[w[2]+g,w[3]+y];t.push({op:"C",x1:x[0],y1:x[1],x2:C[0],y2:C[1],x:P[0],y:P[1]}),[n,o]=P,c=C,u=null;break}case "Q":case "T":{let x,w;_==="Q"?(x=[v[0]+g,v[1]+y],w=[v[2]+g,v[3]+y]):(x=u?[2*n-u[0],2*o-u[1]]:[n,o],w=[v[0]+g,v[1]+y]),t.push({op:"C",x1:n+2/3*(x[0]-n),y1:o+2/3*(x[1]-o),x2:w[0]+2/3*(x[0]-w[0]),y2:w[1]+2/3*(x[1]-w[1]),x:w[0],y:w[1]}),[n,o]=w,u=x,c=null;break}}}return t}var Js=.5522847498;function Gt(e,t,r,n){if(r<=0||n<=0)return [];let o=r*Js,i=n*Js;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*Js,u=a*Js,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 Yr="qrdx.frame",Kr=1,Jr="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:ut},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"],hi=.95,W1=200,gi=["frame","text","accent","background"],T4=/[\t\n\v\f\r\u0085\u2028\u2029]/g,L4=/[\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 to(e,t=ut){let r=e.slice(0,1e3).normalize("NFC").replace(T4," ").replace(L4,"").replace(/\s+/g," ").trim();return Array.from(r).slice(0,Math.max(0,t)).join("").trim()}function N4(e){for(let t of e)if((t.codePointAt(0)??0)>255)return false;return true}var _r=e=>Math.abs(e*1e3-Math.round(e*1e3))<1e-6;function ea(e){let t=ro(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 O4(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 ro(e){return e.qr.padding??e.qr.size*ee.defaultPadding}var Bl=.52,z4=.35;function F4(e){let t=e.fontSize??e.box.height*Bl;return Math.min(t*gr,e.box.height*hi)}var Zl=(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 q1(e){let t=ea(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 D4([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 Z4(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 B4(e,t,r){let n=ea(t);if(!Zl(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 !q1(t).every(i=>D4(i,o,o.radius??0))}if(e.type==="circle"&&e.hole){let o=e.hole;return !q1(t).every(([i,s])=>Math.hypot(i-e.cx,s-e.cy)<=o+.01)}if(e.type==="polygon"){let o=Yn(e.points,n);return o.length>2&&Z4(o)>1e-6}return true}function Ul(e){let t=U4(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 U4(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=pi(e.d,ee.maxDecimals);return t?{bounds:Xr(Jt(e.d)),segments:B1(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:W1}}}function ta(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=y=>y.x0>=a.x0&&y.y0>=a.y0&&y.x1<=a.x1&&y.y1<=a.y1,{qr:u}=e,l=ro(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=ea(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((y,_)=>{let b=["shapes",_],{bounds:S,segments:v}=Ul(y);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",[...b,"d"]);return}if(c(S)||t("The shape extends outside the artboard",b),y.type==="rect"&&y.hole){let{hole:x}=y;(x.x<y.x||x.y<y.y||x.x+x.width>y.x+y.width+1e-9||x.y+x.height>y.y+y.height+1e-9)&&t("The hole must sit inside its rect",[...b,"hole"]);}y.type==="circle"&&y.hole&&y.hole>=y.r&&t("The hole must be smaller than the circle",[...b,"hole"]),"stroke"in y&&y.stroke&&y.stroke.width>Math.min(o,i)*.1+1e-9&&t("A stroke may be at most 10% of the artboard's shorter side",[...b,"stroke","width"]),u.plate==="background"&&B4(y,e,S)&&t('With qr.plate "background", only background fills (or a ring whose hole holds the plate) may lie under the plate',b),p+=v,typeof y.fill=="object"&&"gradient"in y.fill&&(m+=(y.fill.gradient.steps??32)*v);}),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((y,_)=>{let b=["labels",_];d.has(y.id)&&t(`Label id "${y.id}" is used twice`,[...b,"id"]),d.add(y.id),y.slot!=="fixed"&&(g.has(y.slot)&&t(`Only one label may use the ${y.slot} slot`,[...b,"slot"]),g.add(y.slot));let S=y.maxLength??r.maxTextLength;y.text!==to(y.text,S)&&t(`Label text must be at most ${S} characters, trimmed, with no control or invisible characters (see sanitizeFrameText)`,[...b,"text"]);let v;if(y.type==="text"){v={x0:y.box.x,y0:y.box.y,x1:y.box.x+y.box.width,y1:y.box.y+y.box.height},y.fontSize!==void 0&&y.fontSize>y.box.height*hi+1e-9&&t("fontSize may be at most 95% of the label's row height",[...b,"fontSize"]);let x=y.box.y+y.box.height/2,w=F4(y)*z4,C={x0:v.x0,x1:v.x1,y0:x-w,y1:x+w};(Zl(v,O4(e))||Zl(C,f))&&t("The label overlaps the code or its padding",[...b,"box"]);}else {let{cx:x,cy:w,radius:C}=y.curve,P=y.fontSize*gr*.6;v={x0:x-C-P,y0:w-C-P,x1:x+C+P,y1:w+C+P};let R=Math.hypot(Math.max(f.x0-x,0,x-f.x1),Math.max(f.y0-w,0,w-f.y1));Math.hypot(Math.max(Math.abs(f.x0-x),Math.abs(f.x1-x)),Math.max(Math.abs(f.y0-w),Math.abs(f.y1-w)))<=C-P||R>=C+P||t("The curved label crosses the code or its padding",[...b,"curve"]);}if(c(v)||t("The label extends outside the artboard",b),y.collapse){let x=y.collapse,w=x.y+x.height;(x.y<-1e-9||w>i+1e-9)&&t("The collapse band must sit inside the artboard",[...b,"collapse"]),w>f.y0+1e-6&&x.y<f.y1-1e-6&&t("The collapse band crosses the code or its padding",[...b,"collapse"]);for(let C of h)w>C.y+1e-6&&x.y<C.y+C.height-1e-6&&t("Collapse bands may not overlap",[...b,"collapse"]);h.push(x);}});}var A={};hr(A,{$brand:()=>nf,$input:()=>kp,$output:()=>Rp,INVALID:()=>tt,NEVER:()=>rf,TimePrecision:()=>Up,ZodAny:()=>Rh,ZodArray:()=>Th,ZodBase64:()=>Yc,ZodBase64URL:()=>Kc,ZodBigInt:()=>Zo,ZodBigIntFormat:()=>tu,ZodBoolean:()=>Do,ZodCIDRv4:()=>Hc,ZodCIDRv6:()=>Xc,ZodCUID:()=>Uc,ZodCUID2:()=>Gc,ZodCatch:()=>e0,ZodCodec:()=>us,ZodCompileAsyncError:()=>It,ZodCompileUnsupportedError:()=>re,ZodCreditCard:()=>$h,ZodCustom:()=>ls,ZodCustomStringFormat:()=>yn,ZodDate:()=>ns,ZodDefault:()=>Wh,ZodDiscriminatedUnion:()=>Nh,ZodE164:()=>Jc,ZodEmail:()=>Fc,ZodEmoji:()=>Zc,ZodEnum:()=>Oo,ZodError:()=>t6,ZodExactOptional:()=>iu,ZodFile:()=>Qh,ZodFirstPartyTypeKind:()=>d0,ZodFunction:()=>l0,ZodGUID:()=>Dc,ZodIBAN:()=>wh,ZodIPv4:()=>qc,ZodIPv6:()=>Wc,ZodISODate:()=>Rr,ZodISODateTime:()=>Ar,ZodISODuration:()=>Mr,ZodISOTime:()=>kr,ZodInstanceOf:()=>p0,ZodIntersection:()=>Oh,ZodIssueCode:()=>o6,ZodJWT:()=>eu,ZodKSUID:()=>jc,ZodLazy:()=>a0,ZodLiteral:()=>Gh,ZodMAC:()=>xh,ZodMap:()=>Bh,ZodNaN:()=>r0,ZodNanoID:()=>Bc,ZodNever:()=>Mh,ZodNonOptional:()=>su,ZodNull:()=>Ph,ZodNullable:()=>qh,ZodNumber:()=>Fo,ZodNumberFormat:()=>_n,ZodObject:()=>is,ZodOptional:()=>as,ZodPipe:()=>cs,ZodPrefault:()=>Xh,ZodPreprocess:()=>n0,ZodPromise:()=>u0,ZodReadonly:()=>o0,ZodRealError:()=>dt,ZodRecord:()=>No,ZodSet:()=>Uh,ZodString:()=>zo,ZodStringFormat:()=>he,ZodSuccess:()=>Jh,ZodSymbol:()=>Ch,ZodTemplateLiteral:()=>s0,ZodTransform:()=>Vh,ZodTuple:()=>Fh,ZodType:()=>H,ZodULID:()=>Qc,ZodURL:()=>rs,ZodUUID:()=>Wt,ZodUndefined:()=>Eh,ZodUnion:()=>ss,ZodUnknown:()=>kh,ZodVoid:()=>Ih,ZodXID:()=>Vc,ZodXor:()=>Lh,_ZodString:()=>zc,_default:()=>Hh,_function:()=>bb,any:()=>X_,array:()=>os,base64:()=>k_,base64url:()=>M_,bigint:()=>V_,boolean:()=>vh,catch:()=>t0,check:()=>xb,cidrv4:()=>A_,cidrv6:()=>R_,clone:()=>le,codec:()=>hb,coerce:()=>g0,compile:()=>Lp,config:()=>Ae,core:()=>or,creditCard:()=>T_,cuid:()=>x_,cuid2:()=>$_,currencyCode:()=>D_,custom:()=>$b,date:()=>K_,decode:()=>ph,decodeAsync:()=>hh,deepPartial:()=>Lb,describe:()=>wb,discriminatedUnion:()=>ob,e164:()=>I_,email:()=>l_,emoji:()=>__,encode:()=>mh,encodeAsync:()=>dh,endsWith:()=>vo,enum:()=>nu,exactOptional:()=>jh,file:()=>fb,flattenError:()=>Pi,float32:()=>B_,float64:()=>U_,formatError:()=>Ai,fromJSONSchema:()=>Ib,function:()=>bb,getDiscriminatedOption:()=>np,getErrorMap:()=>s6,globalRegistry:()=>We,gt:()=>jt,gte:()=>_t,guid:()=>f_,hash:()=>Z_,hex:()=>F_,hostname:()=>z_,httpUrl:()=>y_,iban:()=>L_,includes:()=>wo,input:()=>Ob,instanceof:()=>vb,int:()=>Nc,int32:()=>G_,int64:()=>j_,intersection:()=>zh,invertCodec:()=>gb,ipv4:()=>C_,ipv6:()=>P_,iso:()=>fs,json:()=>Eb,jwt:()=>N_,keyof:()=>J_,ksuid:()=>v_,lazy:()=>c0,length:()=>mn,literal:()=>lb,locales:()=>Xa,looseObject:()=>rb,looseRecord:()=>sb,lowercase:()=>xo,lt:()=>Vt,lte:()=>yt,mac:()=>E_,map:()=>ab,maxLength:()=>fn,maxSize:()=>vr,memoizer:()=>ji,meta:()=>Sb,mime:()=>Eo,minLength:()=>nr,minSize:()=>qt,multipleOf:()=>Sr,nan:()=>db,nanoid:()=>b_,nativeEnum:()=>ub,negative:()=>vc,never:()=>ru,nonnegative:()=>Ec,nonoptional:()=>Kh,nonpositive:()=>Cc,normalize:()=>Po,null:()=>Ah,nullable:()=>ts,nullish:()=>mb,number:()=>Sh,object:()=>eb,optional:()=>hn,output:()=>zb,overwrite:()=>Tt,parse:()=>ch,parseAsync:()=>uh,partialRecord:()=>ib,pipe:()=>Oc,positive:()=>Sc,prefault:()=>Yh,preprocess:()=>Pb,prettifyError:()=>uf,promise:()=>_b,properties:()=>Co,property:()=>Pc,readonly:()=>i0,record:()=>Zh,refine:()=>f0,regex:()=>bo,regexes:()=>Et,registry:()=>Ka,safeDecode:()=>yh,safeDecodeAsync:()=>bh,safeEncode:()=>gh,safeEncodeAsync:()=>_h,safeParse:()=>lh,safeParseAsync:()=>fh,set:()=>cb,setErrorMap:()=>i6,size:()=>ln,slugify:()=>Mo,startsWith:()=>So,strictObject:()=>tb,string:()=>es,stringFormat:()=>O_,stringbool:()=>Cb,success:()=>pb,superRefine:()=>m0,symbol:()=>W_,templateLiteral:()=>yb,toJSONSchema:()=>Mc,toLowerCase:()=>Ro,toUpperCase:()=>ko,toZod:()=>yi,transform:()=>ou,treeifyError:()=>cf,trim:()=>Ao,tuple:()=>Dh,uint32:()=>Q_,uint64:()=>q_,ulid:()=>w_,undefined:()=>H_,union:()=>Bo,unknown:()=>dn,uppercase:()=>$o,url:()=>g_,util:()=>F,uuid:()=>m_,uuidv4:()=>p_,uuidv6:()=>d_,uuidv7:()=>h_,validate:()=>Ri,validateAsync:()=>ki,void:()=>Y_,withParser:()=>Ja,xid:()=>S_,xor:()=>nb});var or={};hr(or,{$ZodAny:()=>Wm,$ZodArray:()=>ep,$ZodAsyncError:()=>mt,$ZodBase64:()=>Om,$ZodBase64URL:()=>zm,$ZodBigInt:()=>Za,$ZodBigIntFormat:()=>Qm,$ZodBoolean:()=>Zi,$ZodCIDRv4:()=>Lm,$ZodCIDRv6:()=>Nm,$ZodCUID:()=>wm,$ZodCUID2:()=>Sm,$ZodCatch:()=>bp,$ZodCheck:()=>_e,$ZodCheckBigIntFormat:()=>Hf,$ZodCheckEndsWith:()=>am,$ZodCheckGreaterThan:()=>va,$ZodCheckIncludes:()=>im,$ZodCheckLengthEquals:()=>tm,$ZodCheckLessThan:()=>Sa,$ZodCheckLowerCase:()=>nm,$ZodCheckMaxLength:()=>Jf,$ZodCheckMaxSize:()=>Xf,$ZodCheckMimeType:()=>lm,$ZodCheckMinLength:()=>em,$ZodCheckMinSize:()=>Yf,$ZodCheckMultipleOf:()=>qf,$ZodCheckNumberFormat:()=>Wf,$ZodCheckOverwrite:()=>fm,$ZodCheckProperties:()=>um,$ZodCheckProperty:()=>cm,$ZodCheckRegex:()=>rm,$ZodCheckSizeEquals:()=>Kf,$ZodCheckStartsWith:()=>sm,$ZodCheckStringFormat:()=>ho,$ZodCheckUpperCase:()=>om,$ZodCodec:()=>Ui,$ZodCreditCard:()=>Dm,$ZodCustom:()=>Ep,$ZodCustomStringFormat:()=>Um,$ZodCyclicError:()=>qa,$ZodDate:()=>Km,$ZodDefault:()=>hp,$ZodDiscriminatedUnion:()=>op,$ZodE164:()=>Fm,$ZodEmail:()=>gm,$ZodEmoji:()=>xm,$ZodEncodeError:()=>$r,$ZodEnum:()=>up,$ZodError:()=>af,$ZodExactOptional:()=>pp,$ZodFile:()=>fp,$ZodFunction:()=>vp,$ZodGUID:()=>dm,$ZodIBAN:()=>Zm,$ZodIPv4:()=>Mm,$ZodIPv6:()=>Im,$ZodISODate:()=>Am,$ZodISODateTime:()=>Pm,$ZodISODuration:()=>km,$ZodISOTime:()=>Rm,$ZodIntersection:()=>ip,$ZodJWT:()=>Bm,$ZodKSUID:()=>Em,$ZodLazy:()=>Gi,$ZodLiteral:()=>lp,$ZodMAC:()=>Tm,$ZodMap:()=>ap,$ZodNaN:()=>xp,$ZodNanoID:()=>$m,$ZodNever:()=>Xm,$ZodNonOptional:()=>yp,$ZodNull:()=>qm,$ZodNullable:()=>dp,$ZodNumber:()=>Da,$ZodNumberFormat:()=>Gm,$ZodObject:()=>Ry,$ZodObjectJIT:()=>tp,$ZodOptional:()=>Ua,$ZodPipe:()=>Ga,$ZodPrefault:()=>gp,$ZodPreprocess:()=>$p,$ZodPromise:()=>Cp,$ZodReadonly:()=>wp,$ZodRealError:()=>pt,$ZodRecord:()=>sp,$ZodRegistry:()=>Ya,$ZodSet:()=>cp,$ZodString:()=>sn,$ZodStringFormat:()=>fe,$ZodSuccess:()=>_p,$ZodSymbol:()=>Vm,$ZodTemplateLiteral:()=>Sp,$ZodTransform:()=>mp,$ZodTuple:()=>Ba,$ZodType:()=>q,$ZodULID:()=>vm,$ZodURL:()=>bm,$ZodUUID:()=>hm,$ZodUndefined:()=>jm,$ZodUnion:()=>Bi,$ZodUnknown:()=>Hm,$ZodVoid:()=>Ym,$ZodXID:()=>Cm,$ZodXor:()=>rp,$brand:()=>nf,$constructor:()=>E,$input:()=>kp,$output:()=>Rp,Doc:()=>on,INVALID:()=>tt,JSONSchema:()=>s_,JSONSchemaGenerator:()=>Ic,NEVER:()=>rf,TimePrecision:()=>Up,URL_BAD_FORMAT:()=>ym,URL_UNPARSEABLE:()=>Ni,ZodCompileAsyncError:()=>It,ZodCompileUnsupportedError:()=>re,_any:()=>id,_array:()=>md,_base64:()=>bc,_base64url:()=>xc,_bigint:()=>Kp,_boolean:()=>Xp,_catch:()=>US,_check:()=>Qy,_cidrv4:()=>yc,_cidrv6:()=>_c,_coercedBigint:()=>Jp,_coercedBoolean:()=>Yp,_coercedDate:()=>ld,_coercedNumber:()=>Qp,_coercedString:()=>Fp,_creditCard:()=>Zp,_cuid:()=>lc,_cuid2:()=>fc,_custom:()=>dd,_date:()=>ud,_decode:()=>ma,_decodeAsync:()=>da,_default:()=>DS,_discriminatedUnion:()=>PS,_e164:()=>$c,_email:()=>rc,_emoji:()=>cc,_encode:()=>fa,_encodeAsync:()=>pa,_endsWith:()=>vo,_enum:()=>TS,_file:()=>pd,_float32:()=>jp,_float64:()=>qp,_gt:()=>jt,_gte:()=>_t,_guid:()=>nc,_iban:()=>Bp,_includes:()=>wo,_int:()=>Vp,_int32:()=>Wp,_int64:()=>ed,_intersection:()=>AS,_ipv4:()=>hc,_ipv6:()=>gc,_isoDate:()=>Hi,_isoDateTime:()=>Wi,_isoDuration:()=>Yi,_isoTime:()=>Xi,_jwt:()=>wc,_ksuid:()=>dc,_lazy:()=>jS,_length:()=>mn,_literal:()=>NS,_lowercase:()=>xo,_lt:()=>Vt,_lte:()=>yt,_mac:()=>Dp,_map:()=>MS,_max:()=>yt,_maxLength:()=>fn,_maxSize:()=>vr,_mime:()=>Eo,_min:()=>_t,_minLength:()=>nr,_minSize:()=>qt,_multipleOf:()=>Sr,_nan:()=>fd,_nanoid:()=>uc,_nativeEnum:()=>LS,_negative:()=>vc,_never:()=>ad,_nonnegative:()=>Ec,_nonoptional:()=>ZS,_nonpositive:()=>Cc,_normalize:()=>Po,_null:()=>od,_nullable:()=>FS,_number:()=>Gp,_optional:()=>zS,_overwrite:()=>Tt,_parse:()=>lo,_parseAsync:()=>fo,_pipe:()=>GS,_positive:()=>Sc,_promise:()=>qS,_properties:()=>Co,_property:()=>Pc,_readonly:()=>QS,_record:()=>kS,_refine:()=>hd,_regex:()=>bo,_safeDecode:()=>ga,_safeDecodeAsync:()=>_a,_safeEncode:()=>ha,_safeEncodeAsync:()=>ya,_safeParse:()=>mo,_safeParseAsync:()=>po,_set:()=>IS,_size:()=>ln,_slugify:()=>Mo,_startsWith:()=>So,_string:()=>zp,_stringFormat:()=>pn,_stringbool:()=>bd,_success:()=>BS,_superRefine:()=>gd,_symbol:()=>rd,_templateLiteral:()=>VS,_toLowerCase:()=>Ro,_toUpperCase:()=>ko,_transform:()=>OS,_trim:()=>Ao,_tuple:()=>RS,_uint32:()=>Hp,_uint64:()=>td,_ulid:()=>mc,_undefined:()=>nd,_union:()=>CS,_unknown:()=>sd,_uppercase:()=>$o,_url:()=>qi,_uuid:()=>oc,_uuidv4:()=>ic,_uuidv6:()=>sc,_uuidv7:()=>ac,_void:()=>cd,_xid:()=>pc,_xor:()=>ES,base64Charset:()=>La,base64urlCharset:()=>Di,canParseURL:()=>_m,clone:()=>le,compile:()=>Lp,compileFn:()=>ec,config:()=>Ae,createStandardJSONSchemaMethod:()=>Io,createToJSONSchemaMethod:()=>$d,decode:()=>T3,decodeAsync:()=>N3,describe:()=>yd,encode:()=>I3,encodeAsync:()=>L3,extractDefs:()=>Er,finalize:()=>Pr,flattenError:()=>Pi,formatError:()=>Ai,getDiscriminatedOption:()=>np,globalConfig:()=>Ge,globalRegistry:()=>We,handleUnrepresentable:()=>Fe,initializeContext:()=>Cr,isBackEdge:()=>Ha,isRecursiveSchema:()=>Wa,isValidBase64:()=>Fi,isValidBase64URL:()=>Na,isValidCIDRv6:()=>Ta,isValidCreditCard:()=>Oa,isValidIBAN:()=>za,isValidIPv6:()=>zi,isValidJWT:()=>Fa,locales:()=>Xa,memoizer:()=>ji,mergeValues:()=>go,meta:()=>_d,parse:()=>ua,parseAsync:()=>la,parseURLObject:()=>Ey,prettifyError:()=>uf,process:()=>me,processSchema:()=>me,regexes:()=>Et,registry:()=>Ka,safeDecode:()=>z3,safeDecodeAsync:()=>D3,safeEncode:()=>O3,safeEncodeAsync:()=>F3,safeParse:()=>P3,safeParseAsync:()=>A3,standardProps:()=>Ra,stripTabAndNewline:()=>Oi,toDotPath:()=>iy,toJSONSchema:()=>Mc,toZod:()=>yi,treeifyError:()=>cf,urlHostnameOk:()=>Ma,urlProtocolOk:()=>Ia,util:()=>F,validate:()=>Ri,validateAsync:()=>ki,validateURL:()=>ka,version:()=>mm,withParser:()=>Ja});var F={};hr(F,{BIGINT_FORMAT_RANGES:()=>wi,CONSTANT_CATCH:()=>aa,Class:()=>Vl,NUMBER_FORMAT_RANGES:()=>$i,aborted:()=>et,allowsEval:()=>Wl,assert:()=>q4,assertEqual:()=>G4,assertIs:()=>V4,assertNever:()=>j4,assertNotEqual:()=>Q4,assignProp:()=>qe,attachSchema:()=>Si,base64ToUint8Array:()=>J1,base64urlToUint8Array:()=>m3,cached:()=>so,captureStackTrace:()=>oa,cleanEnum:()=>f3,cleanRegex:()=>tr,clone:()=>le,cloneDef:()=>X4,codePointLength:()=>rn,constantCatch:()=>ef,createTransparentProxy:()=>r3,defineLazy:()=>jl,defineLazyInternal:()=>X,derived:()=>g3,esc:()=>Je,escapeRegex:()=>Ct,explicitlyAborted:()=>Yl,extend:()=>i3,finalizeIssue:()=>ft,floatSafeRemainder:()=>_i,getElementAtPath:()=>Y4,getEnumValues:()=>oo,getLengthableOrigin:()=>Ci,getParsedType:()=>t3,getSizableOrigin:()=>vi,hexToUint8Array:()=>d3,hide:()=>Ei,installLazyProp:()=>x3,isObject:()=>tn,isPlainObject:()=>vt,issue:()=>uo,joinValues:()=>ra,jsonStringifyReplacer:()=>io,members:()=>Jl,merge:()=>a3,mergeDefs:()=>Mt,normalizeParams:()=>N,nullish:()=>na,numKeys:()=>e3,objectClone:()=>W4,omit:()=>o3,optionalKeys:()=>Xl,own:()=>xr,parsedType:()=>Kl,partial:()=>c3,pick:()=>n3,prefixIssues:()=>lt,primitiveTypes:()=>Hl,promiseAllObject:()=>K4,propertyKeyTypes:()=>xi,randomString:()=>J4,rawShape:()=>ao,required:()=>u3,safeExtend:()=>s3,shallowClone:()=>bi,sizeCaps:()=>co,slugify:()=>ql,stringifyPrimitive:()=>ia,toZod:()=>yi,uint8ArrayToBase64:()=>ey,uint8ArrayToBase64url:()=>p3,uint8ArrayToHex:()=>h3,unwrapMessage:()=>no});function G4(e){return e}function Q4(e){return e}function yi(){return e=>e}function V4(e){}function j4(e){throw new Error("Unexpected value in exhaustive check")}function q4(e){}function oo(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 ra(e,t="|"){return e.map(r=>ia(r)).join(t)}function io(e,t){return typeof t=="bigint"?t.toString():t}var Ql=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 so(e){return new Ql(e)}function na(e){return e==null}function tr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _i(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 H1=Symbol("evaluating");function jl(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==H1)return n===void 0&&(n=H1,n=r()),n},set(o){Object.defineProperty(e,t,{value:o});},configurable:true});}function W4(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 ao(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function er(e){return ao(e._zod.def)??e._zod.def.shape}function X1(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return qe(this,t,n),n},enumerable:true,configurable:true});}function Y1(e,t,r){t in e?qe(e,t,r):e[t]=r;}function en(e,t,r,n){let o=er(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?X1(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):Y1(e,i,n?n(s.value,i):s.value));}}function H4(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?X1(e,r,()=>t[r]):Y1(e,r,n.value));}}function Mt(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n);}return Object.defineProperties({},t)}function X4(e){return Mt(e._zod.def)}function Y4(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function K4(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 J4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Je(e){return JSON.stringify(e)}function ql(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var oa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Wl=so(()=>{if(Ge.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let e=Function;return new e(""),!0}catch{return false}});function vt(e){if(tn(e)===false)return false;let t=e.constructor;if(t===void 0||typeof t!="function")return true;let r=t.prototype;return !(tn(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function bi(e){return vt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function e3(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var t3=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}`)}},xi=new Set(["string","number","symbol"]),Hl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le(e,t,r){let n=new e._zod.constr(t??e._zod.def);return (!t||r?.parent)&&(n._zod.parent=e),n}function N(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 r3(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 ia(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Xl(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var $i={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 n3(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 en(i,e,sa(e,t)),le(e,Mt(r,{shape:i,checks:[]}))}function sa(e,t){let r=er(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 o3(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(sa(e,t)),s={};return en(s,e,Reflect.ownKeys(er(e)).filter(a=>!i.has(a))),le(e,Mt(r,{shape:s,checks:[]}))}function i3(e,t){if(!vt(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=er(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 le(e,Mt(e._zod.def,{shape:K1(e,t)}))}function K1(e,t){let r={};return en(r,e,Reflect.ownKeys(er(e))),H4(r,t),r}function s3(e,t){if(!vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return le(e,Mt(e._zod.def,{shape:K1(e,t)}))}function a3(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={};en(r,e,Reflect.ownKeys(er(e))),en(r,t,Reflect.ownKeys(er(t)));let n=Mt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return le(e,n)}function c3(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(sa(t,r)):void 0,c={};return en(c,t,Reflect.ownKeys(er(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),le(t,Mt(t._zod.def,{shape:c,checks:[]}))}function u3(e,t,r){let n=r?new Set(sa(t,r)):void 0,o={};return en(o,t,Reflect.ownKeys(er(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),le(t,Mt(t._zod.def,{shape:o}))}function et(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 Yl(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 lt(e,t){return t.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(e),r})}function no(e){return typeof e=="string"?e:e?.message}function co(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 Si(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r);}function ft(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:no(e.inst?._zod.def?.error?.(e))??no(i?.(e))??no(t?.error?.(e))??no(r.customError?.(e))??no(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 vi(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var l3=/[\uD800-\uDBFF]/;function rn(e){let t=e.length;if(!l3.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 Ci(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kl(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 uo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function f3(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function J1(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 ey(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function m3(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return J1(t+r)}function p3(e){return ey(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function d3(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 h3(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Vl=class{constructor(...t){}};function Jl(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:false}):y3(e,r,n.value);}}function xr(e,t,r,n=true){return Object.defineProperty(e,t,{configurable:true,writable:true,enumerable:n,value:r}),r}function Ei(e,t,r){return xr(e,t,r,false)}function g3(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:true,enumerable:true,get(){return xr(this,r,n(this))},set(o){xr(this,r,o);}});}return t}function y3(e,t,r){Object.defineProperty(e,t,{configurable:true,get(){return this==null?r:xr(this,t,r.bind(this))},set(n){xr(this,t,n);}});}function _3(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Gl,br=false,b3={configurable:true,get(){br=true;}};function X(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Gl!==e._zod){Gl=void 0;return}Gl=e._zod,Object.defineProperty(n,t,{configurable:true,get(){Object.defineProperty(this,t,b3);let o=br;br=false;try{let i=r(this);return br?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),br=br||o,i}catch(i){throw delete this[t],br=br||o,i}},set(o){Object.defineProperty(this,t,{configurable:true,writable:true,value:o});}});}function x3(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 aa="~constantCatch";function ef(e){let t=()=>e;return t[aa]=true,t}var ty,rf=Object.freeze({status:"aborted"}),tf={value:void 0,enumerable:false},ry="captureStackTrace"in Error?Error:null;function $3(e){let t=ry;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0;}catch{return ry=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 {tf.value=new i(m);try{Object.defineProperty(p,"_zod",tf);}finally{tf.value=void 0;}}if(p._zod.traits.add(e),t(p,m),a){let d=Object.getPrototypeOf(p),g=p._zod.constr.prototype,y=d;for(;y&&y!==g;)y=Object.getPrototypeOf(y);let _=y??d;a.has(_)||(a.add(_),Jl(_,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?$3(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 nf=Symbol("zod_brand"),mt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},$r=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError";}};(ty=globalThis).__zod_globalConfig??(ty.__zod_globalConfig={});var Ge=globalThis.__zod_globalConfig;function Ae(e){return e&&Object.assign(Ge,e),Ge}function w3(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,io,2)),e.message}function S3(e){this._zod.message=e;}var v3={get:w3,set:S3,enumerable:true,configurable:true},sf={value:void 0,enumerable:false},ny=new WeakSet([Object.prototype,Error.prototype]),oy=(e,t)=>{e.name="$ZodError",sf.value=t,Object.defineProperty(e,"issues",sf),sf.value=void 0,Object.defineProperty(e,"message",v3);let r=Object.getPrototypeOf(e);ny.has(r)||(ny.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});}}));},af=E("$ZodError",oy),pt=E("$ZodError",oy,void 0,{Parent:Error});function C3(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 Pi(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?C3(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return {formErrors:n,fieldErrors:r}}function Ai(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 cf(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 iy(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 uf(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 ${iy(n.path)}`);return t.join(`
|
|
2
|
+
`)}function ca(e,t){return {callee:t?.callee??e,Err:t?.Err}}var lo=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 mt;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>ft(u,s,Ae())));throw oa(c,i?.callee??t),c}return a.value};return t},ua=lo(pt),fo=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=>ft(u,s,Ae())));throw oa(c,i?.callee??t),c}return a.value};return t},la=fo(pt),mo=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 mt;return i.issues.length?sy(e,i.issues,o):{success:true,data:i.value}},P3=mo(pt);function sy(e,t,r){let n;return {success:false,get error(){return n||(n=new e(t.map(o=>ft(o,r,Ae()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0;}}}var po=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?sy(e,i.issues,o):{success:true,data:i.value}},A3=po(pt),R3=Symbol.for("zod.compile.invalid"),k3=Symbol.for("zod.compile.fallback"),Ri=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==R3)return true;if(n.definite===true&&r===void 0)return false}return M3(e,t,r)});function M3(e,t,r){let n=r?{...r,async:false,abortEarly:true}:{async:false,abortEarly:true},o=e._zod.bag.fallbackRun,i;if(o?(n[k3]=true,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new mt;return i.issues.length===0}var ki=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},fa=e=>{let t=lo(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,ca(r,s))};return r},I3=fa(pt),ma=e=>{let t=lo(e),r=(n,o,i,s)=>t(n,o,i,ca(r,s));return r},T3=ma(pt),pa=e=>{let t=fo(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,ca(r,s))};return r},L3=pa(pt),da=e=>{let t=fo(e),r=async(n,o,i,s)=>await t(n,o,i,ca(r,s));return r},N3=da(pt),ha=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return mo(e)(t,r,o)},O3=ha(pt),ga=e=>(t,r,n)=>mo(e)(t,r,n),z3=ga(pt),ya=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return po(e)(t,r,o)},F3=ya(pt),_a=e=>async(t,r,n)=>po(e)(t,r,n),D3=_a(pt);var Et={};hr(Et,{anyString:()=>Of,base64:()=>Pf,base64url:()=>Af,bigint:()=>Ff,boolean:()=>Df,browserEmail:()=>q3,cidrv4:()=>Cf,cidrv6:()=>Ef,creditCard:()=>ba,cuid:()=>ff,cuid2:()=>mf,currencyCode:()=>If,date:()=>Tf,datetime:()=>Nf,domain:()=>kf,duration:()=>_f,e164:()=>Mf,email:()=>xf,emoji:()=>$f,extendedDuration:()=>Z3,guid:()=>bf,hex:()=>Qf,hostname:()=>Rf,html5Email:()=>Q3,httpProtocol:()=>Mi,iban:()=>xa,idnEmail:()=>j3,integer:()=>Ii,ipv4:()=>wf,ipv6:()=>Sf,ksuid:()=>hf,lowercase:()=>Uf,mac:()=>vf,md5_base64:()=>Y3,md5_base64url:()=>K3,md5_hex:()=>X3,nanoid:()=>gf,nanoidOfLength:()=>yf,null:()=>Zf,number:()=>rr,rfc5322Email:()=>V3,sha1_base64:()=>ew,sha1_base64url:()=>tw,sha1_hex:()=>J3,sha256_base64:()=>nw,sha256_base64url:()=>ow,sha256_hex:()=>rw,sha384_base64:()=>sw,sha384_base64url:()=>aw,sha384_hex:()=>iw,sha512_base64:()=>uw,sha512_base64url:()=>lw,sha512_hex:()=>cw,string:()=>zf,time:()=>Lf,ulid:()=>pf,undefined:()=>Bf,unicodeEmail:()=>ay,uppercase:()=>Gf,uuid:()=>nn,uuid4:()=>B3,uuid6:()=>U3,uuid7:()=>G3,xid:()=>df});var ff=/^[cC][0-9a-z]{6,}$/,mf=/^[0-9a-z]+$/,pf=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,df=/^[0-9a-vA-V]{20}$/,hf=/^[A-Za-z0-9]{27}$/,gf=/^[a-zA-Z0-9_-]{21}$/;function yf(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var _f=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Z3=/^[-+]?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)?)??$/,bf=/^([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})$/,nn=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)$/,B3=nn(4),U3=nn(6),G3=nn(7),xf=/^(?:[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])?)*$/,V3=/^(([^<>()\[\]\\.,;:\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,}))$/,ay=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,j3=ay,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])?)*$/,W3="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function $f(){return new RegExp(W3,"u")}var wf=/^(?:(?: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])$/,Sf=/^(([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}|:))$/,vf=e=>{let t=Ct(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Cf=/^((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])$/,Ef=/^(([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])$/,Pf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Af=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rf=/^(?=.{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])?)*\.?$/,kf=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Mi=/^https?$/,Mf=/^\+[1-9]\d{6,14}$/,ba=/^\d(?:[ -]?\d){11,18}$/,If=/^(?: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)$/,xa=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,cy="(?:(?:\\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 H3(e){return new RegExp(`^${e}$`)}var Tf=H3(cy);function lf(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 Lf(e){return new RegExp(`^${lf(e)}$`)}function Nf(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${lf({precision:e.precision,seconds:true})}(?:${t.join("|")})`,n=e.local?`${r}|${lf({precision:e.precision})}`:r;return new RegExp(`^${cy}T(?:${n})$`)}var Of=/^[\s\S]{0,}$/,zf=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ff=/^-?\d+n?$/,Ii=/^-?\d+$/,rr=/^-?\d+(?:\.\d+)?$/,Df=/^(?:true|false)$/i,Zf=/^null$/i;var Bf=/^undefined$/i;var Uf=/^[^A-Z]*$/,Gf=/^[^a-z]*$/,Qf=/^[0-9a-fA-F]*$/;function Ti(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Li(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var X3=/^[0-9a-fA-F]{32}$/,Y3=Ti(22,"=="),K3=Li(22),J3=/^[0-9a-fA-F]{40}$/,ew=Ti(27,"="),tw=Li(27),rw=/^[0-9a-fA-F]{64}$/,nw=Ti(43,"="),ow=Li(43),iw=/^[0-9a-fA-F]{96}$/,sw=Ti(64,""),aw=Li(64),cw=/^[0-9a-fA-F]{128}$/,uw=Ti(86,"=="),lw=Li(86);var _e=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[]);}),Vf=e=>{let t=e.value;return !na(t)&&t.size!==void 0},jf=e=>{let t=e.value;return !na(t)&&t.length!==void 0},$a={number:"number",bigint:"bigint",object:"date"},Sa=E("$ZodCheckLessThan",(e,t)=>{_e.init(e,t);let r=$a[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:$a[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});};}),va=E("$ZodCheckGreaterThan",(e,t)=>{_e.init(e,t);let r=$a[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:$a[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});};}),qf=E("$ZodCheckMultipleOf",(e,t)=>{_e.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):_i(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});};}),Wf=E("$ZodCheckNumberFormat",(e,t)=>{_e.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=$i[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});};}),Hf=E("$ZodCheckBigIntFormat",(e,t)=>{_e.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});};}),Xf=E("$ZodCheckMaxSize",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:vi(o),code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Yf=E("$ZodCheckMinSize",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Vf),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:vi(o),code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),Kf=E("$ZodCheckSizeEquals",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=Vf),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:vi(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});};}),Jf=E("$ZodCheckMaxLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=jf),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?rn(o):i)<=t.maximum)return;let a=Ci(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),em=E("$ZodCheckMinLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=jf),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?rn(o):i)>=t.minimum)return;let a=Ci(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:true,input:o,inst:e,continue:!t.abort});};}),tm=E("$ZodCheckLengthEquals",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=jf),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?rn(o):i;if(s===t.length)return;let a=Ci(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});};}),ho=E("$ZodCheckStringFormat",(e,t)=>{var r,n;_e.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=()=>{});}),rm=E("$ZodCheckRegex",(e,t)=>{ho.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});};}),nm=E("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Uf),ho.init(e,t);}),om=E("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Gf),ho.init(e,t);}),im=E("$ZodCheckIncludes",(e,t)=>{_e.init(e,t);let r=Ct(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});};}),sm=E("$ZodCheckStartsWith",(e,t)=>{_e.init(e,t);let r=new RegExp(`^${Ct(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});};}),am=E("$ZodCheckEndsWith",(e,t)=>{_e.init(e,t);let r=new RegExp(`.*${Ct(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 wa(e,t,r){e.issues.length&&t.issues.push(...lt(r,e.issues));}var cm=E("$ZodCheckProperty",(e,t)=>{_e.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=>wa(o,r,t.property));wa(n,r,t.property);};}),um=E("$ZodCheckProperties",(e,t)=>{_e.init(e,t),Ei(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=>wa(u,n,s)))):wa(c,n,s);}if(i)return Promise.all(i).then(()=>{})};}),lm=E("$ZodCheckMimeType",(e,t)=>{_e.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});};}),fm=E("$ZodCheckOverwrite",(e,t)=>{_e.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value);};});var on=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 fm={major:4,minor:6,patch:7};var q=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fm;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=et(a),f;for(let p of c){if(p._zod.def.when){if(Xl(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 mt;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(wi(a.issues,m,e),l||(l=et(a,m)));});else {if(a.issues.length===m)continue;wi(a.issues,m,e),l||(l=et(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(et(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new mt;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 mt;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return Ci(this,"~standard",ka(this))},set"~standard"(e){xr(this,"~standard",e);}}),$y=(e,t)=>e.issues.length?{issues:e.issues.map(r=>ft(r,t,Pe()))}:{value:e.value};async function iw(e,t){let r={async:true};return $y(await e._zod.run({value:t,issues:[]},r),r)}function ka(e){return {validate:t=>{let r={async:false};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return $y(n,r)}catch{}return iw(e,t)},vendor:"zod",version:1}}var on=E("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=t.pattern??Nf,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};}),fe=E("$ZodStringFormat",(e,t)=>{mo.init(e,t),on.init(e,t);}),pm=E("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_f),fe.init(e,t);}),dm=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=rn(n));}else t.pattern??(t.pattern=rn());fe.init(e,t);}),hm=E("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bf),fe.init(e,t);}),gm=1,Li=2;function ym(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function Ra(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?ym(e)||Li:wy(e,t)}function wy(e,t){if(!t.normalize&&t.protocol?.source===Ri.source&&!/^https?:\/\//i.test(e))return gm;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Li}return new URL(e)}catch{return Li}}var sw=/[\t\n\r]/g;function Ni(e){return e.replace(sw,"")}function Ma(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ia(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var _m=E("$ZodURL",(e,t)=>{fe.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=Ra(n,t);if(o===gm){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Li){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=Ni(n);return}t.hostname&&!Ma(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&&!Ia(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:Ni(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});}};}),bm=E("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xf()),fe.init(e,t);}),xm=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?hf:gf(t.length)),fe.init(e,t);}),$m=E("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lf),fe.init(e,t);}),wm=E("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ff),fe.init(e,t);}),Sm=E("$ZodULID",(e,t)=>{t.pattern??(t.pattern=mf),fe.init(e,t);}),vm=E("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pf),fe.init(e,t);}),Cm=E("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=df),fe.init(e,t);}),Em=E("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Lf(t)),fe.init(e,t);}),Am=E("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=If),fe.init(e,t);}),Pm=E("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Tf(t)),fe.init(e,t);}),km=E("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=yf),fe.init(e,t);}),Rm=E("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$f),fe.init(e,t);}),aw=/^[0-9a-fA-F:.]+$/;function zi(e){return aw.test(e)?ym(`http://[${e}]`):false}var Mm=E("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=wf),fe.init(e,t),e._zod.check=r=>{zi(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort});};}),Im=E("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Sf(t.delimiter)),fe.init(e,t);}),Tm=E("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=vf),fe.init(e,t);});function Ta(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:zi(r)}var Lm=E("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cf),fe.init(e,t),e._zod.check=r=>{Ta(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort});};});function Oi(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var La=/^[0-9a-zA-Z+/]*={0,2}$/,Nm=E("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=La),fe.init(e,t),e._zod.check=r=>{Oi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort});};}),Fi=/^[A-Za-z0-9_-]*$/;function Na(e){if(!Fi.test(e))return false;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Oi(r)}var zm=E("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fi),fe.init(e,t),e._zod.check=r=>{Na(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort});};}),Om=E("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rf),fe.init(e,t);}),cw=/[- ]/g;function uw(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 za(e){return ba.test(e)?uw(e.replace(cw,"")):false}var Fm=E("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=ba),fe.init(e,t),e._zod.check=r=>{za(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort});};});function lw(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 Oa(e){return xa.test(e)?lw(e):false}var Dm=E("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=xa),fe.init(e,t),e._zod.check=r=>{Oa(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort});};});function Fa(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 Zm=E("$ZodJWT",(e,t)=>{fe.init(e,t),e._zod.check=r=>{Fa(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort});};}),Bm=E("$ZodCustomStringFormat",(e,t)=>{fe.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});};}),Da=E("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=rr,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};}),Gm=E("$ZodNumberFormat",(e,t)=>{qf.init(e,t),Da.init(e,t);}),Di=E("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Ff,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};}),Za=E("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Of,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};}),Um=E("$ZodBigIntFormat",(e,t)=>{Wf.init(e,t),Za.init(e,t);}),Qm=E("$ZodSymbol",(e,t)=>{q.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};}),Vm=E("$ZodUndefined",(e,t)=>{q.init(e,t),e._zod.pattern=Zf,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};}),jm=E("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=Df,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};}),qm=E("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r;}),Wm=E("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r;}),Hm=E("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r);}),Xm=E("$ZodVoid",(e,t)=>{q.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};}),Ym=E("$ZodDate",(e,t)=>{q.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 Km(e,t){let r=so(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 so(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 fw=e=>Array.isArray(e)?e.length:-1,mw=e=>e instanceof Map?e.size:-1,pw=e=>e instanceof Set?e.size:-1;function sy(e,t,r){e.issues.length&&t.issues.push(...lt(r,e.issues)),t.value[r]=e.value;}var Jm=E("$ZodArray",(e,t)=>{q.init(e,t);let r=Ue.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=>sy(f,n,c)));else if(sy(l,n,c),a&&l.issues.length!==0&&et(l))break}return s.length?Promise.all(s).then(()=>n):n},Km(e,fw);});function Pa(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(...lt(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 dw=[];function Sy(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:dw,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=Hl(e.shape);return {...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function vy(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(et(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=>Pa(g,r,h,t,f,p))):Pa(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=E("$ZodObject",(e,t)=>{q.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=oo(()=>Sy(t));X(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=en,s=t.catchall,a,c=Ue.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(et(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let y=m[g],_=y._zod.optin,b=y._zod.optout,S=y._zod.run({value:f[g],issues:[]},l);S instanceof Promise?p.push(S.then(v=>Pa(v,u,g,f,_,b))):Pa(S,u,g,f,_,b);}return s?vy(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),ep=E("$ZodObjectJIT",(e,t)=>{Cy.init(e,t);let r=e._zod.parse,n=oo(()=>Sy(t)),o=Ue.memoizer,i=m=>{let h=n.value,d=h.symbolKeys,g=new nn(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),y=v=>`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`,_=(v,x)=>`
|
|
6
|
+
};`)(...Object.values(this.closed))}};var mm={major:4,minor:6,patch:7};var q=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mm;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=et(a),f;for(let p of c){if(p._zod.def.when){if(Yl(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 mt;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(Si(a.issues,m,e),l||(l=et(a,m)));});else {if(a.issues.length===m)continue;Si(a.issues,m,e),l||(l=et(a,m));}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(et(a))return a.aborted=true,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===false)throw new mt;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 mt;return u.then(l=>i(l,o,c))}return i(u,o,c)};}},{get"~standard"(){return Ei(this,"~standard",Ra(this))},set"~standard"(e){xr(this,"~standard",e);}}),Cy=(e,t)=>e.issues.length?{issues:e.issues.map(r=>ft(r,t,Ae()))}:{value:e.value};async function fw(e,t){let r={async:true};return Cy(await e._zod.run({value:t,issues:[]},r),r)}function Ra(e){return {validate:t=>{let r={async:false};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Cy(n,r)}catch{}return fw(e,t)},vendor:"zod",version:1}}var sn=E("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=t.pattern??Of,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};}),fe=E("$ZodStringFormat",(e,t)=>{ho.init(e,t),sn.init(e,t);}),dm=E("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=bf),fe.init(e,t);}),hm=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=nn(n));}else t.pattern??(t.pattern=nn());fe.init(e,t);}),gm=E("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xf),fe.init(e,t);}),ym=1,Ni=2;function _m(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return false}}function ka(e,t){return !("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?_m(e)||Ni:Ey(e,t)}function Ey(e,t){if(!t.normalize&&t.protocol?.source===Mi.source&&!/^https?:\/\//i.test(e))return ym;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Ni}return new URL(e)}catch{return Ni}}var mw=/[\t\n\r]/g;function Oi(e){return e.replace(mw,"")}function Ma(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ia(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var bm=E("$ZodURL",(e,t)=>{fe.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=ka(n,t);if(o===ym){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Ni){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=Oi(n);return}t.hostname&&!Ma(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&&!Ia(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:Oi(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});}};}),xm=E("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=$f()),fe.init(e,t);}),$m=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?gf:yf(t.length)),fe.init(e,t);}),wm=E("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ff),fe.init(e,t);}),Sm=E("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mf),fe.init(e,t);}),vm=E("$ZodULID",(e,t)=>{t.pattern??(t.pattern=pf),fe.init(e,t);}),Cm=E("$ZodXID",(e,t)=>{t.pattern??(t.pattern=df),fe.init(e,t);}),Em=E("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=hf),fe.init(e,t);}),Pm=E("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Nf(t)),fe.init(e,t);}),Am=E("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Tf),fe.init(e,t);}),Rm=E("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Lf(t)),fe.init(e,t);}),km=E("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_f),fe.init(e,t);}),Mm=E("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wf),fe.init(e,t);}),pw=/^[0-9a-fA-F:.]+$/;function zi(e){return pw.test(e)?_m(`http://[${e}]`):false}var Im=E("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Sf),fe.init(e,t),e._zod.check=r=>{zi(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort});};}),Tm=E("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=vf(t.delimiter)),fe.init(e,t);}),Lm=E("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Cf),fe.init(e,t);});function Ta(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:zi(r)}var Nm=E("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ef),fe.init(e,t),e._zod.check=r=>{Ta(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort});};});function Fi(e){if(e==="")return true;if(/\s/.test(e)||e.length%4!==0)return false;try{return atob(e),!0}catch{return false}}var La=/^[0-9a-zA-Z+/]*={0,2}$/,Om=E("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=La),fe.init(e,t),e._zod.check=r=>{Fi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort});};}),Di=/^[A-Za-z0-9_-]*$/;function Na(e){if(!Di.test(e))return false;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fi(r)}var zm=E("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Di),fe.init(e,t),e._zod.check=r=>{Na(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort});};}),Fm=E("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mf),fe.init(e,t);}),dw=/[- ]/g;function hw(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 Oa(e){return ba.test(e)?hw(e.replace(dw,"")):false}var Dm=E("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=ba),fe.init(e,t),e._zod.check=r=>{Oa(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort});};});function gw(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 za(e){return xa.test(e)?gw(e):false}var Zm=E("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=xa),fe.init(e,t),e._zod.check=r=>{za(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort});};});function Fa(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 Bm=E("$ZodJWT",(e,t)=>{fe.init(e,t),e._zod.check=r=>{Fa(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort});};}),Um=E("$ZodCustomStringFormat",(e,t)=>{fe.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});};}),Da=E("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=rr,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};}),Gm=E("$ZodNumberFormat",(e,t)=>{Wf.init(e,t),Da.init(e,t);}),Zi=E("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Df,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};}),Za=E("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Ff,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};}),Qm=E("$ZodBigIntFormat",(e,t)=>{Hf.init(e,t),Za.init(e,t);}),Vm=E("$ZodSymbol",(e,t)=>{q.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};}),jm=E("$ZodUndefined",(e,t)=>{q.init(e,t),e._zod.pattern=Bf,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};}),qm=E("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=Zf,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};}),Wm=E("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r;}),Hm=E("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r;}),Xm=E("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r);}),Ym=E("$ZodVoid",(e,t)=>{q.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};}),Km=E("$ZodDate",(e,t)=>{q.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 Jm(e,t){let r=co(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 co(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,Si(i.issues,l,e),i}}return o(i,s)};}var yw=e=>Array.isArray(e)?e.length:-1,_w=e=>e instanceof Map?e.size:-1,bw=e=>e instanceof Set?e.size:-1;function ly(e,t,r){e.issues.length&&t.issues.push(...lt(r,e.issues)),t.value[r]=e.value;}var ep=E("$ZodArray",(e,t)=>{q.init(e,t);let r=Ge.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=>ly(f,n,c)));else if(ly(l,n,c),a&&l.issues.length!==0&&et(l))break}return s.length?Promise.all(s).then(()=>n):n},Jm(e,yw);});function Aa(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(...lt(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 xw=[];function Py(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:xw,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=Xl(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(et(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=>Aa(g,r,h,t,f,p))):Aa(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 Ry=E("$ZodObject",(e,t)=>{q.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=so(()=>Py(t));X(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=tn,s=t.catchall,a,c=Ge.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(et(u,d))break;d=u.issues.length;}if(g==="__proto__")continue;let y=m[g],_=y._zod.optin,b=y._zod.optout,S=y._zod.run({value:f[g],issues:[]},l);S instanceof Promise?p.push(S.then(v=>Aa(v,u,g,f,_,b))):Aa(S,u,g,f,_,b);}return s?Ay(p,f,u,l,o.value,e,h===true):p.length?Promise.all(p).then(()=>u):u};}),tp=E("$ZodObjectJIT",(e,t)=>{Ry.init(e,t);let r=e._zod.parse,n=so(()=>Py(t)),o=Ge.memoizer,i=m=>{let h=n.value,d=h.symbolKeys,g=new on(["payload","ctx"],{shape:m,inst:e,memo:o,syms:d}),y=v=>`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`,_=(v,x)=>`
|
|
7
7
|
let ${v}_ab = false;
|
|
8
8
|
for (let i = 0; i < ${v}.issues.length; i++) {
|
|
9
9
|
const iss = ${v}.issues[i];
|
|
@@ -14,7 +14,7 @@ ${r.join(`
|
|
|
14
14
|
if (${v}_ab && ctx && ctx.abortEarly) {
|
|
15
15
|
payload.value = newResult;
|
|
16
16
|
return payload;
|
|
17
|
-
}`;g.write("const input = payload.value;");let b=Object.create(null),S=0;for(let v of h.allKeys)b[v]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let v of h.allKeys){if(v==="__proto__")continue;let x=b[v],w=typeof v=="symbol"?`syms[${d.indexOf(v)}]`:Je(v),C=`${w} in input`,
|
|
17
|
+
}`;g.write("const input = payload.value;");let b=Object.create(null),S=0;for(let v of h.allKeys)b[v]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let v of h.allKeys){if(v==="__proto__")continue;let x=b[v],w=typeof v=="symbol"?`syms[${d.indexOf(v)}]`:Je(v),C=`${w} in input`,P=m[v],R=P?._zod?.optin,M=R!==void 0,T=P?._zod?.optout==="optional";if(g.write(`const ${x} = ${y(w)};`),M&&T){let L=R==="optional"?`${x}_present`:`${x}.value !== undefined || ${x}_present`;g.write(`
|
|
18
18
|
const ${x}_present = ${C};
|
|
19
19
|
if (!${x}.issues.length || ${x}_present) {
|
|
20
20
|
if (${x}.issues.length) {${_(x,w)}
|
|
@@ -28,7 +28,7 @@ ${r.join(`
|
|
|
28
28
|
`);}else M?(g.write(`
|
|
29
29
|
if (${x}.issues.length) {${_(x,w)}
|
|
30
30
|
}
|
|
31
|
-
`),
|
|
31
|
+
`),R==="defaulted"?g.write(`newResult[${w}] = ${x}.value;`):g.write(`
|
|
32
32
|
if (${x}.value !== undefined || ${C}) {
|
|
33
33
|
newResult[${w}] = ${x}.value;
|
|
34
34
|
}
|
|
@@ -53,15 +53,15 @@ ${r.join(`
|
|
|
53
53
|
newResult[${w}] = ${x}.value;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
`);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=en,c=!Ue.jitless,l=c&&ql.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?vy([],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 ay(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=>!et(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=>ft(s,n,Pe())))}),t)}var Zi=E("$ZodUnion",(e,t)=>{q.init(e,t),X(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),X(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(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)))}),X(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=>tr(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=>ay(a,n,e,o)):ay(s,n,e,o)};});function cy(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=>ft(s,n,Pe())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:false,matches:o}),t)}var tp=E("$ZodXor",(e,t)=>{Zi.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=>cy(a,n,e,o)):cy(s,n,e,o)};});function rp(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=Ey(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 Ey(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 np=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,Zi.init(e,t);let r=e._zod.parse;X(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=io(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=oo(()=>Ey(t));e._zod.parse=(o,i)=>{let s=o.value;if(!en(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)};}),op=E("$ZodIntersection",(e,t)=>{q.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])=>uy(r,c,u)):uy(r,i,s)};});function po(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(vt(e)&&vt(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=po(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=po(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 uy(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=po(t.value,r.value);if(!c.valid){if(et(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ba=E("$ZodTuple",(e,t)=>{q.init(e,t);let r=t.items,n=Ue.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=ly(r,"optin"),u=ly(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=et(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(et(o,d))break;d=o.issues.length;}m++;let y=t.rest._zod.run({value:g,issues:[]},i);y instanceof Promise?a.push(y.then(_=>fy(_,o,m))):fy(y,o,m);}}return a.length?Promise.all(a).then(()=>my(l,o,r,s,u)):my(l,o,r,s,u)};});function ly(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 fy(e,t,r){e.issues.length&&t.issues.push(...lt(r,e.issues)),t.value[r]=e.value;}function my(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(...lt(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 ip=E("$ZodRecord",(e,t)=>{q.init(e,t);let r=Ue.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!vt(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=>ft(h,o,Pe())),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(...lt(l,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...lt(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"&&rr.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=>ft(h,o,Pe())),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(...lt(u,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...lt(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};}),sp=E("$ZodMap",(e,t)=>{q.init(e,t);let r=Ue.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(et(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])=>{py(m,h,n,u,i,e,o);})):py(f,p,n,u,i,e,o);}return s.length?Promise.all(s).then(()=>n):n},Km(e,mw);});function py(e,t,r,n,o,i,s){e.issues.length&&(bi.has(typeof n)?r.issues.push(...lt(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>ft(a,s,Pe()))})),t.issues.length&&(bi.has(typeof n)?r.issues.push(...lt(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>ft(a,s,Pe()))})),r.value.set(e.value,t.value);}var ap=E("$ZodSet",(e,t)=>{q.init(e,t);let r=Ue.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(et(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=>dy(f,n))):dy(l,n);}return s.length?Promise.all(s).then(()=>n):n},Km(e,pw);});function dy(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var cp=E("$ZodEnum",(e,t)=>{q.init(e,t);let r=ro(t.entries),n=new Set(r);e._zod.values=n,X(e,"pattern",o=>{let i=ro(o.def.entries).filter(s=>bi.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>Ct(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};}),up=E("$ZodLiteral",(e,t)=>{q.init(e,t);let r=new Set(t.values);e._zod.values=r,X(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?Ct(i):i?Ct(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};}),lp=E("$ZodFile",(e,t)=>{q.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};}),fp=E("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.optin="optional",Ue.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r(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 mt;return r.value=o,r};});function hy(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ga=E("$ZodOptional",(e,t)=>{q.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",X(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),X(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${tr(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=>hy(r,i)):hy(r,o)}return t.innerType._zod.run(r,n)};}),mp=E("$ZodExactOptional",(e,t)=>{Ga.init(e,t),X(e,"values",r=>r.def.innerType._zod.values),X(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n);}),pp=E("$ZodNullable",(e,t)=>{q.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin),X(e,"optout",r=>r.def.innerType._zod.optout),X(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${tr(n.source)}|null)$`):void 0}),X(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);}),dp=E("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="defaulted",X(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=>gy(i,t)):gy(o,t)};});function gy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var hp=E("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="defaulted",X(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));}),gp=E("$ZodNonOptional",(e,t)=>{q.init(e,t),X(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=>yy(i,e)):yy(o,e)};});function yy(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 yp=E("$ZodSuccess",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r("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 _y(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>ft(o,n,Pe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var _p=E("$ZodCatch",(e,t)=>{q.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),X(e,"optout",r=>r.def.innerType._zod.optout),X(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=>_y(r,i,t,n)):_y(r,o,t,n)};}),bp=E("$ZodNaN",(e,t)=>{q.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);}),Ua=E("$ZodPipe",(e,t)=>{q.init(e,t),X(e,"values",r=>r.def.in._zod.values),X(e,"optin",r=>r.def.in._zod.optin),X(e,"optout",r=>r.def.out._zod.optout),X(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=>Ca(s,t.in,n)):Ca(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ca(i,t.out,n)):Ca(o,t.out,n)};});function Ca(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 Bi=E("$ZodCodec",(e,t)=>{q.init(e,t),X(e,"values",r=>r.def.in._zod.values),X(e,"optin",r=>r.def.in._zod.optin),X(e,"optout",r=>r.def.out._zod.optout),X(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=>Ea(s,t,n)):Ea(i,t,n)}else {let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Ea(s,t,n)):Ea(i,t,n)}};});function Ea(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=>Aa(e,i,t.out,r)):Aa(e,o,t.out,r)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>Aa(e,i,t.in,r)):Aa(e,o,t.in,r)}}function Aa(e,t,r,n){return e.issues.length?(e.aborted=true,e):r._zod.run({value:t,issues:e.issues},n)}var xp=E("$ZodPreprocess",(e,t)=>{Ua.init(e,t);}),$p=E("$ZodReadonly",(e,t)=>{q.init(e,t),X(e,"propValues",r=>r.def.innerType._zod.propValues),X(e,"values",r=>r.def.innerType._zod.values),X(e,"optin",r=>r.def.innerType?._zod?.optin),X(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(by):by(o)};});function by(e){return e.memo||(e.value=Object.freeze(e.value)),e}function hw(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 zf({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (n&&s===rr?Mi:s)?.source}function mm(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=mm(n);return r&&o&&i&&i!==o?r.replace(tr(o),()=>tr(i)):r}if(t.options){let o=t.options.map(mm);if(o.every(Boolean))return `^(${o.map(i=>tr(i)).join("|")})$`}return hw(e)}var wp=E("$ZodTemplateLiteral",(e,t)=>{q.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=mm(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(tr(o));}else if(n===null||Wl.has(typeof n))r.push(Ct(`${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);}),Sp=E("$ZodFunction",(e,t)=>(q.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?ua(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?ua(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 la(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await la(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 Ba({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)),vp=E("$ZodPromise",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n));}),Gi=E("$ZodLazy",(e,t)=>{q.init(e,t),Vl(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),X(e,"pattern",r=>r.innerType?._zod?.pattern),X(e,"propValues",r=>r.innerType?._zod?.propValues),X(e,"optin",r=>r.innerType?._zod?.optin??void 0),X(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n);}),Cp=E("$ZodCustom",(e,t)=>{_e.init(e,t),q.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=>xy(i,r,n,e));xy(o,r,n,e);};});function xy(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(ao(o));}}var qa=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},Ap="~memo",Py=[];function ky(e){return e!==null&&typeof e=="object"}function Ep(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Ry=new WeakMap,ho=0,ja=1,Ui=2;function Qi(e,t,r){let n=Ry.get(e);if(n!==void 0)return n?Ui:ho;if(t.has(e))return Ui;t.add(e);let o=ho,i=l=>{if(o!==Ui&&l?._zod){let f=Qi(l,t,r);f>o&&(o=f);}},s=(l,f)=>{let p=ho;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?ja:h.value?._zod?Qi(h.value,t,r):ho;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=io(c);a(l?s(l):ja),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?Qi(l,t,false):ja);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),gw(e,o)}function gw(e,t){return t!==ja&&Ry.set(e,t===Ui),t}function Wa(e){return Qi(e,new Set,true)!==ho}function yw(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Qa,Va=[],_w={alloc(e,t,r){let n=Qa;if(!n)return r;Qa=void 0;let o={value:r,issues:null};return n.set(t.value,o),Va.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"&&Ha(i,o.value))throw new qa;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 y=Qi(e,new Set,false);if(y===ho)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);y===Ui||n?r=true:n=true;}let l=c.value;if(!ky(l))return s(c,u);let f=u[Ap];f||(f={buckets:new WeakMap,backEdges:void 0},u[Ap]=f);let p;o===u?p=i:(p=yw(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(...Ep(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;Qa=p;let h=Va.length,d=s(c,u);Qa=void 0;let g=Va.length>h?Va.pop():void 0;return d instanceof Promise?d.then(y=>(g&&(g.issues=y.issues.length?Ep(y.issues):Py),y)):(g&&(g.issues=d.issues.length?Ep(d.issues):Py),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function Vi(){return _w}function Ha(e,t){let r=e[Ap]?.backEdges;return r!==void 0&&ky(t)&&r.has(t)}var Xa={};var My,Pp=Symbol("ZodOutput"),kp=Symbol("ZodInput"),Ya=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 Ka(){return new Ya}(My=globalThis).__zod_globalRegistry??(My.__zod_globalRegistry=Ka());var We=globalThis.__zod_globalRegistry;var tt=Symbol.for("zod.compile.invalid"),Iy=Symbol.for("zod.compile.fallback"),It=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},re=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 xw(e,t){try{return ec(e,{assertOnly:!0})}catch{return t}}function Tp(e,t){try{let r=ec(e),n=Ja(e,r);return n._zod.bag.validator=xw(e,r),n}catch(r){if(t?.strict)throw r;return e}}function Ja(e,t){if(Wa(e))throw new re("a schema whose subtree contains a reference cycle");let r=le(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[Iy]||a&&Ha(a,s.value))return o(s,a);let c=t(s.value);return c!==tt?(s.value=c,s):(a&&(a[Iy]=true),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||$w(r,e,t),r}function $w(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!==tt?{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!==tt?c:i(s,a)};}}function ec(e,t){let r=true;try{r=Wa(e);}catch{}if(r)throw new re("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new nn(["input"]),i=Ce(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[tt,...n.constants.values()],c=o.content.join(`
|
|
56
|
+
`);}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=tn,c=!Ge.jitless,l=c&&Wl.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 fy(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=>!et(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=>ft(s,n,Ae())))}),t)}var Bi=E("$ZodUnion",(e,t)=>{q.init(e,t),X(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),X(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(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)))}),X(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=>tr(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=>fy(a,n,e,o)):fy(s,n,e,o)};});function my(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=>ft(s,n,Ae())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:false,matches:o}),t)}var rp=E("$ZodXor",(e,t)=>{Bi.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=>my(a,n,e,o)):my(s,n,e,o)};});function np(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=ky(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 ky(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 op=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=false,Bi.init(e,t);let r=e._zod.parse;X(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=ao(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=so(()=>ky(t));e._zod.parse=(o,i)=>{let s=o.value;if(!tn(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)};}),ip=E("$ZodIntersection",(e,t)=>{q.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])=>py(r,c,u)):py(r,i,s)};});function go(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(vt(e)&&vt(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=go(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=go(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 py(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=go(t.value,r.value);if(!c.valid){if(et(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ba=E("$ZodTuple",(e,t)=>{q.init(e,t);let r=t.items,n=Ge.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=dy(r,"optin"),u=dy(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=et(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(et(o,d))break;d=o.issues.length;}m++;let y=t.rest._zod.run({value:g,issues:[]},i);y instanceof Promise?a.push(y.then(_=>hy(_,o,m))):hy(y,o,m);}}return a.length?Promise.all(a).then(()=>gy(l,o,r,s,u)):gy(l,o,r,s,u)};});function dy(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 hy(e,t,r){e.issues.length&&t.issues.push(...lt(r,e.issues)),t.value[r]=e.value;}function gy(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(...lt(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 sp=E("$ZodRecord",(e,t)=>{q.init(e,t);let r=Ge.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!vt(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=>ft(h,o,Ae())),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(...lt(l,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...lt(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"&&rr.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=>ft(h,o,Ae())),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(...lt(u,h.issues)),n.value[p]=h.value;})):(m.issues.length&&n.issues.push(...lt(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};}),ap=E("$ZodMap",(e,t)=>{q.init(e,t);let r=Ge.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(et(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])=>{yy(m,h,n,u,i,e,o);})):yy(f,p,n,u,i,e,o);}return s.length?Promise.all(s).then(()=>n):n},Jm(e,_w);});function yy(e,t,r,n,o,i,s){e.issues.length&&(xi.has(typeof n)?r.issues.push(...lt(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>ft(a,s,Ae()))})),t.issues.length&&(xi.has(typeof n)?r.issues.push(...lt(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>ft(a,s,Ae()))})),r.value.set(e.value,t.value);}var cp=E("$ZodSet",(e,t)=>{q.init(e,t);let r=Ge.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(et(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=>_y(f,n))):_y(l,n);}return s.length?Promise.all(s).then(()=>n):n},Jm(e,bw);});function _y(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value);}var up=E("$ZodEnum",(e,t)=>{q.init(e,t);let r=oo(t.entries),n=new Set(r);e._zod.values=n,X(e,"pattern",o=>{let i=oo(o.def.entries).filter(s=>xi.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>Ct(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};}),lp=E("$ZodLiteral",(e,t)=>{q.init(e,t);let r=new Set(t.values);e._zod.values=r,X(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?Ct(i):i?Ct(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};}),fp=E("$ZodFile",(e,t)=>{q.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};}),mp=E("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.optin="optional",Ge.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r(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 mt;return r.value=o,r};});function by(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ua=E("$ZodOptional",(e,t)=>{q.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",X(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),X(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${tr(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=>by(r,i)):by(r,o)}return t.innerType._zod.run(r,n)};}),pp=E("$ZodExactOptional",(e,t)=>{Ua.init(e,t),X(e,"values",r=>r.def.innerType._zod.values),X(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n);}),dp=E("$ZodNullable",(e,t)=>{q.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin),X(e,"optout",r=>r.def.innerType._zod.optout),X(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${tr(n.source)}|null)$`):void 0}),X(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);}),hp=E("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="defaulted",X(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=>xy(i,t)):xy(o,t)};});function xy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var gp=E("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="defaulted",X(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));}),yp=E("$ZodNonOptional",(e,t)=>{q.init(e,t),X(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=>$y(i,e)):$y(o,e)};});function $y(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 _p=E("$ZodSuccess",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r("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 wy(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>ft(o,n,Ae()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=true),e)}var bp=E("$ZodCatch",(e,t)=>{q.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),X(e,"optout",r=>r.def.innerType._zod.optout),X(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=>wy(r,i,t,n)):wy(r,o,t,n)};}),xp=E("$ZodNaN",(e,t)=>{q.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);}),Ga=E("$ZodPipe",(e,t)=>{q.init(e,t),X(e,"values",r=>r.def.in._zod.values),X(e,"optin",r=>r.def.in._zod.optin),X(e,"optout",r=>r.def.out._zod.optout),X(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=>Ca(s,t.in,n)):Ca(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ca(i,t.out,n)):Ca(o,t.out,n)};});function Ca(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 Ui=E("$ZodCodec",(e,t)=>{q.init(e,t),X(e,"values",r=>r.def.in._zod.values),X(e,"optin",r=>r.def.in._zod.optin),X(e,"optout",r=>r.def.out._zod.optout),X(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=>Ea(s,t,n)):Ea(i,t,n)}else {let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Ea(s,t,n)):Ea(i,t,n)}};});function Ea(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=>Pa(e,i,t.out,r)):Pa(e,o,t.out,r)}else {let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>Pa(e,i,t.in,r)):Pa(e,o,t.in,r)}}function Pa(e,t,r,n){return e.issues.length?(e.aborted=true,e):r._zod.run({value:t,issues:e.issues},n)}var $p=E("$ZodPreprocess",(e,t)=>{Ga.init(e,t);}),wp=E("$ZodReadonly",(e,t)=>{q.init(e,t),X(e,"propValues",r=>r.def.innerType._zod.propValues),X(e,"values",r=>r.def.innerType._zod.values),X(e,"optin",r=>r.def.innerType?._zod?.optin),X(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(Sy):Sy(o)};});function Sy(e){return e.memo||(e.value=Object.freeze(e.value)),e}function $w(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 zf({minimum:o,maximum:i}).source;let s=e._zod.pattern;return (n&&s===rr?Ii:s)?.source}function pm(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=pm(n);return r&&o&&i&&i!==o?r.replace(tr(o),()=>tr(i)):r}if(t.options){let o=t.options.map(pm);if(o.every(Boolean))return `^(${o.map(i=>tr(i)).join("|")})$`}return $w(e)}var Sp=E("$ZodTemplateLiteral",(e,t)=>{q.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=pm(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(tr(o));}else if(n===null||Hl.has(typeof n))r.push(Ct(`${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);}),vp=E("$ZodFunction",(e,t)=>(q.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?ua(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?ua(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 la(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await la(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 Ba({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)),Cp=E("$ZodPromise",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n));}),Gi=E("$ZodLazy",(e,t)=>{q.init(e,t),jl(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),X(e,"pattern",r=>r.innerType?._zod?.pattern),X(e,"propValues",r=>r.innerType?._zod?.propValues),X(e,"optin",r=>r.innerType?._zod?.optin??void 0),X(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n);}),Ep=E("$ZodCustom",(e,t)=>{_e.init(e,t),q.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=>vy(i,r,n,e));vy(o,r,n,e);};});function vy(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(uo(o));}}var qa=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError";}},Ap="~memo",Iy=[];function Ty(e){return e!==null&&typeof e=="object"}function Pp(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Ly=new WeakMap,yo=0,ja=1,Qi=2;function Vi(e,t,r){let n=Ly.get(e);if(n!==void 0)return n?Qi:yo;if(t.has(e))return Qi;t.add(e);let o=yo,i=l=>{if(o!==Qi&&l?._zod){let f=Vi(l,t,r);f>o&&(o=f);}},s=(l,f)=>{let p=yo;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(!h.enumerable)continue;let d=h.get?ja:h.value?._zod?Vi(h.value,t,r):yo;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=ao(c);a(l?s(l):ja),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?Vi(l,t,false):ja);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),ww(e,o)}function ww(e,t){return t!==ja&&Ly.set(e,t===Qi),t}function Wa(e){return Vi(e,new Set,true)!==yo}function Sw(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Qa,Va=[],vw={alloc(e,t,r){let n=Qa;if(!n)return r;Qa=void 0;let o={value:r,issues:null};return n.set(t.value,o),Va.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"&&Ha(i,o.value))throw new qa;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 y=Vi(e,new Set,false);if(y===yo)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);y===Qi||n?r=true:n=true;}let l=c.value;if(!Ty(l))return s(c,u);let f=u[Ap];f||(f={buckets:new WeakMap,backEdges:void 0},u[Ap]=f);let p;o===u?p=i:(p=Sw(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(...Pp(m.issues)):(c.memo=true,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value)),c;Qa=p;let h=Va.length,d=s(c,u);Qa=void 0;let g=Va.length>h?Va.pop():void 0;return d instanceof Promise?d.then(y=>(g&&(g.issues=y.issues.length?Pp(y.issues):Iy),y)):(g&&(g.issues=d.issues.length?Pp(d.issues):Iy),d)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a);});}};function ji(){return vw}function Ha(e,t){let r=e[Ap]?.backEdges;return r!==void 0&&Ty(t)&&r.has(t)}var Xa={};var Ny,Rp=Symbol("ZodOutput"),kp=Symbol("ZodInput"),Ya=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 Ka(){return new Ya}(Ny=globalThis).__zod_globalRegistry??(Ny.__zod_globalRegistry=Ka());var We=globalThis.__zod_globalRegistry;var tt=Symbol.for("zod.compile.invalid"),Oy=Symbol.for("zod.compile.fallback"),It=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError";}},re=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 Ew(e,t){try{return ec(e,{assertOnly:!0})}catch{return t}}function Lp(e,t){try{let r=ec(e),n=Ja(e,r);return n._zod.bag.validator=Ew(e,r),n}catch(r){if(t?.strict)throw r;return e}}function Ja(e,t){if(Wa(e))throw new re("a schema whose subtree contains a reference cycle");let r=le(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[Oy]||a&&Ha(a,s.value))return o(s,a);let c=t(s.value);return c!==tt?(s.value=c,s):(a&&(a[Oy]=true),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||Pw(r,e,t),r}function Pw(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!==tt?{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!==tt?c:i(s,a)};}}function ec(e,t){let r=true;try{r=Wa(e);}catch{}if(r)throw new re("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:true},o=new on(["input"]),i=Ce(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[tt,...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 re(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=n.definite,p}function V(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 an(e,t){return e.definite=false,V(e,t)}function G(e){return `v${e.varCounter++}`}function ww(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return tt;let n=r;return n.issues.length===0?n.value:tt}function He(e,t,r,n,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Ce(e,t,r,n,o)}catch(u){if(!(u instanceof re)||!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,Sw(e,t,r,n)}}function Sw(e,t,r,n){t.definite=false;let o=V(t,r),i=V(t,ww),s=G(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var vw=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Cw(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&&!vw.has(a.check))throw new re('check with a custom "when" condition');switch(a.check){case "greater_than":Ew(e,t,a,i);break;case "less_than":Aw(e,t,a,i);break;case "multiple_of":Pw(e,t,a,i);break;case "number_format":Fy(e,a,i);break;case "min_length":{let c=wr(a.minimum,"min_length"),u=Rp(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=wr(a.maximum,"max_length"),u=Rp(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=wr(a.length,"length_equals"),u=Rp(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 < ${wr(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${wr(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${wr(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=Dy(e,t,a,i);break;case "custom":i=Lw(e,t,s,i);break;case "bigint_format":kw(e,a,i);break;case "mime_type":Rw(e,t,a,i);break;case "property":Iw(e,t,a,i);break;case "properties":Mw(e,t,a,i);break;case "overwrite":{let c=G(t);Tw(e,t,s,i,c),i=c;break}default:throw new re(`check type ${a.check}`)}}return i}function Rp(e,t,r,n){let o=V(t,tn),i=G(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function wr(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new re(`${t} bound of type ${typeof e}`);return `${e}`}function Oy(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new re("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new re("comparison check with Invalid Date bound");return V(e,t)}throw new re(`comparison check bound of type ${typeof t}`)}function Ew(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${Oy(t,r.value)}) return INVALID;`);}function Aw(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${Oy(t,r.value)}) return INVALID;`);}function Pw(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new re("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`);}else {let o=V(t,yi);e.write(`if (${o}(${n}, ${wr(r.value,"multiple_of")}) !== 0) return INVALID;`);}}function Fy(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 re(`number format ${n}`)}}function kw(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 re(`bigint format ${n}`)}}function Rw(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=V(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`);}}function Mw(e,t,r,n){if(r.when)throw new re('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"?V(t,i):Je(i),a=G(t);e.write(`const ${a} = ${n}[${s}];`),He(e,t,o[i],a,false);}}function Iw(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;Ce(e,t,r.schema,o);}function Tw(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new re("overwrite check without a transform function");if(cn(i))throw new It("z.compile: async overwrite transforms are not supported");let s=V(t,i);e.write(`const ${o} = ${s}(${n});`);}function Mp(){throw new mt}function Lp(e){this.issues.push(e);}function Lw(e,t,r,n){let o=r._zod.def;if(o.fn){if(cn(o.fn))throw new It("z.compile: async .refine() predicates are not supported");let i=an(t,o.fn),s=V(t,Mp),a=G(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(cn(r._zod.check))throw new It("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=an(t,u=>{let l={value:u,issues:[],addIssue:Lp};return i(l)instanceof Promise&&Mp(),l.issues.length===0?l.value:tt}),c=G(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new re("custom check without a predicate or check function")}var Nw=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 Dy(e,t,r,n,o=true){let i=r.format;if(i==="base64"){let u=V(t,Oi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=V(t,Na);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=V(t,Fa),l=V(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=V(t,zi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=V(t,Ta);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=V(t,za);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=V(t,Oa);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=V(t,Ra),l=V(t,r),f=G(t),p=G(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=V(t,Ma);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=V(t,Ia);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=G(t),h=s.normalize?`${p}.href`:`${V(t,Ni)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=r.fn;if(a){if(cn(a))throw new re(`async string format ${i}`);let u=V(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(Nw.has(i)&&r.pattern){let u=V(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 re("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(${Je(r.includes)})) return INVALID;`);break;case "starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${Je(u)}) return INVALID;`);break}case "ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${Je(u)}) return INVALID;`);break}default:throw new re(`string format ${c}`)}return n}function Ce(e,t,r,n,o=true){let i=r._zod.def,s=i.type;if(i.coerce)throw new re(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=zw(e,t,r,n,a);break;case "number":c=Ow(e,r,n);break;case "boolean":c=Fw(e,n);break;case "bigint":c=Dw(e,r,n);break;case "symbol":c=Zw(e,n);break;case "undefined":c=Bw(e,n);break;case "null":c=Gw(e,n);break;case "any":case "unknown":c=n;break;case "never":e.write("return INVALID;"),c=n;break;case "void":c=Uw(e,n);break;case "nan":c=Qw(e,n);break;case "date":c=Vw(e,n);break;case "object":c=jw(e,t,r,n,a);break;case "optional":c=qw(e,t,r,n,a);break;case "nullable":c=Xw(e,t,r,n,a);break;case "array":c=Yw(e,t,r,n,a);break;case "literal":c=Kw(e,t,r,n);break;case "enum":c=Jw(e,t,r,n);break;case "readonly":{let u=Ly(e,t,r,n),l=G(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":Ly(e,t,r,n),c="true";break;case "default":case "prefault":c=eS(e,t,r,n);break;case "nonoptional":c=tS(e,t,r,n);break;case "tuple":c=rS(e,t,r,n);break;case "union":c=nS(e,t,r,n);break;case "intersection":c=sS(e,t,r,n);break;case "record":c=aS(e,t,r,n);break;case "map":c=uS(e,t,r,n);break;case "set":c=lS(e,t,r,n);break;case "file":c=fS(e,n);break;case "template_literal":c=mS(e,t,r,n);break;case "lazy":c=pS(e,t,r,n);break;case "pipe":c=dS(e,t,r,n);break;case "custom":c=hS(e,t,r,n);break;case "transform":c=_S(e,t,r,n);break;case "catch":c=yS(e,t,r,n);break;default:throw new re(`schema type ${s}`)}return c===null?null:Cw(e,t,r,c)}function zw(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:Dy(e,t,i,n,o)}function Ow(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&&Fy(e,{format:n.format},r),r}function Fw(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Dw(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 Zw(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Bw(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Gw(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Uw(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Qw(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Vw(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function jw(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=_=>typeof _=="symbol"?V(t,_):Je(_),f=_=>typeof _=="symbol"?`[${l(_)}]`:Je(_),p=s;if(a.includes("__proto__"))throw new re('object shape key "__proto__"');let m=new Map;for(let _ of u){let b=p[_],S=l(_),v=G(t);if(e.write(`const ${v} = ${n}[${S}];`),b._zod.optin!==void 0){let x=G(t);e.write(`let ${x} = (() => {`),e.indented(w=>{let C=He(w,t,b,v);w.write(`return ${C};`);}),e.write("})();"),b._zod.optout==="optional"?(e.write(`if (${x} === INVALID) {`),e.indented(w=>{w.write(`if (${S} in ${n}) return INVALID;`),w.write(`${x} = undefined;`);}),e.write("}")):e.write(`if (${x} === INVALID) return INVALID;`),m.set(_,x);}else {Hw(b)&&e.write(`if (!(${S} in ${n})) return INVALID;`);let x=He(e,t,b,v,o);x!==null&&m.set(_,x);}}let h=i.catchall,d="none";if(h){let _=h._zod.def.type;if(_==="never"){let b=a.map(S=>`k !== ${Je(S)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(S=>{S.write(`if (${b}) return INVALID;`);}),e.write("}");}else (_==="unknown"||_==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=G(t),y=u.some(_=>Ty(p[_])||Ip(p[_]));if(!o){if(d==="schema"){let _=a.length>0?V(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`);let S=G(t);b.write(`const ${S} = ${n}[k];`),He(b,t,h,S,false);}),e.write("}");}return null}if(y){e.write(`const ${g} = {};`);for(let _ of u){let b=l(_),S=m.get(_);Ip(p[_])?e.write(`if (${b} in ${n}) ${g}[${b}] = ${S};`):Ty(p[_])?e.write(`if (${S} !== undefined || ${b} in ${n}) ${g}[${b}] = ${S};`):e.write(`${g}[${b}] = ${S};`);}}else {let _=u.map(b=>`${f(b)}: ${m.get(b)}`).join(", ");e.write(`const ${g} = { ${_} };`);}if(d!=="none"){let _=a.length>0?V(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{if(b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`),d==="passthrough")b.write(`${g}[k] = ${n}[k];`);else {let S=G(t);b.write(`const ${S} = ${n}[k];`);let v=He(b,t,h,S);b.write(`${g}[k] = ${v};`);}}),e.write("}");}return g}function qw(e,t,r,n,o=true){let i=r._zod.def;if(Ww(r))return Ce(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let a=G(t),c=G(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=Ce(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=Ce(u,t,i.innerType,n);u.write(`${a} = ${l};`);}),e.write("}"),a}let s=o?G(t):null;return s&&e.write(`let ${s};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=Ce(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function Ww(e){return e._zod.traits?.has("$ZodExactOptional")===true}function Hw(e){return e._zod.optin===void 0&&sn(e)}function sn(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?sn(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?sn(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some(sn):true;case "intersection":return !t.left||!t.right?true:sn(t.left)&&sn(t.right);case "pipe":return t.in?sn(t.in):true;default:return true}}function Ip(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Ty(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&go(e)}function go(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?go(t.innerType):true;case "union":return t.options?t.options.some(go):true;case "intersection":return !t.left||!t.right||go(t.left)||go(t.right);case "pipe":return t.out?go(t.out):true;default:return true}}function Xw(e,t,r,n,o=true){let i=r._zod.def,s=o?G(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=Ce(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function Np(e,t,r){for(let[n,o]of so(t._zod.def.checks))e.write(`if (${r} > ${wr(n,o._zod.def.check)}) return INVALID;`);}function Yw(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),Np(e,r,`${n}.length`);let s=o?G(t):null,a=G(t),c=G(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=He(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function Kw(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=V(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=V(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${Je(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 re(`literal type ${typeof s}`);return n}function Jw(e,t,r,n){let o=r._zod.values;if(!o)throw new re("enum schema without enumerated values");let i=V(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function Ly(e,t,r,n){let o=r._zod.def;return Ce(e,t,o.innerType,n)}function eS(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 Ce(e,t,o.innerType,n);let c=V(t,s),u=G(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),Ce(e,t,o.innerType,u)}let a=G(t);if(s){let c=V(t,s),u=V(t,_i);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=Ce(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=Ce(c,t,o.innerType,n);c.write(`${a} = ${u};`);}),e.write("}");return a}function tS(e,t,r,n){let o=r._zod.def,i=Ce(e,t,o.innerType,n),s=G(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function rS(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=Ny(i,"optin"),c=Ny(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=G(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=G(t);m.write(`const ${h} = ${n}[${l}];`);let d=He(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(Ip(f)){m.write(`${u}.length = ${l};`);return}let h=G(t),d=G(t);m.write(`const ${h} = undefined;`),m.write(`const ${d} = (() => {`),m.indented(g=>{let y=He(g,t,f,h);g.write(`return ${y};`);}),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=G(t);e.write(`const ${p} = ${n}[${l}];`);let m=He(e,t,f,p);e.write(`${u}[${l}] = ${m};`);}}if(s){let l=G(t),f=G(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${n}.length; ${l}++) {`),e.indented(p=>{p.write(`const ${f} = ${n}[${l}];`);let m=He(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function Ny(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 nS(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return oS(e,t,o,n);if(o.inclusive===false)throw new re("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return Ce(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=V(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=G(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=Ce(l,t,u,n);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function oS(e,t,r,n){if(r.unionFallback)throw new re("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=G(t),i=G(t);e.write(`const ${o} = ${n}?.[${Je(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 re("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new re(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>iS(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=Ce(p,t,c,n);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function iS(e,t,r){if(typeof r=="string")return `${t} === ${Je(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=V(e,r);return `${t} === ${n}`}throw new re(`literal discriminator value ${String(r)}`)}function sS(e,t,r,n){let o=r._zod.def;t.definite=false;let i=He(e,t,o.left,n),s=He(e,t,o.right,n),a=V(t,po),c=G(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function aS(e,t,r,n){let o=r._zod.def,i=V(t,vt);e.write(`if (!${i}(${n})) return INVALID;`);let s=G(t),a=G(t),c=G(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 re(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new re('record key "__proto__"');m.push(g);let y=V(t,d),_=Ce(e,t,o.keyType,y),b=G(t);e.write(`const ${b} = ${n}[${cS(t,g)}];`);let S=He(e,t,o.valueType,b);e.write(`${s}[${_}] = ${S};`);}let h=V(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=ec(o.keyType);h.definite===false&&(t.definite=false);let d=V(t,h),g=V(t,rr),y=G(t);return zy(e,t,n,a,_=>{_.write(`let ${y} = ${d}(${a});`),_.write(`if (${y} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${y} = ${d}(Number(${a}));`),m?_.write(`if (${y} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):_.write(`if (${y} === INVALID) return INVALID;`),_.write(`if (${y} === "__proto__") continue;`);let b=G(t);_.write(`const ${b} = ${n}[${a}];`);let S=He(_,t,o.valueType,b);_.write(`${s}[${y}] = ${S};`);}),s}return zy(e,t,n,a,m=>{m.write(`const ${c} = ${n}[${a}];`);let h=He(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function zy(e,t,r,n,o,i){let s=V(t,Object.prototype.propertyIsEnumerable),a=G(t),c=G(t),u=G(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 cS(e,t){return typeof t=="string"?Je(t):V(e,t)}function uS(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),Np(e,r,`${n}.size`);let i=G(t),s=G(t),a=G(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${n}) {`),e.indented(c=>{let u=Ce(c,t,o.keyType,s),l=Ce(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function lS(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),Np(e,r,`${n}.size`);let i=G(t),s=G(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${n}) {`),e.indented(a=>{let c=Ce(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function fS(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function mS(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=V(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`);}return n}function pS(e,t,r,n){let o=r._zod.def,i=an(t,o.getter),s=V(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=G(t);return e.write(`const ${a} = ${s}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function dS(e,t,r,n){let o=r._zod.def,i=Ce(e,t,o.in,n);if(o.transform){if(cn(o.transform))throw new It("z.compile: async transforms in pipes are not supported");let s=o.transform,c=an(t,l=>{let f={value:l,issues:[],addIssue:Lp},p=s(l,f);return p instanceof Promise?tt:f.issues.length===0?p:tt}),u=G(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),Ce(e,t,o.out,u)}else return Ce(e,t,o.out,i)}function cn(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function hS(e,t,r,n){let o=r._zod.def;if(o.fn){if(cn(o.fn))throw new It("z.compile: async custom predicates are not supported");let i=an(t,o.fn),s=V(t,Mp),a=G(t);e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`);}else throw new re("custom schema without a predicate function");return n}function gS(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return tt;let o=n;return o.issues.length===0?o.value:t()}function yS(e,t,r,n){let o=r._zod.def;if(!o.catchValue[aa])throw new re("catch with a callback (only a constant catch value compiles)",false);let i=G(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=He(u,t,o.innerType,n);u.write(`return ${l};`);}),e.write("})();");let s=V(t,o.innerType),a=an(t,o.catchValue),c=V(t,gS);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 _S(e,t,r,n){let o=r._zod.def;if(o.transform){if(cn(o.transform))throw new It("z.compile: async transforms are not supported");let i=o.transform,a=an(t,u=>{let l={value:u,issues:[],addIssue:Lp},f=i(u,l);return f instanceof Promise?tt:l.issues.length===0?f:tt}),c=G(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}function tc(e){return e.checks&&(e.checks=[...e.checks]),e}function zp(e,t){return new e(tc({type:"string",...N(t)}))}function Op(e,t){return new e(tc({type:"string",coerce:true,...N(t)}))}function rc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...N(t)})}function nc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...N(t)})}function oc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...N(t)})}function ic(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...N(t)})}function sc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...N(t)})}function ac(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...N(t)})}function ji(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...N(t)})}function cc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...N(t)})}function uc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...N(t)})}function lc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...N(t)})}function fc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...N(t)})}function mc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...N(t)})}function pc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...N(t)})}function dc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...N(t)})}function hc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...N(t)})}function gc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...N(t)})}function Fp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...N(t)})}function yc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...N(t)})}function _c(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...N(t)})}function bc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...N(t)})}function xc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...N(t)})}function $c(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...N(t)})}function Dp(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...N(t)})}function Zp(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...N(t)})}function wc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...N(t)})}var Bp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function qi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...N(t)})}function Wi(e,t){return new e({type:"string",format:"date",check:"string_format",...N(t)})}function Hi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...N(t)})}function Xi(e,t){return new e({type:"string",format:"duration",check:"string_format",...N(t)})}function Gp(e,t){return new e(tc({type:"number",checks:[],...N(t)}))}function Up(e,t){return new e(tc({type:"number",coerce:true,checks:[],...N(t)}))}function Qp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...N(t)})}function Vp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...N(t)})}function jp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...N(t)})}function qp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...N(t)})}function Wp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...N(t)})}function Hp(e,t){return new e({type:"boolean",...N(t)})}function Xp(e,t){return new e({type:"boolean",coerce:true,...N(t)})}function Yp(e,t){return new e({type:"bigint",...N(t)})}function Kp(e,t){return new e({type:"bigint",coerce:true,...N(t)})}function Jp(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...N(t)})}function ed(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...N(t)})}function td(e,t){return new e({type:"symbol",...N(t)})}function rd(e,t){return new e({type:"undefined",...N(t)})}function nd(e,t){return new e({type:"null",...N(t)})}function od(e){return new e({type:"any"})}function id(e){return new e({type:"unknown"})}function sd(e,t){return new e({type:"never",...N(t)})}function ad(e,t){return new e({type:"void",...N(t)})}function cd(e,t){return new e({type:"date",...N(t)})}function ud(e,t){return new e({type:"date",coerce:true,...N(t)})}function ld(e,t){return new e({type:"nan",...N(t)})}function Qt(e,t){return new Sa({check:"less_than",...N(t),value:e,inclusive:false})}function yt(e,t){return new Sa({check:"less_than",...N(t),value:e,inclusive:true})}function Vt(e,t){return new va({check:"greater_than",...N(t),value:e,inclusive:false})}function _t(e,t){return new va({check:"greater_than",...N(t),value:e,inclusive:true})}function Sc(e){return Vt(0,e)}function vc(e){return Qt(0,e)}function Cc(e){return yt(0,e)}function Ec(e){return _t(0,e)}function Sr(e,t){return new jf({check:"multiple_of",...N(t),value:e})}function vr(e,t){return new Hf({check:"max_size",...N(t),maximum:e})}function jt(e,t){return new Xf({check:"min_size",...N(t),minimum:e})}function un(e,t){return new Yf({check:"size_equals",...N(t),size:e})}function ln(e,t){return new Kf({check:"max_length",...N(t),maximum:e})}function nr(e,t){return new Jf({check:"min_length",...N(t),minimum:e})}function fn(e,t){return new em({check:"length_equals",...N(t),length:e})}function yo(e,t){return new tm({check:"string_format",format:"regex",...N(t),pattern:e})}function _o(e){return new rm({check:"string_format",format:"lowercase",...N(e)})}function bo(e){return new nm({check:"string_format",format:"uppercase",...N(e)})}function xo(e,t){return new om({check:"string_format",format:"includes",...N(t),includes:e})}function $o(e,t){return new im({check:"string_format",format:"starts_with",...N(t),prefix:e})}function wo(e,t){return new sm({check:"string_format",format:"ends_with",...N(t),suffix:e})}function Ac(e,t,r){return new am({check:"property",property:e,schema:t,...N(r)})}function So(e,t){return new cm({check:"properties",shape:e,...N(t)})}function vo(e,t){return new um({check:"mime_type",mime:e,...N(t)})}function Tt(e){return new lm({check:"overwrite",tx:e})}function Co(e){return Tt(t=>t.normalize(e))}function Eo(){return Tt(e=>e.trim())}function Ao(){return Tt(e=>e.toLowerCase())}function Po(){return Tt(e=>e.toUpperCase())}function ko(){return Tt(e=>jl(e))}function fd(e,t,r){return new e({type:"array",element:t,...N(r)})}function bS(e,t,r){return new e({type:"union",options:t,...N(r)})}function xS(e,t,r){return new e({type:"union",options:t,inclusive:false,...N(r)})}function $S(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...N(n)})}function wS(e,t,r){return new e({type:"intersection",left:t,right:r})}function SS(e,t,r,n){let o=r instanceof q,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...N(i)})}function vS(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...N(n)})}function CS(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...N(n)})}function ES(e,t,r){return new e({type:"set",valueType:t,...N(r)})}function AS(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...N(r)})}function PS(e,t,r){return new e({type:"enum",entries:t,...N(r)})}function kS(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...N(r)})}function md(e,t){return new e({type:"file",...N(t)})}function RS(e,t){return new e({type:"transform",transform:t})}function MS(e,t){return new e({type:"optional",innerType:t})}function IS(e,t){return new e({type:"nullable",innerType:t})}function TS(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():_i(r)}})}function LS(e,t,r){return new e({type:"nonoptional",innerType:t,...N(r)})}function NS(e,t){return new e({type:"success",innerType:t})}function zS(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:Jl(r)})}function OS(e,t,r){return new e({type:"pipe",in:t,out:r})}function FS(e,t){return new e({type:"readonly",innerType:t})}function DS(e,t,r){return new e({type:"template_literal",parts:t,...N(r)})}function ZS(e,t){return new e({type:"lazy",getter:t})}function BS(e,t){return new e({type:"promise",innerType:t})}function pd(e,t,r){let n=N(r);return n.abort??(n.abort=true),new e({type:"custom",check:"custom",fn:t,...n})}function dd(e,t,r){return new e({type:"custom",check:"custom",fn:t,...N(r)})}function hd(e,t){let r=Zy(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ao(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(ao(i));}},e(n.value,n)),t);return r}function Zy(e,t){let r=new _e({check:"custom",...N(t)});return r._zod.check=e,r}function gd(e){let t=new _e({check:"describe"});return t._zod.onattach=[r=>{let n=We.get(r)??{};We.add(r,{...n,description:e});}],t._zod.check=()=>{},t}function yd(e){let t=new _e({check:"meta"});return t._zod.onattach=[r=>{let n=We.get(r)??{};We.add(r,{...n,...e});}],t._zod.check=()=>{},t}function _d(e,t){let r=N(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??Bi,c=e.Boolean??Di,u=e.String??on,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 mn(e,t,r,n={}){let o=N(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 Yi(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 Cr(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??We,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 Fe(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 me(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),me(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Yi(s.schema,c),t.io==="input"&&rt(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 By(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Er(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}/${By(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+By(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 re(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(p.code=u),p.definite=n.definite,p}function V(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 cn(e,t){return e.definite=false,V(e,t)}function U(e){return `v${e.varCounter++}`}function Aw(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return tt;let n=r;return n.issues.length===0?n.value:tt}function He(e,t,r,n,o=true){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Ce(e,t,r,n,o)}catch(u){if(!(u instanceof re)||!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,Rw(e,t,r,n)}}function Rw(e,t,r,n){t.definite=false;let o=V(t,r),i=V(t,Aw),s=U(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var kw=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Mw(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&&!kw.has(a.check))throw new re('check with a custom "when" condition');switch(a.check){case "greater_than":Iw(e,t,a,i);break;case "less_than":Tw(e,t,a,i);break;case "multiple_of":Lw(e,t,a,i);break;case "number_format":Uy(e,a,i);break;case "min_length":{let c=wr(a.minimum,"min_length"),u=Mp(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case "max_length":{let c=wr(a.maximum,"max_length"),u=Mp(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case "length_equals":{let c=wr(a.length,"length_equals"),u=Mp(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 < ${wr(a.minimum,"min_size")}) return INVALID;`);break;case "max_size":e.write(`if (${i}.size > ${wr(a.maximum,"max_size")}) return INVALID;`);break;case "size_equals":e.write(`if (${i}.size !== ${wr(a.size,"size_equals")}) return INVALID;`);break;case "string_format":i=Gy(e,t,a,i);break;case "custom":i=Zw(e,t,s,i);break;case "bigint_format":Nw(e,a,i);break;case "mime_type":Ow(e,t,a,i);break;case "property":Fw(e,t,a,i);break;case "properties":zw(e,t,a,i);break;case "overwrite":{let c=U(t);Dw(e,t,s,i,c),i=c;break}default:throw new re(`check type ${a.check}`)}}return i}function Mp(e,t,r,n){let o=V(t,rn),i=U(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function wr(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new re(`${t} bound of type ${typeof e}`);return `${e}`}function By(e,t){if(typeof t=="bigint")return `${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new re("comparison check with NaN bound");return `${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new re("comparison check with Invalid Date bound");return V(e,t)}throw new re(`comparison check bound of type ${typeof t}`)}function Iw(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${By(t,r.value)}) return INVALID;`);}function Tw(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${By(t,r.value)}) return INVALID;`);}function Lw(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new re("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`);}else {let o=V(t,_i);e.write(`if (${o}(${n}, ${wr(r.value,"multiple_of")}) !== 0) return INVALID;`);}}function Uy(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 re(`number format ${n}`)}}function Nw(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 re(`bigint format ${n}`)}}function Ow(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=V(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`);}}function zw(e,t,r,n){if(r.when)throw new re('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"?V(t,i):Je(i),a=U(t);e.write(`const ${a} = ${n}[${s}];`),He(e,t,o[i],a,false);}}function Fw(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;Ce(e,t,r.schema,o);}function Dw(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new re("overwrite check without a transform function");if(un(i))throw new It("z.compile: async overwrite transforms are not supported");let s=V(t,i);e.write(`const ${o} = ${s}(${n});`);}function Ip(){throw new mt}function Np(e){this.issues.push(e);}function Zw(e,t,r,n){let o=r._zod.def;if(o.fn){if(un(o.fn))throw new It("z.compile: async .refine() predicates are not supported");let i=cn(t,o.fn),s=V(t,Ip),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(un(r._zod.check))throw new It("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=cn(t,u=>{let l={value:u,issues:[],addIssue:Np};return i(l)instanceof Promise&&Ip(),l.issues.length===0?l.value:tt}),c=U(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new re("custom check without a predicate or check function")}var Bw=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 Gy(e,t,r,n,o=true){let i=r.format;if(i==="base64"){let u=V(t,Fi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=V(t,Na);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=V(t,Fa),l=V(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=V(t,zi);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=V(t,Ta);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=V(t,Oa);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=V(t,za);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=V(t,ka),l=V(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=V(t,Ma);e.write(`if (!${d}(${p}, ${l}.hostname)) return INVALID;`);}if(s.protocol!==void 0){let d=V(t,Ia);e.write(`if (!${d}(${p}, ${l}.protocol)) return INVALID;`);}if(!o)return null;let m=U(t),h=s.normalize?`${p}.href`:`${V(t,Oi)}(${f})`;return e.write(`const ${m} = ${h};`),m}let a=r.fn;if(a){if(un(a))throw new re(`async string format ${i}`);let u=V(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(Bw.has(i)&&r.pattern){let u=V(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 re("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(${Je(r.includes)})) return INVALID;`);break;case "starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${Je(u)}) return INVALID;`);break}case "ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${Je(u)}) return INVALID;`);break}default:throw new re(`string format ${c}`)}return n}function Ce(e,t,r,n,o=true){let i=r._zod.def,s=i.type;if(i.coerce)throw new re(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case "string":c=Uw(e,t,r,n,a);break;case "number":c=Gw(e,r,n);break;case "boolean":c=Qw(e,n);break;case "bigint":c=Vw(e,r,n);break;case "symbol":c=jw(e,n);break;case "undefined":c=qw(e,n);break;case "null":c=Ww(e,n);break;case "any":case "unknown":c=n;break;case "never":e.write("return INVALID;"),c=n;break;case "void":c=Hw(e,n);break;case "nan":c=Xw(e,n);break;case "date":c=Yw(e,n);break;case "object":c=Kw(e,t,r,n,a);break;case "optional":c=Jw(e,t,r,n,a);break;case "nullable":c=rS(e,t,r,n,a);break;case "array":c=nS(e,t,r,n,a);break;case "literal":c=oS(e,t,r,n);break;case "enum":c=iS(e,t,r,n);break;case "readonly":{let u=Fy(e,t,r,n),l=U(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case "success":Fy(e,t,r,n),c="true";break;case "default":case "prefault":c=sS(e,t,r,n);break;case "nonoptional":c=aS(e,t,r,n);break;case "tuple":c=cS(e,t,r,n);break;case "union":c=uS(e,t,r,n);break;case "intersection":c=mS(e,t,r,n);break;case "record":c=pS(e,t,r,n);break;case "map":c=hS(e,t,r,n);break;case "set":c=gS(e,t,r,n);break;case "file":c=yS(e,n);break;case "template_literal":c=_S(e,t,r,n);break;case "lazy":c=bS(e,t,r,n);break;case "pipe":c=xS(e,t,r,n);break;case "custom":c=$S(e,t,r,n);break;case "transform":c=vS(e,t,r,n);break;case "catch":c=SS(e,t,r,n);break;default:throw new re(`schema type ${s}`)}return c===null?null:Mw(e,t,r,c)}function Uw(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:Gy(e,t,i,n,o)}function Gw(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&&Uy(e,{format:n.format},r),r}function Qw(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Vw(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 jw(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function qw(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Ww(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Hw(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Xw(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Yw(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Kw(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=_=>typeof _=="symbol"?V(t,_):Je(_),f=_=>typeof _=="symbol"?`[${l(_)}]`:Je(_),p=s;if(a.includes("__proto__"))throw new re('object shape key "__proto__"');let m=new Map;for(let _ of u){let b=p[_],S=l(_),v=U(t);if(e.write(`const ${v} = ${n}[${S}];`),b._zod.optin!==void 0){let x=U(t);e.write(`let ${x} = (() => {`),e.indented(w=>{let C=He(w,t,b,v);w.write(`return ${C};`);}),e.write("})();"),b._zod.optout==="optional"?(e.write(`if (${x} === INVALID) {`),e.indented(w=>{w.write(`if (${S} in ${n}) return INVALID;`),w.write(`${x} = undefined;`);}),e.write("}")):e.write(`if (${x} === INVALID) return INVALID;`),m.set(_,x);}else {tS(b)&&e.write(`if (!(${S} in ${n})) return INVALID;`);let x=He(e,t,b,v,o);x!==null&&m.set(_,x);}}let h=i.catchall,d="none";if(h){let _=h._zod.def.type;if(_==="never"){let b=a.map(S=>`k !== ${Je(S)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(S=>{S.write(`if (${b}) return INVALID;`);}),e.write("}");}else (_==="unknown"||_==="any")&&!h._zod.def.checks?.length?d="passthrough":d="schema";}let g=U(t),y=u.some(_=>zy(p[_])||Tp(p[_]));if(!o){if(d==="schema"){let _=a.length>0?V(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`);let S=U(t);b.write(`const ${S} = ${n}[k];`),He(b,t,h,S,false);}),e.write("}");}return null}if(y){e.write(`const ${g} = {};`);for(let _ of u){let b=l(_),S=m.get(_);Tp(p[_])?e.write(`if (${b} in ${n}) ${g}[${b}] = ${S};`):zy(p[_])?e.write(`if (${S} !== undefined || ${b} in ${n}) ${g}[${b}] = ${S};`):e.write(`${g}[${b}] = ${S};`);}}else {let _=u.map(b=>`${f(b)}: ${m.get(b)}`).join(", ");e.write(`const ${g} = { ${_} };`);}if(d!=="none"){let _=a.length>0?V(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(b=>{if(b.write('if (k === "__proto__") continue;'),_&&b.write(`if (${_}.has(k)) continue;`),d==="passthrough")b.write(`${g}[k] = ${n}[k];`);else {let S=U(t);b.write(`const ${S} = ${n}[k];`);let v=He(b,t,h,S);b.write(`${g}[k] = ${v};`);}}),e.write("}");}return g}function Jw(e,t,r,n,o=true){let i=r._zod.def;if(eS(r))return Ce(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=Ce(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=Ce(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=Ce(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function eS(e){return e._zod.traits?.has("$ZodExactOptional")===true}function tS(e){return e._zod.optin===void 0&&an(e)}function an(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?an(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?an(t.innerType):true;case "catch":return true;case "union":return t.options?t.options.some(an):true;case "intersection":return !t.left||!t.right?true:an(t.left)&&an(t.right);case "pipe":return t.in?an(t.in):true;default:return true}}function Tp(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function zy(e){return (e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&_o(e)}function _o(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?_o(t.innerType):true;case "union":return t.options?t.options.some(_o):true;case "intersection":return !t.left||!t.right||_o(t.left)||_o(t.right);case "pipe":return t.out?_o(t.out):true;default:return true}}function rS(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=Ce(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`);}),e.write("}"),s}function Op(e,t,r){for(let[n,o]of co(t._zod.def.checks))e.write(`if (${r} > ${wr(n,o._zod.def.check)}) return INVALID;`);}function nS(e,t,r,n,o=true){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),Op(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=He(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`);}),e.write("}"),s}function oS(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=V(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=V(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${Je(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 re(`literal type ${typeof s}`);return n}function iS(e,t,r,n){let o=r._zod.values;if(!o)throw new re("enum schema without enumerated values");let i=V(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function Fy(e,t,r,n){let o=r._zod.def;return Ce(e,t,o.innerType,n)}function sS(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 Ce(e,t,o.innerType,n);let c=V(t,s),u=U(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),Ce(e,t,o.innerType,u)}let a=U(t);if(s){let c=V(t,s),u=V(t,bi);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=Ce(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=Ce(c,t,o.innerType,n);c.write(`${a} = ${u};`);}),e.write("}");return a}function aS(e,t,r,n){let o=r._zod.def,i=Ce(e,t,o.innerType,n),s=U(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function cS(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=Dy(i,"optin"),c=Dy(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=He(m,t,f,h);m.write(`${u}[${l}] = ${d};`);}),p.write("} else {"),p.indented(m=>{if(Tp(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 y=He(g,t,f,h);g.write(`return ${y};`);}),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=He(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=He(p,t,s,f);p.write(`${u}[${l}] = ${m};`);}),e.write("}");}return u}function Dy(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 uS(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return lS(e,t,o,n);if(o.inclusive===false)throw new re("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return Ce(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=V(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=Ce(l,t,u,n);l.write(`return ${f};`);}),e.write("})();");}return e.write(`if (${a} === INVALID) return INVALID;`),a}function lS(e,t,r,n){if(r.unionFallback)throw new re("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}?.[${Je(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 re("discriminated union option without static discriminator values");for(let p of u){if(a.has(p))throw new re(`duplicate discriminator value ${String(p)}`);a.add(p);}let l=Array.from(u,p=>fS(t,o,p)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(p=>{let m=Ce(p,t,c,n);p.write(`${i} = ${m};`);}),e.write("}"),s=false;}return e.write("else { return INVALID; }"),i}function fS(e,t,r){if(typeof r=="string")return `${t} === ${Je(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=V(e,r);return `${t} === ${n}`}throw new re(`literal discriminator value ${String(r)}`)}function mS(e,t,r,n){let o=r._zod.def;t.definite=false;let i=He(e,t,o.left,n),s=He(e,t,o.right,n),a=V(t,go),c=U(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function pS(e,t,r,n){let o=r._zod.def,i=V(t,vt);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 re(`record key value ${String(d)}`);let g=typeof d=="number"?d.toString():d;if(g==="__proto__")throw new re('record key "__proto__"');m.push(g);let y=V(t,d),_=Ce(e,t,o.keyType,y),b=U(t);e.write(`const ${b} = ${n}[${dS(t,g)}];`);let S=He(e,t,o.valueType,b);e.write(`${s}[${_}] = ${S};`);}let h=V(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=ec(o.keyType);h.definite===false&&(t.definite=false);let d=V(t,h),g=V(t,rr),y=U(t);return Zy(e,t,n,a,_=>{_.write(`let ${y} = ${d}(${a});`),_.write(`if (${y} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${y} = ${d}(Number(${a}));`),m?_.write(`if (${y} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):_.write(`if (${y} === INVALID) return INVALID;`),_.write(`if (${y} === "__proto__") continue;`);let b=U(t);_.write(`const ${b} = ${n}[${a}];`);let S=He(_,t,o.valueType,b);_.write(`${s}[${y}] = ${S};`);}),s}return Zy(e,t,n,a,m=>{m.write(`const ${c} = ${n}[${a}];`);let h=He(m,t,o.valueType,c);m.write(`${s}[${a}] = ${h};`);},"return INVALID;"),s}function Zy(e,t,r,n,o,i){let s=V(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 dS(e,t){return typeof t=="string"?Je(t):V(e,t)}function hS(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),Op(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=Ce(c,t,o.keyType,s),l=Ce(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`);}),e.write("}"),i}function gS(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),Op(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=Ce(a,t,o.valueType,s);a.write(`${i}.add(${c});`);}),e.write("}"),i}function yS(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function _S(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=V(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`);}return n}function bS(e,t,r,n){let o=r._zod.def,i=cn(t,o.getter),s=V(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 xS(e,t,r,n){let o=r._zod.def,i=Ce(e,t,o.in,n);if(o.transform){if(un(o.transform))throw new It("z.compile: async transforms in pipes are not supported");let s=o.transform,c=cn(t,l=>{let f={value:l,issues:[],addIssue:Np},p=s(l,f);return p instanceof Promise?tt:f.issues.length===0?p:tt}),u=U(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),Ce(e,t,o.out,u)}else return Ce(e,t,o.out,i)}function un(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function $S(e,t,r,n){let o=r._zod.def;if(o.fn){if(un(o.fn))throw new It("z.compile: async custom predicates are not supported");let i=cn(t,o.fn),s=V(t,Ip),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 re("custom schema without a predicate function");return n}function wS(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return tt;let o=n;return o.issues.length===0?o.value:t()}function SS(e,t,r,n){let o=r._zod.def;if(!o.catchValue[aa])throw new re("catch with a callback (only a constant catch value compiles)",false);let i=U(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=He(u,t,o.innerType,n);u.write(`return ${l};`);}),e.write("})();");let s=V(t,o.innerType),a=cn(t,o.catchValue),c=V(t,wS);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 vS(e,t,r,n){let o=r._zod.def;if(o.transform){if(un(o.transform))throw new It("z.compile: async transforms are not supported");let i=o.transform,a=cn(t,u=>{let l={value:u,issues:[],addIssue:Np},f=i(u,l);return f instanceof Promise?tt:l.issues.length===0?f:tt}),c=U(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}function tc(e){return e.checks&&(e.checks=[...e.checks]),e}function zp(e,t){return new e(tc({type:"string",...N(t)}))}function Fp(e,t){return new e(tc({type:"string",coerce:true,...N(t)}))}function rc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:false,...N(t)})}function nc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:false,...N(t)})}function oc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,...N(t)})}function ic(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...N(t)})}function sc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...N(t)})}function ac(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...N(t)})}function qi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:false,...N(t)})}function cc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:false,...N(t)})}function uc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:false,...N(t)})}function lc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:false,...N(t)})}function fc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:false,...N(t)})}function mc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:false,...N(t)})}function pc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:false,...N(t)})}function dc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:false,...N(t)})}function hc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:false,...N(t)})}function gc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:false,...N(t)})}function Dp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:false,...N(t)})}function yc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:false,...N(t)})}function _c(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:false,...N(t)})}function bc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:false,...N(t)})}function xc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:false,...N(t)})}function $c(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:false,...N(t)})}function Zp(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:false,...N(t)})}function Bp(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:false,...N(t)})}function wc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:false,...N(t)})}var Up={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Wi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...N(t)})}function Hi(e,t){return new e({type:"string",format:"date",check:"string_format",...N(t)})}function Xi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...N(t)})}function Yi(e,t){return new e({type:"string",format:"duration",check:"string_format",...N(t)})}function Gp(e,t){return new e(tc({type:"number",checks:[],...N(t)}))}function Qp(e,t){return new e(tc({type:"number",coerce:true,checks:[],...N(t)}))}function Vp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"safeint",...N(t)})}function jp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float32",...N(t)})}function qp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"float64",...N(t)})}function Wp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"int32",...N(t)})}function Hp(e,t){return new e({type:"number",check:"number_format",abort:false,format:"uint32",...N(t)})}function Xp(e,t){return new e({type:"boolean",...N(t)})}function Yp(e,t){return new e({type:"boolean",coerce:true,...N(t)})}function Kp(e,t){return new e({type:"bigint",...N(t)})}function Jp(e,t){return new e({type:"bigint",coerce:true,...N(t)})}function ed(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"int64",...N(t)})}function td(e,t){return new e({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...N(t)})}function rd(e,t){return new e({type:"symbol",...N(t)})}function nd(e,t){return new e({type:"undefined",...N(t)})}function od(e,t){return new e({type:"null",...N(t)})}function id(e){return new e({type:"any"})}function sd(e){return new e({type:"unknown"})}function ad(e,t){return new e({type:"never",...N(t)})}function cd(e,t){return new e({type:"void",...N(t)})}function ud(e,t){return new e({type:"date",...N(t)})}function ld(e,t){return new e({type:"date",coerce:true,...N(t)})}function fd(e,t){return new e({type:"nan",...N(t)})}function Vt(e,t){return new Sa({check:"less_than",...N(t),value:e,inclusive:false})}function yt(e,t){return new Sa({check:"less_than",...N(t),value:e,inclusive:true})}function jt(e,t){return new va({check:"greater_than",...N(t),value:e,inclusive:false})}function _t(e,t){return new va({check:"greater_than",...N(t),value:e,inclusive:true})}function Sc(e){return jt(0,e)}function vc(e){return Vt(0,e)}function Cc(e){return yt(0,e)}function Ec(e){return _t(0,e)}function Sr(e,t){return new qf({check:"multiple_of",...N(t),value:e})}function vr(e,t){return new Xf({check:"max_size",...N(t),maximum:e})}function qt(e,t){return new Yf({check:"min_size",...N(t),minimum:e})}function ln(e,t){return new Kf({check:"size_equals",...N(t),size:e})}function fn(e,t){return new Jf({check:"max_length",...N(t),maximum:e})}function nr(e,t){return new em({check:"min_length",...N(t),minimum:e})}function mn(e,t){return new tm({check:"length_equals",...N(t),length:e})}function bo(e,t){return new rm({check:"string_format",format:"regex",...N(t),pattern:e})}function xo(e){return new nm({check:"string_format",format:"lowercase",...N(e)})}function $o(e){return new om({check:"string_format",format:"uppercase",...N(e)})}function wo(e,t){return new im({check:"string_format",format:"includes",...N(t),includes:e})}function So(e,t){return new sm({check:"string_format",format:"starts_with",...N(t),prefix:e})}function vo(e,t){return new am({check:"string_format",format:"ends_with",...N(t),suffix:e})}function Pc(e,t,r){return new cm({check:"property",property:e,schema:t,...N(r)})}function Co(e,t){return new um({check:"properties",shape:e,...N(t)})}function Eo(e,t){return new lm({check:"mime_type",mime:e,...N(t)})}function Tt(e){return new fm({check:"overwrite",tx:e})}function Po(e){return Tt(t=>t.normalize(e))}function Ao(){return Tt(e=>e.trim())}function Ro(){return Tt(e=>e.toLowerCase())}function ko(){return Tt(e=>e.toUpperCase())}function Mo(){return Tt(e=>ql(e))}function md(e,t,r){return new e({type:"array",element:t,...N(r)})}function CS(e,t,r){return new e({type:"union",options:t,...N(r)})}function ES(e,t,r){return new e({type:"union",options:t,inclusive:false,...N(r)})}function PS(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...N(n)})}function AS(e,t,r){return new e({type:"intersection",left:t,right:r})}function RS(e,t,r,n){let o=r instanceof q,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...N(i)})}function kS(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...N(n)})}function MS(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...N(n)})}function IS(e,t,r){return new e({type:"set",valueType:t,...N(r)})}function TS(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...N(r)})}function LS(e,t,r){return new e({type:"enum",entries:t,...N(r)})}function NS(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...N(r)})}function pd(e,t){return new e({type:"file",...N(t)})}function OS(e,t){return new e({type:"transform",transform:t})}function zS(e,t){return new e({type:"optional",innerType:t})}function FS(e,t){return new e({type:"nullable",innerType:t})}function DS(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():bi(r)}})}function ZS(e,t,r){return new e({type:"nonoptional",innerType:t,...N(r)})}function BS(e,t){return new e({type:"success",innerType:t})}function US(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:ef(r)})}function GS(e,t,r){return new e({type:"pipe",in:t,out:r})}function QS(e,t){return new e({type:"readonly",innerType:t})}function VS(e,t,r){return new e({type:"template_literal",parts:t,...N(r)})}function jS(e,t){return new e({type:"lazy",getter:t})}function qS(e,t){return new e({type:"promise",innerType:t})}function dd(e,t,r){let n=N(r);return n.abort??(n.abort=true),new e({type:"custom",check:"custom",fn:t,...n})}function hd(e,t,r){return new e({type:"custom",check:"custom",fn:t,...N(r)})}function gd(e,t){let r=Qy(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(uo(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(uo(i));}},e(n.value,n)),t);return r}function Qy(e,t){let r=new _e({check:"custom",...N(t)});return r._zod.check=e,r}function yd(e){let t=new _e({check:"describe"});return t._zod.onattach=[r=>{let n=We.get(r)??{};We.add(r,{...n,description:e});}],t._zod.check=()=>{},t}function _d(e){let t=new _e({check:"meta"});return t._zod.onattach=[r=>{let n=We.get(r)??{};We.add(r,{...n,...e});}],t._zod.check=()=>{},t}function bd(e,t){let r=N(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??Ui,c=e.Boolean??Zi,u=e.String??sn,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 pn(e,t,r,n={}){let o=N(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 Ki(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 Cr(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??We,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 Fe(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 me(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),me(f,t,l),t.seen.get(f).isParent=true);}let c=t.metadataRegistry.get(e);return c&&Ki(s.schema,c),t.io==="input"&&rt(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 Vy(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Er(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}/${Vy(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+Vy(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 Qy(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;Qy(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 Vy=new Set(["type","properties","required","additionalProperties"]),Gy=["oneOf","anyOf"];function Uy(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function bd(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Vy.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]??Uy(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:bd(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=Uy(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 GS(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Vy)if(o in e)return;let r=t.filter(o=>Gy.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=bd(t);else {let o=r[0],i=Gy.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=>bd([...s,c]));if(a.some(c=>!c))return;n={[i]:a};}n&&(delete e.allOf,Yi(e,n));}function Ar(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)):Yi(u,h),Yi(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())Qy(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)??[])GS(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);}Yi(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:Ro(t,"input",e.processors),output:Ro(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function rt(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 rt(n.element,r);if(n.type==="set")return rt(n.valueType,r);if(n.type==="lazy")return rt(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 rt(n.innerType,r);if(n.type==="intersection")return rt(n.left,r)||rt(n.right,r);if(n.type==="record"||n.type==="map")return rt(n.keyType,r)||rt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:rt(n.in,r)||rt(n.out,r);if(n.type==="object"){for(let o in n.shape)if(rt(n.shape[o],r))return true;return false}if(n.type==="union"){for(let o of n.options)if(rt(o,r))return true;return false}if(n.type==="tuple"){for(let o of n.items)if(rt(o,r))return true;return !!(n.rest&&rt(n.rest,r))}return false}var xd=(e,t={})=>r=>{let n=Cr({...r,processors:t});return me(e,n),Er(n,e),Ar(n,e)},Ro=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Cr({...o??{},target:i,io:t,processors:r});return me(e,s),Er(s,e),Ar(s,e)};var Mo=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r);},Io=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r);},jy=(e,t)=>{Mo(e,"minimum",t),Io(e,"maximum",t);},Xy=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},Yy=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},Ky=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t];},Jy=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},qy=(e,t)=>Mo(e,"minimum",t.minimum),Wy=(e,t)=>Io(e,"maximum",t.maximum),Hy=e=>(t,r)=>{Jy(t,r.format);let[n,o]=e[r.format];Mo(t,"minimum",n),Io(t,"maximum",o);},US={greater_than:(e,t)=>Mo(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Io(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Xy(e,t.value),number_format:Hy(xi),bigint_format:Hy($i),min_length:qy,max_length:Wy,length_equals:(e,t)=>jy(e,t.length),min_size:qy,max_size:Wy,size_equals:(e,t)=>jy(e,t.size),string_format:(e,t)=>{Jy(e,t.format),t.pattern&&Yy(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)=>Ky(e,t.mime)};function De(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)US[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Mo(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Mo(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Io(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Io(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Xy(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&Ky(t,o.mime);for(let i of o.patterns??[])Yy(t,i);return t}var QS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},VS=new Map([[La,Ef],[Fi,Af]]),e_=e=>VS.get(e)??e,Sd=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=De(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=QS[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(e_);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}))]);}},vd=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=De(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 y of a)Number.isFinite(y)&&y!==0?h.add(Math.abs(y)):Fe(e,t,o,n,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(y=>({multipleOf:y}))]);}},Cd=(e,t,r,n)=>{r.type="boolean";},Ed=(e,t,r,n)=>{Fe(e,t,r,n,"BigInt cannot be represented in JSON Schema");},Ad=(e,t,r,n)=>{Fe(e,t,r,n,"Symbols cannot be represented in JSON Schema");},Pd=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},kd=(e,t,r,n)=>{Fe(e,t,r,n,"Undefined cannot be represented in JSON Schema");},Rd=(e,t,r,n)=>{Fe(e,t,r,n,"Void cannot be represented in JSON Schema");},Md=(e,t,r,n)=>{r.not={};},Id=(e,t,r,n)=>{},Td=(e,t,r,n)=>{},Ld=(e,t,r,n)=>{Fe(e,t,r,n,"Date cannot be represented in JSON Schema");},Nd=(e,t,r,n)=>{let o=e._zod.def,i=ro(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;},zd=(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(Fe(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Fe(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;},Od=(e,t,r,n)=>{Fe(e,t,r,n,"NaN cannot be represented in JSON Schema");},Fd=(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;},Dd=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=De(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})));},Zd=(e,t,r,n)=>{r.type="boolean";},Bd=(e,t,r,n)=>{Fe(e,t,r,n,"Custom types cannot be represented in JSON Schema");},Gd=(e,t,r,n)=>{Fe(e,t,r,n,"Function types cannot be represented in JSON Schema");},Ud=(e,t,r,n)=>{Fe(e,t,r,n,"Transforms cannot be represented in JSON Schema");},Qd=(e,t,r,n)=>{Fe(e,t,r,n,"Map cannot be represented in JSON Schema");},Vd=(e,t,r,n)=>{Fe(e,t,r,n,"Set cannot be represented in JSON Schema");},jd=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=De(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=me(i.element,t,{...n,path:[...n.path,"items"]});};function Ki(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Ki(t.out):t.type==="catch"?Ki(t.innerType):e._zod.optin}var qd=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Fe(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,me(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"?Ki(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=me(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},kc=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>me(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s;},Wd=(e,t,r,n)=>{let o=e._zod.def,i=me(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=me(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);},Hd=(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)=>me(d,t,{...n,path:[...n.path,s,g]})),u=i.rest?me(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"?Ki(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}=De(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function $d(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=$d(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(y=>$d(e,y,r));g.some((y,_)=>y!==d[_])&&(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")?rr:Mi).source)),m}var wd=new WeakMap;function jS(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 wd.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||r.has(i))continue;let s=$d(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 Xd=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=De(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=me(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)qe(o.patternProperties,e_(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=me(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=wd.get(t);l||(l=[],wd.set(t,l),t.deferred.push(()=>jS(t))),l.push(e);}o.additionalProperties=me(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&Ki(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));}},Yd=(e,t,r,n)=>{let o=e._zod.def,i=me(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"}];},Kd=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Jd=Symbol();function t_(e,t,r,n,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(Fe(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Jd):JSON.parse(s)}var eh=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=t_(o.defaultValue,e,t,r,n);s!==Jd&&(r.default=s);},th=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=t_(o.defaultValue,e,t,r,n);s!==Jd&&(r._prefault=s);},rh=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{Fe(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s;},nh=(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;me(s,t,n);let a=t.seen.get(e);a.ref=s;},oh=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=true;},ih=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},Rc=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},sh=(e,t,r,n)=>{let o=e._zod.innerType;me(o,t,n);let i=t.seen.get(e);i.ref=o;},Pc={string:Sd,number:vd,boolean:Cd,bigint:Ed,symbol:Ad,null:Pd,undefined:kd,void:Rd,never:Md,any:Id,unknown:Td,date:Ld,enum:Nd,literal:zd,nan:Od,template_literal:Fd,file:Dd,success:Zd,custom:Bd,function:Gd,transform:Ud,map:Qd,set:Vd,array:jd,object:qd,union:kc,intersection:Wd,tuple:Hd,record:Xd,nullable:Yd,nonoptional:Kd,default:eh,prefault:th,catch:rh,pipe:nh,readonly:oh,promise:ih,optional:Rc,lazy:sh};function Mc(e,t){if("_idmap"in e){let n=e,o=Cr({...t,processors:Pc}),i={};for(let c of n._idmap.entries()){let[u,l]=c;me(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;Er(o,l),qe(s,u,Ar(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=Cr({...t,processors:Pc});return me(e,r),Er(r,e),Ar(r,e)}var Ic=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=Cr({processors:Pc,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 me(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,Er(this.ctx,t);let n=Ar(this.ctx,t),{"~standard":o,...i}=n;return i}};var r_={};var Zo={};hr(Zo,{ZodAny:()=>Ph,ZodArray:()=>Ih,ZodBase64:()=>Yc,ZodBase64URL:()=>Kc,ZodBigInt:()=>Fo,ZodBigIntFormat:()=>tu,ZodBoolean:()=>Oo,ZodCIDRv4:()=>Hc,ZodCIDRv6:()=>Xc,ZodCUID:()=>Gc,ZodCUID2:()=>Uc,ZodCatch:()=>Jh,ZodCodec:()=>cs,ZodCreditCard:()=>xh,ZodCustom:()=>us,ZodCustomStringFormat:()=>gn,ZodDate:()=>rs,ZodDefault:()=>qh,ZodDiscriminatedUnion:()=>Lh,ZodE164:()=>Jc,ZodEmail:()=>Fc,ZodEmoji:()=>Zc,ZodEnum:()=>Lo,ZodExactOptional:()=>iu,ZodFile:()=>Uh,ZodFunction:()=>u0,ZodGUID:()=>Dc,ZodIBAN:()=>$h,ZodIPv4:()=>qc,ZodIPv6:()=>Wc,ZodISODate:()=>kr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Mr,ZodISOTime:()=>Rr,ZodInstanceOf:()=>m0,ZodIntersection:()=>Nh,ZodJWT:()=>eu,ZodKSUID:()=>jc,ZodLazy:()=>s0,ZodLiteral:()=>Gh,ZodMAC:()=>bh,ZodMap:()=>Zh,ZodNaN:()=>t0,ZodNanoID:()=>Bc,ZodNever:()=>Rh,ZodNonOptional:()=>su,ZodNull:()=>Eh,ZodNullable:()=>jh,ZodNumber:()=>zo,ZodNumberFormat:()=>yn,ZodObject:()=>os,ZodOptional:()=>ss,ZodPipe:()=>as,ZodPrefault:()=>Hh,ZodPreprocess:()=>r0,ZodPromise:()=>c0,ZodReadonly:()=>n0,ZodRecord:()=>To,ZodSet:()=>Bh,ZodString:()=>No,ZodStringFormat:()=>he,ZodSuccess:()=>Kh,ZodSymbol:()=>vh,ZodTemplateLiteral:()=>i0,ZodTransform:()=>Qh,ZodTuple:()=>Oh,ZodType:()=>H,ZodULID:()=>Qc,ZodURL:()=>ts,ZodUUID:()=>qt,ZodUndefined:()=>Ch,ZodUnion:()=>is,ZodUnknown:()=>kh,ZodVoid:()=>Mh,ZodXID:()=>Vc,ZodXor:()=>Th,_ZodString:()=>Oc,_default:()=>Wh,_function:()=>hb,any:()=>j_,array:()=>ns,base64:()=>E_,base64url:()=>A_,bigint:()=>B_,boolean:()=>Sh,catch:()=>e0,check:()=>gb,cidrv4:()=>v_,cidrv6:()=>C_,codec:()=>fb,creditCard:()=>k_,cuid:()=>g_,cuid2:()=>y_,currencyCode:()=>N_,custom:()=>yb,date:()=>W_,describe:()=>_b,discriminatedUnion:()=>eb,e164:()=>P_,email:()=>s_,emoji:()=>d_,enum:()=>nu,exactOptional:()=>Vh,file:()=>ab,float32:()=>O_,float64:()=>F_,function:()=>hb,guid:()=>a_,hash:()=>z_,hex:()=>L_,hostname:()=>T_,httpUrl:()=>p_,iban:()=>R_,instanceof:()=>xb,int:()=>Nc,int32:()=>D_,int64:()=>G_,intersection:()=>zh,invertCodec:()=>mb,ipv4:()=>$_,ipv6:()=>S_,json:()=>wb,jwt:()=>M_,keyof:()=>H_,ksuid:()=>x_,lazy:()=>a0,literal:()=>sb,looseObject:()=>K_,looseRecord:()=>rb,mac:()=>w_,map:()=>nb,meta:()=>bb,nan:()=>lb,nanoid:()=>h_,nativeEnum:()=>ib,never:()=>ru,nonoptional:()=>Yh,null:()=>Ah,nullable:()=>es,nullish:()=>cb,number:()=>wh,object:()=>X_,optional:()=>dn,partialRecord:()=>tb,pipe:()=>zc,prefault:()=>Xh,preprocess:()=>Sb,promise:()=>db,readonly:()=>o0,record:()=>Dh,refine:()=>l0,set:()=>ob,strictObject:()=>Y_,string:()=>Ji,stringFormat:()=>I_,stringbool:()=>$b,success:()=>ub,superRefine:()=>f0,symbol:()=>Q_,templateLiteral:()=>pb,transform:()=>ou,tuple:()=>Fh,uint32:()=>Z_,uint64:()=>U_,ulid:()=>__,undefined:()=>V_,union:()=>Do,unknown:()=>pn,url:()=>m_,uuid:()=>c_,uuidv4:()=>u_,uuidv6:()=>l_,uuidv7:()=>f_,void:()=>q_,xid:()=>b_,xor:()=>J_});var WS=()=>{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=Yl(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 ${ia(i.values[0])}`:`Invalid option: expected one of ${ra(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":""}: ${ra(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 n_(){return {localeError:WS()}}var Tc={};hr(Tc,{endsWith:()=>wo,gt:()=>Vt,gte:()=>_t,includes:()=>xo,length:()=>fn,lowercase:()=>_o,lt:()=>Qt,lte:()=>yt,maxLength:()=>ln,maxSize:()=>vr,mime:()=>vo,minLength:()=>nr,minSize:()=>jt,multipleOf:()=>Sr,negative:()=>vc,nonnegative:()=>Ec,nonpositive:()=>Cc,normalize:()=>Co,overwrite:()=>Tt,positive:()=>Sc,properties:()=>So,property:()=>Ac,regex:()=>yo,size:()=>un,slugify:()=>ko,startsWith:()=>$o,toLowerCase:()=>Ao,toUpperCase:()=>Po,trim:()=>Eo,uppercase:()=>bo});var o_=new WeakSet([Object.prototype,Error.prototype]);function Lc(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 i_=(e,t)=>{sf.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);o_.has(r)||(o_.add(r),Lc(r,"format",n=>o=>Ai(n,o)),Lc(r,"flatten",n=>o=>Ei(n,o)),Lc(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,no,2);}),Lc(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,no,2);}),Object.defineProperty(r,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},HS=E("ZodError",i_),dt=E("ZodError",i_,void 0,{Parent:Error});var ah=co(dt),ch=uo(dt),uh=lo(dt),lh=fo(dt),fh=fa(dt),mh=ma(dt),ph=pa(dt),dh=da(dt),hh=ha(dt),gh=ga(dt),yh=ya(dt),_h=_a(dt);function YS(){Ue.localeError||Pe(n_());}function hn(){Ue.memoizer||Pe({memoizer:Vi()});}var H=E("ZodType",(e,t)=>(YS(),q.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(F.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 le(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(l0(e,t))},superRefine(e,t){return this.check(f0(e,t))},overwrite(e){return this.check(Tt(e))},optional(){return dn(this)},exactOptional(){return Vh(this)},nullable(){return es(this)},nullish(){return dn(es(this))},nonoptional(e){return Yh(this,e)},array(){return ns(this)},or(e){return Do([this,e])},and(e){return zh(this,e)},transform(e){return zc(this,ou(e))},default(e){return Wh(this,e)},prefault(e){return Xh(this,e)},catch(e){return e0(this,e)},pipe(e){return zc(this,e)},readonly(){return o0(this)},describe(e){let t=this.clone();return We.add(t,{description:e}),t},meta(...e){if(e.length===0)return We.get(this);let t=this.clone();return We.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 F.hide(this,"~standard",{...ka(this),jsonSchema:{input:Ro(this,"input"),output:Ro(this,"output")}})},set"~standard"(e){F.own(this,"~standard",e);},parse:function e(t,r){return ah(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await ch(this,t,r,{callee:e})},safeParse(e,t){return uh(this,e,t)},async safeParseAsync(e,t){return lh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){F.own(this,"spa",e);},validate(e,t){return Pi(this,e,t)},validateAsync(e,t){return ki(this,e,t)},encode:function e(t,r){return fh(this,t,r,{callee:e})},decode:function e(t,r){return mh(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ph(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await dh(this,t,r,{callee:e})},safeEncode(e,t){return hh(this,e,t)},safeDecode(e,t){return gh(this,e,t)},async safeEncodeAsync(e,t){return yh(this,e,t)},async safeDecodeAsync(e,t){return _h(this,e,t)},toJSONSchema(e){return xd(this,{})(e)},get description(){return We.get(this)?.description},get _def(){return this._zod.def}}),Oc=E("_ZodString",(e,t)=>{on.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sd(e,r,n);},F.derived({format:e=>De(e).format??null,minLength:e=>De(e).minimum??null,maxLength:e=>De(e).maximum??null},{regex(...e){return this.check(yo(...e))},includes(...e){return this.check(xo(...e))},startsWith(...e){return this.check($o(...e))},endsWith(...e){return this.check(wo(...e))},min(...e){return this.check(nr(...e))},max(...e){return this.check(ln(...e))},length(...e){return this.check(fn(...e))},nonempty(...e){return this.check(nr(1,...e))},lowercase(e){return this.check(_o(e))},uppercase(e){return this.check(bo(e))},trim(){return this.check(Eo())},normalize(...e){return this.check(Co(...e))},toLowerCase(){return this.check(Ao())},toUpperCase(){return this.check(Po())},slugify(){return this.check(ko())}})),No=E("ZodString",(e,t)=>{on.init(e,t),Oc.init(e,t);},{email(e){return this.check(rc(Fc,e))},url(e){return this.check(ji(ts,e))},jwt(e){return this.check(wc(eu,e))},emoji(e){return this.check(cc(Zc,e))},guid(e){return this.check(nc(Dc,e))},uuid(e){return this.check(oc(qt,e))},uuidv4(e){return this.check(ic(qt,e))},uuidv6(e){return this.check(sc(qt,e))},uuidv7(e){return this.check(ac(qt,e))},nanoid(e){return this.check(uc(Bc,e))},cuid(e){return this.check(lc(Gc,e))},cuid2(e){return this.check(fc(Uc,e))},ulid(e){return this.check(mc(Qc,e))},base64(e){return this.check(bc(Yc,e))},base64url(e){return this.check(xc(Kc,e))},xid(e){return this.check(pc(Vc,e))},ksuid(e){return this.check(dc(jc,e))},ipv4(e){return this.check(hc(qc,e))},ipv6(e){return this.check(gc(Wc,e))},cidrv4(e){return this.check(yc(Hc,e))},cidrv6(e){return this.check(_c(Xc,e))},e164(e){return this.check($c(Jc,e))},datetime(e){return this.check(qi(Pr,e))},date(e){return this.check(Wi(kr,e))},time(e){return this.check(Hi(Rr,e))},duration(e){return this.check(Xi(Mr,e))}});function Ji(e){return zp(No,e)}var he=E("ZodStringFormat",(e,t)=>{fe.init(e,t),Oc.init(e,t);}),Pr=E("ZodISODateTime",(e,t)=>{Em.init(e,t),he.init(e,t);}),kr=E("ZodISODate",(e,t)=>{Am.init(e,t),he.init(e,t);}),Rr=E("ZodISOTime",(e,t)=>{Pm.init(e,t),he.init(e,t);}),Mr=E("ZodISODuration",(e,t)=>{km.init(e,t),he.init(e,t);}),Fc=E("ZodEmail",(e,t)=>{hm.init(e,t),he.init(e,t);});function s_(e){return rc(Fc,e)}var Dc=E("ZodGUID",(e,t)=>{pm.init(e,t),he.init(e,t);});function a_(e){return nc(Dc,e)}var qt=E("ZodUUID",(e,t)=>{dm.init(e,t),he.init(e,t);});function c_(e){return oc(qt,e)}function u_(e){return ic(qt,e)}function l_(e){return sc(qt,e)}function f_(e){return ac(qt,e)}var ts=E("ZodURL",(e,t)=>{_m.init(e,t),he.init(e,t);});function m_(e){return ji(ts,e)}function p_(e){return ji(ts,{protocol:Ri,hostname:kf,...F.normalizeParams(e)})}var Zc=E("ZodEmoji",(e,t)=>{bm.init(e,t),he.init(e,t);});function d_(e){return cc(Zc,e)}var Bc=E("ZodNanoID",(e,t)=>{xm.init(e,t),he.init(e,t);});function h_(e){return uc(Bc,e)}var Gc=E("ZodCUID",(e,t)=>{$m.init(e,t),he.init(e,t);});function g_(e){return lc(Gc,e)}var Uc=E("ZodCUID2",(e,t)=>{wm.init(e,t),he.init(e,t);});function y_(e){return fc(Uc,e)}var Qc=E("ZodULID",(e,t)=>{Sm.init(e,t),he.init(e,t);});function __(e){return mc(Qc,e)}var Vc=E("ZodXID",(e,t)=>{vm.init(e,t),he.init(e,t);});function b_(e){return pc(Vc,e)}var jc=E("ZodKSUID",(e,t)=>{Cm.init(e,t),he.init(e,t);});function x_(e){return dc(jc,e)}var qc=E("ZodIPv4",(e,t)=>{Rm.init(e,t),he.init(e,t);});function $_(e){return hc(qc,e)}var bh=E("ZodMAC",(e,t)=>{Im.init(e,t),he.init(e,t);});function w_(e){return Fp(bh,e)}var Wc=E("ZodIPv6",(e,t)=>{Mm.init(e,t),he.init(e,t);});function S_(e){return gc(Wc,e)}var Hc=E("ZodCIDRv4",(e,t)=>{Tm.init(e,t),he.init(e,t);});function v_(e){return yc(Hc,e)}var Xc=E("ZodCIDRv6",(e,t)=>{Lm.init(e,t),he.init(e,t);});function C_(e){return _c(Xc,e)}var Yc=E("ZodBase64",(e,t)=>{Nm.init(e,t),he.init(e,t);});function E_(e){return bc(Yc,e)}var Kc=E("ZodBase64URL",(e,t)=>{zm.init(e,t),he.init(e,t);});function A_(e){return xc(Kc,e)}var Jc=E("ZodE164",(e,t)=>{Om.init(e,t),he.init(e,t);});function P_(e){return $c(Jc,e)}var xh=E("ZodCreditCard",(e,t)=>{Fm.init(e,t),he.init(e,t);});function k_(e){return Dp(xh,e)}var $h=E("ZodIBAN",(e,t)=>{Dm.init(e,t),he.init(e,t);});function R_(e){return Zp($h,e)}var eu=E("ZodJWT",(e,t)=>{Zm.init(e,t),he.init(e,t);});function M_(e){return wc(eu,e)}var gn=E("ZodCustomStringFormat",(e,t)=>{Bm.init(e,t),he.init(e,t);});function I_(e,t,r={}){return mn(gn,e,t,r)}function T_(e){return mn(gn,"hostname",Pf,e)}function L_(e){return mn(gn,"hex",Uf,e)}function N_(e){return mn(gn,"currency_code",Mf,e)}function z_(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=Et[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return mn(gn,n,o,t)}var zo=E("ZodNumber",(e,t)=>{Da.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vd(e,r,n,o),e.isFinite=true;},F.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=De(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=De(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=De(e);return !!t||!!r?.some(Number.isSafeInteger)},format:e=>De(e).format??null},{gt(e,t){return this.check(Vt(e,t))},gte(e,t){return this.check(_t(e,t))},min(e,t){return this.check(_t(e,t))},lt(e,t){return this.check(Qt(e,t))},lte(e,t){return this.check(yt(e,t))},max(e,t){return this.check(yt(e,t))},int(e){return this.check(Nc(e))},safe(e){return this.check(Nc(e))},positive(e){return this.check(Vt(0,e))},nonnegative(e){return this.check(_t(0,e))},negative(e){return this.check(Qt(0,e))},nonpositive(e){return this.check(yt(0,e))},multipleOf(e,t){return this.check(Sr(e,t))},step(e,t){return this.check(Sr(e,t))},finite(){return this}}));function wh(e){return Gp(zo,e)}var yn=E("ZodNumberFormat",(e,t)=>{Gm.init(e,t),zo.init(e,t);});function Nc(e){return Qp(yn,e)}function O_(e){return Vp(yn,e)}function F_(e){return jp(yn,e)}function D_(e){return qp(yn,e)}function Z_(e){return Wp(yn,e)}var Oo=E("ZodBoolean",(e,t)=>{Di.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cd(e,r,n);});function Sh(e){return Hp(Oo,e)}var Fo=E("ZodBigInt",(e,t)=>{Za.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ed(e,r,n,o);},F.derived({minValue:e=>De(e).minimum??null,maxValue:e=>De(e).maximum??null,format:e=>De(e).format??null},{gte(e,t){return this.check(_t(e,t))},min(e,t){return this.check(_t(e,t))},gt(e,t){return this.check(Vt(e,t))},lt(e,t){return this.check(Qt(e,t))},lte(e,t){return this.check(yt(e,t))},max(e,t){return this.check(yt(e,t))},positive(e){return this.check(Vt(BigInt(0),e))},negative(e){return this.check(Qt(BigInt(0),e))},nonpositive(e){return this.check(yt(BigInt(0),e))},nonnegative(e){return this.check(_t(BigInt(0),e))},multipleOf(e,t){return this.check(Sr(e,t))}}));function B_(e){return Yp(Fo,e)}var tu=E("ZodBigIntFormat",(e,t)=>{Um.init(e,t),Fo.init(e,t);});function G_(e){return Jp(tu,e)}function U_(e){return ed(tu,e)}var vh=E("ZodSymbol",(e,t)=>{Qm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ad(e,r,n,o);});function Q_(e){return td(vh,e)}var Ch=E("ZodUndefined",(e,t)=>{Vm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kd(e,r,n,o);});function V_(e){return rd(Ch,e)}var Eh=E("ZodNull",(e,t)=>{jm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pd(e,r,n);});function Ah(e){return nd(Eh,e)}var Ph=E("ZodAny",(e,t)=>{qm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Id();});function j_(){return od(Ph)}var kh=E("ZodUnknown",(e,t)=>{Wm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Td();});function pn(){return id(kh)}var Rh=E("ZodNever",(e,t)=>{Hm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Md(e,r,n);});function ru(e){return sd(Rh,e)}var Mh=E("ZodVoid",(e,t)=>{Xm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rd(e,r,n,o);});function q_(e){return ad(Mh,e)}var rs=E("ZodDate",(e,t)=>{Ym.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ld(e,r,n,o),e.min=(r,n)=>e.check(_t(r,n)),e.max=(r,n)=>e.check(yt(r,n));},F.derived({minDate:e=>{let{minimum:t}=De(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=De(e);return t?new Date(t):null}},{}));function W_(e){return cd(rs,e)}var Ih=E("ZodArray",(e,t)=>{hn(),Jm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jd(e,r,n,o),e.element=t.element;},{min(e,t){return this.check(nr(e,t))},nonempty(e){return this.check(nr(1,e))},max(e,t){return this.check(ln(e,t))},length(e,t){return this.check(fn(e,t))},unwrap(){return this.element}});function ns(e,t){return fd(Ih,e,t)}function H_(e){let t=e._zod.def.shape;return nu(Object.keys(t))}var os=E("ZodObject",(e,t)=>{hn(),ep.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qd(e,r,n,o),F.installLazyProp(e,"shape",r=>r._zod.def.shape,false);},{keyof(){return nu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(F.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(F.mergeDefs(this._zod.def,{catchall:pn()}))},loose(){return this.clone(F.mergeDefs(this._zod.def,{catchall:pn()}))},strict(){return this.clone(F.mergeDefs(this._zod.def,{catchall:ru()}))},strip(){return this.clone(F.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return F.extend(this,e)},safeExtend(e){return F.safeExtend(this,e)},merge(e){return F.merge(this,e)},pick(e){return F.pick(this,e)},omit(e){return F.omit(this,e)},partial(...e){return F.partial(ss,this,e[0])},exactPartial(...e){return F.partial(iu,this,e[0],"exactPartial")},required(...e){return F.required(su,this,e[0])}});function X_(e,t){let r={type:"object",shape:e??{},...F.normalizeParams(t)};return new os(r)}function Y_(e,t){return new os({type:"object",shape:e,catchall:ru(),...F.normalizeParams(t)})}function K_(e,t){return new os({type:"object",shape:e,catchall:pn(),...F.normalizeParams(t)})}var is=E("ZodUnion",(e,t)=>{Zi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kc(e,r,n,o),e.options=t.options;});function Do(e,t){return new is({type:"union",options:e,...F.normalizeParams(t)})}var Th=E("ZodXor",(e,t)=>{is.init(e,t),tp.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kc(e,r,n,o),e.options=t.options;});function J_(e,t){return new Th({type:"union",options:e,inclusive:false,...F.normalizeParams(t)})}var Lh=E("ZodDiscriminatedUnion",(e,t)=>{is.init(e,t),np.init(e,t);});function eb(e,t,r){return new Lh({type:"union",options:t,discriminator:e,...F.normalizeParams(r)})}var Nh=E("ZodIntersection",(e,t)=>{op.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wd(e,r,n,o);});function zh(e,t){return new Nh({type:"intersection",left:e,right:t})}var Oh=E("ZodTuple",(e,t)=>{hn(),Ba.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hd(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 ss({type:"optional",innerType:t}))})}});function Fh(e,t,r){let n=t instanceof q,o=n?r:t,i=n?t:null;return new Oh({type:"tuple",items:e,rest:i,...F.normalizeParams(o)})}var To=E("ZodRecord",(e,t)=>{hn(),ip.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xd(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType;});function Dh(e,t,r){return !t||!t._zod?new To({type:"record",keyType:Ji(),valueType:e,...F.normalizeParams(t)}):new To({type:"record",keyType:e,valueType:t,...F.normalizeParams(r)})}function tb(e,t,r){return new To({type:"record",keyType:e,valueType:t,...F.normalizeParams(r),partial:true})}function rb(e,t,r){return new To({type:"record",keyType:e,valueType:t,mode:"loose",...F.normalizeParams(r)})}var Zh=E("ZodMap",(e,t)=>{hn(),sp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qd(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(vr(...r)),e.size=(...r)=>e.check(un(...r));});function nb(e,t,r){return new Zh({type:"map",keyType:e,valueType:t,...F.normalizeParams(r)})}var Bh=E("ZodSet",(e,t)=>{hn(),ap.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vd(e,r,n,o),e.min=(...r)=>e.check(jt(...r)),e.nonempty=r=>e.check(jt(1,r)),e.max=(...r)=>e.check(vr(...r)),e.size=(...r)=>e.check(un(...r));});function ob(e,t){return new Bh({type:"set",valueType:e,...F.normalizeParams(t)})}var Lo=E("ZodEnum",(e,t)=>{cp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Nd(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 Lo({...t,checks:[],...F.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 Lo({...t,checks:[],...F.normalizeParams(o),entries:i})};});function nu(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Lo({type:"enum",entries:r,...F.normalizeParams(t)})}function ib(e,t){return new Lo({type:"enum",entries:e,...F.normalizeParams(t)})}var Gh=E("ZodLiteral",(e,t)=>{up.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zd(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 sb(e,t){return new Gh({type:"literal",values:Array.isArray(e)?e:[e],...F.normalizeParams(t)})}var Uh=E("ZodFile",(e,t)=>{lp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dd(e,r,n),e.min=(r,n)=>e.check(jt(r,n)),e.max=(r,n)=>e.check(vr(r,n)),e.mime=(r,n)=>e.check(vo(Array.isArray(r)?r:[r],n));});function ab(e){return md(Uh,e)}var Qh=E("ZodTransform",(e,t)=>{hn(),fp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ud(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(F.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(F.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 ou(e){return new Qh({type:"transform",transform:e})}var ss=E("ZodOptional",(e,t)=>{Ga.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function dn(e){return new ss({type:"optional",innerType:e})}var iu=E("ZodExactOptional",(e,t)=>{mp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Vh(e){return new iu({type:"optional",innerType:e})}var jh=E("ZodNullable",(e,t)=>{pp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function es(e){return new jh({type:"nullable",innerType:e})}function cb(e){return dn(es(e))}var qh=E("ZodDefault",(e,t)=>{dp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>eh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function Wh(e,t){return new qh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():F.shallowClone(t)}})}var Hh=E("ZodPrefault",(e,t)=>{hp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>th(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Xh(e,t){return new Hh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():F.shallowClone(t)}})}var su=E("ZodNonOptional",(e,t)=>{gp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Yh(e,t){return new su({type:"nonoptional",innerType:e,...F.normalizeParams(t)})}var Kh=E("ZodSuccess",(e,t)=>{yp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zd(e,r,n),e.unwrap=()=>e._zod.def.innerType;});function ub(e){return new Kh({type:"success",innerType:e})}var Jh=E("ZodCatch",(e,t)=>{_p.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function e0(e,t){return new Jh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:F.constantCatch(t)})}var t0=E("ZodNaN",(e,t)=>{bp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Od(e,r,n,o);});function lb(e){return ld(t0,e)}var as=E("ZodPipe",(e,t)=>{Ua.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nh(e,r,n,o),e.in=t.in,e.out=t.out;});function zc(e,t){return new as({type:"pipe",in:e,out:t})}var cs=E("ZodCodec",(e,t)=>{as.init(e,t),Bi.init(e,t);});function fb(e,t,r){return new cs({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function mb(e){let t=e._zod.def;return new cs({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var r0=E("ZodPreprocess",(e,t)=>{as.init(e,t),xp.init(e,t);}),n0=E("ZodReadonly",(e,t)=>{$p.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function o0(e){return new n0({type:"readonly",innerType:e})}var i0=E("ZodTemplateLiteral",(e,t)=>{wp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fd(e,r,n);});function pb(e,t){return new i0({type:"template_literal",parts:e,...F.normalizeParams(t)})}var s0=E("ZodLazy",(e,t)=>{Gi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sh(e,r,n,o),e.unwrap=()=>e._zod.def.getter();});function a0(e){return new s0({type:"lazy",getter:e})}var c0=E("ZodPromise",(e,t)=>{vp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ih(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function db(e){return new c0({type:"promise",innerType:e})}var u0=E("ZodFunction",(e,t)=>{Sp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gd(e,r,n,o);});function hb(e){return new u0({type:"function",input:Array.isArray(e?.input)?Fh(e?.input):e?.input??ns(pn()),output:e?.output??pn()})}var us=E("ZodCustom",(e,t)=>{Cp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bd(e,r,n,o);});function gb(e){let t=new _e({check:"custom"});return t._zod.check=e,t}function yb(e,t){return pd(us,e??(()=>true),t)}function l0(e,t={}){return dd(us,e,t)}function f0(e,t){return hd(e,t)}var _b=gd,bb=yd,m0=E("ZodInstanceOf",(e,t)=>{us.init(e,t);},{properties(e,t){return this.check(So(e,t))}});function xb(e,t={}){let r=new m0({type:"custom",check:"custom",fn:n=>n instanceof e,abort:true,...F.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 $b=(...e)=>_d({Codec:cs,Boolean:Oo,String:No},...e);function wb(e){let t=a0(()=>Do([Ji(e),wh(),Sh(),Ah(),ns(t),Dh(Ji(),t)]));return t}function Sb(e,t){return new r0({type:"pipe",in:ou(e),out:t})}var KS={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 JS(e){Pe({customError:e});}function e6(){return Pe().customError}var p0;p0||(p0={});var ls={};hr(ls,{ZodISODate:()=>kr,ZodISODateTime:()=>Pr,ZodISODuration:()=>Mr,ZodISOTime:()=>Rr,date:()=>r6,datetime:()=>t6,duration:()=>o6,time:()=>n6});function t6(e){return qi(Pr,e)}function r6(e){return Wi(kr,e)}function n6(e){return Hi(Rr,e)}function o6(e){return Xi(Mr,e)}var O={...Zo,...Tc,iso:ls},i6=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 s6(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 vb(e,t){return e.map((r,n)=>n<t?r:r.optional())}function a6(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c6(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:a6(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 u6(e,t){return O.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 d0(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=d0(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=d0(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 l6=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),f6=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])=>l6.has(t)?fs(r):!f6.has(t)||typeof r!="object"||r===null?false:Object.values(r).some(fs))}function Cb(e){return e===1?"element":"elements"}function m6(e,t){return O.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=d0(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 ${Cb(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 ${Cb(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function Eb(e,t){if(e!==false)return e===void 0||e===true?O.any():nt(e,t)}var p6=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function Ab(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.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 O.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=c6(o,t),s=nt(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 O.null();if(o.length===0)return O.never();if(o.length===1)return O.literal(o[0]);if(o.every(s=>typeof s=="string"))return O.enum(o);let i=o.map(s=>O.literal(s));return i.length<2?i[0]:O.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return Ab(s,t)});return o.length===0?O.never():o.length===1?o[0]:O.union(o)}if(!r)return O.any();let n;switch(r){case "string":{let o=O.string();if(e.format){let i=e.format;i==="email"?o=o.check(O.email()):i==="uri"||i==="uri-reference"?o=o.check(O.url()):i==="uuid"||i==="guid"?o=o.check(O.uuid()):i==="date-time"?o=o.check(O.iso.datetime({offset:true})):i==="date"?o=o.check(O.iso.date()):i==="time"?o=o.check(O.regex(p6)):i==="duration"?o=o.check(O.iso.duration()):i==="hostname"?o=o.check(O.hostname()):i==="ipv4"?o=o.check(O.ipv4()):i==="ipv6"?o=o.check(O.ipv6()):i==="mac"?o=o.check(O.mac()):i==="cidr"?o=o.check(O.cidrv4()):i==="cidr-v6"?o=o.check(O.cidrv6()):i==="base64"?o=o.check(O.base64()):i==="base64url"?o=o.check(O.base64url()):i==="e164"?o=o.check(O.e164()):i==="credit_card"?o=o.check(O.creditCard()):i==="iban"?o=o.check(O.iban()):i==="jwt"?o=o.check(O.jwt()):i==="emoji"?o=o.check(O.emoji()):i==="nanoid"?o=o.check(O.nanoid()):i==="cuid"?o=o.check(O.cuid()):i==="cuid2"?o=o.check(O.cuid2()):i==="ulid"?o=o.check(O.ulid()):i==="xid"?o=o.check(O.xid()):i==="ksuid"&&(o=o.check(O.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"?O.number().int():O.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=O.boolean();break}case "null":{n=O.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?nt(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=nt(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=nt(f[d],t),y=O.string().regex(new RegExp(d));m.push(O.looseRecord(y,g));}let h=[];if(Object.keys(o).length>0&&h.push(O.object(o).passthrough()),h.push(...m),h.length===0)n=O.object({}).passthrough();else if(h.length===1)n=h[0];else {let d=O.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=O.intersection(d,h[g]);n=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(_=>new RegExp(_)),y=n;n=n.check(_=>{if(!vt(_.value))return;let b=[];for(let S of Object.keys(_.value))d.includes(S)||g.some(v=>v.test(S))||b.push(S);b.length&&_.issues.push({code:"unrecognized_keys",keys:b,input:_.value,inst:y});});}}else {let f=O.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=nt(p,t);}n=u6(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=>nt(f,t)),c=vb(a,s),u=Array.isArray(i)?void 0:Eb(i,t),l=O.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(O.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>nt(f,t)),c=vb(a,s),u=Eb(e.additionalItems,t),l=O.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(O.maxLength(e.maxItems)));}else if(i!==void 0){let s=nt(i,t),a=O.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a;}else n=O.array(O.any());(e.uniqueItems===true||e.contains!==void 0)&&(n=m6(n,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?nt(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 nt(e,t){if(typeof e=="boolean")return e?O.any():O.never();let r=Ab(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=>nt(u,t)),c=O.union(a);r=n?O.intersection(r,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>nt(u,t)),c=O.xor(a);r=n?O.intersection(r,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:O.any();else {let a=n?r:nt(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=O.intersection(a,nt(e.allOf[u],t));r=a;}e.nullable===true&&t.version==="openapi-3.0"&&(r=O.nullable(r)),e.readOnly===true&&(r=O.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))i6.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 Pb(e,t){if(typeof e=="boolean")return e?O.any():O.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=s6(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??We};return nt(r,i)}var kb=Symbol("z.visit/resolving");function ms(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===kb)return new Gi({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,kb);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?le(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:le(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?le(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:le(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:le(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?le(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:le(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:le(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:le(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:le(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return le(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 Rb(e){return ms(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Do(r.options)}})}function d6(e,t){if(!t?.length)return e;let r=e._zod.def;return le(e,Mt(r,{checks:[...r.checks??[],...t]}),{parent:true})}function Mb(e){return d6(e.out,e.checks)}function h6(e){return e.in._zod.traits.has("$ZodTransform")?Mb(e):e.in}function Ib(e){return ms(e,{pipe:t=>h6(t._zod.def),default:(t,r)=>r?dn(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function Tb(e){return ms(e,{pipe:t=>Mb(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var h0={};hr(h0,{bigint:()=>b6,boolean:()=>_6,date:()=>x6,number:()=>y6,string:()=>g6});function g6(e){return Op(No,e)}function y6(e){return Up(zo,e)}function _6(e){return Xp(Oo,e)}function b6(e){return Kp(Fo,e)}function x6(e){return ud(rs,e)}var g0=P.enum(jn),y0=P.enum([...qn.logo,...qn.halftone]),Lb=e=>Math.ceil(e/3)*4,_0=P.object({width:P.number().int().min(1).max(Zt),height:P.number().int().min(1).max(Zt),data:P.string().max(Lb(Zt*Zt*4))}).refine(e=>e.data.length===Lb(e.width*e.height*4),{message:"Art image data does not match its width and height"}),au=P.object({mode:g0,image:_0,intensity:P.number().min(0).max(1).optional(),variant:y0.optional(),matchEyes:P.boolean().optional()});var Nb=P.enum(["solid","linear","radial","angular","image"]),b0=P.object({type:P.literal("solid"),color:P.string()}),ps=P.object({color:P.string(),offset:P.number().min(0).max(100)}),x0=P.object({type:P.literal("linear"),stops:P.array(ps).min(2),angle:P.number().optional().default(0)}),$0=P.object({type:P.literal("radial"),stops:P.array(ps).min(2)}),w0=P.object({type:P.literal("angular"),stops:P.array(ps).min(2),angle:P.number().optional().default(0)}),S0=P.enum(["cover","contain","tile"]),v0=P.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),C0=P.object({type:P.literal("image"),src:P.string().min(1),fit:S0.optional().default("cover"),scale:P.number().min(.1).max(4).optional().default(1),position:v0.optional().default("center"),opacity:P.number().min(0).max(1).optional().default(1),underlay:P.string().optional()}),ir=P.union([P.string(),b0,x0,$0,w0,C0]);var zb=P.object({x:P.number(),y:P.number(),w:P.number(),h:P.number()});var cu=P.enum([...Hs,...xl]),Ob=P.enum(Hs);var uu=P.enum([...Xs,...$l]),Fb=P.enum(Xs);var E0=P.enum(Sl),ds=P.object({style:E0,text:P.string().max(ut).optional(),color:P.string().optional(),textColor:P.string().optional(),secondaryText:P.string().max(ut).optional(),secondaryColor:P.string().optional(),fontScale:P.number().min(Wr).max(gr).optional()});var ke=P.number().min(-ee.maxCoordinate).max(ee.maxCoordinate).refine(_r,{message:`Numbers may have at most ${ee.maxDecimals} decimals`}),Xe=ke.refine(e=>e>0,{message:"Must be greater than 0"}),lu=ke.refine(e=>e>=0,{message:"Must not be negative"}),hs=P.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color"),Db=P.union([P.enum(hi),hs]),Bb=e=>P.object({mix:P.tuple([e,e]),amount:P.number().min(0).max(1).refine(_r)}).strict(),Ir=P.union([Db,Bb(Db)]),$6=P.union([hs,Bb(P.union([P.enum(["frame","accent","background"]),hs]))]),sr=P.union([Ir,P.object({gradient:P.object({from:Ir,to:Ir,direction:P.enum(["horizontal","vertical"]).optional(),steps:P.int().min(2).max(ee.maxGradientSteps).optional()}).strict()}).strict()]),A0={x:ke,y:ke,width:Xe,height:Xe},gs=P.object({color:Ir,width:Xe}).strict(),w6=P.object({type:P.literal("rect"),...A0,radius:lu.optional(),fill:sr,hole:P.object({...A0,radius:lu.optional()}).strict().optional(),stroke:gs.optional()}).strict(),S6=P.object({type:P.literal("circle"),cx:ke,cy:ke,r:Xe,hole:Xe.optional(),fill:sr,stroke:gs.optional()}).strict(),v6=P.object({type:P.literal("ellipse"),cx:ke,cy:ke,rx:Xe,ry:Xe,fill:sr,stroke:gs.optional()}).strict(),C6=P.object({type:P.literal("polygon"),points:P.array(P.tuple([ke,ke])).min(3).max(ee.maxPolygonPoints),fill:sr,stroke:gs.optional()}).strict(),E6=P.object({type:P.literal("path"),d:P.string().min(2).max(ee.maxPathLength),fill:sr,fillRule:P.enum(["nonzero","evenodd"]).optional(),stroke:gs.optional()}).strict(),A6=P.object({type:P.literal("line"),x1:ke,y1:ke,x2:ke,y2:ke,width:Xe,cap:P.enum(["butt","round"]).optional(),dash:P.tuple([Xe,Xe]).optional(),fill:sr}).strict(),P6=P.object({type:P.literal("icon"),icon:P.enum(pi),x:ke,y:ke,size:Xe,fill:sr}).strict(),P0=P.discriminatedUnion("type",[w6,S6,v6,C6,E6,A6,P6]),Gb={id:P.string().regex(/^[a-z][a-z0-9-]{0,31}$/),slot:P.enum(["primary","secondary","fixed"]),text:P.string().max(200),maxLength:P.int().min(1).max(ut).optional(),color:Ir,weight:P.enum(["bold","regular"]).optional(),collapse:P.object({y:ke,height:Xe}).strict().optional()},k6=P.object({type:P.literal("text"),...Gb,box:P.object(A0).strict(),align:P.enum(["start","middle","end"]).optional(),fontSize:Xe.optional()}).strict(),R6=P.object({type:P.literal("curved"),...Gb,curve:P.object({cx:ke,cy:ke,radius:Xe,side:P.enum(["top","bottom"]),spread:P.number().min(20).max(300).refine(_r).optional()}).strict(),fontSize:Xe}).strict(),k0=P.discriminatedUnion("type",[k6,R6]),Zb=ke.refine(e=>e>=ee.minArtboard&&e<=ee.maxArtboard,{message:`Artboard sides must be ${ee.minArtboard} to ${ee.maxArtboard} units`}),M6=P.object({kind:P.literal(Xr),version:P.literal(Yr),artboard:P.object({width:Zb,height:Zb}).strict(),qr:P.object({x:ke,y:ke,size:Xe,padding:lu.optional(),radius:lu.optional(),plate:P.enum(["opaque","background","none"]).optional()}).strict(),colors:P.object({frame:hs,text:$6.optional(),accent:hs.optional()}).strict(),shapes:P.array(P0).max(ee.maxShapes),labels:P.array(k0).max(ee.maxLabels),bleed:P.union([P.literal("none"),Ir]).optional()}).strict(),fu=M6.superRefine((e,t)=>ta(e,(r,n=[])=>t.addIssue({code:"custom",message:r,path:n})));function Ub(e){let t=fu.safeParse(e);return t.success?[]:t.error.issues.map(r=>r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message)}var R0=ds.extend({style:P.literal(Kr),spec:fu}),mu=P.discriminatedUnion("style",[ds,R0]);var pu=P.enum(wl);var du=P.enum(Cl),M0=P.object({src:P.string(),height:P.number(),width:P.number(),excavate:P.boolean(),x:P.number().optional(),y:P.number().optional(),padding:P.number().min(0).optional(),shape:du.optional(),plate:P.string().optional()}),Qb=P.object({size:P.number().min(El).max(li).optional(),padding:P.number().min(0).max(Pl).optional(),x:P.number().min(0).max(1).optional(),y:P.number().min(0).max(1).optional(),shape:du.optional(),plate:P.string().optional()}),I0=P.enum(["L","M","Q","H"]),T0=P.enum(Rl),L0=P.object({type:P.literal("silhouette"),width:P.number().int().min(Rt).max(wt),height:P.number().int().min(Rt).max(wt),cells:P.string().max(wt*wt).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"}),N0=P.union([T0,L0]),ys=P.object({outer:ir.optional(),inner:ir.optional()}),z0=P.object({topLeft:ys.optional(),topRight:ys.optional(),bottomLeft:ys.optional()}),Vb=P.object({value:P.string(),size:P.number().optional(),level:I0.optional(),bgColor:ir.optional(),fgColor:ir.optional(),eyeColor:ir.optional(),dotColor:ir.optional(),bodyPattern:pu.optional(),cornerEyePattern:uu.optional(),cornerEyeDotPattern:cu.optional(),margin:P.number().optional(),imageSettings:M0.optional(),isOGContext:P.boolean().optional(),templateId:P.string().optional(),customProps:P.record(P.string(),P.any()).optional(),frame:mu.optional(),art:au.optional(),eyeColors:z0.optional(),moduleScale:P.number().min(Wn).max(fi).optional(),autoLevel:P.boolean().optional(),shape:N0.optional()});var jb=P.object({fgColor:P.string().optional(),bgColor:P.string().optional()}),qb=P.object({pixelSize:P.number(),url:P.string()}),Wb=P.object({id:P.string(),name:P.string(),description:P.string().optional()});var ot=e=>e/255,_s=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,ae=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function O0(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:[ot(n[a]),ot(n[a+1]),ot(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})=>_s(s,i)<.006)?i:null}function I6(e){let{width:t,height:r,data:n}=e,o=O0(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(_s([ot(n[a]),ot(n[a+1]),ot(n[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var T6=8,L6=.14,Hb=.006;function N6(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]+=ot(o[h]),s[d*3+1]+=ot(o[h+1]),s[d*3+2]+=ot(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<Hb/2||u.length>=T6)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>_s(d,h)>=L6**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=[ot(o[d]),ot(o[d+1]),ot(o[d+2])],y=0,_=Number.POSITIVE_INFINITY;for(let[S,v]of u.entries()){let x=_s(g,v);x<_&&(_=x,y=S);}let b=l[y];b.n++,b.r+=g[0],b.g+=g[1],b.b+=g[2],b.x+=h%r,b.y+=Math.floor(h/r),f+=Math.sqrt(_);}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>=Hb).sort((m,h)=>h.area-m.area),error:f/a}}function z6(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),y=f%2===1,_=y?i(h,d+1):i(h+1,d),b=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),S=y?[h-.5,d-.5+b]:[h-.5+b,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,y=2*(f*n+p),_=2*((f+1)*n+p),b=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);break;case 2:u(S,_);break;case 3:u(S,b);break;case 4:u(y,S);break;case 5:{(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,S),u(_,b));break}case 6:u(y,_);break;case 7:u(y,b);break;case 8:u(b,y);break;case 9:u(_,y);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(b,_),u(S,y)):(u(b,y),u(S,_));break}case 11:u(S,y);break;case 12:u(b,S);break;case 13:u(_,S);break;case 14:u(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 O6(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 Xb(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 F6(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=Xb(e.slice(0,r+1),t),i=Xb([...e.slice(r),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var Tr=e=>se(e,2);function D6(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${Tr(a[0])} ${Tr(a[1])}`:`L${Tr(a[0])} ${Tr(a[1])}`,o+=`Q${Tr(s[0])} ${Tr(s[1])} ${Tr(c[0])} ${Tr(c[1])}`;}return `${o}Z`}function Z6(e,t,r){let n="";for(let o of z6(e,t,r)){if(Math.abs(O6(o))<.8)continue;let i=F6(o,.18);i.length>=3&&(n+=D6(i,.9));}return n}var B6=.075;function Yb(e){let{width:t,height:r,data:n}=e,o=I6(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=N6(e,o),c={width:t,height:r,palette:s,alpha:o,coverage:i/(t*r)};if(s.length===0||a>B6)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 y=d*4,_=[ot(n[y]),ot(n[y+1]),ot(n[y+2])],b=0,S=-1,v=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(let M=0;M<u;M++){let T=_s(_,f[M]);T<v?(S=b,x=v,b=M,v=T):T<x&&(S=M,x=T);}if(S<0||v<1e-6){l[b][d]=g;continue}let w=f[b],C=f[S],A=[C[0]-w[0],C[1]-w[1],C[2]-w[2]],k=Math.min(1,Math.max(0,((_[0]-w[0])*A[0]+(_[1]-w[1])*A[1]+(_[2]-w[2])*A[2])/(A[0]**2+A[1]**2+A[2]**2)));l[b][d]=g*(1-k),l[S][d]=g*k;}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 y=0;y<m.length;y++)m[y]+=g[y];h[d]=m.slice();}for(let d=0;d<u;d++){let g=Z6(h[d],t,r);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:F0}=Le,G6={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function U6(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 Q6(e,t){let r=e*4+17,n=Ke[t].ordinal,o=F0.NUM_ERROR_CORRECTION_BLOCKS[n]?.[e]??0,i=F0.ECC_CODEWORDS_PER_BLOCK[n]?.[e]??0,s=Math.floor(F0.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(S,v)=>c+(v<a?0:1)),l=[],f=[],p=c-i;for(let S=0;S<=c;S++)for(let v=0;v<o;v++)if(v<a){if(S===p)continue;l.push(v),f.push(S<p?S:S-1);}else l.push(v),f.push(S);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=U6(e),h=new Int16Array(r*r).fill(-1),d=new Int16Array(r*r).fill(-1),g=new Int8Array(r*r).fill(-1),y=s*8,_=0;for(let S=r-1;S>=1;S-=2){S===6&&(S=5);let v=(S+1&2)===0;for(let x=0;x<r;x++)for(let w=0;w<2;w++){let C=S-w,k=(v?r-1-x:x)*r+C;if(!m[k]&&_<y){let M=_>>>3;h[k]=l[M],d[k]=f[M],g[k]=7-(_&7),_++;}}}if(_!==y)throw new Error(`Codeword map: placement mismatch at version ${e}`);let b=G6[`${e}${t}`]??0;return {version:e,level:t,size:r,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-b)/2),block:h,codeword:d,bit:g}}var V6=8,_n=new Map;function bs(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=_n.get(r);if(n)return _n.delete(r),_n.set(r,n),n;let o=Q6(e,t);if(_n.size>=V6){let i=_n.keys().next().value;i!==void 0&&_n.delete(i);}return _n.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 j6={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function Kb(e,t){let r=e.trim(),n=Number.parseFloat(r);return Number.isNaN(n)?Number.NaN:r.endsWith("%")?n/100*t:n}function Ae(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let r=j6[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=>Kb(m,255)),f=a===void 0?1:Kb(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 Lr(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]:[se((1-n-s)/(1-s)),se((1-o-s)/(1-s)),se((1-i-s)/(1-s)),se(s)]}function Wt(e){return e.children}var q6=e=>e==null?null:`${e}`;function D0(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:q6(o)}}function W6(e,t){let r=e;return {type:r.type,props:{...r.props,...t},key:r.key??null}}function H6(e,t,...r){let n={...t};return r.length>0&&(n.children=r.length===1?r[0]:r),D0(e,n)}var X6={jsx:D0,jsxs:D0,createElement:H6,cloneElement:W6,Fragment:Wt},$s=X6;var Z0=e=>e===Wt?$s.Fragment:e;function I(e,t,r){return $s.jsx(Z0(e),t,r)}function Qe(e,t,r){return $s.jsxs(Z0(e),t,r)}function hu(e,t,...r){return $s.createElement(Z0(e),t??null,...r)}function Bo(e,t){return $s.cloneElement(e,t)}var Y6=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),Jb=Symbol.for("react.fragment");function bn(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!Y6.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===Jb)&&typeof t.props=="object"&&t.props!==null}var Go=e=>e===Wt||e===Jb;var i2=.6,U0={logo:160,halftone:160};function K6(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}var Uo=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}},J6=new Uo(8);function e7(e){return J6.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 Q0(e){let{width:t,height:r,data:n}=e;if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>Zt||r>Zt||typeof n!="string")return null;try{let o=e7(n);return o.length===t*r*4?{width:t,height:r,data:o}:null}catch{return null}}function s2(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??U0.halftone),1),Zt),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),y=Math.max(g+1,Math.floor((d+1)*u/m));for(let _=0;_<p;_++){let b=Math.floor(_*c/p),S=Math.max(b+1,Math.floor((_+1)*c/p)),v=0,x=0,w=0,C=0,A=0;for(let M=g;M<y;M++)for(let T=b;T<S;T++){let L=((M+a)*r+T+s)*4,D=o[L+3]/255;v+=o[L]*D,x+=o[L+1]*D,w+=o[L+2]*D,C+=D,A++;}let k=(d*p+_)*4;h[k]=C>0?Math.round(v/C):0,h[k+1]=C>0?Math.round(x/C):0,h[k+2]=C>0?Math.round(w/C):0,h[k+3]=Math.round(C/A*255);}}return {width:p,height:m,data:K6(h)}}async function t7(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 r7(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??U0[r],o=await t7(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 s2(m,{maxSize:n,square:a})}function V0(e){return !!(e&&jn.includes(e.mode)&&e.image&&Q0(e.image))}function _u(e){let t=qn[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function n7(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 ws(e,t){let r=n7(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 o7=0,At=1,Lt=2,Nr=3,e2=4,t2=new Map;function a2(e){let t=t2.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,e2),o(0,6,r,1,e2),o(0,8,9,1,Nr),o(8,0,1,9,Nr),o(r-8,8,8,1,Nr),o(8,r-8,1,8,Nr),e>=7&&(o(r-11,0,3,6,Nr),o(0,r-11,6,3,Nr));for(let[i,s]of ws(e,r))o(i-2,s-2,5,5,Lt);return o(0,0,8,8,At),o(r-8,0,8,8,At),o(0,r-8,8,8,At),t2.set(e,n),n}function i7(e){let t=e*4+17,r=a2(e);return Array.from({length:t},(n,o)=>Array.from({length:t},(i,s)=>r[o*t+s]!==o7))}function s7(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 Qo(e,t){let r=Ae(e);return !r||r.a===0?t:[r.r/255,r.g/255,r.b/255]}var $n=(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 zr(e,t,r,n){let o=ae(e);if(n?o<=r:o>=r)return e;let i=ae(t);return Math.abs(o-i)<1e-6?t:$n(e,t,Math.min(1,Math.max(0,(o-r)/(o-i))))}var c2=e=>Math.max(...e)-Math.min(...e),a7=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,B0=e=>e.toString(16).padStart(2,"0");function it(e,t=1){let r=n=>Math.min(255,Math.round(Math.round(Math.min(Math.max(n,0),1)*255)/t)*t);return `#${B0(r(e[0]))}${B0(r(e[1]))}${B0(r(e[2]))}`}function c7(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 j0=.3,r2=e=>1-Math.exp(-((e/2)**2)/(2*j0**2)),u7=e=>c7(e/(2*j0*Math.SQRT2))**2,l7=(e,t,r)=>{let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)};function q0(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 u2(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 f7(e){let t=u2(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=ae([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=ae(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 l2(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,y=0,_=0,b=0,S=0,v=(w,C,A)=>{let k=C*i+w,M=c[k]*A;y+=a[k*3]*M,_+=a[k*3+1]*M,b+=a[k*3+2]*M,S+=M;};if(v(f,p,(1-d)*(1-g)),v(m,p,d*(1-g)),v(f,h,(1-d)*g),v(m,h,d*g),S<=0)return n;let x=S*o;return [n[0]+(y/S-n[0])*x,n[1]+(_/S-n[1])*x,n[2]+(b/S-n[2])*x]}var m7=new Uo(4),p7=new Uo(6),d7=new Uo(6);function W0(e,t){return p7.get(e.image.data,()=>Yb(t))}function f2(e,t,r){return d7.get(e.image.data,()=>u2(t,r.alpha))}var Ze=e=>se(e,2),m2=e=>se(e,4),wn=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,h7(r,n,o));}toElements(t){return [...this.groups].map(([r,n],o)=>I("path",{d:n.join(""),fill:r},`${t}-${o}`))}};function h7(e,t,r){let n=Ze(r*2),o=Ze(r);return `M${Ze(e-r)} ${Ze(t)}a${o} ${o} 0 1 0 ${n} 0a${o} ${o} 0 1 0 ${-n} 0z`}function xn(e,t,r,n,o){let i=Math.min(o,r/2,n/2);if(i<=0)return `M${Ze(e)} ${Ze(t)}h${Ze(r)}v${Ze(n)}h${Ze(-r)}z`;let s=Ze(i);return `M${Ze(e+i)} ${Ze(t)}h${Ze(r-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${Ze(n-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${Ze(-(r-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${Ze(-(n-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function p2(e,t,r){let n="";for(let[o,i]of e){let s=(o-2+t)*r,a=(i-2+t)*r;n+=xn(s,a,5*r,5*r,r*.35),n+=xn(s+r,a+r,3*r,3*r,r*.15),n+=xn(s+2*r,a+2*r,r,r,r*.12);}return n}var g7={blend:1,badge:1,color:.9,mono:.7},yu=.35;function y7(e,t){let r=Qo(e,[0,0,0]),n=Qo(t,[1,1,1]),o=ae(n)-ae(r);return o>=yu?null:o<=-yu?"inverted":"low-contrast"}function d2(e,t,r){let n=Math.min(Math.max(e.intensity??i2,0),g7[_u(e)]);return ae(r)-ae(t)>=yu?n:0}function _7(e){let{art:t,modules:r,version:n}=e,o=t.image&&Q0(t.image);if(!(o&&jn.includes(t.mode)))return null;let i=r.length;if(i!==n*4+17)return null;let s=Qo(e.fgColor,[0,0,0]),a=Qo(e.bgColor,[1,1,1]),c=d2(t,s,a);return c<=0?null:{art:t,image:o,modules:r,size:i,version:n,kinds:a2(n),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:_u(t),body:e.body}}function H0(e){let t=_7(e);if(!t)return null;let r;return t.art.mode==="halftone"?r=t.variant==="mono"?v7(t):S7(t):r=t.variant==="badge"?T7(t):C7(t),I("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:r})}function b7(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var h2=8.5,n2=new Map;function X0(e){let t=e*4+17,r=n2.get(e);if(!r){let i=t*2,s=new Uint8Array(i*i),a=h2*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 ws(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);n2.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 g2(e,t,r=false){let{image:n,size:o,kinds:i,fg:s,bg:a}=e,c=m7.get(e.art.image.data,()=>f7(n)),u=q0(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=ae(a)-.1*(ae(a)-ae(s)),d=X0(e.version);for(let g=0;g<o;g++)for(let y=0;y<o;y++){let _=i[g*o+y],b=_===At||_===Lt;if(!(b&&!r))for(let S=0;S<t;S++)for(let v=0;v<t;v++){let x=0,w=0,C=0;for(let B=0;B<m;B++)for(let z=0;z<m;z++){let j=y+(v+(z+.5)/m)/t,te=g+(S+(B+.5)/m)/t,U=l2(c,(j-u.offsetX)/u.scale,(te-u.offsetY)/u.scale,a);x+=U[0],w+=U[1],C+=U[2];}let A=m*m,k=[x/A,w/A,C/A],M=y+(v+.5)/t,T=g+(S+.5)/t,L=Math.min(M,T,o-M,o-T);L<1.5&&(k=$n(k,a,.35*(1-L/1.5))),r&&(b||d(M,T))&&(k=zr(k,a,h,false));let D=((g*t+S)*l+y*t+v)*3;f[D]=k[0],f[D+1]=k[1],f[D+2]=k[2];}}return {n:t,count:l,rgb:f}}function x7(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=ae(s),m=ae(a),h=m-p,d=b7(c,u),g=C=>.2126*f[C]+.7152*f[C+1]+.0722*f[C+2],y=new Float32Array(n*n),_=new Float32Array(n*n);for(let C=0;C<n;C++)for(let A=0;A<n;A++){let k=o[C*n+A];if(k===At){y[C*n+A]=m;continue}if(k===Lt){y[C*n+A]=i[C]?.[A]?p:m;continue}let M=0,T=0,L=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let z=g(((C*u+D)*l+A*u+B)*3);M+=z,r.under[D*u+B]||(T+=z,L++);}y[C*n+A]=M/(u*u),_[C*n+A]=L?T/L:M/(u*u);}let b=n+1,S=new Float64Array(b*b);for(let C=0;C<n;C++)for(let A=0;A<n;A++)S[(C+1)*b+A+1]=y[C*n+A]+S[C*b+A+1]+S[(C+1)*b+A]-S[C*b+A];let v=2,x=(C,A)=>{let k=Math.max(0,C-v),M=Math.max(0,A-v),T=Math.min(n,C+v+1),L=Math.min(n,A+v+1);return (S[L*b+T]-S[M*b+T]-S[L*b+k]+S[M*b+k])/((T-k)*(L-M))},w=r.weight;for(let C=0;C<n;C++)for(let A=0;A<n;A++){let k=o[C*n+A];if(k===At||k===Lt)continue;let M=k===Nr,T=(d.margin+(M?.08:0))*h,L=(d.darkCap-(M?.12:0))*h,D=(w*((r.light-r.dark)/2)-T)/(1-w),B=x(A,C),z=_[C*n+A],j=!!i[C]?.[A],te=0,U=a;if(j){let Y=Math.min(B+D,p+L);z>Y&&(te=(z-Y)/Math.max(z-p,1e-6),U=s);}else {let Y=Math.max(B-D,m-L);z<Y&&(te=(Y-z)/Math.max(m-z,1e-6));}if(!(te<=0)){te=Math.min(1,te);for(let Y=0;Y<u;Y++)for(let de=0;de<u;de++){let Te=((C*u+Y)*l+A*u+de)*3;for(let $e=0;$e<3;$e++)f[Te+$e]+=(U[$e]-f[Te+$e])*te;}}}}function y2(e,t,r,n){let{count:o}=t,i=new wn;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=Ze(e.margin*e.pixelSize);return I("g",{transform:`translate(${a} ${a}) scale(${m2(s)})`,children:i.toElements(n)},n)}function Y0(e,t){let r=ws(e.version,e.size);return r.length===0?[]:[I("path",{d:p2(r,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function _2(e){let{image:t,size:r}=e;return Math.floor(Math.min(t.width,t.height)/r)>=4&&r<=45?4:3}var $7=e=>2*j0*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function w7(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 b2(e,t,r,n){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=ae(a),l=ae(c),f=l-u,p=w7(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 y=d*o+g,_=i[y];if(_===At||_===Lt)continue;let b=_===Nr,S=n.base+(b?.08:0),v=(n.margin+(b?.03:0))*f,x=(n.cap-(b?.04:0))*f,w=r2(S),C=r2(b?Math.max(n.max,.94):n.max),A=w*((n.dark+n.light)/2)+(1-w)*p[y],k=r[y],M=!!s[d]?.[g],T=M?n.dark:n.light,L=M?Math.min(A-v,u+x):Math.max(A+v,l-x),B=(M?k<=L:k>=L)?0:(k-L)/(k-T);B>C&&(B=C,h[y]=Math.min(l,Math.max(u,(L-C*T)/(1-C))));let z=M?k<=L-.06:k>=L+.06;n.skip&&z&&!b||(B=Math.max(B,w)),m[y]=B>0?$7(B):0;}return {diameter:m,surround:h}}function S7(e){let{size:t,kinds:r,modules:n,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=_2(e),l=g2(e,u,true),f=ae(o),p=ae(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,y=(x,w,C,A)=>((w*u+A)*d+x*u+C)*3,_=new Float32Array(t*t);for(let x=0;x<t;x++)for(let w=0;w<t;w++){let C=r[x*t+w];if(C===At||C===Lt){_[x*t+w]=C===Lt&&n[x]?.[w]?f:p;continue}let A=0;for(let k=0;k<u;k++)for(let M=0;M<u;M++){let T=y(w,x,M,k);A+=.2126*g[T]+.7152*g[T+1]+.0722*g[T+2];}_[x*t+w]=A/(u*u);}let b=b2(e,_,_,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let x=0;x<t;x++)for(let w=0;w<t;w++){let C=b.surround[x*t+w];if(Number.isNaN(C))continue;let A=_[x*t+w],M=C<A?o:i,T=Math.min(1,Math.abs(A-C)/Math.max(Math.abs(A-ae(M)),1e-6));for(let L=0;L<u;L++)for(let D=0;D<u;D++){let B=y(w,x,D,L);for(let z=0;z<3;z++)g[B+z]+=(M[z]-g[B+z])*T;}}let S=[y2(e,l,x=>{let w=x*3;return Number.isNaN(g[w])?null:it([g[w],g[w+1],g[w+2]],8)},"art-photo")],v=new wn;for(let x=0;x<t;x++)for(let w=0;w<t;w++){let C=b.diameter[x*t+w];if(!(C>0))continue;let A=0,k=0,M=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let z=y(w,x,B,D);A+=g[z],k+=g[z+1],M+=g[z+2];}let T=[A/(u*u),k/(u*u),M/(u*u)],L=n[x]?.[w]?zr(T,o,m,true):zr(T,i,h,false);v.circle(it(L,10),(w+a+.5)*c,(x+a+.5)*c,C/2*c);}return S.push(...v.toElements("art-dot"),...Y0(e,it(o))),S}function v7(e){let{size:t,kinds:r,modules:n,fg:o,bg:i}=e,s=_2(e),a=g2(e,s),c=ae(o),u=ae(i),l=s%2===1?1:2,f=(s-l)/2,p=A=>A>=f&&A<f+l,m=[];for(let A=0;A<s;A++)for(let k=0;k<s;k++)m.push(p(k)&&p(A));x7(e,a,{weight:u7(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),y=new Int8Array(h*h).fill(-1);for(let A=0;A<h*h;A++){let k=A*3;if(Number.isNaN(d[k])){g[A]=Number.NaN;continue}let M=(.2126*d[k]+.7152*d[k+1]+.0722*d[k+2]-c)/(u-c);g[A]=.5+(l7(0,1,M)-.5)*1.15;}for(let A=0;A<t;A++)for(let k=0;k<t;k++){let M=r[A*t+k];if(!(M===At||M===Lt))for(let T=f;T<f+l;T++)for(let L=f;L<f+l;L++)y[(A*s+T)*h+k*s+L]=n[A]?.[k]?0:1;}let _=X0(e.version);for(let A=0;A<h;A++)for(let k=0;k<h;k++){let M=A*h+k;y[M]<0&&_((k+.5)/s,(A+.5)/s)&&(y[M]=1);}let b=new Uint8Array(h*h),S=.3,v=0,x=0,w=(A,k,M)=>{if(A<0||A>=h||k>=h)return;let T=k*h+A;if(!Number.isNaN(g[T])){let L=Math.floor(A/s)===Math.floor(v/s)&&Math.floor(k/s)===Math.floor(x/s);g[T]+=L?M:M*S;}};for(let A=0;A<h;A++){let k=A%2===0?1:-1;for(let M=0;M<h;M++){let T=k===1?M:h-1-M,L=A*h+T,D=g[L];if(Number.isNaN(D))continue;let B=y[L]>=0?y[L]:D>=.5?1:0;b[L]=B===0?1:0;let z=Math.min(.75,Math.max(-0.75,D-B));v=T,x=A,w(T+k,A,z*7/16),w(T-k,A+1,z*3/16),w(T,A+1,z*5/16),w(T+k,A+1,z/16);}}let C=it(o);return [y2(e,a,A=>b[A]?C:null,"art-halftone"),...Y0(e,C)]}function o2(e,t){let r=null,n=0;for(let o of e.palette){if(t&&a7(o.color,t)<.02)continue;let i=o.area*(.35+c2(o.color))*(ae(o.color)>.86?.05:1);i>n&&(n=i,r=o.color);}return r}function x2(e,t,r,n,o){let i;if(e.photographic){let s=new wn,{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?it(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)=>I("path",{d:s.d,fill:it(n(s.color)),fillRule:"evenodd"},`${o}-${a}`));return I("g",{transform:`translate(${Ze(r.x)} ${Ze(r.y)}) scale(${m2(r.scale)})`,children:i},o)}function C7(e){let{art:t,image:r,size:n,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=W0(t,r),p=f2(t,r,f),m=q0(f.width,f.height,n,"contain"),h=Math.min(1,.3+1.4*c),d=z=>$n(a,z,h),g=it(a),y=it(s),_=[x2(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],b=h2,S=(z,j)=>xn((z+u)*l,(j+u)*l,(b+.4)*l,(b+.4)*l,1.2*l),v=ws(e.version,n).map(([z,j])=>xn((z-2.5+u)*l,(j-2.5+u)*l,6*l,6*l,l*.8)).join("");_.push(I("path",{d:S(-0.4,-0.4)+S(n-b,-0.4)+S(-0.4,n-b)+v,fill:g},"art-plates"));let x=X0(e.version),w=ae(a),C=ae(s),A=new Float32Array(n*n),k=new Float32Array(n*n),M=new Array(n*n);for(let z=0;z<n;z++)for(let j=0;j<n;j++){let te=z*n+j,U=o[te];if(U===At||U===Lt){A[te]=U===Lt&&i[z]?.[j]?C:w;continue}let Y=1,de=0,Te=0,$e=0,Z=0;for(let K=0;K<4;K++)for(let J=0;J<4;J++){let Ve=j+(J+.5)/4,Vr=z+(K+.5)/4,gt=x(Ve,Vr)?a:l2(p,(Ve-m.offsetX)/m.scale,(Vr-m.offsetY)/m.scale,a,h),Kt=ae(gt);Y=Math.min(Y,Kt),de+=Kt,Te+=gt[0],$e+=gt[1],Z+=gt[2];}A[te]=de/16,k[te]=Y,M[te]=[Te/16,$e/16,Z/16];}let T=C+.08*(w-C),L=w-.04*(w-C),D=b2(e,A,A,{base:.74-.26*c,max:.9,dark:T,light:L,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),B=new wn;for(let z=0;z<n;z++)for(let j=0;j<n;j++){let te=z*n+j,U=D.diameter[te],Y=!!i[z]?.[j];if(!(U>0)||!Y&&k[te]>=w-.02)continue;let de=Y?zr(M[te],s,T,true):zr(M[te],a,L,false);B.circle(it(de,8),(j+u+.5)*l,(z+u+.5)*l,U/2*l);}return _.push(...B.toElements("art-dot")),_.push(...Y0(e,y)),_}var E7={L:.5,M:.72,Q:.88,H:1},$2=.32,w2=.55,A7=.6,P7=2;function S2(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 v2=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function C2(e,t,r){return A2(t+.5,r+.5,e)<w2}function k7(e,t){let r=v2(e),n=w2+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++)C2(r,l,u)&&c.push(u*t+l);return c}var R7=e=>Math.floor(e.correctable*A7);function G0(e,t,r){let n=S2(e,t,r.size),o=R7(r);return xs(r,k7(n,r.size)).every(i=>i<=o)}function E2(e,t,r){if(G0(r,t,e))return r;let n=0,o=r;if(!G0(n,t,e))return -1;for(;o-n>1/64;){let i=(n+o)/2;G0(i,t,e)?n=i:o=i;}return n}var gu=new Map;function M7(e,t){let r=`${e.version}${e.level}:${t.toFixed(3)}`,n=gu.get(r);return n===void 0&&(n=E2(e,t,$2*e.size),gu.size>=64&&gu.clear(),gu.set(r,n)),n}function I7(e,t){let{size:r,t:n,modules:o,version:i}=e,s=s7(o),a=(.18+.15*n)*E7[s],c=t.width/t.height,u=Math.min($2,a)*r,l=bs(i,s),f=Math.max(0,M7(l,c));if(f<P7)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=E2(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:S2(p,c,r)}}function A2(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 P2(e,t){let{fg:r,bg:n,t:o}=e,i=ae(r),s=ae(n),a=o2(t),c=Math.min(1,o/.6),u=a?zr(a,r,i+.3*(s-i),true):r,l=$n(r,u,c),f=a?o2(t,a):null,p=i+.42*(s-i),m=f&&ae(f)<=p+.22?$n(r,zr(f,r,p,true),c):l;return {body:l,inner:m}}function T7(e){let{art:t,image:r,size:n,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=W0(t,r),f=I7(e,l).plate,{body:p}=P2(e,l),m=it(p),h=f&&v2(f),d=i.map(M=>[...M]);for(let M=0;M<n;M++)for(let T=0;T<n;T++){let L=o[M*n+T];(L===Lt||h&&L!==At&&C2(h,T,M))&&(d[M][T]=false);}let g=[],y=e.body?.(d);if(y)g.push(I("g",{fill:m,children:y},"art-body"));else {let M=new wn;for(let T=0;T<n;T++)for(let L=0;L<n;L++)d[T]?.[L]&&o[T*n+L]!==At&&M.circle(m,(L+a+.5)*c,(T+a+.5)*c,.45*c);g.push(...M.toElements("art-body"));}let _=ws(u,n).filter(([M,T])=>!h||A2(M+.5,T+.5,h)>3.2);if(_.length>0&&g.push(I("path",{d:p2(_,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let b=f2(t,r,l),S=(f.cx-f.plateW/2+a)*c,v=(f.cy-f.plateH/2+a)*c,x=f.plateW*c,w=f.plateH*c,C=f.radius*c,A=.1*c,k=xn(S,v,x,w,C);return g.push(I("path",{d:k,fill:it(s)},"art-plate"),I("path",{d:k+xn(S+A,v+A,x-2*A,w-2*A,C-A),fill:it($n(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),x2(l,b,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},M=>M,"art-logo")),g}function K0(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let r=t.image&&Q0(t.image);if(!r)return null;let n=Qo(e.fgColor,[0,0,0]),o=Qo(e.bgColor,[1,1,1]),i=d2(t,n,o);if(i<=0)return null;let s=W0(t,r);if(s.palette.length===0)return null;if(_u(t)==="badge"){let{body:h,inner:d}=P2({fg:n,bg:o,t:i},s),g={outer:it(h),inner:it(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=ae(n),c=ae(o),u=Math.min(1,i/.6),l=e.version*4+17,f=q0(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,y=(d-f.offsetY)/f.scale,_=null,b=0;for(let v of s.palette){if(ae(v.color)>.86)continue;let x=(v.cx-g)**2+(v.cy-y)**2,w=v.area*(.35+c2(v.color))*Math.exp(-x/(2*p**2));w>b&&(b=w,_=v.color);}if(!_)return {};let S=zr(_,n,a+.42*(c-a),true);return {inner:it($n(n,S,u))}};return {topLeft:m(3.5,3.5),topRight:m(l-3.5,3.5),bottomLeft:m(3.5,l-3.5)}}function pe(e){if(e.length===0)return "";let[t,...r]=e;return `M${$(t[0])} ${$(t[1])}${r.map(([n,o])=>`L${$(n)} ${$(o)}`).join("")}Z`}function ce(e,t,r){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e-r)} ${$(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${$(f)} ${$(f)} 0 0 1 ${$(p)} ${$(m)}`:"";return `M${$(e+s)} ${$(t)}H${$(e+r-a)}${l(a,e+r,t+a)}V${$(t+n-c)}${l(c,e+r-c,t+n)}H${$(e+u)}${l(u,e,t+n-u)}V${$(t+s)}${l(s,e+s,t)}Z`}function Vo(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 jo(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 Ss(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 qo(e,t,r){let n=r/2,o=(i,s)=>`${$(e+i*n)} ${$(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 k2(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 bu(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 Sn(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)}var L7=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function R2(e){return L7.includes(e)}var M2={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 xu(e,t){if(e===void 0||!Number.isFinite(e))return 1;let r=t?M2[t]??1:Wn;return Math.min(fi,Math.max(Wn,r,e))}function N7(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}function z7(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 J0(e){let t=(e-17)/4,r=Number.isInteger(t)?z7(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 O7={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 F7(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 pe([[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 pe(Vo(t,r,n*.54,6));case "star":return pe(jo(t,r+n*.04,n*.62,n*.34));case "heart":return qo(t,r+n*.02,n*1.08);case "random-dots":return ce(t,r,n*(.38+.15*bu(o,i)));case "mosaic":{let s=n*(.8+.14*bu(o,i,1))/2,a=[[t-s,r-s],[t+s,r-s],[t+s,r+s],[t-s,r+s]];return pe(k2(a,t,r,(bu(o,i,2)-.5)*16))}case "octagon":return pe(Vo(t,r,n*.48/Math.cos(Math.PI/8),8,22.5));default:return ce(t,r,n*.45)}}function I2(e,t){let{margin:r,pixelSize:n,pattern:o}=t,i=xu(t.scale,o),s=e.length,a=t.plain?()=>false:J0(s),c=(d,g)=>!t.plain&&N7(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=O7[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let y=l(g),_=l(d);if(a(g,d)){f.push(R`M${y-n/2} ${_-n/2}h${n}v${n}h${-n}z`);continue}if(!m){p.push(F7(o,y,_,n*i,g,d));continue}let b=n*m.thickness*i/2,S=m.horizontal&&u(g+1,d),v=m.horizontal&&u(g-1,d),x=m.vertical&&u(g,d-1),w=m.vertical&&u(g,d+1),A=[!(x||v),!(x||S),!(w||S),!(w||v)].map((k,M)=>k?b*m.radius(M):0);p.push(Q(y-b,_-b,2*b,2*b,A)),2*b<n&&(S&&p.push(Q(y,_-b,n,2*b)),w&&p.push(Q(y-b,_,2*b,n)));}if(m?.fillets&&i===1){let d=n*.3;for(let g=0;g<s;g++)for(let y=0;y<s;y++){if(u(y,g)||c(y,g))continue;let _=l(y)-n/2,b=l(g)-n/2,S=_+n,v=b+n;u(y-1,g)&&u(y,g-1)&&u(y-1,g-1)&&p.push(R`M${_} ${b}h${d}A${d} ${d} 0 0 0 ${_} ${b+d}Z`),u(y+1,g)&&u(y,g-1)&&u(y+1,g-1)&&p.push(R`M${S} ${b}v${d}A${d} ${d} 0 0 0 ${S-d} ${b}Z`),u(y+1,g)&&u(y,g+1)&&u(y+1,g+1)&&p.push(R`M${S} ${v}h${-d}A${d} ${d} 0 0 0 ${S} ${v-d}Z`),u(y-1,g)&&u(y,g+1)&&u(y-1,g+1)&&p.push(R`M${_} ${v}v${-d}A${d} ${d} 0 0 0 ${_+d} ${v}Z`);}}let h=[];return p.length>0&&h.push(I("path",{d:p.join("")},"modules")),f.length>0&&h.push(I("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);},D7=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);});}})},T2=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 D7(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 eg=(e,t=0)=>{for(let r=t;r<e.length;r++)if(e[r]?.continue!==true)return true;return false};function Or(e,t=[],r={}){return {...r,run(n){let o=e({value:n,issues:[]}),i=eg(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=eg(o.issues,a));}return o}}}function Z7(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 Cn=(e,t)=>({path:[],message:`Invalid input: expected ${e}, received ${Z7(t)}`}),B7={string:"characters",array:"items"};function ar(e,t,r,n){let o=B7[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 tg=e=>typeof e=="string"?`"${e}"`:`${e}`,O2=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ig(e,t,r){for(let n of r)n.path.unshift(t),e.push(n);}var G7=e=>e>=55296&&e<=56319,U7=e=>e>=56320&&e<=57343;function Q7(e){let t=e.length;for(let r=0;r<e.length-1;r++)G7(e.charCodeAt(r))&&U7(e.charCodeAt(r+1))&&(t--,r++);return t}var F2=e=>Array.isArray(e)?"array":typeof e=="string"?"string":"unknown",Es=e=>({run(t){t.value<e&&t.issues.push(ar(false,"number",e,true));}}),As=e=>({run(t){t.value>e&&t.issues.push(ar(true,"number",e,true));}}),Xo=(e,t="Invalid input")=>({run(r){e(r.value)||r.issues.push({path:[],message:t,continue:true});}}),D2=e=>typeof e=="string"?Q7(e):e.length,Z2=e=>({hasLength:true,run(t){let r=t.value;D2(r)<e&&t.issues.push(ar(false,F2(r),e,true));}}),sg=e=>({hasLength:true,run(t){let r=t.value;D2(r)>e&&t.issues.push(ar(true,F2(r),e,true));}}),B2=(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});}}),V7={run(e){let t=e.value;Number.isInteger(t)?Number.isSafeInteger(t)||e.issues.push(t>0?ar(true,"int",Number.MAX_SAFE_INTEGER,true):ar(false,"int",Number.MIN_SAFE_INTEGER,true)):e.issues.push({...Cn("int",t),continue:false});}},En=(...e)=>Or(t=>{let r=t.value;return typeof r=="number"&&Number.isFinite(r)||t.issues.push(Cn("number",r)),t},e),G2=(...e)=>En(V7,...e),$u=(...e)=>Or(t=>(typeof t.value!="string"&&t.issues.push(Cn("string",t.value)),t),e);function kt(e){let t=e.length===1?`Invalid input: expected ${tg(e[0])}`:`Invalid option: expected one of ${e.map(tg).join("|")}`;return Or(r=>(e.includes(r.value)||r.issues.push({path:[],message:t}),r),[],{values:e})}var Pt=e=>kt([e]),we=e=>({optional:true,run:t=>t===void 0?{value:t,issues:[]}:e.run(t)});function Me(e,t=[]){let r=Object.keys(e),n=new Set(r);return Or(o=>{let i=o.value;if(!O2(i))return o.issues.push(Cn("object",i)),o;let s={};for(let c of r){let u=e[c],l=u.run(i[c]),f=c in i;ig(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(tg).join(", ")}`,continue:true}),o},t,{shape:e})}function rg(e,t,r){let n=[];return t!==void 0&&n.push(Z2(t)),r!==void 0&&n.push(sg(r)),Or(o=>{let i=o.value;if(Array.isArray(i)&&r!==void 0&&i.length>r)return o.issues.push(ar(true,"array",r,false)),o;if(!Array.isArray(i))return o.issues.push(Cn("array",i)),o;let s=new Array(i.length);for(let a=0;a<i.length;a++){let c=e.run(i[a]);ig(o.issues,a,c.issues),s[a]=c.value;}return o.value=s,o},n)}function ng(e){return Or(t=>{let r=t.value;if(!Array.isArray(r))return t.issues.push(Cn("tuple",r)),t;if(r.length<e.length)return t.issues.push(ar(false,"array",e.length,void 0)),t;r.length>e.length&&t.issues.push(ar(true,"array",e.length,void 0));let n=[];return e.forEach((o,i)=>{let s=o.run(r[i]);ig(t.issues,i,s.issues),n[i]=s.value;}),t.value=n,t})}function Ho(e){return Or(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=>!eg(o.issues));return n.length===1?n[0]:(t.issues.push({path:[],message:"Invalid input"}),t)})}function U2(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 Or(o=>{let i=o.value;if(!O2(i))return o.issues.push(Cn("object",i)),o;let s=r.get(i[e]);return s?s.run(i):(o.issues.push({path:[e],message:n}),o)})}var j7=Xo(_r,`Numbers may have at most ${ee.maxDecimals} decimals`),Su=[Es(-ee.maxCoordinate),As(ee.maxCoordinate),j7],Be=En(...Su),Ye=En(...Su,Xo(e=>e>0,"Must be greater than 0")),wu=En(...Su,Xo(e=>e>=0,"Must not be negative")),Cs=$u(B2(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),L2=Ho([kt(hi),Cs]),Q2=e=>Me({mix:ng([e,e]),amount:En(Es(0),As(1),Xo(_r))}),Wo=Ho([L2,Q2(L2)]),q7=Ho([Cs,Q2(Ho([kt(["frame","accent","background"]),Cs]))]),vn=Ho([Wo,Me({gradient:Me({from:Wo,to:Wo,direction:we(kt(["horizontal","vertical"])),steps:we(G2(Es(2),As(ee.maxGradientSteps)))})})]),og=()=>({x:Be,y:Be,width:Ye,height:Ye}),vs=Me({color:Wo,width:Ye}),W7=U2("type",[Me({type:Pt("rect"),...og(),radius:we(wu),fill:vn,hole:we(Me({...og(),radius:we(wu)})),stroke:we(vs)}),Me({type:Pt("circle"),cx:Be,cy:Be,r:Ye,hole:we(Ye),fill:vn,stroke:we(vs)}),Me({type:Pt("ellipse"),cx:Be,cy:Be,rx:Ye,ry:Ye,fill:vn,stroke:we(vs)}),Me({type:Pt("polygon"),points:rg(ng([Be,Be]),3,ee.maxPolygonPoints),fill:vn,stroke:we(vs)}),Me({type:Pt("path"),d:$u(Z2(2),sg(ee.maxPathLength)),fill:vn,fillRule:we(kt(["nonzero","evenodd"])),stroke:we(vs)}),Me({type:Pt("line"),x1:Be,y1:Be,x2:Be,y2:Be,width:Ye,cap:we(kt(["butt","round"])),dash:we(ng([Ye,Ye])),fill:vn}),Me({type:Pt("icon"),icon:kt(pi),x:Be,y:Be,size:Ye,fill:vn})]),N2=()=>({id:$u(B2(/^[a-z][a-z0-9-]{0,31}$/)),slot:kt(["primary","secondary","fixed"]),text:$u(sg(200)),maxLength:we(G2(Es(1),As(ut))),color:Wo,weight:we(kt(["bold","regular"])),collapse:we(Me({y:Be,height:Ye}))}),H7=U2("type",[Me({type:Pt("text"),...N2(),box:Me(og()),align:we(kt(["start","middle","end"])),fontSize:we(Ye)}),Me({type:Pt("curved"),...N2(),curve:Me({cx:Be,cy:Be,radius:Ye,side:kt(["top","bottom"]),spread:we(En(Es(20),As(300),Xo(_r)))}),fontSize:Ye})]),z2=En(...Su,Xo(e=>e>=ee.minArtboard&&e<=ee.maxArtboard,`Artboard sides must be ${ee.minArtboard} to ${ee.maxArtboard} units`)),X7=Me({kind:Pt(Xr),version:Pt(Yr),artboard:Me({width:z2,height:z2}),qr:Me({x:Be,y:Be,size:Ye,padding:we(wu),radius:we(wu),plate:we(kt(["opaque","background","none"]))}),colors:Me({frame:Cs,text:we(q7),accent:we(Cs)}),shapes:rg(W7,void 0,ee.maxShapes),labels:rg(H7,void 0,ee.maxLabels),bleed:we(Ho([Pt("none"),Wo]))},[{run(e){ta(e.value,(t,r=[])=>{e.issues.push({path:[...r],message:t,continue:true});});}}]);function vu(e){let t=X7.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 V2=({path:e,message:t})=>e.length>0?`${e.join(".")}: ${t}`:t;var ag=24,Fr=(e,t,r,n)=>{let o=n*Math.PI/180;return [e+r*Math.cos(o),t+r*Math.sin(o)]},Cu=([e,t])=>`${$(e)} ${$(t)}`;function Yo(e,t,r,n,o,i){let s=i-o>180?1:0;return `M${Cu(Fr(e,t,n,o))}A${$(n)} ${$(n)} 0 ${s} 1 ${Cu(Fr(e,t,n,i))}L${Cu(Fr(e,t,r,i))}A${$(r)} ${$(r)} 0 ${s} 0 ${Cu(Fr(e,t,r,o))}Z`}function Ps(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function Y7(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 j2(e){return pe(Y7(e)<0?[...e].reverse():e)}function Eu(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 j2([[e+s,t+a],[r+s,n+a],[r-s,n-a],[e-s,t-a]])}var st=(...e)=>({d:e.join(""),fillRule:"nonzero"}),cr=(...e)=>({d:e.join(""),fillRule:"evenodd"});function K7(){let e=[];for(let t of [0,60,120]){let[r,n]=Fr(12,12,10.5,t+180),[o,i]=Fr(12,12,10.5,t);e.push(Eu(r,n,o,i,2));}for(let t=0;t<6;t++){let r=t*60,[n,o]=Fr(12,12,6.2,r);for(let i of [-45,45]){let[s,a]=Fr(n,o,3.6,r+i);e.push(Eu(n,o,s,a,1.7));}}return st(...e)}var J7={wifi:()=>st(Yo(12,20,4.6,7.2,-135,-45),Yo(12,20,9.2,11.8,-135,-45),Yo(12,20,13.8,16.4,-135,-45),ce(12,20,2.2)),star:()=>st(pe(jo(12,12.8,11.6,4.8))),heart:()=>st(qo(12,12.4,22)),phone:()=>cr(Q(6,1.5,12,21,2.6),Q(7.8,4.2,8.4,13.4,.6),ce(12,19.8,1.1)),headphones:()=>st(Yo(12,13,7.6,9.8,-180,0),Q(2,12,5,9.5,2),Q(17,12,5,9.5,2)),calendar:()=>cr(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:()=>st(ce(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:()=>cr(Q(2,3,20,14,4),pe([[6.5,17],[11.5,17],[5.8,21.8]]),ce(7.5,10,1.5),ce(12,10,1.5),ce(16.5,10,1.5)),bag:()=>st(Q(3.5,7.5,17,14.5,2),Yo(12,7.5,3.1,4.8,-180,0)),bell:()=>st("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:()=>st("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Yo(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:()=>cr(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:()=>cr(ce(12,12,10.5),pe([[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:()=>cr(ce(12,12,10.5),ce(12,7.2,1.6),Q(10.6,10,2.8,8,.8)),home:()=>cr(pe([[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:()=>cr("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",ce(12,9.5,3)),share:()=>st(Eu(6,12,18,5,1.8),Eu(6,12,18,19,1.8),ce(18,5,3.2),ce(6,12,3.2),ce(18,19,3.2)),download:()=>st(Q(10.6,2,2.8,9.5,0),pe([[6,10],[18,10],[12,16.5]]),pe([[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:()=>cr(ce(12,12,10.5),ce(12,12,8.4),pe([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:K7,pumpkin:()=>st(Ps(7.8,14.6,5.8,6.9),Ps(16.2,14.6,5.8,6.9),Ps(12,14.6,4.8,7.4),Q(10.9,3.4,2.2,4.6,.8),j2([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>st(pe([[12,1.5],[16.8,8.2],[7.2,8.2]]),pe([[12,5.2],[19,13.6],[5,13.6]]),pe([[12,9.4],[21.2,19.2],[2.8,19.2]]),Q(10.4,18.6,3.2,3.9,.4)),sparkle:()=>st(pe(jo(9.5,13.5,9,2.4,4)),pe(jo(19,5,4,1.1,4))),gift:()=>st(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),Ps(8.8,4.8,2.9,1.9),Ps(15.2,4.8,2.9,1.9))};function cg(e){return J7[e]()}function q2(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function lg(e){let t=0;for(let r of e)t+=q2(r);return Math.max(t,1)}var ug=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function ks(e,t,r){let n=Ae(e)??{r:0,g:0,b:0},o=Ae(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,r));return `#${ug(n.r+(o.r-n.r)*i)}${ug(n.g+(o.g-n.g)*i)}${ug(n.b+(o.b-n.b)*i)}`}function W2(e,t,r,n,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>q2(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 y=l[g],_=(h+y/2)/p;if(h+=y+u,d.trim()==="")return;let b=i==="top"?-Math.PI/2-f/2/p+_:Math.PI/2+f/2/p-_;m.push({text:d,x:t+p*Math.cos(b),y:r+p*Math.sin(b),fontSize:o,maxWidth:o*2,color:s,rotate:b*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var Rs=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},H2=new WeakMap;function An(e){if(e&&typeof e=="object"){let r=H2.get(e);if(r)return r}if(e==null)throw new Rs(['A "custom" frame needs a spec']);let t=vu(e);if(!t.success)throw new Rs(t.issues.map(V2));return typeof e=="object"&&H2.set(e,t.data),t.data}function fg(e){let t=An(e);return eo(t)/t.qr.size}var ev=e=>{let t=Ae(e);return !!(t&&t.a>=1)};function tv(e,t){let r=ze(t,Ne);return e.qr.plate==="none"?{color:r,plate:false}:ev(r)?{color:r,plate:true}:e.qr.plate==="background"?{color:r,plate:false}:{color:Ne,plate:true}}function Au(e,t,r=Ne){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:ks(i(s.mix[0]),i(s.mix[1]),s.amount));return {frame:n,text:a,accent:o}}function rv(e,t,r){let n=Au(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):ks(o(i.mix[0]),o(i.mix[1]),i.amount)}function X2(e,t,r=0,n=0){let o=mi(e);return o?Ll(o,t,r,n):""}function nv(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function ov(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,y)=>{let _=[r+c*g,n+u*g],b=[r+c*y,n+u*y];if(e.cap==="round"&&y-g>2*a){let S=[_[0]+c*a,_[1]+u*a],v=[b[0]-c*a,b[1]-u*a];return `M${$(S[0]-l)} ${$(S[1]-f)}L${$(v[0]-l)} ${$(v[1]-f)}A${$(a)} ${$(a)} 0 0 1 ${$(v[0]+l)} ${$(v[1]+f)}L${$(S[0]+l)} ${$(S[1]+f)}A${$(a)} ${$(a)} 0 0 1 ${$(S[0]-l)} ${$(S[1]-f)}Z`}return `M${$(_[0]-l)} ${$(_[1]-f)}L${$(b[0]-l)} ${$(b[1]-f)}L${$(b[0]+l)} ${$(b[1]+f)}L${$(_[0]+l)} ${$(_[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 iv(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:ce(e.cx*t,e.cy*t,e.r*t)+(e.hole?ce(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:nv(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:X2(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return ov(e,t);default:{let r=cg(e.icon);return {type:"path",d:X2(r.d,e.size*t/ag,e.x*t,e.y*t),fillRule:r.fillRule}}}}function sv(e){if(e.type==="rect"){let{x:t,y:r,width:n,height:o,radius:i,hole:s}=e;return [...Ut(t,r,n,o,i,i),...s?Ut(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"}]:Jt(e.d)}function av(e,t,r){let n=sv(e),o=Ks(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 y of g)c=Math.min(c,a(y)),u=Math.max(u,a(y));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 y=c+m*g/l,_=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),b=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:y,y1:_}:{x0:y,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},S=o.map(v=>Hn(v,b)).filter(v=>v.length>2);S.length!==0&&d.push({type:"path",d:D1(S),fill:ks(f,p,(g+.5)/l),fillRule:i});}return d}function cv(e,t,r){let n=iv(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=av(n,e.fill.gradient,r);return o?[...i,{...n,fill:"none",...o}]:i}return [{...n,fill:r(e.fill),...o}]}function uv(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 Jn(n,r)}function lv(e){return e===void 0||!Number.isFinite(e)?1:Math.min(gr,Math.max(Wr,e))}function fv(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:y,side:_,spread:b=140}=e.curve,S=y*n*(b*Math.PI/180),v=Math.min(e.fontSize*n*r,S/(lg(t)+.08*t.length));return W2(t,d*n,g*n,y*n,v,_,s,i).map(x=>({...x,...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*Zl)*n,m=Math.min(p*r,f*di,l/lg(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 mv(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 pv(e,t){let r=mi(e);return r?Ll(mv(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 dv(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:pv(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function hv(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}=Bl(o);return !(i&&n(i.y0,i.y1))}).map(o=>dv(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 Ms(e,t,r,n,o={}){let i=new Map(t.labels.map(g=>[g.id,uv(g,r)])),s=hv(t,t.labels.flatMap(g=>g.collapse&&!i.get(g.id)?[g.collapse]:[])),a=e/s.qr.size,c=tv(s,n),u=rv(r,s,c.color),l=s.shapes.flatMap(g=>cv(g,a,u));if(c.plate){let g=eo(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=lv(r.fontScale),p=s.labels.flatMap(g=>{let y=i.get(g.id);if(!y)return [];let _=(g.slot==="fixed"?void 0:o[g.slot])??g.id;return fv(g,y,f,a,u,_)}),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 mg(e,t,r){return Ms(e,An(t.spec),t,r)}var Y2={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 pg={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 K2={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 J2={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 ex={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 tx={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 rx={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 nx={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 ox={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 Pu={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 ix={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 sx={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 ax={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 cx={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 ux={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 lx={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 fx={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 mx={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 px={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 Ge=(e,t,r,n,o)=>({style:e,name:t,tags:o,labelOn:n,spec:r}),dg=[Ge("banner-bottom","Banner",pg,"frame",["bottom","band"]),Ge("banner-top","Top banner",K2,"frame",["top","band"]),Ge("banner-top-bottom","Two banners",J2,"frame",["top","bottom","band"]),Ge("border","Border",ex,"background",["square","outline"]),Ge("rounded-border","Rounded",cx,"background",["border","outline"]),Ge("gradient-border","Gradient",Pu,"background",["border","colorful"]),Ge("focus","Focus",ox,"background",["corners","brackets"]),Ge("speech-bubble","Bubble",ux,"frame",["speech"]),Ge("speech-bubble-top","Bubble top",lx,"frame",["speech"]),Ge("chat-bubble","Chat",tx,"frame",["message","bubble"]),Ge("circle","Circle",rx,"frame",["round","ring","curved"]),Ge("badge","Ribbon",Y2,"frame",["badge","banner"]),Ge("sticker","Sticker",fx,"frame",["label"]),Ge("polaroid","Polaroid",ax,"frame",["photo","picture"]),Ge("phone","Phone",sx,"background",["mobile","screen"]),Ge("ticket","Ticket",px,"frame",["event","pass"]),Ge("tag","Tag",mx,"frame",["price","label"]),Ge("envelope","Envelope",nx,"frame",["mail","letter"]),Ge("menu-card","Menu card",ix,"background",["menu","restaurant"])],Nv=new Map(dg.map(e=>[e.style,e]));function hg(e){return Nv.get(e)}var zv=Object.fromEntries(dg.map(e=>[e.style,e.spec])),Ov={from:Pu.colors.frame,to:Pu.colors.accent};function ku(e){return !e||e.style==="none"?null:e.style===Kr?e.spec??null:hg(e.style)?.spec??null}function Fv(e){let t=ku(e);return e&&typeof t?.colors?.frame=="string"?Au(t,e):null}var Dv={primary:"text",secondary:"secondaryText"};function dx(e,t,r){let n=hg(t.style)?.spec??pg;return Ms(e,An(n),t,r,Dv)}var Mu="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",gx=.08,yx="data-qrdx-frame-label";function bt(e){return !!(e?.style&&e.style!=="none")}function gg(e){let t=ku(e);return t?fg(t):gx}function Zv(e){return (e.text??vl).trim().slice(0,ut)}function Bv(e){return (e.secondaryText??"").trim().slice(0,ut)}function Pn(e,t,r){return t.style===Kr?mg(e,t,r):dx(e,t,r)}function ur(e,t){if(!bt(t))return {width:e,height:e};let{width:r,height:n}=Pn(e,t);return {width:r,height:n}}var ge=e=>se(e,2);function hx({x:e,y:t,width:r,height:n,radius:o}){let i=ge(Math.min(o,r/2,n/2)),[s,a,c,u]=[ge(e),ge(t),ge(r),ge(n)];return i<=0?R`M${s} ${a}h${c}v${u}h${-c}z`:R`M${s+i} ${a}h${ge(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+R`v${ge(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+R`h${ge(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+R`v${ge(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Ru(e){return e.stroke&&e.strokeWidth?{stroke:e.stroke,strokeWidth:ge(e.strokeWidth)}:{}}function _x(e,t){return e.type==="rect"&&e.hole?I("path",{d:hx(e)+hx(e.hole),fill:e.fill,fillRule:"evenodd",...Ru(e)},t):e.type==="polygon"?I("polygon",{fill:e.fill,points:e.points.map(([r,n])=>`${ge(r)},${ge(n)}`).join(" "),...Ru(e)},t):e.type==="path"?I("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"},...Ru(e)},t):hu("rect",{...Ru(e),fill:e.fill,height:ge(e.height),key:t,width:ge(e.width),x:ge(e.x),y:ge(e.y),...e.radius>0&&{rx:ge(e.radius),ry:ge(e.radius)}})}function bx(e){return e.shapes.map((t,r)=>_x(t,r))}function Iu(e,t){let{size:r,frame:n,bgColor:o,svgProps:i,markLabels:s}=t,a=Pn(r,n,o),c=xx(a),u=ge(a.width),l=ge(a.height);return Qe("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[I("g",{"data-qrdx-frame":n.style,children:a.shapes.map((f,p)=>_x(f,p))}),Bo(e,{x:ge(a.qrX),y:ge(a.qrY),width:r,height:r}),c.map((f,p)=>I("text",{"data-max-width":ge(f.maxWidth),fill:f.color,fontFamily:Mu,fontSize:ge(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:ge(f.x),y:ge(f.y),...f.rotate&&{transform:`rotate(${ge(f.rotate)} ${ge(f.x)} ${ge(f.y)})`},...s&&f.field&&{[yx]:f.field},children:f.text},p))]})}function xx(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var Gv={2:6,3:12};function $x(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=Gv[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 Sx(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 vx(e,t){let r=0;for(let n of e)if(n<t)r++;else break;return r%2===1}function Uv(e,t,r){return vx(Sx(e,r),t)}function Cx(e){let t=new Map;return (r,n)=>{let o=t.get(n);return o||(o=Sx(e,n),t.set(n,o)),vx(o,r)}}function Qv(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 Vv(e,t,r){if(!Uv(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,Qv(t,r,o[i],o[(i+1)%o.length]));return Number.isFinite(n)?n:0}function jv(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 Ex(e){let t=e.map($x),r=jv(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?Vv(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,y=r.y0+o*h/a,_=i(g,y);_>s.value&&(s={cx:g,cy:y,value:_});}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 y=-2;y<=2;y++){let _=d.cx+c*y/2,b=d.cy+u*g/2,S=i(_,b);S>s.value&&(s={cx:_,cy:b,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($x),half:s.value}}function Ax(e,t){let r=([o,i])=>`${$(o*t)} ${$(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 qv={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]]]},wx;function Px(){return wx??=Ex([qv]),wx}function Wv(e){let{width:t,height:r,cells:n}=e;return Number.isInteger(t)&&Number.isInteger(r)&&t>=Rt&&r>=Rt&&t<=wt&&r<=wt&&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 lr=([e,t])=>`${e},${t}`;function Hv(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(lr(l))??[];p.push(f),o.set(lr(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],y=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(y,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(y,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(y,h);break;case 5:i(h,d),i(y,g);break;case 10:i(y,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(lr(h));){a.add(lr(h)),p.push(h);let d=Xv(o.get(lr(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(Yv(p));}return s}function Xv(e,t,r){let n=lr(t);return e.find(o=>lr(o)!==n&&!r.has(lr(o)))??e.find(o=>lr(o)!==n)}function Yv(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 Kv(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 Is=new Map;function yg(e){let t=`${e.width}x${e.height}:${e.cells}`,r=Is.get(t);if(r)return r;let n=Wv(e),o;if(!n)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=Hv(n,e.width,e.height),s=i.length>0?Ex(i.map(Kv)):null;o=s&&2*s.half>=Il?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return Is.size>16&&Is.delete(Is.keys().next().value),Is.set(t,o),o}var Jv=1,kx=.5,Rx=.5,e8=.5;function kn(e){return Math.max(e,Ml)}function Tu(e){return e==="heart"?Px():typeof e=="object"&&e?.type==="silhouette"?yg(e).outline:null}function _g(e){return e==="circle"||Tu(e)!==null}var t8={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 r8(e){let{outline:t,problem:r}=yg(e);if(t&&!r)return {ok:true,share:2*t.half};let n=r??"invalid";return {ok:false,reason:n,message:t8[n]}}function at(e,t,r){if(r==="circle"){let s=kn(t),a=(e/2+s)*Math.SQRT2+Jv;return Math.ceil(a-e/2)}let n=Tu(r);if(!n)return t;let o=kn(t),i=(e+2*(o+e8))/(2*n.half);return Math.ceil((i-e)/2-1e-9)}function Mx(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 n8(e,t,r){let n=at(t,r,"circle"),o=kn(r),i=t+2*n,s=i/2,a=s-kx-.5,c=Mx(Number.parseInt(Sn(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()<Rx;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var o8=Array.from({length:8},(e,t)=>{let r=t*Math.PI/4;return [Math.cos(r),Math.sin(r)]});function Ix(e,t,r,n){if(n==="circle")return n8(e,t,r);let o=Tu(n);if(!o)return null;let i=at(t,r,n),s=kn(r),a=t+2*i,c=Cx(o.polygons),u=.5+kx,l=(h,d)=>{let g=h+.5,y=d+.5;return c(g/a,y/a)?o8.every(([_,b])=>c((g+_*u)/a,(y+b*u)/a)):false},f=Mx(Number.parseInt(Sn(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,y)=>{let _=f()<Rx;return y>=p&&y<m&&d>=p&&d<m?false:_&&l(y,d)}))}function bg(e,t){if(e==="circle")return {circle:t/2};let r=Tu(e);return r?{path:Ax(r,t)}:null}function i8(e,t){let r=bg(e,t);return r?"circle"in r?ce(t/2,t/2,r.circle):r.path:null}function s8(e){return e==="top-left"?0:e==="top-right"?1:3}function Lu(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=s8(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 I("path",{d:Q(e-r,t-r,i,i,m)})}case "extra-rounded":return I("path",{d:Q(e-r,t-r,i,i,1.15*a)});case "plus":{let c=1.15*a,u=r;return I("path",{d:pe([[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 I("path",{d:Q(e-r,t-c,i,2*c,u)+Q(e-c,t-r,2*c,i,u)})}case "hexagon":return I("path",{d:pe(Vo(e,t,1.72*a,6))});case "octagon":return I("path",{d:pe(Vo(e,t,r/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return I("path",{d:ce(e-c,t-c,u)+ce(e+c,t-c,u)+ce(e+c,t+c,u)+ce(e-c,t+c,u)+ce(e,t,1.2*a)})}case "heart":return I("path",{d:qo(e,t+.12*a,3.5*a)});case "squircle":return I("path",{d:pe(Ss(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(ce(e+l*a*.82,t+u*a*.82,.58*a));return I("path",{d:c.join("")})}case "square":return I("rect",{height:$(i),transform:R`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "rounded":return I("rect",{height:$(i),rx:$(r*.5),ry:$(r*.5),transform:R`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "diamond":return I("path",{d:R`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:R`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`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 I("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`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 I("path",{clipRule:"evenodd",d:f,transform:R`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`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 I("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`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 I("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`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 I("path",{d:f,transform:R`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=R`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 I("path",{clipRule:"evenodd",d:f,transform:R`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return I("g",{transform:R`translate(${e-40*c},${t-40*c}) scale(${$(c,6)})`,children:I("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 I("circle",{cx:$(e),cy:$(t),r:$(r),transform:R`rotate(0,${e},${t})`})}}function Ko(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 Tx(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 Lx(e,t,r,n){let o=r/7,i=Math.max(0,(n+Math.SQRT2-2)*o);return pe(Tx(e,t,r,n*o))+pe(Tx(e+o,t+o,5*o,i))}function Nx(e,t,r,n,o=false){let i=r/7,s=a=>o?Ko(n,0,a,true):Ko(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 a8(e,t,r,n){let o=r/7;return Q(e,t,r,r,Ko(n,2.6*o,0,false))+Q(e+o,t+o,5*o,5*o,Ko(n,1.6*o,0,false))}function c8(e,t,r){let n=r/7,o=e+r/2,i=t+r/2;return pe(Ss(o,i,3.5*n,3.5*n,4,96))+pe(Ss(o,i,2.5*n,2.5*n,4,96))}function zx(e,t,r,n,o){let i=n,s=r/2,a=(s-i)*.55,c=(u,l)=>R`${e+u} ${t+l}`;return R`M${c(i,0)}`+R`C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}`+R`C${c(s+a,o)} ${c(r-i-a,0)} ${c(r-i,0)}`+R`A${i} ${i} 0 0 1 ${c(r,i)}`+R`C${c(r,i+a)} ${c(r-o,s-a)} ${c(r-o,s)}`+R`C${c(r-o,s+a)} ${c(r,r-i-a)} ${c(r,r-i)}`+R`A${i} ${i} 0 0 1 ${c(r-i,r)}`+R`C${c(r-i-a,r)} ${c(s+a,r-o)} ${c(s,r-o)}`+R`C${c(s-a,r-o)} ${c(i+a,r)} ${c(i,r)}`+R`A${i} ${i} 0 0 1 ${c(0,r-i)}`+R`C${c(0,r-i-a)} ${c(o,s+a)} ${c(o,s)}`+R`C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}`+R`A${i} ${i} 0 0 1 ${c(i,0)}Z`}function u8(e,t,r){let n=r/7,o=.12*n;return zx(e,t,r,1.4*n,o)+zx(e+n,t+n,5*n,.7*n,o)}function Ox(e,t,r,n,o,i){let s=r/2,a=(c,u)=>R`${e+c} ${t+u}`;return R`M${a(n,0)}H${e+r-n}`+R`A${n} ${n} 0 0 1 ${a(r,n)}`+R`V${t+o}`+R`C${a(r,o+1.55*i)} ${a(s+1.6*i,r)} ${a(s,r)}`+R`C${a(s-1.6*i,r)} ${a(0,o+1.55*i)} ${a(0,o)}`+R`V${t+n}A${n} ${n} 0 0 1 ${a(n,0)}Z`}function l8(e,t,r){let n=r/7;return Ox(e,t,r,.7*n,3.9*n,n)+Ox(e+n,t+n,5*n,.35*n,2.7*n,.8*n)}function f8(e,t,r,n){let o=r/7;return Q(e,t,r,r,Ko(n,.5*o,2.5*o,false))+Q(e+o,t+o,5*o,5*o,Ko(n,.25*o,1.5*o,false))}function m8(e,t,r){let n=r/7;return R`M ${e} ${t}v ${r}h ${r}v -${r}z`+R`M ${e+n} ${t+n}h ${5*n}v ${5*n}h -${5*n}z`}function p8(e,t,r){let n=r/7,o=n*.875,i=n*.4375,s=R`M ${e+o} ${t}`+R`h ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${o} ${o}`+R`v ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${-o} ${o}`+R`h ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${-o} ${-o}`+R`v ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=R`M ${e+n+i} ${t+n}`+R`h ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${i} ${i}`+R`v ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${-i} ${i}`+R`h ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${-i} ${-i}`+R`v ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function d8(e,t,r){let n=e+r/2,o=t+r/2,i=se(r/2),s=se(r*(2.5/7));return R`M ${n-i} ${o}`+R`a ${i} ${i} 0 1 0 ${i*2} 0`+R`a ${i} ${i} 0 1 0 ${-i*2} 0z`+R`M ${n-s} ${o}`+R`a ${s} ${s} 0 1 1 ${s*2} 0`+R`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function h8(e,t,r){let n=r/74.7002,o=a=>a*n+e,i=a=>a*n+t;return R`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 xg(e){let t=e/70;return {scale:t,transform:(n,o)=>(n-5)*t+o}}function g8(e,t,r){let{scale:n,transform:o}=xg(r);return R`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 y8(e,t,r){let n=r/7,o=n*1.5,i=n*.75,s=R`M ${e+o} ${t}`+R`h ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${o} ${o}`+R`v ${r-2*o}`+R`a ${o} ${o} 0 0 1 ${-o} ${o}`+R`h ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${-o} ${-o}`+R`v ${-(r-2*o)}`+R`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=R`M ${e+n+i} ${t+n}`+R`h ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${i} ${i}`+R`v ${5*n-2*i}`+R`a ${i} ${i} 0 0 1 ${-i} ${i}`+R`h ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${-i} ${-i}`+R`v ${-(5*n-2*i)}`+R`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function _8(e,t,r){let{scale:n,transform:o}=xg(r);return R`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 b8(e,t,r){let{scale:n,transform:o}=xg(r);return R`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 x8(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 R`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 Nu(e,t,r,n,o="top-left"){switch(n){case "leaf":return Nx(e,t,r,o);case "leaf-reverse":return Nx(e,t,r,o,true);case "drop":return a8(e,t,r,o);case "octagon":return Lx(e,t,r,1.6);case "bevel":return Lx(e,t,r,1.1);case "squircle":return c8(e,t,r);case "cushion":return u8(e,t,r);case "shield":return l8(e,t,r);case "petal":return f8(e,t,r,o);case "gear":return h8(e,t,r);case "rounded":return p8(e,t,r);case "circle":return d8(e,t,r);case "diya":return g8(e,t,r);case "extra-rounded":return y8(e,t,r);case "message":return _8(e,t,r);case "pointy":return b8(e,t,r);case "curly":return x8(e,t,r);default:return m8(e,t,r)}}var zu=.22,Ou=.14;function Fx(e,t,r={}){if(e==="circle")return I("circle",{cx:$(t.x+t.w/2),cy:$(t.y+t.h/2),r:$(Math.min(t.w,t.h)/2),...r});let n=e==="rounded"?Math.min(t.w,t.h)*zu:0;return I("rect",{height:$(t.h),width:$(t.w),x:$(t.x),y:$(t.y),...n>0&&{rx:$(n),ry:$(n)},...r})}function $8(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 Fu(e,t){let r=e.shape??"square",n=e.plate,o=n?$8(t,Ou):t,i=a=>I("image",{height:$(o.h),href:e.src,preserveAspectRatio:"none",width:$(o.w),x:$(o.x),y:$(o.y),...a&&{clipPath:`url(#${a})`}});if(r==="square"&&!n)return i();let s=r==="square"?void 0:`qrdx-logo-${Sn(`${r}|${$(o.x)}|${$(o.y)}|${$(o.w)}|${$(o.h)}`)}`;return Qe("g",{children:[n&&Fx(r,t,{fill:n}),s&&I("clipPath",{id:s,children:Fx(r,o)}),i(s)]})}var Dx=.6,w8=["L","M","Q","H"];function Zx(e){let t=Le.QrCode.encodeText(e.value,Ke[e.level]),r=w8[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:at(t.size,e.margin,e.shape),map:bs(t.version,r),level:r,version:t.version}}function Bx(e,t){let{cells:r,map:n}=e,o=r.length,i=Dr(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*Dx),level:e.level,version:e.version}}function Du(e,t){return Bx(Zx(e),t)}var Gx=e=>!e||e.worst<=e.budget;function S8(e,t){return Gx(Du(e,t))}function $g(e,t,r,n){let o=t.map(a=>Zx({...e,level:a})),i=a=>{let c=n(a);return o.every(u=>Gx(Bx(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 Zu(e,t){if(!t)return;let r=Math.floor(e.size*Ws),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??Dt,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape},c=p=>xt({...e,level:s,imageSettings:p}),u=p=>{let m=$g(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 wg="data-qrdx-part",Ux="data-qrdx-eye",v8=["eye-outer","eye-centre","body","logo","background"];function Sg(e,t,r){if(e)return r?{[wg]:t,[Ux]:r}:{[wg]:t}}var Ts=300;function Ht(e){return {id:e.id,name:e.name,description:e.description,spec:e.spec,wrapper:(t,r)=>{let n=An(e.spec),o=r?.fgColor,i=(typeof o=="string"?o:ze(o,""))||"black",s=Ms(n.qr.size,n,{color:i}),{x:a,y:c,scale:u}=e.at;return I("svg",{height:Ts,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Ts} ${Ts}`,width:Ts,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Qe("g",{"data-qrdx-template":e.id,transform:`translate(${$(a)} ${$(c)})${u===1?"":` scale(${u})`}`,children:[bx(s),I("g",{fill:"none",transform:`translate(${$(s.qrX)} ${$(s.qrY)}) scale(${s.qrSize/Ts})`,children:t})]})})}}}var Qx={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 Vx=Ht({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Qx,at:{x:47,y:95,scale:1}});var jx={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>I("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:I("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var Ns=593,Zr=296.5,Ls=146.5,Kx=294.5,Jx=231.228,e$="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",E8="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",A8="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",qx="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Wx=52,P8=240;function Hx(e){let t=0;return e.split(" ").map(r=>(t+=Number.parseInt(r,36),t/1e4))}var vg;function k8(){if(!vg){let e=Hx(E8),t=Hx(A8),r=[];for(let n=0;n<qx.length;n+=3){let o=Number.parseInt(qx.slice(n,n+3),36);r.push({cx:e[Math.floor(o/Wx)],cy:t[o%Wx]});}vg=r;}return vg}function R8(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 t$(e){let t=k8(),r=R8(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,P8).sort((i,s)=>i-s).map(i=>t[i])}var Xx=300,M8=49,I8=6;function r$(e,t){if(Xx/t<=M8+.5)return e;let r=Ls,n=Ls+Xx,o=I8*t+t/2;return e.filter(({cx:i,cy:s})=>Math.max(r-i,i-n,r-s,s-n)>=o)}var n$="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",zs=32,o$=3.5,T8=zs*Wr,i$=246.5,fr=2*Math.PI*i$,Ag=.36,Yx=i$+Ag*zs,Cg=400;function Jo(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function L8(e){let t=e.slice(0,Cg).split(" ").map(r=>Jn(r,Cg)).join(" ");return Array.from(t).slice(0,Cg)}var N8="\u2026",s$=1;function a$(e,t,r,n=false){return n&&t===e.length-1?s$*r:Jo(e[t],r)}function Pg(e,t,r=false){let n=0;for(let o=0;o<e.length;o++)n+=a$(e,o,t,r);return n}function Eg(e,t,r,n=false){return Pg(e,t,n)+r*Math.max(0,e.length-1)+Jo(" ",t)+2*r<=fr}var c$=e=>e.join("").split(" ").filter(Boolean),z8=(e,t)=>Array.from(Array.from({length:t},()=>e.join(" ")).join(" "));function u$(e,t,r){if(Eg(e,t,r))return {chars:e,fontSize:t,letterSpacing:r};let n=Math.min(r,0),o=Math.min(t,T8),i=(d,g=false)=>{let y=Pg(d,t,g)+Jo(" ",t),_=d.length+1,b=(fr-y)/_;if(b>=n)return {chars:d,fontSize:t,letterSpacing:b,cut:g};let S=(fr-n*_)/y*t;return S>=o?{chars:d,fontSize:S,letterSpacing:n,cut:g}:null},s=i(e);if(s)return s;let a=c$(e),c=l$(a);for(let d=a.length/c.length-1;d>=1;d--){let g=z8(c,d);if(Eg(g,o,n))return i(g)??{chars:g,fontSize:o,letterSpacing:n}}let u=fr-Jo(" ",o)-s$*o-2*n,l=0,f=0,p=0;for(let[d,g]of e.entries()){if(l+=Jo(g,o)+n,l>u)break;p=d+1,(p===e.length||e[p]===" ")&&(f=p);}let m=[...O8(e.slice(0,f>0?f:p)),N8];return (Eg(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 O8(e){let t=e.length;for(;t>0&&/[\s.,;:!?*·•\-–—]/u.test(e[t-1]);)t--;return e.slice(0,t)}function l$(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 F8(e,t,r){let n=c$(e);if(n.length===0)return {chars:[],fontSize:t,letterSpacing:r};let o=Array.from(l$(n).join(" ")),i=Pg(o,t)+Jo(" ",t),s=i+(o.length+1)*r,a=Math.min(r,0),c=null;for(let u of new Set([Math.floor(fr/s),Math.ceil(fr/s)])){if(u<1)continue;let l=(fr-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??u$(o,t,r)}function f$(e,t){let{position:r,rotation:n}=t,o=L8(e),i=t.fill==="repeat"?F8(o,t.fontSize,t.letterSpacing):u$(o,t.fontSize,t.letterSpacing),{fontSize:s,letterSpacing:a}=i,c=[],u=0;for(let[d,g]of i.chars.entries()){let y=a$(i.chars,d,s,i.cut);c.push({char:g,along:u+y/2}),u+=y+a;}let l=u-(c.length>0?a:0),f=r!=="bottom",p=f?Yx-Ag*s:Yx+Ag*s,m=l/fr*180,h=[];for(let{char:d,along:g}of c){if(d.trim()==="")continue;let y=g/fr*360,_=f?n-m+y:n+180+m-y,b=_*Math.PI/180;h.push({char:d,x:se(Zr+p*Math.sin(b)),y:se(Zr-p*Math.cos(b)),rotate:se(f?_:_-180)});}return {text:i.chars.join(""),letters:h,fontSize:s===t.fontSize?s:se(s),letterSpacing:a}}var ei=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,m$={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=ze(t?.fgColor,"#000000"),o=ze(t?.bgColor,"#ffffff"),i=r?.pixelSize??9,s=se(i/2),a=r$(t$(r?.url??""),i),c=ei(t?.fontSize,zs),u=c>0?c:zs,l=typeof t?.customText=="string"?t.customText:n$,f=f$(l,{fontSize:u,letterSpacing:ei(t?.fontLetterSpacing,o$),position:t?.textPosition==="bottom"?"bottom":"top",rotation:ei(t?.textRotation,0),fill:t?.textFill==="repeat"?"repeat":"none"}),p=t?.textColor||"#ffffff",m=t?.fontFamily||Mu,h=t?.fontWeight??900,d=ei(t?.strokeWidth,0),g=t?.strokeColor||"#000000",y=[{radius:Zr,width:ei(t?.outerStrokeWidth,d),color:t?.outerStrokeColor||g},{radius:Jx,width:ei(t?.innerStrokeWidth,d),color:t?.innerStrokeColor||g}].filter(_=>_.width>0);return Qe("svg",{height:Ns,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Ns} ${Ns}`,width:Ns,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[I("circle",{cx:Zr,cy:Zr,fill:o,r:Kx}),I("g",{fill:n,children:a.map((_,b)=>I("circle",{cx:_.cx,cy:_.cy,r:s},b))}),I("path",{d:e$,fill:t?.outerCircleColor||n}),y.map((_,b)=>I("circle",{cx:Zr,cy:Zr,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},b)),I("g",{"aria-hidden":"true",children:f.letters.map((_,b)=>I("text",{fill:p,fontFamily:m,fontSize:f.fontSize,fontWeight:h,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},b))}),I("g",{transform:`translate(${Ls} ${Ls})`,children:e})]})}};var p$={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 d$=Ht({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:p$,at:{x:38,y:10,scale:1}});var h$={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 g$=Ht({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:h$,at:{x:0,y:0,scale:300/316}});var y$={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 _$=Ht({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:y$,at:{x:46,y:1,scale:1}});var b$={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 x$=Ht({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:b$,at:{x:24,y:0,scale:1}});var Os={default:jx,Arrow:Vx,StandardBox:_$,SquareBorder:g$,StrikedBox:x$,Halloween:d$,DotRing:m$},$$={FlamQR:"DotRing"},Bu=e=>{if(Object.hasOwn(Os,e))return Os[e];let t=Object.hasOwn($$,e)?$$[e]:void 0;return t?Os[t]:void 0},JM=()=>Object.values(Os),eI=()=>Object.keys(Os);var kg=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function C$(e){return `#${kg(e.r)}${kg(e.g)}${kg(e.b)}`}function Gu(e){let t=Ae(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:C$(t),opacity:se(t.a,3)}}function Uu(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 E$={r:0,g:0,b:0,a:1};function U8(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:Ae(t.color)??E$})).sort((t,r)=>t.offset-r.offset)}function Rg(e,t){let r=e[0],n=e.at(-1);if(!(r&&n))return E$;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 w$=4,S$=720,Q8=2;function A$(e,t,r,n,o){let i=U8(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(_=>Math.abs(_.color.a-s)<.002),c=[...new Set([0,...i.map(_=>_.offset),1])].sort((_,b)=>_-b),u=[];for(let _=0;_+1<c.length;_++){let b=c[_],S=c[_+1];if(S<=b)continue;let v=Rg(i,b+1e-9),x=Rg(i,S-1e-9),w=Math.max(Math.abs(v.r*v.a-x.r*x.a),Math.abs(v.g*v.a-x.g*x.a),Math.abs(v.b*v.a-x.b*x.a),Math.abs(v.a-x.a)*255),C=Math.ceil(w/Q8),A=Math.ceil((S-b)*360/w$),k=Math.max(1,C,A);for(let M=0;M<k;M++)u.push([b+(S-b)*M/k,b+(S-b)*(M+1)/k]);}let l=u;if(u.length>S$){let _=Math.ceil(u.length/S$);l=[];for(let b=0;b<u.length;b+=_){let S=u.slice(b,b+_);l.push([S[0][0],S.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*w$/2*(Math.PI/180)),m=_=>{let b=_*Math.PI/180;return [$(r+p*Math.cos(b)),$(n+p*Math.sin(b))]},h=`${$(r)} ${$(n)}`,d=_=>se((_%360+360)%360,4),g=l.length-1,y=l.map(([_,b],S)=>{let v=Rg(i,(_+b)/2),x=(b-_)*360,w=a&&S===0&&g>0?x:0,C=a&&S<g?x:0,A=f+_*360-w,k=f+b*360+C,[M,T]=m(A),[L,D]=m(k);return {d:`M${h}L${M} ${T}L${L} ${D}Z`,color:C$(v),...a||v.a>=1?{}:{opacity:se(v.a,3)},from:d(A),sweep:se(k-A,4)}});return a&&s<1?{wedges:y,opacity:se(s,3)}:{wedges:y}}function v$(e,t,r,n){return (Math.atan2(n-t,r-e)*180/Math.PI%360+360)%360}function P$(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=v$(e,t,r.x+r.width/2,r.y+r.height/2),s=0,a=0;for(let[c,u]of o){let l=v$(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 k$(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 Tg(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 I$(e,t=0){let r=[];return e.forEach((n,o)=>{let i=null;n.forEach((s,a)=>{if(!s&&i!==null){r.push(R`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(R`M${a+t},${o+t} h1v1H${a+t}z`):r.push(R`M${i+t},${o+t} h${a+1-i}v1H${i+t}z`);return}s&&i===null&&(i=a);});}),r.join("")}function V8(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}var j8=.9;function Mg(e,t){let{margin:r,pixelSize:n,pattern:o="circle",plain:i=false}=t;if(R2(o))return I2(e,{margin:r,pixelSize:n,pattern:o,scale:t.scale,plain:i});let s=xu(t.scale,o),a=[],c=e.length,u=n*.45,l=i?()=>false:J0(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!V8(h,p,c))){let d=(h+.5+r)*n,g=(p+.5+r)*n,y=`${h}-${p}`,_=a.length;if(l(h,p)){a.push(I("rect",{height:$(n),width:$(n),x:$(d-n/2),y:$(g-n/2)},y));return}switch(o){case "circle":a.push(I("circle",{cx:$(d),cy:$(g),r:$(u),transform:R`rotate(0,${d},${g})`},y));break;case "circle-large":{let b=n*.5;a.push(I("circle",{cx:$(d),cy:$(g),r:$(b),transform:R`rotate(0,${d},${g})`},y));}break;case "small-square":{let b=n*.357143;a.push(I("path",{d:R`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:R`rotate(0,${d},${g})`},y));}break;case "diamond":{let b=n*.357143;a.push(I("path",{d:R`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:R`rotate(45,${d},${g})`},y));}break;case "circle-mixed":{let b=(h+p)%3===0?j8:(h+p)%2===0?1:1.25,S=u*b;a.push(I("circle",{cx:$(d),cy:$(g),r:$(S),transform:R`rotate(0,${d},${g})`},y));}break;case "pacman":{let b=n*.5,S=n*.357143;a.push(I("path",{d:R`M ${d-b} ${g-S}v ${n*.714286}h ${b}a ${b*.5} ${b*.5}, 0, 0, 0, 0 -${n*.714286}h -${b}v -${n*.714286}z`,transform:R`rotate(${(h+p)%2===0?0:90},${d},${g})`},y));}break;case "rounded":{let b=n*.5,S=n*.2;a.push(I("rect",{height:$(n),rx:$(S),ry:$(S),transform:R`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "square":{let b=n*.5;a.push(I("rect",{height:$(n),transform:R`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "vertical-line":{let b=n*.714286,S=n;a.push(I("path",{d:R`M ${d-n*.5} ${g-b*.5}v ${b}h ${S}v -${b}z`,transform:R`rotate(90,${d},${g})`},y));}break;default:a.push(I("circle",{cx:$(d),cy:$(g),r:$(u),transform:R`rotate(0,${d},${g})`},y));}if(s!==1&&a.length>_){let b=a.pop();a.push(I("g",{transform:R`translate(${d},${g}) scale(${$(s,6)}) translate(${-d},${-g})`,children:b},y));}}});}),a}function q8(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 Lg(e,t){return `${e}-${Sn(JSON.stringify(t))}`}function W8(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 Vu(e,t){return t.map((r,n)=>{let{color:o,opacity:i}=Gu(r.color);return I("stop",{offset:`${r.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${n}`)})}function T$(e,t,r,n,o,i){let s=A$(t.stops,t.angle??0,r,n,o),a=s.wedges.map((c,u)=>I("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 I("pattern",{"data-qrdx-conic":`${$(r)} ${$(n)}`,height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:s.opacity===void 0?a:I("g",{opacity:s.opacity,children:a})},e)}function H8(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 X8=["xMin","xMid","xMax"],Y8=["YMin","YMid","YMax"];function L$(e,t,r){let n=t.scale??1,o=t.fit==="tile",i=o?r/4*n:r,s=t.underlay?Gu(t.underlay):null,a=o?i:r*n,c=H8(t.position),u=o?0:c.x*(r-a),l=o?0:c.y*(r-a),f=o?"xMidYMid slice":`${X8[c.x*2]??"xMid"}${Y8[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return Qe("pattern",{height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:[s&&I("rect",{fill:s.color,fillOpacity:s.opacity,height:$(i),width:$(i),x:0,y:0}),I("image",{height:$(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:$(a),x:$(u),y:$(l)})]},e)}var N$=(e,t)=>Lg("img",[e,t]);function K8(e,t,r,n,o,i,s){let a=$t(e);if(a.type==="solid")return null;if(a.type==="image"){let u=N$(a,s);return {id:u,element:L$(u,a,s)}}let c=Lg(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}=W8(l,t,r,n,o);return {id:c,element:I("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:$(f),x2:$(m),y1:$(p),y2:$(h),children:Vu(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:I("radialGradient",{cx:$(l),cy:$(f),fx:$(l),fy:$(f),gradientUnits:"userSpaceOnUse",id:c,r:$(p),children:Vu(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:T$(c,a,t+n/2,r+n/2,n*.75,s)}:null}function Ig(e,t,r){let n=$t(e);if(n.type==="solid")return null;if(n.type==="image"){let i=N$(n,t);return {id:i,element:L$(i,n,t)}}let o=Lg(r,[n,t]);if(n.type==="linear"){let i=n,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=q8(s,t);return {id:o,element:I("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:$(a),x2:$(u),y1:$(c),y2:$(l),children:Vu(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:I("radialGradient",{cx:$(s),cy:$(a),fx:$(s),fy:$(a),gradientUnits:"userSpaceOnUse",id:o,r:$(c),children:Vu(o,i.stops)},o)}}return n.type==="angular"?{id:o,element:T$(o,n,t/2,t/2,t*.75,t)}:null}var Qu=e=>Vn(e)||bl(e);function R$(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 mr(e,t,r){if(t)return {fill:`url(#${t})`};let n=$t(e,r),o=n.type==="solid"?n.color:n.type==="image"?n.underlay??r:r,{color:i,opacity:s}=Gu(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function Dr(e,t,r,n){if(n==null)return null;let o=e.length,i=Math.floor(t*Ws),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 xt(e){let t=e.level??Dt,{imageSettings:r}=e,n=e.isOGContext&&r?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&r&&n!=="H"){let o=Le.QrCode.encodeText(e.value,Ke[n]).getModules(),i=Dr(o,e.size??ve,at(o.length,e.margin??Oe,e.shape),r);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>kl&&(n="H");}return n}function J8(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 ri(e){let{value:t,size:r=ve,level:n=Dt,bgColor:o=Ne,fgColor:i=je,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=Oe,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:y,art:_,eyeColors:b,moduleScale:S,autoLevel:v,shape:x,frameLabelMarkers:w,partMarkers:C,...A}=e,k=Zu({value:t,size:r,margin:f,level:n,shape:x,autoLevel:v,isOGContext:p},m),M=bt(y),T=M?{}:A,L=xe=>M?Iu(xe,{size:r,frame:y,bgColor:o,svgProps:A,markLabels:w}):xe,D=xt({value:t,size:r,level:n,margin:f,imageSettings:k,isOGContext:p,autoLevel:v,shape:x}),B=Le.QrCode.encodeText(t,Ke[D]),z=B.getModules(),j=at(z.length,f,x),te=Ix(t,z.length,f,x),U=(xe,ct)=>Sg(C,xe,ct),Y=(xe,ct)=>{let Ft=bg(x,xe);return Ft?"circle"in Ft?I("circle",{cx:$(xe/2),cy:$(xe/2),...ct,r:$(xe/2),...U("background")}):I("path",{d:Ft.path,...ct,...U("background")}):I("rect",{...ct,height:xe,width:xe,x:0,y:0,...U("background")})},de=z.length+j*2,Te=Dr(z,r,j,k),$e=null;if(k!=null&&Te!=null){Te.excavation!=null&&(z=Tg(z,Te.excavation));let{imgWidth:xe,imgHeight:ct,imgLeft:Ft,imgTop:Gn}=J8(Te,r,de,j);if(p){let Un=k.shape??"square";$e=I("img",{alt:"Logo",src:k.src,style:{position:"absolute",left:`${$(Ft)}px`,top:`${$(Gn)}px`,width:`${$(xe)}px`,height:`${$(ct)}px`,...Un!=="square"&&{borderRadius:Un==="circle"?"50%":`${$(Math.min(xe,ct)*zu)}px`},...k.plate&&{backgroundColor:k.plate,padding:`${$(xe*Ou)}px`,boxSizing:"border-box"}}});}else $e=Fu(k,{x:Ft,y:Gn,w:xe,h:ct}),C&&($e=Bo($e,U("logo")));}let Z=r/de,K=z.length,J=7*Z,Ve=1.5*Z,Vr={fgColor:ze(i,je),bgColor:ze(o,Ne)},gt=V0(_)?H0({art:_,modules:z,version:B.version,margin:j,pixelSize:Z,...Vr,body:xe=>Mg(xe,{margin:j,pixelSize:Z,pattern:c,scale:S})}):null,Kt=gt&&C?Bo(gt,U("body")):gt,jr=gt&&_?K0({art:_,version:B.version,...Vr}):null,W=gt?null:Mg(z,{margin:j,pixelSize:Z,pattern:c,scale:S}),ye=te?Mg(te,{margin:0,pixelSize:Z,pattern:c,scale:S,plain:true}):null,ie=$t(o,Ne),Re=$t(i,je),ui=Qu(ie)?Ig(ie,r,"bg-color"):null,fl=Qu(Re)?Ig(Re,r,"fg-color"):null,u4=mr(o,ui?.id??null,Ne),x1=mr(i,fl?.id??null,je),$1=Kt?Qe(Wt,{children:[Kt,ye&&I("g",{...x1,...U("body"),children:ye})]}):Qe("g",{...x1,...U("body"),children:[W,ye]}),Tn=j*Z,Ln=j*Z,Nn=(K-7+j)*Z,zn=j*Z,On=j*Z,Fn=(K-7+j)*Z,qr=ze(i,je),Dn=xe=>b?.[xe]?.outer??jr?.[xe]?.outer??s,Zn=xe=>b?.[xe]?.inner??jr?.[xe]?.inner??a,Bn=(xe,ct,Ft,Gn,Un)=>{let _l=$t(xe,qr);return Qu(_l)?K8(_l,ct,Ft,J,Gn,Un,r):null},ml=Bn(Dn("topLeft"),Tn,Ln,"top-left","corners-square-color-0-0"),pl=Bn(Dn("topRight"),Nn,zn,"top-right","corners-square-color-1-0"),dl=Bn(Dn("bottomLeft"),On,Fn,"bottom-left","corners-square-color-0-1"),hl=Bn(Zn("topLeft"),Tn,Ln,"top-left","corners-dot-color-0-0"),gl=Bn(Zn("topRight"),Nn,zn,"top-right","corners-dot-color-1-0"),yl=Bn(Zn("bottomLeft"),On,Fn,"bottom-left","corners-dot-color-0-1"),w1=mr(Dn("topLeft"),ml?.id??null,qr),S1=mr(Dn("topRight"),pl?.id??null,qr),v1=mr(Dn("bottomLeft"),dl?.id??null,qr),C1=mr(Zn("topLeft"),hl?.id??null,qr),E1=mr(Zn("topRight"),gl?.id??null,qr),A1=mr(Zn("bottomLeft"),yl?.id??null,qr),P1=Nu(Tn,Ln,J,u,"top-left"),k1=Lu(Tn+J/2,Ln+J/2,Ve,l,"top-left"),R1=Nu(Nn,zn,J,u,"top-right"),M1=Lu(Nn+J/2,zn+J/2,Ve,l,"top-right"),I1=Nu(On,Fn,J,u,"bottom-left"),T1=Lu(On+J/2,Fn+J/2,Ve,l,"bottom-left"),l4=Qe(Wt,{children:[I("defs",{children:R$([ui,fl,ml,pl,dl,hl,gl,yl])}),Y(r,u4),$1,I("g",{...w1,...U("eye-outer","top-left"),children:I("path",{d:P1,fillRule:"evenodd",transform:R`rotate(0,${Tn+J/2},${Ln+J/2})`})}),I("g",{...C1,...U("eye-centre","top-left"),children:k1}),I("g",{...S1,...U("eye-outer","top-right"),children:I("path",{d:R1,fillRule:"evenodd",transform:R`rotate(0,${Nn+J/2},${zn+J/2})`})}),I("g",{...E1,...U("eye-centre","top-right"),children:M1}),I("g",{...v1,...U("eye-outer","bottom-left"),children:I("path",{d:I1,fillRule:"evenodd",transform:R`rotate(0,${On+J/2},${Fn+J/2})`})}),I("g",{...A1,...U("eye-centre","bottom-left"),children:T1}),$e]}),L1=d||(h?Bu(h):void 0);if(L1){let ct=Qu(ie)?Ig(ie,300,"bg-color-template"):null,Ft=mr(o,ct?.id??null,Ne),Gn=Qe("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[I("defs",{children:R$([ct,fl,ml,pl,dl,hl,gl,yl])}),Y(300,Ft),Qe("g",{transform:`scale(${$(300/r,6)})`,children:[$1,I("g",{...w1,...U("eye-outer","top-left"),children:I("path",{d:P1,fillRule:"evenodd",transform:R`rotate(0,${Tn+J/2},${Ln+J/2})`})}),I("g",{...C1,...U("eye-centre","top-left"),children:k1}),I("g",{...S1,...U("eye-outer","top-right"),children:I("path",{d:R1,fillRule:"evenodd",transform:R`rotate(0,${Nn+J/2},${zn+J/2})`})}),I("g",{...E1,...U("eye-centre","top-right"),children:M1}),I("g",{...v1,...U("eye-outer","bottom-left"),children:I("path",{d:I1,fillRule:"evenodd",transform:R`rotate(0,${On+J/2},${Fn+J/2})`})}),I("g",{...A1,...U("eye-centre","bottom-left"),children:T1}),$e]})]}),Un=300/r,f4={pixelSize:Z*Un,url:t},N1=L1.wrapper(Gn,{fgColor:i,bgColor:o,...g||{},...A},f4),m4={...N1?.props?.style||{},width:void 0,height:void 0,...T.style};return L(Bo(N1,{...T,width:r,height:r,style:m4}))}return L(I("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...T,children:l4}))}var EI=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),AI=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},ti=(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},M$=e=>{let t=Ae(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)}},PI=(e,t)=>{let r=M$(e),n=M$(t);if(!(r&&n))return 1;let o=ti(r.r,r.g,r.b),i=ti(n.r,n.g,n.b),s=Math.max(o,i),a=Math.min(o,i);return (s+.05)/(a+.05)},kI=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 eC=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"]]),tC=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"]]),rC=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),nC=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"]),oC=new Set(["autoFocus","multiple","muted"]),iC=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),sC=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(" ")),z$=":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",aC=new RegExp(`^[${z$}][${z$}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),ju=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,cC=/^[\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,uC="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",lC=e=>cC.test(e)?uC:e,F$=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),fC=/["'&<>]/;function Ng(e){if(!fC.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=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}t+=e.slice(r,n)+o,r=n+1;}return t+e.slice(r)}var pr=e=>typeof e=="function"||typeof e=="symbol",O$=new Map,mC=e=>{let t=O$.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),O$.set(e,t)),t};function pC(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||sC.has(r)?`${n}`:`${n}px`:`${n}`.trim();o=`${mC(r)}:${i}`;}t=t?`${t};${o}`:o;}return t}function ni(e,t){if(t==null||rC.has(e))return null;let r=tC.get(e);if(r!==void 0)return pr(t)||typeof t=="boolean"?null:{name:r,value:`${t}`};switch(e){case "style":{let o=pC(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||pr(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:lC(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||pr(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return pr(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return pr(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(oC.has(e))return t&&!pr(t)?{name:e.toLowerCase(),value:""}:null;if(iC.has(e))return pr(t)?null:{name:e,value:`${t}`};if(nC.has(e))return t&&!pr(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=eC.get(e)??e;if(!aC.test(n)||pr(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 D$="http://www.w3.org/2000/svg",Z$="http://www.w3.org/1999/xhtml",dC="http://www.w3.org/1999/xlink",hC="http://www.w3.org/XML/1998/namespace",gC="http://www.w3.org/2000/xmlns/";function yC(e,t,r){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(gC,t,r):t.startsWith("xlink:")?e.setAttributeNS(dC,t,r):t.startsWith("xml:")?e.setAttributeNS(hC,t,r):e.setAttribute(t,r);}function Fs(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)Fs(e,c,r,n);return}if(!bn(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(Go(o)){Fs(e,i.children,r,n);return}if(typeof o=="function"){Fs(e,o(i),r,n);return}if(!ju.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?D$:r,a=n.createElementNS(s,o);for(let c of Object.keys(i)){let u=ni(c,i[c]);u&&yC(a,u.name,u.value);}Fs(a,i.children,s===D$&&o==="foreignObject"?Z$:s,n),e.appendChild(a);}function Ds(e,t=document){let r=t.createDocumentFragment();return Fs(r,e,Z$,t),r}function Xt(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return Ng(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let r of e)t+=Xt(r);return t}if(!bn(e))throw new TypeError("qrdx: can't render this value as SVG markup");return _C(e)}function _C(e){let{type:t,props:r}=e;if(Go(t))return Xt(r.children);if(typeof t=="function")return Xt(t(r));if(!ju.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let n=`<${t}`;for(let s of Object.keys(r)){let a=ni(s,r[s]);a&&(n+=` ${a.name}="${Ng(a.value)}"`);}if(F$.has(t))return `${n}/>`;let o=r.dangerouslySetInnerHTML?.__html,i=o==null?Xt(r.children):`${o}`;return `${n}>${i}</${t}>`}function zg(e){return Xt(ri(e))}function bC(e,t=document){return Ds(ri(e),t).firstChild}var xC=16384;var Og=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],$C=8,Fg=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 j$(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),y=m(d);s[d]=s[g]+s[y],a[g]=d,a[y]=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 wC(e,t){let r=0;for(let n=0;n<t;n++)r=r<<1|e>>n&1;return r}function q$(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]=wC(u,a),s[c]=r===1?0:a;}),{lengths:e,codes:i,emitted:s}}function Mn(e,t,r){e.write(t.codes[r],t.emitted[r]);}function SC(e){let t=[],r=i=>t.push({code:i,extra:0,extraBits:0}),n=$C,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 vC(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=SC(t),o=new Uint32Array(19);for(let a of n)o[a.code]=o[a.code]+1;let i=q$(j$(o,7)),s=Og.length;for(;s>4&&i.lengths[Og[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[Og[a]],3);e.write(0,1);for(let a of n)Mn(e,i,a.code),e.write(a.extra,a.extraBits);}function qu(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 B$(e,t,r,n){let o=0;for(;o<n&&e[t+o]===e[t+o-r];)o++;return o}function G$(e,t,r){let n=e.length,o=0;for(;o<n;){let i=Math.min(4096,n-o),s=o>=1?B$(e,o,1,i):0,a=o>=t?B$(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 U$=20;function Q$(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n);}function V$(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 Zg(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 v=0;v<n;v++){let x=v*4,w=e[x],C=e[x+1],A=e[x+2],k=e[x+3];k!==255&&(i=true),o[v]=(k<<24|(w-C&255)<<16|C<<8|A-C&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);G$(o,t,{literal(v){s[v>>>8&255]++,a[v>>>16&255]++,c[v&255]++,u[v>>>24]++;},copy(v,x){s[256+qu(v).symbol]++,l[qu(x).symbol]++;}});let f=[s,a,c,u,l].map(v=>j$(v,15)),[p,m,h,d,g]=f.map(q$),y=new Fg(Math.ceil(n/4)+1024);y.write(47,8),y.write(t-1,14),y.write(r-1,14),y.write(i?1:0,1),y.write(0,3),y.write(1,1),y.write(2,2),y.write(0,1),y.write(0,1),y.write(0,1);for(let v of f)vC(y,v);G$(o,t,{literal(v){Mn(y,p,v>>>8&255),Mn(y,m,v>>>16&255),Mn(y,h,v&255),Mn(y,d,v>>>24);},copy(v,x){let w=qu(v);Mn(y,p,256+w.symbol),y.write(w.extra,w.extraBits);let C=qu(x);Mn(y,g,C.symbol),y.write(C.extra,C.extraBits);}});let _=y.finish(),b=_.length+(_.length&1),S=new Uint8Array(U$+b);return Q$(S,0,"RIFF"),V$(S,4,S.length-8),Q$(S,8,"WEBPVP8L"),V$(S,16,_.length),S.set(_,U$),S}function Dg(e,t,r){return String.fromCharCode(...e.subarray(t,t+r))}function W$(e){return e.length>=12&&Dg(e,0,4)==="RIFF"&&Dg(e,8,4)==="WEBP"}function Bg(e){if(!W$(e))return null;let t=12;for(;t+8<=e.length;){let r=Dg(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 CC(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 Wu(e,t={}){let r=t.quality!==void 0,n=r?Math.min(1,Math.max(0,Number(t.quality))):1,o=await CC(e,"image/webp",n);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=Bg(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=Zg(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var H$=32768;async function Zs(e){let t=new Uint8Array(await e.arrayBuffer()),r="";for(let n=0;n<t.length;n+=H$)r+=String.fromCharCode(...t.subarray(n,n+H$));return `data:${e.type||"application/octet-stream"};base64,${btoa(r)}`}async function Nt(e){let t={...e};if(e.imageSettings?.src)try{let l=await EC(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=zg({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var EC=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 oi(e,t,r){let n=await Nt(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}=ur(e.size||ve,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")Wu(c).then(Zs).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 X$=["gradientUnits","gradientTransform","spreadMethod"],AC={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},PC={r:0,g:0,b:0,a:1};function Y$(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 Gg(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function kC(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=Y$(n,"stop-color")??"#000000",c=Ae(a==="currentColor"?"#000000":a)??PC,u=Number.parseFloat(Y$(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 Hu(e){let t=new Map,r=o=>{let i=o.attrs.id;Gg(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=Gg(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=Gg(l)===s?[...X$,...AC[s]]:X$;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=kC(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 Ug(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),y=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-y/g];let _=g*g-4*d*y;if(_<0)return [];let b=Math.sqrt(_);return [(-g+b)/(2*d),(-g-b)/(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 RC=e=>e[0]*e[3]-e[1]*e[2];function Br(e){let t=RC(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 J$(e,t,r){let{kind:n,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every(x=>x.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=Yn;if(!c){let x=Ug(t);if(!x||x.width<=0||x.height<=0)return null;u=[x.width,0,0,x.height,x.x,x.y];}let l=Se(u,St(o.gradientTransform));if(!Br(l))return a.color;let[f,p]=r,m=Math.sqrt((f*f+p*p)/2),h=(x,w)=>{let C=Number.parseFloat(x);return Number.isFinite(C)?x.trim().endsWith("%")?C/100*(c?w:1):C:null},d=(x,w,C)=>h(o[x]??w,C)??h(w,C)??0;if(n==="linear"){let x=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[w,C,A,k]=x;return w===A&&C===k?a.color:{kind:n,coords:x,matrix:l,stops:i}}let g=d("cx","50%",f),y=d("cy","50%",p),_=d("r","50%",m),b=o.fx===void 0?g:d("fx","50%",f),S=o.fy===void 0?y:d("fy","50%",p),v=Math.max(0,d("fr","0%",m));return _<0?null:_===0?a.color:{kind:n,coords:[b,S,v,g,y,_],matrix:l,stops:i}}function Xu(e){return e.map(t=>$(t,6)).join(" ")}function MC(e,t){return (t==="cmyk"?Lr(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(n=>$(n,4)).join(" ")}var K$=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function IC(e,t){let r=[],n=e.map(a=>se(a.offset,4)),o=e.map(a=>MC(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 K$(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${r.map(a=>K$(a.c0,a.c1)).join(" ")}]`,`/Bounds [${r.slice(1).map(a=>$(a.from,4)).join(" ")}]`,`/Encode [${r.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Yu(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(r=>$(r,6)).join(" ")}]`,`/Function ${IC(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function TC(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}}var e5={r:255,g:255,b:255,a:1},LC=/^url\(\s*#bg-color-/,Ku=/^url\(\s*#([^)\s]+)\s*\)/,NC=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function ue(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 oe(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 Bs(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let r=e.children.find(o=>o.name==="stop"),n=r&&(ue(r,"stop-color")??"#000000");n&&t.set(e.attrs.id,n);}for(let r of e.children)Bs(r,t);return t}function Gs(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)Gs(r,t);return t}function Ju(e){return /^data:image\/png[;,]/i.test(e)?"PNG":/^data:image\/jpe?g[;,]/i.test(e)?"JPEG":null}async function el(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 t5(e,t,r){let n={x:oe(e.attrs.x,t[0]),y:oe(e.attrs.y,t[1]),width:oe(e.attrs.width,t[0]),height:oe(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 r5(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)r5(r,t);return t}function n5(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)n5(r,t);return t}function zC(e,t){let[r,n]=t,o=(i,s)=>oe(e.attrs[i],s);switch(e.name){case "path":return Jt(e.attrs.d??"");case "rect":{let i=e.attrs.rx??e.attrs.ry,s=e.attrs.ry??e.attrs.rx;return Ut(o("x",r),o("y",n),o("width",r),o("height",n),oe(i,r),oe(s,n))}case "circle":{let i=o("r",Math.hypot(r,n)/Math.SQRT2);return Gt(o("cx",r),o("cy",n),i,i)}case "ellipse":return Gt(o("cx",r),o("cy",n),o("rx",r),o("ry",n));default:return []}}var ii=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=e5;paper=e5;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=Ku.exec(t);if(r)return this.resolveColor(this.gradients.get(r[1]));let n=Ae(t==="currentColor"?"#000000":t);return n&&n.a>0?n:null}shadedGradient(t){let r=t?Ku.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=J$(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?Ku.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 Uu(t,this.onPaper||n?this.paper:this.backdrop)}paintPattern(t,r,n,o){let i=Ug(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=r.viewport,c=oe(n.attrs.x,s),u=oe(n.attrs.y,a),l=oe(n.attrs.width,s),f=oe(n.attrs.height,a);if(!(l>0&&f>0))return true;let p=St(n.attrs.patternTransform),m=Br(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(([L])=>L),y=d.map(([,L])=>L),_=Math.min(...g),b=Math.max(...g),S=Math.min(...y),v=Math.max(...y),x=Math.floor((_-c)/l),w=Math.ceil((b-c)/l)-1,C=Math.floor((S-u)/f),A=Math.ceil((v-u)/f)-1,k=(w-x+1)*(A-C+1);if(k>4096)return !0;let M=(n.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),T=Se(r.matrix,p);for(let L=C;L<=A;L++)for(let D=x;D<=w;D++){let B=c+D*l,z=u+L*f,j=Se(T,[1,0,0,1,B,z]),te={x:_-B,y:S-z,width:b-_,height:v-S},U=M.length===2&&M.every(Number.isFinite)?P$(M[0],M[1],te):null,Y=k>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"}],j,!1);try{let de={matrix:j,viewport:r.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},Te=($e,Z)=>{for(let K of $e){if(K.name==="g"&&!K.attrs.transform){let J=Number.parseFloat(K.attrs.opacity??"1");Te(K.children,{...Z,opacity:(Z.opacity??1)*(Number.isFinite(J)?J:1)});continue}if(U&&K.attrs["data-arc"]){let[J,Ve]=K.attrs["data-arc"].split(/\s+/).map(Number);if(!k$([J,J+Ve],U))continue}this.walk(K,Z);}};Te(n.children,de);}finally{Y&&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:Se(r.matrix,St(t.attrs.transform))}),a=Br(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=ue(t,"clip-path"),o=n?Ku.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=zC(c,r.viewport);if(u.length===0)continue;let l=St(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=>TC(p,l))),a||=ue(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:r.matrix,evenOdd:a}:null}viewportMatrix(t,r){let n=oe(t.attrs.x,r.viewport[0]),o=oe(t.attrs.y,r.viewport[1]),i=oe(t.attrs.width,r.viewport[0],r.viewport[0]),s=oe(t.attrs.height,r.viewport[1],r.viewport[1]),a=Bt(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [Se(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 [Se(r.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,r,n=false){if(n&&(this.clipPaths=r5(t,new Map),this.patterns=n5(t,new Map)),NC.has(t.name)||ue(t,"display")==="none"||ue(t,"visibility")==="hidden")return;let o=Se(r.matrix,St(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=ue(t,"font-size"),a=Number.parseFloat(ue(t,"opacity")??"1"),c=ue(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:ue(t,"fill")??r.fill,fillRule:ue(t,"fill-rule")??r.fillRule,stroke:ue(t,"stroke")??r.stroke,strokeWidth:ue(t,"stroke-width")===void 0?r.strokeWidth:oe(ue(t,"stroke-width"),i[0],1),fontSize:s===void 0?r.fontSize:oe(s,16,16),fontWeight:ue(t,"font-weight")??r.fontWeight,textAnchor:ue(t,"text-anchor")??r.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&LC.test(ue(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)=>oe(t.attrs[s],a);switch(t.name){case "path":this.paint(Jt(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(Ut(i("x",n),i("y",o),i("width",n),i("height",o),oe(s,n),oe(a,o)),t,r);return}case "circle":{let s=i("r",Math.hypot(n,o)/Math.SQRT2);this.paint(Gt(i("cx",n),i("cy",o),s,s),t,r);return}case "ellipse":this.paint(Gt(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=Bt(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 tl=1e3;async function Us(e){let t=await Nt(In({...e,size:e.size??ve},tl));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function Qg(e){if(bt(e.frame)){let t=Pn(tl,e.frame);return t.squareEdges?t.color:null}return ze(e.bgColor,Ne)}function rl(e,t){let r=Qg(e);if(!(r&&Vn(e.bgColor))||bt(e.frame)||e.templateId||e.customTemplate)return r;let n=yr(t)?.children.find(i=>i.name==="rect"),o=n&&ue(n,"fill");return o?.startsWith("url(")?o:r}function nl(e,t){let r={r:255,g:255,b:255,a:1},n=Ae(ze(t.bgColor,Ne));e.paper=r,e.background=n&&!Vn(t.bgColor)?n:null,e.backdrop=n?Uu(n,r):r;}var ol=25.4,o5=5,i5=2e3,dr=tl,Vg=5,s5=2,FC=.25*(ol/72);function DC(e,t="mm"){return t==="in"?e*ol:e}function ZC(e){let t=xt(e),r=Le.QrCode.encodeText(e.value,Ke[t]).size;return r+at(r,e.margin??Oe,e.shape)*2}function il(e,t){let r=DC(t.size,t.unit);if(!Number.isFinite(r)||r<o5||r>i5)throw new Error(`Print size must be between ${o5} mm and ${i5/1e3} m`);let n=Math.min(Math.max(t.bleed??0,0),20),o=r/dr,i=bt(e.frame)?Pn(dr,e.frame):null,s=(i?.width??dr)*o,a=(i?.height??dr)*o,c=t.cropMarks?n+s5+Vg+1:n,u=ZC(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 jg=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}`);});}},qg=class extends ii{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]=Lr(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=Se(s,Se(r.matrix,n.matrix));if(!(this.shadingResources&&Br(a)))return;let c=this.shadingResources.name(Yu(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(`${Xu(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),u&&(this.setColor("draw",u),this.pdf.setLineWidth(n.strokeWidth*Kn(n.matrix))),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();});}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=Kn(r.matrix),[s,a]=ne(r.matrix,oe(t.attrs.x,r.viewport[0]),oe(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/ol);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&&(Ju(n)?n:this.images.get(n)),i=o&&Ju(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=t5(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 BC(e,t,r){let{trimX:n,trimY:o,trimWidth:i,trimHeight:s,bleed:a}=r,c=a+s5,u=n,l=n+i,f=o,p=o+s;t.setRegistrationColor(),e.setLineWidth(FC);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+Vg),d),e.line(m,d+g*c,m,d+g*(c+Vg));}}}async function GC(e,t){return (await a5(e,t)).output("dataurlstring")}async function RT(e,t){return (await a5(e,t)).output("arraybuffer")}async function a5(e,t){let r=il(e,t),n;try{({jsPDF:n}=await import('jspdf'));}catch(y){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${y})`)}let o=await Us(e),i=yr(o);if(!i)throw new Error("Failed to render the QR code for printing");let s=new Map;for(let y of Gs(i,new Set))if(!Ju(y)){let _=await el(y);_&&s.set(y,_);}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=Hu(i),u=c.size>0?jg.attach(a):null,l=new qg(a,t.colorMode==="cmyk",Bs(i,new Map),u?{gradients:c,resources:u}:null,s);nl(l,e);let f=r.codeWidth/dr,p=oe(i.attrs.width,dr,dr),m=oe(i.attrs.height,dr,dr),h={matrix:Se([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?rl(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 y=d?l.resolveColor(d):null;y&&(l.setColor("fill",y),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&&BC(a,l,r),a}async function UC(e,t){let r=il(e,{size:t.size,unit:t.unit}),n=await Us(e),o=t.unit??"mm",i=c=>`${$(o==="in"?c/ol: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
|
|
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
|
|
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 Wy(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;Wy(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 Hy=new Set(["type","properties","required","additionalProperties"]),jy=["oneOf","anyOf"];function qy(e){let t=e.additionalProperties;return t===void 0||t===false||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function xd(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Hy.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]??qy(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l));}let c=a.length===1?a[0]:xd(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=qy(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 WS(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Hy)if(o in e)return;let r=t.filter(o=>jy.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=xd(t);else {let o=r[0],i=jy.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=>xd([...s,c]));if(a.some(c=>!c))return;n={[i]:a};}n&&(delete e.allOf,Ki(e,n));}function Pr(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)):Ki(u,h),Ki(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())Wy(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)??[])WS(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);}Ki(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:Io(t,"input",e.processors),output:Io(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function rt(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 rt(n.element,r);if(n.type==="set")return rt(n.valueType,r);if(n.type==="lazy")return rt(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 rt(n.innerType,r);if(n.type==="intersection")return rt(n.left,r)||rt(n.right,r);if(n.type==="record"||n.type==="map")return rt(n.keyType,r)||rt(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?true:rt(n.in,r)||rt(n.out,r);if(n.type==="object"){for(let o in n.shape)if(rt(n.shape[o],r))return true;return false}if(n.type==="union"){for(let o of n.options)if(rt(o,r))return true;return false}if(n.type==="tuple"){for(let o of n.items)if(rt(o,r))return true;return !!(n.rest&&rt(n.rest,r))}return false}var $d=(e,t={})=>r=>{let n=Cr({...r,processors:t});return me(e,n),Er(n,e),Pr(n,e)},Io=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Cr({...o??{},target:i,io:t,processors:r});return me(e,s),Er(s,e),Pr(s,e)};var To=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r);},Lo=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r);},Xy=(e,t)=>{To(e,"minimum",t),Lo(e,"maximum",t);},e_=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t);},t_=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t);},r_=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t];},n_=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=true);},Yy=(e,t)=>To(e,"minimum",t.minimum),Ky=(e,t)=>Lo(e,"maximum",t.maximum),Jy=e=>(t,r)=>{n_(t,r.format);let[n,o]=e[r.format];To(t,"minimum",n),Lo(t,"maximum",o);},HS={greater_than:(e,t)=>To(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Lo(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>e_(e,t.value),number_format:Jy($i),bigint_format:Jy(wi),min_length:Yy,max_length:Ky,length_equals:(e,t)=>Xy(e,t.length),min_size:Yy,max_size:Ky,size_equals:(e,t)=>Xy(e,t.size),string_format:(e,t)=>{n_(e,t.format),t.pattern&&t_(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)=>r_(e,t.mime)};function De(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)HS[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&To(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&To(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Lo(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Lo(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&e_(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=true)),o.mime&&r_(t,o.mime);for(let i of o.patterns??[])t_(t,i);return t}var XS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},YS=new Map([[La,Pf],[Di,Af]]),o_=e=>YS.get(e)??e,vd=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=De(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=XS[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(o_);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}))]);}},Cd=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=De(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 y of a)Number.isFinite(y)&&y!==0?h.add(Math.abs(y)):Fe(e,t,o,n,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);let[d,...g]=h;d!==void 0&&(o.multipleOf=d),g.length&&(o.allOf=[...o.allOf??[],...g.map(y=>({multipleOf:y}))]);}},Ed=(e,t,r,n)=>{r.type="boolean";},Pd=(e,t,r,n)=>{Fe(e,t,r,n,"BigInt cannot be represented in JSON Schema");},Ad=(e,t,r,n)=>{Fe(e,t,r,n,"Symbols cannot be represented in JSON Schema");},Rd=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},kd=(e,t,r,n)=>{Fe(e,t,r,n,"Undefined cannot be represented in JSON Schema");},Md=(e,t,r,n)=>{Fe(e,t,r,n,"Void cannot be represented in JSON Schema");},Id=(e,t,r,n)=>{r.not={};},Td=(e,t,r,n)=>{},Ld=(e,t,r,n)=>{},Nd=(e,t,r,n)=>{Fe(e,t,r,n,"Date cannot be represented in JSON Schema");},Od=(e,t,r,n)=>{let o=e._zod.def,i=oo(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;},zd=(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(Fe(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Fe(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;},Fd=(e,t,r,n)=>{Fe(e,t,r,n,"NaN cannot be represented in JSON Schema");},Dd=(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;},Zd=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=De(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})));},Bd=(e,t,r,n)=>{r.type="boolean";},Ud=(e,t,r,n)=>{Fe(e,t,r,n,"Custom types cannot be represented in JSON Schema");},Gd=(e,t,r,n)=>{Fe(e,t,r,n,"Function types cannot be represented in JSON Schema");},Qd=(e,t,r,n)=>{Fe(e,t,r,n,"Transforms cannot be represented in JSON Schema");},Vd=(e,t,r,n)=>{Fe(e,t,r,n,"Map cannot be represented in JSON Schema");},jd=(e,t,r,n)=>{Fe(e,t,r,n,"Set cannot be represented in JSON Schema");},qd=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=De(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=me(i.element,t,{...n,path:[...n.path,"items"]});};function Ji(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Ji(t.out):t.type==="catch"?Ji(t.innerType):e._zod.optin}var Wd=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Fe(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,me(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"?Ji(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=me(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=false);},Rc=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===false,s=o.options.map((a,c)=>me(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s;},Hd=(e,t,r,n)=>{let o=e._zod.def,i=me(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=me(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);},Xd=(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)=>me(d,t,{...n,path:[...n.path,s,g]})),u=i.rest?me(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"?Ji(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}=De(e);typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h);};function wd(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=wd(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(y=>wd(e,y,r));g.some((y,_)=>y!==d[_])&&(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")?rr:Ii).source)),m}var Sd=new WeakMap;function KS(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 Sd.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===true||r.has(i))continue;let s=wd(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 Yd=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=De(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=me(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)qe(o.patternProperties,o_(f).source,l);}else {if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=me(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=Sd.get(t);l||(l=[],Sd.set(t,l),t.deferred.push(()=>KS(t))),l.push(e);}o.additionalProperties=me(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});}let c=s._zod.values,u=t.io==="input"&&Ji(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));}},Kd=(e,t,r,n)=>{let o=e._zod.def,i=me(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"}];},Jd=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},eh=Symbol();function i_(e,t,r,n,o){let i=false,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=true,null));return i?(Fe(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),eh):JSON.parse(s)}var th=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=i_(o.defaultValue,e,t,r,n);s!==eh&&(r.default=s);},rh=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=i_(o.defaultValue,e,t,r,n);s!==eh&&(r._prefault=s);},nh=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0);}catch{Fe(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s;},oh=(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;me(s,t,n);let a=t.seen.get(e);a.ref=s;},ih=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=true;},sh=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},kc=(e,t,r,n)=>{let o=e._zod.def;me(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;},ah=(e,t,r,n)=>{let o=e._zod.innerType;me(o,t,n);let i=t.seen.get(e);i.ref=o;},Ac={string:vd,number:Cd,boolean:Ed,bigint:Pd,symbol:Ad,null:Rd,undefined:kd,void:Md,never:Id,any:Td,unknown:Ld,date:Nd,enum:Od,literal:zd,nan:Fd,template_literal:Dd,file:Zd,success:Bd,custom:Ud,function:Gd,transform:Qd,map:Vd,set:jd,array:qd,object:Wd,union:Rc,intersection:Hd,tuple:Xd,record:Yd,nullable:Kd,nonoptional:Jd,default:th,prefault:rh,catch:nh,pipe:oh,readonly:ih,promise:sh,optional:kc,lazy:ah};function Mc(e,t){if("_idmap"in e){let n=e,o=Cr({...t,processors:Ac}),i={};for(let c of n._idmap.entries()){let[u,l]=c;me(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;Er(o,l),qe(s,u,Pr(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=Cr({...t,processors:Ac});return me(e,r),Er(r,e),Pr(r,e)}var Ic=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=Cr({processors:Ac,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 me(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,Er(this.ctx,t);let n=Pr(this.ctx,t),{"~standard":o,...i}=n;return i}};var s_={};var Uo={};hr(Uo,{ZodAny:()=>Rh,ZodArray:()=>Th,ZodBase64:()=>Yc,ZodBase64URL:()=>Kc,ZodBigInt:()=>Zo,ZodBigIntFormat:()=>tu,ZodBoolean:()=>Do,ZodCIDRv4:()=>Hc,ZodCIDRv6:()=>Xc,ZodCUID:()=>Uc,ZodCUID2:()=>Gc,ZodCatch:()=>e0,ZodCodec:()=>us,ZodCreditCard:()=>$h,ZodCustom:()=>ls,ZodCustomStringFormat:()=>yn,ZodDate:()=>ns,ZodDefault:()=>Wh,ZodDiscriminatedUnion:()=>Nh,ZodE164:()=>Jc,ZodEmail:()=>Fc,ZodEmoji:()=>Zc,ZodEnum:()=>Oo,ZodExactOptional:()=>iu,ZodFile:()=>Qh,ZodFunction:()=>l0,ZodGUID:()=>Dc,ZodIBAN:()=>wh,ZodIPv4:()=>qc,ZodIPv6:()=>Wc,ZodISODate:()=>Rr,ZodISODateTime:()=>Ar,ZodISODuration:()=>Mr,ZodISOTime:()=>kr,ZodInstanceOf:()=>p0,ZodIntersection:()=>Oh,ZodJWT:()=>eu,ZodKSUID:()=>jc,ZodLazy:()=>a0,ZodLiteral:()=>Gh,ZodMAC:()=>xh,ZodMap:()=>Bh,ZodNaN:()=>r0,ZodNanoID:()=>Bc,ZodNever:()=>Mh,ZodNonOptional:()=>su,ZodNull:()=>Ph,ZodNullable:()=>qh,ZodNumber:()=>Fo,ZodNumberFormat:()=>_n,ZodObject:()=>is,ZodOptional:()=>as,ZodPipe:()=>cs,ZodPrefault:()=>Xh,ZodPreprocess:()=>n0,ZodPromise:()=>u0,ZodReadonly:()=>o0,ZodRecord:()=>No,ZodSet:()=>Uh,ZodString:()=>zo,ZodStringFormat:()=>he,ZodSuccess:()=>Jh,ZodSymbol:()=>Ch,ZodTemplateLiteral:()=>s0,ZodTransform:()=>Vh,ZodTuple:()=>Fh,ZodType:()=>H,ZodULID:()=>Qc,ZodURL:()=>rs,ZodUUID:()=>Wt,ZodUndefined:()=>Eh,ZodUnion:()=>ss,ZodUnknown:()=>kh,ZodVoid:()=>Ih,ZodXID:()=>Vc,ZodXor:()=>Lh,_ZodString:()=>zc,_default:()=>Hh,_function:()=>bb,any:()=>X_,array:()=>os,base64:()=>k_,base64url:()=>M_,bigint:()=>V_,boolean:()=>vh,catch:()=>t0,check:()=>xb,cidrv4:()=>A_,cidrv6:()=>R_,codec:()=>hb,creditCard:()=>T_,cuid:()=>x_,cuid2:()=>$_,currencyCode:()=>D_,custom:()=>$b,date:()=>K_,describe:()=>wb,discriminatedUnion:()=>ob,e164:()=>I_,email:()=>l_,emoji:()=>__,enum:()=>nu,exactOptional:()=>jh,file:()=>fb,float32:()=>B_,float64:()=>U_,function:()=>bb,guid:()=>f_,hash:()=>Z_,hex:()=>F_,hostname:()=>z_,httpUrl:()=>y_,iban:()=>L_,instanceof:()=>vb,int:()=>Nc,int32:()=>G_,int64:()=>j_,intersection:()=>zh,invertCodec:()=>gb,ipv4:()=>C_,ipv6:()=>P_,json:()=>Eb,jwt:()=>N_,keyof:()=>J_,ksuid:()=>v_,lazy:()=>c0,literal:()=>lb,looseObject:()=>rb,looseRecord:()=>sb,mac:()=>E_,map:()=>ab,meta:()=>Sb,nan:()=>db,nanoid:()=>b_,nativeEnum:()=>ub,never:()=>ru,nonoptional:()=>Kh,null:()=>Ah,nullable:()=>ts,nullish:()=>mb,number:()=>Sh,object:()=>eb,optional:()=>hn,partialRecord:()=>ib,pipe:()=>Oc,prefault:()=>Yh,preprocess:()=>Pb,promise:()=>_b,readonly:()=>i0,record:()=>Zh,refine:()=>f0,set:()=>cb,strictObject:()=>tb,string:()=>es,stringFormat:()=>O_,stringbool:()=>Cb,success:()=>pb,superRefine:()=>m0,symbol:()=>W_,templateLiteral:()=>yb,transform:()=>ou,tuple:()=>Dh,uint32:()=>Q_,uint64:()=>q_,ulid:()=>w_,undefined:()=>H_,union:()=>Bo,unknown:()=>dn,url:()=>g_,uuid:()=>m_,uuidv4:()=>p_,uuidv6:()=>d_,uuidv7:()=>h_,void:()=>Y_,xid:()=>S_,xor:()=>nb});var e6=()=>{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=Kl(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 ${ia(i.values[0])}`:`Invalid option: expected one of ${ra(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":""}: ${ra(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 a_(){return {localeError:e6()}}var Tc={};hr(Tc,{endsWith:()=>vo,gt:()=>jt,gte:()=>_t,includes:()=>wo,length:()=>mn,lowercase:()=>xo,lt:()=>Vt,lte:()=>yt,maxLength:()=>fn,maxSize:()=>vr,mime:()=>Eo,minLength:()=>nr,minSize:()=>qt,multipleOf:()=>Sr,negative:()=>vc,nonnegative:()=>Ec,nonpositive:()=>Cc,normalize:()=>Po,overwrite:()=>Tt,positive:()=>Sc,properties:()=>Co,property:()=>Pc,regex:()=>bo,size:()=>ln,slugify:()=>Mo,startsWith:()=>So,toLowerCase:()=>Ro,toUpperCase:()=>ko,trim:()=>Ao,uppercase:()=>$o});var c_=new WeakSet([Object.prototype,Error.prototype]);function Lc(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 u_=(e,t)=>{af.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);c_.has(r)||(c_.add(r),Lc(r,"format",n=>o=>Ai(n,o)),Lc(r,"flatten",n=>o=>Pi(n,o)),Lc(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,io,2);}),Lc(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,io,2);}),Object.defineProperty(r,"isEmpty",{configurable:true,enumerable:false,get(){return this.issues.length===0}}));},t6=E("ZodError",u_),dt=E("ZodError",u_,void 0,{Parent:Error});var ch=lo(dt),uh=fo(dt),lh=mo(dt),fh=po(dt),mh=fa(dt),ph=ma(dt),dh=pa(dt),hh=da(dt),gh=ha(dt),yh=ga(dt),_h=ya(dt),bh=_a(dt);function n6(){Ge.localeError||Ae(a_());}function gn(){Ge.memoizer||Ae({memoizer:ji()});}var H=E("ZodType",(e,t)=>(n6(),q.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(F.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 le(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(f0(e,t))},superRefine(e,t){return this.check(m0(e,t))},overwrite(e){return this.check(Tt(e))},optional(){return hn(this)},exactOptional(){return jh(this)},nullable(){return ts(this)},nullish(){return hn(ts(this))},nonoptional(e){return Kh(this,e)},array(){return os(this)},or(e){return Bo([this,e])},and(e){return zh(this,e)},transform(e){return Oc(this,ou(e))},default(e){return Hh(this,e)},prefault(e){return Yh(this,e)},catch(e){return t0(this,e)},pipe(e){return Oc(this,e)},readonly(){return i0(this)},describe(e){let t=this.clone();return We.add(t,{description:e}),t},meta(...e){if(e.length===0)return We.get(this);let t=this.clone();return We.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 F.hide(this,"~standard",{...Ra(this),jsonSchema:{input:Io(this,"input"),output:Io(this,"output")}})},set"~standard"(e){F.own(this,"~standard",e);},parse:function e(t,r){return ch(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await uh(this,t,r,{callee:e})},safeParse(e,t){return lh(this,e,t)},async safeParseAsync(e,t){return fh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){F.own(this,"spa",e);},validate(e,t){return Ri(this,e,t)},validateAsync(e,t){return ki(this,e,t)},encode:function e(t,r){return mh(this,t,r,{callee:e})},decode:function e(t,r){return ph(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await dh(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await hh(this,t,r,{callee:e})},safeEncode(e,t){return gh(this,e,t)},safeDecode(e,t){return yh(this,e,t)},async safeEncodeAsync(e,t){return _h(this,e,t)},async safeDecodeAsync(e,t){return bh(this,e,t)},toJSONSchema(e){return $d(this,{})(e)},get description(){return We.get(this)?.description},get _def(){return this._zod.def}}),zc=E("_ZodString",(e,t)=>{sn.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vd(e,r,n);},F.derived({format:e=>De(e).format??null,minLength:e=>De(e).minimum??null,maxLength:e=>De(e).maximum??null},{regex(...e){return this.check(bo(...e))},includes(...e){return this.check(wo(...e))},startsWith(...e){return this.check(So(...e))},endsWith(...e){return this.check(vo(...e))},min(...e){return this.check(nr(...e))},max(...e){return this.check(fn(...e))},length(...e){return this.check(mn(...e))},nonempty(...e){return this.check(nr(1,...e))},lowercase(e){return this.check(xo(e))},uppercase(e){return this.check($o(e))},trim(){return this.check(Ao())},normalize(...e){return this.check(Po(...e))},toLowerCase(){return this.check(Ro())},toUpperCase(){return this.check(ko())},slugify(){return this.check(Mo())}})),zo=E("ZodString",(e,t)=>{sn.init(e,t),zc.init(e,t);},{email(e){return this.check(rc(Fc,e))},url(e){return this.check(qi(rs,e))},jwt(e){return this.check(wc(eu,e))},emoji(e){return this.check(cc(Zc,e))},guid(e){return this.check(nc(Dc,e))},uuid(e){return this.check(oc(Wt,e))},uuidv4(e){return this.check(ic(Wt,e))},uuidv6(e){return this.check(sc(Wt,e))},uuidv7(e){return this.check(ac(Wt,e))},nanoid(e){return this.check(uc(Bc,e))},cuid(e){return this.check(lc(Uc,e))},cuid2(e){return this.check(fc(Gc,e))},ulid(e){return this.check(mc(Qc,e))},base64(e){return this.check(bc(Yc,e))},base64url(e){return this.check(xc(Kc,e))},xid(e){return this.check(pc(Vc,e))},ksuid(e){return this.check(dc(jc,e))},ipv4(e){return this.check(hc(qc,e))},ipv6(e){return this.check(gc(Wc,e))},cidrv4(e){return this.check(yc(Hc,e))},cidrv6(e){return this.check(_c(Xc,e))},e164(e){return this.check($c(Jc,e))},datetime(e){return this.check(Wi(Ar,e))},date(e){return this.check(Hi(Rr,e))},time(e){return this.check(Xi(kr,e))},duration(e){return this.check(Yi(Mr,e))}});function es(e){return zp(zo,e)}var he=E("ZodStringFormat",(e,t)=>{fe.init(e,t),zc.init(e,t);}),Ar=E("ZodISODateTime",(e,t)=>{Pm.init(e,t),he.init(e,t);}),Rr=E("ZodISODate",(e,t)=>{Am.init(e,t),he.init(e,t);}),kr=E("ZodISOTime",(e,t)=>{Rm.init(e,t),he.init(e,t);}),Mr=E("ZodISODuration",(e,t)=>{km.init(e,t),he.init(e,t);}),Fc=E("ZodEmail",(e,t)=>{gm.init(e,t),he.init(e,t);});function l_(e){return rc(Fc,e)}var Dc=E("ZodGUID",(e,t)=>{dm.init(e,t),he.init(e,t);});function f_(e){return nc(Dc,e)}var Wt=E("ZodUUID",(e,t)=>{hm.init(e,t),he.init(e,t);});function m_(e){return oc(Wt,e)}function p_(e){return ic(Wt,e)}function d_(e){return sc(Wt,e)}function h_(e){return ac(Wt,e)}var rs=E("ZodURL",(e,t)=>{bm.init(e,t),he.init(e,t);});function g_(e){return qi(rs,e)}function y_(e){return qi(rs,{protocol:Mi,hostname:kf,...F.normalizeParams(e)})}var Zc=E("ZodEmoji",(e,t)=>{xm.init(e,t),he.init(e,t);});function __(e){return cc(Zc,e)}var Bc=E("ZodNanoID",(e,t)=>{$m.init(e,t),he.init(e,t);});function b_(e){return uc(Bc,e)}var Uc=E("ZodCUID",(e,t)=>{wm.init(e,t),he.init(e,t);});function x_(e){return lc(Uc,e)}var Gc=E("ZodCUID2",(e,t)=>{Sm.init(e,t),he.init(e,t);});function $_(e){return fc(Gc,e)}var Qc=E("ZodULID",(e,t)=>{vm.init(e,t),he.init(e,t);});function w_(e){return mc(Qc,e)}var Vc=E("ZodXID",(e,t)=>{Cm.init(e,t),he.init(e,t);});function S_(e){return pc(Vc,e)}var jc=E("ZodKSUID",(e,t)=>{Em.init(e,t),he.init(e,t);});function v_(e){return dc(jc,e)}var qc=E("ZodIPv4",(e,t)=>{Mm.init(e,t),he.init(e,t);});function C_(e){return hc(qc,e)}var xh=E("ZodMAC",(e,t)=>{Tm.init(e,t),he.init(e,t);});function E_(e){return Dp(xh,e)}var Wc=E("ZodIPv6",(e,t)=>{Im.init(e,t),he.init(e,t);});function P_(e){return gc(Wc,e)}var Hc=E("ZodCIDRv4",(e,t)=>{Lm.init(e,t),he.init(e,t);});function A_(e){return yc(Hc,e)}var Xc=E("ZodCIDRv6",(e,t)=>{Nm.init(e,t),he.init(e,t);});function R_(e){return _c(Xc,e)}var Yc=E("ZodBase64",(e,t)=>{Om.init(e,t),he.init(e,t);});function k_(e){return bc(Yc,e)}var Kc=E("ZodBase64URL",(e,t)=>{zm.init(e,t),he.init(e,t);});function M_(e){return xc(Kc,e)}var Jc=E("ZodE164",(e,t)=>{Fm.init(e,t),he.init(e,t);});function I_(e){return $c(Jc,e)}var $h=E("ZodCreditCard",(e,t)=>{Dm.init(e,t),he.init(e,t);});function T_(e){return Zp($h,e)}var wh=E("ZodIBAN",(e,t)=>{Zm.init(e,t),he.init(e,t);});function L_(e){return Bp(wh,e)}var eu=E("ZodJWT",(e,t)=>{Bm.init(e,t),he.init(e,t);});function N_(e){return wc(eu,e)}var yn=E("ZodCustomStringFormat",(e,t)=>{Um.init(e,t),he.init(e,t);});function O_(e,t,r={}){return pn(yn,e,t,r)}function z_(e){return pn(yn,"hostname",Rf,e)}function F_(e){return pn(yn,"hex",Qf,e)}function D_(e){return pn(yn,"currency_code",If,e)}function Z_(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=Et[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return pn(yn,n,o,t)}var Fo=E("ZodNumber",(e,t)=>{Da.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cd(e,r,n,o),e.isFinite=true;},F.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=De(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=De(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=De(e);return !!t||!!r?.some(Number.isSafeInteger)},format:e=>De(e).format??null},{gt(e,t){return this.check(jt(e,t))},gte(e,t){return this.check(_t(e,t))},min(e,t){return this.check(_t(e,t))},lt(e,t){return this.check(Vt(e,t))},lte(e,t){return this.check(yt(e,t))},max(e,t){return this.check(yt(e,t))},int(e){return this.check(Nc(e))},safe(e){return this.check(Nc(e))},positive(e){return this.check(jt(0,e))},nonnegative(e){return this.check(_t(0,e))},negative(e){return this.check(Vt(0,e))},nonpositive(e){return this.check(yt(0,e))},multipleOf(e,t){return this.check(Sr(e,t))},step(e,t){return this.check(Sr(e,t))},finite(){return this}}));function Sh(e){return Gp(Fo,e)}var _n=E("ZodNumberFormat",(e,t)=>{Gm.init(e,t),Fo.init(e,t);});function Nc(e){return Vp(_n,e)}function B_(e){return jp(_n,e)}function U_(e){return qp(_n,e)}function G_(e){return Wp(_n,e)}function Q_(e){return Hp(_n,e)}var Do=E("ZodBoolean",(e,t)=>{Zi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ed(e,r,n);});function vh(e){return Xp(Do,e)}var Zo=E("ZodBigInt",(e,t)=>{Za.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pd(e,r,n,o);},F.derived({minValue:e=>De(e).minimum??null,maxValue:e=>De(e).maximum??null,format:e=>De(e).format??null},{gte(e,t){return this.check(_t(e,t))},min(e,t){return this.check(_t(e,t))},gt(e,t){return this.check(jt(e,t))},lt(e,t){return this.check(Vt(e,t))},lte(e,t){return this.check(yt(e,t))},max(e,t){return this.check(yt(e,t))},positive(e){return this.check(jt(BigInt(0),e))},negative(e){return this.check(Vt(BigInt(0),e))},nonpositive(e){return this.check(yt(BigInt(0),e))},nonnegative(e){return this.check(_t(BigInt(0),e))},multipleOf(e,t){return this.check(Sr(e,t))}}));function V_(e){return Kp(Zo,e)}var tu=E("ZodBigIntFormat",(e,t)=>{Qm.init(e,t),Zo.init(e,t);});function j_(e){return ed(tu,e)}function q_(e){return td(tu,e)}var Ch=E("ZodSymbol",(e,t)=>{Vm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ad(e,r,n,o);});function W_(e){return rd(Ch,e)}var Eh=E("ZodUndefined",(e,t)=>{jm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kd(e,r,n,o);});function H_(e){return nd(Eh,e)}var Ph=E("ZodNull",(e,t)=>{qm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rd(e,r,n);});function Ah(e){return od(Ph,e)}var Rh=E("ZodAny",(e,t)=>{Wm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Td();});function X_(){return id(Rh)}var kh=E("ZodUnknown",(e,t)=>{Hm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ld();});function dn(){return sd(kh)}var Mh=E("ZodNever",(e,t)=>{Xm.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Id(e,r,n);});function ru(e){return ad(Mh,e)}var Ih=E("ZodVoid",(e,t)=>{Ym.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Md(e,r,n,o);});function Y_(e){return cd(Ih,e)}var ns=E("ZodDate",(e,t)=>{Km.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nd(e,r,n,o),e.min=(r,n)=>e.check(_t(r,n)),e.max=(r,n)=>e.check(yt(r,n));},F.derived({minDate:e=>{let{minimum:t}=De(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=De(e);return t?new Date(t):null}},{}));function K_(e){return ud(ns,e)}var Th=E("ZodArray",(e,t)=>{gn(),ep.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qd(e,r,n,o),e.element=t.element;},{min(e,t){return this.check(nr(e,t))},nonempty(e){return this.check(nr(1,e))},max(e,t){return this.check(fn(e,t))},length(e,t){return this.check(mn(e,t))},unwrap(){return this.element}});function os(e,t){return md(Th,e,t)}function J_(e){let t=e._zod.def.shape;return nu(Object.keys(t))}var is=E("ZodObject",(e,t)=>{gn(),tp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wd(e,r,n,o),F.installLazyProp(e,"shape",r=>r._zod.def.shape,false);},{keyof(){return nu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(F.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(F.mergeDefs(this._zod.def,{catchall:dn()}))},loose(){return this.clone(F.mergeDefs(this._zod.def,{catchall:dn()}))},strict(){return this.clone(F.mergeDefs(this._zod.def,{catchall:ru()}))},strip(){return this.clone(F.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return F.extend(this,e)},safeExtend(e){return F.safeExtend(this,e)},merge(e){return F.merge(this,e)},pick(e){return F.pick(this,e)},omit(e){return F.omit(this,e)},partial(...e){return F.partial(as,this,e[0])},exactPartial(...e){return F.partial(iu,this,e[0],"exactPartial")},required(...e){return F.required(su,this,e[0])}});function eb(e,t){let r={type:"object",shape:e??{},...F.normalizeParams(t)};return new is(r)}function tb(e,t){return new is({type:"object",shape:e,catchall:ru(),...F.normalizeParams(t)})}function rb(e,t){return new is({type:"object",shape:e,catchall:dn(),...F.normalizeParams(t)})}var ss=E("ZodUnion",(e,t)=>{Bi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rc(e,r,n,o),e.options=t.options;});function Bo(e,t){return new ss({type:"union",options:e,...F.normalizeParams(t)})}var Lh=E("ZodXor",(e,t)=>{ss.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rc(e,r,n,o),e.options=t.options;});function nb(e,t){return new Lh({type:"union",options:e,inclusive:false,...F.normalizeParams(t)})}var Nh=E("ZodDiscriminatedUnion",(e,t)=>{ss.init(e,t),op.init(e,t);});function ob(e,t,r){return new Nh({type:"union",options:t,discriminator:e,...F.normalizeParams(r)})}var Oh=E("ZodIntersection",(e,t)=>{ip.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hd(e,r,n,o);});function zh(e,t){return new Oh({type:"intersection",left:e,right:t})}var Fh=E("ZodTuple",(e,t)=>{gn(),Ba.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xd(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 as({type:"optional",innerType:t}))})}});function Dh(e,t,r){let n=t instanceof q,o=n?r:t,i=n?t:null;return new Fh({type:"tuple",items:e,rest:i,...F.normalizeParams(o)})}var No=E("ZodRecord",(e,t)=>{gn(),sp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yd(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType;});function Zh(e,t,r){return !t||!t._zod?new No({type:"record",keyType:es(),valueType:e,...F.normalizeParams(t)}):new No({type:"record",keyType:e,valueType:t,...F.normalizeParams(r)})}function ib(e,t,r){return new No({type:"record",keyType:e,valueType:t,...F.normalizeParams(r),partial:true})}function sb(e,t,r){return new No({type:"record",keyType:e,valueType:t,mode:"loose",...F.normalizeParams(r)})}var Bh=E("ZodMap",(e,t)=>{gn(),ap.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vd(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(qt(...r)),e.nonempty=r=>e.check(qt(1,r)),e.max=(...r)=>e.check(vr(...r)),e.size=(...r)=>e.check(ln(...r));});function ab(e,t,r){return new Bh({type:"map",keyType:e,valueType:t,...F.normalizeParams(r)})}var Uh=E("ZodSet",(e,t)=>{gn(),cp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jd(e,r,n,o),e.min=(...r)=>e.check(qt(...r)),e.nonempty=r=>e.check(qt(1,r)),e.max=(...r)=>e.check(vr(...r)),e.size=(...r)=>e.check(ln(...r));});function cb(e,t){return new Uh({type:"set",valueType:e,...F.normalizeParams(t)})}var Oo=E("ZodEnum",(e,t)=>{up.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Od(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 Oo({...t,checks:[],...F.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 Oo({...t,checks:[],...F.normalizeParams(o),entries:i})};});function nu(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Oo({type:"enum",entries:r,...F.normalizeParams(t)})}function ub(e,t){return new Oo({type:"enum",entries:e,...F.normalizeParams(t)})}var Gh=E("ZodLiteral",(e,t)=>{lp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zd(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 lb(e,t){return new Gh({type:"literal",values:Array.isArray(e)?e:[e],...F.normalizeParams(t)})}var Qh=E("ZodFile",(e,t)=>{fp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zd(e,r,n),e.min=(r,n)=>e.check(qt(r,n)),e.max=(r,n)=>e.check(vr(r,n)),e.mime=(r,n)=>e.check(Eo(Array.isArray(r)?r:[r],n));});function fb(e){return pd(Qh,e)}var Vh=E("ZodTransform",(e,t)=>{gn(),mp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qd(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(F.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(F.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 ou(e){return new Vh({type:"transform",transform:e})}var as=E("ZodOptional",(e,t)=>{Ua.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function hn(e){return new as({type:"optional",innerType:e})}var iu=E("ZodExactOptional",(e,t)=>{pp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kc(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function jh(e){return new iu({type:"optional",innerType:e})}var qh=E("ZodNullable",(e,t)=>{dp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function ts(e){return new qh({type:"nullable",innerType:e})}function mb(e){return hn(ts(e))}var Wh=E("ZodDefault",(e,t)=>{hp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>th(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap;});function Hh(e,t){return new Wh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():F.shallowClone(t)}})}var Xh=E("ZodPrefault",(e,t)=>{gp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Yh(e,t){return new Xh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():F.shallowClone(t)}})}var su=E("ZodNonOptional",(e,t)=>{yp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function Kh(e,t){return new su({type:"nonoptional",innerType:e,...F.normalizeParams(t)})}var Jh=E("ZodSuccess",(e,t)=>{_p.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bd(e,r,n),e.unwrap=()=>e._zod.def.innerType;});function pb(e){return new Jh({type:"success",innerType:e})}var e0=E("ZodCatch",(e,t)=>{bp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap;});function t0(e,t){return new e0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:F.constantCatch(t)})}var r0=E("ZodNaN",(e,t)=>{xp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fd(e,r,n,o);});function db(e){return fd(r0,e)}var cs=E("ZodPipe",(e,t)=>{Ga.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oh(e,r,n,o),e.in=t.in,e.out=t.out;});function Oc(e,t){return new cs({type:"pipe",in:e,out:t})}var us=E("ZodCodec",(e,t)=>{cs.init(e,t),Ui.init(e,t);});function hb(e,t,r){return new us({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function gb(e){let t=e._zod.def;return new us({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var n0=E("ZodPreprocess",(e,t)=>{cs.init(e,t),$p.init(e,t);}),o0=E("ZodReadonly",(e,t)=>{wp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ih(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function i0(e){return new o0({type:"readonly",innerType:e})}var s0=E("ZodTemplateLiteral",(e,t)=>{Sp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dd(e,r,n);});function yb(e,t){return new s0({type:"template_literal",parts:e,...F.normalizeParams(t)})}var a0=E("ZodLazy",(e,t)=>{Gi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ah(e,r,n,o),e.unwrap=()=>e._zod.def.getter();});function c0(e){return new a0({type:"lazy",getter:e})}var u0=E("ZodPromise",(e,t)=>{Cp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType;});function _b(e){return new u0({type:"promise",innerType:e})}var l0=E("ZodFunction",(e,t)=>{vp.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gd(e,r,n,o);});function bb(e){return new l0({type:"function",input:Array.isArray(e?.input)?Dh(e?.input):e?.input??os(dn()),output:e?.output??dn()})}var ls=E("ZodCustom",(e,t)=>{Ep.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ud(e,r,n,o);});function xb(e){let t=new _e({check:"custom"});return t._zod.check=e,t}function $b(e,t){return dd(ls,e??(()=>true),t)}function f0(e,t={}){return hd(ls,e,t)}function m0(e,t){return gd(e,t)}var wb=yd,Sb=_d,p0=E("ZodInstanceOf",(e,t)=>{ls.init(e,t);},{properties(e,t){return this.check(Co(e,t))}});function vb(e,t={}){let r=new p0({type:"custom",check:"custom",fn:n=>n instanceof e,abort:true,...F.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 Cb=(...e)=>bd({Codec:us,Boolean:Do,String:zo},...e);function Eb(e){let t=c0(()=>Bo([es(e),Sh(),vh(),Ah(),os(t),Zh(es(),t)]));return t}function Pb(e,t){return new n0({type:"pipe",in:ou(e),out:t})}var o6={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 i6(e){Ae({customError:e});}function s6(){return Ae().customError}var d0;d0||(d0={});var fs={};hr(fs,{ZodISODate:()=>Rr,ZodISODateTime:()=>Ar,ZodISODuration:()=>Mr,ZodISOTime:()=>kr,date:()=>c6,datetime:()=>a6,duration:()=>l6,time:()=>u6});function a6(e){return Wi(Ar,e)}function c6(e){return Hi(Rr,e)}function u6(e){return Xi(kr,e)}function l6(e){return Yi(Mr,e)}var z={...Uo,...Tc,iso:fs},f6=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 m6(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 Ab(e,t){return e.map((r,n)=>n<t?r:r.optional())}function p6(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function d6(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:p6(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 h6(e,t){return z.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 h0(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=h0(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=h0(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 g6=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),y6=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function ms(e){return typeof e!="object"||e===null?false:Array.isArray(e)?e.some(ms):typeof e.$ref=="string"?true:Object.entries(e).some(([t,r])=>g6.has(t)?ms(r):!y6.has(t)||typeof r!="object"||r===null?false:Object.values(r).some(ms))}function Rb(e){return e===1?"element":"elements"}function _6(e,t){return z.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=h0(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 ${Rb(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 ${Rb(t.maxContains)}`,input:o,continue:true});}}}).pipe(e)}function kb(e,t){if(e!==false)return e===void 0||e===true?z.any():nt(e,t)}var b6=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function Mb(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return z.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 z.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=d6(o,t),s=nt(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 z.null();if(o.length===0)return z.never();if(o.length===1)return z.literal(o[0]);if(o.every(s=>typeof s=="string"))return z.enum(o);let i=o.map(s=>z.literal(s));return i.length<2?i[0]:z.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return z.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return Mb(s,t)});return o.length===0?z.never():o.length===1?o[0]:z.union(o)}if(!r)return z.any();let n;switch(r){case "string":{let o=z.string();if(e.format){let i=e.format;i==="email"?o=o.check(z.email()):i==="uri"||i==="uri-reference"?o=o.check(z.url()):i==="uuid"||i==="guid"?o=o.check(z.uuid()):i==="date-time"?o=o.check(z.iso.datetime({offset:true})):i==="date"?o=o.check(z.iso.date()):i==="time"?o=o.check(z.regex(b6)):i==="duration"?o=o.check(z.iso.duration()):i==="hostname"?o=o.check(z.hostname()):i==="ipv4"?o=o.check(z.ipv4()):i==="ipv6"?o=o.check(z.ipv6()):i==="mac"?o=o.check(z.mac()):i==="cidr"?o=o.check(z.cidrv4()):i==="cidr-v6"?o=o.check(z.cidrv6()):i==="base64"?o=o.check(z.base64()):i==="base64url"?o=o.check(z.base64url()):i==="e164"?o=o.check(z.e164()):i==="credit_card"?o=o.check(z.creditCard()):i==="iban"?o=o.check(z.iban()):i==="jwt"?o=o.check(z.jwt()):i==="emoji"?o=o.check(z.emoji()):i==="nanoid"?o=o.check(z.nanoid()):i==="cuid"?o=o.check(z.cuid()):i==="cuid2"?o=o.check(z.cuid2()):i==="ulid"?o=o.check(z.ulid()):i==="xid"?o=o.check(z.xid()):i==="ksuid"&&(o=o.check(z.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"?z.number().int():z.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=z.boolean();break}case "null":{n=z.null();break}case "object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?nt(e.additionalProperties,t):void 0;for(let[f,p]of Object.entries(i)){let m=nt(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=nt(f[d],t),y=z.string().regex(new RegExp(d));m.push(z.looseRecord(y,g));}let h=[];if(Object.keys(o).length>0&&h.push(z.object(o).passthrough()),h.push(...m),h.length===0)n=z.object({}).passthrough();else if(h.length===1)n=h[0];else {let d=z.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)d=z.intersection(d,h[g]);n=d;}if(e.additionalProperties===false){let d=Object.keys(o),g=p.map(_=>new RegExp(_)),y=n;n=n.check(_=>{if(!vt(_.value))return;let b=[];for(let S of Object.keys(_.value))d.includes(S)||g.some(v=>v.test(S))||b.push(S);b.length&&_.issues.push({code:"unrecognized_keys",keys:b,input:_.value,inst:y});});}}else {let f=z.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=nt(p,t);}n=h6(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=>nt(f,t)),c=Ab(a,s),u=Array.isArray(i)?void 0:kb(i,t),l=z.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(z.maxLength(e.maxItems)));}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>nt(f,t)),c=Ab(a,s),u=kb(e.additionalItems,t),l=z.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(z.maxLength(e.maxItems)));}else if(i!==void 0){let s=nt(i,t),a=z.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a;}else n=z.array(z.any());(e.uniqueItems===true||e.contains!==void 0)&&(n=_6(n,{uniqueItems:e.uniqueItems===true,containsSchema:e.contains!==void 0?nt(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 nt(e,t){if(typeof e=="boolean")return e?z.any():z.never();let r=Mb(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=>nt(u,t)),c=z.union(a);r=n?z.intersection(r,c):c;}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>nt(u,t)),c=z.xor(a);r=n?z.intersection(r,c):c;}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:z.any();else {let a=n?r:nt(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=z.intersection(a,nt(e.allOf[u],t));r=a;}e.nullable===true&&t.version==="openapi-3.0"&&(r=z.nullable(r)),e.readOnly===true&&(r=z.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&&!ms(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&&!ms(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))f6.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 Ib(e,t){if(typeof e=="boolean")return e?z.any():z.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=m6(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??We};return nt(r,i)}var Tb=Symbol("z.visit/resolving");function ps(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===Tb)return new Gi({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,Tb);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?le(s,{...a,shape:p,catchall:m}):s}case "array":{let u=o(a.element);return u===a.element?s:le(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?le(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:le(s,{...a,keyType:u,valueType:l})}case "set":{let u=o(a.valueType);return u===a.valueType?s:le(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?le(s,{...a,options:f}):s}case "intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:le(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:le(s,{...a,innerType:u})}case "pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:le(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:le(s,{...a,input:u,output:l})}case "lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return le(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 Lb(e){return ps(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Bo(r.options)}})}function x6(e,t){if(!t?.length)return e;let r=e._zod.def;return le(e,Mt(r,{checks:[...r.checks??[],...t]}),{parent:true})}function Nb(e){return x6(e.out,e.checks)}function $6(e){return e.in._zod.traits.has("$ZodTransform")?Nb(e):e.in}function Ob(e){return ps(e,{pipe:t=>$6(t._zod.def),default:(t,r)=>r?hn(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function zb(e){return ps(e,{pipe:t=>Nb(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var g0={};hr(g0,{bigint:()=>C6,boolean:()=>v6,date:()=>E6,number:()=>S6,string:()=>w6});function w6(e){return Fp(zo,e)}function S6(e){return Qp(Fo,e)}function v6(e){return Yp(Do,e)}function C6(e){return Jp(Zo,e)}function E6(e){return ld(ns,e)}var y0=A.enum(Wn),_0=A.enum([...Hn.logo,...Hn.halftone]),Fb=e=>Math.ceil(e/3)*4,b0=A.object({width:A.number().int().min(1).max(Bt),height:A.number().int().min(1).max(Bt),data:A.string().max(Fb(Bt*Bt*4))}).refine(e=>e.data.length===Fb(e.width*e.height*4),{message:"Art image data does not match its width and height"}),au=A.object({mode:y0,image:b0,intensity:A.number().min(0).max(1).optional(),variant:_0.optional(),matchEyes:A.boolean().optional()});var Db=A.enum(["solid","linear","radial","angular","image"]),x0=A.object({type:A.literal("solid"),color:A.string()}),ds=A.object({color:A.string(),offset:A.number().min(0).max(100)}),$0=A.object({type:A.literal("linear"),stops:A.array(ds).min(2),angle:A.number().optional().default(0)}),w0=A.object({type:A.literal("radial"),stops:A.array(ds).min(2)}),S0=A.object({type:A.literal("angular"),stops:A.array(ds).min(2),angle:A.number().optional().default(0)}),v0=A.enum(["cover","contain","tile"]),C0=A.enum(["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"]),E0=A.object({type:A.literal("image"),src:A.string().min(1),fit:v0.optional().default("cover"),scale:A.number().min(.1).max(4).optional().default(1),position:C0.optional().default("center"),opacity:A.number().min(0).max(1).optional().default(1),underlay:A.string().optional()}),ir=A.union([A.string(),x0,$0,w0,S0,E0]);var Zb=A.object({x:A.number(),y:A.number(),w:A.number(),h:A.number()});var cu=A.enum([...Hs,...$l]),Bb=A.enum(Hs);var uu=A.enum([...Xs,...wl]),Ub=A.enum(Xs);var P0=A.enum(vl),hs=A.object({style:P0,text:A.string().max(ut).optional(),color:A.string().optional(),textColor:A.string().optional(),secondaryText:A.string().max(ut).optional(),secondaryColor:A.string().optional(),fontScale:A.number().min(Hr).max(gr).optional()});var Re=A.number().min(-ee.maxCoordinate).max(ee.maxCoordinate).refine(_r,{message:`Numbers may have at most ${ee.maxDecimals} decimals`}),Xe=Re.refine(e=>e>0,{message:"Must be greater than 0"}),lu=Re.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"),Gb=A.union([A.enum(gi),gs]),Vb=e=>A.object({mix:A.tuple([e,e]),amount:A.number().min(0).max(1).refine(_r)}).strict(),Ir=A.union([Gb,Vb(Gb)]),P6=A.union([gs,Vb(A.union([A.enum(["frame","accent","background"]),gs]))]),sr=A.union([Ir,A.object({gradient:A.object({from:Ir,to:Ir,direction:A.enum(["horizontal","vertical"]).optional(),steps:A.int().min(2).max(ee.maxGradientSteps).optional()}).strict()}).strict()]),A0={x:Re,y:Re,width:Xe,height:Xe},ys=A.object({color:Ir,width:Xe}).strict(),A6=A.object({type:A.literal("rect"),...A0,radius:lu.optional(),fill:sr,hole:A.object({...A0,radius:lu.optional()}).strict().optional(),stroke:ys.optional()}).strict(),R6=A.object({type:A.literal("circle"),cx:Re,cy:Re,r:Xe,hole:Xe.optional(),fill:sr,stroke:ys.optional()}).strict(),k6=A.object({type:A.literal("ellipse"),cx:Re,cy:Re,rx:Xe,ry:Xe,fill:sr,stroke:ys.optional()}).strict(),M6=A.object({type:A.literal("polygon"),points:A.array(A.tuple([Re,Re])).min(3).max(ee.maxPolygonPoints),fill:sr,stroke:ys.optional()}).strict(),I6=A.object({type:A.literal("path"),d:A.string().min(2).max(ee.maxPathLength),fill:sr,fillRule:A.enum(["nonzero","evenodd"]).optional(),stroke:ys.optional()}).strict(),T6=A.object({type:A.literal("line"),x1:Re,y1:Re,x2:Re,y2:Re,width:Xe,cap:A.enum(["butt","round"]).optional(),dash:A.tuple([Xe,Xe]).optional(),fill:sr}).strict(),L6=A.object({type:A.literal("icon"),icon:A.enum(di),x:Re,y:Re,size:Xe,fill:sr}).strict(),R0=A.discriminatedUnion("type",[A6,R6,k6,M6,I6,T6,L6]),jb={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(ut).optional(),color:Ir,weight:A.enum(["bold","regular"]).optional(),collapse:A.object({y:Re,height:Xe}).strict().optional()},N6=A.object({type:A.literal("text"),...jb,box:A.object(A0).strict(),align:A.enum(["start","middle","end"]).optional(),fontSize:Xe.optional()}).strict(),O6=A.object({type:A.literal("curved"),...jb,curve:A.object({cx:Re,cy:Re,radius:Xe,side:A.enum(["top","bottom"]),spread:A.number().min(20).max(300).refine(_r).optional()}).strict(),fontSize:Xe}).strict(),k0=A.discriminatedUnion("type",[N6,O6]),Qb=Re.refine(e=>e>=ee.minArtboard&&e<=ee.maxArtboard,{message:`Artboard sides must be ${ee.minArtboard} to ${ee.maxArtboard} units`}),z6=A.object({kind:A.literal(Yr),version:A.literal(Kr),artboard:A.object({width:Qb,height:Qb}).strict(),qr:A.object({x:Re,y:Re,size:Xe,padding:lu.optional(),radius:lu.optional(),plate:A.enum(["opaque","background","none"]).optional()}).strict(),colors:A.object({frame:gs,text:P6.optional(),accent:gs.optional()}).strict(),shapes:A.array(R0).max(ee.maxShapes),labels:A.array(k0).max(ee.maxLabels),bleed:A.union([A.literal("none"),Ir]).optional()}).strict(),fu=z6.superRefine((e,t)=>ta(e,(r,n=[])=>t.addIssue({code:"custom",message:r,path:n})));function qb(e){let t=fu.safeParse(e);return t.success?[]:t.error.issues.map(r=>r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message)}var M0=hs.extend({style:A.literal(Jr),spec:fu}),mu=A.discriminatedUnion("style",[hs,M0]);var pu=A.enum(Sl);var du=A.enum(El),I0=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:du.optional(),plate:A.string().optional()}),Wb=A.object({size:A.number().min(Pl).max(fi).optional(),padding:A.number().min(0).max(Rl).optional(),x:A.number().min(0).max(1).optional(),y:A.number().min(0).max(1).optional(),shape:du.optional(),plate:A.string().optional()}),T0=A.enum(["L","M","Q","H"]),L0=A.enum(Ml),N0=A.object({type:A.literal("silhouette"),width:A.number().int().min(kt).max(wt),height:A.number().int().min(kt).max(wt),cells:A.string().max(wt*wt).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"}),O0=A.union([L0,N0]),_s=A.object({outer:ir.optional(),inner:ir.optional()}),z0=A.object({topLeft:_s.optional(),topRight:_s.optional(),bottomLeft:_s.optional()}),Hb=A.object({value:A.string(),size:A.number().optional(),level:T0.optional(),bgColor:ir.optional(),fgColor:ir.optional(),eyeColor:ir.optional(),dotColor:ir.optional(),bodyPattern:pu.optional(),cornerEyePattern:uu.optional(),cornerEyeDotPattern:cu.optional(),margin:A.number().optional(),imageSettings:I0.optional(),isOGContext:A.boolean().optional(),templateId:A.string().optional(),customProps:A.record(A.string(),A.any()).optional(),frame:mu.optional(),art:au.optional(),eyeColors:z0.optional(),moduleScale:A.number().min(Xn).max(mi).optional(),autoLevel:A.boolean().optional(),shape:O0.optional()});var Xb=A.object({fgColor:A.string().optional(),bgColor:A.string().optional()}),Yb=A.object({pixelSize:A.number(),url:A.string()}),Kb=A.object({id:A.string(),name:A.string(),description:A.string().optional()});var ot=e=>e/255,bs=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,ae=e=>.2126*e[0]+.7152*e[1]+.0722*e[2];function F0(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:[ot(n[a]),ot(n[a+1]),ot(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})=>bs(s,i)<.006)?i:null}function F6(e){let{width:t,height:r,data:n}=e,o=F0(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(bs([ot(n[a]),ot(n[a+1]),ot(n[a+2])],o));c*=Math.min(1,Math.max(0,(u-.06)/.1));}i[s]=c;}return i}var D6=8,Z6=.14,Jb=.006;function B6(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]+=ot(o[h]),s[d*3+1]+=ot(o[h+1]),s[d*3+2]+=ot(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<Jb/2||u.length>=D6)break;let h=[s[m*3]/i[m],s[m*3+1]/i[m],s[m*3+2]/i[m]];u.every(d=>bs(d,h)>=Z6**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=[ot(o[d]),ot(o[d+1]),ot(o[d+2])],y=0,_=Number.POSITIVE_INFINITY;for(let[S,v]of u.entries()){let x=bs(g,v);x<_&&(_=x,y=S);}let b=l[y];b.n++,b.r+=g[0],b.g+=g[1],b.b+=g[2],b.x+=h%r,b.y+=Math.floor(h/r),f+=Math.sqrt(_);}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>=Jb).sort((m,h)=>h.area-m.area),error:f/a}}function U6(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),y=f%2===1,_=y?i(h,d+1):i(h+1,d),b=g===_?.5:Math.min(1,Math.max(0,(.5-g)/(_-g))),S=y?[h-.5,d-.5+b]:[h-.5+b,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,y=2*(f*n+p),_=2*((f+1)*n+p),b=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);break;case 2:u(S,_);break;case 3:u(S,b);break;case 4:u(y,S);break;case 5:{(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,S),u(_,b));break}case 6:u(y,_);break;case 7:u(y,b);break;case 8:u(b,y);break;case 9:u(_,y);break;case 10:{(i(p,f)+i(p+1,f)+i(p+1,f+1)+i(p,f+1))/4>=.5?(u(b,_),u(S,y)):(u(b,y),u(S,_));break}case 11:u(S,y);break;case 12:u(b,S);break;case 13:u(_,S);break;case 14:u(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 G6(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 e2(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 Q6(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=e2(e.slice(0,r+1),t),i=e2([...e.slice(r),e[0]],t);return [...o.slice(0,-1),...i.slice(0,-1)]}var Tr=e=>se(e,2);function V6(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${Tr(a[0])} ${Tr(a[1])}`:`L${Tr(a[0])} ${Tr(a[1])}`,o+=`Q${Tr(s[0])} ${Tr(s[1])} ${Tr(c[0])} ${Tr(c[1])}`;}return `${o}Z`}function j6(e,t,r){let n="";for(let o of U6(e,t,r)){if(Math.abs(G6(o))<.8)continue;let i=Q6(o,.18);i.length>=3&&(n+=V6(i,.9));}return n}var q6=.075;function t2(e){let{width:t,height:r,data:n}=e,o=F6(e),i=0;for(let d of o)i+=d;let{palette:s,error:a}=B6(e,o),c={width:t,height:r,palette:s,alpha:o,coverage:i/(t*r)};if(s.length===0||a>q6)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 y=d*4,_=[ot(n[y]),ot(n[y+1]),ot(n[y+2])],b=0,S=-1,v=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(let M=0;M<u;M++){let T=bs(_,f[M]);T<v?(S=b,x=v,b=M,v=T):T<x&&(S=M,x=T);}if(S<0||v<1e-6){l[b][d]=g;continue}let w=f[b],C=f[S],P=[C[0]-w[0],C[1]-w[1],C[2]-w[2]],R=Math.min(1,Math.max(0,((_[0]-w[0])*P[0]+(_[1]-w[1])*P[1]+(_[2]-w[2])*P[2])/(P[0]**2+P[1]**2+P[2]**2)));l[b][d]=g*(1-R),l[S][d]=g*R;}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 y=0;y<m.length;y++)m[y]+=g[y];h[d]=m.slice();}for(let d=0;d<u;d++){let g=j6(h[d],t,r);g&&p.push({color:f[d],d:g});}return {...c,layers:p,photographic:false}}var{QrCode:D0}=Le,W6={"1L":3,"1M":2,"1Q":1,"1H":1,"2L":2,"3L":1};function H6(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 X6(e,t){let r=e*4+17,n=Ke[t].ordinal,o=D0.NUM_ERROR_CORRECTION_BLOCKS[n]?.[e]??0,i=D0.ECC_CODEWORDS_PER_BLOCK[n]?.[e]??0,s=Math.floor(D0.getNumRawDataModules(e)/8),a=o-s%o,c=Math.floor(s/o),u=Array.from({length:o},(S,v)=>c+(v<a?0:1)),l=[],f=[],p=c-i;for(let S=0;S<=c;S++)for(let v=0;v<o;v++)if(v<a){if(S===p)continue;l.push(v),f.push(S<p?S:S-1);}else l.push(v),f.push(S);if(l.length!==s)throw new Error(`Codeword map: interleave mismatch at version ${e}`);let m=H6(e),h=new Int16Array(r*r).fill(-1),d=new Int16Array(r*r).fill(-1),g=new Int8Array(r*r).fill(-1),y=s*8,_=0;for(let S=r-1;S>=1;S-=2){S===6&&(S=5);let v=(S+1&2)===0;for(let x=0;x<r;x++)for(let w=0;w<2;w++){let C=S-w,R=(v?r-1-x:x)*r+C;if(!m[R]&&_<y){let M=_>>>3;h[R]=l[M],d[R]=f[M],g[R]=7-(_&7),_++;}}}if(_!==y)throw new Error(`Codeword map: placement mismatch at version ${e}`);let b=W6[`${e}${t}`]??0;return {version:e,level:t,size:r,blocks:o,eccPerBlock:i,blockLengths:u,correctable:Math.floor((i-b)/2),block:h,codeword:d,bit:g}}var Y6=8,bn=new Map;function xs(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=bn.get(r);if(n)return bn.delete(r),bn.set(r,n),n;let o=X6(e,t);if(bn.size>=Y6){let i=bn.keys().next().value;i!==void 0&&bn.delete(i);}return bn.set(r,o),o}function $s(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 K6={black:[0,0,0],white:[255,255,255],red:[255,0,0],green:[0,128,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],yellow:[255,255,0],orange:[255,165,0],purple:[128,0,128],pink:[255,192,203],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],teal:[0,128,128],aqua:[0,255,255],cyan:[0,255,255],fuchsia:[255,0,255],magenta:[255,0,255]};function r2(e,t){let r=e.trim(),n=Number.parseFloat(r);return Number.isNaN(n)?Number.NaN:r.endsWith("%")?n/100*t:n}function Pe(e){if(!e)return null;let t=e.trim().toLowerCase();if(t==="transparent")return {r:0,g:0,b:0,a:0};let r=K6[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=>r2(m,255)),f=a===void 0?1:r2(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 Lr(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]:[se((1-n-s)/(1-s)),se((1-o-s)/(1-s)),se((1-i-s)/(1-s)),se(s)]}function Ht(e){return e.children}var J6=e=>e==null?null:`${e}`;function Z0(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:J6(o)}}function ev(e,t){let r=e;return {type:r.type,props:{...r.props,...t},key:r.key??null}}function tv(e,t,...r){let n={...t};return r.length>0&&(n.children=r.length===1?r[0]:r),Z0(e,n)}var rv={jsx:Z0,jsxs:Z0,createElement:tv,cloneElement:ev,Fragment:Ht},ws=rv;var B0=e=>e===Ht?ws.Fragment:e;function I(e,t,r){return ws.jsx(B0(e),t,r)}function Qe(e,t,r){return ws.jsxs(B0(e),t,r)}function hu(e,t,...r){return ws.createElement(B0(e),t??null,...r)}function Go(e,t){return ws.cloneElement(e,t)}var nv=new Set([Symbol.for("react.element"),Symbol.for("react.transitional.element")]),n2=Symbol.for("react.fragment");function xn(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=e;return t.$$typeof!==void 0&&!nv.has(t.$$typeof)?false:(typeof t.type=="string"||typeof t.type=="function"||t.type===n2)&&typeof t.props=="object"&&t.props!==null}var Qo=e=>e===Ht||e===n2;var u2=.6,Q0={logo:160,halftone:160};function ov(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}var Vo=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}},iv=new Vo(8);function sv(e){return iv.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 V0(e){let{width:t,height:r,data:n}=e;if(!(Number.isInteger(t)&&Number.isInteger(r))||t<1||r<1||t>Bt||r>Bt||typeof n!="string")return null;try{let o=sv(n);return o.length===t*r*4?{width:t,height:r,data:o}:null}catch{return null}}function l2(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??Q0.halftone),1),Bt),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),y=Math.max(g+1,Math.floor((d+1)*u/m));for(let _=0;_<p;_++){let b=Math.floor(_*c/p),S=Math.max(b+1,Math.floor((_+1)*c/p)),v=0,x=0,w=0,C=0,P=0;for(let M=g;M<y;M++)for(let T=b;T<S;T++){let L=((M+a)*r+T+s)*4,D=o[L+3]/255;v+=o[L]*D,x+=o[L+1]*D,w+=o[L+2]*D,C+=D,P++;}let R=(d*p+_)*4;h[R]=C>0?Math.round(v/C):0,h[R+1]=C>0?Math.round(x/C):0,h[R+2]=C>0?Math.round(w/C):0,h[R+3]=Math.round(C/P*255);}}return {width:p,height:m,data:ov(h)}}async function av(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 cv(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??Q0[r],o=await av(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 l2(m,{maxSize:n,square:a})}function j0(e){return !!(e&&Wn.includes(e.mode)&&e.image&&V0(e.image))}function _u(e){let t=Hn[e.mode];return e.variant&&t.includes(e.variant)?e.variant:t[0]}function uv(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 Ss(e,t){let r=uv(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 lv=0,Pt=1,Lt=2,Nr=3,o2=4,i2=new Map;function f2(e){let t=i2.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,o2),o(0,6,r,1,o2),o(0,8,9,1,Nr),o(8,0,1,9,Nr),o(r-8,8,8,1,Nr),o(8,r-8,1,8,Nr),e>=7&&(o(r-11,0,3,6,Nr),o(0,r-11,6,3,Nr));for(let[i,s]of Ss(e,r))o(i-2,s-2,5,5,Lt);return o(0,0,8,8,Pt),o(r-8,0,8,8,Pt),o(0,r-8,8,8,Pt),i2.set(e,n),n}function fv(e){let t=e*4+17,r=f2(e);return Array.from({length:t},(n,o)=>Array.from({length:t},(i,s)=>r[o*t+s]!==lv))}function mv(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 jo(e,t){let r=Pe(e);return !r||r.a===0?t:[r.r/255,r.g/255,r.b/255]}var wn=(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 Or(e,t,r,n){let o=ae(e);if(n?o<=r:o>=r)return e;let i=ae(t);return Math.abs(o-i)<1e-6?t:wn(e,t,Math.min(1,Math.max(0,(o-r)/(o-i))))}var m2=e=>Math.max(...e)-Math.min(...e),pv=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,U0=e=>e.toString(16).padStart(2,"0");function it(e,t=1){let r=n=>Math.min(255,Math.round(Math.round(Math.min(Math.max(n,0),1)*255)/t)*t);return `#${U0(r(e[0]))}${U0(r(e[1]))}${U0(r(e[2]))}`}function dv(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 q0=.3,s2=e=>1-Math.exp(-((e/2)**2)/(2*q0**2)),hv=e=>dv(e/(2*q0*Math.SQRT2))**2,gv=(e,t,r)=>{let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)};function W0(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 p2(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 yv(e){let t=p2(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=ae([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=ae(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 d2(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,y=0,_=0,b=0,S=0,v=(w,C,P)=>{let R=C*i+w,M=c[R]*P;y+=a[R*3]*M,_+=a[R*3+1]*M,b+=a[R*3+2]*M,S+=M;};if(v(f,p,(1-d)*(1-g)),v(m,p,d*(1-g)),v(f,h,(1-d)*g),v(m,h,d*g),S<=0)return n;let x=S*o;return [n[0]+(y/S-n[0])*x,n[1]+(_/S-n[1])*x,n[2]+(b/S-n[2])*x]}var _v=new Vo(4),bv=new Vo(6),xv=new Vo(6);function H0(e,t){return bv.get(e.image.data,()=>t2(t))}function h2(e,t,r){return xv.get(e.image.data,()=>p2(t,r.alpha))}var Ze=e=>se(e,2),g2=e=>se(e,4),Sn=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,$v(r,n,o));}toElements(t){return [...this.groups].map(([r,n],o)=>I("path",{d:n.join(""),fill:r},`${t}-${o}`))}};function $v(e,t,r){let n=Ze(r*2),o=Ze(r);return `M${Ze(e-r)} ${Ze(t)}a${o} ${o} 0 1 0 ${n} 0a${o} ${o} 0 1 0 ${-n} 0z`}function $n(e,t,r,n,o){let i=Math.min(o,r/2,n/2);if(i<=0)return `M${Ze(e)} ${Ze(t)}h${Ze(r)}v${Ze(n)}h${Ze(-r)}z`;let s=Ze(i);return `M${Ze(e+i)} ${Ze(t)}h${Ze(r-2*i)}a${s} ${s} 0 0 1 ${s} ${s}v${Ze(n-2*i)}a${s} ${s} 0 0 1 ${-s} ${s}h${Ze(-(r-2*i))}a${s} ${s} 0 0 1 ${-s} ${-s}v${Ze(-(n-2*i))}a${s} ${s} 0 0 1 ${s} ${-s}z`}function y2(e,t,r){let n="";for(let[o,i]of e){let s=(o-2+t)*r,a=(i-2+t)*r;n+=$n(s,a,5*r,5*r,r*.35),n+=$n(s+r,a+r,3*r,3*r,r*.15),n+=$n(s+2*r,a+2*r,r,r,r*.12);}return n}var wv={blend:1,badge:1,color:.9,mono:.7},yu=.35;function Sv(e,t){let r=jo(e,[0,0,0]),n=jo(t,[1,1,1]),o=ae(n)-ae(r);return o>=yu?null:o<=-yu?"inverted":"low-contrast"}function _2(e,t,r){let n=Math.min(Math.max(e.intensity??u2,0),wv[_u(e)]);return ae(r)-ae(t)>=yu?n:0}function vv(e){let{art:t,modules:r,version:n}=e,o=t.image&&V0(t.image);if(!(o&&Wn.includes(t.mode)))return null;let i=r.length;if(i!==n*4+17)return null;let s=jo(e.fgColor,[0,0,0]),a=jo(e.bgColor,[1,1,1]),c=_2(t,s,a);return c<=0?null:{art:t,image:o,modules:r,size:i,version:n,kinds:f2(n),margin:e.margin,pixelSize:e.pixelSize,t:c,fg:s,bg:a,variant:_u(t),body:e.body}}function X0(e){let t=vv(e);if(!t)return null;let r;return t.art.mode==="halftone"?r=t.variant==="mono"?kv(t):Rv(t):r=t.variant==="badge"?Dv(t):Mv(t),I("g",{"data-qrdx-art":t.art.mode,"data-qrdx-art-variant":t.variant,children:r})}function Cv(e,t){return {margin:.42-.17*e+(t===3?.04:0),darkCap:.4+.3*e}}var b2=8.5,a2=new Map;function Y0(e){let t=e*4+17,r=a2.get(e);if(!r){let i=t*2,s=new Uint8Array(i*i),a=b2*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 Ss(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);a2.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 x2(e,t,r=false){let{image:n,size:o,kinds:i,fg:s,bg:a}=e,c=_v.get(e.art.image.data,()=>yv(n)),u=W0(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=ae(a)-.1*(ae(a)-ae(s)),d=Y0(e.version);for(let g=0;g<o;g++)for(let y=0;y<o;y++){let _=i[g*o+y],b=_===Pt||_===Lt;if(!(b&&!r))for(let S=0;S<t;S++)for(let v=0;v<t;v++){let x=0,w=0,C=0;for(let B=0;B<m;B++)for(let O=0;O<m;O++){let j=y+(v+(O+.5)/m)/t,te=g+(S+(B+.5)/m)/t,G=d2(c,(j-u.offsetX)/u.scale,(te-u.offsetY)/u.scale,a);x+=G[0],w+=G[1],C+=G[2];}let P=m*m,R=[x/P,w/P,C/P],M=y+(v+.5)/t,T=g+(S+.5)/t,L=Math.min(M,T,o-M,o-T);L<1.5&&(R=wn(R,a,.35*(1-L/1.5))),r&&(b||d(M,T))&&(R=Or(R,a,h,false));let D=((g*t+S)*l+y*t+v)*3;f[D]=R[0],f[D+1]=R[1],f[D+2]=R[2];}}return {n:t,count:l,rgb:f}}function Ev(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=ae(s),m=ae(a),h=m-p,d=Cv(c,u),g=C=>.2126*f[C]+.7152*f[C+1]+.0722*f[C+2],y=new Float32Array(n*n),_=new Float32Array(n*n);for(let C=0;C<n;C++)for(let P=0;P<n;P++){let R=o[C*n+P];if(R===Pt){y[C*n+P]=m;continue}if(R===Lt){y[C*n+P]=i[C]?.[P]?p:m;continue}let M=0,T=0,L=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let O=g(((C*u+D)*l+P*u+B)*3);M+=O,r.under[D*u+B]||(T+=O,L++);}y[C*n+P]=M/(u*u),_[C*n+P]=L?T/L:M/(u*u);}let b=n+1,S=new Float64Array(b*b);for(let C=0;C<n;C++)for(let P=0;P<n;P++)S[(C+1)*b+P+1]=y[C*n+P]+S[C*b+P+1]+S[(C+1)*b+P]-S[C*b+P];let v=2,x=(C,P)=>{let R=Math.max(0,C-v),M=Math.max(0,P-v),T=Math.min(n,C+v+1),L=Math.min(n,P+v+1);return (S[L*b+T]-S[M*b+T]-S[L*b+R]+S[M*b+R])/((T-R)*(L-M))},w=r.weight;for(let C=0;C<n;C++)for(let P=0;P<n;P++){let R=o[C*n+P];if(R===Pt||R===Lt)continue;let M=R===Nr,T=(d.margin+(M?.08:0))*h,L=(d.darkCap-(M?.12:0))*h,D=(w*((r.light-r.dark)/2)-T)/(1-w),B=x(P,C),O=_[C*n+P],j=!!i[C]?.[P],te=0,G=a;if(j){let Y=Math.min(B+D,p+L);O>Y&&(te=(O-Y)/Math.max(O-p,1e-6),G=s);}else {let Y=Math.max(B-D,m-L);O<Y&&(te=(Y-O)/Math.max(m-O,1e-6));}if(!(te<=0)){te=Math.min(1,te);for(let Y=0;Y<u;Y++)for(let de=0;de<u;de++){let Te=((C*u+Y)*l+P*u+de)*3;for(let $e=0;$e<3;$e++)f[Te+$e]+=(G[$e]-f[Te+$e])*te;}}}}function $2(e,t,r,n){let{count:o}=t,i=new Sn;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=Ze(e.margin*e.pixelSize);return I("g",{transform:`translate(${a} ${a}) scale(${g2(s)})`,children:i.toElements(n)},n)}function K0(e,t){let r=Ss(e.version,e.size);return r.length===0?[]:[I("path",{d:y2(r,e.margin,e.pixelSize),fill:t,fillRule:"evenodd"},"art-alignment")]}function w2(e){let{image:t,size:r}=e;return Math.floor(Math.min(t.width,t.height)/r)>=4&&r<=45?4:3}var Pv=e=>2*q0*Math.sqrt(-2*Math.log(1-Math.min(e,.95)));function Av(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 S2(e,t,r,n){let{size:o,kinds:i,modules:s,fg:a,bg:c}=e,u=ae(a),l=ae(c),f=l-u,p=Av(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 y=d*o+g,_=i[y];if(_===Pt||_===Lt)continue;let b=_===Nr,S=n.base+(b?.08:0),v=(n.margin+(b?.03:0))*f,x=(n.cap-(b?.04:0))*f,w=s2(S),C=s2(b?Math.max(n.max,.94):n.max),P=w*((n.dark+n.light)/2)+(1-w)*p[y],R=r[y],M=!!s[d]?.[g],T=M?n.dark:n.light,L=M?Math.min(P-v,u+x):Math.max(P+v,l-x),B=(M?R<=L:R>=L)?0:(R-L)/(R-T);B>C&&(B=C,h[y]=Math.min(l,Math.max(u,(L-C*T)/(1-C))));let O=M?R<=L-.06:R>=L+.06;n.skip&&O&&!b||(B=Math.max(B,w)),m[y]=B>0?Pv(B):0;}return {diameter:m,surround:h}}function Rv(e){let{size:t,kinds:r,modules:n,fg:o,bg:i,t:s,margin:a,pixelSize:c}=e,u=w2(e),l=x2(e,u,true),f=ae(o),p=ae(i),m=f+.1*(p-f),h=p-.05*(p-f),{count:d,rgb:g}=l,y=(x,w,C,P)=>((w*u+P)*d+x*u+C)*3,_=new Float32Array(t*t);for(let x=0;x<t;x++)for(let w=0;w<t;w++){let C=r[x*t+w];if(C===Pt||C===Lt){_[x*t+w]=C===Lt&&n[x]?.[w]?f:p;continue}let P=0;for(let R=0;R<u;R++)for(let M=0;M<u;M++){let T=y(w,x,M,R);P+=.2126*g[T]+.7152*g[T+1]+.0722*g[T+2];}_[x*t+w]=P/(u*u);}let b=S2(e,_,_,{base:.6-.28*s,max:.86,dark:m,light:h,margin:.2-.1*s,cap:.4+.14*s,skip:false});for(let x=0;x<t;x++)for(let w=0;w<t;w++){let C=b.surround[x*t+w];if(Number.isNaN(C))continue;let P=_[x*t+w],M=C<P?o:i,T=Math.min(1,Math.abs(P-C)/Math.max(Math.abs(P-ae(M)),1e-6));for(let L=0;L<u;L++)for(let D=0;D<u;D++){let B=y(w,x,D,L);for(let O=0;O<3;O++)g[B+O]+=(M[O]-g[B+O])*T;}}let S=[$2(e,l,x=>{let w=x*3;return Number.isNaN(g[w])?null:it([g[w],g[w+1],g[w+2]],8)},"art-photo")],v=new Sn;for(let x=0;x<t;x++)for(let w=0;w<t;w++){let C=b.diameter[x*t+w];if(!(C>0))continue;let P=0,R=0,M=0;for(let D=0;D<u;D++)for(let B=0;B<u;B++){let O=y(w,x,B,D);P+=g[O],R+=g[O+1],M+=g[O+2];}let T=[P/(u*u),R/(u*u),M/(u*u)],L=n[x]?.[w]?Or(T,o,m,true):Or(T,i,h,false);v.circle(it(L,10),(w+a+.5)*c,(x+a+.5)*c,C/2*c);}return S.push(...v.toElements("art-dot"),...K0(e,it(o))),S}function kv(e){let{size:t,kinds:r,modules:n,fg:o,bg:i}=e,s=w2(e),a=x2(e,s),c=ae(o),u=ae(i),l=s%2===1?1:2,f=(s-l)/2,p=P=>P>=f&&P<f+l,m=[];for(let P=0;P<s;P++)for(let R=0;R<s;R++)m.push(p(R)&&p(P));Ev(e,a,{weight:hv(l/s),dark:c,light:u,under:m});let{count:h,rgb:d}=a,g=new Float32Array(h*h),y=new Int8Array(h*h).fill(-1);for(let P=0;P<h*h;P++){let R=P*3;if(Number.isNaN(d[R])){g[P]=Number.NaN;continue}let M=(.2126*d[R]+.7152*d[R+1]+.0722*d[R+2]-c)/(u-c);g[P]=.5+(gv(0,1,M)-.5)*1.15;}for(let P=0;P<t;P++)for(let R=0;R<t;R++){let M=r[P*t+R];if(!(M===Pt||M===Lt))for(let T=f;T<f+l;T++)for(let L=f;L<f+l;L++)y[(P*s+T)*h+R*s+L]=n[P]?.[R]?0:1;}let _=Y0(e.version);for(let P=0;P<h;P++)for(let R=0;R<h;R++){let M=P*h+R;y[M]<0&&_((R+.5)/s,(P+.5)/s)&&(y[M]=1);}let b=new Uint8Array(h*h),S=.3,v=0,x=0,w=(P,R,M)=>{if(P<0||P>=h||R>=h)return;let T=R*h+P;if(!Number.isNaN(g[T])){let L=Math.floor(P/s)===Math.floor(v/s)&&Math.floor(R/s)===Math.floor(x/s);g[T]+=L?M:M*S;}};for(let P=0;P<h;P++){let R=P%2===0?1:-1;for(let M=0;M<h;M++){let T=R===1?M:h-1-M,L=P*h+T,D=g[L];if(Number.isNaN(D))continue;let B=y[L]>=0?y[L]:D>=.5?1:0;b[L]=B===0?1:0;let O=Math.min(.75,Math.max(-0.75,D-B));v=T,x=P,w(T+R,P,O*7/16),w(T-R,P+1,O*3/16),w(T,P+1,O*5/16),w(T+R,P+1,O/16);}}let C=it(o);return [$2(e,a,P=>b[P]?C:null,"art-halftone"),...K0(e,C)]}function c2(e,t){let r=null,n=0;for(let o of e.palette){if(t&&pv(o.color,t)<.02)continue;let i=o.area*(.35+m2(o.color))*(ae(o.color)>.86?.05:1);i>n&&(n=i,r=o.color);}return r}function v2(e,t,r,n,o){let i;if(e.photographic){let s=new Sn,{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?it(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)=>I("path",{d:s.d,fill:it(n(s.color)),fillRule:"evenodd"},`${o}-${a}`));return I("g",{transform:`translate(${Ze(r.x)} ${Ze(r.y)}) scale(${g2(r.scale)})`,children:i},o)}function Mv(e){let{art:t,image:r,size:n,kinds:o,modules:i,fg:s,bg:a,t:c,margin:u,pixelSize:l}=e,f=H0(t,r),p=h2(t,r,f),m=W0(f.width,f.height,n,"contain"),h=Math.min(1,.3+1.4*c),d=O=>wn(a,O,h),g=it(a),y=it(s),_=[v2(f,p,{x:(u+m.offsetX)*l,y:(u+m.offsetY)*l,scale:m.scale*l},d,"art-logo")],b=b2,S=(O,j)=>$n((O+u)*l,(j+u)*l,(b+.4)*l,(b+.4)*l,1.2*l),v=Ss(e.version,n).map(([O,j])=>$n((O-2.5+u)*l,(j-2.5+u)*l,6*l,6*l,l*.8)).join("");_.push(I("path",{d:S(-0.4,-0.4)+S(n-b,-0.4)+S(-0.4,n-b)+v,fill:g},"art-plates"));let x=Y0(e.version),w=ae(a),C=ae(s),P=new Float32Array(n*n),R=new Float32Array(n*n),M=new Array(n*n);for(let O=0;O<n;O++)for(let j=0;j<n;j++){let te=O*n+j,G=o[te];if(G===Pt||G===Lt){P[te]=G===Lt&&i[O]?.[j]?C:w;continue}let Y=1,de=0,Te=0,$e=0,Z=0;for(let K=0;K<4;K++)for(let J=0;J<4;J++){let Ve=j+(J+.5)/4,jr=O+(K+.5)/4,gt=x(Ve,jr)?a:d2(p,(Ve-m.offsetX)/m.scale,(jr-m.offsetY)/m.scale,a,h),Kt=ae(gt);Y=Math.min(Y,Kt),de+=Kt,Te+=gt[0],$e+=gt[1],Z+=gt[2];}P[te]=de/16,R[te]=Y,M[te]=[Te/16,$e/16,Z/16];}let T=C+.08*(w-C),L=w-.04*(w-C),D=S2(e,P,P,{base:.74-.26*c,max:.9,dark:T,light:L,margin:.23-.1*c,cap:.4+.1*c,skip:c>=.7}),B=new Sn;for(let O=0;O<n;O++)for(let j=0;j<n;j++){let te=O*n+j,G=D.diameter[te],Y=!!i[O]?.[j];if(!(G>0)||!Y&&R[te]>=w-.02)continue;let de=Y?Or(M[te],s,T,true):Or(M[te],a,L,false);B.circle(it(de,8),(j+u+.5)*l,(O+u+.5)*l,G/2*l);}return _.push(...B.toElements("art-dot")),_.push(...K0(e,y)),_}var Iv={L:.5,M:.72,Q:.88,H:1},C2=.32,E2=.55,Tv=.6,Lv=2;function P2(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 A2=e=>({cx:e.cx,cy:e.cy,w:e.plateW,h:e.plateH,r:e.radius});function R2(e,t,r){return M2(t+.5,r+.5,e)<E2}function Nv(e,t){let r=A2(e),n=E2+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++)R2(r,l,u)&&c.push(u*t+l);return c}var Ov=e=>Math.floor(e.correctable*Tv);function G0(e,t,r){let n=P2(e,t,r.size),o=Ov(r);return $s(r,Nv(n,r.size)).every(i=>i<=o)}function k2(e,t,r){if(G0(r,t,e))return r;let n=0,o=r;if(!G0(n,t,e))return -1;for(;o-n>1/64;){let i=(n+o)/2;G0(i,t,e)?n=i:o=i;}return n}var gu=new Map;function zv(e,t){let r=`${e.version}${e.level}:${t.toFixed(3)}`,n=gu.get(r);return n===void 0&&(n=k2(e,t,C2*e.size),gu.size>=64&&gu.clear(),gu.set(r,n)),n}function Fv(e,t){let{size:r,t:n,modules:o,version:i}=e,s=mv(o),a=(.18+.15*n)*Iv[s],c=t.width/t.height,u=Math.min(C2,a)*r,l=xs(i,s),f=Math.max(0,zv(l,c));if(f<Lv)return {wantedBox:u,maxBox:f,box:0,plate:null};let p=k2(l,c,Math.min(u,f));return p<0?{wantedBox:u,maxBox:f,box:0,plate:null}:{wantedBox:u,maxBox:f,box:p,plate:P2(p,c,r)}}function M2(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 I2(e,t){let{fg:r,bg:n,t:o}=e,i=ae(r),s=ae(n),a=c2(t),c=Math.min(1,o/.6),u=a?Or(a,r,i+.3*(s-i),true):r,l=wn(r,u,c),f=a?c2(t,a):null,p=i+.42*(s-i),m=f&&ae(f)<=p+.22?wn(r,Or(f,r,p,true),c):l;return {body:l,inner:m}}function Dv(e){let{art:t,image:r,size:n,kinds:o,modules:i,bg:s,margin:a,pixelSize:c,version:u}=e,l=H0(t,r),f=Fv(e,l).plate,{body:p}=I2(e,l),m=it(p),h=f&&A2(f),d=i.map(M=>[...M]);for(let M=0;M<n;M++)for(let T=0;T<n;T++){let L=o[M*n+T];(L===Lt||h&&L!==Pt&&R2(h,T,M))&&(d[M][T]=false);}let g=[],y=e.body?.(d);if(y)g.push(I("g",{fill:m,children:y},"art-body"));else {let M=new Sn;for(let T=0;T<n;T++)for(let L=0;L<n;L++)d[T]?.[L]&&o[T*n+L]!==Pt&&M.circle(m,(L+a+.5)*c,(T+a+.5)*c,.45*c);g.push(...M.toElements("art-body"));}let _=Ss(u,n).filter(([M,T])=>!h||M2(M+.5,T+.5,h)>3.2);if(_.length>0&&g.push(I("path",{d:y2(_,a,c),fill:m,fillRule:"evenodd"},"art-alignment")),!f)return g;let b=h2(t,r,l),S=(f.cx-f.plateW/2+a)*c,v=(f.cy-f.plateH/2+a)*c,x=f.plateW*c,w=f.plateH*c,C=f.radius*c,P=.1*c,R=$n(S,v,x,w,C);return g.push(I("path",{d:R,fill:it(s)},"art-plate"),I("path",{d:R+$n(S+P,v+P,x-2*P,w-2*P,C-P),fill:it(wn(s,p,.16)),fillRule:"evenodd"},"art-plate-ring"),v2(l,b,{x:(f.cx-f.logoW/2+a)*c,y:(f.cy-f.logoH/2+a)*c,scale:f.logoW/l.width*c},M=>M,"art-logo")),g}function J0(e){let{art:t}=e;if(t.mode!=="logo"||t.matchEyes===false)return null;let r=t.image&&V0(t.image);if(!r)return null;let n=jo(e.fgColor,[0,0,0]),o=jo(e.bgColor,[1,1,1]),i=_2(t,n,o);if(i<=0)return null;let s=H0(t,r);if(s.palette.length===0)return null;if(_u(t)==="badge"){let{body:h,inner:d}=I2({fg:n,bg:o,t:i},s),g={outer:it(h),inner:it(d)};return {topLeft:g,topRight:g,bottomLeft:g}}let a=ae(n),c=ae(o),u=Math.min(1,i/.6),l=e.version*4+17,f=W0(s.width,s.height,l,"contain"),p=.45*Math.max(s.width,s.height),m=(h,d)=>{let g=(h-f.offsetX)/f.scale,y=(d-f.offsetY)/f.scale,_=null,b=0;for(let v of s.palette){if(ae(v.color)>.86)continue;let x=(v.cx-g)**2+(v.cy-y)**2,w=v.area*(.35+m2(v.color))*Math.exp(-x/(2*p**2));w>b&&(b=w,_=v.color);}if(!_)return {};let S=Or(_,n,a+.42*(c-a),true);return {inner:it(wn(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 Zv=16384;var T2=e=>e*3+3&-4,eg=(e,t)=>Math.floor((e*t+255*(255-t)+127)/255);function tg(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=T2(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]=eg(h,f),i[u+1]=eg(m,f),i[u+2]=eg(p,f)),c+=4,u+=3;}}return i}function rg(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+T2(r)*n}function bu(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=tg(r,e.width,e.height);if(!rg(n))throw new Error("Could not write a BMP file");return new Blob([n],{type:"image/bmp"})}function pe(e){if(e.length===0)return "";let[t,...r]=e;return `M${$(t[0])} ${$(t[1])}${r.map(([n,o])=>`L${$(n)} ${$(o)}`).join("")}Z`}function ce(e,t,r){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(r)} 0 1 1 ${$(e-r)} ${$(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${$(f)} ${$(f)} 0 0 1 ${$(p)} ${$(m)}`:"";return `M${$(e+s)} ${$(t)}H${$(e+r-a)}${l(a,e+r,t+a)}V${$(t+n-c)}${l(c,e+r-c,t+n)}H${$(e+u)}${l(u,e,t+n-u)}V${$(t+s)}${l(s,e+s,t)}Z`}function qo(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 Wo(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 vs(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 Ho(e,t,r){let n=r/2,o=(i,s)=>`${$(e+i*n)} ${$(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 L2(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 xu(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 vn(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)}var Bv=["horizontal-line","liquid","liquid-horizontal","liquid-vertical","classy","classy-rounded","leaf","plus","hexagon","star","heart","random-dots","mosaic","octagon"];function N2(e){return Bv.includes(e)}var O2={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 $u(e,t){if(e===void 0||!Number.isFinite(e))return 1;let r=t?O2[t]??1:Xn;return Math.min(mi,Math.max(Xn,r,e))}function Uv(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}function Gv(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 ng(e){let t=(e-17)/4,r=Number.isInteger(t)?Gv(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 Qv={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 Vv(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 pe([[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 pe(qo(t,r,n*.54,6));case "star":return pe(Wo(t,r+n*.04,n*.62,n*.34));case "heart":return Ho(t,r+n*.02,n*1.08);case "random-dots":return ce(t,r,n*(.38+.15*xu(o,i)));case "mosaic":{let s=n*(.8+.14*xu(o,i,1))/2,a=[[t-s,r-s],[t+s,r-s],[t+s,r+s],[t-s,r+s]];return pe(L2(a,t,r,(xu(o,i,2)-.5)*16))}case "octagon":return pe(qo(t,r,n*.48/Math.cos(Math.PI/8),8,22.5));default:return ce(t,r,n*.45)}}function z2(e,t){let{margin:r,pixelSize:n,pattern:o}=t,i=$u(t.scale,o),s=e.length,a=t.plain?()=>false:ng(s),c=(d,g)=>!t.plain&&Uv(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=Qv[o];for(let d=0;d<s;d++)for(let g=0;g<s;g++){if(!u(g,d))continue;let y=l(g),_=l(d);if(a(g,d)){f.push(k`M${y-n/2} ${_-n/2}h${n}v${n}h${-n}z`);continue}if(!m){p.push(Vv(o,y,_,n*i,g,d));continue}let b=n*m.thickness*i/2,S=m.horizontal&&u(g+1,d),v=m.horizontal&&u(g-1,d),x=m.vertical&&u(g,d-1),w=m.vertical&&u(g,d+1),P=[!(x||v),!(x||S),!(w||S),!(w||v)].map((R,M)=>R?b*m.radius(M):0);p.push(Q(y-b,_-b,2*b,2*b,P)),2*b<n&&(S&&p.push(Q(y,_-b,n,2*b)),w&&p.push(Q(y-b,_,2*b,n)));}if(m?.fillets&&i===1){let d=n*.3;for(let g=0;g<s;g++)for(let y=0;y<s;y++){if(u(y,g)||c(y,g))continue;let _=l(y)-n/2,b=l(g)-n/2,S=_+n,v=b+n;u(y-1,g)&&u(y,g-1)&&u(y-1,g-1)&&p.push(k`M${_} ${b}h${d}A${d} ${d} 0 0 0 ${_} ${b+d}Z`),u(y+1,g)&&u(y,g-1)&&u(y+1,g-1)&&p.push(k`M${S} ${b}v${d}A${d} ${d} 0 0 0 ${S-d} ${b}Z`),u(y+1,g)&&u(y,g+1)&&u(y+1,g+1)&&p.push(k`M${S} ${v}h${-d}A${d} ${d} 0 0 0 ${S} ${v-d}Z`),u(y-1,g)&&u(y,g+1)&&u(y-1,g+1)&&p.push(k`M${_} ${v}v${-d}A${d} ${d} 0 0 0 ${_+d} ${v}Z`);}}let h=[];return p.length>0&&h.push(I("path",{d:p.join("")},"modules")),f.length>0&&h.push(I("path",{d:f.join("")},"alignment")),h}var Mk=(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);},jv=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);});}})},F2=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 jv(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 Ik(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 og=(e,t=0)=>{for(let r=t;r<e.length;r++)if(e[r]?.continue!==true)return true;return false};function zr(e,t=[],r={}){return {...r,run(n){let o=e({value:n,issues:[]}),i=og(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=og(o.issues,a));}return o}}}function qv(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 En=(e,t)=>({path:[],message:`Invalid input: expected ${e}, received ${qv(t)}`}),Wv={string:"characters",array:"items"};function ar(e,t,r,n){let o=Wv[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 ig=e=>typeof e=="string"?`"${e}"`:`${e}`,U2=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ug(e,t,r){for(let n of r)n.path.unshift(t),e.push(n);}var Hv=e=>e>=55296&&e<=56319,Xv=e=>e>=56320&&e<=57343;function Yv(e){let t=e.length;for(let r=0;r<e.length-1;r++)Hv(e.charCodeAt(r))&&Xv(e.charCodeAt(r+1))&&(t--,r++);return t}var G2=e=>Array.isArray(e)?"array":typeof e=="string"?"string":"unknown",Ps=e=>({run(t){t.value<e&&t.issues.push(ar(false,"number",e,true));}}),As=e=>({run(t){t.value>e&&t.issues.push(ar(true,"number",e,true));}}),Ko=(e,t="Invalid input")=>({run(r){e(r.value)||r.issues.push({path:[],message:t,continue:true});}}),Q2=e=>typeof e=="string"?Yv(e):e.length,V2=e=>({hasLength:true,run(t){let r=t.value;Q2(r)<e&&t.issues.push(ar(false,G2(r),e,true));}}),lg=e=>({hasLength:true,run(t){let r=t.value;Q2(r)>e&&t.issues.push(ar(true,G2(r),e,true));}}),j2=(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});}}),Kv={run(e){let t=e.value;Number.isInteger(t)?Number.isSafeInteger(t)||e.issues.push(t>0?ar(true,"int",Number.MAX_SAFE_INTEGER,true):ar(false,"int",Number.MIN_SAFE_INTEGER,true)):e.issues.push({...En("int",t),continue:false});}},Pn=(...e)=>zr(t=>{let r=t.value;return typeof r=="number"&&Number.isFinite(r)||t.issues.push(En("number",r)),t},e),q2=(...e)=>Pn(Kv,...e),wu=(...e)=>zr(t=>(typeof t.value!="string"&&t.issues.push(En("string",t.value)),t),e);function Rt(e){let t=e.length===1?`Invalid input: expected ${ig(e[0])}`:`Invalid option: expected one of ${e.map(ig).join("|")}`;return zr(r=>(e.includes(r.value)||r.issues.push({path:[],message:t}),r),[],{values:e})}var At=e=>Rt([e]),we=e=>({optional:true,run:t=>t===void 0?{value:t,issues:[]}:e.run(t)});function Me(e,t=[]){let r=Object.keys(e),n=new Set(r);return zr(o=>{let i=o.value;if(!U2(i))return o.issues.push(En("object",i)),o;let s={};for(let c of r){let u=e[c],l=u.run(i[c]),f=c in i;ug(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(ig).join(", ")}`,continue:true}),o},t,{shape:e})}function sg(e,t,r){let n=[];return t!==void 0&&n.push(V2(t)),r!==void 0&&n.push(lg(r)),zr(o=>{let i=o.value;if(Array.isArray(i)&&r!==void 0&&i.length>r)return o.issues.push(ar(true,"array",r,false)),o;if(!Array.isArray(i))return o.issues.push(En("array",i)),o;let s=new Array(i.length);for(let a=0;a<i.length;a++){let c=e.run(i[a]);ug(o.issues,a,c.issues),s[a]=c.value;}return o.value=s,o},n)}function ag(e){return zr(t=>{let r=t.value;if(!Array.isArray(r))return t.issues.push(En("tuple",r)),t;if(r.length<e.length)return t.issues.push(ar(false,"array",e.length,void 0)),t;r.length>e.length&&t.issues.push(ar(true,"array",e.length,void 0));let n=[];return e.forEach((o,i)=>{let s=o.run(r[i]);ug(t.issues,i,s.issues),n[i]=s.value;}),t.value=n,t})}function Yo(e){return zr(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=>!og(o.issues));return n.length===1?n[0]:(t.issues.push({path:[],message:"Invalid input"}),t)})}function W2(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 zr(o=>{let i=o.value;if(!U2(i))return o.issues.push(En("object",i)),o;let s=r.get(i[e]);return s?s.run(i):(o.issues.push({path:[e],message:n}),o)})}var Jv=Ko(_r,`Numbers may have at most ${ee.maxDecimals} decimals`),vu=[Ps(-ee.maxCoordinate),As(ee.maxCoordinate),Jv],Be=Pn(...vu),Ye=Pn(...vu,Ko(e=>e>0,"Must be greater than 0")),Su=Pn(...vu,Ko(e=>e>=0,"Must not be negative")),Es=wu(j2(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,"Use a #rgb or #rrggbb color")),D2=Yo([Rt(gi),Es]),H2=e=>Me({mix:ag([e,e]),amount:Pn(Ps(0),As(1),Ko(_r))}),Xo=Yo([D2,H2(D2)]),e7=Yo([Es,H2(Yo([Rt(["frame","accent","background"]),Es]))]),Cn=Yo([Xo,Me({gradient:Me({from:Xo,to:Xo,direction:we(Rt(["horizontal","vertical"])),steps:we(q2(Ps(2),As(ee.maxGradientSteps)))})})]),cg=()=>({x:Be,y:Be,width:Ye,height:Ye}),Cs=Me({color:Xo,width:Ye}),t7=W2("type",[Me({type:At("rect"),...cg(),radius:we(Su),fill:Cn,hole:we(Me({...cg(),radius:we(Su)})),stroke:we(Cs)}),Me({type:At("circle"),cx:Be,cy:Be,r:Ye,hole:we(Ye),fill:Cn,stroke:we(Cs)}),Me({type:At("ellipse"),cx:Be,cy:Be,rx:Ye,ry:Ye,fill:Cn,stroke:we(Cs)}),Me({type:At("polygon"),points:sg(ag([Be,Be]),3,ee.maxPolygonPoints),fill:Cn,stroke:we(Cs)}),Me({type:At("path"),d:wu(V2(2),lg(ee.maxPathLength)),fill:Cn,fillRule:we(Rt(["nonzero","evenodd"])),stroke:we(Cs)}),Me({type:At("line"),x1:Be,y1:Be,x2:Be,y2:Be,width:Ye,cap:we(Rt(["butt","round"])),dash:we(ag([Ye,Ye])),fill:Cn}),Me({type:At("icon"),icon:Rt(di),x:Be,y:Be,size:Ye,fill:Cn})]),Z2=()=>({id:wu(j2(/^[a-z][a-z0-9-]{0,31}$/)),slot:Rt(["primary","secondary","fixed"]),text:wu(lg(200)),maxLength:we(q2(Ps(1),As(ut))),color:Xo,weight:we(Rt(["bold","regular"])),collapse:we(Me({y:Be,height:Ye}))}),r7=W2("type",[Me({type:At("text"),...Z2(),box:Me(cg()),align:we(Rt(["start","middle","end"])),fontSize:we(Ye)}),Me({type:At("curved"),...Z2(),curve:Me({cx:Be,cy:Be,radius:Ye,side:Rt(["top","bottom"]),spread:we(Pn(Ps(20),As(300),Ko(_r)))}),fontSize:Ye})]),B2=Pn(...vu,Ko(e=>e>=ee.minArtboard&&e<=ee.maxArtboard,`Artboard sides must be ${ee.minArtboard} to ${ee.maxArtboard} units`)),n7=Me({kind:At(Yr),version:At(Kr),artboard:Me({width:B2,height:B2}),qr:Me({x:Be,y:Be,size:Ye,padding:we(Su),radius:we(Su),plate:we(Rt(["opaque","background","none"]))}),colors:Me({frame:Es,text:we(e7),accent:we(Es)}),shapes:sg(t7,void 0,ee.maxShapes),labels:sg(r7,void 0,ee.maxLabels),bleed:we(Yo([At("none"),Xo]))},[{run(e){ta(e.value,(t,r=[])=>{e.issues.push({path:[...r],message:t,continue:true});});}}]);function Cu(e){let t=n7.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 X2=({path:e,message:t})=>e.length>0?`${e.join(".")}: ${t}`:t;var fg=24,Fr=(e,t,r,n)=>{let o=n*Math.PI/180;return [e+r*Math.cos(o),t+r*Math.sin(o)]},Eu=([e,t])=>`${$(e)} ${$(t)}`;function Jo(e,t,r,n,o,i){let s=i-o>180?1:0;return `M${Eu(Fr(e,t,n,o))}A${$(n)} ${$(n)} 0 ${s} 1 ${Eu(Fr(e,t,n,i))}L${Eu(Fr(e,t,r,i))}A${$(r)} ${$(r)} 0 ${s} 0 ${Eu(Fr(e,t,r,o))}Z`}function Rs(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function o7(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 Y2(e){return pe(o7(e)<0?[...e].reverse():e)}function Pu(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 Y2([[e+s,t+a],[r+s,n+a],[r-s,n-a],[e-s,t-a]])}var st=(...e)=>({d:e.join(""),fillRule:"nonzero"}),cr=(...e)=>({d:e.join(""),fillRule:"evenodd"});function i7(){let e=[];for(let t of [0,60,120]){let[r,n]=Fr(12,12,10.5,t+180),[o,i]=Fr(12,12,10.5,t);e.push(Pu(r,n,o,i,2));}for(let t=0;t<6;t++){let r=t*60,[n,o]=Fr(12,12,6.2,r);for(let i of [-45,45]){let[s,a]=Fr(n,o,3.6,r+i);e.push(Pu(n,o,s,a,1.7));}}return st(...e)}var s7={wifi:()=>st(Jo(12,20,4.6,7.2,-135,-45),Jo(12,20,9.2,11.8,-135,-45),Jo(12,20,13.8,16.4,-135,-45),ce(12,20,2.2)),star:()=>st(pe(Wo(12,12.8,11.6,4.8))),heart:()=>st(Ho(12,12.4,22)),phone:()=>cr(Q(6,1.5,12,21,2.6),Q(7.8,4.2,8.4,13.4,.6),ce(12,19.8,1.1)),headphones:()=>st(Jo(12,13,7.6,9.8,-180,0),Q(2,12,5,9.5,2),Q(17,12,5,9.5,2)),calendar:()=>cr(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:()=>st(ce(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:()=>cr(Q(2,3,20,14,4),pe([[6.5,17],[11.5,17],[5.8,21.8]]),ce(7.5,10,1.5),ce(12,10,1.5),ce(16.5,10,1.5)),bag:()=>st(Q(3.5,7.5,17,14.5,2),Jo(12,7.5,3.1,4.8,-180,0)),bell:()=>st("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:()=>st("M4 6.5H17V13.5A6.5 6.5 0 0 1 4 13.5Z",Jo(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:()=>cr(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:()=>cr(ce(12,12,10.5),pe([[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:()=>cr(ce(12,12,10.5),ce(12,7.2,1.6),Q(10.6,10,2.8,8,.8)),home:()=>cr(pe([[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:()=>cr("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",ce(12,9.5,3)),share:()=>st(Pu(6,12,18,5,1.8),Pu(6,12,18,19,1.8),ce(18,5,3.2),ce(6,12,3.2),ce(18,19,3.2)),download:()=>st(Q(10.6,2,2.8,9.5,0),pe([[6,10],[18,10],[12,16.5]]),pe([[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:()=>cr(ce(12,12,10.5),ce(12,12,8.4),pe([[11,5.4],[13,5.4],[13,11.3],[16.9,13.5],[15.9,15.2],[11,12.5]])),snowflake:i7,pumpkin:()=>st(Rs(7.8,14.6,5.8,6.9),Rs(16.2,14.6,5.8,6.9),Rs(12,14.6,4.8,7.4),Q(10.9,3.4,2.2,4.6,.8),Y2([[13,4.2],[17.2,3],[16.2,5.4],[13,6]])),tree:()=>st(pe([[12,1.5],[16.8,8.2],[7.2,8.2]]),pe([[12,5.2],[19,13.6],[5,13.6]]),pe([[12,9.4],[21.2,19.2],[2.8,19.2]]),Q(10.4,18.6,3.2,3.9,.4)),sparkle:()=>st(pe(Wo(9.5,13.5,9,2.4,4)),pe(Wo(19,5,4,1.1,4))),gift:()=>st(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),Rs(8.8,4.8,2.9,1.9),Rs(15.2,4.8,2.9,1.9))};function mg(e){return s7[e]()}function K2(e){return e===" "?.3:/[MWmw@%]/.test(e)?.92:/[A-Z0-9#&]/.test(e)?.72:/[il.,:;!'|1]/.test(e)?.32:.6}function dg(e){let t=0;for(let r of e)t+=K2(r);return Math.max(t,1)}var pg=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function ks(e,t,r){let n=Pe(e)??{r:0,g:0,b:0},o=Pe(t)??{r:255,g:255,b:255},i=Math.min(1,Math.max(0,r));return `#${pg(n.r+(o.r-n.r)*i)}${pg(n.g+(o.g-n.g)*i)}${pg(n.b+(o.b-n.b)*i)}`}function J2(e,t,r,n,o,i,s,a){let c=[...e],u=o*.08,l=c.map(d=>K2(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 y=l[g],_=(h+y/2)/p;if(h+=y+u,d.trim()==="")return;let b=i==="top"?-Math.PI/2-f/2/p+_:Math.PI/2+f/2/p-_;m.push({text:d,x:t+p*Math.cos(b),y:r+p*Math.sin(b),fontSize:o,maxWidth:o*2,color:s,rotate:b*180/Math.PI+(i==="top"?90:-90),field:a});}),m}var Ms=class extends Error{issues;constructor(t){super(`Invalid frame spec: ${t.slice(0,5).join("; ")}`),this.name="FrameSpecError",this.issues=t;}},ex=new WeakMap;function An(e){if(e&&typeof e=="object"){let r=ex.get(e);if(r)return r}if(e==null)throw new Ms(['A "custom" frame needs a spec']);let t=Cu(e);if(!t.success)throw new Ms(t.issues.map(X2));return typeof e=="object"&&ex.set(e,t.data),t.data}function hg(e){let t=An(e);return ro(t)/t.qr.size}var a7=e=>{let t=Pe(e);return !!(t&&t.a>=1)};function c7(e,t){let r=Oe(t,Ne);return e.qr.plate==="none"?{color:r,plate:false}:a7(r)?{color:r,plate:true}:e.qr.plate==="background"?{color:r,plate:false}:{color:Ne,plate:true}}function Au(e,t,r=Ne){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:ks(i(s.mix[0]),i(s.mix[1]),s.amount));return {frame:n,text:a,accent:o}}function u7(e,t,r){let n=Au(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):ks(o(i.mix[0]),o(i.mix[1]),i.amount)}function tx(e,t,r=0,n=0){let o=pi(e);return o?Nl(o,t,r,n):""}function l7(e,t,r,n){return `M${$(e-r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e+r)} ${$(t)}A${$(r)} ${$(n)} 0 1 1 ${$(e-r)} ${$(t)}Z`}function f7(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,y)=>{let _=[r+c*g,n+u*g],b=[r+c*y,n+u*y];if(e.cap==="round"&&y-g>2*a){let S=[_[0]+c*a,_[1]+u*a],v=[b[0]-c*a,b[1]-u*a];return `M${$(S[0]-l)} ${$(S[1]-f)}L${$(v[0]-l)} ${$(v[1]-f)}A${$(a)} ${$(a)} 0 0 1 ${$(v[0]+l)} ${$(v[1]+f)}L${$(S[0]+l)} ${$(S[1]+f)}A${$(a)} ${$(a)} 0 0 1 ${$(S[0]-l)} ${$(S[1]-f)}Z`}return `M${$(_[0]-l)} ${$(_[1]-f)}L${$(b[0]-l)} ${$(b[1]-f)}L${$(b[0]+l)} ${$(b[1]+f)}L${$(_[0]+l)} ${$(_[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 m7(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:ce(e.cx*t,e.cy*t,e.r*t)+(e.hole?ce(e.cx*t,e.cy*t,e.hole*t):""),fillRule:e.hole?"evenodd":"nonzero"};case "ellipse":return {type:"path",d:l7(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:tx(e.d,t),fillRule:e.fillRule??"nonzero"};case "line":return f7(e,t);default:{let r=mg(e.icon);return {type:"path",d:tx(r.d,e.size*t/fg,e.x*t,e.y*t),fillRule:r.fillRule}}}}function p7(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"}]:Jt(e.d)}function d7(e,t,r){let n=p7(e),o=Ks(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 y of g)c=Math.min(c,a(y)),u=Math.max(u,a(y));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 y=c+m*g/l,_=Math.min(u,c+m*(g+1)/l+(g+1<l?h:0)),b=s?{x0:Number.NEGATIVE_INFINITY,x1:Number.POSITIVE_INFINITY,y0:y,y1:_}:{x0:y,x1:_,y0:Number.NEGATIVE_INFINITY,y1:Number.POSITIVE_INFINITY},S=o.map(v=>Yn(v,b)).filter(v=>v.length>2);S.length!==0&&d.push({type:"path",d:G1(S),fill:ks(f,p,(g+.5)/l),fillRule:i});}return d}function h7(e,t,r){let n=m7(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=d7(n,e.fill.gradient,r);return o?[...i,{...n,fill:"none",...o}]:i}return [{...n,fill:r(e.fill),...o}]}function g7(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 to(n,r)}function y7(e){return e===void 0||!Number.isFinite(e)?1:Math.min(gr,Math.max(Hr,e))}function _7(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:y,side:_,spread:b=140}=e.curve,S=y*n*(b*Math.PI/180),v=Math.min(e.fontSize*n*r,S/(dg(t)+.08*t.length));return J2(t,d*n,g*n,y*n,v,_,s,i).map(x=>({...x,...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*Bl)*n,m=Math.min(p*r,f*hi,l/dg(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 b7(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 x7(e,t){let r=pi(e);return r?Nl(b7(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 $7(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:x7(e.d,t)};case "line":return {...e,y1:t(e.y1),y2:t(e.y2)};default:return {...e,y:t(e.y)}}}function w7(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}=Ul(o);return !(i&&n(i.y0,i.y1))}).map(o=>$7(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 Is(e,t,r,n,o={}){let i=new Map(t.labels.map(g=>[g.id,g7(g,r)])),s=w7(t,t.labels.flatMap(g=>g.collapse&&!i.get(g.id)?[g.collapse]:[])),a=e/s.qr.size,c=c7(s,n),u=u7(r,s,c.color),l=s.shapes.flatMap(g=>h7(g,a,u));if(c.plate){let g=ro(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=y7(r.fontScale),p=s.labels.flatMap(g=>{let y=i.get(g.id);if(!y)return [];let _=(g.slot==="fixed"?void 0:o[g.slot])??g.id;return _7(g,y,f,a,u,_)}),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 gg(e,t,r){return Is(e,An(t.spec),t,r)}var rx={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 yg={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 nx={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 ox={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 ix={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 sx={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 ax={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 cx={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 ux={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 Ru={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 lx={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 fx={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 mx={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 px={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 dx={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 hx={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 gx={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 yx={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 _x={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 Ue=(e,t,r,n,o)=>({style:e,name:t,tags:o,labelOn:n,spec:r}),_g=[Ue("banner-bottom","Banner",yg,"frame",["bottom","band"]),Ue("banner-top","Top banner",nx,"frame",["top","band"]),Ue("banner-top-bottom","Two banners",ox,"frame",["top","bottom","band"]),Ue("border","Border",ix,"background",["square","outline"]),Ue("rounded-border","Rounded",px,"background",["border","outline"]),Ue("gradient-border","Gradient",Ru,"background",["border","colorful"]),Ue("focus","Focus",ux,"background",["corners","brackets"]),Ue("speech-bubble","Bubble",dx,"frame",["speech"]),Ue("speech-bubble-top","Bubble top",hx,"frame",["speech"]),Ue("chat-bubble","Chat",sx,"frame",["message","bubble"]),Ue("circle","Circle",ax,"frame",["round","ring","curved"]),Ue("badge","Ribbon",rx,"frame",["badge","banner"]),Ue("sticker","Sticker",gx,"frame",["label"]),Ue("polaroid","Polaroid",mx,"frame",["photo","picture"]),Ue("phone","Phone",fx,"background",["mobile","screen"]),Ue("ticket","Ticket",_x,"frame",["event","pass"]),Ue("tag","Tag",yx,"frame",["price","label"]),Ue("envelope","Envelope",cx,"frame",["mail","letter"]),Ue("menu-card","Menu card",lx,"background",["menu","restaurant"])],U7=new Map(_g.map(e=>[e.style,e]));function bg(e){return U7.get(e)}var G7=Object.fromEntries(_g.map(e=>[e.style,e.spec])),Q7={from:Ru.colors.frame,to:Ru.colors.accent};function ku(e){return !e||e.style==="none"?null:e.style===Jr?e.spec??null:bg(e.style)?.spec??null}function V7(e){let t=ku(e);return e&&typeof t?.colors?.frame=="string"?Au(t,e):null}var j7={primary:"text",secondary:"secondaryText"};function bx(e,t,r){let n=bg(t.style)?.spec??yg;return Is(e,An(n),t,r,j7)}var Iu="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif",$x=.08,wx="data-qrdx-frame-label";function bt(e){return !!(e?.style&&e.style!=="none")}function xg(e){let t=ku(e);return t?hg(t):$x}function q7(e){return (e.text??Cl).trim().slice(0,ut)}function W7(e){return (e.secondaryText??"").trim().slice(0,ut)}function Rn(e,t,r){return t.style===Jr?gg(e,t,r):bx(e,t,r)}function ur(e,t){if(!bt(t))return {width:e,height:e};let{width:r,height:n}=Rn(e,t);return {width:r,height:n}}var ge=e=>se(e,2);function xx({x:e,y:t,width:r,height:n,radius:o}){let i=ge(Math.min(o,r/2,n/2)),[s,a,c,u]=[ge(e),ge(t),ge(r),ge(n)];return i<=0?k`M${s} ${a}h${c}v${u}h${-c}z`:k`M${s+i} ${a}h${ge(c-2*i)}a${i} ${i} 0 0 1 ${i} ${i}`+k`v${ge(u-2*i)}a${i} ${i} 0 0 1 ${-i} ${i}`+k`h${ge(-(c-2*i))}a${i} ${i} 0 0 1 ${-i} ${-i}`+k`v${ge(-(u-2*i))}a${i} ${i} 0 0 1 ${i} ${-i}z`}function Mu(e){return e.stroke&&e.strokeWidth?{stroke:e.stroke,strokeWidth:ge(e.strokeWidth)}:{}}function Sx(e,t){return e.type==="rect"&&e.hole?I("path",{d:xx(e)+xx(e.hole),fill:e.fill,fillRule:"evenodd",...Mu(e)},t):e.type==="polygon"?I("polygon",{fill:e.fill,points:e.points.map(([r,n])=>`${ge(r)},${ge(n)}`).join(" "),...Mu(e)},t):e.type==="path"?I("path",{d:e.d,fill:e.fill,...e.fillRule==="evenodd"&&{fillRule:"evenodd"},...Mu(e)},t):hu("rect",{...Mu(e),fill:e.fill,height:ge(e.height),key:t,width:ge(e.width),x:ge(e.x),y:ge(e.y),...e.radius>0&&{rx:ge(e.radius),ry:ge(e.radius)}})}function vx(e){return e.shapes.map((t,r)=>Sx(t,r))}function Tu(e,t){let{size:r,frame:n,bgColor:o,svgProps:i,markLabels:s}=t,a=Rn(r,n,o),c=Cx(a),u=ge(a.width),l=ge(a.height);return Qe("svg",{height:l,viewBox:`0 0 ${u} ${l}`,width:u,xmlns:"http://www.w3.org/2000/svg",...i,children:[I("g",{"data-qrdx-frame":n.style,children:a.shapes.map((f,p)=>Sx(f,p))}),Go(e,{x:ge(a.qrX),y:ge(a.qrY),width:r,height:r}),c.map((f,p)=>I("text",{"data-max-width":ge(f.maxWidth),fill:f.color,fontFamily:Iu,fontSize:ge(f.fontSize),fontWeight:f.fontWeight??700,textAnchor:f.align??"middle",x:ge(f.x),y:ge(f.y),...f.rotate&&{transform:`rotate(${ge(f.rotate)} ${ge(f.x)} ${ge(f.y)})`},...s&&f.field&&{[wx]:f.field},children:f.text},p))]})}function Cx(e){return [...e.label?[e.label]:[],...e.extraLabels??[]]}var H7={2:6,3:12};function Ex(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=H7[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 Ax(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 Rx(e,t){let r=0;for(let n of e)if(n<t)r++;else break;return r%2===1}function X7(e,t,r){return Rx(Ax(e,r),t)}function kx(e){let t=new Map;return (r,n)=>{let o=t.get(n);return o||(o=Ax(e,n),t.set(n,o)),Rx(o,r)}}function Y7(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 K7(e,t,r){if(!X7(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,Y7(t,r,o[i],o[(i+1)%o.length]));return Number.isFinite(n)?n:0}function J7(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 Mx(e){let t=e.map(Ex),r=J7(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?K7(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,y=r.y0+o*h/a,_=i(g,y);_>s.value&&(s={cx:g,cy:y,value:_});}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 y=-2;y<=2;y++){let _=d.cx+c*y/2,b=d.cy+u*g/2,S=i(_,b);S>s.value&&(s={cx:_,cy:b,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(Ex),half:s.value}}function Ix(e,t){let r=([o,i])=>`${$(o*t)} ${$(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 e8={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]]]},Px;function Tx(){return Px??=Mx([e8]),Px}function t8(e){let{width:t,height:r,cells:n}=e;return Number.isInteger(t)&&Number.isInteger(r)&&t>=kt&&r>=kt&&t<=wt&&r<=wt&&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 lr=([e,t])=>`${e},${t}`;function r8(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(lr(l))??[];p.push(f),o.set(lr(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],y=[u-.5,c];switch((l?8:0)+(f?4:0)+(p?2:0)+(m?1:0)){case 1:case 14:i(y,g);break;case 2:case 13:i(g,d);break;case 3:case 12:i(y,d);break;case 4:case 11:i(h,d);break;case 6:case 9:i(h,g);break;case 7:case 8:i(y,h);break;case 5:i(h,d),i(y,g);break;case 10:i(y,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(lr(h));){a.add(lr(h)),p.push(h);let d=n8(o.get(lr(h))??[],m,a);if(!d)break;m=h,h=d;}p.length>=3&&s.push(o8(p));}return s}function n8(e,t,r){let n=lr(t);return e.find(o=>lr(o)!==n&&!r.has(lr(o)))??e.find(o=>lr(o)!==n)}function o8(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 i8(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 Ts=new Map;function $g(e){let t=`${e.width}x${e.height}:${e.cells}`,r=Ts.get(t);if(r)return r;let n=t8(e),o;if(!n)o={outline:null,problem:"invalid"};else if(e.cells.includes("1")){let i=r8(n,e.width,e.height),s=i.length>0?Mx(i.map(i8)):null;o=s&&2*s.half>=Tl?{outline:s,problem:null}:{outline:null,problem:s?"thin":"empty"};}else o={outline:null,problem:"empty"};return Ts.size>16&&Ts.delete(Ts.keys().next().value),Ts.set(t,o),o}var s8=1,Lx=.5,Nx=.5,a8=.5;function kn(e){return Math.max(e,Il)}function Lu(e){return e==="heart"?Tx():typeof e=="object"&&e?.type==="silhouette"?$g(e).outline:null}function wg(e){return e==="circle"||Lu(e)!==null}var c8={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 u8(e){let{outline:t,problem:r}=$g(e);if(t&&!r)return {ok:true,share:2*t.half};let n=r??"invalid";return {ok:false,reason:n,message:c8[n]}}function at(e,t,r){if(r==="circle"){let s=kn(t),a=(e/2+s)*Math.SQRT2+s8;return Math.ceil(a-e/2)}let n=Lu(r);if(!n)return t;let o=kn(t),i=(e+2*(o+a8))/(2*n.half);return Math.ceil((i-e)/2-1e-9)}function Ox(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 l8(e,t,r){let n=at(t,r,"circle"),o=kn(r),i=t+2*n,s=i/2,a=s-Lx-.5,c=Ox(Number.parseInt(vn(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()<Nx;return h>=u&&h<l&&p>=u&&p<l?false:d&&Math.hypot(h+.5-s,p+.5-s)<=a}))}var f8=Array.from({length:8},(e,t)=>{let r=t*Math.PI/4;return [Math.cos(r),Math.sin(r)]});function zx(e,t,r,n){if(n==="circle")return l8(e,t,r);let o=Lu(n);if(!o)return null;let i=at(t,r,n),s=kn(r),a=t+2*i,c=kx(o.polygons),u=.5+Lx,l=(h,d)=>{let g=h+.5,y=d+.5;return c(g/a,y/a)?f8.every(([_,b])=>c((g+_*u)/a,(y+b*u)/a)):false},f=Ox(Number.parseInt(vn(e),36)||1),p=i-s,m=i+t+s;return Array.from({length:a},(h,d)=>Array.from({length:a},(g,y)=>{let _=f()<Nx;return y>=p&&y<m&&d>=p&&d<m?false:_&&l(y,d)}))}function Sg(e,t){if(e==="circle")return {circle:t/2};let r=Lu(e);return r?{path:Ix(r,t)}:null}function m8(e,t){let r=Sg(e,t);return r?"circle"in r?ce(t/2,t/2,r.circle):r.path:null}function p8(e){return e==="top-left"?0:e==="top-right"?1:3}function Nu(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=p8(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 I("path",{d:Q(e-r,t-r,i,i,m)})}case "extra-rounded":return I("path",{d:Q(e-r,t-r,i,i,1.15*a)});case "plus":{let c=1.15*a,u=r;return I("path",{d:pe([[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 I("path",{d:Q(e-r,t-c,i,2*c,u)+Q(e-c,t-r,2*c,i,u)})}case "hexagon":return I("path",{d:pe(qo(e,t,1.72*a,6))});case "octagon":return I("path",{d:pe(qo(e,t,r/Math.cos(Math.PI/8),8,22.5))});case "flower":{let c=.6*a,u=.9*a;return I("path",{d:ce(e-c,t-c,u)+ce(e+c,t-c,u)+ce(e+c,t+c,u)+ce(e-c,t+c,u)+ce(e,t,1.2*a)})}case "heart":return I("path",{d:Ho(e,t+.12*a,3.5*a)});case "squircle":return I("path",{d:pe(vs(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(ce(e+l*a*.82,t+u*a*.82,.58*a));return I("path",{d:c.join("")})}case "square":return I("rect",{height:$(i),transform:k`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "rounded":return I("rect",{height:$(i),rx:$(r*.5),ry:$(r*.5),transform:k`rotate(0,${e},${t})`,width:$(i),x:$(e-s),y:$(t-s)});case "diamond":return I("path",{d:k`M ${e-s*.714286} ${t-s*.714286}v ${i*.714286}h ${i*.714286}v -${i*.714286}z`,transform:k`rotate(45,${e},${t})`});case "message":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=k`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 I("path",{clipRule:"evenodd",d:f,transform:k`rotate(0,${e},${t})`})}case "message-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=k`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 I("path",{clipRule:"evenodd",d:f,transform:k`rotate(-180,${e},${t})`})}case "diya":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=k`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 I("path",{clipRule:"evenodd",d:f,transform:k`rotate(0,${e},${t})`})}case "diya-reverse":{let c=i/30,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=k`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 I("path",{clipRule:"evenodd",d:f,transform:k`rotate(0,${e},${t})`})}case "rounded-triangle":{let c=i/21,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=k`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 I("path",{d:f,transform:k`rotate(45,${e},${t})`})}case "star":{let c=i/27,u=p=>(p-40)*c+e,l=p=>(p-40)*c+t,f=k`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 I("path",{clipRule:"evenodd",d:f,transform:k`rotate(0,${e},${t})`})}case "banner":{let c=i/28;return I("g",{transform:k`translate(${e-40*c},${t-40*c}) scale(${$(c,6)})`,children:I("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 I("circle",{cx:$(e),cy:$(t),r:$(r),transform:k`rotate(0,${e},${t})`})}}function ei(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 Fx(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 Dx(e,t,r,n){let o=r/7,i=Math.max(0,(n+Math.SQRT2-2)*o);return pe(Fx(e,t,r,n*o))+pe(Fx(e+o,t+o,5*o,i))}function Zx(e,t,r,n,o=false){let i=r/7,s=a=>o?ei(n,0,a,true):ei(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 d8(e,t,r,n){let o=r/7;return Q(e,t,r,r,ei(n,2.6*o,0,false))+Q(e+o,t+o,5*o,5*o,ei(n,1.6*o,0,false))}function h8(e,t,r){let n=r/7,o=e+r/2,i=t+r/2;return pe(vs(o,i,3.5*n,3.5*n,4,96))+pe(vs(o,i,2.5*n,2.5*n,4,96))}function Bx(e,t,r,n,o){let i=n,s=r/2,a=(s-i)*.55,c=(u,l)=>k`${e+u} ${t+l}`;return k`M${c(i,0)}`+k`C${c(i+a,0)} ${c(s-a,o)} ${c(s,o)}`+k`C${c(s+a,o)} ${c(r-i-a,0)} ${c(r-i,0)}`+k`A${i} ${i} 0 0 1 ${c(r,i)}`+k`C${c(r,i+a)} ${c(r-o,s-a)} ${c(r-o,s)}`+k`C${c(r-o,s+a)} ${c(r,r-i-a)} ${c(r,r-i)}`+k`A${i} ${i} 0 0 1 ${c(r-i,r)}`+k`C${c(r-i-a,r)} ${c(s+a,r-o)} ${c(s,r-o)}`+k`C${c(s-a,r-o)} ${c(i+a,r)} ${c(i,r)}`+k`A${i} ${i} 0 0 1 ${c(0,r-i)}`+k`C${c(0,r-i-a)} ${c(o,s+a)} ${c(o,s)}`+k`C${c(o,s-a)} ${c(0,i+a)} ${c(0,i)}`+k`A${i} ${i} 0 0 1 ${c(i,0)}Z`}function g8(e,t,r){let n=r/7,o=.12*n;return Bx(e,t,r,1.4*n,o)+Bx(e+n,t+n,5*n,.7*n,o)}function Ux(e,t,r,n,o,i){let s=r/2,a=(c,u)=>k`${e+c} ${t+u}`;return k`M${a(n,0)}H${e+r-n}`+k`A${n} ${n} 0 0 1 ${a(r,n)}`+k`V${t+o}`+k`C${a(r,o+1.55*i)} ${a(s+1.6*i,r)} ${a(s,r)}`+k`C${a(s-1.6*i,r)} ${a(0,o+1.55*i)} ${a(0,o)}`+k`V${t+n}A${n} ${n} 0 0 1 ${a(n,0)}Z`}function y8(e,t,r){let n=r/7;return Ux(e,t,r,.7*n,3.9*n,n)+Ux(e+n,t+n,5*n,.35*n,2.7*n,.8*n)}function _8(e,t,r,n){let o=r/7;return Q(e,t,r,r,ei(n,.5*o,2.5*o,false))+Q(e+o,t+o,5*o,5*o,ei(n,.25*o,1.5*o,false))}function b8(e,t,r){let n=r/7;return k`M ${e} ${t}v ${r}h ${r}v -${r}z`+k`M ${e+n} ${t+n}h ${5*n}v ${5*n}h -${5*n}z`}function x8(e,t,r){let n=r/7,o=n*.875,i=n*.4375,s=k`M ${e+o} ${t}`+k`h ${r-2*o}`+k`a ${o} ${o} 0 0 1 ${o} ${o}`+k`v ${r-2*o}`+k`a ${o} ${o} 0 0 1 ${-o} ${o}`+k`h ${-(r-2*o)}`+k`a ${o} ${o} 0 0 1 ${-o} ${-o}`+k`v ${-(r-2*o)}`+k`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=k`M ${e+n+i} ${t+n}`+k`h ${5*n-2*i}`+k`a ${i} ${i} 0 0 1 ${i} ${i}`+k`v ${5*n-2*i}`+k`a ${i} ${i} 0 0 1 ${-i} ${i}`+k`h ${-(5*n-2*i)}`+k`a ${i} ${i} 0 0 1 ${-i} ${-i}`+k`v ${-(5*n-2*i)}`+k`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function $8(e,t,r){let n=e+r/2,o=t+r/2,i=se(r/2),s=se(r*(2.5/7));return k`M ${n-i} ${o}`+k`a ${i} ${i} 0 1 0 ${i*2} 0`+k`a ${i} ${i} 0 1 0 ${-i*2} 0z`+k`M ${n-s} ${o}`+k`a ${s} ${s} 0 1 1 ${s*2} 0`+k`a ${s} ${s} 0 1 1 ${-s*2} 0z`}function w8(e,t,r){let n=r/74.7002,o=a=>a*n+e,i=a=>a*n+t;return k`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 vg(e){let t=e/70;return {scale:t,transform:(n,o)=>(n-5)*t+o}}function S8(e,t,r){let{scale:n,transform:o}=vg(r);return k`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 v8(e,t,r){let n=r/7,o=n*1.5,i=n*.75,s=k`M ${e+o} ${t}`+k`h ${r-2*o}`+k`a ${o} ${o} 0 0 1 ${o} ${o}`+k`v ${r-2*o}`+k`a ${o} ${o} 0 0 1 ${-o} ${o}`+k`h ${-(r-2*o)}`+k`a ${o} ${o} 0 0 1 ${-o} ${-o}`+k`v ${-(r-2*o)}`+k`a ${o} ${o} 0 0 1 ${o} ${-o}z`,a=k`M ${e+n+i} ${t+n}`+k`h ${5*n-2*i}`+k`a ${i} ${i} 0 0 1 ${i} ${i}`+k`v ${5*n-2*i}`+k`a ${i} ${i} 0 0 1 ${-i} ${i}`+k`h ${-(5*n-2*i)}`+k`a ${i} ${i} 0 0 1 ${-i} ${-i}`+k`v ${-(5*n-2*i)}`+k`a ${i} ${i} 0 0 1 ${i} ${-i}z`;return s+a}function C8(e,t,r){let{scale:n,transform:o}=vg(r);return k`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 E8(e,t,r){let{scale:n,transform:o}=vg(r);return k`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 P8(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 k`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 Ou(e,t,r,n,o="top-left"){switch(n){case "leaf":return Zx(e,t,r,o);case "leaf-reverse":return Zx(e,t,r,o,true);case "drop":return d8(e,t,r,o);case "octagon":return Dx(e,t,r,1.6);case "bevel":return Dx(e,t,r,1.1);case "squircle":return h8(e,t,r);case "cushion":return g8(e,t,r);case "shield":return y8(e,t,r);case "petal":return _8(e,t,r,o);case "gear":return w8(e,t,r);case "rounded":return x8(e,t,r);case "circle":return $8(e,t,r);case "diya":return S8(e,t,r);case "extra-rounded":return v8(e,t,r);case "message":return C8(e,t,r);case "pointy":return E8(e,t,r);case "curly":return P8(e,t,r);default:return b8(e,t,r)}}var zu=.22,Fu=.14;function Gx(e,t,r={}){if(e==="circle")return I("circle",{cx:$(t.x+t.w/2),cy:$(t.y+t.h/2),r:$(Math.min(t.w,t.h)/2),...r});let n=e==="rounded"?Math.min(t.w,t.h)*zu:0;return I("rect",{height:$(t.h),width:$(t.w),x:$(t.x),y:$(t.y),...n>0&&{rx:$(n),ry:$(n)},...r})}function A8(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 Du(e,t){let r=e.shape??"square",n=e.plate,o=n?A8(t,Fu):t,i=a=>I("image",{height:$(o.h),href:e.src,preserveAspectRatio:"none",width:$(o.w),x:$(o.x),y:$(o.y),...a&&{clipPath:`url(#${a})`}});if(r==="square"&&!n)return i();let s=r==="square"?void 0:`qrdx-logo-${vn(`${r}|${$(o.x)}|${$(o.y)}|${$(o.w)}|${$(o.h)}`)}`;return Qe("g",{children:[n&&Gx(r,t,{fill:n}),s&&I("clipPath",{id:s,children:Gx(r,o)}),i(s)]})}var Qx=.6,R8=["L","M","Q","H"];function Vx(e){let t=Le.QrCode.encodeText(e.value,Ke[e.level]),r=R8[t.errorCorrectionLevel.ordinal]??e.level;return {code:e,cells:t.getModules(),layoutMargin:at(t.size,e.margin,e.shape),map:xs(t.version,r),level:r,version:t.version}}function jx(e,t){let{cells:r,map:n}=e,o=r.length,i=Dr(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=$s(n,a);return {worst:Math.max(0,...c),correctable:n.correctable,budget:Math.floor(n.correctable*Qx),level:e.level,version:e.version}}function Zu(e,t){return jx(Vx(e),t)}var qx=e=>!e||e.worst<=e.budget;function k8(e,t){return qx(Zu(e,t))}function Cg(e,t,r,n){let o=t.map(a=>Vx({...e,level:a})),i=a=>{let c=n(a);return o.every(u=>qx(jx(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 Bu(e,t){if(!t)return;let r=Math.floor(e.size*Ws),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??Zt,a={value:e.value,size:e.size,margin:e.margin,shape:e.shape},c=p=>xt({...e,level:s,imageSettings:p}),u=p=>{let m=Cg(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 Eg="data-qrdx-part",Wx="data-qrdx-eye",M8=["eye-outer","eye-centre","body","logo","background"];function Pg(e,t,r){if(e)return r?{[Eg]:t,[Wx]:r}:{[Eg]:t}}var Ls=300;function Xt(e){return {id:e.id,name:e.name,description:e.description,spec:e.spec,wrapper:(t,r)=>{let n=An(e.spec),o=r?.fgColor,i=(typeof o=="string"?o:Oe(o,""))||"black",s=Is(n.qr.size,n,{color:i}),{x:a,y:c,scale:u}=e.at;return I("svg",{height:Ls,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Ls} ${Ls}`,width:Ls,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:Qe("g",{"data-qrdx-template":e.id,transform:`translate(${$(a)} ${$(c)})${u===1?"":` scale(${u})`}`,children:[vx(s),I("g",{fill:"none",transform:`translate(${$(s.qrX)} ${$(s.qrY)}) scale(${s.qrSize/Ls})`,children:t})]})})}}}var Hx={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 Xx=Xt({id:"Arrow",name:"Arrow",description:"QR code with arrow",spec:Hx,at:{x:47,y:95,scale:1}});var Yx={id:"default",name:"Default",description:"Simple QR code without decorative elements",wrapper:e=>I("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:I("g",{fill:"none",transform:"translate(9, 9) scale(0.95)",children:e})})};var Os=593,Zr=296.5,Ns=146.5,n$=294.5,o$=231.228,i$="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",T8="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",L8="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",Kx="3cf27f17c00j3ch21n1ek00l1el3cj1vv1kd00n3cl3cn1q31q500p3cp1vx00r1kb3cs3aw1ej21p00t3ax3ay17b27h00w3b02g20yq01w2d611m01x3b52aa14i01y24i1bq0203bd3be1q21q60253bf39e39f39h14e2ae02d39j11i2da02e39l0ym02f39n2lt0sz03a39p2ix0vv03b39r2d511n39t03d27d17f03f39x39y21l1en03h3a03a11vt1kf03j37w37x1q11q703l37z1k903n1vz3821eh03p21r38714d03t11h03u2db38a0vp2j303w2lz38g03x0st2rk0n804o38l2oo0q404p38n2iw0vw04r36f36h2a814k04u36k36l1vs1kg04z36o36p1n41t405236q36x36y0ss2m005d3720n02rs05f3742uf0kd0633763772on0q506537834y2fz0yt06834z2d311p06935235424f1bt06c35621j1ep06d3581yn1hl06e35a1sv1nd06g35b1pz1q906h35d35e35g1ef21t06l35h1bj24p06m35k35l11f2dd06q35n0vn2j506s35p35q0pv2ox06u35s0mz2rt06v35t33h0k32up06w2x90hi08y2ud0ke08z33r2lp0t20922fx0yu0942a514m09624d1bu0983441yl1hm09a1vp1ki09b1px1qa09d34e1n11t609e1h91yy09g1ed21u09h1a227m0831492ai09l0yh2ga09n0sp2m209p0pt2oy09q0k12uq09s2xo0h52z209t31k0en0bt2780c319z0az0e831z0cq",Jx=52,N8=240;function e$(e){let t=0;return e.split(" ").map(r=>(t+=Number.parseInt(r,36),t/1e4))}var Ag;function O8(){if(!Ag){let e=e$(T8),t=e$(L8),r=[];for(let n=0;n<Kx.length;n+=3){let o=Number.parseInt(Kx.slice(n,n+3),36);r.push({cx:e[Math.floor(o/Jx)],cy:t[o%Jx]});}Ag=r;}return Ag}function z8(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 s$(e){let t=O8(),r=z8(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,N8).sort((i,s)=>i-s).map(i=>t[i])}var t$=300,F8=49,D8=6;function a$(e,t){if(t$/t<=F8+.5)return e;let r=Ns,n=Ns+t$,o=D8*t+t/2;return e.filter(({cx:i,cy:s})=>Math.max(r-i,i-n,r-s,s-n)>=o)}var c$="Scan the QR code * Scan the QR code * Scan the QR code * Scan the QR code *",zs=32,u$=3.5,Z8=zs*Hr,l$=246.5,fr=2*Math.PI*l$,Mg=.36,r$=l$+Mg*zs,Rg=400;function ti(e,t){return e===" "||/[il1|!']/.test(e)?t*.3:/[mwMW@%&]/.test(e)?t*.8:t*.6}function B8(e){let t=e.slice(0,Rg).split(" ").map(r=>to(r,Rg)).join(" ");return Array.from(t).slice(0,Rg)}var U8="\u2026",f$=1;function m$(e,t,r,n=false){return n&&t===e.length-1?f$*r:ti(e[t],r)}function Ig(e,t,r=false){let n=0;for(let o=0;o<e.length;o++)n+=m$(e,o,t,r);return n}function kg(e,t,r,n=false){return Ig(e,t,n)+r*Math.max(0,e.length-1)+ti(" ",t)+2*r<=fr}var p$=e=>e.join("").split(" ").filter(Boolean),G8=(e,t)=>Array.from(Array.from({length:t},()=>e.join(" ")).join(" "));function d$(e,t,r){if(kg(e,t,r))return {chars:e,fontSize:t,letterSpacing:r};let n=Math.min(r,0),o=Math.min(t,Z8),i=(d,g=false)=>{let y=Ig(d,t,g)+ti(" ",t),_=d.length+1,b=(fr-y)/_;if(b>=n)return {chars:d,fontSize:t,letterSpacing:b,cut:g};let S=(fr-n*_)/y*t;return S>=o?{chars:d,fontSize:S,letterSpacing:n,cut:g}:null},s=i(e);if(s)return s;let a=p$(e),c=h$(a);for(let d=a.length/c.length-1;d>=1;d--){let g=G8(c,d);if(kg(g,o,n))return i(g)??{chars:g,fontSize:o,letterSpacing:n}}let u=fr-ti(" ",o)-f$*o-2*n,l=0,f=0,p=0;for(let[d,g]of e.entries()){if(l+=ti(g,o)+n,l>u)break;p=d+1,(p===e.length||e[p]===" ")&&(f=p);}let m=[...Q8(e.slice(0,f>0?f:p)),U8];return (kg(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 Q8(e){let t=e.length;for(;t>0&&/[\s.,;:!?*·•\-–—]/u.test(e[t-1]);)t--;return e.slice(0,t)}function h$(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 V8(e,t,r){let n=p$(e);if(n.length===0)return {chars:[],fontSize:t,letterSpacing:r};let o=Array.from(h$(n).join(" ")),i=Ig(o,t)+ti(" ",t),s=i+(o.length+1)*r,a=Math.min(r,0),c=null;for(let u of new Set([Math.floor(fr/s),Math.ceil(fr/s)])){if(u<1)continue;let l=(fr-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??d$(o,t,r)}function g$(e,t){let{position:r,rotation:n}=t,o=B8(e),i=t.fill==="repeat"?V8(o,t.fontSize,t.letterSpacing):d$(o,t.fontSize,t.letterSpacing),{fontSize:s,letterSpacing:a}=i,c=[],u=0;for(let[d,g]of i.chars.entries()){let y=m$(i.chars,d,s,i.cut);c.push({char:g,along:u+y/2}),u+=y+a;}let l=u-(c.length>0?a:0),f=r!=="bottom",p=f?r$-Mg*s:r$+Mg*s,m=l/fr*180,h=[];for(let{char:d,along:g}of c){if(d.trim()==="")continue;let y=g/fr*360,_=f?n-m+y:n+180+m-y,b=_*Math.PI/180;h.push({char:d,x:se(Zr+p*Math.sin(b)),y:se(Zr-p*Math.cos(b)),rotate:se(f?_:_-180)});}return {text:i.chars.join(""),letters:h,fontSize:s===t.fontSize?s:se(s),letterSpacing:a}}var ri=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,y$={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=Oe(t?.fgColor,"#000000"),o=Oe(t?.bgColor,"#ffffff"),i=r?.pixelSize??9,s=se(i/2),a=a$(s$(r?.url??""),i),c=ri(t?.fontSize,zs),u=c>0?c:zs,l=typeof t?.customText=="string"?t.customText:c$,f=g$(l,{fontSize:u,letterSpacing:ri(t?.fontLetterSpacing,u$),position:t?.textPosition==="bottom"?"bottom":"top",rotation:ri(t?.textRotation,0),fill:t?.textFill==="repeat"?"repeat":"none"}),p=t?.textColor||"#ffffff",m=t?.fontFamily||Iu,h=t?.fontWeight??900,d=ri(t?.strokeWidth,0),g=t?.strokeColor||"#000000",y=[{radius:Zr,width:ri(t?.outerStrokeWidth,d),color:t?.outerStrokeColor||g},{radius:o$,width:ri(t?.innerStrokeWidth,d),color:t?.innerStrokeColor||g}].filter(_=>_.width>0);return Qe("svg",{height:Os,id:"svgQrWrapper",style:{width:"100%",height:"100%"},viewBox:`0 0 ${Os} ${Os}`,width:Os,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[I("circle",{cx:Zr,cy:Zr,fill:o,r:n$}),I("g",{fill:n,children:a.map((_,b)=>I("circle",{cx:_.cx,cy:_.cy,r:s},b))}),I("path",{d:i$,fill:t?.outerCircleColor||n}),y.map((_,b)=>I("circle",{cx:Zr,cy:Zr,fill:"none",r:_.radius,stroke:_.color,strokeWidth:_.width},b)),I("g",{"aria-hidden":"true",children:f.letters.map((_,b)=>I("text",{fill:p,fontFamily:m,fontSize:f.fontSize,fontWeight:h,textAnchor:"middle",transform:`rotate(${_.rotate} ${_.x} ${_.y})`,x:_.x,y:_.y,children:_.char},b))}),I("g",{transform:`translate(${Ns} ${Ns})`,children:e})]})}};var _$={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 b$=Xt({id:"Halloween",name:"Halloween",description:"QR code with Halloween theme",spec:_$,at:{x:38,y:10,scale:1}});var x$={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 $$=Xt({id:"SquareBorder",name:"Square Border",description:"QR code with square decorative border",spec:x$,at:{x:0,y:0,scale:300/316}});var w$={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$=Xt({id:"StandardBox",name:"Standard Box",description:"QR code with standard box",spec:w$,at:{x:46,y:1,scale:1}});var v$={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 C$=Xt({id:"StrikedBox",name:"Striked Box",description:"QR code with striked box",spec:v$,at:{x:24,y:0,scale:1}});var Fs={default:Yx,Arrow:Xx,StandardBox:S$,SquareBorder:$$,StrikedBox:C$,Halloween:b$,DotRing:y$},E$={FlamQR:"DotRing"},Uu=e=>{if(Object.hasOwn(Fs,e))return Fs[e];let t=Object.hasOwn(E$,e)?E$[e]:void 0;return t?Fs[t]:void 0},lI=()=>Object.values(Fs),fI=()=>Object.keys(Fs);var Tg=e=>Math.round(Math.min(Math.max(e,0),255)).toString(16).padStart(2,"0");function k$(e){return `#${Tg(e.r)}${Tg(e.g)}${Tg(e.b)}`}function Gu(e){let t=Pe(e);return !t||t.a>=1||t.a<=0?{color:e}:{color:k$(t),opacity:se(t.a,3)}}function Qu(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 M$={r:0,g:0,b:0,a:1};function X8(e){return [...e].map(t=>({offset:Math.min(Math.max(t.offset/100,0),1),color:Pe(t.color)??M$})).sort((t,r)=>t.offset-r.offset)}function Lg(e,t){let r=e[0],n=e.at(-1);if(!(r&&n))return M$;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 P$=4,A$=720,Y8=2;function I$(e,t,r,n,o){let i=X8(e);if(i.length===0)return {wedges:[]};let s=i[0].color.a,a=i.every(_=>Math.abs(_.color.a-s)<.002),c=[...new Set([0,...i.map(_=>_.offset),1])].sort((_,b)=>_-b),u=[];for(let _=0;_+1<c.length;_++){let b=c[_],S=c[_+1];if(S<=b)continue;let v=Lg(i,b+1e-9),x=Lg(i,S-1e-9),w=Math.max(Math.abs(v.r*v.a-x.r*x.a),Math.abs(v.g*v.a-x.g*x.a),Math.abs(v.b*v.a-x.b*x.a),Math.abs(v.a-x.a)*255),C=Math.ceil(w/Y8),P=Math.ceil((S-b)*360/P$),R=Math.max(1,C,P);for(let M=0;M<R;M++)u.push([b+(S-b)*M/R,b+(S-b)*(M+1)/R]);}let l=u;if(u.length>A$){let _=Math.ceil(u.length/A$);l=[];for(let b=0;b<u.length;b+=_){let S=u.slice(b,b+_);l.push([S[0][0],S.at(-1)[1]]);}}let f=t-90,p=o/Math.cos(2*P$/2*(Math.PI/180)),m=_=>{let b=_*Math.PI/180;return [$(r+p*Math.cos(b)),$(n+p*Math.sin(b))]},h=`${$(r)} ${$(n)}`,d=_=>se((_%360+360)%360,4),g=l.length-1,y=l.map(([_,b],S)=>{let v=Lg(i,(_+b)/2),x=(b-_)*360,w=a&&S===0&&g>0?x:0,C=a&&S<g?x:0,P=f+_*360-w,R=f+b*360+C,[M,T]=m(P),[L,D]=m(R);return {d:`M${h}L${M} ${T}L${L} ${D}Z`,color:k$(v),...a||v.a>=1?{}:{opacity:se(v.a,3)},from:d(P),sweep:se(R-P,4)}});return a&&s<1?{wedges:y,opacity:se(s,3)}:{wedges:y}}function R$(e,t,r,n){return (Math.atan2(n-t,r-e)*180/Math.PI%360+360)%360}function T$(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=R$(e,t,r.x+r.width/2,r.y+r.height/2),s=0,a=0;for(let[c,u]of o){let l=R$(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 L$(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 zg(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 z$(e,t=0){let r=[];return e.forEach((n,o)=>{let i=null;n.forEach((s,a)=>{if(!s&&i!==null){r.push(k`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(k`M${a+t},${o+t} h1v1H${a+t}z`):r.push(k`M${i+t},${o+t} h${a+1-i}v1H${i+t}z`);return}s&&i===null&&(i=a);});}),r.join("")}function K8(e,t,r){return e<7&&t<7||e>=r-7&&t<7||e<7&&t>=r-7}var J8=.9;function Ng(e,t){let{margin:r,pixelSize:n,pattern:o="circle",plain:i=false}=t;if(N2(o))return z2(e,{margin:r,pixelSize:n,pattern:o,scale:t.scale,plain:i});let s=$u(t.scale,o),a=[],c=e.length,u=n*.45,l=i?()=>false:ng(c);return e.forEach((f,p)=>{f.forEach((m,h)=>{if(m&&(i||!K8(h,p,c))){let d=(h+.5+r)*n,g=(p+.5+r)*n,y=`${h}-${p}`,_=a.length;if(l(h,p)){a.push(I("rect",{height:$(n),width:$(n),x:$(d-n/2),y:$(g-n/2)},y));return}switch(o){case "circle":a.push(I("circle",{cx:$(d),cy:$(g),r:$(u),transform:k`rotate(0,${d},${g})`},y));break;case "circle-large":{let b=n*.5;a.push(I("circle",{cx:$(d),cy:$(g),r:$(b),transform:k`rotate(0,${d},${g})`},y));}break;case "small-square":{let b=n*.357143;a.push(I("path",{d:k`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:k`rotate(0,${d},${g})`},y));}break;case "diamond":{let b=n*.357143;a.push(I("path",{d:k`M ${d-b} ${g-b}v ${n*.714286}h ${n*.714286}v -${n*.714286}z`,transform:k`rotate(45,${d},${g})`},y));}break;case "circle-mixed":{let b=(h+p)%3===0?J8:(h+p)%2===0?1:1.25,S=u*b;a.push(I("circle",{cx:$(d),cy:$(g),r:$(S),transform:k`rotate(0,${d},${g})`},y));}break;case "pacman":{let b=n*.5,S=n*.357143;a.push(I("path",{d:k`M ${d-b} ${g-S}v ${n*.714286}h ${b}a ${b*.5} ${b*.5}, 0, 0, 0, 0 -${n*.714286}h -${b}v -${n*.714286}z`,transform:k`rotate(${(h+p)%2===0?0:90},${d},${g})`},y));}break;case "rounded":{let b=n*.5,S=n*.2;a.push(I("rect",{height:$(n),rx:$(S),ry:$(S),transform:k`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "square":{let b=n*.5;a.push(I("rect",{height:$(n),transform:k`rotate(0,${d},${g})`,width:$(n),x:$(d-b),y:$(g-b)},y));}break;case "vertical-line":{let b=n*.714286,S=n;a.push(I("path",{d:k`M ${d-n*.5} ${g-b*.5}v ${b}h ${S}v -${b}z`,transform:k`rotate(90,${d},${g})`},y));}break;default:a.push(I("circle",{cx:$(d),cy:$(g),r:$(u),transform:k`rotate(0,${d},${g})`},y));}if(s!==1&&a.length>_){let b=a.pop();a.push(I("g",{transform:k`translate(${d},${g}) scale(${$(s,6)}) translate(${-d},${-g})`,children:b},y));}}});}),a}function eC(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 Fg(e,t){return `${e}-${vn(JSON.stringify(t))}`}function tC(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 ju(e,t){return t.map((r,n)=>{let{color:o,opacity:i}=Gu(r.color);return I("stop",{offset:`${r.offset}%`,stopColor:o,stopOpacity:i},`${e}-stop-${n}`)})}function F$(e,t,r,n,o,i){let s=I$(t.stops,t.angle??0,r,n,o),a=s.wedges.map((c,u)=>I("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 I("pattern",{"data-qrdx-conic":`${$(r)} ${$(n)}`,height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:s.opacity===void 0?a:I("g",{opacity:s.opacity,children:a})},e)}function rC(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 nC=["xMin","xMid","xMax"],oC=["YMin","YMid","YMax"];function D$(e,t,r){let n=t.scale??1,o=t.fit==="tile",i=o?r/4*n:r,s=t.underlay?Gu(t.underlay):null,a=o?i:r*n,c=rC(t.position),u=o?0:c.x*(r-a),l=o?0:c.y*(r-a),f=o?"xMidYMid slice":`${nC[c.x*2]??"xMid"}${oC[c.y*2]??"YMid"} ${t.fit==="contain"?"meet":"slice"}`;return Qe("pattern",{height:$(i),id:e,patternUnits:"userSpaceOnUse",width:$(i),x:0,y:0,children:[s&&I("rect",{fill:s.color,fillOpacity:s.opacity,height:$(i),width:$(i),x:0,y:0}),I("image",{height:$(a),href:t.src,opacity:(t.opacity??1)<1?t.opacity:void 0,preserveAspectRatio:f,width:$(a),x:$(u),y:$(l)})]},e)}var Z$=(e,t)=>Fg("img",[e,t]);function iC(e,t,r,n,o,i,s){let a=$t(e);if(a.type==="solid")return null;if(a.type==="image"){let u=Z$(a,s);return {id:u,element:D$(u,a,s)}}let c=Fg(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}=tC(l,t,r,n,o);return {id:c,element:I("linearGradient",{gradientUnits:"userSpaceOnUse",id:c,x1:$(f),x2:$(m),y1:$(p),y2:$(h),children:ju(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:I("radialGradient",{cx:$(l),cy:$(f),fx:$(l),fy:$(f),gradientUnits:"userSpaceOnUse",id:c,r:$(p),children:ju(c,u.stops)},c)}}return a.type==="angular"?{id:c,element:F$(c,a,t+n/2,r+n/2,n*.75,s)}:null}function Og(e,t,r){let n=$t(e);if(n.type==="solid")return null;if(n.type==="image"){let i=Z$(n,t);return {id:i,element:D$(i,n,t)}}let o=Fg(r,[n,t]);if(n.type==="linear"){let i=n,s=i.angle??0,{x1:a,y1:c,x2:u,y2:l}=eC(s,t);return {id:o,element:I("linearGradient",{gradientUnits:"userSpaceOnUse",id:o,x1:$(a),x2:$(u),y1:$(c),y2:$(l),children:ju(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:I("radialGradient",{cx:$(s),cy:$(a),fx:$(s),fy:$(a),gradientUnits:"userSpaceOnUse",id:o,r:$(c),children:ju(o,i.stops)},o)}}return n.type==="angular"?{id:o,element:F$(o,n,t/2,t/2,t*.75,t)}:null}var Vu=e=>qn(e)||xl(e);function N$(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 mr(e,t,r){if(t)return {fill:`url(#${t})`};let n=$t(e,r),o=n.type==="solid"?n.color:n.type==="image"?n.underlay??r:r,{color:i,opacity:s}=Gu(o);return s===void 0?{fill:i}:{fill:i,fillOpacity:s}}function Dr(e,t,r,n){if(n==null)return null;let o=e.length,i=Math.floor(t*Ws),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 xt(e){let t=e.level??Zt,{imageSettings:r}=e,n=e.isOGContext&&r?.excavate&&(t==="L"||t==="M")?"Q":t;if(e.autoLevel&&r&&n!=="H"){let o=Le.QrCode.encodeText(e.value,Ke[n]).getModules(),i=Dr(o,e.size??ve,at(o.length,e.margin??ze,e.shape),r);i&&(i.excavation?i.excavation.w*i.excavation.h:i.w*i.h)/(o.length*o.length)>kl&&(n="H");}return n}function sC(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 oi(e){let{value:t,size:r=ve,level:n=Zt,bgColor:o=Ne,fgColor:i=je,eyeColor:s,dotColor:a,bodyPattern:c="circle",cornerEyePattern:u="gear",cornerEyeDotPattern:l="circle",margin:f=ze,isOGContext:p=false,imageSettings:m,templateId:h,customTemplate:d,customProps:g,frame:y,art:_,eyeColors:b,moduleScale:S,autoLevel:v,shape:x,frameLabelMarkers:w,partMarkers:C,...P}=e,R=Bu({value:t,size:r,margin:f,level:n,shape:x,autoLevel:v,isOGContext:p},m),M=bt(y),T=M?{}:P,L=xe=>M?Tu(xe,{size:r,frame:y,bgColor:o,svgProps:P,markLabels:w}):xe,D=xt({value:t,size:r,level:n,margin:f,imageSettings:R,isOGContext:p,autoLevel:v,shape:x}),B=Le.QrCode.encodeText(t,Ke[D]),O=B.getModules(),j=at(O.length,f,x),te=zx(t,O.length,f,x),G=(xe,ct)=>Pg(C,xe,ct),Y=(xe,ct)=>{let Dt=Sg(x,xe);return Dt?"circle"in Dt?I("circle",{cx:$(xe/2),cy:$(xe/2),...ct,r:$(xe/2),...G("background")}):I("path",{d:Dt.path,...ct,...G("background")}):I("rect",{...ct,height:xe,width:xe,x:0,y:0,...G("background")})},de=O.length+j*2,Te=Dr(O,r,j,R),$e=null;if(R!=null&&Te!=null){Te.excavation!=null&&(O=zg(O,Te.excavation));let{imgWidth:xe,imgHeight:ct,imgLeft:Dt,imgTop:Qn}=sC(Te,r,de,j);if(p){let Vn=R.shape??"square";$e=I("img",{alt:"Logo",src:R.src,style:{position:"absolute",left:`${$(Dt)}px`,top:`${$(Qn)}px`,width:`${$(xe)}px`,height:`${$(ct)}px`,...Vn!=="square"&&{borderRadius:Vn==="circle"?"50%":`${$(Math.min(xe,ct)*zu)}px`},...R.plate&&{backgroundColor:R.plate,padding:`${$(xe*Fu)}px`,boxSizing:"border-box"}}});}else $e=Du(R,{x:Dt,y:Qn,w:xe,h:ct}),C&&($e=Go($e,G("logo")));}let Z=r/de,K=O.length,J=7*Z,Ve=1.5*Z,jr={fgColor:Oe(i,je),bgColor:Oe(o,Ne)},gt=j0(_)?X0({art:_,modules:O,version:B.version,margin:j,pixelSize:Z,...jr,body:xe=>Ng(xe,{margin:j,pixelSize:Z,pattern:c,scale:S})}):null,Kt=gt&&C?Go(gt,G("body")):gt,qr=gt&&_?J0({art:_,version:B.version,...jr}):null,W=gt?null:Ng(O,{margin:j,pixelSize:Z,pattern:c,scale:S}),ye=te?Ng(te,{margin:0,pixelSize:Z,pattern:c,scale:S,plain:true}):null,ie=$t(o,Ne),ke=$t(i,je),li=Vu(ie)?Og(ie,r,"bg-color"):null,ml=Vu(ke)?Og(ke,r,"fg-color"):null,h4=mr(o,li?.id??null,Ne),v1=mr(i,ml?.id??null,je),C1=Kt?Qe(Ht,{children:[Kt,ye&&I("g",{...v1,...G("body"),children:ye})]}):Qe("g",{...v1,...G("body"),children:[W,ye]}),Nn=j*Z,On=j*Z,zn=(K-7+j)*Z,Fn=j*Z,Dn=j*Z,Zn=(K-7+j)*Z,Wr=Oe(i,je),Bn=xe=>b?.[xe]?.outer??qr?.[xe]?.outer??s,Un=xe=>b?.[xe]?.inner??qr?.[xe]?.inner??a,Gn=(xe,ct,Dt,Qn,Vn)=>{let bl=$t(xe,Wr);return Vu(bl)?iC(bl,ct,Dt,J,Qn,Vn,r):null},pl=Gn(Bn("topLeft"),Nn,On,"top-left","corners-square-color-0-0"),dl=Gn(Bn("topRight"),zn,Fn,"top-right","corners-square-color-1-0"),hl=Gn(Bn("bottomLeft"),Dn,Zn,"bottom-left","corners-square-color-0-1"),gl=Gn(Un("topLeft"),Nn,On,"top-left","corners-dot-color-0-0"),yl=Gn(Un("topRight"),zn,Fn,"top-right","corners-dot-color-1-0"),_l=Gn(Un("bottomLeft"),Dn,Zn,"bottom-left","corners-dot-color-0-1"),E1=mr(Bn("topLeft"),pl?.id??null,Wr),P1=mr(Bn("topRight"),dl?.id??null,Wr),A1=mr(Bn("bottomLeft"),hl?.id??null,Wr),R1=mr(Un("topLeft"),gl?.id??null,Wr),k1=mr(Un("topRight"),yl?.id??null,Wr),M1=mr(Un("bottomLeft"),_l?.id??null,Wr),I1=Ou(Nn,On,J,u,"top-left"),T1=Nu(Nn+J/2,On+J/2,Ve,l,"top-left"),L1=Ou(zn,Fn,J,u,"top-right"),N1=Nu(zn+J/2,Fn+J/2,Ve,l,"top-right"),O1=Ou(Dn,Zn,J,u,"bottom-left"),z1=Nu(Dn+J/2,Zn+J/2,Ve,l,"bottom-left"),g4=Qe(Ht,{children:[I("defs",{children:N$([li,ml,pl,dl,hl,gl,yl,_l])}),Y(r,h4),C1,I("g",{...E1,...G("eye-outer","top-left"),children:I("path",{d:I1,fillRule:"evenodd",transform:k`rotate(0,${Nn+J/2},${On+J/2})`})}),I("g",{...R1,...G("eye-centre","top-left"),children:T1}),I("g",{...P1,...G("eye-outer","top-right"),children:I("path",{d:L1,fillRule:"evenodd",transform:k`rotate(0,${zn+J/2},${Fn+J/2})`})}),I("g",{...k1,...G("eye-centre","top-right"),children:N1}),I("g",{...A1,...G("eye-outer","bottom-left"),children:I("path",{d:O1,fillRule:"evenodd",transform:k`rotate(0,${Dn+J/2},${Zn+J/2})`})}),I("g",{...M1,...G("eye-centre","bottom-left"),children:z1}),$e]}),F1=d||(h?Uu(h):void 0);if(F1){let ct=Vu(ie)?Og(ie,300,"bg-color-template"):null,Dt=mr(o,ct?.id??null,Ne),Qn=Qe("svg",{height:300,viewBox:"0 0 300 300",width:300,xmlns:"http://www.w3.org/2000/svg",children:[I("defs",{children:N$([ct,ml,pl,dl,hl,gl,yl,_l])}),Y(300,Dt),Qe("g",{transform:`scale(${$(300/r,6)})`,children:[C1,I("g",{...E1,...G("eye-outer","top-left"),children:I("path",{d:I1,fillRule:"evenodd",transform:k`rotate(0,${Nn+J/2},${On+J/2})`})}),I("g",{...R1,...G("eye-centre","top-left"),children:T1}),I("g",{...P1,...G("eye-outer","top-right"),children:I("path",{d:L1,fillRule:"evenodd",transform:k`rotate(0,${zn+J/2},${Fn+J/2})`})}),I("g",{...k1,...G("eye-centre","top-right"),children:N1}),I("g",{...A1,...G("eye-outer","bottom-left"),children:I("path",{d:O1,fillRule:"evenodd",transform:k`rotate(0,${Dn+J/2},${Zn+J/2})`})}),I("g",{...M1,...G("eye-centre","bottom-left"),children:z1}),$e]})]}),Vn=300/r,y4={pixelSize:Z*Vn,url:t},D1=F1.wrapper(Qn,{fgColor:i,bgColor:o,...g||{},...P},y4),_4={...D1?.props?.style||{},width:void 0,height:void 0,...T.style};return L(Go(D1,{...T,width:r,height:r,style:_4}))}return L(I("svg",{height:r,viewBox:`0 0 ${r} ${r}`,width:r,xmlns:"http://www.w3.org/2000/svg",...T,children:g4}))}var zI=(()=>{try{new Path2D().addPath(new Path2D);}catch{return false}return true})(),FI=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},ni=(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},O$=e=>{let t=Pe(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)}},DI=(e,t)=>{let r=O$(e),n=O$(t);if(!(r&&n))return 1;let o=ni(r.r,r.g,r.b),i=ni(n.r,n.g,n.b),s=Math.max(o,i),a=Math.min(o,i);return (s+.05)/(a+.05)},ZI=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 aC=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"]]),cC=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"]]),uC=new Set(["children","dangerouslySetInnerHTML","key","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","ref"]),lC=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"]),fC=new Set(["autoFocus","multiple","muted"]),mC=new Set(["contentEditable","spellCheck","draggable","value","autoReverse","externalResourcesRequired","focusable","preserveAlpha"]),pC=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(" ")),B$=":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",dC=new RegExp(`^[${B$}][${B$}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),qu=/^[a-zA-Z][a-zA-Z:_.\-\d]*$/,hC=/^[\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,gC="javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')",yC=e=>hC.test(e)?gC:e,G$=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),_C=/["'&<>]/;function Dg(e){if(!_C.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=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}t+=e.slice(r,n)+o,r=n+1;}return t+e.slice(r)}var pr=e=>typeof e=="function"||typeof e=="symbol",U$=new Map,bC=e=>{let t=U$.get(e);return t===void 0&&(t=e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^ms-/,"-ms-"),U$.set(e,t)),t};function xC(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||pC.has(r)?`${n}`:`${n}px`:`${n}`.trim();o=`${bC(r)}:${i}`;}t=t?`${t};${o}`:o;}return t}function ii(e,t){if(t==null||uC.has(e))return null;let r=cC.get(e);if(r!==void 0)return pr(t)||typeof t=="boolean"?null:{name:r,value:`${t}`};switch(e){case "style":{let o=xC(t);return o?{name:"style",value:o}:null}case "src":case "href":case "action":case "formAction":case "xlinkHref":return (e==="src"||e==="href")&&t===""||pr(t)||typeof t=="boolean"?null:{name:e==="xlinkHref"?"xlink:href":e,value:yC(`${t}`)};case "capture":case "download":return t===true?{name:e,value:""}:t===false||pr(t)?null:{name:e,value:`${t}`};case "cols":case "rows":case "size":case "span":return pr(t)||Number.isNaN(Number(t))||!(t>=1)?null:{name:e,value:`${t}`};case "rowSpan":case "start":return pr(t)||Number.isNaN(Number(t))?null:{name:e,value:`${t}`};}if(fC.has(e))return t&&!pr(t)?{name:e.toLowerCase(),value:""}:null;if(mC.has(e))return pr(t)?null:{name:e,value:`${t}`};if(lC.has(e))return t&&!pr(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=aC.get(e)??e;if(!dC.test(n)||pr(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 Q$="http://www.w3.org/2000/svg",V$="http://www.w3.org/1999/xhtml",$C="http://www.w3.org/1999/xlink",wC="http://www.w3.org/XML/1998/namespace",SC="http://www.w3.org/2000/xmlns/";function vC(e,t,r){t==="xmlns"||t.startsWith("xmlns:")?e.setAttributeNS(SC,t,r):t.startsWith("xlink:")?e.setAttributeNS($C,t,r):t.startsWith("xml:")?e.setAttributeNS(wC,t,r):e.setAttribute(t,r);}function Ds(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)Ds(e,c,r,n);return}if(!xn(t))throw new TypeError("qrdx: can't render this value as DOM nodes");let{type:o,props:i}=t;if(Qo(o)){Ds(e,i.children,r,n);return}if(typeof o=="function"){Ds(e,o(i),r,n);return}if(!qu.test(o))throw new TypeError(`qrdx: invalid element name: ${o}`);let s=o==="svg"?Q$:r,a=n.createElementNS(s,o);for(let c of Object.keys(i)){let u=ii(c,i[c]);u&&vC(a,u.name,u.value);}Ds(a,i.children,s===Q$&&o==="foreignObject"?V$:s,n),e.appendChild(a);}function Zs(e,t=document){let r=t.createDocumentFragment();return Ds(r,e,V$,t),r}function Yt(e){if(e==null||typeof e=="boolean")return "";if(typeof e=="string")return Dg(e);if(typeof e=="number"||typeof e=="bigint")return `${e}`;if(Array.isArray(e)){let t="";for(let r of e)t+=Yt(r);return t}if(!xn(e))throw new TypeError("qrdx: can't render this value as SVG markup");return CC(e)}function CC(e){let{type:t,props:r}=e;if(Qo(t))return Yt(r.children);if(typeof t=="function")return Yt(t(r));if(!qu.test(t))throw new TypeError(`qrdx: invalid element name: ${t}`);let n=`<${t}`;for(let s of Object.keys(r)){let a=ii(s,r[s]);a&&(n+=` ${a.name}="${Dg(a.value)}"`);}if(G$.has(t))return `${n}/>`;let o=r.dangerouslySetInnerHTML?.__html,i=o==null?Yt(r.children):`${o}`;return `${n}>${i}</${t}>`}function Zg(e){return Yt(oi(e))}function EC(e,t=document){return Zs(oi(e),t).firstChild}var PC=16384;var Bg=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],AC=8,Ug=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 Y$(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),y=m(d);s[d]=s[g]+s[y],a[g]=d,a[y]=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 RC(e,t){let r=0;for(let n=0;n<t;n++)r=r<<1|e>>n&1;return r}function K$(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]=RC(u,a),s[c]=r===1?0:a;}),{lengths:e,codes:i,emitted:s}}function In(e,t,r){e.write(t.codes[r],t.emitted[r]);}function kC(e){let t=[],r=i=>t.push({code:i,extra:0,extraBits:0}),n=AC,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 MC(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=kC(t),o=new Uint32Array(19);for(let a of n)o[a.code]=o[a.code]+1;let i=K$(Y$(o,7)),s=Bg.length;for(;s>4&&i.lengths[Bg[s-1]]===0;)s--;e.write(0,1),e.write(s-4,4);for(let a=0;a<s;a++)e.write(i.lengths[Bg[a]],3);e.write(0,1);for(let a of n)In(e,i,a.code),e.write(a.extra,a.extraBits);}function Wu(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 j$(e,t,r,n){let o=0;for(;o<n&&e[t+o]===e[t+o-r];)o++;return o}function q$(e,t,r){let n=e.length,o=0;for(;o<n;){let i=Math.min(4096,n-o),s=o>=1?j$(e,o,1,i):0,a=o>=t?j$(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 W$=20;function H$(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n);}function X$(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 Qg(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 v=0;v<n;v++){let x=v*4,w=e[x],C=e[x+1],P=e[x+2],R=e[x+3];R!==255&&(i=true),o[v]=(R<<24|(w-C&255)<<16|C<<8|P-C&255)>>>0;}let s=new Uint32Array(280),a=new Uint32Array(256),c=new Uint32Array(256),u=new Uint32Array(256),l=new Uint32Array(40);q$(o,t,{literal(v){s[v>>>8&255]++,a[v>>>16&255]++,c[v&255]++,u[v>>>24]++;},copy(v,x){s[256+Wu(v).symbol]++,l[Wu(x).symbol]++;}});let f=[s,a,c,u,l].map(v=>Y$(v,15)),[p,m,h,d,g]=f.map(K$),y=new Ug(Math.ceil(n/4)+1024);y.write(47,8),y.write(t-1,14),y.write(r-1,14),y.write(i?1:0,1),y.write(0,3),y.write(1,1),y.write(2,2),y.write(0,1),y.write(0,1),y.write(0,1);for(let v of f)MC(y,v);q$(o,t,{literal(v){In(y,p,v>>>8&255),In(y,m,v>>>16&255),In(y,h,v&255),In(y,d,v>>>24);},copy(v,x){let w=Wu(v);In(y,p,256+w.symbol),y.write(w.extra,w.extraBits);let C=Wu(x);In(y,g,C.symbol),y.write(C.extra,C.extraBits);}});let _=y.finish(),b=_.length+(_.length&1),S=new Uint8Array(W$+b);return H$(S,0,"RIFF"),X$(S,4,S.length-8),H$(S,8,"WEBPVP8L"),X$(S,16,_.length),S.set(_,W$),S}function Gg(e,t,r){return String.fromCharCode(...e.subarray(t,t+r))}function J$(e){return e.length>=12&&Gg(e,0,4)==="RIFF"&&Gg(e,8,4)==="WEBP"}function Vg(e){if(!J$(e))return null;let t=12;for(;t+8<=e.length;){let r=Gg(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 IC(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 Hu(e,t={}){let r=t.quality!==void 0,n=r?Math.min(1,Math.max(0,Number(t.quality))):1,o=await IC(e,"image/webp",n);if(o){let c=new Uint8Array(await o.arrayBuffer()),u=Vg(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=Qg(s,e.width,e.height);return new Blob([a],{type:"image/webp"})}var e5=32768;async function Br(e){let t=new Uint8Array(await e.arrayBuffer()),r="";for(let n=0;n<t.length;n+=e5)r+=String.fromCharCode(...t.subarray(n,n+e5));return `data:${e.type||"application/octet-stream"};base64,${btoa(r)}`}async function Nt(e){let t={...e};if(e.imageSettings?.src)try{let l=await TC(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=Zg({...c,templateId:t.templateId,customTemplate:t.customTemplate});return `data:image/svg+xml,${encodeURIComponent(u)}`}var TC=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 Tn(e,t,r){let n=await Nt(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}=ur(e.size||ve,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")Hu(c).then(Br).then(s,a).finally(()=>c.remove());else if(t==="image/bmp")Br(bu(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 t5=["gradientUnits","gradientTransform","spreadMethod"],LC={linear:["x1","y1","x2","y2"],radial:["cx","cy","r","fx","fy","fr"]},NC={r:0,g:0,b:0,a:1};function r5(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 jg(e){return e.name==="linearGradient"?"linear":e.name==="radialGradient"?"radial":null}function OC(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=r5(n,"stop-color")??"#000000",c=Pe(a==="currentColor"?"#000000":a)??NC,u=Number.parseFloat(r5(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 Xu(e){let t=new Map,r=o=>{let i=o.attrs.id;jg(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=jg(i),a={},c=[],u=new Set,l=i;for(;l&&!u.has(l);){u.add(l);let f=jg(l)===s?[...t5,...LC[s]]:t5;for(let m of f){let h=l.attrs[m];a[m]===void 0&&h!==void 0&&(a[m]=h);}c.length===0&&(c=OC(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 qg(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),y=p-f;if(Math.abs(d)<1e-12)return Math.abs(g)<1e-12?[]:[-y/g];let _=g*g-4*d*y;if(_<0)return [];let b=Math.sqrt(_);return [(-g+b)/(2*d),(-g-b)/(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 zC=e=>e[0]*e[3]-e[1]*e[2];function Ur(e){let t=zC(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 o5(e,t,r){let{kind:n,attrs:o,stops:i}=e,s=i[0],a=i.at(-1);if(!(s&&a)||i.every(x=>x.color.a===0))return null;if(i.length===1)return s.color;let c=o.gradientUnits==="userSpaceOnUse",u=Jn;if(!c){let x=qg(t);if(!x||x.width<=0||x.height<=0)return null;u=[x.width,0,0,x.height,x.x,x.y];}let l=Se(u,St(o.gradientTransform));if(!Ur(l))return a.color;let[f,p]=r,m=Math.sqrt((f*f+p*p)/2),h=(x,w)=>{let C=Number.parseFloat(x);return Number.isFinite(C)?x.trim().endsWith("%")?C/100*(c?w:1):C:null},d=(x,w,C)=>h(o[x]??w,C)??h(w,C)??0;if(n==="linear"){let x=[d("x1","0%",f),d("y1","0%",p),d("x2","100%",f),d("y2","0%",p)],[w,C,P,R]=x;return w===P&&C===R?a.color:{kind:n,coords:x,matrix:l,stops:i}}let g=d("cx","50%",f),y=d("cy","50%",p),_=d("r","50%",m),b=o.fx===void 0?g:d("fx","50%",f),S=o.fy===void 0?y:d("fy","50%",p),v=Math.max(0,d("fr","0%",m));return _<0?null:_===0?a.color:{kind:n,coords:[b,S,v,g,y,_],matrix:l,stops:i}}function Yu(e){return e.map(t=>$(t,6)).join(" ")}function FC(e,t){return (t==="cmyk"?Lr(e.r,e.g,e.b):[e.r/255,e.g/255,e.b/255]).map(n=>$(n,4)).join(" ")}var n5=(e,t)=>`<< /FunctionType 2 /Domain [0 1] /C0 [${e}] /C1 [${t}] /N 1 >>`;function DC(e,t){let r=[],n=e.map(a=>se(a.offset,4)),o=e.map(a=>FC(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 n5(a.c0,a.c1)}return ["<< /FunctionType 3 /Domain [0 1]",`/Functions [${r.map(a=>n5(a.c0,a.c1)).join(" ")}]`,`/Bounds [${r.slice(1).map(a=>$(a.from,4)).join(" ")}]`,`/Encode [${r.map(()=>"0 1").join(" ")}] >>`].join(" ")}function Ku(e,t){return [`<< /ShadingType ${e.kind==="linear"?2:3}`,`/ColorSpace /Device${t==="cmyk"?"CMYK":"RGB"}`,`/Coords [${e.coords.map(r=>$(r,6)).join(" ")}]`,`/Function ${DC(e.stops,t)}`,"/Extend [true true] >>"].join(" ")}function ZC(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}}var i5={r:255,g:255,b:255,a:1},BC=/^url\(\s*#bg-color-/,Ju=/^url\(\s*#([^)\s]+)\s*\)/,UC=new Set(["defs","clipPath","mask","pattern","linearGradient","radialGradient","symbol","title","desc","metadata","style","script","use","foreignObject"]);function ue(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 oe(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 Bs(e,t){if((e.name==="linearGradient"||e.name==="radialGradient")&&e.attrs.id){let r=e.children.find(o=>o.name==="stop"),n=r&&(ue(r,"stop-color")??"#000000");n&&t.set(e.attrs.id,n);}for(let r of e.children)Bs(r,t);return t}function Us(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)Us(r,t);return t}function el(e){return /^data:image\/png[;,]/i.test(e)?"PNG":/^data:image\/jpe?g[;,]/i.test(e)?"JPEG":null}async function tl(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 s5(e,t,r){let n={x:oe(e.attrs.x,t[0]),y:oe(e.attrs.y,t[1]),width:oe(e.attrs.width,t[0]),height:oe(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 a5(e,t){e.name==="clipPath"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)a5(r,t);return t}function c5(e,t){e.name==="pattern"&&e.attrs.id&&t.set(e.attrs.id,e);for(let r of e.children)c5(r,t);return t}function GC(e,t){let[r,n]=t,o=(i,s)=>oe(e.attrs[i],s);switch(e.name){case "path":return Jt(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),oe(i,r),oe(s,n))}case "circle":{let i=o("r",Math.hypot(r,n)/Math.SQRT2);return Gt(o("cx",r),o("cy",n),i,i)}case "ellipse":return Gt(o("cx",r),o("cy",n),o("rx",r),o("ry",n));default:return []}}var si=class{gradients;shadings;clipPaths=new Map;patterns=new Map;backdrop=i5;paper=i5;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=Ju.exec(t);if(r)return this.resolveColor(this.gradients.get(r[1]));let n=Pe(t==="currentColor"?"#000000":t);return n&&n.a>0?n:null}shadedGradient(t){let r=t?Ju.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=o5(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?Ju.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 Qu(t,this.onPaper||n?this.paper:this.backdrop)}paintPattern(t,r,n,o){let i=qg(t);if(!i||i.width<=0||i.height<=0)return true;let[s,a]=r.viewport,c=oe(n.attrs.x,s),u=oe(n.attrs.y,a),l=oe(n.attrs.width,s),f=oe(n.attrs.height,a);if(!(l>0&&f>0))return true;let p=St(n.attrs.patternTransform),m=Ur(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(([L])=>L),y=d.map(([,L])=>L),_=Math.min(...g),b=Math.max(...g),S=Math.min(...y),v=Math.max(...y),x=Math.floor((_-c)/l),w=Math.ceil((b-c)/l)-1,C=Math.floor((S-u)/f),P=Math.ceil((v-u)/f)-1,R=(w-x+1)*(P-C+1);if(R>4096)return !0;let M=(n.attrs["data-qrdx-conic"]??"").trim().split(/\s+/).map(Number),T=Se(r.matrix,p);for(let L=C;L<=P;L++)for(let D=x;D<=w;D++){let B=c+D*l,O=u+L*f,j=Se(T,[1,0,0,1,B,O]),te={x:_-B,y:S-O,width:b-_,height:v-S},G=M.length===2&&M.every(Number.isFinite)?T$(M[0],M[1],te):null,Y=R>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"}],j,!1);try{let de={matrix:j,viewport:r.viewport,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,fontSize:16,fontWeight:"normal",textAnchor:"start",fillOpacity:1,opacity:o},Te=($e,Z)=>{for(let K of $e){if(K.name==="g"&&!K.attrs.transform){let J=Number.parseFloat(K.attrs.opacity??"1");Te(K.children,{...Z,opacity:(Z.opacity??1)*(Number.isFinite(J)?J:1)});continue}if(G&&K.attrs["data-arc"]){let[J,Ve]=K.attrs["data-arc"].split(/\s+/).map(Number);if(!L$([J,J+Ve],G))continue}this.walk(K,Z);}};Te(n.children,de);}finally{Y&&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:Se(r.matrix,St(t.attrs.transform))}),a=Ur(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=ue(t,"clip-path"),o=n?Ju.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=GC(c,r.viewport);if(u.length===0)continue;let l=St(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=>ZC(p,l))),a||=ue(c,"clip-rule")==="evenodd";}return s.length>0?{segments:s,matrix:r.matrix,evenOdd:a}:null}viewportMatrix(t,r){let n=oe(t.attrs.x,r.viewport[0]),o=oe(t.attrs.y,r.viewport[1]),i=oe(t.attrs.width,r.viewport[0],r.viewport[0]),s=oe(t.attrs.height,r.viewport[1],r.viewport[1]),a=Ut(t.attrs.viewBox);if(a.length!==4||!(a[2]&&a[3]))return [Se(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 [Se(r.matrix,[p,0,0,m,h-c*p,d-u*m]),[l,f]]}walk(t,r,n=false){if(n&&(this.clipPaths=a5(t,new Map),this.patterns=c5(t,new Map)),UC.has(t.name)||ue(t,"display")==="none"||ue(t,"visibility")==="hidden")return;let o=Se(r.matrix,St(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=ue(t,"font-size"),a=Number.parseFloat(ue(t,"opacity")??"1"),c=ue(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:ue(t,"fill")??r.fill,fillRule:ue(t,"fill-rule")??r.fillRule,stroke:ue(t,"stroke")??r.stroke,strokeWidth:ue(t,"stroke-width")===void 0?r.strokeWidth:oe(ue(t,"stroke-width"),i[0],1),fontSize:s===void 0?r.fontSize:oe(s,16,16),fontWeight:ue(t,"font-weight")??r.fontWeight,textAnchor:ue(t,"text-anchor")??r.textAnchor},f=this.onPaper;(t.name==="rect"||t.name==="circle"||t.name==="path")&&BC.test(ue(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)=>oe(t.attrs[s],a);switch(t.name){case "path":this.paint(Jt(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),oe(s,n),oe(a,o)),t,r);return}case "circle":{let s=i("r",Math.hypot(n,o)/Math.SQRT2);this.paint(Gt(i("cx",n),i("cy",o),s,s),t,r);return}case "ellipse":this.paint(Gt(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=Ut(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 rl=1e3;async function Gs(e){let t=await Nt(Ln({...e,size:e.size??ve},rl));return decodeURIComponent(t.replace("data:image/svg+xml,",""))}function Wg(e){if(bt(e.frame)){let t=Rn(rl,e.frame);return t.squareEdges?t.color:null}return Oe(e.bgColor,Ne)}function nl(e,t){let r=Wg(e);if(!(r&&qn(e.bgColor))||bt(e.frame)||e.templateId||e.customTemplate)return r;let n=yr(t)?.children.find(i=>i.name==="rect"),o=n&&ue(n,"fill");return o?.startsWith("url(")?o:r}function ol(e,t){let r={r:255,g:255,b:255,a:1},n=Pe(Oe(t.bgColor,Ne));e.paper=r,e.background=n&&!qn(t.bgColor)?n:null,e.backdrop=n?Qu(n,r):r;}var il=25.4,u5=5,l5=2e3,dr=rl,Hg=5,f5=2,VC=.25*(il/72);function jC(e,t="mm"){return t==="in"?e*il:e}function qC(e){let t=xt(e),r=Le.QrCode.encodeText(e.value,Ke[t]).size;return r+at(r,e.margin??ze,e.shape)*2}function sl(e,t){let r=jC(t.size,t.unit);if(!Number.isFinite(r)||r<u5||r>l5)throw new Error(`Print size must be between ${u5} mm and ${l5/1e3} m`);let n=Math.min(Math.max(t.bleed??0,0),20),o=r/dr,i=bt(e.frame)?Rn(dr,e.frame):null,s=(i?.width??dr)*o,a=(i?.height??dr)*o,c=t.cropMarks?n+f5+Hg+1:n,u=qC(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 Xg=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}`);});}},Yg=class extends si{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]=Lr(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=Se(s,Se(r.matrix,n.matrix));if(!(this.shadingResources&&Ur(a)))return;let c=this.shadingResources.name(Ku(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(`${Yu(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),u&&(this.setColor("draw",u),this.pdf.setLineWidth(n.strokeWidth*eo(n.matrix))),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();});}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=eo(r.matrix),[s,a]=ne(r.matrix,oe(t.attrs.x,r.viewport[0]),oe(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/il);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&&(el(n)?n:this.images.get(n)),i=o&&el(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=s5(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 WC(e,t,r){let{trimX:n,trimY:o,trimWidth:i,trimHeight:s,bleed:a}=r,c=a+f5,u=n,l=n+i,f=o,p=o+s;t.setRegistrationColor(),e.setLineWidth(VC);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+Hg),d),e.line(m,d+g*c,m,d+g*(c+Hg));}}}async function HC(e,t){return (await m5(e,t)).output("dataurlstring")}async function UT(e,t){return (await m5(e,t)).output("arraybuffer")}async function m5(e,t){let r=sl(e,t),n;try{({jsPDF:n}=await import('jspdf'));}catch(y){throw new Error(`PDF export needs the optional "jspdf" package. Install it with \`npm install jspdf\`. (${y})`)}let o=await Gs(e),i=yr(o);if(!i)throw new Error("Failed to render the QR code for printing");let s=new Map;for(let y of Us(i,new Set))if(!el(y)){let _=await tl(y);_&&s.set(y,_);}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=Xu(i),u=c.size>0?Xg.attach(a):null,l=new Yg(a,t.colorMode==="cmyk",Bs(i,new Map),u?{gradients:c,resources:u}:null,s);ol(l,e);let f=r.codeWidth/dr,p=oe(i.attrs.width,dr,dr),m=oe(i.attrs.height,dr,dr),h={matrix:Se([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?nl(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 y=d?l.resolveColor(d):null;y&&(l.setColor("fill",y),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&&WC(a,l,r),a}async function XC(e,t){let r=sl(e,{size:t.size,unit:t.unit}),n=await Gs(e),o=t.unit??"mm",i=c=>`${$(o==="in"?c/il: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 GT(e,t){let r=await HC(e,t);Ot(r,t.filename??"qr-code-print.pdf");}async function QT(e,t){let r=await XC(e,t);Ot(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r)}`,t.filename??"qr-code-print.svg");}var YC=[137,80,78,71,13,10,26,10];async function d5(e,t){let r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}async function h5(e){return typeof CompressionStream>"u"?null:await d5(e,new CompressionStream("deflate"))}async function KC(e){if(typeof DecompressionStream>"u")return null;try{return await d5(e,new DecompressionStream("deflate"))}catch{return null}}var Kg=(e,t)=>e[t]*2**24+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,p5={0:1,2:3,3:1,4:2,6:4};function JC(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 Jg(e){if(YC.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=Kg(e,t),g=String.fromCharCode(...e.subarray(t+4,t+8)),y=e.subarray(t+8,t+8+d);if(t+=12+d,g==="IHDR"){r=Kg(y,0),n=Kg(y,4);let _=y[8];o=y[9];let b=y[12];if(_!==8||b!==0||!(o in p5))return null}else if(g==="PLTE")i=y;else if(g==="tRNS")s=y;else if(g==="IDAT")a.push(y);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 KC(c),f=p5[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)],y=l.subarray(d*(p+1)+1,(d+1)*(p+1)),_=d*p;for(let b=0;b<p;b++){let S=b>=f?m[_+b-f]:0,v=d>0?m[_-p+b]:0,x=d>0&&b>=f?m[_-p+b-f]:0,w=y[b],C=0;g===1?C=S:g===2?C=v:g===3?C=S+v>>1:g===4&&(C=JC(S,v,x)),m[_+b]=w+C&255;}}let h=new Uint8Array(r*n*4);for(let d=0;d<r*n;d++){let g=d*4,y=d*f;if(o===3){let _=m[y];h[g]=i?.[_*3]??0,h[g+1]=i?.[_*3+1]??0,h[g+2]=i?.[_*3+2]??0,h[g+3]=s?.[_]??255;}else if(o===0||o===4){let _=m[y];h[g]=_,h[g+1]=_,h[g+2]=_,h[g+3]=o===4?m[y+1]:255;}else h[g]=m[y],h[g+1]=m[y+1],h[g+2]=m[y+2],h[g+3]=o===6?m[y+3]:255;}return {width:r,height:n,data:h}}var eE=25.4,g5=72/eE,tE=50;function rE(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 nE(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 oE(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]=Lr(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 h5(s);return {kind:"raw",width:r,height:n,components:i,bytes:a??s,compressed:!!a}}async function iE(e,t){let r=e;if(!/^data:image\/(png|jpe?g)[;,]/i.test(r)){let s=await tl(r);if(!s)return null;r=s;}let n=rE(r);if(!n)return null;let o=nE(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 Jg(n);return i?await oE(i,t):null}function sE(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 aE=`/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
|
|
86
|
-
`));}};async function
|
|
87
|
-
`)}var p5="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 d5(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 sl(e,t={}){if(d5(e))throw new Error(p5);let r=il(e,{size:t.sizeMm??WC,unit:"mm",bleed:t.bleedMm}),n=await Us(e);return await m5(n,{width:r.trimWidth*f5,bleed:r.bleed*f5,bleedColor:r.bleed>0?rl(e,n):Qg(e),colorMode:t.colorMode,background:ze(e.bgColor,Ne)})}function al(e){return `data:application/postscript;base64,${btoa(e)}`}async function tE(e,t={}){let r=await sl(e,t);Yt(al(r),t.filename??"qr-code-print.eps");}var Kg={png:{mimeType:"image/png",extension:"png",vector:false},jpg:{mimeType:"image/jpeg",extension:"jpg",vector:false},webp:{mimeType:"image/webp",extension:"webp",vector:false},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}},JT={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 Jg(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 In(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 Yt(e,t){let r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r);}var h5=e=>(Kg[e]??Kg.png).mimeType;function rE(e,t,r){let{extension:n,vector:o}=Kg[e];if(o)return `qr-code.${n}`;let{width:i,height:s}=ur(t.width,r);return `qr-code-${Math.round(i)}x${Math.round(s)}.${n}`}async function g5(e,t={}){let r=await oi(e,"image/webp",true);try{return await Wu(r,t)}finally{r.remove();}}var nE=25.4/72;async function y5(e){let t=await sl(e,{sizeMm:(e.size??ve)*nE});return al(t)}async function _5(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 Nt(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}=ur(e.size||ve,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 y=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(y);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(_){clearTimeout(y),d.remove(),m(new Error(`Failed to draw image to canvas: ${_}`));}},h.onerror=()=>{clearTimeout(y),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 b5(e,t){let{format:r,size:n,filename:o,quality:i}=t,s=Jg(n.width,n.height);if(!s.isValid)throw new Error(s.error);let a=In(e,n.width),c=o||rE(r,n,e.frame);try{if(r==="svg"){let u=await Nt(a);Yt(u,c);}else if(r==="pdf"){let u=await _5(a);Yt(u,c);}else if(r==="eps")Yt(await y5(a),c);else if(r==="webp"){let u=await g5(a,{quality:i});Yt(await Zs(u),c);}else {let u=h5(r),l=await oi(a,u);if(typeof l=="string")Yt(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 x5(e,t,r,n={}){let o=Jg(r.width,r.height);if(!o.isValid)throw new Error(o.error);let i=In(e,r.width);if(t==="svg")return await Nt(i);if(t==="pdf")return await _5(i);if(t==="eps")return await y5(i);if(t==="webp")return await Zs(await g5(i,n));let s=h5(t),a=await oi(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}async function eL(e,t={width:ve,height:ve}){try{let r=Jg(t.width,t.height);if(!r.isValid)throw new Error(r.error);let n=In(e,t.width),o=oi(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 tL(e){let t=await Nt(e);return decodeURIComponent(t.replace("data:image/svg+xml,",""))}var ht={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},be=class extends Error{},oE={script:e=>`Removed ${Ie(e,"script")}`,style:e=>`Removed ${Ie(e,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":e=>`Removed ${Ie(e,"foreignObject element")}`,image:e=>`Removed ${Ie(e,"image")}: frames are vector shapes only`,use:e=>`Removed ${Ie(e,"<use> reference")}: ungroup or detach symbols before exporting`,text:e=>`Removed ${Ie(e,"text element")}: add text as labels in the frame editor`,effects:e=>`Removed ${Ie(e,"filter, mask, clip path or pattern")}`,animation:e=>`Removed ${Ie(e,"animation")}`,unknown:e=>`Removed ${Ie(e,"unsupported element")}`,"nested-svg":e=>`Removed ${Ie(e,"nested <svg>")}: flatten it first`,handlers:e=>`Removed ${Ie(e,"event handler attribute")}`,links:e=>`Removed ${Ie(e,"link")} (href)`,"external-paint":e=>`Removed ${Ie(e,"fill or stroke")} that referenced something outside the file`,gradient:e=>`Flattened ${Ie(e,"gradient")} to its first color: add gradients in the frame editor`,opacity:e=>`Made ${Ie(e,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":e=>`${Ie(e,"color")} couldn't be read and fell back to the parent color`,stroke:e=>`Removed ${Ie(e,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:e=>`Drew ${Ie(e,"dashed stroke")} as solid`,clipped:e=>`Cut ${Ie(e,"shape")} at the edge of the artboard`,outside:e=>`Removed ${Ie(e,"shape")} outside the artboard`,colors:e=>`Merged ${Ie(e,"color")} with similar ones (${ht.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 Ie(e,t){return `${e} ${t}${e===1?"":"s"}`}var n1=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:oE[t](r)}))}},iE=/^\s*<\?xml\s[^?>]*\?>/,e1=/[A-Za-z_][\w:.-]*/y,t1=/<\/([A-Za-z_][\w:.-]*)\s*>/y,cl=/\s*/y,sE=/[A-Za-z_:][\w:.-]*/y,aE=/[^"<]*/y,cE=/[^'<]*/y;function si(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function $5(e,t){let r=si(cl,e,t),n=si(sE,e,r);if(r===t||n===r)return -1;let o=si(cl,e,n);if(e[o]!=="=")return -1;let i=si(cl,e,o+1),s=e[i];if(s!=='"'&&s!=="'")return -1;let c=si(s==='"'?aE:cE,e,i+1);return e[c]===s?c+1:-1}function uE(e,t){let r=si(cl,e,t);return e[r]===">"?{end:r+1,selfClosing:false}:e.startsWith("/>",r)?{end:r+2,selfClosing:true}:null}function lE(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 be("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 be("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 be("The SVG has an unclosed declaration");o=u+2;continue}if(e.startsWith("<!",o))throw new be("DOCTYPE and other declarations are not allowed");if(e[o+1]==="/"){t1.lastIndex=o;let u=t1.exec(e);if(!u)throw new be("The SVG has a malformed closing tag");if(t.pop()!==u[1])throw new be(`The SVG closes <${u[1]}> out of order`);o=t1.lastIndex;continue}e1.lastIndex=o+1;let s=e1.exec(e);if(!s)throw new be("The SVG has a malformed tag");let a=e1.lastIndex;for(let u=$5(e,a);u>=0;u=$5(e,a))a=u;let c=uE(e,a);if(!c)throw new be(`The SVG has a malformed <${s[0]}> tag (attributes must be quoted and may not contain "<")`);if(r++,r>ht.maxElements)throw new be(`The SVG has more than ${ht.maxElements} elements`);if(n||(n=s[0]),!c.selfClosing&&(t.push(s[0]),t.length>ht.maxDepth))throw new be(`The SVG nests elements more than ${ht.maxDepth} deep`);o=c.end;}if(t.length>0)throw new be(`The SVG doesn't close <${t.at(-1)}>`);return n}function fE(e){if(typeof e!="string")throw new be("Expected SVG markup as a string");let t=new TextEncoder().encode(e).length;if(t>ht.maxBytes)throw new be(`The SVG is ${Math.ceil(t/1e3)} KB; the limit is ${ht.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(e))throw new be("DOCTYPE and entity declarations are not allowed");let r=e.replace(iE,"");if(r.includes("<?"))throw new be("Processing instructions (such as xml-stylesheet) are not allowed");if(lE(r)!=="svg")throw new be("The file must start with an <svg> element");return r}var r1=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function zt(e){let t=e?.replace(/!important/i,"").trim();return t===""||t==="inherit"?void 0:t}function o1(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"),o1(a,t,r,n)):(n.add("external-paint"),null)}let i=Ae(o==="currentColor"?t.color:o);return i?i.a<=0?null:`#${r1(i.r)}${r1(i.g)}${r1(i.b)}`:(n.add("invalid-paint"),null)}function mE(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&&zt(ue(s,"stop-color"));a&&n.set(o,a);}return n}function w5(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 pE(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 s1(e){return e.length<3?[]:[...e.map(([t,r],n)=>({op:n===0?"M":"L",x:t,y:r})),{op:"Z"}]}var Gr=e=>Number.isFinite(e);function Ee(e,t,r=0){let n=Number.parseFloat(e.attrs[t]??"");return Gr(n)?n:r}function S5(e){switch(e.name){case "path":return Jt(e.attrs.d??"");case "rect":{let t=e.attrs.rx??e.attrs.ry,r=e.attrs.ry??e.attrs.rx;return Ut(Ee(e,"x"),Ee(e,"y"),Ee(e,"width"),Ee(e,"height"),Number.parseFloat(t??"0")||0,Number.parseFloat(r??"0")||0)}case "circle":{let t=Ee(e,"r");return Gt(Ee(e,"cx"),Ee(e,"cy"),t,t)}case "ellipse":return Gt(Ee(e,"cx"),Ee(e,"cy"),Ee(e,"rx"),Ee(e,"ry"));case "polygon":case "polyline":{let t=Bt(e.attrs.points),r=[];for(let n=0;n+1<t.length;n+=2)r.push([t[n],t[n+1]]);return s1(r)}default:return []}}function dE(e,t){let r=t/2;switch(e.name){case "rect":{let n=Ee(e,"x"),o=Ee(e,"y"),i=Ee(e,"width"),s=Ee(e,"height"),a=Number.parseFloat(e.attrs.rx??e.attrs.ry??"0")||0,c=Ut(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,...Ut(n+r,o+r,i-t,s-t,u,u)]}case "circle":case "ellipse":{let n=Ee(e,"cx"),o=Ee(e,"cy"),i=e.name==="circle"?Ee(e,"r"):Ee(e,"rx"),s=e.name==="circle"?Ee(e,"r"):Ee(e,"ry"),a=Gt(n,o,i+r,s+r);return i<=r||s<=r?a:[...a,...Gt(n,o,i-r,s-r)]}case "line":{let[n,o,i,s]=["x1","y1","x2","y2"].map(f=>Ee(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 s1(pE(l)<0?l.reverse():l)}default:return null}}var hE=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),gE=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),yE={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"},_E=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function C5(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 E5(e,t,r,n,o){if(C5(e,n),zt(ue(e,"display"))==="none"||zt(ue(e,"visibility"))==="hidden")return;let i=Number.parseFloat(ue(e,"opacity")??"1"),s=zt(ue(e,"fill-rule")),a=Number.parseFloat(zt(ue(e,"stroke-width"))??""),c={matrix:Se(t.matrix,St(e.attrs.transform)),fill:zt(ue(e,"fill"))??t.fill,fillRule:s==="evenodd"||s==="nonzero"?s:t.fillRule,stroke:zt(ue(e,"stroke"))??t.stroke,strokeWidth:Gr(a)&&a>=0?a:t.strokeWidth,color:zt(ue(e,"color"))??t.color,opacity:t.opacity*(Gr(i)?i:1)};for(let u of e.children){if(gE.has(u.name))continue;let l=yE[u.name];if(l){n.add(l);continue}if(u.name==="svg"){n.add("nested-svg");continue}if(u.name==="g"||u.name==="a"){E5(u,c,r,n,o);continue}if(!hE.has(u.name)){n.add("unknown");continue}bE(u,c,r,n,o);}}function bE(e,t,r,n,o){if(C5(e,n),zt(ue(e,"display"))==="none"||zt(ue(e,"visibility"))==="hidden")return;let i=Se(t.matrix,St(e.attrs.transform));if(e.name==="rect"&&_E.test(e.attrs.id??"")&&!o.qrBox){o.qrBox=Hr(w5(S5(e),i));return}let s=g=>zt(ue(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=Gr(p)&&p>=0?p:t.strokeWidth,h=(g,y,_)=>{if(g.length!==0){if(o.segments+=g.length,o.segments>ht.maxInputSegments)throw new be(`The SVG has more than ${ht.maxInputSegments} path segments; simplify it`);o.shapes.push({segments:w5(g,i),fill:y,fillRule:_});}},d=g=>{let y=(Gr(a)?a:1)*(Gr(g)?g:1);return y<=0?false:(y<1&&n.add("opacity"),true)};if(e.name!=="line"){let g=o1(f.fill,f,r,n);g&&d(c)&&h(S5(e),g,f.fillRule);}if(m>0&&f.stroke!=="none"){let g=o1(f.stroke,f,r,n);if(g&&d(u)){let y=dE(e,m);y?((s("stroke-dasharray")??"none")!=="none"&&n.add("dash"),h(y,g,e.name==="line"?"nonzero":"evenodd")):n.add("stroke");}}}function xE(e,t){let r=u=>{let l=10**t;return Math.round(u*l)/l+0},n=u=>$(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 $E=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function wE(e){let t=[];for(let r of e){let n=Hr(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=>$E(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 i1=e=>[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)];function SE(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=i1(s[m]),g=i1(s[h]),y=Math.hypot(d[0]-g[0],d[1]-g[1],d[2]-g[2]);y<c&&(c=y,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 v5=e=>{let[t,r,n]=i1(e);return .2126*t+.7152*r+.0722*n>235};function vE(e,t={}){let r=new n1;try{let n=fE(e),o=yr(n);if(!o)throw new be("No <svg> element found");let i=Bt(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=Ee(o,"width"),u=Ee(o,"height")),!(Gr(c)&&Gr(u)&&c>0&&u>0))throw new be("The SVG needs a viewBox (or a width and height)");let f=ht.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 be("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};E5(o,{matrix:h,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},mE(o),r,d);let g={x0:0,y0:0,x1:p,y1:m},y=Math.max(p,m)*.004,_=[],b=0,S=0;for(let Z of d.shapes){let K=Hr(Z.segments);if(!K||K.x1<=0||K.y1<=0||K.x0>=p||K.y0>=m){b++;continue}if(K.x0<-y||K.y0<-y||K.x1>p+y||K.y1>m+y){let J=Ks(Z.segments,.25).map(Ve=>Hn(Ve,g)).filter(Ve=>Ve.length>2);if(J.length===0){b++;continue}S++,_.push({...Z,segments:J.flatMap(Ve=>s1(Ve))});}else _.push(Z);}if(b>0&&r.add("outside",b),S>0&&r.add("clipped",S),_.length===0)throw new be("The SVG has no filled shapes to use");let v=SE(_,ht.maxColors,r);for(let Z of _)Z.fill=v.get(Z.fill)??Z.fill;let x=new Map,w=new Map;for(let Z of _){let K=Hr(Z.segments);x.set(Z.fill,(x.get(Z.fill)??0)+(K.x1-K.x0)*(K.y1-K.y0)),w.set(Z.fill,(w.get(Z.fill)??0)+1);}let C=[...x.keys()].sort((Z,K)=>Number(v5(Z))-Number(v5(K))||x.get(K)-x.get(Z)),A=C[0],k=C[1],M=Z=>Z===A?"frame":Z===k?"accent":Z,T=d.qrBox;if(!T&&t.qr){let[Z,K]=ne(h,t.qr.x,t.qr.y);T={x0:Z,y0:K,x1:Z+t.qr.size*f,y1:K+t.qr.size*f};}let L,D,B;T?(L=Math.min(T.x1-T.x0,T.y1-T.y0),D=(T.x0+T.x1-L)/2,B=(T.y0+T.y1-L)/2):(r.add("qr-placed"),L=Math.min(p,m)*.6,D=(p-L)/2,B=(m-L)/2);let z=Z=>Math.round(Z*10)/10+0;if(L=Math.floor(L*10)/10,D=z(D),B=z(B),L<Math.min(p,m)*ee.minQrShare)throw new be("The QR area must be at least half the frame's shorter side");let j=Math.min(D,B,p-D-L,m-B-L);if(j<L*ee.minPadding-1e-9)throw new be("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let te=Math.min(Math.max(t.padding??ht.padding,ee.minPadding),.2),U=Math.floor(Math.min(L*te,j)*10)/10,Y=wE(_);if(Y.length>ee.maxShapes)throw new be(`The artwork has ${Y.length} separate shapes; the limit is ${ee.maxShapes}. Combine shapes of the same color first`);let de={kind:Xr,version:Yr,artboard:{width:p,height:m},qr:{x:D,y:B,size:L,padding:U},colors:{frame:A,...k&&{accent:k}},shapes:Y.map(Z=>({type:"path",d:xE(Z.segments,ht.decimals),fill:M(Z.fill),...Z.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},Te=vu(de);if(!Te.success){let Z=Te.issues[0];throw new be(`The converted frame doesn't fit the frame format: ${Z?.message??"invalid"}`)}let $e=C.map(Z=>({color:Z,ref:Z===A?"frame":Z===k?"accent":"fixed",shapes:w.get(Z)??0}));return {ok:!0,spec:Te.data,warnings:r.list(),palette:$e}}catch(n){return {ok:false,error:n instanceof be?n.message:`Could not read the SVG (${n instanceof Error?n.name:"error"})`,warnings:r.list()}}}var CE=1013,EE={"call-to-action":105,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};var AE=[{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"}];function a1(e){return Array.isArray(e)?`[${e.map(a1).join(",")}]`:e&&typeof e=="object"?`{${Object.keys(e).filter(r=>e[r]!==void 0).sort().map(r=>`${JSON.stringify(r)}:${a1(e[r])}`).join(",")}}`:JSON.stringify(e)}function PE(e){let t=a1(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 kE(e,t){return Le.QrCode.encodeText(e,Ke[t??Dt]).size}function A5(e,t,r,n=r.size*(t?.size??Al)){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=kE(r.value,r.level),a=at(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 P5(e,t,r,n){let o=r.level??Dt,i=o;n&&(i=xt({...r,imageSettings:A5(e,t,r),autoLevel:n}));let s=c=>{let u=f=>A5(e,t,{...r,level:c},f),l=$g(r,[c],u().width,u);return l>0?u(l):void 0};if(i===o)return s(o);let a=s(i);return a&&xt({...r,imageSettings:a,autoLevel:n})===i?a:s(o)}function RE({value:e,level:t,margin:r,shape:n,autoLevel:o,logoOptions:i}){let a=P5("data:,",{...i,size:li},{value:`${e}`,size:1024,margin:r??Oe,level:t,shape:n},o);return a?a.width/1024:0}function c1({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:y,autoLevel:_,shape:b}){let S={value:`${e}`,size:t,margin:l??Oe,level:m,shape:b},v=!a&&c?P5(c,u,S,_):void 0;return {value:S.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},...y!==void 0&&{moduleScale:y},..._&&{autoLevel:_},...b&&b!=="square"&&{shape:b},...v&&{imageSettings:v}}}var k5=.06,R5=.16,M5=512;function I5(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=O0({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)>=R5||(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)-k5)/(R5-k5))),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 _=(n[d+g]/255-(1-h)*p[g])/h;f[d+g]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:t,height:r,data:f}}async function ME(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,M5/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=I5(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 IE(e){let{value:t,size:r=ve,level:n=Dt,bgColor:o=Ne,fgColor:i=je,margin:s=Oe,imageSettings:a,eyeColor:c,dotColor:u,bodyPattern:l,cornerEyePattern:f,cornerEyeDotPattern:p,isOGContext:m,templateId:h,customTemplate:d,customProps:g,frame:y,art:_,eyeColors:b,moduleScale:S,frameLabelMarkers:v,partMarkers:x,autoLevel:w,...C}=e,A=Zu({value:t,size:r,margin:s,level:n,autoLevel:w},a),k=xt({value:t,size:r,level:n,margin:s,imageSettings:A,autoLevel:w}),M=Le.QrCode.encodeText(t,Ke[k]).getModules(),T=M.length+s*2,L=Dr(M,r,s,A),D=null;if(A!=null&&L!=null){L.excavation!=null&&(M=Tg(M,L.excavation));let z=A.src.startsWith("data:")?A.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(A.src)}&w=100&h=100&encoding=base64`).then(j=>{if(!j.ok)throw new Error(`Failed to load QR logo (${j.status}): ${A.src}`);return j.text()});D={settings:{...A,src:z},box:{x:L.x+s,y:L.y+s,w:L.w,h:L.h}};}let B=I$(M,s);return {size:r,numCells:T,fgPath:B,bgColor:o,fgColor:i,frame:y,svgProps:C,logo:D}}function TE(e){let{size:t,numCells:r,fgPath:n,bgColor:o,fgColor:i,frame:s,svgProps:a,logo:c}=e,u=bt(s),l=c?Fu(c.settings,c.box):I(Wt,{}),f=Qe("svg",{height:t,viewBox:`0 0 ${r} ${r}`,width:t,xmlns:"http://www.w3.org/2000/svg",...u?{}:a,children:[I("path",{d:`M0,0 h${r}v${r}H0z`,fill:ze(o,Ne),shapeRendering:"crispEdges"}),I("path",{d:n,fill:ze(i,je),shapeRendering:"crispEdges"}),l]});return u&&s?Iu(f,{size:t,frame:s,bgColor:o,svgProps:a}):f}async function LE(e){return TE(await IE(e))}var NE={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,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function zE(e){let t={};for(let r of Object.keys(e))Object.hasOwn(NE,r)||(t[r]=e[r]);return t}function T5(e){return c1({value:e.value,fgColor:e.fgColor,hideLogo:e.hideLogo,bgColor:e.bgColor,eyeColor:e.eyeColor,dotColor:e.dotColor,bodyPattern:e.bodyPattern,cornerEyePattern:e.cornerEyePattern,cornerEyeDotPattern:e.cornerEyeDotPattern,level:e.level,templateId:e.templateId,logo:e.logo,logoOptions:e.logoOptions,margin:e.margin??Oe,autoLevel:e.autoLevel,shape:e.shape})}function L5(e,t){let{size:r=ve,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=r*n,y=g/t.size,_=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&&m!=="square"&&{shape:m},...h&&{frameLabelMarkers:h},...d&&{partMarkers:d},size:g,style:i,templateId:t.templateId,value:t.value,..._&&{imageSettings:_},...zE(e)}}function OE(e){return L5(e,T5(e))}function N5(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(!bn(o))throw new TypeError("qrdx: can't render this value");let{type:i,props:s,key:a}=o;if(Go(i)){n(s.children);return}if(typeof i=="function"){n(i(s));return}let c={};for(let u of Object.keys(s)){let l=ni(u,s[u]);l&&(c[l.name]=l.value);}r.push(t(i,c,N5(s.children,t),a));};return n(e),r}var z5={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"]},O5={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},F5=["circle","curly"],D5=["diamond","banner","star"],Z5={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Ot=["square","liquid","classy","classy-rounded"],B5={"circle/rounded":Ot,"circle/extra-rounded":Ot,"circle/message":[...Ot,"leaf"],"circle/pointy":Ot,"circle/leaf-reverse":Ot,"circle/drop":Ot,"circle/bevel":[...Ot,"leaf"],"circle/squircle":[...Ot,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Ot,"circle/shield":[...Ot,"rounded","horizontal-line","leaf"],"circle/petal":Ot};function G5(e,t,r){return (Z5[e]?.includes(t)??false)&&!B5[`${e}/${t}`]?.includes(r)}function u1(e){let t=e.bodyPattern??"circle",r=e.cornerEyePattern??"gear",n=e.cornerEyeDotPattern??"circle";return z5[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"}:O5[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"}:D5.includes(n)?{kind:"dot",message:`${n} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:F5.includes(r)?{kind:"eye",message:`${r} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:G5(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 ai=300,Qs=e=>{let t=typeof e=="number"?e:Number.parseFloat(String(e));return Number.isFinite(t)?t:void 0};function FE(e){let t=Qs(e.x)??0,r=Qs(e.y)??0,n=Bt(typeof e.viewBox=="string"?e.viewBox:void 0),o=Qs(e.width),i=Qs(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 l1(e,t,r,n){if(e===t)return r;if(Array.isArray(e)){for(let a of e){let c=l1(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=Se(r,St(typeof i.transform=="string"?i.transform:void 0));return o.type==="svg"&&!n&&(s=Se(s,FE(i))),l1(i.children,t,s,false)}function f1(e){let t=e.customTemplate||(e.templateId?Bu(e.templateId):void 0);if(!t)return 1;let r={type:"svg",props:{height:ai,viewBox:`0 0 ${ai} ${ai}`,width:ai},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=Bt(typeof o.viewBox=="string"?o.viewBox:void 0),s=i.length===4?i[2]:Qs(o.width),a=l1(n,r,Yn,true);if(!(a&&s))return 1;let[c,u]=ne(a,0,0),[l,f]=ne(a,ai,ai),m=Math.min(Math.abs(l-c),Math.abs(f-u))/s;return m>0&&m<=1?m:1}var H5=[96,160,320],p1=640;function h1(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Qr(e){if(e?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var X5=()=>new Promise(e=>setTimeout(e,0));async function g1(){let{default:e}=await import('jsqr');return e}function d1(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 DE(e,t,r=.7){let{data:n,width:o,height:i}=e;for(let l=0;l<n.length;l+=4)for(let f=0;f<3;f++)n[l+f]=128+(n[l+f]-128)*r;let s=Math.max(1,Math.round(t*.25)),a=2*s+1,c=new Float32Array(o*i*3),u=l=>{let f=l?i:o,p=l?o:i,m=l?o:1,h=l?1:o;for(let d=0;d<f;d++){let g=d*m,y=0,_=0,b=0;for(let S=-s;S<=s;S++){let v=(g+Math.min(Math.max(S,0),p-1)*h)*4;y+=n[v],_+=n[v+1],b+=n[v+2];}for(let S=0;S<p;S++){let v=(g+S*h)*3;c[v]=y/a,c[v+1]=_/a,c[v+2]=b/a;let x=(g+Math.max(S-s,0)*h)*4,w=(g+Math.min(S+s+1,p-1)*h)*4;y=y-n[x]+n[w],_=_-n[x+1]+n[w+1],b=b-n[x+2]+n[w+2];}}for(let d=0,g=0;d<o*i*3;d+=3,g+=4)n[g]=c[d],n[g+1]=c[d+1],n[g+2]=c[d+2];};for(let l=0;l<2;l++)u(true),u(false);}function ci(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 ZE=[.9,1,1.1];function y1(e,t,r,n,o){let i=0;for(let s of ZE){let a=r*s,c=t(a);DE(c,a/n),o(e(c.data,c.width,c.height))&&i++;}return i>=2?"pass":i===1?"fragile":"fail"}var m1={small:"small print or far away",medium:"typical phone distance",large:"close up"};function BE(e,t){return e===t[0]&&t.length>1?m1.small:e===t.at(-1)?m1.large:m1.medium}function Y5(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 K5(e,t,r){let n=`${e} px (${BE(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 J5(e,t){return t?"fails":e>=85?"great":e>=65?"ok":"risky"}function GE(e,t,r){let n=$t(e,t);if(n.type==="solid")return [n.color];if(n.type!=="image")return n.stops.map(a=>a.color);let o=n.underlay?ll(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=ll(a);if(!c)return [];let u={...c,a:c.a*s};if(!o)return [U5(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 [U5({r:f(u.r,o.r),g:f(u.g,o.g),b:f(u.b,o.b),a:l})]})}var U5=({r:e,g:t,b:r,a:n})=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(r)}, ${Math.round(n*1e3)/1e3})`;function UE(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:ti(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 QE(e){h1();let t=await qs(e),{canvas:r,ctx:n}=ci(64,64);n.drawImage(t,0,0,64,64);let o=UE(n.getImageData(0,0,64,64));return r.remove(),o}function e4(e){let t=[e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Ys.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 Vs=null;function ll(e){let t=Ae(e);if(t||typeof document>"u")return t;if(Vs??=document.createElement("canvas").getContext("2d"),!Vs)return null;Vs.fillStyle="#010203",Vs.fillStyle=e;let r=String(Vs.fillStyle);return r==="#010203"?null:Ae(r)}var Q5=e=>ti(e.r,e.g,e.b),t4=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),js=4.5,VE=3,V5=1.5,j5={code:7,background:12},q5={r:255,g:255,b:255,a:1},W5=(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 jE(e,t={}){let r=t.imageTones,n=(m,h)=>{let d=typeof m=="object"&&m?.type==="image";return GE(m,h,r).map(g=>({color:g,picture:d}))},o=e.fgColor??je,i=Ys.flatMap(m=>{let h=e.eyeColors?.[m];return [...h?.outer?n(h.outer,je):[],...h?.inner?n(h.inner,je):[]]}),s=[...n(o,je),...n(e.eyeColor??o,je),...n(e.dotColor??o,je),...i],a=n(e.bgColor,Ne),c=(a.length>0?a:[{color:"#ffffff",picture:false}]).map(m=>{let h=ll(m.color);return {color:h?W5(h,q5):q5,picture:m.picture}}),u=s.flatMap(m=>{let h=ll(m.color);return h?[{color:h,picture:m.picture}]:[]}),l=Number.POSITIVE_INFINITY,f=js,p=false;for(let m of u)for(let h of c){let d=Q5(W5(m.color,h.color)),g=Q5(h.color),y=t4(d,g),_=h.picture?j5.background:m.picture?j5.code:js;y/_<l/f&&(l=y,f=_),d>g&&(p=true);}return {ratio:Number.isFinite(l)?l:Number.POSITIVE_INFINITY,required:f,inverted:p}}function qE(e,t){let{ratio:r,inverted:n,required:o}=jE(e,{imageTones:t});if(!Number.isFinite(r))return {checks:[],penalty:0,fails:false};let i=o/js,s=o!==js,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<V5*i?60:r<VE*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<V5*(o/js)}}function _1(e){return Le.QrCode.encodeText(e.value,Ke[xt(e)]).getModules()}function WE(e){let{imageSettings:t}=e;if(!t)return {check:null,penalty:0};let r=_1(e),n=Dr(r,e.size??ve,at(r.length,e.margin??Oe,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=xt(e),p=Math.round(l*100),m=Du({value:e.value,size:e.size??ve,margin:e.margin??Oe,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 HE(e){let t=_g(e.shape)?kn(e.margin??Oe):e.margin??Oe,r=_1(e).length+2*t,n=t+(bt(e.frame)?gg(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 XE(e){let t=e.cornerEyePattern??"gear";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 qs(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 YE=`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 KE(e){let{imageSettings:t}=e;if(!t||t.src.startsWith("data:"))return e;let r=YE;try{let n=await qs(t.src),{canvas:o,ctx:i}=ci(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 JE(e){let t=new Map;for(let o of e4(e))if(!o.startsWith("data:"))try{let i=await qs(o),{canvas:s,ctx:a}=ci(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??je},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 r4(e,t,r,n,o){let i=[],s=0,a=qE(e,o);s+=a.penalty;let c=WE(e);s+=c.penalty;let u=HE(e);s+=u.penalty;let l=XE(e);s+=l.penalty;let f=u1(e),p=f?.kind==="eye"?null:f;p&&p.kind!=="sharp-dot-eye"&&(s+=10);let m=await g1();Qr(n);let h=_1(e).length,d=h+2*at(h,e.margin??Oe,e.shape),g=[],y=false;for(let[S,v]of r.entries()){await X5(),Qr(n);let x=y1(m,t,v,d,w=>d1(w,e.value));s+=Y5(S,r.length,x),g.push(K5(v,r,x)),S===r.length-1&&x==="fail"&&(y=true);}i.push(...g,...a.checks),c.check&&i.push(c.check),i.push(l.check,u.check),p&&i.push({id:"style-pair",passed:false,message:p.message,fix:p.fix});let _=y||a.fails,b=Math.max(0,Math.min(100,100-s));return _&&(b=Math.min(b,30)),{score:b,grade:J5(b,_),checks:i}}function n4(e){return [...e.sizes??H5].filter(t=>t>0).sort((t,r)=>t-r)}async function rN(e,t={}){h1();let{signal:r}=t,n=n4(t),o=p1/f1(e),i=await JE(await KE(In({...e,size:e.size??ve},o)));Qr(r);let s={};for(let f of e4(e))try{let p=await QE(f);p&&(s[f]=p);}catch{}Qr(r);let a=await Nt(i),c=await qs(a);Qr(r);let u=ur(o,e.frame);return await r4(e,f=>{let p=f/p1,m=u.width*p,h=u.height*p,d=Math.max(8,Math.round(f*.12)),{canvas:g,ctx:y}=ci(m+2*d,h+2*d);y.fillStyle="#ffffff",y.fillRect(0,0,g.width,g.height),y.drawImage(c,d,d,m,h);let _=y.getImageData(0,0,g.width,g.height);return g.remove(),_},n,r,s)}var nN=p1;async function oN(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=n4(r),s=e.size??ve,a=ur(s,e.frame),c=n*s*f1(e)/a.width,u={data:eA(t),width:n,height:o};return await r4(e,f=>{let p=o4(u,f/c),m=Math.max(8,Math.round(f*.12));return tA(p,m)},i,r.signal)}function eA(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 tA(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 Ur=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function ul(e,t){return .299*e[t]+.587*e[t+1]+.114*e[t+2]}function rA(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 nA(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 qs(t);return await r.decode?.().catch(()=>{}),r}finally{setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function iN(e,t={}){h1();let{signal:r}=t,n=[...t.sizes??H5].filter(W=>W>0).sort((W,ye)=>W-ye),o=await g1(),i=await nA(e);Qr(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}=ci(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(Qr(r),!p){let W=await T2(i,0,false);return u.remove(),typeof W!="string"||W==="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:W,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=(Ur(m.topLeftCorner,m.topRightCorner)+Ur(m.bottomLeftCorner,m.bottomRightCorner)+Ur(m.topLeftCorner,m.bottomLeftCorner)+Ur(m.topRightCorner,m.bottomRightCorner))/4,y=g/d,_=[m.topLeftCorner,m.topRightCorner,m.bottomRightCorner,m.bottomLeftCorner],b=Math.max(0,Math.floor(Math.min(..._.map(W=>W.x)))),S=Math.min(f.width,Math.ceil(Math.max(..._.map(W=>W.x)))),v=Math.max(0,Math.floor(Math.min(..._.map(W=>W.y)))),x=Math.min(f.height,Math.ceil(Math.max(..._.map(W=>W.y)))),w=[],C=0,A=new Array(256).fill(0),k=0;for(let W=v;W<x;W++)for(let ye=b;ye<S;ye++){let ie=Math.round(ul(f.data,(W*f.width+ye)*4));A[ie]=A[ie]+1,k++;}let M=rA(A,k),T={dark:[0,0,0,0],light:[0,0,0,0]};for(let W=v;W<x;W++)for(let ye=b;ye<S;ye++){let ie=(W*f.width+ye)*4,Re=ul(f.data,ie)<=M?T.dark:T.light;Re[0]=Re[0]+f.data[ie],Re[1]=Re[1]+f.data[ie+1],Re[2]=Re[2]+f.data[ie+2],Re[3]=Re[3]+1;}let L=W=>{let ye=Math.max(W[3],1);return ti(W[0]/ye,W[1]/ye,W[2]/ye)},D=L(T.dark),B=L(T.light),z=t4(D,B),j=Math.round(z*10)/10;z>=4.5?w.push({id:"contrast",passed:true,message:`Contrast ${j}:1 in the image`}):(C+=z<2?30:10,w.push({id:"contrast",passed:false,message:`Low contrast in the image (${j}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let U=[m.topLeftFinderPattern,m.topRightFinderPattern,m.bottomLeftFinderPattern].map(W=>{let ye=Math.min(f.width-1,Math.max(0,Math.round(W.x))),ie=Math.min(f.height-1,Math.max(0,Math.round(W.y)));return ul(f.data,(ie*f.width+ye)*4)}).filter(W=>W>M).length>=2;U?(C+=10,w.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"})):w.push({id:"polarity",passed:true,message:"Dark code on a light background"});let Y=Math.max(2,Math.round(y*2)),de={minX:b-Y,maxX:S+Y,minY:v-Y,maxY:x+Y};if(de.minX<0||de.minY<0||de.maxX>f.width||de.maxY>f.height)w.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let W=0,ye=0;for(let ie=de.minY;ie<de.maxY;ie++)for(let Re=de.minX;Re<de.maxX;Re++){if(Re>=b&&Re<S&&ie>=v&&ie<x)continue;let ui=ul(f.data,(ie*f.width+Re)*4);(U?ui>M:ui<=M)&&W++,ye++;}W/Math.max(ye,1)>.12?(C+=10,w.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"})):w.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}y<2?w.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(y*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):w.push({id:"resolution",passed:true,message:`About ${Math.round(y)} px per module`});let $e=Math.round(y*4),Z=Math.max(0,b-$e),K=Math.max(0,v-$e),J=Math.min(f.width,S+$e)-Z,Ve=Math.min(f.height,x+$e)-K,Vr=W=>{let ye=W/g,ie=ci(J*ye,Ve*ye);ie.ctx.drawImage(u,Z,K,J,Ve,0,0,ie.canvas.width,ie.canvas.height);let Re=ie.ctx.getImageData(0,0,ie.canvas.width,ie.canvas.height);return ie.canvas.remove(),Re},gt=[],Kt=false;for(let[W,ye]of n.entries()){await X5(),Qr(r);let ie=y1(o,Vr,ye,d,Re=>Re?.data===p.data);C+=Y5(W,n.length,ie),gt.push(K5(ye,n,ie)),W===n.length-1&&ie==="fail"&&(Kt=true);}u.remove();let jr=Math.max(0,Math.min(100,100-C));return Kt&&(jr=Math.min(jr,30)),{data:p.data,version:h,score:jr,grade:J5(jr,Kt),checks:[...gt,...w]}}var oA=[320];function o4(e,t){let r=Math.min(1,t),n=Math.max(1,Math.round(e.width*r)),o=Math.max(1,Math.round(e.height*r)),i=new Uint8ClampedArray(n*o*4),s=e.width/n,a=e.height/o;for(let c=0;c<o;c++){let u=Math.floor(c*a),l=Math.max(u+1,Math.min(e.height,Math.floor((c+1)*a)));for(let f=0;f<n;f++){let p=Math.floor(f*s),m=Math.max(p+1,Math.min(e.width,Math.floor((f+1)*s))),h=0,d=0,g=0,y=0;for(let S=u;S<l;S++)for(let v=p;v<m;v++){let x=(S*e.width+v)*4;h+=e.data[x],d+=e.data[x+1],g+=e.data[x+2],y+=e.data[x+3];}let _=(l-u)*(m-p),b=(c*n+f)*4;i[b]=h/_,i[b+1]=d/_,i[b+2]=g/_,i[b+3]=y/_;}}return {data:i,width:n,height:o,colorSpace:"srgb"}}function iA(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(e.binaryData))}catch{return e.data}}async function sN(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 g1(),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=iA(a),{version:u,location:l}=a;if(!d1(a,t))return {data:c,version:u,passed:false};let f=17+4*u,p=(Ur(l.topLeftCorner,l.topRightCorner)+Ur(l.bottomLeftCorner,l.bottomRightCorner)+Ur(l.topLeftCorner,l.bottomLeftCorner)+Ur(l.topRightCorner,l.bottomRightCorner))/4;for(let m of r.sizes??oA)if(y1(i,d=>o4(s,d/p),m,f,d=>d1(d,t))!=="pass")return {data:c,version:u,passed:false};return {data:c,version:u,passed:true}}var sA=16,i4=.01;function aA(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 cA(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=aA(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 s4(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 a4(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=cA(e,t.mode??"auto"),s=i.reduce((w,C)=>w+C,0);s4(i,r,n,Math.max(16,s*i4));let a=r,c=n,u=-1,l=-1;for(let w=0;w<n;w++)for(let C=0;C<r;C++)i[w*r+C]&&(a=Math.min(a,C),c=Math.min(c,w),u=Math.max(u,C),l=Math.max(l,w));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)<sA)throw new Error("The shape is too small to trace; use a bigger picture");let h=Math.min(Math.max(Math.round(t.cells??wt),Rt),wt)/Math.max(f,p),d=Math.max(Rt,Math.round(f*h)),g=Math.max(Rt,Math.round(p*h)),y=Math.max(1,Math.round(f*h)),_=Math.max(1,Math.round(p*h)),b=Math.floor((d-y)/2),S=Math.floor((g-_)/2),v=new Uint8Array(d*g);for(let w=0;w<_;w++){let C=c+Math.floor(w*p/_),A=Math.max(C+1,c+Math.floor((w+1)*p/_));for(let k=0;k<y;k++){let M=a+Math.floor(k*f/y),T=Math.max(M+1,a+Math.floor((k+1)*f/y)),L=0;for(let D=C;D<A;D++)for(let B=M;B<T;B++)L+=i[D*r+B];v[(w+S)*d+k+b]=L*2>=(A-C)*(T-M)?1:0;}}let x=v.reduce((w,C)=>w+C,0);if(s4(v,d,g,Math.max(4,x*i4)),!v.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(v,w=>w?"1":"0").join("")}}var b1=512;async function uA(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 lA(e,t={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let r=await uA(e),n=r.naturalWidth||r.width||b1,o=r.naturalHeight||r.height||b1,i=b1/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 a4(l,t)}var c4=(e,t)=>{let r=t??e.size??ve;return {width:r,height:r}};function KN(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=ri(n),u=Xt(c);if(o&&u===i)return;let l=Ds(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||Xt(ri(n))},toDataURL(c="png",u={}){return x5(n,c,c4(n,u.size),{quality:u.quality})},download(c={}){return b5(n,{format:c.format??"png",size:c4(n,c.size),filename:c.filename,quality:c.quality})},destroy(){s||(s=true,o?.remove(),o=null);}}}/**
|
|
85
|
+
end`;function e1(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 t1=class extends si{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]=Lr(t.r,t.g,t.b);return `${$(r)} ${$(n)} ${$(o)} ${$(i)} cmyk`}return `${$(t.r/255)} ${$(t.g/255)} ${$(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(`${$(s)} ${$(a)} m`),o=true;}else if(i.op==="L"){let[s,a]=ne(r,i.x,i.y);n.push(`${$(s)} ${$(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(`${$(s)} ${$(a)} ${$(c)} ${$(u)} ${$(l)} ${$(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 ${$(r)} ${$(n)} m ${$(r+o)} ${$(n)} l ${$(r+o)} ${$(n+i)} l ${$(r)} ${$(n+i)} l h f`);}shade(t,r,n){let o=Se(r.matrix,n.matrix);if(!Ur(o))return;let i=Ku(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 [${Yu(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";s&&c?this.out.push(`gsave ${this.color(s)} ${u} ${l} grestore`):s&&this.out.push(`${this.color(s)} ${u} ${l}`),c&&this.out.push(`${this.color(c)} ${$(n.strokeWidth*eo(n.matrix))} w ${u} s`);}text(t,r){let n=t.text.replace(/\s+/g," ").trim(),o=this.resolveColor(r.fill);if(!(n&&o))return;let i=eo(r.matrix),[s,a]=ne(r.matrix,oe(t.attrs.x,r.viewport[0]),oe(t.attrs.y,r.viewport[1])),u=r.fontWeight==="bold"||Number.parseInt(r.fontWeight,10)>=600?"/QRDX-Bold":"/QRDX-Regular",l=$(r.fontSize*i),f=Number.parseFloat(t.attrs["data-max-width"]??""),p=f>0?` dup stringwidth pop dup ${$(f*i)} gt {${$(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 ${$(s)} ${$(a)} translate ${$(h)} rotate ${e1(n)}${p} 0 0 moveto${m} show grestore`);return}this.out.push(`gsave ${this.color(o)} ${u} findfont ${l} scalefont setfont ${e1(n)}${p} ${$(s)} ${$(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=oe(t.attrs.x,r.viewport[0]),s=oe(t.attrs.y,r.viewport[1]),a=oe(t.attrs.width,r.viewport[0]),c=oe(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",`${$(Math.min(u,f))} ${$(Math.min(l,p))} translate ${$(Math.abs(f-u))} ${$(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`,sE(o.bytes),"grestore"].join(`
|
|
86
|
+
`));}};async function y5(e,t={}){let r=yr(e);if(!r)throw new Error("Could not read the SVG to convert to EPS");let n=oe(r.attrs.width,0,0)||512,o=oe(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 _ of Us(r,new Set)){let b=await iE(_,f);b&&p.set(_,b);}let m=new t1(f,Bs(r,new Map),Xu(r),p);ol(m,{bgColor:t.background??"#ffffff"});let d={matrix:Se([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 _=g?m.resolveColor(g):null;_&&m.rect(_,0,0,u,l);}m.walk(r,d,true);let y=(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 ${$(u)} ${$(l)}`,`%%Title: ${e1(y)}`,"%%Creator: qrdx",`%%LanguageLevel: ${m.usesLevel3?3:2}`,"%%DocumentData: Clean7Bit","%%EndComments","%%BeginProlog",aE,"%%EndProlog","qrdxdict begin",...Array.from(m.shadingNames,([_,b])=>`/${b} ${_} def`),"gsave",...m.out,"grestore","end","showpage","%%Trailer","%%EOF",""].join(`
|
|
87
|
+
`)}var _5="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 b5(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 al(e,t={}){if(b5(e))throw new Error(_5);let r=sl(e,{size:t.sizeMm??tE,unit:"mm",bleed:t.bleedMm}),n=await Gs(e);return await y5(n,{width:r.trimWidth*g5,bleed:r.bleed*g5,bleedColor:r.bleed>0?nl(e,n):Wg(e),colorMode:t.colorMode,background:Oe(e.bgColor,Ne)})}function cl(e){return `data:application/postscript;base64,${btoa(e)}`}async function cE(e,t={}){let r=await al(e,t);Ot(cl(r),t.filename??"qr-code-print.eps");}var r1={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},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}},mL={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 n1(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 Ln(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 Ot(e,t){let r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r);}var x5=e=>(r1[e]??r1.png).mimeType;function uE(e,t,r){let{extension:n,vector:o}=r1[e];if(o)return `qr-code.${n}`;let{width:i,height:s}=ur(t.width,r);return `qr-code-${Math.round(i)}x${Math.round(s)}.${n}`}async function $5(e,t={}){let r=await Tn(e,"image/webp",true);try{return await Hu(r,t)}finally{r.remove();}}async function w5(e){let t=await Tn(e,"image/png",true);try{return bu(t)}finally{t.remove();}}var lE=25.4/72;async function S5(e){let t=await al(e,{sizeMm:(e.size??ve)*lE});return cl(t)}async function v5(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 Nt(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}=ur(e.size||ve,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 y=setTimeout(()=>{d.remove(),m(new Error("SVG load timeout - image may be too large or contain invalid data"));},3e4);h.onload=()=>{clearTimeout(y);try{g.drawImage(h,0,0,d.width,d.height),p(d);}catch(_){clearTimeout(y),d.remove(),m(new Error(`Failed to draw image to canvas: ${_}`));}},h.onerror=()=>{clearTimeout(y),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 C5(e,t){let{format:r,size:n,filename:o,quality:i}=t,s=n1(n.width,n.height);if(!s.isValid)throw new Error(s.error);let a=Ln(e,n.width),c=o||uE(r,n,e.frame);try{if(r==="svg"){let u=await Nt(a);Ot(u,c);}else if(r==="pdf"){let u=await v5(a);Ot(u,c);}else if(r==="eps")Ot(await S5(a),c);else if(r==="webp"){let u=await $5(a,{quality:i});Ot(await Br(u),c);}else if(r==="bmp"){let u=await w5(a);Ot(await Br(u),c);}else {let u=x5(r),l=await Tn(a,u);if(typeof l=="string")Ot(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 E5(e,t,r,n={}){let o=n1(r.width,r.height);if(!o.isValid)throw new Error(o.error);let i=Ln(e,r.width);if(t==="svg")return await Nt(i);if(t==="pdf")return await v5(i);if(t==="eps")return await S5(i);if(t==="webp")return await Br(await $5(i,n));if(t==="bmp")return await Br(await w5(i));let s=x5(t),a=await Tn(i,s);if(typeof a=="string")return a;throw new Error("Failed to generate QR code data URL")}async function pL(e,t={width:ve,height:ve}){try{let r=n1(t.width,t.height);if(!r.isValid)throw new Error(r.error);let n=Ln(e,t.width),o=Tn(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 dL(e){let t=await Nt(e);return decodeURIComponent(t.replace("data:image/svg+xml,",""))}var ht={maxBytes:2e5,maxElements:500,maxDepth:16,maxInputSegments:4e3,maxColors:8,artboardSide:1e3,decimals:1,padding:.06},be=class extends Error{},fE={script:e=>`Removed ${Ie(e,"script")}`,style:e=>`Removed ${Ie(e,"style sheet")}: colors set with CSS classes are lost. Export with presentation attributes (Illustrator: Styling \u2192 Presentation Attributes)`,"foreign-object":e=>`Removed ${Ie(e,"foreignObject element")}`,image:e=>`Removed ${Ie(e,"image")}: frames are vector shapes only`,use:e=>`Removed ${Ie(e,"<use> reference")}: ungroup or detach symbols before exporting`,text:e=>`Removed ${Ie(e,"text element")}: add text as labels in the frame editor`,effects:e=>`Removed ${Ie(e,"filter, mask, clip path or pattern")}`,animation:e=>`Removed ${Ie(e,"animation")}`,unknown:e=>`Removed ${Ie(e,"unsupported element")}`,"nested-svg":e=>`Removed ${Ie(e,"nested <svg>")}: flatten it first`,handlers:e=>`Removed ${Ie(e,"event handler attribute")}`,links:e=>`Removed ${Ie(e,"link")} (href)`,"external-paint":e=>`Removed ${Ie(e,"fill or stroke")} that referenced something outside the file`,gradient:e=>`Flattened ${Ie(e,"gradient")} to its first color: add gradients in the frame editor`,opacity:e=>`Made ${Ie(e,"semi-transparent shape")} opaque (print files have no transparency)`,"invalid-paint":e=>`${Ie(e,"color")} couldn't be read and fell back to the parent color`,stroke:e=>`Removed ${Ie(e,"stroke")} on paths, polygons or polylines: outline strokes before exporting (Figma: Outline stroke)`,dash:e=>`Drew ${Ie(e,"dashed stroke")} as solid`,clipped:e=>`Cut ${Ie(e,"shape")} at the edge of the artboard`,outside:e=>`Removed ${Ie(e,"shape")} outside the artboard`,colors:e=>`Merged ${Ie(e,"color")} with similar ones (${ht.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 Ie(e,t){return `${e} ${t}${e===1?"":"s"}`}var a1=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:fE[t](r)}))}},mE=/^\s*<\?xml\s[^?>]*\?>/,o1=/[A-Za-z_][\w:.-]*/y,i1=/<\/([A-Za-z_][\w:.-]*)\s*>/y,ul=/\s*/y,pE=/[A-Za-z_:][\w:.-]*/y,dE=/[^"<]*/y,hE=/[^'<]*/y;function ai(e,t,r){return e.lastIndex=r,e.test(t)?e.lastIndex:r}function P5(e,t){let r=ai(ul,e,t),n=ai(pE,e,r);if(r===t||n===r)return -1;let o=ai(ul,e,n);if(e[o]!=="=")return -1;let i=ai(ul,e,o+1),s=e[i];if(s!=='"'&&s!=="'")return -1;let c=ai(s==='"'?dE:hE,e,i+1);return e[c]===s?c+1:-1}function gE(e,t){let r=ai(ul,e,t);return e[r]===">"?{end:r+1,selfClosing:false}:e.startsWith("/>",r)?{end:r+2,selfClosing:true}:null}function yE(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 be("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 be("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 be("The SVG has an unclosed declaration");o=u+2;continue}if(e.startsWith("<!",o))throw new be("DOCTYPE and other declarations are not allowed");if(e[o+1]==="/"){i1.lastIndex=o;let u=i1.exec(e);if(!u)throw new be("The SVG has a malformed closing tag");if(t.pop()!==u[1])throw new be(`The SVG closes <${u[1]}> out of order`);o=i1.lastIndex;continue}o1.lastIndex=o+1;let s=o1.exec(e);if(!s)throw new be("The SVG has a malformed tag");let a=o1.lastIndex;for(let u=P5(e,a);u>=0;u=P5(e,a))a=u;let c=gE(e,a);if(!c)throw new be(`The SVG has a malformed <${s[0]}> tag (attributes must be quoted and may not contain "<")`);if(r++,r>ht.maxElements)throw new be(`The SVG has more than ${ht.maxElements} elements`);if(n||(n=s[0]),!c.selfClosing&&(t.push(s[0]),t.length>ht.maxDepth))throw new be(`The SVG nests elements more than ${ht.maxDepth} deep`);o=c.end;}if(t.length>0)throw new be(`The SVG doesn't close <${t.at(-1)}>`);return n}function _E(e){if(typeof e!="string")throw new be("Expected SVG markup as a string");let t=new TextEncoder().encode(e).length;if(t>ht.maxBytes)throw new be(`The SVG is ${Math.ceil(t/1e3)} KB; the limit is ${ht.maxBytes/1e3} KB`);if(/<!(?:DOCTYPE|ENTITY|ATTLIST|ELEMENT|NOTATION)/i.test(e))throw new be("DOCTYPE and entity declarations are not allowed");let r=e.replace(mE,"");if(r.includes("<?"))throw new be("Processing instructions (such as xml-stylesheet) are not allowed");if(yE(r)!=="svg")throw new be("The file must start with an <svg> element");return r}var s1=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0");function zt(e){let t=e?.replace(/!important/i,"").trim();return t===""||t==="inherit"?void 0:t}function c1(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"),c1(a,t,r,n)):(n.add("external-paint"),null)}let i=Pe(o==="currentColor"?t.color:o);return i?i.a<=0?null:`#${s1(i.r)}${s1(i.g)}${s1(i.b)}`:(n.add("invalid-paint"),null)}function bE(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&&zt(ue(s,"stop-color"));a&&n.set(o,a);}return n}function A5(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 xE(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 l1(e){return e.length<3?[]:[...e.map(([t,r],n)=>({op:n===0?"M":"L",x:t,y:r})),{op:"Z"}]}var Gr=e=>Number.isFinite(e);function Ee(e,t,r=0){let n=Number.parseFloat(e.attrs[t]??"");return Gr(n)?n:r}function R5(e){switch(e.name){case "path":return Jt(e.attrs.d??"");case "rect":{let t=e.attrs.rx??e.attrs.ry,r=e.attrs.ry??e.attrs.rx;return Qt(Ee(e,"x"),Ee(e,"y"),Ee(e,"width"),Ee(e,"height"),Number.parseFloat(t??"0")||0,Number.parseFloat(r??"0")||0)}case "circle":{let t=Ee(e,"r");return Gt(Ee(e,"cx"),Ee(e,"cy"),t,t)}case "ellipse":return Gt(Ee(e,"cx"),Ee(e,"cy"),Ee(e,"rx"),Ee(e,"ry"));case "polygon":case "polyline":{let t=Ut(e.attrs.points),r=[];for(let n=0;n+1<t.length;n+=2)r.push([t[n],t[n+1]]);return l1(r)}default:return []}}function $E(e,t){let r=t/2;switch(e.name){case "rect":{let n=Ee(e,"x"),o=Ee(e,"y"),i=Ee(e,"width"),s=Ee(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=Ee(e,"cx"),o=Ee(e,"cy"),i=e.name==="circle"?Ee(e,"r"):Ee(e,"rx"),s=e.name==="circle"?Ee(e,"r"):Ee(e,"ry"),a=Gt(n,o,i+r,s+r);return i<=r||s<=r?a:[...a,...Gt(n,o,i-r,s-r)]}case "line":{let[n,o,i,s]=["x1","y1","x2","y2"].map(f=>Ee(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 l1(xE(l)<0?l.reverse():l)}default:return null}}var wE=new Set(["path","rect","circle","ellipse","polygon","polyline","line"]),SE=new Set(["defs","linearGradient","radialGradient","stop","title","desc","metadata"]),vE={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"},CE=/^(?:qrdx[-_ ]?)?qr(?:[-_ ]?code)?$/i;function M5(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 I5(e,t,r,n,o){if(M5(e,n),zt(ue(e,"display"))==="none"||zt(ue(e,"visibility"))==="hidden")return;let i=Number.parseFloat(ue(e,"opacity")??"1"),s=zt(ue(e,"fill-rule")),a=Number.parseFloat(zt(ue(e,"stroke-width"))??""),c={matrix:Se(t.matrix,St(e.attrs.transform)),fill:zt(ue(e,"fill"))??t.fill,fillRule:s==="evenodd"||s==="nonzero"?s:t.fillRule,stroke:zt(ue(e,"stroke"))??t.stroke,strokeWidth:Gr(a)&&a>=0?a:t.strokeWidth,color:zt(ue(e,"color"))??t.color,opacity:t.opacity*(Gr(i)?i:1)};for(let u of e.children){if(SE.has(u.name))continue;let l=vE[u.name];if(l){n.add(l);continue}if(u.name==="svg"){n.add("nested-svg");continue}if(u.name==="g"||u.name==="a"){I5(u,c,r,n,o);continue}if(!wE.has(u.name)){n.add("unknown");continue}EE(u,c,r,n,o);}}function EE(e,t,r,n,o){if(M5(e,n),zt(ue(e,"display"))==="none"||zt(ue(e,"visibility"))==="hidden")return;let i=Se(t.matrix,St(e.attrs.transform));if(e.name==="rect"&&CE.test(e.attrs.id??"")&&!o.qrBox){o.qrBox=Xr(A5(R5(e),i));return}let s=g=>zt(ue(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=Gr(p)&&p>=0?p:t.strokeWidth,h=(g,y,_)=>{if(g.length!==0){if(o.segments+=g.length,o.segments>ht.maxInputSegments)throw new be(`The SVG has more than ${ht.maxInputSegments} path segments; simplify it`);o.shapes.push({segments:A5(g,i),fill:y,fillRule:_});}},d=g=>{let y=(Gr(a)?a:1)*(Gr(g)?g:1);return y<=0?false:(y<1&&n.add("opacity"),true)};if(e.name!=="line"){let g=c1(f.fill,f,r,n);g&&d(c)&&h(R5(e),g,f.fillRule);}if(m>0&&f.stroke!=="none"){let g=c1(f.stroke,f,r,n);if(g&&d(u)){let y=$E(e,m);y?((s("stroke-dasharray")??"none")!=="none"&&n.add("dash"),h(y,g,e.name==="line"?"nonzero":"evenodd")):n.add("stroke");}}}function PE(e,t){let r=u=>{let l=10**t;return Math.round(u*l)/l+0},n=u=>$(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 AE=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function RE(e){let t=[];for(let r of e){let n=Xr(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=>AE(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 u1=e=>[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)];function kE(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=u1(s[m]),g=u1(s[h]),y=Math.hypot(d[0]-g[0],d[1]-g[1],d[2]-g[2]);y<c&&(c=y,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 k5=e=>{let[t,r,n]=u1(e);return .2126*t+.7152*r+.0722*n>235};function ME(e,t={}){let r=new a1;try{let n=_E(e),o=yr(n);if(!o)throw new be("No <svg> element found");let i=Ut(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=Ee(o,"width"),u=Ee(o,"height")),!(Gr(c)&&Gr(u)&&c>0&&u>0))throw new be("The SVG needs a viewBox (or a width and height)");let f=ht.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 be("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};I5(o,{matrix:h,fill:"#000000",fillRule:"nonzero",stroke:"none",strokeWidth:1,color:"#000000",opacity:1},bE(o),r,d);let g={x0:0,y0:0,x1:p,y1:m},y=Math.max(p,m)*.004,_=[],b=0,S=0;for(let Z of d.shapes){let K=Xr(Z.segments);if(!K||K.x1<=0||K.y1<=0||K.x0>=p||K.y0>=m){b++;continue}if(K.x0<-y||K.y0<-y||K.x1>p+y||K.y1>m+y){let J=Ks(Z.segments,.25).map(Ve=>Yn(Ve,g)).filter(Ve=>Ve.length>2);if(J.length===0){b++;continue}S++,_.push({...Z,segments:J.flatMap(Ve=>l1(Ve))});}else _.push(Z);}if(b>0&&r.add("outside",b),S>0&&r.add("clipped",S),_.length===0)throw new be("The SVG has no filled shapes to use");let v=kE(_,ht.maxColors,r);for(let Z of _)Z.fill=v.get(Z.fill)??Z.fill;let x=new Map,w=new Map;for(let Z of _){let K=Xr(Z.segments);x.set(Z.fill,(x.get(Z.fill)??0)+(K.x1-K.x0)*(K.y1-K.y0)),w.set(Z.fill,(w.get(Z.fill)??0)+1);}let C=[...x.keys()].sort((Z,K)=>Number(k5(Z))-Number(k5(K))||x.get(K)-x.get(Z)),P=C[0],R=C[1],M=Z=>Z===P?"frame":Z===R?"accent":Z,T=d.qrBox;if(!T&&t.qr){let[Z,K]=ne(h,t.qr.x,t.qr.y);T={x0:Z,y0:K,x1:Z+t.qr.size*f,y1:K+t.qr.size*f};}let L,D,B;T?(L=Math.min(T.x1-T.x0,T.y1-T.y0),D=(T.x0+T.x1-L)/2,B=(T.y0+T.y1-L)/2):(r.add("qr-placed"),L=Math.min(p,m)*.6,D=(p-L)/2,B=(m-L)/2);let O=Z=>Math.round(Z*10)/10+0;if(L=Math.floor(L*10)/10,D=O(D),B=O(B),L<Math.min(p,m)*ee.minQrShare)throw new be("The QR area must be at least half the frame's shorter side");let j=Math.min(D,B,p-D-L,m-B-L);if(j<L*ee.minPadding-1e-9)throw new be("Leave room around the QR area: at least 4% of its size on every side, inside the artboard");let te=Math.min(Math.max(t.padding??ht.padding,ee.minPadding),.2),G=Math.floor(Math.min(L*te,j)*10)/10,Y=RE(_);if(Y.length>ee.maxShapes)throw new be(`The artwork has ${Y.length} separate shapes; the limit is ${ee.maxShapes}. Combine shapes of the same color first`);let de={kind:Yr,version:Kr,artboard:{width:p,height:m},qr:{x:D,y:B,size:L,padding:G},colors:{frame:P,...R&&{accent:R}},shapes:Y.map(Z=>({type:"path",d:PE(Z.segments,ht.decimals),fill:M(Z.fill),...Z.fillRule==="evenodd"&&{fillRule:"evenodd"}})),labels:[]},Te=Cu(de);if(!Te.success){let Z=Te.issues[0];throw new be(`The converted frame doesn't fit the frame format: ${Z?.message??"invalid"}`)}let $e=C.map(Z=>({color:Z,ref:Z===P?"frame":Z===R?"accent":"fixed",shapes:w.get(Z)??0}));return {ok:!0,spec:Te.data,warnings:r.list(),palette:$e}}catch(n){return {ok:false,error:n instanceof be?n.message:`Could not read the SVG (${n instanceof Error?n.name:"error"})`,warnings:r.list()}}}var IE=1013,TE={"call-to-action":105,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};var LE=[{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"}];function f1(e){return Array.isArray(e)?`[${e.map(f1).join(",")}]`:e&&typeof e=="object"?`{${Object.keys(e).filter(r=>e[r]!==void 0).sort().map(r=>`${JSON.stringify(r)}:${f1(e[r])}`).join(",")}}`:JSON.stringify(e)}function NE(e){let t=f1(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 OE(e,t){return Le.QrCode.encodeText(e,Ke[t??Zt]).size}function T5(e,t,r,n=r.size*(t?.size??Al)){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=OE(r.value,r.level),a=at(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 L5(e,t,r,n){let o=r.level??Zt,i=o;n&&(i=xt({...r,imageSettings:T5(e,t,r),autoLevel:n}));let s=c=>{let u=f=>T5(e,t,{...r,level:c},f),l=Cg(r,[c],u().width,u);return l>0?u(l):void 0};if(i===o)return s(o);let a=s(i);return a&&xt({...r,imageSettings:a,autoLevel:n})===i?a:s(o)}function zE({value:e,level:t,margin:r,shape:n,autoLevel:o,logoOptions:i}){let a=L5("data:,",{...i,size:fi},{value:`${e}`,size:1024,margin:r??ze,level:t,shape:n},o);return a?a.width/1024:0}function m1({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:y,autoLevel:_,shape:b}){let S={value:`${e}`,size:t,margin:l??ze,level:m,shape:b},v=!a&&c?L5(c,u,S,_):void 0;return {value:S.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},...y!==void 0&&{moduleScale:y},..._&&{autoLevel:_},...b&&b!=="square"&&{shape:b},...v&&{imageSettings:v}}}var N5=.06,O5=.16,z5=512;function F5(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=F0({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)>=O5||(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)-N5)/(O5-N5))),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 _=(n[d+g]/255-(1-h)*p[g])/h;f[d+g]=Math.round(Math.min(1,Math.max(0,_))*255);}}return {width:t,height:r,data:f}}async function FE(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,z5/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=F5(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 DE(e){let{value:t,size:r=ve,level:n=Zt,bgColor:o=Ne,fgColor:i=je,margin:s=ze,imageSettings:a,eyeColor:c,dotColor:u,bodyPattern:l,cornerEyePattern:f,cornerEyeDotPattern:p,isOGContext:m,templateId:h,customTemplate:d,customProps:g,frame:y,art:_,eyeColors:b,moduleScale:S,frameLabelMarkers:v,partMarkers:x,autoLevel:w,...C}=e,P=Bu({value:t,size:r,margin:s,level:n,autoLevel:w},a),R=xt({value:t,size:r,level:n,margin:s,imageSettings:P,autoLevel:w}),M=Le.QrCode.encodeText(t,Ke[R]).getModules(),T=M.length+s*2,L=Dr(M,r,s,P),D=null;if(P!=null&&L!=null){L.excavation!=null&&(M=zg(M,L.excavation));let O=P.src.startsWith("data:")?P.src:await fetch(`https://wsrv.nl/?url=${encodeURIComponent(P.src)}&w=100&h=100&encoding=base64`).then(j=>{if(!j.ok)throw new Error(`Failed to load QR logo (${j.status}): ${P.src}`);return j.text()});D={settings:{...P,src:O},box:{x:L.x+s,y:L.y+s,w:L.w,h:L.h}};}let B=z$(M,s);return {size:r,numCells:T,fgPath:B,bgColor:o,fgColor:i,frame:y,svgProps:C,logo:D}}function ZE(e){let{size:t,numCells:r,fgPath:n,bgColor:o,fgColor:i,frame:s,svgProps:a,logo:c}=e,u=bt(s),l=c?Du(c.settings,c.box):I(Ht,{}),f=Qe("svg",{height:t,viewBox:`0 0 ${r} ${r}`,width:t,xmlns:"http://www.w3.org/2000/svg",...u?{}:a,children:[I("path",{d:`M0,0 h${r}v${r}H0z`,fill:Oe(o,Ne),shapeRendering:"crispEdges"}),I("path",{d:n,fill:Oe(i,je),shapeRendering:"crispEdges"}),l]});return u&&s?Tu(f,{size:t,frame:s,bgColor:o,svgProps:a}):f}async function BE(e){return ZE(await DE(e))}var UE={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,frameLabelMarkers:true,partMarkers:true,hideLogo:true,logo:true,logoOptions:true,scale:true};function GE(e){let t={};for(let r of Object.keys(e))Object.hasOwn(UE,r)||(t[r]=e[r]);return t}function D5(e){return m1({value:e.value,fgColor:e.fgColor,hideLogo:e.hideLogo,bgColor:e.bgColor,eyeColor:e.eyeColor,dotColor:e.dotColor,bodyPattern:e.bodyPattern,cornerEyePattern:e.cornerEyePattern,cornerEyeDotPattern:e.cornerEyeDotPattern,level:e.level,templateId:e.templateId,logo:e.logo,logoOptions:e.logoOptions,margin:e.margin??ze,autoLevel:e.autoLevel,shape:e.shape})}function Z5(e,t){let{size:r=ve,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=r*n,y=g/t.size,_=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&&m!=="square"&&{shape:m},...h&&{frameLabelMarkers:h},...d&&{partMarkers:d},size:g,style:i,templateId:t.templateId,value:t.value,..._&&{imageSettings:_},...GE(e)}}function QE(e){return Z5(e,D5(e))}function B5(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(!xn(o))throw new TypeError("qrdx: can't render this value");let{type:i,props:s,key:a}=o;if(Qo(i)){n(s.children);return}if(typeof i=="function"){n(i(s));return}let c={};for(let u of Object.keys(s)){let l=ii(u,s[u]);l&&(c[l.name]=l.value);}r.push(t(i,c,B5(s.children,t),a));};return n(e),r}var U5={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"]},G5={diamond:["square"],pacman:["rounded"],"small-square":["square","rounded"]},Q5=["circle","curly"],V5=["diamond","banner","star"],j5={circle:["square","rounded","diya","extra-rounded","message","pointy","leaf","leaf-reverse","drop","bevel","squircle","cushion","shield","petal"]},Ft=["square","liquid","classy","classy-rounded"],q5={"circle/rounded":Ft,"circle/extra-rounded":Ft,"circle/message":[...Ft,"leaf"],"circle/pointy":Ft,"circle/leaf-reverse":Ft,"circle/drop":Ft,"circle/bevel":[...Ft,"leaf"],"circle/squircle":[...Ft,"circle","diamond","circle-mixed","rounded","horizontal-line","leaf","heart","mosaic","octagon"],"circle/cushion":Ft,"circle/shield":[...Ft,"rounded","horizontal-line","leaf"],"circle/petal":Ft};function W5(e,t,r){return (j5[e]?.includes(t)??false)&&!q5[`${e}/${t}`]?.includes(r)}function p1(e){let t=e.bodyPattern??"circle",r=e.cornerEyePattern??"gear",n=e.cornerEyeDotPattern??"circle";return U5[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"}:G5[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"}:V5.includes(n)?{kind:"dot",message:`${n} centres are missed in sharp renders and up close`,fix:"Pick a square, rounded or circle centre"}:Q5.includes(r)?{kind:"eye",message:`${r} eyes only read in lenient decoders`,fix:"Pick square, rounded or gear eyes"}:W5(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 ci=300,Qs=e=>{let t=typeof e=="number"?e:Number.parseFloat(String(e));return Number.isFinite(t)?t:void 0};function VE(e){let t=Qs(e.x)??0,r=Qs(e.y)??0,n=Ut(typeof e.viewBox=="string"?e.viewBox:void 0),o=Qs(e.width),i=Qs(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 d1(e,t,r,n){if(e===t)return r;if(Array.isArray(e)){for(let a of e){let c=d1(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=Se(r,St(typeof i.transform=="string"?i.transform:void 0));return o.type==="svg"&&!n&&(s=Se(s,VE(i))),d1(i.children,t,s,false)}function h1(e){let t=e.customTemplate||(e.templateId?Uu(e.templateId):void 0);if(!t)return 1;let r={type:"svg",props:{height:ci,viewBox:`0 0 ${ci} ${ci}`,width:ci},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=Ut(typeof o.viewBox=="string"?o.viewBox:void 0),s=i.length===4?i[2]:Qs(o.width),a=d1(n,r,Jn,true);if(!(a&&s))return 1;let[c,u]=ne(a,0,0),[l,f]=ne(a,ci,ci),m=Math.min(Math.abs(l-c),Math.abs(f-u))/s;return m>0&&m<=1?m:1}var t4=[96,160,320],y1=640;function b1(){if(typeof document>"u")throw new Error("Scan scoring needs a browser (canvas + image decoding)")}function Vr(e){if(e?.aborted)throw new DOMException("Scan scoring was aborted","AbortError")}var r4=()=>new Promise(e=>setTimeout(e,0));async function x1(){let{default:e}=await import('jsqr');return e}function _1(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 jE(e,t,r=.7){let{data:n,width:o,height:i}=e;for(let l=0;l<n.length;l+=4)for(let f=0;f<3;f++)n[l+f]=128+(n[l+f]-128)*r;let s=Math.max(1,Math.round(t*.25)),a=2*s+1,c=new Float32Array(o*i*3),u=l=>{let f=l?i:o,p=l?o:i,m=l?o:1,h=l?1:o;for(let d=0;d<f;d++){let g=d*m,y=0,_=0,b=0;for(let S=-s;S<=s;S++){let v=(g+Math.min(Math.max(S,0),p-1)*h)*4;y+=n[v],_+=n[v+1],b+=n[v+2];}for(let S=0;S<p;S++){let v=(g+S*h)*3;c[v]=y/a,c[v+1]=_/a,c[v+2]=b/a;let x=(g+Math.max(S-s,0)*h)*4,w=(g+Math.min(S+s+1,p-1)*h)*4;y=y-n[x]+n[w],_=_-n[x+1]+n[w+1],b=b-n[x+2]+n[w+2];}}for(let d=0,g=0;d<o*i*3;d+=3,g+=4)n[g]=c[d],n[g+1]=c[d+1],n[g+2]=c[d+2];};for(let l=0;l<2;l++)u(true),u(false);}function ui(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 qE=[.9,1,1.1];function $1(e,t,r,n,o){let i=0;for(let s of qE){let a=r*s,c=t(a);jE(c,a/n),o(e(c.data,c.width,c.height))&&i++;}return i>=2?"pass":i===1?"fragile":"fail"}var g1={small:"small print or far away",medium:"typical phone distance",large:"close up"};function WE(e,t){return e===t[0]&&t.length>1?g1.small:e===t.at(-1)?g1.large:g1.medium}function n4(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 o4(e,t,r){let n=`${e} px (${WE(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 i4(e,t){return t?"fails":e>=85?"great":e>=65?"ok":"risky"}function HE(e,t,r){let n=$t(e,t);if(n.type==="solid")return [n.color];if(n.type!=="image")return n.stops.map(a=>a.color);let o=n.underlay?fl(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=fl(a);if(!c)return [];let u={...c,a:c.a*s};if(!o)return [H5(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 [H5({r:f(u.r,o.r),g:f(u.g,o.g),b:f(u.b,o.b),a:l})]})}var H5=({r:e,g:t,b:r,a:n})=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(r)}, ${Math.round(n*1e3)/1e3})`;function XE(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:ni(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 YE(e){b1();let t=await qs(e),{canvas:r,ctx:n}=ui(64,64);n.drawImage(t,0,0,64,64);let o=XE(n.getImageData(0,0,64,64));return r.remove(),o}function s4(e){let t=[e.bgColor,e.fgColor,e.eyeColor,e.dotColor,...Ys.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 Vs=null;function fl(e){let t=Pe(e);if(t||typeof document>"u")return t;if(Vs??=document.createElement("canvas").getContext("2d"),!Vs)return null;Vs.fillStyle="#010203",Vs.fillStyle=e;let r=String(Vs.fillStyle);return r==="#010203"?null:Pe(r)}var X5=e=>ni(e.r,e.g,e.b),a4=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),js=4.5,KE=3,Y5=1.5,K5={code:7,background:12},J5={r:255,g:255,b:255,a:1},e4=(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 JE(e,t={}){let r=t.imageTones,n=(m,h)=>{let d=typeof m=="object"&&m?.type==="image";return HE(m,h,r).map(g=>({color:g,picture:d}))},o=e.fgColor??je,i=Ys.flatMap(m=>{let h=e.eyeColors?.[m];return [...h?.outer?n(h.outer,je):[],...h?.inner?n(h.inner,je):[]]}),s=[...n(o,je),...n(e.eyeColor??o,je),...n(e.dotColor??o,je),...i],a=n(e.bgColor,Ne),c=(a.length>0?a:[{color:"#ffffff",picture:false}]).map(m=>{let h=fl(m.color);return {color:h?e4(h,J5):J5,picture:m.picture}}),u=s.flatMap(m=>{let h=fl(m.color);return h?[{color:h,picture:m.picture}]:[]}),l=Number.POSITIVE_INFINITY,f=js,p=false;for(let m of u)for(let h of c){let d=X5(e4(m.color,h.color)),g=X5(h.color),y=a4(d,g),_=h.picture?K5.background:m.picture?K5.code:js;y/_<l/f&&(l=y,f=_),d>g&&(p=true);}return {ratio:Number.isFinite(l)?l:Number.POSITIVE_INFINITY,required:f,inverted:p}}function eP(e,t){let{ratio:r,inverted:n,required:o}=JE(e,{imageTones:t});if(!Number.isFinite(r))return {checks:[],penalty:0,fails:false};let i=o/js,s=o!==js,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<Y5*i?60:r<KE*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<Y5*(o/js)}}function w1(e){return Le.QrCode.encodeText(e.value,Ke[xt(e)]).getModules()}function tP(e){let{imageSettings:t}=e;if(!t)return {check:null,penalty:0};let r=w1(e),n=Dr(r,e.size??ve,at(r.length,e.margin??ze,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=xt(e),p=Math.round(l*100),m=Zu({value:e.value,size:e.size??ve,margin:e.margin??ze,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 rP(e){let t=wg(e.shape)?kn(e.margin??ze):e.margin??ze,r=w1(e).length+2*t,n=t+(bt(e.frame)?xg(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 nP(e){let t=e.cornerEyePattern??"gear";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 qs(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 oP=`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 iP(e){let{imageSettings:t}=e;if(!t||t.src.startsWith("data:"))return e;let r=oP;try{let n=await qs(t.src),{canvas:o,ctx:i}=ui(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 sP(e){let t=new Map;for(let o of s4(e))if(!o.startsWith("data:"))try{let i=await qs(o),{canvas:s,ctx:a}=ui(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??je},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 c4(e,t,r,n,o){let i=[],s=0,a=eP(e,o);s+=a.penalty;let c=tP(e);s+=c.penalty;let u=rP(e);s+=u.penalty;let l=nP(e);s+=l.penalty;let f=p1(e),p=f?.kind==="eye"?null:f;p&&p.kind!=="sharp-dot-eye"&&(s+=10);let m=await x1();Vr(n);let h=w1(e).length,d=h+2*at(h,e.margin??ze,e.shape),g=[],y=false;for(let[S,v]of r.entries()){await r4(),Vr(n);let x=$1(m,t,v,d,w=>_1(w,e.value));s+=n4(S,r.length,x),g.push(o4(v,r,x)),S===r.length-1&&x==="fail"&&(y=true);}i.push(...g,...a.checks),c.check&&i.push(c.check),i.push(l.check,u.check),p&&i.push({id:"style-pair",passed:false,message:p.message,fix:p.fix});let _=y||a.fails,b=Math.max(0,Math.min(100,100-s));return _&&(b=Math.min(b,30)),{score:b,grade:i4(b,_),checks:i}}function u4(e){return [...e.sizes??t4].filter(t=>t>0).sort((t,r)=>t-r)}async function hN(e,t={}){b1();let{signal:r}=t,n=u4(t),o=y1/h1(e),i=await sP(await iP(Ln({...e,size:e.size??ve},o)));Vr(r);let s={};for(let f of s4(e))try{let p=await YE(f);p&&(s[f]=p);}catch{}Vr(r);let a=await Nt(i),c=await qs(a);Vr(r);let u=ur(o,e.frame);return await c4(e,f=>{let p=f/y1,m=u.width*p,h=u.height*p,d=Math.max(8,Math.round(f*.12)),{canvas:g,ctx:y}=ui(m+2*d,h+2*d);y.fillStyle="#ffffff",y.fillRect(0,0,g.width,g.height),y.drawImage(c,d,d,m,h);let _=y.getImageData(0,0,g.width,g.height);return g.remove(),_},n,r,s)}var gN=y1;async function yN(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=u4(r),s=e.size??ve,a=ur(s,e.frame),c=n*s*h1(e)/a.width,u={data:aP(t),width:n,height:o};return await c4(e,f=>{let p=l4(u,f/c),m=Math.max(8,Math.round(f*.12));return cP(p,m)},i,r.signal)}function aP(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 cP(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 Qr=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y);function ll(e,t){return .299*e[t]+.587*e[t+1]+.114*e[t+2]}function uP(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 lP(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 qs(t);return await r.decode?.().catch(()=>{}),r}finally{setTimeout(()=>URL.revokeObjectURL(t),1e3);}}async function _N(e,t={}){b1();let{signal:r}=t,n=[...t.sizes??t4].filter(W=>W>0).sort((W,ye)=>W-ye),o=await x1(),i=await lP(e);Vr(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}=ui(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(Vr(r),!p){let W=await F2(i,0,false);return u.remove(),typeof W!="string"||W==="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:W,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=(Qr(m.topLeftCorner,m.topRightCorner)+Qr(m.bottomLeftCorner,m.bottomRightCorner)+Qr(m.topLeftCorner,m.bottomLeftCorner)+Qr(m.topRightCorner,m.bottomRightCorner))/4,y=g/d,_=[m.topLeftCorner,m.topRightCorner,m.bottomRightCorner,m.bottomLeftCorner],b=Math.max(0,Math.floor(Math.min(..._.map(W=>W.x)))),S=Math.min(f.width,Math.ceil(Math.max(..._.map(W=>W.x)))),v=Math.max(0,Math.floor(Math.min(..._.map(W=>W.y)))),x=Math.min(f.height,Math.ceil(Math.max(..._.map(W=>W.y)))),w=[],C=0,P=new Array(256).fill(0),R=0;for(let W=v;W<x;W++)for(let ye=b;ye<S;ye++){let ie=Math.round(ll(f.data,(W*f.width+ye)*4));P[ie]=P[ie]+1,R++;}let M=uP(P,R),T={dark:[0,0,0,0],light:[0,0,0,0]};for(let W=v;W<x;W++)for(let ye=b;ye<S;ye++){let ie=(W*f.width+ye)*4,ke=ll(f.data,ie)<=M?T.dark:T.light;ke[0]=ke[0]+f.data[ie],ke[1]=ke[1]+f.data[ie+1],ke[2]=ke[2]+f.data[ie+2],ke[3]=ke[3]+1;}let L=W=>{let ye=Math.max(W[3],1);return ni(W[0]/ye,W[1]/ye,W[2]/ye)},D=L(T.dark),B=L(T.light),O=a4(D,B),j=Math.round(O*10)/10;O>=4.5?w.push({id:"contrast",passed:true,message:`Contrast ${j}:1 in the image`}):(C+=O<2?30:10,w.push({id:"contrast",passed:false,message:`Low contrast in the image (${j}:1)`,fix:"Use a darker code on a lighter background, or better lighting for photos"}));let G=[m.topLeftFinderPattern,m.topRightFinderPattern,m.bottomLeftFinderPattern].map(W=>{let ye=Math.min(f.width-1,Math.max(0,Math.round(W.x))),ie=Math.min(f.height-1,Math.max(0,Math.round(W.y)));return ll(f.data,(ie*f.width+ye)*4)}).filter(W=>W>M).length>=2;G?(C+=10,w.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"})):w.push({id:"polarity",passed:true,message:"Dark code on a light background"});let Y=Math.max(2,Math.round(y*2)),de={minX:b-Y,maxX:S+Y,minY:v-Y,maxY:x+Y};if(de.minX<0||de.minY<0||de.maxX>f.width||de.maxY>f.height)w.push({id:"quiet-zone",passed:true,skipped:true,message:"The image is cropped too tight to check the quiet zone"});else {let W=0,ye=0;for(let ie=de.minY;ie<de.maxY;ie++)for(let ke=de.minX;ke<de.maxX;ke++){if(ke>=b&&ke<S&&ie>=v&&ie<x)continue;let li=ll(f.data,(ie*f.width+ke)*4);(G?li>M:li<=M)&&W++,ye++;}W/Math.max(ye,1)>.12?(C+=10,w.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"})):w.push({id:"quiet-zone",passed:true,message:"Clear space around the code"});}y<2?w.push({id:"resolution",passed:false,message:`Low resolution: about ${Math.round(y*10)/10} px per module`,fix:"Use a larger image, or export the code at a bigger size"}):w.push({id:"resolution",passed:true,message:`About ${Math.round(y)} px per module`});let $e=Math.round(y*4),Z=Math.max(0,b-$e),K=Math.max(0,v-$e),J=Math.min(f.width,S+$e)-Z,Ve=Math.min(f.height,x+$e)-K,jr=W=>{let ye=W/g,ie=ui(J*ye,Ve*ye);ie.ctx.drawImage(u,Z,K,J,Ve,0,0,ie.canvas.width,ie.canvas.height);let ke=ie.ctx.getImageData(0,0,ie.canvas.width,ie.canvas.height);return ie.canvas.remove(),ke},gt=[],Kt=false;for(let[W,ye]of n.entries()){await r4(),Vr(r);let ie=$1(o,jr,ye,d,ke=>ke?.data===p.data);C+=n4(W,n.length,ie),gt.push(o4(ye,n,ie)),W===n.length-1&&ie==="fail"&&(Kt=true);}u.remove();let qr=Math.max(0,Math.min(100,100-C));return Kt&&(qr=Math.min(qr,30)),{data:p.data,version:h,score:qr,grade:i4(qr,Kt),checks:[...gt,...w]}}var fP=[320];function l4(e,t){let r=Math.min(1,t),n=Math.max(1,Math.round(e.width*r)),o=Math.max(1,Math.round(e.height*r)),i=new Uint8ClampedArray(n*o*4),s=e.width/n,a=e.height/o;for(let c=0;c<o;c++){let u=Math.floor(c*a),l=Math.max(u+1,Math.min(e.height,Math.floor((c+1)*a)));for(let f=0;f<n;f++){let p=Math.floor(f*s),m=Math.max(p+1,Math.min(e.width,Math.floor((f+1)*s))),h=0,d=0,g=0,y=0;for(let S=u;S<l;S++)for(let v=p;v<m;v++){let x=(S*e.width+v)*4;h+=e.data[x],d+=e.data[x+1],g+=e.data[x+2],y+=e.data[x+3];}let _=(l-u)*(m-p),b=(c*n+f)*4;i[b]=h/_,i[b+1]=d/_,i[b+2]=g/_,i[b+3]=y/_;}}return {data:i,width:n,height:o,colorSpace:"srgb"}}function mP(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(e.binaryData))}catch{return e.data}}async function bN(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 x1(),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=mP(a),{version:u,location:l}=a;if(!_1(a,t))return {data:c,version:u,passed:false};let f=17+4*u,p=(Qr(l.topLeftCorner,l.topRightCorner)+Qr(l.bottomLeftCorner,l.bottomRightCorner)+Qr(l.topLeftCorner,l.bottomLeftCorner)+Qr(l.topRightCorner,l.bottomRightCorner))/4;for(let m of r.sizes??fP)if($1(i,d=>l4(s,d/p),m,f,d=>_1(d,t))!=="pass")return {data:c,version:u,passed:false};return {data:c,version:u,passed:true}}var pP=16,f4=.01;function dP(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 hP(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=dP(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 m4(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 p4(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=hP(e,t.mode??"auto"),s=i.reduce((w,C)=>w+C,0);m4(i,r,n,Math.max(16,s*f4));let a=r,c=n,u=-1,l=-1;for(let w=0;w<n;w++)for(let C=0;C<r;C++)i[w*r+C]&&(a=Math.min(a,C),c=Math.min(c,w),u=Math.max(u,C),l=Math.max(l,w));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)<pP)throw new Error("The shape is too small to trace; use a bigger picture");let h=Math.min(Math.max(Math.round(t.cells??wt),kt),wt)/Math.max(f,p),d=Math.max(kt,Math.round(f*h)),g=Math.max(kt,Math.round(p*h)),y=Math.max(1,Math.round(f*h)),_=Math.max(1,Math.round(p*h)),b=Math.floor((d-y)/2),S=Math.floor((g-_)/2),v=new Uint8Array(d*g);for(let w=0;w<_;w++){let C=c+Math.floor(w*p/_),P=Math.max(C+1,c+Math.floor((w+1)*p/_));for(let R=0;R<y;R++){let M=a+Math.floor(R*f/y),T=Math.max(M+1,a+Math.floor((R+1)*f/y)),L=0;for(let D=C;D<P;D++)for(let B=M;B<T;B++)L+=i[D*r+B];v[(w+S)*d+R+b]=L*2>=(P-C)*(T-M)?1:0;}}let x=v.reduce((w,C)=>w+C,0);if(m4(v,d,g,Math.max(4,x*f4)),!v.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(v,w=>w?"1":"0").join("")}}var S1=512;async function gP(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 yP(e,t={}){if(typeof document>"u")throw new Error("loadQRSilhouette needs a browser; pass decoded pixels to createQRSilhouette instead");let r=await gP(e),n=r.naturalWidth||r.width||S1,o=r.naturalHeight||r.height||S1,i=S1/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 p4(l,t)}var d4=(e,t)=>{let r=t??e.size??ve;return {width:r,height:r}};function mO(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=oi(n),u=Yt(c);if(o&&u===i)return;let l=Zs(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||Yt(oi(n))},toDataURL(c="png",u={}){return E5(n,c,d4(n,u.size),{quality:u.quality})},download(c={}){return C5(n,{format:c.format??"png",size:d4(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{kl as AUTO_LEVEL_LOGO_COVERAGE,
|
|
91
|
+
*/export{kl as AUTO_LEVEL_LOGO_COVERAGE,Xx as Arrow,Zv as BMP_MAX_DIMENSION,Sl as BODY_PATTERN,_g as BUILT_IN_FRAMES,G7 as BUILT_IN_FRAME_SPECS,Hs as CORNER_EYE_DOT_PATTERNS,Xs as CORNER_EYE_PATTERNS,Jr as CUSTOM_FRAME_STYLE,u2 as DEFAULT_ART_INTENSITY,Cl as DEFAULT_FRAME_TEXT,ze as DEFAULT_MARGIN,ve as DEFAULT_SIZE,r1 as DOWNLOAD_FORMATS,y$ as DotRing,_5 as EPS_IMAGE_FILL_REASON,Ys as EYE_POSITIONS,gi as FRAME_COLOR_TOKENS,Iu as FRAME_FONT_FAMILY,gr as FRAME_FONT_SCALE_MAX,Hr as FRAME_FONT_SCALE_MIN,$x as FRAME_GAP_RATIO,di as FRAME_ICONS,fg as FRAME_ICON_BOX,W1 as FRAME_ICON_MAX_SEGMENTS,ht as FRAME_IMPORT_LIMITS,wx as FRAME_LABEL_ATTRIBUTE,Yr as FRAME_SPEC_KIND,hi as FRAME_SPEC_LABEL_MAX_FONT,ee as FRAME_SPEC_LIMITS,Kr as FRAME_SPEC_VERSION,vl as FRAME_STYLES,ut as FRAME_TEXT_MAX_LENGTH,Ht as Fragment,Ms as FrameSpecError,Q7 as GRADIENT_FRAME_DEFAULTS,b$ as Halloween,z5 as LOGO_CLEANUP_MAX_SIDE,Qx as LOGO_EC_SAFETY,Rl as LOGO_PADDING_MAX,Fu as LOGO_PLATE_INSET,zu as LOGO_ROUNDED_RADIUS,El as LOGO_SHAPES,Al as LOGO_SIZE_DEFAULT,fi as LOGO_SIZE_MAX,Pl as LOGO_SIZE_MIN,O2 as MODULE_SCALE_FLOOR,mi as MODULE_SCALE_MAX,Xn as MODULE_SCALE_MIN,LE as OFFICIAL_FRAME_COLLECTIONS,IE as OFFICIAL_FRAME_COUNT,TE as OFFICIAL_FRAME_COUNTS,fP as PIXEL_SCAN_SIZES,gN as PIXEL_SCORE_MIN_CODE_WIDTH,mL as PRESET_SIZES,Bt as QR_ART_MAX_SAMPLE_SIZE,yu as QR_ART_MIN_LUMA_GAP,Wn as QR_ART_MODES,Q0 as QR_ART_SAMPLE_SIZES,Hn as QR_ART_VARIANTS,Il as QR_CIRCLE_QUIET_MIN,Wx as QR_EYE_ATTRIBUTE,M8 as QR_PARTS,Eg as QR_PART_ATTRIBUTE,Ml as QR_SHAPES,wt as QR_SILHOUETTE_MAX_CELLS,kt as QR_SILHOUETTE_MIN_CELLS,Tl as QR_SILHOUETTE_MIN_SHARE,$l as RETIRED_CORNER_EYE_DOT_PATTERNS,wl as RETIRED_CORNER_EYE_PATTERNS,Y5 as SCAN_CONTRAST_FAIL,KE as SCAN_CONTRAST_LOW,js as SCAN_CONTRAST_MIN,K5 as SCAN_IMAGE_CONTRAST_MIN,t4 as SCAN_TEST_SIZES,q5 as SHARP_DOT_EYE_SAFE_BODIES,zI as SUPPORTS_PATH2D,$$ as SquareBorder,S$ as StandardBox,C$ as StrikedBox,Fs as TEMPLATES,G5 as WEAK_BODY_EYES,V5 as WEAK_DOTS,U5 as WEAK_DOT_EYES,Q5 as WEAK_EYES,j5 as WEAK_SHARP_DOT_EYES,PC as WEBP_MAX_DIMENSION,S0 as angularGradientSchema,mu as anyFrameSchema,Xb as baseTemplatePropsSchema,Br as blobToDataUrl,pu as bodyPatternSchema,bu as canvasToBMP,Hu as canvasToWebP,kn as circleQuietZone,$u as clampModuleScale,ir as colorConfigSchema,Db as colorTypeSchema,sC as convertImageSettingsToPixels,pL as copyQRCodeToClipboard,cu as cornerEyeDotPatternSchema,uu as cornerEyePatternSchema,l2 as createQRArtImage,mO as createQRCode,oi as createQRCodeTree,p4 as createQRSilhouette,M0 as customFrameSchema,$s as damagedCodewords,Jg as decodePNGPixels,Yx as defaultTemplate,Ot as downloadFile,Mk as downloadImageData,Ik as downloadImageWithBoundingBox,cE as downloadPrintEPS,GT as downloadPrintPDF,QT as downloadPrintSVG,C5 as downloadQRCode,tg as encodeBMP,Qg as encodeWebPLossless,cl as epsToDataUrl,T0 as errorLevelSchema,zg as excavateModules,Zb as excavationSchema,_s as eyeColorOverrideSchema,z0 as eyeColorsSchema,Cx as frameLabels,hs as frameSchema,Ir as frameSpecColorSchema,NE as frameSpecHash,k0 as frameSpecLabelSchema,ku as frameSpecOf,ro as frameSpecPadding,sr as frameSpecPaintSchema,ea as frameSpecQrZone,fu as frameSpecSchema,R0 as frameSpecShapeSchema,P0 as frameStyleSchema,z$ as generatePath,lI as getAllTemplates,bg as getBuiltInFrame,xs as getCodewordMap,x4 as getColorString,ZI as getContrastLevel,DI as getContrastRatio,gg as getCustomFrameLayout,uE as getDownloadFilename,V7 as getFrameColors,ur as getFrameDimensions,xg as getFrameGapRatio,mg as getFrameIconPath,Rn as getFrameLayout,W7 as getFrameSecondaryText,Au as getFrameSpecColors,hg as getFrameSpecGapRatio,qb as getFrameSpecIssues,q7 as getFrameText,_N as getImageScanScore,Dr as getImageSettings,YE as getImageTones,XE as getImageTonesFromPixels,at as getLayoutMargin,Zu as getLogoBlockDamage,zE as getLogoSizeLimit,ni as getLuminance,$4 as getNormalizedColor,sl as getPrintLayout,Sv as getQRArtColorIssue,J0 as getQRArtEyeColors,_u as getQRArtVariant,w5 as getQRAsBMP,Tn as getQRAsCanvas,al as getQRAsEPS,HC as getQRAsPrintPDF,UT as getQRAsPrintPDFBuffer,XC as getQRAsPrintSVG,Nt as getQRAsSVGDataUri,BE as getQRAsSVGNode,$5 as getQRAsWebP,D5 as getQRCodeData,E5 as getQRCodeDataUrl,Z5 as getQRCodeSVGProps,m1 as getQRData,fv as getQRFunctionModules,qC as getQRModuleCount,m8 as getQRShapePath,u8 as getQRSilhouetteFit,dL as getSVGString,JE as getScanContrast,hN as getScanScore,yN as getScanScoreFromPixels,Oe as getSolidColor,p1 as getStylePairRisk,Uu as getTemplate,fI as getTemplateIds,Vg as getWebPCompression,ds as gradientStopSchema,hu as h,F2 as handleImageLoad,b5 as hasImageFill,FI as hexToRgb,v0 as imageFitSchema,E0 as imagePaintSchema,Z1 as imagePositionCss,C0 as imagePositionSchema,I0 as imageSettingsSchema,ME as importFrameSvg,rg as isBMPFile,bt as isFrameActive,qn as isGradient,xl as isImagePaint,N4 as isLatin1Text,j0 as isQRArtActive,xn as isQRNode,wg as isShapedCode,W5 as isWeakSharpPair,J$ as isWebPFile,$0 as linearGradientSchema,cv as loadQRArtImage,yP as loadQRSilhouette,k8 as logoFitsBudget,Wb as logoOptionsSchema,du as logoShapeSchema,ks as mixFrameColors,$t as normalizeColorConfig,Pg as partMarker,Bb as pickableCornerEyeDotPatternSchema,Ub as pickableCornerEyePatternSchema,b0 as qrArtImageSchema,y0 as qrArtModeSchema,au as qrArtSchema,_0 as qrArtVariantSchema,O0 as qrCodeShapeSchema,Hb as qrPropsSchema,L0 as qrShapeSchema,N0 as qrSilhouetteSchema,w0 as radialGradientSchema,F5 as removeLogoBackdrop,FE as removeLogoBackground,X0 as renderQRArt,Zs as renderToDOM,Yt as renderToString,xt as resolveErrorLevel,An as resolveFrameSpec,QE as resolveQRCodeProps,Lr as rgbToCmyk,to as sanitizeFrameText,bN as scanQRPixels,x0 as solidColorSchema,y5 as svgToEPS,Yb as templateConfigSchema,Kb as templateDefinitionBaseSchema,B5 as toHyperscript,EC as toSVGElement,Zg as toSVGString,n1 as validateSize,Ln as withQRSize};//# sourceMappingURL=vanilla.browser.mjs.map
|
|
92
92
|
//# sourceMappingURL=vanilla.browser.mjs.map
|