import{B as V,aI as P,b as x,aJ as Z,o as ae,Z as ne,I as q,C as D,D as F,H as G,u as p,P as J,G as M,U as I,V as oe,O as ie,W as Q}from"./vue-BqYd3Ike.js";import{x as se,_ as le}from"./index-CP9YHUOF.js";import{s as R,a as ue}from"./index-QPcHmRtJ.js";import{u as ce}from"./index-CB_W4Mz-.js";import"./terminal-DKJcZrof.js";/*! * qrcode.vue v3.6.0 * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3 * © 2017-PRESENT @scopewu(https://github.com/scopewu) * MIT License. */var b=function(){return b=Object.assign||function(u){for(var c,l=1,f=arguments.length;la.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],s=0;s7)throw new RangeError("Invalid value");var d,g;for(d=r;;d++){var y=a.getNumDataCodewords(d,t)*8,E=h.getTotalBits(e,d);if(E<=y){g=E;break}if(d>=n)throw new RangeError("Data too long")}for(var C=0,_=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];C<_.length;C++){var m=_[C];s&&g<=a.getNumDataCodewords(d,m)*8&&(t=m)}for(var v=[],w=0,A=e;w>>3]|=Y<<7-(H&7)}),new a(d,t,L,i)},a.prototype.getModule=function(e,t){return 0<=e&&e>>9)*1335;var i=(t<<10|r)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(i,n));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),i=this.size-11+t%3,s=Math.floor(t/3);this.setFunctionModule(i,s,n),this.setFunctionModule(s,i,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(r)),s=e+n,d=t+r;0<=s&&s=d)&&w.push(z[N])})},C=0;C=1;r-=2){r==6&&(r=5);for(var n=0;n>>3],7-(t&7)),t++)}}f(t==e.length*8)},a.prototype.applyMask=function(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(var t=0;t5&&e++):(this.finderPenaltyAddHistory(n,i),r||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),r=this.modules[t][s],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,i)*a.PENALTY_N3}for(var s=0;s5&&e++):(this.finderPenaltyAddHistory(d,i),r||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),r=this.modules[t][s],d=1);e+=this.finderPenaltyTerminateAndCount(r,d,i)*a.PENALTY_N3}for(var t=0;ta.MAX_VERSION)throw new RangeError("Version number out of range");var t=(16*e+128)*e+64;if(e>=2){var r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return f(208<=t&&t<=29648),t},a.getNumDataCodewords=function(e,t){return Math.floor(a.getNumRawDataModules(e)/8)-a.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*a.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]},a.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");for(var t=[],r=0;r>>8||t>>>8)throw new RangeError("Byte out of range");for(var r=0,n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(t>>>n&1)*e;return f(r>>>8==0),r},a.prototype.finderPenaltyCountPatterns=function(e){var t=e[1];f(t<=this.size*3);var r=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(r&&e[0]>=t*4&&e[6]>=t?1:0)+(r&&e[6]>=t*4&&e[0]>=t?1:0)},a.prototype.finderPenaltyTerminateAndCount=function(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)},a.prototype.finderPenaltyAddHistory=function(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)},a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.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]],a.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]],a})();o.QrCode=u;function c(a,e,t){if(e<0||e>31||a>>>e)throw new RangeError("Value out of range");for(var r=e-1;r>=0;r--)t.push(a>>>r&1)}function l(a,e){return(a>>>e&1)!=0}function f(a){if(!a)throw new Error("Assertion error")}var h=(function(){function a(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}return a.makeBytes=function(e){for(var t=[],r=0,n=e;r=1<=u.y+u.h?c:c.map(function(f,h){return h=u.x+u.w?f:!1})})}var X={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:W,validator:function(o){return $(o)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(o){return["linear","radial"].indexOf(o)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},de=b(b({},X),{renderAs:{type:String,required:!1,default:"canvas",validator:function(o){return["canvas","svg"].indexOf(o)>-1}}}),he=V({name:"QRCodeSvg",props:X,setup:function(o){var u=x(0),c=x(""),l,f=function(){var a=o.value,e=o.level,t=o.margin,r=t>>>0,n=$(e)?e:W,i=k.QrCode.encodeText(a,K[n]).getModules();if(u.value=i.length+r*2,o.imageSettings.src){var s=ee(i,o.size,r,o.imageSettings);l={x:s.x+r,y:s.y+r,width:s.w,height:s.h},s.excavation&&(i=te(i,s.excavation))}c.value=j(i,r)},h=function(){if(!o.gradient)return null;var a=o.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return P(o.gradientType==="linear"?"linearGradient":"radialGradient",b({id:"qr-gradient"},a),[P("stop",{offset:"0%",style:{stopColor:o.gradientStartColor}}),P("stop",{offset:"100%",style:{stopColor:o.gradientEndColor}})])};return f(),Z(f),function(){return P("svg",{width:o.size,height:o.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(u.value," ").concat(u.value)},[P("defs",{},[h()]),P("rect",{width:"100%",height:"100%",fill:o.background}),P("path",{fill:o.gradient?"url(#qr-gradient)":o.foreground,d:c.value}),o.imageSettings.src&&P("image",b({href:o.imageSettings.src},l))])}}}),ve=V({name:"QRCodeCanvas",props:X,setup:function(o,u){var c=x(null),l=x(null),f=function(){var a=o.value,e=o.level,t=o.size,r=o.margin,n=o.background,i=o.foreground,s=o.gradient,d=o.gradientType,g=o.gradientStartColor,y=o.gradientEndColor,E=r>>>0,C=$(e)?e:W,_=c.value;if(_){var m=_.getContext("2d");if(m){var v=k.QrCode.encodeText(a,K[C]).getModules(),w=v.length+E*2,A=l.value,N={x:0,y:0,width:0,height:0},z=o.imageSettings.src&&A!=null&&A.naturalWidth!==0&&A.naturalHeight!==0;if(z){var S=ee(v,o.size,E,o.imageSettings);N={x:S.x+E,y:S.y+E,width:S.w,height:S.h},S.excavation&&(v=te(v,S.excavation))}var U=window.devicePixelRatio||1,B=t/w*U;if(_.height=_.width=t*U,m.scale(B,B),m.fillStyle=n,m.fillRect(0,0,w,w),s){var T=void 0;d==="linear"?T=m.createLinearGradient(0,0,w,w):T=m.createRadialGradient(w/2,w/2,0,w/2,w/2,w/2),T.addColorStop(0,g),T.addColorStop(1,y),m.fillStyle=T}else m.fillStyle=i;fe?m.fill(new Path2D(j(v,E))):v.forEach(function(L,Y){L.forEach(function(H,re){H&&m.fillRect(re+E,Y+E,1,1)})}),z&&m.drawImage(A,N.x,N.y,N.width,N.height)}}};ae(f),Z(f);var h=u.attrs.style;return function(){return P(ne,[P("canvas",b(b({},u.attrs),{ref:c,style:b(b({},h),{width:"".concat(o.size,"px"),height:"".concat(o.size,"px")})})),o.imageSettings.src&&P("img",{ref:l,src:o.imageSettings.src,style:{display:"none"},onLoad:f})])}}}),ge=V({name:"Qrcode",render:function(){var o=this.$props,u=o.renderAs,c=o.value,l=o.size,f=o.margin,h=o.level,a=o.background,e=o.foreground,t=o.imageSettings,r=o.gradient,n=o.gradientType,i=o.gradientStartColor,s=o.gradientEndColor;return P(u==="svg"?he:ve,{value:c,size:l,margin:f,level:h,background:a,foreground:e,imageSettings:t,gradient:r,gradientType:n,gradientStartColor:i,gradientEndColor:s})},props:de});const me={class:"header-box"},pe=["src"],Ce={class:"pay-box"},Ee={class:"left"},we={class:"order-info"},ye={class:"order-info-items"},Me={class:"order-info-items"},_e={class:"order-info-items"},Re={class:"order-info-items"},Ne={class:"rmb-symbol"},Pe={class:"amount"},Ae={class:"pay_qr"},Se=["srcdoc"],Ie={key:2,class:"pay-success"},be={class:"qr-tips-content"},ze={key:0},Te={key:1},Oe={class:"right"},Be=["src"],Le=V({__name:"pay",setup(o){const{t:u}=se.useI18n(),c=ce();return(l,f)=>{const h=q("Icon"),a=q("el-alert"),e=q("el-dialog");return D(),F("div",null,[G(e,{modelValue:p(R).dialog.pay,"onUpdate:modelValue":f[0]||(f[0]=t=>p(R).dialog.pay=t),"close-on-press-escape":!1,"close-on-click-modal":!1,"destroy-on-close":!0,class:"pay-dialog",top:"20vh",width:"680px"},{default:J(()=>[M("div",null,[M("div",me,[M("img",{class:"pay-logo",src:"https://buildadmin.com/static/images/"+(p(R).common.payType=="wx"?"wechat-pay.png":"alipay.png"),alt:""},null,8,pe)]),M("div",Ce,[M("div",Ee,[M("div",we,[M("div",ye,I(p(u)("module.Order title"))+":"+I(p(R).payInfo.info.title),1),M("div",Me,I(p(u)("module.Order No"))+":"+I(p(R).payInfo.info.sn),1),M("div",_e,I(p(u)("module.Purchase user"))+":"+I(p(ue)(p(c))),1),M("div",Re,[M("span",null,I(p(u)("module.Order price"))+":",1),M("span",Ne,[f[1]||(f[1]=oe(" ¥")),M("span",Pe,I(p(R).payInfo.info.amount),1)])])]),M("div",Ae,[p(R).common.payType=="wx"?(D(),ie(ge,{key:0,value:p(R).payInfo.pay.code_url,size:220,margin:0,level:"H"},null,8,["value"])):Q("",!0),p(R).common.payType=="zfb"?(D(),F("iframe",{key:1,srcdoc:p(R).payInfo.pay.code_url,frameborder:"no",border:"0",marginwidth:"0",marginheight:"0",scrolling:"no",width:"220",height:"220",style:{overflow:"hidden"}},null,8,Se)):Q("",!0),p(R).payInfo.pay.status=="success"?(D(),F("div",Ie,[G(h,{name:"fa fa-check",color:"var(--el-color-success)",size:"30"})])):Q("",!0)]),G(a,{class:"qr-tips",closable:!1,type:"success",center:""},{default:J(()=>[M("div",be,[G(h,{color:"var(--el-color-success)",name:p(R).common.payType=="wx"?"fa fa-wechat":"fa fa-buysellads"},null,8,["name"]),p(R).common.payType=="wx"?(D(),F("span",ze,I(p(u)("module.Use WeChat to scan QR code for payment")),1)):Q("",!0),p(R).common.payType=="zfb"?(D(),F("span",Te,I(p(u)("module.Use Alipay to scan QR code for payment")),1)):Q("",!0)])]),_:1})]),M("div",Oe,[M("img",{class:"pay-logo",src:"https://buildadmin.com/static/images/screenshot-"+(p(R).common.payType=="wx"?"wechat.png":"alipay.png"),alt:""},null,8,Be)])])])]),_:1},8,["modelValue"])])}}}),He=le(Le,[["__scopeId","data-v-290c77ee"]]);export{He as default};