retail-print-kit 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,26 @@
1
- "use strict";var RetailPrintKit=(()=>{var Hn=Object.create;var at=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var Kn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var Yn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jn=(e,t)=>{for(var n in t)at(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vn(t))!Jn.call(e,i)&&i!==n&&at(e,i,{get:()=>t[i],enumerable:!(r=Qn(t,i))||r.enumerable});return e};var Wn=(e,t,n)=>(n=e!=null?Hn(Kn(e)):{},Ce(t||!e||!e.__esModule?at(n,"default",{value:e,enumerable:!0}):n,e)),Zn=e=>Ce(at({},"__esModule",{value:!0}),e);var Be=p((Mi,$e)=>{$e.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var B=p(P=>{var Pt,Xn=[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];P.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};P.getSymbolTotalCodewords=function(t){return Xn[t]};P.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};P.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Pt=t};P.isKanjiModeEnabled=function(){return typeof Pt<"u"};P.toSJIS=function(t){return Pt(t)}});var ut=p(x=>{x.L={bit:1};x.M={bit:0};x.Q={bit:3};x.H={bit:2};function tr(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return x.L;case"m":case"medium":return x.M;case"q":case"quartile":return x.Q;case"h":case"high":return x.H;default:throw new Error("Unknown EC Level: "+e)}}x.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};x.from=function(t,n){if(x.isValid(t))return t;try{return tr(t)}catch{return n}}});var Le=p((Pi,Me)=>{function Te(){this.buffer=[],this.length=0}Te.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};Me.exports=Te});var Pe=p((Ni,Se)=>{function Y(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)}Y.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)};Y.prototype.get=function(e,t){return this.data[e*this.size+t]};Y.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Y.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};Se.exports=Y});var Ne=p(ct=>{var er=B().getSymbolSize;ct.getRowColCoords=function(t){if(t===1)return[];let n=Math.floor(t/7)+2,r=er(t),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,o=[r-7];for(let s=1;s<n-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};ct.getPositions=function(t){let n=[],r=ct.getRowColCoords(t),i=r.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||n.push([r[o],r[s]]);return n}});var ke=p(Re=>{var nr=B().getSymbolSize,Ie=7;Re.getPositions=function(t){let n=nr(t);return[[0,0],[n-Ie,0],[0,n-Ie]]}});var Ue=p(m=>{m.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var N={N1:3,N2:3,N3:40,N4:10};m.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};m.from=function(t){return m.isValid(t)?parseInt(t,10):void 0};m.getPenaltyN1=function(t){let n=t.size,r=0,i=0,o=0,s=null,a=null;for(let u=0;u<n;u++){i=o=0,s=a=null;for(let c=0;c<n;c++){let f=t.get(u,c);f===s?i++:(i>=5&&(r+=N.N1+(i-5)),s=f,i=1),f=t.get(c,u),f===a?o++:(o>=5&&(r+=N.N1+(o-5)),a=f,o=1)}i>=5&&(r+=N.N1+(i-5)),o>=5&&(r+=N.N1+(o-5))}return r};m.getPenaltyN2=function(t){let n=t.size,r=0;for(let i=0;i<n-1;i++)for(let o=0;o<n-1;o++){let s=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(s===4||s===0)&&r++}return r*N.N2};m.getPenaltyN3=function(t){let n=t.size,r=0,i=0,o=0;for(let s=0;s<n;s++){i=o=0;for(let a=0;a<n;a++)i=i<<1&2047|t.get(s,a),a>=10&&(i===1488||i===93)&&r++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&r++}return r*N.N3};m.getPenaltyN4=function(t){let n=0,r=t.data.length;for(let o=0;o<r;o++)n+=t.data[o];return Math.abs(Math.ceil(n*100/r/5)-10)*N.N4};function rr(e,t,n){switch(e){case m.Patterns.PATTERN000:return(t+n)%2===0;case m.Patterns.PATTERN001:return t%2===0;case m.Patterns.PATTERN010:return n%3===0;case m.Patterns.PATTERN011:return(t+n)%3===0;case m.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2===0;case m.Patterns.PATTERN101:return t*n%2+t*n%3===0;case m.Patterns.PATTERN110:return(t*n%2+t*n%3)%2===0;case m.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}m.applyMask=function(t,n){let r=n.size;for(let i=0;i<r;i++)for(let o=0;o<r;o++)n.isReserved(o,i)||n.xor(o,i,rr(t,o,i))};m.getBestMask=function(t,n){let r=Object.keys(m.Patterns).length,i=0,o=1/0;for(let s=0;s<r;s++){n(s),m.applyMask(s,t);let a=m.getPenaltyN1(t)+m.getPenaltyN2(t)+m.getPenaltyN3(t)+m.getPenaltyN4(t);m.applyMask(s,t),a<o&&(o=a,i=s)}return i}});var It=p(Nt=>{var T=ut(),lt=[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],ft=[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,n){switch(n){case T.L:return lt[(t-1)*4+0];case T.M:return lt[(t-1)*4+1];case T.Q:return lt[(t-1)*4+2];case T.H:return lt[(t-1)*4+3];default:return}};Nt.getTotalCodewordsCount=function(t,n){switch(n){case T.L:return ft[(t-1)*4+0];case T.M:return ft[(t-1)*4+1];case T.Q:return ft[(t-1)*4+2];case T.H:return ft[(t-1)*4+3];default:return}}});var De=p(dt=>{var j=new Uint8Array(512),ht=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)j[n]=t,ht[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)j[n]=j[n-255]})();dt.log=function(t){if(t<1)throw new Error("log("+t+")");return ht[t]};dt.exp=function(t){return j[t]};dt.mul=function(t,n){return t===0||n===0?0:j[ht[t]+ht[n]]}});var Fe=p(W=>{var Rt=De();W.mul=function(t,n){let r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=Rt.mul(t[i],n[o]);return r};W.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){let i=r[0];for(let s=0;s<n.length;s++)r[s]^=Rt.mul(n[s],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r};W.generateECPolynomial=function(t){let n=new Uint8Array([1]);for(let r=0;r<t;r++)n=W.mul(n,new Uint8Array([1,Rt.exp(r)]));return n}});var ve=p((Oi,qe)=>{var Oe=Fe();function kt(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}kt.prototype.initialize=function(t){this.degree=t,this.genPoly=Oe.generateECPolynomial(this.degree)};kt.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(t.length+this.degree);n.set(t);let r=Oe.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(r,i),o}return r};qe.exports=kt});var Ut=p(_e=>{_e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var Dt=p($=>{var ze="[0-9]+",ir="[A-Z $%*+\\-./:]+",Z="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Z=Z.replace(/u/g,"\\u");var or="(?:(?![A-Z0-9 $%*+\\-./:]|"+Z+`)(?:.|[\r
2
- ]))+`;$.KANJI=new RegExp(Z,"g");$.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");$.BYTE=new RegExp(or,"g");$.NUMERIC=new RegExp(ze,"g");$.ALPHANUMERIC=new RegExp(ir,"g");var sr=new RegExp("^"+Z+"$"),ar=new RegExp("^"+ze+"$"),ur=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");$.testKanji=function(t){return sr.test(t)};$.testNumeric=function(t){return ar.test(t)};$.testAlphanumeric=function(t){return ur.test(t)}});var M=p(b=>{var cr=Ut(),Ft=Dt();b.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};b.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};b.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};b.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};b.MIXED={bit:-1};b.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!cr.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]};b.getBestModeForData=function(t){return Ft.testNumeric(t)?b.NUMERIC:Ft.testAlphanumeric(t)?b.ALPHANUMERIC:Ft.testKanji(t)?b.KANJI:b.BYTE};b.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};b.isValid=function(t){return t&&t.bit&&t.ccBits};function lr(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return b.NUMERIC;case"alphanumeric":return b.ALPHANUMERIC;case"kanji":return b.KANJI;case"byte":return b.BYTE;default:throw new Error("Unknown mode: "+e)}}b.from=function(t,n){if(b.isValid(t))return t;try{return lr(t)}catch{return n}}});var Ke=p(I=>{var gt=B(),fr=It(),Ge=ut(),L=M(),Ot=Ut(),Qe=7973,He=gt.getBCHDigit(Qe);function hr(e,t,n){for(let r=1;r<=40;r++)if(t<=I.getCapacity(r,n,e))return r}function Ve(e,t){return L.getCharCountIndicator(e,t)+4}function dr(e,t){let n=0;return e.forEach(function(r){let i=Ve(r.mode,t);n+=i+r.getBitsLength()}),n}function gr(e,t){for(let n=1;n<=40;n++)if(dr(e,n)<=I.getCapacity(n,t,L.MIXED))return n}I.from=function(t,n){return Ot.isValid(t)?parseInt(t,10):n};I.getCapacity=function(t,n,r){if(!Ot.isValid(t))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=L.BYTE);let i=gt.getSymbolTotalCodewords(t),o=fr.getTotalCodewordsCount(t,n),s=(i-o)*8;if(r===L.MIXED)return s;let a=s-Ve(r,t);switch(r){case L.NUMERIC:return Math.floor(a/10*3);case L.ALPHANUMERIC:return Math.floor(a/11*2);case L.KANJI:return Math.floor(a/13);case L.BYTE:default:return Math.floor(a/8)}};I.getBestVersionForData=function(t,n){let r,i=Ge.from(n,Ge.M);if(Array.isArray(t)){if(t.length>1)return gr(t,i);if(t.length===0)return 1;r=t[0]}else r=t;return hr(r.mode,r.getLength(),i)};I.getEncodedBits=function(t){if(!Ot.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;gt.getBCHDigit(n)-He>=0;)n^=Qe<<gt.getBCHDigit(n)-He;return t<<12|n}});var We=p(je=>{var qt=B(),Ye=1335,pr=21522,Je=qt.getBCHDigit(Ye);je.getEncodedBits=function(t,n){let r=t.bit<<3|n,i=r<<10;for(;qt.getBCHDigit(i)-Je>=0;)i^=Ye<<qt.getBCHDigit(i)-Je;return(r<<10|i)^pr}});var Xe=p((Hi,Ze)=>{var mr=M();function F(e){this.mode=mr.NUMERIC,this.data=e.toString()}F.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};F.prototype.getLength=function(){return this.data.length};F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)};F.prototype.write=function(t){let n,r,i;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),i=parseInt(r,10),t.put(i,10);let o=this.data.length-n;o>0&&(r=this.data.substr(n),i=parseInt(r,10),t.put(i,o*3+1))};Ze.exports=F});var en=p((Qi,tn)=>{var wr=M(),vt=["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 O(e){this.mode=wr.ALPHANUMERIC,this.data=e}O.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};O.prototype.getLength=function(){return this.data.length};O.prototype.getBitsLength=function(){return O.getBitsLength(this.data.length)};O.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=vt.indexOf(this.data[n])*45;r+=vt.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(vt.indexOf(this.data[n]),6)};tn.exports=O});var rn=p((Vi,nn)=>{var br=M();function q(e){this.mode=br.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}q.getBitsLength=function(t){return t*8};q.prototype.getLength=function(){return this.data.length};q.prototype.getBitsLength=function(){return q.getBitsLength(this.data.length)};q.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};nn.exports=q});var sn=p((Ki,on)=>{var yr=M(),xr=B();function v(e){this.mode=yr.KANJI,this.data=e}v.getBitsLength=function(t){return t*13};v.prototype.getLength=function(){return this.data.length};v.prototype.getBitsLength=function(){return v.getBitsLength(this.data.length)};v.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=xr.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};on.exports=v});var an=p((Ji,_t)=>{"use strict";var X={single_source_shortest_paths:function(e,t,n){var r={},i={};i[t]=0;var o=X.PriorityQueue.make();o.push(t,0);for(var s,a,u,c,f,g,l,h,w;!o.empty();){s=o.pop(),a=s.value,c=s.cost,f=e[a]||{};for(u in f)f.hasOwnProperty(u)&&(g=f[u],l=c+g,h=i[u],w=typeof i[u]>"u",(w||h>l)&&(i[u]=l,o.push(u,l),r[u]=a))}if(typeof n<"u"&&typeof i[n]>"u"){var y=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(y)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t,i;r;)n.push(r),i=e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,n){var r=X.single_source_shortest_paths(e,t,n);return X.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(e){var t=X.PriorityQueue,n={},r;e=e||{};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n.queue=[],n.sorter=e.sorter||t.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof _t<"u"&&(_t.exports=X)});var pn=p(_=>{var d=M(),ln=Xe(),fn=en(),hn=rn(),dn=sn(),tt=Dt(),pt=B(),Er=an();function un(e){return unescape(encodeURIComponent(e)).length}function et(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function gn(e){let t=et(tt.NUMERIC,d.NUMERIC,e),n=et(tt.ALPHANUMERIC,d.ALPHANUMERIC,e),r,i;return pt.isKanjiModeEnabled()?(r=et(tt.BYTE,d.BYTE,e),i=et(tt.KANJI,d.KANJI,e)):(r=et(tt.BYTE_KANJI,d.BYTE,e),i=[]),t.concat(n,r,i).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function zt(e,t){switch(t){case d.NUMERIC:return ln.getBitsLength(e);case d.ALPHANUMERIC:return fn.getBitsLength(e);case d.KANJI:return dn.getBitsLength(e);case d.BYTE:return hn.getBitsLength(e)}}function Ar(e){return e.reduce(function(t,n){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function Cr(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];switch(r.mode){case d.NUMERIC:t.push([r,{data:r.data,mode:d.ALPHANUMERIC,length:r.length},{data:r.data,mode:d.BYTE,length:r.length}]);break;case d.ALPHANUMERIC:t.push([r,{data:r.data,mode:d.BYTE,length:r.length}]);break;case d.KANJI:t.push([r,{data:r.data,mode:d.BYTE,length:un(r.data)}]);break;case d.BYTE:t.push([{data:r.data,mode:d.BYTE,length:un(r.data)}])}}return t}function $r(e,t){let n={},r={start:{}},i=["start"];for(let o=0;o<e.length;o++){let s=e[o],a=[];for(let u=0;u<s.length;u++){let c=s[u],f=""+o+u;a.push(f),n[f]={node:c,lastCount:0},r[f]={};for(let g=0;g<i.length;g++){let l=i[g];n[l]&&n[l].node.mode===c.mode?(r[l][f]=zt(n[l].lastCount+c.length,c.mode)-zt(n[l].lastCount,c.mode),n[l].lastCount+=c.length):(n[l]&&(n[l].lastCount=c.length),r[l][f]=zt(c.length,c.mode)+4+d.getCharCountIndicator(c.mode,t))}}i=a}for(let o=0;o<i.length;o++)r[i[o]].end=0;return{map:r,table:n}}function cn(e,t){let n,r=d.getBestModeForData(e);if(n=d.from(t,r),n!==d.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+d.toString(n)+`.
4
- Suggested mode is: `+d.toString(r));switch(n===d.KANJI&&!pt.isKanjiModeEnabled()&&(n=d.BYTE),n){case d.NUMERIC:return new ln(e);case d.ALPHANUMERIC:return new fn(e);case d.KANJI:return new dn(e);case d.BYTE:return new hn(e)}}_.fromArray=function(t){return t.reduce(function(n,r){return typeof r=="string"?n.push(cn(r,null)):r.data&&n.push(cn(r.data,r.mode)),n},[])};_.fromString=function(t,n){let r=gn(t,pt.isKanjiModeEnabled()),i=Cr(r),o=$r(i,n),s=Er.find_path(o.map,"start","end"),a=[];for(let u=1;u<s.length-1;u++)a.push(o.table[s[u]].node);return _.fromArray(Ar(a))};_.rawSplit=function(t){return _.fromArray(gn(t,pt.isKanjiModeEnabled()))}});var wn=p(mn=>{var wt=B(),Gt=ut(),Br=Le(),Tr=Pe(),Mr=Ne(),Lr=ke(),Vt=Ue(),Kt=It(),Sr=ve(),mt=Ke(),Pr=We(),Nr=M(),Ht=pn();function Ir(e,t){let n=e.size,r=Lr.getPositions(t);for(let i=0;i<r.length;i++){let o=r[i][0],s=r[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||n<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||n<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(o+a,s+u,!0,!0):e.set(o+a,s+u,!1,!0))}}function Rr(e){let t=e.size;for(let n=8;n<t-8;n++){let r=n%2===0;e.set(n,6,r,!0),e.set(6,n,r,!0)}}function kr(e,t){let n=Mr.getPositions(t);for(let r=0;r<n.length;r++){let i=n[r][0],o=n[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(i+s,o+a,!0,!0):e.set(i+s,o+a,!1,!0)}}function Ur(e,t){let n=e.size,r=mt.getEncodedBits(t),i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+n-8-3,s=(r>>a&1)===1,e.set(i,o,s,!0),e.set(o,i,s,!0)}function Qt(e,t,n){let r=e.size,i=Pr.getEncodedBits(t,n),o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function Dr(e,t){let n=e.size,r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(i,a-u)){let c=!1;s<t.length&&(c=(t[s]>>>o&1)===1),e.set(i,a-u,c),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function Fr(e,t,n){let r=new Br;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),Nr.getCharCountIndicator(u.mode,e)),u.write(r)});let i=wt.getSymbolTotalCodewords(e),o=Kt.getTotalCodewordsCount(e,t),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);let a=(s-r.getLengthInBits())/8;for(let u=0;u<a;u++)r.put(u%2?17:236,8);return Or(r,e,t)}function Or(e,t,n){let r=wt.getSymbolTotalCodewords(t),i=Kt.getTotalCodewordsCount(t,n),o=r-i,s=Kt.getBlocksCount(t,n),a=r%s,u=s-a,c=Math.floor(r/s),f=Math.floor(o/s),g=f+1,l=c-f,h=new Sr(l),w=0,y=new Array(s),Ee=new Array(s),Mt=0,Gn=new Uint8Array(e.buffer);for(let D=0;D<s;D++){let St=D<u?f:g;y[D]=Gn.slice(w,w+St),Ee[D]=h.encode(y[D]),w+=St,Mt=Math.max(Mt,St)}let Lt=new Uint8Array(r),Ae=0,A,C;for(A=0;A<Mt;A++)for(C=0;C<s;C++)A<y[C].length&&(Lt[Ae++]=y[C][A]);for(A=0;A<l;A++)for(C=0;C<s;C++)Lt[Ae++]=Ee[C][A];return Lt}function qr(e,t,n,r){let i;if(Array.isArray(e))i=Ht.fromArray(e);else if(typeof e=="string"){let c=t;if(!c){let f=Ht.rawSplit(e);c=mt.getBestVersionForData(f,n)}i=Ht.fromString(e,c||40)}else throw new Error("Invalid data");let o=mt.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
1
+ "use strict";var RetailPrintKit=(()=>{var Vn=Object.create;var ut=Object.defineProperty;var Kn=Object.getOwnPropertyDescriptor;var Jn=Object.getOwnPropertyNames;var Yn=Object.getPrototypeOf,jn=Object.prototype.hasOwnProperty;var Zn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wn=(e,t)=>{for(var n in t)ut(e,n,{get:t[n],enumerable:!0})},$e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jn(t))!jn.call(e,i)&&i!==n&&ut(e,i,{get:()=>t[i],enumerable:!(r=Kn(t,i))||r.enumerable});return e};var Xn=(e,t,n)=>(n=e!=null?Vn(Yn(e)):{},$e(t||!e||!e.__esModule?ut(n,"default",{value:e,enumerable:!0}):n,e)),tr=e=>$e(ut({},"__esModule",{value:!0}),e);var Me=p((Ni,Te)=>{Te.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var $=p(I=>{var It,er=[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 er[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.');It=t};I.isKanjiModeEnabled=function(){return typeof It<"u"};I.toSJIS=function(t){return It(t)}});var ct=p(x=>{x.L={bit:1};x.M={bit:0};x.Q={bit:3};x.H={bit:2};function nr(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return x.L;case"m":case"medium":return x.M;case"q":case"quartile":return x.Q;case"h":case"high":return x.H;default:throw new Error("Unknown EC Level: "+e)}}x.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};x.from=function(t,n){if(x.isValid(t))return t;try{return nr(t)}catch{return n}}});var Pe=p((ki,Se)=>{function Le(){this.buffer=[],this.length=0}Le.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};Se.exports=Le});var Ie=p((Ui,Ne)=>{function j(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)}j.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)};j.prototype.get=function(e,t){return this.data[e*this.size+t]};j.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};j.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};Ne.exports=j});var Re=p(lt=>{var rr=$().getSymbolSize;lt.getRowColCoords=function(t){if(t===1)return[];let n=Math.floor(t/7)+2,r=rr(t),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,o=[r-7];for(let s=1;s<n-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()};lt.getPositions=function(t){let n=[],r=lt.getRowColCoords(t),i=r.length;for(let o=0;o<i;o++)for(let s=0;s<i;s++)o===0&&s===0||o===0&&s===i-1||o===i-1&&s===0||n.push([r[o],r[s]]);return n}});var Oe=p(Ue=>{var ir=$().getSymbolSize,ke=7;Ue.getPositions=function(t){let n=ir(t);return[[0,0],[n-ke,0],[0,n-ke]]}});var De=p(m=>{m.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var R={N1:3,N2:3,N3:40,N4:10};m.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};m.from=function(t){return m.isValid(t)?parseInt(t,10):void 0};m.getPenaltyN1=function(t){let n=t.size,r=0,i=0,o=0,s=null,a=null;for(let u=0;u<n;u++){i=o=0,s=a=null;for(let c=0;c<n;c++){let f=t.get(u,c);f===s?i++:(i>=5&&(r+=R.N1+(i-5)),s=f,i=1),f=t.get(c,u),f===a?o++:(o>=5&&(r+=R.N1+(o-5)),a=f,o=1)}i>=5&&(r+=R.N1+(i-5)),o>=5&&(r+=R.N1+(o-5))}return r};m.getPenaltyN2=function(t){let n=t.size,r=0;for(let i=0;i<n-1;i++)for(let o=0;o<n-1;o++){let s=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(s===4||s===0)&&r++}return r*R.N2};m.getPenaltyN3=function(t){let n=t.size,r=0,i=0,o=0;for(let s=0;s<n;s++){i=o=0;for(let a=0;a<n;a++)i=i<<1&2047|t.get(s,a),a>=10&&(i===1488||i===93)&&r++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&r++}return r*R.N3};m.getPenaltyN4=function(t){let n=0,r=t.data.length;for(let o=0;o<r;o++)n+=t.data[o];return Math.abs(Math.ceil(n*100/r/5)-10)*R.N4};function or(e,t,n){switch(e){case m.Patterns.PATTERN000:return(t+n)%2===0;case m.Patterns.PATTERN001:return t%2===0;case m.Patterns.PATTERN010:return n%3===0;case m.Patterns.PATTERN011:return(t+n)%3===0;case m.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2===0;case m.Patterns.PATTERN101:return t*n%2+t*n%3===0;case m.Patterns.PATTERN110:return(t*n%2+t*n%3)%2===0;case m.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}m.applyMask=function(t,n){let r=n.size;for(let i=0;i<r;i++)for(let o=0;o<r;o++)n.isReserved(o,i)||n.xor(o,i,or(t,o,i))};m.getBestMask=function(t,n){let r=Object.keys(m.Patterns).length,i=0,o=1/0;for(let s=0;s<r;s++){n(s),m.applyMask(s,t);let a=m.getPenaltyN1(t)+m.getPenaltyN2(t)+m.getPenaltyN3(t)+m.getPenaltyN4(t);m.applyMask(s,t),a<o&&(o=a,i=s)}return i}});var kt=p(Rt=>{var T=ct(),ft=[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],ht=[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];Rt.getBlocksCount=function(t,n){switch(n){case T.L:return ft[(t-1)*4+0];case T.M:return ft[(t-1)*4+1];case T.Q:return ft[(t-1)*4+2];case T.H:return ft[(t-1)*4+3];default:return}};Rt.getTotalCodewordsCount=function(t,n){switch(n){case T.L:return ht[(t-1)*4+0];case T.M:return ht[(t-1)*4+1];case T.Q:return ht[(t-1)*4+2];case T.H:return ht[(t-1)*4+3];default:return}}});var Fe=p(gt=>{var Z=new Uint8Array(512),dt=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)Z[n]=t,dt[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)Z[n]=Z[n-255]})();gt.log=function(t){if(t<1)throw new Error("log("+t+")");return dt[t]};gt.exp=function(t){return Z[t]};gt.mul=function(t,n){return t===0||n===0?0:Z[dt[t]+dt[n]]}});var qe=p(W=>{var Ut=Fe();W.mul=function(t,n){let r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=Ut.mul(t[i],n[o]);return r};W.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){let i=r[0];for(let s=0;s<n.length;s++)r[s]^=Ut.mul(n[s],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r};W.generateECPolynomial=function(t){let n=new Uint8Array([1]);for(let r=0;r<t;r++)n=W.mul(n,new Uint8Array([1,Ut.exp(r)]));return n}});var ze=p((zi,_e)=>{var ve=qe();function Ot(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}Ot.prototype.initialize=function(t){this.degree=t,this.genPoly=ve.generateECPolynomial(this.degree)};Ot.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let n=new Uint8Array(t.length+this.degree);n.set(t);let r=ve.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){let o=new Uint8Array(this.degree);return o.set(r,i),o}return r};_e.exports=Ot});var Dt=p(Ge=>{Ge.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var Ft=p(C=>{var He="[0-9]+",sr="[A-Z $%*+\\-./:]+",X="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";X=X.replace(/u/g,"\\u");var ar="(?:(?![A-Z0-9 $%*+\\-./:]|"+X+`)(?:.|[\r
2
+ ]))+`;C.KANJI=new RegExp(X,"g");C.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");C.BYTE=new RegExp(ar,"g");C.NUMERIC=new RegExp(He,"g");C.ALPHANUMERIC=new RegExp(sr,"g");var ur=new RegExp("^"+X+"$"),cr=new RegExp("^"+He+"$"),lr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");C.testKanji=function(t){return ur.test(t)};C.testNumeric=function(t){return cr.test(t)};C.testAlphanumeric=function(t){return lr.test(t)}});var M=p(b=>{var fr=Dt(),qt=Ft();b.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};b.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};b.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};b.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};b.MIXED={bit:-1};b.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!fr.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]};b.getBestModeForData=function(t){return qt.testNumeric(t)?b.NUMERIC:qt.testAlphanumeric(t)?b.ALPHANUMERIC:qt.testKanji(t)?b.KANJI:b.BYTE};b.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};b.isValid=function(t){return t&&t.bit&&t.ccBits};function hr(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return b.NUMERIC;case"alphanumeric":return b.ALPHANUMERIC;case"kanji":return b.KANJI;case"byte":return b.BYTE;default:throw new Error("Unknown mode: "+e)}}b.from=function(t,n){if(b.isValid(t))return t;try{return hr(t)}catch{return n}}});var Ye=p(k=>{var pt=$(),dr=kt(),Qe=ct(),L=M(),vt=Dt(),Ke=7973,Ve=pt.getBCHDigit(Ke);function gr(e,t,n){for(let r=1;r<=40;r++)if(t<=k.getCapacity(r,n,e))return r}function Je(e,t){return L.getCharCountIndicator(e,t)+4}function pr(e,t){let n=0;return e.forEach(function(r){let i=Je(r.mode,t);n+=i+r.getBitsLength()}),n}function mr(e,t){for(let n=1;n<=40;n++)if(pr(e,n)<=k.getCapacity(n,t,L.MIXED))return n}k.from=function(t,n){return vt.isValid(t)?parseInt(t,10):n};k.getCapacity=function(t,n,r){if(!vt.isValid(t))throw new Error("Invalid QR Code version");typeof r>"u"&&(r=L.BYTE);let i=pt.getSymbolTotalCodewords(t),o=dr.getTotalCodewordsCount(t,n),s=(i-o)*8;if(r===L.MIXED)return s;let a=s-Je(r,t);switch(r){case L.NUMERIC:return Math.floor(a/10*3);case L.ALPHANUMERIC:return Math.floor(a/11*2);case L.KANJI:return Math.floor(a/13);case L.BYTE:default:return Math.floor(a/8)}};k.getBestVersionForData=function(t,n){let r,i=Qe.from(n,Qe.M);if(Array.isArray(t)){if(t.length>1)return mr(t,i);if(t.length===0)return 1;r=t[0]}else r=t;return gr(r.mode,r.getLength(),i)};k.getEncodedBits=function(t){if(!vt.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;pt.getBCHDigit(n)-Ve>=0;)n^=Ke<<pt.getBCHDigit(n)-Ve;return t<<12|n}});var Xe=p(We=>{var _t=$(),Ze=1335,wr=21522,je=_t.getBCHDigit(Ze);We.getEncodedBits=function(t,n){let r=t.bit<<3|n,i=r<<10;for(;_t.getBCHDigit(i)-je>=0;)i^=Ze<<_t.getBCHDigit(i)-je;return(r<<10|i)^wr}});var en=p((Ji,tn)=>{var br=M();function _(e){this.mode=br.NUMERIC,this.data=e.toString()}_.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};_.prototype.getLength=function(){return this.data.length};_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)};_.prototype.write=function(t){let n,r,i;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),i=parseInt(r,10),t.put(i,10);let o=this.data.length-n;o>0&&(r=this.data.substr(n),i=parseInt(r,10),t.put(i,o*3+1))};tn.exports=_});var rn=p((Yi,nn)=>{var yr=M(),zt=["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=yr.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 n;for(n=0;n+2<=this.data.length;n+=2){let r=zt.indexOf(this.data[n])*45;r+=zt.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(zt.indexOf(this.data[n]),6)};nn.exports=z});var sn=p((ji,on)=>{var xr=M();function G(e){this.mode=xr.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}G.getBitsLength=function(t){return t*8};G.prototype.getLength=function(){return this.data.length};G.prototype.getBitsLength=function(){return G.getBitsLength(this.data.length)};G.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};on.exports=G});var un=p((Zi,an)=>{var Er=M(),Br=$();function H(e){this.mode=Er.KANJI,this.data=e}H.getBitsLength=function(t){return t*13};H.prototype.getLength=function(){return this.data.length};H.prototype.getBitsLength=function(){return H.getBitsLength(this.data.length)};H.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Br.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};an.exports=H});var cn=p((Wi,Gt)=>{"use strict";var tt={single_source_shortest_paths:function(e,t,n){var r={},i={};i[t]=0;var o=tt.PriorityQueue.make();o.push(t,0);for(var s,a,u,c,f,g,l,h,w;!o.empty();){s=o.pop(),a=s.value,c=s.cost,f=e[a]||{};for(u in f)f.hasOwnProperty(u)&&(g=f[u],l=c+g,h=i[u],w=typeof i[u]>"u",(w||h>l)&&(i[u]=l,o.push(u,l),r[u]=a))}if(typeof n<"u"&&typeof i[n]>"u"){var y=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(y)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t,i;r;)n.push(r),i=e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,n){var r=tt.single_source_shortest_paths(e,t,n);return tt.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(e){var t=tt.PriorityQueue,n={},r;e=e||{};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n.queue=[],n.sorter=e.sorter||t.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Gt<"u"&&(Gt.exports=tt)});var wn=p(Q=>{var d=M(),hn=en(),dn=rn(),gn=sn(),pn=un(),et=Ft(),mt=$(),Ar=cn();function ln(e){return unescape(encodeURIComponent(e)).length}function nt(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function mn(e){let t=nt(et.NUMERIC,d.NUMERIC,e),n=nt(et.ALPHANUMERIC,d.ALPHANUMERIC,e),r,i;return mt.isKanjiModeEnabled()?(r=nt(et.BYTE,d.BYTE,e),i=nt(et.KANJI,d.KANJI,e)):(r=nt(et.BYTE_KANJI,d.BYTE,e),i=[]),t.concat(n,r,i).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function Ht(e,t){switch(t){case d.NUMERIC:return hn.getBitsLength(e);case d.ALPHANUMERIC:return dn.getBitsLength(e);case d.KANJI:return pn.getBitsLength(e);case d.BYTE:return gn.getBitsLength(e)}}function Cr(e){return e.reduce(function(t,n){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function $r(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];switch(r.mode){case d.NUMERIC:t.push([r,{data:r.data,mode:d.ALPHANUMERIC,length:r.length},{data:r.data,mode:d.BYTE,length:r.length}]);break;case d.ALPHANUMERIC:t.push([r,{data:r.data,mode:d.BYTE,length:r.length}]);break;case d.KANJI:t.push([r,{data:r.data,mode:d.BYTE,length:ln(r.data)}]);break;case d.BYTE:t.push([{data:r.data,mode:d.BYTE,length:ln(r.data)}])}}return t}function Tr(e,t){let n={},r={start:{}},i=["start"];for(let o=0;o<e.length;o++){let s=e[o],a=[];for(let u=0;u<s.length;u++){let c=s[u],f=""+o+u;a.push(f),n[f]={node:c,lastCount:0},r[f]={};for(let g=0;g<i.length;g++){let l=i[g];n[l]&&n[l].node.mode===c.mode?(r[l][f]=Ht(n[l].lastCount+c.length,c.mode)-Ht(n[l].lastCount,c.mode),n[l].lastCount+=c.length):(n[l]&&(n[l].lastCount=c.length),r[l][f]=Ht(c.length,c.mode)+4+d.getCharCountIndicator(c.mode,t))}}i=a}for(let o=0;o<i.length;o++)r[i[o]].end=0;return{map:r,table:n}}function fn(e,t){let n,r=d.getBestModeForData(e);if(n=d.from(t,r),n!==d.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+d.toString(n)+`.
4
+ Suggested mode is: `+d.toString(r));switch(n===d.KANJI&&!mt.isKanjiModeEnabled()&&(n=d.BYTE),n){case d.NUMERIC:return new hn(e);case d.ALPHANUMERIC:return new dn(e);case d.KANJI:return new pn(e);case d.BYTE:return new gn(e)}}Q.fromArray=function(t){return t.reduce(function(n,r){return typeof r=="string"?n.push(fn(r,null)):r.data&&n.push(fn(r.data,r.mode)),n},[])};Q.fromString=function(t,n){let r=mn(t,mt.isKanjiModeEnabled()),i=$r(r),o=Tr(i,n),s=Ar.find_path(o.map,"start","end"),a=[];for(let u=1;u<s.length-1;u++)a.push(o.table[s[u]].node);return Q.fromArray(Cr(a))};Q.rawSplit=function(t){return Q.fromArray(mn(t,mt.isKanjiModeEnabled()))}});var yn=p(bn=>{var bt=$(),Qt=ct(),Mr=Pe(),Lr=Ie(),Sr=Re(),Pr=Oe(),Jt=De(),Yt=kt(),Nr=ze(),wt=Ye(),Ir=Xe(),Rr=M(),Vt=wn();function kr(e,t){let n=e.size,r=Pr.getPositions(t);for(let i=0;i<r.length;i++){let o=r[i][0],s=r[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||n<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||n<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(o+a,s+u,!0,!0):e.set(o+a,s+u,!1,!0))}}function Ur(e){let t=e.size;for(let n=8;n<t-8;n++){let r=n%2===0;e.set(n,6,r,!0),e.set(6,n,r,!0)}}function Or(e,t){let n=Sr.getPositions(t);for(let r=0;r<n.length;r++){let i=n[r][0],o=n[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(i+s,o+a,!0,!0):e.set(i+s,o+a,!1,!0)}}function Dr(e,t){let n=e.size,r=wt.getEncodedBits(t),i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+n-8-3,s=(r>>a&1)===1,e.set(i,o,s,!0),e.set(o,i,s,!0)}function Kt(e,t,n){let r=e.size,i=Ir.getEncodedBits(t,n),o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function Fr(e,t){let n=e.size,r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(i,a-u)){let c=!1;s<t.length&&(c=(t[s]>>>o&1)===1),e.set(i,a-u,c),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function qr(e,t,n){let r=new Mr;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),Rr.getCharCountIndicator(u.mode,e)),u.write(r)});let i=bt.getSymbolTotalCodewords(e),o=Yt.getTotalCodewordsCount(e,t),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);let a=(s-r.getLengthInBits())/8;for(let u=0;u<a;u++)r.put(u%2?17:236,8);return vr(r,e,t)}function vr(e,t,n){let r=bt.getSymbolTotalCodewords(t),i=Yt.getTotalCodewordsCount(t,n),o=r-i,s=Yt.getBlocksCount(t,n),a=r%s,u=s-a,c=Math.floor(r/s),f=Math.floor(o/s),g=f+1,l=c-f,h=new Nr(l),w=0,y=new Array(s),Ae=new Array(s),St=0,Qn=new Uint8Array(e.buffer);for(let v=0;v<s;v++){let Nt=v<u?f:g;y[v]=Qn.slice(w,w+Nt),Ae[v]=h.encode(y[v]),w+=Nt,St=Math.max(St,Nt)}let Pt=new Uint8Array(r),Ce=0,B,A;for(B=0;B<St;B++)for(A=0;A<s;A++)B<y[A].length&&(Pt[Ce++]=y[A][B]);for(B=0;B<l;B++)for(A=0;A<s;A++)Pt[Ce++]=Ae[A][B];return Pt}function _r(e,t,n,r){let i;if(Array.isArray(e))i=Vt.fromArray(e);else if(typeof e=="string"){let c=t;if(!c){let f=Vt.rawSplit(e);c=wt.getBestVersionForData(f,n)}i=Vt.fromString(e,c||40)}else throw new Error("Invalid data");let o=wt.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
5
5
  The chosen QR Code version cannot contain this amount of data.
6
6
  Minimum version required to store current data is: `+o+`.
7
- `);let s=Fr(t,n,i),a=wt.getSymbolSize(t),u=new Tr(a);return Ir(u,t),Rr(u),kr(u,t),Qt(u,n,0),t>=7&&Ur(u,t),Dr(u,s),isNaN(r)&&(r=Vt.getBestMask(u,Qt.bind(null,u,n))),Vt.applyMask(r,u),Qt(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:i}}mn.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=Gt.M,i,o;return typeof n<"u"&&(r=Gt.from(n.errorCorrectionLevel,Gt.M),i=mt.from(n.version),o=Vt.from(n.maskPattern),n.toSJISFunc&&wt.setToSJISFunction(n.toSJISFunc)),qr(t,i,r,o)}});var Jt=p(R=>{function bn(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(r){return[r,r]}))),t.length===6&&t.push("F","F");let n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+t.slice(0,6).join("")}}R.getOptions=function(t){t||(t={}),t.color||(t.color={});let n=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:bn(t.color.dark||"#000000ff"),light:bn(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};R.getScale=function(t,n){return n.width&&n.width>=t+n.margin*2?n.width/(t+n.margin*2):n.scale};R.getImageWidth=function(t,n){let r=R.getScale(t,n);return Math.floor((t+n.margin*2)*r)};R.qrToImageData=function(t,n,r){let i=n.modules.size,o=n.modules.data,s=R.getScale(i,r),a=Math.floor((i+r.margin*2)*s),u=r.margin*s,c=[r.color.light,r.color.dark];for(let f=0;f<a;f++)for(let g=0;g<a;g++){let l=(f*a+g)*4,h=r.color.light;if(f>=u&&g>=u&&f<a-u&&g<a-u){let w=Math.floor((f-u)/s),y=Math.floor((g-u)/s);h=c[o[w*i+y]?1:0]}t[l++]=h.r,t[l++]=h.g,t[l++]=h.b,t[l]=h.a}}});var yn=p(bt=>{var Yt=Jt();function vr(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}function _r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}bt.render=function(t,n,r){let i=r,o=n;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),n||(o=_r()),i=Yt.getOptions(i);let s=Yt.getImageWidth(t.modules.size,i),a=o.getContext("2d"),u=a.createImageData(s,s);return Yt.qrToImageData(u.data,t,i),vr(a,o,s),a.putImageData(u,0,0),o};bt.renderToDataURL=function(t,n,r){let i=r;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),i||(i={});let o=bt.render(t,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}});var An=p(En=>{var zr=Jt();function xn(e,t){let n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function jt(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function Gr(e,t,n){let r="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){let u=Math.floor(a%t),c=Math.floor(a/t);!u&&!o&&(o=!0),e[a]?(s++,a>0&&u>0&&e[a-1]||(r+=o?jt("M",u+n,.5+c+n):jt("m",i,0),i=0,o=!1),u+1<t&&e[a+1]||(r+=jt("h",s),s=0)):i++}return r}En.render=function(t,n,r){let i=zr.getOptions(n),o=t.modules.size,s=t.modules.data,a=o+i.margin*2,u=i.color.light.a?"<path "+xn(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+xn(i.color.dark,"stroke")+' d="'+Gr(s,o,i.margin)+'"/>',f='viewBox="0 0 '+a+" "+a+'"',l='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+f+' shape-rendering="crispEdges">'+u+c+`</svg>
8
- `;return typeof r=="function"&&r(null,l),l}});var $n=p(nt=>{var Hr=Be(),Wt=wn(),Cn=yn(),Qr=An();function Zt(e,t,n,r,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Hr())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=t,t=r=void 0):s===3&&(t.getContext&&typeof i>"u"?(i=r,r=void 0):(i=r,r=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=r=void 0):s===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{let f=Wt.create(n,r);u(e(f,t,r))}catch(f){c(f)}})}try{let u=Wt.create(n,r);i(null,e(u,t,r))}catch(u){i(u)}}nt.create=Wt.create;nt.toCanvas=Zt.bind(null,Cn.render);nt.toDataURL=Zt.bind(null,Cn.renderToDataURL);nt.toString=Zt.bind(null,function(e,t,n){return Qr.render(e,n)})});var Bi={};jn(Bi,{LabelBuilder:()=>J,OpBuilder:()=>rt,barcodeBitmap:()=>it,bitmapToPng:()=>S,blit:()=>Tn,code128:()=>Ln,code39:()=>Rn,dotsToMm:()=>K,ean13:()=>ee,ean8:()=>In,emptyBitmap:()=>z,encodeEzpl:()=>Tt,encodeLabel:()=>$i,encodeTspl:()=>Bt,encodeZpl:()=>$t,epsonTmM30:()=>ie,epsonTmT20:()=>re,epsonTmT88:()=>ne,evaluate:()=>U,filters:()=>le,fitWidth:()=>Kr,fromRgba:()=>Vr,genericEscPos:()=>Et,genericEscPos58:()=>oe,getPixel:()=>yt,interpolate:()=>E,labelToSvg:()=>_n,lookup:()=>fe,mmToDots:()=>st,opsToHtml:()=>On,parseStyle:()=>Mn,pattern:()=>kn,profileById:()=>ai,profiles:()=>Un,qrBitmap:()=>k,render:()=>Fn,renderBlocks:()=>Q,renderLabel:()=>zn,setPixel:()=>G,starMcPrint3:()=>ue,starTsp100:()=>ce,starTsp650:()=>ae,toBase64:()=>V,truthy:()=>H,upcA:()=>Nn});var Bn=Wn($n());function z(e,t){return{width:e,height:t,bits:new Uint8Array(Math.ceil(e/8)*t)}}function G(e,t,n,r){if(t<0||n<0||t>=e.width||n>=e.height)return;let i=n*Math.ceil(e.width/8)+(t>>3),o=128>>(t&7);r?e.bits[i]|=o:e.bits[i]&=~o}function yt(e,t,n){return t<0||n<0||t>=e.width||n>=e.height?!1:(e.bits[n*Math.ceil(e.width/8)+(t>>3)]&128>>(t&7))!==0}function Vr(e,t,n,r=128){let i=z(t,n);for(let o=0;o<n;o++)for(let s=0;s<t;s++){let a=(o*t+s)*4,u=e[a+3]/255;(.299*e[a]+.587*e[a+1]+.114*e[a+2])*u+255*(1-u)<r&&G(i,s,o,!0)}return i}function Tn(e,t,n,r){for(let i=0;i<t.height;i++)for(let o=0;o<t.width;o++)yt(t,o,i)&&G(e,n+o,r+i,!0)}function Kr(e,t,n="center"){if(e.width===t)return e;let r=z(t,e.height),i=n==="left"?0:n==="right"?t-e.width:Math.floor((t-e.width)/2);return Tn(r,e,i,0),r}function k(e,t={}){let n=Bn.default.create(e,{errorCorrectionLevel:t.correction??"M"}),r=n.modules.size,i=Math.max(1,Math.min(16,Math.floor(t.size??6))),o=z(r*i,r*i);for(let s=0;s<r;s++)for(let a=0;a<r;a++)if(n.modules.get(s,a))for(let u=0;u<i;u++)for(let c=0;c<i;c++)G(o,a*i+c,s*i+u,!0);return o}var Jr={lt:"left",ct:"center",rt:"right",left:"left",center:"center",right:"right"},rt=class{constructor(t){this.profile=t;this.ops=[];this.font="a"}get operations(){return this.ops.slice()}append(t){for(let n of t)this.ops.push(n);return this}get columns(){return this.profile.columns[this.font]}push(t){return this.ops.push(t),this}raw(t){return this.push({kind:"raw",bytes:Uint8Array.from(t)})}text(t){return this.push({kind:"text",text:`${t}
9
- `})}print(t){return this.push({kind:"text",text:t})}newLine(t=1){return this.push({kind:"newline",count:t})}feed(t=1){return this.push({kind:"feed",lines:t})}align(t){let n=Jr[t];if(!n)throw new Error(`retail-print-kit: unknown align "${t}"`);return this.push({kind:"align",align:n})}setFont(t){return this.font=t,this.push({kind:"font",font:t})}size(t,n){return this.push({kind:"size",width:t,height:n})}style(t){let n=typeof t=="string"?Mn(t):t;return this.push({kind:"style",style:n})}lineSpace(t=null){return this.push({kind:"lineSpacing",dots:t})}cut(t=!1,n=3){return this.push({kind:"cut",partial:t,feed:n})}cashdraw(t=2){return this.push({kind:"drawer",pin:t})}beep(t=1,n=1){return this.push({kind:"beep",times:t,duration:n})}barcode(t,n="CODE128",r={}){return this.push({kind:"barcode",data:t,type:n,options:r})}qr(t,n={}){return this.profile.features.nativeQr||this.profile.set==="star-graphic"?this.push({kind:"qr",data:t,options:n}):this.image(k(t,n))}image(t){return this.push({kind:"raster",width:t.width,height:t.height,bits:t.bits})}qrimage(t,n={}){return this.qr(t,n)}drawLine(t="-"){return this.text(t.repeat(this.columns))}tableCustom(t,n={}){let r=n.width??this.columns,i=Yr(t,r),o=n.wrap!==!1,s=t.map((u,c)=>o?jr(u.text??"",i[c]):[String(u.text??"").slice(0,i[c])]),a=Math.max(1,...s.map(u=>u.length));for(let u=0;u<a;u++){let c="";t.forEach((f,g)=>{c+=Wr(s[g][u]??"",i[g],f.align??"LEFT")}),this.text(c.replace(/\s+$/,""))}return this}};function Mn(e){if(e==="normal")return{bold:!1,underline:0,italic:!1,invert:!1};let t=e.toLowerCase();return{bold:t.includes("b"),italic:t.includes("i"),underline:t.includes("u2")?2:t.includes("u")?1:0,invert:!1}}function Yr(e,t){let n=e.map(u=>u.width===void 0?null:u.width>1?Math.floor(u.width):Math.floor(u.width*t)),r=n.reduce((u,c)=>u+(c??0),0),i=n.filter(u=>u===null).length,o=i?Math.floor(Math.max(0,t-r)/i):0,s=n.map(u=>u===null?o:u),a=s.reduce((u,c)=>u+c,0);return a<t&&(s[s.length-1]+=t-a),s}function jr(e,t){if(t<=0)return[""];let n=[];for(let r of String(e).split(`
10
- `)){let i="";for(let o of r.split(/\s+/)){if(!o)continue;if(o.length>t){i&&n.push(i),i="";for(let a=0;a<o.length;a+=t)n.push(o.slice(a,a+t));continue}let s=i?`${i} ${o}`:o;s.length>t?(n.push(i),i=o):i=s}n.push(i)}return n.length?n:[""]}function Wr(e,t,n){let r=e.slice(0,t),i=t-r.length;if(n==="RIGHT")return" ".repeat(i)+r;if(n==="CENTER"){let o=Math.floor(i/2);return" ".repeat(o)+r+" ".repeat(i-o)}return r+" ".repeat(i)}var Zr=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232","2331112"],Xr=104,ti=105,ei=100,ni=99,ri=106;function Ln(e){if(!/^[\x20-\x7e]*$/.test(e)||!e.length)throw new Error("retail-print-kit: CODE128 needs printable ASCII");let t=[],n=0,r=null,i=a=>{let u=0;for(;a+u<e.length&&/[0-9]/.test(e[a+u]);)u++;return u};for(;n<e.length;){let a=i(n);if(a>=4||a>=2&&a===e.length-n){r!=="C"&&(t.push(r===null?ti:ni),r="C");let c=Math.floor(a/2);for(let f=0;f<c;f++)t.push(parseInt(e.slice(n,n+2),10)),n+=2;continue}r!=="B"&&(t.push(r===null?Xr:ei),r="B"),t.push(e.charCodeAt(n)-32),n++}let o=t[0];for(let a=1;a<t.length;a++)o+=t[a]*a;t.push(o%103,ri);let s=[];for(let a of t)for(let u of Zr[a])s.push(Number(u));return s}var Sn=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],ii=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],Pn=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],oi=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];function Xt(e){let t=0;for(let n=0;n<e.length;n++){let r=(e.length-n)%2===0?1:3;t+=Number(e[n])*r}return(10-t%10)%10}function te(e){let t=[],n="1",r=0;e[0]!=="1"&&t.push(0);for(let i of e)i===n?r++:(t.push(r),n=i,r=1);return t.push(r),t}function ee(e){let t=e.replace(/\D/g,"");if(t.length===12&&(t+=Xt(t)),t.length!==13)throw new Error("retail-print-kit: EAN13 needs 12 or 13 digits");let n=oi[Number(t[0])],r="101";for(let i=1;i<=6;i++)r+=(n[i-1]==="L"?Sn:ii)[Number(t[i])];r+="01010";for(let i=7;i<=12;i++)r+=Pn[Number(t[i])];return r+="101",te(r)}function Nn(e){let t=e.replace(/\D/g,"");if(t.length===11&&(t+=Xt(t)),t.length!==12)throw new Error("retail-print-kit: UPC-A needs 11 or 12 digits");return ee("0"+t)}function In(e){let t=e.replace(/\D/g,"");if(t.length===7&&(t+=Xt(t)),t.length!==8)throw new Error("retail-print-kit: EAN8 needs 7 or 8 digits");let n="101";for(let r=0;r<4;r++)n+=Sn[Number(t[r])];n+="01010";for(let r=4;r<8;r++)n+=Pn[Number(t[r])];return n+="101",te(n)}var si={0:"101001101101",1:"110100101011",2:"101100101011",3:"110110010101",4:"101001101011",5:"110100110101",6:"101100110101",7:"101001011011",8:"110100101101",9:"101100101101",A:"110101001011",B:"101101001011",C:"110110100101",D:"101011001011",E:"110101100101",F:"101101100101",G:"101010011011",H:"110101001101",I:"101101001101",J:"101011001101",K:"110101010011",L:"101101010011",M:"110110101001",N:"101011010011",O:"110101101001",P:"101101101001",Q:"101010110011",R:"110101011001",S:"101101011001",T:"101011011001",U:"110010101011",V:"100110101011",W:"110011010101",X:"100101101011",Y:"110010110101",Z:"100110110101","-":"100101011011",".":"110010101101"," ":"100110101101",$:"100100100101","/":"100100101001","+":"100101001001","%":"101001001001","*":"100101101101"};function Rn(e){let t=`*${e.toUpperCase()}*`,n="";for(let r of t){let i=si[r];if(!i)throw new Error(`retail-print-kit: CODE39 cannot encode "${r}"`);n+=i+"0"}return te(n.slice(0,-1))}function kn(e,t){switch(e){case"CODE128":return Ln(t);case"EAN13":return ee(t);case"UPC_A":return Nn(t);case"EAN8":return In(t);case"CODE39":return Rn(t);default:throw new Error(`retail-print-kit: bitmap rendering of ${e} is not implemented`)}}function it(e,t,n=2,r=80){let i=kn(e,t),o=10*n,s=i.reduce((f,g)=>f+g,0)*n+o*2,a=z(s,r),u=o,c=!0;for(let f of i){if(c)for(let g=0;g<f*n;g++)for(let l=0;l<r;l++)G(a,u+g,l,!0);u+=f*n,c=!c}return a}var xt={vendor:"Epson",set:"escpos",paper:80,dots:576,columns:{a:48,b:64},encoding:"cp437",codepage:0,cut:"feed-and-cut",drawer:{on:25,off:250},features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!1}},ne={...xt,id:"epson-tm-t88",model:"TM-T88V / VI / VII",usb:[{vendorId:1208}]},re={...xt,id:"epson-tm-t20",model:"TM-T20III",usb:[{vendorId:1208}]},ie={...xt,id:"epson-tm-m30",model:"TM-m30II / III",usb:[{vendorId:1208}]},Et={...xt,vendor:"Generic",id:"generic-escpos",model:"ESC/POS compatible 80 mm",cut:"legacy",drawer:{on:60,off:120},features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!0}},oe={...Et,id:"generic-escpos-58",model:"ESC/POS compatible 58 mm",paper:58,dots:384,columns:{a:32,b:42}};var se={vendor:"Star Micronics",paper:80,dots:576,columns:{a:48,b:64},encoding:"cp437",codepage:1,cut:"feed-and-cut",drawer:{on:100,off:100},usb:[{vendorId:1305}]},ae={...se,id:"star-tsp650",model:"TSP650II / TSP700II (Star Line Mode)",set:"star-line",features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!1}},ue={...se,id:"star-mc-print3",model:"mC-Print3 (Star Line Mode)",set:"star-line",features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!1}},ce={...se,id:"star-tsp100",model:"TSP100 / TSP143 (raster)",set:"star-graphic",codepage:null,features:{nativeQr:!1,raster:!0,italic:!1,invert:!0,beep:!1}};var Un=Object.fromEntries([ne,re,ie,Et,oe,ae,ue,ce].map(e=>[e.id,e]));function ai(e){let t=Un[e];if(!t)throw new Error(`retail-print-kit: unknown profile "${e}"`);return t}var le={upper:e=>String(e??"").toUpperCase(),lower:e=>String(e??"").toLowerCase(),trim:e=>String(e??"").trim(),money:(e,t)=>{let n=Number(e);if(!isFinite(n))return"";let r=Math.abs(n).toFixed(2);return`${n<0?"-":""}${t??""}${r}`},fixed:(e,t)=>{let n=Number(e);return isFinite(n)?n.toFixed(Number(t??2)):""},pad:(e,t)=>String(e??"").padStart(Number(t??0)),padEnd:(e,t)=>String(e??"").padEnd(Number(t??0)),default:(e,t)=>e==null||e===""?t??"":e,date:(e,t)=>{let n=e instanceof Date?e:new Date(String(e));return isNaN(n.getTime())?"":t==="time"?n.toLocaleTimeString():t==="datetime"?n.toLocaleString():n.toLocaleDateString()},count:e=>Array.isArray(e)?e.length:0};function fe(e,t){let n=e.trim();if(n==="this")return t.current;if(n==="@index")return t.index;if(n==="@number")return t.index===void 0?void 0:t.index+1;if(/^-?\d+(\.\d+)?$/.test(n))return Number(n);if(/^'.*'$/.test(n)||/^".*"$/.test(n))return n.slice(1,-1);let r=Dn(t.current,n);return r!==void 0?r:Dn(t.root,n)}function Dn(e,t){let n=e;for(let r of t.split(".")){if(n==null)return;n=n[r]}return n}function U(e,t){let[n,...r]=e.split("|").map(o=>o.trim()),i=fe(n,t);for(let o of r){let s=o.indexOf(":"),a=s===-1?o:o.slice(0,s),u=s===-1?void 0:o.slice(s+1),c=le[a];if(!c)throw new Error(`retail-print-kit: unknown template filter "${a}"`);i=c(i,u)}return i}function E(e,t){return e.replace(/\{\{([^}]+)\}\}/g,(n,r)=>{let i=U(r,t);return i==null?"":String(i)})}function H(e,t){let n=e.trim().startsWith("!"),r=U(n?e.trim().slice(1):e,t),i=Array.isArray(r)?r.length>0:!!r;return n?!i:i}var he={left:"lt",center:"ct",right:"rt"};function Fn(e,t,n){if(e.version!==1)throw new Error(`retail-print-kit: unsupported template version ${String(e.version)}`);let r=new rt(n);return Q(e.blocks,{root:t,current:t},r),r.operations}function Q(e,t,n){for(let r of e)ui(r,t,n)}function ui(e,t,n){switch(e.type){case"text":{e.align&&n.align(he[e.align]),e.font&&n.setFont(e.font),e.size&&n.size(e.size[0],e.size[1]),e.style&&n.style(e.style),n.text(E(e.value,t)),e.style&&n.style("normal"),e.size&&n.size(1,1),e.font&&n.setFont("a"),e.align&&e.align!=="left"&&n.align("lt");break}case"line":n.drawLine(e.char??"-");break;case"row":n.tableCustom(e.cells.map(r=>({text:E(r.value,t),width:r.width,align:r.align??"LEFT"})));break;case"table":{let r=U(e.rows,t);if(e.header!==!1&&e.columns.some(i=>i.header)&&n.tableCustom(e.columns.map(i=>({text:i.header??"",width:i.width,align:i.align??"LEFT"}))),!Array.isArray(r))break;r.forEach((i,o)=>{let s={root:t.root,current:i,index:o},a=e.columns.map(u=>({text:E(u.value,s),width:u.width,align:u.align??"LEFT"}));n.tableCustom(a)});break}case"feed":n.feed(e.lines??1);break;case"newline":n.newLine(e.count??1);break;case"cut":n.cut(e.partial??!1,e.feed??3);break;case"drawer":n.cashdraw(e.pin??2);break;case"qr":{e.align&&n.align(he[e.align]),n.qr(E(e.value,t),{size:e.size}),e.align&&e.align!=="left"&&n.align("lt");break}case"barcode":{e.align&&n.align(he[e.align]),n.barcode(E(e.value,t),e.format??"CODE128",{height:e.height,width:e.width,position:e.text===!1?"none":"below"}),e.align&&e.align!=="left"&&n.align("lt");break}case"each":{let r=U(e.items,t);if(!Array.isArray(r))break;r.forEach((i,o)=>Q(e.blocks,{root:t.root,current:i,index:o},n));break}case"if":H(e.when,t)?Q(e.blocks,t,n):e.else&&Q(e.else,t,n);break;default:throw new Error(`retail-print-kit: unknown template block "${e.type}"`)}}var ci=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function li(e){let t=4294967295;for(let n of e)t=ci[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}function ot(e){return[e>>>24&255,e>>>16&255,e>>>8&255,e&255]}function At(e){let t=new Uint8Array(e.reduce((r,i)=>r+i.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function de(e,t){let n=At([new Uint8Array([...e].map(r=>r.charCodeAt(0))),t]);return At([new Uint8Array(ot(t.length)),n,new Uint8Array(ot(li(n)))])}function fi(e){let t=1,n=0;for(let r of e)t=(t+r)%65521,n=(n+t)%65521;return(n<<16|t)>>>0}function hi(e){let t=[new Uint8Array([120,1])],n=65535;for(let r=0;r<e.length||r===0;r+=n){let i=e.subarray(r,Math.min(r+n,e.length)),o=r+n>=e.length?1:0,s=i.length;if(t.push(new Uint8Array([o,s&255,s>>8,~s&255,~s>>8&255]),i),e.length===0)break}return t.push(new Uint8Array(ot(fi(e)))),At(t)}function di(e){try{let n=Yn("zlib").deflateSync(e);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}catch{return hi(e)}}function S(e){let t=Math.ceil(e.width/8),n=new Uint8Array((t+1)*e.height);for(let o=0;o<e.height;o++)for(let s=0;s<e.width;s++)yt(e,s,o)||(n[o*(t+1)+1+(s>>3)]|=128>>(s&7));let r=new Uint8Array([...ot(e.width),...ot(e.height),1,0,0,0,0]),i=At([new Uint8Array([137,80,78,71,13,10,26,10]),de("IHDR",r),de("IDAT",di(n)),de("IEND",new Uint8Array(0))]);return typeof Buffer<"u"?Buffer.from(i.buffer,i.byteOffset,i.byteLength):i}var Ct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function V(e){if(typeof Buffer<"u")return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n+=3){let r=e[n],i=n+1<e.length?e[n+1]:0,o=n+2<e.length?e[n+2]:0,s=r<<16|i<<8|o;t+=Ct[s>>18&63]+Ct[s>>12&63],t+=n+1<e.length?Ct[s>>6&63]:"=",t+=n+2<e.length?Ct[s&63]:"="}return t}function ge(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function On(e,t,n={}){let r=n.cellWidth??8,i=t.columns.a*r,o={align:"left",font:"a",w:1,h:1,style:{}},s=[],a="",u=()=>{let l=[`text-align:${o.align}`];return(o.w!==1||o.h!==1)&&l.push(`transform:scale(${o.w},${o.h});transform-origin:${o.align} top`,`height:${o.h}em`),o.font==="b"&&l.push("font-size:0.78em"),o.style.bold&&l.push("font-weight:bold"),o.style.underline&&l.push(`text-decoration:underline${o.style.underline===2?" double":""}`),o.style.invert&&l.push("background:#000;color:#fff"),l.join(";")},c=l=>{if(!a&&!l)return;let h=Math.max(1,Math.floor(t.columns[o.font]/o.w)),w=[];for(let y=0;y<a.length;y+=h)w.push(a.slice(y,y+h));w.length||w.push("");for(let y of w)s.push(`<div class="l" style="${u()}">${ge(y)||"&nbsp;"}</div>`);a=""},f=(l,h,w)=>s.push(`<div class="l" style="text-align:${o.align}"><img alt="${ge(w)}" width="${Math.round(h/t.dots*i)}" src="data:image/png;base64,${V(l)}"></div>`);for(let l of e)switch(l.kind){case"text":{let h=l.text.split(`
11
- `);for(let w=0;w<h.length;w++)a+=h[w],w<h.length-1&&c(!0);break}case"newline":for(let h=0;h<l.count;h++)c(!0);break;case"feed":c(!1);for(let h=0;h<l.lines;h++)s.push('<div class="l">&nbsp;</div>');break;case"align":c(!1),o.align=l.align;break;case"font":c(!1),o.font=l.font;break;case"size":c(!1),o.w=l.width,o.h=l.height;break;case"style":c(!1),o.style=l.style;break;case"qr":{c(!1);let h=k(l.data,l.options);f(S(h),h.width,`QR ${l.data}`);break}case"barcode":{c(!1);let h=it(l.type,l.data,l.options.width??2,l.options.height??80);f(S(h),h.width,`${l.type} ${l.data}`);let w=l.options.position??"below";(w==="below"||w==="both")&&(a=l.data,c(!0));break}case"raster":{c(!1),f(S({width:l.width,height:l.height,bits:l.bits}),l.width,"image");break}case"cut":c(!1),s.push('<div class="cut"></div>');break;case"drawer":c(!1),s.push('<div class="note">[drawer kick]</div>');break;default:break}c(!1);let g=`<div class="paper" style="width:${i}px">${s.join("")}</div>`;return n.document===!1?g:`<!doctype html><html><head><meta charset="utf-8"><title>${ge(t.model)} preview</title><style>
7
+ `);let s=qr(t,n,i),a=bt.getSymbolSize(t),u=new Lr(a);return kr(u,t),Ur(u),Or(u,t),Kt(u,n,0),t>=7&&Dr(u,t),Fr(u,s),isNaN(r)&&(r=Jt.getBestMask(u,Kt.bind(null,u,n))),Jt.applyMask(r,u),Kt(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:i}}bn.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=Qt.M,i,o;return typeof n<"u"&&(r=Qt.from(n.errorCorrectionLevel,Qt.M),i=wt.from(n.version),o=Jt.from(n.maskPattern),n.toSJISFunc&&bt.setToSJISFunction(n.toSJISFunc)),_r(t,i,r,o)}});var jt=p(U=>{function xn(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(r){return[r,r]}))),t.length===6&&t.push("F","F");let n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+t.slice(0,6).join("")}}U.getOptions=function(t){t||(t={}),t.color||(t.color={});let n=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:xn(t.color.dark||"#000000ff"),light:xn(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};U.getScale=function(t,n){return n.width&&n.width>=t+n.margin*2?n.width/(t+n.margin*2):n.scale};U.getImageWidth=function(t,n){let r=U.getScale(t,n);return Math.floor((t+n.margin*2)*r)};U.qrToImageData=function(t,n,r){let i=n.modules.size,o=n.modules.data,s=U.getScale(i,r),a=Math.floor((i+r.margin*2)*s),u=r.margin*s,c=[r.color.light,r.color.dark];for(let f=0;f<a;f++)for(let g=0;g<a;g++){let l=(f*a+g)*4,h=r.color.light;if(f>=u&&g>=u&&f<a-u&&g<a-u){let w=Math.floor((f-u)/s),y=Math.floor((g-u)/s);h=c[o[w*i+y]?1:0]}t[l++]=h.r,t[l++]=h.g,t[l++]=h.b,t[l]=h.a}}});var En=p(yt=>{var Zt=jt();function zr(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}function Gr(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}yt.render=function(t,n,r){let i=r,o=n;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),n||(o=Gr()),i=Zt.getOptions(i);let s=Zt.getImageWidth(t.modules.size,i),a=o.getContext("2d"),u=a.createImageData(s,s);return Zt.qrToImageData(u.data,t,i),zr(a,o,s),a.putImageData(u,0,0),o};yt.renderToDataURL=function(t,n,r){let i=r;typeof i>"u"&&(!n||!n.getContext)&&(i=n,n=void 0),i||(i={});let o=yt.render(t,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}});var Cn=p(An=>{var Hr=jt();function Bn(e,t){let n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Wt(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function Qr(e,t,n){let r="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){let u=Math.floor(a%t),c=Math.floor(a/t);!u&&!o&&(o=!0),e[a]?(s++,a>0&&u>0&&e[a-1]||(r+=o?Wt("M",u+n,.5+c+n):Wt("m",i,0),i=0,o=!1),u+1<t&&e[a+1]||(r+=Wt("h",s),s=0)):i++}return r}An.render=function(t,n,r){let i=Hr.getOptions(n),o=t.modules.size,s=t.modules.data,a=o+i.margin*2,u=i.color.light.a?"<path "+Bn(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+Bn(i.color.dark,"stroke")+' d="'+Qr(s,o,i.margin)+'"/>',f='viewBox="0 0 '+a+" "+a+'"',l='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+f+' shape-rendering="crispEdges">'+u+c+`</svg>
8
+ `;return typeof r=="function"&&r(null,l),l}});var Tn=p(rt=>{var Vr=Me(),Xt=yn(),$n=En(),Kr=Cn();function te(e,t,n,r,i){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Vr())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=t,t=r=void 0):s===3&&(t.getContext&&typeof i>"u"?(i=r,r=void 0):(i=r,r=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=r=void 0):s===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{let f=Xt.create(n,r);u(e(f,t,r))}catch(f){c(f)}})}try{let u=Xt.create(n,r);i(null,e(u,t,r))}catch(u){i(u)}}rt.create=Xt.create;rt.toCanvas=te.bind(null,$n.render);rt.toDataURL=te.bind(null,$n.renderToDataURL);rt.toString=te.bind(null,function(e,t,n){return Kr.render(e,n)})});var Si={};Wn(Si,{LabelBuilder:()=>Y,OpBuilder:()=>it,barcodeBitmap:()=>ot,bitmapToPng:()=>N,blit:()=>Ln,code128:()=>Pn,code39:()=>Un,deserializeBitmap:()=>ee,ditherRgba:()=>jr,dotsToMm:()=>J,ean13:()=>ie,ean8:()=>kn,emptyBitmap:()=>O,encodeEzpl:()=>Lt,encodeLabel:()=>Li,encodeTspl:()=>Mt,encodeZpl:()=>Tt,epsonTmM30:()=>ae,epsonTmT20:()=>se,epsonTmT88:()=>oe,evaluate:()=>q,filters:()=>de,fitWidth:()=>Yr,fromBase64:()=>xt,fromRgba:()=>Jr,genericEscPos:()=>At,genericEscPos58:()=>ue,getPixel:()=>Et,interpolate:()=>E,labelToSvg:()=>Gn,lookup:()=>ge,mmToDots:()=>at,opsToHtml:()=>vn,parseStyle:()=>Sn,pattern:()=>On,profileById:()=>fi,profiles:()=>Dn,qrBitmap:()=>F,render:()=>qn,renderBlocks:()=>K,renderLabel:()=>Hn,serializeBitmap:()=>Zr,setPixel:()=>D,starMcPrint3:()=>fe,starTsp100:()=>he,starTsp650:()=>le,toBase64:()=>P,truthy:()=>V,upcA:()=>Rn});var Mn=Xn(Tn());var S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function P(e){if(typeof Buffer<"u")return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n+=3){let r=e[n],i=n+1<e.length?e[n+1]:0,o=n+2<e.length?e[n+2]:0,s=r<<16|i<<8|o;t+=S[s>>18&63]+S[s>>12&63],t+=n+1<e.length?S[s>>6&63]:"=",t+=n+2<e.length?S[s&63]:"="}return t}function xt(e){if(typeof Buffer<"u"){let i=Buffer.from(e,"base64");return new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let t=e.replace(/[^A-Za-z0-9+/]/g,""),n=new Uint8Array(Math.floor(t.length*3/4)),r=0;for(let i=0;i<t.length;i+=4){let o=S.indexOf(t[i])<<18|S.indexOf(t[i+1])<<12|(S.indexOf(t[i+2])&63)<<6|S.indexOf(t[i+3])&63;n[r++]=o>>16&255,i+2<t.length&&(n[r++]=o>>8&255),i+3<t.length&&(n[r++]=o&255)}return n.subarray(0,r)}function O(e,t){return{width:e,height:t,bits:new Uint8Array(Math.ceil(e/8)*t)}}function D(e,t,n,r){if(t<0||n<0||t>=e.width||n>=e.height)return;let i=n*Math.ceil(e.width/8)+(t>>3),o=128>>(t&7);r?e.bits[i]|=o:e.bits[i]&=~o}function Et(e,t,n){return t<0||n<0||t>=e.width||n>=e.height?!1:(e.bits[n*Math.ceil(e.width/8)+(t>>3)]&128>>(t&7))!==0}function Jr(e,t,n,r=128){let i=O(t,n);for(let o=0;o<n;o++)for(let s=0;s<t;s++){let a=(o*t+s)*4,u=e[a+3]/255;(.299*e[a]+.587*e[a+1]+.114*e[a+2])*u+255*(1-u)<r&&D(i,s,o,!0)}return i}function Ln(e,t,n,r){for(let i=0;i<t.height;i++)for(let o=0;o<t.width;o++)Et(t,o,i)&&D(e,n+o,r+i,!0)}function Yr(e,t,n="center"){if(e.width===t)return e;let r=O(t,e.height),i=n==="left"?0:n==="right"?t-e.width:Math.floor((t-e.width)/2);return Ln(r,e,i,0),r}function F(e,t={}){let n=Mn.default.create(e,{errorCorrectionLevel:t.correction??"M"}),r=n.modules.size,i=Math.max(1,Math.min(16,Math.floor(t.size??6))),o=O(r*i,r*i);for(let s=0;s<r;s++)for(let a=0;a<r;a++)if(n.modules.get(s,a))for(let u=0;u<i;u++)for(let c=0;c<i;c++)D(o,a*i+c,s*i+u,!0);return o}function jr(e,t,n){let r=new Float32Array(t*n);for(let o=0;o<t*n;o++){let s=e[o*4+3]/255;r[o]=(.299*e[o*4]+.587*e[o*4+1]+.114*e[o*4+2])*s+255*(1-s)}let i=O(t,n);for(let o=0;o<n;o++)for(let s=0;s<t;s++){let a=o*t+s,u=r[a],c=u<128;c&&D(i,s,o,!0);let f=u-(c?0:255);s+1<t&&(r[a+1]+=f*7/16),o+1<n&&(s>0&&(r[a+t-1]+=f*3/16),r[a+t]+=f*5/16,s+1<t&&(r[a+t+1]+=f/16))}return i}function Zr(e){return{width:e.width,height:e.height,data:P(e.bits)}}function ee(e){let t=xt(e.data),n=Math.ceil(e.width/8)*e.height;if(t.length!==n)throw new Error(`retail-print-kit: bitmap data is ${t.length} bytes, expected ${n}`);return{width:e.width,height:e.height,bits:t}}var Wr={lt:"left",ct:"center",rt:"right",left:"left",center:"center",right:"right"},it=class{constructor(t){this.profile=t;this.ops=[];this.font="a"}get operations(){return this.ops.slice()}append(t){for(let n of t)this.ops.push(n);return this}get columns(){return this.profile.columns[this.font]}push(t){return this.ops.push(t),this}raw(t){return this.push({kind:"raw",bytes:Uint8Array.from(t)})}text(t){return this.push({kind:"text",text:`${t}
9
+ `})}print(t){return this.push({kind:"text",text:t})}newLine(t=1){return this.push({kind:"newline",count:t})}feed(t=1){return this.push({kind:"feed",lines:t})}align(t){let n=Wr[t];if(!n)throw new Error(`retail-print-kit: unknown align "${t}"`);return this.push({kind:"align",align:n})}setFont(t){return this.font=t,this.push({kind:"font",font:t})}size(t,n){return this.push({kind:"size",width:t,height:n})}style(t){let n=typeof t=="string"?Sn(t):t;return this.push({kind:"style",style:n})}lineSpace(t=null){return this.push({kind:"lineSpacing",dots:t})}cut(t=!1,n=3){return this.push({kind:"cut",partial:t,feed:n})}cashdraw(t=2){return this.push({kind:"drawer",pin:t})}beep(t=1,n=1){return this.push({kind:"beep",times:t,duration:n})}barcode(t,n="CODE128",r={}){return this.push({kind:"barcode",data:t,type:n,options:r})}qr(t,n={}){return this.profile.features.nativeQr||this.profile.set==="star-graphic"?this.push({kind:"qr",data:t,options:n}):this.image(F(t,n))}image(t){return this.push({kind:"raster",width:t.width,height:t.height,bits:t.bits})}qrimage(t,n={}){return this.qr(t,n)}drawLine(t="-"){return this.text(t.repeat(this.columns))}tableCustom(t,n={}){let r=n.width??this.columns,i=Xr(t,r),o=n.wrap!==!1,s=t.map((u,c)=>o?ti(u.text??"",i[c]):[String(u.text??"").slice(0,i[c])]),a=Math.max(1,...s.map(u=>u.length));for(let u=0;u<a;u++){let c="";t.forEach((f,g)=>{c+=ei(s[g][u]??"",i[g],f.align??"LEFT")}),this.text(c.replace(/\s+$/,""))}return this}};function Sn(e){if(e==="normal")return{bold:!1,underline:0,italic:!1,invert:!1};let t=e.toLowerCase();return{bold:t.includes("b"),italic:t.includes("i"),underline:t.includes("u2")?2:t.includes("u")?1:0,invert:!1}}function Xr(e,t){let n=e.map(u=>u.width===void 0?null:u.width>1?Math.floor(u.width):Math.floor(u.width*t)),r=n.reduce((u,c)=>u+(c??0),0),i=n.filter(u=>u===null).length,o=i?Math.floor(Math.max(0,t-r)/i):0,s=n.map(u=>u===null?o:u),a=s.reduce((u,c)=>u+c,0);return a<t&&(s[s.length-1]+=t-a),s}function ti(e,t){if(t<=0)return[""];let n=[];for(let r of String(e).split(`
10
+ `)){let i="";for(let o of r.split(/\s+/)){if(!o)continue;if(o.length>t){i&&n.push(i),i="";for(let a=0;a<o.length;a+=t)n.push(o.slice(a,a+t));continue}let s=i?`${i} ${o}`:o;s.length>t?(n.push(i),i=o):i=s}n.push(i)}return n.length?n:[""]}function ei(e,t,n){let r=e.slice(0,t),i=t-r.length;if(n==="RIGHT")return" ".repeat(i)+r;if(n==="CENTER"){let o=Math.floor(i/2);return" ".repeat(o)+r+" ".repeat(i-o)}return r+" ".repeat(i)}var ni=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232","2331112"],ri=104,ii=105,oi=100,si=99,ai=106;function Pn(e){if(!/^[\x20-\x7e]*$/.test(e)||!e.length)throw new Error("retail-print-kit: CODE128 needs printable ASCII");let t=[],n=0,r=null,i=a=>{let u=0;for(;a+u<e.length&&/[0-9]/.test(e[a+u]);)u++;return u};for(;n<e.length;){let a=i(n);if(a>=4||a>=2&&a===e.length-n){r!=="C"&&(t.push(r===null?ii:si),r="C");let c=Math.floor(a/2);for(let f=0;f<c;f++)t.push(parseInt(e.slice(n,n+2),10)),n+=2;continue}r!=="B"&&(t.push(r===null?ri:oi),r="B"),t.push(e.charCodeAt(n)-32),n++}let o=t[0];for(let a=1;a<t.length;a++)o+=t[a]*a;t.push(o%103,ai);let s=[];for(let a of t)for(let u of ni[a])s.push(Number(u));return s}var Nn=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],ui=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],In=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],ci=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];function ne(e){let t=0;for(let n=0;n<e.length;n++){let r=(e.length-n)%2===0?1:3;t+=Number(e[n])*r}return(10-t%10)%10}function re(e){let t=[],n="1",r=0;e[0]!=="1"&&t.push(0);for(let i of e)i===n?r++:(t.push(r),n=i,r=1);return t.push(r),t}function ie(e){let t=e.replace(/\D/g,"");if(t.length===12&&(t+=ne(t)),t.length!==13)throw new Error("retail-print-kit: EAN13 needs 12 or 13 digits");let n=ci[Number(t[0])],r="101";for(let i=1;i<=6;i++)r+=(n[i-1]==="L"?Nn:ui)[Number(t[i])];r+="01010";for(let i=7;i<=12;i++)r+=In[Number(t[i])];return r+="101",re(r)}function Rn(e){let t=e.replace(/\D/g,"");if(t.length===11&&(t+=ne(t)),t.length!==12)throw new Error("retail-print-kit: UPC-A needs 11 or 12 digits");return ie("0"+t)}function kn(e){let t=e.replace(/\D/g,"");if(t.length===7&&(t+=ne(t)),t.length!==8)throw new Error("retail-print-kit: EAN8 needs 7 or 8 digits");let n="101";for(let r=0;r<4;r++)n+=Nn[Number(t[r])];n+="01010";for(let r=4;r<8;r++)n+=In[Number(t[r])];return n+="101",re(n)}var li={0:"101001101101",1:"110100101011",2:"101100101011",3:"110110010101",4:"101001101011",5:"110100110101",6:"101100110101",7:"101001011011",8:"110100101101",9:"101100101101",A:"110101001011",B:"101101001011",C:"110110100101",D:"101011001011",E:"110101100101",F:"101101100101",G:"101010011011",H:"110101001101",I:"101101001101",J:"101011001101",K:"110101010011",L:"101101010011",M:"110110101001",N:"101011010011",O:"110101101001",P:"101101101001",Q:"101010110011",R:"110101011001",S:"101101011001",T:"101011011001",U:"110010101011",V:"100110101011",W:"110011010101",X:"100101101011",Y:"110010110101",Z:"100110110101","-":"100101011011",".":"110010101101"," ":"100110101101",$:"100100100101","/":"100100101001","+":"100101001001","%":"101001001001","*":"100101101101"};function Un(e){let t=`*${e.toUpperCase()}*`,n="";for(let r of t){let i=li[r];if(!i)throw new Error(`retail-print-kit: CODE39 cannot encode "${r}"`);n+=i+"0"}return re(n.slice(0,-1))}function On(e,t){switch(e){case"CODE128":return Pn(t);case"EAN13":return ie(t);case"UPC_A":return Rn(t);case"EAN8":return kn(t);case"CODE39":return Un(t);default:throw new Error(`retail-print-kit: bitmap rendering of ${e} is not implemented`)}}function ot(e,t,n=2,r=80){let i=On(e,t),o=10*n,s=i.reduce((f,g)=>f+g,0)*n+o*2,a=O(s,r),u=o,c=!0;for(let f of i){if(c)for(let g=0;g<f*n;g++)for(let l=0;l<r;l++)D(a,u+g,l,!0);u+=f*n,c=!c}return a}var Bt={vendor:"Epson",set:"escpos",paper:80,dots:576,columns:{a:48,b:64},encoding:"cp437",codepage:0,cut:"feed-and-cut",drawer:{on:25,off:250},features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!1}},oe={...Bt,id:"epson-tm-t88",model:"TM-T88V / VI / VII",usb:[{vendorId:1208}]},se={...Bt,id:"epson-tm-t20",model:"TM-T20III",usb:[{vendorId:1208}]},ae={...Bt,id:"epson-tm-m30",model:"TM-m30II / III",usb:[{vendorId:1208}]},At={...Bt,vendor:"Generic",id:"generic-escpos",model:"ESC/POS compatible 80 mm",cut:"legacy",drawer:{on:60,off:120},features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!0}},ue={...At,id:"generic-escpos-58",model:"ESC/POS compatible 58 mm",paper:58,dots:384,columns:{a:32,b:42}};var ce={vendor:"Star Micronics",paper:80,dots:576,columns:{a:48,b:64},encoding:"cp437",codepage:1,cut:"feed-and-cut",drawer:{on:100,off:100},usb:[{vendorId:1305}]},le={...ce,id:"star-tsp650",model:"TSP650II / TSP700II (Star Line Mode)",set:"star-line",features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!1}},fe={...ce,id:"star-mc-print3",model:"mC-Print3 (Star Line Mode)",set:"star-line",features:{nativeQr:!0,raster:!0,italic:!1,invert:!0,beep:!1}},he={...ce,id:"star-tsp100",model:"TSP100 / TSP143 (raster)",set:"star-graphic",codepage:null,features:{nativeQr:!1,raster:!0,italic:!1,invert:!0,beep:!1}};var Dn=Object.fromEntries([oe,se,ae,At,ue,le,fe,he].map(e=>[e.id,e]));function fi(e){let t=Dn[e];if(!t)throw new Error(`retail-print-kit: unknown profile "${e}"`);return t}var de={upper:e=>String(e??"").toUpperCase(),lower:e=>String(e??"").toLowerCase(),trim:e=>String(e??"").trim(),money:(e,t)=>{let n=Number(e);if(!isFinite(n))return"";let r=Math.abs(n).toFixed(2);return`${n<0?"-":""}${t??""}${r}`},fixed:(e,t)=>{let n=Number(e);return isFinite(n)?n.toFixed(Number(t??2)):""},pad:(e,t)=>String(e??"").padStart(Number(t??0)),padEnd:(e,t)=>String(e??"").padEnd(Number(t??0)),default:(e,t)=>e==null||e===""?t??"":e,date:(e,t)=>{let n=e instanceof Date?e:new Date(String(e));return isNaN(n.getTime())?"":t==="time"?n.toLocaleTimeString():t==="datetime"?n.toLocaleString():n.toLocaleDateString()},count:e=>Array.isArray(e)?e.length:0};function ge(e,t){let n=e.trim();if(n==="this")return t.current;if(n==="@index")return t.index;if(n==="@number")return t.index===void 0?void 0:t.index+1;if(/^-?\d+(\.\d+)?$/.test(n))return Number(n);if(/^'.*'$/.test(n)||/^".*"$/.test(n))return n.slice(1,-1);let r=Fn(t.current,n);return r!==void 0?r:Fn(t.root,n)}function Fn(e,t){let n=e;for(let r of t.split(".")){if(n==null)return;n=n[r]}return n}function q(e,t){let[n,...r]=e.split("|").map(o=>o.trim()),i=ge(n,t);for(let o of r){let s=o.indexOf(":"),a=s===-1?o:o.slice(0,s),u=s===-1?void 0:o.slice(s+1),c=de[a];if(!c)throw new Error(`retail-print-kit: unknown template filter "${a}"`);i=c(i,u)}return i}function E(e,t){return e.replace(/\{\{([^}]+)\}\}/g,(n,r)=>{let i=q(r,t);return i==null?"":String(i)})}function V(e,t){let n=e.trim().startsWith("!"),r=q(n?e.trim().slice(1):e,t),i=Array.isArray(r)?r.length>0:!!r;return n?!i:i}var Ct={left:"lt",center:"ct",right:"rt"};function qn(e,t,n){if(e.version!==1)throw new Error(`retail-print-kit: unsupported template version ${String(e.version)}`);let r=new it(n);return K(e.blocks,{root:t,current:t},r),r.operations}function K(e,t,n){for(let r of e)hi(r,t,n)}function hi(e,t,n){switch(e.type){case"text":{e.align&&n.align(Ct[e.align]),e.font&&n.setFont(e.font),e.size&&n.size(e.size[0],e.size[1]),e.style&&n.style(e.style),n.text(E(e.value,t)),e.style&&n.style("normal"),e.size&&n.size(1,1),e.font&&n.setFont("a"),e.align&&e.align!=="left"&&n.align("lt");break}case"line":n.drawLine(e.char??"-");break;case"row":n.tableCustom(e.cells.map(r=>({text:E(r.value,t),width:r.width,align:r.align??"LEFT"})));break;case"table":{let r=q(e.rows,t);if(e.header!==!1&&e.columns.some(i=>i.header)&&n.tableCustom(e.columns.map(i=>({text:i.header??"",width:i.width,align:i.align??"LEFT"}))),!Array.isArray(r))break;r.forEach((i,o)=>{let s={root:t.root,current:i,index:o},a=e.columns.map(u=>({text:E(u.value,s),width:u.width,align:u.align??"LEFT"}));n.tableCustom(a)});break}case"feed":n.feed(e.lines??1);break;case"newline":n.newLine(e.count??1);break;case"cut":n.cut(e.partial??!1,e.feed??3);break;case"drawer":n.cashdraw(e.pin??2);break;case"qr":{e.align&&n.align(Ct[e.align]),n.qr(E(e.value,t),{size:e.size}),e.align&&e.align!=="left"&&n.align("lt");break}case"barcode":{e.align&&n.align(Ct[e.align]),n.barcode(E(e.value,t),e.format??"CODE128",{height:e.height,width:e.width,position:e.text===!1?"none":"below"}),e.align&&e.align!=="left"&&n.align("lt");break}case"image":{e.align&&n.align(Ct[e.align]),n.image(ee(e)),e.align&&e.align!=="left"&&n.align("lt");break}case"each":{let r=q(e.items,t);if(!Array.isArray(r))break;r.forEach((i,o)=>K(e.blocks,{root:t.root,current:i,index:o},n));break}case"if":V(e.when,t)?K(e.blocks,t,n):e.else&&K(e.else,t,n);break;default:throw new Error(`retail-print-kit: unknown template block "${e.type}"`)}}var di=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function gi(e){let t=4294967295;for(let n of e)t=di[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}function st(e){return[e>>>24&255,e>>>16&255,e>>>8&255,e&255]}function $t(e){let t=new Uint8Array(e.reduce((r,i)=>r+i.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function pe(e,t){let n=$t([new Uint8Array([...e].map(r=>r.charCodeAt(0))),t]);return $t([new Uint8Array(st(t.length)),n,new Uint8Array(st(gi(n)))])}function pi(e){let t=1,n=0;for(let r of e)t=(t+r)%65521,n=(n+t)%65521;return(n<<16|t)>>>0}function mi(e){let t=[new Uint8Array([120,1])],n=65535;for(let r=0;r<e.length||r===0;r+=n){let i=e.subarray(r,Math.min(r+n,e.length)),o=r+n>=e.length?1:0,s=i.length;if(t.push(new Uint8Array([o,s&255,s>>8,~s&255,~s>>8&255]),i),e.length===0)break}return t.push(new Uint8Array(st(pi(e)))),$t(t)}function wi(e){try{let n=Zn("zlib").deflateSync(e);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}catch{return mi(e)}}function N(e){let t=Math.ceil(e.width/8),n=new Uint8Array((t+1)*e.height);for(let o=0;o<e.height;o++)for(let s=0;s<e.width;s++)Et(e,s,o)||(n[o*(t+1)+1+(s>>3)]|=128>>(s&7));let r=new Uint8Array([...st(e.width),...st(e.height),1,0,0,0,0]),i=$t([new Uint8Array([137,80,78,71,13,10,26,10]),pe("IHDR",r),pe("IDAT",wi(n)),pe("IEND",new Uint8Array(0))]);return typeof Buffer<"u"?Buffer.from(i.buffer,i.byteOffset,i.byteLength):i}function me(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vn(e,t,n={}){let r=n.cellWidth??8,i=t.columns.a*r,o={align:"left",font:"a",w:1,h:1,style:{}},s=[],a="",u=()=>{let l=[`text-align:${o.align}`];return(o.w!==1||o.h!==1)&&l.push(`transform:scale(${o.w},${o.h});transform-origin:${o.align} top`,`height:${o.h}em`),o.font==="b"&&l.push("font-size:0.78em"),o.style.bold&&l.push("font-weight:bold"),o.style.underline&&l.push(`text-decoration:underline${o.style.underline===2?" double":""}`),o.style.invert&&l.push("background:#000;color:#fff"),l.join(";")},c=l=>{if(!a&&!l)return;let h=Math.max(1,Math.floor(t.columns[o.font]/o.w)),w=[];for(let y=0;y<a.length;y+=h)w.push(a.slice(y,y+h));w.length||w.push("");for(let y of w)s.push(`<div class="l" style="${u()}">${me(y)||"&nbsp;"}</div>`);a=""},f=(l,h,w)=>s.push(`<div class="l" style="text-align:${o.align}"><img alt="${me(w)}" width="${Math.round(h/t.dots*i)}" src="data:image/png;base64,${P(l)}"></div>`);for(let l of e)switch(l.kind){case"text":{let h=l.text.split(`
11
+ `);for(let w=0;w<h.length;w++)a+=h[w],w<h.length-1&&c(!0);break}case"newline":for(let h=0;h<l.count;h++)c(!0);break;case"feed":c(!1);for(let h=0;h<l.lines;h++)s.push('<div class="l">&nbsp;</div>');break;case"align":c(!1),o.align=l.align;break;case"font":c(!1),o.font=l.font;break;case"size":c(!1),o.w=l.width,o.h=l.height;break;case"style":c(!1),o.style=l.style;break;case"qr":{c(!1);let h=F(l.data,l.options);f(N(h),h.width,`QR ${l.data}`);break}case"barcode":{c(!1);let h=ot(l.type,l.data,l.options.width??2,l.options.height??80);f(N(h),h.width,`${l.type} ${l.data}`);let w=l.options.position??"below";(w==="below"||w==="both")&&(a=l.data,c(!0));break}case"raster":{c(!1),f(N({width:l.width,height:l.height,bits:l.bits}),l.width,"image");break}case"cut":c(!1),s.push('<div class="cut"></div>');break;case"drawer":c(!1),s.push('<div class="note">[drawer kick]</div>');break;default:break}c(!1);let g=`<div class="paper" style="width:${i}px">${s.join("")}</div>`;return n.document===!1?g:`<!doctype html><html><head><meta charset="utf-8"><title>${me(t.model)} preview</title><style>
12
12
  body{background:#777;margin:0;padding:16px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:${r*1.6}px;line-height:1.25}
13
13
  .paper{background:#fff;color:#000;padding:12px ${r}px;margin:0 auto;box-shadow:0 2px 8px rgba(0,0,0,.4);box-sizing:content-box}
14
14
  .l{white-space:pre;overflow:hidden;min-height:1.25em}
15
15
  .cut{border-top:2px dashed #999;margin:6px -${r}px}
16
16
  .note{color:#999;font-size:.7em;text-align:center}
17
17
  img{image-rendering:pixelated;vertical-align:top}
18
- </style></head><body>${g}</body></html>`}var pe={0:"N",90:"R",180:"I",270:"B"},gi={CODE128:"BC",EAN13:"BE",EAN8:"B8",UPC_A:"BU",UPC_E:"B9",CODE39:"B3",ITF:"B2",CODABAR:"BK"};function me(e){return e.replace(/[\^~\\]/g,t=>`\\${t}`)}function pi(e){let t=Math.ceil(e.width/8),n="";for(let r=0;r<e.bits.length;r++)n+=e.bits[r].toString(16).padStart(2,"0").toUpperCase();return`${t*e.height},${t*e.height},${t},${n}`}function mi(e){let t=`^FO${Math.round(e.x)},${Math.round(e.y)}`;switch(e.kind){case"text":{let n=Math.round(e.width??e.height*.9),r=e.invert?"^FR":"";return`${t}${r}^A0${pe[e.rotation??0]},${Math.round(e.height)},${n}^FD${me(e.text)}^FS`}case"barcode":{let n=gi[e.type];if(!n)throw new Error(`retail-print-kit: ZPL has no ${e.type}`);let r=e.text===!1?"N":"Y",i=e.type==="CODE128"?`,${r},N,N`:`,${r},N`;return`${t}^BY${e.module??2},2,${Math.round(e.height)}^${n}${pe[e.rotation??0]},${Math.round(e.height)}${i}^FD${me(e.data)}^FS`}case"qr":{let n=e.correction??"M";return`${t}^BQ${pe[e.rotation??0]},2,${e.module??4}^FD${n}A,${me(e.data)}^FS`}case"box":return`${t}^GB${Math.round(e.width)},${Math.round(e.height)},${e.thickness??2}^FS`;case"rect":return`${t}^GB${Math.round(e.width)},${Math.round(e.height)},${Math.round(Math.min(e.width,e.height))}^FS`;case"image":return`${t}^GFA,${pi(e.bitmap)}^FS`}}function $t(e){let t=["^XA","^CI28",`^PW${e.width}`,`^LL${e.height}`,"^LH0,0"];e.speed!==void 0&&t.push(`^PR${Math.round(e.speed)}`),e.darkness!==void 0&&t.push(`^MD${Math.round(e.darkness*2-15)}`);for(let n of e.ops)t.push(mi(n));return t.push(`^PQ${e.copies},0,1,Y`,"^XZ"),t.join(`
18
+ </style></head><body>${g}</body></html>`}var we={0:"N",90:"R",180:"I",270:"B"},bi={CODE128:"BC",EAN13:"BE",EAN8:"B8",UPC_A:"BU",UPC_E:"B9",CODE39:"B3",ITF:"B2",CODABAR:"BK"};function be(e){return e.replace(/[\^~\\]/g,t=>`\\${t}`)}function yi(e){let t=Math.ceil(e.width/8),n="";for(let r=0;r<e.bits.length;r++)n+=e.bits[r].toString(16).padStart(2,"0").toUpperCase();return`${t*e.height},${t*e.height},${t},${n}`}function xi(e){let t=`^FO${Math.round(e.x)},${Math.round(e.y)}`;switch(e.kind){case"text":{let n=Math.round(e.width??e.height*.9),r=e.invert?"^FR":"";return`${t}${r}^A0${we[e.rotation??0]},${Math.round(e.height)},${n}^FD${be(e.text)}^FS`}case"barcode":{let n=bi[e.type];if(!n)throw new Error(`retail-print-kit: ZPL has no ${e.type}`);let r=e.text===!1?"N":"Y",i=e.type==="CODE128"?`,${r},N,N`:`,${r},N`;return`${t}^BY${e.module??2},2,${Math.round(e.height)}^${n}${we[e.rotation??0]},${Math.round(e.height)}${i}^FD${be(e.data)}^FS`}case"qr":{let n=e.correction??"M";return`${t}^BQ${we[e.rotation??0]},2,${e.module??4}^FD${n}A,${be(e.data)}^FS`}case"box":return`${t}^GB${Math.round(e.width)},${Math.round(e.height)},${e.thickness??2}^FS`;case"rect":return`${t}^GB${Math.round(e.width)},${Math.round(e.height)},${Math.round(Math.min(e.width,e.height))}^FS`;case"image":return`${t}^GFA,${yi(e.bitmap)}^FS`}}function Tt(e){let t=["^XA","^CI28",`^PW${e.width}`,`^LL${e.height}`,"^LH0,0"];e.speed!==void 0&&t.push(`^PR${Math.round(e.speed)}`),e.darkness!==void 0&&t.push(`^MD${Math.round(e.darkness*2-15)}`);for(let n of e.ops)t.push(xi(n));return t.push(`^PQ${e.copies},0,1,Y`,"^XZ"),t.join(`
19
19
  `)+`
20
- `}function st(e,t){return Math.round(e/25.4*t)}function K(e,t){return e/t*25.4}var wi={CODE128:"128",EAN13:"EAN13",EAN8:"EAN8",UPC_A:"UPCA",UPC_E:"UPCE",CODE39:"39",ITF:"ITF",CODABAR:"CODA"};function we(e){return`"${e.replace(/"/g,'\\["]')}"`}function qn(e,t){return K(e,t).toFixed(2)}function bi(e){let t=new Uint8Array(e.bits.length);for(let n=0;n<e.bits.length;n++)t[n]=~e.bits[n]&255;return t}function yi(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=o=>o??0;switch(e.kind){case"text":{let o=Math.round(e.height),s=Math.round(e.width??e.height*.9),a=`TEXT ${n},${r},"0",${i(e.rotation)},${s},${o},${we(e.text)}`;return e.invert?`${a}
21
- REVERSE ${n},${r},${Math.round(s*e.text.length*.6)},${o}`:a}case"barcode":{let o=wi[e.type];if(!o)throw new Error(`retail-print-kit: TSPL has no ${e.type}`);let s=e.module??2;return`BARCODE ${n},${r},"${o}",${Math.round(e.height)},${e.text===!1?0:1},${i(e.rotation)},${s},${s*2},${we(e.data)}`}case"qr":return`QRCODE ${n},${r},${e.correction??"M"},${e.module??4},A,${i(e.rotation)},${we(e.data)}`;case"box":return`BOX ${n},${r},${n+Math.round(e.width)},${r+Math.round(e.height)},${e.thickness??2}`;case"rect":return`BAR ${n},${r},${Math.round(e.width)},${Math.round(e.height)}`;case"image":{let o=Math.ceil(e.bitmap.width/8),s=`BITMAP ${n},${r},${o},${e.bitmap.height},0,`,a=bi(e.bitmap),u=new Uint8Array(s.length+a.length+1);for(let c=0;c<s.length;c++)u[c]=s.charCodeAt(c);return u.set(a,s.length),u[u.length-1]=10,u}}}function Bt(e){let t=[`SIZE ${qn(e.width,e.dpi)} mm,${qn(e.height,e.dpi)} mm`,`GAP ${e.gap.toFixed(2)} mm,0 mm`,"DIRECTION 1,0","REFERENCE 0,0"];e.speed!==void 0&&t.push(`SPEED ${e.speed}`),e.darkness!==void 0&&t.push(`DENSITY ${Math.round(e.darkness)}`),t.push("CLS");for(let o of e.ops)t.push(yi(o,e.dpi));t.push(`PRINT ${e.copies},1`);let n=t.map(o=>typeof o=="string"?new TextEncoder().encode(o+`
22
- `):o),r=new Uint8Array(n.reduce((o,s)=>o+s.length,0)),i=0;for(let o of n)r.set(o,i),i+=o.length;return r}var be=[["A",12],["B",16],["C",20],["D",24],["E",32],["F",40],["G",48],["H",64]],xi={CODE39:"A",CODE128:"C",EAN13:"E",EAN8:"F",UPC_E:"G",UPC_A:"H",ITF:"I",CODABAR:"J"};function Ei(e){let t=be[0][0],n=be[0][1];for(let[i,o]of be)o<=e&&(t=i,n=o);let r=Math.max(1,Math.min(9,Math.floor(e/n)));return{font:t,mul:r}}function Ai(e){let t=Math.round(e.x),n=Math.round(e.y),r=e.rotation??0;switch(e.kind){case"text":{let{font:i,mul:o}=Ei(e.height);return`A${i},${t},${n},${o},${o},${r/90},0${e.invert?"R":"E"},${e.text}`}case"barcode":{let i=xi[e.type];if(!i)throw new Error(`retail-print-kit: EZPL has no ${e.type}`);let o=e.module??2;return`B${i},${t},${n},${o},${o*2},${Math.round(e.height)},${r/90},${e.text===!1?0:1},${e.data}`}case"qr":{let i={L:"L",M:"M",Q:"Q",H:"H"}[e.correction??"M"];return`W${t},${n},5,2,${i},${e.module??4},${r/90},${e.data.length}
23
- ${e.data}`}case"box":return`R${t},${n},${t+Math.round(e.width)},${n+Math.round(e.height)},${e.thickness??2},${e.thickness??2}`;case"rect":return`R${t},${n},${t+Math.round(e.width)},${n+Math.round(e.height)},${Math.round(e.width)},${Math.round(e.height)}`;case"image":throw new Error("retail-print-kit: EZPL images are not implemented yet")}}function Tt(e){let t=[`^Q${K(e.height,e.dpi).toFixed(2)},${e.gap.toFixed(0)}`,`^W${K(e.width,e.dpi).toFixed(2)}`,`^H${e.darkness??10}`,`^P${e.copies}`,`^S${e.speed??2}`,"^AD","^C1","^R0","~Q+0","^O0","^D0","^E18","~R255","^L"];for(let n of e.ops)t.push(Ai(n));return t.push("E"),t.join(`
20
+ `}function at(e,t){return Math.round(e/25.4*t)}function J(e,t){return e/t*25.4}var Ei={CODE128:"128",EAN13:"EAN13",EAN8:"EAN8",UPC_A:"UPCA",UPC_E:"UPCE",CODE39:"39",ITF:"ITF",CODABAR:"CODA"};function ye(e){return`"${e.replace(/"/g,'\\["]')}"`}function _n(e,t){return J(e,t).toFixed(2)}function Bi(e){let t=new Uint8Array(e.bits.length);for(let n=0;n<e.bits.length;n++)t[n]=~e.bits[n]&255;return t}function Ai(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=o=>o??0;switch(e.kind){case"text":{let o=Math.round(e.height),s=Math.round(e.width??e.height*.9),a=`TEXT ${n},${r},"0",${i(e.rotation)},${s},${o},${ye(e.text)}`;return e.invert?`${a}
21
+ REVERSE ${n},${r},${Math.round(s*e.text.length*.6)},${o}`:a}case"barcode":{let o=Ei[e.type];if(!o)throw new Error(`retail-print-kit: TSPL has no ${e.type}`);let s=e.module??2;return`BARCODE ${n},${r},"${o}",${Math.round(e.height)},${e.text===!1?0:1},${i(e.rotation)},${s},${s*2},${ye(e.data)}`}case"qr":return`QRCODE ${n},${r},${e.correction??"M"},${e.module??4},A,${i(e.rotation)},${ye(e.data)}`;case"box":return`BOX ${n},${r},${n+Math.round(e.width)},${r+Math.round(e.height)},${e.thickness??2}`;case"rect":return`BAR ${n},${r},${Math.round(e.width)},${Math.round(e.height)}`;case"image":{let o=Math.ceil(e.bitmap.width/8),s=`BITMAP ${n},${r},${o},${e.bitmap.height},0,`,a=Bi(e.bitmap),u=new Uint8Array(s.length+a.length+1);for(let c=0;c<s.length;c++)u[c]=s.charCodeAt(c);return u.set(a,s.length),u[u.length-1]=10,u}}}function Mt(e){let t=[`SIZE ${_n(e.width,e.dpi)} mm,${_n(e.height,e.dpi)} mm`,`GAP ${e.gap.toFixed(2)} mm,0 mm`,"DIRECTION 1,0","REFERENCE 0,0"];e.speed!==void 0&&t.push(`SPEED ${e.speed}`),e.darkness!==void 0&&t.push(`DENSITY ${Math.round(e.darkness)}`),t.push("CLS");for(let o of e.ops)t.push(Ai(o,e.dpi));t.push(`PRINT ${e.copies},1`);let n=t.map(o=>typeof o=="string"?new TextEncoder().encode(o+`
22
+ `):o),r=new Uint8Array(n.reduce((o,s)=>o+s.length,0)),i=0;for(let o of n)r.set(o,i),i+=o.length;return r}var xe=[["A",12],["B",16],["C",20],["D",24],["E",32],["F",40],["G",48],["H",64]],Ci={CODE39:"A",CODE128:"C",EAN13:"E",EAN8:"F",UPC_E:"G",UPC_A:"H",ITF:"I",CODABAR:"J"};function $i(e){let t=xe[0][0],n=xe[0][1];for(let[i,o]of xe)o<=e&&(t=i,n=o);let r=Math.max(1,Math.min(9,Math.floor(e/n)));return{font:t,mul:r}}function Ti(e){let t=Math.round(e.x),n=Math.round(e.y),r=e.rotation??0;switch(e.kind){case"text":{let{font:i,mul:o}=$i(e.height);return`A${i},${t},${n},${o},${o},${r/90},0${e.invert?"R":"E"},${e.text}`}case"barcode":{let i=Ci[e.type];if(!i)throw new Error(`retail-print-kit: EZPL has no ${e.type}`);let o=e.module??2;return`B${i},${t},${n},${o},${o*2},${Math.round(e.height)},${r/90},${e.text===!1?0:1},${e.data}`}case"qr":{let i={L:"L",M:"M",Q:"Q",H:"H"}[e.correction??"M"];return`W${t},${n},5,2,${i},${e.module??4},${r/90},${e.data.length}
23
+ ${e.data}`}case"box":return`R${t},${n},${t+Math.round(e.width)},${n+Math.round(e.height)},${e.thickness??2},${e.thickness??2}`;case"rect":return`R${t},${n},${t+Math.round(e.width)},${n+Math.round(e.height)},${Math.round(e.width)},${Math.round(e.height)}`;case"image":throw new Error("retail-print-kit: EZPL images are not implemented yet")}}function Lt(e){let t=[`^Q${J(e.height,e.dpi).toFixed(2)},${e.gap.toFixed(0)}`,`^W${J(e.width,e.dpi).toFixed(2)}`,`^H${e.darkness??10}`,`^P${e.copies}`,`^S${e.speed??2}`,"^AD","^C1","^R0","~Q+0","^O0","^D0","^E18","~R255","^L"];for(let n of e.ops)t.push(Ti(n));return t.push("E"),t.join(`
24
24
  `)+`
25
- `}var J=class{constructor(t){let n=t.dpi??203;this.label={width:st(t.widthMm,n),height:st(t.heightMm,n),dpi:n,gap:t.gapMm??3,copies:1,ops:[]}}mm(t){return st(t,this.label.dpi)}copies(t){return this.label.copies=Math.max(1,Math.floor(t)),this}darkness(t){return this.label.darkness=t,this}speed(t){return this.label.speed=t,this}push(t){return this.label.ops.push(t),this}text(t,n,r,i,o={}){return this.push({kind:"text",x:t,y:n,text:r,height:i,...o})}barcode(t,n,r,i,o,s={}){return this.push({kind:"barcode",x:t,y:n,data:r,type:i,height:o,...s})}qr(t,n,r,i={}){return this.push({kind:"qr",x:t,y:n,data:r,...i})}box(t,n,r,i,o=2){return this.push({kind:"box",x:t,y:n,width:r,height:i,thickness:o})}rect(t,n,r,i){return this.push({kind:"rect",x:t,y:n,width:r,height:i})}image(t,n,r){return this.push({kind:"image",x:t,y:n,bitmap:r})}};function vn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ye(e){return e.rotation?` transform="rotate(${e.rotation} ${e.x} ${e.y})"`:""}function xe(e){return`data:image/png;base64,${V(S(e))}`}function Ci(e){switch(e.kind){case"text":{let t=e.width??e.height*.9,n=e.text.length*t*.62;return`${e.invert?`<rect x="${e.x}" y="${e.y}" width="${n}" height="${e.height}" fill="#000"/>`:""}<text x="${e.x}" y="${e.y+e.height*.82}" font-size="${e.height}" textLength="${n}" lengthAdjust="spacingAndGlyphs" font-family="Helvetica, Arial, sans-serif"${e.bold?' font-weight="bold"':""} fill="${e.invert?"#fff":"#000"}"${ye(e)}>${vn(e.text)}</text>`}case"barcode":{let t=it(e.type,e.data,e.module??2,Math.round(e.height)),n=e.text===!1?"":`<text x="${e.x+t.width/2}" y="${e.y+e.height+14}" font-size="14" text-anchor="middle" font-family="Helvetica, Arial, sans-serif">${vn(e.data)}</text>`;return`<image x="${e.x}" y="${e.y}" width="${t.width}" height="${t.height}" href="${xe(t)}" style="image-rendering:pixelated"${ye(e)}/>${n}`}case"qr":{let t=k(e.data,{size:e.module??4,correction:e.correction});return`<image x="${e.x}" y="${e.y}" width="${t.width}" height="${t.height}" href="${xe(t)}" style="image-rendering:pixelated"${ye(e)}/>`}case"box":return`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="none" stroke="#000" stroke-width="${e.thickness??2}"/>`;case"rect":return`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000"/>`;case"image":return`<image x="${e.x}" y="${e.y}" width="${e.bitmap.width}" height="${e.bitmap.height}" href="${xe(e.bitmap)}" style="image-rendering:pixelated"/>`}}function _n(e){let t=e.ops.map(Ci).join("");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}"><rect width="${e.width}" height="${e.height}" fill="#fff"/>${t}</svg>`}function zn(e,t){if(e.version!==1||e.kind!=="label")throw new Error("retail-print-kit: not a version 1 label template");let n=new J({widthMm:e.widthMm,heightMm:e.heightMm,dpi:e.dpi,gapMm:e.gapMm}),r={root:t,current:t};for(let i of e.elements)if(!(i.when&&!H(i.when,r)))switch(i.type){case"text":n.text(i.x,i.y,E(i.value,r),i.height,{width:i.width,rotation:i.rotation,bold:i.bold,invert:i.invert});break;case"barcode":n.barcode(i.x,i.y,E(i.value,r),i.format??"CODE128",i.height,{module:i.module,rotation:i.rotation,text:i.text});break;case"qr":n.qr(i.x,i.y,E(i.value,r),{module:i.module,correction:i.correction,rotation:i.rotation});break;case"box":n.box(i.x,i.y,i.width,i.height,i.thickness);break;case"rect":n.rect(i.x,i.y,i.width,i.height);break}return n.label}function $i(e,t){switch(t){case"zpl":return new TextEncoder().encode($t(e));case"ezpl":return new TextEncoder().encode(Tt(e));case"tspl":return Bt(e)}}return Zn(Bi);})();
25
+ `}var Y=class{constructor(t){let n=t.dpi??203;this.label={width:at(t.widthMm,n),height:at(t.heightMm,n),dpi:n,gap:t.gapMm??3,copies:1,ops:[]}}mm(t){return at(t,this.label.dpi)}copies(t){return this.label.copies=Math.max(1,Math.floor(t)),this}darkness(t){return this.label.darkness=t,this}speed(t){return this.label.speed=t,this}push(t){return this.label.ops.push(t),this}text(t,n,r,i,o={}){return this.push({kind:"text",x:t,y:n,text:r,height:i,...o})}barcode(t,n,r,i,o,s={}){return this.push({kind:"barcode",x:t,y:n,data:r,type:i,height:o,...s})}qr(t,n,r,i={}){return this.push({kind:"qr",x:t,y:n,data:r,...i})}box(t,n,r,i,o=2){return this.push({kind:"box",x:t,y:n,width:r,height:i,thickness:o})}rect(t,n,r,i){return this.push({kind:"rect",x:t,y:n,width:r,height:i})}image(t,n,r){return this.push({kind:"image",x:t,y:n,bitmap:r})}};function zn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ee(e){return e.rotation?` transform="rotate(${e.rotation} ${e.x} ${e.y})"`:""}function Be(e){return`data:image/png;base64,${P(N(e))}`}function Mi(e){switch(e.kind){case"text":{let t=e.width??e.height*.9,n=e.text.length*t*.62;return`${e.invert?`<rect x="${e.x}" y="${e.y}" width="${n}" height="${e.height}" fill="#000"/>`:""}<text x="${e.x}" y="${e.y+e.height*.82}" font-size="${e.height}" textLength="${n}" lengthAdjust="spacingAndGlyphs" font-family="Helvetica, Arial, sans-serif"${e.bold?' font-weight="bold"':""} fill="${e.invert?"#fff":"#000"}"${Ee(e)}>${zn(e.text)}</text>`}case"barcode":{let t=ot(e.type,e.data,e.module??2,Math.round(e.height)),n=e.text===!1?"":`<text x="${e.x+t.width/2}" y="${e.y+e.height+14}" font-size="14" text-anchor="middle" font-family="Helvetica, Arial, sans-serif">${zn(e.data)}</text>`;return`<image x="${e.x}" y="${e.y}" width="${t.width}" height="${t.height}" href="${Be(t)}" style="image-rendering:pixelated"${Ee(e)}/>${n}`}case"qr":{let t=F(e.data,{size:e.module??4,correction:e.correction});return`<image x="${e.x}" y="${e.y}" width="${t.width}" height="${t.height}" href="${Be(t)}" style="image-rendering:pixelated"${Ee(e)}/>`}case"box":return`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="none" stroke="#000" stroke-width="${e.thickness??2}"/>`;case"rect":return`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000"/>`;case"image":return`<image x="${e.x}" y="${e.y}" width="${e.bitmap.width}" height="${e.bitmap.height}" href="${Be(e.bitmap)}" style="image-rendering:pixelated"/>`}}function Gn(e){let t=e.ops.map(Mi).join("");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}"><rect width="${e.width}" height="${e.height}" fill="#fff"/>${t}</svg>`}function Hn(e,t){if(e.version!==1||e.kind!=="label")throw new Error("retail-print-kit: not a version 1 label template");let n=new Y({widthMm:e.widthMm,heightMm:e.heightMm,dpi:e.dpi,gapMm:e.gapMm}),r={root:t,current:t};for(let i of e.elements)if(!(i.when&&!V(i.when,r)))switch(i.type){case"text":n.text(i.x,i.y,E(i.value,r),i.height,{width:i.width,rotation:i.rotation,bold:i.bold,invert:i.invert});break;case"barcode":n.barcode(i.x,i.y,E(i.value,r),i.format??"CODE128",i.height,{module:i.module,rotation:i.rotation,text:i.text});break;case"qr":n.qr(i.x,i.y,E(i.value,r),{module:i.module,correction:i.correction,rotation:i.rotation});break;case"box":n.box(i.x,i.y,i.width,i.height,i.thickness);break;case"rect":n.rect(i.x,i.y,i.width,i.height);break}return n.label}function Li(e,t){switch(t){case"zpl":return new TextEncoder().encode(Tt(e));case"ezpl":return new TextEncoder().encode(Lt(e));case"tspl":return Mt(e)}}return tr(Si);})();
26
26
  //# sourceMappingURL=retail-print-kit.js.map