var we={},te={},d={};Object.defineProperty(d,"__esModule",{value:!0});function qt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Yt=function t(e,r){qt(this,t),this.data=e,this.text=r.text||e,this.options=r};d.default=Yt;Object.defineProperty(te,"__esModule",{value:!0});te.CODE39=void 0;var Wt=function(){function t(e,r){for(var n=0;n=200){u=n.shift()-105;var h=v.SWAP[u];h!==void 0?o=e.next(n,i+1,h):((a===v.SET_A||a===v.SET_B)&&u===v.SHIFT&&(n[0]=a===v.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),o=e.next(n,i+1,a))}else u=e.correctIndex(n,a),o=e.next(n,i+1,a);var l=e.getBar(u),x=u*i;return{result:l+o.result,checksum:x+o.checksum}}}]),e}(_n.default);B.default=pn;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});var m=f,St=function(e){return e.match(new RegExp("^"+m.A_CHARS+"*"))[0].length},xt=function(e){return e.match(new RegExp("^"+m.B_CHARS+"*"))[0].length},At=function(e){return e.match(new RegExp("^"+m.C_CHARS+"*"))[0]};function xe(t,e){var r=e?m.A_CHARS:m.B_CHARS,n=t.match(new RegExp("^("+r+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+String.fromCharCode(204)+Tt(t.substring(n[1].length));var i=t.match(new RegExp("^"+r+"+"))[0];return i.length===t.length?t:i+String.fromCharCode(e?205:206)+xe(t.substring(i.length),!e)}function Tt(t){var e=At(t),r=e.length;if(r===t.length)return t;t=t.substring(r);var n=St(t)>=xt(t);return e+String.fromCharCode(n?206:205)+xe(t,n)}Se.default=function(t){var e=void 0,r=At(t).length;if(r>=2)e=m.C_START_CHAR+Tt(t);else{var n=St(t)>xt(t);e=(n?m.A_START_CHAR:m.B_START_CHAR)+xe(t,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(i,a){return String.fromCharCode(203)+a})};Object.defineProperty($e,"__esModule",{value:!0});var En=B,mn=Rt(En),On=Se,bn=Rt(On);function Rt(t){return t&&t.__esModule?t:{default:t}}function wn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function se(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function $n(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Sn=function(t){$n(e,t);function e(r,n){if(wn(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var i=se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,bn.default)(r),n));else var i=se(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r,n));return se(i)}return e}(mn.default);$e.default=Sn;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});var xn=function(){function t(e,r){for(var n=0;nn.width*10?n.width*10:n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return or(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,i){return this.text.substr(n,i)}},{key:"leftEncode",value:function(n,i){return(0,ut.default)(n,i)}},{key:"rightText",value:function(n,i){return this.text.substr(n,i)}},{key:"rightEncode",value:function(n,i){return(0,ut.default)(n,i)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},i={height:this.guardHeight};return[{data:P.SIDE_BIN,options:i},{data:this.leftEncode(),text:this.leftText(),options:n},{data:P.MIDDLE_BIN,options:i},{data:this.rightEncode(),text:this.rightText(),options:n},{data:P.SIDE_BIN,options:i}]}},{key:"encodeFlat",value:function(){var n=[P.SIDE_BIN,this.leftEncode(),P.MIDDLE_BIN,this.rightEncode(),P.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(cr.default);re.default=_r;Object.defineProperty(Pe,"__esModule",{value:!0});var vr=function(){function t(e,r){for(var n=0;nn.width*10?i.fontSize=n.width*10:i.fontSize=n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return Qr(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==me(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,I.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,I.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,I.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,I.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,I.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,I.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),e}(ti.default);function me(t){var e=0,r;for(r=1;r<11;r+=2)e+=parseInt(t[r]);for(r=0;r<11;r+=2)e+=parseInt(t[r])*3;return(10-e%10)%10}X.default=ai;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});var oi=function(){function t(e,r){for(var n=0;nn.width*10?i.fontSize=n.width*10:i.fontSize=n.fontSize,i.guardHeight=n.height+i.fontSize/2+n.textMargin,i}return oi(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],i=this.upcA[this.upcA.length-1],a=si[parseInt(i)][parseInt(n)];return(0,fi.default)(this.middleDigits,a)}}]),e}(li.default);function lt(t,e){for(var r=parseInt(t[t.length-1]),n=vi[r],i="",a=0,o=0;o=3&&this.number<=131070}}]),e}(Ya.default);ae.pharmacode=Ka;var oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.codabar=void 0;var eo=function(){function t(e,r){for(var n=0;n":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"\x7F":["(%)","T"]};Object.defineProperty(ue,"__esModule",{value:!0});var fo=function(){function t(e,r){for(var n=0;n0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function jt(t,e,r){if(r.displayValue&&ee&&(e=t[r].height);return e}function nu(t,e,r){var n;if(r)n=r;else if(typeof document!="undefined")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=n.measureText(t);if(!i)return 0;var a=i.width;return a}s.getMaximumHeightOfEncodings=tu;s.getEncodingHeight=Lt;s.getBarcodePadding=jt;s.calculateEncodingAttributes=Ko;s.getTotalWidthOfEncodings=eu;Object.defineProperty(Ve,"__esModule",{value:!0});var ru=function(){function t(e,r){for(var n=0;n0?(o=0,i.textAlign="left"):r.textAlign=="right"?(o=n.width-1,i.textAlign="right"):(o=n.width/2,i.textAlign="center"),i.fillText(n.text,o,u)}}},{key:"moveCanvasDrawing",value:function(r){var n=this.canvas.getContext("2d");n.translate(r.width,0)}},{key:"restoreCanvas",value:function(){var r=this.canvas.getContext("2d");r.restore()}}]),t}();Ve.default=fu;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});var cu=function(){function t(e,r){for(var n=0;n0&&(this.drawRect(h-n.width*u,o,n.width*u,n.height,r),u=0);u>0&&this.drawRect(h-n.width*(u-1),o,n.width*u,n.height,r)}},{key:"drawSVGText",value:function(r,n,i){var a=this.document.createElementNS(K,"text");if(n.displayValue){var o,u;a.setAttribute("font-family",n.font),a.setAttribute("font-size",n.fontSize),n.fontOptions.includes("bold")&&a.setAttribute("font-weight","bold"),n.fontOptions.includes("italic")&&a.setAttribute("font-style","italic"),n.textPosition=="top"?u=n.fontSize-n.textMargin:u=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||i.barcodePadding>0?(o=0,a.setAttribute("text-anchor","start")):n.textAlign=="right"?(o=i.width-1,a.setAttribute("text-anchor","end")):(o=i.width/2,a.setAttribute("text-anchor","middle")),a.setAttribute("x",o),a.setAttribute("y",u),a.appendChild(this.document.createTextNode(i.text)),r.appendChild(a)}}},{key:"setSvgAttributes",value:function(r,n){var i=this.svg;i.setAttribute("width",r+"px"),i.setAttribute("height",n+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+r+" "+n),i.setAttribute("xmlns",K),i.setAttribute("version","1.1")}},{key:"createGroup",value:function(r,n,i){var a=this.document.createElementNS(K,"g");return a.setAttribute("transform","translate("+r+", "+n+")"),i.appendChild(a),a}},{key:"setGroupOptions",value:function(r,n){r.setAttribute("fill",n.lineColor)}},{key:"drawRect",value:function(r,n,i,a,o){var u=this.document.createElementNS(K,"rect");return u.setAttribute("x",r),u.setAttribute("y",n),u.setAttribute("width",i),u.setAttribute("height",a),o.appendChild(u),u}}]),t}();qe.default=vu;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});var su=function(){function t(e,r){for(var n=0;n{t.PRINT_INIT("\u9500\u552E\u5C0F\u7968"),t.SET_PRINT_PAGESIZE(1,"76mm","110mm",""),t.ADD_PRINT_TEXT("10mm","5mm","60mm","5mm","=== \u9500\u552E\u5C0F\u7968 ==="),t.SET_PRINT_STYLEA(0,"FontSize",12),e.items.forEach((r,n)=>{t.ADD_PRINT_TEXT(`${25+n*8}mm`,"5mm","60mm","5mm",`${r.name} x${r.qty} \uFFE5${r.price}`)})},yunda:(t,e)=>{var tt;t.PRINT_INIT("\u97F5\u8FBE\u5FEB\u9012\u5355"),e.mailno?(t.SET_PRINT_PAGESIZE(3,"77mm","120mm",""),t.ADD_PRINT_PDF("-4mm","-1mm","10mm","10mm",e.pdf_info),t.ADD_PRINT_IMAGE("100.5mm","1.5mm","5mm","15mm",Ee(210,60,0,0)),t.ADD_PRINT_IMAGE("21.5mm","1.5mm","5mm","15mm",Ee(210,60,0,0)),t.ADD_PRINT_IMAGE("38mm","56mm","4mm","15mm",Ee(75,225,0,0)),t.ADD_PRINT_IMAGE("22mm","4mm","40mm","15mm",Yu(e.mailno,!1)),t.ADD_PRINT_IMAGE("40mm","56mm","0mm","0mm",Wu(e.mailno)),t.ADD_PRINT_RECT("10.6mm","0","76mm","118mm",0,1)):(t.SET_PRINT_PAGESIZE(3,"77mm","0mm",""),t.ADD_PRINT_PDF("0","0mm","10mm","10mm",e.pdfInfo),t.ADD_PRINT_TEXT("55mm","10mm","48mm","8mm",((tt=e.receiver)==null?void 0:tt.name)+" "+e.receiver.mobile),t.SET_PRINT_STYLEA(0,"FontSize",10),t.ADD_PRINT_TEXT("60mm","10mm","48mm","8mm",e.receiver.address),t.SET_PRINT_STYLEA(0,"FontSize",9),t.ADD_PRINT_TEXT("71mm","10mm","48mm","8mm",e.sender.name+" "+e.sender.mobile),t.SET_PRINT_STYLEA(0,"FontSize",8),t.ADD_PRINT_TEXT("74mm","10mm","48mm","8mm",e.sender.address),t.SET_PRINT_STYLEA(0,"FontSize",8));let r=[];try{r=JSON.parse(e.printTemplateData||"[]"),r=r.sort((c,A)=>c.sort-A.sort)}catch{r=[]}function n(c,A=30){if(!c)return"-";let T=0,R="";for(let he=0;heA)break;R+=nt,T+=rt}return R.lengthc.isbn||"-"},isGoodsName:{label:"\u5546\u54C1\u540D\u79F0\uFF1A",getValue:c=>n(c.goodsName)},isGoodsArtno:{label:"\u8D27\u53F7/\u539F\u8D27\u53F7\uFF1A",getValue:c=>`${(c.artNo||"").toString().slice(0,6)}/${c.originalArtNo||""}`},isGoodsNum:{label:"\u6570\u91CF\uFF1A",getValue:c=>c.goodsCount||0}};let a=95;const o=3.5,u=2,h=80,l=5;(Array.isArray(e.dataList)?e.dataList:[]).forEach(c=>{r.forEach(A=>{if(!A.checked)return;const T=i[A.value];if(!T)return;const R=`${T.label}${T.getValue(c)}`;t.ADD_PRINT_TEXT(`${a}mm`,`${u}mm`,`${h}mm`,`${l}mm`,R),t.SET_PRINT_STYLEA(0,"FontSize",9),t.SET_PRINT_STYLEA(0,"Bold",1),a+=o})})}},Vt=()=>new Promise((t,e)=>{if(z)return t(z);const r=document.createElement("script");r.src="http://localhost:8000/CLodopfuncs.js",r.onload=()=>{z=getCLodop(),z||e(new Error("C-Lodop \u672A\u6B63\u786E\u5B89\u88C5")),t(z)},r.onerror=()=>{const n=new Error("\u52A0\u8F7D C-Lodop \u5931\u8D25");Ju("C-Lodop\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF01"),e(n)},document.head.appendChild(r)});function Ju(t){const e=`${t} \u8BF7\u5148\u4E0B\u8F7D\u5B89\u88C5\u63D2\u4EF6\u540E\u91CD\u8BD5\uFF01 \u70B9\u51FB\u3010\u786E\u5B9A\u3011\u5F00\u59CB\u4E0B\u8F7D\uFF0C\u3010\u53D6\u6D88\u3011\u5219\u653E\u5F03\u3002`;if(confirm(e)){const r="http://103.236.68.64:19000/my-pics/Lodop/CLodop_Setup_for_Win64NT_6.623EN.exe",n=document.createElement("a");n.href=r,n.download="CLodop_Setup_for_Win64NT_6.623EN.exe",n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}const Zu=async(t,e)=>{console.log("\u521B\u5EFA\u6253\u5370\u4EFB\u52A1\uFF0C\u6A21\u677F:",t,"\u5185\u5BB9:",e);try{const r=await Vt();if(r.SET_LICENSES("","630D8906DC4186920589CAE3FFA925A278D","",""),!Et[t])throw console.log(t),new Error(`\u672A\u627E\u5230\u6A21\u677F: ${t}`);return Et[t](r,e),r}catch(r){throw r}},Qu=async()=>{try{const t=await Vt(),e=[],r=t.GET_PRINTER_COUNT();for(let n=0;n