@devraghu/electron-printer 2.0.0 → 2.1.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.
package/dist/index.d.ts CHANGED
@@ -1,175 +1 @@
1
- import { DrawerOptions } from '@devraghu/cashdrawer';
2
- import { getAvailablePrinters } from '@devraghu/cashdrawer';
3
- import { openCashDrawer } from '@devraghu/cashdrawer';
4
- import { OpenCashDrawerResult } from '@devraghu/cashdrawer';
5
- import { PrinterErrorCodes } from '@devraghu/cashdrawer';
6
- import { PrinterInfo } from '@devraghu/cashdrawer';
7
- import { PrinterStatus } from '@devraghu/cashdrawer';
8
- import { PrinterType } from '@devraghu/cashdrawer';
9
- import { WebContentsPrintOptions } from 'electron';
10
-
11
- export { DrawerOptions }
12
-
13
- export { OpenCashDrawerResult }
14
-
15
- declare type PaperSize = '80mm' | '78mm' | '76mm' | '57mm' | '58mm' | '44mm';
16
-
17
- /**
18
- * Prints data to a printer or opens a preview window
19
- * @param data - array of print data to print
20
- * @param options - print configuration options
21
- */
22
- declare function print_2(data: PrintData[], options: PrintOptions): Promise<PrintResult>;
23
-
24
- /** Barcode content for printing */
25
- export declare interface PrintBarCodeData extends PrintDataBase {
26
- type: 'barCode';
27
- value: string;
28
- width?: string;
29
- height?: string;
30
- fontsize?: number;
31
- displayValue?: boolean;
32
- position?: PrintPosition;
33
- }
34
-
35
- /** Discriminated union of all print data types */
36
- export declare type PrintData = PrintTextData | PrintBarCodeData | PrintQRCodeData | PrintImageData | PrintTableData;
37
-
38
- /** Base properties shared by all print data types */
39
- declare interface PrintDataBase {
40
- style?: PrintDataStyle;
41
- }
42
-
43
- /**
44
- * CSS Style interface - a subset of CSSStyleDeclaration properties commonly used for printing
45
- * Uses Record type for flexibility while maintaining type safety
46
- */
47
- declare type PrintDataStyle = {
48
- [K in keyof CSSStyleDeclaration]?: CSSStyleDeclaration[K];
49
- };
50
-
51
- export declare const printer: {
52
- print: typeof print_2;
53
- openCashDrawer: typeof openCashDrawer;
54
- getPrinters: typeof getAvailablePrinters;
55
- };
56
-
57
- export { PrinterErrorCodes }
58
-
59
- export { PrinterInfo }
60
-
61
- export { PrinterStatus }
62
-
63
- export { PrinterType }
64
-
65
- /** Image content for printing */
66
- export declare interface PrintImageData extends PrintDataBase {
67
- type: 'image';
68
- path?: string;
69
- url?: string;
70
- width?: string;
71
- height?: string;
72
- position?: PrintPosition;
73
- }
74
-
75
- /**
76
- * Print configuration options.
77
- *
78
- * Extends Electron's WebContentsPrintOptions with additional properties for receipt printing.
79
- * Inherited options include: silent, printBackground, copies, header, footer, color,
80
- * margins, landscape, scaleFactor, pagesPerSheet, collate, pageRanges, duplexMode.
81
- *
82
- * @see https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback
83
- */
84
- export declare interface PrintOptions extends Omit<WebContentsPrintOptions, 'pageSize' | 'deviceName' | 'dpi'> {
85
- /**
86
- * CSS width of the print container element.
87
- * @example "100%", "80mm", "300px"
88
- */
89
- width?: string;
90
- /**
91
- * CSS margin of the print container element.
92
- * @example "0", "10px", "5mm 10mm"
93
- */
94
- margin?: string;
95
- /**
96
- * When true, opens a preview window instead of printing directly.
97
- * @default false
98
- */
99
- preview?: boolean;
100
- /**
101
- * Name of the target printer. Required unless `silent` or `preview` is true.
102
- * Use `getPrinters()` to get available printer names.
103
- */
104
- printerName?: string;
105
- /**
106
- * Timeout per print item in milliseconds.
107
- * Total timeout is calculated as: `data.length * timeOutPerLine + 200ms`.
108
- * Used to prevent hanging when printer is disconnected.
109
- * @default 400
110
- */
111
- timeOutPerLine?: number;
112
- /**
113
- * Paper size for printing. Can be a preset size string or custom dimensions.
114
- * @example "80mm", "58mm", { width: 300, height: 400 }
115
- */
116
- pageSize?: PaperSize | SizeOptions;
117
- /**
118
- * Print resolution in dots per inch.
119
- * @example { horizontal: 300, vertical: 300 }
120
- */
121
- dpi?: {
122
- horizontal: number;
123
- vertical: number;
124
- };
125
- /**
126
- * Path to a custom HTML template file for the print window.
127
- * If not provided, uses the default built-in template.
128
- */
129
- pathTemplate?: string;
130
- }
131
-
132
- /** Alignment for barCode and qrCode */
133
- export declare type PrintPosition = 'left' | 'center' | 'right';
134
-
135
- /** QR code content for printing */
136
- export declare interface PrintQRCodeData extends PrintDataBase {
137
- type: 'qrCode';
138
- value: string;
139
- width?: string;
140
- position?: PrintPosition;
141
- }
142
-
143
- declare interface PrintResult {
144
- complete: boolean;
145
- data?: PrintData[];
146
- options?: PrintOptions;
147
- }
148
-
149
- /** Table content for printing */
150
- export declare interface PrintTableData extends PrintDataBase {
151
- type: 'table';
152
- tableHeader?: PrintTableField[] | string[];
153
- tableBody?: PrintTableField[][] | string[][];
154
- tableFooter?: PrintTableField[] | string[];
155
- tableHeaderStyle?: PrintDataStyle;
156
- tableBodyStyle?: PrintDataStyle;
157
- tableFooterStyle?: PrintDataStyle;
158
- }
159
-
160
- export declare type PrintTableField = PrintImageData | PrintTextData;
161
-
162
- /** Text content for printing */
163
- export declare interface PrintTextData extends PrintDataBase {
164
- type: 'text';
165
- value: string;
166
- }
167
-
168
- export declare type PrintType = 'text' | 'barCode' | 'qrCode' | 'image' | 'table';
169
-
170
- declare interface SizeOptions {
171
- height: number;
172
- width: number;
173
- }
174
-
175
1
  export { }
