var Yt=Object.defineProperty,Zt=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable;var $e=(_,l,v)=>l in _?Yt(_,l,{enumerable:!0,configurable:!0,writable:!0,value:v}):_[l]=v,Fe=(_,l)=>{for(var v in l||(l={}))er.call(l,v)&&$e(_,v,l[v]);if(Ge)for(var v of Ge(l))tr.call(l,v)&&$e(_,v,l[v]);return _},He=(_,l)=>Zt(_,Kt(l));import{S as rr,d as $t,a as nr,m as ir,b as ar,e as Ce,U as or,V as ur,k as Ue,f as D,w as B,h as W,F as fr,l as cr,u as lr,g as dr,j as Y}from"./index-A0ZgrqbB.js";var Z={},N={},K={},ze;function M(){if(ze)return K;ze=1,Object.defineProperty(K,"__esModule",{value:!0});function _(v,c){if(!(v instanceof c))throw new TypeError("Cannot call a class as a function")}var l=function v(c,h){_(this,v),this.data=c,this.text=h.text||c,this.options=h};return K.default=l,K}var Xe;function hr(){if(Xe)return N;Xe=1,Object.defineProperty(N,"__esModule",{value:!0}),N.CODE39=void 0;var _=function(){function u(y,p){for(var g=0;g=200){y=r.shift()-105;var p=c.SWAP[y];p!==void 0?u=t.next(r,i+1,p):((o===c.SET_A||o===c.SET_B)&&y===c.SHIFT&&(r[0]=o===c.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),u=t.next(r,i+1,o))}else y=t.correctIndex(r,o),u=t.next(r,i+1,o);var g=t.getBar(y),w=y*i;return{result:g+u.result,checksum:w+u.checksum}}}]),t}(v.default);return te.default=a,te}var re={},Qe;function vr(){if(Qe)return re;Qe=1,Object.defineProperty(re,"__esModule",{value:!0});var _=z(),l=function(f){return f.match(new RegExp("^"+_.A_CHARS+"*"))[0].length},v=function(f){return f.match(new RegExp("^"+_.B_CHARS+"*"))[0].length},c=function(f){return f.match(new RegExp("^"+_.C_CHARS+"*"))[0]};function h(d,f){var a=f?_.A_CHARS:_.B_CHARS,e=d.match(new RegExp("^("+a+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+"Ì"+s(d.substring(e[1].length));var t=d.match(new RegExp("^"+a+"+"))[0];return t.length===d.length?d:t+String.fromCharCode(f?205:206)+h(d.substring(t.length),!f)}function s(d){var f=c(d),a=f.length;if(a===d.length)return d;d=d.substring(a);var e=l(d)>=v(d);return f+String.fromCharCode(e?206:205)+h(d,e)}return re.default=function(d){var f=void 0,a=c(d).length;if(a>=2)f=_.C_START_CHAR+s(d);else{var e=l(d)>v(d);f=(e?_.A_START_CHAR:_.B_START_CHAR)+h(d,e)}return f.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,n){return"Ë"+n})},re}var We;function _r(){if(We)return ee;We=1,Object.defineProperty(ee,"__esModule",{value:!0});var _=ke(),l=h(_),v=vr(),c=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){if(s(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var i=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,c.default)(n),r));else var i=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r));return d(i)}return t}(l.default);return ee.default=a,ee}var ne={},Ye;function sr(){if(Ye)return ne;Ye=1,Object.defineProperty(ne,"__esModule",{value:!0});var _=function(){function e(t,n){for(var r=0;ro.width*10?o.width*10:o.fontSize,u.guardHeight=o.height+u.fontSize/2+o.textMargin,u}return _(r,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(o,u){return this.text.substr(o,u)}},{key:"leftEncode",value:function(o,u){return(0,c.default)(o,u)}},{key:"rightText",value:function(o,u){return this.text.substr(o,u)}},{key:"rightEncode",value:function(o,u){return(0,c.default)(o,u)}},{key:"encodeGuarded",value:function(){var o={fontSize:this.fontSize},u={height:this.guardHeight};return[{data:l.SIDE_BIN,options:u},{data:this.leftEncode(),text:this.leftText(),options:o},{data:l.MIDDLE_BIN,options:u},{data:this.rightEncode(),text:this.rightText(),options:o},{data:l.SIDE_BIN,options:u}]}},{key:"encodeFlat",value:function(){var o=[l.SIDE_BIN,this.leftEncode(),l.MIDDLE_BIN,this.rightEncode(),l.SIDE_BIN];return{data:o.join(""),text:this.text}}}]),r}(s.default);return ue.default=t,ue}var it;function Er(){if(it)return oe;it=1,Object.defineProperty(oe,"__esModule",{value:!0});var _=function(){function n(r,i){for(var o=0;oo.width*10?u.fontSize=o.width*10:u.fontSize=o.fontSize,u.guardHeight=o.height+u.fontSize/2+o.textMargin,u}return _(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var o="";return o+="101",o+=(0,v.default)(this.data.substr(0,6),"LLLLLL"),o+="01010",o+=(0,v.default)(this.data.substr(6,6),"RRRRRR"),o+="101",{data:o,text:this.text}}},{key:"guardedEncoding",value:function(){var o=[];return this.displayValue&&o.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),o.push({data:"101"+(0,v.default)(this.data[0],"L"),options:{height:this.guardHeight}}),o.push({data:(0,v.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),o.push({data:"01010",options:{height:this.guardHeight}}),o.push({data:(0,v.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),o.push({data:(0,v.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&o.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),o}}]),r}(h.default);function t(n){var r=0,i;for(i=1;i<11;i+=2)r+=parseInt(n[i]);for(i=0;i<11;i+=2)r+=parseInt(n[i])*3;return(10-r%10)%10}return G.default=e,G}var he={},ct;function wr(){if(ct)return he;ct=1,Object.defineProperty(he,"__esModule",{value:!0});var _=function(){function o(u,y){for(var p=0;pp.width*10?g.fontSize=p.width*10:g.fontSize=p.fontSize,g.guardHeight=p.height+g.fontSize/2+p.textMargin,g}return _(u,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var p="";return p+="101",p+=this.encodeMiddleDigits(),p+="010101",{data:p,text:this.text}}},{key:"guardedEncoding",value:function(){var p=[];return this.displayValue&&p.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),p.push({data:"101",options:{height:this.guardHeight}}),p.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),p.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&p.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),p}},{key:"encodeMiddleDigits",value:function(){var p=this.upcA[0],g=this.upcA[this.upcA.length-1],w=n[parseInt(g)][parseInt(p)];return(0,v.default)(this.middleDigits,w)}}]),u}(h.default);function i(o,u){for(var y=parseInt(o[o.length-1]),p=t[y],g="",w=0,j=0;j=3&&this.number<=131070}}]),e}(v.default);return F.pharmacode=f,F}var H={},wt;function Br(){if(wt)return H;wt=1,Object.defineProperty(H,"__esModule",{value:!0}),H.codabar=void 0;var _=function(){function a(e,t){for(var n=0;n0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function h(e,t,n){if(n.displayValue&&tt&&(t=e[n].height);return t}function a(e,t,n){var r;if(n)r=n;else if(typeof document!="undefined")r=document.createElement("canvas").getContext("2d");else return 0;r.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var i=r.measureText(e);if(!i)return 0;var o=i.width;return o}return P.getMaximumHeightOfEncodings=f,P.getEncodingHeight=c,P.getBarcodePadding=h,P.calculateEncodingAttributes=s,P.getTotalWidthOfEncodings=d,P}var Dt;function Gr(){if(Dt)return Pe;Dt=1,Object.defineProperty(Pe,"__esModule",{value:!0});var _=function(){function f(a,e){for(var t=0;t0?(i=0,n.textAlign="left"):e.textAlign=="right"?(i=t.width-1,n.textAlign="right"):(i=t.width/2,n.textAlign="center"),n.fillText(t.text,i,o)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),f}();return Pe.default=d,Pe}var Te={},Bt;function $r(){if(Bt)return Te;Bt=1,Object.defineProperty(Te,"__esModule",{value:!0});var _=function(){function a(e,t){for(var n=0;n0&&(this.drawRect(y-n.width*u,o,n.width*u,n.height,t),u=0);u>0&&this.drawRect(y-n.width*(u-1),o,n.width*u,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var i=this.document.createElementNS(d,"text");if(n.displayValue){var o,u;i.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?u=n.fontSize-n.textMargin:u=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(o=0,i.setAttribute("text-anchor","start")):n.textAlign=="right"?(o=r.width-1,i.setAttribute("text-anchor","end")):(o=r.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",o),i.setAttribute("y",u),i.appendChild(this.document.createTextNode(r.text)),t.appendChild(i)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",d),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,r){var i=this.document.createElementNS(d,"g");return i.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(i),i}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(t,n,r,i,o){var u=this.document.createElementNS(d,"rect");return u.setAttribute("x",t),u.setAttribute("y",n),u.setAttribute("width",r),u.setAttribute("height",i),o.appendChild(u),u}}]),a}();return Te.default=f,Te}var Me={},qt;function Fr(){if(qt)return Me;qt=1,Object.defineProperty(Me,"__esModule",{value:!0});var _=function(){function c(h,s){for(var d=0;d{const c=He(Fe({},l.options),{format:l.type});Jr(v.value,l.text,c)}),(c,h)=>(Ce(),ar(or(_.tag),{ref_key:"wrapEl",ref:v},null,512))}}),Wr=ur(Qr),Yr={class:"font-medium"},en=$t({name:"BarCode",__name:"barcode",setup(_){const l=[{text:"CODE128",type:"CODE128",options:{}},{text:"CODE39",type:"CODE39",options:{lineColor:"#990000"}},{text:"123456",type:"pharmacode",options:{background:"#eee",width:5}}];return(v,c)=>{const h=W("el-link"),s=W("el-card"),d=W("el-col"),f=W("el-row");return Ce(),Ue("div",null,[D(s,{shadow:"never"},{header:B(()=>[dr("div",Yr,[c[1]||(c[1]=Y(" 条形码(基于 ")),D(h,{href:"https://lindell.me/JsBarcode/",target:"_blank",style:{margin:"0 5px 4px 0","font-size":"16px"}},{default:B(()=>c[0]||(c[0]=[Y(" JsBarcode ")])),_:1}),c[2]||(c[2]=Y(" 生成) "))]),D(h,{class:"mt-2",href:"https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/able/barcode.vue",target:"_blank"},{default:B(()=>c[3]||(c[3]=[Y(" 代码位置 src/views/able/barcode.vue ")])),_:1})]),default:B(()=>[D(f,{gutter:12},{default:B(()=>[(Ce(),Ue(fr,null,cr(l,(a,e)=>D(d,{key:e,xs:24,sm:24,md:12,lg:8,xl:8},{default:B(()=>[D(s,{shadow:"hover",class:"flex justify-center"},{default:B(()=>[D(lr(Wr),{text:a.text,type:a.type,options:a.options},null,8,["text","type","options"])]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1})])}}});export{en as default};