import { d as G, q as Le, e as Ue, a as l, A as B, I as te, F as pe, x as qe, P as ye, C as Ae, Q as rt, R as q, M as Y, D as O, S as ke, r as Oe, w as st, y as je, z as at, U as it, V as Pe, E as le } from './index-20bdb712.js'; import { C as j } from './index-a4ff0f6f.js'; import { T as ze } from './index-b0472578.js'; import { M as ut } from './index-10f99a75.js'; import { R as lt, a as Fe } from './index-c497da86.js'; import { C as Be } from './index-6930c802.js'; import { O as ct } from './index-a25e1c12.js'; import { O as dt } from './index-29cade8a.js'; import { F as ft } from './index-61a6f012.js'; import { F as ve } from './index-7f161d6e.js'; import { q as gt } from './base-aba1ba3e.js'; import { O as ht } from './index-7c8aab9e.js'; import { I as mt } from './index-730bdae4.js'; import './Checker-65584c7b.js'; import './index-c814200a.js'; const pt = '_cartConfirm_1q6j7_1', yt = '_cartConfirmBox_1q6j7_9', wt = '_cartItem_1q6j7_15', Ct = '_mlr13_1q6j7_24', _t = '_protocol_1q6j7_28', Et = '_paymentContainer_1q6j7_36', At = '_needPrice_1q6j7_48', Bt = '_allPrice_1q6j7_64', Nt = '_cellItem_1q6j7_72', It = '_img_1q6j7_77', St = '_cellPrice_1q6j7_85', Tt = '_numFont_1q6j7_91', bt = '_numPrefix_1q6j7_94', Pt = '_goodsContent_1q6j7_98', Ft = '_goodsNum_1q6j7_98', vt = '_goodsPrice_1q6j7_104', Mt = '_free_1q6j7_110', Dt = '_goodsNums_1q6j7_113', Rt = '_brandName_1q6j7_128', Lt = '_model_1q6j7_137', Ut = '_popupCode_1q6j7_143', qt = '_codeContainer_1q6j7_147', kt = '_codeClose_1q6j7_150', Ot = '_codeImg_1q6j7_160', jt = '_codeTitle_1q6j7_167', zt = '_codeName_1q6j7_175', Vt = '_codeQr_1q6j7_182', Ht = '_codeBtnText_1q6j7_195', xt = '_codeTips_1q6j7_206', Gt = '_tipsTitle_1q6j7_220', Qt = '_close_1q6j7_226', Yt = '_codeBottom_1q6j7_231', Jt = '_title_1q6j7_238', Kt = '_shareImg_1q6j7_253', Zt = '_shareText_1q6j7_257', Xt = '_freight_1q6j7_263', Wt = '_submitBtn_1q6j7_275', I = { cartConfirm: pt, cartConfirmBox: yt, cartItem: wt, mlr13: Ct, protocol: _t, paymentContainer: Et, needPrice: At, allPrice: Bt, cellItem: Nt, img: It, cellPrice: St, numFont: Tt, numPrefix: bt, goodsContent: Pt, goodsNum: Ft, goodsPrice: vt, free: Mt, goodsNums: Dt, brandName: Rt, model: Lt, popupCode: Ut, codeContainer: qt, codeClose: kt, codeImg: Ot, codeTitle: jt, codeName: zt, codeQr: Vt, codeBtnText: Ht, codeTips: xt, tipsTitle: Gt, close: Qt, codeBottom: Yt, title: Jt, shareImg: Kt, shareText: Zt, freight: Xt, submitBtn: Wt }, $t = '_cellEntry_1kuxn_1', en = '_cell_1kuxn_1', tn = '_userName_1kuxn_36', nn = '_phone_1kuxn_41', on = '_addressInfo_1kuxn_46', rn = '_emtry_1kuxn_51', k = { cellEntry: $t, cell: en, userName: tn, phone: nn, addressInfo: on, emtry: rn }, sn = 'data:image/png;base64,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', an = G({ name: 'cart-address', props: { item: { type: Object, default: () => ({}) }, isLink: { type: Boolean, default: !0 }, setAddress: { type: Function, default: e => {} } }, setup(e) { const n = Le(), t = Ue(() => [ e.item.provinceName, e.item.cityName, e.item.regionName, e.item.detailAddress ].join('') ), s = () => { e.isLink && n.push('/shopAddress'); }; return () => l(pe, null, [ e.item && e.item.phoneNumber ? l( j, { class: k.cell, 'is-link': e.isLink, onClick: () => s(), titleStyle: { marginLeft: '0' } }, { title: () => l('div', null, [ l('span', { class: k.userName }, [e.item.name]), l('span', { class: k.phone }, [ e.item && e.item.phoneNumber && e.item.phoneNumber.replace( /^(\d{3})\d{4}(\d+)/, '$1****$2' ) ]), e.item.defaultStatus && l( ze, { type: 'primary', color: 'linear-gradient(90deg, #FF8633 0%, #FFB047 100%)', round: !0, style: { 'vertical-align': 'text-top', marginLeft: '10px', padding: '1px 8px' } }, { default: () => [B('默认')] } ) ]), label: () => l('span', { class: k.addressInfo }, [t.value]) } ) : l( j, { class: k.cell, 'is-link': e.isLink, onClick: () => s() }, { icon: () => l(te, { name: sn, size: 28 }, null), title: () => l('div', { class: k.emtry }, [B('去填写收货地址')]) } ) ]); } }), un = '_payment_1ot0l_1', ln = '_title_1ot0l_13', cn = '_payAmount_1ot0l_21', dn = '_amount_1ot0l_31', fn = '_blank_1ot0l_38', gn = '_payTypeRe_1ot0l_41', hn = '_recommend_1ot0l_45', mn = '_payBtn_1ot0l_54', R = { payment: un, title: ln, payAmount: cn, amount: dn, blank: fn, payTypeRe: gn, recommend: hn, payBtn: mn }, pn = G({ name: 'payment', props: { paymentConfig: { type: Object, default: {} } }, emits: ['backOut', 'close', 'confirm'], setup(e, { slots: n, attrs: t, emit: s }) { const o = qe({ payType: 'wx', pay_channel: '' }), r = () => { rt({ message: '是否放弃本次付款', confirmButtonText: '继续付款', cancelButtonText: '放弃', showCancelButton: !0 }).catch(async () => { await a(), s('backOut'), s('close'); }); }, a = async d => {}, u = async () => { const d = o.payType; q().weixin ? d == 'zfb' ? ((o.pay_channel = 'alipay_qr'), i('qrCode')) : d == 'wx' && ((o.pay_channel = 'wx_pub'), i('pay')) : q().alipay ? d == 'zfb' ? ((o.pay_channel = 'alipay_wap'), i('pay')) : d == 'wx' && ((o.pay_channel = 'wx_pub'), i('qrCode')) : (d == 'zfb' ? (o.pay_channel = 'alipay_qr') : d == 'wx' && (o.pay_channel = 'wx_pub'), i('qrCode')); }, i = d => { const f = d == 'qrCode' ? 'payCenter' : 'payResult'; s('confirm', { payCode: f, pay_channel: o.pay_channel }); }; return () => l('div', { class: R.payment }, [ l(te, { onClick: r, name: 'cross', size: 20 }, null), l('div', { class: [R.title] }, [B('选择支付方式')]), l('div', { class: R.payAmount }, [ l('p', null, [B('应付金额')]), l('div', { class: R.amount }, [ l('span', null, [B('¥ ')]), ye(e.paymentConfig.currentPrice) ]) ]), l( lt, { modelValue: o.payType, 'onUpdate:modelValue': d => (o.payType = d) }, { default: () => [ l( Be, { border: !1 }, { default: () => [ l( j, { border: !0, center: !0, onClick: () => { o.payType = 'wx'; } }, { icon: () => l( te, { name: 'wechat-pay', color: '#15c434', size: 22 }, null ), 'right-icon': () => l(Fe, { name: 'wx' }, null), title: () => l('div', { class: R.payTypeRe }, [ B('微信支付 '), l('span', { class: R.recommend }, [B('推荐')]) ]) } ), l( j, { title: '支付宝支付', border: !0, center: !0, onClick: () => { o.payType = 'zfb'; } }, { icon: () => l( te, { name: 'alipay', color: '#009fe9', size: 22 }, null ), 'right-icon': () => l(Fe, { name: 'zfb' }, null) } ) ] } ) ] } ), l('div', { class: R.blank }, null), l( Ae, { type: 'primary', class: R.payBtn, block: !0, round: !0, onClick: u }, { default: () => [B('确认支付')] } ) ]); } }), yn = '_userAuth_1wdij_1', wn = '_cellGroup_1wdij_6', Cn = '_btnGroup_1wdij_38', _n = '_otherBtn_1wdij_42', ce = { userAuth: yn, cellGroup: wn, btnGroup: Cn, otherBtn: _n }, En = G({ name: 'UserAuth', props: { onSuccess: { type: Function, default: () => {} }, hideHeader: { type: Boolean, default: !1 } }, data() { return { form: { realName: '', idCardNo: '' } }; }, mounted() { const e = Y.user.data; this.form.realName = e == null ? void 0 : e.account.realName; }, methods: { async onSubmit() { try { const e = '/edu-app/sysAccount/realNameAuth'; await O.post(e, { data: { ...this.form, contract: !0, save: !0 } }), (Y.user.data.account.realName = this.form.realName), (Y.user.data.account.idCardNo = this.form.idCardNo), this.onSuccess(); } catch (e) {} } }, render() { return l( ft, { class: ce.userAuth, onSubmit: this.onSubmit }, { default: () => [ !this.hideHeader && l(ke, { title: '实名认证' }, null), l( Be, { inset: !0, class: ce.cellGroup }, { default: () => [ l( ve, { required: !0, label: '真实姓名', modelValue: this.form.realName, 'onUpdate:modelValue': e => (this.form.realName = e), rules: [{ required: !0, message: '请填写真实姓名' }], name: 'realName', placeholder: '请填写真实姓名', autocomplete: 'off', maxlength: '50' }, null ), l( ve, { required: !0, label: '身份证号', modelValue: this.form.idCardNo, 'onUpdate:modelValue': e => (this.form.idCardNo = e), maxlength: 18, autocomplete: 'off', rules: [ { required: !0, message: '请输入身份证号' }, { pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号' } ], placeholder: '请输入身份证号' }, null ) ] } ), l('div', { class: ['btnGroup'] }, [ l( Ae, { block: !0, round: !0, type: 'primary', 'native-type': 'submit', class: ce.otherBtn }, { default: () => [B('确定')] } ) ]) ] } ); } }), An = { WAIT_PAY: '待支付', PAYING: '支付中', PAID: '已付款', TIMEOUT: '已关闭', FAIL: '支付失败', CLOSED: '已关闭', REFUNDING: '退款中', REFUNDED: '已退款' }, Bn = '_saveShareImage_1vhog_1', Nn = '_tips_1vhog_5', In = '_tipsTitle_1vhog_11', Sn = '_tipsContent_1vhog_17', Tn = '_previewSection_1vhog_23', bn = '_topImage_1vhog_30', Pn = '_shareContaienr_1vhog_37', Fn = '_schoolName_1vhog_45', vn = '_shareType_1vhog_51', Mn = '_qrcodeSection_1vhog_60', Dn = '_memo_1vhog_68', M = { saveShareImage: Bn, tips: Nn, tipsTitle: In, tipsContent: Sn, previewSection: Tn, topImage: bn, shareContaienr: Pn, schoolName: Fn, shareType: vn, qrcodeSection: Mn, memo: Dn }, Rn = '' + new URL('smallLogo-517ff5bd.png', import.meta.url).href; var Z = {}, Ln = function () { return ( typeof Promise == 'function' && Promise.prototype && Promise.prototype.then ); }, Ve = {}, T = {}; let Ne; const Un = [ 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 (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; }; T.getSymbolTotalCodewords = function (n) { return Un[n]; }; T.getBCHDigit = function (e) { let n = 0; for (; e !== 0; ) n++, (e >>>= 1); return n; }; T.setToSJISFunction = function (n) { if (typeof n != 'function') throw new Error('"toSJISFunc" is not a valid function.'); Ne = n; }; T.isKanjiModeEnabled = function () { return typeof Ne < 'u'; }; T.toSJIS = function (n) { return Ne(n); }; var re = {}; (function (e) { (e.L = { bit: 1 }), (e.M = { bit: 0 }), (e.Q = { bit: 3 }), (e.H = { bit: 2 }); function n(t) { if (typeof t != 'string') throw new Error('Param is not a string'); switch (t.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: ' + t); } } (e.isValid = function (s) { return s && typeof s.bit < 'u' && s.bit >= 0 && s.bit < 4; }), (e.from = function (s, o) { if (e.isValid(s)) return s; try { return n(s); } catch (r) { return o; } }); })(re); function He() { (this.buffer = []), (this.length = 0); } He.prototype = { get: function (e) { const n = Math.floor(e / 8); return ((this.buffer[n] >>> (7 - (e % 8))) & 1) === 1; }, put: function (e, n) { for (let t = 0; t < n; t++) this.putBit(((e >>> (n - t - 1)) & 1) === 1); }, getLengthInBits: function () { return this.length; }, putBit: function (e) { const n = Math.floor(this.length / 8); this.buffer.length <= n && this.buffer.push(0), e && (this.buffer[n] |= 128 >>> this.length % 8), this.length++; } }; var qn = He; function X(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)); } X.prototype.set = function (e, n, t, s) { const o = e * this.size + n; (this.data[o] = t), s && (this.reservedBit[o] = !0); }; X.prototype.get = function (e, n) { return this.data[e * this.size + n]; }; X.prototype.xor = function (e, n, t) { this.data[e * this.size + n] ^= t; }; X.prototype.isReserved = function (e, n) { return this.reservedBit[e * this.size + n]; }; var kn = X, xe = {}; (function (e) { const n = T.getSymbolSize; (e.getRowColCoords = function (s) { if (s === 1) return []; const o = Math.floor(s / 7) + 2, r = n(s), a = r === 145 ? 26 : Math.ceil((r - 13) / (2 * o - 2)) * 2, u = [r - 7]; for (let i = 1; i < o - 1; i++) u[i] = u[i - 1] - a; return u.push(6), u.reverse(); }), (e.getPositions = function (s) { const o = [], r = e.getRowColCoords(s), a = r.length; for (let u = 0; u < a; u++) for (let i = 0; i < a; i++) (u === 0 && i === 0) || (u === 0 && i === a - 1) || (u === a - 1 && i === 0) || o.push([r[u], r[i]]); return o; }); })(xe); var Ge = {}; const On = T.getSymbolSize, Me = 7; Ge.getPositions = function (n) { const t = On(n); return [ [0, 0], [t - Me, 0], [0, t - Me] ]; }; var Qe = {}; (function (e) { e.Patterns = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 }; const n = { N1: 3, N2: 3, N3: 40, N4: 10 }; (e.isValid = function (o) { return o != null && o !== '' && !isNaN(o) && o >= 0 && o <= 7; }), (e.from = function (o) { return e.isValid(o) ? parseInt(o, 10) : void 0; }), (e.getPenaltyN1 = function (o) { const r = o.size; let a = 0, u = 0, i = 0, d = null, f = null; for (let A = 0; A < r; A++) { (u = i = 0), (d = f = null); for (let y = 0; y < r; y++) { let h = o.get(A, y); h === d ? u++ : (u >= 5 && (a += n.N1 + (u - 5)), (d = h), (u = 1)), (h = o.get(y, A)), h === f ? i++ : (i >= 5 && (a += n.N1 + (i - 5)), (f = h), (i = 1)); } u >= 5 && (a += n.N1 + (u - 5)), i >= 5 && (a += n.N1 + (i - 5)); } return a; }), (e.getPenaltyN2 = function (o) { const r = o.size; let a = 0; for (let u = 0; u < r - 1; u++) for (let i = 0; i < r - 1; i++) { const d = o.get(u, i) + o.get(u, i + 1) + o.get(u + 1, i) + o.get(u + 1, i + 1); (d === 4 || d === 0) && a++; } return a * n.N2; }), (e.getPenaltyN3 = function (o) { const r = o.size; let a = 0, u = 0, i = 0; for (let d = 0; d < r; d++) { u = i = 0; for (let f = 0; f < r; f++) (u = ((u << 1) & 2047) | o.get(d, f)), f >= 10 && (u === 1488 || u === 93) && a++, (i = ((i << 1) & 2047) | o.get(f, d)), f >= 10 && (i === 1488 || i === 93) && a++; } return a * n.N3; }), (e.getPenaltyN4 = function (o) { let r = 0; const a = o.data.length; for (let i = 0; i < a; i++) r += o.data[i]; return Math.abs(Math.ceil((r * 100) / a / 5) - 10) * n.N4; }); function t(s, o, r) { switch (s) { case e.Patterns.PATTERN000: return (o + r) % 2 === 0; case e.Patterns.PATTERN001: return o % 2 === 0; case e.Patterns.PATTERN010: return r % 3 === 0; case e.Patterns.PATTERN011: return (o + r) % 3 === 0; case e.Patterns.PATTERN100: return (Math.floor(o / 2) + Math.floor(r / 3)) % 2 === 0; case e.Patterns.PATTERN101: return ((o * r) % 2) + ((o * r) % 3) === 0; case e.Patterns.PATTERN110: return (((o * r) % 2) + ((o * r) % 3)) % 2 === 0; case e.Patterns.PATTERN111: return (((o * r) % 3) + ((o + r) % 2)) % 2 === 0; default: throw new Error('bad maskPattern:' + s); } } (e.applyMask = function (o, r) { const a = r.size; for (let u = 0; u < a; u++) for (let i = 0; i < a; i++) r.isReserved(i, u) || r.xor(i, u, t(o, i, u)); }), (e.getBestMask = function (o, r) { const a = Object.keys(e.Patterns).length; let u = 0, i = 1 / 0; for (let d = 0; d < a; d++) { r(d), e.applyMask(d, o); const f = e.getPenaltyN1(o) + e.getPenaltyN2(o) + e.getPenaltyN3(o) + e.getPenaltyN4(o); e.applyMask(d, o), f < i && ((i = f), (u = d)); } return u; }); })(Qe); var se = {}; const L = re, W = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2, 4, 4, 2, 4, 4, 4, 2, 4, 6, 5, 2, 4, 6, 6, 2, 5, 8, 8, 4, 5, 8, 8, 4, 5, 8, 11, 4, 8, 10, 11, 4, 9, 12, 16, 4, 9, 16, 16, 6, 10, 12, 18, 6, 10, 17, 16, 6, 11, 16, 19, 6, 13, 18, 21, 7, 14, 21, 25, 8, 16, 20, 25, 8, 17, 23, 25, 9, 17, 23, 34, 9, 18, 25, 30, 10, 20, 27, 32, 12, 21, 29, 35, 12, 23, 34, 37, 12, 25, 34, 40, 13, 26, 35, 42, 14, 28, 38, 45, 15, 29, 40, 48, 16, 31, 43, 51, 17, 33, 45, 54, 18, 35, 48, 57, 19, 37, 51, 60, 19, 38, 53, 63, 20, 40, 56, 66, 21, 43, 59, 70, 22, 45, 62, 74, 24, 47, 65, 77, 25, 49, 68, 81 ], $ = [ 7, 10, 13, 17, 10, 16, 22, 28, 15, 26, 36, 44, 20, 36, 52, 64, 26, 48, 72, 88, 36, 64, 96, 112, 40, 72, 108, 130, 48, 88, 132, 156, 60, 110, 160, 192, 72, 130, 192, 224, 80, 150, 224, 264, 96, 176, 260, 308, 104, 198, 288, 352, 120, 216, 320, 384, 132, 240, 360, 432, 144, 280, 408, 480, 168, 308, 448, 532, 180, 338, 504, 588, 196, 364, 546, 650, 224, 416, 600, 700, 224, 442, 644, 750, 252, 476, 690, 816, 270, 504, 750, 900, 300, 560, 810, 960, 312, 588, 870, 1050, 336, 644, 952, 1110, 360, 700, 1020, 1200, 390, 728, 1050, 1260, 420, 784, 1140, 1350, 450, 812, 1200, 1440, 480, 868, 1290, 1530, 510, 924, 1350, 1620, 540, 980, 1440, 1710, 570, 1036, 1530, 1800, 570, 1064, 1590, 1890, 600, 1120, 1680, 1980, 630, 1204, 1770, 2100, 660, 1260, 1860, 2220, 720, 1316, 1950, 2310, 750, 1372, 2040, 2430 ]; se.getBlocksCount = function (n, t) { switch (t) { case L.L: return W[(n - 1) * 4 + 0]; case L.M: return W[(n - 1) * 4 + 1]; case L.Q: return W[(n - 1) * 4 + 2]; case L.H: return W[(n - 1) * 4 + 3]; default: return; } }; se.getTotalCodewordsCount = function (n, t) { switch (t) { case L.L: return $[(n - 1) * 4 + 0]; case L.M: return $[(n - 1) * 4 + 1]; case L.Q: return $[(n - 1) * 4 + 2]; case L.H: return $[(n - 1) * 4 + 3]; default: return; } }; var Ye = {}, ae = {}; const J = new Uint8Array(512), ne = new Uint8Array(256); (function () { let n = 1; for (let t = 0; t < 255; t++) (J[t] = n), (ne[n] = t), (n <<= 1), n & 256 && (n ^= 285); for (let t = 255; t < 512; t++) J[t] = J[t - 255]; })(); ae.log = function (n) { if (n < 1) throw new Error('log(' + n + ')'); return ne[n]; }; ae.exp = function (n) { return J[n]; }; ae.mul = function (n, t) { return n === 0 || t === 0 ? 0 : J[ne[n] + ne[t]]; }; (function (e) { const n = ae; (e.mul = function (s, o) { const r = new Uint8Array(s.length + o.length - 1); for (let a = 0; a < s.length; a++) for (let u = 0; u < o.length; u++) r[a + u] ^= n.mul(s[a], o[u]); return r; }), (e.mod = function (s, o) { let r = new Uint8Array(s); for (; r.length - o.length >= 0; ) { const a = r[0]; for (let i = 0; i < o.length; i++) r[i] ^= n.mul(o[i], a); let u = 0; for (; u < r.length && r[u] === 0; ) u++; r = r.slice(u); } return r; }), (e.generateECPolynomial = function (s) { let o = new Uint8Array([1]); for (let r = 0; r < s; r++) o = e.mul(o, new Uint8Array([1, n.exp(r)])); return o; }); })(Ye); const Je = Ye; function Ie(e) { (this.genPoly = void 0), (this.degree = e), this.degree && this.initialize(this.degree); } Ie.prototype.initialize = function (n) { (this.degree = n), (this.genPoly = Je.generateECPolynomial(this.degree)); }; Ie.prototype.encode = function (n) { if (!this.genPoly) throw new Error('Encoder not initialized'); const t = new Uint8Array(n.length + this.degree); t.set(n); const s = Je.mod(t, this.genPoly), o = this.degree - s.length; if (o > 0) { const r = new Uint8Array(this.degree); return r.set(s, o), r; } return s; }; var jn = Ie, Ke = {}, U = {}, Se = {}; Se.isValid = function (n) { return !isNaN(n) && n >= 1 && n <= 40; }; var F = {}; const Ze = '[0-9]+', zn = '[A-Z $%*+\\-./:]+'; let K = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'; K = K.replace(/u/g, '\\u'); const Vn = '(?:(?![A-Z0-9 $%*+\\-./:]|' + K + `)(?:.|[\r ]))+`; F.KANJI = new RegExp(K, 'g'); F.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\-./:]+', 'g'); F.BYTE = new RegExp(Vn, 'g'); F.NUMERIC = new RegExp(Ze, 'g'); F.ALPHANUMERIC = new RegExp(zn, 'g'); const Hn = new RegExp('^' + K + '$'), xn = new RegExp('^' + Ze + '$'), Gn = new RegExp('^[A-Z0-9 $%*+\\-./:]+$'); F.testKanji = function (n) { return Hn.test(n); }; F.testNumeric = function (n) { return xn.test(n); }; F.testAlphanumeric = function (n) { return Gn.test(n); }; (function (e) { const n = Se, t = F; (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 (r, a) { if (!r.ccBits) throw new Error('Invalid mode: ' + r); if (!n.isValid(a)) throw new Error('Invalid version: ' + a); return a >= 1 && a < 10 ? r.ccBits[0] : a < 27 ? r.ccBits[1] : r.ccBits[2]; }), (e.getBestModeForData = function (r) { return t.testNumeric(r) ? e.NUMERIC : t.testAlphanumeric(r) ? e.ALPHANUMERIC : t.testKanji(r) ? e.KANJI : e.BYTE; }), (e.toString = function (r) { if (r && r.id) return r.id; throw new Error('Invalid mode'); }), (e.isValid = function (r) { return r && r.bit && r.ccBits; }); function s(o) { if (typeof o != 'string') throw new Error('Param is not a string'); switch (o.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: ' + o); } } e.from = function (r, a) { if (e.isValid(r)) return r; try { return s(r); } catch (u) { return a; } }; })(U); (function (e) { const n = T, t = se, s = re, o = U, r = Se, a = 7973, u = n.getBCHDigit(a); function i(y, h, _) { for (let c = 1; c <= 40; c++) if (h <= e.getCapacity(c, _, y)) return c; } function d(y, h) { return o.getCharCountIndicator(y, h) + 4; } function f(y, h) { let _ = 0; return ( y.forEach(function (c) { const m = d(c.mode, h); _ += m + c.getBitsLength(); }), _ ); } function A(y, h) { for (let _ = 1; _ <= 40; _++) if (f(y, _) <= e.getCapacity(_, h, o.MIXED)) return _; } (e.from = function (h, _) { return r.isValid(h) ? parseInt(h, 10) : _; }), (e.getCapacity = function (h, _, c) { if (!r.isValid(h)) throw new Error('Invalid QR Code version'); typeof c > 'u' && (c = o.BYTE); const m = n.getSymbolTotalCodewords(h), g = t.getTotalCodewordsCount(h, _), C = (m - g) * 8; if (c === o.MIXED) return C; const p = C - d(c, h); switch (c) { case o.NUMERIC: return Math.floor((p / 10) * 3); case o.ALPHANUMERIC: return Math.floor((p / 11) * 2); case o.KANJI: return Math.floor(p / 13); case o.BYTE: default: return Math.floor(p / 8); } }), (e.getBestVersionForData = function (h, _) { let c; const m = s.from(_, s.M); if (Array.isArray(h)) { if (h.length > 1) return A(h, m); if (h.length === 0) return 1; c = h[0]; } else c = h; return i(c.mode, c.getLength(), m); }), (e.getEncodedBits = function (h) { if (!r.isValid(h) || h < 7) throw new Error('Invalid QR Code version'); let _ = h << 12; for (; n.getBCHDigit(_) - u >= 0; ) _ ^= a << (n.getBCHDigit(_) - u); return (h << 12) | _; }); })(Ke); var Xe = {}; const we = T, We = 1335, Qn = 21522, De = we.getBCHDigit(We); Xe.getEncodedBits = function (n, t) { const s = (n.bit << 3) | t; let o = s << 10; for (; we.getBCHDigit(o) - De >= 0; ) o ^= We << (we.getBCHDigit(o) - De); return ((s << 10) | o) ^ Qn; }; var $e = {}; const Yn = U; function z(e) { (this.mode = Yn.NUMERIC), (this.data = e.toString()); } z.getBitsLength = function (n) { return 10 * Math.floor(n / 3) + (n % 3 ? (n % 3) * 3 + 1 : 0); }; z.prototype.getLength = function () { return this.data.length; }; z.prototype.getBitsLength = function () { return z.getBitsLength(this.data.length); }; z.prototype.write = function (n) { let t, s, o; for (t = 0; t + 3 <= this.data.length; t += 3) (s = this.data.substr(t, 3)), (o = parseInt(s, 10)), n.put(o, 10); const r = this.data.length - t; r > 0 && ((s = this.data.substr(t)), (o = parseInt(s, 10)), n.put(o, r * 3 + 1)); }; var Jn = z; const Kn = U, de = [ '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 V(e) { (this.mode = Kn.ALPHANUMERIC), (this.data = e); } V.getBitsLength = function (n) { return 11 * Math.floor(n / 2) + 6 * (n % 2); }; V.prototype.getLength = function () { return this.data.length; }; V.prototype.getBitsLength = function () { return V.getBitsLength(this.data.length); }; V.prototype.write = function (n) { let t; for (t = 0; t + 2 <= this.data.length; t += 2) { let s = de.indexOf(this.data[t]) * 45; (s += de.indexOf(this.data[t + 1])), n.put(s, 11); } this.data.length % 2 && n.put(de.indexOf(this.data[t]), 6); }; var Zn = V, Xn = function (n) { for (var t = [], s = n.length, o = 0; o < s; o++) { var r = n.charCodeAt(o); if (r >= 55296 && r <= 56319 && s > o + 1) { var a = n.charCodeAt(o + 1); a >= 56320 && a <= 57343 && ((r = (r - 55296) * 1024 + a - 56320 + 65536), (o += 1)); } if (r < 128) { t.push(r); continue; } if (r < 2048) { t.push((r >> 6) | 192), t.push((r & 63) | 128); continue; } if (r < 55296 || (r >= 57344 && r < 65536)) { t.push((r >> 12) | 224), t.push(((r >> 6) & 63) | 128), t.push((r & 63) | 128); continue; } if (r >= 65536 && r <= 1114111) { t.push((r >> 18) | 240), t.push(((r >> 12) & 63) | 128), t.push(((r >> 6) & 63) | 128), t.push((r & 63) | 128); continue; } t.push(239, 191, 189); } return new Uint8Array(t).buffer; }; const Wn = Xn, $n = U; function H(e) { (this.mode = $n.BYTE), typeof e == 'string' && (e = Wn(e)), (this.data = new Uint8Array(e)); } H.getBitsLength = function (n) { return n * 8; }; H.prototype.getLength = function () { return this.data.length; }; H.prototype.getBitsLength = function () { return H.getBitsLength(this.data.length); }; H.prototype.write = function (e) { for (let n = 0, t = this.data.length; n < t; n++) e.put(this.data[n], 8); }; var eo = H; const to = U, no = T; function x(e) { (this.mode = to.KANJI), (this.data = e); } x.getBitsLength = function (n) { return n * 13; }; x.prototype.getLength = function () { return this.data.length; }; x.prototype.getBitsLength = function () { return x.getBitsLength(this.data.length); }; x.prototype.write = function (e) { let n; for (n = 0; n < this.data.length; n++) { let t = no.toSJIS(this.data[n]); if (t >= 33088 && t <= 40956) t -= 33088; else if (t >= 57408 && t <= 60351) t -= 49472; else throw new Error( 'Invalid SJIS character: ' + this.data[n] + ` Make sure your charset is UTF-8` ); (t = ((t >>> 8) & 255) * 192 + (t & 255)), e.put(t, 13); } }; var oo = x, et = { exports: {} }; (function (e) { var n = { single_source_shortest_paths: function (t, s, o) { var r = {}, a = {}; a[s] = 0; var u = n.PriorityQueue.make(); u.push(s, 0); for (var i, d, f, A, y, h, _, c, m; !u.empty(); ) { (i = u.pop()), (d = i.value), (A = i.cost), (y = t[d] || {}); for (f in y) y.hasOwnProperty(f) && ((h = y[f]), (_ = A + h), (c = a[f]), (m = typeof a[f] > 'u'), (m || c > _) && ((a[f] = _), u.push(f, _), (r[f] = d))); } if (typeof o < 'u' && typeof a[o] > 'u') { var g = ['Could not find a path from ', s, ' to ', o, '.'].join(''); throw new Error(g); } return r; }, extract_shortest_path_from_predecessor_list: function (t, s) { for (var o = [], r = s; r; ) o.push(r), t[r], (r = t[r]); return o.reverse(), o; }, find_path: function (t, s, o) { var r = n.single_source_shortest_paths(t, s, o); return n.extract_shortest_path_from_predecessor_list(r, o); }, PriorityQueue: { make: function (t) { var s = n.PriorityQueue, o = {}, r; t = t || {}; for (r in s) s.hasOwnProperty(r) && (o[r] = s[r]); return (o.queue = []), (o.sorter = t.sorter || s.default_sorter), o; }, default_sorter: function (t, s) { return t.cost - s.cost; }, push: function (t, s) { var o = { value: t, cost: s }; this.queue.push(o), this.queue.sort(this.sorter); }, pop: function () { return this.queue.shift(); }, empty: function () { return this.queue.length === 0; } } }; e.exports = n; })(et); var ro = et.exports; (function (e) { const n = U, t = Jn, s = Zn, o = eo, r = oo, a = F, u = T, i = ro; function d(g) { return unescape(encodeURIComponent(g)).length; } function f(g, C, p) { const w = []; let E; for (; (E = g.exec(p)) !== null; ) w.push({ data: E[0], index: E.index, mode: C, length: E[0].length }); return w; } function A(g) { const C = f(a.NUMERIC, n.NUMERIC, g), p = f(a.ALPHANUMERIC, n.ALPHANUMERIC, g); let w, E; return ( u.isKanjiModeEnabled() ? ((w = f(a.BYTE, n.BYTE, g)), (E = f(a.KANJI, n.KANJI, g))) : ((w = f(a.BYTE_KANJI, n.BYTE, g)), (E = [])), C.concat(p, w, E) .sort(function (S, b) { return S.index - b.index; }) .map(function (S) { return { data: S.data, mode: S.mode, length: S.length }; }) ); } function y(g, C) { switch (C) { case n.NUMERIC: return t.getBitsLength(g); case n.ALPHANUMERIC: return s.getBitsLength(g); case n.KANJI: return r.getBitsLength(g); case n.BYTE: return o.getBitsLength(g); } } function h(g) { return g.reduce(function (C, p) { const w = C.length - 1 >= 0 ? C[C.length - 1] : null; return w && w.mode === p.mode ? ((C[C.length - 1].data += p.data), C) : (C.push(p), C); }, []); } function _(g) { const C = []; for (let p = 0; p < g.length; p++) { const w = g[p]; switch (w.mode) { case n.NUMERIC: C.push([ w, { data: w.data, mode: n.ALPHANUMERIC, length: w.length }, { data: w.data, mode: n.BYTE, length: w.length } ]); break; case n.ALPHANUMERIC: C.push([w, { data: w.data, mode: n.BYTE, length: w.length }]); break; case n.KANJI: C.push([w, { data: w.data, mode: n.BYTE, length: d(w.data) }]); break; case n.BYTE: C.push([{ data: w.data, mode: n.BYTE, length: d(w.data) }]); } } return C; } function c(g, C) { const p = {}, w = { start: {} }; let E = ['start']; for (let N = 0; N < g.length; N++) { const S = g[N], b = []; for (let D = 0; D < S.length; D++) { const P = S[D], Q = '' + N + D; b.push(Q), (p[Q] = { node: P, lastCount: 0 }), (w[Q] = {}); for (let ue = 0; ue < E.length; ue++) { const v = E[ue]; p[v] && p[v].node.mode === P.mode ? ((w[v][Q] = y(p[v].lastCount + P.length, P.mode) - y(p[v].lastCount, P.mode)), (p[v].lastCount += P.length)) : (p[v] && (p[v].lastCount = P.length), (w[v][Q] = y(P.length, P.mode) + 4 + n.getCharCountIndicator(P.mode, C))); } } E = b; } for (let N = 0; N < E.length; N++) w[E[N]].end = 0; return { map: w, table: p }; } function m(g, C) { let p; const w = n.getBestModeForData(g); if (((p = n.from(C, w)), p !== n.BYTE && p.bit < w.bit)) throw new Error( '"' + g + '" cannot be encoded with mode ' + n.toString(p) + `. Suggested mode is: ` + n.toString(w) ); switch ((p === n.KANJI && !u.isKanjiModeEnabled() && (p = n.BYTE), p)) { case n.NUMERIC: return new t(g); case n.ALPHANUMERIC: return new s(g); case n.KANJI: return new r(g); case n.BYTE: return new o(g); } } (e.fromArray = function (C) { return C.reduce(function (p, w) { return ( typeof w == 'string' ? p.push(m(w, null)) : w.data && p.push(m(w.data, w.mode)), p ); }, []); }), (e.fromString = function (C, p) { const w = A(C, u.isKanjiModeEnabled()), E = _(w), N = c(E, p), S = i.find_path(N.map, 'start', 'end'), b = []; for (let D = 1; D < S.length - 1; D++) b.push(N.table[S[D]].node); return e.fromArray(h(b)); }), (e.rawSplit = function (C) { return e.fromArray(A(C, u.isKanjiModeEnabled())); }); })($e); const ie = T, fe = re, so = qn, ao = kn, io = xe, uo = Ge, Ce = Qe, _e = se, lo = jn, oe = Ke, co = Xe, fo = U, ge = $e; function go(e, n) { const t = e.size, s = uo.getPositions(n); for (let o = 0; o < s.length; o++) { const r = s[o][0], a = s[o][1]; for (let u = -1; u <= 7; u++) if (!(r + u <= -1 || t <= r + u)) for (let i = -1; i <= 7; i++) a + i <= -1 || t <= a + i || ((u >= 0 && u <= 6 && (i === 0 || i === 6)) || (i >= 0 && i <= 6 && (u === 0 || u === 6)) || (u >= 2 && u <= 4 && i >= 2 && i <= 4) ? e.set(r + u, a + i, !0, !0) : e.set(r + u, a + i, !1, !0)); } } function ho(e) { const n = e.size; for (let t = 8; t < n - 8; t++) { const s = t % 2 === 0; e.set(t, 6, s, !0), e.set(6, t, s, !0); } } function mo(e, n) { const t = io.getPositions(n); for (let s = 0; s < t.length; s++) { const o = t[s][0], r = t[s][1]; for (let a = -2; a <= 2; a++) for (let u = -2; u <= 2; u++) a === -2 || a === 2 || u === -2 || u === 2 || (a === 0 && u === 0) ? e.set(o + a, r + u, !0, !0) : e.set(o + a, r + u, !1, !0); } } function po(e, n) { const t = e.size, s = oe.getEncodedBits(n); let o, r, a; for (let u = 0; u < 18; u++) (o = Math.floor(u / 3)), (r = (u % 3) + t - 8 - 3), (a = ((s >> u) & 1) === 1), e.set(o, r, a, !0), e.set(r, o, a, !0); } function he(e, n, t) { const s = e.size, o = co.getEncodedBits(n, t); let r, a; for (r = 0; r < 15; r++) (a = ((o >> r) & 1) === 1), r < 6 ? e.set(r, 8, a, !0) : r < 8 ? e.set(r + 1, 8, a, !0) : e.set(s - 15 + r, 8, a, !0), r < 8 ? e.set(8, s - r - 1, a, !0) : r < 9 ? e.set(8, 15 - r - 1 + 1, a, !0) : e.set(8, 15 - r - 1, a, !0); e.set(s - 8, 8, 1, !0); } function yo(e, n) { const t = e.size; let s = -1, o = t - 1, r = 7, a = 0; for (let u = t - 1; u > 0; u -= 2) for (u === 6 && u--; ; ) { for (let i = 0; i < 2; i++) if (!e.isReserved(o, u - i)) { let d = !1; a < n.length && (d = ((n[a] >>> r) & 1) === 1), e.set(o, u - i, d), r--, r === -1 && (a++, (r = 7)); } if (((o += s), o < 0 || t <= o)) { (o -= s), (s = -s); break; } } } function wo(e, n, t) { const s = new so(); t.forEach(function (i) { s.put(i.mode.bit, 4), s.put(i.getLength(), fo.getCharCountIndicator(i.mode, e)), i.write(s); }); const o = ie.getSymbolTotalCodewords(e), r = _e.getTotalCodewordsCount(e, n), a = (o - r) * 8; for ( s.getLengthInBits() + 4 <= a && s.put(0, 4); s.getLengthInBits() % 8 !== 0; ) s.putBit(0); const u = (a - s.getLengthInBits()) / 8; for (let i = 0; i < u; i++) s.put(i % 2 ? 17 : 236, 8); return Co(s, e, n); } function Co(e, n, t) { const s = ie.getSymbolTotalCodewords(n), o = _e.getTotalCodewordsCount(n, t), r = s - o, a = _e.getBlocksCount(n, t), u = s % a, i = a - u, d = Math.floor(s / a), f = Math.floor(r / a), A = f + 1, y = d - f, h = new lo(y); let _ = 0; const c = new Array(a), m = new Array(a); let g = 0; const C = new Uint8Array(e.buffer); for (let S = 0; S < a; S++) { const b = S < i ? f : A; (c[S] = C.slice(_, _ + b)), (m[S] = h.encode(c[S])), (_ += b), (g = Math.max(g, b)); } const p = new Uint8Array(s); let w = 0, E, N; for (E = 0; E < g; E++) for (N = 0; N < a; N++) E < c[N].length && (p[w++] = c[N][E]); for (E = 0; E < y; E++) for (N = 0; N < a; N++) p[w++] = m[N][E]; return p; } function _o(e, n, t, s) { let o; if (Array.isArray(e)) o = ge.fromArray(e); else if (typeof e == 'string') { let d = n; if (!d) { const f = ge.rawSplit(e); d = oe.getBestVersionForData(f, t); } o = ge.fromString(e, d || 40); } else throw new Error('Invalid data'); const r = oe.getBestVersionForData(o, t); if (!r) throw new Error('The amount of data is too big to be stored in a QR Code'); if (!n) n = r; else if (n < r) throw new Error( ` The chosen QR Code version cannot contain this amount of data. Minimum version required to store current data is: ` + r + `. ` ); const a = wo(n, t, o), u = ie.getSymbolSize(n), i = new ao(u); return ( go(i, n), ho(i), mo(i, n), he(i, t, 0), n >= 7 && po(i, n), yo(i, a), isNaN(s) && (s = Ce.getBestMask(i, he.bind(null, i, t))), Ce.applyMask(s, i), he(i, t, s), { modules: i, version: n, errorCorrectionLevel: t, maskPattern: s, segments: o } ); } Ve.create = function (n, t) { if (typeof n > 'u' || n === '') throw new Error('No input text'); let s = fe.M, o, r; return ( typeof t < 'u' && ((s = fe.from(t.errorCorrectionLevel, fe.M)), (o = oe.from(t.version)), (r = Ce.from(t.maskPattern)), t.toSJISFunc && ie.setToSJISFunction(t.toSJISFunc)), _o(n, o, s, r) ); }; var tt = {}, Te = {}; (function (e) { function n(t) { if ((typeof t == 'number' && (t = t.toString()), typeof t != 'string')) throw new Error('Color should be defined as hex string'); let s = t.slice().replace('#', '').split(''); if (s.length < 3 || s.length === 5 || s.length > 8) throw new Error('Invalid hex color: ' + t); (s.length === 3 || s.length === 4) && (s = Array.prototype.concat.apply( [], s.map(function (r) { return [r, r]; }) )), s.length === 6 && s.push('F', 'F'); const o = parseInt(s.join(''), 16); return { r: (o >> 24) & 255, g: (o >> 16) & 255, b: (o >> 8) & 255, a: o & 255, hex: '#' + s.slice(0, 6).join('') }; } (e.getOptions = function (s) { s || (s = {}), s.color || (s.color = {}); const o = typeof s.margin > 'u' || s.margin === null || s.margin < 0 ? 4 : s.margin, r = s.width && s.width >= 21 ? s.width : void 0, a = s.scale || 4; return { width: r, scale: r ? 4 : a, margin: o, color: { dark: n(s.color.dark || '#000000ff'), light: n(s.color.light || '#ffffffff') }, type: s.type, rendererOpts: s.rendererOpts || {} }; }), (e.getScale = function (s, o) { return o.width && o.width >= s + o.margin * 2 ? o.width / (s + o.margin * 2) : o.scale; }), (e.getImageWidth = function (s, o) { const r = e.getScale(s, o); return Math.floor((s + o.margin * 2) * r); }), (e.qrToImageData = function (s, o, r) { const a = o.modules.size, u = o.modules.data, i = e.getScale(a, r), d = Math.floor((a + r.margin * 2) * i), f = r.margin * i, A = [r.color.light, r.color.dark]; for (let y = 0; y < d; y++) for (let h = 0; h < d; h++) { let _ = (y * d + h) * 4, c = r.color.light; if (y >= f && h >= f && y < d - f && h < d - f) { const m = Math.floor((y - f) / i), g = Math.floor((h - f) / i); c = A[u[m * a + g] ? 1 : 0]; } (s[_++] = c.r), (s[_++] = c.g), (s[_++] = c.b), (s[_] = c.a); } }); })(Te); (function (e) { const n = Te; function t(o, r, a) { o.clearRect(0, 0, r.width, r.height), r.style || (r.style = {}), (r.height = a), (r.width = a), (r.style.height = a + 'px'), (r.style.width = a + 'px'); } function s() { try { return document.createElement('canvas'); } catch (o) { throw new Error('You need to specify a canvas element'); } } (e.render = function (r, a, u) { let i = u, d = a; typeof i > 'u' && (!a || !a.getContext) && ((i = a), (a = void 0)), a || (d = s()), (i = n.getOptions(i)); const f = n.getImageWidth(r.modules.size, i), A = d.getContext('2d'), y = A.createImageData(f, f); return ( n.qrToImageData(y.data, r, i), t(A, d, f), A.putImageData(y, 0, 0), d ); }), (e.renderToDataURL = function (r, a, u) { let i = u; typeof i > 'u' && (!a || !a.getContext) && ((i = a), (a = void 0)), i || (i = {}); const d = e.render(r, a, i), f = i.type || 'image/png', A = i.rendererOpts || {}; return d.toDataURL(f, A.quality); }); })(tt); var nt = {}; const Eo = Te; function Re(e, n) { const t = e.a / 255, s = n + '="' + e.hex + '"'; return t < 1 ? s + ' ' + n + '-opacity="' + t.toFixed(2).slice(1) + '"' : s; } function me(e, n, t) { let s = e + n; return typeof t < 'u' && (s += ' ' + t), s; } function Ao(e, n, t) { let s = '', o = 0, r = !1, a = 0; for (let u = 0; u < e.length; u++) { const i = Math.floor(u % n), d = Math.floor(u / n); !i && !r && (r = !0), e[u] ? (a++, (u > 0 && i > 0 && e[u - 1]) || ((s += r ? me('M', i + t, 0.5 + d + t) : me('m', o, 0)), (o = 0), (r = !1)), (i + 1 < n && e[u + 1]) || ((s += me('h', a)), (a = 0))) : o++; } return s; } nt.render = function (n, t, s) { const o = Eo.getOptions(t), r = n.modules.size, a = n.modules.data, u = r + o.margin * 2, i = o.color.light.a ? '' : '', d = '', f = 'viewBox="0 0 ' + u + ' ' + u + '"', y = '' + i + d + ` `; return typeof s == 'function' && s(null, y), y; }; const Bo = Ln, Ee = Ve, ot = tt, No = nt; function be(e, n, t, s, o) { const r = [].slice.call(arguments, 1), a = r.length, u = typeof r[a - 1] == 'function'; if (!u && !Bo()) throw new Error('Callback required as last argument'); if (u) { if (a < 2) throw new Error('Too few arguments provided'); a === 2 ? ((o = t), (t = n), (n = s = void 0)) : a === 3 && (n.getContext && typeof o > 'u' ? ((o = s), (s = void 0)) : ((o = s), (s = t), (t = n), (n = void 0))); } else { if (a < 1) throw new Error('Too few arguments provided'); return ( a === 1 ? ((t = n), (n = s = void 0)) : a === 2 && !n.getContext && ((s = t), (t = n), (n = void 0)), new Promise(function (i, d) { try { const f = Ee.create(t, s); i(e(f, n, s)); } catch (f) { d(f); } }) ); } try { const i = Ee.create(t, s); o(null, e(i, n, s)); } catch (i) { o(i); } } Z.create = Ee.create; Z.toCanvas = be.bind(null, ot.render); Z.toDataURL = be.bind(null, ot.renderToDataURL); Z.toString = be.bind(null, function (e, n, t) { return No.render(e, t); }); const Io = '_qrcode_izshm_1', So = '_qrcodeCanvas_izshm_4', To = '_qrcodeLogo_izshm_8', bo = '_small_izshm_18', ee = { qrcode: Io, qrcodeCanvas: So, qrcodeLogo: To, small: bo }, Po = G({ props: { text: { type: String, default: '' }, size: { type: String, default: '200px' }, logoSize: { type: String, default: 'default' } }, setup(e) { const n = Oe(), t = () => { Z.toCanvas(n.value, e.text, { margin: 1 }, s => { s && console.log(s), console.log('success'); }); }; return ( st( () => e.text, () => { t(); } ), je(() => { at(() => { t(); }); }), () => l( 'div', { class: ee.qrcode, style: { width: e.size, height: e.size } }, [ l('canvas', { ref: n, class: ee.qrcodeCanvas }, null), l( 'img', { src: Rn, class: [ee.qrcodeLogo, e.logoSize === 'small' && ee.small] }, null ) ] ) ); } }), Fo = G({ name: 'qrcode-payment', props: { url: { type: String, default: '' }, pay_channel: { type: String, default: 'wx_pub' }, orderType: { type: String, default: '' } }, setup(e) { return () => l('div', { class: [M.saveShareImage] }, [ l('div', { class: [M.shareContaienr] }, [ l('div', { class: M.schoolName }, [ e.orderType === 'VIP' ? '会员购买' : '报名缴费' ]), l('div', { class: M.shareType }, [ B('请截图下方二维码'), l('span', null, [ B('登录'), e.pay_channel === 'wx_pub' ? '微信' : '支付宝', B('扫码支付') ]) ]), l('div', { class: M.qrcodeSection }, [ l(Po, { text: e.url, logoSize: 'small', size: '100%' }, null) ]), l('div', { class: M.memo }, [B('请在30分钟内扫码支付')]) ]), l('div', { class: [M.tips] }, [ l('div', { class: M.tipsTitle }, [B('使用说明:')]), l('div', { class: M.tipsContent }, [ B('1.打开'), e.pay_channel === 'wx_pub' ? '微信' : '支付宝', B('扫一扫'), l('br', null, null), B('2.选择相册中的二维码'), l('br', null, null), B('3.请在30分钟内扫码支付') ]) ]) ]); } }), vo = e => { let n = 'qrCode'; return ( q().weixin ? e == 'alipay_qr' || e == 'alipay_wap' ? (n = 'qrCode') : e == 'wx_pub' && (n = 'pay') : q().alipay && e == 'alipay_wap' ? (n = 'pay') : (n = 'qrCode'), n == 'qrCode' ? 'payDefine' : 'payResult' ); }, Yo = G({ name: 'order-detail', setup() { const e = it(), n = Le(), t = qe({ paymentType: 'adapay', orderTimer: null, paymentStatus: !1, showQrcode: !1, qrCodeUrl: '', pay_channel: '', orderNo: e.query.orderNo, orderInfo: {}, goodsInfos: [], config: e.query.config ? JSON.parse(e.query.config) : {}, hasFreight: !e.query.hf, freight: '', agreeStatus: !0, showHeader: !1, authShow: !1, selectGoodsId: null, currentPrice: 0, dialogStatus: !1, dialogMessage: '', submitStatus: !1 }), s = Ue(() => t.orderInfo.orderType), o = Oe({}), r = async () => { try { const { data: c } = await O.get( '/edu-app/userPaymentOrder/detail/' + t.orderNo ), m = c.goodsInfos || []; t.orderInfo = c; let g = !1; m.forEach(C => { const p = C.goodsUrl ? C.goodsUrl.split(',')[0] : ''; (C.goodsUrl = p), C.goodsType === 'INSTRUMENTS' && (g = !0); }), (t.goodsInfos = m), o.value.id || (o.value = c.addresses || {}), g ? (t.freight = '到付') : (t.freight = '免运费'), c.status !== 'WAIT_PAY' && c.status !== 'PAYING' && ((t.dialogStatus = !0), (t.dialogMessage = '订单' + An[c.status])); } catch (c) {} }, a = c => { const m = t.config; t.pay_channel = c.pay_channel; const g = gt.stringify({ pay_channel: c.pay_channel, wxAppId: m.wxAppId, body: m.body, price: m.price, orderNo: m.merOrderNo, userId: m.userId }); c.payCode === 'payResult' ? (window.location.href = window.location.origin + '/classroom-app/#/payResult?' + g) : ((t.qrCodeUrl = window.location.origin + '/classroom-app/#/payDefine?' + g), (t.showQrcode = !0), (t.paymentStatus = !1), setTimeout(() => { u(); }, 300)); }, u = async () => { const c = setInterval(async () => { if (e.name != 'order-detail') { clearInterval(c); return; } t.orderTimer = c; try { const { data: m } = await O.post( '/edu-app/open/userOrder/paymentStatus/' + t.orderNo, { hideLoading: !0 } ); m.status !== 'WAIT_PAY' && m.status !== 'PAYING' && ((t.showQrcode = !1), clearInterval(t.orderTimer), setTimeout(() => { y(); }, 100)); } catch (m) { clearInterval(t.orderTimer); } }, 5e3); }, i = async () => { clearInterval(t.orderTimer), s.value === 'VIP' ? f(d) : A(d); }, d = () => { const c = t.pay_channel; if (c) { const m = vo(t.pay_channel); a({ payCode: m, pay_channel: c }); } else s.value === 'VIP' ? (t.paymentStatus = !0) : a({ payCode: 'payResult', pay_channel: 'wx_pub' }); }, f = async c => { try { if (!t.agreeStatus) { le('请先阅读并同意《音乐数字课堂服务协议》'); return; } const m = Y.user.data; if ( !(m != null && m.account.realName) || !(m != null && m.account.idCardNo) ) { t.authShow = !0; return; } t.submitStatus = !0; const { data: g } = await O.post( '/edu-app/userPaymentOrder/updateReceiveAddress', { hideLoading: !1, data: { orderNo: t.orderNo, orderType: 'VIP' } } ); (t.pay_channel = g.paymentChannel), g.status !== 'WAIT_PAY' && g.status !== 'PAYING' ? n.replace({ path: '/payment-result', query: { orderNo: t.orderNo } }) : (c && c(), (t.submitStatus = !1)); } catch (m) { t.submitStatus = !1; } }, A = async c => { if (!o.value.id) { le('请选择收货地址'); return; } if (!t.agreeStatus) { le('请先阅读并同意《音乐数字课堂服务协议》'); return; } const m = Y.user.data; if ( !(m != null && m.account.realName) || !(m != null && m.account.idCardNo) ) { t.authShow = !0; return; } t.submitStatus = !0; try { const { data: g } = await O.post( '/edu-app/userPaymentOrder/updateReceiveAddress', { hideLoading: !1, data: { orderNo: t.orderNo, orderType: 'SCHOOL_REGISTER', receiveAddress: o.value.id } } ); (t.pay_channel = g.paymentChannel), g.status !== 'WAIT_PAY' && g.status !== 'PAYING' ? y() : (c && c(), (t.submitStatus = !1)); } catch (g) { t.submitStatus = !1; } }, y = () => { n.replace({ path: '/payment-result', query: { orderNo: t.orderNo } }); }, h = async () => { try { await O.post( '/edu-app/userPaymentOrder/cancelPayment/' + t.orderNo ), n.back(); } catch (c) {} }, _ = () => { (t.authShow = !1), i(); }; return ( je(() => { q().isApp ? (t.showHeader = !0) : (t.showHeader = !1); let c = sessionStorage.getItem('addressDetails'); (c = c ? JSON.parse(c) : {}), (o.value = c), sessionStorage.removeItem('addressDetails'), r(); }), () => l(pe, null, [ q().isApp && l(ke, { border: !1 }, null), l('div', { class: I.cartConfirm }, [ s.value === 'SCHOOL_REGISTER' && l('div', { class: I.cartConfirmBox }, [ l(an, { item: o.value }, null) ]), l( Be, { style: { margin: 0 } }, { default: () => [ t.goodsInfos && t.goodsInfos.map(c => l( j, { class: I.cellItem }, { icon: () => l(mt, { class: I.img, src: c.goodsUrl }, null), title: () => l('div', { class: I.goodsContent }, [ l('h2', null, [ l('span', null, [c.goodsName]), l('span', { class: I.goodsNum }, [ B('x '), c.goodsNum ]) ]), l('div', { class: I.goodsPrice }, [ l( ze, { class: I.brandName }, { default: () => [ c.goodsType === 'VIP' ? '12个月' : c.brandName ] } ), l( 'span', { class: [ I.goodsNums, c.paymentCashAmount > 0 ? I.numFont : I.free ] }, [ c.paymentCashAmount > 0 ? l(pe, null, [ l('span', { class: I.numPrefix }, [ B('¥ ') ]), ye(c.paymentCashAmount) ]) : '免费' ] ) ]), l('p', { class: I.model }, [c.description]) ]) } ) ) ] } ), s.value === 'SCHOOL_REGISTER' && l( j, { class: I.freight, title: '运费', value: t.freight }, null ) ]), l( ut, { position: 'bottom' }, { default: () => [ l('div', { class: I.protocol }, [ l( ct, { modelValue: t.agreeStatus, 'onUpdate:modelValue': c => (t.agreeStatus = c), showHeader: t.showHeader, style: { paddingTop: 0, paddingBottom: 0 } }, null ) ]), l('div', { class: I.paymentContainer }, [ l('div', { class: I.payemntPrice }, [ l('p', { class: I.needPrice }, [ B('支付金额:'), l('span', null, [ l('i', null, [B('¥')]), ye(t.orderInfo.currentPrice) ]) ]) ]), l('div', { class: I.paymentBtn }, [ l( Ae, { round: !0, class: [I.submitBtn], onClick: i, loading: t.submitStatus, disabled: t.submitStatus }, { default: () => [B('提交')] } ) ]) ]) ] } ), l( Pe, { show: t.paymentStatus, closeOnClickOverlay: !1, position: 'bottom', round: !0, closeOnPopstate: !0, safeAreaInsetBottom: !0, style: { minHeight: '30%' } }, { default: () => [ l( pn, { paymentConfig: t.orderInfo, onClose: () => (t.paymentStatus = !1), onBackOut: h, onConfirm: c => a(c) }, null ) ] } ), l( Pe, { show: t.showQrcode, 'onUpdate:show': c => (t.showQrcode = c), round: !0, onClose: () => { clearInterval(t.orderTimer); } }, { default: () => [ l( Fo, { url: t.qrCodeUrl, pay_channel: t.pay_channel, orderType: s.value }, null ) ] } ), l( dt, { modelValue: t.authShow, 'onUpdate:modelValue': c => (t.authShow = c) }, { default: () => [ l(En, { onSuccess: _, hideHeader: !q().isApp }, null) ] } ), l( ht, { title: '提示', show: t.dialogStatus, 'onUpdate:show': c => (t.dialogStatus = c), message: t.dialogMessage, confirmButtonText: '确定', onConfirm: () => { y(); } }, null ) ]) ); } }); export { Yo as default };