@@ -1 +1 @@
1
- "use strict";const t=require("electron"),a=require("node:fs"),d=require("node:path");function i(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const o=i(a),c=i(d),l={onBodyInit:e=>{t.ipcRenderer.on("body-init",(r,n)=>{e(n)})},onRenderLine:e=>{t.ipcRenderer.on("render-line",(r,n)=>{e(n)})},sendBodyInitReply:e=>{t.ipcRenderer.send("body-init-reply",e)},sendRenderLineReply:e=>{t.ipcRenderer.send("render-line-reply",e)},readFileAsBase64:e=>{try{const r=c.resolve(e),n=process.cwd();return!r.startsWith(n+c.sep)&&r!==n?{success:!1,error:"Access denied: Path outside allowed directory"}:o.existsSync(r)?{success:!0,data:o.readFileSync(r).toString("base64")}:{success:!1,error:"File not found"}}catch(r){return{success:!1,error:r.message}}},getFileExtension:e=>c.extname(e).slice(1)};t.contextBridge.exposeInMainWorld("electronAPI",l);
1
+ "use strict";const t=require("electron"),a=require("node:fs"),d=require("node:path");function i(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const o=i(a),c=i(d),l={onBodyInit:e=>{t.ipcRenderer.once("body-init",(r,n)=>{e(n)})},onRenderLine:e=>{t.ipcRenderer.on("render-line",(r,n)=>{e(n)})},sendBodyInitReply:e=>{t.ipcRenderer.send("body-init-reply",e)},sendRenderLineReply:e=>{t.ipcRenderer.send("render-line-reply",e)},readFileAsBase64:e=>{try{const r=c.resolve(e),n=process.cwd();return!r.startsWith(n+c.sep)&&r!==n?{success:!1,error:"Access denied: Path outside allowed directory"}:o.existsSync(r)?{success:!0,data:o.readFileSync(r).toString("base64")}:{success:!1,error:"File not found"}}catch(r){return{success:!1,error:r.message}}},getFileExtension:e=>c.extname(e).slice(1)};t.contextBridge.exposeInMainWorld("electronAPI",l);
@@ -0,0 +1,9 @@
1
+ const{entries:Qi,setPrototypeOf:_r,isFrozen:So,getPrototypeOf:Ro,getOwnPropertyDescriptor:Io}=Object;let{freeze:Y,seal:re,create:Jt}=Object,{apply:Xn,construct:$n}=typeof Reflect<"u"&&Reflect;Y||(Y=function(o){return o});re||(re=function(o){return o});Xn||(Xn=function(o,s){for(var i=arguments.length,u=new Array(i>2?i-2:0),l=2;l<i;l++)u[l-2]=arguments[l];return o.apply(s,u)});$n||($n=function(o){for(var s=arguments.length,i=new Array(s>1?s-1:0),u=1;u<s;u++)i[u-1]=arguments[u];return new o(...i)});const dt=W(Array.prototype.forEach),Co=W(Array.prototype.lastIndexOf),pr=W(Array.prototype.pop),Ge=W(Array.prototype.push),Mo=W(Array.prototype.splice),Qt=W(String.prototype.toLowerCase),_n=W(String.prototype.toString),pn=W(String.prototype.match),He=W(String.prototype.replace),Po=W(String.prototype.indexOf),xo=W(String.prototype.trim),ee=W(Object.prototype.hasOwnProperty),X=W(RegExp.prototype.test),ze=Do(TypeError);function W(f){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var s=arguments.length,i=new Array(s>1?s-1:0),u=1;u<s;u++)i[u-1]=arguments[u];return Xn(f,o,i)}}function Do(f){return function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return $n(f,s)}}function L(f,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qt;_r&&_r(f,null);let i=o.length;for(;i--;){let u=o[i];if(typeof u=="string"){const l=s(u);l!==u&&(So(o)||(o[i]=l),u=l)}f[u]=!0}return f}function Lo(f){for(let o=0;o<f.length;o++)ee(f,o)||(f[o]=null);return f}function le(f){const o=Jt(null);for(const[s,i]of Qi(f))ee(f,s)&&(Array.isArray(i)?o[s]=Lo(i):i&&typeof i=="object"&&i.constructor===Object?o[s]=le(i):o[s]=i);return o}function Ve(f,o){for(;f!==null;){const i=Io(f,o);if(i){if(i.get)return W(i.get);if(typeof i.value=="function")return W(i.value)}f=Ro(f)}function s(){return null}return s}const vr=Y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vn=Y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),mn=Y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),No=Y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),En=Y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Bo=Y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mr=Y(["#text"]),Er=Y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),yn=Y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yr=Y(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ht=Y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ko=re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qo=re(/<%[\w\W]*|[\w\W]*%>/gm),Fo=re(/\$\{[\w\W]*/gm),Uo=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),jo=re(/^aria-[\-\w]+$/),Zi=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Go=re(/^(?:\w+script|data):/i),Ho=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eo=re(/^html$/i),zo=re(/^[a-z][.\w]*(-[.\w]+)+$/i);var Or=Object.freeze({__proto__:null,ARIA_ATTR:jo,ATTR_WHITESPACE:Ho,CUSTOM_ELEMENT:zo,DATA_ATTR:Uo,DOCTYPE_NAME:eo,ERB_EXPR:qo,IS_ALLOWED_URI:Zi,IS_SCRIPT_OR_DATA:Go,MUSTACHE_EXPR:ko,TMPLIT_EXPR:Fo});const Xe={element:1,text:3,progressingInstruction:7,comment:8,document:9},Vo=function(){return typeof window>"u"?null:window},Xo=function(o,s){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const u="data-tt-policy-suffix";s&&s.hasAttribute(u)&&(i=s.getAttribute(u));const l="dompurify"+(i?"#"+i:"");try{return o.createPolicy(l,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},wr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function to(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vo();const o=P=>to(P);if(o.version="3.3.3",o.removed=[],!f||!f.document||f.document.nodeType!==Xe.document||!f.Element)return o.isSupported=!1,o;let{document:s}=f;const i=s,u=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:d,Node:h,Element:a,NodeFilter:e,NamedNodeMap:t=f.NamedNodeMap||f.MozNamedAttrMap,HTMLFormElement:r,DOMParser:n,trustedTypes:c}=f,g=a.prototype,_=Ve(g,"cloneNode"),v=Ve(g,"remove"),m=Ve(g,"nextSibling"),E=Ve(g,"childNodes"),T=Ve(g,"parentNode");if(typeof d=="function"){const P=s.createElement("template");P.content&&P.content.ownerDocument&&(s=P.content.ownerDocument)}let R,N="";const{implementation:I,createNodeIterator:D,createDocumentFragment:x,getElementsByTagName:y}=s,{importNode:S}=i;let w=wr();o.isSupported=typeof Qi=="function"&&typeof T=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:b,TMPLIT_EXPR:M,DATA_ATTR:ne,ARIA_ATTR:se,IS_SCRIPT_OR_DATA:nn,ATTR_WHITESPACE:qe,CUSTOM_ELEMENT:rn}=Or;let{IS_ALLOWED_URI:Re}=Or,q=null;const Fe=L({},[...vr,...vn,...mn,...En,...mr]);let U=null;const it=L({},[...Er,...yn,...yr,...ht]);let B=Object.seal(Jt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,K=null;const H=Object.seal(Jt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let de=!0,Ee=!0,Kn=!1,Jn=!0,Ie=!1,ot=!0,ye=!1,on=!1,an=!1,Ce=!1,at=!1,ut=!1,Qn=!0,Zn=!1;const mo="user-content-";let un=!0,Ue=!1,Me={},ue=null;const fn=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const tr=L({},["audio","video","img","source","image","track"]);let cn=null;const nr=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";let Pe=he,ln=!1,sn=null;const Eo=L({},[ft,ct,he],_n);let lt=L({},["mi","mo","mn","ms","mtext"]),st=L({},["annotation-xml"]);const yo=L({},["title","style","font","a","script"]);let je=null;const Oo=["application/xhtml+xml","text/html"],wo="text/html";let G=null,xe=null;const bo=s.createElement("form"),rr=function(p){return p instanceof RegExp||p instanceof Function},dn=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xe&&xe===p)){if((!p||typeof p!="object")&&(p={}),p=le(p),je=Oo.indexOf(p.PARSER_MEDIA_TYPE)===-1?wo:p.PARSER_MEDIA_TYPE,G=je==="application/xhtml+xml"?_n:Qt,q=ee(p,"ALLOWED_TAGS")?L({},p.ALLOWED_TAGS,G):Fe,U=ee(p,"ALLOWED_ATTR")?L({},p.ALLOWED_ATTR,G):it,sn=ee(p,"ALLOWED_NAMESPACES")?L({},p.ALLOWED_NAMESPACES,_n):Eo,cn=ee(p,"ADD_URI_SAFE_ATTR")?L(le(nr),p.ADD_URI_SAFE_ATTR,G):nr,er=ee(p,"ADD_DATA_URI_TAGS")?L(le(tr),p.ADD_DATA_URI_TAGS,G):tr,ue=ee(p,"FORBID_CONTENTS")?L({},p.FORBID_CONTENTS,G):fn,ve=ee(p,"FORBID_TAGS")?L({},p.FORBID_TAGS,G):le({}),K=ee(p,"FORBID_ATTR")?L({},p.FORBID_ATTR,G):le({}),Me=ee(p,"USE_PROFILES")?p.USE_PROFILES:!1,de=p.ALLOW_ARIA_ATTR!==!1,Ee=p.ALLOW_DATA_ATTR!==!1,Kn=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Jn=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=p.SAFE_FOR_TEMPLATES||!1,ot=p.SAFE_FOR_XML!==!1,ye=p.WHOLE_DOCUMENT||!1,Ce=p.RETURN_DOM||!1,at=p.RETURN_DOM_FRAGMENT||!1,ut=p.RETURN_TRUSTED_TYPE||!1,an=p.FORCE_BODY||!1,Qn=p.SANITIZE_DOM!==!1,Zn=p.SANITIZE_NAMED_PROPS||!1,un=p.KEEP_CONTENT!==!1,Ue=p.IN_PLACE||!1,Re=p.ALLOWED_URI_REGEXP||Zi,Pe=p.NAMESPACE||he,lt=p.MATHML_TEXT_INTEGRATION_POINTS||lt,st=p.HTML_INTEGRATION_POINTS||st,B=p.CUSTOM_ELEMENT_HANDLING||{},p.CUSTOM_ELEMENT_HANDLING&&rr(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=p.CUSTOM_ELEMENT_HANDLING.tagNameCheck),p.CUSTOM_ELEMENT_HANDLING&&rr(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Ee=!1),at&&(Ce=!0),Me&&(q=L({},mr),U=Jt(null),Me.html===!0&&(L(q,vr),L(U,Er)),Me.svg===!0&&(L(q,vn),L(U,yn),L(U,ht)),Me.svgFilters===!0&&(L(q,mn),L(U,yn),L(U,ht)),Me.mathMl===!0&&(L(q,En),L(U,yr),L(U,ht))),ee(p,"ADD_TAGS")||(H.tagCheck=null),ee(p,"ADD_ATTR")||(H.attributeCheck=null),p.ADD_TAGS&&(typeof p.ADD_TAGS=="function"?H.tagCheck=p.ADD_TAGS:(q===Fe&&(q=le(q)),L(q,p.ADD_TAGS,G))),p.ADD_ATTR&&(typeof p.ADD_ATTR=="function"?H.attributeCheck=p.ADD_ATTR:(U===it&&(U=le(U)),L(U,p.ADD_ATTR,G))),p.ADD_URI_SAFE_ATTR&&L(cn,p.ADD_URI_SAFE_ATTR,G),p.FORBID_CONTENTS&&(ue===fn&&(ue=le(ue)),L(ue,p.FORBID_CONTENTS,G)),p.ADD_FORBID_CONTENTS&&(ue===fn&&(ue=le(ue)),L(ue,p.ADD_FORBID_CONTENTS,G)),un&&(q["#text"]=!0),ye&&L(q,["html","head","body"]),q.table&&(L(q,["tbody"]),delete ve.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=p.TRUSTED_TYPES_POLICY,N=R.createHTML("")}else R===void 0&&(R=Xo(c,u)),R!==null&&typeof N=="string"&&(N=R.createHTML(""));Y&&Y(p),xe=p}},ir=L({},[...vn,...mn,...No]),or=L({},[...En,...Bo]),Ao=function(p){let O=T(p);(!O||!O.tagName)&&(O={namespaceURI:Pe,tagName:"template"});const C=Qt(p.tagName),k=Qt(O.tagName);return sn[p.namespaceURI]?p.namespaceURI===ct?O.namespaceURI===he?C==="svg":O.namespaceURI===ft?C==="svg"&&(k==="annotation-xml"||lt[k]):!!ir[C]:p.namespaceURI===ft?O.namespaceURI===he?C==="math":O.namespaceURI===ct?C==="math"&&st[k]:!!or[C]:p.namespaceURI===he?O.namespaceURI===ct&&!st[k]||O.namespaceURI===ft&&!lt[k]?!1:!or[C]&&(yo[C]||!ir[C]):!!(je==="application/xhtml+xml"&&sn[p.namespaceURI]):!1},fe=function(p){Ge(o.removed,{element:p});try{T(p).removeChild(p)}catch{v(p)}},Oe=function(p,O){try{Ge(o.removed,{attribute:O.getAttributeNode(p),from:O})}catch{Ge(o.removed,{attribute:null,from:O})}if(O.removeAttribute(p),p==="is")if(Ce||at)try{fe(O)}catch{}else try{O.setAttribute(p,"")}catch{}},ar=function(p){let O=null,C=null;if(an)p="<remove></remove>"+p;else{const j=pn(p,/^[\r\n\t ]+/);C=j&&j[0]}je==="application/xhtml+xml"&&Pe===he&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const k=R?R.createHTML(p):p;if(Pe===he)try{O=new n().parseFromString(k,je)}catch{}if(!O||!O.documentElement){O=I.createDocument(Pe,"template",null);try{O.documentElement.innerHTML=ln?N:k}catch{}}const V=O.body||O.documentElement;return p&&C&&V.insertBefore(s.createTextNode(C),V.childNodes[0]||null),Pe===he?y.call(O,ye?"html":"body")[0]:ye?O.documentElement:V},ur=function(p){return D.call(p.ownerDocument||p,p,e.SHOW_ELEMENT|e.SHOW_COMMENT|e.SHOW_TEXT|e.SHOW_PROCESSING_INSTRUCTION|e.SHOW_CDATA_SECTION,null)},hn=function(p){return p instanceof r&&(typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||!(p.attributes instanceof t)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function")},fr=function(p){return typeof h=="function"&&p instanceof h};function ge(P,p,O){dt(P,C=>{C.call(o,p,O,xe)})}const cr=function(p){let O=null;if(ge(w.beforeSanitizeElements,p,null),hn(p))return fe(p),!0;const C=G(p.nodeName);if(ge(w.uponSanitizeElement,p,{tagName:C,allowedTags:q}),ot&&p.hasChildNodes()&&!fr(p.firstElementChild)&&X(/<[/\w!]/g,p.innerHTML)&&X(/<[/\w!]/g,p.textContent)||p.nodeType===Xe.progressingInstruction||ot&&p.nodeType===Xe.comment&&X(/<[/\w]/g,p.data))return fe(p),!0;if(!(H.tagCheck instanceof Function&&H.tagCheck(C))&&(!q[C]||ve[C])){if(!ve[C]&&sr(C)&&(B.tagNameCheck instanceof RegExp&&X(B.tagNameCheck,C)||B.tagNameCheck instanceof Function&&B.tagNameCheck(C)))return!1;if(un&&!ue[C]){const k=T(p)||p.parentNode,V=E(p)||p.childNodes;if(V&&k){const j=V.length;for(let J=j-1;J>=0;--J){const _e=_(V[J],!0);_e.__removalCount=(p.__removalCount||0)+1,k.insertBefore(_e,m(p))}}}return fe(p),!0}return p instanceof a&&!Ao(p)||(C==="noscript"||C==="noembed"||C==="noframes")&&X(/<\/no(script|embed|frames)/i,p.innerHTML)?(fe(p),!0):(Ie&&p.nodeType===Xe.text&&(O=p.textContent,dt([A,b,M],k=>{O=He(O,k," ")}),p.textContent!==O&&(Ge(o.removed,{element:p.cloneNode()}),p.textContent=O)),ge(w.afterSanitizeElements,p,null),!1)},lr=function(p,O,C){if(K[O]||Qn&&(O==="id"||O==="name")&&(C in s||C in bo))return!1;if(!(Ee&&!K[O]&&X(ne,O))){if(!(de&&X(se,O))){if(!(H.attributeCheck instanceof Function&&H.attributeCheck(O,p))){if(!U[O]||K[O]){if(!(sr(p)&&(B.tagNameCheck instanceof RegExp&&X(B.tagNameCheck,p)||B.tagNameCheck instanceof Function&&B.tagNameCheck(p))&&(B.attributeNameCheck instanceof RegExp&&X(B.attributeNameCheck,O)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(O,p))||O==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&X(B.tagNameCheck,C)||B.tagNameCheck instanceof Function&&B.tagNameCheck(C))))return!1}else if(!cn[O]){if(!X(Re,He(C,qe,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&p!=="script"&&Po(C,"data:")===0&&er[p])){if(!(Kn&&!X(nn,He(C,qe,"")))){if(C)return!1}}}}}}}return!0},sr=function(p){return p!=="annotation-xml"&&pn(p,rn)},dr=function(p){ge(w.beforeSanitizeAttributes,p,null);const{attributes:O}=p;if(!O||hn(p))return;const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0};let k=O.length;for(;k--;){const V=O[k],{name:j,namespaceURI:J,value:_e}=V,De=G(j),gn=_e;let z=j==="value"?gn:xo(gn);if(C.attrName=De,C.attrValue=z,C.keepAttr=!0,C.forceKeepAttr=void 0,ge(w.uponSanitizeAttribute,p,C),z=C.attrValue,Zn&&(De==="id"||De==="name")&&(Oe(j,p),z=mo+z),ot&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,z)){Oe(j,p);continue}if(De==="attributename"&&pn(z,"href")){Oe(j,p);continue}if(C.forceKeepAttr)continue;if(!C.keepAttr){Oe(j,p);continue}if(!Jn&&X(/\/>/i,z)){Oe(j,p);continue}Ie&&dt([A,b,M],gr=>{z=He(z,gr," ")});const hr=G(p.nodeName);if(!lr(hr,De,z)){Oe(j,p);continue}if(R&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!J)switch(c.getAttributeType(hr,De)){case"TrustedHTML":{z=R.createHTML(z);break}case"TrustedScriptURL":{z=R.createScriptURL(z);break}}if(z!==gn)try{J?p.setAttributeNS(J,j,z):p.setAttribute(j,z),hn(p)?fe(p):pr(o.removed)}catch{Oe(j,p)}}ge(w.afterSanitizeAttributes,p,null)},To=function P(p){let O=null;const C=ur(p);for(ge(w.beforeSanitizeShadowDOM,p,null);O=C.nextNode();)ge(w.uponSanitizeShadowNode,O,null),cr(O),dr(O),O.content instanceof l&&P(O.content);ge(w.afterSanitizeShadowDOM,p,null)};return o.sanitize=function(P){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,C=null,k=null,V=null;if(ln=!P,ln&&(P="<!-->"),typeof P!="string"&&!fr(P))if(typeof P.toString=="function"){if(P=P.toString(),typeof P!="string")throw ze("dirty is not a string, aborting")}else throw ze("toString is not a function");if(!o.isSupported)return P;if(on||dn(p),o.removed=[],typeof P=="string"&&(Ue=!1),Ue){if(P.nodeName){const _e=G(P.nodeName);if(!q[_e]||ve[_e])throw ze("root node is forbidden and cannot be sanitized in-place")}}else if(P instanceof h)O=ar("<!---->"),C=O.ownerDocument.importNode(P,!0),C.nodeType===Xe.element&&C.nodeName==="BODY"||C.nodeName==="HTML"?O=C:O.appendChild(C);else{if(!Ce&&!Ie&&!ye&&P.indexOf("<")===-1)return R&&ut?R.createHTML(P):P;if(O=ar(P),!O)return Ce?null:ut?N:""}O&&an&&fe(O.firstChild);const j=ur(Ue?P:O);for(;k=j.nextNode();)cr(k),dr(k),k.content instanceof l&&To(k.content);if(Ue)return P;if(Ce){if(at)for(V=x.call(O.ownerDocument);O.firstChild;)V.appendChild(O.firstChild);else V=O;return(U.shadowroot||U.shadowrootmode)&&(V=S.call(i,V,!0)),V}let J=ye?O.outerHTML:O.innerHTML;return ye&&q["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&X(eo,O.ownerDocument.doctype.name)&&(J="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
2
+ `+J),Ie&&dt([A,b,M],_e=>{J=He(J,_e," ")}),R&&ut?R.createHTML(J):J},o.setConfig=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(P),on=!0},o.clearConfig=function(){xe=null,on=!1},o.isValidAttribute=function(P,p,O){xe||dn({});const C=G(P),k=G(p);return lr(C,k,O)},o.addHook=function(P,p){typeof p=="function"&&Ge(w[P],p)},o.removeHook=function(P,p){if(p!==void 0){const O=Co(w[P],p);return O===-1?void 0:Mo(w[P],O,1)[0]}return pr(w[P])},o.removeHooks=function(P){w[P]=[]},o.removeAllHooks=function(){w=wr()},o}var $o=to();const br=new Set(["apng","bmp","gif","ico","cur","jpeg","jpg","jfif","pjpeg","pjp","png","svg","tif","tiff","webp"]);function ae(f,o={}){return!o||typeof o!="object"||Object.assign(f.style,o),f}function Yo(f){if(!f||typeof f!="string")return!1;try{return btoa(atob(f))===f}catch{return!1}}function Wo(f){let o;try{o=new URL(f)}catch{return!1}return o.protocol==="http:"||o.protocol==="https:"}function Yn(f){return $o.sanitize(f,{ALLOWED_TAGS:["b","i","u","strong","em","br","span","p","div"],ALLOWED_ATTR:["style","class"],RETURN_DOM_FRAGMENT:!1})}function Ko(f){const o=ae(document.createElement("div"),f.style);return o.innerHTML=Yn(f.value||""),o}function Jo(f,o="td"){const s=ae(document.createElement(o),{padding:"7px 2px",...f.style});return s.innerHTML=Yn(f.value||""),s}function no(f){const o=ae(document.createElement("div"),{width:"100%",display:"flex",justifyContent:f.position||"left"});let s;if(f.url){const u=Yo(f.url);if(!Wo(f.url)&&!u)throw new Error(`Invalid url: ${f.url}`);u?s="data:image/png;base64,"+f.url:s=f.url}else if(f.path){const u=window.electronAPI.readFileAsBase64(f.path);if(!u.success)throw new Error(u.error);let l=window.electronAPI.getFileExtension(f.path);if(!br.has(l))throw new Error(l+" file type not supported, consider the types: "+[...br].join());l==="svg"&&(l="svg+xml"),s="data:image/"+l+";base64,"+u.data}else throw new Error("Image requires either a valid url or path property");if(!s)throw new Error("Failed to generate image URI");const i=ae(document.createElement("img"),{height:f.height,width:f.width,...f.style});return i.src=s,o.prepend(i),o}function ro(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var gt={},$e={},_t={},Ar;function te(){if(Ar)return _t;Ar=1,Object.defineProperty(_t,"__esModule",{value:!0});function f(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}var o=function s(i,u){f(this,s),this.data=i,this.text=u.text||i,this.options=u};return _t.default=o,_t}var Tr;function Qo(){if(Tr)return $e;Tr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.CODE39=void 0;var f=(function(){function _(v,m){for(var E=0;E<m.length;E++){var T=m[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,T.key,T)}}return function(v,m,E){return m&&_(v.prototype,m),E&&_(v,E),v}})(),o=te(),s=i(o);function i(_){return _&&_.__esModule?_:{default:_}}function u(_,v){if(!(_ instanceof v))throw new TypeError("Cannot call a class as a function")}function l(_,v){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:_}function d(_,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);_.prototype=Object.create(v&&v.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(_,v):_.__proto__=v)}var h=(function(_){d(v,_);function v(m,E){return u(this,v),m=m.toUpperCase(),E.mod43&&(m+=n(g(m))),l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,m,E))}return f(v,[{key:"encode",value:function(){for(var E=t("*"),T=0;T<this.data.length;T++)E+=t(this.data[T])+"0";return E+=t("*"),{data:E,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),v})(s.default),a=["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","-","."," ","$","/","+","%","*"],e=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function t(_){return r(c(_))}function r(_){return e[_].toString(2)}function n(_){return a[_]}function c(_){return a.indexOf(_)}function g(_){for(var v=0,m=0;m<_.length;m++)v+=c(_[m]);return v=v%43,v}return $e.CODE39=h,$e}var ie={},pt={},vt={},F={},Sr;function et(){if(Sr)return F;Sr=1,Object.defineProperty(F,"__esModule",{value:!0});var f;function o(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var s=F.SET_A=0,i=F.SET_B=1,u=F.SET_C=2;F.SHIFT=98;var l=F.START_A=103,d=F.START_B=104,h=F.START_C=105;return F.MODULO=103,F.STOP=106,F.FNC1=207,F.SET_BY_CODE=(f={},o(f,l,s),o(f,d,i),o(f,h,u),f),F.SWAP={101:s,100:i,99:u},F.A_START_CHAR="Ð",F.B_START_CHAR="Ñ",F.C_START_CHAR="Ò",F.A_CHARS="[\0-_È-Ï]",F.B_CHARS="[ -È-Ï]",F.C_CHARS="(Ï*[0-9]{2}Ï*)",F.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],F}var Rr;function Zt(){if(Rr)return vt;Rr=1,Object.defineProperty(vt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=te(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){l(this,t);var c=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r.substring(1),n));return c.bytes=r.split("").map(function(g){return g.charCodeAt(0)}),c}return f(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,c=n.shift()-105,g=i.SET_BY_CODE[c];if(g===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(i.FNC1);var _=t.next(n,1,g);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(c)+_.result+t.getBar((_.checksum+c)%i.MODULO)+t.getBar(i.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return i.BARS[n]?i.BARS[n].toString():""}},{key:"correctIndex",value:function(n,c){if(c===i.SET_A){var g=n.shift();return g<32?g+64:g-32}else return c===i.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,c,g){if(!n.length)return{result:"",checksum:0};var _=void 0,v=void 0;if(n[0]>=200){v=n.shift()-105;var m=i.SWAP[v];m!==void 0?_=t.next(n,c+1,m):((g===i.SET_A||g===i.SET_B)&&v===i.SHIFT&&(n[0]=g===i.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),_=t.next(n,c+1,g))}else v=t.correctIndex(n,g),_=t.next(n,c+1,g);var E=t.getBar(v),T=v*c;return{result:E+_.result,checksum:T+_.checksum}}}]),t})(s.default);return vt.default=a,vt}var mt={},Ir;function Zo(){if(Ir)return mt;Ir=1,Object.defineProperty(mt,"__esModule",{value:!0});var f=et(),o=function(h){return h.match(new RegExp("^"+f.A_CHARS+"*"))[0].length},s=function(h){return h.match(new RegExp("^"+f.B_CHARS+"*"))[0].length},i=function(h){return h.match(new RegExp("^"+f.C_CHARS+"*"))[0]};function u(d,h){var a=h?f.A_CHARS:f.B_CHARS,e=d.match(new RegExp("^("+a+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+"Ì"+l(d.substring(e[1].length));var t=d.match(new RegExp("^"+a+"+"))[0];return t.length===d.length?d:t+String.fromCharCode(h?205:206)+u(d.substring(t.length),!h)}function l(d){var h=i(d),a=h.length;if(a===d.length)return d;d=d.substring(a);var e=o(d)>=s(d);return h+String.fromCharCode(e?206:205)+u(d,e)}return mt.default=function(d){var h=void 0,a=i(d).length;if(a>=2)h=f.C_START_CHAR+l(d);else{var e=o(d)>s(d);h=(e?f.A_START_CHAR:f.B_START_CHAR)+u(d,e)}return h.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,r){return"Ë"+r})},mt}var Cr;function ea(){if(Cr)return pt;Cr=1,Object.defineProperty(pt,"__esModule",{value:!0});var f=Zt(),o=u(f),s=Zo(),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){if(l(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var c=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,i.default)(r),n));else var c=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return d(c)}return t})(o.default);return pt.default=a,pt}var Et={},Mr;function ta(){if(Mr)return Et;Mr=1,Object.defineProperty(Et,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Zt(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.A_START_CHAR+r,n))}return f(t,[{key:"valid",value:function(){return new RegExp("^"+i.A_CHARS+"+$").test(this.data)}}]),t})(s.default);return Et.default=a,Et}var yt={},Pr;function na(){if(Pr)return yt;Pr=1,Object.defineProperty(yt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Zt(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.B_START_CHAR+r,n))}return f(t,[{key:"valid",value:function(){return new RegExp("^"+i.B_CHARS+"+$").test(this.data)}}]),t})(s.default);return yt.default=a,yt}var Ot={},xr;function ra(){if(xr)return Ot;xr=1,Object.defineProperty(Ot,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Zt(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.C_START_CHAR+r,n))}return f(t,[{key:"valid",value:function(){return new RegExp("^"+i.C_CHARS+"+$").test(this.data)}}]),t})(s.default);return Ot.default=a,Ot}var Dr;function ia(){if(Dr)return ie;Dr=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.CODE128C=ie.CODE128B=ie.CODE128A=ie.CODE128=void 0;var f=ea(),o=a(f),s=ta(),i=a(s),u=na(),l=a(u),d=ra(),h=a(d);function a(e){return e&&e.__esModule?e:{default:e}}return ie.CODE128=o.default,ie.CODE128A=i.default,ie.CODE128B=l.default,ie.CODE128C=h.default,ie}var $={},wt={},pe={},Lr;function tt(){return Lr||(Lr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.SIDE_BIN="101",pe.MIDDLE_BIN="01010",pe.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},pe.EAN2_STRUCTURE=["LL","LG","GL","GG"],pe.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],pe.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),pe}var bt={},At={},Nr;function nt(){if(Nr)return At;Nr=1,Object.defineProperty(At,"__esModule",{value:!0});var f=tt(),o=function(i,u,l){var d=i.split("").map(function(a,e){return f.BINARIES[u[e]]}).map(function(a,e){return a?a[i[e]]:""});if(l){var h=i.length-1;d=d.map(function(a,e){return e<h?a+l:a})}return d.join("")};return At.default=o,At}var Br;function io(){if(Br)return bt;Br=1,Object.defineProperty(bt,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})(),o=tt(),s=nt(),i=d(s),u=te(),l=d(u);function d(r){return r&&r.__esModule?r:{default:r}}function h(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function a(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function e(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var t=(function(r){e(n,r);function n(c,g){h(this,n);var _=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g));return _.fontSize=!g.flat&&g.fontSize>g.width*10?g.width*10:g.fontSize,_.guardHeight=g.height+_.fontSize/2+g.textMargin,_}return f(n,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(g,_){return this.text.substr(g,_)}},{key:"leftEncode",value:function(g,_){return(0,i.default)(g,_)}},{key:"rightText",value:function(g,_){return this.text.substr(g,_)}},{key:"rightEncode",value:function(g,_){return(0,i.default)(g,_)}},{key:"encodeGuarded",value:function(){var g={fontSize:this.fontSize},_={height:this.guardHeight};return[{data:o.SIDE_BIN,options:_},{data:this.leftEncode(),text:this.leftText(),options:g},{data:o.MIDDLE_BIN,options:_},{data:this.rightEncode(),text:this.rightText(),options:g},{data:o.SIDE_BIN,options:_}]}},{key:"encodeFlat",value:function(){var g=[o.SIDE_BIN,this.leftEncode(),o.MIDDLE_BIN,this.rightEncode(),o.SIDE_BIN];return{data:g.join(""),text:this.text}}}]),n})(l.default);return bt.default=t,bt}var kr;function oa(){if(kr)return wt;kr=1,Object.defineProperty(wt,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})(),o=function r(n,c,g){n===null&&(n=Function.prototype);var _=Object.getOwnPropertyDescriptor(n,c);if(_===void 0){var v=Object.getPrototypeOf(n);return v===null?void 0:r(v,c,g)}else{if("value"in _)return _.value;var m=_.get;return m===void 0?void 0:m.call(g)}},s=tt(),i=io(),u=l(i);function l(r){return r&&r.__esModule?r:{default:r}}function d(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function h(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function a(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var e=function(n){var c=n.substr(0,12).split("").map(function(g){return+g}).reduce(function(g,_,v){return v%2?g+_*3:g+_},0);return(10-c%10)%10},t=(function(r){a(n,r);function n(c,g){d(this,n),c.search(/^[0-9]{12}$/)!==-1&&(c+=e(c));var _=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g));return _.lastChar=g.lastChar,_}return f(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===e(this.data)}},{key:"leftText",value:function(){return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var g=this.data.substr(1,6),_=s.EAN13_STRUCTURE[this.data[0]];return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,g,_)}},{key:"rightText",value:function(){return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var g=this.data.substr(7,6);return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,g,"RRRRRR")}},{key:"encodeGuarded",value:function(){var g=o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(g.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(g.push({data:"00"}),g.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),g}}]),n})(u.default);return wt.default=t,wt}var Tt={},qr;function aa(){if(qr)return Tt;qr=1,Object.defineProperty(Tt,"__esModule",{value:!0});var f=(function(){function t(r,n){for(var c=0;c<n.length;c++){var g=n[c];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}return function(r,n,c){return n&&t(r.prototype,n),c&&t(r,c),r}})(),o=function t(r,n,c){r===null&&(r=Function.prototype);var g=Object.getOwnPropertyDescriptor(r,n);if(g===void 0){var _=Object.getPrototypeOf(r);return _===null?void 0:t(_,n,c)}else{if("value"in g)return g.value;var v=g.get;return v===void 0?void 0:v.call(c)}},s=io(),i=u(s);function u(t){return t&&t.__esModule?t:{default:t}}function l(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function d(t,r){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:t}function h(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(t,r):t.__proto__=r)}var a=function(r){var n=r.substr(0,7).split("").map(function(c){return+c}).reduce(function(c,g,_){return _%2?c+g:c+g*3},0);return(10-n%10)%10},e=(function(t){h(r,t);function r(n,c){return l(this,r),n.search(/^[0-9]{7}$/)!==-1&&(n+=a(n)),d(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,n,c))}return f(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===a(this.data)}},{key:"leftText",value:function(){return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var c=this.data.substr(0,4);return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftEncode",this).call(this,c,"LLLL")}},{key:"rightText",value:function(){return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var c=this.data.substr(4,4);return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightEncode",this).call(this,c,"RRRR")}}]),r})(i.default);return Tt.default=e,Tt}var St={},Fr;function ua(){if(Fr)return St;Fr=1,Object.defineProperty(St,"__esModule",{value:!0});var f=(function(){function n(c,g){for(var _=0;_<g.length;_++){var v=g[_];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}return function(c,g,_){return g&&n(c.prototype,g),_&&n(c,_),c}})(),o=tt(),s=nt(),i=d(s),u=te(),l=d(u);function d(n){return n&&n.__esModule?n:{default:n}}function h(n,c){if(!(n instanceof c))throw new TypeError("Cannot call a class as a function")}function a(n,c){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:n}function e(n,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);n.prototype=Object.create(c&&c.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(n,c):n.__proto__=c)}var t=function(c){var g=c.split("").map(function(_){return+_}).reduce(function(_,v,m){return m%2?_+v*9:_+v*3},0);return g%10},r=(function(n){e(c,n);function c(g,_){return h(this,c),a(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,g,_))}return f(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var _=o.EAN5_STRUCTURE[t(this.data)];return{data:"1011"+(0,i.default)(this.data,_,"01"),text:this.text}}}]),c})(l.default);return St.default=r,St}var Rt={},Ur;function fa(){if(Ur)return Rt;Ur=1,Object.defineProperty(Rt,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})(),o=tt(),s=nt(),i=d(s),u=te(),l=d(u);function d(r){return r&&r.__esModule?r:{default:r}}function h(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function a(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function e(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var t=(function(r){e(n,r);function n(c,g){return h(this,n),a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g))}return f(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var g=o.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,i.default)(this.data,g,"01"),text:this.text}}}]),n})(l.default);return Rt.default=t,Rt}var Ye={},jr;function oo(){if(jr)return Ye;jr=1,Object.defineProperty(Ye,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})();Ye.checksum=t;var o=nt(),s=l(o),i=te(),u=l(i);function l(r){return r&&r.__esModule?r:{default:r}}function d(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function h(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function a(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var e=(function(r){a(n,r);function n(c,g){d(this,n),c.search(/^[0-9]{11}$/)!==-1&&(c+=t(c));var _=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g));return _.displayValue=g.displayValue,g.fontSize>g.width*10?_.fontSize=g.width*10:_.fontSize=g.fontSize,_.guardHeight=g.height+_.fontSize/2+g.textMargin,_}return f(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var g="";return g+="101",g+=(0,s.default)(this.data.substr(0,6),"LLLLLL"),g+="01010",g+=(0,s.default)(this.data.substr(6,6),"RRRRRR"),g+="101",{data:g,text:this.text}}},{key:"guardedEncoding",value:function(){var g=[];return this.displayValue&&g.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),g.push({data:"101"+(0,s.default)(this.data[0],"L"),options:{height:this.guardHeight}}),g.push({data:(0,s.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),g.push({data:"01010",options:{height:this.guardHeight}}),g.push({data:(0,s.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),g.push({data:(0,s.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&g.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),g}}]),n})(u.default);function t(r){var n=0,c;for(c=1;c<11;c+=2)n+=parseInt(r[c]);for(c=0;c<11;c+=2)n+=parseInt(r[c])*3;return(10-n%10)%10}return Ye.default=e,Ye}var It={},Gr;function ca(){if(Gr)return It;Gr=1,Object.defineProperty(It,"__esModule",{value:!0});var f=(function(){function g(_,v){for(var m=0;m<v.length;m++){var E=v[m];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,v,m){return v&&g(_.prototype,v),m&&g(_,m),_}})(),o=nt(),s=d(o),i=te(),u=d(i),l=oo();function d(g){return g&&g.__esModule?g:{default:g}}function h(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function a(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:g}function e(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(g,_):g.__proto__=_)}var t=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],r=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],n=(function(g){e(_,g);function _(v,m){h(this,_);var E=a(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,v,m));if(E.isValid=!1,v.search(/^[0-9]{6}$/)!==-1)E.middleDigits=v,E.upcA=c(v,"0"),E.text=m.text||""+E.upcA[0]+v+E.upcA[E.upcA.length-1],E.isValid=!0;else if(v.search(/^[01][0-9]{7}$/)!==-1)if(E.middleDigits=v.substring(1,v.length-1),E.upcA=c(E.middleDigits,v[0]),E.upcA[E.upcA.length-1]===v[v.length-1])E.isValid=!0;else return a(E);else return a(E);return E.displayValue=m.displayValue,m.fontSize>m.width*10?E.fontSize=m.width*10:E.fontSize=m.fontSize,E.guardHeight=m.height+E.fontSize/2+m.textMargin,E}return f(_,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var m="";return m+="101",m+=this.encodeMiddleDigits(),m+="010101",{data:m,text:this.text}}},{key:"guardedEncoding",value:function(){var m=[];return this.displayValue&&m.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),m.push({data:"101",options:{height:this.guardHeight}}),m.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),m.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&m.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),m}},{key:"encodeMiddleDigits",value:function(){var m=this.upcA[0],E=this.upcA[this.upcA.length-1],T=r[parseInt(E)][parseInt(m)];return(0,s.default)(this.middleDigits,T)}}]),_})(u.default);function c(g,_){for(var v=parseInt(g[g.length-1]),m=t[v],E="",T=0,R=0;R<m.length;R++){var N=m[R];N==="X"?E+=g[T++]:E+=N}return E=""+_+E,""+E+(0,l.checksum)(E)}return It.default=n,It}var Hr;function la(){if(Hr)return $;Hr=1,Object.defineProperty($,"__esModule",{value:!0}),$.UPCE=$.UPC=$.EAN2=$.EAN5=$.EAN8=$.EAN13=void 0;var f=oa(),o=n(f),s=aa(),i=n(s),u=ua(),l=n(u),d=fa(),h=n(d),a=oo(),e=n(a),t=ca(),r=n(t);function n(c){return c&&c.__esModule?c:{default:c}}return $.EAN13=o.default,$.EAN8=i.default,$.EAN5=l.default,$.EAN2=h.default,$.UPC=e.default,$.UPCE=r.default,$}var we={},Ct={},Le={},zr;function sa(){return zr||(zr=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.START_BIN="1010",Le.END_BIN="11101",Le.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),Le}var Vr;function ao(){if(Vr)return Ct;Vr=1,Object.defineProperty(Ct,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=sa(),s=te(),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,c=this.data.match(/.{2}/g).map(function(g){return n.encodePair(g)}).join("");return{data:o.START_BIN+c+o.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var c=o.BINARIES[n[1]];return o.BINARIES[n[0]].split("").map(function(g,_){return(g==="1"?"111":"1")+(c[_]==="1"?"000":"0")}).join("")}}]),t})(i.default);return Ct.default=a,Ct}var Mt={},Xr;function da(){if(Xr)return Mt;Xr=1,Object.defineProperty(Mt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=ao(),s=i(o);function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function d(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(t){var r=t.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,c,g){return n+c*(3-g%2*2)},0);return Math.ceil(r/10)*10-r},a=(function(e){d(t,e);function t(r,n){return u(this,t),r.search(/^[0-9]{13}$/)!==-1&&(r+=h(r)),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n))}return f(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===h(this.data)}}]),t})(s.default);return Mt.default=a,Mt}var $r;function ha(){if($r)return we;$r=1,Object.defineProperty(we,"__esModule",{value:!0}),we.ITF14=we.ITF=void 0;var f=ao(),o=u(f),s=da(),i=u(s);function u(l){return l&&l.__esModule?l:{default:l}}return we.ITF=o.default,we.ITF14=i.default,we}var Q={},Pt={},Yr;function rt(){if(Yr)return Pt;Yr=1,Object.defineProperty(Pt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=te(),s=i(o);function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function d(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=(function(e){d(t,e);function t(r,n){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n))}return f(t,[{key:"encode",value:function(){for(var n="110",c=0;c<this.data.length;c++){var g=parseInt(this.data[c]),_=g.toString(2);_=a(_,4-_.length);for(var v=0;v<_.length;v++)n+=_[v]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),t})(s.default);function a(e,t){for(var r=0;r<t;r++)e="0"+e;return e}return Pt.default=h,Pt}var xt={},We={},Wr;function en(){if(Wr)return We;Wr=1,Object.defineProperty(We,"__esModule",{value:!0}),We.mod10=f,We.mod11=o;function f(s){for(var i=0,u=0;u<s.length;u++){var l=parseInt(s[u]);(u+s.length)%2===0?i+=l:i+=l*2%10+Math.floor(l*2/10)}return(10-i%10)%10}function o(s){for(var i=0,u=[2,3,4,5,6,7],l=0;l<s.length;l++){var d=parseInt(s[s.length-1-l]);i+=u[l%u.length]*d}return(11-i%11)%11}return We}var Kr;function ga(){if(Kr)return xt;Kr=1,Object.defineProperty(xt,"__esModule",{value:!0});var f=rt(),o=i(f),s=en();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,s.mod10)(t),r))}return e})(o.default);return xt.default=h,xt}var Dt={},Jr;function _a(){if(Jr)return Dt;Jr=1,Object.defineProperty(Dt,"__esModule",{value:!0});var f=rt(),o=i(f),s=en();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,s.mod11)(t),r))}return e})(o.default);return Dt.default=h,Dt}var Lt={},Qr;function pa(){if(Qr)return Lt;Qr=1,Object.defineProperty(Lt,"__esModule",{value:!0});var f=rt(),o=i(f),s=en();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),t+=(0,s.mod10)(t),t+=(0,s.mod10)(t),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return e})(o.default);return Lt.default=h,Lt}var Nt={},Zr;function va(){if(Zr)return Nt;Zr=1,Object.defineProperty(Nt,"__esModule",{value:!0});var f=rt(),o=i(f),s=en();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),t+=(0,s.mod11)(t),t+=(0,s.mod10)(t),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return e})(o.default);return Nt.default=h,Nt}var ei;function ma(){if(ei)return Q;ei=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.MSI1110=Q.MSI1010=Q.MSI11=Q.MSI10=Q.MSI=void 0;var f=rt(),o=t(f),s=ga(),i=t(s),u=_a(),l=t(u),d=pa(),h=t(d),a=va(),e=t(a);function t(r){return r&&r.__esModule?r:{default:r}}return Q.MSI=o.default,Q.MSI10=i.default,Q.MSI11=l.default,Q.MSI1010=h.default,Q.MSI1110=e.default,Q}var Ke={},ti;function Ea(){if(ti)return Ke;ti=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.pharmacode=void 0;var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=te(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){u(this,e);var n=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return n.number=parseInt(t,10),n}return f(e,[{key:"encode",value:function(){for(var r=this.number,n="";!isNaN(r)&&r!=0;)r%2===0?(n="11100"+n,r=(r-2)/2):(n="100"+n,r=(r-1)/2);return n=n.slice(0,-2),{data:n,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e})(s.default);return Ke.pharmacode=h,Ke}var Je={},ni;function ya(){if(ni)return Je;ni=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.codabar=void 0;var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=te(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){u(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var n=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),r));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return f(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var r=[],n=this.getEncodings(),c=0;c<this.data.length;c++)r.push(n[this.data.charAt(c)]),c!==this.data.length-1&&r.push("0");return{text:this.text,data:r.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e})(s.default);return Je.codabar=h,Je}var be={},Bt={},Ne={},ri;function Oa(){return ri||(ri=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.SYMBOLS=["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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],Ne.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],Ne.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),Ne}var ii;function uo(){if(ii)return Bt;ii=1,Object.defineProperty(Bt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Oa(),s=te(),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n))}return f(t,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.data.split("").flatMap(function(v){return o.MULTI_SYMBOLS[v]||v}),c=n.map(function(v){return t.getEncoding(v)}).join(""),g=t.checksum(n,20),_=t.checksum(n.concat(g),15);return{text:this.text,data:t.getEncoding("ÿ")+c+t.getEncoding(g)+t.getEncoding(_)+t.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(n){return o.BINARIES[t.symbolValue(n)]}},{key:"getSymbol",value:function(n){return o.SYMBOLS[n]}},{key:"symbolValue",value:function(n){return o.SYMBOLS.indexOf(n)}},{key:"checksum",value:function(n,c){var g=n.slice().reverse().reduce(function(_,v,m){var E=m%c+1;return _+t.symbolValue(v)*E},0);return t.getSymbol(g%47)}}]),t})(i.default);return Bt.default=a,Bt}var kt={},oi;function wa(){if(oi)return kt;oi=1,Object.defineProperty(kt,"__esModule",{value:!0});var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=uo(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return f(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e})(s.default);return kt.default=h,kt}var ai;function ba(){if(ai)return be;ai=1,Object.defineProperty(be,"__esModule",{value:!0}),be.CODE93FullASCII=be.CODE93=void 0;var f=uo(),o=u(f),s=wa(),i=u(s);function u(l){return l&&l.__esModule?l:{default:l}}return be.CODE93=o.default,be.CODE93FullASCII=i.default,be}var Qe={},ui;function Aa(){if(ui)return Qe;ui=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.GenericBarcode=void 0;var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=te(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return f(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e})(s.default);return Qe.GenericBarcode=h,Qe}var fi;function Ta(){if(fi)return gt;fi=1,Object.defineProperty(gt,"__esModule",{value:!0});var f=Qo(),o=ia(),s=la(),i=ha(),u=ma(),l=Ea(),d=ya(),h=ba(),a=Aa();return gt.default={CODE39:f.CODE39,CODE128:o.CODE128,CODE128A:o.CODE128A,CODE128B:o.CODE128B,CODE128C:o.CODE128C,EAN13:s.EAN13,EAN8:s.EAN8,EAN5:s.EAN5,EAN2:s.EAN2,UPC:s.UPC,UPCE:s.UPCE,ITF14:i.ITF14,ITF:i.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:l.pharmacode,codabar:d.codabar,CODE93:h.CODE93,CODE93FullASCII:h.CODE93FullASCII,GenericBarcode:a.GenericBarcode},gt}var qt={},ci;function tn(){if(ci)return qt;ci=1,Object.defineProperty(qt,"__esModule",{value:!0});var f=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o};return qt.default=function(o,s){return f({},o,s)},qt}var Ft={},li;function Sa(){if(li)return Ft;li=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=f;function f(o){var s=[];function i(u){if(Array.isArray(u))for(var l=0;l<u.length;l++)i(u[l]);else u.text=u.text||"",u.data=u.data||"",s.push(u)}return i(o),s}return Ft}var Ut={},si;function Ra(){if(si)return Ut;si=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.default=f;function f(o){return o.marginTop=o.marginTop||o.margin,o.marginBottom=o.marginBottom||o.margin,o.marginRight=o.marginRight||o.margin,o.marginLeft=o.marginLeft||o.margin,o}return Ut}var jt={},Gt={},Ht={},di;function fo(){if(di)return Ht;di=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=f;function f(o){var s=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var i in s)s.hasOwnProperty(i)&&(i=s[i],typeof o[i]=="string"&&(o[i]=parseInt(o[i],10)));return typeof o.displayValue=="string"&&(o.displayValue=o.displayValue!="false"),o}return Ht}var zt={},hi;function co(){if(hi)return zt;hi=1,Object.defineProperty(zt,"__esModule",{value:!0});var f={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};return zt.default=f,zt}var gi;function Ia(){if(gi)return Gt;gi=1,Object.defineProperty(Gt,"__esModule",{value:!0});var f=fo(),o=u(f),s=co(),i=u(s);function u(d){return d&&d.__esModule?d:{default:d}}function l(d){var h={};for(var a in i.default)i.default.hasOwnProperty(a)&&(d.hasAttribute("jsbarcode-"+a.toLowerCase())&&(h[a]=d.getAttribute("jsbarcode-"+a.toLowerCase())),d.hasAttribute("data-"+a.toLowerCase())&&(h[a]=d.getAttribute("data-"+a.toLowerCase())));return h.value=d.getAttribute("jsbarcode-value")||d.getAttribute("data-value"),h=(0,o.default)(h),h}return Gt.default=l,Gt}var Vt={},Xt={},Z={},_i;function lo(){if(_i)return Z;_i=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.getTotalWidthOfEncodings=Z.calculateEncodingAttributes=Z.getBarcodePadding=Z.getEncodingHeight=Z.getMaximumHeightOfEncodings=void 0;var f=tn(),o=s(f);function s(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return t.height+(t.displayValue&&e.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function u(e,t,r){if(r.displayValue&&t<e){if(r.textAlign=="center")return Math.floor((e-t)/2);if(r.textAlign=="left")return 0;if(r.textAlign=="right")return Math.floor(e-t)}return 0}function l(e,t,r){for(var n=0;n<e.length;n++){var c=e[n],g=(0,o.default)(t,c.options),_;g.displayValue?_=a(c.text,g,r):_=0;var v=c.data.length*g.width;c.width=Math.ceil(Math.max(_,v)),c.height=i(c,g),c.barcodePadding=u(_,v,g)}}function d(e){for(var t=0,r=0;r<e.length;r++)t+=e[r].width;return t}function h(e){for(var t=0,r=0;r<e.length;r++)e[r].height>t&&(t=e[r].height);return t}function a(e,t,r){var n;if(r)n=r;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var c=n.measureText(e);if(!c)return 0;var g=c.width;return g}return Z.getMaximumHeightOfEncodings=h,Z.getEncodingHeight=i,Z.getBarcodePadding=u,Z.calculateEncodingAttributes=l,Z.getTotalWidthOfEncodings=d,Z}var pi;function Ca(){if(pi)return Xt;pi=1,Object.defineProperty(Xt,"__esModule",{value:!0});var f=(function(){function h(a,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(a,r.key,r)}}return function(a,e,t){return e&&h(a.prototype,e),t&&h(a,t),a}})(),o=tn(),s=u(o),i=lo();function u(h){return h&&h.__esModule?h:{default:h}}function l(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}var d=(function(){function h(a,e,t){l(this,h),this.canvas=a,this.encodings=e,this.options=t}return f(h,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var t=(0,s.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(t,this.encodings[e]),this.drawCanvasText(t,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save(),(0,i.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,i.getTotalWidthOfEncodings)(this.encodings),r=(0,i.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,t){var r=this.canvas.getContext("2d"),n=t.data,c;e.textPosition=="top"?c=e.marginTop+e.fontSize+e.textMargin:c=e.marginTop,r.fillStyle=e.lineColor;for(var g=0;g<n.length;g++){var _=g*e.width+t.barcodePadding;n[g]==="1"?r.fillRect(_,c,e.width,e.height):n[g]&&r.fillRect(_,c,e.width,e.height*n[g])}}},{key:"drawCanvasText",value:function(e,t){var r=this.canvas.getContext("2d"),n=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var c,g;e.textPosition=="top"?g=e.marginTop+e.fontSize-e.textMargin:g=e.height+e.textMargin+e.marginTop+e.fontSize,r.font=n,e.textAlign=="left"||t.barcodePadding>0?(c=0,r.textAlign="left"):e.textAlign=="right"?(c=t.width-1,r.textAlign="right"):(c=t.width/2,r.textAlign="center"),r.fillText(t.text,c,g)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),h})();return Xt.default=d,Xt}var $t={},vi;function Ma(){if(vi)return $t;vi=1,Object.defineProperty($t,"__esModule",{value:!0});var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=tn(),s=u(o),i=lo();function u(a){return a&&a.__esModule?a:{default:a}}function l(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}var d="http://www.w3.org/2000/svg",h=(function(){function a(e,t,r){l(this,a),this.svg=e,this.encodings=t,this.options=r,this.document=r.xmlDocument||document}return f(a,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var r=0;r<this.encodings.length;r++){var n=this.encodings[r],c=(0,s.default)(this.options,n.options),g=this.createGroup(t,c.marginTop,this.svg);this.setGroupOptions(g,c),this.drawSvgBarcode(g,c,n),this.drawSVGText(g,c,n),t+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,i.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,i.getTotalWidthOfEncodings)(this.encodings),r=(0,i.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,r),this.options.background&&this.drawRect(0,0,n,r,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(t,r,n){var c=n.data,g;r.textPosition=="top"?g=r.fontSize+r.textMargin:g=0;for(var _=0,v=0,m=0;m<c.length;m++)v=m*r.width+n.barcodePadding,c[m]==="1"?_++:_>0&&(this.drawRect(v-r.width*_,g,r.width*_,r.height,t),_=0);_>0&&this.drawRect(v-r.width*(_-1),g,r.width*_,r.height,t)}},{key:"drawSVGText",value:function(t,r,n){var c=this.document.createElementNS(d,"text");if(r.displayValue){var g,_;c.setAttribute("font-family",r.font),c.setAttribute("font-size",r.fontSize),r.fontOptions.includes("bold")&&c.setAttribute("font-weight","bold"),r.fontOptions.includes("italic")&&c.setAttribute("font-style","italic"),r.textPosition=="top"?_=r.fontSize-r.textMargin:_=r.height+r.textMargin+r.fontSize,r.textAlign=="left"||n.barcodePadding>0?(g=0,c.setAttribute("text-anchor","start")):r.textAlign=="right"?(g=n.width-1,c.setAttribute("text-anchor","end")):(g=n.width/2,c.setAttribute("text-anchor","middle")),c.setAttribute("x",g),c.setAttribute("y",_),c.appendChild(this.document.createTextNode(n.text)),t.appendChild(c)}}},{key:"setSvgAttributes",value:function(t,r){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",r+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+r),n.setAttribute("xmlns",d),n.setAttribute("version","1.1")}},{key:"createGroup",value:function(t,r,n){var c=this.document.createElementNS(d,"g");return c.setAttribute("transform","translate("+t+", "+r+")"),n.appendChild(c),c}},{key:"setGroupOptions",value:function(t,r){t.setAttribute("fill",r.lineColor)}},{key:"drawRect",value:function(t,r,n,c,g){var _=this.document.createElementNS(d,"rect");return _.setAttribute("x",t),_.setAttribute("y",r),_.setAttribute("width",n),_.setAttribute("height",c),g.appendChild(_),_}}]),a})();return $t.default=h,$t}var Yt={},mi;function Pa(){if(mi)return Yt;mi=1,Object.defineProperty(Yt,"__esModule",{value:!0});var f=(function(){function i(u,l){for(var d=0;d<l.length;d++){var h=l[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,l,d){return l&&i(u.prototype,l),d&&i(u,d),u}})();function o(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var s=(function(){function i(u,l,d){o(this,i),this.object=u,this.encodings=l,this.options=d}return f(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i})();return Yt.default=s,Yt}var Ei;function xa(){if(Ei)return Vt;Ei=1,Object.defineProperty(Vt,"__esModule",{value:!0});var f=Ca(),o=d(f),s=Ma(),i=d(s),u=Pa(),l=d(u);function d(h){return h&&h.__esModule?h:{default:h}}return Vt.default={CanvasRenderer:o.default,SVGRenderer:i.default,ObjectRenderer:l.default},Vt}var Be={},yi;function so(){if(yi)return Be;yi=1,Object.defineProperty(Be,"__esModule",{value:!0});function f(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}function o(d,h){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:d}function s(d,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);d.prototype=Object.create(h&&h.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(d,h):d.__proto__=h)}var i=(function(d){s(h,d);function h(a,e){f(this,h);var t=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return t.name="InvalidInputException",t.symbology=a,t.input=e,t.message='"'+t.input+'" is not a valid input for '+t.symbology,t}return h})(Error),u=(function(d){s(h,d);function h(){f(this,h);var a=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return a.name="InvalidElementException",a.message="Not supported type to render on",a}return h})(Error),l=(function(d){s(h,d);function h(){f(this,h);var a=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return a.name="NoElementException",a.message="No element to render on.",a}return h})(Error);return Be.InvalidInputException=i,Be.InvalidElementException=u,Be.NoElementException=l,Be}var Oi;function Da(){if(Oi)return jt;Oi=1,Object.defineProperty(jt,"__esModule",{value:!0});var f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=Ia(),s=d(o),i=xa(),u=d(i),l=so();function d(t){return t&&t.__esModule?t:{default:t}}function h(t){if(typeof t=="string")return a(t);if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++)r.push(h(t[n]));return r}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return e(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,s.default)(t),renderer:u.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,s.default)(t),renderer:u.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:u.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":f(t))==="object"&&!t.nodeName)return{element:t,renderer:u.default.ObjectRenderer};throw new l.InvalidElementException}}function a(t){var r=document.querySelectorAll(t);if(r.length!==0){for(var n=[],c=0;c<r.length;c++)n.push(h(r[c]));return n}}function e(t){var r=document.createElement("canvas");return{element:r,options:(0,s.default)(t),renderer:u.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",r.toDataURL())}}}return jt.default=h,jt}var Wt={},wi;function La(){if(wi)return Wt;wi=1,Object.defineProperty(Wt,"__esModule",{value:!0});var f=(function(){function i(u,l){for(var d=0;d<l.length;d++){var h=l[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,l,d){return l&&i(u.prototype,l),d&&i(u,d),u}})();function o(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var s=(function(){function i(u){o(this,i),this.api=u}return f(i,[{key:"handleCatch",value:function(l){if(l.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw l.message;else throw l;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(l){try{var d=l.apply(void 0,arguments);return this.api._options.valid(!0),d}catch(h){return this.handleCatch(h),this.api}}}]),i})();return Wt.default=s,Wt}var On,bi;function Na(){if(bi)return On;bi=1;var f=Ta(),o=m(f),s=tn(),i=m(s),u=Sa(),l=m(u),d=Ra(),h=m(d),a=Da(),e=m(a),t=fo(),r=m(t),n=La(),c=m(n),g=so(),_=co(),v=m(_);function m(y){return y&&y.__esModule?y:{default:y}}var E=function(){},T=function(S,w,A){var b=new E;if(typeof S>"u")throw Error("No element to render on was provided.");return b._renderProperties=(0,e.default)(S),b._encodings=[],b._options=v.default,b._errorHandler=new c.default(b),typeof w<"u"&&(A=A||{},A.format||(A.format=D()),b.options(A)[A.format](w,A).render()),b};T.getModule=function(y){return o.default[y]};for(var R in o.default)o.default.hasOwnProperty(R)&&N(o.default,R);function N(y,S){E.prototype[S]=E.prototype[S.toUpperCase()]=E.prototype[S.toLowerCase()]=function(w,A){var b=this;return b._errorHandler.wrapBarcodeCall(function(){A.text=typeof A.text>"u"?void 0:""+A.text;var M=(0,i.default)(b._options,A);M=(0,r.default)(M);var ne=y[S],se=I(w,ne,M);return b._encodings.push(se),b})}}function I(y,S,w){y=""+y;var A=new S(y,w);if(!A.valid())throw new g.InvalidInputException(A.constructor.name,y);var b=A.encode();b=(0,l.default)(b);for(var M=0;M<b.length;M++)b[M].options=(0,i.default)(w,b[M].options);return b}function D(){return o.default.CODE128?"CODE128":Object.keys(o.default)[0]}E.prototype.options=function(y){return this._options=(0,i.default)(this._options,y),this},E.prototype.blank=function(y){var S=new Array(y+1).join("0");return this._encodings.push({data:S}),this},E.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var y;for(var S in this._renderProperties){y=this._renderProperties[S];var w=(0,i.default)(this._options,y.options);w.format=="auto"&&(w.format=D()),this._errorHandler.wrapBarcodeCall(function(){var A=w.value,b=o.default[w.format.toUpperCase()],M=I(A,b,w);x(y,M,w)})}}},E.prototype.render=function(){if(!this._renderProperties)throw new g.NoElementException;if(Array.isArray(this._renderProperties))for(var y=0;y<this._renderProperties.length;y++)x(this._renderProperties[y],this._encodings,this._options);else x(this._renderProperties,this._encodings,this._options);return this},E.prototype._defaults=v.default;function x(y,S,w){S=(0,l.default)(S);for(var A=0;A<S.length;A++)S[A].options=(0,i.default)(w,S[A].options),(0,h.default)(S[A].options);(0,h.default)(w);var b=y.renderer,M=new b(y.element,S,w);M.render(),y.afterRender&&y.afterRender()}return typeof window<"u"&&(window.JsBarcode=T),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(y,S){var w=[];return jQuery(this).each(function(){w.push(this)}),T(w,y,S)}),On=T,On}var Ba=Na();const ka=ro(Ba);var ke={},wn,Ai;function qa(){return Ai||(Ai=1,wn=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),wn}var bn={},me={},Ti;function Te(){if(Ti)return me;Ti=1;let f;const o=[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];return me.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},me.getSymbolTotalCodewords=function(i){return o[i]},me.getBCHDigit=function(s){let i=0;for(;s!==0;)i++,s>>>=1;return i},me.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');f=i},me.isKanjiModeEnabled=function(){return typeof f<"u"},me.toSJIS=function(i){return f(i)},me}var An={},Si;function Wn(){return Si||(Si=1,(function(f){f.L={bit:1},f.M={bit:0},f.Q={bit:3},f.H={bit:2};function o(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"l":case"low":return f.L;case"m":case"medium":return f.M;case"q":case"quartile":return f.Q;case"h":case"high":return f.H;default:throw new Error("Unknown EC Level: "+s)}}f.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},f.from=function(i,u){if(f.isValid(i))return i;try{return o(i)}catch{return u}}})(An)),An}var Tn,Ri;function Fa(){if(Ri)return Tn;Ri=1;function f(){this.buffer=[],this.length=0}return f.prototype={get:function(o){const s=Math.floor(o/8);return(this.buffer[s]>>>7-o%8&1)===1},put:function(o,s){for(let i=0;i<s;i++)this.putBit((o>>>s-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const s=Math.floor(this.length/8);this.buffer.length<=s&&this.buffer.push(0),o&&(this.buffer[s]|=128>>>this.length%8),this.length++}},Tn=f,Tn}var Sn,Ii;function Ua(){if(Ii)return Sn;Ii=1;function f(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return f.prototype.set=function(o,s,i,u){const l=o*this.size+s;this.data[l]=i,u&&(this.reservedBit[l]=!0)},f.prototype.get=function(o,s){return this.data[o*this.size+s]},f.prototype.xor=function(o,s,i){this.data[o*this.size+s]^=i},f.prototype.isReserved=function(o,s){return this.reservedBit[o*this.size+s]},Sn=f,Sn}var Rn={},Ci;function ja(){return Ci||(Ci=1,(function(f){const o=Te().getSymbolSize;f.getRowColCoords=function(i){if(i===1)return[];const u=Math.floor(i/7)+2,l=o(i),d=l===145?26:Math.ceil((l-13)/(2*u-2))*2,h=[l-7];for(let a=1;a<u-1;a++)h[a]=h[a-1]-d;return h.push(6),h.reverse()},f.getPositions=function(i){const u=[],l=f.getRowColCoords(i),d=l.length;for(let h=0;h<d;h++)for(let a=0;a<d;a++)h===0&&a===0||h===0&&a===d-1||h===d-1&&a===0||u.push([l[h],l[a]]);return u}})(Rn)),Rn}var In={},Mi;function Ga(){if(Mi)return In;Mi=1;const f=Te().getSymbolSize,o=7;return In.getPositions=function(i){const u=f(i);return[[0,0],[u-o,0],[0,u-o]]},In}var Cn={},Pi;function Ha(){return Pi||(Pi=1,(function(f){f.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};f.isValid=function(u){return u!=null&&u!==""&&!isNaN(u)&&u>=0&&u<=7},f.from=function(u){return f.isValid(u)?parseInt(u,10):void 0},f.getPenaltyN1=function(u){const l=u.size;let d=0,h=0,a=0,e=null,t=null;for(let r=0;r<l;r++){h=a=0,e=t=null;for(let n=0;n<l;n++){let c=u.get(r,n);c===e?h++:(h>=5&&(d+=o.N1+(h-5)),e=c,h=1),c=u.get(n,r),c===t?a++:(a>=5&&(d+=o.N1+(a-5)),t=c,a=1)}h>=5&&(d+=o.N1+(h-5)),a>=5&&(d+=o.N1+(a-5))}return d},f.getPenaltyN2=function(u){const l=u.size;let d=0;for(let h=0;h<l-1;h++)for(let a=0;a<l-1;a++){const e=u.get(h,a)+u.get(h,a+1)+u.get(h+1,a)+u.get(h+1,a+1);(e===4||e===0)&&d++}return d*o.N2},f.getPenaltyN3=function(u){const l=u.size;let d=0,h=0,a=0;for(let e=0;e<l;e++){h=a=0;for(let t=0;t<l;t++)h=h<<1&2047|u.get(e,t),t>=10&&(h===1488||h===93)&&d++,a=a<<1&2047|u.get(t,e),t>=10&&(a===1488||a===93)&&d++}return d*o.N3},f.getPenaltyN4=function(u){let l=0;const d=u.data.length;for(let a=0;a<d;a++)l+=u.data[a];return Math.abs(Math.ceil(l*100/d/5)-10)*o.N4};function s(i,u,l){switch(i){case f.Patterns.PATTERN000:return(u+l)%2===0;case f.Patterns.PATTERN001:return u%2===0;case f.Patterns.PATTERN010:return l%3===0;case f.Patterns.PATTERN011:return(u+l)%3===0;case f.Patterns.PATTERN100:return(Math.floor(u/2)+Math.floor(l/3))%2===0;case f.Patterns.PATTERN101:return u*l%2+u*l%3===0;case f.Patterns.PATTERN110:return(u*l%2+u*l%3)%2===0;case f.Patterns.PATTERN111:return(u*l%3+(u+l)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}f.applyMask=function(u,l){const d=l.size;for(let h=0;h<d;h++)for(let a=0;a<d;a++)l.isReserved(a,h)||l.xor(a,h,s(u,a,h))},f.getBestMask=function(u,l){const d=Object.keys(f.Patterns).length;let h=0,a=1/0;for(let e=0;e<d;e++){l(e),f.applyMask(e,u);const t=f.getPenaltyN1(u)+f.getPenaltyN2(u)+f.getPenaltyN3(u)+f.getPenaltyN4(u);f.applyMask(e,u),t<a&&(a=t,h=e)}return h}})(Cn)),Cn}var Kt={},xi;function ho(){if(xi)return Kt;xi=1;const f=Wn(),o=[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],s=[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];return Kt.getBlocksCount=function(u,l){switch(l){case f.L:return o[(u-1)*4+0];case f.M:return o[(u-1)*4+1];case f.Q:return o[(u-1)*4+2];case f.H:return o[(u-1)*4+3];default:return}},Kt.getTotalCodewordsCount=function(u,l){switch(l){case f.L:return s[(u-1)*4+0];case f.M:return s[(u-1)*4+1];case f.Q:return s[(u-1)*4+2];case f.H:return s[(u-1)*4+3];default:return}},Kt}var Mn={},Ze={},Di;function za(){if(Di)return Ze;Di=1;const f=new Uint8Array(512),o=new Uint8Array(256);return(function(){let i=1;for(let u=0;u<255;u++)f[u]=i,o[i]=u,i<<=1,i&256&&(i^=285);for(let u=255;u<512;u++)f[u]=f[u-255]})(),Ze.log=function(i){if(i<1)throw new Error("log("+i+")");return o[i]},Ze.exp=function(i){return f[i]},Ze.mul=function(i,u){return i===0||u===0?0:f[o[i]+o[u]]},Ze}var Li;function Va(){return Li||(Li=1,(function(f){const o=za();f.mul=function(i,u){const l=new Uint8Array(i.length+u.length-1);for(let d=0;d<i.length;d++)for(let h=0;h<u.length;h++)l[d+h]^=o.mul(i[d],u[h]);return l},f.mod=function(i,u){let l=new Uint8Array(i);for(;l.length-u.length>=0;){const d=l[0];for(let a=0;a<u.length;a++)l[a]^=o.mul(u[a],d);let h=0;for(;h<l.length&&l[h]===0;)h++;l=l.slice(h)}return l},f.generateECPolynomial=function(i){let u=new Uint8Array([1]);for(let l=0;l<i;l++)u=f.mul(u,new Uint8Array([1,o.exp(l)]));return u}})(Mn)),Mn}var Pn,Ni;function Xa(){if(Ni)return Pn;Ni=1;const f=Va();function o(s){this.genPoly=void 0,this.degree=s,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(i){this.degree=i,this.genPoly=f.generateECPolynomial(this.degree)},o.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const u=new Uint8Array(i.length+this.degree);u.set(i);const l=f.mod(u,this.genPoly),d=this.degree-l.length;if(d>0){const h=new Uint8Array(this.degree);return h.set(l,d),h}return l},Pn=o,Pn}var xn={},Dn={},Ln={},Bi;function go(){return Bi||(Bi=1,Ln.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),Ln}var ce={},ki;function _o(){if(ki)return ce;ki=1;const f="[0-9]+",o="[A-Z $%*+\\-./:]+";let s="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";s=s.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+s+`)(?:.|[\r
3
+ ]))+`;ce.KANJI=new RegExp(s,"g"),ce.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ce.BYTE=new RegExp(i,"g"),ce.NUMERIC=new RegExp(f,"g"),ce.ALPHANUMERIC=new RegExp(o,"g");const u=new RegExp("^"+s+"$"),l=new RegExp("^"+f+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ce.testKanji=function(a){return u.test(a)},ce.testNumeric=function(a){return l.test(a)},ce.testAlphanumeric=function(a){return d.test(a)},ce}var qi;function Se(){return qi||(qi=1,(function(f){const o=go(),s=_o();f.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},f.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},f.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},f.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},f.MIXED={bit:-1},f.getCharCountIndicator=function(l,d){if(!l.ccBits)throw new Error("Invalid mode: "+l);if(!o.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?l.ccBits[0]:d<27?l.ccBits[1]:l.ccBits[2]},f.getBestModeForData=function(l){return s.testNumeric(l)?f.NUMERIC:s.testAlphanumeric(l)?f.ALPHANUMERIC:s.testKanji(l)?f.KANJI:f.BYTE},f.toString=function(l){if(l&&l.id)return l.id;throw new Error("Invalid mode")},f.isValid=function(l){return l&&l.bit&&l.ccBits};function i(u){if(typeof u!="string")throw new Error("Param is not a string");switch(u.toLowerCase()){case"numeric":return f.NUMERIC;case"alphanumeric":return f.ALPHANUMERIC;case"kanji":return f.KANJI;case"byte":return f.BYTE;default:throw new Error("Unknown mode: "+u)}}f.from=function(l,d){if(f.isValid(l))return l;try{return i(l)}catch{return d}}})(Dn)),Dn}var Fi;function $a(){return Fi||(Fi=1,(function(f){const o=Te(),s=ho(),i=Wn(),u=Se(),l=go(),d=7973,h=o.getBCHDigit(d);function a(n,c,g){for(let _=1;_<=40;_++)if(c<=f.getCapacity(_,g,n))return _}function e(n,c){return u.getCharCountIndicator(n,c)+4}function t(n,c){let g=0;return n.forEach(function(_){const v=e(_.mode,c);g+=v+_.getBitsLength()}),g}function r(n,c){for(let g=1;g<=40;g++)if(t(n,g)<=f.getCapacity(g,c,u.MIXED))return g}f.from=function(c,g){return l.isValid(c)?parseInt(c,10):g},f.getCapacity=function(c,g,_){if(!l.isValid(c))throw new Error("Invalid QR Code version");typeof _>"u"&&(_=u.BYTE);const v=o.getSymbolTotalCodewords(c),m=s.getTotalCodewordsCount(c,g),E=(v-m)*8;if(_===u.MIXED)return E;const T=E-e(_,c);switch(_){case u.NUMERIC:return Math.floor(T/10*3);case u.ALPHANUMERIC:return Math.floor(T/11*2);case u.KANJI:return Math.floor(T/13);case u.BYTE:default:return Math.floor(T/8)}},f.getBestVersionForData=function(c,g){let _;const v=i.from(g,i.M);if(Array.isArray(c)){if(c.length>1)return r(c,v);if(c.length===0)return 1;_=c[0]}else _=c;return a(_.mode,_.getLength(),v)},f.getEncodedBits=function(c){if(!l.isValid(c)||c<7)throw new Error("Invalid QR Code version");let g=c<<12;for(;o.getBCHDigit(g)-h>=0;)g^=d<<o.getBCHDigit(g)-h;return c<<12|g}})(xn)),xn}var Nn={},Ui;function Ya(){if(Ui)return Nn;Ui=1;const f=Te(),o=1335,s=21522,i=f.getBCHDigit(o);return Nn.getEncodedBits=function(l,d){const h=l.bit<<3|d;let a=h<<10;for(;f.getBCHDigit(a)-i>=0;)a^=o<<f.getBCHDigit(a)-i;return(h<<10|a)^s},Nn}var Bn={},kn,ji;function Wa(){if(ji)return kn;ji=1;const f=Se();function o(s){this.mode=f.NUMERIC,this.data=s.toString()}return o.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){let u,l,d;for(u=0;u+3<=this.data.length;u+=3)l=this.data.substr(u,3),d=parseInt(l,10),i.put(d,10);const h=this.data.length-u;h>0&&(l=this.data.substr(u),d=parseInt(l,10),i.put(d,h*3+1))},kn=o,kn}var qn,Gi;function Ka(){if(Gi)return qn;Gi=1;const f=Se(),o=["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 s(i){this.mode=f.ALPHANUMERIC,this.data=i}return s.getBitsLength=function(u){return 11*Math.floor(u/2)+6*(u%2)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(u){let l;for(l=0;l+2<=this.data.length;l+=2){let d=o.indexOf(this.data[l])*45;d+=o.indexOf(this.data[l+1]),u.put(d,11)}this.data.length%2&&u.put(o.indexOf(this.data[l]),6)},qn=s,qn}var Fn,Hi;function Ja(){if(Hi)return Fn;Hi=1;const f=Se();function o(s){this.mode=f.BYTE,typeof s=="string"?this.data=new TextEncoder().encode(s):this.data=new Uint8Array(s)}return o.getBitsLength=function(i){return i*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(s){for(let i=0,u=this.data.length;i<u;i++)s.put(this.data[i],8)},Fn=o,Fn}var Un,zi;function Qa(){if(zi)return Un;zi=1;const f=Se(),o=Te();function s(i){this.mode=f.KANJI,this.data=i}return s.getBitsLength=function(u){return u*13},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(i){let u;for(u=0;u<this.data.length;u++){let l=o.toSJIS(this.data[u]);if(l>=33088&&l<=40956)l-=33088;else if(l>=57408&&l<=60351)l-=49472;else throw new Error("Invalid SJIS character: "+this.data[u]+`
4
+ Make sure your charset is UTF-8`);l=(l>>>8&255)*192+(l&255),i.put(l,13)}},Un=s,Un}var jn={exports:{}},Vi;function Za(){return Vi||(Vi=1,(function(f){var o={single_source_shortest_paths:function(s,i,u){var l={},d={};d[i]=0;var h=o.PriorityQueue.make();h.push(i,0);for(var a,e,t,r,n,c,g,_,v;!h.empty();){a=h.pop(),e=a.value,r=a.cost,n=s[e]||{};for(t in n)n.hasOwnProperty(t)&&(c=n[t],g=r+c,_=d[t],v=typeof d[t]>"u",(v||_>g)&&(d[t]=g,h.push(t,g),l[t]=e))}if(typeof u<"u"&&typeof d[u]>"u"){var m=["Could not find a path from ",i," to ",u,"."].join("");throw new Error(m)}return l},extract_shortest_path_from_predecessor_list:function(s,i){for(var u=[],l=i;l;)u.push(l),s[l],l=s[l];return u.reverse(),u},find_path:function(s,i,u){var l=o.single_source_shortest_paths(s,i,u);return o.extract_shortest_path_from_predecessor_list(l,u)},PriorityQueue:{make:function(s){var i=o.PriorityQueue,u={},l;s=s||{};for(l in i)i.hasOwnProperty(l)&&(u[l]=i[l]);return u.queue=[],u.sorter=s.sorter||i.default_sorter,u},default_sorter:function(s,i){return s.cost-i.cost},push:function(s,i){var u={value:s,cost:i};this.queue.push(u),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};f.exports=o})(jn)),jn.exports}var Xi;function eu(){return Xi||(Xi=1,(function(f){const o=Se(),s=Wa(),i=Ka(),u=Ja(),l=Qa(),d=_o(),h=Te(),a=Za();function e(m){return unescape(encodeURIComponent(m)).length}function t(m,E,T){const R=[];let N;for(;(N=m.exec(T))!==null;)R.push({data:N[0],index:N.index,mode:E,length:N[0].length});return R}function r(m){const E=t(d.NUMERIC,o.NUMERIC,m),T=t(d.ALPHANUMERIC,o.ALPHANUMERIC,m);let R,N;return h.isKanjiModeEnabled()?(R=t(d.BYTE,o.BYTE,m),N=t(d.KANJI,o.KANJI,m)):(R=t(d.BYTE_KANJI,o.BYTE,m),N=[]),E.concat(T,R,N).sort(function(D,x){return D.index-x.index}).map(function(D){return{data:D.data,mode:D.mode,length:D.length}})}function n(m,E){switch(E){case o.NUMERIC:return s.getBitsLength(m);case o.ALPHANUMERIC:return i.getBitsLength(m);case o.KANJI:return l.getBitsLength(m);case o.BYTE:return u.getBitsLength(m)}}function c(m){return m.reduce(function(E,T){const R=E.length-1>=0?E[E.length-1]:null;return R&&R.mode===T.mode?(E[E.length-1].data+=T.data,E):(E.push(T),E)},[])}function g(m){const E=[];for(let T=0;T<m.length;T++){const R=m[T];switch(R.mode){case o.NUMERIC:E.push([R,{data:R.data,mode:o.ALPHANUMERIC,length:R.length},{data:R.data,mode:o.BYTE,length:R.length}]);break;case o.ALPHANUMERIC:E.push([R,{data:R.data,mode:o.BYTE,length:R.length}]);break;case o.KANJI:E.push([R,{data:R.data,mode:o.BYTE,length:e(R.data)}]);break;case o.BYTE:E.push([{data:R.data,mode:o.BYTE,length:e(R.data)}])}}return E}function _(m,E){const T={},R={start:{}};let N=["start"];for(let I=0;I<m.length;I++){const D=m[I],x=[];for(let y=0;y<D.length;y++){const S=D[y],w=""+I+y;x.push(w),T[w]={node:S,lastCount:0},R[w]={};for(let A=0;A<N.length;A++){const b=N[A];T[b]&&T[b].node.mode===S.mode?(R[b][w]=n(T[b].lastCount+S.length,S.mode)-n(T[b].lastCount,S.mode),T[b].lastCount+=S.length):(T[b]&&(T[b].lastCount=S.length),R[b][w]=n(S.length,S.mode)+4+o.getCharCountIndicator(S.mode,E))}}N=x}for(let I=0;I<N.length;I++)R[N[I]].end=0;return{map:R,table:T}}function v(m,E){let T;const R=o.getBestModeForData(m);if(T=o.from(E,R),T!==o.BYTE&&T.bit<R.bit)throw new Error('"'+m+'" cannot be encoded with mode '+o.toString(T)+`.
5
+ Suggested mode is: `+o.toString(R));switch(T===o.KANJI&&!h.isKanjiModeEnabled()&&(T=o.BYTE),T){case o.NUMERIC:return new s(m);case o.ALPHANUMERIC:return new i(m);case o.KANJI:return new l(m);case o.BYTE:return new u(m)}}f.fromArray=function(E){return E.reduce(function(T,R){return typeof R=="string"?T.push(v(R,null)):R.data&&T.push(v(R.data,R.mode)),T},[])},f.fromString=function(E,T){const R=r(E,h.isKanjiModeEnabled()),N=g(R),I=_(N,T),D=a.find_path(I.map,"start","end"),x=[];for(let y=1;y<D.length-1;y++)x.push(I.table[D[y]].node);return f.fromArray(c(x))},f.rawSplit=function(E){return f.fromArray(r(E,h.isKanjiModeEnabled()))}})(Bn)),Bn}var $i;function tu(){if($i)return bn;$i=1;const f=Te(),o=Wn(),s=Fa(),i=Ua(),u=ja(),l=Ga(),d=Ha(),h=ho(),a=Xa(),e=$a(),t=Ya(),r=Se(),n=eu();function c(I,D){const x=I.size,y=l.getPositions(D);for(let S=0;S<y.length;S++){const w=y[S][0],A=y[S][1];for(let b=-1;b<=7;b++)if(!(w+b<=-1||x<=w+b))for(let M=-1;M<=7;M++)A+M<=-1||x<=A+M||(b>=0&&b<=6&&(M===0||M===6)||M>=0&&M<=6&&(b===0||b===6)||b>=2&&b<=4&&M>=2&&M<=4?I.set(w+b,A+M,!0,!0):I.set(w+b,A+M,!1,!0))}}function g(I){const D=I.size;for(let x=8;x<D-8;x++){const y=x%2===0;I.set(x,6,y,!0),I.set(6,x,y,!0)}}function _(I,D){const x=u.getPositions(D);for(let y=0;y<x.length;y++){const S=x[y][0],w=x[y][1];for(let A=-2;A<=2;A++)for(let b=-2;b<=2;b++)A===-2||A===2||b===-2||b===2||A===0&&b===0?I.set(S+A,w+b,!0,!0):I.set(S+A,w+b,!1,!0)}}function v(I,D){const x=I.size,y=e.getEncodedBits(D);let S,w,A;for(let b=0;b<18;b++)S=Math.floor(b/3),w=b%3+x-8-3,A=(y>>b&1)===1,I.set(S,w,A,!0),I.set(w,S,A,!0)}function m(I,D,x){const y=I.size,S=t.getEncodedBits(D,x);let w,A;for(w=0;w<15;w++)A=(S>>w&1)===1,w<6?I.set(w,8,A,!0):w<8?I.set(w+1,8,A,!0):I.set(y-15+w,8,A,!0),w<8?I.set(8,y-w-1,A,!0):w<9?I.set(8,15-w-1+1,A,!0):I.set(8,15-w-1,A,!0);I.set(y-8,8,1,!0)}function E(I,D){const x=I.size;let y=-1,S=x-1,w=7,A=0;for(let b=x-1;b>0;b-=2)for(b===6&&b--;;){for(let M=0;M<2;M++)if(!I.isReserved(S,b-M)){let ne=!1;A<D.length&&(ne=(D[A]>>>w&1)===1),I.set(S,b-M,ne),w--,w===-1&&(A++,w=7)}if(S+=y,S<0||x<=S){S-=y,y=-y;break}}}function T(I,D,x){const y=new s;x.forEach(function(M){y.put(M.mode.bit,4),y.put(M.getLength(),r.getCharCountIndicator(M.mode,I)),M.write(y)});const S=f.getSymbolTotalCodewords(I),w=h.getTotalCodewordsCount(I,D),A=(S-w)*8;for(y.getLengthInBits()+4<=A&&y.put(0,4);y.getLengthInBits()%8!==0;)y.putBit(0);const b=(A-y.getLengthInBits())/8;for(let M=0;M<b;M++)y.put(M%2?17:236,8);return R(y,I,D)}function R(I,D,x){const y=f.getSymbolTotalCodewords(D),S=h.getTotalCodewordsCount(D,x),w=y-S,A=h.getBlocksCount(D,x),b=y%A,M=A-b,ne=Math.floor(y/A),se=Math.floor(w/A),nn=se+1,qe=ne-se,rn=new a(qe);let Re=0;const q=new Array(A),Fe=new Array(A);let U=0;const it=new Uint8Array(I.buffer);for(let de=0;de<A;de++){const Ee=de<M?se:nn;q[de]=it.slice(Re,Re+Ee),Fe[de]=rn.encode(q[de]),Re+=Ee,U=Math.max(U,Ee)}const B=new Uint8Array(y);let ve=0,K,H;for(K=0;K<U;K++)for(H=0;H<A;H++)K<q[H].length&&(B[ve++]=q[H][K]);for(K=0;K<qe;K++)for(H=0;H<A;H++)B[ve++]=Fe[H][K];return B}function N(I,D,x,y){let S;if(Array.isArray(I))S=n.fromArray(I);else if(typeof I=="string"){let ne=D;if(!ne){const se=n.rawSplit(I);ne=e.getBestVersionForData(se,x)}S=n.fromString(I,ne||40)}else throw new Error("Invalid data");const w=e.getBestVersionForData(S,x);if(!w)throw new Error("The amount of data is too big to be stored in a QR Code");if(!D)D=w;else if(D<w)throw new Error(`
6
+ The chosen QR Code version cannot contain this amount of data.
7
+ Minimum version required to store current data is: `+w+`.
8
+ `);const A=T(D,x,S),b=f.getSymbolSize(D),M=new i(b);return c(M,D),g(M),_(M,D),m(M,x,0),D>=7&&v(M,D),E(M,A),isNaN(y)&&(y=d.getBestMask(M,m.bind(null,M,x))),d.applyMask(y,M),m(M,x,y),{modules:M,version:D,errorCorrectionLevel:x,maskPattern:y,segments:S}}return bn.create=function(D,x){if(typeof D>"u"||D==="")throw new Error("No input text");let y=o.M,S,w;return typeof x<"u"&&(y=o.from(x.errorCorrectionLevel,o.M),S=e.from(x.version),w=d.from(x.maskPattern),x.toSJISFunc&&f.setToSJISFunction(x.toSJISFunc)),N(D,S,y,w)},bn}var Gn={},Hn={},Yi;function po(){return Yi||(Yi=1,(function(f){function o(s){if(typeof s=="number"&&(s=s.toString()),typeof s!="string")throw new Error("Color should be defined as hex string");let i=s.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+s);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(l){return[l,l]}))),i.length===6&&i.push("F","F");const u=parseInt(i.join(""),16);return{r:u>>24&255,g:u>>16&255,b:u>>8&255,a:u&255,hex:"#"+i.slice(0,6).join("")}}f.getOptions=function(i){i||(i={}),i.color||(i.color={});const u=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,l=i.width&&i.width>=21?i.width:void 0,d=i.scale||4;return{width:l,scale:l?4:d,margin:u,color:{dark:o(i.color.dark||"#000000ff"),light:o(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},f.getScale=function(i,u){return u.width&&u.width>=i+u.margin*2?u.width/(i+u.margin*2):u.scale},f.getImageWidth=function(i,u){const l=f.getScale(i,u);return Math.floor((i+u.margin*2)*l)},f.qrToImageData=function(i,u,l){const d=u.modules.size,h=u.modules.data,a=f.getScale(d,l),e=Math.floor((d+l.margin*2)*a),t=l.margin*a,r=[l.color.light,l.color.dark];for(let n=0;n<e;n++)for(let c=0;c<e;c++){let g=(n*e+c)*4,_=l.color.light;if(n>=t&&c>=t&&n<e-t&&c<e-t){const v=Math.floor((n-t)/a),m=Math.floor((c-t)/a);_=r[h[v*d+m]?1:0]}i[g++]=_.r,i[g++]=_.g,i[g++]=_.b,i[g]=_.a}}})(Hn)),Hn}var Wi;function nu(){return Wi||(Wi=1,(function(f){const o=po();function s(u,l,d){u.clearRect(0,0,l.width,l.height),l.style||(l.style={}),l.height=d,l.width=d,l.style.height=d+"px",l.style.width=d+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}f.render=function(l,d,h){let a=h,e=d;typeof a>"u"&&(!d||!d.getContext)&&(a=d,d=void 0),d||(e=i()),a=o.getOptions(a);const t=o.getImageWidth(l.modules.size,a),r=e.getContext("2d"),n=r.createImageData(t,t);return o.qrToImageData(n.data,l,a),s(r,e,t),r.putImageData(n,0,0),e},f.renderToDataURL=function(l,d,h){let a=h;typeof a>"u"&&(!d||!d.getContext)&&(a=d,d=void 0),a||(a={});const e=f.render(l,d,a),t=a.type||"image/png",r=a.rendererOpts||{};return e.toDataURL(t,r.quality)}})(Gn)),Gn}var zn={},Ki;function ru(){if(Ki)return zn;Ki=1;const f=po();function o(u,l){const d=u.a/255,h=l+'="'+u.hex+'"';return d<1?h+" "+l+'-opacity="'+d.toFixed(2).slice(1)+'"':h}function s(u,l,d){let h=u+l;return typeof d<"u"&&(h+=" "+d),h}function i(u,l,d){let h="",a=0,e=!1,t=0;for(let r=0;r<u.length;r++){const n=Math.floor(r%l),c=Math.floor(r/l);!n&&!e&&(e=!0),u[r]?(t++,r>0&&n>0&&u[r-1]||(h+=e?s("M",n+d,.5+c+d):s("m",a,0),a=0,e=!1),n+1<l&&u[r+1]||(h+=s("h",t),t=0)):a++}return h}return zn.render=function(l,d,h){const a=f.getOptions(d),e=l.modules.size,t=l.modules.data,r=e+a.margin*2,n=a.color.light.a?"<path "+o(a.color.light,"fill")+' d="M0 0h'+r+"v"+r+'H0z"/>':"",c="<path "+o(a.color.dark,"stroke")+' d="'+i(t,e,a.margin)+'"/>',g='viewBox="0 0 '+r+" "+r+'"',v='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+g+' shape-rendering="crispEdges">'+n+c+`</svg>
9
+ `;return typeof h=="function"&&h(null,v),v},zn}var Ji;function iu(){if(Ji)return ke;Ji=1;const f=qa(),o=tu(),s=nu(),i=ru();function u(l,d,h,a,e){const t=[].slice.call(arguments,1),r=t.length,n=typeof t[r-1]=="function";if(!n&&!f())throw new Error("Callback required as last argument");if(n){if(r<2)throw new Error("Too few arguments provided");r===2?(e=h,h=d,d=a=void 0):r===3&&(d.getContext&&typeof e>"u"?(e=a,a=void 0):(e=a,a=h,h=d,d=void 0))}else{if(r<1)throw new Error("Too few arguments provided");return r===1?(h=d,d=a=void 0):r===2&&!d.getContext&&(a=h,h=d,d=void 0),new Promise(function(c,g){try{const _=o.create(h,a);c(l(_,d,a))}catch(_){g(_)}})}try{const c=o.create(h,a);e(null,l(c,d,a))}catch(c){e(c)}}return ke.create=o.create,ke.toCanvas=u.bind(null,s.render),ke.toDataURL=u.bind(null,s.renderToDataURL),ke.toString=u.bind(null,function(l,d,h){return i.render(l,h)}),ke}var ou=iu();const au=ro(ou),vo=document.querySelector("#main");if(!vo)throw new Error("Main element (#main) not found in document");const Ae=vo;function oe(f,o=null){window.electronAPI.sendRenderLineReply({status:f,error:o})}function uu(f,o){const s=document.createElement("div"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttributeNS(null,"id",`barCode-${o}`),s.append(i),f.style?ae(s,f.style):(s.style.display="flex",s.style.justifyContent=f.position??"left"),f.value&&ka(i,f.value,{lineColor:"#000",textMargin:0,fontOptions:"bold",fontSize:f.fontsize??12,width:f.width?Number.parseInt(f.width,10):4,height:f.height?Number.parseInt(f.height,10):40,displayValue:f.displayValue}),s}async function fu(f,o){const s=document.createElement("div");s.style.display="flex",s.style.justifyContent=f.position||"left",f.style&&ae(s,f.style);const i=document.createElement("canvas");return i.setAttribute("id",`qrCode-${o}`),ae(i,{textAlign:f.position?"-webkit-"+f.position:"-webkit-left"}),s.append(i),await au.toCanvas(i,f.value||"",{width:f.width?Number.parseInt(f.width,10):55,errorCorrectionLevel:"H",color:{dark:"#000",light:"#fff"}}),s}function Vn(f,o,s){for(const i of f)if(typeof i=="object")switch(i.type){case"image":{const u=no(i),l=document.createElement(s);l.append(u),o.append(l);break}case"text":o.append(Jo(i,s));break}else{const u=document.createElement(s);u.innerHTML=Yn(String(i)),o.append(u)}}function cu(f,o){const s=document.createElement("div");s.setAttribute("id",`table-container-${o}`);const i=ae(document.createElement("table"),{...f.style});i.setAttribute("id",`table${o}`);const u=ae(document.createElement("thead"),f.tableHeaderStyle),l=ae(document.createElement("tbody"),f.tableBodyStyle),d=ae(document.createElement("tfoot"),f.tableFooterStyle);if(f.tableHeader&&Vn(f.tableHeader,u,"th"),f.tableBody)for(const h of f.tableBody){const a=document.createElement("tr");Vn(h,a,"td"),l.append(a)}return f.tableFooter&&Vn(f.tableFooter,d,"th"),i.append(u),i.append(l),i.append(d),s.append(i),s}async function lu(f){const{printItem:o,itemIndex:s}=f;switch(o.type){case"text":try{Ae.append(Ko(o)),oe(!0)}catch(i){oe(!1,i.toString())}return;case"image":try{Ae.append(no(o)),oe(!0)}catch(i){oe(!1,i.toString())}return;case"qrCode":try{const i=await fu(o,s);Ae.append(i),oe(!0)}catch(i){oe(!1,i.toString())}return;case"barCode":try{Ae.append(uu(o,s)),oe(!0)}catch(i){oe(!1,i.toString())}return;case"table":try{Ae.append(cu(o,s)),oe(!0)}catch(i){oe(!1,i.toString())}return;default:oe(!1,`Unknown print item type: ${o.type}`)}}window.electronAPI.onBodyInit(function(f){Ae.style.width=f?.width||"100%",Ae.style.margin=f?.margin||"0",window.electronAPI.sendBodyInitReply({status:!0,error:null})});window.electronAPI.onRenderLine(lu);
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <title>Print preview</title>
6
- <script type="module" crossorigin src="./assets/index-CuxDGCZK.js"></script>
6
+ <script type="module" crossorigin src="./assets/index-Dxv7U4zV.js"></script>
7
7
  <link rel="stylesheet" crossorigin href="./assets/index-Dr_XYfBm.css">
8
8
  </head>
9
9
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devraghu/electron-printer",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "private": false,
5
5
  "description": "Electron printer plugin for 80mm, 78mm, 76mm, 58mm, 57mm, 44mm printers",
6
6
  "keywords": [
@@ -43,28 +43,28 @@
43
43
  "fmt": "oxfmt",
44
44
  "fmt:check": "oxfmt --check",
45
45
  "clean": "git clean -fx ./dist",
46
- "prebuild": "npm run clean",
47
- "type-check": "tsc --noEmit",
46
+ "prebuild": "bun run clean",
47
+ "typecheck": "tsc --noEmit",
48
48
  "prepare": "husky"
49
49
  },
50
50
  "dependencies": {
51
- "@devraghu/cashdrawer": "^0.3.0",
52
- "dompurify": "^3.3.1",
51
+ "@devraghu/cashdrawer": "^0.3.2",
52
+ "dompurify": "^3.3.3",
53
53
  "jsbarcode": "^3.12.3",
54
54
  "qrcode": "^1.5.4"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@playwright/test": "^1.58.2",
58
- "@types/node": "^25.3.2",
58
+ "@types/node": "^25.5.0",
59
59
  "@types/qrcode": "^1.5.6",
60
- "electron": "^40.6.1",
60
+ "electron": "^41.0.4",
61
61
  "electron-vite": "^5.0.0",
62
62
  "husky": "^9.1.7",
63
- "lint-staged": "^16.3.0",
64
- "oxfmt": "^0.35.0",
65
- "oxlint": "^1.50.0",
63
+ "lint-staged": "^16.4.0",
64
+ "oxfmt": "^0.42.0",
65
+ "oxlint": "^1.57.0",
66
66
  "playwright": "^1.58.2",
67
- "typescript": "^5.9.3",
67
+ "typescript": "^6.0.2",
68
68
  "vite": "^7.3.1",
69
69
  "vite-plugin-dts": "^4.5.4"
70
70
  },
@@ -78,8 +78,7 @@
78
78
  ]
79
79
  },
80
80
  "engines": {
81
- "node": "^24 || ^22 || ^20",
82
- "npm": ">= 9.0.0",
83
- "yarn": ">= 1.21.1"
84
- }
81
+ "node": "^24 || ^22 || ^20"
82
+ },
83
+ "packageManager": "bun@1.3.11"
85
84
  }
@@ -1,9 +0,0 @@
1
- const{entries:Qi,setPrototypeOf:_r,isFrozen:So,getPrototypeOf:Ro,getOwnPropertyDescriptor:Io}=Object;let{freeze:Y,seal:ne,create:Vn}=Object,{apply:Xn,construct:$n}=typeof Reflect<"u"&&Reflect;Y||(Y=function(o){return o});ne||(ne=function(o){return o});Xn||(Xn=function(o,s){for(var i=arguments.length,u=new Array(i>2?i-2:0),l=2;l<i;l++)u[l-2]=arguments[l];return o.apply(s,u)});$n||($n=function(o){for(var s=arguments.length,i=new Array(s>1?s-1:0),u=1;u<s;u++)i[u-1]=arguments[u];return new o(...i)});const dt=W(Array.prototype.forEach),Co=W(Array.prototype.lastIndexOf),pr=W(Array.prototype.pop),He=W(Array.prototype.push),Mo=W(Array.prototype.splice),Jt=W(String.prototype.toLowerCase),gn=W(String.prototype.toString),_n=W(String.prototype.match),Ge=W(String.prototype.replace),Po=W(String.prototype.indexOf),xo=W(String.prototype.trim),oe=W(Object.prototype.hasOwnProperty),X=W(RegExp.prototype.test),ze=Lo(TypeError);function W(f){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var s=arguments.length,i=new Array(s>1?s-1:0),u=1;u<s;u++)i[u-1]=arguments[u];return Xn(f,o,i)}}function Lo(f){return function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return $n(f,s)}}function D(f,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jt;_r&&_r(f,null);let i=o.length;for(;i--;){let u=o[i];if(typeof u=="string"){const l=s(u);l!==u&&(So(o)||(o[i]=l),u=l)}f[u]=!0}return f}function Do(f){for(let o=0;o<f.length;o++)oe(f,o)||(f[o]=null);return f}function le(f){const o=Vn(null);for(const[s,i]of Qi(f))oe(f,s)&&(Array.isArray(i)?o[s]=Do(i):i&&typeof i=="object"&&i.constructor===Object?o[s]=le(i):o[s]=i);return o}function Ve(f,o){for(;f!==null;){const i=Io(f,o);if(i){if(i.get)return W(i.get);if(typeof i.value=="function")return W(i.value)}f=Ro(f)}function s(){return null}return s}const vr=Y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pn=Y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),vn=Y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),No=Y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mn=Y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Bo=Y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mr=Y(["#text"]),Er=Y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),En=Y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yr=Y(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ht=Y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ko=ne(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qo=ne(/<%[\w\W]*|[\w\W]*%>/gm),Fo=ne(/\$\{[\w\W]*/gm),Uo=ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),jo=ne(/^aria-[\-\w]+$/),Zi=ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ho=ne(/^(?:\w+script|data):/i),Go=ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eo=ne(/^html$/i),zo=ne(/^[a-z][.\w]*(-[.\w]+)+$/i);var Or=Object.freeze({__proto__:null,ARIA_ATTR:jo,ATTR_WHITESPACE:Go,CUSTOM_ELEMENT:zo,DATA_ATTR:Uo,DOCTYPE_NAME:eo,ERB_EXPR:qo,IS_ALLOWED_URI:Zi,IS_SCRIPT_OR_DATA:Ho,MUSTACHE_EXPR:ko,TMPLIT_EXPR:Fo});const Xe={element:1,text:3,progressingInstruction:7,comment:8,document:9},Vo=function(){return typeof window>"u"?null:window},Xo=function(o,s){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const u="data-tt-policy-suffix";s&&s.hasAttribute(u)&&(i=s.getAttribute(u));const l="dompurify"+(i?"#"+i:"");try{return o.createPolicy(l,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},wr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function to(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vo();const o=P=>to(P);if(o.version="3.3.1",o.removed=[],!f||!f.document||f.document.nodeType!==Xe.document||!f.Element)return o.isSupported=!1,o;let{document:s}=f;const i=s,u=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:d,Node:h,Element:a,NodeFilter:e,NamedNodeMap:t=f.NamedNodeMap||f.MozNamedAttrMap,HTMLFormElement:r,DOMParser:n,trustedTypes:c}=f,g=a.prototype,_=Ve(g,"cloneNode"),v=Ve(g,"remove"),m=Ve(g,"nextSibling"),E=Ve(g,"childNodes"),T=Ve(g,"parentNode");if(typeof d=="function"){const P=s.createElement("template");P.content&&P.content.ownerDocument&&(s=P.content.ownerDocument)}let R,N="";const{implementation:I,createNodeIterator:L,createDocumentFragment:x,getElementsByTagName:y}=s,{importNode:S}=i;let w=wr();o.isSupported=typeof Qi=="function"&&typeof T=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:b,TMPLIT_EXPR:M,DATA_ATTR:te,ARIA_ATTR:se,IS_SCRIPT_OR_DATA:tn,ATTR_WHITESPACE:qe,CUSTOM_ELEMENT:nn}=Or;let{IS_ALLOWED_URI:Re}=Or,q=null;const Fe=D({},[...vr,...pn,...vn,...mn,...mr]);let U=null;const it=D({},[...Er,...En,...yr,...ht]);let B=Object.seal(Vn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,J=null;const z=Object.seal(Vn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let de=!0,Ee=!0,Kn=!1,Jn=!0,Ie=!1,ot=!0,ye=!1,rn=!1,on=!1,Ce=!1,at=!1,ut=!1,Qn=!0,Zn=!1;const mo="user-content-";let an=!0,Ue=!1,Me={},ue=null;const un=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const tr=D({},["audio","video","img","source","image","track"]);let fn=null;const nr=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";let Pe=he,cn=!1,ln=null;const Eo=D({},[ft,ct,he],gn);let lt=D({},["mi","mo","mn","ms","mtext"]),st=D({},["annotation-xml"]);const yo=D({},["title","style","font","a","script"]);let je=null;const Oo=["application/xhtml+xml","text/html"],wo="text/html";let H=null,xe=null;const bo=s.createElement("form"),rr=function(p){return p instanceof RegExp||p instanceof Function},sn=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xe&&xe===p)){if((!p||typeof p!="object")&&(p={}),p=le(p),je=Oo.indexOf(p.PARSER_MEDIA_TYPE)===-1?wo:p.PARSER_MEDIA_TYPE,H=je==="application/xhtml+xml"?gn:Jt,q=oe(p,"ALLOWED_TAGS")?D({},p.ALLOWED_TAGS,H):Fe,U=oe(p,"ALLOWED_ATTR")?D({},p.ALLOWED_ATTR,H):it,ln=oe(p,"ALLOWED_NAMESPACES")?D({},p.ALLOWED_NAMESPACES,gn):Eo,fn=oe(p,"ADD_URI_SAFE_ATTR")?D(le(nr),p.ADD_URI_SAFE_ATTR,H):nr,er=oe(p,"ADD_DATA_URI_TAGS")?D(le(tr),p.ADD_DATA_URI_TAGS,H):tr,ue=oe(p,"FORBID_CONTENTS")?D({},p.FORBID_CONTENTS,H):un,ve=oe(p,"FORBID_TAGS")?D({},p.FORBID_TAGS,H):le({}),J=oe(p,"FORBID_ATTR")?D({},p.FORBID_ATTR,H):le({}),Me=oe(p,"USE_PROFILES")?p.USE_PROFILES:!1,de=p.ALLOW_ARIA_ATTR!==!1,Ee=p.ALLOW_DATA_ATTR!==!1,Kn=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Jn=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=p.SAFE_FOR_TEMPLATES||!1,ot=p.SAFE_FOR_XML!==!1,ye=p.WHOLE_DOCUMENT||!1,Ce=p.RETURN_DOM||!1,at=p.RETURN_DOM_FRAGMENT||!1,ut=p.RETURN_TRUSTED_TYPE||!1,on=p.FORCE_BODY||!1,Qn=p.SANITIZE_DOM!==!1,Zn=p.SANITIZE_NAMED_PROPS||!1,an=p.KEEP_CONTENT!==!1,Ue=p.IN_PLACE||!1,Re=p.ALLOWED_URI_REGEXP||Zi,Pe=p.NAMESPACE||he,lt=p.MATHML_TEXT_INTEGRATION_POINTS||lt,st=p.HTML_INTEGRATION_POINTS||st,B=p.CUSTOM_ELEMENT_HANDLING||{},p.CUSTOM_ELEMENT_HANDLING&&rr(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=p.CUSTOM_ELEMENT_HANDLING.tagNameCheck),p.CUSTOM_ELEMENT_HANDLING&&rr(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Ee=!1),at&&(Ce=!0),Me&&(q=D({},mr),U=[],Me.html===!0&&(D(q,vr),D(U,Er)),Me.svg===!0&&(D(q,pn),D(U,En),D(U,ht)),Me.svgFilters===!0&&(D(q,vn),D(U,En),D(U,ht)),Me.mathMl===!0&&(D(q,mn),D(U,yr),D(U,ht))),p.ADD_TAGS&&(typeof p.ADD_TAGS=="function"?z.tagCheck=p.ADD_TAGS:(q===Fe&&(q=le(q)),D(q,p.ADD_TAGS,H))),p.ADD_ATTR&&(typeof p.ADD_ATTR=="function"?z.attributeCheck=p.ADD_ATTR:(U===it&&(U=le(U)),D(U,p.ADD_ATTR,H))),p.ADD_URI_SAFE_ATTR&&D(fn,p.ADD_URI_SAFE_ATTR,H),p.FORBID_CONTENTS&&(ue===un&&(ue=le(ue)),D(ue,p.FORBID_CONTENTS,H)),p.ADD_FORBID_CONTENTS&&(ue===un&&(ue=le(ue)),D(ue,p.ADD_FORBID_CONTENTS,H)),an&&(q["#text"]=!0),ye&&D(q,["html","head","body"]),q.table&&(D(q,["tbody"]),delete ve.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=p.TRUSTED_TYPES_POLICY,N=R.createHTML("")}else R===void 0&&(R=Xo(c,u)),R!==null&&typeof N=="string"&&(N=R.createHTML(""));Y&&Y(p),xe=p}},ir=D({},[...pn,...vn,...No]),or=D({},[...mn,...Bo]),Ao=function(p){let O=T(p);(!O||!O.tagName)&&(O={namespaceURI:Pe,tagName:"template"});const C=Jt(p.tagName),k=Jt(O.tagName);return ln[p.namespaceURI]?p.namespaceURI===ct?O.namespaceURI===he?C==="svg":O.namespaceURI===ft?C==="svg"&&(k==="annotation-xml"||lt[k]):!!ir[C]:p.namespaceURI===ft?O.namespaceURI===he?C==="math":O.namespaceURI===ct?C==="math"&&st[k]:!!or[C]:p.namespaceURI===he?O.namespaceURI===ct&&!st[k]||O.namespaceURI===ft&&!lt[k]?!1:!or[C]&&(yo[C]||!ir[C]):!!(je==="application/xhtml+xml"&&ln[p.namespaceURI]):!1},fe=function(p){He(o.removed,{element:p});try{T(p).removeChild(p)}catch{v(p)}},Oe=function(p,O){try{He(o.removed,{attribute:O.getAttributeNode(p),from:O})}catch{He(o.removed,{attribute:null,from:O})}if(O.removeAttribute(p),p==="is")if(Ce||at)try{fe(O)}catch{}else try{O.setAttribute(p,"")}catch{}},ar=function(p){let O=null,C=null;if(on)p="<remove></remove>"+p;else{const j=_n(p,/^[\r\n\t ]+/);C=j&&j[0]}je==="application/xhtml+xml"&&Pe===he&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const k=R?R.createHTML(p):p;if(Pe===he)try{O=new n().parseFromString(k,je)}catch{}if(!O||!O.documentElement){O=I.createDocument(Pe,"template",null);try{O.documentElement.innerHTML=cn?N:k}catch{}}const V=O.body||O.documentElement;return p&&C&&V.insertBefore(s.createTextNode(C),V.childNodes[0]||null),Pe===he?y.call(O,ye?"html":"body")[0]:ye?O.documentElement:V},ur=function(p){return L.call(p.ownerDocument||p,p,e.SHOW_ELEMENT|e.SHOW_COMMENT|e.SHOW_TEXT|e.SHOW_PROCESSING_INSTRUCTION|e.SHOW_CDATA_SECTION,null)},dn=function(p){return p instanceof r&&(typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||!(p.attributes instanceof t)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function")},fr=function(p){return typeof h=="function"&&p instanceof h};function ge(P,p,O){dt(P,C=>{C.call(o,p,O,xe)})}const cr=function(p){let O=null;if(ge(w.beforeSanitizeElements,p,null),dn(p))return fe(p),!0;const C=H(p.nodeName);if(ge(w.uponSanitizeElement,p,{tagName:C,allowedTags:q}),ot&&p.hasChildNodes()&&!fr(p.firstElementChild)&&X(/<[/\w!]/g,p.innerHTML)&&X(/<[/\w!]/g,p.textContent)||p.nodeType===Xe.progressingInstruction||ot&&p.nodeType===Xe.comment&&X(/<[/\w]/g,p.data))return fe(p),!0;if(!(z.tagCheck instanceof Function&&z.tagCheck(C))&&(!q[C]||ve[C])){if(!ve[C]&&sr(C)&&(B.tagNameCheck instanceof RegExp&&X(B.tagNameCheck,C)||B.tagNameCheck instanceof Function&&B.tagNameCheck(C)))return!1;if(an&&!ue[C]){const k=T(p)||p.parentNode,V=E(p)||p.childNodes;if(V&&k){const j=V.length;for(let K=j-1;K>=0;--K){const _e=_(V[K],!0);_e.__removalCount=(p.__removalCount||0)+1,k.insertBefore(_e,m(p))}}}return fe(p),!0}return p instanceof a&&!Ao(p)||(C==="noscript"||C==="noembed"||C==="noframes")&&X(/<\/no(script|embed|frames)/i,p.innerHTML)?(fe(p),!0):(Ie&&p.nodeType===Xe.text&&(O=p.textContent,dt([A,b,M],k=>{O=Ge(O,k," ")}),p.textContent!==O&&(He(o.removed,{element:p.cloneNode()}),p.textContent=O)),ge(w.afterSanitizeElements,p,null),!1)},lr=function(p,O,C){if(Qn&&(O==="id"||O==="name")&&(C in s||C in bo))return!1;if(!(Ee&&!J[O]&&X(te,O))){if(!(de&&X(se,O))){if(!(z.attributeCheck instanceof Function&&z.attributeCheck(O,p))){if(!U[O]||J[O]){if(!(sr(p)&&(B.tagNameCheck instanceof RegExp&&X(B.tagNameCheck,p)||B.tagNameCheck instanceof Function&&B.tagNameCheck(p))&&(B.attributeNameCheck instanceof RegExp&&X(B.attributeNameCheck,O)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(O,p))||O==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&X(B.tagNameCheck,C)||B.tagNameCheck instanceof Function&&B.tagNameCheck(C))))return!1}else if(!fn[O]){if(!X(Re,Ge(C,qe,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&p!=="script"&&Po(C,"data:")===0&&er[p])){if(!(Kn&&!X(tn,Ge(C,qe,"")))){if(C)return!1}}}}}}}return!0},sr=function(p){return p!=="annotation-xml"&&_n(p,nn)},dr=function(p){ge(w.beforeSanitizeAttributes,p,null);const{attributes:O}=p;if(!O||dn(p))return;const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0};let k=O.length;for(;k--;){const V=O[k],{name:j,namespaceURI:K,value:_e}=V,Le=H(j),hn=_e;let G=j==="value"?hn:xo(hn);if(C.attrName=Le,C.attrValue=G,C.keepAttr=!0,C.forceKeepAttr=void 0,ge(w.uponSanitizeAttribute,p,C),G=C.attrValue,Zn&&(Le==="id"||Le==="name")&&(Oe(j,p),G=mo+G),ot&&X(/((--!?|])>)|<\/(style|title|textarea)/i,G)){Oe(j,p);continue}if(Le==="attributename"&&_n(G,"href")){Oe(j,p);continue}if(C.forceKeepAttr)continue;if(!C.keepAttr){Oe(j,p);continue}if(!Jn&&X(/\/>/i,G)){Oe(j,p);continue}Ie&&dt([A,b,M],gr=>{G=Ge(G,gr," ")});const hr=H(p.nodeName);if(!lr(hr,Le,G)){Oe(j,p);continue}if(R&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!K)switch(c.getAttributeType(hr,Le)){case"TrustedHTML":{G=R.createHTML(G);break}case"TrustedScriptURL":{G=R.createScriptURL(G);break}}if(G!==hn)try{K?p.setAttributeNS(K,j,G):p.setAttribute(j,G),dn(p)?fe(p):pr(o.removed)}catch{Oe(j,p)}}ge(w.afterSanitizeAttributes,p,null)},To=function P(p){let O=null;const C=ur(p);for(ge(w.beforeSanitizeShadowDOM,p,null);O=C.nextNode();)ge(w.uponSanitizeShadowNode,O,null),cr(O),dr(O),O.content instanceof l&&P(O.content);ge(w.afterSanitizeShadowDOM,p,null)};return o.sanitize=function(P){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,C=null,k=null,V=null;if(cn=!P,cn&&(P="<!-->"),typeof P!="string"&&!fr(P))if(typeof P.toString=="function"){if(P=P.toString(),typeof P!="string")throw ze("dirty is not a string, aborting")}else throw ze("toString is not a function");if(!o.isSupported)return P;if(rn||sn(p),o.removed=[],typeof P=="string"&&(Ue=!1),Ue){if(P.nodeName){const _e=H(P.nodeName);if(!q[_e]||ve[_e])throw ze("root node is forbidden and cannot be sanitized in-place")}}else if(P instanceof h)O=ar("<!---->"),C=O.ownerDocument.importNode(P,!0),C.nodeType===Xe.element&&C.nodeName==="BODY"||C.nodeName==="HTML"?O=C:O.appendChild(C);else{if(!Ce&&!Ie&&!ye&&P.indexOf("<")===-1)return R&&ut?R.createHTML(P):P;if(O=ar(P),!O)return Ce?null:ut?N:""}O&&on&&fe(O.firstChild);const j=ur(Ue?P:O);for(;k=j.nextNode();)cr(k),dr(k),k.content instanceof l&&To(k.content);if(Ue)return P;if(Ce){if(at)for(V=x.call(O.ownerDocument);O.firstChild;)V.appendChild(O.firstChild);else V=O;return(U.shadowroot||U.shadowrootmode)&&(V=S.call(i,V,!0)),V}let K=ye?O.outerHTML:O.innerHTML;return ye&&q["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&X(eo,O.ownerDocument.doctype.name)&&(K="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
2
- `+K),Ie&&dt([A,b,M],_e=>{K=Ge(K,_e," ")}),R&&ut?R.createHTML(K):K},o.setConfig=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(P),rn=!0},o.clearConfig=function(){xe=null,rn=!1},o.isValidAttribute=function(P,p,O){xe||sn({});const C=H(P),k=H(p);return lr(C,k,O)},o.addHook=function(P,p){typeof p=="function"&&He(w[P],p)},o.removeHook=function(P,p){if(p!==void 0){const O=Co(w[P],p);return O===-1?void 0:Mo(w[P],O,1)[0]}return pr(w[P])},o.removeHooks=function(P){w[P]=[]},o.removeAllHooks=function(){w=wr()},o}var $o=to();const br=new Set(["apng","bmp","gif","ico","cur","jpeg","jpg","jfif","pjpeg","pjp","png","svg","tif","tiff","webp"]);function ae(f,o={}){return!o||typeof o!="object"||Object.assign(f.style,o),f}function Yo(f){if(!f||typeof f!="string")return!1;try{return btoa(atob(f))===f}catch{return!1}}function Wo(f){let o;try{o=new URL(f)}catch{return!1}return o.protocol==="http:"||o.protocol==="https:"}function Yn(f){return $o.sanitize(f,{ALLOWED_TAGS:["b","i","u","strong","em","br","span","p","div"],ALLOWED_ATTR:["style","class"]})}function Ko(f){const o=ae(document.createElement("div"),f.style);return o.innerHTML=Yn(f.value||""),o}function Jo(f,o="td"){const s=ae(document.createElement(o),{padding:"7px 2px",...f.style});return s.innerHTML=Yn(f.value||""),s}function no(f){const o=ae(document.createElement("div"),{width:"100%",display:"flex",justifyContent:f.position||"left"});let s;if(f.url){const u=Yo(f.url);if(!Wo(f.url)&&!u)throw new Error(`Invalid url: ${f.url}`);u?s="data:image/png;base64,"+f.url:s=f.url}else if(f.path){const u=window.electronAPI.readFileAsBase64(f.path);if(!u.success)throw new Error(u.error);let l=window.electronAPI.getFileExtension(f.path);if(!br.has(l))throw new Error(l+" file type not supported, consider the types: "+[...br].join());l==="svg"&&(l="svg+xml"),s="data:image/"+l+";base64,"+u.data}else throw new Error("Image requires either a valid url or path property");if(!s)throw new Error("Failed to generate image URI");const i=ae(document.createElement("img"),{height:f.height,width:f.width,...f.style});return i.src=s,o.prepend(i),o}function ro(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var gt={},$e={},_t={},Ar;function ee(){if(Ar)return _t;Ar=1,Object.defineProperty(_t,"__esModule",{value:!0});function f(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}var o=function s(i,u){f(this,s),this.data=i,this.text=u.text||i,this.options=u};return _t.default=o,_t}var Tr;function Qo(){if(Tr)return $e;Tr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.CODE39=void 0;var f=(function(){function _(v,m){for(var E=0;E<m.length;E++){var T=m[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,T.key,T)}}return function(v,m,E){return m&&_(v.prototype,m),E&&_(v,E),v}})(),o=ee(),s=i(o);function i(_){return _&&_.__esModule?_:{default:_}}function u(_,v){if(!(_ instanceof v))throw new TypeError("Cannot call a class as a function")}function l(_,v){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:_}function d(_,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);_.prototype=Object.create(v&&v.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(_,v):_.__proto__=v)}var h=(function(_){d(v,_);function v(m,E){return u(this,v),m=m.toUpperCase(),E.mod43&&(m+=n(g(m))),l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,m,E))}return f(v,[{key:"encode",value:function(){for(var E=t("*"),T=0;T<this.data.length;T++)E+=t(this.data[T])+"0";return E+=t("*"),{data:E,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),v})(s.default),a=["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","-","."," ","$","/","+","%","*"],e=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function t(_){return r(c(_))}function r(_){return e[_].toString(2)}function n(_){return a[_]}function c(_){return a.indexOf(_)}function g(_){for(var v=0,m=0;m<_.length;m++)v+=c(_[m]);return v=v%43,v}return $e.CODE39=h,$e}var re={},pt={},vt={},F={},Sr;function et(){if(Sr)return F;Sr=1,Object.defineProperty(F,"__esModule",{value:!0});var f;function o(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var s=F.SET_A=0,i=F.SET_B=1,u=F.SET_C=2;F.SHIFT=98;var l=F.START_A=103,d=F.START_B=104,h=F.START_C=105;return F.MODULO=103,F.STOP=106,F.FNC1=207,F.SET_BY_CODE=(f={},o(f,l,s),o(f,d,i),o(f,h,u),f),F.SWAP={101:s,100:i,99:u},F.A_START_CHAR="Ð",F.B_START_CHAR="Ñ",F.C_START_CHAR="Ò",F.A_CHARS="[\0-_È-Ï]",F.B_CHARS="[ -È-Ï]",F.C_CHARS="(Ï*[0-9]{2}Ï*)",F.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],F}var Rr;function Qt(){if(Rr)return vt;Rr=1,Object.defineProperty(vt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=ee(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){l(this,t);var c=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r.substring(1),n));return c.bytes=r.split("").map(function(g){return g.charCodeAt(0)}),c}return f(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,c=n.shift()-105,g=i.SET_BY_CODE[c];if(g===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(i.FNC1);var _=t.next(n,1,g);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(c)+_.result+t.getBar((_.checksum+c)%i.MODULO)+t.getBar(i.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return i.BARS[n]?i.BARS[n].toString():""}},{key:"correctIndex",value:function(n,c){if(c===i.SET_A){var g=n.shift();return g<32?g+64:g-32}else return c===i.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,c,g){if(!n.length)return{result:"",checksum:0};var _=void 0,v=void 0;if(n[0]>=200){v=n.shift()-105;var m=i.SWAP[v];m!==void 0?_=t.next(n,c+1,m):((g===i.SET_A||g===i.SET_B)&&v===i.SHIFT&&(n[0]=g===i.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),_=t.next(n,c+1,g))}else v=t.correctIndex(n,g),_=t.next(n,c+1,g);var E=t.getBar(v),T=v*c;return{result:E+_.result,checksum:T+_.checksum}}}]),t})(s.default);return vt.default=a,vt}var mt={},Ir;function Zo(){if(Ir)return mt;Ir=1,Object.defineProperty(mt,"__esModule",{value:!0});var f=et(),o=function(h){return h.match(new RegExp("^"+f.A_CHARS+"*"))[0].length},s=function(h){return h.match(new RegExp("^"+f.B_CHARS+"*"))[0].length},i=function(h){return h.match(new RegExp("^"+f.C_CHARS+"*"))[0]};function u(d,h){var a=h?f.A_CHARS:f.B_CHARS,e=d.match(new RegExp("^("+a+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+"Ì"+l(d.substring(e[1].length));var t=d.match(new RegExp("^"+a+"+"))[0];return t.length===d.length?d:t+String.fromCharCode(h?205:206)+u(d.substring(t.length),!h)}function l(d){var h=i(d),a=h.length;if(a===d.length)return d;d=d.substring(a);var e=o(d)>=s(d);return h+String.fromCharCode(e?206:205)+u(d,e)}return mt.default=function(d){var h=void 0,a=i(d).length;if(a>=2)h=f.C_START_CHAR+l(d);else{var e=o(d)>s(d);h=(e?f.A_START_CHAR:f.B_START_CHAR)+u(d,e)}return h.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,r){return"Ë"+r})},mt}var Cr;function ea(){if(Cr)return pt;Cr=1,Object.defineProperty(pt,"__esModule",{value:!0});var f=Qt(),o=u(f),s=Zo(),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){if(l(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(r))var c=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,i.default)(r),n));else var c=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n));return d(c)}return t})(o.default);return pt.default=a,pt}var Et={},Mr;function ta(){if(Mr)return Et;Mr=1,Object.defineProperty(Et,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Qt(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.A_START_CHAR+r,n))}return f(t,[{key:"valid",value:function(){return new RegExp("^"+i.A_CHARS+"+$").test(this.data)}}]),t})(s.default);return Et.default=a,Et}var yt={},Pr;function na(){if(Pr)return yt;Pr=1,Object.defineProperty(yt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Qt(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.B_START_CHAR+r,n))}return f(t,[{key:"valid",value:function(){return new RegExp("^"+i.B_CHARS+"+$").test(this.data)}}]),t})(s.default);return yt.default=a,yt}var Ot={},xr;function ra(){if(xr)return Ot;xr=1,Object.defineProperty(Ot,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Qt(),s=u(o),i=et();function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.C_START_CHAR+r,n))}return f(t,[{key:"valid",value:function(){return new RegExp("^"+i.C_CHARS+"+$").test(this.data)}}]),t})(s.default);return Ot.default=a,Ot}var Lr;function ia(){if(Lr)return re;Lr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.CODE128C=re.CODE128B=re.CODE128A=re.CODE128=void 0;var f=ea(),o=a(f),s=ta(),i=a(s),u=na(),l=a(u),d=ra(),h=a(d);function a(e){return e&&e.__esModule?e:{default:e}}return re.CODE128=o.default,re.CODE128A=i.default,re.CODE128B=l.default,re.CODE128C=h.default,re}var $={},wt={},pe={},Dr;function tt(){return Dr||(Dr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.SIDE_BIN="101",pe.MIDDLE_BIN="01010",pe.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},pe.EAN2_STRUCTURE=["LL","LG","GL","GG"],pe.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],pe.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),pe}var bt={},At={},Nr;function nt(){if(Nr)return At;Nr=1,Object.defineProperty(At,"__esModule",{value:!0});var f=tt(),o=function(i,u,l){var d=i.split("").map(function(a,e){return f.BINARIES[u[e]]}).map(function(a,e){return a?a[i[e]]:""});if(l){var h=i.length-1;d=d.map(function(a,e){return e<h?a+l:a})}return d.join("")};return At.default=o,At}var Br;function io(){if(Br)return bt;Br=1,Object.defineProperty(bt,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})(),o=tt(),s=nt(),i=d(s),u=ee(),l=d(u);function d(r){return r&&r.__esModule?r:{default:r}}function h(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function a(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function e(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var t=(function(r){e(n,r);function n(c,g){h(this,n);var _=a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g));return _.fontSize=!g.flat&&g.fontSize>g.width*10?g.width*10:g.fontSize,_.guardHeight=g.height+_.fontSize/2+g.textMargin,_}return f(n,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(g,_){return this.text.substr(g,_)}},{key:"leftEncode",value:function(g,_){return(0,i.default)(g,_)}},{key:"rightText",value:function(g,_){return this.text.substr(g,_)}},{key:"rightEncode",value:function(g,_){return(0,i.default)(g,_)}},{key:"encodeGuarded",value:function(){var g={fontSize:this.fontSize},_={height:this.guardHeight};return[{data:o.SIDE_BIN,options:_},{data:this.leftEncode(),text:this.leftText(),options:g},{data:o.MIDDLE_BIN,options:_},{data:this.rightEncode(),text:this.rightText(),options:g},{data:o.SIDE_BIN,options:_}]}},{key:"encodeFlat",value:function(){var g=[o.SIDE_BIN,this.leftEncode(),o.MIDDLE_BIN,this.rightEncode(),o.SIDE_BIN];return{data:g.join(""),text:this.text}}}]),n})(l.default);return bt.default=t,bt}var kr;function oa(){if(kr)return wt;kr=1,Object.defineProperty(wt,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})(),o=function r(n,c,g){n===null&&(n=Function.prototype);var _=Object.getOwnPropertyDescriptor(n,c);if(_===void 0){var v=Object.getPrototypeOf(n);return v===null?void 0:r(v,c,g)}else{if("value"in _)return _.value;var m=_.get;return m===void 0?void 0:m.call(g)}},s=tt(),i=io(),u=l(i);function l(r){return r&&r.__esModule?r:{default:r}}function d(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function h(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function a(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var e=function(n){var c=n.substr(0,12).split("").map(function(g){return+g}).reduce(function(g,_,v){return v%2?g+_*3:g+_},0);return(10-c%10)%10},t=(function(r){a(n,r);function n(c,g){d(this,n),c.search(/^[0-9]{12}$/)!==-1&&(c+=e(c));var _=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g));return _.lastChar=g.lastChar,_}return f(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===e(this.data)}},{key:"leftText",value:function(){return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var g=this.data.substr(1,6),_=s.EAN13_STRUCTURE[this.data[0]];return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,g,_)}},{key:"rightText",value:function(){return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var g=this.data.substr(7,6);return o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,g,"RRRRRR")}},{key:"encodeGuarded",value:function(){var g=o(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(g.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(g.push({data:"00"}),g.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),g}}]),n})(u.default);return wt.default=t,wt}var Tt={},qr;function aa(){if(qr)return Tt;qr=1,Object.defineProperty(Tt,"__esModule",{value:!0});var f=(function(){function t(r,n){for(var c=0;c<n.length;c++){var g=n[c];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}return function(r,n,c){return n&&t(r.prototype,n),c&&t(r,c),r}})(),o=function t(r,n,c){r===null&&(r=Function.prototype);var g=Object.getOwnPropertyDescriptor(r,n);if(g===void 0){var _=Object.getPrototypeOf(r);return _===null?void 0:t(_,n,c)}else{if("value"in g)return g.value;var v=g.get;return v===void 0?void 0:v.call(c)}},s=io(),i=u(s);function u(t){return t&&t.__esModule?t:{default:t}}function l(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function d(t,r){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:t}function h(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(t,r):t.__proto__=r)}var a=function(r){var n=r.substr(0,7).split("").map(function(c){return+c}).reduce(function(c,g,_){return _%2?c+g:c+g*3},0);return(10-n%10)%10},e=(function(t){h(r,t);function r(n,c){return l(this,r),n.search(/^[0-9]{7}$/)!==-1&&(n+=a(n)),d(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,n,c))}return f(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===a(this.data)}},{key:"leftText",value:function(){return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var c=this.data.substr(0,4);return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftEncode",this).call(this,c,"LLLL")}},{key:"rightText",value:function(){return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var c=this.data.substr(4,4);return o(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightEncode",this).call(this,c,"RRRR")}}]),r})(i.default);return Tt.default=e,Tt}var St={},Fr;function ua(){if(Fr)return St;Fr=1,Object.defineProperty(St,"__esModule",{value:!0});var f=(function(){function n(c,g){for(var _=0;_<g.length;_++){var v=g[_];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}return function(c,g,_){return g&&n(c.prototype,g),_&&n(c,_),c}})(),o=tt(),s=nt(),i=d(s),u=ee(),l=d(u);function d(n){return n&&n.__esModule?n:{default:n}}function h(n,c){if(!(n instanceof c))throw new TypeError("Cannot call a class as a function")}function a(n,c){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:n}function e(n,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);n.prototype=Object.create(c&&c.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(n,c):n.__proto__=c)}var t=function(c){var g=c.split("").map(function(_){return+_}).reduce(function(_,v,m){return m%2?_+v*9:_+v*3},0);return g%10},r=(function(n){e(c,n);function c(g,_){return h(this,c),a(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,g,_))}return f(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var _=o.EAN5_STRUCTURE[t(this.data)];return{data:"1011"+(0,i.default)(this.data,_,"01"),text:this.text}}}]),c})(l.default);return St.default=r,St}var Rt={},Ur;function fa(){if(Ur)return Rt;Ur=1,Object.defineProperty(Rt,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})(),o=tt(),s=nt(),i=d(s),u=ee(),l=d(u);function d(r){return r&&r.__esModule?r:{default:r}}function h(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function a(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function e(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var t=(function(r){e(n,r);function n(c,g){return h(this,n),a(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g))}return f(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var g=o.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,i.default)(this.data,g,"01"),text:this.text}}}]),n})(l.default);return Rt.default=t,Rt}var Ye={},jr;function oo(){if(jr)return Ye;jr=1,Object.defineProperty(Ye,"__esModule",{value:!0});var f=(function(){function r(n,c){for(var g=0;g<c.length;g++){var _=c[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(n,_.key,_)}}return function(n,c,g){return c&&r(n.prototype,c),g&&r(n,g),n}})();Ye.checksum=t;var o=nt(),s=l(o),i=ee(),u=l(i);function l(r){return r&&r.__esModule?r:{default:r}}function d(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function h(r,n){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:r}function a(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n)}var e=(function(r){a(n,r);function n(c,g){d(this,n),c.search(/^[0-9]{11}$/)!==-1&&(c+=t(c));var _=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,c,g));return _.displayValue=g.displayValue,g.fontSize>g.width*10?_.fontSize=g.width*10:_.fontSize=g.fontSize,_.guardHeight=g.height+_.fontSize/2+g.textMargin,_}return f(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var g="";return g+="101",g+=(0,s.default)(this.data.substr(0,6),"LLLLLL"),g+="01010",g+=(0,s.default)(this.data.substr(6,6),"RRRRRR"),g+="101",{data:g,text:this.text}}},{key:"guardedEncoding",value:function(){var g=[];return this.displayValue&&g.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),g.push({data:"101"+(0,s.default)(this.data[0],"L"),options:{height:this.guardHeight}}),g.push({data:(0,s.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),g.push({data:"01010",options:{height:this.guardHeight}}),g.push({data:(0,s.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),g.push({data:(0,s.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&g.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),g}}]),n})(u.default);function t(r){var n=0,c;for(c=1;c<11;c+=2)n+=parseInt(r[c]);for(c=0;c<11;c+=2)n+=parseInt(r[c])*3;return(10-n%10)%10}return Ye.default=e,Ye}var It={},Hr;function ca(){if(Hr)return It;Hr=1,Object.defineProperty(It,"__esModule",{value:!0});var f=(function(){function g(_,v){for(var m=0;m<v.length;m++){var E=v[m];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,v,m){return v&&g(_.prototype,v),m&&g(_,m),_}})(),o=nt(),s=d(o),i=ee(),u=d(i),l=oo();function d(g){return g&&g.__esModule?g:{default:g}}function h(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function a(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:g}function e(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(g,_):g.__proto__=_)}var t=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],r=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],n=(function(g){e(_,g);function _(v,m){h(this,_);var E=a(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,v,m));if(E.isValid=!1,v.search(/^[0-9]{6}$/)!==-1)E.middleDigits=v,E.upcA=c(v,"0"),E.text=m.text||""+E.upcA[0]+v+E.upcA[E.upcA.length-1],E.isValid=!0;else if(v.search(/^[01][0-9]{7}$/)!==-1)if(E.middleDigits=v.substring(1,v.length-1),E.upcA=c(E.middleDigits,v[0]),E.upcA[E.upcA.length-1]===v[v.length-1])E.isValid=!0;else return a(E);else return a(E);return E.displayValue=m.displayValue,m.fontSize>m.width*10?E.fontSize=m.width*10:E.fontSize=m.fontSize,E.guardHeight=m.height+E.fontSize/2+m.textMargin,E}return f(_,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var m="";return m+="101",m+=this.encodeMiddleDigits(),m+="010101",{data:m,text:this.text}}},{key:"guardedEncoding",value:function(){var m=[];return this.displayValue&&m.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),m.push({data:"101",options:{height:this.guardHeight}}),m.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),m.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&m.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),m}},{key:"encodeMiddleDigits",value:function(){var m=this.upcA[0],E=this.upcA[this.upcA.length-1],T=r[parseInt(E)][parseInt(m)];return(0,s.default)(this.middleDigits,T)}}]),_})(u.default);function c(g,_){for(var v=parseInt(g[g.length-1]),m=t[v],E="",T=0,R=0;R<m.length;R++){var N=m[R];N==="X"?E+=g[T++]:E+=N}return E=""+_+E,""+E+(0,l.checksum)(E)}return It.default=n,It}var Gr;function la(){if(Gr)return $;Gr=1,Object.defineProperty($,"__esModule",{value:!0}),$.UPCE=$.UPC=$.EAN2=$.EAN5=$.EAN8=$.EAN13=void 0;var f=oa(),o=n(f),s=aa(),i=n(s),u=ua(),l=n(u),d=fa(),h=n(d),a=oo(),e=n(a),t=ca(),r=n(t);function n(c){return c&&c.__esModule?c:{default:c}}return $.EAN13=o.default,$.EAN8=i.default,$.EAN5=l.default,$.EAN2=h.default,$.UPC=e.default,$.UPCE=r.default,$}var we={},Ct={},De={},zr;function sa(){return zr||(zr=1,Object.defineProperty(De,"__esModule",{value:!0}),De.START_BIN="1010",De.END_BIN="11101",De.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),De}var Vr;function ao(){if(Vr)return Ct;Vr=1,Object.defineProperty(Ct,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=sa(),s=ee(),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,c=this.data.match(/.{2}/g).map(function(g){return n.encodePair(g)}).join("");return{data:o.START_BIN+c+o.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var c=o.BINARIES[n[1]];return o.BINARIES[n[0]].split("").map(function(g,_){return(g==="1"?"111":"1")+(c[_]==="1"?"000":"0")}).join("")}}]),t})(i.default);return Ct.default=a,Ct}var Mt={},Xr;function da(){if(Xr)return Mt;Xr=1,Object.defineProperty(Mt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=ao(),s=i(o);function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function d(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(t){var r=t.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,c,g){return n+c*(3-g%2*2)},0);return Math.ceil(r/10)*10-r},a=(function(e){d(t,e);function t(r,n){return u(this,t),r.search(/^[0-9]{13}$/)!==-1&&(r+=h(r)),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n))}return f(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===h(this.data)}}]),t})(s.default);return Mt.default=a,Mt}var $r;function ha(){if($r)return we;$r=1,Object.defineProperty(we,"__esModule",{value:!0}),we.ITF14=we.ITF=void 0;var f=ao(),o=u(f),s=da(),i=u(s);function u(l){return l&&l.__esModule?l:{default:l}}return we.ITF=o.default,we.ITF14=i.default,we}var Q={},Pt={},Yr;function rt(){if(Yr)return Pt;Yr=1,Object.defineProperty(Pt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=ee(),s=i(o);function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function d(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=(function(e){d(t,e);function t(r,n){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n))}return f(t,[{key:"encode",value:function(){for(var n="110",c=0;c<this.data.length;c++){var g=parseInt(this.data[c]),_=g.toString(2);_=a(_,4-_.length);for(var v=0;v<_.length;v++)n+=_[v]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),t})(s.default);function a(e,t){for(var r=0;r<t;r++)e="0"+e;return e}return Pt.default=h,Pt}var xt={},We={},Wr;function Zt(){if(Wr)return We;Wr=1,Object.defineProperty(We,"__esModule",{value:!0}),We.mod10=f,We.mod11=o;function f(s){for(var i=0,u=0;u<s.length;u++){var l=parseInt(s[u]);(u+s.length)%2===0?i+=l:i+=l*2%10+Math.floor(l*2/10)}return(10-i%10)%10}function o(s){for(var i=0,u=[2,3,4,5,6,7],l=0;l<s.length;l++){var d=parseInt(s[s.length-1-l]);i+=u[l%u.length]*d}return(11-i%11)%11}return We}var Kr;function ga(){if(Kr)return xt;Kr=1,Object.defineProperty(xt,"__esModule",{value:!0});var f=rt(),o=i(f),s=Zt();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,s.mod10)(t),r))}return e})(o.default);return xt.default=h,xt}var Lt={},Jr;function _a(){if(Jr)return Lt;Jr=1,Object.defineProperty(Lt,"__esModule",{value:!0});var f=rt(),o=i(f),s=Zt();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,s.mod11)(t),r))}return e})(o.default);return Lt.default=h,Lt}var Dt={},Qr;function pa(){if(Qr)return Dt;Qr=1,Object.defineProperty(Dt,"__esModule",{value:!0});var f=rt(),o=i(f),s=Zt();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),t+=(0,s.mod10)(t),t+=(0,s.mod10)(t),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return e})(o.default);return Dt.default=h,Dt}var Nt={},Zr;function va(){if(Zr)return Nt;Zr=1,Object.defineProperty(Nt,"__esModule",{value:!0});var f=rt(),o=i(f),s=Zt();function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),t+=(0,s.mod11)(t),t+=(0,s.mod10)(t),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return e})(o.default);return Nt.default=h,Nt}var ei;function ma(){if(ei)return Q;ei=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.MSI1110=Q.MSI1010=Q.MSI11=Q.MSI10=Q.MSI=void 0;var f=rt(),o=t(f),s=ga(),i=t(s),u=_a(),l=t(u),d=pa(),h=t(d),a=va(),e=t(a);function t(r){return r&&r.__esModule?r:{default:r}}return Q.MSI=o.default,Q.MSI10=i.default,Q.MSI11=l.default,Q.MSI1010=h.default,Q.MSI1110=e.default,Q}var Ke={},ti;function Ea(){if(ti)return Ke;ti=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.pharmacode=void 0;var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=ee(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){u(this,e);var n=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return n.number=parseInt(t,10),n}return f(e,[{key:"encode",value:function(){for(var r=this.number,n="";!isNaN(r)&&r!=0;)r%2===0?(n="11100"+n,r=(r-2)/2):(n="100"+n,r=(r-1)/2);return n=n.slice(0,-2),{data:n,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e})(s.default);return Ke.pharmacode=h,Ke}var Je={},ni;function ya(){if(ni)return Je;ni=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.codabar=void 0;var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=ee(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){u(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var n=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),r));return n.text=n.options.text||n.text.replace(/[A-D]/g,""),n}return f(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var r=[],n=this.getEncodings(),c=0;c<this.data.length;c++)r.push(n[this.data.charAt(c)]),c!==this.data.length-1&&r.push("0");return{text:this.text,data:r.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e})(s.default);return Je.codabar=h,Je}var be={},Bt={},Ne={},ri;function Oa(){return ri||(ri=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.SYMBOLS=["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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],Ne.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],Ne.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),Ne}var ii;function uo(){if(ii)return Bt;ii=1,Object.defineProperty(Bt,"__esModule",{value:!0});var f=(function(){function e(t,r){for(var n=0;n<r.length;n++){var c=r[n];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}})(),o=Oa(),s=ee(),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=(function(e){h(t,e);function t(r,n){return l(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r,n))}return f(t,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.data.split("").flatMap(function(v){return o.MULTI_SYMBOLS[v]||v}),c=n.map(function(v){return t.getEncoding(v)}).join(""),g=t.checksum(n,20),_=t.checksum(n.concat(g),15);return{text:this.text,data:t.getEncoding("ÿ")+c+t.getEncoding(g)+t.getEncoding(_)+t.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(n){return o.BINARIES[t.symbolValue(n)]}},{key:"getSymbol",value:function(n){return o.SYMBOLS[n]}},{key:"symbolValue",value:function(n){return o.SYMBOLS.indexOf(n)}},{key:"checksum",value:function(n,c){var g=n.slice().reverse().reduce(function(_,v,m){var E=m%c+1;return _+t.symbolValue(v)*E},0);return t.getSymbol(g%47)}}]),t})(i.default);return Bt.default=a,Bt}var kt={},oi;function wa(){if(oi)return kt;oi=1,Object.defineProperty(kt,"__esModule",{value:!0});var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=uo(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return f(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e})(s.default);return kt.default=h,kt}var ai;function ba(){if(ai)return be;ai=1,Object.defineProperty(be,"__esModule",{value:!0}),be.CODE93FullASCII=be.CODE93=void 0;var f=uo(),o=u(f),s=wa(),i=u(s);function u(l){return l&&l.__esModule?l:{default:l}}return be.CODE93=o.default,be.CODE93FullASCII=i.default,be}var Qe={},ui;function Aa(){if(ui)return Qe;ui=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.GenericBarcode=void 0;var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=ee(),s=i(o);function i(a){return a&&a.__esModule?a:{default:a}}function u(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function l(a,e){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:a}function d(a,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(a,e):a.__proto__=e)}var h=(function(a){d(e,a);function e(t,r){return u(this,e),l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return f(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e})(s.default);return Qe.GenericBarcode=h,Qe}var fi;function Ta(){if(fi)return gt;fi=1,Object.defineProperty(gt,"__esModule",{value:!0});var f=Qo(),o=ia(),s=la(),i=ha(),u=ma(),l=Ea(),d=ya(),h=ba(),a=Aa();return gt.default={CODE39:f.CODE39,CODE128:o.CODE128,CODE128A:o.CODE128A,CODE128B:o.CODE128B,CODE128C:o.CODE128C,EAN13:s.EAN13,EAN8:s.EAN8,EAN5:s.EAN5,EAN2:s.EAN2,UPC:s.UPC,UPCE:s.UPCE,ITF14:i.ITF14,ITF:i.ITF,MSI:u.MSI,MSI10:u.MSI10,MSI11:u.MSI11,MSI1010:u.MSI1010,MSI1110:u.MSI1110,pharmacode:l.pharmacode,codabar:d.codabar,CODE93:h.CODE93,CODE93FullASCII:h.CODE93FullASCII,GenericBarcode:a.GenericBarcode},gt}var qt={},ci;function en(){if(ci)return qt;ci=1,Object.defineProperty(qt,"__esModule",{value:!0});var f=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o};return qt.default=function(o,s){return f({},o,s)},qt}var Ft={},li;function Sa(){if(li)return Ft;li=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=f;function f(o){var s=[];function i(u){if(Array.isArray(u))for(var l=0;l<u.length;l++)i(u[l]);else u.text=u.text||"",u.data=u.data||"",s.push(u)}return i(o),s}return Ft}var Ut={},si;function Ra(){if(si)return Ut;si=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.default=f;function f(o){return o.marginTop=o.marginTop||o.margin,o.marginBottom=o.marginBottom||o.margin,o.marginRight=o.marginRight||o.margin,o.marginLeft=o.marginLeft||o.margin,o}return Ut}var jt={},Ht={},Gt={},di;function fo(){if(di)return Gt;di=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=f;function f(o){var s=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var i in s)s.hasOwnProperty(i)&&(i=s[i],typeof o[i]=="string"&&(o[i]=parseInt(o[i],10)));return typeof o.displayValue=="string"&&(o.displayValue=o.displayValue!="false"),o}return Gt}var zt={},hi;function co(){if(hi)return zt;hi=1,Object.defineProperty(zt,"__esModule",{value:!0});var f={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};return zt.default=f,zt}var gi;function Ia(){if(gi)return Ht;gi=1,Object.defineProperty(Ht,"__esModule",{value:!0});var f=fo(),o=u(f),s=co(),i=u(s);function u(d){return d&&d.__esModule?d:{default:d}}function l(d){var h={};for(var a in i.default)i.default.hasOwnProperty(a)&&(d.hasAttribute("jsbarcode-"+a.toLowerCase())&&(h[a]=d.getAttribute("jsbarcode-"+a.toLowerCase())),d.hasAttribute("data-"+a.toLowerCase())&&(h[a]=d.getAttribute("data-"+a.toLowerCase())));return h.value=d.getAttribute("jsbarcode-value")||d.getAttribute("data-value"),h=(0,o.default)(h),h}return Ht.default=l,Ht}var Vt={},Xt={},Z={},_i;function lo(){if(_i)return Z;_i=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.getTotalWidthOfEncodings=Z.calculateEncodingAttributes=Z.getBarcodePadding=Z.getEncodingHeight=Z.getMaximumHeightOfEncodings=void 0;var f=en(),o=s(f);function s(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return t.height+(t.displayValue&&e.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function u(e,t,r){if(r.displayValue&&t<e){if(r.textAlign=="center")return Math.floor((e-t)/2);if(r.textAlign=="left")return 0;if(r.textAlign=="right")return Math.floor(e-t)}return 0}function l(e,t,r){for(var n=0;n<e.length;n++){var c=e[n],g=(0,o.default)(t,c.options),_;g.displayValue?_=a(c.text,g,r):_=0;var v=c.data.length*g.width;c.width=Math.ceil(Math.max(_,v)),c.height=i(c,g),c.barcodePadding=u(_,v,g)}}function d(e){for(var t=0,r=0;r<e.length;r++)t+=e[r].width;return t}function h(e){for(var t=0,r=0;r<e.length;r++)e[r].height>t&&(t=e[r].height);return t}function a(e,t,r){var n;if(r)n=r;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var c=n.measureText(e);if(!c)return 0;var g=c.width;return g}return Z.getMaximumHeightOfEncodings=h,Z.getEncodingHeight=i,Z.getBarcodePadding=u,Z.calculateEncodingAttributes=l,Z.getTotalWidthOfEncodings=d,Z}var pi;function Ca(){if(pi)return Xt;pi=1,Object.defineProperty(Xt,"__esModule",{value:!0});var f=(function(){function h(a,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(a,r.key,r)}}return function(a,e,t){return e&&h(a.prototype,e),t&&h(a,t),a}})(),o=en(),s=u(o),i=lo();function u(h){return h&&h.__esModule?h:{default:h}}function l(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}var d=(function(){function h(a,e,t){l(this,h),this.canvas=a,this.encodings=e,this.options=t}return f(h,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var t=(0,s.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(t,this.encodings[e]),this.drawCanvasText(t,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save(),(0,i.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,i.getTotalWidthOfEncodings)(this.encodings),r=(0,i.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,t){var r=this.canvas.getContext("2d"),n=t.data,c;e.textPosition=="top"?c=e.marginTop+e.fontSize+e.textMargin:c=e.marginTop,r.fillStyle=e.lineColor;for(var g=0;g<n.length;g++){var _=g*e.width+t.barcodePadding;n[g]==="1"?r.fillRect(_,c,e.width,e.height):n[g]&&r.fillRect(_,c,e.width,e.height*n[g])}}},{key:"drawCanvasText",value:function(e,t){var r=this.canvas.getContext("2d"),n=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var c,g;e.textPosition=="top"?g=e.marginTop+e.fontSize-e.textMargin:g=e.height+e.textMargin+e.marginTop+e.fontSize,r.font=n,e.textAlign=="left"||t.barcodePadding>0?(c=0,r.textAlign="left"):e.textAlign=="right"?(c=t.width-1,r.textAlign="right"):(c=t.width/2,r.textAlign="center"),r.fillText(t.text,c,g)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),h})();return Xt.default=d,Xt}var $t={},vi;function Ma(){if(vi)return $t;vi=1,Object.defineProperty($t,"__esModule",{value:!0});var f=(function(){function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}})(),o=en(),s=u(o),i=lo();function u(a){return a&&a.__esModule?a:{default:a}}function l(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}var d="http://www.w3.org/2000/svg",h=(function(){function a(e,t,r){l(this,a),this.svg=e,this.encodings=t,this.options=r,this.document=r.xmlDocument||document}return f(a,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var r=0;r<this.encodings.length;r++){var n=this.encodings[r],c=(0,s.default)(this.options,n.options),g=this.createGroup(t,c.marginTop,this.svg);this.setGroupOptions(g,c),this.drawSvgBarcode(g,c,n),this.drawSVGText(g,c,n),t+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,i.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,i.getTotalWidthOfEncodings)(this.encodings),r=(0,i.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,r),this.options.background&&this.drawRect(0,0,n,r,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(t,r,n){var c=n.data,g;r.textPosition=="top"?g=r.fontSize+r.textMargin:g=0;for(var _=0,v=0,m=0;m<c.length;m++)v=m*r.width+n.barcodePadding,c[m]==="1"?_++:_>0&&(this.drawRect(v-r.width*_,g,r.width*_,r.height,t),_=0);_>0&&this.drawRect(v-r.width*(_-1),g,r.width*_,r.height,t)}},{key:"drawSVGText",value:function(t,r,n){var c=this.document.createElementNS(d,"text");if(r.displayValue){var g,_;c.setAttribute("font-family",r.font),c.setAttribute("font-size",r.fontSize),r.fontOptions.includes("bold")&&c.setAttribute("font-weight","bold"),r.fontOptions.includes("italic")&&c.setAttribute("font-style","italic"),r.textPosition=="top"?_=r.fontSize-r.textMargin:_=r.height+r.textMargin+r.fontSize,r.textAlign=="left"||n.barcodePadding>0?(g=0,c.setAttribute("text-anchor","start")):r.textAlign=="right"?(g=n.width-1,c.setAttribute("text-anchor","end")):(g=n.width/2,c.setAttribute("text-anchor","middle")),c.setAttribute("x",g),c.setAttribute("y",_),c.appendChild(this.document.createTextNode(n.text)),t.appendChild(c)}}},{key:"setSvgAttributes",value:function(t,r){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",r+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+r),n.setAttribute("xmlns",d),n.setAttribute("version","1.1")}},{key:"createGroup",value:function(t,r,n){var c=this.document.createElementNS(d,"g");return c.setAttribute("transform","translate("+t+", "+r+")"),n.appendChild(c),c}},{key:"setGroupOptions",value:function(t,r){t.setAttribute("fill",r.lineColor)}},{key:"drawRect",value:function(t,r,n,c,g){var _=this.document.createElementNS(d,"rect");return _.setAttribute("x",t),_.setAttribute("y",r),_.setAttribute("width",n),_.setAttribute("height",c),g.appendChild(_),_}}]),a})();return $t.default=h,$t}var Yt={},mi;function Pa(){if(mi)return Yt;mi=1,Object.defineProperty(Yt,"__esModule",{value:!0});var f=(function(){function i(u,l){for(var d=0;d<l.length;d++){var h=l[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,l,d){return l&&i(u.prototype,l),d&&i(u,d),u}})();function o(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var s=(function(){function i(u,l,d){o(this,i),this.object=u,this.encodings=l,this.options=d}return f(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i})();return Yt.default=s,Yt}var Ei;function xa(){if(Ei)return Vt;Ei=1,Object.defineProperty(Vt,"__esModule",{value:!0});var f=Ca(),o=d(f),s=Ma(),i=d(s),u=Pa(),l=d(u);function d(h){return h&&h.__esModule?h:{default:h}}return Vt.default={CanvasRenderer:o.default,SVGRenderer:i.default,ObjectRenderer:l.default},Vt}var Be={},yi;function so(){if(yi)return Be;yi=1,Object.defineProperty(Be,"__esModule",{value:!0});function f(d,h){if(!(d instanceof h))throw new TypeError("Cannot call a class as a function")}function o(d,h){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:d}function s(d,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);d.prototype=Object.create(h&&h.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(d,h):d.__proto__=h)}var i=(function(d){s(h,d);function h(a,e){f(this,h);var t=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return t.name="InvalidInputException",t.symbology=a,t.input=e,t.message='"'+t.input+'" is not a valid input for '+t.symbology,t}return h})(Error),u=(function(d){s(h,d);function h(){f(this,h);var a=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return a.name="InvalidElementException",a.message="Not supported type to render on",a}return h})(Error),l=(function(d){s(h,d);function h(){f(this,h);var a=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return a.name="NoElementException",a.message="No element to render on.",a}return h})(Error);return Be.InvalidInputException=i,Be.InvalidElementException=u,Be.NoElementException=l,Be}var Oi;function La(){if(Oi)return jt;Oi=1,Object.defineProperty(jt,"__esModule",{value:!0});var f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=Ia(),s=d(o),i=xa(),u=d(i),l=so();function d(t){return t&&t.__esModule?t:{default:t}}function h(t){if(typeof t=="string")return a(t);if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++)r.push(h(t[n]));return r}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return e(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,s.default)(t),renderer:u.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,s.default)(t),renderer:u.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:u.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":f(t))==="object"&&!t.nodeName)return{element:t,renderer:u.default.ObjectRenderer};throw new l.InvalidElementException}}function a(t){var r=document.querySelectorAll(t);if(r.length!==0){for(var n=[],c=0;c<r.length;c++)n.push(h(r[c]));return n}}function e(t){var r=document.createElement("canvas");return{element:r,options:(0,s.default)(t),renderer:u.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",r.toDataURL())}}}return jt.default=h,jt}var Wt={},wi;function Da(){if(wi)return Wt;wi=1,Object.defineProperty(Wt,"__esModule",{value:!0});var f=(function(){function i(u,l){for(var d=0;d<l.length;d++){var h=l[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,l,d){return l&&i(u.prototype,l),d&&i(u,d),u}})();function o(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var s=(function(){function i(u){o(this,i),this.api=u}return f(i,[{key:"handleCatch",value:function(l){if(l.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw l.message;else throw l;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(l){try{var d=l.apply(void 0,arguments);return this.api._options.valid(!0),d}catch(h){return this.handleCatch(h),this.api}}}]),i})();return Wt.default=s,Wt}var yn,bi;function Na(){if(bi)return yn;bi=1;var f=Ta(),o=m(f),s=en(),i=m(s),u=Sa(),l=m(u),d=Ra(),h=m(d),a=La(),e=m(a),t=fo(),r=m(t),n=Da(),c=m(n),g=so(),_=co(),v=m(_);function m(y){return y&&y.__esModule?y:{default:y}}var E=function(){},T=function(S,w,A){var b=new E;if(typeof S>"u")throw Error("No element to render on was provided.");return b._renderProperties=(0,e.default)(S),b._encodings=[],b._options=v.default,b._errorHandler=new c.default(b),typeof w<"u"&&(A=A||{},A.format||(A.format=L()),b.options(A)[A.format](w,A).render()),b};T.getModule=function(y){return o.default[y]};for(var R in o.default)o.default.hasOwnProperty(R)&&N(o.default,R);function N(y,S){E.prototype[S]=E.prototype[S.toUpperCase()]=E.prototype[S.toLowerCase()]=function(w,A){var b=this;return b._errorHandler.wrapBarcodeCall(function(){A.text=typeof A.text>"u"?void 0:""+A.text;var M=(0,i.default)(b._options,A);M=(0,r.default)(M);var te=y[S],se=I(w,te,M);return b._encodings.push(se),b})}}function I(y,S,w){y=""+y;var A=new S(y,w);if(!A.valid())throw new g.InvalidInputException(A.constructor.name,y);var b=A.encode();b=(0,l.default)(b);for(var M=0;M<b.length;M++)b[M].options=(0,i.default)(w,b[M].options);return b}function L(){return o.default.CODE128?"CODE128":Object.keys(o.default)[0]}E.prototype.options=function(y){return this._options=(0,i.default)(this._options,y),this},E.prototype.blank=function(y){var S=new Array(y+1).join("0");return this._encodings.push({data:S}),this},E.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var y;for(var S in this._renderProperties){y=this._renderProperties[S];var w=(0,i.default)(this._options,y.options);w.format=="auto"&&(w.format=L()),this._errorHandler.wrapBarcodeCall(function(){var A=w.value,b=o.default[w.format.toUpperCase()],M=I(A,b,w);x(y,M,w)})}}},E.prototype.render=function(){if(!this._renderProperties)throw new g.NoElementException;if(Array.isArray(this._renderProperties))for(var y=0;y<this._renderProperties.length;y++)x(this._renderProperties[y],this._encodings,this._options);else x(this._renderProperties,this._encodings,this._options);return this},E.prototype._defaults=v.default;function x(y,S,w){S=(0,l.default)(S);for(var A=0;A<S.length;A++)S[A].options=(0,i.default)(w,S[A].options),(0,h.default)(S[A].options);(0,h.default)(w);var b=y.renderer,M=new b(y.element,S,w);M.render(),y.afterRender&&y.afterRender()}return typeof window<"u"&&(window.JsBarcode=T),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(y,S){var w=[];return jQuery(this).each(function(){w.push(this)}),T(w,y,S)}),yn=T,yn}var Ba=Na();const ka=ro(Ba);var ke={},On,Ai;function qa(){return Ai||(Ai=1,On=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),On}var wn={},me={},Ti;function Te(){if(Ti)return me;Ti=1;let f;const o=[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];return me.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},me.getSymbolTotalCodewords=function(i){return o[i]},me.getBCHDigit=function(s){let i=0;for(;s!==0;)i++,s>>>=1;return i},me.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');f=i},me.isKanjiModeEnabled=function(){return typeof f<"u"},me.toSJIS=function(i){return f(i)},me}var bn={},Si;function Wn(){return Si||(Si=1,(function(f){f.L={bit:1},f.M={bit:0},f.Q={bit:3},f.H={bit:2};function o(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"l":case"low":return f.L;case"m":case"medium":return f.M;case"q":case"quartile":return f.Q;case"h":case"high":return f.H;default:throw new Error("Unknown EC Level: "+s)}}f.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},f.from=function(i,u){if(f.isValid(i))return i;try{return o(i)}catch{return u}}})(bn)),bn}var An,Ri;function Fa(){if(Ri)return An;Ri=1;function f(){this.buffer=[],this.length=0}return f.prototype={get:function(o){const s=Math.floor(o/8);return(this.buffer[s]>>>7-o%8&1)===1},put:function(o,s){for(let i=0;i<s;i++)this.putBit((o>>>s-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const s=Math.floor(this.length/8);this.buffer.length<=s&&this.buffer.push(0),o&&(this.buffer[s]|=128>>>this.length%8),this.length++}},An=f,An}var Tn,Ii;function Ua(){if(Ii)return Tn;Ii=1;function f(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return f.prototype.set=function(o,s,i,u){const l=o*this.size+s;this.data[l]=i,u&&(this.reservedBit[l]=!0)},f.prototype.get=function(o,s){return this.data[o*this.size+s]},f.prototype.xor=function(o,s,i){this.data[o*this.size+s]^=i},f.prototype.isReserved=function(o,s){return this.reservedBit[o*this.size+s]},Tn=f,Tn}var Sn={},Ci;function ja(){return Ci||(Ci=1,(function(f){const o=Te().getSymbolSize;f.getRowColCoords=function(i){if(i===1)return[];const u=Math.floor(i/7)+2,l=o(i),d=l===145?26:Math.ceil((l-13)/(2*u-2))*2,h=[l-7];for(let a=1;a<u-1;a++)h[a]=h[a-1]-d;return h.push(6),h.reverse()},f.getPositions=function(i){const u=[],l=f.getRowColCoords(i),d=l.length;for(let h=0;h<d;h++)for(let a=0;a<d;a++)h===0&&a===0||h===0&&a===d-1||h===d-1&&a===0||u.push([l[h],l[a]]);return u}})(Sn)),Sn}var Rn={},Mi;function Ha(){if(Mi)return Rn;Mi=1;const f=Te().getSymbolSize,o=7;return Rn.getPositions=function(i){const u=f(i);return[[0,0],[u-o,0],[0,u-o]]},Rn}var In={},Pi;function Ga(){return Pi||(Pi=1,(function(f){f.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};f.isValid=function(u){return u!=null&&u!==""&&!isNaN(u)&&u>=0&&u<=7},f.from=function(u){return f.isValid(u)?parseInt(u,10):void 0},f.getPenaltyN1=function(u){const l=u.size;let d=0,h=0,a=0,e=null,t=null;for(let r=0;r<l;r++){h=a=0,e=t=null;for(let n=0;n<l;n++){let c=u.get(r,n);c===e?h++:(h>=5&&(d+=o.N1+(h-5)),e=c,h=1),c=u.get(n,r),c===t?a++:(a>=5&&(d+=o.N1+(a-5)),t=c,a=1)}h>=5&&(d+=o.N1+(h-5)),a>=5&&(d+=o.N1+(a-5))}return d},f.getPenaltyN2=function(u){const l=u.size;let d=0;for(let h=0;h<l-1;h++)for(let a=0;a<l-1;a++){const e=u.get(h,a)+u.get(h,a+1)+u.get(h+1,a)+u.get(h+1,a+1);(e===4||e===0)&&d++}return d*o.N2},f.getPenaltyN3=function(u){const l=u.size;let d=0,h=0,a=0;for(let e=0;e<l;e++){h=a=0;for(let t=0;t<l;t++)h=h<<1&2047|u.get(e,t),t>=10&&(h===1488||h===93)&&d++,a=a<<1&2047|u.get(t,e),t>=10&&(a===1488||a===93)&&d++}return d*o.N3},f.getPenaltyN4=function(u){let l=0;const d=u.data.length;for(let a=0;a<d;a++)l+=u.data[a];return Math.abs(Math.ceil(l*100/d/5)-10)*o.N4};function s(i,u,l){switch(i){case f.Patterns.PATTERN000:return(u+l)%2===0;case f.Patterns.PATTERN001:return u%2===0;case f.Patterns.PATTERN010:return l%3===0;case f.Patterns.PATTERN011:return(u+l)%3===0;case f.Patterns.PATTERN100:return(Math.floor(u/2)+Math.floor(l/3))%2===0;case f.Patterns.PATTERN101:return u*l%2+u*l%3===0;case f.Patterns.PATTERN110:return(u*l%2+u*l%3)%2===0;case f.Patterns.PATTERN111:return(u*l%3+(u+l)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}f.applyMask=function(u,l){const d=l.size;for(let h=0;h<d;h++)for(let a=0;a<d;a++)l.isReserved(a,h)||l.xor(a,h,s(u,a,h))},f.getBestMask=function(u,l){const d=Object.keys(f.Patterns).length;let h=0,a=1/0;for(let e=0;e<d;e++){l(e),f.applyMask(e,u);const t=f.getPenaltyN1(u)+f.getPenaltyN2(u)+f.getPenaltyN3(u)+f.getPenaltyN4(u);f.applyMask(e,u),t<a&&(a=t,h=e)}return h}})(In)),In}var Kt={},xi;function ho(){if(xi)return Kt;xi=1;const f=Wn(),o=[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],s=[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];return Kt.getBlocksCount=function(u,l){switch(l){case f.L:return o[(u-1)*4+0];case f.M:return o[(u-1)*4+1];case f.Q:return o[(u-1)*4+2];case f.H:return o[(u-1)*4+3];default:return}},Kt.getTotalCodewordsCount=function(u,l){switch(l){case f.L:return s[(u-1)*4+0];case f.M:return s[(u-1)*4+1];case f.Q:return s[(u-1)*4+2];case f.H:return s[(u-1)*4+3];default:return}},Kt}var Cn={},Ze={},Li;function za(){if(Li)return Ze;Li=1;const f=new Uint8Array(512),o=new Uint8Array(256);return(function(){let i=1;for(let u=0;u<255;u++)f[u]=i,o[i]=u,i<<=1,i&256&&(i^=285);for(let u=255;u<512;u++)f[u]=f[u-255]})(),Ze.log=function(i){if(i<1)throw new Error("log("+i+")");return o[i]},Ze.exp=function(i){return f[i]},Ze.mul=function(i,u){return i===0||u===0?0:f[o[i]+o[u]]},Ze}var Di;function Va(){return Di||(Di=1,(function(f){const o=za();f.mul=function(i,u){const l=new Uint8Array(i.length+u.length-1);for(let d=0;d<i.length;d++)for(let h=0;h<u.length;h++)l[d+h]^=o.mul(i[d],u[h]);return l},f.mod=function(i,u){let l=new Uint8Array(i);for(;l.length-u.length>=0;){const d=l[0];for(let a=0;a<u.length;a++)l[a]^=o.mul(u[a],d);let h=0;for(;h<l.length&&l[h]===0;)h++;l=l.slice(h)}return l},f.generateECPolynomial=function(i){let u=new Uint8Array([1]);for(let l=0;l<i;l++)u=f.mul(u,new Uint8Array([1,o.exp(l)]));return u}})(Cn)),Cn}var Mn,Ni;function Xa(){if(Ni)return Mn;Ni=1;const f=Va();function o(s){this.genPoly=void 0,this.degree=s,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(i){this.degree=i,this.genPoly=f.generateECPolynomial(this.degree)},o.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const u=new Uint8Array(i.length+this.degree);u.set(i);const l=f.mod(u,this.genPoly),d=this.degree-l.length;if(d>0){const h=new Uint8Array(this.degree);return h.set(l,d),h}return l},Mn=o,Mn}var Pn={},xn={},Ln={},Bi;function go(){return Bi||(Bi=1,Ln.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),Ln}var ce={},ki;function _o(){if(ki)return ce;ki=1;const f="[0-9]+",o="[A-Z $%*+\\-./:]+";let s="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";s=s.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+s+`)(?:.|[\r
3
- ]))+`;ce.KANJI=new RegExp(s,"g"),ce.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ce.BYTE=new RegExp(i,"g"),ce.NUMERIC=new RegExp(f,"g"),ce.ALPHANUMERIC=new RegExp(o,"g");const u=new RegExp("^"+s+"$"),l=new RegExp("^"+f+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ce.testKanji=function(a){return u.test(a)},ce.testNumeric=function(a){return l.test(a)},ce.testAlphanumeric=function(a){return d.test(a)},ce}var qi;function Se(){return qi||(qi=1,(function(f){const o=go(),s=_o();f.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},f.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},f.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},f.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},f.MIXED={bit:-1},f.getCharCountIndicator=function(l,d){if(!l.ccBits)throw new Error("Invalid mode: "+l);if(!o.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?l.ccBits[0]:d<27?l.ccBits[1]:l.ccBits[2]},f.getBestModeForData=function(l){return s.testNumeric(l)?f.NUMERIC:s.testAlphanumeric(l)?f.ALPHANUMERIC:s.testKanji(l)?f.KANJI:f.BYTE},f.toString=function(l){if(l&&l.id)return l.id;throw new Error("Invalid mode")},f.isValid=function(l){return l&&l.bit&&l.ccBits};function i(u){if(typeof u!="string")throw new Error("Param is not a string");switch(u.toLowerCase()){case"numeric":return f.NUMERIC;case"alphanumeric":return f.ALPHANUMERIC;case"kanji":return f.KANJI;case"byte":return f.BYTE;default:throw new Error("Unknown mode: "+u)}}f.from=function(l,d){if(f.isValid(l))return l;try{return i(l)}catch{return d}}})(xn)),xn}var Fi;function $a(){return Fi||(Fi=1,(function(f){const o=Te(),s=ho(),i=Wn(),u=Se(),l=go(),d=7973,h=o.getBCHDigit(d);function a(n,c,g){for(let _=1;_<=40;_++)if(c<=f.getCapacity(_,g,n))return _}function e(n,c){return u.getCharCountIndicator(n,c)+4}function t(n,c){let g=0;return n.forEach(function(_){const v=e(_.mode,c);g+=v+_.getBitsLength()}),g}function r(n,c){for(let g=1;g<=40;g++)if(t(n,g)<=f.getCapacity(g,c,u.MIXED))return g}f.from=function(c,g){return l.isValid(c)?parseInt(c,10):g},f.getCapacity=function(c,g,_){if(!l.isValid(c))throw new Error("Invalid QR Code version");typeof _>"u"&&(_=u.BYTE);const v=o.getSymbolTotalCodewords(c),m=s.getTotalCodewordsCount(c,g),E=(v-m)*8;if(_===u.MIXED)return E;const T=E-e(_,c);switch(_){case u.NUMERIC:return Math.floor(T/10*3);case u.ALPHANUMERIC:return Math.floor(T/11*2);case u.KANJI:return Math.floor(T/13);case u.BYTE:default:return Math.floor(T/8)}},f.getBestVersionForData=function(c,g){let _;const v=i.from(g,i.M);if(Array.isArray(c)){if(c.length>1)return r(c,v);if(c.length===0)return 1;_=c[0]}else _=c;return a(_.mode,_.getLength(),v)},f.getEncodedBits=function(c){if(!l.isValid(c)||c<7)throw new Error("Invalid QR Code version");let g=c<<12;for(;o.getBCHDigit(g)-h>=0;)g^=d<<o.getBCHDigit(g)-h;return c<<12|g}})(Pn)),Pn}var Dn={},Ui;function Ya(){if(Ui)return Dn;Ui=1;const f=Te(),o=1335,s=21522,i=f.getBCHDigit(o);return Dn.getEncodedBits=function(l,d){const h=l.bit<<3|d;let a=h<<10;for(;f.getBCHDigit(a)-i>=0;)a^=o<<f.getBCHDigit(a)-i;return(h<<10|a)^s},Dn}var Nn={},Bn,ji;function Wa(){if(ji)return Bn;ji=1;const f=Se();function o(s){this.mode=f.NUMERIC,this.data=s.toString()}return o.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){let u,l,d;for(u=0;u+3<=this.data.length;u+=3)l=this.data.substr(u,3),d=parseInt(l,10),i.put(d,10);const h=this.data.length-u;h>0&&(l=this.data.substr(u),d=parseInt(l,10),i.put(d,h*3+1))},Bn=o,Bn}var kn,Hi;function Ka(){if(Hi)return kn;Hi=1;const f=Se(),o=["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 s(i){this.mode=f.ALPHANUMERIC,this.data=i}return s.getBitsLength=function(u){return 11*Math.floor(u/2)+6*(u%2)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(u){let l;for(l=0;l+2<=this.data.length;l+=2){let d=o.indexOf(this.data[l])*45;d+=o.indexOf(this.data[l+1]),u.put(d,11)}this.data.length%2&&u.put(o.indexOf(this.data[l]),6)},kn=s,kn}var qn,Gi;function Ja(){if(Gi)return qn;Gi=1;const f=Se();function o(s){this.mode=f.BYTE,typeof s=="string"?this.data=new TextEncoder().encode(s):this.data=new Uint8Array(s)}return o.getBitsLength=function(i){return i*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(s){for(let i=0,u=this.data.length;i<u;i++)s.put(this.data[i],8)},qn=o,qn}var Fn,zi;function Qa(){if(zi)return Fn;zi=1;const f=Se(),o=Te();function s(i){this.mode=f.KANJI,this.data=i}return s.getBitsLength=function(u){return u*13},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(i){let u;for(u=0;u<this.data.length;u++){let l=o.toSJIS(this.data[u]);if(l>=33088&&l<=40956)l-=33088;else if(l>=57408&&l<=60351)l-=49472;else throw new Error("Invalid SJIS character: "+this.data[u]+`
4
- Make sure your charset is UTF-8`);l=(l>>>8&255)*192+(l&255),i.put(l,13)}},Fn=s,Fn}var Un={exports:{}},Vi;function Za(){return Vi||(Vi=1,(function(f){var o={single_source_shortest_paths:function(s,i,u){var l={},d={};d[i]=0;var h=o.PriorityQueue.make();h.push(i,0);for(var a,e,t,r,n,c,g,_,v;!h.empty();){a=h.pop(),e=a.value,r=a.cost,n=s[e]||{};for(t in n)n.hasOwnProperty(t)&&(c=n[t],g=r+c,_=d[t],v=typeof d[t]>"u",(v||_>g)&&(d[t]=g,h.push(t,g),l[t]=e))}if(typeof u<"u"&&typeof d[u]>"u"){var m=["Could not find a path from ",i," to ",u,"."].join("");throw new Error(m)}return l},extract_shortest_path_from_predecessor_list:function(s,i){for(var u=[],l=i;l;)u.push(l),s[l],l=s[l];return u.reverse(),u},find_path:function(s,i,u){var l=o.single_source_shortest_paths(s,i,u);return o.extract_shortest_path_from_predecessor_list(l,u)},PriorityQueue:{make:function(s){var i=o.PriorityQueue,u={},l;s=s||{};for(l in i)i.hasOwnProperty(l)&&(u[l]=i[l]);return u.queue=[],u.sorter=s.sorter||i.default_sorter,u},default_sorter:function(s,i){return s.cost-i.cost},push:function(s,i){var u={value:s,cost:i};this.queue.push(u),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};f.exports=o})(Un)),Un.exports}var Xi;function eu(){return Xi||(Xi=1,(function(f){const o=Se(),s=Wa(),i=Ka(),u=Ja(),l=Qa(),d=_o(),h=Te(),a=Za();function e(m){return unescape(encodeURIComponent(m)).length}function t(m,E,T){const R=[];let N;for(;(N=m.exec(T))!==null;)R.push({data:N[0],index:N.index,mode:E,length:N[0].length});return R}function r(m){const E=t(d.NUMERIC,o.NUMERIC,m),T=t(d.ALPHANUMERIC,o.ALPHANUMERIC,m);let R,N;return h.isKanjiModeEnabled()?(R=t(d.BYTE,o.BYTE,m),N=t(d.KANJI,o.KANJI,m)):(R=t(d.BYTE_KANJI,o.BYTE,m),N=[]),E.concat(T,R,N).sort(function(L,x){return L.index-x.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function n(m,E){switch(E){case o.NUMERIC:return s.getBitsLength(m);case o.ALPHANUMERIC:return i.getBitsLength(m);case o.KANJI:return l.getBitsLength(m);case o.BYTE:return u.getBitsLength(m)}}function c(m){return m.reduce(function(E,T){const R=E.length-1>=0?E[E.length-1]:null;return R&&R.mode===T.mode?(E[E.length-1].data+=T.data,E):(E.push(T),E)},[])}function g(m){const E=[];for(let T=0;T<m.length;T++){const R=m[T];switch(R.mode){case o.NUMERIC:E.push([R,{data:R.data,mode:o.ALPHANUMERIC,length:R.length},{data:R.data,mode:o.BYTE,length:R.length}]);break;case o.ALPHANUMERIC:E.push([R,{data:R.data,mode:o.BYTE,length:R.length}]);break;case o.KANJI:E.push([R,{data:R.data,mode:o.BYTE,length:e(R.data)}]);break;case o.BYTE:E.push([{data:R.data,mode:o.BYTE,length:e(R.data)}])}}return E}function _(m,E){const T={},R={start:{}};let N=["start"];for(let I=0;I<m.length;I++){const L=m[I],x=[];for(let y=0;y<L.length;y++){const S=L[y],w=""+I+y;x.push(w),T[w]={node:S,lastCount:0},R[w]={};for(let A=0;A<N.length;A++){const b=N[A];T[b]&&T[b].node.mode===S.mode?(R[b][w]=n(T[b].lastCount+S.length,S.mode)-n(T[b].lastCount,S.mode),T[b].lastCount+=S.length):(T[b]&&(T[b].lastCount=S.length),R[b][w]=n(S.length,S.mode)+4+o.getCharCountIndicator(S.mode,E))}}N=x}for(let I=0;I<N.length;I++)R[N[I]].end=0;return{map:R,table:T}}function v(m,E){let T;const R=o.getBestModeForData(m);if(T=o.from(E,R),T!==o.BYTE&&T.bit<R.bit)throw new Error('"'+m+'" cannot be encoded with mode '+o.toString(T)+`.
5
- Suggested mode is: `+o.toString(R));switch(T===o.KANJI&&!h.isKanjiModeEnabled()&&(T=o.BYTE),T){case o.NUMERIC:return new s(m);case o.ALPHANUMERIC:return new i(m);case o.KANJI:return new l(m);case o.BYTE:return new u(m)}}f.fromArray=function(E){return E.reduce(function(T,R){return typeof R=="string"?T.push(v(R,null)):R.data&&T.push(v(R.data,R.mode)),T},[])},f.fromString=function(E,T){const R=r(E,h.isKanjiModeEnabled()),N=g(R),I=_(N,T),L=a.find_path(I.map,"start","end"),x=[];for(let y=1;y<L.length-1;y++)x.push(I.table[L[y]].node);return f.fromArray(c(x))},f.rawSplit=function(E){return f.fromArray(r(E,h.isKanjiModeEnabled()))}})(Nn)),Nn}var $i;function tu(){if($i)return wn;$i=1;const f=Te(),o=Wn(),s=Fa(),i=Ua(),u=ja(),l=Ha(),d=Ga(),h=ho(),a=Xa(),e=$a(),t=Ya(),r=Se(),n=eu();function c(I,L){const x=I.size,y=l.getPositions(L);for(let S=0;S<y.length;S++){const w=y[S][0],A=y[S][1];for(let b=-1;b<=7;b++)if(!(w+b<=-1||x<=w+b))for(let M=-1;M<=7;M++)A+M<=-1||x<=A+M||(b>=0&&b<=6&&(M===0||M===6)||M>=0&&M<=6&&(b===0||b===6)||b>=2&&b<=4&&M>=2&&M<=4?I.set(w+b,A+M,!0,!0):I.set(w+b,A+M,!1,!0))}}function g(I){const L=I.size;for(let x=8;x<L-8;x++){const y=x%2===0;I.set(x,6,y,!0),I.set(6,x,y,!0)}}function _(I,L){const x=u.getPositions(L);for(let y=0;y<x.length;y++){const S=x[y][0],w=x[y][1];for(let A=-2;A<=2;A++)for(let b=-2;b<=2;b++)A===-2||A===2||b===-2||b===2||A===0&&b===0?I.set(S+A,w+b,!0,!0):I.set(S+A,w+b,!1,!0)}}function v(I,L){const x=I.size,y=e.getEncodedBits(L);let S,w,A;for(let b=0;b<18;b++)S=Math.floor(b/3),w=b%3+x-8-3,A=(y>>b&1)===1,I.set(S,w,A,!0),I.set(w,S,A,!0)}function m(I,L,x){const y=I.size,S=t.getEncodedBits(L,x);let w,A;for(w=0;w<15;w++)A=(S>>w&1)===1,w<6?I.set(w,8,A,!0):w<8?I.set(w+1,8,A,!0):I.set(y-15+w,8,A,!0),w<8?I.set(8,y-w-1,A,!0):w<9?I.set(8,15-w-1+1,A,!0):I.set(8,15-w-1,A,!0);I.set(y-8,8,1,!0)}function E(I,L){const x=I.size;let y=-1,S=x-1,w=7,A=0;for(let b=x-1;b>0;b-=2)for(b===6&&b--;;){for(let M=0;M<2;M++)if(!I.isReserved(S,b-M)){let te=!1;A<L.length&&(te=(L[A]>>>w&1)===1),I.set(S,b-M,te),w--,w===-1&&(A++,w=7)}if(S+=y,S<0||x<=S){S-=y,y=-y;break}}}function T(I,L,x){const y=new s;x.forEach(function(M){y.put(M.mode.bit,4),y.put(M.getLength(),r.getCharCountIndicator(M.mode,I)),M.write(y)});const S=f.getSymbolTotalCodewords(I),w=h.getTotalCodewordsCount(I,L),A=(S-w)*8;for(y.getLengthInBits()+4<=A&&y.put(0,4);y.getLengthInBits()%8!==0;)y.putBit(0);const b=(A-y.getLengthInBits())/8;for(let M=0;M<b;M++)y.put(M%2?17:236,8);return R(y,I,L)}function R(I,L,x){const y=f.getSymbolTotalCodewords(L),S=h.getTotalCodewordsCount(L,x),w=y-S,A=h.getBlocksCount(L,x),b=y%A,M=A-b,te=Math.floor(y/A),se=Math.floor(w/A),tn=se+1,qe=te-se,nn=new a(qe);let Re=0;const q=new Array(A),Fe=new Array(A);let U=0;const it=new Uint8Array(I.buffer);for(let de=0;de<A;de++){const Ee=de<M?se:tn;q[de]=it.slice(Re,Re+Ee),Fe[de]=nn.encode(q[de]),Re+=Ee,U=Math.max(U,Ee)}const B=new Uint8Array(y);let ve=0,J,z;for(J=0;J<U;J++)for(z=0;z<A;z++)J<q[z].length&&(B[ve++]=q[z][J]);for(J=0;J<qe;J++)for(z=0;z<A;z++)B[ve++]=Fe[z][J];return B}function N(I,L,x,y){let S;if(Array.isArray(I))S=n.fromArray(I);else if(typeof I=="string"){let te=L;if(!te){const se=n.rawSplit(I);te=e.getBestVersionForData(se,x)}S=n.fromString(I,te||40)}else throw new Error("Invalid data");const w=e.getBestVersionForData(S,x);if(!w)throw new Error("The amount of data is too big to be stored in a QR Code");if(!L)L=w;else if(L<w)throw new Error(`
6
- The chosen QR Code version cannot contain this amount of data.
7
- Minimum version required to store current data is: `+w+`.
8
- `);const A=T(L,x,S),b=f.getSymbolSize(L),M=new i(b);return c(M,L),g(M),_(M,L),m(M,x,0),L>=7&&v(M,L),E(M,A),isNaN(y)&&(y=d.getBestMask(M,m.bind(null,M,x))),d.applyMask(y,M),m(M,x,y),{modules:M,version:L,errorCorrectionLevel:x,maskPattern:y,segments:S}}return wn.create=function(L,x){if(typeof L>"u"||L==="")throw new Error("No input text");let y=o.M,S,w;return typeof x<"u"&&(y=o.from(x.errorCorrectionLevel,o.M),S=e.from(x.version),w=d.from(x.maskPattern),x.toSJISFunc&&f.setToSJISFunction(x.toSJISFunc)),N(L,S,y,w)},wn}var jn={},Hn={},Yi;function po(){return Yi||(Yi=1,(function(f){function o(s){if(typeof s=="number"&&(s=s.toString()),typeof s!="string")throw new Error("Color should be defined as hex string");let i=s.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+s);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(l){return[l,l]}))),i.length===6&&i.push("F","F");const u=parseInt(i.join(""),16);return{r:u>>24&255,g:u>>16&255,b:u>>8&255,a:u&255,hex:"#"+i.slice(0,6).join("")}}f.getOptions=function(i){i||(i={}),i.color||(i.color={});const u=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,l=i.width&&i.width>=21?i.width:void 0,d=i.scale||4;return{width:l,scale:l?4:d,margin:u,color:{dark:o(i.color.dark||"#000000ff"),light:o(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},f.getScale=function(i,u){return u.width&&u.width>=i+u.margin*2?u.width/(i+u.margin*2):u.scale},f.getImageWidth=function(i,u){const l=f.getScale(i,u);return Math.floor((i+u.margin*2)*l)},f.qrToImageData=function(i,u,l){const d=u.modules.size,h=u.modules.data,a=f.getScale(d,l),e=Math.floor((d+l.margin*2)*a),t=l.margin*a,r=[l.color.light,l.color.dark];for(let n=0;n<e;n++)for(let c=0;c<e;c++){let g=(n*e+c)*4,_=l.color.light;if(n>=t&&c>=t&&n<e-t&&c<e-t){const v=Math.floor((n-t)/a),m=Math.floor((c-t)/a);_=r[h[v*d+m]?1:0]}i[g++]=_.r,i[g++]=_.g,i[g++]=_.b,i[g]=_.a}}})(Hn)),Hn}var Wi;function nu(){return Wi||(Wi=1,(function(f){const o=po();function s(u,l,d){u.clearRect(0,0,l.width,l.height),l.style||(l.style={}),l.height=d,l.width=d,l.style.height=d+"px",l.style.width=d+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}f.render=function(l,d,h){let a=h,e=d;typeof a>"u"&&(!d||!d.getContext)&&(a=d,d=void 0),d||(e=i()),a=o.getOptions(a);const t=o.getImageWidth(l.modules.size,a),r=e.getContext("2d"),n=r.createImageData(t,t);return o.qrToImageData(n.data,l,a),s(r,e,t),r.putImageData(n,0,0),e},f.renderToDataURL=function(l,d,h){let a=h;typeof a>"u"&&(!d||!d.getContext)&&(a=d,d=void 0),a||(a={});const e=f.render(l,d,a),t=a.type||"image/png",r=a.rendererOpts||{};return e.toDataURL(t,r.quality)}})(jn)),jn}var Gn={},Ki;function ru(){if(Ki)return Gn;Ki=1;const f=po();function o(u,l){const d=u.a/255,h=l+'="'+u.hex+'"';return d<1?h+" "+l+'-opacity="'+d.toFixed(2).slice(1)+'"':h}function s(u,l,d){let h=u+l;return typeof d<"u"&&(h+=" "+d),h}function i(u,l,d){let h="",a=0,e=!1,t=0;for(let r=0;r<u.length;r++){const n=Math.floor(r%l),c=Math.floor(r/l);!n&&!e&&(e=!0),u[r]?(t++,r>0&&n>0&&u[r-1]||(h+=e?s("M",n+d,.5+c+d):s("m",a,0),a=0,e=!1),n+1<l&&u[r+1]||(h+=s("h",t),t=0)):a++}return h}return Gn.render=function(l,d,h){const a=f.getOptions(d),e=l.modules.size,t=l.modules.data,r=e+a.margin*2,n=a.color.light.a?"<path "+o(a.color.light,"fill")+' d="M0 0h'+r+"v"+r+'H0z"/>':"",c="<path "+o(a.color.dark,"stroke")+' d="'+i(t,e,a.margin)+'"/>',g='viewBox="0 0 '+r+" "+r+'"',v='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+g+' shape-rendering="crispEdges">'+n+c+`</svg>
9
- `;return typeof h=="function"&&h(null,v),v},Gn}var Ji;function iu(){if(Ji)return ke;Ji=1;const f=qa(),o=tu(),s=nu(),i=ru();function u(l,d,h,a,e){const t=[].slice.call(arguments,1),r=t.length,n=typeof t[r-1]=="function";if(!n&&!f())throw new Error("Callback required as last argument");if(n){if(r<2)throw new Error("Too few arguments provided");r===2?(e=h,h=d,d=a=void 0):r===3&&(d.getContext&&typeof e>"u"?(e=a,a=void 0):(e=a,a=h,h=d,d=void 0))}else{if(r<1)throw new Error("Too few arguments provided");return r===1?(h=d,d=a=void 0):r===2&&!d.getContext&&(a=h,h=d,d=void 0),new Promise(function(c,g){try{const _=o.create(h,a);c(l(_,d,a))}catch(_){g(_)}})}try{const c=o.create(h,a);e(null,l(c,d,a))}catch(c){e(c)}}return ke.create=o.create,ke.toCanvas=u.bind(null,s.render),ke.toDataURL=u.bind(null,s.renderToDataURL),ke.toString=u.bind(null,function(l,d,h){return i.render(l,h)}),ke}var ou=iu();const au=ro(ou),vo=document.querySelector("#main");if(!vo)throw new Error("Main element (#main) not found in document");const Ae=vo;function ie(f,o=null){window.electronAPI.sendRenderLineReply({status:f,error:o})}function uu(f,o){const s=document.createElement("div"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttributeNS(null,"id",`barCode-${o}`),s.append(i),f.style?ae(s,f.style):(s.style.display="flex",s.style.justifyContent=f.position??"left"),f.value&&ka(i,f.value,{lineColor:"#000",textMargin:0,fontOptions:"bold",fontSize:f.fontsize??12,width:f.width?Number.parseInt(f.width,10):4,height:f.height?Number.parseInt(f.height,10):40,displayValue:f.displayValue}),s}async function fu(f,o){const s=document.createElement("div");s.style.display="flex",s.style.justifyContent=f.position||"left",f.style&&ae(s,f.style);const i=document.createElement("canvas");return i.setAttribute("id",`qrCode-${o}`),ae(i,{textAlign:f.position?"-webkit-"+f.position:"-webkit-left"}),s.append(i),await au.toCanvas(i,f.value||"",{width:f.width?Number.parseInt(f.width,10):55,errorCorrectionLevel:"H",color:{dark:"#000",light:"#fff"}}),s}function zn(f,o,s){for(const i of f)if(typeof i=="object")switch(i.type){case"image":{const u=no(i),l=document.createElement(s);l.append(u),o.append(l);break}case"text":o.append(Jo(i,s));break}else{const u=document.createElement(s);u.innerHTML=Yn(String(i)),o.append(u)}}function cu(f,o){const s=document.createElement("div");s.setAttribute("id",`table-container-${o}`);const i=ae(document.createElement("table"),{...f.style});i.setAttribute("id",`table${o}`);const u=ae(document.createElement("thead"),f.tableHeaderStyle),l=ae(document.createElement("tbody"),f.tableBodyStyle),d=ae(document.createElement("tfoot"),f.tableFooterStyle);if(f.tableHeader&&zn(f.tableHeader,u,"th"),f.tableBody)for(const h of f.tableBody){const a=document.createElement("tr");zn(h,a,"td"),l.append(a)}return f.tableFooter&&zn(f.tableFooter,d,"th"),i.append(u),i.append(l),i.append(d),s.append(i),s}async function lu(f){const{printItem:o,itemIndex:s}=f;switch(o.type){case"text":try{Ae.append(Ko(o)),ie(!0)}catch(i){ie(!1,i.toString())}return;case"image":try{Ae.append(no(o)),ie(!0)}catch(i){ie(!1,i.toString())}return;case"qrCode":try{const i=await fu(o,s);Ae.append(i),ie(!0)}catch(i){ie(!1,i.toString())}return;case"barCode":try{Ae.append(uu(o,s)),ie(!0)}catch(i){ie(!1,i.toString())}return;case"table":try{Ae.append(cu(o,s)),ie(!0)}catch(i){ie(!1,i.toString())}return;default:ie(!1,`Unknown print item type: ${o.type}`)}}window.electronAPI.onBodyInit(function(f){Ae.style.width=f?.width||"100%",Ae.style.margin=f?.margin||"0",window.electronAPI.sendBodyInitReply({status:!0,error:null})});window.electronAPI.onRenderLine(lu);