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