Files
my-spring/web-api/src/main/resources/worker/assets/QrCodeForm-pbQcck4j.js

9 lines
28 KiB
JavaScript
Raw Normal View History

import{Y as de,ad as ge,b as re,j as he,B as me,W as we,f as v,_ as Ce,c as oe,o as Et,e as ye,aD as Ee,aq as pe,i as Be,m as Re,G as Ae,a as Se,k as W,w as It,D as Tt,t as Nt,bp as Ie}from"./index-BRLZOSuF-1775297478351.js";import{d as Te}from"./sb-adnPBAyt.js";import{u as Ne,L as Me}from"./LoginFormTitle-CYfZMbiW.js";import{D as Pe}from"./index-B7dHRAHV.js";var V={},X,Mt;function be(){return Mt||(Mt=1,X=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),X}var Z={},U={},Pt;function k(){if(Pt)return U;Pt=1;let r;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return U.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},U.getSymbolTotalCodewords=function(n){return o[n]},U.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},U.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');r=n},U.isKanjiModeEnabled=function(){return typeof r<"u"},U.toSJIS=function(n){return r(n)},U}var x={},bt;function pt(){return bt||(bt=1,(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+i)}}r.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},r.from=function(n,t){if(r.isValid(n))return n;try{return o(n)}catch{return t}}})(x)),x}var $,Lt;function Le(){if(Lt)return $;Lt=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(o){const i=Math.floor(o/8);return(this.buffer[i]>>>7-o%8&1)===1},put:function(o,i){for(let n=0;n<i;n++)this.putBit((o>>>i-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),o&&(this.buffer[i]|=128>>>this.length%8),this.length++}},$=r,$}var tt,vt;function ve(){if(vt)return tt;vt=1;function r(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return r.prototype.set=function(o,i,n,t){const e=o*this.size+i;this.data[e]=n,t&&(this.reservedBit[e]=!0)},r.prototype.get=function(o,i){return this.data[o*this.size+i]},r.prototype.xor=function(o,i,n){this.data[o*this.size+i]^=n},r.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},tt=r,tt}var et={},_t;function _e(){return _t||(_t=1,(function(r){const o=k().getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const t=Math.floor(n/7)+2,e=o(n),s=e===145?26:Math.ceil((e-13)/(2*t-2))*2,u=[e-7];for(let a=1;a<t-1;a++)u[a]=u[a-1]-s;return u.push(6),u.reverse()},r.getPositions=function(n){const t=[],e=r.getRowColCoords(n),s=e.length;for(let u=0;u<s;u++)for(let a=0;a<s;a++)u===0&&a===0||u===0&&a===s-1||u===s-1&&a===0||t.push([e[u],e[a]]);return t}})(et)),et}var nt={},Dt;function De(){if(Dt)return nt;Dt=1;const r=k().getSymbolSize,o=7;return nt.getPositions=function(n){const t=r(n);return[[0,0],[t-o,0],[0,t-o]]},nt}var rt={},qt;function qe(){return qt||(qt=1,(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};r.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){const e=t.size;let s=0,u=0,a=0,l=null,c=null;for(let d=0;d<e;d++){u=a=0,l=c=null;for(let g=0;g<e;g++){let f=t.get(d,g);f===l?u++:(u>=5&&(s+=o.N1+(u-5)),l=f,u=1),f=t.get(g,d),f===c?a++:(a>=5&&(s+=o.N1+(a-5)),c=f,a=1)}u>=5&&(s+=o.N1+(u-5)),a>=5&&(s+=o.N1+(a-5))}return s},r.getPenaltyN2=function(t){const e=t.
]))+`;L.KANJI=new RegExp(i,"g"),L.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),L.BYTE=new RegExp(n,"g"),L.NUMERIC=new RegExp(r,"g"),L.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),e=new RegExp("^"+r+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return L.testKanji=function(a){return t.test(a)},L.testNumeric=function(a){return e.test(a)},L.testAlphanumeric=function(a){return s.test(a)},L}var Kt;function F(){return Kt||(Kt=1,(function(r){const o=se(),i=ue();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(e,s){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?e.ccBits[0]:s<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return i.testNumeric(e)?r.NUMERIC:i.testAlphanumeric(e)?r.ALPHANUMERIC:i.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits};function n(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}r.from=function(e,s){if(r.isValid(e))return e;try{return n(e)}catch{return s}}})(ut)),ut}var Ot;function ze(){return Ot||(Ot=1,(function(r){const o=k(),i=ie(),n=pt(),t=F(),e=se(),s=7973,u=o.getBCHDigit(s);function a(g,f,w){for(let T=1;T<=40;T++)if(f<=r.getCapacity(T,w,g))return T}function l(g,f){return t.getCharCountIndicator(g,f)+4}function c(g,f){let w=0;return g.forEach(function(T){const P=l(T.mode,f);w+=P+T.getBitsLength()}),w}function d(g,f){for(let w=1;w<=40;w++)if(c(g,w)<=r.getCapacity(w,f,t.MIXED))return w}r.from=function(f,w){return e.isValid(f)?parseInt(f,10):w},r.getCapacity=function(f,w,T){if(!e.isValid(f))throw new Error("Invalid QR Code version");typeof T>"u"&&(T=t.BYTE);const P=o.getSymbolTotalCodewords(f),S=i.getTotalCodewordsCount(f,w),N=(P-S)*8;if(T===t.MIXED)return N;const p=N-l(T,f);switch(T){case t.NUMERIC:return Math.floor(p/10*3);case t.ALPHANUMERIC:return Math.floor(p/11*2);case t.KANJI:return Math.floor(p/13);case t.BYTE:default:return Math.floor(p/8)}},r.getBestVersionForData=function(f,w){let T;const P=n.from(w,n.M);if(Array.isArray(f)){if(f.length>1)return d(f,P);if(f.length===0)return 1;T=f[0]}else T=f;return a(T.mode,T.getLength(),P)},r.getEncodedBits=function(f){if(!e.isValid(f)||f<7)throw new Error("Invalid QR Code version");let w=f<<12;for(;o.getBCHDigit(w)-u>=0;)w^=s<<o.getBCHDigit(w)-u;return f<<12|w}})(st)),st}var ct={},jt;function Ve(){if(jt)return ct;jt=1;const r=k(),o=1335,i=21522,n=r.getBCHDigit(o);return ct.getEncodedBits=function(e,s){const u=e.bit<<3|s;let a=u<<10;for(;r.getBCHDigit(a)-n>=0;)a^=o<<r.getBCHDigit(a)-n;return(u<<10|a)^i},ct}var lt={},ft,Jt;function He(){if(Jt)return ft;Jt=1;const r=F();function o(i){this.mode=r.NUMERIC,this.data=i.toString()}return o.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(n){let t,e,s;for(t=0;t+3<=this.data.length;t+=3)e=this.data.substr(t,3),s=parseInt(e,10),n.put(s,10);const u=this.data.length-t;u>0&&(e=this.data.substr(t),s=parseInt(e,10),n.put(s,u*3+1))},ft=o,ft}var dt,Yt;function Ke(){if(Yt)return dt;Yt=1;const r=F(),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(n){this.mode=r.ALPHANUMERIC,this.data=n}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.pro
Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),n.put(e,13)}},ht=i,ht}var mt={exports:{}},Wt;function Je(){return Wt||(Wt=1,(function(r){var o={single_source_shortest_paths:function(i,n,t){var e={},s={};s[n]=0;var u=o.PriorityQueue.make();u.push(n,0);for(var a,l,c,d,g,f,w,T,P;!u.empty();){a=u.pop(),l=a.value,d=a.cost,g=i[l]||{};for(c in g)g.hasOwnProperty(c)&&(f=g[c],w=d+f,T=s[c],P=typeof s[c]>"u",(P||T>w)&&(s[c]=w,u.push(c,w),e[c]=l))}if(typeof t<"u"&&typeof s[t]>"u"){var S=["Could not find a path from ",n," to ",t,"."].join("");throw new Error(S)}return e},extract_shortest_path_from_predecessor_list:function(i,n){for(var t=[],e=n;e;)t.push(e),i[e],e=i[e];return t.reverse(),t},find_path:function(i,n,t){var e=o.single_source_shortest_paths(i,n,t);return o.extract_shortest_path_from_predecessor_list(e,t)},PriorityQueue:{make:function(i){var n=o.PriorityQueue,t={},e;i=i||{};for(e in n)n.hasOwnProperty(e)&&(t[e]=n[e]);return t.queue=[],t.sorter=i.sorter||n.default_sorter,t},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var t={value:i,cost:n};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=o})(mt)),mt.exports}var Xt;function Ye(){return Xt||(Xt=1,(function(r){const o=F(),i=He(),n=Ke(),t=Oe(),e=je(),s=ue(),u=k(),a=Je();function l(S){return unescape(encodeURIComponent(S)).length}function c(S,N,p){const B=[];let b;for(;(b=S.exec(p))!==null;)B.push({data:b[0],index:b.index,mode:N,length:b[0].length});return B}function d(S){const N=c(s.NUMERIC,o.NUMERIC,S),p=c(s.ALPHANUMERIC,o.ALPHANUMERIC,S);let B,b;return u.isKanjiModeEnabled()?(B=c(s.BYTE,o.BYTE,S),b=c(s.KANJI,o.KANJI,S)):(B=c(s.BYTE_KANJI,o.BYTE,S),b=[]),N.concat(p,B,b).sort(function(R,E){return R.index-E.index}).map(function(R){return{data:R.data,mode:R.mode,length:R.length}})}function g(S,N){switch(N){case o.NUMERIC:return i.getBitsLength(S);case o.ALPHANUMERIC:return n.getBitsLength(S);case o.KANJI:return e.getBitsLength(S);case o.BYTE:return t.getBitsLength(S)}}function f(S){return S.reduce(function(N,p){const B=N.length-1>=0?N[N.length-1]:null;return B&&B.mode===p.mode?(N[N.length-1].data+=p.data,N):(N.push(p),N)},[])}function w(S){const N=[];for(let p=0;p<S.length;p++){const B=S[p];switch(B.mode){case o.NUMERIC:N.push([B,{data:B.data,mode:o.ALPHANUMERIC,length:B.length},{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.ALPHANUMERIC:N.push([B,{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.KANJI:N.push([B,{data:B.data,mode:o.BYTE,length:l(B.data)}]);break;case o.BYTE:N.push([{data:B.data,mode:o.BYTE,length:l(B.data)}])}}return N}function T(S,N){const p={},B={start:{}};let b=["start"];for(let m=0;m<S.length;m++){const R=S[m],E=[];for(let h=0;h<R.length;h++){const I=R[h],C=""+m+h;E.push(C),p[C]={node:I,lastCount:0},B[C]={};for(let A=0;A<b.length;A++){const y=b[A];p[y]&&p[y].node.mode===I.mode?(B[y][C]=g(p[y].lastCount+I.length,I.mode)-g(p[y].lastCount,I.mode),p[y].lastCount+=I.length):(p[y]&&(p[y].lastCount=I.length),B[y][C]=g(I.length,I.mode)+4+o.getCharCountIndicator(I.mode,N))}}b=E}for(let m=0;m<b.length;m++)B[b[m]].end=0;return{map:B,table:p}}function P(S,N){let p;const B=o.getBestModeForData(S);if(p=o.from(N,B),p!==o.BYTE&&p.bit<B.bit)throw new Error('"'+S+'" cannot be encoded with mode '+o.toString(p)+`.
Suggested mode is: `+o.toString(B));switch(p===o.KANJI&&!u.isKanjiModeEnabled()&&(p=o.BYTE),p){case o.NUMERIC:return new i(S);case o.ALPHANUMERIC:return new n(S);case o.KANJI:return new e(S);case o.BYTE:return new t(S)}}r.fromArray=function(N){return N.reduce(function(p,B){return typeof B=="string"?p.push(P(B,null)):B.data&&p.push(P(B.data,B.mode)),p},[])},r.fromString=function(N,p){const B=d(N,u.isKanjiModeEnabled()),b=w(B),m=T(b,p),R=a.find_path(m.map,"start","end"),E=[];for(let h=1;h<R.length-1;h++)E.push(m.table[R[h]].node);return r.fromArray(f(E))},r.rawSplit=function(N){return r.fromArray(d(N,u.isKanjiModeEnabled()))}})(lt)),lt}var Zt;function Qe(){if(Zt)return Z;Zt=1;const r=k(),o=pt(),i=Le(),n=ve(),t=_e(),e=De(),s=qe(),u=ie(),a=Fe(),l=ze(),c=Ve(),d=F(),g=Ye();function f(m,R){const E=m.size,h=e.getPositions(R);for(let I=0;I<h.length;I++){const C=h[I][0],A=h[I][1];for(let y=-1;y<=7;y++)if(!(C+y<=-1||E<=C+y))for(let M=-1;M<=7;M++)A+M<=-1||E<=A+M||(y>=0&&y<=6&&(M===0||M===6)||M>=0&&M<=6&&(y===0||y===6)||y>=2&&y<=4&&M>=2&&M<=4?m.set(C+y,A+M,!0,!0):m.set(C+y,A+M,!1,!0))}}function w(m){const R=m.size;for(let E=8;E<R-8;E++){const h=E%2===0;m.set(E,6,h,!0),m.set(6,E,h,!0)}}function T(m,R){const E=t.getPositions(R);for(let h=0;h<E.length;h++){const I=E[h][0],C=E[h][1];for(let A=-2;A<=2;A++)for(let y=-2;y<=2;y++)A===-2||A===2||y===-2||y===2||A===0&&y===0?m.set(I+A,C+y,!0,!0):m.set(I+A,C+y,!1,!0)}}function P(m,R){const E=m.size,h=l.getEncodedBits(R);let I,C,A;for(let y=0;y<18;y++)I=Math.floor(y/3),C=y%3+E-8-3,A=(h>>y&1)===1,m.set(I,C,A,!0),m.set(C,I,A,!0)}function S(m,R,E){const h=m.size,I=c.getEncodedBits(R,E);let C,A;for(C=0;C<15;C++)A=(I>>C&1)===1,C<6?m.set(C,8,A,!0):C<8?m.set(C+1,8,A,!0):m.set(h-15+C,8,A,!0),C<8?m.set(8,h-C-1,A,!0):C<9?m.set(8,15-C-1+1,A,!0):m.set(8,15-C-1,A,!0);m.set(h-8,8,1,!0)}function N(m,R){const E=m.size;let h=-1,I=E-1,C=7,A=0;for(let y=E-1;y>0;y-=2)for(y===6&&y--;;){for(let M=0;M<2;M++)if(!m.isReserved(I,y-M)){let q=!1;A<R.length&&(q=(R[A]>>>C&1)===1),m.set(I,y-M,q),C--,C===-1&&(A++,C=7)}if(I+=h,I<0||E<=I){I-=h,h=-h;break}}}function p(m,R,E){const h=new i;E.forEach(function(M){h.put(M.mode.bit,4),h.put(M.getLength(),d.getCharCountIndicator(M.mode,m)),M.write(h)});const I=r.getSymbolTotalCodewords(m),C=u.getTotalCodewordsCount(m,R),A=(I-C)*8;for(h.getLengthInBits()+4<=A&&h.put(0,4);h.getLengthInBits()%8!==0;)h.putBit(0);const y=(A-h.getLengthInBits())/8;for(let M=0;M<y;M++)h.put(M%2?17:236,8);return B(h,m,R)}function B(m,R,E){const h=r.getSymbolTotalCodewords(R),I=u.getTotalCodewordsCount(R,E),C=h-I,A=u.getBlocksCount(R,E),y=h%A,M=A-y,q=Math.floor(h/A),H=Math.floor(C/A),ce=H+1,Rt=q-H,le=new a(Rt);let J=0;const O=new Array(A),At=new Array(A);let Y=0;const fe=new Uint8Array(m.buffer);for(let z=0;z<A;z++){const G=z<M?H:ce;O[z]=fe.slice(J,J+G),At[z]=le.encode(O[z]),J+=G,Y=Math.max(Y,G)}const Q=new Uint8Array(h);let St=0,_,D;for(_=0;_<Y;_++)for(D=0;D<A;D++)_<O[D].length&&(Q[St++]=O[D][_]);for(_=0;_<Rt;_++)for(D=0;D<A;D++)Q[St++]=At[D][_];return Q}function b(m,R,E,h){let I;if(Array.isArray(m))I=g.fromArray(m);else if(typeof m=="string"){let q=R;if(!q){const H=g.rawSplit(m);q=l.getBestVersionForData(H,E)}I=g.fromString(m,q||40)}else throw new Error("Invalid data");const C=l.getBestVersionForData(I,E);if(!C)throw new Error("The amount of data is too big to be stored in a QR Code");if(!R)R=C;else if(R<C)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+C+`.
`);const A=p(R,E,I),y=r.getSymbolSize(R),M=new n(y);return f(M,R),w(M),T(M,R),S(M,E,0),R>=7&&P(M,R),N(M,A),isNaN(h)&&(h=s.getBestMask(M,S.bind(null,M,E))),s.applyMask(h,M),S(M,E,h),{modules:M,version:R,errorCorrectionLevel:E,maskPattern:h,segments:I}}return Z.create=function(R,E){if(typeof R>"u"||R==="")throw new Error("No input text");let h=o.M,I,C;return typeof E<"u"&&(h=o.from(E.errorCorrectionLevel,o.M),I=l.from(E.version),C=s.from(E.maskPattern),E.toSJISFunc&&r.setToSJISFunction(E.toSJISFunc)),b(R,I,h,C)},Z}var wt={},Ct={},xt;function ae(){return xt||(xt=1,(function(r){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let n=i.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+i);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(e){return[e,e]}))),n.length===6&&n.push("F","F");const t=parseInt(n.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+n.slice(0,6).join("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const t=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,e=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:e,scale:e?4:s,margin:t,color:{dark:o(n.color.dark||"#000000ff"),light:o(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,t){return t.width&&t.width>=n+t.margin*2?t.width/(n+t.margin*2):t.scale},r.getImageWidth=function(n,t){const e=r.getScale(n,t);return Math.floor((n+t.margin*2)*e)},r.qrToImageData=function(n,t,e){const s=t.modules.size,u=t.modules.data,a=r.getScale(s,e),l=Math.floor((s+e.margin*2)*a),c=e.margin*a,d=[e.color.light,e.color.dark];for(let g=0;g<l;g++)for(let f=0;f<l;f++){let w=(g*l+f)*4,T=e.color.light;if(g>=c&&f>=c&&g<l-c&&f<l-c){const P=Math.floor((g-c)/a),S=Math.floor((f-c)/a);T=d[u[P*s+S]?1:0]}n[w++]=T.r,n[w++]=T.g,n[w++]=T.b,n[w]=T.a}}})(Ct)),Ct}var $t;function Ge(){return $t||($t=1,(function(r){const o=ae();function i(t,e,s){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=s,e.width=s,e.style.height=s+"px",e.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(e,s,u){let a=u,l=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(l=n()),a=o.getOptions(a);const c=o.getImageWidth(e.modules.size,a),d=l.getContext("2d"),g=d.createImageData(c,c);return o.qrToImageData(g.data,e,a),i(d,l,c),d.putImageData(g,0,0),l},r.renderToDataURL=function(e,s,u){let a=u;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const l=r.render(e,s,a),c=a.type||"image/png",d=a.rendererOpts||{};return l.toDataURL(c,d.quality)}})(wt)),wt}var yt={},te;function We(){if(te)return yt;te=1;const r=ae();function o(t,e){const s=t.a/255,u=e+'="'+t.hex+'"';return s<1?u+" "+e+'-opacity="'+s.toFixed(2).slice(1)+'"':u}function i(t,e,s){let u=t+e;return typeof s<"u"&&(u+=" "+s),u}function n(t,e,s){let u="",a=0,l=!1,c=0;for(let d=0;d<t.length;d++){const g=Math.floor(d%e),f=Math.floor(d/e);!g&&!l&&(l=!0),t[d]?(c++,d>0&&g>0&&t[d-1]||(u+=l?i("M",g+s,.5+f+s):i("m",a,0),a=0,l=!1),g+1<e&&t[d+1]||(u+=i("h",c),c=0)):a++}return u}return yt.render=function(e,s,u){const a=r.getOptions(s),l=e.modules.size,c=e.modules.data,d=l+a.margin*2,g=a.color.light.a?"<path "+o(a.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",f="<path "+o(a.color.dark,"stroke")+' d="'+n(c,l,a.margin)+'"/>',w='viewBox="0 0 '+d+" "+d+'"',P='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+w+' shape-rendering="crispEdges">'+g+f+`</svg>
`;return typeof u=="function"&&u(null,P),P},yt}var ee;function Xe(){if(ee)return V;ee=1;const r=be(),o=Qe(),i=Ge(),n=We();function t(e,s,u,a,l){const c=[].slice.call(arguments,1),d=c.length,g=typeof c[d-1]=="function";if(!g&&!r())throw new Error("Callback required as last argument");if(g){if(d<2)throw new Error("Too few arguments provided");d===2?(l=u,u=s,s=a=void 0):d===3&&(s.getContext&&typeof l>"u"?(l=a,a=void 0):(l=a,a=u,u=s,s=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(u=s,s=a=void 0):d===2&&!s.getContext&&(a=u,u=s,s=void 0),new Promise(function(f,w){try{const T=o.create(u,a);f(e(T,s,a))}catch(T){w(T)}})}try{const f=o.create(u,a);l(null,e(f,s,a))}catch(f){l(f)}}return V.create=o.create,V.toCanvas=t.bind(null,i.render),V.toDataURL=t.bind(null,i.renderToDataURL),V.toString=t.bind(null,function(e,s,u){return n.render(e,u)}),V}var Bt=Xe();const Ze=({canvas:r,content:o,width:i=0,options:n={}})=>{const t=de(n);return t.errorCorrectionLevel=t.errorCorrectionLevel||$e(o),xe(o,t).then(e=>(t.scale=i===0?void 0:i/e*4,Bt.toCanvas(r,o,t)))};function xe(r,o){const i=document.createElement("canvas");return Bt.toCanvas(i,r,o).then(()=>i.width)}function $e(r){return r.length>36?"M":r.length>16?"Q":"H"}const tn=({canvas:r,logo:o})=>{if(!o)return new Promise(N=>{N(r.toDataURL())});const i=r.width,{logoSize:n=.15,bgColor:t="#ffffff",borderSize:e=.05,crossOrigin:s,borderRadius:u=8,logoRadius:a=0}=o,l=ge(o)?o:o.src,c=i*n,d=i*(1-n)/2,g=i*(n+e),f=i*(1-n-e)/2,w=r.getContext("2d");if(!w)return;ne(w)(f,f,g,g,u),w.fillStyle=t,w.fill();const T=new Image;(s||a)&&T.setAttribute("crossOrigin",s||"anonymous"),T.src=l;const P=N=>{w.drawImage(N,d,d,c,c)},S=N=>{const p=document.createElement("canvas");p.width=d+c,p.height=d+c;const B=p.getContext("2d");if(!B||!w||(B.drawImage(N,d,d,c,c),ne(w)(d,d,c,c,a),!w))return;const b=w.createPattern(p,"no-repeat");b&&(w.fillStyle=b,w.fill())};return new Promise(N=>{T.onload=()=>{a?S(T):P(T),N(r.toDataURL())}})};function ne(r){return(o,i,n,t,e)=>{const s=Math.min(n,t);return e>s/2&&(e=s/2),r.beginPath(),r.moveTo(o+e,i),r.arcTo(o+n,i,o+n,i+t,e),r.arcTo(o+n,i+t,o,i+t,e),r.arcTo(o,i+t,o,i,e),r.arcTo(o,i,o+n,i,e),r.closePath(),r}}const en=r=>Ze(r).then(()=>r).then(tn),nn=re({name:"QrCode",props:{value:{type:[String,Array],default:null},options:{type:Object,default:null},width:{type:Number,default:200},logo:{type:[String,Object],default:""},tag:{type:String,default:"canvas",validator:r=>["canvas","img"].includes(r)}},emits:{done:r=>!!r,error:r=>!!r},setup(r,{emit:o}){const i=he(null);async function n(){try{const{tag:e,value:s,options:u={},width:a,logo:l}=r,c=String(s),d=v(i);if(!d)return;if(e==="canvas"){const g=await en({canvas:d,width:a,logo:l,content:c,options:u||{}});o("done",{url:g,ctx:d.getContext("2d")});return}if(e==="img"){const g=await Bt.toDataURL(c,{errorCorrectionLevel:"H",width:a,...u});v(i).src=g,o("done",{url:g})}}catch(e){o("error",e)}}function t(e){let s="";const u=v(i);u instanceof HTMLCanvasElement?s=u.toDataURL():u instanceof HTMLImageElement&&(s=u.src),s&&Te({url:s,fileName:e})}return me(n),we(r,()=>{n()},{deep:!0}),{wrapRef:i,download:t}}});function rn(r,o,i,n,t,e){return Et(),oe("div",null,[(Et(),ye(Ee(r.tag),{ref:"wrapRef"},null,512))])}const on=Ce(nn,[["render",rn]]),sn=pe(on),un={key:0},an={class:"enter-x min-h-80 text-center pt-2"},cn="https://jeesite.com",hn=re({__name:"QrCodeForm",setup(r){const{t:o}=Be(),{handleBackLogin:i,getLoginState:n}=Ne(),t=Re(()=>v(n)===Me.QR_CODE);return(e,s)=>t.value?(Et(),oe("div",un,[Se("div",an,[W(v(sn),{value:cn,class:"enter-x flex justify-center xl:justify-start",width:280}),W(v(Pe),{class:"enter-x size"},{default:It(()=>[Tt(Nt(v(o)("专业版支持微信扫描二维码登录!")),1)]),_:1}),W(v(Ie),{size:"large",block:"",class:"enter-x mt-4",onClick:v(i)},{default:It(()=>[Tt(Nt(v(o)("sys.login.backSignIn")),1)]),_:1},8,["onClick"])])])):Ae("",!0)}});export{hn as default};