import{c as G,d as Y,E as N,r as R,G as X,o as re,F as ae,H as ne,U as x,f as k,u as oe}from"./index-B-Ka-o3f.js";/** * @license lucide-vue-next v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pe=G("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** * @license lucide-vue-next v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ae=G("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-vue-next v0.535.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ne=G("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/*! * 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 D=function(){return D=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 s=[],i=0;i7)throw new RangeError("Invalid value");var h,m;for(h=r;;h++){var M=a.getNumDataCodewords(h,t)*8,w=v.getTotalBits(e,h);if(w<=M){m=w;break}if(h>=n)throw new RangeError("Data too long")}for(var p=0,S=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];p>>3]|=_<<7-(Q&7)}),new a(h,t,z,s)},a.prototype.getModule=function(e,t){return 0<=e&&e>>9)*1335;var s=(t<<10|r)^21522;f(s>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(s,n));this.setFunctionModule(8,7,l(s,6)),this.setFunctionModule(8,8,l(s,7)),this.setFunctionModule(7,8,l(s,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(s,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(s,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(s,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),s=this.size-11+t%3,i=Math.floor(t/3);this.setFunctionModule(s,i,n),this.setFunctionModule(i,s,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var s=Math.max(Math.abs(n),Math.abs(r)),i=e+n,h=t+r;0<=i&&i=h)&&E.push(I[y])})},p=0;p=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,s),r||(e+=this.finderPenaltyCountPatterns(s)*a.PENALTY_N3),r=this.modules[t][i],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,s)*a.PENALTY_N3}for(var i=0;i5&&e++):(this.finderPenaltyAddHistory(h,s),r||(e+=this.finderPenaltyCountPatterns(s)*a.PENALTY_N3),r=this.modules[t][i],h=1);e+=this.finderPenaltyTerminateAndCount(r,h,s)*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 v=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,v){return v=u.x+u.w?f:!1})})}var q={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:$,validator:function(o){return W(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"}},se=D(D({},q),{renderAs:{type:String,required:!1,default:"canvas",validator:function(o){return["canvas","svg"].indexOf(o)>-1}}}),le=Y({name:"QRCodeSvg",props:q,setup:function(o){var u=R(0),c=R(""),l,f=function(){var a=o.value,e=o.level,t=o.margin,r=t>>>0,n=W(e)?e:$,s=B.QrCode.encodeText(a,K[n]).getModules();if(u.value=s.length+r*2,o.imageSettings.src){var i=Z(s,o.size,r,o.imageSettings);l={x:i.x+r,y:i.y+r,width:i.w,height:i.h},i.excavation&&(s=j(s,i.excavation))}c.value=J(s,r)},v=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 N(o.gradientType==="linear"?"linearGradient":"radialGradient",D({id:"qr-gradient"},a),[N("stop",{offset:"0%",style:{stopColor:o.gradientStartColor}}),N("stop",{offset:"100%",style:{stopColor:o.gradientEndColor}})])};return f(),X(f),function(){return N("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)},[N("defs",{},[v()]),N("rect",{width:"100%",height:"100%",fill:o.background}),N("path",{fill:o.gradient?"url(#qr-gradient)":o.foreground,d:c.value}),o.imageSettings.src&&N("image",D({href:o.imageSettings.src},l))])}}}),ue=Y({name:"QRCodeCanvas",props:q,setup:function(o,u){var c=R(null),l=R(null),f=function(){var a=o.value,e=o.level,t=o.size,r=o.margin,n=o.background,s=o.foreground,i=o.gradient,h=o.gradientType,m=o.gradientStartColor,M=o.gradientEndColor,w=r>>>0,p=W(e)?e:$,S=c.value;if(S){var C=S.getContext("2d");if(C){var g=B.QrCode.encodeText(a,K[p]).getModules(),E=g.length+w*2,P=l.value,y={x:0,y:0,width:0,height:0},I=o.imageSettings.src&&P!=null&&P.naturalWidth!==0&&P.naturalHeight!==0;if(I){var A=Z(g,o.size,w,o.imageSettings);y={x:A.x+w,y:A.y+w,width:A.w,height:A.h},A.excavation&&(g=j(g,A.excavation))}var U=window.devicePixelRatio||1,T=t/E*U;if(S.height=S.width=t*U,C.scale(T,T),C.fillStyle=n,C.fillRect(0,0,E,E),i){var b=void 0;h==="linear"?b=C.createLinearGradient(0,0,E,E):b=C.createRadialGradient(E/2,E/2,0,E/2,E/2,E/2),b.addColorStop(0,m),b.addColorStop(1,M),C.fillStyle=b}else C.fillStyle=s;ie?C.fill(new Path2D(J(g,w))):g.forEach(function(z,_){z.forEach(function(Q,V){Q&&C.fillRect(V+w,_+w,1,1)})}),I&&C.drawImage(P,y.x,y.y,y.width,y.height)}}};re(f),X(f);var v=u.attrs.style;return function(){return N(ae,[N("canvas",D(D({},u.attrs),{ref:c,style:D(D({},v),{width:"".concat(o.size,"px"),height:"".concat(o.size,"px")})})),o.imageSettings.src&&N("img",{ref:l,src:o.imageSettings.src,style:{display:"none"},onLoad:f})])}}}),Ie=Y({name:"Qrcode",render:function(){var o=this.$props,u=o.renderAs,c=o.value,l=o.size,f=o.margin,v=o.level,a=o.background,e=o.foreground,t=o.imageSettings,r=o.gradient,n=o.gradientType,s=o.gradientStartColor,i=o.gradientEndColor;return N(u==="svg"?le:ue,{value:c,size:l,margin:f,level:v,background:a,foreground:e,imageSettings:t,gradient:r,gradientType:n,gradientStartColor:s,gradientEndColor:i})},props:se});const be=ne("fileData",()=>{const o=R(x.IDLE),u=R({loaded:0,total:0,percentage:0}),c=R(""),l=R(null),f=R(""),v=R(null),a=R(!1),e=R([]),t=R(0),r=R(1),n=R(10),s=R(!1),i=R([]),h=R([]),m=k(()=>o.value===x.UPLOADING),M=k(()=>o.value===x.SUCCESS),w=k(()=>o.value===x.ERROR),p=k(()=>v.value!==null),S=k(()=>p.value&&!a.value),C=k(()=>Math.ceil(t.value/n.value)),g=d=>{o.value=d},E=d=>{u.value=d},P=d=>{c.value=d},y=d=>{l.value=d},I=()=>{o.value=x.IDLE,u.value={loaded:0,total:0,percentage:0},c.value="",l.value=null},A=d=>{f.value=d},U=d=>{v.value=d},T=d=>{a.value=d},b=()=>{f.value="",v.value=null,a.value=!1},z=d=>{e.value=d},_=d=>{e.value.unshift(d),t.value+=1};return{uploadStatus:o,uploadProgress:u,uploadedCode:c,currentFile:l,downloadCode:f,fileInfo:v,isDownloading:a,fileList:e,totalFiles:t,currentPage:r,pageSize:n,isLoadingList:s,isUploading:m,isUploadSuccess:M,isUploadError:w,hasFileInfo:p,canDownload:S,totalPages:C,setUploadStatus:g,setUploadProgress:E,setUploadedCode:P,setCurrentFile:y,resetUpload:I,setDownloadCode:A,setFileInfo:U,setDownloading:T,resetDownload:b,setFileList:z,addFile:_,removeFile:d=>{const L=e.value.findIndex(F=>F.id===d);L>-1&&(e.value.splice(L,1),t.value-=1)},updateFile:(d,L)=>{const F=e.value.findIndex(te=>te.id===d);F>-1&&(e.value[F]={...e.value[F],...L})},setTotalFiles:d=>{t.value=d},setCurrentPage:d=>{r.value=d},setPageSize:d=>{n.value=d},setLoadingList:d=>{s.value=d},resetFileList:()=>{e.value=[],t.value=0,r.value=1,s.value=!1},addShareData:d=>{if(P(d.code),d.name){const L={id:d.code,name:d.name,size:0,type:"",uploadTime:new Date().toISOString(),downloadCount:0};_(L)}},receiveData:i,addReceiveData:d=>{i.value.push(d)},removeReceiveData:d=>{const L=i.value.findIndex(F=>F.id===d);L>-1&&i.value.splice(L,1)},deleteReceiveData:d=>{d>-1&&d{i.value=[]},shareData:h,addShareDataRecord:d=>{h.value.push(d)},deleteShareData:d=>{d>-1&&d{h.value=[]}}}),ee=async(o,u={})=>{const{successMsg:c="复制成功",errorMsg:l="复制失败,请手动复制",showMsg:f=!0}=u,v=oe();try{if(document.hasFocus()&&navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(o),f&&v.showAlert(c,"success"),!0;const a=document.createElement("textarea");a.value=o,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();const e=document.execCommand("copy");if(document.body.removeChild(a),e)return f&&v.showAlert(c,"success"),!0;throw new Error("execCommand copy failed")}catch(a){return console.error("复制失败:",a),f&&v.showAlert(l,"error"),!1}},De=async o=>{const u=`${window.location.origin}/#/?code=${o}`;return ee(u,{successMsg:"取件链接已复制到剪贴板",errorMsg:"复制失败,请手动复制取件链接"})},Le=async o=>ee(o,{successMsg:"取件码已复制到剪贴板",errorMsg:"复制失败,请手动复制取件码"}),ce=window.location.origin+"/",Te=(o,u)=>{const c=`wget ${ce}share/select?code=${o} -O "${u}"`;navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(c).then(()=>{console.log("命令已复制到剪贴板!")}).catch(l=>{console.error("复制失败,使用回退方法:",l),H(c)}):(console.warn("Clipboard API 不可用,使用回退方法。"),H(c))};function H(o){const u=document.createElement("textarea");u.value=o,u.style.position="fixed",document.body.appendChild(u),u.focus(),u.select();try{const c=document.execCommand("copy");console.log("回退复制操作成功:",c),document.hasFocus()&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(o):H(o)}catch(c){console.error("回退复制操作失败:",c)}document.body.removeChild(u)}export{Pe as C,Ae as E,Ie as Q,Ne as S,Te as a,De as b,Le as c,ee as d,be as u};