zero-ai-ui-lib 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,16 +50,47 @@ const options = [
50
50
 
51
51
  按钮与操作:`UiButton` `UiChip` `UiBadge` `UiFloatingMenu` `UiToolMenu` `UiSegmented` `UiStepper` `UiRating`
52
52
 
53
- 表单:`UiInput` `UiTextarea` `UiSelect` `UiSwitch` `UiCheckbox` `UiRadioGroup` `UiSlider` `UiDatePicker` `UiTimePicker`
53
+ 表单:`UiInput` `UiTextarea` `UiSelect`(含多选)`UiAutocomplete`(下拉同款形变 + 展开层内输入)`UiColorPicker`(自绘 HSV 取色盘)`UiSwitch` `UiCheckbox` `UiRadioGroup` `UiSlider` `UiRangeSlider` `UiRingSlider` `UiGaugeSlider` `UiDatePicker` `UiTimePicker` `UiRangeDatePicker` `UiWheelDatePicker` `UiRangeTimePicker` `UiStepper`
54
54
 
55
- 数据与可视化:`UiSparkline` `UiBarChart` `UiLineChart` `UiRingProgress` `UiGauge` `UiHeatmap` `UiProgress` `UiSkeleton` `UiSpinner`
55
+ 数据录入:`UiTagInput` `UiKeyValueEditor` `UiSchemaForm`(JSON Schema 生成表单)
56
56
 
57
- 反馈与浮层:`UiAlert` `UiTooltip` `UiToastHost` `UiEmptyState` `UiModal` `UiBottomSheet` `UiAccordion`
57
+ 数据与可视化:`UiSparkline` `UiBarChart` `UiLineChart` `UiRingProgress` `UiGauge` `UiHeatmap` `UiProgress` `UiSkeleton` `UiSpinner` `UiDataTable` `UiTreeView` `UiVirtualList`(虚拟滚动 + 滑动多选)`UiRollNumber`(全库统一数字动效)
58
58
 
59
- 布局与卡片:`UiAvatar` `UiEmptyState` `ExpandableCard` `RouteExpandCard`
59
+ 工程与代码:`UiCodeEditor`(行号 / 高亮 / Tab 缩进)、`UiTerminalOutput`(ANSI 着色 + 跟随滚动)
60
+
61
+ 反馈与浮层:`UiAlert` `UiTooltip` `UiToastHost`(success/error/warning/info + 队列)`UiEmptyState` `UiModal` `UiBottomSheet` `UiAccordion` `UiConfirmDialog` / `confirmDialog()`(替代 window.confirm)、`UiSlideover`(抽屉)`UiTour`(整体聚焦到一点的巡览)`UiFileDropzone`(拖拽上传)
62
+
63
+ 搜索与状态:`UiSearchField`(图标原地形变)
64
+
65
+ 编码与图形:`UiCodeImage`(children 传文本渲染二维码 / 一维码,多码制可切换,内容不合规自动禁用与降级)
66
+
67
+ 导航:`UiTabBar`(移动端贴底铺满整宽、桌面端贴左竖排铺满整高,两套定位互斥不冲突)
68
+
69
+ 动效与手势:`UiRotatingText`(循环短语)、`UiText`(打字机 / 掠光 / 流动渐变)、`UiStatusMark`、`UiToolCallChip`、`UiCodeSlots`、`UiScrubField`、`UiSwipeRow`、`UiStepFlow`、`UiTooltipGroup`、`UiCardGroup`(8 种形态)
70
+
71
+ 交互基座:`UiMorphPanel`(泛用「按钮 ⇄ 任意组件」形变容器)、`UiWheel`(通用多列波轮基座,时间 / 日期波轮共用)
72
+
73
+ 布局与卡片:`UiAvatar` `UiAvatarTag`(异形遮罩图 / 任意 SVG 且无遮罩)`UiCard`(含 `variant="product"` 产品授权卡)`UiSidebar` `UiSplitter` `UiGrid` / `UiRow` / `UiCol` `UiCarousel` / `UiPagerDots` `UiEmptyState` `ExpandableCard` `RouteExpandCard`
60
74
 
61
75
  组合式函数:`usePress`(按压反馈)、`useMorphWindow`(从输入框形变成浮动窗口)
62
76
 
77
+ 工具函数:`formatDuration` / `formatDurationBetween` / `parseClockTime`(00h00m00s 时长规则)、`confirmDialog`、`highlightToHtml` / `ansiToHtml`
78
+
79
+ > 类型:包自带 `dist/index.d.ts`(手写声明,exports.types 已接好),TS 项目直接获得 props 提示,无需 declare module 兜底。
80
+
81
+ ## 应用级配置与动效气质
82
+
83
+ 根目录放 `zero.config.yaml`(或 json),库启动时读取根部 `ui`:
84
+
85
+ ```yaml
86
+ ui:
87
+ motion: lively # calm(默认)| lively —— 产品调性,不是用户偏好,别做成设置项
88
+ colors:
89
+ primary: "#3f5f90"
90
+ ```
91
+
92
+ 代码里也可以直接 `setMotionTone('lively')`;完整字段见 `zero.config.example.yaml`。
93
+
63
94
  ## 主题
64
95
 
65
96
  样式通过 CSS 变量驱动,库自带 `tokens.css` 的默认浅色令牌。
@@ -0,0 +1 @@
1
+ "use strict";const Qt=require("./_commonjsHelpers-DwGv2jUC.cjs");function Wt(s,d){for(var v=0;v<d.length;v++){const c=d[v];if(typeof c!="string"&&!Array.isArray(c)){for(const h in c)if(h!=="default"&&!(h in s)){const _=Object.getOwnPropertyDescriptor(c,h);_&&Object.defineProperty(s,h,_.get?_:{enumerable:!0,get:()=>c[h]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var Q={},$={},W={},$e;function T(){if($e)return W;$e=1,Object.defineProperty(W,"__esModule",{value:!0});function s(v,c){if(!(v instanceof c))throw new TypeError("Cannot call a class as a function")}var d=function v(c,h){s(this,v),this.data=c,this.text=h.text||c,this.options=h};return W.default=d,W}var Ne;function Zt(){if(Ne)return $;Ne=1,Object.defineProperty($,"__esModule",{value:!0}),$.CODE39=void 0;var s=function(){function o(y,p){for(var g=0;g<p.length;g++){var w=p[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,p,g){return p&&o(y.prototype,p),g&&o(y,g),y}}(),d=T(),v=c(d);function c(o){return o&&o.__esModule?o:{default:o}}function h(o,y){if(!(o instanceof y))throw new TypeError("Cannot call a class as a function")}function _(o,y){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:o}function l(o,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);o.prototype=Object.create(y&&y.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(o,y):o.__proto__=y)}var f=function(o){l(y,o);function y(p,g){return h(this,y),p=p.toUpperCase(),g.mod43&&(p+=r(u(p))),_(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,p,g))}return s(y,[{key:"encode",value:function(){for(var g=t("*"),w=0;w<this.data.length;w++)g+=t(this.data[w])+"0";return g+=t("*"),{data:g,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),y}(v.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(o){return n(i(o))}function n(o){return e[o].toString(2)}function r(o){return a[o]}function i(o){return a.indexOf(o)}function u(o){for(var y=0,p=0;p<o.length;p++)y+=i(o[p]);return y=y%43,y}return $.CODE39=f,$}var I={},Z={},K={},S={},Ge;function z(){if(Ge)return S;Ge=1,Object.defineProperty(S,"__esModule",{value:!0});var s;function d(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var v=S.SET_A=0,c=S.SET_B=1,h=S.SET_C=2;S.SHIFT=98;var _=S.START_A=103,l=S.START_B=104,f=S.START_C=105;return S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(s={},d(s,_,v),d(s,l,c),d(s,f,h),s),S.SWAP={101:v,100:c,99:h},S.A_START_CHAR="Ð",S.B_START_CHAR="Ñ",S.C_START_CHAR="Ò",S.A_CHARS="[\0-_È-Ï]",S.B_CHARS="[ -È-Ï]",S.C_CHARS="(Ï*[0-9]{2}Ï*)",S.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],S}var Fe;function De(){if(Fe)return K;Fe=1,Object.defineProperty(K,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=T(),v=h(d),c=z();function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){_(this,t);var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n.substring(1),r));return i.bytes=n.split("").map(function(u){return u.charCodeAt(0)}),i}return s(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.bytes,i=r.shift()-105,u=c.SET_BY_CODE[i];if(u===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&r.unshift(c.FNC1);var o=t.next(r,1,u);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(i)+o.result+t.getBar((o.checksum+i)%c.MODULO)+t.getBar(c.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var r=this.options.ean128||!1;return typeof r=="string"&&(r=r.toLowerCase()==="true"),r}}],[{key:"getBar",value:function(r){return c.BARS[r]?c.BARS[r].toString():""}},{key:"correctIndex",value:function(r,i){if(i===c.SET_A){var u=r.shift();return u<32?u+64:u-32}else return i===c.SET_B?r.shift()-32:(r.shift()-48)*10+r.shift()-48}},{key:"next",value:function(r,i,u){if(!r.length)return{result:"",checksum:0};var o=void 0,y=void 0;if(r[0]>=200){y=r.shift()-105;var p=c.SWAP[y];p!==void 0?o=t.next(r,i+1,p):((u===c.SET_A||u===c.SET_B)&&y===c.SHIFT&&(r[0]=u===c.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),o=t.next(r,i+1,u))}else y=t.correctIndex(r,u),o=t.next(r,i+1,u);var g=t.getBar(y),w=y*i;return{result:g+o.result,checksum:w+o.checksum}}}]),t}(v.default);return K.default=a,K}var ee={},He;function Kt(){if(He)return ee;He=1,Object.defineProperty(ee,"__esModule",{value:!0});var s=z(),d=function(f){return f.match(new RegExp("^"+s.A_CHARS+"*"))[0].length},v=function(f){return f.match(new RegExp("^"+s.B_CHARS+"*"))[0].length},c=function(f){return f.match(new RegExp("^"+s.C_CHARS+"*"))[0]};function h(l,f){var a=f?s.A_CHARS:s.B_CHARS,e=l.match(new RegExp("^("+a+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(e)return e[1]+"Ì"+_(l.substring(e[1].length));var t=l.match(new RegExp("^"+a+"+"))[0];return t.length===l.length?l:t+String.fromCharCode(f?205:206)+h(l.substring(t.length),!f)}function _(l){var f=c(l),a=f.length;if(a===l.length)return l;l=l.substring(a);var e=d(l)>=v(l);return f+String.fromCharCode(e?206:205)+h(l,e)}return ee.default=function(l){var f=void 0,a=c(l).length;if(a>=2)f=s.C_START_CHAR+_(l);else{var e=d(l)>v(l);f=(e?s.A_START_CHAR:s.B_START_CHAR)+h(l,e)}return f.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(t,n){return"Ë"+n})},ee}var Ue;function er(){if(Ue)return Z;Ue=1,Object.defineProperty(Z,"__esModule",{value:!0});var s=De(),d=h(s),v=Kt(),c=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){if(_(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,c.default)(n),r));else var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r));return l(i)}return t}(d.default);return Z.default=a,Z}var te={},ze;function tr(){if(ze)return te;ze=1,Object.defineProperty(te,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=De(),v=h(d),c=z();function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){return _(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.A_START_CHAR+n,r))}return s(t,[{key:"valid",value:function(){return new RegExp("^"+c.A_CHARS+"+$").test(this.data)}}]),t}(v.default);return te.default=a,te}var re={},Xe;function rr(){if(Xe)return re;Xe=1,Object.defineProperty(re,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=De(),v=h(d),c=z();function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){return _(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.B_START_CHAR+n,r))}return s(t,[{key:"valid",value:function(){return new RegExp("^"+c.B_CHARS+"+$").test(this.data)}}]),t}(v.default);return re.default=a,re}var ne={},Ve;function nr(){if(Ve)return ne;Ve=1,Object.defineProperty(ne,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=De(),v=h(d),c=z();function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){return _(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.C_START_CHAR+n,r))}return s(t,[{key:"valid",value:function(){return new RegExp("^"+c.C_CHARS+"+$").test(this.data)}}]),t}(v.default);return ne.default=a,ne}var Je;function ir(){if(Je)return I;Je=1,Object.defineProperty(I,"__esModule",{value:!0}),I.CODE128C=I.CODE128B=I.CODE128A=I.CODE128=void 0;var s=er(),d=a(s),v=tr(),c=a(v),h=rr(),_=a(h),l=nr(),f=a(l);function a(e){return e&&e.__esModule?e:{default:e}}return I.CODE128=d.default,I.CODE128A=c.default,I.CODE128B=_.default,I.CODE128C=f.default,I}var R={},ie={},D={},Ye;function X(){return Ye||(Ye=1,Object.defineProperty(D,"__esModule",{value:!0}),D.SIDE_BIN="101",D.MIDDLE_BIN="01010",D.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"]},D.EAN2_STRUCTURE=["LL","LG","GL","GG"],D.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],D.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),D}var ae={},ue={},Qe;function V(){if(Qe)return ue;Qe=1,Object.defineProperty(ue,"__esModule",{value:!0});var s=X(),d=function(c,h,_){var l=c.split("").map(function(a,e){return s.BINARIES[h[e]]}).map(function(a,e){return a?a[c[e]]:""});if(_){var f=c.length-1;l=l.map(function(a,e){return e<f?a+_:a})}return l.join("")};return ue.default=d,ue}var We;function $t(){if(We)return ae;We=1,Object.defineProperty(ae,"__esModule",{value:!0});var s=function(){function n(r,i){for(var u=0;u<i.length;u++){var o=i[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}return function(r,i,u){return i&&n(r.prototype,i),u&&n(r,u),r}}(),d=X(),v=V(),c=l(v),h=T(),_=l(h);function l(n){return n&&n.__esModule?n:{default:n}}function f(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function a(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function e(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var t=function(n){e(r,n);function r(i,u){f(this,r);var o=a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,i,u));return o.fontSize=!u.flat&&u.fontSize>u.width*10?u.width*10:u.fontSize,o.guardHeight=u.height+o.fontSize/2+u.textMargin,o}return s(r,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(u,o){return this.text.substr(u,o)}},{key:"leftEncode",value:function(u,o){return(0,c.default)(u,o)}},{key:"rightText",value:function(u,o){return this.text.substr(u,o)}},{key:"rightEncode",value:function(u,o){return(0,c.default)(u,o)}},{key:"encodeGuarded",value:function(){var u={fontSize:this.fontSize},o={height:this.guardHeight};return[{data:d.SIDE_BIN,options:o},{data:this.leftEncode(),text:this.leftText(),options:u},{data:d.MIDDLE_BIN,options:o},{data:this.rightEncode(),text:this.rightText(),options:u},{data:d.SIDE_BIN,options:o}]}},{key:"encodeFlat",value:function(){var u=[d.SIDE_BIN,this.leftEncode(),d.MIDDLE_BIN,this.rightEncode(),d.SIDE_BIN];return{data:u.join(""),text:this.text}}}]),r}(_.default);return ae.default=t,ae}var Ze;function ar(){if(Ze)return ie;Ze=1,Object.defineProperty(ie,"__esModule",{value:!0});var s=function(){function n(r,i){for(var u=0;u<i.length;u++){var o=i[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}return function(r,i,u){return i&&n(r.prototype,i),u&&n(r,u),r}}(),d=function n(r,i,u){r===null&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,i);if(o===void 0){var y=Object.getPrototypeOf(r);return y===null?void 0:n(y,i,u)}else{if("value"in o)return o.value;var p=o.get;return p===void 0?void 0:p.call(u)}},v=X(),c=$t(),h=_(c);function _(n){return n&&n.__esModule?n:{default:n}}function l(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function f(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function a(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var e=function(r){var i=r.substr(0,12).split("").map(function(u){return+u}).reduce(function(u,o,y){return y%2?u+o*3:u+o},0);return(10-i%10)%10},t=function(n){a(r,n);function r(i,u){l(this,r),i.search(/^[0-9]{12}$/)!==-1&&(i+=e(i));var o=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,i,u));return o.lastChar=u.lastChar,o}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===e(this.data)}},{key:"leftText",value:function(){return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var u=this.data.substr(1,6),o=v.EAN13_STRUCTURE[this.data[0]];return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"leftEncode",this).call(this,u,o)}},{key:"rightText",value:function(){return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var u=this.data.substr(7,6);return d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"rightEncode",this).call(this,u,"RRRRRR")}},{key:"encodeGuarded",value:function(){var u=d(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(u.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(u.push({data:"00"}),u.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),u}}]),r}(h.default);return ie.default=t,ie}var oe={},Ke;function ur(){if(Ke)return oe;Ke=1,Object.defineProperty(oe,"__esModule",{value:!0});var s=function(){function t(n,r){for(var i=0;i<r.length;i++){var u=r[i];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(n,u.key,u)}}return function(n,r,i){return r&&t(n.prototype,r),i&&t(n,i),n}}(),d=function t(n,r,i){n===null&&(n=Function.prototype);var u=Object.getOwnPropertyDescriptor(n,r);if(u===void 0){var o=Object.getPrototypeOf(n);return o===null?void 0:t(o,r,i)}else{if("value"in u)return u.value;var y=u.get;return y===void 0?void 0:y.call(i)}},v=$t(),c=h(v);function h(t){return t&&t.__esModule?t:{default:t}}function _(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function l(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:t}function f(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}var a=function(n){var r=n.substr(0,7).split("").map(function(i){return+i}).reduce(function(i,u,o){return o%2?i+u:i+u*3},0);return(10-r%10)%10},e=function(t){f(n,t);function n(r,i){return _(this,n),r.search(/^[0-9]{7}$/)!==-1&&(r+=a(r)),l(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r,i))}return s(n,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===a(this.data)}},{key:"leftText",value:function(){return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var i=this.data.substr(0,4);return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"leftEncode",this).call(this,i,"LLLL")}},{key:"rightText",value:function(){return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var i=this.data.substr(4,4);return d(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"rightEncode",this).call(this,i,"RRRR")}}]),n}(c.default);return oe.default=e,oe}var fe={},et;function or(){if(et)return fe;et=1,Object.defineProperty(fe,"__esModule",{value:!0});var s=function(){function r(i,u){for(var o=0;o<u.length;o++){var y=u[o];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(i,y.key,y)}}return function(i,u,o){return u&&r(i.prototype,u),o&&r(i,o),i}}(),d=X(),v=V(),c=l(v),h=T(),_=l(h);function l(r){return r&&r.__esModule?r:{default:r}}function f(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}function a(r,i){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:r}function e(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(r,i):r.__proto__=i)}var t=function(i){var u=i.split("").map(function(o){return+o}).reduce(function(o,y,p){return p%2?o+y*9:o+y*3},0);return u%10},n=function(r){e(i,r);function i(u,o){return f(this,i),a(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,u,o))}return s(i,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var o=d.EAN5_STRUCTURE[t(this.data)];return{data:"1011"+(0,c.default)(this.data,o,"01"),text:this.text}}}]),i}(_.default);return fe.default=n,fe}var ce={},tt;function fr(){if(tt)return ce;tt=1,Object.defineProperty(ce,"__esModule",{value:!0});var s=function(){function n(r,i){for(var u=0;u<i.length;u++){var o=i[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}return function(r,i,u){return i&&n(r.prototype,i),u&&n(r,u),r}}(),d=X(),v=V(),c=l(v),h=T(),_=l(h);function l(n){return n&&n.__esModule?n:{default:n}}function f(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function a(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function e(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var t=function(n){e(r,n);function r(i,u){return f(this,r),a(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,i,u))}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var u=d.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,c.default)(this.data,u,"01"),text:this.text}}}]),r}(_.default);return ce.default=t,ce}var N={},rt;function Nt(){if(rt)return N;rt=1,Object.defineProperty(N,"__esModule",{value:!0});var s=function(){function n(r,i){for(var u=0;u<i.length;u++){var o=i[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}return function(r,i,u){return i&&n(r.prototype,i),u&&n(r,u),r}}();N.checksum=t;var d=V(),v=_(d),c=T(),h=_(c);function _(n){return n&&n.__esModule?n:{default:n}}function l(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function f(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function a(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var e=function(n){a(r,n);function r(i,u){l(this,r),i.search(/^[0-9]{11}$/)!==-1&&(i+=t(i));var o=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,i,u));return o.displayValue=u.displayValue,u.fontSize>u.width*10?o.fontSize=u.width*10:o.fontSize=u.fontSize,o.guardHeight=u.height+o.fontSize/2+u.textMargin,o}return s(r,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var u="";return u+="101",u+=(0,v.default)(this.data.substr(0,6),"LLLLLL"),u+="01010",u+=(0,v.default)(this.data.substr(6,6),"RRRRRR"),u+="101",{data:u,text:this.text}}},{key:"guardedEncoding",value:function(){var u=[];return this.displayValue&&u.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),u.push({data:"101"+(0,v.default)(this.data[0],"L"),options:{height:this.guardHeight}}),u.push({data:(0,v.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),u.push({data:"01010",options:{height:this.guardHeight}}),u.push({data:(0,v.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),u.push({data:(0,v.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&u.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),u}}]),r}(h.default);function t(n){var r=0,i;for(i=1;i<11;i+=2)r+=parseInt(n[i]);for(i=0;i<11;i+=2)r+=parseInt(n[i])*3;return(10-r%10)%10}return N.default=e,N}var le={},nt;function cr(){if(nt)return le;nt=1,Object.defineProperty(le,"__esModule",{value:!0});var s=function(){function u(o,y){for(var p=0;p<y.length;p++){var g=y[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(o,g.key,g)}}return function(o,y,p){return y&&u(o.prototype,y),p&&u(o,p),o}}(),d=V(),v=l(d),c=T(),h=l(c),_=Nt();function l(u){return u&&u.__esModule?u:{default:u}}function f(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}function a(u,o){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o&&(typeof o=="object"||typeof o=="function")?o:u}function e(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof o);u.prototype=Object.create(o&&o.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(u,o):u.__proto__=o)}var t=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],n=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],r=function(u){e(o,u);function o(y,p){f(this,o);var g=a(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,y,p));if(g.isValid=!1,y.search(/^[0-9]{6}$/)!==-1)g.middleDigits=y,g.upcA=i(y,"0"),g.text=p.text||""+g.upcA[0]+y+g.upcA[g.upcA.length-1],g.isValid=!0;else if(y.search(/^[01][0-9]{7}$/)!==-1)if(g.middleDigits=y.substring(1,y.length-1),g.upcA=i(g.middleDigits,y[0]),g.upcA[g.upcA.length-1]===y[y.length-1])g.isValid=!0;else return a(g);else return a(g);return g.displayValue=p.displayValue,p.fontSize>p.width*10?g.fontSize=p.width*10:g.fontSize=p.fontSize,g.guardHeight=p.height+g.fontSize/2+p.textMargin,g}return s(o,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var p="";return p+="101",p+=this.encodeMiddleDigits(),p+="010101",{data:p,text:this.text}}},{key:"guardedEncoding",value:function(){var p=[];return this.displayValue&&p.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),p.push({data:"101",options:{height:this.guardHeight}}),p.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),p.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&p.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),p}},{key:"encodeMiddleDigits",value:function(){var p=this.upcA[0],g=this.upcA[this.upcA.length-1],w=n[parseInt(g)][parseInt(p)];return(0,v.default)(this.middleDigits,w)}}]),o}(h.default);function i(u,o){for(var y=parseInt(u[u.length-1]),p=t[y],g="",w=0,B=0;B<p.length;B++){var Y=p[B];Y==="X"?g+=u[w++]:g+=Y}return g=""+o+g,""+g+(0,_.checksum)(g)}return le.default=r,le}var it;function lr(){if(it)return R;it=1,Object.defineProperty(R,"__esModule",{value:!0}),R.UPCE=R.UPC=R.EAN2=R.EAN5=R.EAN8=R.EAN13=void 0;var s=ar(),d=r(s),v=ur(),c=r(v),h=or(),_=r(h),l=fr(),f=r(l),a=Nt(),e=r(a),t=cr(),n=r(t);function r(i){return i&&i.__esModule?i:{default:i}}return R.EAN13=d.default,R.EAN8=c.default,R.EAN5=_.default,R.EAN2=f.default,R.UPC=e.default,R.UPCE=n.default,R}var k={},de={},C={},at;function dr(){return at||(at=1,Object.defineProperty(C,"__esModule",{value:!0}),C.START_BIN="1010",C.END_BIN="11101",C.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),C}var ut;function Gt(){if(ut)return de;ut=1,Object.defineProperty(de,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=dr(),v=T(),c=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(){return _(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var r=this,i=this.data.match(/.{2}/g).map(function(u){return r.encodePair(u)}).join("");return{data:d.START_BIN+i+d.END_BIN,text:this.text}}},{key:"encodePair",value:function(r){var i=d.BINARIES[r[1]];return d.BINARIES[r[0]].split("").map(function(u,o){return(u==="1"?"111":"1")+(i[o]==="1"?"000":"0")}).join("")}}]),t}(c.default);return de.default=a,de}var he={},ot;function hr(){if(ot)return he;ot=1,Object.defineProperty(he,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=Gt(),v=c(d);function c(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(t){var n=t.substr(0,13).split("").map(function(r){return parseInt(r,10)}).reduce(function(r,i,u){return r+i*(3-u%2*2)},0);return Math.ceil(n/10)*10-n},a=function(e){l(t,e);function t(n,r){return h(this,t),n.search(/^[0-9]{13}$/)!==-1&&(n+=f(n)),_(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r))}return s(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===f(this.data)}}]),t}(v.default);return he.default=a,he}var ft;function vr(){if(ft)return k;ft=1,Object.defineProperty(k,"__esModule",{value:!0}),k.ITF14=k.ITF=void 0;var s=Gt(),d=h(s),v=hr(),c=h(v);function h(_){return _&&_.__esModule?_:{default:_}}return k.ITF=d.default,k.ITF14=c.default,k}var A={},ve={},ct;function J(){if(ct)return ve;ct=1,Object.defineProperty(ve,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=T(),v=c(d);function c(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(e){l(t,e);function t(n,r){return h(this,t),_(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r))}return s(t,[{key:"encode",value:function(){for(var r="110",i=0;i<this.data.length;i++){var u=parseInt(this.data[i]),o=u.toString(2);o=a(o,4-o.length);for(var y=0;y<o.length;y++)r+=o[y]=="0"?"100":"110"}return r+="1001",{data:r,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),t}(v.default);function a(e,t){for(var n=0;n<t;n++)e="0"+e;return e}return ve.default=f,ve}var _e={},G={},lt;function ke(){if(lt)return G;lt=1,Object.defineProperty(G,"__esModule",{value:!0}),G.mod10=s,G.mod11=d;function s(v){for(var c=0,h=0;h<v.length;h++){var _=parseInt(v[h]);(h+v.length)%2===0?c+=_:c+=_*2%10+Math.floor(_*2/10)}return(10-c%10)%10}function d(v){for(var c=0,h=[2,3,4,5,6,7],_=0;_<v.length;_++){var l=parseInt(v[v.length-1-_]);c+=h[_%h.length]*l}return(11-c%11)%11}return G}var dt;function _r(){if(dt)return _e;dt=1,Object.defineProperty(_e,"__esModule",{value:!0});var s=J(),d=c(s),v=ke();function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,v.mod10)(t),n))}return e}(d.default);return _e.default=f,_e}var se={},ht;function sr(){if(ht)return se;ht=1,Object.defineProperty(se,"__esModule",{value:!0});var s=J(),d=c(s),v=ke();function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,v.mod11)(t),n))}return e}(d.default);return se.default=f,se}var ye={},vt;function yr(){if(vt)return ye;vt=1,Object.defineProperty(ye,"__esModule",{value:!0});var s=J(),d=c(s),v=ke();function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){return h(this,e),t+=(0,v.mod10)(t),t+=(0,v.mod10)(t),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(d.default);return ye.default=f,ye}var pe={},_t;function pr(){if(_t)return pe;_t=1,Object.defineProperty(pe,"__esModule",{value:!0});var s=J(),d=c(s),v=ke();function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){return h(this,e),t+=(0,v.mod11)(t),t+=(0,v.mod10)(t),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(d.default);return pe.default=f,pe}var st;function gr(){if(st)return A;st=1,Object.defineProperty(A,"__esModule",{value:!0}),A.MSI1110=A.MSI1010=A.MSI11=A.MSI10=A.MSI=void 0;var s=J(),d=t(s),v=_r(),c=t(v),h=sr(),_=t(h),l=yr(),f=t(l),a=pr(),e=t(a);function t(n){return n&&n.__esModule?n:{default:n}}return A.MSI=d.default,A.MSI10=c.default,A.MSI11=_.default,A.MSI1010=f.default,A.MSI1110=e.default,A}var F={},yt;function Or(){if(yt)return F;yt=1,Object.defineProperty(F,"__esModule",{value:!0}),F.pharmacode=void 0;var s=function(){function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}}(),d=T(),v=c(d);function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){h(this,e);var r=_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return s(e,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(v.default);return F.pharmacode=f,F}var H={},pt;function Er(){if(pt)return H;pt=1,Object.defineProperty(H,"__esModule",{value:!0}),H.codabar=void 0;var s=function(){function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}}(),d=T(),v=c(d);function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){h(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var r=_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return s(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),i=0;i<this.data.length;i++)n.push(r[this.data.charAt(i)]),i!==this.data.length-1&&n.push("0");return{text:this.text,data:n.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}(v.default);return H.codabar=f,H}var q={},ge={},j={},gt;function br(){return gt||(gt=1,Object.defineProperty(j,"__esModule",{value:!0}),j.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","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],j.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"],j.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"]}),j}var Ot;function Ft(){if(Ot)return ge;Ot=1,Object.defineProperty(ge,"__esModule",{value:!0});var s=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=br(),v=T(),c=h(v);function h(e){return e&&e.__esModule?e:{default:e}}function _(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 f(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(e){f(t,e);function t(n,r){return _(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n,r))}return s(t,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.data.split("").flatMap(function(y){return d.MULTI_SYMBOLS[y]||y}),i=r.map(function(y){return t.getEncoding(y)}).join(""),u=t.checksum(r,20),o=t.checksum(r.concat(u),15);return{text:this.text,data:t.getEncoding("ÿ")+i+t.getEncoding(u)+t.getEncoding(o)+t.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(r){return d.BINARIES[t.symbolValue(r)]}},{key:"getSymbol",value:function(r){return d.SYMBOLS[r]}},{key:"symbolValue",value:function(r){return d.SYMBOLS.indexOf(r)}},{key:"checksum",value:function(r,i){var u=r.slice().reverse().reduce(function(o,y,p){var g=p%i+1;return o+t.symbolValue(y)*g},0);return t.getSymbol(u%47)}}]),t}(c.default);return ge.default=a,ge}var Oe={},Et;function mr(){if(Et)return Oe;Et=1,Object.defineProperty(Oe,"__esModule",{value:!0});var s=function(){function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}}(),d=Ft(),v=c(d);function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return s(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(v.default);return Oe.default=f,Oe}var bt;function wr(){if(bt)return q;bt=1,Object.defineProperty(q,"__esModule",{value:!0}),q.CODE93FullASCII=q.CODE93=void 0;var s=Ft(),d=h(s),v=mr(),c=h(v);function h(_){return _&&_.__esModule?_:{default:_}}return q.CODE93=d.default,q.CODE93FullASCII=c.default,q}var U={},mt;function Sr(){if(mt)return U;mt=1,Object.defineProperty(U,"__esModule",{value:!0}),U.GenericBarcode=void 0;var s=function(){function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}}(),d=T(),v=c(d);function c(a){return a&&a.__esModule?a:{default:a}}function h(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 l(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 f=function(a){l(e,a);function e(t,n){return h(this,e),_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return s(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(v.default);return U.GenericBarcode=f,U}var wt;function xr(){if(wt)return Q;wt=1,Object.defineProperty(Q,"__esModule",{value:!0});var s=Zt(),d=ir(),v=lr(),c=vr(),h=gr(),_=Or(),l=Er(),f=wr(),a=Sr();return Q.default={CODE39:s.CODE39,CODE128:d.CODE128,CODE128A:d.CODE128A,CODE128B:d.CODE128B,CODE128C:d.CODE128C,EAN13:v.EAN13,EAN8:v.EAN8,EAN5:v.EAN5,EAN2:v.EAN2,UPC:v.UPC,UPCE:v.UPCE,ITF14:c.ITF14,ITF:c.ITF,MSI:h.MSI,MSI10:h.MSI10,MSI11:h.MSI11,MSI1010:h.MSI1010,MSI1110:h.MSI1110,pharmacode:_.pharmacode,codabar:l.codabar,CODE93:f.CODE93,CODE93FullASCII:f.CODE93FullASCII,GenericBarcode:a.GenericBarcode},Q}var Ee={},St;function qe(){if(St)return Ee;St=1,Object.defineProperty(Ee,"__esModule",{value:!0});var s=Object.assign||function(d){for(var v=1;v<arguments.length;v++){var c=arguments[v];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(d[h]=c[h])}return d};return Ee.default=function(d,v){return s({},d,v)},Ee}var be={},xt;function Rr(){if(xt)return be;xt=1,Object.defineProperty(be,"__esModule",{value:!0}),be.default=s;function s(d){var v=[];function c(h){if(Array.isArray(h))for(var _=0;_<h.length;_++)c(h[_]);else h.text=h.text||"",h.data=h.data||"",v.push(h)}return c(d),v}return be}var me={},Rt;function Ar(){if(Rt)return me;Rt=1,Object.defineProperty(me,"__esModule",{value:!0}),me.default=s;function s(d){return d.marginTop=d.marginTop||d.margin,d.marginBottom=d.marginBottom||d.margin,d.marginRight=d.marginRight||d.margin,d.marginLeft=d.marginLeft||d.margin,d}return me}var we={},Se={},xe={},At;function Ht(){if(At)return xe;At=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.default=s;function s(d){var v=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var c in v)v.hasOwnProperty(c)&&(c=v[c],typeof d[c]=="string"&&(d[c]=parseInt(d[c],10)));return typeof d.displayValue=="string"&&(d.displayValue=d.displayValue!="false"),d}return xe}var Re={},Pt;function Ut(){if(Pt)return Re;Pt=1,Object.defineProperty(Re,"__esModule",{value:!0});var s={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 Re.default=s,Re}var Tt;function Pr(){if(Tt)return Se;Tt=1,Object.defineProperty(Se,"__esModule",{value:!0});var s=Ht(),d=h(s),v=Ut(),c=h(v);function h(l){return l&&l.__esModule?l:{default:l}}function _(l){var f={};for(var a in c.default)c.default.hasOwnProperty(a)&&(l.hasAttribute("jsbarcode-"+a.toLowerCase())&&(f[a]=l.getAttribute("jsbarcode-"+a.toLowerCase())),l.hasAttribute("data-"+a.toLowerCase())&&(f[a]=l.getAttribute("data-"+a.toLowerCase())));return f.value=l.getAttribute("jsbarcode-value")||l.getAttribute("data-value"),f=(0,d.default)(f),f}return Se.default=_,Se}var Ae={},Pe={},P={},Mt;function zt(){if(Mt)return P;Mt=1,Object.defineProperty(P,"__esModule",{value:!0}),P.getTotalWidthOfEncodings=P.calculateEncodingAttributes=P.getBarcodePadding=P.getEncodingHeight=P.getMaximumHeightOfEncodings=void 0;var s=qe(),d=v(s);function v(e){return e&&e.__esModule?e:{default:e}}function c(e,t){return t.height+(t.displayValue&&e.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function h(e,t,n){if(n.displayValue&&t<e){if(n.textAlign=="center")return Math.floor((e-t)/2);if(n.textAlign=="left")return 0;if(n.textAlign=="right")return Math.floor(e-t)}return 0}function _(e,t,n){for(var r=0;r<e.length;r++){var i=e[r],u=(0,d.default)(t,i.options),o;u.displayValue?o=a(i.text,u,n):o=0;var y=i.data.length*u.width;i.width=Math.ceil(Math.max(o,y)),i.height=c(i,u),i.barcodePadding=h(o,y,u)}}function l(e){for(var t=0,n=0;n<e.length;n++)t+=e[n].width;return t}function f(e){for(var t=0,n=0;n<e.length;n++)e[n].height>t&&(t=e[n].height);return t}function a(e,t,n){var r;if(n)r=n;else if(typeof document<"u")r=document.createElement("canvas").getContext("2d");else return 0;r.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var i=r.measureText(e);if(!i)return 0;var u=i.width;return u}return P.getMaximumHeightOfEncodings=f,P.getEncodingHeight=c,P.getBarcodePadding=h,P.calculateEncodingAttributes=_,P.getTotalWidthOfEncodings=l,P}var It;function Tr(){if(It)return Pe;It=1,Object.defineProperty(Pe,"__esModule",{value:!0});var s=function(){function f(a,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}return function(a,e,t){return e&&f(a.prototype,e),t&&f(a,t),a}}(),d=qe(),v=h(d),c=zt();function h(f){return f&&f.__esModule?f:{default:f}}function _(f,a){if(!(f instanceof a))throw new TypeError("Cannot call a class as a function")}var l=function(){function f(a,e,t){_(this,f),this.canvas=a,this.encodings=e,this.options=t}return s(f,[{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,v.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,c.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,c.getTotalWidthOfEncodings)(this.encodings),n=(0,c.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,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 n=this.canvas.getContext("2d"),r=t.data,i;e.textPosition=="top"?i=e.marginTop+e.fontSize+e.textMargin:i=e.marginTop,n.fillStyle=e.lineColor;for(var u=0;u<r.length;u++){var o=u*e.width+t.barcodePadding;r[u]==="1"?n.fillRect(o,i,e.width,e.height):r[u]&&n.fillRect(o,i,e.width,e.height*r[u])}}},{key:"drawCanvasText",value:function(e,t){var n=this.canvas.getContext("2d"),r=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var i,u;e.textPosition=="top"?u=e.marginTop+e.fontSize-e.textMargin:u=e.height+e.textMargin+e.marginTop+e.fontSize,n.font=r,e.textAlign=="left"||t.barcodePadding>0?(i=0,n.textAlign="left"):e.textAlign=="right"?(i=t.width-1,n.textAlign="right"):(i=t.width/2,n.textAlign="center"),n.fillText(t.text,i,u)}}},{key:"moveCanvasDrawing",value:function(e){var t=this.canvas.getContext("2d");t.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),f}();return Pe.default=l,Pe}var Te={},Dt;function Mr(){if(Dt)return Te;Dt=1,Object.defineProperty(Te,"__esModule",{value:!0});var s=function(){function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}}(),d=qe(),v=h(d),c=zt();function h(a){return a&&a.__esModule?a:{default:a}}function _(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}var l="http://www.w3.org/2000/svg",f=function(){function a(e,t,n){_(this,a),this.svg=e,this.encodings=t,this.options=n,this.document=n.xmlDocument||document}return s(a,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],i=(0,v.default)(this.options,r.options),u=this.createGroup(t,i.marginTop,this.svg);this.setGroupOptions(u,i),this.drawSvgBarcode(u,i,r),this.drawSVGText(u,i,r),t+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,c.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,c.getTotalWidthOfEncodings)(this.encodings),n=(0,c.getMaximumHeightOfEncodings)(this.encodings),r=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(t,n,r){var i=r.data,u;n.textPosition=="top"?u=n.fontSize+n.textMargin:u=0;for(var o=0,y=0,p=0;p<i.length;p++)y=p*n.width+r.barcodePadding,i[p]==="1"?o++:o>0&&(this.drawRect(y-n.width*o,u,n.width*o,n.height,t),o=0);o>0&&this.drawRect(y-n.width*(o-1),u,n.width*o,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var i=this.document.createElementNS(l,"text");if(n.displayValue){var u,o;i.setAttribute("font-family",n.font),i.setAttribute("font-size",n.fontSize),n.fontOptions.includes("bold")&&i.setAttribute("font-weight","bold"),n.fontOptions.includes("italic")&&i.setAttribute("font-style","italic"),n.textPosition=="top"?o=n.fontSize-n.textMargin:o=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(u=0,i.setAttribute("text-anchor","start")):n.textAlign=="right"?(u=r.width-1,i.setAttribute("text-anchor","end")):(u=r.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",u),i.setAttribute("y",o),i.appendChild(this.document.createTextNode(r.text)),t.appendChild(i)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",l),r.setAttribute("version","1.1")}},{key:"createGroup",value:function(t,n,r){var i=this.document.createElementNS(l,"g");return i.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(i),i}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("fill",n.lineColor)}},{key:"drawRect",value:function(t,n,r,i,u){var o=this.document.createElementNS(l,"rect");return o.setAttribute("x",t),o.setAttribute("y",n),o.setAttribute("width",r),o.setAttribute("height",i),u.appendChild(o),o}}]),a}();return Te.default=f,Te}var Me={},kt;function Ir(){if(kt)return Me;kt=1,Object.defineProperty(Me,"__esModule",{value:!0});var s=function(){function c(h,_){for(var l=0;l<_.length;l++){var f=_[l];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}return function(h,_,l){return _&&c(h.prototype,_),l&&c(h,l),h}}();function d(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}var v=function(){function c(h,_,l){d(this,c),this.object=h,this.encodings=_,this.options=l}return s(c,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),c}();return Me.default=v,Me}var qt;function Dr(){if(qt)return Ae;qt=1,Object.defineProperty(Ae,"__esModule",{value:!0});var s=Tr(),d=l(s),v=Mr(),c=l(v),h=Ir(),_=l(h);function l(f){return f&&f.__esModule?f:{default:f}}return Ae.default={CanvasRenderer:d.default,SVGRenderer:c.default,ObjectRenderer:_.default},Ae}var L={},Bt;function Xt(){if(Bt)return L;Bt=1,Object.defineProperty(L,"__esModule",{value:!0});function s(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}function d(l,f){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:l}function v(l,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);l.prototype=Object.create(f&&f.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(l,f):l.__proto__=f)}var c=function(l){v(f,l);function f(a,e){s(this,f);var t=d(this,(f.__proto__||Object.getPrototypeOf(f)).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 f}(Error),h=function(l){v(f,l);function f(){s(this,f);var a=d(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return a.name="InvalidElementException",a.message="Not supported type to render on",a}return f}(Error),_=function(l){v(f,l);function f(){s(this,f);var a=d(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return a.name="NoElementException",a.message="No element to render on.",a}return f}(Error);return L.InvalidInputException=c,L.InvalidElementException=h,L.NoElementException=_,L}var Ct;function kr(){if(Ct)return we;Ct=1,Object.defineProperty(we,"__esModule",{value:!0});var s=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},d=Pr(),v=l(d),c=Dr(),h=l(c),_=Xt();function l(t){return t&&t.__esModule?t:{default:t}}function f(t){if(typeof t=="string")return a(t);if(Array.isArray(t)){for(var n=[],r=0;r<t.length;r++)n.push(f(t[r]));return n}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,v.default)(t),renderer:h.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,v.default)(t),renderer:h.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:h.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":s(t))==="object"&&!t.nodeName)return{element:t,renderer:h.default.ObjectRenderer};throw new _.InvalidElementException}}function a(t){var n=document.querySelectorAll(t);if(n.length!==0){for(var r=[],i=0;i<n.length;i++)r.push(f(n[i]));return r}}function e(t){var n=document.createElement("canvas");return{element:n,options:(0,v.default)(t),renderer:h.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",n.toDataURL())}}}return we.default=f,we}var Ie={},jt;function qr(){if(jt)return Ie;jt=1,Object.defineProperty(Ie,"__esModule",{value:!0});var s=function(){function c(h,_){for(var l=0;l<_.length;l++){var f=_[l];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}return function(h,_,l){return _&&c(h.prototype,_),l&&c(h,l),h}}();function d(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}var v=function(){function c(h){d(this,c),this.api=h}return s(c,[{key:"handleCatch",value:function(_){if(_.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw _.message;else throw _;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(_){try{var l=_.apply(void 0,arguments);return this.api._options.valid(!0),l}catch(f){return this.handleCatch(f),this.api}}}]),c}();return Ie.default=v,Ie}var Ce,Lt;function Br(){if(Lt)return Ce;Lt=1;var s=xr(),d=p(s),v=qe(),c=p(v),h=Rr(),_=p(h),l=Ar(),f=p(l),a=kr(),e=p(a),t=Ht(),n=p(t),r=qr(),i=p(r),u=Xt(),o=Ut(),y=p(o);function p(O){return O&&O.__esModule?O:{default:O}}var g=function(){},w=function(b,x,E){var m=new g;if(typeof b>"u")throw Error("No element to render on was provided.");return m._renderProperties=(0,e.default)(b),m._encodings=[],m._options=y.default,m._errorHandler=new i.default(m),typeof x<"u"&&(E=E||{},E.format||(E.format=Le()),m.options(E)[E.format](x,E).render()),m};w.getModule=function(O){return d.default[O]};for(var B in d.default)d.default.hasOwnProperty(B)&&Y(d.default,B);function Y(O,b){g.prototype[b]=g.prototype[b.toUpperCase()]=g.prototype[b.toLowerCase()]=function(x,E){var m=this;return m._errorHandler.wrapBarcodeCall(function(){E.text=typeof E.text>"u"?void 0:""+E.text;var M=(0,c.default)(m._options,E);M=(0,n.default)(M);var Jt=O[b],Yt=je(x,Jt,M);return m._encodings.push(Yt),m})}}function je(O,b,x){O=""+O;var E=new b(O,x);if(!E.valid())throw new u.InvalidInputException(E.constructor.name,O);var m=E.encode();m=(0,_.default)(m);for(var M=0;M<m.length;M++)m[M].options=(0,c.default)(x,m[M].options);return m}function Le(){return d.default.CODE128?"CODE128":Object.keys(d.default)[0]}g.prototype.options=function(O){return this._options=(0,c.default)(this._options,O),this},g.prototype.blank=function(O){var b=new Array(O+1).join("0");return this._encodings.push({data:b}),this},g.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var O;for(var b in this._renderProperties){O=this._renderProperties[b];var x=(0,c.default)(this._options,O.options);x.format=="auto"&&(x.format=Le()),this._errorHandler.wrapBarcodeCall(function(){var E=x.value,m=d.default[x.format.toUpperCase()],M=je(E,m,x);Be(O,M,x)})}}},g.prototype.render=function(){if(!this._renderProperties)throw new u.NoElementException;if(Array.isArray(this._renderProperties))for(var O=0;O<this._renderProperties.length;O++)Be(this._renderProperties[O],this._encodings,this._options);else Be(this._renderProperties,this._encodings,this._options);return this},g.prototype._defaults=y.default;function Be(O,b,x){b=(0,_.default)(b);for(var E=0;E<b.length;E++)b[E].options=(0,c.default)(x,b[E].options),(0,f.default)(b[E].options);(0,f.default)(x);var m=O.renderer,M=new m(O.element,b,x);M.render(),O.afterRender&&O.afterRender()}return typeof window<"u"&&(window.JsBarcode=w),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(O,b){var x=[];return jQuery(this).each(function(){x.push(this)}),w(x,O,b)}),Ce=w,Ce}var Vt=Br();const Cr=Qt.getDefaultExportFromCjs(Vt),jr=Wt({__proto__:null,default:Cr},[Vt]);exports.JsBarcode=jr;