var Ft=Object.defineProperty;var lt=Object.getOwnPropertySymbols;var kt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;var ft=(e,t,o)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,dt=(e,t)=>{for(var o in t||(t={}))kt.call(t,o)&&ft(e,o,t[o]);if(lt)for(var o of lt(t))zt.call(t,o)&&ft(e,o,t[o]);return e};var gt=(e,t,o)=>new Promise((i,r)=>{var n=a=>{try{u(o.next(a))}catch(l){r(l)}},s=a=>{try{u(o.throw(a))}catch(l){r(l)}},u=a=>a.done?i(a.value):Promise.resolve(a.value).then(n,s);u((o=o.apply(e,t)).next())});import{w as Ht}from"./entry/index-DShbtsWl.js";import{f as Vt,l as Kt}from"./antd-BmrhB3rb.js";import{d as Jt}from"./download-D1UiuoyS.js";import{d as Ot,f as Yt,o as $t,w as jt,Z as ht,_ as Qt,a8 as Gt,ai as Wt,u as W}from"./vue-BjERyvPm.js";var qt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Et={},T={};let it;const Xt=[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];T.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};T.getSymbolTotalCodewords=function(t){return Xt[t]};T.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};T.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');it=t};T.isKanjiModeEnabled=function(){return typeof it!="undefined"};T.toSJIS=function(t){return it(t)};var Y={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+o)}}e.isValid=function(i){return i&&typeof i.bit!="undefined"&&i.bit>=0&&i.bit<4},e.from=function(i,r){if(e.isValid(i))return i;try{return t(i)}catch(n){return r}}})(Y);function pt(){this.buffer=[],this.length=0}pt.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let o=0;o>>t-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Zt=pt;function H(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}H.prototype.set=function(e,t,o,i){const r=e*this.size+t;this.data[r]=o,i&&(this.reservedBit[r]=!0)};H.prototype.get=function(e,t){return this.data[e*this.size+t]};H.prototype.xor=function(e,t,o){this.data[e*this.size+t]^=o};H.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var xt=H,Bt={};(function(e){const t=T.getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,n=t(i),s=n===145?26:Math.ceil((n-13)/(2*r-2))*2,u=[n-7];for(let a=1;a=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const n=r.size;let s=0,u=0,a=0,l=null,c=null;for(let E=0;E=5&&(s+=t.N1+(u-5)),l=f,u=1),f=r.get(m,E),f===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=f,a=1)}u>=5&&(s+=t.N1+(u-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(r){const n=r.size;let s=0;for(let u=0;u=10&&(u===1488||u===93)&&s++,a=a<<1&2047|r.get(c,l),c>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(r){let n=0;const s=r.data.length;for(let a=0;a=0;){const s=n[0];for(let a=0;a0){const n=new Uint8Array(this.degree);return n.set(i,r),n}return i};var ee=st,St={},L={},at={};at.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var M={};const Mt="[0-9]+",ne="[A-Z $%*+\\-./:]+";let z="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";z=z.replace(/u/g,"\\u");const re="(?:(?![A-Z0-9 $%*+\\-./:]|"+z+`)(?:.|[\r ]))+`;M.KANJI=new RegExp(z,"g");M.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");M.BYTE=new RegExp(re,"g");M.NUMERIC=new RegExp(Mt,"g");M.ALPHANUMERIC=new RegExp(ne,"g");const oe=new RegExp("^"+z+"$"),ie=new RegExp("^"+Mt+"$"),se=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");M.testKanji=function(t){return oe.test(t)};M.testNumeric=function(t){return ie.test(t)};M.testAlphanumeric=function(t){return se.test(t)};(function(e){const t=at,o=M;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},e.getBestModeForData=function(n){return o.testNumeric(n)?e.NUMERIC:o.testAlphanumeric(n)?e.ALPHANUMERIC:o.testKanji(n)?e.KANJI:e.BYTE},e.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},e.isValid=function(n){return n&&n.bit&&n.ccBits};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+r)}}e.from=function(n,s){if(e.isValid(n))return n;try{return i(n)}catch(u){return s}}})(L);(function(e){const t=T,o=$,i=Y,r=L,n=at,s=7973,u=t.getBCHDigit(s);function a(m,f,d){for(let w=1;w<=40;w++)if(f<=e.getCapacity(w,d,m))return w}function l(m,f){return r.getCharCountIndicator(m,f)+4}function c(m,f){let d=0;return m.forEach(function(w){const A=l(w.mode,f);d+=A+w.getBitsLength()}),d}function E(m,f){for(let d=1;d<=40;d++)if(c(m,d)<=e.getCapacity(d,f,r.MIXED))return d}e.from=function(f,d){return n.isValid(f)?parseInt(f,10):d},e.getCapacity=function(f,d,w){if(!n.isValid(f))throw new Error("Invalid QR Code version");typeof w=="undefined"&&(w=r.BYTE);const A=t.getSymbolTotalCodewords(f),C=o.getTotalCodewordsCount(f,d),y=(A-C)*8;if(w===r.MIXED)return y;const g=y-l(w,f);switch(w){case r.NUMERIC:return Math.floor(g/10*3);case r.ALPHANUMERIC:return Math.floor(g/11*2);case r.KANJI:return Math.floor(g/13);case r.BYTE:default:return Math.floor(g/8)}},e.getBestVersionForData=function(f,d){let w;const A=i.from(d,i.M);if(Array.isArray(f)){if(f.length>1)return E(f,A);if(f.length===0)return 1;w=f[0]}else w=f;return a(w.mode,w.getLength(),A)},e.getEncodedBits=function(f){if(!n.isValid(f)||f<7)throw new Error("Invalid QR Code version");let d=f<<12;for(;t.getBCHDigit(d)-u>=0;)d^=s<=0;)r^=Pt<0&&(i=this.data.substr(o),r=parseInt(i,10),t.put(r,n*3+1))};var ce=D;const le=L,q=["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 _(e){this.mode=le.ALPHANUMERIC,this.data=e}_.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};_.prototype.getLength=function(){return this.data.length};_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)};_.prototype.write=function(t){let o;for(o=0;o+2<=this.data.length;o+=2){let i=q.indexOf(this.data[o])*45;i+=q.indexOf(this.data[o+1]),t.put(i,11)}this.data.length%2&&t.put(q.indexOf(this.data[o]),6)};var fe=_,de=function(t){for(var o=[],i=t.length,r=0;r=55296&&n<=56319&&i>r+1){var s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,r+=1)}if(n<128){o.push(n);continue}if(n<2048){o.push(n>>6|192),o.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){o.push(n>>12|224),o.push(n>>6&63|128),o.push(n&63|128);continue}if(n>=65536&&n<=1114111){o.push(n>>18|240),o.push(n>>12&63|128),o.push(n>>6&63|128),o.push(n&63|128);continue}o.push(239,191,189)}return new Uint8Array(o).buffer};const ge=de,he=L;function U(e){this.mode=he.BYTE,typeof e=="string"&&(e=ge(e)),this.data=new Uint8Array(e)}U.getBitsLength=function(t){return t*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(e){for(let t=0,o=this.data.length;t=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),e.put(o,13)}};var ye=v,Lt={exports:{}};(function(e){var t={single_source_shortest_paths:function(o,i,r){var n={},s={};s[i]=0;var u=t.PriorityQueue.make();u.push(i,0);for(var a,l,c,E,m,f,d,w,A;!u.empty();){a=u.pop(),l=a.value,E=a.cost,m=o[l]||{};for(c in m)m.hasOwnProperty(c)&&(f=m[c],d=E+f,w=s[c],A=typeof s[c]=="undefined",(A||w>d)&&(s[c]=d,u.push(c,d),n[c]=l))}if(typeof r!="undefined"&&typeof s[r]=="undefined"){var C=["Could not find a path from ",i," to ",r,"."].join("");throw new Error(C)}return n},extract_shortest_path_from_predecessor_list:function(o,i){for(var r=[],n=i;n;)r.push(n),o[n],n=o[n];return r.reverse(),r},find_path:function(o,i,r){var n=t.single_source_shortest_paths(o,i,r);return t.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(o){var i=t.PriorityQueue,r={},n;o=o||{};for(n in i)i.hasOwnProperty(n)&&(r[n]=i[n]);return r.queue=[],r.sorter=o.sorter||i.default_sorter,r},default_sorter:function(o,i){return o.cost-i.cost},push:function(o,i){var r={value:o,cost:i};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Lt);var Ee=Lt.exports;(function(e){const t=L,o=ce,i=fe,r=me,n=ye,s=M,u=T,a=Ee;function l(C){return unescape(encodeURIComponent(C)).length}function c(C,y,g){const h=[];let p;for(;(p=C.exec(g))!==null;)h.push({data:p[0],index:p.index,mode:y,length:p[0].length});return h}function E(C){const y=c(s.NUMERIC,t.NUMERIC,C),g=c(s.ALPHANUMERIC,t.ALPHANUMERIC,C);let h,p;return u.isKanjiModeEnabled()?(h=c(s.BYTE,t.BYTE,C),p=c(s.KANJI,t.KANJI,C)):(h=c(s.BYTE_KANJI,t.BYTE,C),p=[]),y.concat(g,h,p).sort(function(I,N){return I.index-N.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function m(C,y){switch(y){case t.NUMERIC:return o.getBitsLength(C);case t.ALPHANUMERIC:return i.getBitsLength(C);case t.KANJI:return n.getBitsLength(C);case t.BYTE:return r.getBitsLength(C)}}function f(C){return C.reduce(function(y,g){const h=y.length-1>=0?y[y.length-1]:null;return h&&h.mode===g.mode?(y[y.length-1].data+=g.data,y):(y.push(g),y)},[])}function d(C){const y=[];for(let g=0;g=0&&u<=6&&(a===0||a===6)||a>=0&&a<=6&&(u===0||u===6)||u>=2&&u<=4&&a>=2&&a<=4?e.set(n+u,s+a,!0,!0):e.set(n+u,s+a,!1,!0))}}function be(e){const t=e.size;for(let o=8;o>u&1)===1,e.set(r,n,s,!0),e.set(n,r,s,!0)}function x(e,t,o){const i=e.size,r=Ne.getEncodedBits(t,o);let n,s;for(n=0;n<15;n++)s=(r>>n&1)===1,n<6?e.set(n,8,s,!0):n<8?e.set(n+1,8,s,!0):e.set(i-15+n,8,s,!0),n<8?e.set(8,i-n-1,s,!0):n<9?e.set(8,15-n-1+1,s,!0):e.set(8,15-n-1,s,!0);e.set(i-8,8,1,!0)}function Le(e,t){const o=e.size;let i=-1,r=o-1,n=7,s=0;for(let u=o-1;u>0;u-=2)for(u===6&&u--;;){for(let a=0;a<2;a++)if(!e.isReserved(r,u-a)){let l=!1;s>>n&1)===1),e.set(r,u-a,l),n--,n===-1&&(s++,n=7)}if(r+=i,r<0||o<=r){r-=i,i=-i;break}}}function De(e,t,o){const i=new pe;o.forEach(function(a){i.put(a.mode.bit,4),i.put(a.getLength(),Se.getCharCountIndicator(a.mode,e)),a.write(i)});const r=Q.getSymbolTotalCodewords(e),n=rt.getTotalCodewordsCount(e,t),s=(r-n)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(s-i.getLengthInBits())/8;for(let a=0;a=7&&Re(a,t),Le(a,s),isNaN(i)&&(i=nt.getBestMask(a,x.bind(null,a,o))),nt.applyMask(i,a),x(a,o,i),{modules:a,version:t,errorCorrectionLevel:o,maskPattern:i,segments:r}}Et.create=function(t,o){if(typeof t=="undefined"||t==="")throw new Error("No input text");let i=X.M,r,n;return typeof o!="undefined"&&(i=X.from(o.errorCorrectionLevel,X.M),r=O.from(o.version),n=nt.from(o.maskPattern),o.toSJISFunc&&Q.setToSJISFunction(o.toSJISFunc)),Ue(t,r,i,n)};var Dt={},ut={};(function(e){function t(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let i=o.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+o);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(n){return[n,n]}))),i.length===6&&i.push("F","F");const r=parseInt(i.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const r=typeof i.margin=="undefined"||i.margin===null||i.margin<0?4:i.margin,n=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:n,scale:n?4:s,margin:r,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,r){return r.width&&r.width>=i+r.margin*2?r.width/(i+r.margin*2):r.scale},e.getImageWidth=function(i,r){const n=e.getScale(i,r);return Math.floor((i+r.margin*2)*n)},e.qrToImageData=function(i,r,n){const s=r.modules.size,u=r.modules.data,a=e.getScale(s,n),l=Math.floor((s+n.margin*2)*a),c=n.margin*a,E=[n.color.light,n.color.dark];for(let m=0;m=c&&f>=c&&m0&&a>0&&e[u-1]||(i+=n?tt("M",a+o,.5+l+o):tt("m",r,0),r=0,n=!1),a+1':"",l="',c='viewBox="0 0 '+u+" "+u+'"',m=''+a+l+` `;return typeof i=="function"&&i(null,m),m};const ke=qt,ot=Et,Ut=Dt,ze=_t;function ct(e,t,o,i,r){const n=[].slice.call(arguments,1),s=n.length,u=typeof n[s-1]=="function";if(!u&&!ke())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(r=o,o=t,t=i=void 0):s===3&&(t.getContext&&typeof r=="undefined"?(r=i,i=void 0):(r=i,i=o,o=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(o=t,t=i=void 0):s===2&&!t.getContext&&(i=o,o=t,t=void 0),new Promise(function(a,l){try{const c=ot.create(o,i);a(e(c,t,i))}catch(c){l(c)}})}try{const a=ot.create(o,i);r(null,e(a,t,i))}catch(a){r(a)}}ot.create;var vt=ct.bind(null,Ut.render),He=ct.bind(null,Ut.renderToDataURL);ct.bind(null,function(e,t,o){return ze.render(e,o)});const Ve=({canvas:e,content:t,width:o=0,options:i={}})=>{const r=Vt(i);return r.errorCorrectionLevel=r.errorCorrectionLevel||Je(t),Ke(t,r).then(n=>(r.scale=o===0?void 0:o/n*4,vt(e,t,r)))};function Ke(e,t){const o=document.createElement("canvas");return vt(o,e,t).then(()=>o.width)}function Je(e){return e.length>36?"M":e.length>16?"Q":"H"}const Oe=({canvas:e,logo:t})=>{if(!t)return new Promise(y=>{y(e.toDataURL())});const o=e.width,{logoSize:i=.15,bgColor:r="#ffffff",borderSize:n=.05,crossOrigin:s,borderRadius:u=8,logoRadius:a=0}=t,l=Kt(t)?t:t.src,c=o*i,E=o*(1-i)/2,m=o*(i+n),f=o*(1-i-n)/2,d=e.getContext("2d");if(!d)return;yt(d)(f,f,m,m,u),d.fillStyle=r,d.fill();const w=new Image;(s||a)&&w.setAttribute("crossOrigin",s||"anonymous"),w.src=l;const A=y=>{d.drawImage(y,E,E,c,c)},C=y=>{const g=document.createElement("canvas");g.width=E+c,g.height=E+c;const h=g.getContext("2d");if(!h||!d||(h.drawImage(y,E,E,c,c),yt(d)(E,E,c,c,a),!d))return;const p=d.createPattern(g,"no-repeat");p&&(d.fillStyle=p,d.fill())};return new Promise(y=>{w.onload=()=>{a?C(w):A(w),y(e.toDataURL())}})};function yt(e){return(t,o,i,r,n)=>{const s=Math.min(i,r);return n>s/2&&(n=s/2),e.beginPath(),e.moveTo(t+n,o),e.arcTo(t+i,o,t+i,o+r,n),e.arcTo(t+i,o+r,t,o+r,n),e.arcTo(t,o+r,t,o,n),e.arcTo(t,o,t+i,o,n),e.closePath(),e}}const Ye=e=>Ve(e).then(()=>e).then(Oe),$e=Ot({name:"QrCode",__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:e=>["canvas","img"].includes(e)}},emits:{done:e=>!!e,error:e=>!!e},setup(e,{expose:t,emit:o}){const i=e,r=o,n=Yt(null);function s(){return gt(this,null,function*(){try{const{tag:a,value:l,options:c={},width:E,logo:m}=i,f=String(l),d=W(n);if(!d)return;if(a==="canvas"){const w=yield Ye({canvas:d,width:E,logo:m,content:f,options:c||{}});r("done",{url:w,ctx:d.getContext("2d")});return}if(a==="img"){const w=yield He(f,dt({errorCorrectionLevel:"H",width:E},c));W(n).src=w,r("done",{url:w})}}catch(a){r("error",a)}})}function u(a){let l="";const c=W(n);c instanceof HTMLCanvasElement?l=c.toDataURL():c instanceof HTMLImageElement&&(l=c.src),l&&Jt({url:l,fileName:a})}return $t(s),jt(i,()=>{s()},{deep:!0}),t({download:u}),(a,l)=>(ht(),Qt("div",null,[(ht(),Gt(Wt(e.tag),{ref_key:"wrapRef",ref:n},null,512))]))}}),Xe=Ht($e);export{Xe as Q};