niucloud-admin/niucloud/public/admin/assets/preview-e34595d2.js
2023-10-26 17:26:46 +08:00

9 lines
28 KiB
JavaScript

import"./base-0e92f4db.js";import{a as Jt,E as Ot}from"./el-form-item-c2dd2ffe.js";/* empty css *//* empty css *//* empty css *//* empty css */import{a3 as $t,v as j}from"./event-a537c4cb.js";import{t as T}from"./index-8f29cb04.js";import{u as Yt}from"./vue-router-8b032575.js";import{g as qt}from"./weapp-e343d68c.js";import{S as jt}from"./index-9033603c.js";import{c as Gt,a as Qt}from"./common-46715e7e.js";import{a as st}from"./index-e9d9b1a1.js";import{E as Wt}from"./index-8cefa3ab.js";import{E as Zt}from"./index-e09a20f5.js";import{E as Xt}from"./index-2b1dc445.js";import{d as te,r as U,M as ee,w as ne,b as G,e as _t,f as S,L as Q,x,u as M,q as P,p as D,v as bt,m as At,C as oe}from"./runtime-core.esm-bundler-67034826.js";import"./index-72686045.js";import"./index-81f2aa1e.js";import"./el-main-7a89c415.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./index-ebd2990f.js";import"./el-overlay-3eff2fc5.js";import"./index-defed8ff.js";import"./focus-trap-83769a43.js";import"./index-6cae7119.js";import"./index-d87ae4a2.js";/* empty css */import"./index-ef31373f.js";import"./index-de22cd40.js";import"./index-c7745eb3.js";import"./debounce-f6ba9d12.js";import"./position-c2e84b2a.js";var Y={},re=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},vt={},I={};let wt;const ie=[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(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};I.getSymbolTotalCodewords=function(t){return ie[t]};I.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};I.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');wt=t};I.isKanjiModeEnabled=function(){return typeof wt<"u"};I.toSJIS=function(t){return wt(t)};var et={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.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: "+i)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,o){if(e.isValid(r))return r;try{return t(r)}catch{return o}}})(et);function St(){this.buffer=[],this.length=0}St.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 i=0;i<t;i++)this.putBit((e>>>t-i-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 se=St;function q(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)}q.prototype.set=function(e,t,i,r){const o=e*this.size+t;this.data[o]=i,r&&(this.reservedBit[o]=!0)};q.prototype.get=function(e,t){return this.data[e*this.size+t]};q.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};q.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var ae=q,Mt={};(function(e){const t=I.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,n=t(r),s=n===145?26:Math.ceil((n-13)/(2*o-2))*2,u=[n-7];for(let a=1;a<o-1;a++)u[a]=u[a-1]-s;return u.push(6),u.reverse()},e.getPositions=function(r){const o=[],n=e.getRowColCoords(r),s=n.length;for(let u=0;u<s;u++)for(let a=0;a<s;a++)u===0&&a===0||u===0&&a===s-1||u===s-1&&a===0||o.push([n[u],n[a]]);return o}})(Mt);var Pt={};const ue=I.getSymbolSize,It=7;Pt.getPositions=function(t){const i=ue(t);return[[0,0],[i-It,0],[0,i-It]]};var Rt={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={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 n=o.size;let s=0,u=0,a=0,l=null,c=null;for(let B=0;B<n;B++){u=a=0,l=c=null;for(let m=0;m<n;m++){let g=o.get(B,m);g===l?u++:(u>=5&&(s+=t.N1+(u-5)),l=g,u=1),g=o.get(m,B),g===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=g,a=1)}u>=5&&(s+=t.N1+(u-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(o){const n=o.size;let s=0;for(let u=0;u<n-1;u++)for(let a=0;a<n-1;a++){const l=o.get(u,a)+o.get(u,a+1)+o.get(u+1,a)+o.get(u+1,a+1);(l===4||l===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const n=o.size;let s=0,u=0,a=0;for(let l=0;l<n;l++){u=a=0;for(let c=0;c<n;c++)u=u<<1&2047|o.get(l,c),c>=10&&(u===1488||u===93)&&s++,a=a<<1&2047|o.get(c,l),c>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let n=0;const s=o.data.length;for(let a=0;a<s;a++)n+=o.data[a];return Math.abs(Math.ceil(n*100/s/5)-10)*t.N4};function i(r,o,n){switch(r){case e.Patterns.PATTERN000:return(o+n)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return n%3===0;case e.Patterns.PATTERN011:return(o+n)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(n/3))%2===0;case e.Patterns.PATTERN101:return o*n%2+o*n%3===0;case e.Patterns.PATTERN110:return(o*n%2+o*n%3)%2===0;case e.Patterns.PATTERN111:return(o*n%3+(o+n)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(o,n){const s=n.size;for(let u=0;u<s;u++)for(let a=0;a<s;a++)n.isReserved(a,u)||n.xor(a,u,i(o,a,u))},e.getBestMask=function(o,n){const s=Object.keys(e.Patterns).length;let u=0,a=1/0;for(let l=0;l<s;l++){n(l),e.applyMask(l,o);const c=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(l,o),c<a&&(a=c,u=l)}return u}})(Rt);var nt={};const F=et,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],Z=[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];nt.getBlocksCount=function(t,i){switch(i){case F.L:return W[(t-1)*4+0];case F.M:return W[(t-1)*4+1];case F.Q:return W[(t-1)*4+2];case F.H:return W[(t-1)*4+3];default:return}};nt.getTotalCodewordsCount=function(t,i){switch(i){case F.L:return Z[(t-1)*4+0];case F.M:return Z[(t-1)*4+1];case F.Q:return Z[(t-1)*4+2];case F.H:return Z[(t-1)*4+3];default:return}};var Lt={},ot={};const O=new Uint8Array(512),X=new Uint8Array(256);(function(){let t=1;for(let i=0;i<255;i++)O[i]=t,X[t]=i,t<<=1,t&256&&(t^=285);for(let i=255;i<512;i++)O[i]=O[i-255]})();ot.log=function(t){if(t<1)throw new Error("log("+t+")");return X[t]};ot.exp=function(t){return O[t]};ot.mul=function(t,i){return t===0||i===0?0:O[X[t]+X[i]]};(function(e){const t=ot;e.mul=function(r,o){const n=new Uint8Array(r.length+o.length-1);for(let s=0;s<r.length;s++)for(let u=0;u<o.length;u++)n[s+u]^=t.mul(r[s],o[u]);return n},e.mod=function(r,o){let n=new Uint8Array(r);for(;n.length-o.length>=0;){const s=n[0];for(let a=0;a<o.length;a++)n[a]^=t.mul(o[a],s);let u=0;for(;u<n.length&&n[u]===0;)u++;n=n.slice(u)}return n},e.generateECPolynomial=function(r){let o=new Uint8Array([1]);for(let n=0;n<r;n++)o=e.mul(o,new Uint8Array([1,t.exp(n)]));return o}})(Lt);const Dt=Lt;function yt(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}yt.prototype.initialize=function(t){this.degree=t,this.genPoly=Dt.generateECPolynomial(this.degree)};yt.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(t.length+this.degree);i.set(t);const r=Dt.mod(i,this.genPoly),o=this.degree-r.length;if(o>0){const n=new Uint8Array(this.degree);return n.set(r,o),n}return r};var le=yt,Ut={},k={},Et={};Et.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var R={};const Ft="[0-9]+",ce="[A-Z $%*+\\-./:]+";let $="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";$=$.replace(/u/g,"\\u");const fe="(?:(?![A-Z0-9 $%*+\\-./:]|"+$+`)(?:.|[\r
]))+`;R.KANJI=new RegExp($,"g");R.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");R.BYTE=new RegExp(fe,"g");R.NUMERIC=new RegExp(Ft,"g");R.ALPHANUMERIC=new RegExp(ce,"g");const de=new RegExp("^"+$+"$"),ge=new RegExp("^"+Ft+"$"),he=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");R.testKanji=function(t){return de.test(t)};R.testNumeric=function(t){return ge.test(t)};R.testAlphanumeric=function(t){return he.test(t)};(function(e){const t=Et,i=R;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,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 i.testNumeric(n)?e.NUMERIC:i.testAlphanumeric(n)?e.ALPHANUMERIC:i.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 r(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(n,s){if(e.isValid(n))return n;try{return r(n)}catch{return s}}})(k);(function(e){const t=I,i=nt,r=et,o=k,n=Et,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,u=t.getBCHDigit(s);function a(m,g,w){for(let y=1;y<=40;y++)if(g<=e.getCapacity(y,w,m))return y}function l(m,g){return o.getCharCountIndicator(m,g)+4}function c(m,g){let w=0;return m.forEach(function(y){const b=l(y.mode,g);w+=b+y.getBitsLength()}),w}function B(m,g){for(let w=1;w<=40;w++)if(c(m,w)<=e.getCapacity(w,g,o.MIXED))return w}e.from=function(g,w){return n.isValid(g)?parseInt(g,10):w},e.getCapacity=function(g,w,y){if(!n.isValid(g))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=o.BYTE);const b=t.getSymbolTotalCodewords(g),p=i.getTotalCodewordsCount(g,w),h=(b-p)*8;if(y===o.MIXED)return h;const f=h-l(y,g);switch(y){case o.NUMERIC:return Math.floor(f/10*3);case o.ALPHANUMERIC:return Math.floor(f/11*2);case o.KANJI:return Math.floor(f/13);case o.BYTE:default:return Math.floor(f/8)}},e.getBestVersionForData=function(g,w){let y;const b=r.from(w,r.M);if(Array.isArray(g)){if(g.length>1)return B(g,b);if(g.length===0)return 1;y=g[0]}else y=g;return a(y.mode,y.getLength(),b)},e.getEncodedBits=function(g){if(!n.isValid(g)||g<7)throw new Error("Invalid QR Code version");let w=g<<12;for(;t.getBCHDigit(w)-u>=0;)w^=s<<t.getBCHDigit(w)-u;return g<<12|w}})(Ut);var kt={};const dt=I,xt=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,me=1<<14|1<<12|1<<10|1<<4|1<<1,Tt=dt.getBCHDigit(xt);kt.getEncodedBits=function(t,i){const r=t.bit<<3|i;let o=r<<10;for(;dt.getBCHDigit(o)-Tt>=0;)o^=xt<<dt.getBCHDigit(o)-Tt;return(r<<10|o)^me};var Vt={};const pe=k;function V(e){this.mode=pe.NUMERIC,this.data=e.toString()}V.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};V.prototype.getLength=function(){return this.data.length};V.prototype.getBitsLength=function(){return V.getBitsLength(this.data.length)};V.prototype.write=function(t){let i,r,o;for(i=0;i+3<=this.data.length;i+=3)r=this.data.substr(i,3),o=parseInt(r,10),t.put(o,10);const n=this.data.length-i;n>0&&(r=this.data.substr(i),o=parseInt(r,10),t.put(o,n*3+1))};var we=V;const ye=k,at=["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 z(e){this.mode=ye.ALPHANUMERIC,this.data=e}z.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};z.prototype.getLength=function(){return this.data.length};z.prototype.getBitsLength=function(){return z.getBitsLength(this.data.length)};z.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let r=at.indexOf(this.data[i])*45;r+=at.indexOf(this.data[i+1]),t.put(r,11)}this.data.length%2&&t.put(at.indexOf(this.data[i]),6)};var Ee=z,Ce=function(t){for(var i=[],r=t.length,o=0;o<r;o++){var n=t.charCodeAt(o);if(n>=55296&&n<=56319&&r>o+1){var s=t.charCodeAt(o+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,o+=1)}if(n<128){i.push(n);continue}if(n<2048){i.push(n>>6|192),i.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){i.push(n>>12|224),i.push(n>>6&63|128),i.push(n&63|128);continue}if(n>=65536&&n<=1114111){i.push(n>>18|240),i.push(n>>12&63|128),i.push(n>>6&63|128),i.push(n&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const Be=Ce,_e=k;function H(e){this.mode=_e.BYTE,typeof e=="string"&&(e=Be(e)),this.data=new Uint8Array(e)}H.getBitsLength=function(t){return t*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 t=0,i=this.data.length;t<i;t++)e.put(this.data[t],8)};var be=H;const Ae=k,Ie=I;function K(e){this.mode=Ae.KANJI,this.data=e}K.getBitsLength=function(t){return t*13};K.prototype.getLength=function(){return this.data.length};K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)};K.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let i=Ie.toSJIS(this.data[t]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var Te=K,gt={},Ne={get exports(){return gt},set exports(e){gt=e}};(function(e){var t={single_source_shortest_paths:function(i,r,o){var n={},s={};s[r]=0;var u=t.PriorityQueue.make();u.push(r,0);for(var a,l,c,B,m,g,w,y,b;!u.empty();){a=u.pop(),l=a.value,B=a.cost,m=i[l]||{};for(c in m)m.hasOwnProperty(c)&&(g=m[c],w=B+g,y=s[c],b=typeof s[c]>"u",(b||y>w)&&(s[c]=w,u.push(c,w),n[c]=l))}if(typeof o<"u"&&typeof s[o]>"u"){var p=["Could not find a path from ",r," to ",o,"."].join("");throw new Error(p)}return n},extract_shortest_path_from_predecessor_list:function(i,r){for(var o=[],n=r;n;)o.push(n),i[n],n=i[n];return o.reverse(),o},find_path:function(i,r,o){var n=t.single_source_shortest_paths(i,r,o);return t.extract_shortest_path_from_predecessor_list(n,o)},PriorityQueue:{make:function(i){var r=t.PriorityQueue,o={},n;i=i||{};for(n in r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=i.sorter||r.default_sorter,o},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var o={value:i,cost:r};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Ne);(function(e){const t=k,i=we,r=Ee,o=be,n=Te,s=R,u=I,a=gt;function l(p){return unescape(encodeURIComponent(p)).length}function c(p,h,f){const d=[];let E;for(;(E=p.exec(f))!==null;)d.push({data:E[0],index:E.index,mode:h,length:E[0].length});return d}function B(p){const h=c(s.NUMERIC,t.NUMERIC,p),f=c(s.ALPHANUMERIC,t.ALPHANUMERIC,p);let d,E;return u.isKanjiModeEnabled()?(d=c(s.BYTE,t.BYTE,p),E=c(s.KANJI,t.KANJI,p)):(d=c(s.BYTE_KANJI,t.BYTE,p),E=[]),h.concat(f,d,E).sort(function(_,A){return _.index-A.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function m(p,h){switch(h){case t.NUMERIC:return i.getBitsLength(p);case t.ALPHANUMERIC:return r.getBitsLength(p);case t.KANJI:return n.getBitsLength(p);case t.BYTE:return o.getBitsLength(p)}}function g(p){return p.reduce(function(h,f){const d=h.length-1>=0?h[h.length-1]:null;return d&&d.mode===f.mode?(h[h.length-1].data+=f.data,h):(h.push(f),h)},[])}function w(p){const h=[];for(let f=0;f<p.length;f++){const d=p[f];switch(d.mode){case t.NUMERIC:h.push([d,{data:d.data,mode:t.ALPHANUMERIC,length:d.length},{data:d.data,mode:t.BYTE,length:d.length}]);break;case t.ALPHANUMERIC:h.push([d,{data:d.data,mode:t.BYTE,length:d.length}]);break;case t.KANJI:h.push([d,{data:d.data,mode:t.BYTE,length:l(d.data)}]);break;case t.BYTE:h.push([{data:d.data,mode:t.BYTE,length:l(d.data)}])}}return h}function y(p,h){const f={},d={start:{}};let E=["start"];for(let C=0;C<p.length;C++){const _=p[C],A=[];for(let N=0;N<_.length;N++){const v=_[N],J=""+C+N;A.push(J),f[J]={node:v,lastCount:0},d[J]={};for(let it=0;it<E.length;it++){const L=E[it];f[L]&&f[L].node.mode===v.mode?(d[L][J]=m(f[L].lastCount+v.length,v.mode)-m(f[L].lastCount,v.mode),f[L].lastCount+=v.length):(f[L]&&(f[L].lastCount=v.length),d[L][J]=m(v.length,v.mode)+4+t.getCharCountIndicator(v.mode,h))}}E=A}for(let C=0;C<E.length;C++)d[E[C]].end=0;return{map:d,table:f}}function b(p,h){let f;const d=t.getBestModeForData(p);if(f=t.from(h,d),f!==t.BYTE&&f.bit<d.bit)throw new Error('"'+p+'" cannot be encoded with mode '+t.toString(f)+`.
Suggested mode is: `+t.toString(d));switch(f===t.KANJI&&!u.isKanjiModeEnabled()&&(f=t.BYTE),f){case t.NUMERIC:return new i(p);case t.ALPHANUMERIC:return new r(p);case t.KANJI:return new n(p);case t.BYTE:return new o(p)}}e.fromArray=function(h){return h.reduce(function(f,d){return typeof d=="string"?f.push(b(d,null)):d.data&&f.push(b(d.data,d.mode)),f},[])},e.fromString=function(h,f){const d=B(h,u.isKanjiModeEnabled()),E=w(d),C=y(E,f),_=a.find_path(C.map,"start","end"),A=[];for(let N=1;N<_.length-1;N++)A.push(C.table[_[N]].node);return e.fromArray(g(A))},e.rawSplit=function(h){return e.fromArray(B(h,u.isKanjiModeEnabled()))}})(Vt);const rt=I,ut=et,ve=se,Se=ae,Me=Mt,Pe=Pt,ht=Rt,mt=nt,Re=le,tt=Ut,Le=kt,De=k,lt=Vt;function Ue(e,t){const i=e.size,r=Pe.getPositions(t);for(let o=0;o<r.length;o++){const n=r[o][0],s=r[o][1];for(let u=-1;u<=7;u++)if(!(n+u<=-1||i<=n+u))for(let a=-1;a<=7;a++)s+a<=-1||i<=s+a||(u>=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 Fe(e){const t=e.size;for(let i=8;i<t-8;i++){const r=i%2===0;e.set(i,6,r,!0),e.set(6,i,r,!0)}}function ke(e,t){const i=Me.getPositions(t);for(let r=0;r<i.length;r++){const o=i[r][0],n=i[r][1];for(let s=-2;s<=2;s++)for(let u=-2;u<=2;u++)s===-2||s===2||u===-2||u===2||s===0&&u===0?e.set(o+s,n+u,!0,!0):e.set(o+s,n+u,!1,!0)}}function xe(e,t){const i=e.size,r=tt.getEncodedBits(t);let o,n,s;for(let u=0;u<18;u++)o=Math.floor(u/3),n=u%3+i-8-3,s=(r>>u&1)===1,e.set(o,n,s,!0),e.set(n,o,s,!0)}function ct(e,t,i){const r=e.size,o=Le.getEncodedBits(t,i);let n,s;for(n=0;n<15;n++)s=(o>>n&1)===1,n<6?e.set(n,8,s,!0):n<8?e.set(n+1,8,s,!0):e.set(r-15+n,8,s,!0),n<8?e.set(8,r-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(r-8,8,1,!0)}function Ve(e,t){const i=e.size;let r=-1,o=i-1,n=7,s=0;for(let u=i-1;u>0;u-=2)for(u===6&&u--;;){for(let a=0;a<2;a++)if(!e.isReserved(o,u-a)){let l=!1;s<t.length&&(l=(t[s]>>>n&1)===1),e.set(o,u-a,l),n--,n===-1&&(s++,n=7)}if(o+=r,o<0||i<=o){o-=r,r=-r;break}}}function ze(e,t,i){const r=new ve;i.forEach(function(a){r.put(a.mode.bit,4),r.put(a.getLength(),De.getCharCountIndicator(a.mode,e)),a.write(r)});const o=rt.getSymbolTotalCodewords(e),n=mt.getTotalCodewordsCount(e,t),s=(o-n)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const u=(s-r.getLengthInBits())/8;for(let a=0;a<u;a++)r.put(a%2?17:236,8);return He(r,e,t)}function He(e,t,i){const r=rt.getSymbolTotalCodewords(t),o=mt.getTotalCodewordsCount(t,i),n=r-o,s=mt.getBlocksCount(t,i),u=r%s,a=s-u,l=Math.floor(r/s),c=Math.floor(n/s),B=c+1,m=l-c,g=new Re(m);let w=0;const y=new Array(s),b=new Array(s);let p=0;const h=new Uint8Array(e.buffer);for(let _=0;_<s;_++){const A=_<a?c:B;y[_]=h.slice(w,w+A),b[_]=g.encode(y[_]),w+=A,p=Math.max(p,A)}const f=new Uint8Array(r);let d=0,E,C;for(E=0;E<p;E++)for(C=0;C<s;C++)E<y[C].length&&(f[d++]=y[C][E]);for(E=0;E<m;E++)for(C=0;C<s;C++)f[d++]=b[C][E];return f}function Ke(e,t,i,r){let o;if(Array.isArray(e))o=lt.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){const c=lt.rawSplit(e);l=tt.getBestVersionForData(c,i)}o=lt.fromString(e,l||40)}else throw new Error("Invalid data");const n=tt.getBestVersionForData(o,i);if(!n)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=n;else if(t<n)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+n+`.
`);const s=ze(t,i,o),u=rt.getSymbolSize(t),a=new Se(u);return Ue(a,t),Fe(a),ke(a,t),ct(a,i,0),t>=7&&xe(a,t),Ve(a,s),isNaN(r)&&(r=ht.getBestMask(a,ct.bind(null,a,i))),ht.applyMask(r,a),ct(a,i,r),{modules:a,version:t,errorCorrectionLevel:i,maskPattern:r,segments:o}}vt.create=function(t,i){if(typeof t>"u"||t==="")throw new Error("No input text");let r=ut.M,o,n;return typeof i<"u"&&(r=ut.from(i.errorCorrectionLevel,ut.M),o=tt.from(i.version),n=ht.from(i.maskPattern),i.toSJISFunc&&rt.setToSJISFunction(i.toSJISFunc)),Ke(t,o,r,n)};var zt={},Ct={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(n){return[n,n]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,n=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:n,scale:n?4:s,margin:o,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},e.getImageWidth=function(r,o){const n=e.getScale(r,o);return Math.floor((r+o.margin*2)*n)},e.qrToImageData=function(r,o,n){const s=o.modules.size,u=o.modules.data,a=e.getScale(s,n),l=Math.floor((s+n.margin*2)*a),c=n.margin*a,B=[n.color.light,n.color.dark];for(let m=0;m<l;m++)for(let g=0;g<l;g++){let w=(m*l+g)*4,y=n.color.light;if(m>=c&&g>=c&&m<l-c&&g<l-c){const b=Math.floor((m-c)/a),p=Math.floor((g-c)/a);y=B[u[b*s+p]?1:0]}r[w++]=y.r,r[w++]=y.g,r[w++]=y.b,r[w]=y.a}}})(Ct);(function(e){const t=Ct;function i(o,n,s){o.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=s,n.width=s,n.style.height=s+"px",n.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(n,s,u){let a=u,l=s;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(l=r()),a=t.getOptions(a);const c=t.getImageWidth(n.modules.size,a),B=l.getContext("2d"),m=B.createImageData(c,c);return t.qrToImageData(m.data,n,a),i(B,l,c),B.putImageData(m,0,0),l},e.renderToDataURL=function(n,s,u){let a=u;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const l=e.render(n,s,a),c=a.type||"image/png",B=a.rendererOpts||{};return l.toDataURL(c,B.quality)}})(zt);var Ht={};const Je=Ct;function Nt(e,t){const i=e.a/255,r=t+'="'+e.hex+'"';return i<1?r+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':r}function ft(e,t,i){let r=e+t;return typeof i<"u"&&(r+=" "+i),r}function Oe(e,t,i){let r="",o=0,n=!1,s=0;for(let u=0;u<e.length;u++){const a=Math.floor(u%t),l=Math.floor(u/t);!a&&!n&&(n=!0),e[u]?(s++,u>0&&a>0&&e[u-1]||(r+=n?ft("M",a+i,.5+l+i):ft("m",o,0),o=0,n=!1),a+1<t&&e[u+1]||(r+=ft("h",s),s=0)):o++}return r}Ht.render=function(t,i,r){const o=Je.getOptions(i),n=t.modules.size,s=t.modules.data,u=n+o.margin*2,a=o.color.light.a?"<path "+Nt(o.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",l="<path "+Nt(o.color.dark,"stroke")+' d="'+Oe(s,n,o.margin)+'"/>',c='viewBox="0 0 '+u+" "+u+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+c+' shape-rendering="crispEdges">'+a+l+`</svg>
`;return typeof r=="function"&&r(null,m),m};const $e=re,pt=vt,Kt=zt,Ye=Ht;function Bt(e,t,i,r,o){const n=[].slice.call(arguments,1),s=n.length,u=typeof n[s-1]=="function";if(!u&&!$e())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(o=i,i=t,t=r=void 0):s===3&&(t.getContext&&typeof o>"u"?(o=r,r=void 0):(o=r,r=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=r=void 0):s===2&&!t.getContext&&(r=i,i=t,t=void 0),new Promise(function(a,l){try{const c=pt.create(i,r);a(e(c,t,r))}catch(c){l(c)}})}try{const a=pt.create(i,r);o(null,e(a,t,r))}catch(a){o(a)}}Y.create=pt.create;Y.toCanvas=Bt.bind(null,Kt.render);Y.toDataURL=Bt.bind(null,Kt.renderToDataURL);Y.toString=Bt.bind(null,function(e,t,i){return Ye.render(e,i)});const qe={class:"main-container w-[375px] mx-auto mt-[20px] mb-[40px] relative"},je={class:"flex h-full"},Ge=["src"],Qe={class:"w-[375px] border border-slate-100 bg-body pt-[20px] px-[20px]"},We={class:"font-bold text-xl mb-[40px]"},Ze={class:"mb-[20px] flex flex-col"},Xe={class:"mb-[10px]"},tn={key:0,class:"w-[400px] absolute bg-body top-[10%] -right-[450px]"},en={class:"info-wrap mt-[20px]"},nn={class:"px-[20px] pb-[10px] font-bold"},on={class:"px-[20px] pb-[10px] font-bold mt-[40px]"},rn={class:"text-gray-400"},Vn=te({__name:"preview",setup(e){const t=U(""),i=U(""),r=U(""),o=U(""),n=U(!1),s=U(!1),u=U(0),a=U(0);new Date().getTime();const l=Yt();l.query.page=l.query.page||"",jt().then(h=>{t.value=h.data.wap_url,B()});const c=()=>{if(i.value.trim().length==0){st({type:"warning",message:`${T("wapDomainPlaceholder")}`});return}t.value=i.value+"/wap",B(),Qt.set({key:"wap_domain",data:t.value}),n.value=!0,s.value=!1},B=()=>{l.query.page&&(o.value=`${t.value}${l.query.page}`,Y.toDataURL(o.value,{errorCorrectionLevel:"L",margin:0,width:100}).then(h=>{r.value=h}),u.value=new Date().getTime(),setTimeout(()=>{a.value==0&&m()},1e3*2))};window.addEventListener("message",h=>{try{let d=JSON.parse(h.data);if(["appOnLaunch","appOnReady"].indexOf(d.type)!=-1){s.value=!1,n.value=!0;var f=new Date().getTime();a.value=f-u.value}}catch(d){m(),console.log("后台接受数据错误",d)}},!1);const m=()=>{s.value=!0,n.value=!1,o.value="",r.value=""},g=ee({qr_code:""});qt().then(h=>{if(h.code==1){let f=h.data;g.qr_code=f.qr_code}});const{copy:w,isSupported:y,copied:b}=$t(),p=h=>{y.value||st({message:T("notSupportCopy"),type:"warning"}),w(h)};return ne(b,()=>{b.value&&st({message:T("copySuccess"),type:"success"})}),(h,f)=>{const d=Wt,E=Zt,C=Jt,_=Xt,A=Ot;return G(),_t("div",qe,[S("div",je,[Q(S("iframe",{class:"w-[375px]",src:o.value,frameborder:"0",id:"previewIframe"},null,8,Ge),[[j,n.value]]),Q(S("div",Qe,[S("div",We,x(M(T)("developTitle")),1),S("div",Ze,[S("text",Xe,x(M(T)("wapDomain")),1),P(d,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=N=>i.value=N),placeholder:M(T)("wapDomainPlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),P(E,{type:"primary",onClick:c},{default:D(()=>[bt(x(M(T)("confirm")),1)]),_:1})],512),[[j,s.value]]),n.value?(G(),_t("div",tn,[S("div",en,[S("div",nn,x(M(T)("h5")),1),P(A,{"label-width":"40px",class:"px-[20px]"},{default:D(()=>[Q(P(C,{label:M(T)("link")},{default:D(()=>[P(d,{readonly:"",value:o.value},{append:D(()=>[P(E,{onClick:f[1]||(f[1]=N=>p(o.value)),class:"bg-primary copy"},{default:D(()=>[bt(x(M(T)("copy")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),[[j,o.value]]),Q(P(C,{label:" "},{default:D(()=>[P(_,{src:r.value},null,8,["src"])]),_:1},512),[[j,r.value]])]),_:1}),S("div",on,x(M(T)("weapp")),1),P(A,{"label-width":"40px",class:"px-[20px]"},{default:D(()=>[g.qr_code?(G(),At(C,{key:0,label:" "},{default:D(()=>[P(_,{class:"w-[100px] h-[100px]",src:M(Gt)(g.qr_code)},null,8,["src"])]),_:1})):(G(),At(C,{key:1,label:" "},{default:D(()=>[S("span",rn,x(M(T)("weappNotSet")),1)]),_:1}))]),_:1})])])):oe("",!0)])])}}});export{Vn as default};